qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Meyering <...@meyering.net>
Subject Re: Automake build system up and running :)
Date Fri, 01 Dec 2006 14:25:24 GMT
[resend]
Alan Conway <aconway@redhat.com> wrote:
> The automake build system is in, building and passing all tests :)
> There is some cleanup left to do and you will get a headache on your
> first commit. Check the README for details.

Here's an important follow-up to my autoconf/automake/libtool patch.
With it, you may be able to ./bootstrap && ./configure && make
after a fresh checkout.  I'll test that soon and post any additional
patch that may be required.

(if you apply this patch, be care that your mailer doesn't munge
the trailing blanks in it -- this patch removes some; they can cause
nasty problems in Makefiles, though none of these did)

	* configure.ac: Check for the apr-1 package, and substitute
	variables for compiling and linking.
	Check for minimum APR version of 1.2.7.
	* lib/common/Makefile.am (libcommon_la_LIBADD): Add $(APR_LIBS)
	rather than hard-coding "-lapr-1".
	* tests/Makefile.am (gen.mk): Use $$pwd, rather than $(abs_builddir),
	so this file works with automake older than 1.10.
	* lib/broker/Makefile.am (AM_CXXFLAGS): Don't add -DUSE_APR=1 here.
	Use the new, autoconf-set $(APR_CXXFLAGS) instead.
	* lib/client/Makefile.am: Likewise.
	* lib/common/Makefile.am: Likewise.
	* tests/Makefile.am: Likewise.
	* bootstrap: Create test/Makefile.am's included file, gen.mk.

Index: configure.ac
===================================================================
--- configure.ac	(revision 481184)
+++ configure.ac	(working copy)
@@ -32,7 +32,7 @@
    *)      AC_MSG_ERROR([bad value ${enableval} for warnings option]) ;;
  esac],
  [enableval=yes])
- 
+
 # Warnings: Enable as many as possible, keep the code clean. Please
 # do not disable warnings or remove -Werror without discussing on
 # qpid-dev list.
@@ -80,6 +80,14 @@

 gl_CLOCK_TIME

+APR_MINIMUM_VERSION=1.2.7
+PKG_CHECK_MODULES([APR], [apr-1 >= $APR_MINIMUM_VERSION])
+
+APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR=1"
+AC_SUBST(APR_CXXFLAGS)
+AC_SUBST(APR_LIBS)
+
+
 AC_CONFIG_FILES([
   Makefile
   gen/Makefile
Index: lib/common/Makefile.am
===================================================================
--- lib/common/Makefile.am	(revision 481184)
+++ lib/common/Makefile.am	(working copy)
@@ -1,11 +1,10 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS) -DUSE_APR=1
-LIBS = -lapr-1
+AM_CXXFLAGS = $(WARNING_CFLAGS)

-INCLUDES = \
-  -I$(shell apr-1-config --includedir) \
-  -I$(top_srcdir)/gen \
-  -I$(top_srcdir)/lib/common/sys \
-  -I$(top_srcdir)/lib/common/framing
+INCLUDES =				\
+  -I$(top_srcdir)/gen			\
+  -I$(top_srcdir)/lib/common/sys	\
+  -I$(top_srcdir)/lib/common/framing	\
+  $(APR_CXXFLAGS)

 apr = sys/apr
 apr_src =			\
@@ -24,7 +23,7 @@
   $(apr)/Thread.cpp

 posix = sys/posix
-posix_src =  					\
+posix_src =					\
   $(posix)/PosixAcceptor.cpp			\
   $(posix)/Socket.cpp				\
   $(posix)/Thread.cpp				\
@@ -43,6 +42,7 @@

 lib_LTLIBRARIES = libcommon.la
 libcommon_la_LIBADD =		\
+  $(APR_LIBS)			\
   $(LIB_DLOPEN)			\
   $(LIB_CLOCK_GETTIME)

Index: tests/Makefile.am
===================================================================
--- tests/Makefile.am	(revision 481184)
+++ tests/Makefile.am	(working copy)
@@ -1,17 +1,14 @@
-# TODO aconway 2006-11-30: nasty hack, should be done by automake?
-abs_builddir = @abs_builddir@
+AM_CXXFLAGS = $(WARNING_CFLAGS)
+INCLUDES =				\
+  -I$(top_srcdir)/gen			\
+  -I$(top_srcdir)/lib			\
+  -I$(top_srcdir)/lib/client		\
+  -I$(top_srcdir)/lib/broker		\
+  -I$(top_srcdir)/lib/common		\
+  -I$(top_srcdir)/lib/common/sys	\
+  -I$(top_srcdir)/lib/common/framing	\
+  $(APR_CXXFLAGS)

-AM_CXXFLAGS = $(WARNING_CFLAGS) -DUSE_APR=1
-INCLUDES = \
-  -I$(shell apr-1-config --includedir) \
-  -I$(top_srcdir)/gen \
-  -I$(top_srcdir)/lib \
-  -I$(top_srcdir)/lib/client \
-  -I$(top_srcdir)/lib/broker \
-  -I$(top_srcdir)/lib/common \
-  -I$(top_srcdir)/lib/common/sys \
-  -I$(top_srcdir)/lib/common/framing
-
 # FIXME: -lcppunit must come from autoconf

 # FIXME: have e.g., topicall, run as part of "make check"?
@@ -63,7 +60,7 @@
 unit_tests =		\
   $(broker_tests)	\
   $(framing_tests)	\
-  $(misc_tests)		
+  $(misc_tests)


 noinst_PROGRAMS = $(client_tests)
@@ -77,7 +74,7 @@
 # TODO aconway 2006-12-01: Should also check for qpidd.
 run-python-tests: $(check_LTLIBRARIES)
 	../src/qpidd > qpidd.log 2>&1 &
-	cd ../../python ; ./run-tests -v -I cpp_failing.txt	
+	cd ../../python ; ./run-tests -v -I cpp_failing.txt


 include gen.mk
@@ -94,12 +91,13 @@
 	    echo $${i}_LDADD = '$$(lib_client) $$(lib_common) $$(extra_libs)'; \
 	  done;					\
 	  libs=;				\
+	  pwd=`pwd`;				\
 	  for i in $(unit_tests); do		\
 	    libs="$$libs $${i}.la";		\
 	    echo $${i}_la_SOURCES = $$i.cpp;	\
 	    echo $${i}_la_LIBADD = '$$(lib_common)';			\
 	    echo $${i}_la_LIBADD += '$$(lib_broker) $$(extra_libs)';	\
-	    echo $${i}_la_LDFLAGS = '-module -rpath $$(abs_builddir)';	\
+	    echo $${i}_la_LDFLAGS = '-module -rpath $$pwd';	\
 	  done;					\
 	  echo "check_LTLIBRARIES =$$libs";	\
 	)					\
