blob: d9ee4f0f5188071306760a326345b78a9129b008 (
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
##############################################################
#
# hostapd
#
#############################################################
HOSTAPD_VERSION = 1.0
HOSTAPD_SITE = http://hostap.epitest.fi/releases
HOSTAPD_SUBDIR = hostapd
HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config
HOSTAPD_DEPENDENCIES = libnl
HOSTAPD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
HOSTAPD_LDFLAGS = $(TARGET_LDFLAGS)
# libnl needs -lm (for rint) if linking statically
ifeq ($(BR2_PREFER_STATIC_LIB),y)
HOSTAPD_LDFLAGS += -lm
endif
define HOSTAPD_LIBNL_CONFIG
echo "CONFIG_LIBNL32=y" >>$(HOSTAPD_CONFIG)
endef
define HOSTAPD_CRYPTO_CONFIG
echo "CONFIG_CRYPTO=internal" >>$(HOSTAPD_CONFIG)
echo "CONFIG_INTERNAL_LIBTOMMATH=y" >>$(HOSTAPD_CONFIG)
echo "CONFIG_INTERNAL_LIBTOMMATH_FAST=y" >>$(HOSTAPD_CONFIG)
endef
# Try to use openssl or gnutls if it's already available
ifeq ($(BR2_PACKAGE_OPENSSL),y)
HOSTAPD_DEPENDENCIES += openssl
define HOSTAPD_TLS_CONFIG
echo "CONFIG_TLS=openssl" >>$(HOSTAPD_CONFIG)
endef
else
ifeq ($(BR2_PACKAGE_GNUTLS),y)
HOSTAPD_DEPENDENCIES += gnutls
define HOSTAPD_TLS_CONFIG
echo "CONFIG_TLS=gnutls" >>$(HOSTAPD_CONFIG)
endef
else
define HOSTAPD_TLS_CONFIG
echo "CONFIG_TLS=internal" >>$(HOSTAPD_CONFIG)
endef
endif
endif
ifeq ($(BR2_PACKAGE_HOSTAPD_EAP),y)
define HOSTAPD_EAP_CONFIG
$(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)
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)
echo "CONFIG_RADIUS_SERVER=y" >>$(HOSTAPD_CONFIG)
endef
ifeq ($(BR2_INET_IPV6),y)
define HOSTAPD_RADIUS_IPV6_CONFIG
$(SED) "s/^#CONFIG_IPV6/CONFIG_IPV6/" $(HOSTAPD_CONFIG)
endef
endif
else
define HOSTAPD_EAP_CONFIG
$(SED) "s/^CONFIG_EAP/#CONFIG_EAP/g" $(HOSTAPD_CONFIG)
$(SED) "s/^#CONFIG_NO_ACCOUNTING/CONFIG_NO_ACCOUNTING/" $(HOSTAPD_CONFIG)
$(SED) "s/^#CONFIG_NO_RADIUS/CONFIG_NO_RADIUS/" $(HOSTAPD_CONFIG)
endef
endif
ifeq ($(BR2_PACKAGE_HOSTAPD_WPS),y)
define HOSTAPD_WPS_CONFIG
$(SED) "s/^#CONFIG_WPS/CONFIG_WPS/g" $(HOSTAPD_CONFIG)
endef
endif
define HOSTAPD_CONFIGURE_CMDS
cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
# Misc
$(SED) "s/^CONFIG_IPV6/#CONFIG_IPV6/" $(HOSTAPD_CONFIG)
$(SED) "s/^#CONFIG_IEEE80211N/CONFIG_IEEE80211N/" $(HOSTAPD_CONFIG)
$(SED) "s/^#CONFIG_IEEE80211R/CONFIG_IEEE80211R/" $(HOSTAPD_CONFIG)
$(HOSTAPD_CRYPTO_CONFIG)
$(HOSTAPD_TLS_CONFIG)
$(HOSTAPD_RADIUS_IPV6_CONFIG)
$(HOSTAPD_EAP_CONFIG)
$(HOSTAPD_WPS_CONFIG)
$(HOSTAPD_LIBNL_CONFIG)
endef
define HOSTAPD_BUILD_CMDS
$(TARGET_MAKE_ENV) CFLAGS="$(HOSTAPD_CFLAGS)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
$(MAKE) CC="$(TARGET_CC)" -C $(@D)/$(HOSTAPD_SUBDIR)
endef
define HOSTAPD_INSTALL_TARGET_CMDS
$(INSTALL) -m 0755 -D $(@D)/$(HOSTAPD_SUBDIR)/hostapd \
$(TARGET_DIR)/usr/sbin/hostapd
$(INSTALL) -m 0755 -D $(@D)/$(HOSTAPD_SUBDIR)/hostapd_cli \
$(TARGET_DIR)/usr/bin/hostapd_cli
endef
$(eval $(call GENTARGETS))
|