[postgis-users] Re: ver 1.1.5 configure fails on Ubuntu

strk at refractions.net strk at refractions.net
Fri Nov 10 07:16:32 PST 2006


Actually, try the attached patch for configure.in, it should work
out of the box for you (with --with-geos-libdir still usable
for overrides)

--strk;

On Fri, Nov 10, 2006 at 04:11:29PM +0100, strk at refractions.net wrote:
> On Fri, Nov 10, 2006 at 09:59:35AM -0500, Greg Troxel wrote:
> > I need to update pkgsrc, which is at 2.0.0.  So I have put a patch to
> > postgis in pkgsrc to work around it using ldflags instead of libs.
> 
> It seems postgis doesn't automatically work with 2.0.0 version of geos,
> but I see it's possible to use --with-geos-libdir=... to override
> the default GEOS_LDFLAGS (which in your case is set to the empty string,
> given the invalid call).
> Please try that.
> 
> --strk;
> 
> > gdt 2 > geos-config --prefix
> > /usr/pkg
> > gdt 3 > geos-config --ldflags
> > Usage: geos-config [OPTIONS]
> > Options:
> >      [--prefix]
> >      [--version]
> >      [--libs]
> >      [--cflags]
> >      [--includes]
> >      [--jtsport]
> > gdt 4 > geos-config --version
> > 2.0.0
> > gdt 5 > geos-config --version  | cut -d. -f1
> > 2
> > gdt 6 > geos-config --libs
> > -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lgeos
-------------- next part --------------
Index: configure.in
===================================================================
--- configure.in	(revision 2526)
+++ configure.in	(working copy)
@@ -147,7 +147,16 @@
 
 if test $USE_GEOS -gt 0; then
 	GEOS_DIR=`$GEOSCONFIG --prefix`
-	GEOS_LDFLAGS=`$GEOSCONFIG --ldflags`
+
+	GEOS_LDFLAGS=`$GEOSCONFIG --ldflags 2> /dev/null`
+	if test x"$GEOS_LDFLAGS" = "x"; then
+		# older geos-config versions did not
+		# support the --ldflags switch, we'll
+		# default to GEOS_DIR/lib in this case.
+		#
+		GEOS_LDFLAGS="$GEOS_DIR/lib"
+	fi
+
 	GEOS_MAJOR=`$GEOSCONFIG --version | cut -d. -f1`
 	if test "$GEOS_MAJOR" = "@GEOS_VERSION@"; then
 		GEOS_MAJOR=1


More information about the postgis-users mailing list