[Xapian-devel] Starting to work for xapian

Olly Betts olly at survex.com
Thu Mar 1 06:43:57 GMT 2012


On Tue, Feb 28, 2012 at 09:54:36PM +0530, Rajan Walia wrote:
> So for replacing this with OpenBSD getopt are we going to statically
> compile the newer one and replace the gnu getopt completely (also the
> GNU C Library one) and for that I will have to change the files in
> xapian-core/common/getopt.cc right?

There's certainly an argument for using the same implementation
everywhere, but there's also one for using the C library implementation
where there is one.  If GNU getopt and OpenBSD getopt are API
compatible, I'm not sure what is best to do.

Also, presumably on OpenBSD their getopt implementation is available in
libc, so we probably don't want to use a bundled version there.

> And also currently the getopt.cc is modified by Olly for compilation
> with C++, so what will be the right path for me to go ahead?

Currently we compile all the C code as C++ (aside from tools using
only during the build, like lemon and snowmall).  In some cases we
need to tweak the C code a little to get this to work.

The main reason we went this route was that on some platforms configure
could end up picking an incompatible C and C++ compiler combination by
default.  We were running a lot of automated builds, and trying to stop
them doing this without manual intervention was a pain.  That may not
really be an issue now, so compiling C code as C is probably OK if
that's easier.

> I have compiled the source from the bleeding edge git repo and have
> also familiarized myself with the usage of gnu getopt by building a
> sample application.

Cool.

Cheers,
    Olly



More information about the Xapian-devel mailing list