2 # Copyright (C) 2006-2010 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
13 PKG_REV
:=cbcf92b42f237190b006ca8c3078593a58cbeac6
15 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.bz2
16 PKG_SOURCE_URL
:=git
://w1.fi
/srv
/git
/hostap.git
17 PKG_SOURCE_SUBDIR
:=hostapd-
$(PKG_VERSION
)
18 PKG_SOURCE_VERSION
:=$(PKG_REV
)
22 PACKAGE_kmod-madwifi
:madwifi \
23 PACKAGE_kmod-mac80211
:mac80211 \
25 PKG_CONFIG_DEPENDS
:= \
26 CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
27 CONFIG_PACKAGE_kmod-ath9k \
28 CONFIG_PACKAGE_kmod-mac80211 \
29 CONFIG_PACKAGE_kmod-madwifi \
30 CONFIG_PACKAGE_hostapd \
31 CONFIG_PACKAGE_hostapd-mini \
32 CONFIG_PACKAGE_kmod-hostap \
33 CONFIG_WPA_RFKILL_SUPPORT \
34 CONFIG_DRIVER_WEXT_SUPPORT \
35 CONFIG_DRIVER_11N_SUPPORT
38 $(if
$(findstring wpad
,$(BUILD_VARIANT
)),wpad
, \
39 $(if
$(findstring supplicant
,$(BUILD_VARIANT
)),supplicant
, \
42 LOCAL_VARIANT
=$(patsubst wpad-
%,%,$(patsubst supplicant-
%,%,$(BUILD_VARIANT
)))
44 ifeq ($(LOCAL_TYPE
),supplicant
)
45 ifeq ($(LOCAL_VARIANT
),full
)
46 PKG_CONFIG_DEPENDS
+= \
47 CONFIG_WPA_SUPPLICANT_INTERNAL \
48 CONFIG_WPA_SUPPLICANT_OPENSSL
52 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
54 include $(INCLUDE_DIR
)/package.mk
56 ifneq ($(CONFIG_DRIVER_11N_SUPPORT
),)
61 CONFIG_DRIVER_NL80211
=$(CONFIG_PACKAGE_kmod-mac80211
) \
62 CONFIG_DRIVER_MADWIFI
=$(CONFIG_PACKAGE_kmod-madwifi
) \
63 CONFIG_DRIVER_HOSTAP
=$(CONFIG_PACKAGE_kmod-hostap
) \
64 CONFIG_IEEE80211N
=$(HOSTAPD_IEEE80211N
) \
65 CONFIG_IEEE80211W
=$(CONFIG_PACKAGE_kmod-ath9k
) \
66 CONFIG_DRIVER_WEXT
=$(CONFIG_DRIVER_WEXT_SUPPORT
) \
67 $(if
$(CONFIG_WPA_RFKILL_SUPPORT
),NEED_RFKILL
=y
)
69 ifneq ($(LOCAL_TYPE
),hostapd
)
70 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
71 ifeq ($(LOCAL_VARIANT
),full
)
72 DRIVER_MAKEOPTS
+= CONFIG_TLS
=openssl
73 TARGET_LDFLAGS
+= -lcrypto
-lssl
76 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
77 TARGET_CFLAGS
+= -DNO_TIMESTAMP_CHECK
80 CONFIG_DRIVER_ROBOSWITCH
=$(CONFIG_PACKAGE_kmod-switch
)
83 DRV_DEPENDS
:=+PACKAGE_kmod-mac80211
:libnl-tiny @
(!(TARGET_avr32||TARGET_etrax
)||BROKEN
)
85 define Package
/hostapd
/Default
88 TITLE
:=IEEE
802.1x Authenticator
89 URL
:=http
://hostap.epitest.fi
/
90 DEPENDS
:=$(DRV_DEPENDS
)
91 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
94 define Package
/hostapd
95 $(call Package
/hostapd
/Default
)
100 define Package
/hostapd
/description
101 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
105 define Package
/hostapd-mini
106 $(call Package
/hostapd
/Default
)
107 TITLE
+= (WPA-PSK only
)
111 define Package
/hostapd-mini
/description
112 This package contains a minimal IEEE
802.1x
/WPA Authenticator
(WPA-PSK only
).
115 define Package
/hostapd-utils
116 $(call Package
/hostapd
/Default
)
118 DEPENDS
:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
121 define Package
/hostapd-utils
/description
122 This package contains a command line utility to control the
123 IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator.
126 define Package
/wpad
/Default
129 TITLE
:=IEEE
802.1x Authenticator
/Supplicant
130 URL
:=http
://hostap.epitest.fi
/
131 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
135 $(call Package
/wpad
/Default
)
137 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
141 define Package
/wpad
/description
142 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
143 Authenticator and Supplicant
146 define Package
/wpad-mini
147 $(call Package
/wpad
/Default
)
148 TITLE
+= (WPA-PSK only
)
149 DEPENDS
:=$(DRV_DEPENDS
)
153 define Package
/wpad-mini
/description
154 This package contains a minimal IEEE
802.1x
/WPA Authenticator and Supplicant
(WPA-PSK only
).
157 define Package
/wpa-supplicant
160 TITLE
:=WPA Supplicant
161 URL
:=http
://hostap.epitest.fi
/wpa_supplicant
/
162 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
163 VARIANT
:=supplicant-full
164 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
167 define Package
/wpa-supplicant
/Description
171 define Package
/wpa-supplicant
/config
172 source
"$(SOURCE)/Config.in"
175 define Package
/wpa-supplicant-mini
176 $(Package
/wpa-supplicant
)
177 TITLE
:=WPA Supplicant
(minimal version
)
178 DEPENDS
:=$(DRV_DEPENDS
)
179 VARIANT
:=supplicant-mini
182 define Package
/wpa-supplicant-mini
/Description
183 WPA Supplicant
(minimal version
)
186 define Package
/wpa-cli
189 DEPENDS
:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad
190 TITLE
:=WPA Supplicant command line interface
191 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
194 define Package
/wpa-cli
/Description
195 WPA Supplicant control utility
199 ifneq ($(wildcard $(PKG_BUILD_DIR
)/.config_
*),$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
)))
200 define Build
/Configure
/rebuild
201 $(FIND
) $(PKG_BUILD_DIR
) -name \
*.o
-or
-name \
*.a |
$(XARGS
) rm -f
202 rm -f
$(PKG_BUILD_DIR
)/hostapd
/hostapd
203 rm -f
$(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
204 rm -f
$(PKG_BUILD_DIR
)/.config_
*
205 touch
$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
))
209 define Build
/Configure
210 $(Build
/Configure
/rebuild
)
211 $(CP
) .
/files
/hostapd-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/hostapd
/.config
212 $(CP
) .
/files
/wpa_supplicant-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/wpa_supplicant
/.config
216 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
217 -I
$(PKG_BUILD_DIR
)/src
/crypto \
219 -I
$(STAGING_DIR
)/usr
/include/madwifi \
220 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
224 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
225 TARGET_LDFLAGS
+= -Wl
,--gc-sections
227 ifdef CONFIG_PACKAGE_kmod-mac80211
228 TARGET_LDFLAGS
+= -lm
-lnl-tiny
232 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
233 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(1) \
234 $(TARGET_CONFIGURE_OPTS
) \
236 LIBS
="$(TARGET_LDFLAGS)" \
240 define Build
/Compile
/wpad
242 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
243 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
244 sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
245 ` > $(PKG_BUILD_DIR
)/.
cflags
246 $(call Build
/RunMake
,hostapd
, \
247 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
249 hostapd_cli hostapd_multi.a \
251 $(call Build
/RunMake
,wpa_supplicant
, \
252 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
254 wpa_cli wpa_supplicant_multi.a \
256 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/wpad \
258 .
/files
/multicall.c \
259 $(PKG_BUILD_DIR
)/hostapd
/hostapd_multi.a \
260 $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant_multi.a \
264 define Build
/Compile
/hostapd
265 $(call Build
/RunMake
,hostapd
, \
266 hostapd hostapd_cli \
270 define Build
/Compile
/supplicant
271 $(call Build
/RunMake
,wpa_supplicant
, \
272 wpa_cli wpa_supplicant \
277 $(Build
/Compile
/$(LOCAL_TYPE
))
280 define Install
/hostapd
281 $(INSTALL_DIR
) $(1)/lib
/wifi
282 $(INSTALL_DATA
) .
/files
/hostapd.sh
$(1)/lib
/wifi
/hostapd.sh
283 $(INSTALL_DIR
) $(1)/usr
/sbin
286 define Install
/supplicant
287 $(INSTALL_DIR
) $(1)/lib
/wifi
288 $(INSTALL_DATA
) .
/files
/wpa_supplicant.sh
$(1)/lib
/wifi
/wpa_supplicant.sh
289 $(INSTALL_DIR
) $(1)/usr
/sbin
292 define Package
/hostapd
/install
293 $(call Install
/hostapd
,$(1))
294 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd
$(1)/usr
/sbin
/
296 Package
/hostapd-mini
/install = $(Package
/hostapd
/install)
298 ifneq ($(LOCAL_TYPE
),supplicant
)
299 define Package
/hostapd-utils
/install
300 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/hotplug.d
/button
301 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd_cli
$(1)/usr
/sbin
/
302 $(INSTALL_DATA
) .
/files
/wps-hotplug.sh
$(1)/etc
/hotplug.d
/button
/50-wps
306 define Package
/wpad
/install
307 $(call Install
/hostapd
,$(1))
308 $(call Install
/supplicant
,$(1))
309 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpad
$(1)/usr
/sbin
/
310 ln
-sf wpad
$(1)/usr
/sbin
/hostapd
311 ln
-sf wpad
$(1)/usr
/sbin
/wpa_supplicant
313 Package
/wpad-mini
/install = $(Package
/wpad
/install)
315 define Package
/wpa-supplicant
/install
316 $(call Install
/supplicant
,$(1))
317 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
$(1)/usr
/sbin
/
319 Package
/wpa-supplicant-mini
/install = $(Package
/wpa-supplicant
/install)
321 ifneq ($(LOCAL_TYPE
),hostapd
)
322 define Package
/wpa-cli
/install
323 $(INSTALL_DIR
) $(1)/usr
/sbin
324 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_cli
$(1)/usr
/sbin
/
328 $(eval
$(call BuildPackage
,hostapd
))
329 $(eval
$(call BuildPackage
,hostapd-mini
))
330 $(eval
$(call BuildPackage
,wpad
))
331 $(eval
$(call BuildPackage
,wpad-mini
))
332 $(eval
$(call BuildPackage
,wpa-supplicant
))
333 $(eval
$(call BuildPackage
,wpa-supplicant-mini
))
334 $(eval
$(call BuildPackage
,wpa-cli
))
335 $(eval
$(call BuildPackage
,hostapd-utils
))