summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2012-08-14 22:09:33 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-22 18:40:17 +0200
commit4d7921b819c9966eb0732a3e672f18833d65c7fc (patch)
treea2628ee343329962cdfaaa5cf7b2c03a03a7d9af
parent03307980379293c9127e5aa01dcd9c7b1c3fbf06 (diff)
make configure set up QMAKE_DEFAULT_{INC,LIB}DIRS
hard-coding it in unix.conf was no particularly good idea for hopefully obvious reasons. the windows version is so far just a stub that does what the makespecs hard-coded - more doesn't seem worth the effort. the guys interested in x-building may want to rectify it at some point, but it's not going to be easy. Change-Id: I8fedd841a8416f8c0c57018752eae9510b5d00d0 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
-rwxr-xr-xconfigure18
-rw-r--r--mkspecs/common/unix.conf3
-rw-r--r--tools/configure/configureapp.cpp5
3 files changed, 22 insertions, 4 deletions
diff --git a/configure b/configure
index 0b9eac8df3..cbd92daf06 100755
--- a/configure
+++ b/configure
@@ -2542,6 +2542,7 @@ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
exit 1
fi
fi
+TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
GCC_MACHINE_DUMP=
case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac
@@ -2567,7 +2568,6 @@ fi
# auto-detect support for separate debug info in objcopy
if [ "$CFG_SEPARATE_DEBUG_INFO" != "no" ] && [ "$CFG_SHARED" = "yes" ]; then
- TEST_COMPILER_CXXFLAGS=`getXQMakeConf QMAKE_CXXFLAGS`
TEST_OBJCOPY=`getXQMakeConf QMAKE_OBJCOPY`
COMPILER_WITH_FLAGS="$TEST_COMPILER $TEST_COMPILER_CXXFLAGS"
if "$unixtests/objcopy.test" "$COMPILER_WITH_FLAGS" "$TEST_OBJCOPY" "$OPT_VERBOSE"; then
@@ -2632,6 +2632,20 @@ else
CFG_FRAMEWORK=no
fi
+# auto-detect default include and library search paths
+gccout=`$TEST_COMPILER $SYSROOT_FLAG $TEST_COMPILER_CXXFLAGS -xc++ -E -v - < /dev/null 2>&1 > /dev/null`
+libdirs=`echo "$gccout" | sed -n -e 's/^LIBRARY_PATH=\(.*\)/\1/p'`
+DEFAULT_LIBDIRS=`IFS=:; for i in $libdirs; do test -d "$i" && cd "$i" && pwd; done | sort -u`
+DEFAULT_INCDIRS=`echo "$gccout" | awk '
+/^End of search/ { yup=0 }
+yup { print substr($0, 2) }
+/^\#include </ { yup=1 }
+' | sort -u`
+test -z "$DEFAULT_LIBDIRS" && DEFAULT_LIBDIRS="/lib
+/usr/lib"
+test -z "$DEFAULT_INCDIRS" && DEFAULT_INCDIRS="/usr/include
+/usr/local/include"
+
#setup the build parts
if [ -z "$CFG_BUILD_PARTS" ]; then
CFG_BUILD_PARTS="$QT_DEFAULT_BUILD_PARTS"
@@ -5891,6 +5905,8 @@ QT_ARCH = $CFG_ARCH
QT_HOST_ARCH = $CFG_HOST_ARCH
QT_CPU_FEATURES = $CFG_CPUFEATURES
QT_HOST_CPU_FEATURES = $CFG_HOST_CPUFEATURES
+QMAKE_DEFAULT_LIBDIRS = `echo "$DEFAULT_LIBDIRS" | sed 's,^,",;s,$,",' | tr '\n' ' '`
+QMAKE_DEFAULT_INCDIRS = `echo "$DEFAULT_INCDIRS" | sed 's,^,",;s,$,",' | tr '\n' ' '`
QT_EDITION = $Edition
QT_CONFIG += $QT_CONFIG
diff --git a/mkspecs/common/unix.conf b/mkspecs/common/unix.conf
index 5bbc25bb1d..9ee626562b 100644
--- a/mkspecs/common/unix.conf
+++ b/mkspecs/common/unix.conf
@@ -13,7 +13,4 @@ QMAKE_PREFIX_SHLIB = lib
QMAKE_PREFIX_STATICLIB = lib
QMAKE_EXTENSION_STATICLIB = a
-QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include
-QMAKE_DEFAULT_LIBDIRS = /usr/lib /usr/local/lib
-
include(shell-unix.conf)
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp
index f031cfcf11..29f6de9b2a 100644
--- a/tools/configure/configureapp.cpp
+++ b/tools/configure/configureapp.cpp
@@ -2888,6 +2888,11 @@ void Configure::generateQConfigPri()
configStream << "QT_HOST_ARCH = " << dictionary["QT_HOST_ARCH"] << endl;
configStream << "QT_CPU_FEATURES = " << dictionary["QT_CPU_FEATURES"] << endl;
configStream << "QT_HOST_CPU_FEATURES = " << dictionary["QT_HOST_CPU_FEATURES"] << endl;
+ if (!dictionary["XQMAKESPEC"].isEmpty() && !dictionary["XQMAKESPEC"].startsWith("wince")) {
+ // FIXME: add detection
+ configStream << "QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib" << endl;
+ configStream << "QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include" << endl;
+ }
if (dictionary["QT_EDITION"].contains("OPENSOURCE"))
configStream << "QT_EDITION = " << QLatin1String("OpenSource") << endl;
else