[Xapian-devel] Xapian core build failure under gcc 2.95
David Sainty
david.sainty at dtsp.co.nz
Thu Jan 15 01:28:34 GMT 2009
Hi,
Under gcc 2.95 Xapian fails to build like so:
g++ -DHAVE_CONFIG_H -I. -I./common -I./include
-I/home/dsainty/not-backed-up/pkgsrc/textproc/xapian/work/.buildlink/include
-Wall -W -Wredundant-decls -Wpointer-arith -Wcast-qual -Wcast-align
-Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -O2 -c
queryparser/queryparser_internal.cc
-Wp,-MD,queryparser/.deps/queryparser_internal.TPlo -fPIC -DPIC -o
queryparser/.libs/queryparser_internal.o
/data/home/olly/tmp/xapian-svn-snapshot/tags/1.0.10/xapian/xapian-core/queryparser/queryparser.lemony:25:
queryparser_internal.h: No such file or directory
/data/home/olly/tmp/xapian-svn-snapshot/tags/1.0.10/xapian/xapian-core/queryparser/queryparser.lemony:31:
queryparser_token.h: No such file or directory
*** Error code 1
The problem seems to be that the build system is relying on the compiler
to imply -Iqueryparser when the source file is
queryparser/queryparser_internal.cc. Modern gcc makes this implication,
gcc 2.95 doesn't.
queryparser/Makefile.mk has an almost-solution there already, but it's
conditionally disabled.
if VPATH_BUILD
# We need this so that generated sources can find non-generated
headers in a
# VPATH build from SVN.
INCLUDES += -I$(top_srcdir)/queryparser
if MAINTAINER_MODE
# We need this because otherwise, if depcomp is being used (as it will
be for a
# build with gcc-2.95), depcomp will be unable to find
queryparser_token.h.
# This may be a bug in depcomp, but it certainly happens with
automake-1.10.
INCLUDES += -I$(top_builddir)/queryparser
endif
endif
If instead it unconditionally set: INCLUDES += -I$(top_builddir)/queryparser
... regardless of flags, that should fix the build on old GCC and
perhaps some other non-GCC compilers, and would make it clearer what is
happening for those people like me that still find the newer GCC
behaviour a little odd :)
(Please CC: email, I'm not on the list)
Cheers,
Dave
More information about the Xapian-devel
mailing list