141 | | '''10. Compiling libxml2 '''[[BR]] |
| 141 | '''9. Compiling PostgreSQL'''[[BR]] |
| 142 | Download latest PostgreSQL source from http://www.postgresql.org/ftp/source/ and untar in C:\thesrc[[BR]] |
| 143 | move to folder[[BR]] |
| 144 | 1. ''cd /c/thesrc/postgresql-8.3.7'' (the version of today) |
| 145 | 2. ''configure --prefix=/c/postgres && make && make install'' |
| 146 | 3. If you want to be able to do a full make check on PostGIS, [UsersWikiWinCompileInitdb Initialize the postgresql database cluster] |
| 147 | |
| 148 | note that we now have changed the install-directory from mingw to postgres |
| 149 | |
| 150 | if you get an error something like:[[BR]] |
| 151 | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING[[BR]] |
| 152 | In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39, [[BR]] |
| 153 | from libpq-int.h:57, [[BR]] |
| 154 | from fe-auth.h:18, [[BR]] |
| 155 | from fe-auth.c:48: [[BR]] |
| 156 | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING |
| 157 | |
| 158 | the solution is to edit two of the source-files.[[BR]] |
| 159 | In both files: [[BR]] |
| 160 | postgresql-8.3.7/src/include/libpq/libpq-be.h [[BR]] |
| 161 | and [[BR]] |
| 162 | postgresql-8.3.7/src/interfaces/libpq/libpq-int.h: |
| 163 | |
| 164 | add a new include-file:[[BR]] |
| 165 | #ifdef ENABLE_SSPI[[BR]] |
| 166 | #define SECURITY_WIN32[[BR]] |
| 167 | #include <ntsecapi.h> '''<- Add this include'''[[BR]] |
| 168 | #include <security.h>[[BR]] |
| 169 | #undef SECURITY_WIN32[[BR]] |
| 170 | |
| 171 | you can read about this here:[[BR]] |
| 172 | http://pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ [[BR]] |
| 173 | and[[BR]] |
| 174 | http://postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html [[BR]] |
| 175 | |
| 176 | '''10. Compiling GEOS'''[[BR]] |
| 177 | Download latest GEOS-source from trac.osgeo.org/geos/ ( http://download.osgeo.org/geos/geos-3.1.1.tar.bz2 ) |
| 178 | and copy into C:\thesrc |
| 179 | |
| 180 | Extract with: |
| 181 | cd /thesrc |
| 182 | |
| 183 | bzip2 -d -c geos-3.1.1.tar.bz2 | tar -xvf - |
| 184 | |
| 185 | |
| 186 | Do the same as with postgresql, extract to c:\thesrc [[BR]] |
| 187 | in msys terminal move to the GEOS source-code directory[[BR]] |
| 188 | 1. ''configure --prefix=/c/postgres && make && make install'' |
| 189 | 2. To strip all the debug info weight from the libgeos-3-1-1.dll run |
| 190 | |
| 191 | strip /c/postgres/bin/libgeos-3-1-1.dll |
| 192 | |
| 193 | NOTE: If you are compiling the latest GEOS 3.2 (geos/trunk, you may get an error because of a bug in MingW). GEOS 3.2 is needed |
| 194 | to take advantage of the new ST_Buffer enhancements in PostGIS 1.5+ and also some fixes for topology exceptions in intersects and intersection. |
| 195 | |
| 196 | I had to comment out like below -- change lines (159, 166) to below (in C:\MinGW\include\c++\3.4.5\cwchar (same issue exists under gcc 4.4.0) |
| 197 | //using ::swprintf; |
| 198 | |
| 199 | //using ::vswprintf; |
| 200 | |
| 201 | refer to [http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435] |
| 202 | and [http://lists.osgeo.org/pipermail/geos-devel/2009-June/004240.html] for details |
| 203 | |
| 204 | If you are runnning gcc 4.4.0 and you get complaints about link g++ you probably need to do this too: |
| 205 | |
| 206 | and changing library_names='libstdc++.dll.a' |
| 207 | |
| 208 | to |
| 209 | #library_names='libstdc++.dll.a' |
| 210 | |
| 211 | library_names='libstdc++.a' |
| 212 | |
| 213 | As alluded to here http://www.nabble.com/GCC-4.4.0-fails-with-GMP-td24191439.html |
| 214 | |
| 215 | |
| 216 | '''11. Compiling Proj'''[[BR]] |
| 217 | Download latest Proj from trac.osgeo.org/proj/ (http://download.osgeo.org/proj/proj-4.6.1.zip ) [[BR]] |
| 218 | in msys terminal move to the Proj source-code directory[[BR]] |
| 219 | 1. ''./configure --prefix=/c/postgres --enable-shared --disable-static '' |
| 220 | 2. ''make && make install'' |
| 221 | --Make the libproj.dll and make it dynamically linked |
| 222 | 3. cd /c/postgres/lib |
| 223 | 4. gcc -shared -o libproj.dll -Wl,--out-implib=libproj.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive libproj.a -Wl,--no-whole-archive /c/mingw/lib/libmingw32.a |
| 224 | |
| 225 | |
| 226 | '''12. Installing C-Unit -- needed for PostGIS 1.4 and above make check''' |
| 227 | 1. download http://sourceforge.net/projects/cunit/files/CUnit/CUnit-2.1-0-winlib.zip |
| 228 | 2. extract and copy contents to C:\MingW |
| 229 | |
| 230 | '''13. Compiling libxml2 '''[[BR]] |
150 | | '''9. Compiling PostgreSQL'''[[BR]] |
151 | | Download latest PostgreSQL source from http://www.postgresql.org/ftp/source/ and untar in C:\thesrc[[BR]] |
152 | | move to folder[[BR]] |
153 | | 1. ''cd /c/thesrc/postgresql-8.3.7'' (the version of today) |
154 | | 2. ''configure --prefix=/c/postgres && make && make install'' |
155 | | 3. If you want to be able to do a full make check on PostGIS, [UsersWikiWinCompileInitdb Initialize the postgresql database cluster] |
156 | | |
157 | | note that we now have changed the install-directory from mingw to postgres |
158 | | |
159 | | if you get an error something like:[[BR]] |
160 | | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING[[BR]] |
161 | | In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39, [[BR]] |
162 | | from libpq-int.h:57, [[BR]] |
163 | | from fe-auth.h:18, [[BR]] |
164 | | from fe-auth.c:48: [[BR]] |
165 | | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING |
166 | | |
167 | | the solution is to edit two of the source-files.[[BR]] |
168 | | In both files: [[BR]] |
169 | | postgresql-8.3.7/src/include/libpq/libpq-be.h [[BR]] |
170 | | and [[BR]] |
171 | | postgresql-8.3.7/src/interfaces/libpq/libpq-int.h: |
172 | | |
173 | | add a new include-file:[[BR]] |
174 | | #ifdef ENABLE_SSPI[[BR]] |
175 | | #define SECURITY_WIN32[[BR]] |
176 | | #include <ntsecapi.h> '''<- Add this include'''[[BR]] |
177 | | #include <security.h>[[BR]] |
178 | | #undef SECURITY_WIN32[[BR]] |
179 | | |
180 | | you can read about this here:[[BR]] |
181 | | http://pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ [[BR]] |
182 | | and[[BR]] |
183 | | http://postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html [[BR]] |
184 | | |
185 | | '''10. Compiling GEOS'''[[BR]] |
186 | | Download latest GEOS-source from trac.osgeo.org/geos/ ( http://download.osgeo.org/geos/geos-3.1.1.tar.bz2 ) |
187 | | and copy into C:\thesrc |
188 | | |
189 | | Extract with: |
190 | | cd /thesrc |
191 | | |
192 | | bzip2 -d -c geos-3.1.1.tar.bz2 | tar -xvf - |
193 | | |
194 | | |
195 | | Do the same as with postgresql, extract to c:\thesrc [[BR]] |
196 | | in msys terminal move to the GEOS source-code directory[[BR]] |
197 | | 1. ''configure --prefix=/c/postgres && make && make install'' |
198 | | 2. To strip all the debug info weight from the libgeos-3-1-1.dll run |
199 | | |
200 | | strip /c/postgres/bin/libgeos-3-1-1.dll |
201 | | |
202 | | NOTE: If you are compiling the latest GEOS 3.2 (geos/trunk, you may get an error because of a bug in MingW). GEOS 3.2 is needed |
203 | | to take advantage of the new ST_Buffer enhancements in PostGIS 1.5+ and also some fixes for topology exceptions in intersects and intersection. |
204 | | |
205 | | I had to comment out like below -- change lines (159, 166) to below (in C:\MinGW\include\c++\3.4.5\cwchar (same issue exists under gcc 4.4.0) |
206 | | //using ::swprintf; |
207 | | |
208 | | //using ::vswprintf; |
209 | | |
210 | | refer to [http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435] |
211 | | and [http://lists.osgeo.org/pipermail/geos-devel/2009-June/004240.html] for details |
212 | | |
213 | | If you are runnning gcc 4.4.0 and you get complaints about link g++ you probably need to do this too: |
214 | | |
215 | | and changing library_names='libstdc++.dll.a' |
216 | | |
217 | | to |
218 | | #library_names='libstdc++.dll.a' |
219 | | |
220 | | library_names='libstdc++.a' |
221 | | |
222 | | As alluded to here http://www.nabble.com/GCC-4.4.0-fails-with-GMP-td24191439.html |
223 | | |
224 | | |
225 | | '''11. Compiling Proj'''[[BR]] |
226 | | Download latest Proj from trac.osgeo.org/proj/ (http://download.osgeo.org/proj/proj-4.6.1.zip ) [[BR]] |
227 | | in msys terminal move to the Proj source-code directory[[BR]] |
228 | | 1. ''./configure --prefix=/c/postgres --enable-shared --disable-static '' |
229 | | 2. ''make && make install'' |
230 | | --Make the libproj.dll and make it dynamically linked |
231 | | 3. cd /c/postgres/lib |
232 | | 4. gcc -shared -o libproj.dll -Wl,--out-implib=libproj.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive libproj.a -Wl,--no-whole-archive /c/mingw/lib/libmingw32.a |
233 | | |
234 | | |
235 | | '''12. Installing C-Unit -- needed for PostGIS 1.4 and above make check''' |
236 | | 1. download http://sourceforge.net/projects/cunit/files/CUnit/CUnit-2.1-0-winlib.zip |
237 | | 2. extract and copy contents to C:\MingW |
238 | | |
239 | | |
240 | | '''13. Compiling PostGIS SVN 1.4 (without shp2pgql-gui)''' (if you want to install with the GUI you need GTK [UsersWikiWinCompileWithgui Install GTK and PostGIS 1.4 with GUI]) |
| 239 | |
| 240 | '''14. Compiling PostGIS SVN 1.4 (without shp2pgql-gui)''' (if you want to install with the GUI you need GTK [UsersWikiWinCompileWithgui Install GTK and PostGIS 1.4 with GUI]) |