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