Version 9 (modified by 14 years ago) ( diff ) | ,
---|
Get MinGW, MSYS, w32api, binutils and install them (this may not be a comprehensive list but start with MinGW and execute the install package and try to add gcc etc. - the tar packages you just unpack to c:\mingw). Then open MSYS prompt, go to the dir where you unpacked GDAL, and issue commands (but see below for configure switches):
./configure make make install
And you should have libgdal-1.dll in your c:\msys\1.0\local\bin and libgdal-1.dll.a in c:\msys\1.0\local\lib.
linking:
Edit libtool at line 6114 to sed out the MSYS-anchored absolute path and replace it by a relative path or possibly a Windows drive-based absolute path.
or
Edit GNUmakefile on lines 6-12 and replace $(GDAL_ROOT) with . (a dot).
expat:
By default configure tries to add support for Expat. To enable it, use configure switch --with-expat=/c/mingw, get libexpat.dll and create an import library into /c/mingw/lib with commands (in mingw\bin):
pexports libexpat.dll | perl def.pl >libexpat.def dlltool -d libexpat.def -l ..\lib\libexpat.dll.a
where def.pl is a small perl program to add an underscored alias:
while (<STDIN>) { $a = $_; print $_; if (/^XML/) { chomp; s/\r//; print '_'."$_ = $a"; } }
See also http://trac.osgeo.org/gdal/ticket/2050, i.e., patch configure with
#expat_lib_flags="-L$expat_prefix/lib -lexpat" LIBS="$LIBS -L$expat_prefix/lib -lexpat"
before
run_expat_test="yes"
in configure.
GTK+:
If you have a development version of GTK+ installed, its (old) libtiff may confuse the building. It is best to use --with-libtiff=internal and move tiff headers and libraries away from sight.
configure detects GTK+ provided libz, libpng and libjpeg but in compile time zlib.h etc are not found. This correct way to fix this is probably to use --with-jpeg=/c/gtk/include --with-libz=/c/gtk/include --with-png=/c/gtk/include.
PostgreSQL and PostGIS:
I've successfully used
--with-pg=/c/Progra~1/PostgreSQL/8.2/bin/pg_config