[GRASS-SVN] r38563 - grass/trunk/mswindows/osgeo4w

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 2 05:01:13 EDT 2009


Author: neteler
Date: 2009-08-02 05:01:13 -0400 (Sun, 02 Aug 2009)
New Revision: 38563

Added:
   grass/trunk/mswindows/osgeo4w/config.h.switch
   grass/trunk/mswindows/osgeo4w/config.h.vc
   grass/trunk/mswindows/osgeo4w/gdal-1.6.diff
   grass/trunk/mswindows/osgeo4w/gdalplugins.cmd
   grass/trunk/mswindows/osgeo4w/grass70.bat.tmpl
   grass/trunk/mswindows/osgeo4w/grass70.tmpl
   grass/trunk/mswindows/osgeo4w/ini.bat.tmpl
   grass/trunk/mswindows/osgeo4w/mklibs.sed
   grass/trunk/mswindows/osgeo4w/mklibs.sh
   grass/trunk/mswindows/osgeo4w/postinstall.bat
   grass/trunk/mswindows/osgeo4w/preremove.bat
Modified:
   grass/trunk/mswindows/osgeo4w/package.cmd
   grass/trunk/mswindows/osgeo4w/package.sh
Log:
Juergen Fischer: osgeo4w additions/updates

Added: grass/trunk/mswindows/osgeo4w/config.h.switch
===================================================================
--- grass/trunk/mswindows/osgeo4w/config.h.switch	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/config.h.switch	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,5 @@
+#ifdef _MSC_VER
+#include <grass/config.h.vc>
+#else
+#include <grass/config.h.mingw>
+#endif

