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-10-25
13 PKG_REV
:=01e2231fdc4fbec61fbc382238e3606a1d2826e4
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_LICENSE
:=BSD-3-Clause
23 PKG_LICENSE_FILES
:=README
25 PKG_MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
26 PKG_LICENSE
:=BSD-3-Clause
31 PACKAGE_kmod-madwifi
:madwifi \
33 PKG_CONFIG_DEPENDS
:= \
34 CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
35 CONFIG_PACKAGE_kmod-ath9k \
36 CONFIG_PACKAGE_kmod-mac80211 \
37 CONFIG_PACKAGE_kmod-madwifi \
38 CONFIG_PACKAGE_hostapd \
39 CONFIG_PACKAGE_hostapd-mini \
40 CONFIG_PACKAGE_kmod-hostap \
41 CONFIG_WPA_RFKILL_SUPPORT \
42 CONFIG_DRIVER_WEXT_SUPPORT \
43 CONFIG_DRIVER_11N_SUPPORT
46 $(if
$(findstring wpad
,$(BUILD_VARIANT
)),wpad
, \
47 $(if
$(findstring supplicant
,$(BUILD_VARIANT
)),supplicant
, \
50 LOCAL_VARIANT
=$(patsubst wpad-
%,%,$(patsubst supplicant-
%,%,$(BUILD_VARIANT
)))
52 ifeq ($(LOCAL_TYPE
),supplicant
)
53 ifeq ($(LOCAL_VARIANT
),full
)
54 PKG_CONFIG_DEPENDS
+= \
55 CONFIG_WPA_SUPPLICANT_INTERNAL \
56 CONFIG_WPA_SUPPLICANT_OPENSSL
60 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
62 include $(INCLUDE_DIR
)/package.mk
64 STAMP_CONFIGURED
:=$(STAMP_CONFIGURED
)_
$(CONFIG_WPA_MSG_MIN_PRIORITY
)
66 ifneq ($(CONFIG_DRIVER_11N_SUPPORT
),)
71 CONFIG_DRIVER_NL80211
=$(CONFIG_PACKAGE_kmod-mac80211
) \
72 CONFIG_DRIVER_MADWIFI
=$(CONFIG_PACKAGE_kmod-madwifi
) \
73 CONFIG_DRIVER_HOSTAP
=$(CONFIG_PACKAGE_kmod-hostap
) \
74 CONFIG_IEEE80211N
=$(HOSTAPD_IEEE80211N
) \
75 CONFIG_IEEE80211W
=$(CONFIG_PACKAGE_kmod-ath9k
) \
76 CONFIG_DRIVER_WEXT
=$(CONFIG_DRIVER_WEXT_SUPPORT
) \
77 $(if
$(CONFIG_WPA_RFKILL_SUPPORT
),NEED_RFKILL
=y
)
79 ifneq ($(LOCAL_TYPE
),hostapd
)
80 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
81 ifeq ($(LOCAL_VARIANT
),full
)
82 DRIVER_MAKEOPTS
+= CONFIG_TLS
=openssl
83 TARGET_LDFLAGS
+= -lcrypto
-lssl
86 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
87 TARGET_CFLAGS
+= -DNO_TIMESTAMP_CHECK
90 CONFIG_DRIVER_ROBOSWITCH
=$(CONFIG_PACKAGE_kmod-switch
)
93 ifdef CONFIG_USE_EGLIBC
94 TARGET_LDFLAGS
+= -lrt
95 TARGET_LDFLAGS_C
+= -lrt
98 DRV_DEPENDS
:=+PACKAGE_kmod-mac80211
:libnl-tiny @
(!TARGET_avr32||BROKEN
)
100 define Package
/hostapd
/Default
103 TITLE
:=IEEE
802.1x Authenticator
104 URL
:=http
://hostap.epitest.fi
/
105 DEPENDS
:=$(DRV_DEPENDS
) +libubus
108 define Package
/hostapd
109 $(call Package
/hostapd
/Default
)
112 CONFLICTS
:=wpad wpad-mini
115 define Package
/hostapd
/description
116 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
120 define Package
/hostapd-mini
121 $(call Package
/hostapd
/Default
)
122 TITLE
+= (WPA-PSK only
)
124 CONFLICTS
:=wpad wpad-mini
127 define Package
/hostapd-mini
/description
128 This package contains a minimal IEEE
802.1x
/WPA Authenticator
(WPA-PSK only
).
131 define Package
/hostapd-utils
132 $(call Package
/hostapd
/Default
)
134 DEPENDS
:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
137 define Package
/hostapd-utils
/description
138 This package contains a command line utility to control the
139 IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator.
142 define Package
/wpad
/Default
145 TITLE
:=IEEE
802.1x Authenticator
/Supplicant
146 URL
:=http
://hostap.epitest.fi
/
150 $(call Package
/wpad
/Default
)
152 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
+libubus
156 define Package
/wpad
/description
157 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
158 Authenticator and Supplicant
161 define Package
/wpad-mini
162 $(call Package
/wpad
/Default
)
163 TITLE
+= (WPA-PSK only
)
164 DEPENDS
:=$(DRV_DEPENDS
) +libubus
168 define Package
/wpad-mini
/description
169 This package contains a minimal IEEE
802.1x
/WPA Authenticator and Supplicant
(WPA-PSK only
).
172 define Package
/wpa-supplicant
175 TITLE
:=WPA Supplicant
176 URL
:=http
://hostap.epitest.fi
/wpa_supplicant
/
177 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
178 CONFLICTS
:=wpad wpad-mini
179 VARIANT
:=supplicant-full
182 define Package
/wpa-supplicant
/Description
186 define Package
/wpa-supplicant
/config
187 source
"$(SOURCE)/Config.in"
190 define Package
/wpa-supplicant-p2p
191 $(Package
/wpa-supplicant
)
192 TITLE
:=WPA Supplicant
(with Wi-Fi P2P support
)
193 DEPENDS
:=$(DRV_DEPENDS
)
194 CONFLICTS
:=wpad wpad-mini
195 VARIANT
:=supplicant-p2p
198 define Package
/wpa-supplicant-p2p
/Description
199 WPA Supplicant
(with Wi-Fi P2P support
)
202 define Package
/wpa-supplicant-mini
203 $(Package
/wpa-supplicant
)
204 TITLE
:=WPA Supplicant
(minimal version
)
205 DEPENDS
:=$(DRV_DEPENDS
)
206 CONFLICTS
:=wpad wpad-mini
207 VARIANT
:=supplicant-mini
210 define Package
/wpa-supplicant-mini
/Description
211 WPA Supplicant
(minimal version
)
214 define Package
/wpa-cli
217 DEPENDS
:=@PACKAGE_wpa-supplicant||PACKAGE_wpa-supplicant-p2p||PACKAGE_wpad-mini||PACKAGE_wpad
218 TITLE
:=WPA Supplicant command line interface
221 define Package
/wpa-cli
/Description
222 WPA Supplicant control utility
225 define Package
/hostapd-common
226 TITLE
:=hostapd
/wpa_supplicant common support files
231 define Package
/hostapd-common-old
232 TITLE
:=hostapd
/wpa_supplicant common support files
(legacy drivers
)
237 define Package
/eapol-test
238 TITLE
:=802.1x authentication
test utility
241 VARIANT
:=supplicant-full
242 DEPENDS
:=$(DRV_DEPENDS
)
246 ifneq ($(wildcard $(PKG_BUILD_DIR
)/.config_
*),$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
)))
247 define Build
/Configure
/rebuild
248 $(FIND
) $(PKG_BUILD_DIR
) -name \
*.o
-or
-name \
*.a |
$(XARGS
) rm -f
249 rm -f
$(PKG_BUILD_DIR
)/hostapd
/hostapd
250 rm -f
$(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
251 rm -f
$(PKG_BUILD_DIR
)/.config_
*
252 touch
$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
))
256 define Build
/Configure
257 $(Build
/Configure
/rebuild
)
258 $(if
$(wildcard .
/files
/hostapd-
$(LOCAL_VARIANT
).config
), \
259 $(CP
) .
/files
/hostapd-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/hostapd
/.config \
261 $(CP
) .
/files
/wpa_supplicant-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/wpa_supplicant
/.config
265 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
266 -I
$(PKG_BUILD_DIR
)/src
/crypto \
268 -I
$(CURDIR
)/madwifi \
271 $(if
$(CONFIG_WPA_MSG_MIN_PRIORITY
),-DCONFIG_MSG_MIN_PRIORITY
=$(CONFIG_WPA_MSG_MIN_PRIORITY
))
273 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
274 TARGET_LDFLAGS
+= -Wl
,--gc-sections
275 ifeq ($(findstring supplicant
,$(BUILD_VARIANT
)),)
276 TARGET_LDFLAGS
+= -lubox
-lubus
279 ifdef CONFIG_PACKAGE_kmod-mac80211
280 TARGET_LDFLAGS
+= -lm
-lnl-tiny
284 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
285 $(MAKE
) $(PKG_JOBS
) -C
$(PKG_BUILD_DIR
)/$(1) \
286 $(TARGET_CONFIGURE_OPTS
) \
288 LIBS
="$(TARGET_LDFLAGS)" \
289 LIBS_c
="$(TARGET_LDFLAGS_C)" \
294 define Build
/Compile
/wpad
296 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
297 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
298 sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
299 ` > $(PKG_BUILD_DIR
)/.
cflags
300 +$(call Build
/RunMake
,hostapd
, \
301 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
303 hostapd_cli hostapd_multi.a \
305 +$(call Build
/RunMake
,wpa_supplicant
, \
306 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
308 wpa_cli wpa_supplicant_multi.a \
310 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/wpad \
312 .
/files
/multicall.c \
313 $(PKG_BUILD_DIR
)/hostapd
/hostapd_multi.a \
314 $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant_multi.a \
318 define Build
/Compile
/hostapd
319 $(call Build
/RunMake
,hostapd
, \
320 hostapd hostapd_cli \
324 define Build
/Compile
/supplicant
325 $(call Build
/RunMake
,wpa_supplicant
, \
326 wpa_cli wpa_supplicant \
330 define Build
/Compile
/supplicant-full
331 $(call Build
/RunMake
,wpa_supplicant
, \
337 $(Build
/Compile
/$(LOCAL_TYPE
))
338 $(Build
/Compile
/$(BUILD_VARIANT
))
341 define Install
/hostapd
342 $(INSTALL_DIR
) $(1)/usr
/sbin
345 define Install
/supplicant
346 $(INSTALL_DIR
) $(1)/usr
/sbin
349 define Package
/hostapd-common
/install
350 $(INSTALL_DIR
) $(1)/lib
/netifd
351 $(INSTALL_DATA
) .
/files
/netifd.sh
$(1)/lib
/netifd
/hostapd.sh
354 define Package
/hostapd-common-old
/install
355 $(INSTALL_DIR
) $(1)/lib
/wifi
356 $(INSTALL_DATA
) .
/files
/hostapd.sh
$(1)/lib
/wifi
/hostapd.sh
357 $(INSTALL_DATA
) .
/files
/wpa_supplicant.sh
$(1)/lib
/wifi
/wpa_supplicant.sh
360 define Package
/hostapd
/install
361 $(call Install
/hostapd
,$(1))
362 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd
$(1)/usr
/sbin
/
364 Package
/hostapd-mini
/install = $(Package
/hostapd
/install)
366 ifneq ($(LOCAL_TYPE
),supplicant
)
367 define Package
/hostapd-utils
/install
368 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/rc.button
369 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd_cli
$(1)/usr
/sbin
/
370 $(INSTALL_BIN
) .
/files
/wps-hotplug.sh
$(1)/etc
/rc.button
/wps
374 define Package
/wpad
/install
375 $(call Install
/hostapd
,$(1))
376 $(call Install
/supplicant
,$(1))
377 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpad
$(1)/usr
/sbin
/
378 ln
-sf wpad
$(1)/usr
/sbin
/hostapd
379 ln
-sf wpad
$(1)/usr
/sbin
/wpa_supplicant
381 Package
/wpad-mini
/install = $(Package
/wpad
/install)
383 define Package
/wpa-supplicant
/install
384 $(call Install
/supplicant
,$(1))
385 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
$(1)/usr
/sbin
/
387 Package
/wpa-supplicant-mini
/install = $(Package
/wpa-supplicant
/install)
388 Package
/wpa-supplicant-p2p
/install = $(Package
/wpa-supplicant
/install)
390 ifneq ($(LOCAL_TYPE
),hostapd
)
391 define Package
/wpa-cli
/install
392 $(INSTALL_DIR
) $(1)/usr
/sbin
393 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_cli
$(1)/usr
/sbin
/
397 ifeq ($(BUILD_VARIANT
),supplicant-full
)
398 define Package
/eapol-test
/install
399 $(INSTALL_DIR
) $(1)/usr
/sbin
400 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/eapol_test
$(1)/usr
/sbin
/
404 $(eval
$(call BuildPackage
,hostapd
))
405 $(eval
$(call BuildPackage
,hostapd-mini
))
406 $(eval
$(call BuildPackage
,wpad
))
407 $(eval
$(call BuildPackage
,wpad-mini
))
408 $(eval
$(call BuildPackage
,wpa-supplicant
))
409 $(eval
$(call BuildPackage
,wpa-supplicant-mini
))
410 $(eval
$(call BuildPackage
,wpa-supplicant-p2p
))
411 $(eval
$(call BuildPackage
,wpa-cli
))
412 $(eval
$(call BuildPackage
,hostapd-utils
))
413 $(eval
$(call BuildPackage
,hostapd-common
))
414 $(eval
$(call BuildPackage
,hostapd-common-old
))
415 $(eval
$(call BuildPackage
,eapol-test
))