From 5d1472ea60e7c3b543ee1508f6377900765973f7 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Mon, 5 Jan 2009 20:54:12 +0000 Subject: [PATCH] Allow CPPFLAGS/LDFLAGS parameters from the command line to be passed into the CUnit Makefile, since CUnit is the only dependency that cannot determine its own flags using a --with-X parameter. This allows CUnit to be installed in a non-standard location if required. git-svn-id: http://svn.osgeo.org/postgis/trunk@3494 b70326c6-7e19-0410-871a-916f4a2858ee --- configure.ac | 9 ++++++++- liblwgeom/cunit/Makefile.in | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c9d97d468..8440243e5 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/liblwgeom/cunit/Makefile.in b/liblwgeom/cunit/Makefile.in index cdc03d783..1c7978b13 100644 --- a/liblwgeom/cunit/Makefile.in +++ b/liblwgeom/cunit/Makefile.in @@ -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 -- 2.49.0