From c0264050938c04723f7dc9295ef87cf41ab7a8ae Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 10 Oct 2013 18:05:36 +0200 Subject: normalize QMAKE_DEFAULT_{LIB,INC}DIRS the consumers of these variables use the strings for naive text-based "subtraction", which of course doesn't work particularly well when the paths contain "../", "./", and trailing slashes. Task-number: QTBUG-33714 Change-Id: I893c90e6f5c7cf18c9e6cb1e5be825a16509a2a4 Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- configure | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 5271e6ba1a..f7d770acef 100755 --- a/configure +++ b/configure @@ -3032,6 +3032,21 @@ unset tty eval `LC_ALL=C $TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null | $AWK ' BEGIN { ORS = ""; FS = "="; incs = 0; libs = 0; } + +function normalize(dir) +{ + do { + odir = dir + gsub(/\\/[^/]+\\/\\.\\./, "", dir) + } while (dir != odir); + do { + odir = dir + gsub(/\\/\\./, "", dir) + } while (dir != odir); + sub("/$", "", dir); + return dir; +} + function quote(s) { # We only handle spaces @@ -3047,14 +3062,16 @@ function quote(s) /^\#include