source: branches/backfire/package/hostapd/Makefile @ 24158

Last change on this file since 24158 was 24158, checked in by jow, 6 years ago

[backfire] backport r24041

  • Property svn:copyright set to Copyright (C) 2006 OpenWrt.org
  • Property svn:eol-style set to native
File size: 8.8 KB
Line 
1#
2# Copyright (C) 2006-2010 OpenWrt.org
3#
4# This is free software, licensed under the GNU General Public License v2.
5# See /LICENSE for more information.
6#
7
8include $(TOPDIR)/rules.mk
9
10PKG_NAME:=hostapd
11PKG_VERSION:=20100705
12PKG_RELEASE:=2
13PKG_REV:=2f1ce78bf78cecd7021385b04a4f55f22e76ab97
14
15PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
16PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
17PKG_SOURCE_SUBDIR:=hostapd-$(PKG_VERSION)
18PKG_SOURCE_VERSION:=$(PKG_REV)
19PKG_SOURCE_PROTO:=git
20
21PKG_BUILD_DEPENDS:= \
22        PACKAGE_kmod-madwifi:madwifi \
23        PACKAGE_kmod-mac80211:mac80211 \
24
25PKG_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
36LOCAL_TYPE=$(strip \
37                $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
38                $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
39                hostapd \
40        )))
41LOCAL_VARIANT=$(patsubst wpad-%,%,$(patsubst supplicant-%,%,$(BUILD_VARIANT)))
42
43ifeq ($(LOCAL_TYPE),supplicant)
44  ifeq ($(LOCAL_VARIANT),full)
45    PKG_CONFIG_DEPENDS += \
46                CONFIG_WPA_SUPPLICANT_INTERNAL \
47                CONFIG_WPA_SUPPLICANT_OPENSSL
48  endif
49endif
50
51PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
52
53include $(INCLUDE_DIR)/package.mk
54
55ifneq ($(CONFIG_PACKAGE_kmod-rt2800-lib),)
56  HOSTAPD_IEEE80211N:=y
57endif
58
59ifneq ($(CONFIG_PACKAGE_kmod-ath9k),)
60  HOSTAPD_IEEE80211N:=y
61endif
62
63DRIVER_MAKEOPTS= \
64        CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-mac80211) \
65        CONFIG_DRIVER_MADWIFI=$(CONFIG_PACKAGE_kmod-madwifi) \
66        CONFIG_DRIVER_HOSTAP=$(CONFIG_PACKAGE_kmod-hostap) \
67        CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
68        CONFIG_IEEE80211W=$(CONFIG_PACKAGE_kmod-ath9k) \
69        $(if $(CONFIG_WPA_RFKILL_SUPPORT),NEED_RFKILL=y)
70
71ifneq ($(LOCAL_TYPE),hostapd)
72  ifdef CONFIG_WPA_SUPPLICANT_OPENSSL
73    ifeq ($(LOCAL_VARIANT),full)
74      DRIVER_MAKEOPTS += CONFIG_TLS=openssl
75      TARGET_LDFLAGS += -lcrypto -lssl
76    endif
77  endif
78  ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
79    TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
80  endif
81  DRIVER_MAKEOPTS += \
82        CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
83endif
84
85DRV_DEPENDS:=+PACKAGE_kmod-mac80211:libnl-tiny @(!(TARGET_avr32||TARGET_etrax)||BROKEN)
86
87define Package/hostapd/Default
88  SECTION:=net
89  CATEGORY:=Network
90  TITLE:=IEEE 802.1x Authenticator
91  URL:=http://hostap.epitest.fi/
92  DEPENDS:=$(DRV_DEPENDS)
93  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
94endef
95
96define Package/hostapd
97$(call Package/hostapd/Default)
98  TITLE+= (full)
99  VARIANT:=full
100endef
101
102define Package/hostapd/description
103 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
104 Authenticator.
105endef
106
107define Package/hostapd-mini
108$(call Package/hostapd/Default)
109  TITLE+= (WPA-PSK only)
110  VARIANT:=mini
111endef
112
113define Package/hostapd-mini/description
114 This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
115endef
116
117define Package/hostapd-utils
118  $(call Package/hostapd/Default)
119  TITLE+= (utils)
120  DEPENDS:=@PACKAGE_hostapd||PACKAGE_hostapd-mini||PACKAGE_wpad||PACKAGE_wpad-mini
121endef
122
123define Package/hostapd-utils/description
124 This package contains a command line utility to control the
125 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
126endef
127
128define Package/wpad/Default
129  SECTION:=net
130  CATEGORY:=Network
131  TITLE:=IEEE 802.1x Authenticator/Supplicant
132  URL:=http://hostap.epitest.fi/
133  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
134endef
135
136define Package/wpad
137$(call Package/wpad/Default)
138  TITLE+= (full)
139  DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
140  VARIANT:=wpad-full
141endef
142
143define Package/wpad/description
144 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
145 Authenticator and Supplicant
146endef
147
148define Package/wpad-mini
149$(call Package/wpad/Default)
150  TITLE+= (WPA-PSK only)
151  DEPENDS:=$(DRV_DEPENDS)
152  VARIANT:=wpad-mini
153endef
154
155define Package/wpad-mini/description
156 This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
157endef
158
159define Package/wpa-supplicant
160  SECTION:=net
161  CATEGORY:=Network
162  TITLE:=WPA Supplicant
163  URL:=http://hostap.epitest.fi/wpa_supplicant/
164  DEPENDS:=$(DRV_DEPENDS) +WPA_SUPPLICANT_OPENSSL:libopenssl
165  VARIANT:=supplicant-full
166  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
167endef
168
169define Package/wpa-supplicant/Description
170  WPA Supplicant
171endef
172
173define Package/wpa-supplicant/config
174        source "$(SOURCE)/Config.in"
175endef
176
177define Package/wpa-supplicant-mini
178  $(Package/wpa-supplicant)
179  TITLE:=WPA Supplicant (minimal version)
180  DEPENDS:=$(DRV_DEPENDS)
181  VARIANT:=supplicant-mini
182endef
183
184define Package/wpa-supplicant-mini/Description
185  WPA Supplicant (minimal version)
186endef
187
188define Package/wpa-cli
189  SECTION:=net
190  CATEGORY:=Network
191  DEPENDS:=@PACKAGE_wpa-supplicant||PACKAGE_wpad-mini||PACKAGE_wpad
192  TITLE:=WPA Supplicant command line interface
193  MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
194endef
195
196define Package/wpa-cli/Description
197  WPA Supplicant control utility
198endef
199
200
201ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
202  define Build/Configure/rebuild
203        $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
204        rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
205        rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
206        rm -f $(PKG_BUILD_DIR)/.config_*
207        touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
208  endef
209endif
210
211define Build/Configure
212        $(Build/Configure/rebuild)
213        $(CP) ./files/hostapd-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config
214        $(CP) ./files/wpa_supplicant-$(LOCAL_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
215endef
216
217TARGET_CPPFLAGS := \
218        -I$(STAGING_DIR)/usr/include/libnl-tiny \
219        -I$(PKG_BUILD_DIR)/src/crypto \
220        $(TARGET_CPPFLAGS) \
221        -I$(STAGING_DIR)/usr/include/madwifi \
222        -I$(STAGING_DIR)/usr/include/mac80211 \
223        -DCONFIG_LIBNL20 \
224        -D_GNU_SOURCE
225
226ifdef CONFIG_PACKAGE_kmod-mac80211
227  TARGET_LDFLAGS += -lm -lnl-tiny
228endif
229
230define Build/RunMake
231        CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
232        $(MAKE) -C $(PKG_BUILD_DIR)/$(1) \
233                $(TARGET_CONFIGURE_OPTS) \
234                $(DRIVER_MAKEOPTS) \
235                LIBS="$(TARGET_LDFLAGS)" \
236                $(2)
237endef
238
239define Build/Compile/wpad
240        echo ` \
241                $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
242                $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
243                sed -e 's,-n ,,g' -e 's,$(TARGET_CFLAGS),,' \
244        ` > $(PKG_BUILD_DIR)/.cflags
245        $(call Build/RunMake,hostapd, \
246                CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
247                MULTICALL=1 \
248                hostapd_cli hostapd_multi.a \
249        )
250        $(call Build/RunMake,wpa_supplicant, \
251                CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
252                MULTICALL=1 \
253                wpa_cli wpa_supplicant_multi.a \
254        )
255        $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
256                $(TARGET_CFLAGS) \
257                ./files/multicall.c \
258                $(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
259                $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
260                $(TARGET_LDFLAGS)
261endef
262
263define Build/Compile/hostapd
264        $(call Build/RunMake,hostapd, \
265                hostapd hostapd_cli \
266        )
267endef
268
269define Build/Compile/supplicant
270        $(call Build/RunMake,wpa_supplicant, \
271                wpa_cli wpa_supplicant \
272        )
273endef
274
275define Build/Compile
276        $(Build/Compile/$(LOCAL_TYPE))
277endef
278
279define Install/hostapd
280        $(INSTALL_DIR) $(1)/lib/wifi
281        $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/wifi/hostapd.sh
282        $(INSTALL_DIR) $(1)/usr/sbin
283endef
284
285define Install/supplicant
286        $(INSTALL_DIR) $(1)/lib/wifi
287        $(INSTALL_DATA) ./files/wpa_supplicant.sh $(1)/lib/wifi/wpa_supplicant.sh
288        $(INSTALL_DIR) $(1)/usr/sbin
289endef
290
291define Package/hostapd/install
292        $(call Install/hostapd,$(1))
293        $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
294endef
295Package/hostapd-mini/install = $(Package/hostapd/install)
296
297ifneq ($(LOCAL_TYPE),supplicant)
298  define Package/hostapd-utils/install
299        $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/hotplug.d/button
300        $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
301        $(INSTALL_DATA) ./files/wps-hotplug.sh $(1)/etc/hotplug.d/button/50-wps
302  endef
303endif
304
305define Package/wpad/install
306        $(call Install/hostapd,$(1))
307        $(call Install/supplicant,$(1))
308        $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
309        ln -sf wpad $(1)/usr/sbin/hostapd
310        ln -sf wpad $(1)/usr/sbin/wpa_supplicant
311endef
312Package/wpad-mini/install = $(Package/wpad/install)
313
314define Package/wpa-supplicant/install
315        $(call Install/supplicant,$(1))
316        $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
317endef
318Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
319
320ifneq ($(LOCAL_TYPE),hostapd)
321  define Package/wpa-cli/install
322        $(INSTALL_DIR) $(1)/usr/sbin
323        $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
324  endef
325endif
326
327$(eval $(call BuildPackage,hostapd))
328$(eval $(call BuildPackage,hostapd-mini))
329$(eval $(call BuildPackage,wpad))
330$(eval $(call BuildPackage,wpad-mini))
331$(eval $(call BuildPackage,wpa-supplicant))
332$(eval $(call BuildPackage,wpa-supplicant-mini))
333$(eval $(call BuildPackage,wpa-cli))
334$(eval $(call BuildPackage,hostapd-utils))
Note: See TracBrowser for help on using the repository browser.