aboutsummaryrefslogtreecommitdiffstats
path: root/package/hostapd/hostapd.mk
blob: 2359fd3489db59918f8cb9182be66ff8464f9a76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#############################################################
#
# hostapd
#
#############################################################

HOSTAPD_VERSION = 0.7.2
HOSTAPD_SITE = http://hostap.epitest.fi/releases
HOSTAPD_SUBDIR = hostapd
HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config
HOSTAPD_DEPENDENCIES = libnl

ifeq ($(BR2_PACKAGE_OPENSSL),y)
	HOSTAPD_DEPENDENCIES += openssl
endif

$(eval $(call AUTOTARGETS,package,hostapd))

$(HOSTAPD_TARGET_CONFIGURE):
	cp $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/defconfig $(HOSTAPD_CONFIG)
	$(SED) "s/\/local//" $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/Makefile
	echo "CFLAGS += $(TARGET_CFLAGS)" >>$(HOSTAPD_CONFIG)
	echo "LDFLAGS += $(TARGET_LDFLAGS)" >>$(HOSTAPD_CONFIG)
	echo "CC = $(TARGET_CC)" >>$(HOSTAPD_CONFIG)
# IPv6
ifneq ($(BR2_INET_IPV6),y)
	$(SED) "s/CONFIG_IPV6=y//" $(HOSTAPD_CONFIG)
endif
# EAP
	echo "CONFIG_EAP_AKA=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_AKA_PRIME=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_GPSK=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_GPSK_SHA256=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_PAX=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_PSK=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_SAKE=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_EAP_SIM=y" >>$(HOSTAPD_CONFIG)
ifneq ($(BR2_PACKAGE_HOSTAPD_EXTRA_EAP),y)
	$(SED) "s/CONFIG_EAP_MSCHAPV2=y//" $(HOSTAPD_CONFIG)
	$(SED) "s/CONFIG_EAP_PEAP=y//" $(HOSTAPD_CONFIG)
	$(SED) "s/CONFIG_EAP_TLS=y//" $(HOSTAPD_CONFIG)
	$(SED) "s/CONFIG_EAP_TTLS=y//" $(HOSTAPD_CONFIG)
endif
# OpenSSL is required for EXTRA_EAP and/or WPS
# We take care of that in Config.in
ifneq ($(BR2_PACKAGE_OPENSSL),y)
	echo "CONFIG_CRYPTO=internal" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_TLS=internal" >>$(HOSTAPD_CONFIG)
endif
# WPS
ifeq ($(BR2_PACKAGE_HOSTAPD_WPS),y)
	echo "CONFIG_WPS=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_WPS_UPNP=y" >>$(HOSTAPD_CONFIG)
endif
# Drivers
	echo "CONFIG_DRIVER_WIRED=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_DRIVER_PRISM54=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_DRIVER_NL80211=y" >>$(HOSTAPD_CONFIG)
# Misc
	echo "CONFIG_IEEE80211N=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_IEEE80211R=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_IEEE80211W=y" >>$(HOSTAPD_CONFIG)
	echo "CONFIG_RADIUS_SERVER=y" >>$(HOSTAPD_CONFIG)
	touch $@

$(HOSTAPD_TARGET_INSTALL_TARGET):
	$(call MESSAGE,"Installing to target")
	$(INSTALL) -m 0755 $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/hostapd \
		$(TARGET_DIR)/usr/sbin
	$(INSTALL) -m 0755 $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/hostapd_cli \
		$(TARGET_DIR)/usr/bin
	touch $@

$(HOSTAPD_TARGET_UNINSTALL):
	$(call MESSAGE,"Uninstalling")
	rm -f $(TARGET_DIR)/usr/sbin/hostapd
	rm -f $(TARGET_DIR)/usr/bin/hostapd
	rm -f $(HOSTAPD_TARGET_INSTALL_TARGET) $(HOSTAPD_HOOK_POST_INSTALL)