summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-08-21 14:39:29 +0200
committerJason Barron <jbarron@trolltech.com>2009-08-21 14:39:29 +0200
commite59ee48a8656d04339967ad99334bd0ddca0c956 (patch)
tree4fe72429115ae4a4171cd3f1f06d9a3a425973d0 /configure
parent4aa6869877d4906fcfaac5388294748512cace25 (diff)
parent508b447075fb852e61ddf88c92c9099dad292747 (diff)
downloadqt4-tools-e59ee48a8656d04339967ad99334bd0ddca0c956.tar.gz
Merge commit 'qt/master'
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure35
1 files changed, 35 insertions, 0 deletions
diff --git a/configure b/configure
index 6960772579..6bd755258e 100755
--- a/configure
+++ b/configure
@@ -47,6 +47,11 @@ QMAKE_VARS_FILE=.qmake.vars
# utility functions
#-------------------------------------------------------------------------------
+shellEscape()
+{
+ echo "$@" | sed 's/ /\ /g'
+}
+
# Adds a new qmake variable to the cache
# Usage: QMakeVar mode varname contents
# where mode is one of: set, add, del
@@ -89,6 +94,29 @@ getQMakeConf()
{ print }' "$tmpSPEC/qmake.conf"
}
+# relies on $TEST_COMPILER being set correctly
+compilerSupportsFlag()
+{
+ cat >conftest.cpp <<EOF
+int main() { return 0; }
+EOF
+ "$TEST_COMPILER" "$@" -o /dev/null conftest.cpp
+ ret=$?
+ rm -f conftest.cpp conftest.o
+ return $?
+}
+
+# relies on $TEST_COMPILER being set correctly
+linkerSupportsFlag()
+{
+ lflags=-Wl
+ for flag; do
+ safe_flag=`shellEscape "$flag"`
+ lflags=$lflags,$safe_flag
+ done
+ compilerSupportsFlag "$lflags"
+}
+
#-------------------------------------------------------------------------------
# operating system detection
#-------------------------------------------------------------------------------
@@ -7008,6 +7036,13 @@ QMAKE_LIBDIR_QT = \$\$QT_BUILD_TREE/lib
EOF
+# Ensure we can link to uninistalled libraries
+if linkerSupportsFlag -rpath-link "$outpath/lib"; then
+ echo "QMAKE_LFLAGS += -Wl,-rpath-link,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
+elif linkerSupportsFlag -rpath "$outpath/lib"; then
+ echo "QMAKE_LFLAGS += -Wl,-rpath,\$\$QT_BUILD_TREE/lib" >> "$CACHEFILE.tmp"
+fi
+
if [ -n "$QT_CFLAGS_PSQL" ]; then
echo "QT_CFLAGS_PSQL = $QT_CFLAGS_PSQL" >> "$CACHEFILE.tmp"
fi