summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2012-03-08 11:29:05 -0500
committerRyan Lortie <desrt@desrt.ca>2012-03-08 11:29:05 -0500
commiteec74b9603f02ae63bd6b43c016972eb218a53bf (patch)
tree7bcdd75c637f0c398290da591f75f8b17750f15a /autogen.sh
parentf5ecb0181dd680260bc11e73ae739f4a02ed6b75 (diff)
downloaddconf-eec74b9603f02ae63bd6b43c016972eb218a53bf.tar.gz
autogen.sh: support calling from out of tree
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/autogen.sh b/autogen.sh
index d1fc5c2..89f7ad7 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -2,6 +2,12 @@
set -e
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+
+olddir=`pwd`
+cd "$srcdir"
+
if [ "$1" = "clean" ]; then
rm -f aclocal.m4 configure config.* `find . -name Makefile.in` libtool
rm -rf autom4te.cache m4 aux
@@ -25,7 +31,9 @@ CFLAGS=${CFLAGS=-ggdb}
LDFLAGS=${LDFLAGS=-Wl,-O1}
export CFLAGS LDFLAGS
+cd "$olddir"
+
if test -z "$NOCONFIGURE"; then
- ./configure "$@"
+ "$srcdir"/configure "$@"
fi