From 9a1f249329e0d4aa9456eaa7cd339f7c8ca1257b Mon Sep 17 00:00:00 2001 From: Nicola Fontana Date: Mon, 6 Jan 2014 17:04:02 +0100 Subject: [PATCH] build: do not call ./configure in autogen.sh This allows to do VPATH builds straight after the ./autogen.sh call, allowing an easier integration with Travis CI. --- autogen.sh | 71 +++++++++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 22 deletions(-) rewrite autogen.sh (78%) diff --git a/autogen.sh b/autogen.sh dissimilarity index 78% index 72c7b623..ffcb3414 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,22 +1,49 @@ -#!/bin/sh -# Run this to generate all the initial makefiles, etc. - -srcdir=`dirname $0` -test -z "$srcdir" && srcdir=. - -if test ! -f $srcdir/configure.ac -o ! -f $srcdir/src/adg.h.in; then - echo "**Error**: '$srcdir' does not look like the top-level adg directory" - exit 1 -fi - -cd $srcdir -glib-gettextize -f || exit $? -intltoolize -f || exit $? - -# autoreconf interaction with libtool has been broken for ages: -# explicitely calling libtoolize avoid some problems -libtoolize --automake || exit $? - -autoreconf -is -Wall || exit $? - -./configure "$@" && echo "Now type 'make' to compile $PROJECT." +#!/bin/sh +# +# Run this to generate the configuration scripts after a fresh +# repository clone/checkout. +# +# This script does *not* call configure (as usually done in other +# projects) because this would prevent VPATH builds. + +step() { + local message="$1" + local command="$2" + + printf "$message... " + + if eval $command >/dev/null 2>&1; then + printf "\033[32mok\033[0m\n" + else + local result=$? + printf "\033[31mfailed\033[0m\n ** \"$command\" returned $result\n" + exit $result + fi +} + + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +step "Checking for top-level adg directory" \ + "test -f '$srcdir/configure.ac' -a -f '$srcdir/src/adg.h.in'" + +cd "$srcdir" + +step "Creating dummy ChangeLog, if needed" \ + "test -f './ChangeLog' || touch './ChangeLog'" + +# Not sure if I can remove these, they seem to be old relics +step "Calling internationalization scripts" \ + "glib-gettextize -f && intltoolize -f" + +# autoreconf interaction with libtool has been broken for ages: +# explicitely calling libtoolize seems to avoid some problem +step "Calling libtoolize" \ + "libtoolize --automake" + +step "Regenerating autotools files" \ + "autoreconf -isf -Wall" + + +printf "Now run \033[1m./configure\033[0m to customize your building\n" -- 2.11.4.GIT