diff options
author | Dave Cobbley <david.j.cobbley@linux.intel.com> | 2018-08-14 20:05:37 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-08-23 04:26:31 +0300 |
commit | eb8dc40360f0cfef56fb6947cc817a547d6d9bc6 (patch) | |
tree | de291a73dc37168da6370e2cf16c347d1eba9df8 /poky/meta/classes/gtk-doc.bbclass | |
parent | 9c3cf826d853102535ead04cebc2d6023eff3032 (diff) | |
download | openbmc-eb8dc40360f0cfef56fb6947cc817a547d6d9bc6.tar.xz |
[Subtree] Removing import-layers directory
As part of the move to subtrees, need to bring all the import layers
content to the top level.
Change-Id: I4a163d10898cbc6e11c27f776f60e1a470049d8f
Signed-off-by: Dave Cobbley <david.j.cobbley@linux.intel.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/classes/gtk-doc.bbclass')
-rw-r--r-- | poky/meta/classes/gtk-doc.bbclass | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/poky/meta/classes/gtk-doc.bbclass b/poky/meta/classes/gtk-doc.bbclass new file mode 100644 index 000000000..b4f675490 --- /dev/null +++ b/poky/meta/classes/gtk-doc.bbclass @@ -0,0 +1,68 @@ +# Helper class to pull in the right gtk-doc dependencies and configure +# gtk-doc to enable or disable documentation building (which requries the +# use of usermode qemu). + +# This variable is set to True if api-documentation is in +# DISTRO_FEATURES and qemu-usermode is in MACHINE_FEATURES, and False otherwise. +# +# It should be used in recipes to determine whether gtk-doc based documentation should be built, +# so that qemu use can be avoided when necessary. +GTKDOC_ENABLED ?= "${@bb.utils.contains('DISTRO_FEATURES', 'api-documentation', \ + bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d), 'False', d)}" + +EXTRA_OECONF_prepend_class-target = "${@bb.utils.contains('GTKDOC_ENABLED', 'True', '--enable-gtk-doc --enable-gtk-doc-html --disable-gtk-doc-pdf', \ + '--disable-gtk-doc', d)} " + +# When building native recipes, disable gtkdoc, as it is not necessary, +# pulls in additional dependencies, and makes build times longer +EXTRA_OECONF_prepend_class-native = "--disable-gtk-doc " +EXTRA_OECONF_prepend_class-nativesdk = "--disable-gtk-doc " + +# Even though gtkdoc is disabled on -native, gtk-doc package is still +# needed for m4 macros. +DEPENDS_append = " gtk-doc-native" + +# The documentation directory, where the infrastructure will be copied. +# gtkdocize has a default of "." so to handle out-of-tree builds set this to $S. +GTKDOC_DOCDIR ?= "${S}" + +export STAGING_DIR_HOST + +inherit python3native pkgconfig qemu +DEPENDS_append = "${@' qemu-native' if d.getVar('GTKDOC_ENABLED') == 'True' else ''}" + +do_configure_prepend () { + # Need to use ||true as this is only needed if configure.ac both exists + # and uses GTK_DOC_CHECK. + gtkdocize --srcdir ${S} --docdir ${GTKDOC_DOCDIR} || true +} + +do_compile_prepend_class-target () { + if [ ${GTKDOC_ENABLED} = True ]; then + # Write out a qemu wrapper that will be given to gtkdoc-scangobj so that it + # can run target helper binaries through that. + qemu_binary="${@qemu_wrapper_cmdline(d, '$STAGING_DIR_HOST', ['\$GIR_EXTRA_LIBS_PATH','$STAGING_DIR_HOST/${libdir}','$STAGING_DIR_HOST/${base_libdir}'])}" + cat > ${B}/gtkdoc-qemuwrapper << EOF +#!/bin/sh +# Use a modules directory which doesn't exist so we don't load random things +# which may then get deleted (or their dependencies) and potentially segfault +export GIO_MODULE_DIR=${STAGING_LIBDIR}/gio/modules-dummy + +GIR_EXTRA_LIBS_PATH=\`find ${B} -name *.so -printf "%h\n"|sort|uniq| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH +GIR_EXTRA_LIBS_PATH=\`find ${B} -name .libs| tr '\n' ':'\`\$GIR_EXTRA_LIBS_PATH + +if [ -d ".libs" ]; then + $qemu_binary ".libs/\$@" +else + $qemu_binary "\$@" +fi + +if [ \$? -ne 0 ]; then + echo "If the above error message is about missing .so libraries, then setting up GIR_EXTRA_LIBS_PATH in the recipe should help." + echo "(typically like this: GIR_EXTRA_LIBS_PATH=\"$""{B}/something/.libs\" )" + exit 1 +fi +EOF + chmod +x ${B}/gtkdoc-qemuwrapper + fi +} |