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
:=2014-06-03
13 PKG_REV
:=84df167554569af8c87f0a8ac1fb508192417d8e
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
>
27 PACKAGE_kmod-madwifi
:madwifi \
29 PKG_CONFIG_DEPENDS
:= \
30 CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
31 CONFIG_PACKAGE_kmod-ath9k \
32 CONFIG_PACKAGE_kmod-mac80211 \
33 CONFIG_PACKAGE_kmod-madwifi \
34 CONFIG_PACKAGE_hostapd \
35 CONFIG_PACKAGE_hostapd-mini \
36 CONFIG_PACKAGE_kmod-hostap \
37 CONFIG_WPA_RFKILL_SUPPORT \
38 CONFIG_DRIVER_WEXT_SUPPORT \
39 CONFIG_DRIVER_11N_SUPPORT
42 $(if
$(findstring wpad
,$(BUILD_VARIANT
)),wpad
, \
43 $(if
$(findstring supplicant
,$(BUILD_VARIANT
)),supplicant
, \
46 LOCAL_VARIANT
=$(patsubst wpad-
%,%,$(patsubst supplicant-
%,%,$(BUILD_VARIANT
)))
48 ifeq ($(LOCAL_TYPE
),supplicant
)
49 ifeq ($(LOCAL_VARIANT
),full
)
50 PKG_CONFIG_DEPENDS
+= \
51 CONFIG_WPA_SUPPLICANT_INTERNAL \
52 CONFIG_WPA_SUPPLICANT_OPENSSL
56 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
58 include $(INCLUDE_DIR
)/package.mk
60 STAMP_CONFIGURED
:=$(STAMP_CONFIGURED
)_
$(CONFIG_WPA_MSG_MIN_PRIORITY
)
62 ifneq ($(CONFIG_DRIVER_11N_SUPPORT
),)
67 CONFIG_DRIVER_NL80211
=$(CONFIG_PACKAGE_kmod-mac80211
) \
68 CONFIG_DRIVER_MADWIFI
=$(CONFIG_PACKAGE_kmod-madwifi
) \
69 CONFIG_DRIVER_HOSTAP
=$(CONFIG_PACKAGE_kmod-hostap
) \
70 CONFIG_IEEE80211N
=$(HOSTAPD_IEEE80211N
) \
71 CONFIG_IEEE80211W
=$(CONFIG_PACKAGE_kmod-ath9k
) \
72 CONFIG_DRIVER_WEXT
=$(CONFIG_DRIVER_WEXT_SUPPORT
) \
73 $(if
$(CONFIG_WPA_RFKILL_SUPPORT
),NEED_RFKILL
=y
)
75 ifneq ($(LOCAL_TYPE
),hostapd
)
76 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
77 ifeq ($(LOCAL_VARIANT
),full
)
78 DRIVER_MAKEOPTS
+= CONFIG_TLS
=openssl
79 TARGET_LDFLAGS
+= -lcrypto
-lssl
82 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
83 TARGET_CFLAGS
+= -DNO_TIMESTAMP_CHECK
86 CONFIG_DRIVER_ROBOSWITCH
=$(CONFIG_PACKAGE_kmod-switch
)
89 ifdef CONFIG_USE_EGLIBC
90 TARGET_LDFLAGS
+= -lrt
91 TARGET_LDFLAGS_C
+= -lrt
94 DRV_DEPENDS
:=+PACKAGE_kmod-mac80211
:libnl-tiny @
(!TARGET_avr32||BROKEN
)
96 define Package
/hostapd
/Default
99 TITLE
:=IEEE
802.1x Authenticator
100 URL
:=http
://hostap.epitest.fi
/
101 DEPENDS
:=$(DRV_DEPENDS
) +libubus
104 define Package
/hostapd
105 $(call Package
/hostapd
/Default
)
110 define Package
/hostapd
/description
111 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
115 define Package
/hostapd-mini
116 $(call Package
/hostapd
/Default
)
117 TITLE
+= (WPA-PSK only
)
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 VARIANT
:=supplicant-full
175 define Package
/wpa-supplicant
/Description
179 define Package
/wpa-supplicant
/config
180 source
"$(SOURCE)/Config.in"
183 define Package
/wpa-supplicant-p2p
184 $(Package
/wpa-supplicant
)
185 TITLE
:=WPA Supplicant
(with Wi-Fi P2P support
)
186 DEPENDS
:=$(DRV_DEPENDS
)
187 VARIANT
:=supplicant-p2p
190 define Package
/wpa-supplicant-p2p
/Description
191 WPA Supplicant
(with Wi-Fi P2P support
)
194 define Package
/wpa-supplicant-mini
195 $(Package
/wpa-supplicant
)
196 TITLE
:=WPA Supplicant
(minimal version
)
197 DEPENDS
:=$(DRV_DEPENDS
)
198 VARIANT
:=supplicant-mini
201 define Package
/wpa-supplicant-mini
/Description
202 WPA Supplicant
(minimal version
)
205 define Package
/wpa-cli
208 DEPENDS
:=@PACKAGE_wpa-supplicant||PACKAGE_wpa-supplicant-p2p||PACKAGE_wpad-mini||PACKAGE_wpad
209 TITLE
:=WPA Supplicant command line interface
212 define Package
/wpa-cli
/Description
213 WPA Supplicant control utility
216 define Package
/hostapd-common
217 TITLE
:=hostapd
/wpa_supplicant common support files
222 define Package
/hostapd-common-old
223 TITLE
:=hostapd
/wpa_supplicant common support files
(legacy drivers
)
228 define Package
/eapol-test
229 TITLE
:=802.1x authentication
test utility
232 VARIANT
:=supplicant-full
233 DEPENDS
:=$(DRV_DEPENDS
)
237 ifneq ($(wildcard $(PKG_BUILD_DIR
)/.config_
*),$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
)))
238 define Build
/Configure
/rebuild
239 $(FIND
) $(PKG_BUILD_DIR
) -name \
*.o
-or
-name \
*.a |
$(XARGS
) rm -f
240 rm -f
$(PKG_BUILD_DIR
)/hostapd
/hostapd
241 rm -f
$(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
242 rm -f
$(PKG_BUILD_DIR
)/.config_
*
243 touch
$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
))
247 define Build
/Configure
248 $(Build
/Configure
/rebuild
)
249 $(if
$(wildcard .
/files
/hostapd-
$(LOCAL_VARIANT
).config
), \
250 $(CP
) .
/files
/hostapd-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/hostapd
/.config \
252 $(CP
) .
/files
/wpa_supplicant-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/wpa_supplicant
/.config
256 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
257 -I
$(PKG_BUILD_DIR
)/src
/crypto \
259 -I
$(CURDIR
)/madwifi \
262 $(if
$(CONFIG_WPA_MSG_MIN_PRIORITY
),-DCONFIG_MSG_MIN_PRIORITY
=$(CONFIG_WPA_MSG_MIN_PRIORITY
))
264 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
265 TARGET_LDFLAGS
+= -Wl
,--gc-sections
266 ifeq ($(findstring supplicant
,$(BUILD_VARIANT
)),)
267 TARGET_LDFLAGS
+= -lubox
-lubus
270 ifdef CONFIG_PACKAGE_kmod-mac80211
271 TARGET_LDFLAGS
+= -lm
-lnl-tiny
275 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
276 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(1) \
277 $(TARGET_CONFIGURE_OPTS
) \
279 LIBS
="$(TARGET_LDFLAGS)" \
280 LIBS_c
="$(TARGET_LDFLAGS_C)" \
285 define Build
/Compile
/wpad
287 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
288 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
289 sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
290 ` > $(PKG_BUILD_DIR
)/.
cflags
291 +$(call Build
/RunMake
,hostapd
, \
292 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
294 hostapd_cli hostapd_multi.a \
296 +$(call Build
/RunMake
,wpa_supplicant
, \
297 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
299 wpa_cli wpa_supplicant_multi.a \
301 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/wpad \
303 .
/files
/multicall.c \
304 $(PKG_BUILD_DIR
)/hostapd
/hostapd_multi.a \
305 $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant_multi.a \
309 define Build
/Compile
/hostapd
310 $(call Build
/RunMake
,hostapd
, \
311 hostapd hostapd_cli \
315 define Build
/Compile
/supplicant
316 $(call Build
/RunMake
,wpa_supplicant
, \
317 wpa_cli wpa_supplicant \
321 define Build
/Compile
/supplicant-full
322 $(call Build
/RunMake
,wpa_supplicant
, \
328 $(Build
/Compile
/$(LOCAL_TYPE
))
329 $(Build
/Compile
/$(BUILD_VARIANT
))
332 define Install
/hostapd
333 $(INSTALL_DIR
) $(1)/usr
/sbin
336 define Install
/supplicant
337 $(INSTALL_DIR
) $(1)/usr
/sbin
340 define Package
/hostapd-common
/install
341 $(INSTALL_DIR
) $(1)/lib
/netifd
342 $(INSTALL_DATA
) .
/files
/netifd.sh
$(1)/lib
/netifd
/hostapd.sh
345 define Package
/hostapd-common-old
/install
346 $(INSTALL_DIR
) $(1)/lib
/wifi
347 $(INSTALL_DATA
) .
/files
/hostapd.sh
$(1)/lib
/wifi
/hostapd.sh
348 $(INSTALL_DATA
) .
/files
/wpa_supplicant.sh
$(1)/lib
/wifi
/wpa_supplicant.sh
351 define Package
/hostapd
/install
352 $(call Install
/hostapd
,$(1))
353 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd
$(1)/usr
/sbin
/
355 Package
/hostapd-mini
/install = $(Package
/hostapd
/install)
357 ifneq ($(LOCAL_TYPE
),supplicant
)
358 define Package
/hostapd-utils
/install
359 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/rc.button
360 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd_cli
$(1)/usr
/sbin
/
361 $(INSTALL_BIN
) .
/files
/wps-hotplug.sh
$(1)/etc
/rc.button
/wps
365 define Package
/wpad
/install
366 $(call Install
/hostapd
,$(1))
367 $(call Install
/supplicant
,$(1))
368 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpad
$(1)/usr
/sbin
/
369 ln
-sf wpad
$(1)/usr
/sbin
/hostapd
370 ln
-sf wpad
$(1)/usr
/sbin
/wpa_supplicant
372 Package
/wpad-mini
/install = $(Package
/wpad
/install)
374 define Package
/wpa-supplicant
/install
375 $(call Install
/supplicant
,$(1))
376 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
$(1)/usr
/sbin
/
378 Package
/wpa-supplicant-mini
/install = $(Package
/wpa-supplicant
/install)
379 Package
/wpa-supplicant-p2p
/install = $(Package
/wpa-supplicant
/install)
381 ifneq ($(LOCAL_TYPE
),hostapd
)
382 define Package
/wpa-cli
/install
383 $(INSTALL_DIR
) $(1)/usr
/sbin
384 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_cli
$(1)/usr
/sbin
/
388 ifeq ($(BUILD_VARIANT
),supplicant-full
)
389 define Package
/eapol-test
/install
390 $(INSTALL_DIR
) $(1)/usr
/sbin
391 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/eapol_test
$(1)/usr
/sbin
/
395 $(eval
$(call BuildPackage
,hostapd
))
396 $(eval
$(call BuildPackage
,hostapd-mini
))
397 $(eval
$(call BuildPackage
,wpad
))
398 $(eval
$(call BuildPackage
,wpad-mini
))
399 $(eval
$(call BuildPackage
,wpa-supplicant
))
400 $(eval
$(call BuildPackage
,wpa-supplicant-mini
))
401 $(eval
$(call BuildPackage
,wpa-supplicant-p2p
))
402 $(eval
$(call BuildPackage
,wpa-cli
))
403 $(eval
$(call BuildPackage
,hostapd-utils
))
404 $(eval
$(call BuildPackage
,hostapd-common
))
405 $(eval
$(call BuildPackage
,hostapd-common-old
))
406 $(eval
$(call BuildPackage
,eapol-test
))