[Xapian-devel] Re: [Xapian-commits] 7990:trunk/xapian-core/trunk/xapian-core/bin/trunk/xapian-core/tests/harness/

Mark Hammond mhammond at skippinet.com.au
Mon Apr 2 03:51:51 BST 2007


Olly:
> We already have a mechanism for this (`SOCKLEN_T') which
> should be used
> instead.  On UNIX, configure probes and generates config.h
> with a #define
> of SOCKLEN_T to `int' or `socklen_t' as appropriate.
>
> The hand-written config.h.win32 erroneously had "#define SOCKLEN_T
> socklen_t" (which previously didn't matter of course) so I had fixed
> that and removed the typedef.  I suspect Mark hadn't updated
> to the new config.h.win32.

Oops - yes, my apologies, that is almost certainly what happened.  The trunk
now builds for me - thanks.

In my feeble defense though, the current win32 build process is fairly error
prone.  It requires you to manually copy files from one directory to
another, then start the build process, which itself then copies those files
into yet other directories.  This first manual step is easy to forget, and
would seem to work against a tinderbox type system working for windows
out-of-the-box.

Is there a reason for the intermediate 'xapian-core/win32' directory?  Is
there any reason we can't tweak the top-level makefile to copy the files
directly from xapian-maintainer-tools/win32msvc directory directly into the
xapian-core tree, and thereby allowing the make process to run directly from
the source of the makefiles?

And while on this topic, it did take me some time to work out how to get
started building on Windows.  I'd like to suggest a patch similar to the
following to help MSVC builders who follow (but obviously the text would
change if we tweaked the build process as described above.)

Index: HACKING
===================================================================
--- HACKING     (revision 8055)
+++ HACKING     (working copy)
@@ -50,6 +50,23 @@

 ./configure CC_FOR_BUILD=/opt/bin/gcc

+Building on Windows with MSVC
+==================================
+
+The windows build process is maintained in the
+../xapian-maintainer-tools/win32msvc directory - please see the README file
+in that directory, but the short story is:
+
+* Copy all files from that folder into a (new) xapian-core/win32 directory.
+* Change to that new directory.
+* Edit config.mak, updating the necessary variables to point to the tools
+  required by the build process.  For example, the PERL_DIR variable will
+  need to reflect where perl is installed locally.
+* Ensure your MSVC build environment is setup correctly.
+* Execute 'nmake -f win32.mak'
+
+The world should then build.
+
 Debugging Messages
 ==================

Similarly, a note mentioning how to build on wingw would be good - I assume
that is basically "install mingw, install cygwin, then do the configure/make
dance like all other platforms", but as I've never tried that, I haven't
included specific text.  Alternatively, a new xapian-core/WINDOWS file might
be more appropriate.

Cheers,

Mark




More information about the Xapian-devel mailing list