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