From patchwork Wed Oct 17 13:42:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC] autotools: Don't install .la files if the distro doesn't want them Date: Wed, 17 Oct 2012 13:42:03 -0000 From: Phil Blundell X-Patchwork-Id: 38213 Message-Id: <1350481324.3259.185.camel@phil-desktop> To: openembedded-core@lists.openembedded.org It's not obvious that libtool's .la files serve any very useful purpose on a modern system and they can be positively vexatious under some circumstances. Make installation of this stuff conditional on the new "libtool-garbage" flag in DISTRO_FEATURES and backfill it for existing distros. Also, perform at least a perfunctory cleaning of unified build directories when reconfiguring since many packages don't have the right dependency rules to cause a recompile when this happens. Making distclean is not practical since many packages either don't support it at all, or remove too much (e.g. polkit blows away its documentation which causes the subsequent license check to fail). Signed-off-by: Phil Blundell --- meta/classes/autotools.bbclass | 16 ++++++++++++---- meta/conf/bitbake.conf | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass index e4e034b..adb2bbf 100644 --- a/meta/classes/autotools.bbclass +++ b/meta/classes/autotools.bbclass @@ -93,10 +93,15 @@ 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 + echo "Previously configured source directory detected, cleaning ${S} (slightly)" + oe_runmake clean + fi fi fi } @@ -201,6 +206,9 @@ autotools_do_install() { if [ -e "${D}${infodir}/dir" ]; then rm -f ${D}${infodir}/dir fi + if ${@base_contains('DISTRO_FEATURES', 'libtool-garbage', 'false', 'true', d)}; then + find ${D} -name "*.la" -exec rm \{} \; + fi } inherit siteconfig diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index 1ad6ee6..4ad3722 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -728,7 +728,7 @@ MACHINE_ESSENTIAL_EXTRA_RDEPENDS ?= "" MACHINE_ESSENTIAL_EXTRA_RRECOMMENDS ?= "" IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}" -DISTRO_FEATURES_BACKFILL = "pulseaudio update-modules" +DISTRO_FEATURES_BACKFILL = "pulseaudio update-modules libtool-garbage" DISTRO_FEATURES_append = "${@oe.utils.features_backfill("DISTRO_FEATURES",d)}" MACHINE_FEATURES_BACKFILL = "rtc"