| 1 | I have used this installdirectories: |
| 2 | MinGW: c:\MinGW |
| 3 | Msys: c:\msys |
| 4 | sources c:\thesrc |
| 5 | installdirectory for postgresql: c:\postgresql |
| 6 | a good tool for extracting tar-files is 7-zip from www.7-zip.org |
| 7 | |
| 8 | Installing Minimalist GNU for Windows (MinGW) |
| 9 | Download MinGW autoinstaller (Current - MinGW-5.1.4) from sourceforge.net/project/showfiles.php?group_id=2435 |
| 10 | 1. Run the setup file and choose everything (except possibly Ada) |
| 11 | 2. Accept the default Install location of C:\MinGW |
| 12 | |
| 13 | |
| 14 | 3. Installing Minimal System (Mys) |
| 15 | Msys provides you with a unix shell environment for compiling code under windows |
| 16 | |
| 17 | Download Msys downloads.sourceforge.net/mingw/MSYS-1.0.10.exe |
| 18 | 4. Say y to post Installation |
| 19 | 5. When prompted do you have MinGW -> y |
| 20 | 6. When prompted for where it is type -> C:\MinGW |
| 21 | |
| 22 | |
| 23 | 7. Installing Msy Development Toolkit |
| 24 | Download the MysDTK1.0.1 from downloads.sourceforge.net/mingw/msysDTK-1.0.1.exe |
| 25 | 8. Run the EXE install and accept all the defaults |
| 26 | |
| 27 | 9. Download MSYS Core 1.0.11 fromhttp://downloads.sourceforge.net/mingw/msysCORE-1.0.11-2007.01.19-1.tar.bz2 |
| 28 | untar them and copy all content to c:\msys\1.0 and and click ok to overwrite existing files and folders. |
| 29 | |
| 30 | |
| 31 | Download and install the following from gnuwin32.sourceforge.net/packages.html |
| 32 | Change install directory to c:\mingw |
| 33 | |
| 34 | Bison (kent.dl.sourceforge.net/sourceforge/gnuwin32/bison-2.1.exe) |
| 35 | zlib (kent.dl.sourceforge.net/sourceforge/gnuwin32/zlib-1.2.3.exe) |
| 36 | Flex |
| 37 | GetText |
| 38 | LibIconv |
| 39 | |
| 40 | update m4 by downloading downloads.sourceforge.net/mingw/m4-1.4.7-MSYS.tar.bz2 |
| 41 | untar and copy the m4.exe-file in the end of the path to C:\msys\1.0\bin |
| 42 | |
| 43 | |
| 44 | between the lines is copied direct from www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite |
| 45 | -------------------------------------------------------------------- |
| 46 | |
| 47 | Environment Settings |
| 48 | |
| 49 | When you install command line tools, such as MinGW, or GnuWin32 tools, you have to tell the command line interpreter where to find them; this is usually accomplished by adding the appropriate directory names to the PATH variable in your environment. Typically, it is your responsibility to do this; please do not expect the installer, (if you used one), to do it for you. |
| 50 | |
| 51 | Warning: Adding entries to the PATH is normally benign. However, if you delete, you may mess up your PATH string, and you could seriously compromise the functioning of your computer. Please be careful. |
| 52 | |
| 53 | 1. Right-click on "My Computer" and select "Properties". |
| 54 | 2. Click Advanced -> Environment Variables. |
| 55 | 3. In the box entitled "System Variables" scroll down to the line that says "PATH" and double-click the entry. |
| 56 | 4. You will be presented with a dialog box with two text boxes, the bottom text box allows you to edit the PATH variable. It is very important that you do not delete the existing values in the PATH string, this will cause all sorts of problems for you! |
| 57 | 5. Scroll to the end of the string and at the end add ";<installation-directory>\bin". Here <installation-directory> is the full absolute path name of the installation directory; if you accepted the defaults when installing tar and gzip, then for these, it will (probably) be C:\Program Files\GnuWin32, while for MinGW it will be C:\MinGW\bin, (if you kept to the recommended default installation directory). Don't forget the semicolon; this separates the entries in the PATH. |
| 58 | 6. press OK -> OK -> OK and you are done. |
| 59 | |
| 60 | |
| 61 | ----------------------------------------------------------------------- |
| 62 | |
| 63 | Set the environment variable HOME to C:\msys\1.0\home |
| 64 | |
| 65 | Now, download the sourcecode of : |
| 66 | autoconf from ftp.gnu.org/gnu/autoconf |
| 67 | automake from ftp.gnu.org/gnu/automake |
| 68 | libtool from ftp.gnu.org/gnu/libtool |
| 69 | |
| 70 | The latest releases 2009-04-11 is: |
| 71 | autoconf 2.63 (1.4MB) |
| 72 | automake 1.10.2 (1.2MB) |
| 73 | libtool 2.2.4 (1.8MB) |
| 74 | |
| 75 | make a filder c:\thesrc and untar the source-files there |
| 76 | |
| 77 | Launch MSys from Start->Programs->MinGW->msys |
| 78 | now you get a terminal-window that understands a bunch of unix/linux-commands (at least enough for compiling) |
| 79 | print |
| 80 | 1. cd /c/thesrc |
| 81 | 2. ls |
| 82 | Now you will get the filders you have copied to the directory listed. |
| 83 | The names of the folders will be different than in this example if you have newer releases of the tools. |
| 84 | 4 cd autoconf-2.63 |
| 85 | |
| 86 | ok, now we are in the directory with the autoconf source-code |
| 87 | print |
| 88 | ls |
| 89 | if you just see a new folder called autoconf-2.63 you have to go into that one to: cd autoconf-2.63 |
| 90 | when you se a lot of folders like bin and lib and a lot of files, then you are right |
| 91 | now we shall configure and make this tool |
| 92 | print |
| 93 | 5 configure --prefix-/c/mingw && make && make install |
| 94 | |
| 95 | now a lot of text shall appear in the window and after a while you will hopefully get no error-messages but jut get back to your prompt. |
| 96 | |
| 97 | now go to the other source-code directories and do the same |
| 98 | |
| 99 | |
| 100 | cd .. (backing to the directory c:\thesrc) |
| 101 | cd automake-1.10.2 |
| 102 | configure --prefix-/c/mingw && make && make install |
| 103 | |
| 104 | cd .. (backing to the directory c:\thesrc) |
| 105 | cd libtool-2.2.4 |
| 106 | configure --prefix-/c/mingw && make && make install |
| 107 | |
| 108 | 3. Compiling PostgreSQL |
| 109 | |
| 110 | |
| 111 | Download latest PostgreSQL source and untar in C:\thesrc |
| 112 | move to folder |
| 113 | cd /c/thesrc/postgresql-8.3.7 (the version of today) |
| 114 | configure --prefix-/c/postgres && make && make install |
| 115 | |
| 116 | note that we now have changed the install-directory from mingw to postgres |
| 117 | |
| 118 | if you get an error something like: |
| 119 | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING |
| 120 | In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39, |
| 121 | from libpq-int.h:57, |
| 122 | from fe-auth.h:18, |
| 123 | from fe-auth.c:48: |
| 124 | e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING |
| 125 | |
| 126 | the solution is to edit two of the source-files. |
| 127 | In both files: |
| 128 | postgresql-8.3.7/src/include/libpq/libpq-be.h |
| 129 | and |
| 130 | postgresql-8.3.7/src/interfaces/libpq/libpq-int.h: |
| 131 | |
| 132 | add a new include-file: |
| 133 | #ifdef ENABLE_SSPI |
| 134 | #define SECURITY_WIN32 |
| 135 | #include <ntsecapi.h> <- Add this include |
| 136 | #include <security.h> |
| 137 | #undef SECURITY_WIN32 |
| 138 | |
| 139 | read about this here: |
| 140 | pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/ |
| 141 | and |
| 142 | postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html |
| 143 | |
| 144 | |
| 145 | Compiling GEOS |
| 146 | Download latest GEOS -- from trac.osgeo.org/geos/ (download.osgeo.org/geos/geos-3.1.0rc2.tar.bz2) |
| 147 | Do the same as with postgresql, extract to c:\thesrc |
| 148 | in msys terminal print |
| 149 | configure --prefix-/c/postgres && make && make install |
| 150 | |
| 151 | Compiling Proj |
| 152 | Download latest Proj -- from trac.osgeo.org/proj/ (download.osgeo.org/proj/proj-4.6.1.zip) |
| 153 | in msys terminal print |
| 154 | configure --prefix-/c/postgres && make && make install |
| 155 | |
| 156 | Compiling PostGIS SVN 1.4 |
| 157 | 1. Download postgis.refractions.net/download/postgis-1.4.0SVN.tar.gz and put in C:/thesrc |
| 158 | 2. cd /c/thesrc |
| 159 | 3. gzip -d -c postgis-1.4.0SVN.tar.gz | tar xvf - |
| 160 | 4. cd postgis-svn |
| 161 | 5. configure --prefix=/c/postgresql --with-pgconfig=/c/postgresql/bin/pg_config -with-geosconfig=/c/postgresql/bin/geos-config --with-projdir=/c/postgresql |
| 162 | 6. make |
| 163 | 7. make install |
| 164 | 8. copy postgis-1.4.dll from C:\postgresql\lib to your windows PostgreSQL lib folder |
| 165 | 9. copy C:\postgresql\bin\libgeos-3-1-0.dll and libgeos_c-1.dll to your PostgreSQL bin folder |
| 166 | |