[postgis-commits] svn - r2819 - in trunk: . liblwgeom

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Tue Jul 1 07:15:34 PDT 2008


Author: mcayland
Date: 2008-07-01 07:15:33 -0700 (Tue, 01 Jul 2008)
New Revision: 2819

Modified:
   trunk/configure.ac
   trunk/liblwgeom/Makefile.in
Log:
Fix liblwgeom requiring gcc to compile. By using macros and variables supplied by libtool, we can now detect the PIC flags and whether the compiler will accept additional gcc warning flags for developers

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-06-30 15:34:38 UTC (rev 2818)
+++ trunk/configure.ac	2008-07-01 14:15:33 UTC (rev 2819)
@@ -13,6 +13,10 @@
 AC_INIT()
 AC_CONFIG_HEADERS([postgis_config.h])
 
+dnl Invoke libtool: we do this as it is the easiest way to find the PIC
+dnl flags required to build liblwgeom
+AC_PROG_LIBTOOL
+
 dnl
 dnl Compilers
 dnl
@@ -20,8 +24,21 @@
 AC_PROG_CPP
 AC_PROG_CXX
 
+dnl
+dnl Define PIC flags in PICFLAGS (note: this variable is set as part of libtool initialisation above)
+dnl
+PICFLAGS="$lt_prog_compiler_pic"
+AC_SUBST([PICFLAGS])
 
 dnl
+dnl For GCC enable additional warning flags -Wall and -Wmissing-prototypes (using macro included with libtool)
+dnl
+WARNFLAGS=""
+AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wall], [dummy], [-Wall], [], [WARNFLAGS="$WARNFLAGS -Wall"], []) 
+AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -Wmissing-prototypes], [dummy], [-Wmissing-prototypes], [], [WARNFLAGS="$WARNFLAGS -Wmissing-prototypes"], []) 
+AC_SUBST([WARNFLAGS])
+
+dnl
 dnl Version Information imported from Version.config 
 dnl
 POSTGIS_MAJOR_VERSION=`cat Version.config | grep POSTGIS_MAJOR_VERSION | sed 's/[[^=]]*=\([[0-9]]\)/\1/g'`

Modified: trunk/liblwgeom/Makefile.in
===================================================================
--- trunk/liblwgeom/Makefile.in	2008-06-30 15:34:38 UTC (rev 2818)
+++ trunk/liblwgeom/Makefile.in	2008-07-01 14:15:33 UTC (rev 2819)
@@ -11,7 +11,7 @@
 # **********************************************************************
 
 CC=@CC@
-CFLAGS=@CFLAGS@ -Wall -Wmissing-prototypes -fPIC 
+CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@ 
 
 # Standalone LWGEOM objects
 SA_OBJS=measures.o \



More information about the postgis-commits mailing list