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