Eric Lindblad
2015-Sep-14 00:20 UTC
xapian-core-1.2.21 ported to Interix / 'gmake check' compile error
Report by Eric Lindblad 13-09-2015 http://www.ericlindblad.blogspot.com cf: http://comments.gmane.org/gmane.comp.search.xapian.general/9862 I ported xapian-core-1.2.21 to Interix today having disabled the default chert and development brass backends, using flint, which was the 1.0.x series' default, which ships with the 1.2.x series; the disabling do to an unresolved 'ambiguous overload' error encountered when compiling those backends. Running 'gmake check' however I right away encountered an error: ../../tests/api_backend.cc: In function `bool test_phrasebug1()': ../../tests/api_backend.cc:951: error: `q' undeclared (first use this function) ../../tests/api_backend.cc:951: error: (Each undeclared identifier is reported only once for each function it appears in.) 'htons' needed to be defined, which on Interix is in /usr/include/arpa/inet.h and /net/tcpclient.cc was modified as adding #include <arpa/inet.h> #include <cmath> #include <cstring> #ifndef __WIN32__ # include "safenetdb.h" # include <netinet/in.h> # include <netinet/tcp.h> # include <arpa/inet.h> # include <sys/socket.h> #else # include "safewinsock2.h" #endif perhaps there is a better location to add '#include <arpa/inet.h>' as in an #ifdef __INTERIX located in tcpclient.h or in safenetdb.h #ifdef __INTERIX #include <arpa/inet.h> #endif note safenetdb.h is found in both /net/tcpclient.cc and /net/tcpserver.cc curious but tcpserver.cc has the line #include <arpa/inet.h> or, perhaps xapian support for minority platforms should not be incorporated. cf: http://bugs.python.org/issue11937 comment by M. v. L?wis
Olly Betts
2015-Sep-14 00:50 UTC
xapian-core-1.2.21 ported to Interix / 'gmake check' compile error
On Sun, Sep 13, 2015 at 05:20:01PM -0700, Eric Lindblad wrote:> I ported xapian-core-1.2.21 to Interix today having disabled the > default chert and development brass backends, using flint, which > was the 1.0.x series' default, which ships with the 1.2.x series; > the disabling do to an unresolved 'ambiguous overload' error > encountered when compiling those backends.You probably realise this, but 1.2.x with just flint support is of somewhat limited use. It sounds like you've reached a milestone though.> Running 'gmake check' however I right away encountered an error: > ../../tests/api_backend.cc: In function `bool test_phrasebug1()': > ../../tests/api_backend.cc:951: error: `q' undeclared (first use this function) > ../../tests/api_backend.cc:951: error: (Each undeclared identifier is reported > only once for each function it appears in.)Does changing "q.OP_PHRASE" to "Xapian::Query::OP_PHRASE" help?> 'htons' needed to be defined, which on Interix is in /usr/include/arpa/inet.h > and /net/tcpclient.cc was modified as adding #include <arpa/inet.h>We should be including that header for all Unix platforms. I guess most include it implicitly from another header so mostly we get away without it. Committed this fix to the 1.2 branch. In git master this code has been replaced with getaddrinfo(), so the patch isn't needed there.> or, perhaps xapian support for minority platforms should not be incorporated.I can't feasibly fix issues with platforms I don't have access to, but I'm happy to apply clean patches for portability to any platform. Cheers, Olly