summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2012-09-12 17:48:12 +0200
committerStefan Metzmacher <metze@samba.org>2012-09-12 23:52:51 +0200
commitc33643ebb354637f8651c5356b8e7445f0931ce8 (patch)
tree3dc48e0b8c1c8e7796ce5bb64cc70e040644b397
parentb9389798314bc1163be7ea8fc89823c2666ecd78 (diff)
downloadsamba-c33643ebb354637f8651c5356b8e7445f0931ce8.tar.gz
samba-c33643ebb354637f8651c5356b8e7445f0931ce8.tar.bz2
samba-c33643ebb354637f8651c5356b8e7445f0931ce8.zip
s3:build: rewrite autogen.sh to be called from any directory
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rwxr-xr-xsource3/autogen.sh25
1 files changed, 20 insertions, 5 deletions
diff --git a/source3/autogen.sh b/source3/autogen.sh
index 2238efbe5e..4f39e10441 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