Native WinGRASS build instructions The binaries in the wingrass-extralibs.tar.gz package were compiled on an Msys/Mingw system more or less according to the notes in this file. Paul Kelly, 6th May 2007 zlib ---- zlib-1.2.3 http://www.zlib.net/ First patch it: --- zlib-1.2.3/configure~ Mon Jul 11 22:11:57 2005 +++ zlib-1.2.3/configure Mon Dec 11 22:57:11 2006 @@ -79,6 +79,11 @@ Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; CYGWIN* | Cygwin* | cygwin* | OS/2* ) EXE='.exe';; + MINGW32* ) + shared_ext='.dll' + SFLAGS=${CFLAGS} + LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.dll.1"} + EXE='.exe';; QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 # (alain.bonnefoy@icbt.com) LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};; CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --shared --prefix=/c/grass/extra make make install libpng ------ libpng-1.2.16-noconfig http://www.libpng.org/pub/png/libpng.html cp scripts/makefile.mingw ./Makefile Edit prefix, ZLIBLIB and ZLIBINC in Makefile Add at end: libpng.dll: $(OBJS) gcc -shared -o $@ $(OBJS) -L$(ZLIBLIB) -lz make make libpng.dll install libpng.dll /c/grass/extra/lib install -m 644 png.h pngconf.h /c/grass/extra/include xdrlib ------ xdr-4.0-mingw2 http://wiki.qgis.org/qgiswiki/BuildingWindowsBinaryOnLinux?action=AttachFile&do=get&target=xdr-4.0-mingw2.tar.gz (special stripped-down version with networking code removed) Copy in the config.guess file from the GRASS distribution. CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --prefix=/c/grass/extra make make install (Must compile this as a static library because of obscure problems with shared) Freetype -------- freetype-2.3.4 http://download.savannah.gnu.org/releases/freetype/freetype-2.3.4.tar.gz CPPFLAGS="-I/c/grass/extra/include" CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS="-s -L/c/grass/extra/lib" ./configure --enable-shared --disable-static --prefix=/c/grass/extra make make install FFTW ---- fftw-2.1.5 http://www.fftw.org/download.html CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --prefix=/c/grass/extra --disable-fortran --enable-shared --disable-static make make install Shared build doesn't seem to work though; results in a static library. So go into fftw directory and type: rm /c/grass/extra/lib/*fftw* gcc -s -shared -o libfftw.dll *.o install libfftw.dll /c/grass/extra/lib cd ../rfftw gcc -s -shared -o librfftw.dll -L/c/grass/extra/lib -lfftw *.o install librfftw.dll /c/grass/extra/lib PDCurses -------- PDCurses-3.1 http://pdcurses.sourceforge.net/ cd win32 Edit mingwin32.mak PDCURSES_HOME make -f mingwin32.mak mv pdcurses.a libcurses.a install libcurses.a /c/grass/extra/lib cd .. install -m 644 curses.h /c/grass/extra/include PROJ.4 ------ http://proj.maptools.org/ proj-4.5.0 CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --prefix=/c/grass/extra --enable-shared --disable-static make make install rm ./src/*.exe rm /c/grass/extra/lib/*proj* cd ./src/.libs gcc -shared -s -o libproj.dll -lm *.o install libproj.dll /c/grass/extra/lib cd .. gcc -s -g -O2 -o cs2cs.exe cs2cs.o gen_cheb.o p_series.o .libs/emess.o -L/c/grass/forgrass/lib -lproj gcc -s -g -O2 -o geod.exe geod.o geod_set.o geod_for.o geod_inv.o .libs/emess.o -L/c/grass/forgrass/lib -lproj gcc -s -g -O2 -o nad2bin.exe nad2bin.o gcc -s -g -O2 -o nad2nad.exe nad2nad.o .libs/emess.o -L/c/grass/forgrass/lib -lproj gcc -s -g -O2 -o proj.exe proj.o gen_cheb.o p_series.o .libs/emess.o -L/c/grass/forgrass/lib -lproj cp proj.exe invproj.exe cp geod.exe invgeod.exe for i in *.exe ; do install $i /c/grass/extra/bin ; done GDAL ---- gdal-1.4.1 http://trac.osgeo.org/gdal/wiki/DownloadSource CFLAGS="-O2 -s" CXXFLAGS="-O2 -s" LDFLAGS=-s ./configure --without-libtool --prefix=/c/grass/extra --enable-shared --disable-static --with-libz=/c/grass/extra --with-png=/c/grass/extra make make install rm /c/grass/extra/lib/libgdal.a g++ -s -shared -o ./libgdal.dll -L/c/grass/extra/lib -lz -lpng ./frmts/o/*.o ./gcore/*.o ./port/*.o ./alg/*.o ./ogr/ogrsf_frmts/o/*.o ./ogr/ogrgeometryfactory.o ./ogr/ogrpoint.o ./ogr/ogrcurve.o ./ogr/ogrlinestring.o ./ogr/ogrlinearring.o ./ogr/ogrpolygon.o ./ogr/ogrutils.o ./ogr/ogrgeometry.o ./ogr/ogrgeometrycollection.o ./ogr/ogrmultipolygon.o ./ogr/ogrsurface.o ./ogr/ogrmultipoint.o ./ogr/ogrmultilinestring.o ./ogr/ogr_api.o ./ogr/ogrfeature.o ./ogr/ogrfeaturedefn.o ./ogr/ogrfeaturequery.o ./ogr/ogrfeaturestyle.o ./ogr/ogrfielddefn.o ./ogr/ogrspatialreference.o ./ogr/ogr_srsnode.o ./ogr/ogr_srs_proj4.o ./ogr/ogr_fromepsg.o ./ogr/ogrct.o ./ogr/ogr_opt.o ./ogr/ogr_srs_esri.o ./ogr/ogr_srs_pci.o ./ogr/ogr_srs_usgs.o ./ogr/ogr_srs_dict.o ./ogr/ogr_srs_panorama.o ./ogr/swq.o ./ogr/ogr_srs_validate.o ./ogr/ogr_srs_xml.o ./ogr/ograssemblepolygon.o ./ogr/ogr2gmlgeometry.o ./ogr/gml2ogrgeometry.o install libgdal.dll /c/grass/extra/lib cd ogr g++ -s ogrinfo.o -o ogrinfo.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s ogr2ogr.o -o ogr2ogr.exe -lgdal -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s ogrtindex.o -o ogrtindex.exe -lgdal -L/c/grass/extra/lib -lpng -lz -lgdal install ogrinfo.exe ogr2ogr.exe ogrtindex.exe /c/grass/extra/bin cd ../apps g++ -s gdalinfo.o -o gdalinfo.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdal_translate.o -o gdal_translate.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdaladdo.o -o gdaladdo.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdalwarp.o -o gdalwarp.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdal_contour.o -o gdal_contour.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdaltindex.o -o gdaltindex.exe -L/c/grass/extra/lib -lpng -lz -lgdal g++ -s gdal_rasterize.o -o gdal_rasterize.exe -L/c/grass/extra/lib -lpng -lz -lgdal install gdalinfo.exe gdal_translate.exe gdaladdo.exe gdalwarp.exe gdal_contour.exe gdaltindex.exe gdal_rasterize.exe /c/grass/extra/bin Manually edit gdal-config to replace the static library reference with -lgdal GRASS ----- PATH="/c/grass/extra/bin:/c/grass/extra/lib:$PATH" export PATH ./configure --prefix=c:/grass --bindir=c:/grass/bin --with-includes=/c/grass/extra/include --with-libs=/c/grass/extra/lib --with-cxx --without-jpeg --without-tiff --without-postgres --with-opengl=windows --with-fftw --with-freetype --with-freetype-includes=/c/grass/extra/include/freetype2 --without-x --enable-x11=no --enable-shared=yes --with-tcltk-includes=/c/tcl/include --with-tcltk-libs=/c/tcl/bin --with-proj-share=/c/grass/extra/share/proj