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-rt2800-lib \
29 CONFIG_PACKAGE_kmod-mac80211 \
30 CONFIG_PACKAGE_kmod-madwifi \
31 CONFIG_PACKAGE_hostapd \
32 CONFIG_PACKAGE_hostapd-mini \
33 CONFIG_PACKAGE_kmod-hostap \
34 CONFIG_WPA_RFKILL_SUPPORT \
35 CONFIG_DRIVER_WEXT_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_PACKAGE_kmod-rt2800-lib
),)
60 ifneq ($(CONFIG_PACKAGE_kmod-ath9k
),)
65 CONFIG_DRIVER_NL80211
=$(CONFIG_PACKAGE_kmod-mac80211
) \
66 CONFIG_DRIVER_MADWIFI
=$(CONFIG_PACKAGE_kmod-madwifi
) \
67 CONFIG_DRIVER_HOSTAP
=$(CONFIG_PACKAGE_kmod-hostap
) \
68 CONFIG_IEEE80211N
=$(HOSTAPD_IEEE80211N
) \
69 CONFIG_IEEE80211W
=$(CONFIG_PACKAGE_kmod-ath9k
) \
70 CONFIG_DRIVER_WEXT
=$(CONFIG_DRIVER_WEXT_SUPPORT
) \
71 $(if
$(CONFIG_WPA_RFKILL_SUPPORT
),NEED_RFKILL
=y
)
73 ifneq ($(LOCAL_TYPE
),hostapd
)
74 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
75 ifeq ($(LOCAL_VARIANT
),full
)
76 DRIVER_MAKEOPTS
+= CONFIG_TLS
=openssl
77 TARGET_LDFLAGS
+= -lcrypto
-lssl
80 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
81 TARGET_CFLAGS
+= -DNO_TIMESTAMP_CHECK
84 CONFIG_DRIVER_ROBOSWITCH
=$(CONFIG_PACKAGE_kmod-switch
)
87 DRV_DEPENDS
:=+PACKAGE_kmod-mac80211
:libnl-tiny @
(!(TARGET_avr32||TARGET_etrax
)||BROKEN
)
89 define Package
/hostapd
/Default
92 TITLE
:=IEEE
802.1x Authenticator
93 URL
:=http
://hostap.epitest.fi
/
94 DEPENDS
:=$(DRV_DEPENDS
)
95 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
98 define Package
/hostapd
99 $(call Package
/hostapd
/Default
)
104 define Package
/hostapd
/description
105 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
109 define Package
/hostapd-mini
110 $(call Package
/hostapd
/Default
)
111 TITLE
+= (WPA-PSK only
)
115 define Package
/hostapd-mini
/description
116 This package contains a minimal IEEE
802.1x
/WPA Authenticator
(WPA-PSK only
).
119 define Package
/hostapd-utils
120 $(call Package
/hostapd
/Default
)
122 DEPENDS
:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
125 define Package
/hostapd-utils
/description
126 This package contains a command line utility to control the
127 IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator.
130 define Package
/wpad
/Default
133 TITLE
:=IEEE
802.1x Authenticator
/Supplicant
134 URL
:=http
://hostap.epitest.fi
/
135 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
139 $(call Package
/wpad
/Default
)
141 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
145 define Package
/wpad
/description
146 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
147 Authenticator and Supplicant
150 define Package
/wpad-mini
151 $(call Package
/wpad
/Default
)
152 TITLE
+= (WPA-PSK only
)
153 DEPENDS
:=$(DRV_DEPENDS
)
157 define Package
/wpad-mini
/description
158 This package contains a minimal IEEE
802.1x
/WPA Authenticator and Supplicant
(WPA-PSK only
).
161 define Package
/wpa-supplicant
164 TITLE
:=WPA Supplicant
165 URL
:=http
://hostap.epitest.fi
/wpa_supplicant
/
166 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
167 VARIANT
:=supplicant-full
168 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
171 define Package
/wpa-supplicant
/Description
175 define Package
/wpa-supplicant
/config
176 source
"$(SOURCE)/Config.in"
179 define Package
/wpa-supplicant-mini
180 $(Package
/wpa-supplicant
)
181 TITLE
:=WPA Supplicant
(minimal version
)
182 DEPENDS
:=$(DRV_DEPENDS
)
183 VARIANT
:=supplicant-mini
186 define Package
/wpa-supplicant-mini
/Description
187 WPA Supplicant
(minimal version
)
190 define Package
/wpa-cli
193 DEPENDS
:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad
194 TITLE
:=WPA Supplicant command line interface
195 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
198 define Package
/wpa-cli
/Description
199 WPA Supplicant control utility
203 ifneq ($(wildcard $(PKG_BUILD_DIR
)/.config_
*),$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
)))
204 define Build
/Configure
/rebuild
205 $(FIND
) $(PKG_BUILD_DIR
) -name \
*.o
-or
-name \
*.a |
$(XARGS
) rm -f
206 rm -f
$(PKG_BUILD_DIR
)/hostapd
/hostapd
207 rm -f
$(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
208 rm -f
$(PKG_BUILD_DIR
)/.config_
*
209 touch
$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
))
213 define Build
/Configure
214 $(Build
/Configure
/rebuild
)
215 $(CP
) .
/files
/hostapd-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/hostapd
/.config
216 $(CP
) .
/files
/wpa_supplicant-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/wpa_supplicant
/.config
220 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
221 -I
$(PKG_BUILD_DIR
)/src
/crypto \
223 -I
$(STAGING_DIR
)/usr
/include/madwifi \
224 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
228 TARGET_CFLAGS
+= -ffunction-sections
-fdata-sections
229 TARGET_LDFLAGS
+= -Wl
,--gc-sections
231 ifdef CONFIG_PACKAGE_kmod-mac80211
232 TARGET_LDFLAGS
+= -lm
-lnl-tiny
236 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
237 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(1) \
238 $(TARGET_CONFIGURE_OPTS
) \
240 LIBS
="$(TARGET_LDFLAGS)" \
244 define Build
/Compile
/wpad
246 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
247 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
248 sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
249 ` > $(PKG_BUILD_DIR
)/.
cflags
250 $(call Build
/RunMake
,hostapd
, \
251 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
253 hostapd_cli hostapd_multi.a \
255 $(call Build
/RunMake
,wpa_supplicant
, \
256 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
258 wpa_cli wpa_supplicant_multi.a \
260 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/wpad \
262 .
/files
/multicall.c \
263 $(PKG_BUILD_DIR
)/hostapd
/hostapd_multi.a \
264 $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant_multi.a \
268 define Build
/Compile
/hostapd
269 $(call Build
/RunMake
,hostapd
, \
270 hostapd hostapd_cli \
274 define Build
/Compile
/supplicant
275 $(call Build
/RunMake
,wpa_supplicant
, \
276 wpa_cli wpa_supplicant \
281 $(Build
/Compile
/$(LOCAL_TYPE
))
284 define Install
/hostapd
285 $(INSTALL_DIR
) $(1)/lib
/wifi
286 $(INSTALL_DATA
) .
/files
/hostapd.sh
$(1)/lib
/wifi
/hostapd.sh
287 $(INSTALL_DIR
) $(1)/usr
/sbin
290 define Install
/supplicant
291 $(INSTALL_DIR
) $(1)/lib
/wifi
292 $(INSTALL_DATA
) .
/files
/wpa_supplicant.sh
$(1)/lib
/wifi
/wpa_supplicant.sh
293 $(INSTALL_DIR
) $(1)/usr
/sbin
296 define Package
/hostapd
/install
297 $(call Install
/hostapd
,$(1))
298 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd
$(1)/usr
/sbin
/
300 Package
/hostapd-mini
/install = $(Package
/hostapd
/install)
302 ifneq ($(LOCAL_TYPE
),supplicant
)
303 define Package
/hostapd-utils
/install
304 $(INSTALL_DIR
) $(1)/usr
/sbin
$(1)/etc
/hotplug.d
/button
305 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd_cli
$(1)/usr
/sbin
/
306 $(INSTALL_DATA
) .
/files
/wps-hotplug.sh
$(1)/etc
/hotplug.d
/button
/50-wps
310 define Package
/wpad
/install
311 $(call Install
/hostapd
,$(1))
312 $(call Install
/supplicant
,$(1))
313 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpad
$(1)/usr
/sbin
/
314 ln
-sf wpad
$(1)/usr
/sbin
/hostapd
315 ln
-sf wpad
$(1)/usr
/sbin
/wpa_supplicant
317 Package
/wpad-mini
/install = $(Package
/wpad
/install)
319 define Package
/wpa-supplicant
/install
320 $(call Install
/supplicant
,$(1))
321 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
$(1)/usr
/sbin
/
323 Package
/wpa-supplicant-mini
/install = $(Package
/wpa-supplicant
/install)
325 ifneq ($(LOCAL_TYPE
),hostapd
)
326 define Package
/wpa-cli
/install
327 $(INSTALL_DIR
) $(1)/usr
/sbin
328 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_cli
$(1)/usr
/sbin
/
332 $(eval
$(call BuildPackage
,hostapd
))
333 $(eval
$(call BuildPackage
,hostapd-mini
))
334 $(eval
$(call BuildPackage
,wpad
))
335 $(eval
$(call BuildPackage
,wpad-mini
))
336 $(eval
$(call BuildPackage
,wpa-supplicant
))
337 $(eval
$(call BuildPackage
,wpa-supplicant-mini
))
338 $(eval
$(call BuildPackage
,wpa-cli
))
339 $(eval
$(call BuildPackage
,hostapd-utils
))