[OE-core] [PATCH] autotools.bbclass: Add functionality to force a distclean when reconfiguring

Mark Hatle mark.hatle at windriver.com
Fri Sep 7 16:32:37 UTC 2012


I'm curious, is there any [easy] way we can force a rerun of configure as a test 
pass over the system?

I'd like a way to verify that both this patch works as expected, and future 
recipes work as expected.  (It would also be nice to test the things that don't 
use the autotools.bbclass..)

--Mark

On 9/7/12 11:05 AM, Richard Purdie wrote:
> Unfortunately whilst reruning configure and make against a project will mostly
> work there are situations where it does not correctly do the right thing.
>
> In particular, eglibc and gcc will fail out with errors where settings
> do not match a previously built configuration. It could be argued they are
> broken but the situation is what it is. There is the possibility of more subtle
> errors too.
>
> This patch adds a "make distclean" call to recipes where configure is
> rerunning and the sstate checksum for do_configure has changed. We could
> simply use a stamp but saving out the previous configuration checksum
> adds some data at no real overhead.
>
> If we find there are things out there which don't have a "distclean" target,
> we can disable this behaviour with CONFIGURESTAMPFILE = "" in the recipe,
> or users could disable it globally.
>
> [YOCTO #2774]
> [YOCTO #2848]
>
> Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
> ---
> diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
> index 4c4bf87..1ab2e0c 100644
> --- a/meta/classes/autotools.bbclass
> +++ b/meta/classes/autotools.bbclass
> @@ -89,7 +89,16 @@ oe_runconf () {
>
>   AUTOTOOLS_AUXDIR ?= "${S}"
>
> +CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate"
> +
>   autotools_do_configure() {
> +	if [ -n "${CONFIGURESTAMPFILE}" -a -e "${CONFIGURESTAMPFILE}" ]; then
> +		if [ "`cat ${CONFIGURESTAMPFILE}`" != "${BB_TASKHASH}" ]; then
> +			echo "Previously configured build detected, running make distclean"
> +			oe_runmake distclean
> +		fi
> +	fi
> +
>   	case ${PN} in
>   	autoconf*)
>   	;;
> @@ -180,6 +189,9 @@ autotools_do_configure() {
>   	else
>   		bbnote "nothing to configure"
>   	fi
> +	if [ -n "${CONFIGURESTAMPFILE}" ]; then
> +		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
> +	fi
>   }
>
>   autotools_do_install() {
>
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
>





More information about the Openembedded-core mailing list