~ubuntu-branches/ubuntu/precise/grass/precise

« back to all changes in this revision

Viewing changes to mswindows/osgeo4w/gdal-1.6.diff

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2011-04-13 17:08:41 UTC
  • mfrom: (8.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20110413170841-ss1t9bic0d0uq0gz
Tags: 6.4.1-1
* New upstream version.
* Now build-dep on libjpeg-dev and current libreadline6-dev.
* Removed patch swig: obsolete.
* Policy bumped to 3.9.2, without changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: nmake.opt
2
 
===================================================================
3
 
--- nmake.opt   (revision 17458)
4
 
+++ nmake.opt   (working copy)
5
 
@@ -22,8 +22,8 @@
6
 
 # 1200 = 6.0
7
 
 #
8
 
 !IFNDEF MSVC_VER
9
 
-#assume msvc 7.1
10
 
-MSVC_VER=1310
11
 
+#assume msvc 9.0
12
 
+MSVC_VER=1500
13
 
 !ENDIF
14
 
 
15
 
 ###############################################################################
16
 
@@ -39,11 +39,11 @@
17
 
 # But the paths *should* be absolute (relative paths mess up in submakefiles).
18
 
 
19
 
 !IFNDEF GDAL_HOME
20
 
-GDAL_HOME = "C:\warmerda\bld"
21
 
+GDAL_HOME = $(OSGEO4W_ROOT)
22
 
 !ENDIF
23
 
 BINDIR = $(GDAL_HOME)\bin
24
 
 PLUGINDIR = $(BINDIR)\gdalplugins
25
 
-PY_INST_DIR = $(GDAL_HOME)\pymod
26
 
+PY_INST_DIR = $(GDAL_HOME)\apps\Python25\lib\site-packages
27
 
 LIBDIR = $(GDAL_HOME)\lib
28
 
 INCDIR = $(GDAL_HOME)\include
29
 
 DATADIR = $(GDAL_HOME)\data
30
 
@@ -52,7 +52,7 @@
31
 
 # Set this to the installed directory containing python.  If you don't
32
 
 # have python just let it point to a directory that does not exist (as now).
33
 
 !IFNDEF PYDIR 
34
 
-PYDIR   =      "C:\Software\Python24"
35
 
+PYDIR = $(OSGEO4W_ROOT)\apps\Python25
36
 
 !ENDIF
37
 
 
38
 
 # Set the location of your SWIG installation
39
 
@@ -77,7 +77,7 @@
40
 
 !IFNDEF OPTFLAGS
41
 
 !IF $(MSVC_VER) >= 1400
42
 
 !IFNDEF DEBUG
43
 
-OPTFLAGS= /nologo /MD /EHsc /Ox /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
44
 
+OPTFLAGS= /nologo /MD /EHsc /Zi /Ox /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb
45
 
 !ELSE
46
 
 OPTFLAGS= /nologo /MD /EHsc /Zi /W4 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /Fd$(GDAL_ROOT)\gdal$(VERSION).pdb
47
 
 !ENDIF
48
 
Index: ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp
49
 
===================================================================
50
 
--- ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp        (revision 17458)
51
 
+++ ogr/ogrsf_frmts/grass/ogrgrassdatasource.cpp        (working copy)
52
 
@@ -31,6 +31,10 @@
53
 
 #include "cpl_conv.h"
54
 
 #include "cpl_string.h"
55
 
 
56
 
+#ifdef WIN32
57
 
+#include <fcntl.h>
58
 
+#endif
59
 
+
60
 
 CPL_CVSID("$Id$");
61
 
 
62
 
 /************************************************************************/
63
 
@@ -187,6 +191,9 @@
64
 
 /* -------------------------------------------------------------------- */
65
 
     Vect_set_fatal_error ( GV_FATAL_PRINT ); // Print error and continue
66
 
     Vect_set_open_level (2);
67
 
+#ifdef WIN32
68
 
+    _set_fmode(_O_BINARY);
69
 
+#endif
70
 
     int level = Vect_open_old ( &map, pszMap, pszMapset);
71
 
 
72
 
     if ( level < 2 ) {
73
 
Index: ogr/ogrsf_frmts/grass/makefile.vc
74
 
===================================================================
75
 
--- ogr/ogrsf_frmts/grass/makefile.vc   (revision 0)
76
 
+++ ogr/ogrsf_frmts/grass/makefile.vc   (revision 0)
77
 
@@ -0,0 +1,33 @@
78
 
+GRASS_BASE     = $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)
79
 
+SRC            = ogrgrassdriver.cpp ogrgrassdatasource.cpp ogrgrasslayer.obj
80
 
+OBJ            = ogrgrassdriver.obj ogrgrassdatasource.obj ogrgrasslayer.obj
81
 
+PLUGIN_DLL     = ogr_GRASS.dll
82
 
+CFLAGS         = /nologo /MD /EHsc /Od /Zi /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG \
83
 
+                       -I $(OSGEO4W_ROOT)/apps/gdal-16/include \
84
 
+                       -I $(OSGEO4W_ROOT)/include -I $(GRASS_BASE)/include \
85
 
+                       -D GRASS_GISBASE=\"$(OSGEO4W_ROOT)\\apps\\grass\\grass-$(GRASS_VERSION)\"
86
 
+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
87
 
+PLUGIN_DIR     = $(OSGEO4W_ROOT)\apps\gdal-16\bin\gdalplugins
88
 
+
89
 
+#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
90
 
+#PLUGIN_DIR    = $(OSGEO4W_ROOT)\bin\gdalplugins
91
 
+
92
 
+plugin: $(PLUGIN_DLL)
93
 
+
94
 
+$(PLUGIN_DLL): $(OBJ)
95
 
+       link /debug /dll $(LDEBUG) /out:$(PLUGIN_DLL) $(OBJ) $(GDALLIB) $(GRASS_LIBS)
96
 
+       if exist $(PLUGIN_DLL).manifest mt -manifest $(PLUGIN_DLL).manifest -outputresource:$(PLUGIN_DLL);2
97
 
+       xcopy $(PLUGIN_DLL) $(PLUGIN_DIR) /y
98
 
+
99
 
+.cpp.obj:      
100
 
+       $(CC) $(CFLAGS) /c $*.cpp
101
 
+
102
 
+default:       $(OBJ)
103
 
+       xcopy /D  /Y *.obj ..\o
104
 
+
105
 
+clean:
106
 
+       -del *.obj
107
 
+
108
 
+plugin-install: $(PLUGIN_DLL)
109
 
+       -mkdir $(PLUGINDIR)
110
 
+       $(INSTALL) $(PLUGIN_DLL) $(PLUGINDIR)
111
 
Index: ogr/ogrfeature.cpp
112
 
===================================================================
113
 
--- ogr/ogrfeature.cpp  (revision 17458)
114
 
+++ ogr/ogrfeature.cpp  (working copy)
115
 
@@ -976,8 +976,7 @@
116
 
 const char *OGRFeature::GetFieldAsString( int iField )
117
 
 
118
 
 {
119
 
-#define TEMP_BUFFER_SIZE 80
120
 
-    char         szTempBuffer[TEMP_BUFFER_SIZE];
121
 
+    char szTempBufferSize[80];
122
 
 
123
 
     CPLFree(m_pszTmpFieldValue);
124
 
     m_pszTmpFieldValue = NULL;            
125
 
@@ -989,7 +988,7 @@
126
 
         switch (iSpecialField)
127
 
         {
128
 
           case SPF_FID:
129
 
-            snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%ld", GetFID() );
130
 
+            snprintf( szTempBuffer, sizeof szTempBufferSize, "%ld", GetFID() );
131
 
             return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
132
 
 
133
 
           case SPF_OGR_GEOMETRY:
134
 
@@ -1038,7 +1037,7 @@
135
 
     }
136
 
     else if( poFDefn->GetType() == OFTInteger )
137
 
     {
138
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
139
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize,
140
 
                   "%d", pauFields[iField].Integer );
141
 
         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
142
 
     }
143
 
@@ -1054,14 +1053,14 @@
144
 
         else
145
 
             strcpy( szFormat, "%.15g" );
146
 
         
147
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
148
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize,
149
 
                   szFormat, pauFields[iField].Real );
