Colin Nielsen wrote:

> 1) I reverted markus's patch and the jef_mingw patch as well.
> 2) make distclean
> 3) ./configure etc etc etc
> 4) make
> 5) as Glynn suggested, make again
> 
> Seems to still be a lot of errors, so far the jef_mingw patch worked
> the best, it fixed dllmain but not fmode.

fmode.c seems to have disappeared at some point.

Eventually, I managed to get it to compile with the attached patch.

-- 
Glynn Clements <[email protected]>

Index: lib/gis/fmode.c
===================================================================
--- lib/gis/fmode.c     (revision 0)
+++ lib/gis/fmode.c     (revision 0)
@@ -0,0 +1,4 @@
+#include <stdlib.h>
+#include <fcntl.h>
+#undef _fmode
+int _fmode = _O_BINARY;
Index: lib/gis/Makefile
===================================================================
--- lib/gis/Makefile    (revision 36231)
+++ lib/gis/Makefile    (working copy)
@@ -8,8 +8,13 @@
 DATASRC = ellipse.table datum.table datumtransform.table FIPS.code state27 
state83 projections gui.tcl
 EXTRA_INC = $(ZLIBINCPATH)
 
+include $(MODULE_TOPDIR)/include/Make/Platform.make
+
 LIB_OBJS := $(subst .c,.o,$(wildcard *.c))
 LIB_OBJS := $(filter-out fmode.o dllmain.o,$(LIB_OBJS))
+ifneq ($(MINGW),)
+LIB_OBJS := $(LIB_OBJS) dllmain.o fmode.o
+endif
 
 include $(MODULE_TOPDIR)/include/Make/Lib.make
 include $(MODULE_TOPDIR)/include/Make/Doxygen.make
@@ -40,7 +45,7 @@
 
 endif
 
-default: $(DLLMAIN_OBJ) lib $(FMODE_OBJ) $(DATAFILES) $(COLORFILES) 
$(ETC)/colors.desc $(ETC)/element_list
+default: lib $(FMODE_OBJ) $(DATAFILES) $(COLORFILES) $(ETC)/colors.desc 
$(ETC)/element_list
 
 $(ETC)/colors:
        $(MKDIR) $@
Index: include/Make/Shlib.make
===================================================================
--- include/Make/Shlib.make     (revision 36231)
+++ include/Make/Shlib.make     (working copy)
@@ -4,8 +4,12 @@
 
 # Object that calls _setfmode(_O_BINARY) which must be linked to each DLL on 
Windows
 ifdef MINGW
+ifneq ($(SHLIB_NAME),$(DATETIME_LIBNAME))
+ifneq ($(SHLIB_NAME),$(GIS_LIBNAME))
   DLLMAIN_OBJ = $(MODULE_TOPDIR)/lib/gis/$(OBJDIR)/dllmain.o
 endif
+endif
+endif
 
 CFLAGS += $(SHLIB_CFLAGS) $(NLS_CFLAGS)
 LDFLAGS += $(SHLIB_LDFLAGS)
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to