qtbase: correctly configure

This commit is contained in:
Martin Jansa 2013-03-30 04:04:20 +01:00
parent 2b5c531b22
commit 85b0bb6445
3 changed files with 39 additions and 36 deletions

View File

@ -56,6 +56,7 @@ QT_CONFIG_FLAGS += " \
"
do_configure() {
# set_arch
set_endian
if [ ! -e bin/qmake ]; then
@ -66,13 +67,9 @@ do_configure() {
ln -sf linux-g++ mkspecs/${TARGET_OS}-oe-g++
fi
if [ -f mkspecs/common/g++-unix.conf ] ; then
# mkspecs were refactored for 4.8.0
cp -f ${WORKDIR}/g++.conf mkspecs/common/g++-unix.conf
else
cp -f ${WORKDIR}/g++.conf mkspecs/common/g++.conf
fi
cp -f ${WORKDIR}/linux.conf mkspecs/common/
# replace common files with our version
cp -f ${WORKDIR}/g++.conf mkspecs/common/g++-unix.conf
cp -f ${WORKDIR}/linux.conf mkspecs/common/linux.conf
# Avoid problems with the linkers, since we want the linker to be g++
unset LD

View File

@ -12,13 +12,16 @@ SRC_URI += " \
DEPENDS += "qtbase-native virtual/libgl freetype jpeg libpng zlib openssl glib-2.0 ${ICU}"
# to provide xcb/xcb_icccm.h, xcb/xcb_image.h, xcb/xcb_keysyms.h and dbus/dbus.h
# DEPENDS += "xcb-util-wm xcb-util-image xcb-util-keysyms dbus"
XCB_DEPENDS += "xcb-util-wm xcb-util-image xcb-util-keysyms dbus"
# reenable when we switch to "-qt-xcb" and build of
# DEPENDS += "${XCB_DEPENDS}"
# QT_MODULE_FLAGS = "-qt-xcb"
# src/platformsupport/glxconvenience/ is resolved to be before build of
# src/plugins/platforms/xcb/
QT_MODULE_FLAGS = "-no-xcb"
INC_PR = "r0"
QT_BASE_NAME = "qt5"
@ -29,28 +32,32 @@ ARM_INSTRUCTION_SET = "arm"
inherit qmake5
do_generate_qt_config_file() {
:
cat > ${WORKDIR}/qt.conf <<EOF
[Paths]
Binaries = ${bindir}
Libraries = ${libdir}
Prefix = ${prefix}
Headers = ${includedir}/${QT_DIR_NAME}
Data = ${datadir}/${QT_DIR_NAME}
ArchData = ${libdir}/${QT_DIR_NAME}
Documentation = ${docdir}/${QT_DIR_NAME}
HostData = ${S}
HostSpecPath = ${QMAKE_MKSPEC_PATH_NATIVE}
HostBinaries = ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME}
EOF
}
# qtbase is exception, we need to use mkspecs from ${S}
OE_XQMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
do_configure_append() {
### Make sure that our mkspecs will eventually end up in STAGING_DATADIR
${OE_QMAKE_QMAKE} -set OE_CROSS_INSTALL_DATA ${datadir}/${QT_DIR_NAME}
sed -i '/mkspecs\.path/s/QT_HOST_DATA/OE_CROSS_INSTALL_DATA/' qtbase.pro
sed -i '/pritarget/s/QT_HOST_DATA/OE_CROSS_INSTALL_DATA/' mkspecs/features/qt_installs.prf
### Same applies to the module headers...
${OE_QMAKE_QMAKE} -set OE_CROSS_INSTALL_HEADERS ${includedir}/${QT_DIR_NAME}
sed -i 's/QT_INSTALL_HEADERS/OE_CROSS_INSTALL_HEADERS/g' mkspecs/features/qt_installs.prf
### Create the mkspec for the target
mkdir -p mkspecs/${TARGET_OS}-oe-g++
cp -f ${WORKDIR}/qplatformdefs.h mkspecs/${TARGET_OS}-oe-g++
bash ${WORKDIR}/qmake.conf.sh > mkspecs/${TARGET_OS}-oe-g++/qmake.conf
### Fix up prl and pkgconfig lib paths, by default they will point to /usr/lib
${OE_QMAKE_QMAKE} -set OE_CROSS_INSTALL_LIBS ${STAGING_LIBDIR}
sed -i 's/QT_INSTALL_LIBS\/raw/OE_CROSS_INSTALL_LIBS/g' mkspecs/features/qt_module.prf
# in qtbase case we want to find qmodule.pri in ${S}/mkspec
# ./features/qt_build_config.prf: QMAKE_QT_MODULE = $$[QT_HOST_DATA/get]/mkspecs/qmodule.pri
echo "HostData = ${S}" >> ${QT_CONF_PATH}
# qtbase is exception, create mkspecs for it
if [ ! -e ${OE_XQMAKESPEC} ]; then
mkdir -p ${OE_XQMAKESPEC}
bash ${WORKDIR}/qmake.conf.sh > ${OE_XQMAKESPEC}/qmake.conf
fi
./configure -v \
-dont-process \
@ -58,7 +65,7 @@ do_configure_append() {
-prefix ${prefix} \
-bindir ${bindir} \
-libdir ${libdir} \
-datadir ${datadir}/${QT_DIR_NAME} \
-datadir ${S} \
-sysconfdir ${sysconfdir}/${QT_DIR_NAME} \
-docdir ${docdir}/${QT_DIR_NAME} \
-headerdir ${includedir}/${QT_DIR_NAME} \
@ -66,20 +73,18 @@ do_configure_append() {
-importdir ${libdir}/${QT_DIR_NAME}/imports \
-translationdir ${datadir}/${QT_DIR_NAME}/translations \
-examplesdir ${bindir}/${QT_DIR_NAME}/examples \
-platform ${TARGET_OS}-oe-g++ \
-xplatform ${TARGET_OS}-oe-g++ \
-hostdatadir ${S} \
-hostbindir ${STAGING_BINDIR_NATIVE}/${QT_DIR_NAME} \
-platform ${OE_QMAKESPEC} \
-xplatform ${OE_XQMAKESPEC} \
${QT_CONFIG_FLAGS}
### As we provided the '-dont-process' switch inorder to allow us to stage a few files
### generated by the configure we need to manually run qmake the generate _all_ the Makefiles (-r)
export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
${OE_QMAKE_QMAKE} -r -d
}
do_compile_append() {
# Build qmake for the target arch
cd ${S}/qmake
export QMAKESPEC="${S}/mkspecs/${TARGET_OS}-oe-g++"
${OE_QMAKE_QMAKE}
oe_runmake CC="${CC}" CXX="${CXX}"
cd ${S}

View File

@ -35,6 +35,7 @@ QMAKE_CXX = ${OE_QMAKE_CXX}
QMAKE_LINK = ${OE_QMAKE_LINK}
QMAKE_LINK_SHLIB = ${OE_QMAKE_LINK}
QMAKE_CONF_COMPILER = ${OE_QMAKE_CONF_COMPILER}
QMAKE_QT_CONFIG = ${OE_QMAKE_QT_CONFIG}
load(qt_config)
EOF