[postgis-devel] Patch for building PostGIS on Windows from CVS

Jean David TECHER davidtecher at yahoo.fr
Tue Apr 26 02:23:50 PDT 2005


Hi Sandro,

configure -with-geos.....works..OK!!

U're right..it is not worth typing 'which geos'...sorry...

Before building postgis it's better to update the PATH environment variable
by adding at the beginning of PATH

C:\PostgreSQL\8.0.2\bin;C:\PostgreSQL\8.0.2\lib;C:\PostgreSQL\8.0.2\lib\post
gresql

Should replae "C:\PostgreSQL\8.0.2" by the path to your PostgreSQL's
prefix...

My patch is attached to this mail (postgis_cvs.patch)...In order to applyng
it (thanks to Gerald for patching :-))

(I know that U know how to do...:-) )

copy the patch in the same directory of postgis directory:

/postgis
/postgis_cvs.patch

patch -p0 < postgis_cvs.patch



In my last mail I did a little mistake for Makefile;config.in...sorry

PGCONFIG=@PGCONFIG@
 PGFEINCLUDES=@PGFEINCLUDES@
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+PGBEINCLUDES=@PGBEINCLUDES@ @PGBEINCLUDES@/port @PGBEINCLUDES@/port/win32
@PGBEINCLUDES@/port/win32/arpa
+PGFELIBS=$(shell @PGCONFIG@ --libdir)
+else
 PGBEINCLUDES=@PGBEINCLUDES@
 PGFELIBS=@PGFELIBS@

NOTICE: BUILDING POSTGIS DOCUMENTATION

The last thing to do -  for people who wants to compil postgis on windows -
is to take care of Docbook, iconv.dll and xsltproc
Else 'make install' wil stop for "make -C doc"

The best link I know for that is http://xmlsoft.org/sources/win32 They have
to download:

- iconv-1.9.1.win32.zip ( contains icon.exe and iconv.dll)

- libxml2-2.6 18.win32.zip

- libxslt-1.1.13.win32.zip (contains xsltproc.exe)

and install it to MinGW repository (C:\MinGW)

For DocBook XSL files, they have to download from
http://sourceforge.net/projects/docbook (find docbook-xsl version 1.68.1
or
http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.68.1.zip?download

then to create the DOS path  C:\msys\1.0\share\sgml\docbook\xsl-stylesheets
(or GNU/Linux PATH /usr/share/sgml/docbook/xsl-stylesheets)
and finally copy the contents of docbook-xsl-1.68.1.zip ( commons, fo, ...)
in this directory  C:\msys\1.0\share\sgml\docbook\xsl-stylesheets

For people who wants to build postgis.pdf ( postgis.fo ----------->
postgis.pdf ), I pupose to use (FOP from java) or install MikTeX (= laTeX
distribution) for windows that contains pdfxmltex.exe


============================================================================
================================

Here is the contense of the patch:

--- postgis/Makefile.config.in Tue Apr 19 10:41:21 2005
+++ postgis/Makefile.config.in Mon Apr 25 12:43:59 2005
@@ -71,9 +71,13 @@
 #
 PGCONFIG=@PGCONFIG@
 PGFEINCLUDES=@PGFEINCLUDES@
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+PGBEINCLUDES=@PGBEINCLUDES@ @PGBEINCLUDES@/port @PGBEINCLUDES@/port/win32
@PGBEINCLUDES@/port/win32/arpa
+PGFELIBS=$(shell @PGCONFIG@ --libdir)
+else
 PGBEINCLUDES=@PGBEINCLUDES@
 PGFELIBS=@PGFELIBS@
-
+endif
 #
 # Docbook
 #
@@ -112,8 +116,13 @@
 #
 # DLL
 #
-DLSUFFIX=@DLSUFFIX@
-DLFLAGS=@DLFLAGS@
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+ DLSUFFIX=.dll
+ DLFLAGS=@DLFLAGS@
+else
+ DLSUFFIX=@DLSUFFIX@
+ DLFLAGS=@DLFLAGS@
+endif

 #---------------------------------------------------------------
 # END OF CONFIGURATION
