Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] autotools.bbclass: Add functionality to force a clean of ${B} when reconfiguring (and ${S} != ${B})
@ 2012-09-11 14:22 Richard Purdie
  2012-09-11 19:01 ` McClintock Matthew-B29882
  2012-09-26 17:07 ` Phil Blundell
  0 siblings, 2 replies; 13+ messages in thread
From: Richard Purdie @ 2012-09-11 14:22 UTC (permalink / raw)
  To: openembedded-core

Unfortunately whilst rerunning 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 removal of the build directory (${B}) when configure is
rerunning, the sstate checksum for do_configure has changed and ${S} != ${B}.
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 where we want to disable this behaviour with
CONFIGURESTAMPFILE = "" in the recipe, or users could disable it globally.

[YOCTO #2774]
[YOCTO #2848]

This is particularly helpful for eglibc and gcc which use split builds by default and
are a particular source of reconfigure type problems.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index 4c4bf87..a5997c5 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -89,6 +89,27 @@ oe_runconf () {
 
 AUTOTOOLS_AUXDIR ?= "${S}"
 
+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}
+		fi
+	fi
+}
+
+autotools_postconfigure(){
+	if [ -n "${CONFIGURESTAMPFILE}" ]; then
+		echo ${BB_TASKHASH} > ${CONFIGURESTAMPFILE}
+	fi
+}
+
+do_configure[prefuncs] += "autotools_preconfigure"
+do_configure[postfuncs] += "autotools_postconfigure"
+
 autotools_do_configure() {
 	case ${PN} in
 	autoconf*)





^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2012-09-29 10:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-11 14:22 [PATCH] autotools.bbclass: Add functionality to force a clean of ${B} when reconfiguring (and ${S} != ${B}) Richard Purdie
2012-09-11 19:01 ` McClintock Matthew-B29882
2012-09-12 14:16   ` Richard Purdie
2012-09-12 17:47     ` McClintock Matthew-B29882
2012-09-14  0:26       ` Scott Garman
2012-09-26 17:07 ` Phil Blundell
2012-09-26 23:45   ` McClintock Matthew-B29882
2012-09-28 13:23   ` Richard Purdie
2012-09-28 20:21     ` McClintock Matthew-B29882
2012-09-28 21:20       ` Richard Purdie
2012-09-29  6:42         ` Ross Burton
2012-09-29  7:24           ` Martin Jansa
2012-09-29 10:30             ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox