From 7caede7850d7b33011a5a0e3124180db2f7a0d6c Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Wed, 8 May 2013 22:40:30 +0200 Subject: qmake5: Fix cleaning separate build directory and use it by default * "${B}/*" in quotes doesn't match anything, better to remove whole directory (incluing .files) and recreate it * not sure why I've added quotes after testing first version, we don't expect B with spaces.. but I'm a bit scared with rm -rf ${SOME_VAR} after one glibc upgrade cleaned my whole disk and attached NFS array when OLD_LOCALE_PATH wasn't detected correctly... * qmake works well with separate B, use it by default Signed-off-by: Martin Jansa --- classes/qmake5_base.bbclass | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'classes') diff --git a/classes/qmake5_base.bbclass b/classes/qmake5_base.bbclass index 9aeafd70..0bfacec3 100644 --- a/classes/qmake5_base.bbclass +++ b/classes/qmake5_base.bbclass @@ -124,6 +124,33 @@ EOF # TargetSpec The location where to install target mkspec # HostSpec The location where to install host mkspec +# qmake works fine with separate B, use it by default +SEPB = "${WORKDIR}/build" +B = "${SEPB}" + +CONFIGURESTAMPFILE = "${WORKDIR}/qmake5_base_configure.sstate" + +qmake5_base_preconfigure() { + if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then + if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" -a "${S}" != "${B}" ]; then + echo "Previously configured separate build directory detected, cleaning ${B}" + rm -rf ${B} + mkdir ${B} + fi + fi +} + +qmake5_base_postconfigure(){ + if [ -n "${CONFIGURESTAMPFILE}" ]; then + echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE} + fi +} + +EXTRAQCONFFUNCS ??= "" + +do_configure[prefuncs] += "qmake5_base_preconfigure ${EXTRAQCONFFUNCS}" +do_configure[postfuncs] += "qmake5_base_postconfigure" + addtask generate_qt_config_file after do_patch before do_configure qmake5_base_do_configure () { -- cgit v1.2.3