+
+# We want madwifi if all of the following are true:
+# - distro has pci, wifi, and madwifi in its features
+# - machine has pci in its features
+COMBINED_FEATURES += "${@base_ifelse( \
+ base_contains('DISTRO_FEATURES', ('pci', 'wifi', 'madwifi'), True, False, d) and \
+ base_contains('MACHINE_FEATURES', 'pci', True, False, d), \
+ 'madwifi', '')}"
+
+# We want hostap if all of the following are true:
+# - 'wifi' and 'hostap' are in distro features
+# - either 'pci' or 'pcmcia' are in both distro and machine features
+COMBINED_FEATURES += "${@base_ifelse( \
+ base_contains('DISTRO_FEATURES', ('wifi', 'hostap'), True, False, d) and \
+ ((base_contains('MACHINE_FEATURES', 'pci', True, False, d) and \
+ base_contains('DISTRO_FEATURES', 'pci', True, False, d)) or \
+ (base_contains('MACHINE_FEATURES', 'pcmcia', True, False, d) and \
+ base_contains('DISTRO_FEATURES', 'pcmcia', True, False, d))), \
+ 'hostap', '')}"