* [PATCH 0/1] Fix for re-running do_configure with externalsrc
@ 2016-10-11 21:33 Paul Eggleton
2016-10-11 21:33 ` [PATCH 1/1] classes/externalsrc: re-run do_configure when configure files change Paul Eggleton
0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2016-10-11 21:33 UTC (permalink / raw)
To: openembedded-core
The following changes since commit 806a910927f479207d47b06c20a0497e91203266:
sysklogd and busybox: ignore return code from init script stop (2016-10-11 22:18:36 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib paule/externalsrc-configure
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/externalsrc-configure
Paul Eggleton (1):
classes/externalsrc: re-run do_configure when configure files change
meta/classes/autotools.bbclass | 2 ++
meta/classes/cmake.bbclass | 2 ++
meta/classes/externalsrc.bbclass | 22 ++++++++++++++++++++++
3 files changed, 26 insertions(+)
--
2.5.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] classes/externalsrc: re-run do_configure when configure files change
2016-10-11 21:33 [PATCH 0/1] Fix for re-running do_configure with externalsrc Paul Eggleton
@ 2016-10-11 21:33 ` Paul Eggleton
0 siblings, 0 replies; 2+ messages in thread
From: Paul Eggleton @ 2016-10-11 21:33 UTC (permalink / raw)
To: openembedded-core
If the user modifies files such as CMakeLists.txt in the case of cmake,
we want do_configure to re-run so that those changes can take effect. In
order to accomplish that, have a variable CONFIGURE_FILES which
specifies a list of files that will be put into do_configure's checksum
(either full paths, or just filenames which will be searched for in the
entire source tree). CONFIGURE_FILES then just needs to be set
appropriately depending on what do_configure is doing; for now I've set
this for autotools and cmake which are the most common cases.
Fixes [YOCTO #7617].
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
meta/classes/autotools.bbclass | 2 ++
meta/classes/cmake.bbclass | 2 ++
meta/classes/externalsrc.bbclass | 22 ++++++++++++++++++++++
3 files changed, 26 insertions(+)
diff --git a/meta/classes/autotools.bbclass b/meta/classes/autotools.bbclass
index ecbba9f..c43ea9a 100644
--- a/meta/classes/autotools.bbclass
+++ b/meta/classes/autotools.bbclass
@@ -259,6 +259,8 @@ python autotools_copy_aclocals () {
}
autotools_copy_aclocals[vardepsexclude] += "MACHINE SDK_ARCH BUILD_ARCH SDK_OS BB_TASKDEPDATA"
+CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in ${S}/acinclude.m4 Makefile.am"
+
autotools_do_configure() {
# WARNING: gross hack follows:
# An autotools built package generally needs these scripts, however only
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 7091f8b..3e762de 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -84,6 +84,8 @@ EOF
addtask generate_toolchain_file after do_patch before do_configure
+CONFIGURE_FILES = "CMakeLists.txt"
+
cmake_do_configure() {
if [ "${OECMAKE_BUILDPATH}" ]; then
bbnote "cmake.bbclass no longer uses OECMAKE_BUILDPATH. The default behaviour is now out-of-tree builds with B=WORKDIR/build."
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass
index 5c65d2b..31908c3 100644
--- a/meta/classes/externalsrc.bbclass
+++ b/meta/classes/externalsrc.bbclass
@@ -103,6 +103,7 @@ python () {
d.prependVarFlag('do_configure', 'prefuncs', "externalsrc_configure_prefunc ")
d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}')
+ d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}')
# We don't want the workdir to go away
d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True))
@@ -166,3 +167,24 @@ def srctree_hash_files(d):
else:
ret = d.getVar('EXTERNALSRC', True) + '/*:True'
return ret
+
+def srctree_configure_hash_files(d):
+ """
+ Get the list of files that should trigger do_configure to re-execute,
+ based on the value of CONFIGURE_FILES
+ """
+ in_files = (d.getVar('CONFIGURE_FILES', True) or '').split()
+ out_items = []
+ search_files = []
+ for entry in in_files:
+ if entry.startswith('/'):
+ out_items.append('%s:%s' % (entry, os.path.exists(entry)))
+ else:
+ search_files.append(entry)
+ if search_files:
+ s_dir = d.getVar('EXTERNALSRC', True)
+ for root, _, files in os.walk(s_dir):
+ for f in files:
+ if f in search_files:
+ out_items.append('%s:True' % os.path.join(root, f))
+ return ' '.join(out_items)
--
2.5.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-11 21:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-11 21:33 [PATCH 0/1] Fix for re-running do_configure with externalsrc Paul Eggleton
2016-10-11 21:33 ` [PATCH 1/1] classes/externalsrc: re-run do_configure when configure files change Paul Eggleton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.