150
 
         
151
 
         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
152
 
     }
153
 
     else if( poFDefn->GetType() == OFTDateTime )
154
 
     {
155
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE,
156
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize,
157
 
                   "%04d/%02d/%02d %2d:%02d:%02d", 
158
 
                   pauFields[iField].Date.Year,
159
 
                   pauFields[iField].Date.Month,
160
 
@@ -1086,17 +1085,17 @@
161
 
 
162
 
             if( nMinutes == 0 )
163
 
                 snprintf( szTempBuffer+strlen(szTempBuffer), 
164
 
-                          TEMP_BUFFER_SIZE-strlen(szTempBuffer), "%02d", nHours );
165
 
+                          sizeof szTempBufferSize-strlen(szTempBuffer), "%02d", nHours );
166
 
             else
167
 
                 snprintf( szTempBuffer+strlen(szTempBuffer), 
168
 
-                          TEMP_BUFFER_SIZE-strlen(szTempBuffer), "%02d%02d", nHours, nMinutes );
169
 
+                          sizeof szTempBufferSize-strlen(szTempBuffer), "%02d%02d", nHours, nMinutes );
170
 
         }
171
 
 
172
 
         return m_pszTmpFieldValue = CPLStrdup( szTempBuffer );
173
 
     }
174
 
     else if( poFDefn->GetType() == OFTDate )
