You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by Jim Meyering <ji...@meyering.net> on 2006/12/04 14:46:35 UTC

better cppunit support

Alan,

Here's another build infrastructure change.
This one doesn't conflict with the other one that is pending:

  http://www.nabble.com/better-bootstrap-and-gen-*-dependencies-p7645703.html

so you should be able to check them in in either order.

2006-12-04  Jim Meyering  <ji...@meyering.net>

	* configure.ac: Check for cppunit (>= 1.11.4).
	Set/substitute CPPUNIT_CXXFLAGS.
	* tests/Makefile.am (extra_libs): Use $(CPPUNIT_LIBS),
	rather than hard-coding -lcppunit.
	(AM_CXXFLAGS): Add $(CPPUNIT_CXXFLAGS).

Index: configure.ac
===================================================================
--- configure.ac	(revision 482107)
+++ configure.ac	(working copy)
@@ -85,8 +98,11 @@

 APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR=1"
 AC_SUBST(APR_CXXFLAGS)
-AC_SUBST(APR_LIBS)

+CPPUNIT_MINIMUM_VERSION=1.11.4
+PKG_CHECK_MODULES([CPPUNIT], [cppunit >= $CPPUNIT_MINIMUM_VERSION])
+CPPUNIT_CXXFLAGS=$CPPUNIT_CFLAGS
+AC_SUBST(CPPUNIT_CXXFLAGS)

 AC_CONFIG_FILES([
   Makefile
Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 482107)
+++ tests/Makefile.am	(working copy)
@@ -1,4 +1,4 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS)
+AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS)
 INCLUDES =				\
   -I$(top_srcdir)/gen			\
   -I$(top_srcdir)/lib			\
@@ -9,8 +9,6 @@
   -I$(top_srcdir)/lib/common/framing	\
   $(APR_CXXFLAGS)

-# FIXME: -lcppunit must come from autoconf
-
 # FIXME: have e.g., topicall, run as part of "make check"?
 EXTRA_DIST =		\
   env			\
@@ -80,7 +78,7 @@
 include gen.mk

 abs_builddir = @abs_builddir@
-extra_libs = -lcppunit
+extra_libs = $(CPPUNIT_LIBS)
 lib_client = $(abs_builddir)/../lib/client/libclient.la
 lib_common = $(abs_builddir)/../lib/common/libcommon.la
 lib_broker = $(abs_builddir)/../lib/broker/libbroker.la