diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-10-12 10:33:47 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-11-08 23:47:13 +0000 |
commit | b169435134fd1a2894ac179f386697874b109a0f (patch) | |
tree | 36d6904e1d072ea897c6d7fa1d310d0990dd4200 /meta/classes/externalsrc.bbclass | |
parent | 95e3d7108062fa5aa6db3670d22940a4b9513f6b (diff) | |
download | poky-b169435134fd1a2894ac179f386697874b109a0f.tar.gz |
classes/externalsrc: re-run do_configure when configure files change
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].
(From OE-Core rev: 923fc20c2862a6d75f949082c9f6532ab7e2d2cd)
(From OE-Core rev: 4019bb8454c36c4baf1d4f23e2d4fafb6c47fbc0)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/externalsrc.bbclass')
-rw-r--r-- | meta/classes/externalsrc.bbclass | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/meta/classes/externalsrc.bbclass b/meta/classes/externalsrc.bbclass index da7eb4781c..f173496ae8 100644 --- a/meta/classes/externalsrc.bbclass +++ b/meta/classes/externalsrc.bbclass | |||
@@ -89,6 +89,7 @@ python () { | |||
89 | # function is run every time | 89 | # function is run every time |
90 | d.setVar('BB_DONT_CACHE', '1') | 90 | d.setVar('BB_DONT_CACHE', '1') |
91 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') | 91 | d.setVarFlag('do_compile', 'file-checksums', '${@srctree_hash_files(d)}') |
92 | d.setVarFlag('do_configure', 'file-checksums', '${@srctree_configure_hash_files(d)}') | ||
92 | 93 | ||
93 | # We don't want the workdir to go away | 94 | # We don't want the workdir to go away |
94 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True)) | 95 | d.appendVar('RM_WORK_EXCLUDE', ' ' + d.getVar('PN', True)) |
@@ -152,3 +153,24 @@ def srctree_hash_files(d): | |||
152 | else: | 153 | else: |
153 | ret = d.getVar('EXTERNALSRC', True) + '/*:True' | 154 | ret = d.getVar('EXTERNALSRC', True) + '/*:True' |
154 | return ret | 155 | return ret |
156 | |||
157 | def srctree_configure_hash_files(d): | ||
158 | """ | ||
159 | Get the list of files that should trigger do_configure to re-execute, | ||
160 | based on the value of CONFIGURE_FILES | ||
161 | """ | ||
162 | in_files = (d.getVar('CONFIGURE_FILES', True) or '').split() | ||
163 | out_items = [] | ||
164 | search_files = [] | ||
165 | for entry in in_files: | ||
166 | if entry.startswith('/'): | ||
167 | out_items.append('%s:%s' % (entry, os.path.exists(entry))) | ||
168 | else: | ||
169 | search_files.append(entry) | ||
170 | if search_files: | ||
171 | s_dir = d.getVar('EXTERNALSRC', True) | ||
172 | for root, _, files in os.walk(s_dir): | ||
173 | for f in files: | ||
174 | if f in search_files: | ||
175 | out_items.append('%s:True' % os.path.join(root, f)) | ||
176 | return ' '.join(out_items) | ||