Added: grass/trunk/mswindows/osgeo4w/config.h.vc
===================================================================
--- grass/trunk/mswindows/osgeo4w/config.h.vc	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/config.h.vc	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,304 @@
+/* include/config.h.  modified mingw version for VC */
+
+/*
+ * config.h.in
+ */
+
+#ifndef _config_h
+#define _config_h
+
+#define GDEBUG 1
+
+/* define _OE_SOCKETS flag (OS/390 sys/socket.h) */
+/* #undef _OE_SOCKETS */
+
+/* define _REENTRANT flag (for SunOS) */
+/* #undef _REENTRANT */
+
+/* define USE_DELTA_FOR_TZ (for AIX) */
+/* #undef USE_DELTA_FOR_TZ */
+
+/* define for Windows static build */
+/* #undef STATIC_BUILD */
+
+/* define if curses.h exists */
+#define HAVE_CURSES_H 1
+
+/* define if keypad in lib[n]curses */
+#define HAVE_KEYPAD 1
+
+/* define if limits.h exists */
+#define HAVE_LIMITS_H 1
+
+/* define if termio.h exists */
+/* #undef HAVE_TERMIO_H */
+
+/* define if termios.h exists */
+/* #undef HAVE_TERMIOS_H */
+
+/* define if unistd.h exists */
+#define HAVE_UNISTD_H 1
+
+/* define if values.h exists */
+#define HAVE_VALUES_H 1
+
+/* define if zlib.h exists */
+#define HAVE_ZLIB_H 1
+
+/* define if sys/ioctl.h exists */
+/* #undef HAVE_SYS_IOCTL_H */
+
+/* define if sys/mtio.h exists */
+/* #undef HAVE_SYS_MTIO_H */
+
+/* define if sys/resource.h exists */
+/* #undef HAVE_SYS_RESOURCE_H */
+
+/* define if sys/time.h exists */
+/* #undef HAVE_SYS_TIME_H */
+
+/* define if time.h and sys/time.h can be included together */
+/* #undef TIME_WITH_SYS_TIME */
+
+/* define if sys/timeb.h exists */
+#define HAVE_SYS_TIMEB_H 1
+
+/* define if sys/types.h exists */
+#define HAVE_SYS_TYPES_H 1
+
+/* define if sys/utsname.h exists */
+/* #undef HAVE_SYS_UTSNAME_H */
+
+/* define if g2c.h exists */
+/* #undef HAVE_G2C_H */
+
+/* define if f2c.h exists */
+/* #undef HAVE_F2C_H */
+
+/* define if cblas.h exists */
+/* #undef HAVE_CBLAS_H */
+
+/* define if clapack.h exists */
+/* #undef HAVE_CLAPACK_H */
+
+/* define gid_t type */
+#define gid_t int
+
+/* define off_t type */
+/* #undef off_t */
+
+/* define uid_t type */
+#define uid_t int
+
+/* define if "long long" is available */
+#define HAVE_LONG_LONG_INT 1
+
+/* Define the return type of signal handlers */
+#define RETSIGTYPE void
+
+/* define curses.h WINDOW structure component */
+#define CURSES_MAXY _maxy
+
+/* define if ftime() exists */
+#ifndef HAVE_FTIME
+#define HAVE_FTIME 1
+#endif
+
+/* define if gethostname() exists */
+/* #undef HAVE_GETHOSTNAME */
+
+/* define if gettimeofday() exists */
+#define HAVE_GETTIMEOFDAY 1
+
+/* define if lseek() exists */
+#define HAVE_LSEEK 1
+
+/* define if time() exists */
+#define HAVE_TIME 1
+
+/* define if uname() exists */
+/* #undef HAVE_UNAME */
+
+/* define if seteuid() exists */
+/* #undef HAVE_SETEUID */
+
+/* define if setpriority() exists */
+/* #undef HAVE_SETPRIORITY */
+
+/* define if setreuid() exists */
+/* #undef HAVE_SETREUID */
+
+/* define if setruid() exists */
+/* #undef HAVE_SETRUID */
+
+/* define if setpgrp() takes no argument */
+#define SETPGRP_VOID 1
+
+/* define if drand48() exists */
+/* #undef HAVE_DRAND48 */
+
+/* define if nanosleep() exists */
+/* #undef HAVE_NANOSLEEP */
+
+/* define if asprintf() exists */
+/* #undef HAVE_ASPRINTF */
+
+/* define if postgres is to be used */
+#define HAVE_POSTGRES 1
+
+/* define if SQLite is to be used */
+#define HAVE_SQLITE 1
+
+/* define if GDAL is to be used */
+#define HAVE_GDAL 1
+
+/* define if OGR is to be used */
+#define HAVE_OGR 1
+
+/* define if postgres client header exists */
+#define HAVE_LIBPQ_FE_H 1
+
+/* define if PQcmdTuples in lpq */
+#define HAVE_PQCMDTUPLES 1
+
+/* define if ODBC exists */
+/* #undef HAVE_SQL_H */
+
+/* define if tiffio.h exists */
+#define HAVE_TIFFIO_H 1
+
+/* define if png.h exists */
+#define HAVE_PNG_H 1
+
+/* define if jpeglib.h exists */
+#define HAVE_JPEGLIB_H 1
+
+/* define if fftw3.h exists */
+#define HAVE_FFTW3_H 1
+
+/* define if fftw.h exists */
+/* #undef HAVE_FFTW_H */
+
+/* define if dfftw.h exists */
+/* #undef HAVE_DFFTW_H */
+
+/* define if BLAS exists */
+/* #undef HAVE_LIBBLAS */
+
+/* define if LAPACK exists */
+/* #undef HAVE_LIBLAPACK */
+
+/* define if ATLAS exists */
+/* #undef HAVE_LIBATLAS */
+
+/* define if dbm.h exists */
+/* #undef HAVE_DBM_H */
+
+/* define if readline exists */
+/* #undef HAVE_READLINE_READLINE_H */
+
+/* define if ft2build.h exists */
+#define HAVE_FT2BUILD_H 1
+
+/* Whether or not we are using G_socks for display communications */
+/* #undef USE_G_SOCKS */
+
+/* define if X is disabled or unavailable */
+#define X_DISPLAY_MISSING 1
+
+/* define if libintl.h exists */
+/* #undef HAVE_LIBINTL_H */
+
+/* define if iconv.h exists */
+#define HAVE_ICONV_H 1
+
+/* define if NLS requested */
+#define USE_NLS 1
+
+/* define if <GL/GLwMDrawA.h> exists */
+/* #undef HAVE_GL_GLWMDRAWA_H */
+
+/* define if <X11/GLw/GLwMDrawA.h> exists */
+/* #undef HAVE_X11_GLW_GLWMDRAWA_H */
+
+/* define if TclTk exists */
+#define HAVE_TCLTK 1
+
+/* define if putenv() exists */
+#ifndef HAVE_PUTENV
+#define HAVE_PUTENV 1
+#endif
+
+/* define if setenv() exists */
+/* #undef HAVE_SETENV */
+
+/* define if socket() exists */
+/* #undef HAVE_SOCKET */
+
+/* define if glXCreatePbuffer exists */
+/* #undef HAVE_PBUFFERS */
+
+/* define if glXCreateGLXPixmap exists */
+/* #undef HAVE_PIXMAPS */
+
+/* define if FFMPEG library exists */
+/* #undef HAVE_FFMPEG */
+
+/* define if OpenGL uses X11 */
+/* #undef OPENGL_X11 */
+
+/* define if OpenGL uses Aqua (MacOS X) */
+/* #undef OPENGL_AQUA */
+
+/* define if OpenGL uses Windows */
+#define OPENGL_WINDOWS 1
+
+/* define if regex.h exists */
+#define HAVE_REGEX_H 1
+
+/*
+ * configuration information solely dependent on the above
+ * nothing below this point should need changing
+ */
+
+#if defined(HAVE_VALUES_H) && !defined(HAVE_LIMITS_H)
+#define INT_MIN -MAXINT
+#endif
+
+
+
+/*
+ * Defines needed to get large file support - from cdrtools-2.01
+ */
+#ifdef	USE_LARGEFILES
+
+#define	HAVE_LARGEFILES 1
+
+#ifdef	HAVE_LARGEFILES		/* If we have working largefiles at all	   */
+				/* This is not defined with glibc-2.1.3	   */
+
+/* #undef _FILE_OFFSET_BITS */	/* # of bits in off_t if settable	   */
+/* #undef _LARGEFILE_SOURCE */	/* To make ftello() visible (HP-UX 10.20). */
+/* #undef _LARGE_FILES */		/* Large file defined on AIX-style hosts.  */
+/* #undef _XOPEN_SOURCE */		/* To make ftello() visible (glibc 2.1.3). */
+/* #undef _XOPEN_SOURCE_EXTENDED */
+				/* XXX We don't use this because glibc2.1.3*/
+				/* XXX is bad anyway. If we define	   */
+				/* XXX _XOPEN_SOURCE we will loose caddr_t */
+
+/* #undef HAVE_FSEEKO */		/* Do we need this? If HAVE_LARGEFILES is  */
+				/* defined, we have fseeko()		   */
+
+#ifdef __MINGW32__
+#define off_t off64_t
+#define fseeko fseeko64
+#define ftello ftello64
+#endif
+
+#endif	/* HAVE_LARGEFILES */
+#endif	/* USE_LARGEFILES */
+
+/* define if langinfo.h exists */
+/* #undef HAVE_LANGINFO_H */
+
+#endif /* _config_h */

