]> granicus.if.org Git - postgis/commitdiff
Allow CPPFLAGS/LDFLAGS parameters from the command line to be passed into the CUnit...
authorMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 5 Jan 2009 20:54:12 +0000 (20:54 +0000)
committerMark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>
Mon, 5 Jan 2009 20:54:12 +0000 (20:54 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@3494 b70326c6-7e19-0410-871a-916f4a2858ee

configure.ac
liblwgeom/cunit/Makefile.in

index c9d97d4681ad9a4a1e616ea246ce5a0499c928c1..8440243e56e6399e9f60fb666cb267285bbd23b5 100644 (file)
@@ -157,15 +157,22 @@ AC_SUBST([XSLBASE])
 dnl
 dnl Detect CUnit if it is installed (used for unit testing)
 dnl
+dnl Note that we pass any specified CPPFLAGS and LDFLAGS into the Makefile as CUnit is
+dnl the only compile-time dependency that cannot obtain any specialised flags using
+dnl a --with-X parameter, and so we allow this information to be passed in if
+dnl required.
+dnl
 
 CUNIT_LDFLAGS=""
 AC_CHECK_HEADER([CUnit/CUnit.h], [
-       AC_CHECK_LIB([cunit], [CU_initialize_registry], [CUNIT_LDFLAGS=-lcunit], [AC_MSG_WARN([could not locate CUnit required for liblwgeom unit tests])])
+       CUNIT_CPPFLAGS="$CPPFLAGS"
+       AC_CHECK_LIB([cunit], [CU_initialize_registry], [CUNIT_LDFLAGS="$LDFLAGS -lcunit"], [AC_MSG_WARN([could not locate CUnit required for liblwgeom unit tests])])
        ],
        [
        AC_MSG_WARN([could not locate CUnit required for liblwgeom unit tests])
        ])
        
+AC_SUBST([CUNIT_CPPFLAGS])
 AC_SUBST([CUNIT_LDFLAGS])
 
 
index cdc03d783dc05d6faa2adc1441949c955c16b9a1..1c7978b138c268c3e89439cbc086a5adfb9f04bf 100644 (file)
@@ -14,7 +14,7 @@ CC=@CC@
 CFLAGS=@CFLAGS@ @WARNFLAGS@
 
 CUNIT_LDFLAGS=@CUNIT_LDFLAGS@
-CUNIT_CPPFLAGS=-I..
+CUNIT_CPPFLAGS=@CUNIT_CPPFLAGS@ -I..
 
 OBJS=  cu_tester.o \
        cu_algorithm.o