Index: lib/broker/Makefile.am
===================================================================
--- lib/broker/Makefile.am	(revision 481184)
+++ lib/broker/Makefile.am	(working copy)
@@ -1,10 +1,10 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS) -DUSE_APR=1
-INCLUDES = \
-  -I$(shell apr-1-config --includedir) \
-  -I$(top_srcdir)/gen \
-  -I$(top_srcdir)/lib/common \
-  -I$(top_srcdir)/lib/common/sys \
-  -I$(top_srcdir)/lib/common/framing
+AM_CXXFLAGS = $(WARNING_CFLAGS)
+INCLUDES =				\
+  -I$(top_srcdir)/gen			\
+  -I$(top_srcdir)/lib/common		\
+  -I$(top_srcdir)/lib/common/sys	\
+  -I$(top_srcdir)/lib/common/framing	\
+  $(APR_CXXFLAGS)

 lib_LTLIBRARIES = libbroker.la
 libbroker_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
Index: lib/client/Makefile.am
===================================================================
--- lib/client/Makefile.am	(revision 481184)
+++ lib/client/Makefile.am	(working copy)
@@ -1,10 +1,10 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS) -DUSE_APR=1
-INCLUDES = \
-  -I$(shell apr-1-config --includedir) \
-  -I$(top_srcdir)/gen \
-  -I$(top_srcdir)/lib/common \
-  -I$(top_srcdir)/lib/common/sys \
-  -I$(top_srcdir)/lib/common/framing
+AM_CXXFLAGS = $(WARNING_CFLAGS)
+INCLUDES =				\
+  -I$(top_srcdir)/gen			\
+  -I$(top_srcdir)/lib/common		\
+  -I$(top_srcdir)/lib/common/sys	\
+  -I$(top_srcdir)/lib/common/framing	\
+  $(APR_CXXFLAGS)

 lib_LTLIBRARIES = libclient.la
 libclient_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
Index: bootstrap
===================================================================
--- bootstrap	(revision 481184)
+++ bootstrap	(working copy)
@@ -1,8 +1,13 @@
 #!/bin/sh
+set -e
 aclocal -I m4
 autoheader
 libtoolize --automake
+
+# Generate (for automake) lots of repetitive parts of tests/Makefile.am.
+(cd tests && rm -f gen.mk
+  perl -ne '/^include / or print' Makefile.am \
+      | make -f - abs_srcdir=`dirname $(pwd)` gen.mk )
+
 automake
 autoconf
-./configure --enable-warnings --prefix=/tmp/qpid-inst CXXFLAGS=-g
-

Mime
View raw message