1# Copyright (C) 2008 The Android Open Source Project
2#
3# This software may be distributed under the terms of the BSD license.
4# See README for more details.
5#
6
7LOCAL_PATH := $(call my-dir)
8
9WPA_BUILD_HOSTAPD := false
10ifneq ($(BOARD_HOSTAPD_DRIVER),)
11  WPA_BUILD_HOSTAPD := true
12  CONFIG_DRIVER_$(BOARD_HOSTAPD_DRIVER) := y
13endif
14
15ifeq ($(WPA_BUILD_HOSTAPD),true)
16
17include $(LOCAL_PATH)/android.config
18
19# To ignore possible wrong network configurations
20L_CFLAGS = -DWPA_IGNORE_CONFIG_ERRORS
21
22L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
23
24# Set Android log name
25L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
26
27# Disable unused parameter warnings
28L_CFLAGS += -Wno-unused-parameter
29
30# Disable macro redefined warnings
31L_CFLAGS += -Wno-macro-redefined
32
33# Set Android extended P2P functionality
34L_CFLAGS += -DANDROID_P2P
35
36ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
37L_CFLAGS += -DANDROID_LIB_STUB
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/system/hostapd\"
43
44# Use Android specific directory for hostapd_cli command completion history
45L_CFLAGS += -DCONFIG_HOSTAPD_CLI_HISTORY_DIR=\"/data/misc/wifi\"
46
47# To force sizeof(enum) = 4
48ifeq ($(TARGET_ARCH),arm)
49L_CFLAGS += -mabi=aapcs-linux
50endif
51
52INCLUDES = $(LOCAL_PATH)
53INCLUDES += $(LOCAL_PATH)/src
54INCLUDES += $(LOCAL_PATH)/src/utils
55INCLUDES += system/security/keystore/include
56ifdef CONFIG_DRIVER_NL80211
57ifneq ($(wildcard external/libnl),)
58INCLUDES += external/libnl/include
59else
60INCLUDES += external/libnl-headers
61endif
62endif
63
64
65ifndef CONFIG_OS
66ifdef CONFIG_NATIVE_WINDOWS
67CONFIG_OS=win32
68else
69CONFIG_OS=unix
70endif
71endif
72
73ifeq ($(CONFIG_OS), internal)
74L_CFLAGS += -DOS_NO_C_LIB_DEFINES
75endif
76
77ifdef CONFIG_NATIVE_WINDOWS
78L_CFLAGS += -DCONFIG_NATIVE_WINDOWS
79LIBS += -lws2_32
80endif
81
82OBJS = main.c
83OBJS += config_file.c
84
85OBJS += src/ap/hostapd.c
86OBJS += src/ap/wpa_auth_glue.c
87OBJS += src/ap/drv_callbacks.c
88OBJS += src/ap/ap_drv_ops.c
89OBJS += src/ap/utils.c
90OBJS += src/ap/authsrv.c
91OBJS += src/ap/ieee802_1x.c
92OBJS += src/ap/ap_config.c
93OBJS += src/ap/eap_user_db.c
94OBJS += src/ap/ieee802_11_auth.c
95OBJS += src/ap/sta_info.c
96OBJS += src/ap/wpa_auth.c
97OBJS += src/ap/tkip_countermeasures.c
98OBJS += src/ap/ap_mlme.c
99OBJS += src/ap/wpa_auth_ie.c
100OBJS += src/ap/preauth_auth.c
101OBJS += src/ap/pmksa_cache_auth.c
102OBJS += src/ap/ieee802_11_shared.c
103OBJS += src/ap/beacon.c
104OBJS += src/ap/bss_load.c
105OBJS += src/ap/neighbor_db.c
106OBJS += src/ap/rrm.c
107OBJS_d =
108OBJS_p =
109LIBS =
110LIBS_c =
111HOBJS =
112LIBS_h =
113
114NEED_RC4=y
115NEED_AES=y
116NEED_MD5=y
117NEED_SHA1=y
118
119OBJS += src/drivers/drivers.c
120L_CFLAGS += -DHOSTAPD
121
122ifdef CONFIG_WPA_TRACE
123L_CFLAGS += -DWPA_TRACE
124OBJS += src/utils/trace.c
125HOBJS += src/utils/trace.c
126LDFLAGS += -rdynamic
127L_CFLAGS += -funwind-tables
128ifdef CONFIG_WPA_TRACE_BFD
129L_CFLAGS += -DWPA_TRACE_BFD
130LIBS += -lbfd
131LIBS_c += -lbfd
132LIBS_h += -lbfd
133endif
134endif
135
136OBJS += src/utils/eloop.c
137
138ifdef CONFIG_ELOOP_POLL
139L_CFLAGS += -DCONFIG_ELOOP_POLL
140endif
141
142ifdef CONFIG_ELOOP_EPOLL
143L_CFLAGS += -DCONFIG_ELOOP_EPOLL
144endif
145
146OBJS += src/utils/common.c
147OBJS += src/utils/wpa_debug.c
148OBJS += src/utils/wpabuf.c
149OBJS += src/utils/os_$(CONFIG_OS).c
150OBJS += src/utils/ip_addr.c
151
152OBJS += src/common/ieee802_11_common.c
153OBJS += src/common/wpa_common.c
154OBJS += src/common/hw_features_common.c
155
156OBJS += src/eapol_auth/eapol_auth_sm.c
157
158ifndef CONFIG_NO_DUMP_STATE
159# define HOSTAPD_DUMP_STATE to include support for dumping internal state
160# through control interface commands (undefine it, if you want to save in
161# binary size)
162L_CFLAGS += -DHOSTAPD_DUMP_STATE
163OBJS += src/eapol_auth/eapol_auth_dump.c
164endif
165
166ifdef CONFIG_NO_RADIUS
167L_CFLAGS += -DCONFIG_NO_RADIUS
168CONFIG_NO_ACCOUNTING=y
169else
170OBJS += src/radius/radius.c
171OBJS += src/radius/radius_client.c
172OBJS += src/radius/radius_das.c
173endif
174
175ifdef CONFIG_NO_ACCOUNTING
176L_CFLAGS += -DCONFIG_NO_ACCOUNTING
177else
178OBJS += src/ap/accounting.c
179endif
180
181ifdef CONFIG_NO_VLAN
182L_CFLAGS += -DCONFIG_NO_VLAN
183else
184OBJS += src/ap/vlan_init.c
185OBJS += src/ap/vlan_ifconfig.c
186OBJS += src/ap/vlan.c
187ifdef CONFIG_FULL_DYNAMIC_VLAN
188# Define CONFIG_FULL_DYNAMIC_VLAN to have hostapd manipulate bridges
189# and VLAN interfaces for the VLAN feature.
190L_CFLAGS += -DCONFIG_FULL_DYNAMIC_VLAN
191OBJS += src/ap/vlan_full.c
192ifdef CONFIG_VLAN_NETLINK
193OBJS += src/ap/vlan_util.c
194else
195OBJS += src/ap/vlan_ioctl.c
196endif
197endif
198endif
199
200ifdef CONFIG_NO_CTRL_IFACE
201L_CFLAGS += -DCONFIG_NO_CTRL_IFACE
202else
203OBJS += src/common/ctrl_iface_common.c
204OBJS += ctrl_iface.c
205OBJS += src/ap/ctrl_iface_ap.c
206endif
207
208L_CFLAGS += -DCONFIG_CTRL_IFACE -DCONFIG_CTRL_IFACE_UNIX
209
210ifdef CONFIG_IAPP
211L_CFLAGS += -DCONFIG_IAPP
212OBJS += src/ap/iapp.c
213endif
214
215ifdef CONFIG_RSN_PREAUTH
216L_CFLAGS += -DCONFIG_RSN_PREAUTH
217CONFIG_L2_PACKET=y
218endif
219
220ifdef CONFIG_PEERKEY
221L_CFLAGS += -DCONFIG_PEERKEY
222OBJS += src/ap/peerkey_auth.c
223endif
224
225ifdef CONFIG_HS20
226NEED_AES_OMAC1=y
227CONFIG_PROXYARP=y
228endif
229
230ifdef CONFIG_PROXYARP
231CONFIG_L2_PACKET=y
232endif
233
234ifdef CONFIG_SUITEB
235L_CFLAGS += -DCONFIG_SUITEB
236NEED_SHA256=y
237NEED_AES_OMAC1=y
238endif
239
240ifdef CONFIG_SUITEB192
241L_CFLAGS += -DCONFIG_SUITEB192
242NEED_SHA384=y
243endif
244
245ifdef CONFIG_IEEE80211W
246L_CFLAGS += -DCONFIG_IEEE80211W
247NEED_SHA256=y
248NEED_AES_OMAC1=y
249endif
250
251ifdef CONFIG_IEEE80211R
252L_CFLAGS += -DCONFIG_IEEE80211R -DCONFIG_IEEE80211R_AP
253OBJS += src/ap/wpa_auth_ft.c
254NEED_SHA256=y
255NEED_AES_OMAC1=y
256NEED_AES_UNWRAP=y
257endif
258
259ifdef CONFIG_SAE
260L_CFLAGS += -DCONFIG_SAE
261OBJS += src/common/sae.c
262NEED_ECC=y
263NEED_DH_GROUPS=y
264endif
265
266ifdef CONFIG_FILS
267L_CFLAGS += -DCONFIG_FILS
268OBJS += src/ap/fils_hlp.c
269NEED_SHA384=y
270NEED_AES_SIV=y
271endif
272
273ifdef CONFIG_WNM
274L_CFLAGS += -DCONFIG_WNM
275OBJS += src/ap/wnm_ap.c
276endif
277
278ifdef CONFIG_IEEE80211N
279L_CFLAGS += -DCONFIG_IEEE80211N
280endif
281
282ifdef CONFIG_IEEE80211AC
283L_CFLAGS += -DCONFIG_IEEE80211AC
284endif
285
286ifdef CONFIG_IEEE80211AX
287L_CFLAGS += -DCONFIG_IEEE80211AX
288endif
289
290ifdef CONFIG_MBO
291L_CFLAGS += -DCONFIG_MBO
292OBJS += src/ap/mbo_ap.c
293endif
294
295ifdef CONFIG_FST
296L_CFLAGS += -DCONFIG_FST
297OBJS += src/fst/fst.c
298OBJS += src/fst/fst_group.c
299OBJS += src/fst/fst_iface.c
300OBJS += src/fst/fst_session.c
301OBJS += src/fst/fst_ctrl_aux.c
302ifdef CONFIG_FST_TEST
303L_CFLAGS += -DCONFIG_FST_TEST
304endif
305ifndef CONFIG_NO_CTRL_IFACE
306OBJS += src/fst/fst_ctrl_iface.c
307endif
308endif
309
310
311include $(LOCAL_PATH)/src/drivers/drivers.mk
312
313OBJS += $(DRV_AP_OBJS)
314L_CFLAGS += $(DRV_AP_CFLAGS)
315LDFLAGS += $(DRV_AP_LDFLAGS)
316LIBS += $(DRV_AP_LIBS)
317
318ifdef CONFIG_L2_PACKET
319ifdef CONFIG_DNET_PCAP
320ifdef CONFIG_L2_FREEBSD
321LIBS += -lpcap
322OBJS += src/l2_packet/l2_packet_freebsd.c
323else
324LIBS += -ldnet -lpcap
325OBJS += src/l2_packet/l2_packet_pcap.c
326endif
327else
328OBJS += src/l2_packet/l2_packet_linux.c
329endif
330else
331OBJS += src/l2_packet/l2_packet_none.c
332endif
333
334
335ifdef CONFIG_EAP_MD5
336L_CFLAGS += -DEAP_SERVER_MD5
337OBJS += src/eap_server/eap_server_md5.c
338CHAP=y
339endif
340
341ifdef CONFIG_EAP_TLS
342L_CFLAGS += -DEAP_SERVER_TLS
343OBJS += src/eap_server/eap_server_tls.c
344TLS_FUNCS=y
345endif
346
347ifdef CONFIG_EAP_UNAUTH_TLS
348L_CFLAGS += -DEAP_SERVER_UNAUTH_TLS
349ifndef CONFIG_EAP_TLS
350OBJS += src/eap_server/eap_server_tls.c
351TLS_FUNCS=y
352endif
353endif
354
355ifdef CONFIG_EAP_PEAP
356L_CFLAGS += -DEAP_SERVER_PEAP
357OBJS += src/eap_server/eap_server_peap.c
358OBJS += src/eap_common/eap_peap_common.c
359TLS_FUNCS=y
360CONFIG_EAP_MSCHAPV2=y
361endif
362
363ifdef CONFIG_EAP_TTLS
364L_CFLAGS += -DEAP_SERVER_TTLS
365OBJS += src/eap_server/eap_server_ttls.c
366TLS_FUNCS=y
367CHAP=y
368endif
369
370ifdef CONFIG_EAP_MSCHAPV2
371L_CFLAGS += -DEAP_SERVER_MSCHAPV2
372OBJS += src/eap_server/eap_server_mschapv2.c
373MS_FUNCS=y
374endif
375
376ifdef CONFIG_EAP_GTC
377L_CFLAGS += -DEAP_SERVER_GTC
378OBJS += src/eap_server/eap_server_gtc.c
379endif
380
381ifdef CONFIG_EAP_SIM
382L_CFLAGS += -DEAP_SERVER_SIM
383OBJS += src/eap_server/eap_server_sim.c
384CONFIG_EAP_SIM_COMMON=y
385NEED_AES_CBC=y
386endif
387
388ifdef CONFIG_EAP_AKA
389L_CFLAGS += -DEAP_SERVER_AKA
390OBJS += src/eap_server/eap_server_aka.c
391CONFIG_EAP_SIM_COMMON=y
392NEED_SHA256=y
393NEED_AES_CBC=y
394endif
395
396ifdef CONFIG_EAP_AKA_PRIME
397L_CFLAGS += -DEAP_SERVER_AKA_PRIME
398endif
399
400ifdef CONFIG_EAP_SIM_COMMON
401OBJS += src/eap_common/eap_sim_common.c
402# Example EAP-SIM/AKA interface for GSM/UMTS authentication. This can be
403# replaced with another file implementating the interface specified in
404# eap_sim_db.h.
405OBJS += src/eap_server/eap_sim_db.c
406NEED_FIPS186_2_PRF=y
407endif
408
409ifdef CONFIG_EAP_PAX
410L_CFLAGS += -DEAP_SERVER_PAX
411OBJS += src/eap_server/eap_server_pax.c src/eap_common/eap_pax_common.c
412endif
413
414ifdef CONFIG_EAP_PSK
415L_CFLAGS += -DEAP_SERVER_PSK
416OBJS += src/eap_server/eap_server_psk.c src/eap_common/eap_psk_common.c
417NEED_AES_OMAC1=y
418NEED_AES_ENCBLOCK=y
419NEED_AES_EAX=y
420endif
421
422ifdef CONFIG_EAP_SAKE
423L_CFLAGS += -DEAP_SERVER_SAKE
424OBJS += src/eap_server/eap_server_sake.c src/eap_common/eap_sake_common.c
425endif
426
427ifdef CONFIG_EAP_GPSK
428L_CFLAGS += -DEAP_SERVER_GPSK
429OBJS += src/eap_server/eap_server_gpsk.c src/eap_common/eap_gpsk_common.c
430ifdef CONFIG_EAP_GPSK_SHA256
431L_CFLAGS += -DEAP_GPSK_SHA256
432endif
433NEED_SHA256=y
434NEED_AES_OMAC1=y
435endif
436
437ifdef CONFIG_EAP_PWD
438L_CFLAGS += -DEAP_SERVER_PWD
439OBJS += src/eap_server/eap_server_pwd.c src/eap_common/eap_pwd_common.c
440NEED_SHA256=y
441endif
442
443ifdef CONFIG_EAP_EKE
444L_CFLAGS += -DEAP_SERVER_EKE
445OBJS += src/eap_server/eap_server_eke.c src/eap_common/eap_eke_common.c
446NEED_DH_GROUPS=y
447NEED_DH_GROUPS_ALL=y
448endif
449
450ifdef CONFIG_EAP_VENDOR_TEST
451L_CFLAGS += -DEAP_SERVER_VENDOR_TEST
452OBJS += src/eap_server/eap_server_vendor_test.c
453endif
454
455ifdef CONFIG_EAP_FAST
456L_CFLAGS += -DEAP_SERVER_FAST
457OBJS += src/eap_server/eap_server_fast.c
458OBJS += src/eap_common/eap_fast_common.c
459TLS_FUNCS=y
460NEED_T_PRF=y
461NEED_AES_UNWRAP=y
462endif
463
464ifdef CONFIG_WPS
465L_CFLAGS += -DCONFIG_WPS -DEAP_SERVER_WSC
466OBJS += src/utils/uuid.c
467OBJS += src/ap/wps_hostapd.c
468OBJS += src/eap_server/eap_server_wsc.c src/eap_common/eap_wsc_common.c
469OBJS += src/wps/wps.c
470OBJS += src/wps/wps_common.c
471OBJS += src/wps/wps_attr_parse.c
472OBJS += src/wps/wps_attr_build.c
473OBJS += src/wps/wps_attr_process.c
474OBJS += src/wps/wps_dev_attr.c
475OBJS += src/wps/wps_enrollee.c
476OBJS += src/wps/wps_registrar.c
477NEED_DH_GROUPS=y
478NEED_SHA256=y
479NEED_BASE64=y
480NEED_AES_CBC=y
481NEED_MODEXP=y
482CONFIG_EAP=y
483
484ifdef CONFIG_WPS_NFC
485L_CFLAGS += -DCONFIG_WPS_NFC
486OBJS += src/wps/ndef.c
487NEED_WPS_OOB=y
488endif
489
490ifdef NEED_WPS_OOB
491L_CFLAGS += -DCONFIG_WPS_OOB
492endif
493
494ifdef CONFIG_WPS_UPNP
495L_CFLAGS += -DCONFIG_WPS_UPNP
496OBJS += src/wps/wps_upnp.c
497OBJS += src/wps/wps_upnp_ssdp.c
498OBJS += src/wps/wps_upnp_web.c
499OBJS += src/wps/wps_upnp_event.c
500OBJS += src/wps/wps_upnp_ap.c
501OBJS += src/wps/upnp_xml.c
502OBJS += src/wps/httpread.c
503OBJS += src/wps/http_client.c
504OBJS += src/wps/http_server.c
505endif
506
507ifdef CONFIG_WPS_STRICT
508L_CFLAGS += -DCONFIG_WPS_STRICT
509OBJS += src/wps/wps_validate.c
510endif
511
512ifdef CONFIG_WPS_TESTING
513L_CFLAGS += -DCONFIG_WPS_TESTING
514endif
515
516endif
517
518ifdef CONFIG_EAP_IKEV2
519L_CFLAGS += -DEAP_SERVER_IKEV2
520OBJS += src/eap_server/eap_server_ikev2.c src/eap_server/ikev2.c
521OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c
522NEED_DH_GROUPS=y
523NEED_DH_GROUPS_ALL=y
524NEED_MODEXP=y
525NEED_CIPHER=y
526endif
527
528ifdef CONFIG_EAP_TNC
529L_CFLAGS += -DEAP_SERVER_TNC
530OBJS += src/eap_server/eap_server_tnc.c
531OBJS += src/eap_server/tncs.c
532NEED_BASE64=y
533ifndef CONFIG_DRIVER_BSD
534LIBS += -ldl
535endif
536endif
537
538# Basic EAP functionality is needed for EAPOL
539OBJS += eap_register.c
540OBJS += src/eap_server/eap_server.c
541OBJS += src/eap_common/eap_common.c
542OBJS += src/eap_server/eap_server_methods.c
543OBJS += src/eap_server/eap_server_identity.c
544L_CFLAGS += -DEAP_SERVER_IDENTITY
545
546ifdef CONFIG_EAP
547L_CFLAGS += -DEAP_SERVER
548endif
549
550ifdef CONFIG_PKCS12
551L_CFLAGS += -DPKCS12_FUNCS
552endif
553
554ifdef MS_FUNCS
555OBJS += src/crypto/ms_funcs.c
556NEED_DES=y
557NEED_MD4=y
558endif
559
560ifdef CHAP
561OBJS += src/eap_common/chap.c
562endif
563
564ifdef TLS_FUNCS
565NEED_DES=y
566# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, and EAP_TTLS)
567L_CFLAGS += -DEAP_TLS_FUNCS
568OBJS += src/eap_server/eap_server_tls_common.c
569NEED_TLS_PRF=y
570endif
571
572ifndef CONFIG_TLS
573CONFIG_TLS=openssl
574endif
575
576ifdef CONFIG_TLSV11
577L_CFLAGS += -DCONFIG_TLSV11
578endif
579
580ifdef CONFIG_TLSV12
581L_CFLAGS += -DCONFIG_TLSV12
582NEED_SHA256=y
583endif
584
585ifeq ($(CONFIG_TLS), openssl)
586ifdef TLS_FUNCS
587OBJS += src/crypto/tls_openssl.c
588OBJS += src/crypto/tls_openssl_ocsp.c
589LIBS += -lssl
590endif
591OBJS += src/crypto/crypto_openssl.c
592HOBJS += src/crypto/crypto_openssl.c
593ifdef NEED_FIPS186_2_PRF
594OBJS += src/crypto/fips_prf_openssl.c
595endif
596NEED_SHA256=y
597NEED_TLS_PRF_SHA256=y
598LIBS += -lcrypto
599LIBS_h += -lcrypto
600endif
601
602ifeq ($(CONFIG_TLS), gnutls)
603ifdef TLS_FUNCS
604OBJS += src/crypto/tls_gnutls.c
605LIBS += -lgnutls -lgpg-error
606endif
607OBJS += src/crypto/crypto_gnutls.c
608HOBJS += src/crypto/crypto_gnutls.c
609ifdef NEED_FIPS186_2_PRF
610OBJS += src/crypto/fips_prf_internal.c
611OBJS += src/crypto/sha1-internal.c
612endif
613LIBS += -lgcrypt
614LIBS_h += -lgcrypt
615CONFIG_INTERNAL_SHA256=y
616CONFIG_INTERNAL_RC4=y
617CONFIG_INTERNAL_DH_GROUP5=y
618endif
619
620ifeq ($(CONFIG_TLS), internal)
621ifndef CONFIG_CRYPTO
622CONFIG_CRYPTO=internal
623endif
624ifdef TLS_FUNCS
625OBJS += src/crypto/crypto_internal-rsa.c
626OBJS += src/crypto/tls_internal.c
627OBJS += src/tls/tlsv1_common.c
628OBJS += src/tls/tlsv1_record.c
629OBJS += src/tls/tlsv1_cred.c
630OBJS += src/tls/tlsv1_server.c
631OBJS += src/tls/tlsv1_server_write.c
632OBJS += src/tls/tlsv1_server_read.c
633OBJS += src/tls/asn1.c
634OBJS += src/tls/rsa.c
635OBJS += src/tls/x509v3.c
636OBJS += src/tls/pkcs1.c
637OBJS += src/tls/pkcs5.c
638OBJS += src/tls/pkcs8.c
639NEED_SHA256=y
640NEED_BASE64=y
641NEED_TLS_PRF=y
642ifdef CONFIG_TLSV12
643NEED_TLS_PRF_SHA256=y
644endif
645NEED_MODEXP=y
646NEED_CIPHER=y
647L_CFLAGS += -DCONFIG_TLS_INTERNAL
648L_CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
649endif
650ifdef NEED_CIPHER
651NEED_DES=y
652OBJS += src/crypto/crypto_internal-cipher.c
653endif
654ifdef NEED_MODEXP
655OBJS += src/crypto/crypto_internal-modexp.c
656OBJS += src/tls/bignum.c
657endif
658ifeq ($(CONFIG_CRYPTO), libtomcrypt)
659OBJS += src/crypto/crypto_libtomcrypt.c
660LIBS += -ltomcrypt -ltfm
661LIBS_h += -ltomcrypt -ltfm
662CONFIG_INTERNAL_SHA256=y
663CONFIG_INTERNAL_RC4=y
664CONFIG_INTERNAL_DH_GROUP5=y
665endif
666ifeq ($(CONFIG_CRYPTO), internal)
667OBJS += src/crypto/crypto_internal.c
668NEED_AES_DEC=y
669L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL
670ifdef CONFIG_INTERNAL_LIBTOMMATH
671L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
672ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
673L_CFLAGS += -DLTM_FAST
674endif
675else
676LIBS += -ltommath
677LIBS_h += -ltommath
678endif
679CONFIG_INTERNAL_AES=y
680CONFIG_INTERNAL_DES=y
681CONFIG_INTERNAL_SHA1=y
682CONFIG_INTERNAL_MD4=y
683CONFIG_INTERNAL_MD5=y
684CONFIG_INTERNAL_SHA256=y
685CONFIG_INTERNAL_SHA384=y
686CONFIG_INTERNAL_SHA512=y
687CONFIG_INTERNAL_RC4=y
688CONFIG_INTERNAL_DH_GROUP5=y
689endif
690ifeq ($(CONFIG_CRYPTO), cryptoapi)
691OBJS += src/crypto/crypto_cryptoapi.c
692OBJS_p += src/crypto/crypto_cryptoapi.c
693L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
694CONFIG_INTERNAL_SHA256=y
695CONFIG_INTERNAL_RC4=y
696endif
697endif
698
699ifeq ($(CONFIG_TLS), none)
700ifdef TLS_FUNCS
701OBJS += src/crypto/tls_none.c
702L_CFLAGS += -DEAP_TLS_NONE
703CONFIG_INTERNAL_AES=y
704CONFIG_INTERNAL_SHA1=y
705CONFIG_INTERNAL_MD5=y
706endif
707OBJS += src/crypto/crypto_none.c
708OBJS_p += src/crypto/crypto_none.c
709CONFIG_INTERNAL_SHA256=y
710CONFIG_INTERNAL_RC4=y
711endif
712
713ifndef TLS_FUNCS
714OBJS += src/crypto/tls_none.c
715ifeq ($(CONFIG_TLS), internal)
716CONFIG_INTERNAL_AES=y
717CONFIG_INTERNAL_SHA1=y
718CONFIG_INTERNAL_MD5=y
719CONFIG_INTERNAL_RC4=y
720endif
721endif
722
723AESOBJS = # none so far
724ifdef CONFIG_INTERNAL_AES
725AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-enc.c
726endif
727
728ifneq ($(CONFIG_TLS), openssl)
729AESOBJS += src/crypto/aes-wrap.c
730endif
731ifdef NEED_AES_EAX
732AESOBJS += src/crypto/aes-eax.c
733NEED_AES_CTR=y
734endif
735ifdef NEED_AES_CTR
736AESOBJS += src/crypto/aes-ctr.c
737endif
738ifdef NEED_AES_ENCBLOCK
739AESOBJS += src/crypto/aes-encblock.c
740endif
741ifdef NEED_AES_OMAC1
742AESOBJS += src/crypto/aes-omac1.c
743endif
744ifdef NEED_AES_UNWRAP
745ifneq ($(CONFIG_TLS), openssl)
746NEED_AES_DEC=y
747AESOBJS += src/crypto/aes-unwrap.c
748endif
749endif
750ifdef NEED_AES_CBC
751NEED_AES_DEC=y
752ifneq ($(CONFIG_TLS), openssl)
753AESOBJS += src/crypto/aes-cbc.c
754endif
755endif
756ifdef NEED_AES_SIV
757AESOBJS += src/crypto/aes-siv.c
758endif
759ifdef NEED_AES_DEC
760ifdef CONFIG_INTERNAL_AES
761AESOBJS += src/crypto/aes-internal-dec.c
762endif
763endif
764ifdef NEED_AES
765OBJS += $(AESOBJS)
766endif
767
768SHA1OBJS =
769ifdef NEED_SHA1
770ifneq ($(CONFIG_TLS), openssl)
771SHA1OBJS += src/crypto/sha1.c
772endif
773SHA1OBJS += src/crypto/sha1-prf.c
774ifdef CONFIG_INTERNAL_SHA1
775SHA1OBJS += src/crypto/sha1-internal.c
776ifdef NEED_FIPS186_2_PRF
777SHA1OBJS += src/crypto/fips_prf_internal.c
778endif
779endif
780ifneq ($(CONFIG_TLS), openssl)
781SHA1OBJS += src/crypto/sha1-pbkdf2.c
782endif
783ifdef NEED_T_PRF
784SHA1OBJS += src/crypto/sha1-tprf.c
785endif
786ifdef NEED_TLS_PRF
787SHA1OBJS += src/crypto/sha1-tlsprf.c
788endif
789endif
790
791ifdef NEED_SHA1
792OBJS += $(SHA1OBJS)
793endif
794
795ifneq ($(CONFIG_TLS), openssl)
796OBJS += src/crypto/md5.c
797endif
798
799ifdef NEED_MD5
800ifdef CONFIG_INTERNAL_MD5
801OBJS += src/crypto/md5-internal.c
802HOBJS += src/crypto/md5-internal.c
803endif
804endif
805
806ifdef NEED_MD4
807ifdef CONFIG_INTERNAL_MD4
808OBJS += src/crypto/md4-internal.c
809endif
810endif
811
812ifdef NEED_DES
813ifdef CONFIG_INTERNAL_DES
814OBJS += src/crypto/des-internal.c
815endif
816endif
817
818ifdef CONFIG_NO_RC4
819L_CFLAGS += -DCONFIG_NO_RC4
820endif
821
822ifdef NEED_RC4
823ifdef CONFIG_INTERNAL_RC4
824ifndef CONFIG_NO_RC4
825OBJS += src/crypto/rc4.c
826endif
827endif
828endif
829
830ifdef NEED_SHA256
831L_CFLAGS += -DCONFIG_SHA256
832ifneq ($(CONFIG_TLS), openssl)
833OBJS += src/crypto/sha256.c
834endif
835OBJS += src/crypto/sha256-prf.c
836ifdef CONFIG_INTERNAL_SHA256
837OBJS += src/crypto/sha256-internal.c
838endif
839ifdef NEED_TLS_PRF_SHA256
840OBJS += src/crypto/sha256-tlsprf.c
841endif
842endif
843ifdef NEED_SHA384
844L_CFLAGS += -DCONFIG_SHA384
845ifneq ($(CONFIG_TLS), openssl)
846OBJS += src/crypto/sha384.c
847endif
848OBJS += src/crypto/sha384-prf.c
849endif
850
851ifdef CONFIG_INTERNAL_SHA384
852L_CFLAGS += -DCONFIG_INTERNAL_SHA384
853OBJS += src/crypto/sha384-internal.c
854endif
855
856ifdef CONFIG_INTERNAL_SHA512
857L_CFLAGS += -DCONFIG_INTERNAL_SHA512
858OBJS += src/crypto/sha512-internal.c
859endif
860
861ifdef NEED_DH_GROUPS
862OBJS += src/crypto/dh_groups.c
863endif
864ifdef NEED_DH_GROUPS_ALL
865L_CFLAGS += -DALL_DH_GROUPS
866endif
867ifdef CONFIG_INTERNAL_DH_GROUP5
868ifdef NEED_DH_GROUPS
869OBJS += src/crypto/dh_group5.c
870endif
871endif
872
873ifdef NEED_ECC
874L_CFLAGS += -DCONFIG_ECC
875endif
876
877ifdef CONFIG_NO_RANDOM_POOL
878L_CFLAGS += -DCONFIG_NO_RANDOM_POOL
879else
880OBJS += src/crypto/random.c
881HOBJS += src/crypto/random.c
882HOBJS += src/utils/eloop.c
883HOBJS += $(SHA1OBJS)
884ifneq ($(CONFIG_TLS), openssl)
885HOBJS += src/crypto/md5.c
886endif
887endif
888
889ifdef CONFIG_RADIUS_SERVER
890L_CFLAGS += -DRADIUS_SERVER
891OBJS += src/radius/radius_server.c
892endif
893
894ifdef CONFIG_IPV6
895L_CFLAGS += -DCONFIG_IPV6
896endif
897
898ifdef CONFIG_DRIVER_RADIUS_ACL
899L_CFLAGS += -DCONFIG_DRIVER_RADIUS_ACL
900endif
901
902ifdef NEED_BASE64
903OBJS += src/utils/base64.c
904endif
905
906ifdef NEED_AP_MLME
907OBJS += src/ap/wmm.c
908OBJS += src/ap/ap_list.c
909OBJS += src/ap/ieee802_11.c
910OBJS += src/ap/hw_features.c
911OBJS += src/ap/dfs.c
912L_CFLAGS += -DNEED_AP_MLME
913endif
914ifdef CONFIG_IEEE80211N
915OBJS += src/ap/ieee802_11_ht.c
916endif
917
918ifdef CONFIG_IEEE80211AC
919OBJS += src/ap/ieee802_11_vht.c
920endif
921
922ifdef CONFIG_IEEE80211AX
923OBJS += src/ap/ieee802_11_he.c
924endif
925
926ifdef CONFIG_P2P_MANAGER
927L_CFLAGS += -DCONFIG_P2P_MANAGER
928OBJS += src/ap/p2p_hostapd.c
929endif
930
931ifdef CONFIG_HS20
932L_CFLAGS += -DCONFIG_HS20
933OBJS += src/ap/hs20.c
934CONFIG_INTERWORKING=y
935endif
936
937ifdef CONFIG_INTERWORKING
938L_CFLAGS += -DCONFIG_INTERWORKING
939OBJS += src/common/gas.c
940OBJS += src/ap/gas_serv.c
941endif
942
943ifdef CONFIG_PROXYARP
944L_CFLAGS += -DCONFIG_PROXYARP
945OBJS += src/ap/x_snoop.c
946OBJS += src/ap/dhcp_snoop.c
947ifdef CONFIG_IPV6
948OBJS += src/ap/ndisc_snoop.c
949endif
950endif
951
952OBJS += src/drivers/driver_common.c
953
954ifdef CONFIG_ACS
955L_CFLAGS += -DCONFIG_ACS
956OBJS += src/ap/acs.c
957LIBS += -lm
958endif
959
960ifdef CONFIG_NO_STDOUT_DEBUG
961L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
962endif
963
964ifdef CONFIG_DEBUG_SYSLOG
965L_CFLAGS += -DCONFIG_DEBUG_SYSLOG
966endif
967
968ifdef CONFIG_DEBUG_LINUX_TRACING
969L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
970endif
971
972ifdef CONFIG_DEBUG_FILE
973L_CFLAGS += -DCONFIG_DEBUG_FILE
974endif
975
976ifdef CONFIG_ANDROID_LOG
977L_CFLAGS += -DCONFIG_ANDROID_LOG
978endif
979
980OBJS_c = hostapd_cli.c
981OBJS_c += src/common/wpa_ctrl.c
982OBJS_c += src/utils/os_$(CONFIG_OS).c
983OBJS_c += src/common/cli.c
984OBJS_c += src/utils/eloop.c
985OBJS_c += src/utils/common.c
986ifdef CONFIG_WPA_TRACE
987OBJS_c += src/utils/trace.c
988endif
989OBJS_c += src/utils/wpa_debug.c
990ifdef CONFIG_WPA_CLI_EDIT
991OBJS_c += src/utils/edit.c
992else
993OBJS_c += src/utils/edit_simple.c
994endif
995
996########################
997
998include $(CLEAR_VARS)
999LOCAL_MODULE := hostapd_cli
1000LOCAL_MODULE_TAGS := debug
1001LOCAL_PROPRIETARY_MODULE := true
1002LOCAL_SHARED_LIBRARIES := libc libcutils liblog
1003LOCAL_CFLAGS := $(L_CFLAGS)
1004LOCAL_SRC_FILES := $(OBJS_c)
1005LOCAL_C_INCLUDES := $(INCLUDES)
1006include $(BUILD_EXECUTABLE)
1007
1008########################
1009include $(CLEAR_VARS)
1010LOCAL_MODULE := hostapd
1011LOCAL_MODULE_TAGS := optional
1012LOCAL_PROPRIETARY_MODULE := true
1013ifdef CONFIG_DRIVER_CUSTOM
1014LOCAL_STATIC_LIBRARIES := libCustomWifi
1015endif
1016ifneq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
1017LOCAL_STATIC_LIBRARIES += $(BOARD_HOSTAPD_PRIVATE_LIB)
1018endif
1019LOCAL_SHARED_LIBRARIES := libc libcutils liblog libcrypto libssl
1020ifdef CONFIG_DRIVER_NL80211
1021ifneq ($(wildcard external/libnl),)
1022LOCAL_SHARED_LIBRARIES += libnl
1023else
1024LOCAL_STATIC_LIBRARIES += libnl_2
1025endif
1026endif
1027LOCAL_CFLAGS := $(L_CFLAGS)
1028LOCAL_SRC_FILES := $(OBJS)
1029LOCAL_C_INCLUDES := $(INCLUDES)
1030LOCAL_INIT_RC := hostapd.android.rc
1031include $(BUILD_EXECUTABLE)
1032
1033endif # ifeq ($(WPA_BUILD_HOSTAPD),true)
1034