summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure40
1 files changed, 25 insertions, 15 deletions
diff --git a/configure b/configure
index 5cdbaf2..dae167c 100755
--- a/configure
+++ b/configure
@@ -3284,7 +3284,7 @@ else
CFG_FRAMEWORK=no
fi
-QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "\(^\| \)QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
+QMAKE_CONF_COMPILER=`getQMakeConf "$XQMAKESPEC" | grep "^QMAKE_CXX[^_A-Z0-9]" | sed "s,.* *= *\(.*\)$,\1," | tail -1`
TEST_COMPILER="$CXX"
[ -z "$TEST_COMPILER" ] && TEST_COMPILER=$QMAKE_CONF_COMPILER
@@ -4696,27 +4696,37 @@ fi
# $2: optional transformation
# relies on $QMAKESPEC, $COMPILER_CONF and $mkfile being set correctly, as the latter
# is where the resulting variable is written to
+# Assumes that the optional transformation produces the same variable name for each hit
setBootstrapVariable()
{
getQMakeConf | $AWK '/^('"$1"')[^_A-Z0-9]/ { print $0; }' | ( [ -n "$2" ] && sed "$2" ; [ -z "$2" ] && cat ) | $AWK '
+BEGIN {
+ variable = ""
+ combinedValue = ""
+}
{
- varLength = index($0, "=") - 1
- valStart = varLength + 2
- if (substr($0, varLength, 1) == "+") {
- varLength = varLength - 1
- valStart = valStart + 1
+ valStart = index($0, "=") + 1
+
+ append = 0
+ if (substr($0, valStart - 2, 1) == "+") {
+ append = 1
+ }
+
+ variable = substr($0, 0, valStart - 2 - append)
+ value = substr($0, valStart)
+ gsub("[ \t]+", "", variable)
+ gsub("^[ \t]+", "", value)
+ gsub("[ \t]+$", "", value)
+
+ if (append == 1 && length(combinedValue) > 0) {
+ combinedValue = combinedValue " " value
+ } else {
+ combinedValue = value
}
- var = substr($0, 0, varLength)
- gsub("[ \t]+", "", var)
- val = substr($0, valStart)
- printf "%s_%s = %s\n", var, NR, val
}
END {
- if (length(var) > 0) {
- printf "%s =", var
- for (i = 1; i <= NR; ++i)
- printf " $(%s_%s)", var, i
- printf "\n"
+ if (length(combinedValue) > 0) {
+ printf "%s = %s\n", variable, combinedValue
}
}' >> "$mkfile"
}