summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-07-06 14:41:09 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-18 17:10:29 +0000
commit672c0b3721201dcc5c41868b4c67976dc57d5e81 (patch)
tree10c710abe79d2fe0751348a8e908e9799e60b981 /configure
parentfd3e12e7a6c71a244650415a86e98d910a011ebe (diff)
downloadqtbase-672c0b3721201dcc5c41868b4c67976dc57d5e81.tar.gz
unify configure command line saving with configure.exe
that is, save it to config.opt and recall it when -redo is used (and do not write it again in this case). a trivial config.status is still created, as having it is very convenient when shadow-building. Task-number: QTBUG-38792 Change-Id: I5e9f7374d6bfc60c427cbfd5e9b3e68bfcaae9f2 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure51
1 files changed, 41 insertions, 10 deletions
diff --git a/configure b/configure
index 6a425232e5..bd5a0fac8d 100755
--- a/configure
+++ b/configure
@@ -80,16 +80,45 @@ if [ x"$1" = x"-top-level" ]; then
shift
fi
-# later cache the command line in config.status
-OPT_CMDLINE=
+CFG_REDO=no
+OPT_CMDLINE= # excluding -verbose (for config.opt)
+QMAKE_CMDLINE= # including -verbose (for actual parsing)
+set -f # suppress globbing in for loop
+SAVED_IFS=$IFS
+IFS='
+'
for i in "$@"; do
+ case $i in
+ -redo|--redo)
+ if ! test -f config.opt; then
+ echo >&2 "No config.opt present - cannot redo configuration."
+ exit 1
+ fi
+ for a in `cat config.opt`; do
+ OPT_CMDLINE="$OPT_CMDLINE
+$a"
+ QMAKE_CMDLINE="$QMAKE_CMDLINE
+$a"
+ done
+ CFG_REDO=yes # suppress repeated config.opt writeout
+ continue
+ ;;
+ -v|-verbose|--verbose|-no-v|-no-verbose|--no-verbose)
+ ;;
+ *)
+ OPT_CMDLINE="$OPT_CMDLINE
+$i"
+ ;;
+ esac
QMAKE_CMDLINE="$QMAKE_CMDLINE
$i"
- if [ "x$i" != "x-v" ]; then
- [ -z "${i##* *}" ] && i="'$i'"
- OPT_CMDLINE="$OPT_CMDLINE $i"
- fi
done
+set --
+for i in $QMAKE_CMDLINE; do
+ set -- "$@" "$i"
+done
+set +f
+IFS=$SAVED_IFS
# initialize global variables
DEVICE_VARS_FILE=.device.vars
@@ -1928,14 +1957,16 @@ fi
#-------------------------------------------------------------------------------
# finally save the executed command to another script
#-------------------------------------------------------------------------------
-if [ `basename $0` != "config.status" ]; then
- CONFIG_STATUS="$relpath/$relconf$OPT_CMDLINE"
+if [ $CFG_REDO = no ]; then
+ echo "$OPT_CMDLINE" | grep '\-confirm\-license' >/dev/null 2>&1 || OPT_CMDLINE="$OPT_CMDLINE
+-confirm-license"
- echo "$CONFIG_STATUS" | grep '\-confirm\-license' >/dev/null 2>&1 || CONFIG_STATUS="$CONFIG_STATUS -confirm-license"
+ # skip first line, as it's always empty due to unconditional field separation
+ echo "$OPT_CMDLINE" | tail -n +2 > "$outpath/config.opt"
[ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
echo "#!/bin/sh" > "$outpath/config.status"
- echo "$CONFIG_STATUS \"\$@\"" >> "$outpath/config.status"
+ echo "$relpath/$relconf -redo \"\$@\"" >> "$outpath/config.status"
chmod +x "$outpath/config.status"
fi