xref: /freebsd/contrib/wpa/wpa_supplicant/Android.mk (revision 6683132d54bd6d589889e43dabdc53d35e38a028)
1#
2# Copyright (C) 2008 The Android Open Source Project
3#
4# This software may be distributed under the terms of the BSD license.
5# See README for more details.
6#
7
8LOCAL_PATH := $(call my-dir)
9PKG_CONFIG ?= pkg-config
10
11ifneq ($(BOARD_WPA_SUPPLICANT_DRIVER),)
12  CONFIG_DRIVER_$(BOARD_WPA_SUPPLICANT_DRIVER) := y
13endif
14
15include $(LOCAL_PATH)/android.config
16
17# To ignore possible wrong network configurations
18L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
19
20L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
21
22# Set Android log name
23L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
24
25# Disable unused parameter warnings
26L_CFLAGS += -Wno-unused-parameter
27
28# Set Android extended P2P functionality
29L_CFLAGS += -DANDROID_P2P
30
31ifeq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
32L_CFLAGS += -DANDROID_LIB_STUB
33endif
34
35# Disable roaming in wpa_supplicant
36ifdef CONFIG_NO_ROAMING
37L_CFLAGS += -DCONFIG_NO_ROAMING
38endif
39
40# Use Android specific directory for control interface sockets
41L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
42L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/misc/wifi/sockets\"
43
44# Use Android specific directory for wpa_cli command completion history
45L_CFLAGS += -DCONFIG_WPA_CLI_HISTORY_DIR=\"/data/misc/wifi\"
46
47# To force sizeof(enum) = 4
48ifeq ($(TARGET_ARCH),arm)
49L_CFLAGS += -mabi=aapcs-linux
50endif
51
52# C++ flags for binder interface
53L_CPPFLAGS := -std=c++11 -Wall -Werror
54# TODO: Remove these allowed warnings later.
55L_CPPFLAGS += -Wno-unused-variable -Wno-unused-parameter
56L_CPPFLAGS += -Wno-unused-private-field
57
58INCLUDES = $(LOCAL_PATH)
59INCLUDES += $(LOCAL_PATH)/src
60INCLUDES += $(LOCAL_PATH)/src/common
61# INCLUDES += $(LOCAL_PATH)/src/crypto # To force proper includes
62INCLUDES += $(LOCAL_PATH)/src/drivers
63INCLUDES += $(LOCAL_PATH)/src/eap_common
64INCLUDES += $(LOCAL_PATH)/src/eapol_supp
65INCLUDES += $(LOCAL_PATH)/src/eap_peer
66INCLUDES += $(LOCAL_PATH)/src/eap_server
67INCLUDES += $(LOCAL_PATH)/src/hlr_auc_gw
68INCLUDES += $(LOCAL_PATH)/src/l2_packet
69INCLUDES += $(LOCAL_PATH)/src/radius
70INCLUDES += $(LOCAL_PATH)/src/rsn_supp
71INCLUDES += $(LOCAL_PATH)/src/tls
72INCLUDES += $(LOCAL_PATH)/src/utils
73INCLUDES += $(LOCAL_PATH)/src/wps
74INCLUDES += system/security/keystore/include
75ifdef CONFIG_DRIVER_NL80211
76ifneq ($(wildcard external/libnl),)
77INCLUDES += external/libnl/include
78else
79INCLUDES += external/libnl-headers
80endif
81endif
82
83ifdef CONFIG_FIPS
84CONFIG_NO_RANDOM_POOL=
85CONFIG_OPENSSL_CMAC=y
86endif
87
88OBJS = config.c
89OBJS += notify.c
90OBJS += bss.c
91OBJS += eap_register.c
92OBJS += src/utils/common.c
93OBJS += src/utils/wpa_debug.c
94OBJS += src/utils/wpabuf.c
95OBJS += src/utils/bitfield.c
96OBJS += wmm_ac.c
97OBJS += op_classes.c
98OBJS += rrm.c
99OBJS_p = wpa_passphrase.c
100OBJS_p += src/utils/common.c
101OBJS_p += src/utils/wpa_debug.c
102OBJS_p += src/utils/wpabuf.c
103OBJS_c = wpa_cli.c src/common/wpa_ctrl.c
104OBJS_c += src/utils/wpa_debug.c
105OBJS_c += src/utils/common.c
106OBJS_c += src/common/cli.c
107OBJS_d =
108OBJS_priv =
109
110ifndef CONFIG_OS
111ifdef CONFIG_NATIVE_WINDOWS
112CONFIG_OS=win32
113else
114CONFIG_OS=unix
115endif
116endif
117
118ifeq ($(CONFIG_OS), internal)
119L_CFLAGS += -DOS_NO_C_LIB_DEFINES
120endif
121
122OBJS += src/utils/os_$(CONFIG_OS).c
123OBJS_p += src/utils/os_$(CONFIG_OS).c
124OBJS_c += src/utils/os_$(CONFIG_OS).c
125
126ifdef CONFIG_WPA_TRACE
127L_CFLAGS += -DWPA_TRACE
128OBJS += src/utils/trace.c
129OBJS_p += src/utils/trace.c
130OBJS_c += src/utils/trace.c
131LDFLAGS += -rdynamic
132L_CFLAGS += -funwind-tables
133ifdef CONFIG_WPA_TRACE_BFD
134L_CFLAGS += -DWPA_TRACE_BFD
135LIBS += -lbfd
136LIBS_p += -lbfd
137LIBS_c += -lbfd
138endif
139endif
140
141ifndef CONFIG_ELOOP
142CONFIG_ELOOP=eloop
143endif
144OBJS += src/utils/$(CONFIG_ELOOP).c
145OBJS_c += src/utils/$(CONFIG_ELOOP).c
146
147ifdef CONFIG_ELOOP_POLL
148L_CFLAGS += -DCONFIG_ELOOP_POLL
149endif
150
151ifdef CONFIG_ELOOP_EPOLL
152L_CFLAGS += -DCONFIG_ELOOP_EPOLL
153endif
154
155ifdef CONFIG_EAPOL_TEST
156L_CFLAGS += -Werror -DEAPOL_TEST
157endif
158
159ifdef CONFIG_HT_OVERRIDES
160L_CFLAGS += -DCONFIG_HT_OVERRIDES
161endif
162
163ifdef CONFIG_VHT_OVERRIDES
164L_CFLAGS += -DCONFIG_VHT_OVERRIDES
165endif
166
167ifndef CONFIG_BACKEND
168CONFIG_BACKEND=file
169endif
170
171ifeq ($(CONFIG_BACKEND), file)
172OBJS += config_file.c
173ifndef CONFIG_NO_CONFIG_BLOBS
174NEED_BASE64=y
175endif
176L_CFLAGS += -DCONFIG_BACKEND_FILE
177endif
178
179ifeq ($(CONFIG_BACKEND), winreg)
180OBJS += config_winreg.c
181endif
182
183ifeq ($(CONFIG_BACKEND), none)
184OBJS += config_none.c
185endif
186
187ifdef CONFIG_NO_CONFIG_WRITE
188L_CFLAGS += -DCONFIG_NO_CONFIG_WRITE
189endif
190
191ifdef CONFIG_NO_CONFIG_BLOBS
192L_CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
193endif
194
195ifdef CONFIG_NO_SCAN_PROCESSING
196L_CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
197endif
198
199ifdef CONFIG_SUITEB
200L_CFLAGS += -DCONFIG_SUITEB
201NEED_SHA256=y
202NEED_AES_OMAC1=y
203endif
204
205ifdef CONFIG_SUITEB192
206L_CFLAGS += -DCONFIG_SUITEB192
207NEED_SHA384=y
208endif
209
210ifdef CONFIG_OCV
211L_CFLAGS += -DCONFIG_OCV
212OBJS += src/common/ocv.c
213CONFIG_IEEE80211W=y
214endif
215
216ifdef CONFIG_IEEE80211W
217L_CFLAGS += -DCONFIG_IEEE80211W
218NEED_SHA256=y
219NEED_AES_OMAC1=y
220endif
221
222ifdef CONFIG_IEEE80211R
223L_CFLAGS += -DCONFIG_IEEE80211R
224OBJS += src/rsn_supp/wpa_ft.c
225NEED_SHA256=y
226NEED_AES_OMAC1=y
227endif
228
229ifdef CONFIG_MESH
230NEED_80211_COMMON=y
231NEED_SHA256=y
232NEED_AES_SIV=y
233CONFIG_SAE=y
234CONFIG_AP=y
235L_CFLAGS += -DCONFIG_MESH
236OBJS += mesh.c
237OBJS += mesh_mpm.c
238OBJS += mesh_rsn.c
239endif
240
241ifdef CONFIG_SAE
242L_CFLAGS += -DCONFIG_SAE
243OBJS += src/common/sae.c
244NEED_ECC=y
245NEED_DH_GROUPS=y
246endif
247
248ifdef CONFIG_DPP
249L_CFLAGS += -DCONFIG_DPP
250OBJS += src/common/dpp.c
251OBJS += dpp_supplicant.c
252NEED_AES_SIV=y
253NEED_HMAC_SHA256_KDF=y
254NEED_HMAC_SHA384_KDF=y
255NEED_HMAC_SHA512_KDF=y
256NEED_SHA256=y
257NEED_SHA384=y
258NEED_SHA512=y
259NEED_JSON=y
260NEED_GAS_SERVER=y
261NEED_BASE64=y
262ifdef CONFIG_DPP2
263L_CFLAGS += -DCONFIG_DPP2
264endif
265endif
266
267ifdef CONFIG_OWE
268L_CFLAGS += -DCONFIG_OWE
269NEED_ECC=y
270NEED_HMAC_SHA256_KDF=y
271NEED_HMAC_SHA384_KDF=y
272NEED_HMAC_SHA512_KDF=y
273NEED_SHA256=y
274NEED_SHA384=y
275NEED_SHA512=y
276endif
277
278ifdef CONFIG_FILS
279L_CFLAGS += -DCONFIG_FILS
280NEED_SHA384=y
281NEED_AES_SIV=y
282ifdef CONFIG_FILS_SK_PFS
283L_CFLAGS += -DCONFIG_FILS_SK_PFS
284NEED_ECC=y
285endif
286endif
287
288ifdef CONFIG_MBO
289CONFIG_WNM=y
290endif
291
292ifdef CONFIG_WNM
293L_CFLAGS += -DCONFIG_WNM
294OBJS += wnm_sta.c
295endif
296
297ifdef CONFIG_TDLS
298L_CFLAGS += -DCONFIG_TDLS
299OBJS += src/rsn_supp/tdls.c
300NEED_SHA256=y
301NEED_AES_OMAC1=y
302endif
303
304ifdef CONFIG_TDLS_TESTING
305L_CFLAGS += -DCONFIG_TDLS_TESTING
306endif
307
308ifdef CONFIG_PMKSA_CACHE_EXTERNAL
309L_CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
310endif
311
312ifndef CONFIG_NO_WPA
313OBJS += src/rsn_supp/wpa.c
314OBJS += src/rsn_supp/preauth.c
315OBJS += src/rsn_supp/pmksa_cache.c
316OBJS += src/rsn_supp/wpa_ie.c
317OBJS += src/common/wpa_common.c
318NEED_AES=y
319NEED_SHA1=y
320NEED_MD5=y
321NEED_RC4=y
322else
323L_CFLAGS += -DCONFIG_NO_WPA
324endif
325
326ifdef CONFIG_IBSS_RSN
327NEED_RSN_AUTHENTICATOR=y
328L_CFLAGS += -DCONFIG_IBSS_RSN
329L_CFLAGS += -DCONFIG_NO_VLAN
330OBJS += ibss_rsn.c
331endif
332
333ifdef CONFIG_P2P
334OBJS += p2p_supplicant.c
335OBJS += p2p_supplicant_sd.c
336OBJS += src/p2p/p2p.c
337OBJS += src/p2p/p2p_utils.c
338OBJS += src/p2p/p2p_parse.c
339OBJS += src/p2p/p2p_build.c
340OBJS += src/p2p/p2p_go_neg.c
341OBJS += src/p2p/p2p_sd.c
342OBJS += src/p2p/p2p_pd.c
343OBJS += src/p2p/p2p_invitation.c
344OBJS += src/p2p/p2p_dev_disc.c
345OBJS += src/p2p/p2p_group.c
346OBJS += src/ap/p2p_hostapd.c
347L_CFLAGS += -DCONFIG_P2P
348NEED_GAS=y
349NEED_OFFCHANNEL=y
350CONFIG_WPS=y
351CONFIG_AP=y
352ifdef CONFIG_P2P_STRICT
353L_CFLAGS += -DCONFIG_P2P_STRICT
354endif
355endif
356
357ifdef CONFIG_WIFI_DISPLAY
358L_CFLAGS += -DCONFIG_WIFI_DISPLAY
359OBJS += wifi_display.c
360endif
361
362ifdef CONFIG_HS20
363OBJS += hs20_supplicant.c
364L_CFLAGS += -DCONFIG_HS20
365CONFIG_INTERWORKING=y
366NEED_AES_OMAC1=y
367endif
368
369ifdef CONFIG_INTERWORKING
370OBJS += interworking.c
371L_CFLAGS += -DCONFIG_INTERWORKING
372NEED_GAS=y
373endif
374
375ifdef CONFIG_FST
376L_CFLAGS += -DCONFIG_FST
377OBJS += src/fst/fst.c
378OBJS += src/fst/fst_session.c
379OBJS += src/fst/fst_iface.c
380OBJS += src/fst/fst_group.c
381OBJS += src/fst/fst_ctrl_aux.c
382ifdef CONFIG_FST_TEST
383L_CFLAGS += -DCONFIG_FST_TEST
384endif
385ifdef CONFIG_CTRL_IFACE
386OBJS += src/fst/fst_ctrl_iface.c
387endif
388endif
389
390
391include $(LOCAL_PATH)/src/drivers/drivers.mk
392
393ifdef CONFIG_AP
394OBJS_d += $(DRV_BOTH_OBJS)
395L_CFLAGS += $(DRV_BOTH_CFLAGS)
396LDFLAGS += $(DRV_BOTH_LDFLAGS)
397LIBS += $(DRV_BOTH_LIBS)
398else
399NEED_AP_MLME=
400OBJS_d += $(DRV_WPA_OBJS)
401L_CFLAGS += $(DRV_WPA_CFLAGS)
402LDFLAGS += $(DRV_WPA_LDFLAGS)
403LIBS += $(DRV_WPA_LIBS)
404endif
405
406ifndef CONFIG_L2_PACKET
407CONFIG_L2_PACKET=linux
408endif
409
410OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c
411
412ifeq ($(CONFIG_L2_PACKET), pcap)
413ifdef CONFIG_WINPCAP
414L_CFLAGS += -DCONFIG_WINPCAP
415LIBS += -lwpcap -lpacket
416LIBS_w += -lwpcap
417else
418LIBS += -ldnet -lpcap
419endif
420endif
421
422ifeq ($(CONFIG_L2_PACKET), winpcap)
423LIBS += -lwpcap -lpacket
424LIBS_w += -lwpcap
425endif
426
427ifeq ($(CONFIG_L2_PACKET), freebsd)
428LIBS += -lpcap
429endif
430
431ifdef CONFIG_ERP
432L_CFLAGS += -DCONFIG_ERP
433NEED_SHA256=y
434NEED_HMAC_SHA256_KDF=y
435endif
436
437ifdef CONFIG_EAP_TLS
438# EAP-TLS
439ifeq ($(CONFIG_EAP_TLS), dyn)
440L_CFLAGS += -DEAP_TLS_DYNAMIC
441EAPDYN += src/eap_peer/eap_tls.so
442else
443L_CFLAGS += -DEAP_TLS
444OBJS += src/eap_peer/eap_tls.c
445endif
446TLS_FUNCS=y
447CONFIG_IEEE8021X_EAPOL=y
448endif
449
450ifdef CONFIG_EAP_UNAUTH_TLS
451# EAP-UNAUTH-TLS
452L_CFLAGS += -DEAP_UNAUTH_TLS
453ifndef CONFIG_EAP_TLS
454OBJS += src/eap_peer/eap_tls.c
455TLS_FUNCS=y
456endif
457CONFIG_IEEE8021X_EAPOL=y
458endif
459
460ifdef CONFIG_EAP_PEAP
461# EAP-PEAP
462ifeq ($(CONFIG_EAP_PEAP), dyn)
463L_CFLAGS += -DEAP_PEAP_DYNAMIC
464EAPDYN += src/eap_peer/eap_peap.so
465else
466L_CFLAGS += -DEAP_PEAP
467OBJS += src/eap_peer/eap_peap.c
468OBJS += src/eap_common/eap_peap_common.c
469endif
470TLS_FUNCS=y
471CONFIG_IEEE8021X_EAPOL=y
472endif
473
474ifdef CONFIG_EAP_TTLS
475# EAP-TTLS
476ifeq ($(CONFIG_EAP_TTLS), dyn)
477L_CFLAGS += -DEAP_TTLS_DYNAMIC
478EAPDYN += src/eap_peer/eap_ttls.so
479else
480L_CFLAGS += -DEAP_TTLS
481OBJS += src/eap_peer/eap_ttls.c
482endif
483TLS_FUNCS=y
484ifndef CONFIG_FIPS
485MS_FUNCS=y
486CHAP=y
487endif
488CONFIG_IEEE8021X_EAPOL=y
489endif
490
491ifdef CONFIG_EAP_MD5
492# EAP-MD5
493ifeq ($(CONFIG_EAP_MD5), dyn)
494L_CFLAGS += -DEAP_MD5_DYNAMIC
495EAPDYN += src/eap_peer/eap_md5.so
496else
497L_CFLAGS += -DEAP_MD5
498OBJS += src/eap_peer/eap_md5.c
499endif
500CHAP=y
501CONFIG_IEEE8021X_EAPOL=y
502endif
503
504# backwards compatibility for old spelling
505ifdef CONFIG_MSCHAPV2
506ifndef CONFIG_EAP_MSCHAPV2
507CONFIG_EAP_MSCHAPV2=y
508endif
509endif
510
511ifdef CONFIG_EAP_MSCHAPV2
512# EAP-MSCHAPv2
513ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
514L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
515EAPDYN += src/eap_peer/eap_mschapv2.so
516EAPDYN += src/eap_peer/mschapv2.so
517else
518L_CFLAGS += -DEAP_MSCHAPv2
519OBJS += src/eap_peer/eap_mschapv2.c
520OBJS += src/eap_peer/mschapv2.c
521endif
522MS_FUNCS=y
523CONFIG_IEEE8021X_EAPOL=y
524endif
525
526ifdef CONFIG_EAP_GTC
527# EAP-GTC
528ifeq ($(CONFIG_EAP_GTC), dyn)
529L_CFLAGS += -DEAP_GTC_DYNAMIC
530EAPDYN += src/eap_peer/eap_gtc.so
531else
532L_CFLAGS += -DEAP_GTC
533OBJS += src/eap_peer/eap_gtc.c
534endif
535CONFIG_IEEE8021X_EAPOL=y
536endif
537
538ifdef CONFIG_EAP_OTP
539# EAP-OTP
540ifeq ($(CONFIG_EAP_OTP), dyn)
541L_CFLAGS += -DEAP_OTP_DYNAMIC
542EAPDYN += src/eap_peer/eap_otp.so
543else
544L_CFLAGS += -DEAP_OTP
545OBJS += src/eap_peer/eap_otp.c
546endif
547CONFIG_IEEE8021X_EAPOL=y
548endif
549
550ifdef CONFIG_EAP_SIM
551# EAP-SIM
552ifeq ($(CONFIG_EAP_SIM), dyn)
553L_CFLAGS += -DEAP_SIM_DYNAMIC
554EAPDYN += src/eap_peer/eap_sim.so
555else
556L_CFLAGS += -DEAP_SIM
557OBJS += src/eap_peer/eap_sim.c
558endif
559CONFIG_IEEE8021X_EAPOL=y
560CONFIG_EAP_SIM_COMMON=y
561NEED_AES_CBC=y
562endif
563
564ifdef CONFIG_EAP_LEAP
565# EAP-LEAP
566ifeq ($(CONFIG_EAP_LEAP), dyn)
567L_CFLAGS += -DEAP_LEAP_DYNAMIC
568EAPDYN += src/eap_peer/eap_leap.so
569else
570L_CFLAGS += -DEAP_LEAP
571OBJS += src/eap_peer/eap_leap.c
572endif
573MS_FUNCS=y
574CONFIG_IEEE8021X_EAPOL=y
575endif
576
577ifdef CONFIG_EAP_PSK
578# EAP-PSK
579ifeq ($(CONFIG_EAP_PSK), dyn)
580L_CFLAGS += -DEAP_PSK_DYNAMIC
581EAPDYN += src/eap_peer/eap_psk.so
582else
583L_CFLAGS += -DEAP_PSK
584OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c
585endif
586CONFIG_IEEE8021X_EAPOL=y
587NEED_AES=y
588NEED_AES_OMAC1=y
589NEED_AES_ENCBLOCK=y
590NEED_AES_EAX=y
591endif
592
593ifdef CONFIG_EAP_AKA
594# EAP-AKA
595ifeq ($(CONFIG_EAP_AKA), dyn)
596L_CFLAGS += -DEAP_AKA_DYNAMIC
597EAPDYN += src/eap_peer/eap_aka.so
598else
599L_CFLAGS += -DEAP_AKA
600OBJS += src/eap_peer/eap_aka.c
601endif
602CONFIG_IEEE8021X_EAPOL=y
603CONFIG_EAP_SIM_COMMON=y
604NEED_AES_CBC=y
605endif
606
607ifdef CONFIG_EAP_PROXY
608L_CFLAGS += -DCONFIG_EAP_PROXY
609OBJS += src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).c
610include $(LOCAL_PATH)/eap_proxy_$(CONFIG_EAP_PROXY).mk
611CONFIG_IEEE8021X_EAPOL=y
612endif
613
614ifdef CONFIG_EAP_AKA_PRIME
615# EAP-AKA'
616ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
617L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
618else
619L_CFLAGS += -DEAP_AKA_PRIME
620endif
621NEED_SHA256=y
622endif
623
624ifdef CONFIG_EAP_SIM_COMMON
625OBJS += src/eap_common/eap_sim_common.c
626NEED_AES=y
627NEED_FIPS186_2_PRF=y
628endif
629
630ifdef CONFIG_EAP_FAST
631# EAP-FAST
632ifeq ($(CONFIG_EAP_FAST), dyn)
633L_CFLAGS += -DEAP_FAST_DYNAMIC
634EAPDYN += src/eap_peer/eap_fast.so
635EAPDYN += src/eap_common/eap_fast_common.c
636else
637L_CFLAGS += -DEAP_FAST
638OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c
639OBJS += src/eap_common/eap_fast_common.c
640endif
641TLS_FUNCS=y
642CONFIG_IEEE8021X_EAPOL=y
643NEED_T_PRF=y
644endif
645
646ifdef CONFIG_EAP_PAX
647# EAP-PAX
648ifeq ($(CONFIG_EAP_PAX), dyn)
649L_CFLAGS += -DEAP_PAX_DYNAMIC
650EAPDYN += src/eap_peer/eap_pax.so
651else
652L_CFLAGS += -DEAP_PAX
653OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c
654endif
655CONFIG_IEEE8021X_EAPOL=y
656endif
657
658ifdef CONFIG_EAP_SAKE
659# EAP-SAKE
660ifeq ($(CONFIG_EAP_SAKE), dyn)
661L_CFLAGS += -DEAP_SAKE_DYNAMIC
662EAPDYN += src/eap_peer/eap_sake.so
663else
664L_CFLAGS += -DEAP_SAKE
665OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c
666endif
667CONFIG_IEEE8021X_EAPOL=y
668endif
669
670ifdef CONFIG_EAP_GPSK
671# EAP-GPSK
672ifeq ($(CONFIG_EAP_GPSK), dyn)
673L_CFLAGS += -DEAP_GPSK_DYNAMIC
674EAPDYN += src/eap_peer/eap_gpsk.so
675else
676L_CFLAGS += -DEAP_GPSK
677OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c
678endif
679CONFIG_IEEE8021X_EAPOL=y
680ifdef CONFIG_EAP_GPSK_SHA256
681L_CFLAGS += -DEAP_GPSK_SHA256
682endif
683NEED_SHA256=y
684NEED_AES_OMAC1=y
685endif
686
687ifdef CONFIG_EAP_PWD
688L_CFLAGS += -DEAP_PWD
689OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c
690CONFIG_IEEE8021X_EAPOL=y
691NEED_SHA256=y
692NEED_ECC=y
693endif
694
695ifdef CONFIG_EAP_EKE
696# EAP-EKE
697ifeq ($(CONFIG_EAP_EKE), dyn)
698L_CFLAGS += -DEAP_EKE_DYNAMIC
699EAPDYN += src/eap_peer/eap_eke.so
700else
701L_CFLAGS += -DEAP_EKE
702OBJS += src/eap_peer/eap_eke.c src/eap_common/eap_eke_common.c
703endif
704CONFIG_IEEE8021X_EAPOL=y
705NEED_DH_GROUPS=y
706NEED_DH_GROUPS_ALL=y
707NEED_SHA256=y
708NEED_AES_CBC=y
709endif
710
711ifdef CONFIG_WPS
712# EAP-WSC
713L_CFLAGS += -DCONFIG_WPS -DEAP_WSC
714OBJS += wps_supplicant.c
715OBJS += src/utils/uuid.c
716OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c
717OBJS += src/wps/wps.c
718OBJS += src/wps/wps_common.c
719OBJS += src/wps/wps_attr_parse.c
720OBJS += src/wps/wps_attr_build.c
721OBJS += src/wps/wps_attr_process.c
722OBJS += src/wps/wps_dev_attr.c
723OBJS += src/wps/wps_enrollee.c
724OBJS += src/wps/wps_registrar.c
725CONFIG_IEEE8021X_EAPOL=y
726NEED_DH_GROUPS=y
727NEED_SHA256=y
728NEED_BASE64=y
729NEED_AES_CBC=y
730NEED_MODEXP=y
731
732ifdef CONFIG_WPS_NFC
733L_CFLAGS += -DCONFIG_WPS_NFC
734OBJS += src/wps/ndef.c
735NEED_WPS_OOB=y
736endif
737
738ifdef NEED_WPS_OOB
739L_CFLAGS += -DCONFIG_WPS_OOB
740endif
741
742ifdef CONFIG_WPS_ER
743CONFIG_WPS_UPNP=y
744L_CFLAGS += -DCONFIG_WPS_ER
745OBJS += src/wps/wps_er.c
746OBJS += src/wps/wps_er_ssdp.c
747endif
748
749ifdef CONFIG_WPS_UPNP
750L_CFLAGS += -DCONFIG_WPS_UPNP
751OBJS += src/wps/wps_upnp.c
752OBJS += src/wps/wps_upnp_ssdp.c
753OBJS += src/wps/wps_upnp_web.c
754OBJS += src/wps/wps_upnp_event.c
755OBJS += src/wps/wps_upnp_ap.c
756OBJS += src/wps/upnp_xml.c
757OBJS += src/wps/httpread.c
758OBJS += src/wps/http_client.c
759OBJS += src/wps/http_server.c
760endif
761
762ifdef CONFIG_WPS_STRICT
763L_CFLAGS += -DCONFIG_WPS_STRICT
764OBJS += src/wps/wps_validate.c
765endif
766
767ifdef CONFIG_WPS_TESTING
768L_CFLAGS += -DCONFIG_WPS_TESTING
769endif
770
771ifdef CONFIG_WPS_REG_DISABLE_OPEN
772L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
773endif
774
775endif
776
777ifdef CONFIG_EAP_IKEV2
778# EAP-IKEv2
779ifeq ($(CONFIG_EAP_IKEV2), dyn)
780L_CFLAGS += -DEAP_IKEV2_DYNAMIC
781EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c
782EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
783else
784L_CFLAGS += -DEAP_IKEV2
785OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c
786OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
787endif
788CONFIG_IEEE8021X_EAPOL=y
789NEED_DH_GROUPS=y
790NEED_DH_GROUPS_ALL=y
791NEED_MODEXP=y
792NEED_CIPHER=y
793endif
794
795ifdef CONFIG_EAP_VENDOR_TEST
796ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
797L_CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
798EAPDYN += src/eap_peer/eap_vendor_test.so
799else
800L_CFLAGS += -DEAP_VENDOR_TEST
801OBJS += src/eap_peer/eap_vendor_test.c
802endif
803CONFIG_IEEE8021X_EAPOL=y
804endif
805
806ifdef CONFIG_EAP_TNC
807# EAP-TNC
808L_CFLAGS += -DEAP_TNC
809OBJS += src/eap_peer/eap_tnc.c
810OBJS += src/eap_peer/tncc.c
811NEED_BASE64=y
812ifndef CONFIG_NATIVE_WINDOWS
813ifndef CONFIG_DRIVER_BSD
814LIBS += -ldl
815endif
816endif
817endif
818
819ifdef CONFIG_IEEE8021X_EAPOL
820# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
821L_CFLAGS += -DIEEE8021X_EAPOL
822OBJS += src/eapol_supp/eapol_supp_sm.c
823OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c
824NEED_EAP_COMMON=y
825ifdef CONFIG_DYNAMIC_EAP_METHODS
826L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
827LIBS += -ldl -rdynamic
828endif
829endif
830
831ifdef CONFIG_AP
832NEED_EAP_COMMON=y
833NEED_RSN_AUTHENTICATOR=y
834L_CFLAGS += -DCONFIG_AP
835OBJS += ap.c
836L_CFLAGS += -DCONFIG_NO_RADIUS
837L_CFLAGS += -DCONFIG_NO_ACCOUNTING
838L_CFLAGS += -DCONFIG_NO_VLAN
839OBJS += src/ap/hostapd.c
840OBJS += src/ap/wpa_auth_glue.c
841OBJS += src/ap/utils.c
842OBJS += src/ap/authsrv.c
843OBJS += src/ap/ap_config.c
844OBJS += src/utils/ip_addr.c
845OBJS += src/ap/sta_info.c
846OBJS += src/ap/tkip_countermeasures.c
847OBJS += src/ap/ap_mlme.c
848OBJS += src/ap/ieee802_1x.c
849OBJS += src/eapol_auth/eapol_auth_sm.c
850OBJS += src/ap/ieee802_11_auth.c
851OBJS += src/ap/ieee802_11_shared.c
852OBJS += src/ap/drv_callbacks.c
853OBJS += src/ap/ap_drv_ops.c
854OBJS += src/ap/beacon.c
855OBJS += src/ap/bss_load.c
856OBJS += src/ap/eap_user_db.c
857OBJS += src/ap/neighbor_db.c
858OBJS += src/ap/rrm.c
859ifdef CONFIG_IEEE80211N
860OBJS += src/ap/ieee802_11_ht.c
861ifdef CONFIG_IEEE80211AC
862OBJS += src/ap/ieee802_11_vht.c
863endif
864ifdef CONFIG_IEEE80211AX
865OBJS += src/ap/ieee802_11_he.c
866endif
867endif
868ifdef CONFIG_WNM_AP
869L_CFLAGS += -DCONFIG_WNM_AP
870OBJS += src/ap/wnm_ap.c
871endif
872ifdef CONFIG_MBO
873OBJS += src/ap/mbo_ap.c
874endif
875ifdef CONFIG_FILS
876OBJS += src/ap/fils_hlp.c
877endif
878ifdef CONFIG_CTRL_IFACE
879OBJS += src/ap/ctrl_iface_ap.c
880endif
881
882L_CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
883OBJS += src/eap_server/eap_server.c
884OBJS += src/eap_server/eap_server_identity.c
885OBJS += src/eap_server/eap_server_methods.c
886
887ifdef CONFIG_IEEE80211N
888L_CFLAGS += -DCONFIG_IEEE80211N
889ifdef CONFIG_IEEE80211AC
890L_CFLAGS += -DCONFIG_IEEE80211AC
891endif
892ifdef CONFIG_IEEE80211AX
893L_CFLAGS += -DCONFIG_IEEE80211AX
894endif
895endif
896
897ifdef NEED_AP_MLME
898OBJS += src/ap/wmm.c
899OBJS += src/ap/ap_list.c
900OBJS += src/ap/ieee802_11.c
901OBJS += src/ap/hw_features.c
902OBJS += src/ap/dfs.c
903L_CFLAGS += -DNEED_AP_MLME
904endif
905ifdef CONFIG_WPS
906L_CFLAGS += -DEAP_SERVER_WSC
907OBJS += src/ap/wps_hostapd.c
908OBJS += src/eap_server/eap_server_wsc.c
909endif
910ifdef CONFIG_DPP
911OBJS += src/ap/dpp_hostapd.c
912OBJS += src/ap/gas_query_ap.c
913endif
914ifdef CONFIG_INTERWORKING
915OBJS += src/ap/gas_serv.c
916endif
917ifdef CONFIG_HS20
918OBJS += src/ap/hs20.c
919endif
920endif
921
922ifdef CONFIG_MBO
923OBJS += mbo.c
924L_CFLAGS += -DCONFIG_MBO
925endif
926
927ifdef CONFIG_TESTING_OPTIONS
928L_CFLAGS += -DCONFIG_TESTING_OPTIONS
929endif
930
931ifdef NEED_RSN_AUTHENTICATOR
932L_CFLAGS += -DCONFIG_NO_RADIUS
933NEED_AES_WRAP=y
934OBJS += src/ap/wpa_auth.c
935OBJS += src/ap/wpa_auth_ie.c
936OBJS += src/ap/pmksa_cache_auth.c
937endif
938
939ifdef CONFIG_ACS
940L_CFLAGS += -DCONFIG_ACS
941OBJS += src/ap/acs.c
942LIBS += -lm
943endif
944
945ifdef CONFIG_PCSC
946# PC/SC interface for smartcards (USIM, GSM SIM)
947L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
948OBJS += src/utils/pcsc_funcs.c
949# -lpthread may not be needed depending on how pcsc-lite was configured
950ifdef CONFIG_NATIVE_WINDOWS
951#Once MinGW gets support for WinScard, -lwinscard could be used instead of the
952#dynamic symbol loading that is now used in pcsc_funcs.c
953#LIBS += -lwinscard
954else
955LIBS += -lpcsclite -lpthread
956endif
957endif
958
959ifdef CONFIG_SIM_SIMULATOR
960L_CFLAGS += -DCONFIG_SIM_SIMULATOR
961NEED_MILENAGE=y
962endif
963
964ifdef CONFIG_USIM_SIMULATOR
965L_CFLAGS += -DCONFIG_USIM_SIMULATOR
966NEED_MILENAGE=y
967endif
968
969ifdef NEED_MILENAGE
970OBJS += src/crypto/milenage.c
971NEED_AES_ENCBLOCK=y
972endif
973
974ifdef CONFIG_PKCS12
975L_CFLAGS += -DPKCS12_FUNCS
976endif
977
978ifdef CONFIG_SMARTCARD
979L_CFLAGS += -DCONFIG_SMARTCARD
980endif
981
982ifdef MS_FUNCS
983OBJS += src/crypto/ms_funcs.c
984NEED_DES=y
985NEED_MD4=y
986endif
987
988ifdef CHAP
989OBJS += src/eap_common/chap.c
990endif
991
992ifdef TLS_FUNCS
993NEED_DES=y
994# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
995OBJS += src/eap_peer/eap_tls_common.c
996ifndef CONFIG_FIPS
997NEED_TLS_PRF=y
998NEED_SHA1=y
999NEED_MD5=y
1000endif
1001endif
1002
1003ifndef CONFIG_TLS
1004CONFIG_TLS=openssl
1005endif
1006
1007ifdef CONFIG_TLSV11
1008L_CFLAGS += -DCONFIG_TLSV11
1009endif
1010
1011ifdef CONFIG_TLSV12
1012L_CFLAGS += -DCONFIG_TLSV12
1013NEED_SHA256=y
1014endif
1015
1016ifeq ($(CONFIG_TLS), openssl)
1017ifdef TLS_FUNCS
1018L_CFLAGS += -DEAP_TLS_OPENSSL
1019OBJS += src/crypto/tls_openssl.c
1020OBJS += src/crypto/tls_openssl_ocsp.c
1021LIBS += -lssl
1022endif
1023OBJS += src/crypto/crypto_openssl.c
1024OBJS_p += src/crypto/crypto_openssl.c
1025ifdef NEED_FIPS186_2_PRF
1026OBJS += src/crypto/fips_prf_openssl.c
1027endif
1028NEED_SHA256=y
1029NEED_TLS_PRF_SHA256=y
1030LIBS += -lcrypto
1031LIBS_p += -lcrypto
1032ifdef CONFIG_TLS_ADD_DL
1033LIBS += -ldl
1034LIBS_p += -ldl
1035endif
1036ifndef CONFIG_TLS_DEFAULT_CIPHERS
1037CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
1038endif
1039L_CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
1040endif
1041
1042ifeq ($(CONFIG_TLS), gnutls)
1043ifndef CONFIG_CRYPTO
1044# default to libgcrypt
1045CONFIG_CRYPTO=gnutls
1046endif
1047ifdef TLS_FUNCS
1048OBJS += src/crypto/tls_gnutls.c
1049LIBS += -lgnutls -lgpg-error
1050endif
1051OBJS += src/crypto/crypto_$(CONFIG_CRYPTO).c
1052OBJS_p += src/crypto/crypto_$(CONFIG_CRYPTO).c
1053ifdef NEED_FIPS186_2_PRF
1054OBJS += src/crypto/fips_prf_internal.c
1055OBJS += src/crypto/sha1-internal.c
1056endif
1057ifeq ($(CONFIG_CRYPTO), gnutls)
1058LIBS += -lgcrypt
1059LIBS_p += -lgcrypt
1060CONFIG_INTERNAL_RC4=y
1061CONFIG_INTERNAL_DH_GROUP5=y
1062endif
1063ifeq ($(CONFIG_CRYPTO), nettle)
1064LIBS += -lnettle -lgmp
1065LIBS_p += -lnettle -lgmp
1066CONFIG_INTERNAL_RC4=y
1067CONFIG_INTERNAL_DH_GROUP5=y
1068endif
1069endif
1070
1071ifeq ($(CONFIG_TLS), internal)
1072ifndef CONFIG_CRYPTO
1073CONFIG_CRYPTO=internal
1074endif
1075ifdef TLS_FUNCS
1076OBJS += src/crypto/crypto_internal-rsa.c
1077OBJS += src/crypto/tls_internal.c
1078OBJS += src/tls/tlsv1_common.c
1079OBJS += src/tls/tlsv1_record.c
1080OBJS += src/tls/tlsv1_cred.c
1081OBJS += src/tls/tlsv1_client.c
1082OBJS += src/tls/tlsv1_client_write.c
1083OBJS += src/tls/tlsv1_client_read.c
1084OBJS += src/tls/tlsv1_client_ocsp.c
1085OBJS += src/tls/asn1.c
1086OBJS += src/tls/rsa.c
1087OBJS += src/tls/x509v3.c
1088OBJS += src/tls/pkcs1.c
1089OBJS += src/tls/pkcs5.c
1090OBJS += src/tls/pkcs8.c
1091NEED_SHA256=y
1092NEED_BASE64=y
1093NEED_TLS_PRF=y
1094ifdef CONFIG_TLSV12
1095NEED_TLS_PRF_SHA256=y
1096endif
1097NEED_MODEXP=y
1098NEED_CIPHER=y
1099L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
1100endif
1101ifdef NEED_CIPHER
1102NEED_DES=y
1103OBJS += src/crypto/crypto_internal-cipher.c
1104endif
1105ifdef NEED_MODEXP
1106OBJS += src/crypto/crypto_internal-modexp.c
1107OBJS += src/tls/bignum.c
1108endif
1109ifeq ($(CONFIG_CRYPTO), libtomcrypt)
1110OBJS += src/crypto/crypto_libtomcrypt.c
1111OBJS_p += src/crypto/crypto_libtomcrypt.c
1112LIBS += -ltomcrypt -ltfm
1113LIBS_p += -ltomcrypt -ltfm
1114CONFIG_INTERNAL_SHA256=y
1115CONFIG_INTERNAL_RC4=y
1116CONFIG_INTERNAL_DH_GROUP5=y
1117endif
1118ifeq ($(CONFIG_CRYPTO), internal)
1119OBJS += src/crypto/crypto_internal.c
1120OBJS_p += src/crypto/crypto_internal.c
1121NEED_AES_ENC=y
1122L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
1123ifdef CONFIG_INTERNAL_LIBTOMMATH
1124L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
1125ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
1126L_CFLAGS += -DLTM_FAST
1127endif
1128else
1129LIBS += -ltommath
1130LIBS_p += -ltommath
1131endif
1132CONFIG_INTERNAL_AES=y
1133CONFIG_INTERNAL_DES=y
1134CONFIG_INTERNAL_SHA1=y
1135CONFIG_INTERNAL_MD4=y
1136CONFIG_INTERNAL_MD5=y
1137CONFIG_INTERNAL_SHA256=y
1138CONFIG_INTERNAL_SHA384=y
1139CONFIG_INTERNAL_SHA512=y
1140CONFIG_INTERNAL_RC4=y
1141CONFIG_INTERNAL_DH_GROUP5=y
1142endif
1143ifeq ($(CONFIG_CRYPTO), cryptoapi)
1144OBJS += src/crypto/crypto_cryptoapi.c
1145OBJS_p += src/crypto/crypto_cryptoapi.c
1146L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
1147CONFIG_INTERNAL_SHA256=y
1148CONFIG_INTERNAL_RC4=y
1149endif
1150endif
1151
1152ifeq ($(CONFIG_TLS), none)
1153ifdef TLS_FUNCS
1154OBJS += src/crypto/tls_none.c
1155L_CFLAGS += -DEAP_TLS_NONE
1156CONFIG_INTERNAL_AES=y
1157CONFIG_INTERNAL_SHA1=y
1158CONFIG_INTERNAL_MD5=y
1159endif
1160OBJS += src/crypto/crypto_none.c
1161OBJS_p += src/crypto/crypto_none.c
1162CONFIG_INTERNAL_SHA256=y
1163CONFIG_INTERNAL_RC4=y
1164endif
1165
1166ifdef TLS_FUNCS
1167ifdef CONFIG_SMARTCARD
1168ifndef CONFIG_NATIVE_WINDOWS
1169ifneq ($(CONFIG_L2_PACKET), freebsd)
1170LIBS += -ldl
1171endif
1172endif
1173endif
1174endif
1175
1176ifndef TLS_FUNCS
1177OBJS += src/crypto/tls_none.c
1178ifeq ($(CONFIG_TLS), internal)
1179CONFIG_INTERNAL_AES=y
1180CONFIG_INTERNAL_SHA1=y
1181CONFIG_INTERNAL_MD5=y
1182CONFIG_INTERNAL_RC4=y
1183endif
1184endif
1185
1186AESOBJS = # none so far (see below)
1187ifdef CONFIG_INTERNAL_AES
1188AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c
1189endif
1190
1191ifneq ($(CONFIG_TLS), openssl)
1192NEED_INTERNAL_AES_WRAP=y
1193endif
1194ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
1195# Seems to be needed at least with BoringSSL
1196NEED_INTERNAL_AES_WRAP=y
1197L_CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
1198endif
1199ifdef CONFIG_FIPS
1200# Have to use internal AES key wrap routines to use OpenSSL EVP since the
1201# OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
1202NEED_INTERNAL_AES_WRAP=y
1203endif
1204
1205ifdef NEED_INTERNAL_AES_WRAP
1206AESOBJS += src/crypto/aes-unwrap.c
1207endif
1208ifdef NEED_AES_EAX
1209AESOBJS += src/crypto/aes-eax.c
1210NEED_AES_CTR=y
1211NEED_AES_OMAC1=y
1212endif
1213ifdef NEED_AES_SIV
1214AESOBJS += src/crypto/aes-siv.c
1215NEED_AES_CTR=y
1216NEED_AES_OMAC1=y
1217endif
1218ifdef NEED_AES_CTR
1219AESOBJS += src/crypto/aes-ctr.c
1220endif
1221ifdef NEED_AES_ENCBLOCK
1222AESOBJS += src/crypto/aes-encblock.c
1223endif
1224ifdef NEED_AES_OMAC1
1225NEED_AES_ENC=y
1226ifdef CONFIG_OPENSSL_CMAC
1227L_CFLAGS += -DCONFIG_OPENSSL_CMAC
1228else
1229AESOBJS += src/crypto/aes-omac1.c
1230endif
1231endif
1232ifdef NEED_AES_WRAP
1233NEED_AES_ENC=y
1234ifdef NEED_INTERNAL_AES_WRAP
1235AESOBJS += src/crypto/aes-wrap.c
1236endif
1237endif
1238ifdef NEED_AES_CBC
1239NEED_AES_ENC=y
1240ifneq ($(CONFIG_TLS), openssl)
1241AESOBJS += src/crypto/aes-cbc.c
1242endif
1243endif
1244ifdef NEED_AES_ENC
1245ifdef CONFIG_INTERNAL_AES
1246AESOBJS += src/crypto/aes-internal-enc.c
1247endif
1248endif
1249ifdef NEED_AES
1250OBJS += $(AESOBJS)
1251endif
1252
1253SHA1OBJS =
1254ifdef NEED_SHA1
1255ifneq ($(CONFIG_TLS), openssl)
1256ifneq ($(CONFIG_TLS), gnutls)
1257SHA1OBJS += src/crypto/sha1.c
1258endif
1259endif
1260SHA1OBJS += src/crypto/sha1-prf.c
1261ifdef CONFIG_INTERNAL_SHA1
1262SHA1OBJS += src/crypto/sha1-internal.c
1263ifdef NEED_FIPS186_2_PRF
1264SHA1OBJS += src/crypto/fips_prf_internal.c
1265endif
1266endif
1267ifdef CONFIG_NO_WPA_PASSPHRASE
1268L_CFLAGS += -DCONFIG_NO_PBKDF2
1269else
1270ifneq ($(CONFIG_TLS), openssl)
1271SHA1OBJS += src/crypto/sha1-pbkdf2.c
1272endif
1273endif
1274ifdef NEED_T_PRF
1275SHA1OBJS += src/crypto/sha1-tprf.c
1276endif
1277ifdef NEED_TLS_PRF
1278SHA1OBJS += src/crypto/sha1-tlsprf.c
1279endif
1280endif
1281
1282MD5OBJS =
1283ifndef CONFIG_FIPS
1284ifneq ($(CONFIG_TLS), openssl)
1285ifneq ($(CONFIG_TLS), gnutls)
1286MD5OBJS += src/crypto/md5.c
1287endif
1288endif
1289endif
1290ifdef NEED_MD5
1291ifdef CONFIG_INTERNAL_MD5
1292MD5OBJS += src/crypto/md5-internal.c
1293endif
1294OBJS += $(MD5OBJS)
1295OBJS_p += $(MD5OBJS)
1296endif
1297
1298ifdef NEED_MD4
1299ifdef CONFIG_INTERNAL_MD4
1300OBJS += src/crypto/md4-internal.c
1301endif
1302endif
1303
1304DESOBJS = # none needed when not internal
1305ifdef NEED_DES
1306ifdef CONFIG_INTERNAL_DES
1307DESOBJS += src/crypto/des-internal.c
1308endif
1309endif
1310
1311ifdef CONFIG_NO_RC4
1312L_CFLAGS += -DCONFIG_NO_RC4
1313endif
1314
1315ifdef NEED_RC4
1316ifdef CONFIG_INTERNAL_RC4
1317ifndef CONFIG_NO_RC4
1318OBJS += src/crypto/rc4.c
1319endif
1320endif
1321endif
1322
1323SHA256OBJS = # none by default
1324ifdef NEED_SHA256
1325L_CFLAGS += -DCONFIG_SHA256
1326ifneq ($(CONFIG_TLS), openssl)
1327ifneq ($(CONFIG_TLS), gnutls)
1328SHA256OBJS += src/crypto/sha256.c
1329endif
1330endif
1331SHA256OBJS += src/crypto/sha256-prf.c
1332ifdef CONFIG_INTERNAL_SHA256
1333SHA256OBJS += src/crypto/sha256-internal.c
1334endif
1335ifdef CONFIG_INTERNAL_SHA384
1336L_CFLAGS += -DCONFIG_INTERNAL_SHA384
1337SHA256OBJS += src/crypto/sha384-internal.c
1338endif
1339ifdef CONFIG_INTERNAL_SHA512
1340L_CFLAGS += -DCONFIG_INTERNAL_SHA512
1341SHA256OBJS += src/crypto/sha512-internal.c
1342endif
1343ifdef NEED_TLS_PRF_SHA256
1344SHA256OBJS += src/crypto/sha256-tlsprf.c
1345endif
1346ifdef NEED_HMAC_SHA256_KDF
1347L_CFLAGS += -DCONFIG_HMAC_SHA256_KDF
1348SHA256OBJS += src/crypto/sha256-kdf.c
1349endif
1350ifdef NEED_HMAC_SHA384_KDF
1351L_CFLAGS += -DCONFIG_HMAC_SHA384_KDF
1352SHA256OBJS += src/crypto/sha384-kdf.c
1353endif
1354ifdef NEED_HMAC_SHA512_KDF
1355L_CFLAGS += -DCONFIG_HMAC_SHA512_KDF
1356SHA256OBJS += src/crypto/sha512-kdf.c
1357endif
1358OBJS += $(SHA256OBJS)
1359endif
1360ifdef NEED_SHA384
1361L_CFLAGS += -DCONFIG_SHA384
1362ifneq ($(CONFIG_TLS), openssl)
1363ifneq ($(CONFIG_TLS), gnutls)
1364OBJS += src/crypto/sha384.c
1365endif
1366endif
1367OBJS += src/crypto/sha384-prf.c
1368endif
1369ifdef NEED_SHA512
1370L_CFLAGS += -DCONFIG_SHA512
1371ifneq ($(CONFIG_TLS), openssl)
1372ifneq ($(CONFIG_TLS), gnutls)
1373OBJS += src/crypto/sha512.c
1374endif
1375endif
1376OBJS += src/crypto/sha512-prf.c
1377endif
1378
1379ifdef NEED_DH_GROUPS
1380OBJS += src/crypto/dh_groups.c
1381endif
1382ifdef NEED_DH_GROUPS_ALL
1383L_CFLAGS += -DALL_DH_GROUPS
1384endif
1385ifdef CONFIG_INTERNAL_DH_GROUP5
1386ifdef NEED_DH_GROUPS
1387OBJS += src/crypto/dh_group5.c
1388endif
1389endif
1390
1391ifdef NEED_ECC
1392L_CFLAGS += -DCONFIG_ECC
1393endif
1394
1395ifdef CONFIG_NO_RANDOM_POOL
1396L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
1397else
1398OBJS += src/crypto/random.c
1399endif
1400
1401ifdef CONFIG_CTRL_IFACE
1402ifeq ($(CONFIG_CTRL_IFACE), y)
1403ifdef CONFIG_NATIVE_WINDOWS
1404CONFIG_CTRL_IFACE=named_pipe
1405else
1406CONFIG_CTRL_IFACE=unix
1407endif
1408endif
1409L_CFLAGS += -DCONFIG_CTRL_IFACE
1410ifeq ($(CONFIG_CTRL_IFACE), unix)
1411L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
1412OBJS += src/common/ctrl_iface_common.c
1413endif
1414ifeq ($(CONFIG_CTRL_IFACE), udp)
1415L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1416endif
1417ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
1418L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
1419endif
1420ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
1421CONFIG_CTRL_IFACE=udp
1422L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP
1423L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
1424endif
1425OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c
1426endif
1427
1428ifdef CONFIG_CTRL_IFACE_DBUS_NEW
1429L_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
1430OBJS += dbus/dbus_dict_helpers.c
1431OBJS += dbus/dbus_new_helpers.c
1432OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c
1433OBJS += dbus/dbus_common.c
1434ifdef CONFIG_WPS
1435OBJS += dbus/dbus_new_handlers_wps.c
1436endif
1437ifdef CONFIG_P2P
1438OBJS += dbus/dbus_new_handlers_p2p.c
1439endif
1440ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
1441OBJS += dbus/dbus_new_introspect.c
1442L_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
1443endif
1444L_CFLAGS += $(DBUS_INCLUDE)
1445endif
1446
1447ifdef CONFIG_CTRL_IFACE_BINDER
1448WPA_SUPPLICANT_USE_BINDER=y
1449L_CFLAGS += -DCONFIG_BINDER -DCONFIG_CTRL_IFACE_BINDER
1450endif
1451
1452ifdef CONFIG_READLINE
1453OBJS_c += src/utils/edit_readline.c
1454LIBS_c += -lncurses -lreadline
1455else
1456ifdef CONFIG_WPA_CLI_EDIT
1457OBJS_c += src/utils/edit.c
1458else
1459OBJS_c += src/utils/edit_simple.c
1460endif
1461endif
1462
1463ifdef CONFIG_NATIVE_WINDOWS
1464L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
1465LIBS += -lws2_32 -lgdi32 -lcrypt32
1466LIBS_c += -lws2_32
1467LIBS_p += -lws2_32 -lgdi32
1468ifeq ($(CONFIG_CRYPTO), cryptoapi)
1469LIBS_p += -lcrypt32
1470endif
1471endif
1472
1473ifdef CONFIG_NO_STDOUT_DEBUG
1474L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
1475ifndef CONFIG_CTRL_IFACE
1476L_CFLAGS += -DCONFIG_NO_WPA_MSG
1477endif
1478endif
1479
1480ifdef CONFIG_ANDROID_LOG
1481L_CFLAGS += -DCONFIG_ANDROID_LOG
1482endif
1483
1484ifdef CONFIG_IPV6
1485# for eapol_test only
1486L_CFLAGS += -DCONFIG_IPV6
1487endif
1488
1489ifdef NEED_BASE64
1490OBJS += src/utils/base64.c
1491endif
1492
1493ifdef NEED_SME
1494OBJS += sme.c
1495L_CFLAGS += -DCONFIG_SME
1496endif
1497
1498OBJS += src/common/ieee802_11_common.c
1499OBJS += src/common/hw_features_common.c
1500
1501ifdef NEED_EAP_COMMON
1502OBJS += src/eap_common/eap_common.c
1503endif
1504
1505ifndef CONFIG_MAIN
1506CONFIG_MAIN=main
1507endif
1508
1509ifdef CONFIG_DEBUG_SYSLOG
1510L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
1511ifdef CONFIG_DEBUG_SYSLOG_FACILITY
1512L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
1513endif
1514endif
1515
1516ifdef CONFIG_DEBUG_LINUX_TRACING
1517L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
1518endif
1519
1520ifdef CONFIG_DEBUG_FILE
1521L_CFLAGS += -DCONFIG_DEBUG_FILE
1522endif
1523
1524ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
1525L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
1526endif
1527
1528ifdef CONFIG_FIPS
1529L_CFLAGS += -DCONFIG_FIPS
1530endif
1531
1532OBJS += $(SHA1OBJS) $(DESOBJS)
1533
1534OBJS_p += $(SHA1OBJS)
1535OBJS_p += $(SHA256OBJS)
1536
1537ifdef CONFIG_BGSCAN_SIMPLE
1538L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE
1539OBJS += bgscan_simple.c
1540NEED_BGSCAN=y
1541endif
1542
1543ifdef CONFIG_BGSCAN_LEARN
1544L_CFLAGS += -DCONFIG_BGSCAN_LEARN
1545OBJS += bgscan_learn.c
1546NEED_BGSCAN=y
1547endif
1548
1549ifdef NEED_BGSCAN
1550L_CFLAGS += -DCONFIG_BGSCAN
1551OBJS += bgscan.c
1552endif
1553
1554ifdef CONFIG_AUTOSCAN_EXPONENTIAL
1555L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
1556OBJS += autoscan_exponential.c
1557NEED_AUTOSCAN=y
1558endif
1559
1560ifdef CONFIG_AUTOSCAN_PERIODIC
1561L_CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
1562OBJS += autoscan_periodic.c
1563NEED_AUTOSCAN=y
1564endif
1565
1566ifdef NEED_AUTOSCAN
1567L_CFLAGS += -DCONFIG_AUTOSCAN
1568OBJS += autoscan.c
1569endif
1570
1571ifdef CONFIG_EXT_PASSWORD_TEST
1572OBJS += src/utils/ext_password_test.c
1573L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
1574NEED_EXT_PASSWORD=y
1575endif
1576
1577ifdef NEED_EXT_PASSWORD
1578OBJS += src/utils/ext_password.c
1579L_CFLAGS += -DCONFIG_EXT_PASSWORD
1580endif
1581
1582ifdef NEED_GAS_SERVER
1583OBJS += src/common/gas_server.c
1584L_CFLAGS += -DCONFIG_GAS_SERVER
1585NEED_GAS=y
1586endif
1587
1588ifdef NEED_GAS
1589OBJS += src/common/gas.c
1590OBJS += gas_query.c
1591L_CFLAGS += -DCONFIG_GAS
1592NEED_OFFCHANNEL=y
1593endif
1594
1595ifdef NEED_OFFCHANNEL
1596OBJS += offchannel.c
1597L_CFLAGS += -DCONFIG_OFFCHANNEL
1598endif
1599
1600ifdef NEED_JSON
1601OBJS += src/utils/json.c
1602L_CFLAGS += -DCONFIG_JSON
1603endif
1604
1605OBJS += src/drivers/driver_common.c
1606
1607OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c
1608OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c
1609OBJS_t += src/radius/radius_client.c
1610OBJS_t += src/radius/radius.c
1611ifndef CONFIG_AP
1612OBJS_t += src/utils/ip_addr.c
1613endif
1614OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c
1615OBJS += $(CONFIG_MAIN).c
1616
1617ifdef CONFIG_PRIVSEP
1618OBJS_priv += $(OBJS_d) src/drivers/drivers.c
1619OBJS_priv += $(OBJS_l2)
1620OBJS_priv += src/utils/os_$(CONFIG_OS).c
1621OBJS_priv += src/utils/$(CONFIG_ELOOP).c
1622OBJS_priv += src/utils/common.c
1623OBJS_priv += src/utils/wpa_debug.c
1624OBJS_priv += src/utils/wpabuf.c
1625OBJS_priv += wpa_priv.c
1626ifdef CONFIG_DRIVER_NL80211
1627OBJS_priv += src/common/ieee802_11_common.c
1628endif
1629OBJS += src/l2_packet/l2_packet_privsep.c
1630OBJS += src/drivers/driver_privsep.c
1631EXTRA_progs += wpa_priv
1632else
1633OBJS += $(OBJS_d) src/drivers/drivers.c
1634OBJS += $(OBJS_l2)
1635endif
1636
1637ifdef CONFIG_NDIS_EVENTS_INTEGRATED
1638L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
1639OBJS += src/drivers/ndis_events.c
1640EXTRALIBS += -loleaut32 -lole32 -luuid
1641ifdef PLATFORMSDKLIB
1642EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
1643else
1644EXTRALIBS += WbemUuid.Lib
1645endif
1646endif
1647
1648ifndef LDO
1649LDO=$(CC)
1650endif
1651
1652########################
1653
1654include $(CLEAR_VARS)
1655LOCAL_MODULE := wpa_cli
1656LOCAL_MODULE_TAGS := debug
1657LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1658LOCAL_CFLAGS := $(L_CFLAGS)
1659LOCAL_SRC_FILES := $(OBJS_c)
1660LOCAL_C_INCLUDES := $(INCLUDES)
1661include $(BUILD_EXECUTABLE)
1662
1663########################
1664include $(CLEAR_VARS)
1665LOCAL_MODULE := wpa_supplicant
1666ifdef CONFIG_DRIVER_CUSTOM
1667LOCAL_STATIC_LIBRARIES := libCustomWifi
1668endif
1669ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
1670LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB)
1671endif
1672LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1673ifdef CONFIG_EAP_PROXY
1674LOCAL_STATIC_LIBRARIES += $(LIB_STATIC_EAP_PROXY)
1675LOCAL_SHARED_LIBRARIES += $(LIB_SHARED_EAP_PROXY)
1676endif
1677ifeq ($(CONFIG_TLS), openssl)
1678LOCAL_SHARED_LIBRARIES += libcrypto libssl libkeystore_binder
1679endif
1680
1681# With BoringSSL we need libkeystore-engine in order to provide access to
1682# keystore keys.
1683LOCAL_SHARED_LIBRARIES += libkeystore-engine
1684
1685ifdef CONFIG_DRIVER_NL80211
1686ifneq ($(wildcard external/libnl),)
1687LOCAL_SHARED_LIBRARIES += libnl
1688else
1689LOCAL_STATIC_LIBRARIES += libnl_2
1690endif
1691endif
1692LOCAL_CFLAGS := $(L_CFLAGS)
1693LOCAL_SRC_FILES := $(OBJS)
1694LOCAL_C_INCLUDES := $(INCLUDES)
1695ifeq ($(DBUS), y)
1696LOCAL_SHARED_LIBRARIES += libdbus
1697endif
1698ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
1699LOCAL_SHARED_LIBRARIES += libbinder libutils
1700LOCAL_STATIC_LIBRARIES += libwpa_binder libwpa_binder_interface
1701endif
1702include $(BUILD_EXECUTABLE)
1703
1704########################
1705#
1706#include $(CLEAR_VARS)
1707#LOCAL_MODULE := eapol_test
1708#ifdef CONFIG_DRIVER_CUSTOM
1709#LOCAL_STATIC_LIBRARIES := libCustomWifi
1710#endif
1711#LOCAL_SHARED_LIBRARIES := libc libcrypto libssl
1712#LOCAL_CFLAGS := $(L_CFLAGS)
1713#LOCAL_SRC_FILES := $(OBJS_t)
1714#LOCAL_C_INCLUDES := $(INCLUDES)
1715#include $(BUILD_EXECUTABLE)
1716#
1717########################
1718#
1719#local_target_dir := $(TARGET_OUT)/etc/wifi
1720#
1721#include $(CLEAR_VARS)
1722#LOCAL_MODULE := wpa_supplicant.conf
1723#LOCAL_MODULE_CLASS := ETC
1724#LOCAL_MODULE_PATH := $(local_target_dir)
1725#LOCAL_SRC_FILES := $(LOCAL_MODULE)
1726#include $(BUILD_PREBUILT)
1727#
1728########################
1729
1730include $(CLEAR_VARS)
1731LOCAL_MODULE = libwpa_client
1732LOCAL_CFLAGS = $(L_CFLAGS)
1733LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c
1734LOCAL_C_INCLUDES = $(INCLUDES)
1735LOCAL_SHARED_LIBRARIES := libcutils liblog
1736LOCAL_COPY_HEADERS_TO := libwpa_client
1737LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h
1738LOCAL_COPY_HEADERS += src/common/qca-vendor.h
1739include $(BUILD_SHARED_LIBRARY)
1740
1741ifeq ($(WPA_SUPPLICANT_USE_BINDER), y)
1742### Binder interface library ###
1743########################
1744
1745include $(CLEAR_VARS)
1746LOCAL_MODULE := libwpa_binder_interface
1747LOCAL_AIDL_INCLUDES := \
1748    $(LOCAL_PATH)/binder \
1749    frameworks/native/aidl/binder
1750LOCAL_EXPORT_C_INCLUDE_DIRS := \
1751    $(LOCAL_PATH)/binder
1752LOCAL_CPPFLAGS := $(L_CPPFLAGS)
1753LOCAL_SRC_FILES := \
1754    binder/binder_constants.cpp \
1755    binder/fi/w1/wpa_supplicant/ISupplicant.aidl \
1756    binder/fi/w1/wpa_supplicant/ISupplicantCallbacks.aidl \
1757    binder/fi/w1/wpa_supplicant/IIface.aidl
1758LOCAL_SHARED_LIBRARIES := libbinder
1759include $(BUILD_STATIC_LIBRARY)
1760
1761### Binder service library ###
1762########################
1763
1764include $(CLEAR_VARS)
1765LOCAL_MODULE := libwpa_binder
1766LOCAL_CPPFLAGS := $(L_CPPFLAGS)
1767LOCAL_CFLAGS := $(L_CFLAGS)
1768LOCAL_C_INCLUDES := $(INCLUDES)
1769LOCAL_SRC_FILES := \
1770    binder/binder.cpp binder/binder_manager.cpp \
1771    binder/supplicant.cpp binder/iface.cpp
1772LOCAL_SHARED_LIBRARIES := \
1773    libbinder \
1774    libutils
1775LOCAL_STATIC_LIBRARIES := libwpa_binder_interface
1776include $(BUILD_STATIC_LIBRARY)
1777
1778endif # BINDER == y
1779