From 0e7e3e01d9d6a3cc20758f0d2fe0f113e51998c5 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 1 Jul 2008 14:15:33 +0000 Subject: [PATCH] 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 git-svn-id: http://svn.osgeo.org/postgis/trunk@2819 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 17 +++++++++++++++++ liblwgeom/Makefile.in | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index bd9697a9a..d24c9c7bc 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/liblwgeom/Makefile.in b/liblwgeom/Makefile.in index ffbbbb41b..a5aaf5186 100644 --- a/liblwgeom/Makefile.in +++ b/liblwgeom/Makefile.in @@ -11,7 +11,7 @@ # ********************************************************************** CC=@CC@ -CFLAGS=@CFLAGS@ -Wall -Wmissing-prototypes -fPIC +CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@ # Standalone LWGEOM objects SA_OBJS=measures.o \ -- 2.50.1