harfbuzz: security bump to version 1.4.4
[buildroot-gz.git] / package / wpa_supplicant / wpa_supplicant.mk
blob9c8414b56828a38c89c5f47df3acbf2e77b168d4
1 ################################################################################
3 # wpa_supplicant
5 ################################################################################
7 WPA_SUPPLICANT_VERSION = 2.6
8 WPA_SUPPLICANT_SITE = http://hostap.epitest.fi/releases
9 WPA_SUPPLICANT_LICENSE = BSD-3c
10 WPA_SUPPLICANT_LICENSE_FILES = README
11 WPA_SUPPLICANT_CONFIG = $(WPA_SUPPLICANT_DIR)/wpa_supplicant/.config
12 WPA_SUPPLICANT_SUBDIR = wpa_supplicant
13 WPA_SUPPLICANT_DBUS_OLD_SERVICE = fi.epitest.hostap.WPASupplicant
14 WPA_SUPPLICANT_DBUS_NEW_SERVICE = fi.w1.wpa_supplicant1
15 WPA_SUPPLICANT_CFLAGS = $(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include/libnl3/
16 WPA_SUPPLICANT_LDFLAGS = $(TARGET_LDFLAGS)
18 # install the wpa_client library
19 WPA_SUPPLICANT_INSTALL_STAGING = YES
21 WPA_SUPPLICANT_CONFIG_EDITS =
23 # Add support for simple background scan
24 WPA_SUPPLICANT_CONFIG_SET = CONFIG_BGSCAN_SIMPLE
26 WPA_SUPPLICANT_CONFIG_ENABLE = \
27 CONFIG_IEEE80211AC \
28 CONFIG_IEEE80211N \
29 CONFIG_IEEE80211R \
30 CONFIG_INTERNAL_LIBTOMMATH \
31 CONFIG_DEBUG_FILE \
32 CONFIG_MATCH_IFACE
34 WPA_SUPPLICANT_CONFIG_DISABLE = \
35 CONFIG_SMARTCARD
37 # libnl-3 needs -lm (for rint) and -lpthread if linking statically
38 # And library order matters hence stick -lnl-3 first since it's appended
39 # in the wpa_supplicant Makefiles as in LIBS+=-lnl-3 ... thus failing
40 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_NL80211),y)
41 ifeq ($(BR2_STATIC_LIBS),y)
42 WPA_SUPPLICANT_LIBS += -lnl-3 -lm -lpthread
43 endif
44 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf libnl
45 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_LIBNL32
46 else
47 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
48 endif
50 # Trailing underscore on purpose to not enable CONFIG_EAPOL_TEST
51 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
52 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_EAP_
53 # uses dlopen()
54 ifeq ($(BR2_STATIC_LIBS),y)
55 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_TNC
56 endif
57 else
58 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP
59 endif
61 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
62 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_HS20 \
63 CONFIG_INTERWORKING
64 endif
66 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT),y)
67 WPA_SUPPLICANT_CONFIG_ENABLE += \
68 CONFIG_AP \
69 CONFIG_P2P
70 endif
72 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WIFI_DISPLAY),y)
73 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_WIFI_DISPLAY
74 endif
76 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_MESH_NETWORKING),y)
77 WPA_SUPPLICANT_CONFIG_SET += CONFIG_MESH
78 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_IEEE80211W
79 endif
81 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_AUTOSCAN),y)
82 WPA_SUPPLICANT_CONFIG_ENABLE += \
83 CONFIG_AUTOSCAN_EXPONENTIAL \
84 CONFIG_AUTOSCAN_PERIODIC
85 endif
87 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPS),y)
88 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_WPS
89 endif
91 # Try to use openssl if it's already available
92 ifeq ($(BR2_PACKAGE_OPENSSL),y)
93 WPA_SUPPLICANT_DEPENDENCIES += openssl
94 WPA_SUPPLICANT_LIBS += $(if $(BR2_STATIC_LIBS),-lcrypto -lz)
95 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=openssl\)/\1/'
96 else
97 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_PWD
98 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
99 endif
101 ifeq ($(BR2_PACKAGE_DBUS),y)
102 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf dbus
103 WPA_SUPPLICANT_MAKE_ENV = \
104 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
105 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"
107 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD),y)
108 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS=
109 define WPA_SUPPLICANT_INSTALL_DBUS_OLD
110 $(INSTALL) -m 0644 -D \
111 $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE).service \
112 $(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE).service
113 endef
114 endif
116 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW),y)
117 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_NEW
118 define WPA_SUPPLICANT_INSTALL_DBUS_NEW
119 $(INSTALL) -m 0644 -D \
120 $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service \
121 $(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service
122 endef
123 endif
125 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION),y)
126 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_INTRO
127 endif
129 endif
131 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG),y)
132 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_DEBUG_SYSLOG
133 endif
135 ifeq ($(BR2_PACKAGE_READLINE),y)
136 WPA_SUPPLICANT_DEPENDENCIES += readline
137 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_READLINE
138 endif
140 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO),y)
141 WPA_SUPPLICANT_CONFIG_SET += CONFIG_BUILD_WPA_CLIENT_SO
142 define WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO
143 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/libwpa_client.so \
144 $(TARGET_DIR)/usr/lib/libwpa_client.so
145 $(INSTALL) -m 0644 -D $(@D)/src/common/wpa_ctrl.h \
146 $(TARGET_DIR)/usr/include/wpa_ctrl.h
147 endef
148 define WPA_SUPPLICANT_INSTALL_STAGING_WPA_CLIENT_SO
149 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/libwpa_client.so \
150 $(STAGING_DIR)/usr/lib/libwpa_client.so
151 $(INSTALL) -m 0644 -D $(@D)/src/common/wpa_ctrl.h \
152 $(STAGING_DIR)/usr/include/wpa_ctrl.h
153 endef
154 endif
156 define WPA_SUPPLICANT_CONFIGURE_CMDS
157 cp $(@D)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
158 sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(WPA_SUPPLICANT_CONFIG_ENABLE)) \
159 $(patsubst %,-e 's/^\(%\)/#\1/',$(WPA_SUPPLICANT_CONFIG_DISABLE)) \
160 $(patsubst %,-e '1i%=y',$(WPA_SUPPLICANT_CONFIG_SET)) \
161 $(patsubst %,-e %,$(WPA_SUPPLICANT_CONFIG_EDITS)) \
162 $(WPA_SUPPLICANT_CONFIG)
163 endef
165 # LIBS for wpa_supplicant, LIBS_c for wpa_cli, LIBS_p for wpa_passphrase
166 define WPA_SUPPLICANT_BUILD_CMDS
167 $(TARGET_MAKE_ENV) CFLAGS="$(WPA_SUPPLICANT_CFLAGS)" \
168 LDFLAGS="$(TARGET_LDFLAGS)" BINDIR=/usr/sbin \
169 LIBS="$(WPA_SUPPLICANT_LIBS)" LIBS_c="$(WPA_SUPPLICANT_LIBS)" \
170 LIBS_p="$(WPA_SUPPLICANT_LIBS)" \
171 $(MAKE) CC="$(TARGET_CC)" -C $(@D)/$(WPA_SUPPLICANT_SUBDIR)
172 endef
174 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_CLI),y)
175 define WPA_SUPPLICANT_INSTALL_CLI
176 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_cli \
177 $(TARGET_DIR)/usr/sbin/wpa_cli
178 endef
179 endif
181 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE),y)
182 define WPA_SUPPLICANT_INSTALL_PASSPHRASE
183 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_passphrase \
184 $(TARGET_DIR)/usr/sbin/wpa_passphrase
185 endef
186 endif
188 ifeq ($(BR2_PACKAGE_DBUS),y)
189 define WPA_SUPPLICANT_INSTALL_DBUS
190 $(INSTALL) -m 0644 -D \
191 $(@D)/wpa_supplicant/dbus/dbus-wpa_supplicant.conf \
192 $(TARGET_DIR)/etc/dbus-1/system.d/wpa_supplicant.conf
193 $(WPA_SUPPLICANT_INSTALL_DBUS_OLD)
194 $(WPA_SUPPLICANT_INSTALL_DBUS_NEW)
195 endef
196 endif
198 define WPA_SUPPLICANT_INSTALL_STAGING_CMDS
199 $(WPA_SUPPLICANT_INSTALL_STAGING_WPA_CLIENT_SO)
200 endef
202 define WPA_SUPPLICANT_INSTALL_TARGET_CMDS
203 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_supplicant \
204 $(TARGET_DIR)/usr/sbin/wpa_supplicant
205 $(INSTALL) -m 644 -D package/wpa_supplicant/wpa_supplicant.conf \
206 $(TARGET_DIR)/etc/wpa_supplicant.conf
207 $(WPA_SUPPLICANT_INSTALL_CLI)
208 $(WPA_SUPPLICANT_INSTALL_PASSPHRASE)
209 $(WPA_SUPPLICANT_INSTALL_DBUS)
210 $(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO)
211 endef
213 define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
214 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant.service \
215 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant.service
216 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant@.service \
217 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant@.service
218 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-nl80211@.service \
219 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-nl80211@.service
220 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-wired@.service \
221 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired@.service
222 endef
224 $(eval $(generic-package))