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