[OE-core] [PATCH 2/2] gtk-doc: improve calling of gtkdocize

Ross Burton ross.burton at intel.com
Wed Mar 14 11:22:25 UTC 2018


gtkdocize is only needed if the recipe is using autotools, so instead of hiding
all errors from it, only run it if we're also inheriting autotools.

Also instead of cd'ing into ${S}, pass --srcdir.

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/gtk-doc.bbclass | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/meta/classes/gtk-doc.bbclass b/meta/classes/gtk-doc.bbclass
index 3f731cb93bf..cfeb49a1d00 100644
--- a/meta/classes/gtk-doc.bbclass
+++ b/meta/classes/gtk-doc.bbclass
@@ -31,8 +31,15 @@ export STAGING_DIR_HOST
 inherit python3native pkgconfig qemu
 DEPENDS_append = "${@' qemu-native' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}"
 
-do_configure_prepend () {
-	( cd ${S}; gtkdocize --docdir ${GTKDOC_DOCDIR} || true )
+# Run gtkdocize if the recipe is using autotools
+run_gtkdocize () {
+	bbnote Running gtkdocize...
+	gtkdocize --srcdir ${S} --docdir ${GTKDOC_DOCDIR}
+}
+
+python () {
+    if bb.data.inherits_class("autotools", d):
+        d.appendVarFlag('do_configure', 'prefuncs', ' run_gtkdocize')
 }
 
 do_compile_prepend_class-target () {
-- 
2.11.0




More information about the Openembedded-core mailing list