summaryrefslogtreecommitdiffstats
path: root/recipes-qt
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2013-04-28 02:24:17 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2013-04-28 15:55:05 +0200
commita5783e1a09bc8788b527b63ee3e8a8f489bf8ba5 (patch)
tree0765c40ed6697522fe87941849982b0963355d40 /recipes-qt
parentb3abb65f6af9e6a48410f53d69444ffb026b39bb (diff)
downloadmeta-qt5-a5783e1a09bc8788b527b63ee3e8a8f489bf8ba5.tar.gz
qtbase: Override all paths and export sysroot
* otherwise sysroot from native build can leak to target build * missing paths like Qml2Imports were defaulting to devault /usr/qml * synchronize values between qt.conf and configure params
Diffstat (limited to 'recipes-qt')
-rw-r--r--recipes-qt/qt5/qtbase.inc62
1 files changed, 39 insertions, 23 deletions
diff --git a/recipes-qt/qt5/qtbase.inc b/recipes-qt/qt5/qtbase.inc
index 5b41bded..c1198477 100644
--- a/recipes-qt/qt5/qtbase.inc
+++ b/recipes-qt/qt5/qtbase.inc
@@ -29,40 +29,43 @@ INC_PR = "r0"
29QT_BASE_NAME = "qt5" 29QT_BASE_NAME = "qt5"
30QT_DIR_NAME = "qt5" 30QT_DIR_NAME = "qt5"
31 31
32SSTATE_SCAN_FILES += "*.pri *.prl"
33
32# Qt uses atomic instructions not supported in thumb mode 34# Qt uses atomic instructions not supported in thumb mode
33ARM_INSTRUCTION_SET = "arm" 35ARM_INSTRUCTION_SET = "arm"
34 36
35inherit qmake5 37inherit qmake5
36 38
39do_generate_qt_config_file_append() {
40 UNDO_SYSROOT_PREFIX=`echo ${STAGING_DIR_TARGET} | sed 's#/[^/]*#../#g'`
41 cat >> ${WORKDIR}/qt.conf <<EOF
42
43[EffectivePaths]
44Prefix=..
45#Prefix=$UNDO_SYSROOT_PREFIX
46EOF
47}
37 48
38#do_generate_qt_config_file() { 49EXTRA_ENV = 'QMAKE="bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} -after \
39# cat > ${WORKDIR}/qt.conf <<EOF 50 INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
40#[Paths] 51 LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
41#Binaries = ${bindir} 52 STRIP="${OE_QMAKE_STRIP}" \
42#Libraries = ${libdir} 53 MAKE="make -e ${PARALLEL_MAKE}"'
43#Prefix = ${prefix}
44#Headers = ${includedir}/${QT_DIR_NAME}
45#Data = ${datadir}/${QT_DIR_NAME}
46#ArchData = ${libdir}/${QT_DIR_NAME}
47#Documentation = ${docdir}/${QT_DIR_NAME}
48#HostSpec = ${QMAKE_MKSPEC_PATH_NATIVE}
49##HostData = ${S}
50#TargetSpec = ${S}
51#ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
52#EOF
53#}
54 54
55# qtbase is exception, we need to use mkspecs from ${S} 55# qtbase is exception, we need to use mkspecs from ${S}
56# QMAKE_MKSPEC_PATH = "${S}/mkspecs" 56# QMAKE_MKSPEC_PATH = "${S}/mkspecs"
57QMAKE_MKSPEC_PATH = "${B}" 57QMAKE_MKSPEC_PATH = "${B}"
58 58
59do_configure_append() { 59do_configure_append() {
60 # we need symlink in path relative to source, because
61 # EffectivePaths:Prefix is relative to qmake location
60 if [ ! -e ${B}/bin/qmake ]; then 62 if [ ! -e ${B}/bin/qmake ]; then
61 mkdir ${B}/bin 63 mkdir ${B}/bin
62 ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake 64 ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake
63 fi 65 fi
64 66
65 ${S}/configure -v \ 67 ${S}/configure -v \
68 -dont-process \
66 -opensource -confirm-license \ 69 -opensource -confirm-license \
67 -sysroot ${STAGING_DIR_TARGET} \ 70 -sysroot ${STAGING_DIR_TARGET} \
68 -no-gcc-sysroot \ 71 -no-gcc-sysroot \
@@ -73,11 +76,16 @@ do_configure_append() {
73 -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \ 76 -sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
74 -docdir ${docdir}/${QT_DIR_NAME} \ 77 -docdir ${docdir}/${QT_DIR_NAME} \
75 -headerdir ${includedir}/${QT_DIR_NAME} \ 78 -headerdir ${includedir}/${QT_DIR_NAME} \
79 -archdatadir ${libdir}/${QT_DIR_NAME} \
80 -libexecdir ${libdir}/${QT_DIR_NAME}/libexec \
76 -plugindir ${libdir}/${QT_DIR_NAME}/plugins \ 81 -plugindir ${libdir}/${QT_DIR_NAME}/plugins \
77 -importdir ${libdir}/${QT_DIR_NAME}/imports \ 82 -importdir ${libdir}/${QT_DIR_NAME}/imports \
83 -qmldir ${libdir}/${QT_DIR_NAME}/qml \
78 -translationdir ${datadir}/${QT_DIR_NAME}/translations \ 84 -translationdir ${datadir}/${QT_DIR_NAME}/translations \
79 -examplesdir ${bindir}/${QT_DIR_NAME}/examples \ 85 -testsdir ${datadir}/${QT_DIR_NAME}/tests \
80 -hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \ 86 -examplesdir ${datadir}/${QT_DIR_NAME}/examples \
87 -hostbindir ${bindir}/${QT_DIR_NAME} \
88 -hostdatadir ${libdir}/${QT_DIR_NAME} \
81 -external-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \ 89 -external-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
82 -platform ${OE_QMAKESPEC} \ 90 -platform ${OE_QMAKESPEC} \
83 -xplatform linux-oe-g++ \ 91 -xplatform linux-oe-g++ \
@@ -89,10 +97,13 @@ do_configure_append() {
89do_compile_append() { 97do_compile_append() {
90 # Build qmake for the target arch 98 # Build qmake for the target arch
91 # Disable for now, because doesn't work well with separate ${B} 99 # Disable for now, because doesn't work well with separate ${B}
92 # cd ${S}/qmake 100 # cp -ra ${S}/qmake ${B}
101 # cd ${B}/qmake
93 # ${OE_QMAKE_QMAKE} 102 # ${OE_QMAKE_QMAKE}
103 # Fix to use headers in ${B}
104 # sed '/INCPATH/s#${S}#${B}#g' -i Makefile
94 # oe_runmake CC="${CC}" CXX="${CXX}" 105 # oe_runmake CC="${CC}" CXX="${CXX}"
95 # cd ${S} 106 # cd ${B}
96} 107}
97 108
98do_install_append() { 109do_install_append() {
@@ -100,9 +111,14 @@ do_install_append() {
100 ### TODO: FIX 111 ### TODO: FIX
101 # qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed 112 # qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed
102 # ERROR: objcopy failed with exit code 1 (cmd was 'arm-oe-linux-gnueabi-objcopy' --only-keep-debug '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/qmake' '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/.debug/qmake') 113 # ERROR: objcopy failed with exit code 1 (cmd was 'arm-oe-linux-gnueabi-objcopy' --only-keep-debug '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/qmake' '/OE/oe-core/tmp-eglibc/work/armv5te-oe-linux-gnueabi/qtbase/5.0.1-r0.0/package/usr/bin/.debug/qmake')
103 rm -f ${D}/${bindir}/qmake 114 rm -f ${D}/${bindir}/${QT_DIR_NAME}/qmake
104 mv ${D}${B}/mkspecs ${D}${libdir}/mkspecs 115
105 TMP=`dirname ${D}/${B}/mkspecs` 116 # everything except HostData and HostBinaries is prefixed with sysroot value,
117 # but we cannot remove sysroot override, because that's useful for pkg-config etc
118 cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
119 rm -rf ${D}${STAGING_DIR_TARGET}
120 # remove empty dirs
121 TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
106 while test ${TMP} != ${D}; do 122 while test ${TMP} != ${D}; do
107 rmdir ${TMP} 123 rmdir ${TMP}
108 TMP=`dirname ${TMP}`; 124 TMP=`dirname ${TMP}`;