Changes between Initial Version and Version 1 of UsersWikiWinCompile


Ignore:
Timestamp:
Apr 15, 2009, 11:32:13 AM (15 years ago)
Author:
nicklas
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiWinCompile

    v1 v1  
     1I have used this installdirectories:
     2MinGW: c:\MinGW
     3Msys: c:\msys
     4sources c:\thesrc
     5installdirectory for postgresql: c:\postgresql
     6a good tool for extracting tar-files is 7-zip from www.7-zip.org
     7
     8Installing Minimalist GNU for Windows (MinGW)
     9Download 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) 
     15Msys provides you with a unix shell environment for compiling code under windows
     16
     17Download 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
     24Download 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   
     31Download and install the following from gnuwin32.sourceforge.net/packages.html
     32Change install directory to c:\mingw
     33 
     34Bison (kent.dl.sourceforge.net/sourceforge/gnuwin32/bison-2.1.exe)
     35zlib (kent.dl.sourceforge.net/sourceforge/gnuwin32/zlib-1.2.3.exe)
     36Flex
     37GetText
     38LibIconv
     39
     40update m4 by downloading downloads.sourceforge.net/mingw/m4-1.4.7-MSYS.tar.bz2
     41untar and copy the m4.exe-file in the end of the path to C:\msys\1.0\bin
     42
     43
     44between the lines is copied direct from www.mingw.org/wiki/HOWTO_Install_the_MinGW_GCC_Compiler_Suite
     45--------------------------------------------------------------------
     46
     47Environment Settings
     48
     49When 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
     51Warning: 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   
     63Set the environment variable HOME to C:\msys\1.0\home
     64
     65Now, download the sourcecode of :
     66autoconf from ftp.gnu.org/gnu/autoconf
     67automake  from ftp.gnu.org/gnu/automake
     68libtool   from ftp.gnu.org/gnu/libtool
     69
     70The latest releases 2009-04-11 is:
     71autoconf 2.63 (1.4MB)
     72automake 1.10.2 (1.2MB)
     73libtool  2.2.4 (1.8MB)
     74
     75make a filder c:\thesrc and untar the source-files there
     76
     77Launch MSys from Start->Programs->MinGW->msys
     78now you get a terminal-window that understands a bunch of unix/linux-commands (at least enough for compiling)
     79print
     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 
     111Download latest PostgreSQL source and untar in C:\thesrc
     112move to folder
     113cd /c/thesrc/postgresql-8.3.7 (the version of today)
     114configure --prefix-/c/postgres && make && make install
     115
     116note that we now have changed the install-directory from mingw to postgres
     117
     118if you get an error something like:
     119e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/sspi.h:60: error: syntax error before SECURITY_STRING
     120In file included from e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/security.h:39,
     121from libpq-int.h:57,
     122from fe-auth.h:18,
     123from fe-auth.c:48:
     124e:/mingw/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ntsecpkg.h:123: error: syntax error before SECURITY_STRING
     125
     126the solution is to edit two of the source-files.
     127In both files:
     128postgresql-8.3.7/src/include/libpq/libpq-be.h
     129and
     130postgresql-8.3.7/src/interfaces/libpq/libpq-int.h:
     131
     132add 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
     139read about this here:
     140pgolub.wordpress.com/2008/12/15/building-postgresql-client-library-using-mingw-under-winxp-sp3/
     141and
     142postgresqlorg.blogspot.com/2008/09/hackers-83-4-vista-mingw-initdb.html
     143
     144
     145Compiling GEOS
     146Download latest GEOS -- from trac.osgeo.org/geos/ (download.osgeo.org/geos/geos-3.1.0rc2.tar.bz2)
     147Do the same as with postgresql, extract to c:\thesrc
     148in msys terminal print
     149configure --prefix-/c/postgres && make && make install
     150
     151Compiling Proj
     152Download latest Proj -- from trac.osgeo.org/proj/ (download.osgeo.org/proj/proj-4.6.1.zip)
     153in msys terminal print
     154configure --prefix-/c/postgres && make && make install
     155
     156Compiling 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