diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-06-28 10:11:41 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-06-28 10:11:41 +0200 |
commit | 3a1718e0109e9cef4f848bcdbe0c5d92e06e0830 (patch) | |
tree | a5fd755064257d12e3ce937f4fd4c4dd52d88dcb | |
parent | 4a433cde9871b77858b059c318488f7a1a6f3e50 (diff) | |
download | cppunit-3a1718e0109e9cef4f848bcdbe0c5d92e06e0830.tar.gz |
Some build system tweaks
-rwxr-xr-x | autogen.sh | 63 | ||||
-rw-r--r-- | configure.in | 50 | ||||
-rw-r--r-- | doc/Makefile.am | 4 |
3 files changed, 76 insertions, 41 deletions
@@ -1,21 +1,54 @@ #!/bin/sh +TESTLIBTOOLIZE="glibtoolize libtoolize" -set -e +LIBTOOLIZEFOUND="0" -ACLOCAL_FLAGS="-I config" +aclocal --version > /dev/null 2> /dev/null || { + echo "error: aclocal not found" + exit 1 +} +automake --version > /dev/null 2> /dev/null || { + echo "error: automake not found" + exit 1 +} -aclocal $ACLOCAL_FLAGS || \ - aclocal $ACLOCAL_FLAGS -I /usr/local/share/aclocal - -for l in libtoolize glibtoolize; -do - ($l --version) < /dev/null > /dev/null 2>&1 && { - LIBTOOLIZE=$l - break - } +for i in $TESTLIBTOOLIZE; do + if which $i > /dev/null 2>&1; then + LIBTOOLIZE=$i + LIBTOOLIZEFOUND="1" + break + fi done -$LIBTOOLIZE --force -autoheader -automake --add-missing -autoconf +if [ "$LIBTOOLIZEFOUND" = "0" ]; then + echo "$0: need libtoolize tool to build cppunit" >&2 + exit 1 +fi + +amcheck=`automake --version | grep 'automake (GNU automake) 1.5'` +if test "x$amcheck" = "xautomake (GNU automake) 1.5"; then + echo "warning: you appear to be using automake 1.5" + echo " this version has a bug - GNUmakefile.am dependencies are not generated" +fi + +rm -rf autom4te*.cache + +$LIBTOOLIZE --force --copy || { + echo "error: libtoolize failed" + exit 1 +} +aclocal $ACLOCAL_FLAGS -I config || { + echo "error: aclocal $ACLOCAL_FLAGS failed" + exit 1 +} +autoheader || { + echo "error: autoheader failed" + exit 1 +} +automake -a -c --foreign || { + echo "warning: automake failed" +} +autoconf || { + echo "error: autoconf failed" + exit 1 +} diff --git a/configure.in b/configure.in index 466624e..067e566 100644 --- a/configure.in +++ b/configure.in @@ -1,9 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(Makefile.am) -# autoconf 2.50 or higher to rebuild aclocal.m4, because the -# AC_CREATE_PREFIX_CONFIG_H macro needs the AS_DIRNAME macro. -AC_PREREQ(2.50) +AC_PREREQ(2.65) # Making releases: # CPPUNIT_MICRO_VERSION += 1; @@ -13,33 +10,38 @@ AC_PREREQ(2.50) # if backwards compatibility has been broken, # set CPPUNIT_BINARY_AGE and CPPUNIT_INTERFACE_AGE to 0. # -CPPUNIT_MAJOR_VERSION=1 -CPPUNIT_MINOR_VERSION=13 -CPPUNIT_MICRO_VERSION=0 -CPPUNIT_INTERFACE_AGE=0 -CPPUNIT_BINARY_AGE=0 -CPPUNIT_VERSION=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION.$CPPUNIT_MICRO_VERSION -AC_SUBST(CPPUNIT_MAJOR_VERSION) -AC_SUBST(CPPUNIT_MINOR_VERSION) -AC_SUBST(CPPUNIT_MICRO_VERSION) -AC_SUBST(CPPUNIT_INTERFACE_AGE) -AC_SUBST(CPPUNIT_BINARY_AGE) -AC_SUBST(CPPUNIT_VERSION) +m4_define([cppunit_major_version],[1]) +m4_define([cppunit_minor_version],[13]) +m4_define([cppunit_micro_version],[0]) +m4_define([cppunit_interface_age],[0]) +m4_define([cppunit_binary_age],[0]) +m4_define([cppunit_version],[cppunit_major_version.cppunit_minor_version.cppunit_micro_version]) + +AC_INIT([cppunit],[cppunit_version]) +AC_CONFIG_AUX_DIR([config]) +AC_CONFIG_MACRO_DIR([config]) +AM_CONFIG_HEADER([config/config.h]) +AM_INIT_AUTOMAKE([1.11 foreign dist-xz dist-bzip2]) +AM_SILENT_RULES([yes]) +AC_LANG([C++]) + +AC_SUBST(CPPUNIT_MAJOR_VERSION,[cppunit_major_version]) +AC_SUBST(CPPUNIT_MINOR_VERSION,[cppunit_minor_version]) +AC_SUBST(CPPUNIT_MICRO_VERSION,[cppunit_micro_version]) +AC_SUBST(CPPUNIT_INTERFACE_AGE,[cppunit_interface_age]) +AC_SUBST(CPPUNIT_BINARY_AGE,[cppunit_binary_age]) +AC_SUBST(CPPUNIT_VERSION,[cppunit_version]) # libtool versioning -LT_RELEASE=$CPPUNIT_MAJOR_VERSION.$CPPUNIT_MINOR_VERSION -LT_CURRENT=`expr $CPPUNIT_MICRO_VERSION - $CPPUNIT_INTERFACE_AGE` -LT_REVISION=$CPPUNIT_INTERFACE_AGE -LT_AGE=`expr $CPPUNIT_BINARY_AGE - $CPPUNIT_INTERFACE_AGE` +LT_RELEASE=cppunit_major_version.cppunit_minor_version +LT_CURRENT=`expr cppunit_micro_version - cppunit_interface_age` +LT_REVISION=cppunit_interface_age +LT_AGE=`expr cppunit_binary_age - cppunit_interface_age` AC_SUBST(LT_RELEASE) AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) -AC_CONFIG_AUX_DIR(config) -AM_CONFIG_HEADER(config/config.h) -AM_INIT_AUTOMAKE(cppunit, $CPPUNIT_VERSION) - # General "with" options # ---------------------------------------------------------------------------- diff --git a/doc/Makefile.am b/doc/Makefile.am index 08e5a03..81205cf 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -13,11 +13,11 @@ static_pages = FAQ # However, the manpages do not appear to be tremendously useful, so # let's not bother. -if DOC - htmldir = $(pkgdatadir)/html html_DATA = $(static_pages) html/index.html +if DOC + install-data-hook: cp -pR html/* $(DESTDIR)$(htmldir) |