Android.mk revision 1.1 1 1.1 christos LOCAL_PATH := $(call my-dir)
2 1.1 christos
3 1.1 christos WPA_BUILD_HOSTAPD := false
4 1.1 christos ifneq ($(TARGET_SIMULATOR),true)
5 1.1 christos ifneq ($(BOARD_HOSTAPD_DRIVER),)
6 1.1 christos WPA_BUILD_HOSTAPD := true
7 1.1 christos CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
8 1.1 christos endif
9 1.1 christos endif
10 1.1 christos
11 1.1 christos include $(LOCAL_PATH)/.config
12 1.1 christos
13 1.1 christos # To ignore possible wrong network configurations
14 1.1 christos L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
15 1.1 christos
16 1.1 christos # Set Android log name
17 1.1 christos L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
18 1.1 christos
19 1.1 christos # To force sizeof(enum) = 4
20 1.1 christos ifeq ($(TARGET_ARCH),arm)
21 1.1 christos L_CFLAGS += -mabi=aapcs-linux
22 1.1 christos endif
23 1.1 christos
24 1.1 christos # To allow non-ASCII characters in SSID
25 1.1 christos L_CFLAGS += -DWPA_UNICODE_SSID
26 1.1 christos
27 1.1 christos # OpenSSL is configured without engines on Android
28 1.1 christos L_CFLAGS += -DOPENSSL_NO_ENGINE
29 1.1 christos
30 1.1 christos INCLUDES = $(LOCAL_PATH)
31 1.1 christos INCLUDES += $(LOCAL_PATH)/src
32 1.1 christos INCLUDES += $(LOCAL_PATH)/src/utils
33 1.1 christos INCLUDES += external/openssl/include
34 1.1 christos INCLUDES += frameworks/base/cmds/keystore
35 1.1 christos ifdef CONFIG_DRIVER_NL80211
36 1.1 christos INCLUDES += external/libnl-headers
37 1.1 christos endif
38 1.1 christos
39 1.1 christos
40 1.1 christos ifndef CONFIG_OS
41 1.1 christos ifdef CONFIG_NATIVE_WINDOWS
42 1.1 christos CONFIG_OS=win32
43 1.1 christos else
44 1.1 christos CONFIG_OS=unix
45 1.1 christos endif
46 1.1 christos endif
47 1.1 christos
48 1.1 christos ifeq ($(CONFIG_OS), internal)
49 1.1 christos L_CFLAGS += -DOS_NO_C_LIB_DEFINES
50 1.1 christos endif
51 1.1 christos
52 1.1 christos ifdef CONFIG_NATIVE_WINDOWS
53 1.1 christos L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
54 1.1 christos LIBS += -lws2_32
55 1.1 christos endif
56 1.1 christos
57 1.1 christos OBJS = main.c
58 1.1 christos OBJS += config_file.c
59 1.1 christos
60 1.1 christos OBJS += src/ap/hostapd.c
61 1.1 christos OBJS += src/ap/wpa_auth_glue.c
62 1.1 christos OBJS += src/ap/drv_callbacks.c
63 1.1 christos OBJS += src/ap/ap_drv_ops.c
64 1.1 christos OBJS += src/ap/utils.c
65 1.1 christos OBJS += src/ap/authsrv.c
66 1.1 christos OBJS += src/ap/ieee802_1x.c
67 1.1 christos OBJS += src/ap/ap_config.c
68 1.1 christos OBJS += src/ap/ieee802_11_auth.c
69 1.1 christos OBJS += src/ap/sta_info.c
70 1.1 christos OBJS += src/ap/wpa_auth.c
71 1.1 christos OBJS += src/ap/tkip_countermeasures.c
72 1.1 christos OBJS += src/ap/ap_mlme.c
73 1.1 christos OBJS += src/ap/wpa_auth_ie.c
74 1.1 christos OBJS += src/ap/preauth_auth.c
75 1.1 christos OBJS += src/ap/pmksa_cache_auth.c
76 1.1 christos OBJS += src/ap/ieee802_11_shared.c
77 1.1 christos OBJS += src/ap/beacon.c
78 1.1 christos OBJS_d =
79 1.1 christos OBJS_p =
80 1.1 christos LIBS =
81 1.1 christos LIBS_c =
82 1.1 christos HOBJS =
83 1.1 christos LIBS_h =
84 1.1 christos
85 1.1 christos NEED_RC4=y
86 1.1 christos NEED_AES=y
87 1.1 christos NEED_MD5=y
88 1.1 christos NEED_SHA1=y
89 1.1 christos
90 1.1 christos OBJS += src/drivers/drivers.c
91 1.1 christos L_CFLAGS += -DHOSTAPD
92 1.1 christos
93 1.1 christos ifdef CONFIG_WPA_TRACE
94 1.1 christos L_CFLAGS += -DWPA_TRACE
95 1.1 christos OBJS += src/utils/trace.c
96 1.1 christos HOBJS += src/utils/trace.c
97 1.1 christos LDFLAGS += -rdynamic
98 1.1 christos L_CFLAGS += -funwind-tables
99 1.1 christos ifdef CONFIG_WPA_TRACE_BFD
100 1.1 christos L_CFLAGS += -DWPA_TRACE_BFD
101 1.1 christos LIBS += -lbfd
102 1.1 christos LIBS_c += -lbfd
103 1.1 christos LIBS_h += -lbfd
104 1.1 christos endif
105 1.1 christos endif
106 1.1 christos
107 1.1 christos OBJS += src/utils/eloop.c
108 1.1 christos OBJS += src/utils/common.c
109 1.1 christos OBJS += src/utils/wpa_debug.c
110 1.1 christos OBJS += src/utils/wpabuf.c
111 1.1 christos OBJS += src/utils/os_$(CONFIG_OS).c
112 1.1 christos OBJS += src/utils/ip_addr.c
113 1.1 christos
114 1.1 christos OBJS += src/common/ieee802_11_common.c
115 1.1 christos OBJS += src/common/wpa_common.c
116 1.1 christos
117 1.1 christos OBJS += src/eapol_auth/eapol_auth_sm.c
118 1.1 christos
119 1.1 christos
120 1.1 christos ifndef CONFIG_NO_DUMP_STATE
121 1.1 christos # define HOSTAPD_DUMP_STATE to include SIGUSR1 handler for dumping state to
122 1.1 christos # a file (undefine it, if you want to save in binary size)
123 1.1 christos L_CFLAGS += -DHOSTAPD_DUMP_STATE
124 1.1 christos OBJS += dump_state.c
125 1.1 christos OBJS += src/eapol_auth/eapol_auth_dump.c
126 1.1 christos endif
127 1.1 christos
128 1.1 christos ifdef CONFIG_NO_RADIUS
129 1.1 christos L_CFLAGS += -DCONFIG_NO_RADIUS
130 1.1 christos CONFIG_NO_ACCOUNTING=y
131 1.1 christos else
132 1.1 christos OBJS += src/radius/radius.c
133 1.1 christos OBJS += src/radius/radius_client.c
134 1.1 christos endif
135 1.1 christos
136 1.1 christos ifdef CONFIG_NO_ACCOUNTING
137 1.1 christos L_CFLAGS += -DCONFIG_NO_ACCOUNTING
138 1.1 christos else
139 1.1 christos OBJS += src/ap/accounting.c
140 1.1 christos endif
141 1.1 christos
142 1.1 christos ifdef CONFIG_NO_VLAN
143 1.1 christos L_CFLAGS += -DCONFIG_NO_VLAN
144 1.1 christos else
145 1.1 christos OBJS += src/ap/vlan_init.c
146 1.1 christos endif
147 1.1 christos
148 1.1 christos ifdef CONFIG_NO_CTRL_IFACE
149 1.1 christos L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
150 1.1 christos else
151 1.1 christos OBJS += ctrl_iface.c
152 1.1 christos OBJS += src/ap/ctrl_iface_ap.c
153 1.1 christos endif
154 1.1 christos
155 1.1 christos OBJS += src/crypto/md5.c
156 1.1 christos
157 1.1 christos L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
158 1.1 christos
159 1.1 christos ifdef CONFIG_IAPP
160 1.1 christos L_CFLAGS += -DCONFIG_IAPP
161 1.1 christos OBJS += src/ap/iapp.c
162 1.1 christos endif
163 1.1 christos
164 1.1 christos ifdef CONFIG_RSN_PREAUTH
165 1.1 christos L_CFLAGS += -DCONFIG_RSN_PREAUTH
166 1.1 christos CONFIG_L2_PACKET=y
167 1.1 christos endif
168 1.1 christos
169 1.1 christos ifdef CONFIG_PEERKEY
170 1.1 christos L_CFLAGS += -DCONFIG_PEERKEY
171 1.1 christos OBJS += src/ap/peerkey_auth.c
172 1.1 christos endif
173 1.1 christos
174 1.1 christos ifdef CONFIG_IEEE80211W
175 1.1 christos L_CFLAGS += -DCONFIG_IEEE80211W
176 1.1 christos NEED_SHA256=y
177 1.1 christos NEED_AES_OMAC1=y
178 1.1 christos endif
179 1.1 christos
180 1.1 christos ifdef CONFIG_IEEE80211R
181 1.1 christos L_CFLAGS += -DCONFIG_IEEE80211R
182 1.1 christos OBJS += src/ap/wpa_auth_ft.c
183 1.1 christos NEED_SHA256=y
184 1.1 christos NEED_AES_OMAC1=y
185 1.1 christos NEED_AES_UNWRAP=y
186 1.1 christos endif
187 1.1 christos
188 1.1 christos ifdef CONFIG_IEEE80211N
189 1.1 christos L_CFLAGS += -DCONFIG_IEEE80211N
190 1.1 christos endif
191 1.1 christos
192 1.1 christos include $(LOCAL_PATH)/src/drivers/drivers.mk
193 1.1 christos
194 1.1 christos OBJS += $(DRV_AP_OBJS)
195 1.1 christos L_CFLAGS += $(DRV_AP_CFLAGS)
196 1.1 christos LDFLAGS += $(DRV_AP_LDFLAGS)
197 1.1 christos LIBS += $(DRV_AP_LIBS)
198 1.1 christos
199 1.1 christos ifdef CONFIG_L2_PACKET
200 1.1 christos ifdef CONFIG_DNET_PCAP
201 1.1 christos ifdef CONFIG_L2_FREEBSD
202 1.1 christos LIBS += -lpcap
203 1.1 christos OBJS += src/l2_packet/l2_packet_freebsd.c
204 1.1 christos else
205 1.1 christos LIBS += -ldnet -lpcap
206 1.1 christos OBJS += src/l2_packet/l2_packet_pcap.c
207 1.1 christos endif
208 1.1 christos else
209 1.1 christos OBJS += src/l2_packet/l2_packet_linux.c
210 1.1 christos endif
211 1.1 christos else
212 1.1 christos OBJS += src/l2_packet/l2_packet_none.c
213 1.1 christos endif
214 1.1 christos
215 1.1 christos
216 1.1 christos ifdef CONFIG_EAP_MD5
217 1.1 christos L_CFLAGS += -DEAP_SERVER_MD5
218 1.1 christos OBJS += src/eap_server/eap_server_md5.c
219 1.1 christos CHAP=y
220 1.1 christos endif
221 1.1 christos
222 1.1 christos ifdef CONFIG_EAP_TLS
223 1.1 christos L_CFLAGS += -DEAP_SERVER_TLS
224 1.1 christos OBJS += src/eap_server/eap_server_tls.c
225 1.1 christos TLS_FUNCS=y
226 1.1 christos endif
227 1.1 christos
228 1.1 christos ifdef CONFIG_EAP_PEAP
229 1.1 christos L_CFLAGS += -DEAP_SERVER_PEAP
230 1.1 christos OBJS += src/eap_server/eap_server_peap.c
231 1.1 christos OBJS += src/eap_common/eap_peap_common.c
232 1.1 christos TLS_FUNCS=y
233 1.1 christos CONFIG_EAP_MSCHAPV2=y
234 1.1 christos endif
235 1.1 christos
236 1.1 christos ifdef CONFIG_EAP_TTLS
237 1.1 christos L_CFLAGS += -DEAP_SERVER_TTLS
238 1.1 christos OBJS += src/eap_server/eap_server_ttls.c
239 1.1 christos TLS_FUNCS=y
240 1.1 christos CHAP=y
241 1.1 christos endif
242 1.1 christos
243 1.1 christos ifdef CONFIG_EAP_MSCHAPV2
244 1.1 christos L_CFLAGS += -DEAP_SERVER_MSCHAPV2
245 1.1 christos OBJS += src/eap_server/eap_server_mschapv2.c
246 1.1 christos MS_FUNCS=y
247 1.1 christos endif
248 1.1 christos
249 1.1 christos ifdef CONFIG_EAP_GTC
250 1.1 christos L_CFLAGS += -DEAP_SERVER_GTC
251 1.1 christos OBJS += src/eap_server/eap_server_gtc.c
252 1.1 christos endif
253 1.1 christos
254 1.1 christos ifdef CONFIG_EAP_SIM
255 1.1 christos L_CFLAGS += -DEAP_SERVER_SIM
256 1.1 christos OBJS += src/eap_server/eap_server_sim.c
257 1.1 christos CONFIG_EAP_SIM_COMMON=y
258 1.1 christos NEED_AES_CBC=y
259 1.1 christos endif
260 1.1 christos
261 1.1 christos ifdef CONFIG_EAP_AKA
262 1.1 christos L_CFLAGS += -DEAP_SERVER_AKA
263 1.1 christos OBJS += src/eap_server/eap_server_aka.c
264 1.1 christos CONFIG_EAP_SIM_COMMON=y
265 1.1 christos NEED_SHA256=y
266 1.1 christos NEED_AES_CBC=y
267 1.1 christos endif
268 1.1 christos
269 1.1 christos ifdef CONFIG_EAP_AKA_PRIME
270 1.1 christos L_CFLAGS += -DEAP_SERVER_AKA_PRIME
271 1.1 christos endif
272 1.1 christos
273 1.1 christos ifdef CONFIG_EAP_SIM_COMMON
274 1.1 christos OBJS += src/eap_common/eap_sim_common.c
275 1.1 christos # Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
276 1.1 christos # replaced with another file implementating the interface specified in
277 1.1 christos # eap_sim_db.h.
278 1.1 christos OBJS += src/eap_server/eap_sim_db.c
279 1.1 christos NEED_FIPS186_2_PRF=y
280 1.1 christos endif
281 1.1 christos
282 1.1 christos ifdef CONFIG_EAP_PAX
283 1.1 christos L_CFLAGS += -DEAP_SERVER_PAX
284 1.1 christos OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
285 1.1 christos endif
286 1.1 christos
287 1.1 christos ifdef CONFIG_EAP_PSK
288 1.1 christos L_CFLAGS += -DEAP_SERVER_PSK
289 1.1 christos OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
290 1.1 christos NEED_AES_OMAC1=y
291 1.1 christos NEED_AES_ENCBLOCK=y
292 1.1 christos NEED_AES_EAX=y
293 1.1 christos endif
294 1.1 christos
295 1.1 christos ifdef CONFIG_EAP_SAKE
296 1.1 christos L_CFLAGS += -DEAP_SERVER_SAKE
297 1.1 christos OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
298 1.1 christos endif
299 1.1 christos
300 1.1 christos ifdef CONFIG_EAP_GPSK
301 1.1 christos L_CFLAGS += -DEAP_SERVER_GPSK
302 1.1 christos OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
303 1.1 christos ifdef CONFIG_EAP_GPSK_SHA256
304 1.1 christos L_CFLAGS += -DEAP_SERVER_GPSK_SHA256
305 1.1 christos endif
306 1.1 christos NEED_SHA256=y
307 1.1 christos NEED_AES_OMAC1=y
308 1.1 christos endif
309 1.1 christos
310 1.1 christos ifdef CONFIG_EAP_PWD
311 1.1 christos L_CFLAGS += -DEAP_SERVER_PWD
312 1.1 christos OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
313 1.1 christos NEED_SHA256=y
314 1.1 christos endif
315 1.1 christos
316 1.1 christos ifdef CONFIG_EAP_VENDOR_TEST
317 1.1 christos L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
318 1.1 christos OBJS += src/eap_server/eap_server_vendor_test.c
319 1.1 christos endif
320 1.1 christos
321 1.1 christos ifdef CONFIG_EAP_FAST
322 1.1 christos L_CFLAGS += -DEAP_SERVER_FAST
323 1.1 christos OBJS += src/eap_server/eap_server_fast.c
324 1.1 christos OBJS += src/eap_common/eap_fast_common.c
325 1.1 christos TLS_FUNCS=y
326 1.1 christos NEED_T_PRF=y
327 1.1 christos NEED_AES_UNWRAP=y
328 1.1 christos endif
329 1.1 christos
330 1.1 christos ifdef CONFIG_WPS
331 1.1 christos ifdef CONFIG_WPS2
332 1.1 christos L_CFLAGS += -DCONFIG_WPS2
333 1.1 christos endif
334 1.1 christos
335 1.1 christos L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
336 1.1 christos OBJS += src/utils/uuid.c
337 1.1 christos OBJS += src/ap/wps_hostapd.c
338 1.1 christos OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
339 1.1 christos OBJS += src/wps/wps.c
340 1.1 christos OBJS += src/wps/wps_common.c
341 1.1 christos OBJS += src/wps/wps_attr_parse.c
342 1.1 christos OBJS += src/wps/wps_attr_build.c
343 1.1 christos OBJS += src/wps/wps_attr_process.c
344 1.1 christos OBJS += src/wps/wps_dev_attr.c
345 1.1 christos OBJS += src/wps/wps_enrollee.c
346 1.1 christos OBJS += src/wps/wps_registrar.c
347 1.1 christos NEED_DH_GROUPS=y
348 1.1 christos NEED_SHA256=y
349 1.1 christos NEED_BASE64=y
350 1.1 christos NEED_AES_CBC=y
351 1.1 christos NEED_MODEXP=y
352 1.1 christos CONFIG_EAP=y
353 1.1 christos
354 1.1 christos ifdef CONFIG_WPS_UFD
355 1.1 christos L_CFLAGS += -DCONFIG_WPS_UFD
356 1.1 christos OBJS += src/wps/wps_ufd.c
357 1.1 christos NEED_WPS_OOB=y
358 1.1 christos endif
359 1.1 christos
360 1.1 christos ifdef CONFIG_WPS_NFC
361 1.1 christos L_CFLAGS += -DCONFIG_WPS_NFC
362 1.1 christos OBJS += src/wps/ndef.c
363 1.1 christos OBJS += src/wps/wps_nfc.c
364 1.1 christos NEED_WPS_OOB=y
365 1.1 christos ifdef CONFIG_WPS_NFC_PN531
366 1.1 christos PN531_PATH ?= /usr/local/src/nfc
367 1.1 christos L_CFLAGS += -DCONFIG_WPS_NFC_PN531
368 1.1 christos L_CFLAGS += -I${PN531_PATH}/inc
369 1.1 christos OBJS += src/wps/wps_nfc_pn531.c
370 1.1 christos LIBS += ${PN531_PATH}/lib/wpsnfc.dll
371 1.1 christos LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
372 1.1 christos endif
373 1.1 christos endif
374 1.1 christos
375 1.1 christos ifdef NEED_WPS_OOB
376 1.1 christos L_CFLAGS += -DCONFIG_WPS_OOB
377 1.1 christos endif
378 1.1 christos
379 1.1 christos ifdef CONFIG_WPS_UPNP
380 1.1 christos L_CFLAGS += -DCONFIG_WPS_UPNP
381 1.1 christos OBJS += src/wps/wps_upnp.c
382 1.1 christos OBJS += src/wps/wps_upnp_ssdp.c
383 1.1 christos OBJS += src/wps/wps_upnp_web.c
384 1.1 christos OBJS += src/wps/wps_upnp_event.c
385 1.1 christos OBJS += src/wps/wps_upnp_ap.c
386 1.1 christos OBJS += src/wps/upnp_xml.c
387 1.1 christos OBJS += src/wps/httpread.c
388 1.1 christos OBJS += src/wps/http_client.c
389 1.1 christos OBJS += src/wps/http_server.c
390 1.1 christos endif
391 1.1 christos
392 1.1 christos ifdef CONFIG_WPS_STRICT
393 1.1 christos L_CFLAGS += -DCONFIG_WPS_STRICT
394 1.1 christos OBJS += src/wps/wps_validate.c
395 1.1 christos endif
396 1.1 christos
397 1.1 christos ifdef CONFIG_WPS_TESTING
398 1.1 christos L_CFLAGS += -DCONFIG_WPS_TESTING
399 1.1 christos endif
400 1.1 christos
401 1.1 christos endif
402 1.1 christos
403 1.1 christos ifdef CONFIG_EAP_IKEV2
404 1.1 christos L_CFLAGS += -DEAP_SERVER_IKEV2
405 1.1 christos OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
406 1.1 christos OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
407 1.1 christos NEED_DH_GROUPS=y
408 1.1 christos NEED_DH_GROUPS_ALL=y
409 1.1 christos NEED_MODEXP=y
410 1.1 christos NEED_CIPHER=y
411 1.1 christos endif
412 1.1 christos
413 1.1 christos ifdef CONFIG_EAP_TNC
414 1.1 christos L_CFLAGS += -DEAP_SERVER_TNC
415 1.1 christos OBJS += src/eap_server/eap_server_tnc.c
416 1.1 christos OBJS += src/eap_server/tncs.c
417 1.1 christos NEED_BASE64=y
418 1.1 christos ifndef CONFIG_DRIVER_BSD
419 1.1 christos LIBS += -ldl
420 1.1 christos endif
421 1.1 christos endif
422 1.1 christos
423 1.1 christos # Basic EAP functionality is needed for EAPOL
424 1.1 christos OBJS += eap_register.c
425 1.1 christos OBJS += src/eap_server/eap_server.c
426 1.1 christos OBJS += src/eap_common/eap_common.c
427 1.1 christos OBJS += src/eap_server/eap_server_methods.c
428 1.1 christos OBJS += src/eap_server/eap_server_identity.c
429 1.1 christos L_CFLAGS += -DEAP_SERVER_IDENTITY
430 1.1 christos
431 1.1 christos ifdef CONFIG_EAP
432 1.1 christos L_CFLAGS += -DEAP_SERVER
433 1.1 christos endif
434 1.1 christos
435 1.1 christos ifdef CONFIG_PKCS12
436 1.1 christos L_CFLAGS += -DPKCS12_FUNCS
437 1.1 christos endif
438 1.1 christos
439 1.1 christos ifdef MS_FUNCS
440 1.1 christos OBJS += src/crypto/ms_funcs.c
441 1.1 christos NEED_DES=y
442 1.1 christos NEED_MD4=y
443 1.1 christos endif
444 1.1 christos
445 1.1 christos ifdef CHAP
446 1.1 christos OBJS += src/eap_common/chap.c
447 1.1 christos endif
448 1.1 christos
449 1.1 christos ifdef TLS_FUNCS
450 1.1 christos NEED_DES=y
451 1.1 christos # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
452 1.1 christos L_CFLAGS += -DEAP_TLS_FUNCS
453 1.1 christos OBJS += src/eap_server/eap_server_tls_common.c
454 1.1 christos NEED_TLS_PRF=y
455 1.1 christos endif
456 1.1 christos
457 1.1 christos ifndef CONFIG_TLS
458 1.1 christos CONFIG_TLS=openssl
459 1.1 christos endif
460 1.1 christos
461 1.1 christos ifeq ($(CONFIG_TLS), openssl)
462 1.1 christos ifdef TLS_FUNCS
463 1.1 christos OBJS += src/crypto/tls_openssl.c
464 1.1 christos LIBS += -lssl
465 1.1 christos endif
466 1.1 christos OBJS += src/crypto/crypto_openssl.c
467 1.1 christos HOBJS += src/crypto/crypto_openssl.c
468 1.1 christos ifdef NEED_FIPS186_2_PRF
469 1.1 christos OBJS += src/crypto/fips_prf_openssl.c
470 1.1 christos endif
471 1.1 christos LIBS += -lcrypto
472 1.1 christos LIBS_h += -lcrypto
473 1.1 christos endif
474 1.1 christos
475 1.1 christos ifeq ($(CONFIG_TLS), gnutls)
476 1.1 christos ifdef TLS_FUNCS
477 1.1 christos OBJS += src/crypto/tls_gnutls.c
478 1.1 christos LIBS += -lgnutls -lgpg-error
479 1.1 christos ifdef CONFIG_GNUTLS_EXTRA
480 1.1 christos L_CFLAGS += -DCONFIG_GNUTLS_EXTRA
481 1.1 christos LIBS += -lgnutls-extra
482 1.1 christos endif
483 1.1 christos endif
484 1.1 christos OBJS += src/crypto/crypto_gnutls.c
485 1.1 christos HOBJS += src/crypto/crypto_gnutls.c
486 1.1 christos ifdef NEED_FIPS186_2_PRF
487 1.1 christos OBJS += src/crypto/fips_prf_gnutls.c
488 1.1 christos endif
489 1.1 christos LIBS += -lgcrypt
490 1.1 christos LIBS_h += -lgcrypt
491 1.1 christos CONFIG_INTERNAL_SHA256=y
492 1.1 christos CONFIG_INTERNAL_RC4=y
493 1.1 christos CONFIG_INTERNAL_DH_GROUP5=y
494 1.1 christos endif
495 1.1 christos
496 1.1 christos ifeq ($(CONFIG_TLS), schannel)
497 1.1 christos ifdef TLS_FUNCS
498 1.1 christos OBJS += src/crypto/tls_schannel.c
499 1.1 christos endif
500 1.1 christos OBJS += src/crypto/crypto_cryptoapi.c
501 1.1 christos OBJS_p += src/crypto/crypto_cryptoapi.c
502 1.1 christos CONFIG_INTERNAL_SHA256=y
503 1.1 christos CONFIG_INTERNAL_RC4=y
504 1.1 christos CONFIG_INTERNAL_DH_GROUP5=y
505 1.1 christos endif
506 1.1 christos
507 1.1 christos ifeq ($(CONFIG_TLS), nss)
508 1.1 christos ifdef TLS_FUNCS
509 1.1 christos OBJS += src/crypto/tls_nss.c
510 1.1 christos LIBS += -lssl3
511 1.1 christos endif
512 1.1 christos OBJS += src/crypto/crypto_nss.c
513 1.1 christos ifdef NEED_FIPS186_2_PRF
514 1.1 christos OBJS += src/crypto/fips_prf_nss.c
515 1.1 christos endif
516 1.1 christos LIBS += -lnss3
517 1.1 christos LIBS_h += -lnss3
518 1.1 christos CONFIG_INTERNAL_MD4=y
519 1.1 christos CONFIG_INTERNAL_DH_GROUP5=y
520 1.1 christos endif
521 1.1 christos
522 1.1 christos ifeq ($(CONFIG_TLS), internal)
523 1.1 christos ifndef CONFIG_CRYPTO
524 1.1 christos CONFIG_CRYPTO=internal
525 1.1 christos endif
526 1.1 christos ifdef TLS_FUNCS
527 1.1 christos OBJS += src/crypto/crypto_internal-rsa.c
528 1.1 christos OBJS += src/crypto/tls_internal.c
529 1.1 christos OBJS += src/tls/tlsv1_common.c
530 1.1 christos OBJS += src/tls/tlsv1_record.c
531 1.1 christos OBJS += src/tls/tlsv1_cred.c
532 1.1 christos OBJS += src/tls/tlsv1_server.c
533 1.1 christos OBJS += src/tls/tlsv1_server_write.c
534 1.1 christos OBJS += src/tls/tlsv1_server_read.c
535 1.1 christos OBJS += src/tls/asn1.c
536 1.1 christos OBJS += src/tls/rsa.c
537 1.1 christos OBJS += src/tls/x509v3.c
538 1.1 christos OBJS += src/tls/pkcs1.c
539 1.1 christos OBJS += src/tls/pkcs5.c
540 1.1 christos OBJS += src/tls/pkcs8.c
541 1.1 christos NEED_SHA256=y
542 1.1 christos NEED_BASE64=y
543 1.1 christos NEED_TLS_PRF=y
544 1.1 christos NEED_MODEXP=y
545 1.1 christos NEED_CIPHER=y
546 1.1 christos L_CFLAGS += -DCONFIG_TLS_INTERNAL
547 1.1 christos L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
548 1.1 christos endif
549 1.1 christos ifdef NEED_CIPHER
550 1.1 christos NEED_DES=y
551 1.1 christos OBJS += src/crypto/crypto_internal-cipher.c
552 1.1 christos endif
553 1.1 christos ifdef NEED_MODEXP
554 1.1 christos OBJS += src/crypto/crypto_internal-modexp.c
555 1.1 christos OBJS += src/tls/bignum.c
556 1.1 christos endif
557 1.1 christos ifeq ($(CONFIG_CRYPTO), libtomcrypt)
558 1.1 christos OBJS += src/crypto/crypto_libtomcrypt.c
559 1.1 christos LIBS += -ltomcrypt -ltfm
560 1.1 christos LIBS_h += -ltomcrypt -ltfm
561 1.1 christos CONFIG_INTERNAL_SHA256=y
562 1.1 christos CONFIG_INTERNAL_RC4=y
563 1.1 christos CONFIG_INTERNAL_DH_GROUP5=y
564 1.1 christos endif
565 1.1 christos ifeq ($(CONFIG_CRYPTO), internal)
566 1.1 christos OBJS += src/crypto/crypto_internal.c
567 1.1 christos NEED_AES_DEC=y
568 1.1 christos L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
569 1.1 christos ifdef CONFIG_INTERNAL_LIBTOMMATH
570 1.1 christos L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
571 1.1 christos ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
572 1.1 christos L_CFLAGS += -DLTM_FAST
573 1.1 christos endif
574 1.1 christos else
575 1.1 christos LIBS += -ltommath
576 1.1 christos LIBS_h += -ltommath
577 1.1 christos endif
578 1.1 christos CONFIG_INTERNAL_AES=y
579 1.1 christos CONFIG_INTERNAL_DES=y
580 1.1 christos CONFIG_INTERNAL_SHA1=y
581 1.1 christos CONFIG_INTERNAL_MD4=y
582 1.1 christos CONFIG_INTERNAL_MD5=y
583 1.1 christos CONFIG_INTERNAL_SHA256=y
584 1.1 christos CONFIG_INTERNAL_RC4=y
585 1.1 christos CONFIG_INTERNAL_DH_GROUP5=y
586 1.1 christos endif
587 1.1 christos ifeq ($(CONFIG_CRYPTO), cryptoapi)
588 1.1 christos OBJS += src/crypto/crypto_cryptoapi.c
589 1.1 christos OBJS_p += src/crypto/crypto_cryptoapi.c
590 1.1 christos L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
591 1.1 christos CONFIG_INTERNAL_SHA256=y
592 1.1 christos CONFIG_INTERNAL_RC4=y
593 1.1 christos endif
594 1.1 christos endif
595 1.1 christos
596 1.1 christos ifeq ($(CONFIG_TLS), none)
597 1.1 christos ifdef TLS_FUNCS
598 1.1 christos OBJS += src/crypto/tls_none.c
599 1.1 christos L_CFLAGS += -DEAP_TLS_NONE
600 1.1 christos CONFIG_INTERNAL_AES=y
601 1.1 christos CONFIG_INTERNAL_SHA1=y
602 1.1 christos CONFIG_INTERNAL_MD5=y
603 1.1 christos endif
604 1.1 christos OBJS += src/crypto/crypto_none.c
605 1.1 christos OBJS_p += src/crypto/crypto_none.c
606 1.1 christos CONFIG_INTERNAL_SHA256=y
607 1.1 christos CONFIG_INTERNAL_RC4=y
608 1.1 christos endif
609 1.1 christos
610 1.1 christos ifndef TLS_FUNCS
611 1.1 christos OBJS += src/crypto/tls_none.c
612 1.1 christos ifeq ($(CONFIG_TLS), internal)
613 1.1 christos CONFIG_INTERNAL_AES=y
614 1.1 christos CONFIG_INTERNAL_SHA1=y
615 1.1 christos CONFIG_INTERNAL_MD5=y
616 1.1 christos CONFIG_INTERNAL_RC4=y
617 1.1 christos endif
618 1.1 christos endif
619 1.1 christos
620 1.1 christos AESOBJS = # none so far
621 1.1 christos ifdef CONFIG_INTERNAL_AES
622 1.1 christos AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
623 1.1 christos endif
624 1.1 christos
625 1.1 christos AESOBJS += src/crypto/aes-wrap.c
626 1.1 christos ifdef NEED_AES_EAX
627 1.1 christos AESOBJS += src/crypto/aes-eax.c
628 1.1 christos NEED_AES_CTR=y
629 1.1 christos endif
630 1.1 christos ifdef NEED_AES_CTR
631 1.1 christos AESOBJS += src/crypto/aes-ctr.c
632 1.1 christos endif
633 1.1 christos ifdef NEED_AES_ENCBLOCK
634 1.1 christos AESOBJS += src/crypto/aes-encblock.c
635 1.1 christos endif
636 1.1 christos ifdef NEED_AES_OMAC1
637 1.1 christos AESOBJS += src/crypto/aes-omac1.c
638 1.1 christos endif
639 1.1 christos ifdef NEED_AES_UNWRAP
640 1.1 christos NEED_AES_DEC=y
641 1.1 christos AESOBJS += src/crypto/aes-unwrap.c
642 1.1 christos endif
643 1.1 christos ifdef NEED_AES_CBC
644 1.1 christos NEED_AES_DEC=y
645 1.1 christos AESOBJS += src/crypto/aes-cbc.c
646 1.1 christos endif
647 1.1 christos ifdef NEED_AES_DEC
648 1.1 christos ifdef CONFIG_INTERNAL_AES
649 1.1 christos AESOBJS += src/crypto/aes-internal-dec.c
650 1.1 christos endif
651 1.1 christos endif
652 1.1 christos ifdef NEED_AES
653 1.1 christos OBJS += $(AESOBJS)
654 1.1 christos endif
655 1.1 christos
656 1.1 christos SHA1OBJS =
657 1.1 christos ifdef NEED_SHA1
658 1.1 christos SHA1OBJS += src/crypto/sha1.c
659 1.1 christos ifdef CONFIG_INTERNAL_SHA1
660 1.1 christos SHA1OBJS += src/crypto/sha1-internal.c
661 1.1 christos ifdef NEED_FIPS186_2_PRF
662 1.1 christos SHA1OBJS += src/crypto/fips_prf_internal.c
663 1.1 christos endif
664 1.1 christos endif
665 1.1 christos SHA1OBJS += src/crypto/sha1-pbkdf2.c
666 1.1 christos ifdef NEED_T_PRF
667 1.1 christos SHA1OBJS += src/crypto/sha1-tprf.c
668 1.1 christos endif
669 1.1 christos ifdef NEED_TLS_PRF
670 1.1 christos SHA1OBJS += src/crypto/sha1-tlsprf.c
671 1.1 christos endif
672 1.1 christos endif
673 1.1 christos
674 1.1 christos ifdef NEED_SHA1
675 1.1 christos OBJS += $(SHA1OBJS)
676 1.1 christos endif
677 1.1 christos
678 1.1 christos ifdef NEED_MD5
679 1.1 christos ifdef CONFIG_INTERNAL_MD5
680 1.1 christos OBJS += src/crypto/md5-internal.c
681 1.1 christos HOBJS += src/crypto/md5-internal.c
682 1.1 christos endif
683 1.1 christos endif
684 1.1 christos
685 1.1 christos ifdef NEED_MD4
686 1.1 christos ifdef CONFIG_INTERNAL_MD4
687 1.1 christos OBJS += src/crypto/md4-internal.c
688 1.1 christos endif
689 1.1 christos endif
690 1.1 christos
691 1.1 christos ifdef NEED_DES
692 1.1 christos ifdef CONFIG_INTERNAL_DES
693 1.1 christos OBJS += src/crypto/des-internal.c
694 1.1 christos endif
695 1.1 christos endif
696 1.1 christos
697 1.1 christos ifdef NEED_RC4
698 1.1 christos ifdef CONFIG_INTERNAL_RC4
699 1.1 christos OBJS += src/crypto/rc4.c
700 1.1 christos endif
701 1.1 christos endif
702 1.1 christos
703 1.1 christos ifdef NEED_SHA256
704 1.1 christos OBJS += src/crypto/sha256.c
705 1.1 christos ifdef CONFIG_INTERNAL_SHA256
706 1.1 christos OBJS += src/crypto/sha256-internal.c
707 1.1 christos endif
708 1.1 christos endif
709 1.1 christos
710 1.1 christos ifdef NEED_DH_GROUPS
711 1.1 christos OBJS += src/crypto/dh_groups.c
712 1.1 christos endif
713 1.1 christos ifdef NEED_DH_GROUPS_ALL
714 1.1 christos L_CFLAGS += -DALL_DH_GROUPS
715 1.1 christos endif
716 1.1 christos ifdef CONFIG_INTERNAL_DH_GROUP5
717 1.1 christos ifdef NEED_DH_GROUPS
718 1.1 christos OBJS += src/crypto/dh_group5.c
719 1.1 christos endif
720 1.1 christos endif
721 1.1 christos
722 1.1 christos ifdef CONFIG_NO_RANDOM_POOL
723 1.1 christos L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
724 1.1 christos else
725 1.1 christos OBJS += src/crypto/random.c
726 1.1 christos HOBJS += src/crypto/random.c
727 1.1 christos HOBJS += $(SHA1OBJS)
728 1.1 christos HOBJS += src/crypto/md5.c
729 1.1 christos endif
730 1.1 christos
731 1.1 christos ifdef CONFIG_RADIUS_SERVER
732 1.1 christos L_CFLAGS += -DRADIUS_SERVER
733 1.1 christos OBJS += src/radius/radius_server.c
734 1.1 christos endif
735 1.1 christos
736 1.1 christos ifdef CONFIG_IPV6
737 1.1 christos L_CFLAGS += -DCONFIG_IPV6
738 1.1 christos endif
739 1.1 christos
740 1.1 christos ifdef CONFIG_DRIVER_RADIUS_ACL
741 1.1 christos L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
742 1.1 christos endif
743 1.1 christos
744 1.1 christos ifdef CONFIG_FULL_DYNAMIC_VLAN
745 1.1 christos # define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
746 1.1 christos # and vlan interfaces for the vlan feature.
747 1.1 christos L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
748 1.1 christos endif
749 1.1 christos
750 1.1 christos ifdef NEED_BASE64
751 1.1 christos OBJS += src/utils/base64.c
752 1.1 christos endif
753 1.1 christos
754 1.1 christos ifdef NEED_AP_MLME
755 1.1 christos OBJS += src/ap/wmm.c
756 1.1 christos OBJS += src/ap/ap_list.c
757 1.1 christos OBJS += src/ap/ieee802_11.c
758 1.1 christos OBJS += src/ap/hw_features.c
759 1.1 christos L_CFLAGS += -DNEED_AP_MLME
760 1.1 christos endif
761 1.1 christos ifdef CONFIG_IEEE80211N
762 1.1 christos OBJS += src/ap/ieee802_11_ht.c
763 1.1 christos endif
764 1.1 christos
765 1.1 christos ifdef CONFIG_P2P_MANAGER
766 1.1 christos L_CFLAGS += -DCONFIG_P2P_MANAGER
767 1.1 christos OBJS += src/ap/p2p_hostapd.c
768 1.1 christos endif
769 1.1 christos
770 1.1 christos OBJS += src/drivers/driver_common.c
771 1.1 christos
772 1.1 christos ifdef CONFIG_NO_STDOUT_DEBUG
773 1.1 christos L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
774 1.1 christos endif
775 1.1 christos
776 1.1 christos ifdef CONFIG_DEBUG_FILE
777 1.1 christos L_CFLAGS += -DCONFIG_DEBUG_FILE
778 1.1 christos endif
779 1.1 christos
780 1.1 christos ifdef CONFIG_ANDROID_LOG
781 1.1 christos L_CFLAGS += -DCONFIG_ANDROID_LOG
782 1.1 christos endif
783 1.1 christos
784 1.1 christos OBJS_c = hostapd_cli.c src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
785 1.1 christos OBJS_c += src/utils/eloop.c
786 1.1 christos ifdef CONFIG_WPA_TRACE
787 1.1 christos OBJS_c += src/utils/trace.c
788 1.1 christos endif
789 1.1 christos OBJS_c += src/utils/wpa_debug.c
790 1.1 christos ifdef CONFIG_WPA_CLI_EDIT
791 1.1 christos OBJS_c += src/utils/edit.c
792 1.1 christos else
793 1.1 christos OBJS_c += src/utils/edit_simple.c
794 1.1 christos endif
795 1.1 christos
796 1.1 christos ifeq ($(WPA_BUILD_HOSTAPD),true)
797 1.1 christos
798 1.1 christos ########################
799 1.1 christos
800 1.1 christos include $(CLEAR_VARS)
801 1.1 christos LOCAL_MODULE := hostapd_cli
802 1.1 christos LOCAL_MODULE_TAGS := debug
803 1.1 christos LOCAL_SHARED_LIBRARIES := libc libcutils
804 1.1 christos LOCAL_CFLAGS := $(L_CFLAGS)
805 1.1 christos LOCAL_SRC_FILES := $(OBJS_c)
806 1.1 christos LOCAL_C_INCLUDES := $(INCLUDES)
807 1.1 christos include $(BUILD_EXECUTABLE)
808 1.1 christos
809 1.1 christos ########################
810 1.1 christos include $(CLEAR_VARS)
811 1.1 christos LOCAL_MODULE := hostapd
812 1.1 christos LOCAL_MODULE_TAGS := optional
813 1.1 christos ifdef CONFIG_DRIVER_CUSTOM
814 1.1 christos LOCAL_STATIC_LIBRARIES := libCustomWifi
815 1.1 christos endif
816 1.1 christos ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
817 1.1 christos LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
818 1.1 christos endif
819 1.1 christos LOCAL_SHARED_LIBRARIES := libc libcutils libcrypto libssl
820 1.1 christos ifdef CONFIG_DRIVER_NL80211
821 1.1 christos LOCAL_STATIC_LIBRARIES += libnl_2
822 1.1 christos endif
823 1.1 christos LOCAL_CFLAGS := $(L_CFLAGS)
824 1.1 christos LOCAL_SRC_FILES := $(OBJS)
825 1.1 christos LOCAL_C_INCLUDES := $(INCLUDES)
826 1.1 christos include $(BUILD_EXECUTABLE)
827 1.1 christos
828 1.1 christos endif # ifeq ($(WPA_BUILD_HOSTAPD),true)
829