Added: grass/trunk/mswindows/osgeo4w/gdal-1.6.diff
===================================================================
--- grass/trunk/mswindows/osgeo4w/gdal-1.6.diff	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/gdal-1.6.diff	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,261 @@
+Index: nmake.opt
+===================================================================
+--- nmake.opt	(revision 17458)
++++ nmake.opt	(working copy)
+@@ -22,8 +22,8 @@
+ # 1200 = 6.0
+ #
+ !IFNDEF MSVC_VER
+-#assume msvc 7.1
+-MSVC_VER=1310
++#assume msvc 9.0
++MSVC_VER=1500
+ !ENDIF
+ 
+ ###############################################################################
+@@ -39,11 +39,11 @@
+ # But the paths *should* be absolute (relative paths mess up in submakefiles).
+ 
+ !IFNDEF GDAL_HOME
+-GDAL_HOME = "C:\warmerda\bld"
++GDAL_HOME = $(OSGEO4W_ROOT)
+ !ENDIF
+ BINDIR = $(GDAL_HOME)\bin
+ PLUGINDIR = $(BINDIR)\gdalplugins
+-PY_INST_DIR = $(GDAL_HOME)\pymod
++PY_INST_DIR = $(GDAL_HOME)\apps\Python25\lib\site-packages
+ LIBDIR = $(GDAL_HOME)\lib
+ INCDIR = $(GDAL_HOME)\include
+ DATADIR = $(GDAL_HOME)\data
+@@ -52,7 +52,7 @@
+ # Set this to the installed directory containing python.  If you don't
+ # have python just let it point to a directory that does not exist (as now).
+ !IFNDEF PYDIR 
+-PYDIR   =	"C:\Software\Python24"
++PYDIR = $(OSGEO4W_ROOT)\apps\Python25
+ !ENDIF
+ 
+ # Set the location of your SWIG installation
+@@ -77,7 +77,7 @@
+ !IFNDEF OPTFLAGS
+ !IF $(MSVC_VER) >= 1400
+ !IFNDEF DEBUG
+-OPTFLAGS= /nologo /MD /EHsc /Ox /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
++OPTFLAGS= /nologo /MD /EHsc /Zi /Ox /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb
+ !ELSE
+ OPTFLAGS= /nologo /MD /EHsc /Zi /W4 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb
+ !ENDIF
+Index: ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp
+===================================================================
+--- ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp	(revision 17458)
++++ ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp	(working copy)
+@@ -31,6 +31,10 @@
+ #include "cpl_conv.h"
+ #include "cpl_string.h"
+ 
++#ifdef WIN32
++#include <fcntl.h>
++#endif
++
+ CPL_CVSID("$Id$");
+ 
+ /************************************************************************/
+@@ -187,6 +191,9 @@
+ /* -------------------------------------------------------------------- */
+     Vect_set_fatal_error ( GV_FATAL_PRINT ); // Print error and continue
+     Vect_set_open_level (2);
++#ifdef WIN32
++    _set_fmode(_O_BINARY);
++#endif
+     int level = Vect_open_old ( &map, pszMap, pszMapset);
+ 
+     if ( level < 2 ) {
+Index: ogr/ogrsf_frmts/grass/makefile.vc
+===================================================================
+--- ogr/ogrsf_frmts/grass/makefile.vc	(revision 0)
++++ ogr/ogrsf_frmts/grass/makefile.vc	(revision 0)
+@@ -0,0 +1,33 @@
++GRASS_BASE     = $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)
++SRC            = ogrgrassdriver.cpp ogrgrassdatasource.cpp ogrgrasslayer.obj
++OBJ            = ogrgrassdriver.obj ogrgrassdatasource.obj ogrgrasslayer.obj
++PLUGIN_DLL     = ogr_GRASS.dll
++CFLAGS         = /nologo /MD /EHsc /Od /Zi /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG \
++                       -I $(OSGEO4W_ROOT)/apps/gdal-16/include \
++                       -I $(OSGEO4W_ROOT)/include -I $(GRASS_BASE)/include \
++                       -D GRASS_GISBASE=\"$(OSGEO4W_ROOT)\\apps\\grass\\grass-$(GRASS_VERSION)\"
++GRASS_LIBS     = /LIBPATH:$(GRASS_BASE)/lib $(OSGEO4W_ROOT)/apps/gdal-16/lib/gdal_i.lib grass_gis.lib grass_vect.lib grass_dbmibase.lib grass_dbmiclient.lib grass_gproj.lib
++PLUGIN_DIR     = $(OSGEO4W_ROOT)\apps\gdal-16\bin\gdalplugins
++
++#GRASS_LIBS    = /LIBPATH:$(GRASS_BASE)/lib /LIBPATH:$(OSGEO4W_ROOT)/lib gdal_i.lib grass_gis.lib grass_vect.lib grass_dbmibase.lib grass_dbmiclient.lib grass_gproj.lib
++#PLUGIN_DIR    = $(OSGEO4W_ROOT)\bin\gdalplugins
++
++plugin: $(PLUGIN_DLL)
++
++$(PLUGIN_DLL): $(OBJ)
++       link /debug /dll $(LDEBUG) /out:$(PLUGIN_DLL) $(OBJ) $(GDALLIB) $(GRASS_LIBS)
++       if exist $(PLUGIN_DLL).manifest mt -manifest $(PLUGIN_DLL).manifest -outputresource:$(PLUGIN_DLL);2
++       xcopy $(PLUGIN_DLL) $(PLUGIN_DIR) /y
++
++.cpp.obj:      
++       $(CC) $(CFLAGS) /c $*.cpp
++
++default:       $(OBJ)
++       xcopy /D  /Y *.obj ..\o
++
++clean:
++       -del *.obj
++
++plugin-install: $(PLUGIN_DLL)
++       -mkdir $(PLUGINDIR)
++       $(INSTALL) $(PLUGIN_DLL) $(PLUGINDIR)
+Index: ogr/ogrfeature.cpp
+===================================================================
+--- ogr/ogrfeature.cpp	(revision 17458)
++++ ogr/ogrfeature.cpp	(working copy)
+@@ -976,8 +976,7 @@
+ const char *OGRFeature::GetFieldAsString( int iField )
+ 
+ {
+-#define TEMP_BUFFER_SIZE 80
+-    char         szTempBuffer[TEMP_BUFFER_SIZE];
++    char szTempBufferSize[80];
+ 
+     CPLFree(m_pszTmpFieldValue);
+     m_pszTmpFieldValue = NULL;            
+@@ -989,7 +988,7 @@
+         switch (iSpecialField)
+         {
+           case SPF_FID:
+-            snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%ld", GetFID() );
++            snprintf( szTempBuffer, sizeof szTempBufferSize, "%ld", GetFID() );
+             return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
+ 
+           case SPF_OGR_GEOMETRY:
+@@ -1038,7 +1037,7 @@
+     }
+     else if( poFDefn->GetType() == OFTInteger )
+     {
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
++        snprintf( szTempBuffer, sizeof szTempBufferSize,
+                   "%d", pauFields[iField].Integer );
+         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
+     }
+@@ -1054,14 +1053,14 @@
+         else
+             strcpy( szFormat, "%.15g" );
+         
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
++        snprintf( szTempBuffer, sizeof szTempBufferSize,
+                   szFormat, pauFields[iField].Real );
+         
+         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
+     }
+     else if( poFDefn->GetType() == OFTDateTime )
+     {
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
++        snprintf( szTempBuffer, sizeof szTempBufferSize,
+                   "%04d/%02d/%02d %2d:%02d:%02d", 
+                   pauFields[iField].Date.Year,
+                   pauFields[iField].Date.Month,
+@@ -1086,17 +1085,17 @@
+ 
+             if( nMinutes == 0 )
+                 snprintf( szTempBuffer+strlen(szTempBuffer), 
+-                          TEMP_BUFFER_SIZE-strlen(szTempBuffer), "%02d", nHours );
++                          sizeof szTempBufferSize-strlen(szTempBuffer), "%02d", nHours );
+             else
+                 snprintf( szTempBuffer+strlen(szTempBuffer), 
+-                          TEMP_BUFFER_SIZE-strlen(szTempBuffer), "%02d%02d", nHours, nMinutes );
++                          sizeof szTempBufferSize-strlen(szTempBuffer), "%02d%02d", nHours, nMinutes );
+         }
+ 
+         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
+     }
+     else if( poFDefn->GetType() == OFTDate )
+     {
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%04d/%02d/%02d",
++        snprintf( szTempBuffer, sizeof szTempBufferSize, "%04d/%02d/%02d",
+                   pauFields[iField].Date.Year,
+                   pauFields[iField].Date.Month,
+                   pauFields[iField].Date.Day );
+@@ -1105,7 +1104,7 @@
+     }
+     else if( poFDefn->GetType() == OFTTime )
+     {
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%2d:%02d:%02d", 
++        snprintf( szTempBuffer, sizeof szTempBufferSize, "%2d:%02d:%02d", 
+                   pauFields[iField].Date.Hour,
+                   pauFields[iField].Date.Minute,
+                   pauFields[iField].Date.Second );
+@@ -1117,7 +1116,7 @@
+         char    szItem[32];
+         int     i, nCount = pauFields[iField].IntegerList.nCount;
+ 
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
++        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
+         for( i = 0; i < nCount; i++ )
+         {
+             snprintf( szItem, sizeof(szItem), "%d",
+@@ -1155,7 +1154,7 @@
+         else
+             strcpy( szFormat, "%.16g" );
+         
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
++        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
+         for( i = 0; i < nCount; i++ )
+         {
+             snprintf( szItem, sizeof(szItem), szFormat,
+@@ -1183,7 +1182,7 @@
+     {
+         int     i, nCount = pauFields[iField].StringList.nCount;
+ 
+-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
++        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
+         for( i = 0; i < nCount; i++ )
+         {
+             const char  *pszItem = pauFields[iField].StringList.paList[i];
+@@ -1228,7 +1227,6 @@
+     }
+     else
+         return "";
+-#undef TEMP_BUFFER_SIZE
+ }
+ 
+ /************************************************************************/
+Index: frmts/grass/makefile.vc
+===================================================================
+--- frmts/grass/makefile.vc	(revision 0)
++++ frmts/grass/makefile.vc	(revision 0)
+@@ -0,0 +1,32 @@
++SRC            = grass57dataset.cpp
++OBJ            = grass57dataset.obj
++PLUGIN_DLL     = gdal_GRASS.dll
++LDEBUG         = /debug 
++
++CFLAGS         = -I $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)\include -I $(OSGEO4W_ROOT)\apps\gdal-16\include -I $(OSGEO4W_ROOT)\include /MD /EHsc
++GRASS_LIBS     = /LIBPATH:$(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)\lib $(OSGEO4W_ROOT)\apps\gdal-16\lib\gdal_i.lib grass_gis.lib grass_i.lib grass_gproj.lib
++PLUGINDIR      = $(OSGEO4W_ROOT)\apps\gdal-16\bin\gdalplugins
++
++#CFLAGS        = -I $(OSGEO4W_ROOT)\include -I $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)\include /MD /EHsc /Od /Zi /DNDEBUG /Fdgdal_GRASS.pdb
++#GRASS_LIBS    = /LIBPATH:c:/OSGeo4W/apps/grass/grass-$(GRASS_VERSION)/lib /LIBPATH:C:/OSGeo4W/lib gdal_i.lib grass_gis.lib grass_i.lib grass_gproj.lib
++#PLUGINDIR     = $(OSGEO4W_ROOT)\bin\gdalplugins
++
++plugin: $(PLUGIN_DLL)
++
++$(PLUGIN_DLL): $(OBJ)
++	link /dll $(LDEBUG) /out:$(PLUGIN_DLL) $(OBJ) $(GDALLIB) $(GRASS_LIBS)
++	if exist $(PLUGIN_DLL).manifest mt -manifest $(PLUGIN_DLL).manifest -outputresource:$(PLUGIN_DLL);2
++	xcopy $(PLUGIN_DLL) $(PLUGINDIR) /y
++
++$(OBJ): $(SRC)
++	$(CC) $(CFLAGS) /c $(SRC)
++
++default:       $(OBJ)
++	xcopy /D  /Y *.obj ..\o
++
++clean:
++       -del *.obj *.manifest *.dll *.lib *.exp *.pdb
++
++plugin-install: $(PLUGIN_DLL)
++       -mkdir $(PLUGINDIR)
++       $(INSTALL) $(PLUGIN_DLL) $(PLUGINDIR)

Added: grass/trunk/mswindows/osgeo4w/gdalplugins.cmd
===================================================================
--- grass/trunk/mswindows/osgeo4w/gdalplugins.cmd	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/gdalplugins.cmd	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,33 @@
+path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem
+
+set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\
+call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86
+set OSGEO4W_ROOT=%PROGRAMFILES%\OSGeo4W
+set P=%PATH%
+call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
+path %P%;%OSGEO4W_ROOT%\bin
+
+set VERSION=1.6.0
+set PACKAGE=1
+
+set P=%CD%
+
+echo OGR: %DATE% %TIME%
+cd ..\gdal-1.6\ogr\ogrsf_frmts\grass
+nmake /f makefile.vc clean
+nmake /f makefile.vc GRASS_VERSION=%1 plugin
+
+echo GDAL: %DATE% %TIME%
+cd ..\..\..\frmts\grass
+nmake /f makefile.vc clean
+nmake /f makefile.vc GRASS_VERSION=%1 plugin
+
+cd %P%
+
+mkdir package\gdal16-grass
+tar -C %OSGEO4W_ROOT% -cjf package/gdal16-grass-%VERSION%-%PACKAGE%.tar.bz2 ^
+	apps/gdal-16/bin/gdalplugins/ogr_GRASS.dll ^
+	apps/gdal-16/bin/gdalplugins/gdal_GRASS.dll
+
+:end
+echo END: %DATE% %TIME%

Added: grass/trunk/mswindows/osgeo4w/grass70.bat.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/grass70.bat.tmpl	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/grass70.bat.tmpl	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,3 @@
+ at echo off
+call @osgeo4w@\bin\o4w_env.bat
+"%WINGISBASE%"\etc\init.bat %*

Added: grass/trunk/mswindows/osgeo4w/grass70.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/grass70.tmpl	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/grass70.tmpl	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,25 @@
+#! /bin/sh
+#############################################################################
+#
+# MODULE:   	GRASS Initialization
+# AUTHOR(S):	Justin Hickey - Thailand - jhickey at hpcc.nectec.or.th
+# PURPOSE:  	The source file for this shell script is in
+#   	    	lib/init/grass.src and is the grass startup script. It
+#   	    	requires a source file because the definition of GISBASE
+#   	    	is not known until compile time and is substituted from the
+#   	    	Makefile. Any command line options are passed to Init.sh.
+# COPYRIGHT:    (C) 2000-2005 by the GRASS Development Team
+#
+#               This program is free software under the GNU General Public
+#   	    	License (>=v2). Read the file COPYING that comes with GRASS
+#   	    	for details.
+#
+#############################################################################
+
+trap "echo 'User break!' ; exit" 2 3 9 15
+
+# Set the GISBASE variable
+GISBASE=@osgeo4w_msys@
+export GISBASE
+
+exec "$GISBASE/etc/Init.sh" "$@"

Added: grass/trunk/mswindows/osgeo4w/ini.bat.tmpl
===================================================================
--- grass/trunk/mswindows/osgeo4w/ini.bat.tmpl	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/ini.bat.tmpl	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,7 @@
+set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-7.0.0svn
+set WINGISBASE=%OSGEO4W_ROOT%\apps\grass\grass-7.0.0svn
+set GRASS_SH=%OSGEO4W_ROOT%\apps\msys\bin\sh.exe
+set GRASS_WISH=%OSGEO4W_ROOT%\bin\wish.exe
+set GRASS_PYTHON=%OSGEO4W_ROOT%\bin\python.exe
+set GRASS_PROJSHARE=%OSGEO4W_ROOT%\share\proj
+set GRASS_HTML_BROWSER=%PROGRAMFILES%\Internet Explorer\iexplore.exe

Added: grass/trunk/mswindows/osgeo4w/mklibs.sed
===================================================================
--- grass/trunk/mswindows/osgeo4w/mklibs.sed	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/mklibs.sed	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,10 @@
+/Dump of file / {
+	s/Dump of file \([^	 ]*\)$/LIBRARY \1/p
+  	a\
+EXPORTS
+}
+/[ 	]*ordinal hint/,/^[	]*Summary/ {
+ /^[ 	]\+[0-9]\+/ {
+   s/^[ 	]\+[0-9]\+[ 	]\+[0-9A-Fa-f]\+[ 	]\+[0-9A-Fa-f]\+[ 	]\+\([^ 	=?]\+\).*$/	\1/p
+ }
+}

Added: grass/trunk/mswindows/osgeo4w/mklibs.sh
===================================================================
--- grass/trunk/mswindows/osgeo4w/mklibs.sh	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/mklibs.sh	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+set -e
+
+PROGRAMFILES="/c/Programme"
+VSDIR="$PROGRAMFILES/Microsoft Visual Studio 9.0"
+PATH="$VSDIR/Common7/IDE:$PATH"
+PATH="$VSDIR/VC/bin:$PATH"
+PATH="$VSDIR/Common7/Tools:$PATH"
+PATH="$PATH:/c/MinGW/bin"
+export PATH
+
+[ -d mswindows/osgeo4w/vc ] || mkdir mswindows/osgeo4w/vc
+
+for dllfile in "$@"; do
+	dlldir=${dllfile%/*}
+	dllfile=${dllfile##*/}
+
+	dllbase=${dllfile%.dll}
+	dllname=${dllbase#lib}
+	dllname=${dllname%.$VERSION}
+	defname=$dllname.def
+	libname=$dllname.lib
+
+ 	echo "$dllfile => $dllname"
+
+	(cd $dlldir; dumpbin -exports $dllfile) |
+		sed -nf mswindows/osgeo4w/mklibs.sed |
+		egrep -v "^[ 	]*(_IMPORT_DESCRIPTOR_.*|_NULL_IMPORT_DESCRIPTOR)$" >mswindows/osgeo4w/vc/${defname%$VERSION}
+
+	cd mswindows/osgeo4w/vc
+	lib -nologo -def:${defname} -subsystem:windows -machine:x86
+	lib -nologo $libname || exit
+	cd ../../..
+done 


Property changes on: grass/trunk/mswindows/osgeo4w/mklibs.sh
___________________________________________________________________
Added: svn:executable
   + *
Added: svn:eol-style
   + native

Modified: grass/trunk/mswindows/osgeo4w/package.cmd
===================================================================
--- grass/trunk/mswindows/osgeo4w/package.cmd	2009-08-02 08:20:52 UTC (rev 38562)
+++ grass/trunk/mswindows/osgeo4w/package.cmd	2009-08-02 09:01:13 UTC (rev 38563)
@@ -1,7 +1,7 @@
 path %PATH%;%OSGEO4W_ROOT%\apps\swig
 set WXWIN=h:\windows\wxPython-src-2.8.9.1
 
-set GRASS_HOME=%OSGEO4W_ROOT%\apps\grass\grass-6.4.0RC3
+set GRASS_HOME=%OSGEO4W_ROOT%\apps\grass\grass-7.0.0
 set GRASS_INC=%GRASS_HOME%\include
 set GRASS_LPATH=%GRASS_HOME%\lib
 

Modified: grass/trunk/mswindows/osgeo4w/package.sh
===================================================================
--- grass/trunk/mswindows/osgeo4w/package.sh	2009-08-02 08:20:52 UTC (rev 38562)
+++ grass/trunk/mswindows/osgeo4w/package.sh	2009-08-02 09:01:13 UTC (rev 38563)
@@ -1,20 +1,43 @@
+#!/c/Programme/OSGeo4W/bin/sh
+
 set -e
 
+if ! [ -d mswindows ]; then
+	echo Start from GRASS toplevel dir
+	exit 1
+fi
+
+export OSGEO4W_ROOT_MSYS=/c/Programme/OSGeo4W
+export PATH=.:/c/mingw/bin:/usr/local/bin:/bin:$OSGEO4W_ROOT_MSYS/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem
+
+version() {
+	(
+		read MAJOR
+		read MINOR
+		read PATCH
+		echo $MAJOR.$MINOR.$PATCH
+	) <include/VERSION
+}
+
+export VERSION=$(version)
+export PACKAGE=3
+
+
 (
 echo
 echo
 echo
 
-if ! [ -f configure-stamp ]; then
+if ! [ -f mswindows/osgeo4w/configure-stamp ]; then
 	echo $(date): STARTING configure
 
 	./configure \
-		--with-libs=/c/OSGeo4W/lib \
-		--with-includes=/c/OSGeo4W/include \
-		--exec-prefix=/c/OSGeo4W/bin \
-		--libexecdir=/c/OSGeo4W/bin \
-		--prefix=/c/OSGeo4W/apps/grass \
-		--includedir=/c/OSGeo4W/include \
+		--with-libs="$OSGEO4W_ROOT_MSYS/apps/gdal-16/lib $OSGEO4W_ROOT_MSYS/lib /c/MinGW/lib" \
+		--with-includes="$OSGEO4W_ROOT_MSYS/apps/gdal-16/include $OSGEO4W_ROOT_MSYS/include /c/MinGW/include" \
+		--exec-prefix=$OSGEO4W_ROOT_MSYS/bin \
+		--libexecdir=$OSGEO4W_ROOT_MSYS/bin \
+		--prefix=$OSGEO4W_ROOT_MSYS/apps/grass \
+		--includedir=$OSGEO4W_ROOT_MSYS/include \
 		--disable-x --without-x \
 		--with-cxx \
 		--enable-shared \
@@ -22,8 +45,8 @@
 		--with-opengl=windows \
 		--with-fftw \
 		--with-freetype \
-		--with-proj-share=/c/OSGeo4W/share/proj \
-		--with-gdal=/c/OSGeo4W/bin/gdal-config \
+		--with-proj-share=$OSGEO4W_ROOT_MSYS/share/proj \
+		--with-gdal=$OSGEO4W_ROOT_MSYS/bin/gdal-config \
 		--with-tcltk \
 		--with-sqlite \
 		--with-postgres \
@@ -31,22 +54,86 @@
 		--with-regex \
 		--with-nls \
 		--without-swig \
-		--with-freetype-includes=/c/OSGeo4W/include/freetype2 \
-		--without-cairo \
-		--without-geos
+		--with-freetype-includes=$OSGEO4W_ROOT_MSYS/include/freetype2
 
 	echo $(date): STARTING make clean
 	make clean
 
-	touch configure-stamp
+	touch mswindows/osgeo4w/configure-stamp
 fi
 
-
 echo $(date): STARTING make
-make || make
+make -j4 || make -j4
 
 echo $(date): STARTING make install
 make install
+
+echo $(date): STARTING cleanup
+mv $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib/*.$VERSION.dll $OSGEO4W_ROOT_MSYS/bin
+rm $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib/*.dll
+
+mv $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h.mingw
+cp mswindows/osgeo4w/config.h.switch $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass/config.h
+cp mswindows/osgeo4w/config.h.vc $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/include/grass
+cp mswindows/osgeo4w/grass70.bat.tmpl $OSGEO4W_ROOT_MSYS/bin/grass70.bat.tmpl
+cp mswindows/osgeo4w/ini.bat.tmpl $OSGEO4W_ROOT_MSYS/etc/ini/grass.bat.tmpl
+cp mswindows/osgeo4w/postinstall.bat $OSGEO4W_ROOT_MSYS/etc/postinstall/grass.bat
+cp mswindows/osgeo4w/preremove.bat $OSGEO4W_ROOT_MSYS/etc/preremove/grass.bat
+cp /c/mingw/bin/libgnurx-0.dll $OSGEO_ROOT_MSYS/bin
+cp /c/mingw/bin/libiconv-2.dll $OSGEO_ROOT_MSYS/bin
+cp /c/mingw/bin/libintl-8.dll $OSGEO_ROOT_MSYS/bin
+
+P=$(pwd -W)
+P=${P//\//\\\\}\\\\dist.i686-pc-mingw32
+
+sed -e "s#$P#@osgeo4w@#" $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap >$OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap.tmpl
+sed -e "s#$P#@osgeo4w_msys@#" $OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70 >$OSGEO4W_ROOT_MSYS/apps/grass/bin/grass70.tmpl
+rm $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/etc/fontcap 
+
+echo $(date): STARTING building vc libraries
+sh mswindows/osgeo4w/mklibs.sh $OSGEO4W_ROOT_MSYS/bin/*.$VERSION.dll
+mv mswindows/osgeo4w/vc/grass*.lib $OSGEO4W_ROOT_MSYS/apps/grass/grass-$VERSION/lib
+
+set -x
+echo $(date): BUILDING GDAL GRASS plugins
+cmd /c mswindows\\osgeo4w\\gdalplugins.cmd $VERSION
+
+echo $(date): CREATING packages
+mkdir -p package/grass-devel package/grass-devel-mingw package/grass-devel-vc package/grass
+
+PDIR=$PWD/package
+cd $OSGEO4W_ROOT_MSYS
+tar -cjf $PDIR/grass-devel/grass-devel-$VERSION-$PACKAGE.tar.bz2 \
+	apps/grass/grass-$VERSION/include
+
+tar -cjf $PDIR/grass-devel-mingw/grass-devel-mingw-$VERSION-$PACKAGE.tar.bz2 \
+	apps/grass/grass-$VERSION/lib/libgrass*.a
+
+tar -cjf $PDIR/grass-devel-vc/grass-devel-vc-$VERSION-$PACKAGE.tar.bz2 \
+	apps/grass/grass-$VERSION/lib/*.lib
+
+tar -cjf $PDIR/grass/grass-$VERSION-$PACKAGE.tar.bz2 \
+	apps/grass/bin/grass70.tmpl \
+	apps/grass/grass-$VERSION/authors \
+	apps/grass/grass-$VERSION/bin/ \
+	apps/grass/grass-$VERSION/bwidget/ \
+	apps/grass/grass-$VERSION/changes \
+	apps/grass/grass-$VERSION/copying \
+	apps/grass/grass-$VERSION/docs \
+	apps/grass/grass-$VERSION/driver \
+	apps/grass/grass-$VERSION/etc \
+	apps/grass/grass-$VERSION/gpl.txt \
+	apps/grass/grass-$VERSION/requirements.html \
+	apps/grass/grass-$VERSION/scripts \
+	bin/libgnurx-0.dll \
+	bin/libiconv-2.dll \
+	bin/libintl-8.dll \
+	bin/grass70.bat.tmpl \
+	bin/libgrass_*.$VERSION.dll \
+	etc/ini/grass.bat \
+	etc/postinstall/grass.bat \
+	etc/preremove/grass.bat
+
 echo $(date): END
 
-) | tee -a package.log
+) | tee -a mswindows/osgeo4w/package.log

Added: grass/trunk/mswindows/osgeo4w/postinstall.bat
===================================================================
--- grass/trunk/mswindows/osgeo4w/postinstall.bat	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/postinstall.bat	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,15 @@
+set ICON=%OSGEO4W_ROOT%\apps\grass\grass-7.0.0svn\etc\gui\icons\grass.ico
+set BATCH=%OSGEO4W_ROOT%\bin\grass70.bat
+
+textreplace -std -t "%OSGEO4W_ROOT%"\bin\grass70.bat
+textreplace -std -t "%OSGEO4W_ROOT%"\apps\grass\grass-7.0.0svn\etc\fontcap
+textreplace -std -t "%OSGEO4W_ROOT%"\apps\grass\bin\grass70
+
+mkdir "%OSGEO4W_STARTMENU%\GRASS GIS"
+xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS\wxPython.lnk"   "%BATCH%" "-wxpython" \ "wxPython interface" 1 "%ICON%"
+xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS\TclTk.lnk"      "%BATCH%" "-tcltk" \ "Tcl/Tk interface" 1 "%ICON%"
+xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS\Text.lnk"       "%BATCH%" "-text" \ "Text interface" 1 "%ICON%"
+
+xxmklink "%ALLUSERSPROFILE%\Desktop\GRASS GIS (wxpython).lnk" "%BATCH%" "-wxpython" \ "wxPython" 1 "%ICON%"
+xxmklink "%ALLUSERSPROFILE%\Desktop\GRASS GIS (TclTk).lnk" "%BATCH%" "-tcltk" \ "Tcl/Tk" 1 "%ICON%"
+xxmklink "%ALLUSERSPROFILE%\Desktop\GRASS GIS (Text).lnk" "%BATCH%" "-text" \ "Text interface" 1 "%ICON%"

Added: grass/trunk/mswindows/osgeo4w/preremove.bat
===================================================================
--- grass/trunk/mswindows/osgeo4w/preremove.bat	                        (rev 0)
+++ grass/trunk/mswindows/osgeo4w/preremove.bat	2009-08-02 09:01:13 UTC (rev 38563)
@@ -0,0 +1,15 @@
+del "%OSGEO4W_STARTMENU%\GRASS.lnk"
+del "%ALLUSERSPROFILE%\Desktop\grass.lnk"
+
+del "%OSGEO4W_STARTMENU%\GRASS GIS\wxpython.lnk"
+del "%OSGEO4W_STARTMENU%\GRASS GIS\tcltk.lnk"
+del "%OSGEO4W_STARTMENU%\GRASS GIS\text.lnk"
+rmdir "%OSGEO4W_STARTMENU%\GRASS GIS"
+
+del "%ALLUSERSPROFILE%\Desktop\GRASS GIS (wxPython).lnk"
+del "%ALLUSERSPROFILE%\Desktop\GRASS GIS (TclTk).lnk"
+del "%ALLUSERSPROFILE%\Desktop\GRASS GIS (Text).lnk"
+
+del "%OSGEO4W_ROOT%"\apps\grass\grass-7.0.0svn\etc\fontcap
+del "%OSGEO4W_ROOT%"\apps\grass\bin\grass70
+del "%OSGEO4W_ROOT%"\bin\grass70.bat



More information about the grass-commit mailing list