summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@collabora.co.uk>2012-06-29 09:16:15 +0200
committerQt by Nokia <qt-info@nokia.com>2012-07-03 01:09:07 +0200
commit865b910dc083c6341587ea1e91656eccef5c3f04 (patch)
tree489d0978ef00cb5d31a61d1cb4baf7345b01cfa7 /configure
parentb97070f2c489877b650283842fbbdea708102a40 (diff)
configure: properly quote glesv2 flags
pkg-config returns glesv2 build flags, which are parsed into a few variables. However, extra spaces get included in these variables and quoted, which makes includes paths not work. This problem can only be hit, if you do not have GL ES 2 headers installed system-wide, but you do have installed into $prefix, and pkg-config configured to return the configuration for $prefix. Even though pkg-config returns correct paths, extra space gets included. Fix it by parsing the strings returned by pkg-config just like a shell would parse a command line. pkg-config escapes e.g. spaces, so those escape sequences need to be interpreted, while doing word-splitting. The result is a quoted list, as expected in the qmake files. Done-with: Pekka Paalanen <ppaalanen@gmail.com> Change-Id: I0593ef7e0606ac5ea80da046e45f86806206951a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure23
1 files changed, 19 insertions, 4 deletions
diff --git a/configure b/configure
index c85c39c4f7..097bd90c90 100755
--- a/configure
+++ b/configure
@@ -108,6 +108,21 @@ QMakeVar()
echo "$2" "$eq" "$3" >> "$QMAKE_VARS_FILE"
}
+shellArgumentListToQMakeListHelper()
+{
+ local retval
+ for arg in "$@"; do retval="$retval \"$arg\""; done
+ echo "$retval"
+}
+
+# Convert a string usable on a shell command line into word-by-word quoted
+# qmake list.
+shellArgumentListToQMakeList()
+{
+ # eval is needed for the shell to interpret the backslash escape sequences
+ eval shellArgumentListToQMakeListHelper "$@"
+}
+
# Helper function for getQMakeConf. It parses include statements in
# qmake.conf and prints out the expanded file
getQMakeConf1()
@@ -4518,9 +4533,9 @@ elif [ "$CFG_OPENGL" = "es2" ]; then
QMAKE_LIBDIR_OPENGL_ES2=`$PKG_CONFIG --libs-only-L glesv2 2>/dev/null | sed -e 's,^-L,,g' -e 's, -L, ,g'`
QMAKE_LIBS_OPENGL_ES2=`$PKG_CONFIG --libs glesv2 2>/dev/null`
QMAKE_CFLAGS_OPENGL_ES2=`$PKG_CONFIG --cflags glesv2 2>/dev/null`
- QMakeVar set QMAKE_INCDIR_OPENGL_ES2 "$QMAKE_INCDIR_OPENGL_ES2"
- QMakeVar set QMAKE_LIBDIR_OPENGL_ES2 "$QMAKE_LIBDIR_OPENGL_ES2"
- QMakeVar set QMAKE_LIBS_OPENGL_ES2 "$QMAKE_LIBS_OPENGL_ES2"
+ QMakeVar set QMAKE_INCDIR_OPENGL_ES2 "`shellArgumentListToQMakeList "$QMAKE_INCDIR_OPENGL_ES2"`"
+ QMakeVar set QMAKE_LIBDIR_OPENGL_ES2 "`shellArgumentListToQMakeList "$QMAKE_LIBDIR_OPENGL_ES2"`"
+ QMakeVar set QMAKE_LIBS_OPENGL_ES2 "`shellArgumentListToQMakeList "$QMAKE_LIBS_OPENGL_ES2"`"
fi
"$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $D_FLAGS $l_FLAGS $QMAKE_LIBS_OPENGL_ES2 $QMAKE_CFLAGS_OPENGL_ES2
@@ -5809,7 +5824,7 @@ fi
if [ -n "$QMAKE_INCDIR_OPENGL_ES2" ]; then
echo "#Qt opengl include path" >> "$QTCONFIG.tmp"
- echo "QMAKE_INCDIR_OPENGL_ES2 = \"$QMAKE_INCDIR_OPENGL_ES2\"" >> "$QTCONFIG.tmp"
+ echo "QMAKE_INCDIR_OPENGL_ES2 = `shellArgumentListToQMakeList "$QMAKE_INCDIR_OPENGL_ES2"`" >> "$QTCONFIG.tmp"
fi
# replace qconfig.pri if it differs from the newly created temp file