diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index cf498e801fb..1ba4ac613aa 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -44,6 +44,12 @@ LOCAL_TYPE=$(strip \ hostapd \ ))) +# hostapd-utils and wpa-cli can be packed by several variants, which are +# built in parallel. Only pack them in the first selected variant that +# builds them, so the variants do not write the same files. +HOSTAPD_UTILS_VARIANT=$(firstword $(filter-out supplicant-%,$(ALL_VARIANTS))) +WPA_CLI_VARIANT=$(firstword $(filter wpad-% supplicant-%,$(ALL_VARIANTS))) + LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\ $(patsubst wpad-%,%,\ $(patsubst supplicant-%,%,\ @@ -761,7 +767,7 @@ Package/hostapd-openssl/install = $(Package/hostapd/install) Package/hostapd-wolfssl/install = $(Package/hostapd/install) Package/hostapd-mbedtls/install = $(Package/hostapd/install) -ifneq ($(LOCAL_TYPE),supplicant) +ifeq ($(BUILD_VARIANT),$(HOSTAPD_UTILS_VARIANT)) define Package/hostapd-utils/install $(INSTALL_DIR) $(1)/usr/sbin $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/ @@ -801,7 +807,7 @@ Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install) Package/wpa-supplicant-mesh-mbedtls/install = $(Package/wpa-supplicant/install) -ifneq ($(LOCAL_TYPE),hostapd) +ifeq ($(BUILD_VARIANT),$(WPA_CLI_VARIANT)) define Package/wpa-cli/install $(INSTALL_DIR) $(1)/usr/sbin $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/