Introduce gcc machinedump considerations to build system
authorDonald Carr <donald.carr@nokia.com>
Thu, 31 May 2012 21:58:32 +0000 (21:58 +0000)
committerQt by Nokia <qt-info@nokia.com>
Mon, 4 Jun 2012 20:29:24 +0000 (22:29 +0200)
This information is required by qmake when cross compiling for Debian based
multi-arch devices in order to adequately resolve system libraries and
pkg-config information.

Change-Id: If96e677ab27c6f0453889c8f7cc43bdb9016f8b6
Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
configure

index c23c0a7..17ea5b8 100755 (executable)
--- a/configure
+++ b/configure
@@ -2501,6 +2501,12 @@ if [ "$XPLATFORM_SYMBIAN_SBSV2" = "no" ]; then
     fi
 fi
 
+GCC_MACHINE_DUMP=
+case "$TEST_COMPILER" in *g++) GCC_MACHINE_DUMP=$($TEST_COMPILER -dumpmachine);; esac
+if [ -n "$GCC_MACHINE_DUMP" ]; then
+    DeviceVar set GCC_MACHINE_DUMP $($TEST_COMPILER -dumpmachine)
+fi
+
 if [ -n "$CFG_SYSROOT" ]; then
     SYSROOT_FLAG="--sysroot=$CFG_SYSROOT"
 else
@@ -3620,6 +3626,9 @@ elif [ -n "$PKG_CONFIG" ]; then
         if [ -z "$PKG_CONFIG_LIBDIR" ]; then
             if [ -n "$CFG_SYSROOT" ] && [ -d "$CFG_SYSROOT/usr/lib/pkgconfig" ]; then
                 PKG_CONFIG_LIBDIR=$CFG_SYSROOT/usr/lib/pkgconfig:$CFG_SYSROOT/usr/share/pkgconfig
+                if [ -n "$GCC_MACHINE_DUMP" ]; then
+                    PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR:$CFG_SYSROOT/usr/lib/$GCC_MACHINE_DUMP/pkgconfig
+                fi
                 export PKG_CONFIG_LIBDIR
                 echo >&2 "Note: PKG_CONFIG_LIBDIR automatically set to $PKG_CONFIG_LIBDIR"
             elif [ "$CFG_PKGCONFIG" = "yes" ]; then