From 67c9b5ad9f32bc0ef89a34f01b1f0602a4869865 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 24 Oct 2013 20:36:25 +0200 Subject: fix filtering of system paths the path filtering functions assume that DEFAULT_{INC,LIB}DIRS are newline separated lists of unquoted strings, which 8fbf959be broke. Task-number: QTBUG-33714 Change-Id: Ie07909963ac5155a8ac79ca9254f34069925e001 Reviewed-by: Thiago Macieira --- configure | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) (limited to 'configure') diff --git a/configure b/configure index f8dcebe9f6..3a8665d1c2 100755 --- a/configure +++ b/configure @@ -93,6 +93,13 @@ shellEscape() echo "$@" | sed 's/ /\ /g' } +shellQuoteLines() +{ + # The call of the outer echo makes the shell word-split the output of + # the nested pipe, thus effectively converting newlines to spaces. + echo `echo "$1" | sed 's,^[^ ]* .*$,"&",'` +} + # Adds a new qmake variable to the cache # Usage: QMakeVar mode varname contents # where mode is one of: set, add, del @@ -3028,35 +3035,26 @@ else CFG_FRAMEWORK=no fi -# auto-detect default include and library search paths -unset tty -[ "$OPT_VERBOSE" = "yes" ] && tty=/dev/stderr +# Auto-detect default include and library search paths. -eval `LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK ' +# Use intermediate variable to get around backtick/quote nesting problems. +awkprog=' BEGIN { ORS = ""; FS = "="; incs = 0; libs = 0; } function normalize(dir) { do { odir = dir - gsub(/\\/[^\\/]+\\/\\.\\./, "", dir) + gsub(/\/[^\/]+\/\.\./, "", dir) } while (dir != odir); do { odir = dir - gsub(/\\/\\./, "", dir) + gsub(/\/\./, "", dir) } while (dir != odir); sub("/$", "", dir); return dir; } -function quote(s) -{ - # We only handle spaces - if (match(s, " ") != 0) - return "\\\\\"" s "\\\\\""; - return s; -} - # extract include paths from indented lines between # #include <...> search starts here: # and @@ -3064,7 +3062,7 @@ function quote(s) /^\#include &1 > /dev/null | $AWK "$awkprog" | tee $tty`" unset tty #setup the build parts @@ -6597,8 +6599,8 @@ host_build { QT_TARGET_ARCH = $CFG_ARCH } else { QT_ARCH = $CFG_ARCH - QMAKE_DEFAULT_LIBDIRS = $DEFAULT_LIBDIRS - QMAKE_DEFAULT_INCDIRS = $DEFAULT_INCDIRS + QMAKE_DEFAULT_LIBDIRS = `shellQuoteLines "$DEFAULT_LIBDIRS"` + QMAKE_DEFAULT_INCDIRS = `shellQuoteLines "$DEFAULT_INCDIRS"` } QT_EDITION = $Edition QT_CONFIG += $QT_CONFIG -- cgit v1.2.1