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