From e354bf496235b20435a645a940803e1f5560a084 Mon Sep 17 00:00:00 2001 From: "David M. Syzdek" Date: Tue, 29 Jul 2014 07:53:30 -0800 Subject: Copying autogen.sh from tallymark --- .gitignore | 2 ++ Makefile.am | 4 +++- autogen.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++-------- m4/.gitignore | 21 +++++++++++---------- 4 files changed, 61 insertions(+), 19 deletions(-) diff --git a/.gitignore b/.gitignore index ae72a03..aff0601 100644 --- a/.gitignore +++ b/.gitignore @@ -14,11 +14,13 @@ /build-aux/git-package-version aclocal.m4 autom4te.cache +autoscan.log build/ config.h config.h.in config.log config.status configure +configure.scan stamp-h1 xcuserdata diff --git a/Makefile.am b/Makefile.am index 02f5b75..1f039e8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -221,7 +221,9 @@ EXTRA_DIST = autogen.sh \ CLEANFILES = \ $(builddir)/a.out $(srcdir)/a.out \ $(builddir)/*/a.out $(srcdir)/*/a.out \ - config.h.in~ $(srcdir)/config.h.in~ \ + autoscan.log $(srcdir)/autoscan.log \ + config.h.in~ $(srcdir)/config.h.in~ \ + configure.scan $(srcdir)/configure.scan \ $(man_MANS) \ include/dmsversion.h \ @PACKAGE_TARNAME@-*.tar.* \ diff --git a/autogen.sh b/autogen.sh index 319e693..9b80d31 100755 --- a/autogen.sh +++ b/autogen.sh @@ -35,18 +35,55 @@ # build-aux/autogen.sh - runs GNU Autotools to create build environment # -AUTOGENNAME="`basename ${0}`" || exit $? -SRCDIR=`dirname ${0}` +AUTOGENNAME="`basename ${0}`" || exit 1 +SRCDIR="`dirname ${0}`" -cd $SRCDIR || exit 1 +# check for required programs +for TEST_PROG in which autoreconf autoscan find git;do + which ${TEST_PROG} 2> /dev/null > /dev/null; + if test $? -ne 0;then + echo "${AUTOGENNAME}: unable to find \"${TEST_PROG}\"" + exit 1 + fi +done -if test -d .git || test -f .git;then - git submodule init 2>&1 | sed -e 's/^/git submodule init: /g' || exit 1 - git submodule sync 2>&1 | sed -e 's/^/git submodule sync: /g' || exit 1 - git submodule update --merge 2>&1 | sed -e 's/^/git submodule update: /g' || exit 1 + +# updates git repository +if test -d ${SRCDIR}/.git || test -f ${SRCDIR}/.git;then + cd ${SRCDIR} + git submodule init || exit 1 + git submodule sync || exit 1 + git submodule update --init --recursive --merge || exit 1 + cd - fi -autoreconf -v -i -f -I m4 -I contrib/bindletools/m4 -W all || exit 1 + +# Performs some useful checks +autoscan ${SRCDIR} || exit 1 + + +# symlinks M4 macros +cd ${SRCDIR}/m4 +rm -f ./bindle*.m4 || exit 1 +ln -s ../contrib/bindletools/m4/bindle*.m4 ./ +cd - + + +# generates/installs autotools files +autoreconf -v -i -f -Wall \ + -I m4 \ + -m \ + ${SRCDIR} \ + || exit 1 + + +# makes build directory +mkdir -p ${SRCDIR}/build + + +# add newline to create visual separation +echo " " + # end of script diff --git a/m4/.gitignore b/m4/.gitignore index d343f26..05b8008 100644 --- a/m4/.gitignore +++ b/m4/.gitignore @@ -1,10 +1,11 @@ -iconv.m4 -lib-ld.m4 -lib-link.m4 -lib-prefix.m4 -libtool.m4 -ltoptions.m4 -ltsugar.m4 -ltversion.m4 -lt~obsolete.m4 -progtest.m4 +/bindle-*.m4 +/iconv.m4 +/lib-ld.m4 +/lib-link.m4 +/lib-prefix.m4 +/libtool.m4 +/ltoptions.m4 +/ltsugar.m4 +/ltversion.m4 +/lt~obsolete.m4 +/progtest.m4 -- cgit v1.2.3