Skip to contentSkip to conversation

externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES

PATCH In review Peter Kjellerstedt 2 participants 4 messages Oct 3, 2023 – Oct 6, 2023 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 externalsrc.bbclass: Support specifying patterns in CONFIGURE_FILES

This allows, e.g., *.cmake to be added to CONFIGURE_FILES to make the do_configure task depend on changes to any cmake file.

---
 meta/classes/externalsrc.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
meta/classes/externalsrc.bbclass +4 -2
index cba80bb1d4..a54f316aa0 100644
@@ -252,6 +252,8 @@ 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
     """
+    import fnmatch
+
     in_files = (d.getVar('CONFIGURE_FILES') or '').split()
     out_items = []
     search_files = []
@@ -263,8 +265,8 @@ def srctree_configure_hash_files(d):
     if search_files:
         s_dir = d.getVar('EXTERNALSRC')
         for root, _, files in os.walk(s_dir):
-            for f in files:
-                if f in search_files:
+            for p in search_files:
+                for f in fnmatch.filter(files, p):
                     out_items.append('%s:True' % os.path.join(root, f))
     return ' '.join(out_items)
 
#1 lore raw

PATCH 2/3 cmake.bbclass: Add *.cmake to CONFIGURE_FILES

This makes do_configure depend on changes to any cmake file when externalsrc is active.

---
 meta/classes-recipe/cmake.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/cmake.bbclass +1 -1
index 41748b0820..d978b88944 100644
@@ -156,7 +156,7 @@ EOF
 
 addtask generate_toolchain_file after do_patch before do_configure
 
-CONFIGURE_FILES = "CMakeLists.txt"
+CONFIGURE_FILES = "CMakeLists.txt *.cmake"
 
 do_configure[cleandirs] = "${@d.getVar('B') if d.getVar('S') != d.getVar('B') else ''}"
 
#2 lore raw

PATCH 3/3 autotools.bbclass: Add *.m4 to CONFIGURE_FILES

In reply to Peter Kjellerstedt

This makes do_configure depend on changes to any m4 file when externalsrc is active.

---
 meta/classes-recipe/autotools.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/autotools.bbclass +1 -1
index a4c1c4be41..5ed21a3d68 100644
@@ -157,7 +157,7 @@ python autotools_aclocals () {
 
 do_configure[file-checksums] += "${@' '.join(siteinfo_get_files(d, sysrootcache=False)[1])}"
 
-CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in ${S}/acinclude.m4 Makefile.am"
+CONFIGURE_FILES = "${S}/configure.in ${S}/configure.ac ${S}/config.h.in *.m4 Makefile.am"
 
 autotools_do_configure() {
 	# WARNING: gross hack follows:

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

RE: [OE-core] [PATCH 2/3] cmake.bbclass: Add *.cmake to CONFIGURE_FILES

Quoted 19 lines

-----Original Message-----
From: [email protected] <[email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 3 oktober 2023 03:05
To: [email protected]
Subject: [OE-core] [PATCH 2/3] cmake.bbclass: Add *.cmake to CONFIGURE_FILES

This makes do_configure depend on changes to any cmake file when externalsrc is active.

---
 meta/classes-recipe/cmake.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes-recipe/cmake.bbclass +0 -0
index 41748b0820..d978b88944 100644

meta/classes-recipe/cmake.bbclass EOF · line 162

Quoted 8 lines
meta/classes-recipe/cmake.bbclass +1 -1
@@ -156,7 +156,7 @@ EOF
 
 addtask generate_toolchain_file after do_patch before do_configure
 
-CONFIGURE_FILES = "CMakeLists.txt"
+CONFIGURE_FILES = "CMakeLists.txt *.cmake"
 
 do_configure[cleandirs] = "${@d.getVar('B') if d.getVar('S') != d.getVar('B') else ''}"
 

Any reason this was not integrated today together with the other two patches in this series?

//Peter