David Sainty
2009-Jan-15 01:28 UTC
[Xapian-devel] Xapian core build failure under gcc 2.95
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
David Sainty
2009-Jan-15 03:53 UTC
[Xapian-devel] Xapian core build failure under gcc 2.95
David Sainty wrote:> Hi, > > Under gcc 2.95 Xapian fails to build like so:I can confirm that the attached patch fixes the build under gcc 2.95 (after an automake). Cheers, Dave -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: xapian-gcc-295 URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments/20090115/cbdc4c91/attachment.ksh>
On Thu, Jan 15, 2009 at 04:53:52PM +1300, David Sainty wrote:> David Sainty wrote: > >Under gcc 2.95 Xapian fails to build like so: > > I can confirm that the attached patch fixes the build under gcc 2.95 > (after an automake).Thanks for the patch. But it seems there's something odd going on, as other subdirectories also include headers from the same directory without an explicit -I. The files here are generated, but that shouldn't make a difference as they are shipped in the tarball and it appears you're building from the 1.0.10 source tarball. Perhaps the issue is the "#line" directives with full paths in queryparser_internal.cc - if GCC 2.95 resolves header includes relative to the filename given by "#line" then that would cause this problem. Could you try: perl -pi -e 's/^#line.*//' queryparser/queryparser_internal.cc And then building without your patch. (Unfortunately I no longer have access to GCC 2.95 to test this myself). Another question - what's the reason for using GCC 2.95? We came quite closing to dropping support for GCC < 3 a while back (but instead we ended up requiring 2.95.3 which added <sstream>). But I'd assumed that 2.95 was probably no longer used by now, and there are a few minor issues we currently work around to keep support for it, so if there are still people using it I'm interested as to why. Cheers, Olly
Possibly Parallel Threads
- Xapian .lemony files
- How to enable stemming with default_op set to OP_NEAR
- [PATCH] Add set_max_wildcard_expansion method to the queryparser.
- xapian-0.9.4 queryparser build errors after applying utf-8 patch
- build error : xapian-core-0.9.4_svn6707 with UTF-8 patch