common/autoconf/configure
changeset 22722 03797b5d2ba3
parent 22721 63761da45392
child 22725 c382bed20726
--- a/common/autoconf/configure	Mon Feb 24 12:16:58 2014 +0100
+++ b/common/autoconf/configure	Mon Feb 24 13:29:26 2014 +0100
@@ -22,18 +22,25 @@
 # questions.
 #
 
-if test "x$BASH_VERSION" = x; then
-  echo This script needs bash to run.
-  echo It is recommended to use the configure script in the source tree root instead.
+if test "x$1" != xCHECKME; then
+  echo "This script cannot be run directly."
+  echo "Use the 'configure' script in the top-level directory instead."
   exit 1
 fi
 
-conf_script_dir=`dirname $0`
+# Now the next argument is the absolute top-level directory path.
+# The TOPDIR variable is passed on to configure.ac.
+TOPDIR="$2"
+# Remove these two arguments to get to the user supplied arguments
+shift
+shift
+
+conf_script_dir="$TOPDIR/common/autoconf"
 
 if [ "$CUSTOM_CONFIG_DIR" = "" ]; then
-  conf_custom_script_dir="$conf_script_dir/../../closed/autoconf"
+  conf_custom_script_dir="$TOPDIR/closed/autoconf"
 else
-  conf_custom_script_dir=$CUSTOM_CONFIG_DIR
+  conf_custom_script_dir="$CUSTOM_CONFIG_DIR"
 fi
 
 ###
@@ -226,10 +233,10 @@
 ###
 if test -e $conf_custom_script_dir/generated-configure.sh; then
   # Custom source configure available; run that instead
-  echo Running custom generated-configure.sh
+  echo "Running custom generated-configure.sh"
   conf_script_to_run=$conf_custom_script_dir/generated-configure.sh
 else
-  echo Running generated-configure.sh
+  echo "Running generated-configure.sh"
   conf_script_to_run=$conf_script_dir/generated-configure.sh
 fi