summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorHarald Fernengel <harald.fernengel@nokia.com>2009-12-17 11:26:31 +0100
committerHarald Fernengel <harald.fernengel@nokia.com>2009-12-17 11:26:31 +0100
commite2ed04bac3cd353711bfd50eba3232692b40ab99 (patch)
treed533ce92f1a39ff94f3a07e0992ea8a71af44097 /configure
parent7dcf7e6f2593a2d2e3ee5768e27cdf17500c90c9 (diff)
Configure support for multiple include levels in qmake.conf hierarchy.
If a configuration file included in qmake.conf had an include statements of its own, the variables defined in the second level of included files were not parsed by getQMakeConf function from configure. Author: Adrian Constantin <adrian.constantin@nokia.com> Reviewed-by: Thiago Macieira
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure32
1 files changed, 23 insertions, 9 deletions
diff --git a/configure b/configure
index 04f17bd010..1b1799c7e3 100755
--- a/configure
+++ b/configure
@@ -106,6 +106,28 @@ QMakeVar()
echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
}
+# Helper function for getQMakeConf. It parses include statements in
+# qmake.conf and prints out the expanded file
+getQMakeConf1()
+{
+ while read line; do case "$line" in
+ include*)
+ inc_file=`echo "$line" | sed -n -e "/^include.*(.*)/s/include.*(\(.*\)).*$/\1/p"`
+ current_dir=`dirname "$1"`
+ conf_file="$current_dir/$inc_file"
+ if [ ! -e "$conf_file" ]; then
+ echo "WARNING: Unable to find file $conf_file" >&2
+ continue
+ fi
+ getQMakeConf1 "$conf_file"
+ ;;
+ *)
+ echo "$line"
+ ;;
+ esac; done < "$1"
+}
+
+
# relies on $QMAKESPEC being set correctly. parses include statements in
# qmake.conf and prints out the expanded file
getQMakeConf()
@@ -114,15 +136,7 @@ getQMakeConf()
if [ -n "$1" ]; then
tmpSPEC="$1"
fi
- $AWK -v "QMAKESPEC=$tmpSPEC" '
-/^include\(.+\)$/{
- fname = QMAKESPEC "/" substr($0, 9, length($0) - 9)
- while ((getline line < fname) > 0)
- print line
- close(fname)
- next
-}
-{ print }' "$tmpSPEC/qmake.conf"
+ getQMakeConf1 "$tmpSPEC/qmake.conf"
}
# relies on $TEST_COMPILER being set correctly