]> granicus.if.org Git - postgis/commitdiff
Fix liblwgeom requiring gcc to compile. By using macros and variables supplied by...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 1 Jul 2008 14:15:33 +0000 (14:15 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Tue, 1 Jul 2008 14:15:33 +0000 (14:15 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@2819 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
liblwgeom/Makefile.in

index bd9697a9a25496df008c6ed5bedd6f5dfc9fe1fd..d24c9c7bc08dd5373558373c00c907c0af7db2e8 100644 (file)
@@ -13,6 +13,10 @@ dnl **********************************************************************
 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,6 +24,19 @@ AC_PROG_CC
 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 
index ffbbbb41ba551d589f34200080786ebb15966173..a5aaf5186f1acb3f35c5885761dea8510bfba884 100644 (file)
@@ -11,7 +11,7 @@
 # **********************************************************************
 
 CC=@CC@
-CFLAGS=@CFLAGS@ -Wall -Wmissing-prototypes -fPIC 
+CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@ 
 
 # Standalone LWGEOM objects
 SA_OBJS=measures.o \