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
This commit is contained in:
parent
b3abb65f6a
commit
a5783e1a09
|
@ -1,7 +1,8 @@
|
||||||
# This is useful for target recipes to reference native mkspecs
|
# This is useful for target recipes to reference native mkspecs
|
||||||
QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}"
|
QMAKE_MKSPEC_PATH_NATIVE = "${STAGING_LIBDIR_NATIVE}/${QT_DIR_NAME}"
|
||||||
|
QMAKE_MKSPEC_PATH_TARGET = "${STAGING_LIBDIR}/${QT_DIR_NAME}"
|
||||||
|
|
||||||
QMAKE_MKSPEC_PATH = "${STAGING_LIBDIR}"
|
QMAKE_MKSPEC_PATH = "${QMAKE_MKSPEC_PATH_TARGET}"
|
||||||
QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}"
|
QMAKE_MKSPEC_PATH_class-native = "${QMAKE_MKSPEC_PATH_NATIVE}"
|
||||||
|
|
||||||
# hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
|
# hardcode linux, because that's what 0001-Add-linux-oe-g-platform.patch adds
|
||||||
|
@ -46,13 +47,20 @@ Libraries = ${libdir}
|
||||||
Headers = ${includedir}/${QT_DIR_NAME}
|
Headers = ${includedir}/${QT_DIR_NAME}
|
||||||
Data = ${datadir}/${QT_DIR_NAME}
|
Data = ${datadir}/${QT_DIR_NAME}
|
||||||
ArchData = ${libdir}/${QT_DIR_NAME}
|
ArchData = ${libdir}/${QT_DIR_NAME}
|
||||||
|
LibraryExecutables = ${libdir}/${QT_DIR_NAME}/libexec
|
||||||
|
Imports = ${libdir}/${QT_DIR_NAME}/imports
|
||||||
|
Qml2Imports = ${libdir}/${QT_DIR_NAME}/qml
|
||||||
Plugins = ${libdir}/${QT_DIR_NAME}/plugins
|
Plugins = ${libdir}/${QT_DIR_NAME}/plugins
|
||||||
Documentation = ${docdir}/${QT_DIR_NAME}
|
Documentation = ${docdir}/${QT_DIR_NAME}
|
||||||
HostData = ${QMAKE_MKSPEC_PATH}
|
HostData = ${QMAKE_MKSPEC_PATH_TARGET}
|
||||||
|
HostBinaries = ${bindir}/${QT_DIR_NAME}
|
||||||
|
HostSpec = ${OE_QMAKESPEC}
|
||||||
|
TartgetSpec = ${OE_XQMAKESPEC}
|
||||||
ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
|
ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
|
||||||
|
Sysroot = ${STAGING_DIR_TARGET}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
#
|
||||||
# Allows to override following values (as in version 5.0.1)
|
# Allows to override following values (as in version 5.0.1)
|
||||||
# Prefix The default prefix for all paths.
|
# Prefix The default prefix for all paths.
|
||||||
# Documentation The location for documentation upon install.
|
# Documentation The location for documentation upon install.
|
||||||
|
|
|
@ -29,40 +29,43 @@ INC_PR = "r0"
|
||||||
QT_BASE_NAME = "qt5"
|
QT_BASE_NAME = "qt5"
|
||||||
QT_DIR_NAME = "qt5"
|
QT_DIR_NAME = "qt5"
|
||||||
|
|
||||||
|
SSTATE_SCAN_FILES += "*.pri *.prl"
|
||||||
|
|
||||||
# Qt uses atomic instructions not supported in thumb mode
|
# Qt uses atomic instructions not supported in thumb mode
|
||||||
ARM_INSTRUCTION_SET = "arm"
|
ARM_INSTRUCTION_SET = "arm"
|
||||||
|
|
||||||
inherit qmake5
|
inherit qmake5
|
||||||
|
|
||||||
|
do_generate_qt_config_file_append() {
|
||||||
|
UNDO_SYSROOT_PREFIX=`echo ${STAGING_DIR_TARGET} | sed 's#/[^/]*#../#g'`
|
||||||
|
cat >> ${WORKDIR}/qt.conf <<EOF
|
||||||
|
|
||||||
#do_generate_qt_config_file() {
|
[EffectivePaths]
|
||||||
# cat > ${WORKDIR}/qt.conf <<EOF
|
Prefix=..
|
||||||
#[Paths]
|
#Prefix=$UNDO_SYSROOT_PREFIX
|
||||||
#Binaries = ${bindir}
|
EOF
|
||||||
#Libraries = ${libdir}
|
}
|
||||||
#Prefix = ${prefix}
|
|
||||||
#Headers = ${includedir}/${QT_DIR_NAME}
|
EXTRA_ENV = 'QMAKE="bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} -after \
|
||||||
#Data = ${datadir}/${QT_DIR_NAME}
|
INCPATH+=${STAGING_INCDIR}/freetype2 LIBS+=-L${STAGING_LIBDIR}" \
|
||||||
#ArchData = ${libdir}/${QT_DIR_NAME}
|
LINK="${CXX} -Wl,-rpath-link,${STAGING_LIBDIR}" \
|
||||||
#Documentation = ${docdir}/${QT_DIR_NAME}
|
STRIP="${OE_QMAKE_STRIP}" \
|
||||||
#HostSpec = ${QMAKE_MKSPEC_PATH_NATIVE}
|
MAKE="make -e ${PARALLEL_MAKE}"'
|
||||||
##HostData = ${S}
|
|
||||||
#TargetSpec = ${S}
|
|
||||||
#ExternalHostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
|
|
||||||
#EOF
|
|
||||||
#}
|
|
||||||
|
|
||||||
# qtbase is exception, we need to use mkspecs from ${S}
|
# qtbase is exception, we need to use mkspecs from ${S}
|
||||||
# QMAKE_MKSPEC_PATH = "${S}/mkspecs"
|
# QMAKE_MKSPEC_PATH = "${S}/mkspecs"
|
||||||
QMAKE_MKSPEC_PATH = "${B}"
|
QMAKE_MKSPEC_PATH = "${B}"
|
||||||
|
|
||||||
do_configure_append() {
|
do_configure_append() {
|
||||||
|
# we need symlink in path relative to source, because
|
||||||
|
# EffectivePaths:Prefix is relative to qmake location
|
||||||
if [ ! -e ${B}/bin/qmake ]; then
|
if [ ! -e ${B}/bin/qmake ]; then
|
||||||
mkdir ${B}/bin
|
mkdir ${B}/bin
|
||||||
ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake
|
ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake
|
||||||
fi
|
fi
|
||||||
|
|
||||||
${S}/configure -v \
|
${S}/configure -v \
|
||||||
|
-dont-process \
|
||||||
-opensource -confirm-license \
|
-opensource -confirm-license \
|
||||||
-sysroot ${STAGING_DIR_TARGET} \
|
-sysroot ${STAGING_DIR_TARGET} \
|
||||||
-no-gcc-sysroot \
|
-no-gcc-sysroot \
|
||||||
|
@ -73,11 +76,16 @@ do_configure_append() {
|
||||||
-sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
|
-sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
|
||||||
-docdir ${docdir}/${QT_DIR_NAME} \
|
-docdir ${docdir}/${QT_DIR_NAME} \
|
||||||
-headerdir ${includedir}/${QT_DIR_NAME} \
|
-headerdir ${includedir}/${QT_DIR_NAME} \
|
||||||
|
-archdatadir ${libdir}/${QT_DIR_NAME} \
|
||||||
|
-libexecdir ${libdir}/${QT_DIR_NAME}/libexec \
|
||||||
-plugindir ${libdir}/${QT_DIR_NAME}/plugins \
|
-plugindir ${libdir}/${QT_DIR_NAME}/plugins \
|
||||||
-importdir ${libdir}/${QT_DIR_NAME}/imports \
|
-importdir ${libdir}/${QT_DIR_NAME}/imports \
|
||||||
|
-qmldir ${libdir}/${QT_DIR_NAME}/qml \
|
||||||
-translationdir ${datadir}/${QT_DIR_NAME}/translations \
|
-translationdir ${datadir}/${QT_DIR_NAME}/translations \
|
||||||
-examplesdir ${bindir}/${QT_DIR_NAME}/examples \
|
-testsdir ${datadir}/${QT_DIR_NAME}/tests \
|
||||||
-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
|
-examplesdir ${datadir}/${QT_DIR_NAME}/examples \
|
||||||
|
-hostbindir ${bindir}/${QT_DIR_NAME} \
|
||||||
|
-hostdatadir ${libdir}/${QT_DIR_NAME} \
|
||||||
-external-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
|
-external-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
|
||||||
-platform ${OE_QMAKESPEC} \
|
-platform ${OE_QMAKESPEC} \
|
||||||
-xplatform linux-oe-g++ \
|
-xplatform linux-oe-g++ \
|
||||||
|
@ -89,10 +97,13 @@ do_configure_append() {
|
||||||
do_compile_append() {
|
do_compile_append() {
|
||||||
# Build qmake for the target arch
|
# Build qmake for the target arch
|
||||||
# Disable for now, because doesn't work well with separate ${B}
|
# Disable for now, because doesn't work well with separate ${B}
|
||||||
# cd ${S}/qmake
|
# cp -ra ${S}/qmake ${B}
|
||||||
|
# cd ${B}/qmake
|
||||||
# ${OE_QMAKE_QMAKE}
|
# ${OE_QMAKE_QMAKE}
|
||||||
|
# Fix to use headers in ${B}
|
||||||
|
# sed '/INCPATH/s#${S}#${B}#g' -i Makefile
|
||||||
# oe_runmake CC="${CC}" CXX="${CXX}"
|
# oe_runmake CC="${CC}" CXX="${CXX}"
|
||||||
# cd ${S}
|
# cd ${B}
|
||||||
}
|
}
|
||||||
|
|
||||||
do_install_append() {
|
do_install_append() {
|
||||||
|
@ -100,9 +111,14 @@ do_install_append() {
|
||||||
### TODO: FIX
|
### TODO: FIX
|
||||||
# qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed
|
# qemu built on host breaks do_package, remove it here (will be replaces with right qemu when do_compile is fixed
|
||||||
# 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')
|
# 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')
|
||||||
rm -f ${D}/${bindir}/qmake
|
rm -f ${D}/${bindir}/${QT_DIR_NAME}/qmake
|
||||||
mv ${D}${B}/mkspecs ${D}${libdir}/mkspecs
|
|
||||||
TMP=`dirname ${D}/${B}/mkspecs`
|
# everything except HostData and HostBinaries is prefixed with sysroot value,
|
||||||
|
# but we cannot remove sysroot override, because that's useful for pkg-config etc
|
||||||
|
cp -ra ${D}${STAGING_DIR_TARGET}/* ${D}
|
||||||
|
rm -rf ${D}${STAGING_DIR_TARGET}
|
||||||
|
# remove empty dirs
|
||||||
|
TMP=`dirname ${D}/${STAGING_DIR_TARGET}`
|
||||||
while test ${TMP} != ${D}; do
|
while test ${TMP} != ${D}; do
|
||||||
rmdir ${TMP}
|
rmdir ${TMP}
|
||||||
TMP=`dirname ${TMP}`;
|
TMP=`dirname ${TMP}`;
|
||||||
|
|
Loading…
Reference in New Issue