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 <thiago.macieira@intel.com>
This commit is contained in:
parent
65b12fbdb1
commit
67c9b5ad9f
44
configure
vendored
44
configure
vendored
@ -93,6 +93,13 @@ shellEscape()
|
|||||||
echo "$@" | sed 's/ /\ /g'
|
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
|
# Adds a new qmake variable to the cache
|
||||||
# Usage: QMakeVar mode varname contents
|
# Usage: QMakeVar mode varname contents
|
||||||
# where mode is one of: set, add, del
|
# where mode is one of: set, add, del
|
||||||
@ -3028,35 +3035,26 @@ else
|
|||||||
CFG_FRAMEWORK=no
|
CFG_FRAMEWORK=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# auto-detect default include and library search paths
|
# Auto-detect default include and library search paths.
|
||||||
unset tty
|
|
||||||
[ "$OPT_VERBOSE" = "yes" ] && tty=/dev/stderr
|
|
||||||
|
|
||||||
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; }
|
BEGIN { ORS = ""; FS = "="; incs = 0; libs = 0; }
|
||||||
|
|
||||||
function normalize(dir)
|
function normalize(dir)
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
odir = dir
|
odir = dir
|
||||||
gsub(/\\/[^\\/]+\\/\\.\\./, "", dir)
|
gsub(/\/[^\/]+\/\.\./, "", dir)
|
||||||
} while (dir != odir);
|
} while (dir != odir);
|
||||||
do {
|
do {
|
||||||
odir = dir
|
odir = dir
|
||||||
gsub(/\\/\\./, "", dir)
|
gsub(/\/\./, "", dir)
|
||||||
} while (dir != odir);
|
} while (dir != odir);
|
||||||
sub("/$", "", dir);
|
sub("/$", "", dir);
|
||||||
return 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
|
# extract include paths from indented lines between
|
||||||
# #include <...> search starts here:
|
# #include <...> search starts here:
|
||||||
# and
|
# and
|
||||||
@ -3064,7 +3062,7 @@ function quote(s)
|
|||||||
/^\#include </ { yup=1; print "DEFAULT_INCDIRS=\""; next }
|
/^\#include </ { yup=1; print "DEFAULT_INCDIRS=\""; next }
|
||||||
/^End of search/ { yup=0; print "\"\n" }
|
/^End of search/ { yup=0; print "\"\n" }
|
||||||
/ \(framework directory\)$/ { next }
|
/ \(framework directory\)$/ { next }
|
||||||
yup { print quote(normalize(substr($0, 2))) " "; ++incs }
|
yup { print normalize(substr($0, 2)) "\n"; ++incs }
|
||||||
|
|
||||||
# extract from one line like LIBRARY_PATH=/one/path:/another/path:...
|
# extract from one line like LIBRARY_PATH=/one/path:/another/path:...
|
||||||
$1 == "LIBRARY_PATH" {
|
$1 == "LIBRARY_PATH" {
|
||||||
@ -3073,7 +3071,7 @@ $1 == "LIBRARY_PATH" {
|
|||||||
for (lib in library_paths) {
|
for (lib in library_paths) {
|
||||||
dir = normalize(library_paths[lib]);
|
dir = normalize(library_paths[lib]);
|
||||||
if (!(dir in dirs)) {
|
if (!(dir in dirs)) {
|
||||||
print quote(dir) " ";
|
print dir "\n";
|
||||||
dirs[dir] = 1;
|
dirs[dir] = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3082,10 +3080,14 @@ $1 == "LIBRARY_PATH" {
|
|||||||
|
|
||||||
END {
|
END {
|
||||||
if (incs == 0)
|
if (incs == 0)
|
||||||
print "DEFAULT_INCDIRS=\"/usr/include /usr/local/include\"\n";
|
print "DEFAULT_INCDIRS=\"/usr/include\n/usr/local/include\"\n";
|
||||||
if (libs == 0)
|
if (libs == 0)
|
||||||
print "DEFAULT_LIBDIRS=\"/lib /usr/lib\"\n";
|
print "DEFAULT_LIBDIRS=\"/lib\n/usr/lib\"\n";
|
||||||
}' | tee $tty`
|
}'
|
||||||
|
|
||||||
|
unset tty
|
||||||
|
[ "$OPT_VERBOSE" = "yes" ] && tty=/dev/stderr
|
||||||
|
eval "`LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK "$awkprog" | tee $tty`"
|
||||||
unset tty
|
unset tty
|
||||||
|
|
||||||
#setup the build parts
|
#setup the build parts
|
||||||
@ -6597,8 +6599,8 @@ host_build {
|
|||||||
QT_TARGET_ARCH = $CFG_ARCH
|
QT_TARGET_ARCH = $CFG_ARCH
|
||||||
} else {
|
} else {
|
||||||
QT_ARCH = $CFG_ARCH
|
QT_ARCH = $CFG_ARCH
|
||||||
QMAKE_DEFAULT_LIBDIRS = $DEFAULT_LIBDIRS
|
QMAKE_DEFAULT_LIBDIRS = `shellQuoteLines "$DEFAULT_LIBDIRS"`
|
||||||
QMAKE_DEFAULT_INCDIRS = $DEFAULT_INCDIRS
|
QMAKE_DEFAULT_INCDIRS = `shellQuoteLines "$DEFAULT_INCDIRS"`
|
||||||
}
|
}
|
||||||
QT_EDITION = $Edition
|
QT_EDITION = $Edition
|
||||||
QT_CONFIG += $QT_CONFIG
|
QT_CONFIG += $QT_CONFIG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user