]> code.ossystems Code Review - openembedded-core.git/commitdiff
distutils: clean the build tree in do_configure
authorRoss Burton <ross.burton@intel.com>
Thu, 5 Jul 2018 12:29:29 +0000 (13:29 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Jul 2018 21:54:56 +0000 (22:54 +0100)
base_do_configure() tries to do "make clean" if there is a Makefile present.
For most recipes using distutils there is not a Makefile, but we do know that
"setup.py clean" will work so call that instead.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/distutils3.bbclass

index 6c303068820f2a9f5d4e874c489fb14ee54fed3b..99ad64d287d8e132bad982f6dc5f9b737cc2b162 100644 (file)
@@ -8,6 +8,12 @@ DISTUTILS_STAGE_ALL_ARGS ?= "--prefix=${STAGING_DIR_HOST}${prefix} \
 DISTUTILS_INSTALL_ARGS ?= "--prefix=${D}/${prefix} \
     --install-data=${D}/${datadir}"
 
+distutils3_do_configure() {
+       if [ "${CLEANBROKEN}" != "1" ] ; then
+               ${STAGING_BINDIR_NATIVE}/${PYTHON_PN}-native/${PYTHON_PN} setup.py clean
+       fi
+}
+
 distutils3_do_compile() {
         STAGING_INCDIR=${STAGING_INCDIR} \
         STAGING_LIBDIR=${STAGING_LIBDIR} \
@@ -71,6 +77,6 @@ distutils3_do_install() {
 }
 distutils3_do_install[vardepsexclude] = "MACHINE"
 
-EXPORT_FUNCTIONS do_compile do_install
+EXPORT_FUNCTIONS do_configure do_compile do_install
 
 export LDSHARED="${CCLD} -shared"