From: Martin Jansa Date: Sun, 28 Apr 2013 20:30:58 +0000 (+0200) Subject: qmake5_base: add qmake5_base_do_configure which allows to declare QMAKE_VARSUBST_* X-Git-Tag: rev_ivi_2015_02_04~1148 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e5479cf5b1ecce69a6902a38e3f8aa8d47521c5;p=scm%2Fbb%2Ftizen-distro.git qmake5_base: add qmake5_base_do_configure which allows to declare QMAKE_VARSUBST_* * don't export it, let recipe decide where to call it or even if it should be called (native recipes are not using it) (From meta-qt5 rev: 18d2e711d87ffd8c6c341757d5810cef1d05dc39) Signed-off-by: Martin Jansa Signed-off-by: Patrick Ohly --- diff --git a/meta-qt5/classes/qmake5_base.bbclass b/meta-qt5/classes/qmake5_base.bbclass index 5f83d12..dd58dac 100644 --- a/meta-qt5/classes/qmake5_base.bbclass +++ b/meta-qt5/classes/qmake5_base.bbclass @@ -91,3 +91,26 @@ EOF # HostSpec The location where to install host mkspec addtask generate_qt_config_file after do_patch before do_configure + +qmake5_base_do_configure () { + if [ -z "${QMAKE_PROFILES}" ]; then + PROFILES="`ls ${S}/*.pro`" + else + PROFILES="${QMAKE_PROFILES}" + bbnote "qmake using profiles: '${QMAKE_PROFILES}'" + fi + + if [ ! -z "${EXTRA_QMAKEVARS_POST}" ]; then + AFTER="-after" + QMAKE_VARSUBST_POST="${EXTRA_QMAKEVARS_POST}" + bbnote "qmake postvar substitution: '${EXTRA_QMAKEVARS_POST}'" + fi + + if [ ! -z "${EXTRA_QMAKEVARS_PRE}" ]; then + QMAKE_VARSUBST_PRE="${EXTRA_QMAKEVARS_PRE}" + bbnote "qmake prevar substitution: '${EXTRA_QMAKEVARS_PRE}'" + fi + + CMD="${OE_QMAKE_QMAKE} -makefile -o Makefile ${OE_QMAKE_DEBUG_OUTPUT} -r $QMAKE_VARSUBST_PRE $AFTER $PROFILES $QMAKE_VARSUBST_POST" + $CMD || die "Error calling $CMD" +} diff --git a/meta-qt5/recipes-qt/qt5/qt5.inc b/meta-qt5/recipes-qt/qt5/qt5.inc index a4ac90b..4e78577 100644 --- a/meta-qt5/recipes-qt/qt5/qt5.inc +++ b/meta-qt5/recipes-qt/qt5/qt5.inc @@ -1,6 +1,6 @@ # Copyright (C) 2012 O.S. Systems Software LTDA. -inherit qmake5_base +inherit qmake5 # Qt5 is dependent on icu for localization ICU = "icu " @@ -71,6 +71,8 @@ do_configure() { # Existing separate build directory, exists, remove rm -rf "${B}/*" fi + + qmake5_base_do_configure } do_compile() { diff --git a/meta-qt5/recipes-qt/qt5/qt5module.inc b/meta-qt5/recipes-qt/qt5/qt5module.inc index 45053f0..bbb05a6 100644 --- a/meta-qt5/recipes-qt/qt5/qt5module.inc +++ b/meta-qt5/recipes-qt/qt5/qt5module.inc @@ -1,9 +1,3 @@ require qt5.inc DEPENDS += "qtbase" - -inherit qmake5 - -do_configure_append () { - ${OE_QMAKE_QMAKE} ${OE_QMAKE_DEBUG_OUTPUT} -r ${S} -} diff --git a/meta-qt5/recipes-qt/qt5/qtbase.inc b/meta-qt5/recipes-qt/qt5/qtbase.inc index 0a8b739..531c88f 100644 --- a/meta-qt5/recipes-qt/qt5/qtbase.inc +++ b/meta-qt5/recipes-qt/qt5/qtbase.inc @@ -49,12 +49,28 @@ EXTRA_ENV = 'QMAKE="bin/qmake ${OE_QMAKE_DEBUG_OUTPUT} -after \ # qtbase is exception, we need to use mkspecs from ${S} QMAKE_MKSPEC_PATH = "${B}" -do_configure_append() { +# another exception is that we need to run bin/qmake, because EffectivePaths are relative to qmake location +OE_QMAKE_QMAKE_ORIG := "${OE_QMAKE_QMAKE}" +OE_QMAKE_QMAKE = "bin/qmake" + +do_configure() { + set_arch + set_endian + + # Avoid problems with the linkers, since we want the linker to be g++ + unset LD + + # Similar logic is in autotools.bbclass + if [ -d ${B} -a "${S}" != "${B}" ] ; then + # Existing separate build directory, exists, remove + rm -rf "${B}/*" + fi + # we need symlink in path relative to source, because # EffectivePaths:Prefix is relative to qmake location if [ ! -e ${B}/bin/qmake ]; then mkdir ${B}/bin - ln -sf ${OE_QMAKE_QMAKE} ${B}/bin/qmake + ln -sf ${OE_QMAKE_QMAKE_ORIG} ${B}/bin/qmake fi ${S}/configure -v \ @@ -83,8 +99,8 @@ do_configure_append() { -platform ${OE_QMAKESPEC} \ -xplatform linux-oe-g++ \ ${QT_CONFIG_FLAGS} - - bin/qmake -r ${OE_QMAKE_DEBUG_OUTPUT} ${S} + + qmake5_base_do_configure } do_compile_append() {