[1/3] qmake5: Fix 32 bit SDK build on 64 bit host without i386 multilib packages installed
diff mbox

Message ID 074ec4ccf2920abaaa828c1744b572f16871fc6d.1410766811.git.kibo@prevas.dk
State Rejected
Delegated to: Christian Sørensen
Headers show

Commit Message

Kim Bøndergaard Sept. 15, 2014, 7:43 a.m. UTC
---
 .../qt5/qmake5-5.1.1/sdk-x86-64-build-fix.patch    | 11 +++++
 recipes/qt5/qmake5.inc                             | 50 ++++++++++++++++++----
 2 files changed, 52 insertions(+), 9 deletions(-)
 create mode 100644 recipes/qt5/qmake5-5.1.1/sdk-x86-64-build-fix.patch

Patch
diff mbox

diff --git a/recipes/qt5/qmake5-5.1.1/sdk-x86-64-build-fix.patch b/recipes/qt5/qmake5-5.1.1/sdk-x86-64-build-fix.patch
new file mode 100644
index 0000000..18eb31b
--- /dev/null
+++ b/recipes/qt5/qmake5-5.1.1/sdk-x86-64-build-fix.patch
@@ -0,0 +1,11 @@ 
+--- qtbase-opensource-src-5.1.1/configure.orig	2014-09-03 09:52:44.154535578 +0200
++++ qtbase-opensource-src-5.1.1/configure	2014-09-03 09:47:21.822545102 +0200
+@@ -4076,7 +4076,7 @@
+                         \"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp\" \
+                         \"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp\" \
+                         \"\$(SOURCE_PATH)/src/corelib/tools/qlocal_unix.cpp\""
+-            EXEEXT=
++            EXEEXT="real"
+         fi
+         if [ "$BUILD_ON_MAC" = "yes" ]; then
+             echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
diff --git a/recipes/qt5/qmake5.inc b/recipes/qt5/qmake5.inc
index 9650c8d..e8980fc 100644
--- a/recipes/qt5/qmake5.inc
+++ b/recipes/qt5/qmake5.inc
@@ -17,6 +17,10 @@  require qmake5-${PV}.inc
 #TBD: Bugs are seen with more more than 1 parallel maker
 PARALLEL_MAKE = ""
 
+SRC_URI:>HOST_CPU_i686 = "\
+    file://sdk-x86-64-build-fix.patch \
+"
+
 QT_CONF_PATH = "${B}/qt.conf"
 
 EXTRA_OECONF = " \
@@ -73,9 +77,19 @@  export OE_QMAKE_LDFLAGS
 export OE_QMAKE_AR
 export OE_QMAKE_STRIP
 
-CONFIGURE_MINGW_UTILS = ""
-CONFIGURE_MINGW_UTILS:HOST_LIBC_mingw = "do_configure_mingw"
-do_configure[prefuncs] += "${CONFIGURE_MINGW_UTILS}"
+
+CONFIGURE_NATIVE_UTILS = ""
+CONFIGURE_NATIVE_UTILS:HOST_CPU_i686 = "do_configure_linux"
+CONFIGURE_NATIVE_UTILS:HOST_LIBC_mingw = "do_configure_mingw"
+do_configure[prefuncs] += "${CONFIGURE_NATIVE_UTILS}"
+do_configure_linux () {
+#Use native tools instead of using the wrong sdk tools
+    ln -sf ${STAGE_DIR}/native/bin/qmake ${S}/bin/qmake
+    ln -sf ${STAGE_DIR}/native/bin/moc ${S}/bin/moc
+    ln -sf ${STAGE_DIR}/native/bin/rcc ${S}/bin/rcc
+    ln -sf ${STAGE_DIR}/native/bin/uic ${S}/bin/uic
+}
+
 do_configure_mingw () {
 #Use native tools to build instead of using the mingw tools
     ln -sf ${STAGE_DIR}/native/bin/qmake ${S}/bin/qmake
@@ -93,9 +107,17 @@  do_configure_preqt() {
     bin/qmake ${USE_MINGW_SPEC} ${OE_QMAKE_DEBUG_OUTPUT} ${S} -o Makefile || die "Configuring qt with qmake failed. EXTRA_OECONF was ${EXTRA_OECONF}"
 }
 
-CONFIGURE_BUILD_MINGW_UTILS = ""
-CONFIGURE_BUILD_MINGW_UTILS:HOST_LIBC_mingw = "do_configure_mingw2"
-do_configure[postfuncs] += "${CONFIGURE_BUILD_MINGW_UTILS}"
+CONFIGURE_BUILD_SDK_UTILS = ""
+CONFIGURE_BUILD_SDK_UTILS:HOST_CPU_i686 = "do_configure_linux2"
+CONFIGURE_BUILD_SDK_UTILS:HOST_LIBC_mingw = "do_configure_mingw2"
+do_configure[postfuncs] += "${CONFIGURE_BUILD_SDK_UTILS}"
+do_configure_linux2 () {
+    #Set the build target to something else, so it does not overwrite
+    #the native tools
+    echo "TARGET = \"realmoc\"" >> ${S}/src/tools/moc/moc.pro
+    echo "TARGET = \"realrcc\"" >> ${S}/src/tools/rcc/rcc.pro
+    echo "TARGET = \"realuic\"" >> ${S}/src/tools/uic/uic.pro
+}
 do_configure_mingw2 () {
     #Set the build target to something else, so it does not overwrite
     #the native tools
@@ -110,9 +132,19 @@  do_install() {
 
 }
 
-INSTALL_MINGW_UTILS = ""
-INSTALL_MINGW_UTILS:HOST_LIBC_mingw = "do_install_mingw_fixup"
-do_install[postfuncs] += "${INSTALL_MINGW_UTILS}"
+INSTALL_BUILD_UTILS = ""
+INSTALL_BUILD_UTILS:HOST_CPU_i686 = "do_install_linux_fixup"
+INSTALL_BUILD_UTILS:HOST_LIBC_mingw = "do_install_mingw_fixup"
+do_install[postfuncs] += "${INSTALL_BUILD_UTILS}"
+do_install_linux_fixup () {
+    #Set the correct name of the build linux utils
+    rm ${D}${bindir}/qmake
+    install ${S}/bin/qmakereal ${D}${bindir}/qmake
+    #mv ${D}${bindir}/qmakereal ${D}${bindir}/qmake
+    mv ${D}${bindir}/realmoc ${D}${bindir}/moc
+    mv ${D}${bindir}/realuic ${D}${bindir}/uic
+    mv ${D}${bindir}/realrcc ${D}${bindir}/rcc
+}
 do_install_mingw_fixup () {
     #Set the correct name of the build mingw utils
     rm ${D}${bindir}/qmake