The new value is more general and better reflects what having the feature really means.
Introspection data, then, is built only if 'gobject-introspection-data' is in
DISTRO_FEATURES and 'qemu-usermode' is in MACHINE_FEATURES.
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
--- /dev/null
+# This variable is set to True if gobject-introspection-data is in
+# DISTRO_FEATURES and qemu-usermode is in MACHINE_FEATURES, and False otherwise.
+#
+# It should be used in recipes to determine whether introspection data should be built,
+# so that qemu use can be avoided when necessary.
+GI_DATA_ENABLED = "${@bb.utils.contains('DISTRO_FEATURES', 'gobject-introspection-data', \
+ bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', 'True', 'False', d), 'False', d)}"
+
+
# Inherit this class in recipes to enable building their introspection files
-# This allows disabling introspection support (and therefore avoiding the use
-# of qemu) in recipes if gobject-introspection-data is omitted from
-# DISTRO_FEATURES or MACHINE_FEATURES.
-EXTRA_OECONF_prepend = "${@bb.utils.contains('COMBINED_FEATURES', 'gobject-introspection-data', '--enable-introspection', '--disable-introspection', d)} "
+# This sets up autoconf-based recipes to build introspection data (or not),
+# depending on distro and machine features (see gobject-introspection-data class).
+inherit gobject-introspection-data
+EXTRA_OECONF_prepend = "${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection', '--disable-introspection', d)} "
UNKNOWN_CONFIGURE_WHITELIST_append = " --enable-introspection --disable-introspection"
IMAGE_FEATURES += "${EXTRA_IMAGE_FEATURES}"
DISTRO_FEATURES_BACKFILL = "pulseaudio sysvinit bluez5 gobject-introspection-data"
-MACHINE_FEATURES_BACKFILL = "rtc gobject-introspection-data"
+MACHINE_FEATURES_BACKFILL = "rtc qemu-usermode"
COMBINED_FEATURES = "${@oe.utils.set_intersect('DISTRO_FEATURES', 'MACHINE_FEATURES', d)}"
COMBINED_FEATURES[vardeps] += "DISTRO_FEATURES MACHINE_FEATURES"
TUNE_LDARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-m elf32_x86_64', '', d)}"
TUNE_ASARGS += "${@bb.utils.contains('TUNE_FEATURES', 'mx32', '-x32', '', d)}"
# user mode qemu doesn't support x32
-MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'gobject-introspection-data', '', d)}"
+MACHINE_FEATURES_BACKFILL_CONSIDERED_append = " ${@bb.utils.contains('TUNE_FEATURES', 'mx32', 'qemu-usermode', '', d)}"
# ELF64 ABI
TUNEVALID[m64] = "IA32e (x86_64) ELF64 standard ABI"
SRC_URI[md5sum] = "adb40a31c7c80b65b0f4c8fd71b493dc"
SRC_URI[sha256sum] = "6658bd3c2b8813eb3e2511ee153238d09ace9d309e4574af27443d87423e4233"
-inherit autotools pkgconfig gtk-doc pythonnative qemu
+inherit autotools pkgconfig gtk-doc pythonnative qemu gobject-introspection-data
BBCLASSEXTEND = "native"
# necessary to let the call for python-config from configure.ac succeed
EXTRA_OECONF_class-target += "--enable-host-gi \
--enable-gi-cross-wrapper=${B}/g-ir-scanner-qemuwrapper \
--enable-gi-ldd-wrapper=${B}/g-ir-scanner-lddwrapper \
- ${@bb.utils.contains('COMBINED_FEATURES', 'gobject-introspection-data', '--enable-introspection-data', '--disable-introspection-data', d)} \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '--enable-introspection-data', '--disable-introspection-data', d)} \
"
EXTRA_OECMAKE = " \
-DPORT=GTK \
-DCMAKE_BUILD_TYPE=Release \
- ${@bb.utils.contains('COMBINED_FEATURES', 'gobject-introspection-data', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
+ ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '-DENABLE_INTROSPECTION=ON', '-DENABLE_INTROSPECTION=OFF', d)} \
-DENABLE_GTKDOC=OFF \
-DENABLE_MINIBROWSER=ON \
"