175
 
     {
176
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%04d/%02d/%02d",
177
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize, "%04d/%02d/%02d",
178
 
                   pauFields[iField].Date.Year,
179
 
                   pauFields[iField].Date.Month,
180
 
                   pauFields[iField].Date.Day );
181
 
@@ -1105,7 +1104,7 @@
182
 
     }
183
 
     else if( poFDefn->GetType() == OFTTime )
184
 
     {
185
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "%2d:%02d:%02d", 
186
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize, "%2d:%02d:%02d", 
187
 
                   pauFields[iField].Date.Hour,
188
 
                   pauFields[iField].Date.Minute,
189
 
                   pauFields[iField].Date.Second );
190
 
@@ -1117,7 +1116,7 @@
191
 
         char    szItem[32];
192
 
         int     i, nCount = pauFields[iField].IntegerList.nCount;
193
 
 
194
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
195
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
196
 
         for( i = 0; i < nCount; i++ )
197
 
         {
198
 
             snprintf( szItem, sizeof(szItem), "%d",
199
 
@@ -1155,7 +1154,7 @@
200
 
         else
201
 
             strcpy( szFormat, "%.16g" );
202
 
         
203
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
204
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
205
 
         for( i = 0; i < nCount; i++ )
206
 
         {
207
 
             snprintf( szItem, sizeof(szItem), szFormat,
208
 
@@ -1183,7 +1182,7 @@
209
 
     {
210
 
         int     i, nCount = pauFields[iField].StringList.nCount;
211
 
 
212
 
-        snprintf( szTempBuffer, TEMP_BUFFER_SIZE, "(%d:", nCount );
213
 
+        snprintf( szTempBuffer, sizeof szTempBufferSize, "(%d:", nCount );
214
 
         for( i = 0; i < nCount; i++ )
215
 
         {
216
 
             const char  *pszItem = pauFields[iField].StringList.paList[i];
217
 
@@ -1228,7 +1227,6 @@
218
 
     }
219
 
     else
220
 
         return "";
221
 
-#undef TEMP_BUFFER_SIZE
222
 
 }
223
 
 
224
 
 /************************************************************************/
225
 
Index: frmts/grass/makefile.vc
226
 
===================================================================
227
 
--- frmts/grass/makefile.vc     (revision 0)
228
 
+++ frmts/grass/makefile.vc     (revision 0)
229
 
@@ -0,0 +1,32 @@
230
 
+SRC            = grass57dataset.cpp
231
 
+OBJ            = grass57dataset.obj
232
 
+PLUGIN_DLL     = gdal_GRASS.dll
233
 
+LDEBUG         = /debug 
234
 
+
235
 
+CFLAGS         = -I $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)\include -I $(OSGEO4W_ROOT)\apps\gdal-16\include -I $(OSGEO4W_ROOT)\include /MD /EHsc
236
 
+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
237
 
+PLUGINDIR      = $(OSGEO4W_ROOT)\apps\gdal-16\bin\gdalplugins
238
 
+
239
 
+#CFLAGS        = -I $(OSGEO4W_ROOT)\include -I $(OSGEO4W_ROOT)\apps\grass\grass-$(GRASS_VERSION)\include /MD /EHsc /Od /Zi /DNDEBUG /Fdgdal_GRASS.pdb
240
 
+#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
241
 
+#PLUGINDIR     = $(OSGEO4W_ROOT)\bin\gdalplugins
242
 
+
243
 
+plugin: $(PLUGIN_DLL)
244
 
+
245
 
+$(PLUGIN_DLL): $(OBJ)
246
 
+       link /dll $(LDEBUG) /out:$(PLUGIN_DLL) $(OBJ) $(GDALLIB) $(GRASS_LIBS)
247
 
+       if exist $(PLUGIN_DLL).manifest mt -manifest $(PLUGIN_DLL).manifest -outputresource:$(PLUGIN_DLL);2
248
 
+       xcopy $(PLUGIN_DLL) $(PLUGINDIR) /y
249
 
+
250
 
+$(OBJ): $(SRC)
251
 
+       $(CC) $(CFLAGS) /c $(SRC)
252
 
+
253
 
+default:       $(OBJ)
254
 
+       xcopy /D  /Y *.obj ..\o
255
 
+
256
 
+clean:
257
 
+       -del *.obj *.manifest *.dll *.lib *.exp *.pdb
258
 
+
259
 
+plugin-install: $(PLUGIN_DLL)
260
 
+       -mkdir $(PLUGINDIR)
261
 
+       $(INSTALL) $(PLUGIN_DLL) $(PLUGINDIR)