From 17763ce6ca2972f234bbc65a14943ec36cd040f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=BCller?= Date: Sun, 6 Sep 2015 00:13:59 +0200 Subject: [PATCH] cmake-extra-sanity.bbclass: rework MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit triggered by default misconfiguration of kdenlive the detection of links on build host sysroot was reworked. Signed-off-by: Andreas Müller --- classes/cmake-extra-sanity.bbclass | 41 +++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 6 deletions(-) diff --git a/classes/cmake-extra-sanity.bbclass b/classes/cmake-extra-sanity.bbclass index 527b2e23..8aaf0911 100644 --- a/classes/cmake-extra-sanity.bbclass +++ b/classes/cmake-extra-sanity.bbclass @@ -1,14 +1,43 @@ +# do_install_append_class-cross does not work so hack +do_install_prepend_class-native() { + no_staging_check=true +} + +do_install_prepend_class-nativesdk() { + no_staging_check=true +} + do_install_append() { # avoid strange prefixing seen often old_dir=`pwd` cd ${D} if grep -qr 'usr\/\/usr' ; then - bbfatal 'usr//usr found in ${PN} - check sources for PREFIX or better CMAKE_INSTALL_PREFIX!' - fi - - # check for staging links - if grep -qr '${STAGING_DIR}' ; then - bbwarn '${STAGING_DIR} in ${PN}' + bbfatal 'usr//usr found - check sources for PREFIX or better CMAKE_INSTALL_PREFIX!' fi cd $old_dir + + # check for staging links in non native recipes + # TBD: -> oe-core (1st part - genarated sources - should work with autotools too) + if [ x = x$no_staging_check ] ; then + error= + # check for genarated sources + for f in `find ${B} -name '*.h' -o -name '*.cpp'` ; do + if grep -q '${STAGING_DIR}' $f ; then + bbwarn "$f contains links to build host sysroot!" + error=true + fi + done + + # check installed cmake files + for f in `find ${D} -name '*.cmake'` ; do + if grep -q '${STAGING_DIR}' "$f" ; then + bbwarn "$f contains links to build host sysroot!" + error=true + fi + done + + if [ x != x$error ] ; then + bbfatal "One or more files contain links to build host sysroot ${STAGING_DIR}" + fi + fi }