From c33643ebb354637f8651c5356b8e7445f0931ce8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 12 Sep 2012 17:48:12 +0200 Subject: s3:build: rewrite autogen.sh to be called from any directory Signed-off-by: Stefan Metzmacher --- source3/autogen.sh | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/autogen.sh b/source3/autogen.sh index 2238efbe5e6..4f39e10441b 100755 --- a/source3/autogen.sh +++ b/source3/autogen.sh @@ -2,6 +2,20 @@ # Run this script to build samba from GIT. + +_exit() { + echo $@ >&2 + cd ${OLD_DIR} + exit 1 +} + +OLD_DIR=$(pwd) +BASE_DIR=$(dirname $0) +SCRIPT_NAME=$(basename $0) + +cd ${BASE_DIR} || exit 1 + + while true; do case $1 in --version-file) @@ -55,8 +69,7 @@ done ## do we have it? ## if test "$AUTOCONFFOUND" = "0" -o "$AUTOHEADERFOUND" = "0"; then - echo "$0: need autoconf 2.53 or later to build samba from GIT" >&2 - exit 1 + _exit "$0: need autoconf 2.53 or later to build samba from GIT" fi echo "$0: running script/mkversion.sh" @@ -68,10 +81,10 @@ rm -f configure include/config.h* IPATHS="-Im4 -I../m4 -I../lib/replace" echo "$0: running $AUTOHEADER $IPATHS" -$AUTOHEADER $IPATHS || exit 1 +$AUTOHEADER $IPATHS || _exit "ERROR running autoheader" echo "$0: running $AUTOCONF $IPATHS" -$AUTOCONF $IPATHS || exit 1 +$AUTOCONF $IPATHS || _exit "ERROR running autoconf" rm -rf autom4te*.cache @@ -81,7 +94,7 @@ rm -rf autom4te*.cache echo "$0: running $AUTOCONF in ../examples/VFS/" $AUTOCONF || exit 1 rm -rf autom4te*.cache -) || exit 1 +) || _exit "ERROR running autoheader/autoconf in examples/VFS" if gcc -E tests/preproc-dummy.c -o /dev/null ; @@ -102,5 +115,7 @@ perl ../source4/script/mkproto.pl ../lib/param/loadparm.c ../lib/param/param_fun perl ../script/mks3param.pl ../lib/param/loadparm.c ../lib/param/param_functions.c --file autoconf/lib/param/s3_param.h echo "Now run ./configure (or ./configure.developer) and then make." + +cd ${OLD_DIR} exit 0 -- cgit v1.2.1