]> code.ossystems Code Review - openembedded-core.git/commitdiff
autotools: Remove .la files if rebuilding non out of tree software
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 Sep 2013 11:33:49 +0000 (11:33 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 17 Sep 2013 13:11:43 +0000 (14:11 +0100)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/autotools.bbclass

index 4e4ef986bf70568da0c6488c424430bb5e0a2acb..883eb06e263dceb9eb6b031eed54ca06789eab3d 100644 (file)
@@ -108,10 +108,16 @@ CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
 
 autotools_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}
+               if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
+                       if [ "${S}" != "${B}" ]; then
+                               echo "Previously configured separate build directory detected, cleaning ${B}"
+                               rm -rf ${B}
+                               mkdir ${B}
+                       else
+                               # At least remove the .la files since automake won't automatically
+                               # regenerate them even if CFLAGS/LDFLAGS are different
+                               cd ${S}; find ${S} -name \*.la -delete
+                       fi
                fi
        fi
 }