--- postgis/loader/Makefile Mon Apr 18 14:46:48 2005
+++ postgis/loader/Makefile Mon Apr 25 12:40:44 2005
@@ -32,7 +32,13 @@
  $(CC) $(CFLAGS) $(PGFEINCLUDES) -c $<

 pgsql2shp$(EXE): $(OBJS) pgsql2shp.o PQunescapeBytea.o
+
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+ $(CC) $(CFLAGS) $(OBJS) PQunescapeBytea.o pgsql2shp.o $(LDFLAGS)
$(PGFELIBS)/libpq.a -o $@
+else
  $(CC) $(CFLAGS) $(PGFELIBS) $(OBJS) PQunescapeBytea.o pgsql2shp.o
$(LDFLAGS) -o $@
+endif
+

 shp2pgsql$(EXE): $(OBJS) shp2pgsql.o
  $(CC) $(CFLAGS) $(OBJS) shp2pgsql.o $(LDFLAGS) -o $@
--- postgis/lwgeom/Makefile Wed Apr 20 15:17:37 2005
+++ postgis/lwgeom/Makefile Mon Apr 25 12:09:17 2005
@@ -13,21 +13,32 @@
 # Shared library parameters.
 #
 NAME=lwgeom
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+SHLIB           =
lib$(NAME).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)$(DLSUFFIX)
+SHLIB_MAJOR     = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
+SHLIB_BARE      = lib$(NAME)$(DLSUFFIX)
+SHLIB_LINK  =
+else
 SHLIB           =
lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
 SHLIB_MAJOR     = lib$(NAME)$(DLSUFFIX).$(SO_MAJOR_VERSION)
 SHLIB_BARE      = lib$(NAME)$(DLSUFFIX)
-SHLIB_LINK  = $(DLFLAGS)
+SHLIB_LINK  = $(DLFLAGS)
+endif

 MODULE_FILENAME = $(LPATH)/$(SHLIB)

 #---------------------------------------------------------------
 # Postgis version and build date
 #---------------------------------------------------------------
-
-POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
-POSTGIS_LIB_VERSION =
$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
-POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
-
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+ POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
+ POSTGIS_LIB_VERSION =
$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
+ POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
+else
+ POSTGIS_VERSION = $(SO_MAJOR_VERSION).$(SO_MINOR_VERSION)
USE_GEOS=$(USE_GEOS) USE_PROJ=$(USE_PROJ) USE_STATS=$(USE_STATS)
+ POSTGIS_LIB_VERSION =
$(SO_MAJOR_VERSION).$(SO_MINOR_VERSION).$(SO_MICRO_VERSION)
+ POSTGIS_BUILD_DATE := $(shell date -u "+%Y-%m-%d %H:%M:%S")
+endif

 #---------------------------------------------------------------

@@ -87,8 +98,17 @@

 all: $(GEOS_RULES) $(SHLIB) ../lwpostgis.sql

+#------------ It's for Win32 -----------------------------------
 $(SHLIB): $(OBJS)
+
+ifeq ($(findstring MINGW,$(MSYSTEM)),MINGW)
+ dlltool --export-all  --output-def lwgeom.def $(OBJS)
+ dllwrap  -o $@ --dllname $@ --def lwgeom.def $(OBJS)
$(SHLIB_LINK) -L$(shell pg_config --libdir) -lpostgres
+ dlltool --dllname $@  --def lwgeom.def --output-lib liblwgeom.a
+else
  $(CC) $(SHLIB_LINK) -o $(SHLIB) $(OBJS)
+endif
+

 wktparse.tab.c: wktparse.y
  $(YACC) -vd -p lwg_parse_yy wktparse.y

---------------------------------------------------------------
TECHER Jean David
01MAP
e-mail: david at 01map.net
Tél: 04 67 45 60 27
Entreprise: http://www.01map.net
Perso: http://techer.pascal.free.fr/postgis/
---------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20050426/c89524ce/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: postgis_cvs.patch
Type: application/octet-stream
Size: 3697 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20050426/c89524ce/attachment.obj>


More information about the postgis-devel mailing list