[Xapian-devel] Fixes for omega under Windows
Charlie Hull
charlie at juggler.net
Mon Apr 23 12:05:37 BST 2007
Olly Betts wrote:
> On Sat, Apr 21, 2007 at 08:37:11PM +0100, Olly Betts wrote:
>> On Thu, Apr 19, 2007 at 01:46:00PM +0100, Olly Betts wrote:
>>> We need a sane solution to allow using the safe versions of the system
>>> headers in Omega too. The obvious way is to just copy the files into
>>> omega too but that's not ideal as they'll inevitably slowly diverge.
>>> I'll read the SVN docs to see if we can share a copy in a sensible way.
>> Still need to do this...
>
> OK, now done.
>
OK, I've now got a final, simpler patch for Omega under Windows, enclosed.
Cheers
Charlie
-------------- next part --------------
Index: xapian-applications/omega/portability/mkdtemp.cc
===================================================================
--- xapian-applications/omega/portability/mkdtemp.cc (revision 8360)
+++ xapian-applications/omega/portability/mkdtemp.cc (working copy)
@@ -31,11 +31,20 @@
*/
#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#include "config.h"
+#include "safesysstat.h"
+#include "safeunistd.h"
+
#include <errno.h>
+#ifdef __CYGWIN__
+# include "safewindows.h"
+# include <sys/cygwin.h>
+#elif defined __WIN32__
+# include "safewindows.h"
+#endif
+
static int
do_mkdtemp(char *path)
{
Index: xapian-applications/omega/scriptindex.cc
===================================================================
--- xapian-applications/omega/scriptindex.cc (revision 8356)
+++ xapian-applications/omega/scriptindex.cc (working copy)
@@ -35,6 +35,7 @@
#include "safeerrno.h"
#include <stdio.h>
+#include <time.h>
#include "safeunistd.h"
#include "commonhelp.h"
Index: xapian-maintainer-tools/win32msvc/config.h.omega.win32
===================================================================
--- xapian-maintainer-tools/win32msvc/config.h.omega.win32 (revision 8356)
+++ xapian-maintainer-tools/win32msvc/config.h.omega.win32 (working copy)
@@ -80,7 +80,15 @@
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
+/* Define to `int' if <sys/types.h> does not define. */
+#define pid_t DWORD
+/* Define to `int' if <sys/types.h> does not define. */
+#define mode_t int
+
+/* Must define this here, we can't do it as a build parameter as quotes are stripped */
+#define CONFIGFILE_SYSTEM "omega.conf"
+
/* Disable stupid MSVC "performance" warning for converting int to bool. */
#ifdef _MSC_VER
# pragma warning(disable:4800)
Index: xapian-maintainer-tools/win32msvc/win32_applications_omega.mak
===================================================================
--- xapian-maintainer-tools/win32msvc/win32_applications_omega.mak (revision 8356)
+++ xapian-maintainer-tools/win32msvc/win32_applications_omega.mak (working copy)
@@ -31,12 +31,10 @@
OUTEXEDIR=$(XAPIAN_CORE_REL_OMEGA)\win32\$(XAPIAN_DEBUG_OR_RELEASE)
PROGRAMS = "$(OUTEXEDIR)\scriptindex.exe" "$(OUTEXEDIR)\omindex.exe" "$(OUTEXEDIR)\omega.exe" \
-"$(OUTEXEDIR)\md5test.exe" "$(OUTEXEDIR)\htmlparsetest.exe" "$(OUTEXEDIR)\utf8test.exe"
+"$(OUTEXEDIR)\md5test.exe" "$(OUTEXEDIR)\htmlparsetest.exe"
ALL : $(PROGRAMS)
-
-
OMEGA_OBJS= \
"$(OUTDIR)\omega.obj" \
"$(OUTDIR)\query.obj" \
@@ -51,7 +49,6 @@
"$(OUTDIR)\indextext.obj" \
"$(OUTDIR)\loadfile.obj" \
"$(OUTDIR)\utf8convert.obj" \
- "$(OUTDIR)\utf8itor.obj" \
"$(OUTDIR)\datematchdecider.obj"
@@ -60,7 +57,6 @@
"$(OUTDIR)\myhtmlparse.obj" \
"$(OUTDIR)\htmlparse.obj" \
"$(OUTDIR)\indextext.obj" \
- "$(OUTDIR)\getopt.obj" \
"$(OUTDIR)\commonhelp.obj" \
"$(OUTDIR)\utils.obj" \
"$(OUTDIR)\hashterm.obj" \
@@ -71,8 +67,9 @@
"$(OUTDIR)\xmlparse.obj" \
"$(OUTDIR)\metaxmlparse.obj" \
"$(OUTDIR)\utf8convert.obj" \
- "$(OUTDIR)\utf8itor.obj" \
- "$(OUTDIR)\tclUniData.obj"
+ "$(OUTDIR)\mkdtemp.obj" \
+ "$(OUTDIR)\sample.obj"
+
SCRIPTINDEX_OBJS= \
@@ -80,30 +77,24 @@
"$(OUTDIR)\myhtmlparse.obj" \
"$(OUTDIR)\htmlparse.obj" \
"$(OUTDIR)\indextext.obj" \
- "$(OUTDIR)\getopt.obj" \
"$(OUTDIR)\commonhelp.obj" \
"$(OUTDIR)\utils.obj" \
"$(OUTDIR)\hashterm.obj" \
"$(OUTDIR)\loadfile.obj" \
"$(OUTDIR)\utf8convert.obj" \
- "$(OUTDIR)\utf8itor.obj"
+ "$(OUTDIR)\utf8truncate.obj"
HTMLPARSETEST_OBJS= \
"$(OUTDIR)\htmlparsetest.obj" \
"$(OUTDIR)\myhtmlparse.obj" \
"$(OUTDIR)\htmlparse.obj" \
- "$(OUTDIR)\utf8convert.obj" \
- "$(OUTDIR)\utf8itor.obj"
+ "$(OUTDIR)\utf8convert.obj"
MD5TEST_OBJS= \
"$(OUTDIR)\md5.obj" \
"$(OUTDIR)\md5wrap.obj" \
"$(OUTDIR)\md5test.obj"
-UTF8TEST_OBJS= \
- "$(OUTDIR)\utf8test.obj" \
- "$(OUTDIR)\utf8itor.obj"
-
CLEAN :
- at erase $(PROGRAMS)
@@ -112,14 +103,12 @@
- at erase $(SCRIPTINDEX_OBJS)
- at erase $(HTMLPARSETEST_OBJS)
- at erase $(MD5TEST_OBJS)
- - at erase $(UTF8TEST_OBJS)
#"$(OUTDIR)" :
# if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
CPP_PROJ=$(CPPFLAGS_EXTRA) \
- /I "." /I "$(XAPIAN_CORE_REL_OMEGA)" /I "$(XAPIAN_CORE_REL_OMEGA)\common" /I "$(XAPIAN_CORE_REL_OMEGA)\include" /I "$(XAPIAN_CORE_REL_OMEGA)\win32" \
- /DCONFIGFILE_SYSTEM=NULL \
+ /I "." /I "common" /I "$(XAPIAN_CORE_REL_OMEGA)\include" /I "$(XAPIAN_CORE_REL_OMEGA)\win32" \
/Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /Tp$(INPUTNAME)
CPP_OBJS=..\win32\$(XAPIAN_DEBUG_OR_RELEASE)
@@ -163,12 +152,6 @@
$(ALL_LINK32_FLAGS) /out:"$(OUTEXEDIR)\md5test.exe" $(DEF_FLAGS) $(MD5TEST_OBJS)
<<
-"$(OUTEXEDIR)\utf8test.exe" : "$(OUTEXEDIR)" $(DEF_FILE) $(UTF8TEST_OBJS)
- $(PROGRAM_DEPENDENCIES)
- $(LINK32) @<<
- $(ALL_LINK32_FLAGS) /out:"$(OUTEXEDIR)\utf8test.exe" $(DEF_FLAGS) $(UTF8TEST_OBJS)
-<<
-
"$(INTDIR)\dirent.obj" : "$(XAPIAN_CORE_REL_OMEGA)\win32\dirent.c"
$(CPP) @<<
$(CPP_PROJ) $**
@@ -285,7 +268,7 @@
$(CPP_PROJ) $**
<<
-"$(INTDIR)\utf8itor.obj" : ".\utf8itor.cc"
+"$(INTDIR)\utf8truncate.obj" : ".\utf8truncate.cc"
$(CPP) @<<
$(CPP_PROJ) $**
<<
@@ -295,11 +278,6 @@
$(CPP_PROJ) $**
<<
-"$(INTDIR)\tclUniData.obj" : ".\tclUniData.cc"
- $(CPP) @<<
- $(CPP_PROJ) $**
-<<
-
"$(INTDIR)\md5test.obj" : ".\md5test.cc"
$(CPP) @<<
$(CPP_PROJ) $**
@@ -326,6 +304,16 @@
$(CPP_PROJ) $**
<<
+"$(INTDIR)\mkdtemp.obj" : ".\portability\mkdtemp.cc"
+ $(CPP) @<<
+ $(CPP_PROJ) $**
+<<
+
+"$(INTDIR)\sample.obj" : ".\sample.cc"
+ $(CPP) @<<
+ $(CPP_PROJ) $**
+<<
+
.c{$(CPP_OBJS)}.obj::
$(CPP) @<<
$(CPP_PROJ) $<
More information about the Xapian-devel
mailing list