2 # Copyright (C) 2006-2009 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
:=7b90c16aa9ca377b1a6d160c1ba0f2bd304f7e2f
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
35 $(if
$(findstring wpad
,$(BUILD_VARIANT
)),wpad
, \
36 $(if
$(findstring supplicant
,$(BUILD_VARIANT
)),supplicant
, \
39 LOCAL_VARIANT
=$(patsubst wpad-
%,%,$(patsubst supplicant-
%,%,$(BUILD_VARIANT
)))
41 ifeq ($(LOCAL_TYPE
),supplicant
)
42 ifeq ($(LOCAL_VARIANT
),full
)
43 PKG_CONFIG_DEPENDS
+= \
44 CONFIG_WPA_SUPPLICANT_INTERNAL \
45 CONFIG_WPA_SUPPLICANT_OPENSSL
49 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_NAME
)-$(BUILD_VARIANT
)/$(PKG_NAME
)-$(PKG_VERSION
)
51 include $(INCLUDE_DIR
)/package.mk
54 CONFIG_DRIVER_NL80211
=$(CONFIG_PACKAGE_kmod-mac80211
) \
55 CONFIG_DRIVER_MADWIFI
=$(CONFIG_PACKAGE_kmod-madwifi
) \
56 CONFIG_DRIVER_HOSTAP
=$(CONFIG_PACKAGE_kmod-hostap
) \
57 CONFIG_IEEE80211N
=$(CONFIG_PACKAGE_kmod-ath9k
) \
58 CONFIG_IEEE80211W
=$(CONFIG_PACKAGE_kmod-ath9k
)
60 ifneq ($(LOCAL_TYPE
),hostapd
)
61 ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
62 ifeq ($(LOCAL_VARIANT
),full
)
63 DRIVER_MAKEOPTS
+= CONFIG_TLS
=openssl
64 TARGET_LDFLAGS
+= -lcrypto
-lssl
67 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
68 TARGET_CFLAGS
+= -DNO_TIMESTAMP_CHECK
71 CONFIG_DRIVER_ROBOSWITCH
=$(CONFIG_PACKAGE_kmod-switch
)
74 DRV_DEPENDS
:=+PACKAGE_kmod-mac80211
:libnl-tiny
+PACKAGE_kmod-mac80211
:crda @
(!(TARGET_avr32||TARGET_etrax
)||BROKEN
)
76 define Package
/hostapd
/Default
79 TITLE
:=IEEE
802.1x Authenticator
80 URL
:=http
://hostap.epitest.fi
/
81 DEPENDS
:=$(DRV_DEPENDS
)
82 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
85 define Package
/hostapd
86 $(call Package
/hostapd
/Default
)
91 define Package
/hostapd
/description
92 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
96 define Package
/hostapd-mini
97 $(call Package
/hostapd
/Default
)
98 TITLE
+= (WPA-PSK only
)
102 define Package
/hostapd-mini
/description
103 This package contains a minimal IEEE
802.1x
/WPA Authenticator
(WPA-PSK only
).
106 define Package
/hostapd-utils
107 $(call Package
/hostapd
/Default
)
109 DEPENDS
:=@PACKAGE_hostapd||PACKAGE_hostapd-mini
112 define Package
/hostapd-utils
/description
113 This package contains a command line utility to control the
114 IEEE
802.1x
/WPA
/EAP
/RADIUS Authenticator.
117 define Package
/wpad
/Default
120 TITLE
:=IEEE
802.1x Authenticator
/Supplicant
121 URL
:=http
://hostap.epitest.fi
/
122 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
126 $(call Package
/wpad
/Default
)
128 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
132 define Package
/wpad
/description
133 This package contains a full featured IEEE
802.1x
/WPA
/EAP
/RADIUS
134 Authenticator and Supplicant
137 define Package
/wpad-mini
138 $(call Package
/wpad
/Default
)
139 TITLE
+= (WPA-PSK only
)
140 DEPENDS
:=$(DRV_DEPENDS
)
144 define Package
/wpad-mini
/description
145 This package contains a minimal IEEE
802.1x
/WPA Authenticator and Supplicant
(WPA-PSK only
).
148 define Package
/wpa-supplicant
151 TITLE
:=WPA Supplicant
152 URL
:=http
://hostap.epitest.fi
/wpa_supplicant
/
153 DEPENDS
:=$(DRV_DEPENDS
) +WPA_SUPPLICANT_OPENSSL
:libopenssl
154 VARIANT
:=supplicant-full
155 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
158 define Package
/wpa-supplicant
/Description
162 define Package
/wpa-supplicant
/config
163 source
"$(SOURCE)/Config.in"
166 define Package
/wpa-supplicant-mini
167 $(Package
/wpa-supplicant
)
168 TITLE
:=WPA Supplicant
(minimal version
)
169 DEPENDS
:=$(DRV_DEPENDS
)
170 VARIANT
:=supplicant-mini
173 define Package
/wpa-supplicant-mini
/Description
174 WPA Supplicant
(minimal version
)
177 define Package
/wpa-cli
180 DEPENDS
:=wpa-supplicant
181 TITLE
:=WPA Supplicant command line interface
182 MAINTAINER
:=Felix Fietkau
<nbd@openwrt.org
>
185 define Package
/wpa-cli
/Description
186 WPA Supplicant control utility
190 ifneq ($(wildcard $(PKG_BUILD_DIR
)/.config_
*),$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
)))
191 define Build
/Configure
/rebuild
192 $(FIND
) $(PKG_BUILD_DIR
) -name \
*.o
-or
-name \
*.a |
$(XARGS
) rm -f
193 rm -f
$(PKG_BUILD_DIR
)/hostapd
/hostapd
194 rm -f
$(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
195 rm -f
$(PKG_BUILD_DIR
)/.config_
*
196 touch
$(subst .configured_
,.config_
,$(STAMP_CONFIGURED
))
200 define Build
/Configure
201 $(Build
/Configure
/rebuild
)
202 $(CP
) .
/files
/hostapd-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/hostapd
/.config
203 $(CP
) .
/files
/wpa_supplicant-
$(LOCAL_VARIANT
).config
$(PKG_BUILD_DIR
)/wpa_supplicant
/.config
207 -I
$(STAGING_DIR
)/usr
/include/libnl-tiny \
208 -I
$(PKG_BUILD_DIR
)/src
/crypto \
210 -I
$(STAGING_DIR
)/usr
/include/madwifi \
211 -I
$(STAGING_DIR
)/usr
/include/mac80211 \
215 ifdef CONFIG_PACKAGE_kmod-mac80211
216 TARGET_LDFLAGS
+= -lm
-lnl-tiny
220 CFLAGS
="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
221 $(MAKE
) -C
$(PKG_BUILD_DIR
)/$(1) \
222 $(TARGET_CONFIGURE_OPTS
) \
224 LIBS
="$(TARGET_LDFLAGS)" \
228 define Build
/Compile
/wpad
230 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
231 $(call Build/RunMake,wpa_supplicant,-s dump_cflags) | \
232 sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
233 ` > $(PKG_BUILD_DIR
)/.
cflags
234 $(call Build
/RunMake
,hostapd
, \
235 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
237 hostapd_cli hostapd_multi.a \
239 $(call Build
/RunMake
,wpa_supplicant
, \
240 CFLAGS
="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
242 wpa_cli wpa_supplicant_multi.a \
244 $(TARGET_CC
) -o
$(PKG_BUILD_DIR
)/wpad \
246 .
/files
/multicall.c \
247 $(PKG_BUILD_DIR
)/hostapd
/hostapd_multi.a \
248 $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant_multi.a \
252 define Build
/Compile
/hostapd
253 $(call Build
/RunMake
,hostapd
, \
254 hostapd hostapd_cli \
258 define Build
/Compile
/supplicant
259 $(call Build
/RunMake
,wpa_supplicant
, \
260 wpa_cli wpa_supplicant \
265 $(Build
/Compile
/$(LOCAL_TYPE
))
268 define Install
/hostapd
269 $(INSTALL_DIR
) $(1)/lib
/wifi
270 $(INSTALL_DATA
) .
/files
/hostapd.sh
$(1)/lib
/wifi
/hostapd.sh
271 $(INSTALL_DIR
) $(1)/usr
/sbin
274 define Install
/supplicant
275 $(INSTALL_DIR
) $(1)/lib
/wifi
276 $(INSTALL_DATA
) .
/files
/wpa_supplicant.sh
$(1)/lib
/wifi
/wpa_supplicant.sh
277 $(INSTALL_DIR
) $(1)/usr
/sbin
280 define Package
/hostapd
/install
281 $(call Install
/hostapd
,$(1))
282 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd
$(1)/usr
/sbin
/
284 Package
/hostapd-mini
/install = $(Package
/hostapd
/install)
286 ifneq ($(LOCAL_TYPE
),supplicant
)
287 define Package
/hostapd-utils
/install
288 $(INSTALL_DIR
) $(1)/usr
/sbin
289 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/hostapd
/hostapd_cli
$(1)/usr
/sbin
/
293 define Package
/wpad
/install
294 $(call Install
/hostapd
,$(1))
295 $(call Install
/supplicant
,$(1))
296 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpad
$(1)/usr
/sbin
/
297 ln
-sf wpad
$(1)/usr
/sbin
/hostapd
298 ln
-sf wpad
$(1)/usr
/sbin
/wpa_supplicant
300 Package
/wpad-mini
/install = $(Package
/wpad
/install)
302 define Package
/wpa-supplicant
/install
303 $(call Install
/supplicant
,$(1))
304 $(INSTALL_BIN
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_supplicant
$(1)/usr
/sbin
/
306 Package
/wpa-supplicant-mini
/install = $(Package
/wpa-supplicant
/install)
308 ifneq ($(LOCAL_TYPE
),hostapd
)
309 define Package
/wpa-cli
/install
310 $(INSTALL_DIR
) $(1)/usr
/sbin
311 $(CP
) $(PKG_BUILD_DIR
)/wpa_supplicant
/wpa_cli
$(1)/usr
/sbin
/
315 $(eval
$(call BuildPackage
,hostapd
))
316 $(eval
$(call BuildPackage
,hostapd-mini
))
317 $(eval
$(call BuildPackage
,wpad
))
318 $(eval
$(call BuildPackage
,wpad-mini
))
319 $(eval
$(call BuildPackage
,wpa-supplicant
))
320 $(eval
$(call BuildPackage
,wpa-supplicant-mini
))
321 $(eval
$(call BuildPackage
,wpa-cli
))
322 $(eval
$(call BuildPackage
,hostapd-utils
))