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
This commit is contained in:
Mark Cave-Ayland 2008-07-01 14:15:33 +00:00
parent 0007d4f8de
commit 0e7e3e01d9
2 changed files with 18 additions and 1 deletions

View 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

View file

@ -11,7 +11,7 @@
# **********************************************************************
CC=@CC@
CFLAGS=@CFLAGS@ -Wall -Wmissing-prototypes -fPIC
CFLAGS=@CFLAGS@ @PICFLAGS@ @WARNFLAGS@
# Standalone LWGEOM objects
SA_OBJS=measures.o \