summaryrefslogtreecommitdiff
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh19
1 files changed, 16 insertions, 3 deletions
diff --git a/autogen.sh b/autogen.sh
index 44a1922cb0..6cbc5dddab 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,9 +1,22 @@
#!/bin/sh
+# Clear PWD to force commands to recompute working directory
PWD=
+
+# Figure out the source directory for this script
+# configure.ac should be in the same place
case "$0" in
-*/*) srcdir=`dirname $0`;;
-*) srcdir="";;
+ */* ) srcdir=`dirname "$0"` ;; # Called with path
+ * ) srcdir="";; # Otherwise
+esac
+
+# If install-only is explicitly requested, disable symlink flags
+case " $* " in
+ *" -i "* | *" --install"* ) symlink_flags="" ;;
+ * ) symlink_flags="--install --symlink" ;;
esac
-exec ${AUTORECONF:-autoreconf} --install --symlink "$@" ${srcdir:+"$srcdir"}
+exec ${AUTORECONF:-autoreconf} \
+ $symlink_flags \
+ "$@" \
+ $srcdir