2 # Copyright (C) 2006-2014 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR)/rules.mk
11 PKG_VERSION:=2015-03-25
13 PKG_REV:=8278138e679174b1ec8af7f169c2810a8888e202
15 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
17 PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
18 PKG_SOURCE_VERSION:=$(PKG_REV)
20 # PKG_MIRROR_MD5SUM:=4e7c1f97edd7514535056fce54ae053a
22 PKG_MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
23 PKG_LICENSE:=BSD-3-Clause
27 PKG_CONFIG_DEPENDS:= \
28 CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
29 CONFIG_PACKAGE_kmod-ath9k \
30 CONFIG_PACKAGE_kmod-cfg80211 \
31 CONFIG_PACKAGE_hostapd \
32 CONFIG_PACKAGE_hostapd-mini \
33 CONFIG_PACKAGE_kmod-hostap \
34 CONFIG_WPA_RFKILL_SUPPORT \
35 CONFIG_DRIVER_WEXT_SUPPORT \
36 CONFIG_DRIVER_11N_SUPPORT
39 $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
40 $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
43 LOCAL_VARIANT=$(patsubst wpad-%,%,$(patsubst supplicant-%,%,$(BUILD_VARIANT)))
45 ifeq ($(LOCAL_TYPE),supplicant)
46 ifeq ($(LOCAL_VARIANT),full)
47 PKG_CONFIG_DEPENDS += \
48 CONFIG_WPA_SUPPLICANT_INTERNAL \
49 CONFIG_WPA_SUPPLICANT_OPENSSL
53 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
55 include $(INCLUDE_DIR)/package.mk
57 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
59 ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
64 CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
65 CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
66 CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
67 CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \
68 CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
70 ifneq ($(LOCAL_TYPE),hostapd)
71 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
72 ifeq ($(LOCAL_VARIANT),full)
73 DRIVER_MAKEOPTS += CONFIG_TLS=openssl
74 TARGET_LDFLAGS += -lcrypto -lssl
77 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
78 TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
80 ifdef CONFIG_WPA_RFKILL_SUPPORT
81 DRIVER_MAKEOPTS += NEED_RFKILL=y
84 CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
87 ifdef CONFIG_USE_GLIBC
88 TARGET_LDFLAGS += -lrt
89 TARGET_LDFLAGS_C += -lrt
92 DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny
94 define Package/hostapd/Default
97 TITLE:=IEEE 802.1x Authenticator
98 URL:=http://hostap.epitest.fi/
99 DEPENDS:=$(DRV_DEPENDS) +libubus
102 define Package/hostapd
103 $(call Package/hostapd/Default)
106 CONFLICTS:=wpad wpad-mini
109 define Package/hostapd/description
110 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
114 define Package/hostapd-mini
115 $(call Package/hostapd/Default)
116 TITLE+= (WPA-PSK only)
118 CONFLICTS:=wpad wpad-mini
121 define Package/hostapd-mini/description
122 This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
125 define Package/hostapd-utils
126 $(call Package/hostapd/Default)
128 DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
131 define Package/hostapd-utils/description
132 This package contains a command line utility to control the
133 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
136 define Package/wpad/Default
139 TITLE:=IEEE 802.1x Authenticator/Supplicant
140 URL:=http://hostap.epitest.fi/
144 $(call Package/wpad/Default)
146 DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl +libubus
150 define Package/wpad/description
151 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
152 Authenticator and Supplicant
155 define Package/wpad-mini
156 $(call Package/wpad/Default)
157 TITLE+= (WPA-PSK only)
158 DEPENDS:=$(DRV_DEPENDS) +libubus
162 define Package/wpad-mini/description
163 This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
166 define Package/wpa-supplicant
169 TITLE:=WPA Supplicant
170 URL:=http://hostap.epitest.fi/wpa_supplicant/
171 DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
172 CONFLICTS:=wpad wpad-mini
173 VARIANT:=supplicant-full
176 define Package/wpa-supplicant/Description
180 define Package/wpa-supplicant/config
181 source "$(SOURCE)/Config.in"
184 define Package/wpa-supplicant-p2p
185 $(Package/wpa-supplicant)
186 TITLE:=WPA Supplicant (with Wi-Fi P2P support)
187 DEPENDS:=$(DRV_DEPENDS)
188 CONFLICTS:=wpad wpad-mini
189 VARIANT:=supplicant-p2p
192 define Package/wpa-supplicant-p2p/Description
193 WPA Supplicant (with Wi-Fi P2P support)
196 define Package/wpa-supplicant-mini
197 $(Package/wpa-supplicant)
198 TITLE:=WPA Supplicant (minimal version)
199 DEPENDS:=$(DRV_DEPENDS)
200 CONFLICTS:=wpad wpad-mini
201 VARIANT:=supplicant-mini
204 define Package/wpa-supplicant-mini/Description
205 WPA Supplicant (minimal version)
208 define Package/wpa-cli
211 DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpa-supplicant-p2p||PACKAGE_wpad-mini||PACKAGE_wpad
212 TITLE:=WPA Supplicant command line interface
215 define Package/wpa-cli/Description
216 WPA Supplicant control utility
219 define Package/hostapd-common
220 TITLE:=hostapd/wpa_supplicant common support files
225 define Package/hostapd-common-old
226 TITLE:=hostapd/wpa_supplicant common support files (legacy drivers)
231 define Package/eapol-test
232 TITLE:=802.1x authentication test utility
235 VARIANT:=supplicant-full
236 DEPENDS:=$(DRV_DEPENDS)
240 ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
241 define Build/Configure/rebuild
242 $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
243 rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
244 rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
245 rm -f $(PKG_BUILD_DIR)/.config_*
246 touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
250 define Build/Configure
251 $(Build/Configure/rebuild)
252 $(if $(wildcard ./files/hostapd-$(LOCAL_VARIANT).config), \
253 $(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
255 $(CP) ./files/wpa_supplicant-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
259 -I$(STAGING_DIR)/usr/include/libnl-tiny \
260 -I$(PKG_BUILD_DIR)/src/crypto \
264 $(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
266 TARGET_CFLAGS += -ffunction-sections -fdata-sections
267 TARGET_LDFLAGS += -Wl,--gc-sections
268 ifeq ($(findstring supplicant,$(BUILD_VARIANT)),)
269 TARGET_LDFLAGS += -lubox -lubus
272 ifdef CONFIG_PACKAGE_kmod-cfg80211
273 TARGET_LDFLAGS += -lm -lnl-tiny
277 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
278 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
279 $(TARGET_CONFIGURE_OPTS) \
281 LIBS="$(TARGET_LDFLAGS)" \
282 LIBS_c="$(TARGET_LDFLAGS_C)" \
287 define Build/Compile/wpad
289 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
290 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
291 sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \
292 ` > $(PKG_BUILD_DIR)/.cflags
293 +$(call Build/RunMake,hostapd, \
294 CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
296 hostapd_cli hostapd_multi.a \
298 +$(call Build/RunMake,wpa_supplicant, \
299 CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
301 wpa_cli wpa_supplicant_multi.a \
303 $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
305 ./files/multicall.c \
306 $(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
307 $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
311 define Build/Compile/hostapd
312 $(call Build/RunMake,hostapd, \
313 hostapd hostapd_cli \
317 define Build/Compile/supplicant
318 $(call Build/RunMake,wpa_supplicant, \
319 wpa_cli wpa_supplicant \
323 define Build/Compile/supplicant-full
324 $(call Build/RunMake,wpa_supplicant, \
330 $(Build/Compile/$(LOCAL_TYPE))
331 $(Build/Compile/$(BUILD_VARIANT))
334 define Install/hostapd
335 $(INSTALL_DIR) $(1)/usr/sbin
338 define Install/supplicant
339 $(INSTALL_DIR) $(1)/usr/sbin
342 define Package/hostapd-common/install
343 $(INSTALL_DIR) $(1)/lib/netifd
344 $(INSTALL_DATA) ./files/netifd.sh $(1)/lib/netifd/hostapd.sh
347 define Package/hostapd-common-old/install
348 $(INSTALL_DIR) $(1)/lib/wifi
349 $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
350 $(INSTALL_DATA) ./files/wpa_supplicant.sh $(1)/lib/wifi/wpa_supplicant.sh
353 define Package/hostapd/install
354 $(call Install/hostapd,$(1))
355 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
357 Package/hostapd-mini/install = $(Package/hostapd/install)
359 ifneq ($(LOCAL_TYPE),supplicant)
360 define Package/hostapd-utils/install
361 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/rc.button
362 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
363 $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
367 define Package/wpad/install
368 $(call Install/hostapd,$(1))
369 $(call Install/supplicant,$(1))
370 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
371 $(LN) wpad $(1)/usr/sbin/hostapd
372 $(LN) wpad $(1)/usr/sbin/wpa_supplicant
374 Package/wpad-mini/install = $(Package/wpad/install)
376 define Package/wpa-supplicant/install
377 $(call Install/supplicant,$(1))
378 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
380 Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
381 Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
383 ifneq ($(LOCAL_TYPE),hostapd)
384 define Package/wpa-cli/install
385 $(INSTALL_DIR) $(1)/usr/sbin
386 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
390 ifeq ($(BUILD_VARIANT),supplicant-full)
391 define Package/eapol-test/install
392 $(INSTALL_DIR) $(1)/usr/sbin
393 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
397 $(eval $(call BuildPackage,hostapd))
398 $(eval $(call BuildPackage,hostapd-mini))
399 $(eval $(call BuildPackage,wpad))
400 $(eval $(call BuildPackage,wpad-mini))
401 $(eval $(call BuildPackage,wpa-supplicant))
402 $(eval $(call BuildPackage,wpa-supplicant-mini))
403 $(eval $(call BuildPackage,wpa-supplicant-p2p))
404 $(eval $(call BuildPackage,wpa-cli))
405 $(eval $(call BuildPackage,hostapd-utils))
406 $(eval $(call BuildPackage,hostapd-common))
407 $(eval $(call BuildPackage,hostapd-common-old))
408 $(eval $(call BuildPackage,eapol-test))