2059c7e6db9e7051be10a0f6afaab855158da45f
[openwrt/openwrt.git] / package / network / services / hostapd / Makefile
1 # Copyright (C) 2006-2014 OpenWrt.org
2 #
3 # This is free software, licensed under the GNU General Public License v2.
4 # See /LICENSE for more information.
5 #
6
7 include $(TOPDIR)/rules.mk
8
9 PKG_NAME:=hostapd
10 PKG_RELEASE:=4
11
12 PKG_SOURCE_URL:=http://w1.fi/hostap.git
13 PKG_SOURCE_PROTO:=git
14 PKG_SOURCE_DATE:=2018-05-21
15 PKG_SOURCE_VERSION:=62566bc23d041e88f8e35933d5fd8c2fd0f7cf2a
16 PKG_MIRROR_HASH:=f234b24f9471ae9cb34460feec6d6614641691544101535673595272c91448eb
17
18 PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
21
22 PKG_BUILD_PARALLEL:=1
23
24 PKG_CONFIG_DEPENDS:= \
25 CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK \
26 CONFIG_PACKAGE_kmod-ath9k \
27 CONFIG_PACKAGE_kmod-cfg80211 \
28 CONFIG_PACKAGE_hostapd \
29 CONFIG_PACKAGE_hostapd-mini \
30 CONFIG_WPA_RFKILL_SUPPORT \
31 CONFIG_DRIVER_WEXT_SUPPORT \
32 CONFIG_DRIVER_11N_SUPPORT \
33 CONFIG_DRIVER_11AC_SUPPORT \
34
35 WPAD_PROVIDERS:=wpad-mini wpad wpad-openssl wpad-wolfssl \
36 wpad-mesh-openssl wpad-mesh-wolfssl
37
38 SUPPLICANT_ONLY_PROVIDERS:=wpa-supplicant-mini wpa-supplicant-p2p \
39 wpa-supplicant wpa-supplicant-openssl wpa-supplicant-wolfssl \
40 wpa-supplicant-mesh-openssl wpa-supplicant-mesh-wolfssl
41
42 HOSTAPD_ONLY_PROVIDERS:=hostapd-mini hostapd hostapd-openssl hostapd-wolfssl
43
44 EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
45
46 SUPPLICANT_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS)
47 HOSTAPD_PROVIDERS:=$(WPAD_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS)
48 ANY_PROVIDERS:=$(WPAD_PROVIDERS) $(SUPPLICANT_ONLY_PROVIDERS) $(HOSTAPD_ONLY_PROVIDERS)
49
50 LOCAL_TYPE=$(strip \
51 $(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
52 $(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
53 hostapd \
54 )))
55
56 LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
57 $(patsubst wpad-%,%,\
58 $(patsubst supplicant-%,%,\
59 $(BUILD_VARIANT)\
60 )))
61
62 LOCAL_VARIANT=$(patsubst %-internal,%,\
63 $(patsubst %-openssl,%,\
64 $(patsubst %-wolfssl,%,\
65 $(LOCAL_AND_LIB_VARIANT)\
66 )))
67
68 SSL_VARIANT=$(strip \
69 $(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\
70 $(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\
71 internal\
72 )))
73
74 CONFIG_VARIANT:=$(LOCAL_VARIANT)
75 ifeq ($(LOCAL_VARIANT),mesh)
76 CONFIG_VARIANT:=full
77 endif
78
79 PKG_BUILD_DIR=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
80
81 include $(INCLUDE_DIR)/package.mk
82
83 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
84
85
86 ifneq ($(CONFIG_DRIVER_11N_SUPPORT),)
87 HOSTAPD_IEEE80211N:=y
88 endif
89
90 ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
91 HOSTAPD_IEEE80211AC:=y
92 endif
93
94 DRIVER_MAKEOPTS= \
95 CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
96 CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
97 CONFIG_IEEE80211N=$(HOSTAPD_IEEE80211N) \
98 CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
99 CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
100
101 space :=
102 space +=
103
104 ifeq ($(LOCAL_VARIANT),full)
105 DRIVER_MAKEOPTS += CONFIG_IEEE80211W=$(CONFIG_DRIVER_11W_SUPPORT)
106 endif
107
108 ifeq ($(LOCAL_VARIANT),full)
109 ifeq ($(SSL_VARIANT),openssl)
110 DRIVER_MAKEOPTS += CONFIG_TLS=openssl
111 TARGET_LDFLAGS += -lcrypto -lssl
112 endif
113 ifeq ($(SSL_VARIANT),wolfssl)
114 DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1
115 TARGET_LDFLAGS += -lwolfssl
116 endif
117 endif
118
119 ifneq ($(LOCAL_TYPE),hostapd)
120 ifeq ($(LOCAL_VARIANT),mesh)
121 ifeq ($(SSL_VARIANT),openssl)
122 DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
123 TARGET_LDFLAGS += -lcrypto -lssl
124 endif
125 ifeq ($(SSL_VARIANT),wolfssl)
126 DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_WPS_NFC=1 CONFIG_AP=y CONFIG_SAE=y CONFIG_MESH=y
127 TARGET_LDFLAGS += -lwolfssl
128 endif
129 endif
130
131 ifdef CONFIG_WPA_SUPPLICANT_NO_TIMESTAMP_CHECK
132 TARGET_CFLAGS += -DNO_TIMESTAMP_CHECK
133 endif
134 ifdef CONFIG_WPA_RFKILL_SUPPORT
135 DRIVER_MAKEOPTS += NEED_RFKILL=y
136 endif
137 DRIVER_MAKEOPTS += \
138 CONFIG_DRIVER_ROBOSWITCH=$(CONFIG_PACKAGE_kmod-switch)
139 endif
140
141 ifdef CONFIG_USE_GLIBC
142 TARGET_LDFLAGS += -lrt
143 TARGET_LDFLAGS_C += -lrt
144 endif
145
146 DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny
147
148
149 define Package/hostapd/Default
150 SECTION:=net
151 CATEGORY:=Network
152 TITLE:=IEEE 802.1x Authenticator
153 URL:=http://hostap.epitest.fi/
154 DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
155 PROVIDES:=hostapd
156 endef
157
158 define Package/hostapd
159 $(call Package/hostapd/Default)
160 TITLE+= (full)
161 VARIANT:=full-internal
162 endef
163
164 define Package/hostapd/description
165 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
166 Authenticator.
167 endef
168
169 define Package/hostapd-openssl
170 $(call Package/hostapd/Default)
171 TITLE+= (full)
172 VARIANT:=full-openssl
173 DEPENDS+=+libopenssl
174 CONFLICTS:=$(filter-out hostapd-openssl ,$(HOSTAPD_ONLY_PROVIDERS))
175 endef
176
177 Package/hostapd-openssl/description = $(Package/hostapd/description)
178
179 define Package/hostapd-wolfssl
180 $(call Package/hostapd/Default)
181 TITLE+= (full)
182 VARIANT:=full-wolfssl
183 DEPENDS+=+libwolfssl
184 CONFLICTS:=$(filter-out hostapd-openssl ,$(filter-out hostapd-wolfssl ,$(HOSTAPD_ONLY_PROVIDERS)))
185 endef
186
187 Package/hostapd-wolfssl/description = $(Package/hostapd/description)
188
189 define Package/hostapd-mini
190 $(call Package/hostapd/Default)
191 TITLE+= (WPA-PSK only)
192 VARIANT:=mini
193 CONFLICTS:=$(filter-out hostapd-wolfssl ,$(filter-out hostapd-openssl ,$(filter-out hostapd-mini ,$(HOSTAPD_ONLY_PROVIDERS))))
194 endef
195
196 define Package/hostapd-mini/description
197 This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
198 endef
199
200 define Package/hostapd-utils
201 SECTION:=net
202 CATEGORY:=Network
203 TITLE:=IEEE 802.1x Authenticator (utils)
204 URL:=http://hostap.epitest.fi/
205 DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg)))
206 endef
207
208 define Package/hostapd-utils/description
209 This package contains a command line utility to control the
210 IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
211 endef
212
213
214 define Package/wpad/Default
215 SECTION:=net
216 CATEGORY:=Network
217 TITLE:=IEEE 802.1x Authenticator/Supplicant
218 DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
219 URL:=http://hostap.epitest.fi/
220 PROVIDES:=hostapd wpa-supplicant
221 endef
222
223 define Package/wpad
224 $(call Package/wpad/Default)
225 TITLE+= (full)
226 VARIANT:=wpad-full-internal
227 CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\
228 $(filter-out wpad-mesh-openssl ,\
229 $(filter-out wpad-openssl ,\
230 $(filter-out wpad-wolfssl ,\
231 $(filter-out wpad-wolfssl ,\
232 $(filter-out wpad ,\
233 $(ANY_PROVIDERS)\
234 ))))))
235 endef
236
237 define Package/wpad/description
238 This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
239 Authenticator and Supplicant
240 endef
241
242 define Package/wpad-openssl
243 $(call Package/wpad/Default)
244 TITLE+= (full)
245 VARIANT:=wpad-full-openssl
246 DEPENDS+=+libopenssl
247 CONFLICTS:=$(filter-out wpad-mesh-wolfssl,\
248 $(filter-out wpad-mesh-openssl ,\
249 $(filter-out wpad-openssl ,\
250 $(ANY_PROVIDERS))))
251 endef
252
253 Package/wpad-openssl/description = $(Package/wpad/description)
254
255 define Package/wpad-wolfssl
256 $(call Package/wpad/Default)
257 TITLE+= (full)
258 VARIANT:=wpad-full-wolfssl
259 DEPENDS+=+libwolfssl
260 CONFLICTS:=$(filter-out wpad-mesh-wolfssl ,\
261 $(filter-out wpad-mesh-openssl ,\
262 $(filter-out wpad-openssl ,\
263 $(filter-out wpad-wolfssl ,\
264 $(ANY_PROVIDERS)))))
265 endef
266
267 Package/wpad-wolfssl/description = $(Package/wpad/description)
268
269 define Package/wpad-mini
270 $(call Package/wpad/Default)
271 TITLE+= (WPA-PSK only)
272 VARIANT:=wpad-mini
273 CONFLICTS:=$(SUPPLICANT_ONLY_PROVIDERS)
274 endef
275
276 define Package/wpad-mini/description
277 This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
278 endef
279
280 define Package/wpad-mesh
281 $(call Package/wpad/Default)
282 TITLE+= (with 802.11s mesh and SAE support)
283 DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
284 PROVIDES+=wpa-supplicant-mesh wpad-mesh
285 endef
286
287 define Package/wpad-mesh/description
288 This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support).
289 endef
290
291 define Package/wpad-mesh-openssl
292 $(call Package/wpad-mesh)
293 DEPENDS+=+libopenssl
294 VARIANT:=wpad-mesh-openssl
295 CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(ANY_PROVIDERS))
296 endef
297
298 Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description)
299
300 define Package/wpad-mesh-wolfssl
301 $(call Package/wpad-mesh)
302 DEPENDS+=+libwolfssl
303 VARIANT:=wpad-mesh-wolfssl
304 CONFLICTS:=$(filter-out wpad-mesh-openssl ,$(filter-out wpad-mesh-wolfssl ,$(ANY_PROVIDERS)))
305 endef
306
307 Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description)
308
309
310 define Package/wpa-supplicant/Default
311 SECTION:=net
312 CATEGORY:=Network
313 TITLE:=WPA Supplicant
314 URL:=http://hostap.epitest.fi/wpa_supplicant/
315 DEPENDS:=$(DRV_DEPENDS)
316 PROVIDES:=wpa-supplicant
317 endef
318
319 define Package/wpa-supplicant
320 $(Package/wpa-supplicant/Default)
321 VARIANT:=supplicant-full-internal
322 CONFLICTS:=wpa-supplicant-mini
323 endef
324
325 define Package/wpa-supplicant-openssl
326 $(Package/wpa-supplicant/Default)
327 CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\
328 $(filter-out wpa-supplicant-openssl ,\
329 $(filter-out wpa-supplicant-mesh-openssl ,\
330 $(filter-out wpa-supplicant-mesh-wolfssl ,\
331 $(SUPPLICANT_ONLY_PROVIDERS)\
332 ))))
333 VARIANT:=supplicant-full-openssl
334 DEPENDS+=+libopenssl
335 endef
336
337 define Package/wpa-supplicant-wolfssl
338 $(Package/wpa-supplicant/Default)
339 CONFLICTS:=$(filter-out wpa-supplicant-wolfssl ,\
340 $(filter-out wpa-supplicant-openssl ,\
341 $(filter-out wpa-supplicant-mesh-openssl ,\
342 $(filter-out wpa-supplicant-mesh-wolfssl ,\
343 $(SUPPLICANT_ONLY_PROVIDERS)\
344 ))))
345 VARIANT:=supplicant-full-wolfssl
346 DEPENDS+=+libwolfssl
347 endef
348
349 define Package/wpa-supplicant/config
350 source "$(SOURCE)/Config.in"
351 endef
352
353 define Package/wpa-supplicant-p2p
354 $(Package/wpa-supplicant/Default)
355 TITLE+= (with Wi-Fi P2P support)
356 DEPENDS+=@PACKAGE_kmod-cfg80211
357 CONFLICTS:=$(filter-out wpa-supplicant-openssl ,\
358 $(filter-out wpa-supplicant-wolfssl ,\
359 $(filter-out wpa-supplicant-p2p ,\
360 $(filter-out wpa-supplicant-mesh-openssl ,\
361 $(filter-out wpa-supplicant-mesh-wolfssl ,\
362 $(SUPPLICANT_ONLY_PROVIDERS)\
363 )))))
364 VARIANT:=supplicant-p2p-internal
365 endef
366
367 define Package/wpa-supplicant-mesh/Default
368 $(Package/wpa-supplicant/Default)
369 TITLE+= (with 802.11s and SAE)
370 DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
371 PROVIDES+=wpa-supplicant-mesh
372 endef
373
374 define Package/wpa-supplicant-mesh-openssl
375 $(Package/wpa-supplicant-mesh/Default)
376 VARIANT:=supplicant-mesh-openssl
377 CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(SUPPLICANT_ONLY_PROVIDERS))
378 DEPENDS+=+libopenssl
379 endef
380
381 define Package/wpa-supplicant-mesh-wolfssl
382 $(Package/wpa-supplicant-mesh/Default)
383 VARIANT:=supplicant-mesh-wolfssl
384 CONFLICTS:=$(filter-out wpa-supplicant-mesh-openssl ,$(filter-out wpa-supplicant-mesh-wolfssl ,$(SUPPLICANT_ONLY_PROVIDERS)))
385 DEPENDS+=+libwolfssl
386 endef
387
388 define Package/wpa-supplicant-mini
389 $(Package/wpa-supplicant/Default)
390 TITLE+= (minimal version)
391 VARIANT:=supplicant-mini
392 endef
393
394 define Package/wpa-cli
395 SECTION:=net
396 CATEGORY:=Network
397 DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg)))
398 TITLE:=WPA Supplicant command line control utility
399 endef
400
401 define Package/hostapd-common
402 TITLE:=hostapd/wpa_supplicant common support files
403 SECTION:=net
404 CATEGORY:=Network
405 endef
406
407 define Package/eapol-test
408 TITLE:=802.1x authentication test utility
409 SECTION:=net
410 CATEGORY:=Network
411 VARIANT:=supplicant-full-internal
412 DEPENDS:=$(DRV_DEPENDS)
413 endef
414
415 define Package/eapol-test-openssl
416 TITLE:=802.1x authentication test utility
417 SECTION:=net
418 CATEGORY:=Network
419 VARIANT:=supplicant-full-openssl
420 CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS))
421 DEPENDS:=$(DRV_DEPENDS) +libopenssl
422 PROVIDES:=eapol-test
423 endef
424
425 define Package/eapol-test-wolfssl
426 TITLE:=802.1x authentication test utility
427 SECTION:=net
428 CATEGORY:=Network
429 VARIANT:=supplicant-full-wolfssl
430 CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS)))
431 DEPENDS:=$(DRV_DEPENDS) +libwolfssl
432 PROVIDES:=eapol-test
433 endef
434
435
436 ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
437 define Build/Configure/rebuild
438 $(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
439 rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
440 rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
441 rm -f $(PKG_BUILD_DIR)/.config_*
442 touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
443 endef
444 endif
445
446 define Build/Configure
447 $(Build/Configure/rebuild)
448 $(if $(wildcard ./files/hostapd-$(CONFIG_VARIANT).config), \
449 $(CP) ./files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
450 )
451 $(CP) ./files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
452 endef
453
454 TARGET_CPPFLAGS := \
455 -I$(STAGING_DIR)/usr/include/libnl-tiny \
456 -I$(PKG_BUILD_DIR)/src/crypto \
457 $(TARGET_CPPFLAGS) \
458 -DCONFIG_LIBNL20 \
459 -D_GNU_SOURCE \
460 $(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
461
462 TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
463 TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin
464 ifeq ($(findstring supplicant,$(BUILD_VARIANT)),)
465 TARGET_LDFLAGS += -lubox -lubus
466 endif
467
468 ifdef CONFIG_PACKAGE_kmod-cfg80211
469 TARGET_LDFLAGS += -lm -lnl-tiny
470 endif
471
472 define Build/RunMake
473 CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
474 $(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
475 $(TARGET_CONFIGURE_OPTS) \
476 $(DRIVER_MAKEOPTS) \
477 LIBS="$(TARGET_LDFLAGS)" \
478 LIBS_c="$(TARGET_LDFLAGS_C)" \
479 AR="$(TARGET_CROSS)gcc-ar" \
480 BCHECK= \
481 $(2)
482 endef
483
484 define Build/Compile/wpad
485 echo ` \
486 $(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
487 $(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
488 sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \
489 ` > $(PKG_BUILD_DIR)/.cflags
490 sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags
491 +$(call Build/RunMake,hostapd, \
492 CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
493 MULTICALL=1 \
494 hostapd_cli hostapd_multi.a \
495 )
496 +$(call Build/RunMake,wpa_supplicant, \
497 CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
498 MULTICALL=1 \
499 wpa_cli wpa_supplicant_multi.a \
500 )
501 +export MAKEFLAGS="$(MAKE_JOBSERVER)"; $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
502 $(TARGET_CFLAGS) \
503 ./files/multicall.c \
504 $(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
505 $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
506 $(TARGET_LDFLAGS)
507 endef
508
509 define Build/Compile/hostapd
510 +$(call Build/RunMake,hostapd, \
511 hostapd hostapd_cli \
512 )
513 endef
514
515 define Build/Compile/supplicant
516 +$(call Build/RunMake,wpa_supplicant, \
517 wpa_cli wpa_supplicant \
518 )
519 endef
520
521 define Build/Compile/supplicant-full-internal
522 +$(call Build/RunMake,wpa_supplicant, \
523 eapol_test \
524 )
525 endef
526
527 define Build/Compile/supplicant-full-openssl
528 +$(call Build/RunMake,wpa_supplicant, \
529 eapol_test \
530 )
531 endef
532
533 define Build/Compile/supplicant-full-wolfssl
534 +$(call Build/RunMake,wpa_supplicant, \
535 eapol_test \
536 )
537 endef
538
539 define Build/Compile
540 $(Build/Compile/$(LOCAL_TYPE))
541 $(Build/Compile/$(BUILD_VARIANT))
542 endef
543
544 define Install/hostapd
545 $(INSTALL_DIR) $(1)/usr/sbin
546 endef
547
548 define Install/supplicant
549 $(INSTALL_DIR) $(1)/usr/sbin
550 endef
551
552 define Package/hostapd-common/install
553 $(INSTALL_DIR) $(1)/lib/netifd
554 $(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
555 endef
556
557 define Package/hostapd/install
558 $(call Install/hostapd,$(1))
559 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
560 endef
561 Package/hostapd-mini/install = $(Package/hostapd/install)
562 Package/hostapd-openssl/install = $(Package/hostapd/install)
563 Package/hostapd-wolfssl/install = $(Package/hostapd/install)
564
565 ifneq ($(LOCAL_TYPE),supplicant)
566 define Package/hostapd-utils/install
567 $(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/rc.button
568 $(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
569 $(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
570 endef
571 endif
572
573 define Package/wpad/install
574 $(call Install/hostapd,$(1))
575 $(call Install/supplicant,$(1))
576 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
577 $(LN) wpad $(1)/usr/sbin/hostapd
578 $(LN) wpad $(1)/usr/sbin/wpa_supplicant
579 endef
580 Package/wpad-mini/install = $(Package/wpad/install)
581 Package/wpad-openssl/install = $(Package/wpad/install)
582 Package/wpad-wolfssl/install = $(Package/wpad/install)
583 Package/wpad-mesh-openssl/install = $(Package/wpad/install)
584 Package/wpad-mesh-wolfssl/install = $(Package/wpad/install)
585
586 define Package/wpa-supplicant/install
587 $(call Install/supplicant,$(1))
588 $(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
589 endef
590 Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
591 Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
592 Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install)
593 Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install)
594 Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
595 Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
596
597 ifneq ($(LOCAL_TYPE),hostapd)
598 define Package/wpa-cli/install
599 $(INSTALL_DIR) $(1)/usr/sbin
600 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
601 endef
602 endif
603
604 ifeq ($(BUILD_VARIANT),supplicant-full-internal)
605 define Package/eapol-test/install
606 $(INSTALL_DIR) $(1)/usr/sbin
607 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
608 endef
609 endif
610
611 ifeq ($(BUILD_VARIANT),supplicant-full-openssl)
612 define Package/eapol-test-openssl/install
613 $(INSTALL_DIR) $(1)/usr/sbin
614 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
615 endef
616 endif
617
618 ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl)
619 define Package/eapol-test-wolfssl/install
620 $(INSTALL_DIR) $(1)/usr/sbin
621 $(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
622 endef
623 endif
624
625 $(eval $(call BuildPackage,hostapd))
626 $(eval $(call BuildPackage,hostapd-mini))
627 $(eval $(call BuildPackage,hostapd-openssl))
628 $(eval $(call BuildPackage,hostapd-wolfssl))
629 $(eval $(call BuildPackage,wpad))
630 $(eval $(call BuildPackage,wpad-mesh-openssl))
631 $(eval $(call BuildPackage,wpad-mesh-wolfssl))
632 $(eval $(call BuildPackage,wpad-mini))
633 $(eval $(call BuildPackage,wpad-openssl))
634 $(eval $(call BuildPackage,wpad-wolfssl))
635 $(eval $(call BuildPackage,wpa-supplicant))
636 $(eval $(call BuildPackage,wpa-supplicant-mesh-openssl))
637 $(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl))
638 $(eval $(call BuildPackage,wpa-supplicant-mini))
639 $(eval $(call BuildPackage,wpa-supplicant-p2p))
640 $(eval $(call BuildPackage,wpa-supplicant-openssl))
641 $(eval $(call BuildPackage,wpa-supplicant-wolfssl))
642 $(eval $(call BuildPackage,wpa-cli))
643 $(eval $(call BuildPackage,hostapd-utils))
644 $(eval $(call BuildPackage,hostapd-common))
645 $(eval $(call BuildPackage,eapol-test))
646 $(eval $(call BuildPackage,eapol-test-openssl))
647 $(eval $(call BuildPackage,eapol-test-wolfssl))