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>
This commit is contained in:
Oswald Buddenhagen 2012-08-14 22:09:33 +02:00 committed by Qt by Nokia
parent 0330798037
commit 4d7921b819
3 changed files with 22 additions and 4 deletions

18
configure vendored
View File

@ -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

View File

@ -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)

View File

@ -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