fs/tar: make --no-recursion effective
[buildroot-gz.git] / package / hostapd / hostapd.mk
bloba49901138566fc19e1eac88f2e7ae86bf97d9658
1 ################################################################################
3 # hostapd
5 ################################################################################
7 HOSTAPD_VERSION = 2.6
8 HOSTAPD_SITE = http://hostap.epitest.fi/releases
9 HOSTAPD_SUBDIR = hostapd
10 HOSTAPD_CONFIG = $(HOSTAPD_DIR)/$(HOSTAPD_SUBDIR)/.config
11 HOSTAPD_DEPENDENCIES = host-pkgconf libnl
12 HOSTAPD_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
13 HOSTAPD_LICENSE = BSD-3c
14 HOSTAPD_LICENSE_FILES = README
15 HOSTAPD_CONFIG_SET =
17 HOSTAPD_CONFIG_ENABLE = \
18 CONFIG_FULL_DYNAMIC_VLAN \
19 CONFIG_HS20 \
20 CONFIG_IEEE80211AC \
21 CONFIG_IEEE80211N \
22 CONFIG_IEEE80211R \
23 CONFIG_INTERNAL_LIBTOMMATH \
24 CONFIG_INTERWORKING \
25 CONFIG_LIBNL32 \
26 CONFIG_VLAN_NETLINK
28 HOSTAPD_CONFIG_DISABLE =
30 # libnl-3 needs -lm (for rint) and -lpthread if linking statically
31 # And library order matters hence stick -lnl-3 first since it's appended
32 # in the hostapd Makefiles as in LIBS+=-lnl-3 ... thus failing
33 ifeq ($(BR2_STATIC_LIBS),y)
34 HOSTAPD_LIBS += -lnl-3 -lm -lpthread
35 endif
37 # Try to use openssl if it's already available
38 ifeq ($(BR2_PACKAGE_OPENSSL),y)
39 HOSTAPD_DEPENDENCIES += openssl
40 HOSTAPD_LIBS += $(if $(BR2_STATIC_LIBS),-lcrypto -lz)
41 HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=openssl\)/\1/'
42 else
43 HOSTAPD_CONFIG_DISABLE += CONFIG_EAP_PWD
44 HOSTAPD_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
45 endif
47 ifeq ($(BR2_PACKAGE_HOSTAPD_ACS),y)
48 HOSTAPD_CONFIG_ENABLE += CONFIG_ACS
49 endif
51 ifeq ($(BR2_PACKAGE_HOSTAPD_EAP),y)
52 HOSTAPD_CONFIG_ENABLE += \
53 CONFIG_EAP \
54 CONFIG_RADIUS_SERVER \
56 # Enable both TLS v1.1 (CONFIG_TLSV11) and v1.2 (CONFIG_TLSV12)
57 HOSTAPD_CONFIG_ENABLE += CONFIG_TLSV1
58 else
59 HOSTAPD_CONFIG_DISABLE += CONFIG_EAP
60 HOSTAPD_CONFIG_ENABLE += \
61 CONFIG_NO_ACCOUNTING \
62 CONFIG_NO_RADIUS
63 endif
65 ifeq ($(BR2_PACKAGE_HOSTAPD_WPS),y)
66 HOSTAPD_CONFIG_ENABLE += CONFIG_WPS
67 endif
69 define HOSTAPD_CONFIGURE_CMDS
70 cp $(@D)/hostapd/defconfig $(HOSTAPD_CONFIG)
71 sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(HOSTAPD_CONFIG_ENABLE)) \
72 $(patsubst %,-e 's/^\(%\)/#\1/',$(HOSTAPD_CONFIG_DISABLE)) \
73 $(patsubst %,-e '1i%=y',$(HOSTAPD_CONFIG_SET)) \
74 $(patsubst %,-e %,$(HOSTAPD_CONFIG_EDITS)) \
75 $(HOSTAPD_CONFIG)
76 endef
78 define HOSTAPD_BUILD_CMDS
79 $(TARGET_MAKE_ENV) CFLAGS="$(HOSTAPD_CFLAGS)" \
80 LDFLAGS="$(TARGET_LDFLAGS)" LIBS="$(HOSTAPD_LIBS)" \
81 $(MAKE) CC="$(TARGET_CC)" -C $(@D)/$(HOSTAPD_SUBDIR)
82 endef
84 define HOSTAPD_INSTALL_TARGET_CMDS
85 $(INSTALL) -m 0755 -D $(@D)/$(HOSTAPD_SUBDIR)/hostapd \
86 $(TARGET_DIR)/usr/sbin/hostapd
87 $(INSTALL) -m 0755 -D $(@D)/$(HOSTAPD_SUBDIR)/hostapd_cli \
88 $(TARGET_DIR)/usr/bin/hostapd_cli
89 $(INSTALL) -m 0644 -D $(@D)/$(HOSTAPD_SUBDIR)/hostapd.conf \
90 $(TARGET_DIR)/etc/hostapd.conf
91 endef
93 $(eval $(generic-package))