[Xapian-devel] msvc trunk breakage

Charlie Hull charlie at juggler.net
Mon Apr 23 11:45:21 BST 2007


Richard Boulton wrote:
> Mark Hammond wrote:
>> Hi all,
>>   I'm running out of time tonight, but I thought I would fire off this 
>> patch
>> to the MSVC makefiles, which should get things building again 
>> (assuming you
>> have a built zlib static library hanging around).  I'll try and get to
>> Olly's (private) request regarding buildbot and cygwin as I get time over
>> the next few days.
> 
> I've applied this.  We need to put something in the README to document 
> the need for zlib, but I'll let someone with more knowledge of windows 
> write that.
> 
Done, and patch attached. Note this also fixes a small issue in 
safeunistd.h (because Zlib has its own unistd.h). I've also fixed the 
paths in config.mak to match the paths created by the recommended binary 
installer for Zlib.

Charlie
-------------- next part --------------
Index: xapian-core/common/safeunistd.h
===================================================================
--- xapian-core/common/safeunistd.h	(revision 8358)
+++ xapian-core/common/safeunistd.h	(working copy)
@@ -49,12 +49,13 @@
 # define lseek(FD, OFF, WHENCE) _lseeki64(FD, OFF, WHENCE)
 # define off_t __int64
 
-// MSVC needs safewindows.h to get SSIZE_T defined.  We also need it for
-// GetCurrentProcessId().
+// MSVC needs safewindows.h to get SSIZE_T defined.  process.h is needed for 
+// getpid()
 # include "safewindows.h"
 # define ssize_t SSIZE_T
-# define getpid() GetCurrentProcessId()
+#include <process.h>
 
+
 #endif
 
 #endif /* XAPIAN_INCLUDED_SAFEUNISTD_H */
Index: xapian-maintainer-tools/win32msvc/config.mak
===================================================================
--- xapian-maintainer-tools/win32msvc/config.mak	(revision 8356)
+++ xapian-maintainer-tools/win32msvc/config.mak	(working copy)
@@ -94,7 +94,7 @@
 # ------------end SWIG settings-------------
 
 # ------------ Misc external libraries we depend on -------------
-ZLIB_DIR=c:\src\zlib-1.2.3
+ZLIB_DIR=C:\Program Files\GnuWin32
 
 #--------------------------------------
 # Visual C++ Compiler and linker programs, and flags for these
@@ -105,7 +105,7 @@
 LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib\
  advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib \
  wsock32.lib Ws2_32.lib  odbccp32.lib /subsystem:console /debug /nologo \
- $(ZLIB_DIR)\zlib.lib
+ "$(ZLIB_DIR)\lib\zlib.lib"
  
 CPP=cl.exe
 RSC=rc.exe
@@ -129,7 +129,7 @@
 /D "WIN32" /D "__WIN32__" /D "_WINDOWS" \
 /D "HAVE_VSNPRINTF" /D "HAVE_STRDUP" /D "_USE_32BIT_TIME_T" \
 /D_CRT_SECURE_NO_DEPRECATE \
-/I $(ZLIB_DIR)
+/I "$(ZLIB_DIR)\include"
 
 # The various parts of Xapian
 XAPIAN_LIBS = \
Index: xapian-maintainer-tools/win32msvc/README
===================================================================
--- xapian-maintainer-tools/win32msvc/README	(revision 8356)
+++ xapian-maintainer-tools/win32msvc/README	(working copy)
@@ -1,6 +1,6 @@
 README for Xapian/Visual C++ Tools
 ==================================
-2007-04-10
+2007-04-23
 
 Make files, some extra headers and associated tools for compiling Xapian on
 Win32 using the Microsoft Visual C++ compilers. This is particularly useful
@@ -126,6 +126,11 @@
 http://www.microsoft.com/msdownload/platformsdk/sdkupdate/
 which contains headers, libs and NMAKE. Make sure once you have installed this that you create LIB and INCLUDE environment variables to point to the appropriate Platform SDK folders, and that the path to the SDK's BIN folder is in your PATH.
 
+- You will also need the ZLIB library. If you download and run the binary Windows installer from:
+http://sourceforge.net/project/showfiles.php?group_id=23617&package_id=16861
+(it will be called zlib-X.Y.Z.exe, we have successfully used zlib-1.2.3.exe), and use the default settings, the path
+to ZLIB will be the same as the default in config.mak (ZLIB_DIR).
+
 - SWIG can be useful for recompiling the bindings, but this is done by the Xapian
 core maintainers, so you shouldn't need to do this unless you are building from the development sources, in which 
 case use the latest development version of SWIG (the latest Windows binary, 1.3.31, is not suitable).


More information about the Xapian-devel mailing list