package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / wpa_supplicant / wpa_supplicant.mk
blobe3f1434c82626605d16f1759c4148d5de4f86071
1 ################################################################################
3 # wpa_supplicant
5 ################################################################################
7 WPA_SUPPLICANT_VERSION = 2.5
8 WPA_SUPPLICANT_SITE = http://hostap.epitest.fi/releases
9 WPA_SUPPLICANT_LICENSE = GPLv2/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 WPA_SUPPLICANT_CONFIG_SET =
25 WPA_SUPPLICANT_CONFIG_ENABLE = \
26 CONFIG_IEEE80211AC \
27 CONFIG_IEEE80211N \
28 CONFIG_IEEE80211R \
29 CONFIG_INTERNAL_LIBTOMMATH \
30 CONFIG_DEBUG_FILE
32 WPA_SUPPLICANT_CONFIG_DISABLE = \
33 CONFIG_SMARTCARD
35 # libnl-3 needs -lm (for rint) and -lpthread if linking statically
36 # And library order matters hence stick -lnl-3 first since it's appended
37 # in the wpa_supplicant Makefiles as in LIBS+=-lnl-3 ... thus failing
38 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_NL80211),y)
39 ifeq ($(BR2_STATIC_LIBS),y)
40 WPA_SUPPLICANT_LIBS += -lnl-3 -lm -lpthread
41 endif
42 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf libnl
43 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_LIBNL32
44 else
45 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_DRIVER_NL80211
46 endif
48 # Trailing underscore on purpose to not enable CONFIG_EAPOL_TEST
49 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_EAP),y)
50 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_EAP_
51 # uses dlopen()
52 ifeq ($(BR2_STATIC_LIBS),y)
53 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_TNC
54 endif
55 else
56 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP
57 endif
59 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_HOTSPOT),y)
60 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_HS20 \
61 CONFIG_INTERWORKING
62 endif
64 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_AP_SUPPORT),y)
65 WPA_SUPPLICANT_CONFIG_ENABLE += \
66 CONFIG_AP \
67 CONFIG_P2P
68 endif
70 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPS),y)
71 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_WPS
72 endif
74 # Try to use openssl if it's already available
75 ifeq ($(BR2_PACKAGE_OPENSSL),y)
76 WPA_SUPPLICANT_DEPENDENCIES += openssl
77 WPA_SUPPLICANT_LIBS += $(if $(BR2_STATIC_LIBS),-lcrypto -lz)
78 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=openssl\)/\1/'
79 else
80 WPA_SUPPLICANT_CONFIG_DISABLE += CONFIG_EAP_PWD
81 WPA_SUPPLICANT_CONFIG_EDITS += 's/\#\(CONFIG_TLS=\).*/\1internal/'
82 endif
84 ifeq ($(BR2_PACKAGE_DBUS),y)
85 WPA_SUPPLICANT_DEPENDENCIES += host-pkgconf dbus
86 WPA_SUPPLICANT_MAKE_ENV = \
87 PKG_CONFIG_SYSROOT_DIR="$(STAGING_DIR)" \
88 PKG_CONFIG_PATH="$(STAGING_DIR)/usr/lib/pkgconfig"
90 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_OLD),y)
91 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS=
92 define WPA_SUPPLICANT_INSTALL_DBUS_OLD
93 $(INSTALL) -m 0644 -D \
94 $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE).service \
95 $(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_OLD_SERVICE).service
96 endef
97 endif
99 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_NEW),y)
100 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_NEW
101 define WPA_SUPPLICANT_INSTALL_DBUS_NEW
102 $(INSTALL) -m 0644 -D \
103 $(@D)/wpa_supplicant/dbus/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service \
104 $(TARGET_DIR)/usr/share/dbus-1/system-services/$(WPA_SUPPLICANT_DBUS_NEW_SERVICE).service
105 endef
106 endif
108 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DBUS_INTROSPECTION),y)
109 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_CTRL_IFACE_DBUS_INTRO
110 endif
112 endif
114 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_DEBUG_SYSLOG),y)
115 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_DEBUG_SYSLOG
116 endif
118 ifeq ($(BR2_PACKAGE_READLINE),y)
119 WPA_SUPPLICANT_DEPENDENCIES += readline
120 WPA_SUPPLICANT_CONFIG_ENABLE += CONFIG_READLINE
121 endif
123 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_WPA_CLIENT_SO),y)
124 WPA_SUPPLICANT_CONFIG_SET += CONFIG_BUILD_WPA_CLIENT_SO
125 define WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO
126 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/libwpa_client.so \
127 $(TARGET_DIR)/usr/lib/libwpa_client.so
128 $(INSTALL) -m 0644 -D $(@D)/src/common/wpa_ctrl.h \
129 $(TARGET_DIR)/usr/include/wpa_ctrl.h
130 endef
131 define WPA_SUPPLICANT_INSTALL_STAGING_WPA_CLIENT_SO
132 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/libwpa_client.so \
133 $(STAGING_DIR)/usr/lib/libwpa_client.so
134 $(INSTALL) -m 0644 -D $(@D)/src/common/wpa_ctrl.h \
135 $(STAGING_DIR)/usr/include/wpa_ctrl.h
136 endef
137 endif
139 define WPA_SUPPLICANT_CONFIGURE_CMDS
140 cp $(@D)/wpa_supplicant/defconfig $(WPA_SUPPLICANT_CONFIG)
141 sed -i $(patsubst %,-e 's/^#\(%\)/\1/',$(WPA_SUPPLICANT_CONFIG_ENABLE)) \
142 $(patsubst %,-e 's/^\(%\)/#\1/',$(WPA_SUPPLICANT_CONFIG_DISABLE)) \
143 $(patsubst %,-e '1i%=y',$(WPA_SUPPLICANT_CONFIG_SET)) \
144 $(patsubst %,-e %,$(WPA_SUPPLICANT_CONFIG_EDITS)) \
145 $(WPA_SUPPLICANT_CONFIG)
146 endef
148 # LIBS for wpa_supplicant, LIBS_c for wpa_cli, LIBS_p for wpa_passphrase
149 define WPA_SUPPLICANT_BUILD_CMDS
150 $(TARGET_MAKE_ENV) CFLAGS="$(WPA_SUPPLICANT_CFLAGS)" \
151 LDFLAGS="$(TARGET_LDFLAGS)" BINDIR=/usr/sbin \
152 LIBS="$(WPA_SUPPLICANT_LIBS)" LIBS_c="$(WPA_SUPPLICANT_LIBS)" \
153 LIBS_p="$(WPA_SUPPLICANT_LIBS)" \
154 $(MAKE) CC="$(TARGET_CC)" -C $(@D)/$(WPA_SUPPLICANT_SUBDIR)
155 endef
157 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_CLI),y)
158 define WPA_SUPPLICANT_INSTALL_CLI
159 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_cli \
160 $(TARGET_DIR)/usr/sbin/wpa_cli
161 endef
162 endif
164 ifeq ($(BR2_PACKAGE_WPA_SUPPLICANT_PASSPHRASE),y)
165 define WPA_SUPPLICANT_INSTALL_PASSPHRASE
166 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_passphrase \
167 $(TARGET_DIR)/usr/sbin/wpa_passphrase
168 endef
169 endif
171 ifeq ($(BR2_PACKAGE_DBUS),y)
172 define WPA_SUPPLICANT_INSTALL_DBUS
173 $(INSTALL) -m 0644 -D \
174 $(@D)/wpa_supplicant/dbus/dbus-wpa_supplicant.conf \
175 $(TARGET_DIR)/etc/dbus-1/system.d/wpa_supplicant.conf
176 $(WPA_SUPPLICANT_INSTALL_DBUS_OLD)
177 $(WPA_SUPPLICANT_INSTALL_DBUS_NEW)
178 endef
179 endif
181 define WPA_SUPPLICANT_INSTALL_STAGING_CMDS
182 $(WPA_SUPPLICANT_INSTALL_STAGING_WPA_CLIENT_SO)
183 endef
185 define WPA_SUPPLICANT_INSTALL_TARGET_CMDS
186 $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_supplicant \
187 $(TARGET_DIR)/usr/sbin/wpa_supplicant
188 $(INSTALL) -m 644 -D package/wpa_supplicant/wpa_supplicant.conf \
189 $(TARGET_DIR)/etc/wpa_supplicant.conf
190 $(WPA_SUPPLICANT_INSTALL_CLI)
191 $(WPA_SUPPLICANT_INSTALL_PASSPHRASE)
192 $(WPA_SUPPLICANT_INSTALL_DBUS)
193 $(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO)
194 endef
196 define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
197 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant.service \
198 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant.service
199 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant@.service \
200 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant@.service
201 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-nl80211@.service \
202 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-nl80211@.service
203 $(INSTALL) -m 0644 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/systemd/wpa_supplicant-wired@.service \
204 $(TARGET_DIR)/usr/lib/systemd/system/wpa_supplicant-wired@.service
205 endef
207 $(eval $(generic-package))