summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-23 20:03:50 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-25 11:57:45 +0000
commit1967fc7f63b7b3884667f96507d159be1b23a825 (patch)
treefd3aa11bd0ca73d849371dfb464f06025806daaa /configure
parentd76a756b03840ef9339ecc30f16e8580c7f323ea (diff)
downloadqtbase-1967fc7f63b7b3884667f96507d159be1b23a825.tar.gz
fix location of config.{opt,status} in top-level builds
write them to the top-level build dir, not the qtbase build dir. the old files will be still used for a smooth migration. Task-number: QTBUG-46974 Change-Id: I6eae678ffc7dfb921ecd9e9012e79e3b915ad3fa Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure36
1 files changed, 19 insertions, 17 deletions
diff --git a/configure b/configure
index 9ab3834cf8..8be7b5fa44 100755
--- a/configure
+++ b/configure
@@ -75,8 +75,12 @@ fi
# do this early so we don't store it in config.status
CFG_TOPLEVEL=
+relpathMangled=$relpath
+outpathPrefix=
if [ x"$1" = x"-top-level" ]; then
CFG_TOPLEVEL=yes
+ relpathMangled=`dirname "$relpath"`
+ outpathPrefix=../
shift
fi
@@ -90,11 +94,15 @@ IFS='
for i in "$@"; do
case $i in
-redo|--redo)
- if ! test -f config.opt; then
+ optfile=${outpathPrefix}config.opt
+ if test -n "$CFG_TOPLEVEL" && ! test -f $optfile; then
+ optfile=config.opt
+ fi
+ if ! test -f $optfile; then
echo >&2 "No config.opt present - cannot redo configuration."
exit 1
fi
- for a in `cat config.opt`; do
+ for a in `cat $optfile`; do
OPT_CMDLINE="$OPT_CMDLINE
$a"
QMAKE_CMDLINE="$QMAKE_CMDLINE
@@ -1917,17 +1925,11 @@ fi
# build makefiles based on the configuration
#-------------------------------------------------------------------------------
-( # fork to make the cd stay local
-
- relpathMangled=$relpath
- if [ -n "$CFG_TOPLEVEL" ]; then
- relpathMangled=`dirname "$relpath"`
- cd ..
- fi
-
- "$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" "$relpathMangled"
+if [ -n "$CFG_TOPLEVEL" ]; then
+ cd ..
+fi
-) || exit
+"$CFG_QMAKE_PATH" -qtconf "$QTCONFFILE" "$relpathMangled" || exit
#-------------------------------------------------------------------------------
# finally save the executed command to another script
@@ -1937,12 +1939,12 @@ if [ $CFG_REDO = no ]; then
-confirm-license"
# skip first line, as it's always empty due to unconditional field separation
- echo "$OPT_CMDLINE" | tail -n +2 > "$outpath/config.opt"
+ echo "$OPT_CMDLINE" | tail -n +2 > config.opt
- [ -f "$outpath/config.status" ] && rm -f "$outpath/config.status"
- echo "#!/bin/sh" > "$outpath/config.status"
- echo "$relpath/$relconf -redo \"\$@\"" >> "$outpath/config.status"
- chmod +x "$outpath/config.status"
+ [ -f "config.status" ] && rm -f config.status
+ echo "#!/bin/sh" > config.status
+ echo "$relpathMangled/$relconf -redo \"\$@\"" >> config.status
+ chmod +x config.status
fi
if [ -n "$PREFIX_COMPLAINTS" ]; then