Skip to contentSkip to conversation

cmake: don't inherit autotools

PATCH New Ross Burton 1 participant 2 messages Feb 16, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 cmake: don't inherit autotools

autotools was inherited for some functions some time ago, but now all it's using it for explicitly is autotools_do_install(), which is basically just "make install". Invoke that directly and we can remove the inherit autotools.

---
 meta/classes/cmake.bbclass | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
meta/classes/cmake.bbclass +1 -4
index 70e8677..22cd61e 100644
@@ -7,9 +7,6 @@ B = "${WORKDIR}/build"
 # We need to unset CCACHE otherwise cmake gets too confused
 CCACHE = ""
 
-# We want the staging and installing functions from autotools
-inherit autotools
-
 # C/C++ Compiler (without cpu arch/tune arguments)
 OECMAKE_C_COMPILER ?= "`echo ${CC} | sed 's/^\([^ ]*\).*/\1/'`"
 OECMAKE_CXX_COMPILER ?= "`echo ${CXX} | sed 's/^\([^ ]*\).*/\1/'`"
@@ -132,7 +129,7 @@ cmake_do_compile()  {
 
 cmake_do_install() {
 	cd ${B}
-	autotools_do_install
+	oe_runmake 'DESTDIR=${D}' install
 }
 
 EXPORT_FUNCTIONS do_configure do_compile do_install do_generate_toolchain_file
Signature · 1 line
2.7.0
#1 lore raw

PATCH 2/2 insane: wrap autotools checks in inherits_class(autotools) checks

There's no point doing the autotools sanity checks if a recipe didn't inherit autotools, so check the inherits before doing the checks.

Also pass -F (fixed strings) and -q (quiet) to grep.

---
 meta/classes/insane.bbclass | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
meta/classes/insane.bbclass +13 -11
index aef08fe..241ad08 100644
@@ -1148,19 +1148,21 @@ python do_qa_configure() {
 
     configs = []
     workdir = d.getVar('WORKDIR', True)
-    bb.note("Checking autotools environment for common misconfiguration")
-    for root, dirs, files in os.walk(workdir):
-        statement = "grep -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s > /dev/null" % \
-                    os.path.join(root,"config.log")
-        if "config.log" in files:
-            if subprocess.call(statement, shell=True) == 0:
-                bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
+
+    if bb.data.inherits_class('autotools', d):
+        bb.note("Checking autotools environment for common misconfiguration")
+        for root, dirs, files in os.walk(workdir):
+            statement = "grep -q -F -e 'CROSS COMPILE Badness:' -e 'is unsafe for cross-compilation' %s" % \
+                        os.path.join(root,"config.log")
+            if "config.log" in files:
+                if subprocess.call(statement, shell=True) == 0:
+                    bb.fatal("""This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
 Rerun configure task after fixing this.""")
 
-        if "configure.ac" in files:
-            configs.append(os.path.join(root,"configure.ac"))
-        if "configure.in" in files:
-            configs.append(os.path.join(root, "configure.in"))
+            if "configure.ac" in files:
+                configs.append(os.path.join(root,"configure.ac"))
+            if "configure.in" in files:
+                configs.append(os.path.join(root, "configure.in"))
 
     ###########################################################################
     # Check gettext configuration and dependencies are correct
Signature · 1 line
2.7.0