Changes between Version 80 and Version 81 of UsersWikiWinCompile


Ignore:
Timestamp:
Oct 21, 2009, 6:03:26 AM (15 years ago)
Author:
robe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiWinCompile

    v80 v81  
    139139      10. ''configure --prefix=/c/mingw && make && make install''
    140140 
    141 '''10. Compiling libxml2 '''[[BR]]
     141'''9. Compiling PostgreSQL'''[[BR]]   
     142Download latest PostgreSQL source from http://www.postgresql.org/ftp/source/ and untar in C:\thesrc[[BR]]
     143move 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   
     148note that we now have changed the install-directory from mingw to postgres
     149
     150if you get an error something like:[[BR]]
     151e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING[[BR]]
     152In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39, [[BR]]
     153from libpq-int.h:57, [[BR]]
     154from fe-auth.h:18, [[BR]]
     155from fe-auth.c:48: [[BR]]
     156e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING
     157
     158the solution is to edit two of the source-files.[[BR]]
     159In both files: [[BR]]
     160postgresql-8.3.7/src/include/libpq/libpq-be.h [[BR]]
     161and [[BR]]
     162postgresql-8.3.7/src/interfaces/libpq/libpq-int.h:
     163
     164add 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
     171you can read about this here:[[BR]]
     172http://pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ [[BR]]
     173and[[BR]]
     174http://postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html [[BR]]
     175
     176'''10. Compiling GEOS'''[[BR]]
     177Download latest GEOS-source from trac.osgeo.org/geos/ ( http://download.osgeo.org/geos/geos-3.1.1.tar.bz2 )
     178and copy into C:\thesrc
     179
     180Extract with:
     181cd /thesrc
     182
     183bzip2 -d -c geos-3.1.1.tar.bz2 | tar -xvf -
     184
     185
     186Do the same as with postgresql, extract to c:\thesrc [[BR]]
     187in 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
     193NOTE: 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
     194to take advantage of the new ST_Buffer enhancements in PostGIS 1.5+ and also some fixes for topology exceptions in intersects and intersection.
     195
     196I 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
     201refer to [http://sourceforge.net/tracker/index.php?func=detail&aid=2373234&group_id=2435&atid=102435]
     202and [http://lists.osgeo.org/pipermail/geos-devel/2009-June/004240.html] for details
     203
     204If you are runnning gcc 4.4.0 and you get complaints about link g++ you probably need to do this too:
     205
     206and changing library_names='libstdc++.dll.a'
     207
     208to
     209#library_names='libstdc++.dll.a'
     210
     211library_names='libstdc++.a'
     212
     213As alluded to here http://www.nabble.com/GCC-4.4.0-fails-with-GMP-td24191439.html
     214
     215
     216'''11. Compiling Proj'''[[BR]]
     217Download latest Proj from trac.osgeo.org/proj/ (http://download.osgeo.org/proj/proj-4.6.1.zip ) [[BR]]
     218in 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]]
    142231This is only needed for PostGIS 1.5+.  Libxml2 is used to support the ST_GeomFromGML function.
    143232    a. Download the libxml special from here http://www.pokorra.de/coding/compile_libxml_mingw.html
     
    148237    d. ./configure
    149238    e. make && make install
    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])
    241241       1. Download postgis.refractions.net/download/postgis-1.4.0.tar.gz and put in C:/thesrc
    242242       2. ''cd /c/thesrc''
     
    251251       9. ''make check'' [UsersWikiMakeCheckConsiderations Make Check gotchas]
    252252
    253 '''14. To use your new postgis'''
     253'''15. To use your new postgis'''
    254254       1. copy postgis-1.4.dll from C:\postgresql\lib to your windows PostgreSQL lib folder
    255255       2. copy C:\postgresql\bin\libgeos-3-1-1.dll,libgeos_c-1.dll, libproj.dll, libiconv-2.dll (depending on which version it could be libiconv-2.dll or libiconv2.dll), shp2pgsql.exe, pgsql2shp.exe to your PostgreSQL bin folder