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/system/wpa_supplicant\" 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 272OBJS += ibss_rsn.c 273endif 274 275ifdef CONFIG_P2P 276OBJS += p2p_supplicant.c 277OBJS += p2p_supplicant_sd.c 278OBJS += src/p2p/p2p.c 279OBJS += src/p2p/p2p_utils.c 280OBJS += src/p2p/p2p_parse.c 281OBJS += src/p2p/p2p_build.c 282OBJS += src/p2p/p2p_go_neg.c 283OBJS += src/p2p/p2p_sd.c 284OBJS += src/p2p/p2p_pd.c 285OBJS += src/p2p/p2p_invitation.c 286OBJS += src/p2p/p2p_dev_disc.c 287OBJS += src/p2p/p2p_group.c 288OBJS += src/ap/p2p_hostapd.c 289OBJS += src/utils/bitfield.c 290L_CFLAGS += -DCONFIG_P2P 291NEED_GAS=y 292NEED_OFFCHANNEL=y 293CONFIG_WPS=y 294CONFIG_AP=y 295ifdef CONFIG_P2P_STRICT 296L_CFLAGS += -DCONFIG_P2P_STRICT 297endif 298endif 299 300ifdef CONFIG_WIFI_DISPLAY 301L_CFLAGS += -DCONFIG_WIFI_DISPLAY 302OBJS += wifi_display.c 303endif 304 305ifdef CONFIG_HS20 306OBJS += hs20_supplicant.c 307L_CFLAGS += -DCONFIG_HS20 308CONFIG_INTERWORKING=y 309NEED_AES_OMAC1=y 310endif 311 312ifdef CONFIG_INTERWORKING 313OBJS += interworking.c 314L_CFLAGS += -DCONFIG_INTERWORKING 315NEED_GAS=y 316endif 317 318include $(LOCAL_PATH)/src/drivers/drivers.mk 319 320ifdef CONFIG_AP 321OBJS_d += $(DRV_BOTH_OBJS) 322L_CFLAGS += $(DRV_BOTH_CFLAGS) 323LDFLAGS += $(DRV_BOTH_LDFLAGS) 324LIBS += $(DRV_BOTH_LIBS) 325else 326NEED_AP_MLME= 327OBJS_d += $(DRV_WPA_OBJS) 328L_CFLAGS += $(DRV_WPA_CFLAGS) 329LDFLAGS += $(DRV_WPA_LDFLAGS) 330LIBS += $(DRV_WPA_LIBS) 331endif 332 333ifndef CONFIG_L2_PACKET 334CONFIG_L2_PACKET=linux 335endif 336 337OBJS_l2 += src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).c 338 339ifeq ($(CONFIG_L2_PACKET), pcap) 340ifdef CONFIG_WINPCAP 341L_CFLAGS += -DCONFIG_WINPCAP 342LIBS += -lwpcap -lpacket 343LIBS_w += -lwpcap 344else 345LIBS += -ldnet -lpcap 346endif 347endif 348 349ifeq ($(CONFIG_L2_PACKET), winpcap) 350LIBS += -lwpcap -lpacket 351LIBS_w += -lwpcap 352endif 353 354ifeq ($(CONFIG_L2_PACKET), freebsd) 355LIBS += -lpcap 356endif 357 358ifdef CONFIG_ERP 359L_CFLAGS += -DCONFIG_ERP 360NEED_SHA256=y 361NEED_HMAC_SHA256_KDF=y 362endif 363 364ifdef CONFIG_EAP_TLS 365# EAP-TLS 366ifeq ($(CONFIG_EAP_TLS), dyn) 367L_CFLAGS += -DEAP_TLS_DYNAMIC 368EAPDYN += src/eap_peer/eap_tls.so 369else 370L_CFLAGS += -DEAP_TLS 371OBJS += src/eap_peer/eap_tls.c 372OBJS_h += src/eap_server/eap_server_tls.c 373endif 374TLS_FUNCS=y 375CONFIG_IEEE8021X_EAPOL=y 376endif 377 378ifdef CONFIG_EAP_UNAUTH_TLS 379# EAP-UNAUTH-TLS 380L_CFLAGS += -DEAP_UNAUTH_TLS 381ifndef CONFIG_EAP_TLS 382OBJS += src/eap_peer/eap_tls.c 383OBJS_h += src/eap_server/eap_server_tls.c 384TLS_FUNCS=y 385endif 386CONFIG_IEEE8021X_EAPOL=y 387endif 388 389ifdef CONFIG_EAP_PEAP 390# EAP-PEAP 391ifeq ($(CONFIG_EAP_PEAP), dyn) 392L_CFLAGS += -DEAP_PEAP_DYNAMIC 393EAPDYN += src/eap_peer/eap_peap.so 394else 395L_CFLAGS += -DEAP_PEAP 396OBJS += src/eap_peer/eap_peap.c 397OBJS += src/eap_common/eap_peap_common.c 398OBJS_h += src/eap_server/eap_server_peap.c 399endif 400TLS_FUNCS=y 401CONFIG_IEEE8021X_EAPOL=y 402endif 403 404ifdef CONFIG_EAP_TTLS 405# EAP-TTLS 406ifeq ($(CONFIG_EAP_TTLS), dyn) 407L_CFLAGS += -DEAP_TTLS_DYNAMIC 408EAPDYN += src/eap_peer/eap_ttls.so 409else 410L_CFLAGS += -DEAP_TTLS 411OBJS += src/eap_peer/eap_ttls.c 412OBJS_h += src/eap_server/eap_server_ttls.c 413endif 414MS_FUNCS=y 415TLS_FUNCS=y 416CHAP=y 417CONFIG_IEEE8021X_EAPOL=y 418endif 419 420ifdef CONFIG_EAP_MD5 421# EAP-MD5 422ifeq ($(CONFIG_EAP_MD5), dyn) 423L_CFLAGS += -DEAP_MD5_DYNAMIC 424EAPDYN += src/eap_peer/eap_md5.so 425else 426L_CFLAGS += -DEAP_MD5 427OBJS += src/eap_peer/eap_md5.c 428OBJS_h += src/eap_server/eap_server_md5.c 429endif 430CHAP=y 431CONFIG_IEEE8021X_EAPOL=y 432endif 433 434# backwards compatibility for old spelling 435ifdef CONFIG_MSCHAPV2 436ifndef CONFIG_EAP_MSCHAPV2 437CONFIG_EAP_MSCHAPV2=y 438endif 439endif 440 441ifdef CONFIG_EAP_MSCHAPV2 442# EAP-MSCHAPv2 443ifeq ($(CONFIG_EAP_MSCHAPV2), dyn) 444L_CFLAGS += -DEAP_MSCHAPv2_DYNAMIC 445EAPDYN += src/eap_peer/eap_mschapv2.so 446EAPDYN += src/eap_peer/mschapv2.so 447else 448L_CFLAGS += -DEAP_MSCHAPv2 449OBJS += src/eap_peer/eap_mschapv2.c 450OBJS += src/eap_peer/mschapv2.c 451OBJS_h += src/eap_server/eap_server_mschapv2.c 452endif 453MS_FUNCS=y 454CONFIG_IEEE8021X_EAPOL=y 455endif 456 457ifdef CONFIG_EAP_GTC 458# EAP-GTC 459ifeq ($(CONFIG_EAP_GTC), dyn) 460L_CFLAGS += -DEAP_GTC_DYNAMIC 461EAPDYN += src/eap_peer/eap_gtc.so 462else 463L_CFLAGS += -DEAP_GTC 464OBJS += src/eap_peer/eap_gtc.c 465OBJS_h += src/eap_server/eap_server_gtc.c 466endif 467CONFIG_IEEE8021X_EAPOL=y 468endif 469 470ifdef CONFIG_EAP_OTP 471# EAP-OTP 472ifeq ($(CONFIG_EAP_OTP), dyn) 473L_CFLAGS += -DEAP_OTP_DYNAMIC 474EAPDYN += src/eap_peer/eap_otp.so 475else 476L_CFLAGS += -DEAP_OTP 477OBJS += src/eap_peer/eap_otp.c 478endif 479CONFIG_IEEE8021X_EAPOL=y 480endif 481 482ifdef CONFIG_EAP_SIM 483# EAP-SIM 484ifeq ($(CONFIG_EAP_SIM), dyn) 485L_CFLAGS += -DEAP_SIM_DYNAMIC 486EAPDYN += src/eap_peer/eap_sim.so 487else 488L_CFLAGS += -DEAP_SIM 489OBJS += src/eap_peer/eap_sim.c 490OBJS_h += src/eap_server/eap_server_sim.c 491endif 492CONFIG_IEEE8021X_EAPOL=y 493CONFIG_EAP_SIM_COMMON=y 494NEED_AES_CBC=y 495endif 496 497ifdef CONFIG_EAP_LEAP 498# EAP-LEAP 499ifeq ($(CONFIG_EAP_LEAP), dyn) 500L_CFLAGS += -DEAP_LEAP_DYNAMIC 501EAPDYN += src/eap_peer/eap_leap.so 502else 503L_CFLAGS += -DEAP_LEAP 504OBJS += src/eap_peer/eap_leap.c 505endif 506MS_FUNCS=y 507CONFIG_IEEE8021X_EAPOL=y 508endif 509 510ifdef CONFIG_EAP_PSK 511# EAP-PSK 512ifeq ($(CONFIG_EAP_PSK), dyn) 513L_CFLAGS += -DEAP_PSK_DYNAMIC 514EAPDYN += src/eap_peer/eap_psk.so 515else 516L_CFLAGS += -DEAP_PSK 517OBJS += src/eap_peer/eap_psk.c src/eap_common/eap_psk_common.c 518OBJS_h += src/eap_server/eap_server_psk.c 519endif 520CONFIG_IEEE8021X_EAPOL=y 521NEED_AES=y 522NEED_AES_OMAC1=y 523NEED_AES_ENCBLOCK=y 524NEED_AES_EAX=y 525endif 526 527ifdef CONFIG_EAP_AKA 528# EAP-AKA 529ifeq ($(CONFIG_EAP_AKA), dyn) 530L_CFLAGS += -DEAP_AKA_DYNAMIC 531EAPDYN += src/eap_peer/eap_aka.so 532else 533L_CFLAGS += -DEAP_AKA 534OBJS += src/eap_peer/eap_aka.c 535OBJS_h += src/eap_server/eap_server_aka.c 536endif 537CONFIG_IEEE8021X_EAPOL=y 538CONFIG_EAP_SIM_COMMON=y 539NEED_AES_CBC=y 540endif 541 542ifdef CONFIG_EAP_PROXY 543L_CFLAGS += -DCONFIG_EAP_PROXY 544OBJS += src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).c 545include $(LOCAL_PATH)/eap_proxy_$(CONFIG_EAP_PROXY).mk 546CONFIG_IEEE8021X_EAPOL=y 547endif 548 549ifdef CONFIG_EAP_AKA_PRIME 550# EAP-AKA' 551ifeq ($(CONFIG_EAP_AKA_PRIME), dyn) 552L_CFLAGS += -DEAP_AKA_PRIME_DYNAMIC 553else 554L_CFLAGS += -DEAP_AKA_PRIME 555endif 556NEED_SHA256=y 557endif 558 559ifdef CONFIG_EAP_SIM_COMMON 560OBJS += src/eap_common/eap_sim_common.c 561OBJS_h += src/eap_server/eap_sim_db.c 562NEED_AES=y 563NEED_FIPS186_2_PRF=y 564endif 565 566ifdef CONFIG_EAP_FAST 567# EAP-FAST 568ifeq ($(CONFIG_EAP_FAST), dyn) 569L_CFLAGS += -DEAP_FAST_DYNAMIC 570EAPDYN += src/eap_peer/eap_fast.so 571EAPDYN += src/eap_common/eap_fast_common.c 572else 573L_CFLAGS += -DEAP_FAST 574OBJS += src/eap_peer/eap_fast.c src/eap_peer/eap_fast_pac.c 575OBJS += src/eap_common/eap_fast_common.c 576OBJS_h += src/eap_server/eap_server_fast.c 577endif 578TLS_FUNCS=y 579CONFIG_IEEE8021X_EAPOL=y 580NEED_T_PRF=y 581endif 582 583ifdef CONFIG_EAP_PAX 584# EAP-PAX 585ifeq ($(CONFIG_EAP_PAX), dyn) 586L_CFLAGS += -DEAP_PAX_DYNAMIC 587EAPDYN += src/eap_peer/eap_pax.so 588else 589L_CFLAGS += -DEAP_PAX 590OBJS += src/eap_peer/eap_pax.c src/eap_common/eap_pax_common.c 591OBJS_h += src/eap_server/eap_server_pax.c 592endif 593CONFIG_IEEE8021X_EAPOL=y 594endif 595 596ifdef CONFIG_EAP_SAKE 597# EAP-SAKE 598ifeq ($(CONFIG_EAP_SAKE), dyn) 599L_CFLAGS += -DEAP_SAKE_DYNAMIC 600EAPDYN += src/eap_peer/eap_sake.so 601else 602L_CFLAGS += -DEAP_SAKE 603OBJS += src/eap_peer/eap_sake.c src/eap_common/eap_sake_common.c 604OBJS_h += src/eap_server/eap_server_sake.c 605endif 606CONFIG_IEEE8021X_EAPOL=y 607endif 608 609ifdef CONFIG_EAP_GPSK 610# EAP-GPSK 611ifeq ($(CONFIG_EAP_GPSK), dyn) 612L_CFLAGS += -DEAP_GPSK_DYNAMIC 613EAPDYN += src/eap_peer/eap_gpsk.so 614else 615L_CFLAGS += -DEAP_GPSK 616OBJS += src/eap_peer/eap_gpsk.c src/eap_common/eap_gpsk_common.c 617OBJS_h += src/eap_server/eap_server_gpsk.c 618endif 619CONFIG_IEEE8021X_EAPOL=y 620ifdef CONFIG_EAP_GPSK_SHA256 621L_CFLAGS += -DEAP_GPSK_SHA256 622endif 623NEED_SHA256=y 624NEED_AES_OMAC1=y 625endif 626 627ifdef CONFIG_EAP_PWD 628L_CFLAGS += -DEAP_PWD 629OBJS += src/eap_peer/eap_pwd.c src/eap_common/eap_pwd_common.c 630OBJS_h += src/eap_server/eap_server_pwd.c 631CONFIG_IEEE8021X_EAPOL=y 632NEED_SHA256=y 633endif 634 635ifdef CONFIG_EAP_EKE 636# EAP-EKE 637ifeq ($(CONFIG_EAP_EKE), dyn) 638L_CFLAGS += -DEAP_EKE_DYNAMIC 639EAPDYN += src/eap_peer/eap_eke.so 640else 641L_CFLAGS += -DEAP_EKE 642OBJS += src/eap_peer/eap_eke.c src/eap_common/eap_eke_common.c 643OBJS_h += src/eap_server/eap_server_eke.c 644endif 645CONFIG_IEEE8021X_EAPOL=y 646NEED_DH_GROUPS=y 647NEED_DH_GROUPS_ALL=y 648NEED_SHA256=y 649endif 650 651ifdef CONFIG_WPS 652# EAP-WSC 653L_CFLAGS += -DCONFIG_WPS -DEAP_WSC 654OBJS += wps_supplicant.c 655OBJS += src/utils/uuid.c 656OBJS += src/eap_peer/eap_wsc.c src/eap_common/eap_wsc_common.c 657OBJS += src/wps/wps.c 658OBJS += src/wps/wps_common.c 659OBJS += src/wps/wps_attr_parse.c 660OBJS += src/wps/wps_attr_build.c 661OBJS += src/wps/wps_attr_process.c 662OBJS += src/wps/wps_dev_attr.c 663OBJS += src/wps/wps_enrollee.c 664OBJS += src/wps/wps_registrar.c 665OBJS_h += src/eap_server/eap_server_wsc.c 666CONFIG_IEEE8021X_EAPOL=y 667NEED_DH_GROUPS=y 668NEED_SHA256=y 669NEED_BASE64=y 670NEED_AES_CBC=y 671NEED_MODEXP=y 672 673ifdef CONFIG_WPS_NFC 674L_CFLAGS += -DCONFIG_WPS_NFC 675OBJS += src/wps/ndef.c 676NEED_WPS_OOB=y 677endif 678 679ifdef NEED_WPS_OOB 680L_CFLAGS += -DCONFIG_WPS_OOB 681endif 682 683ifdef CONFIG_WPS_ER 684CONFIG_WPS_UPNP=y 685L_CFLAGS += -DCONFIG_WPS_ER 686OBJS += src/wps/wps_er.c 687OBJS += src/wps/wps_er_ssdp.c 688endif 689 690ifdef CONFIG_WPS_UPNP 691L_CFLAGS += -DCONFIG_WPS_UPNP 692OBJS += src/wps/wps_upnp.c 693OBJS += src/wps/wps_upnp_ssdp.c 694OBJS += src/wps/wps_upnp_web.c 695OBJS += src/wps/wps_upnp_event.c 696OBJS += src/wps/wps_upnp_ap.c 697OBJS += src/wps/upnp_xml.c 698OBJS += src/wps/httpread.c 699OBJS += src/wps/http_client.c 700OBJS += src/wps/http_server.c 701endif 702 703ifdef CONFIG_WPS_STRICT 704L_CFLAGS += -DCONFIG_WPS_STRICT 705OBJS += src/wps/wps_validate.c 706endif 707 708ifdef CONFIG_WPS_TESTING 709L_CFLAGS += -DCONFIG_WPS_TESTING 710endif 711 712ifdef CONFIG_WPS_REG_DISABLE_OPEN 713L_CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN 714endif 715 716endif 717 718ifdef CONFIG_EAP_IKEV2 719# EAP-IKEv2 720ifeq ($(CONFIG_EAP_IKEV2), dyn) 721L_CFLAGS += -DEAP_IKEV2_DYNAMIC 722EAPDYN += src/eap_peer/eap_ikev2.so src/eap_peer/ikev2.c 723EAPDYN += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c 724else 725L_CFLAGS += -DEAP_IKEV2 726OBJS += src/eap_peer/eap_ikev2.c src/eap_peer/ikev2.c 727OBJS += src/eap_common/eap_ikev2_common.c src/eap_common/ikev2_common.c 728OBJS_h += src/eap_server/eap_server_ikev2.c 729OBJS_h += src/eap_server/ikev2.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 745OBJS_h += src/eap_server/eap_server_vendor_test.c 746endif 747CONFIG_IEEE8021X_EAPOL=y 748endif 749 750ifdef CONFIG_EAP_TNC 751# EAP-TNC 752L_CFLAGS += -DEAP_TNC 753OBJS += src/eap_peer/eap_tnc.c 754OBJS += src/eap_peer/tncc.c 755OBJS_h += src/eap_server/eap_server_tnc.c 756OBJS_h += src/eap_server/tncs.c 757NEED_BASE64=y 758ifndef CONFIG_NATIVE_WINDOWS 759ifndef CONFIG_DRIVER_BSD 760LIBS += -ldl 761endif 762endif 763endif 764 765ifdef CONFIG_IEEE8021X_EAPOL 766# IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication) 767L_CFLAGS += -DIEEE8021X_EAPOL 768OBJS += src/eapol_supp/eapol_supp_sm.c 769OBJS += src/eap_peer/eap.c src/eap_peer/eap_methods.c 770NEED_EAP_COMMON=y 771ifdef CONFIG_DYNAMIC_EAP_METHODS 772L_CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS 773LIBS += -ldl -rdynamic 774endif 775endif 776 777ifdef CONFIG_AP 778NEED_EAP_COMMON=y 779NEED_RSN_AUTHENTICATOR=y 780L_CFLAGS += -DCONFIG_AP 781OBJS += ap.c 782L_CFLAGS += -DCONFIG_NO_RADIUS 783L_CFLAGS += -DCONFIG_NO_ACCOUNTING 784L_CFLAGS += -DCONFIG_NO_VLAN 785OBJS += src/ap/hostapd.c 786OBJS += src/ap/wpa_auth_glue.c 787OBJS += src/ap/utils.c 788OBJS += src/ap/authsrv.c 789OBJS += src/ap/ap_config.c 790OBJS += src/utils/ip_addr.c 791OBJS += src/ap/sta_info.c 792OBJS += src/ap/tkip_countermeasures.c 793OBJS += src/ap/ap_mlme.c 794OBJS += src/ap/ieee802_1x.c 795OBJS += src/eapol_auth/eapol_auth_sm.c 796OBJS += src/ap/ieee802_11_auth.c 797OBJS += src/ap/ieee802_11_shared.c 798OBJS += src/ap/drv_callbacks.c 799OBJS += src/ap/ap_drv_ops.c 800OBJS += src/ap/beacon.c 801OBJS += src/ap/bss_load.c 802OBJS += src/ap/eap_user_db.c 803ifdef CONFIG_IEEE80211N 804OBJS += src/ap/ieee802_11_ht.c 805ifdef CONFIG_IEEE80211AC 806OBJS += src/ap/ieee802_11_vht.c 807endif 808endif 809ifdef CONFIG_WNM 810OBJS += src/ap/wnm_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 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_WPS 837L_CFLAGS += -DEAP_SERVER_WSC 838OBJS += src/ap/wps_hostapd.c 839OBJS += src/eap_server/eap_server_wsc.c 840endif 841ifdef CONFIG_INTERWORKING 842OBJS += src/ap/gas_serv.c 843endif 844ifdef CONFIG_HS20 845OBJS += src/ap/hs20.c 846endif 847endif 848 849ifdef NEED_RSN_AUTHENTICATOR 850L_CFLAGS += -DCONFIG_NO_RADIUS 851NEED_AES_WRAP=y 852OBJS += src/ap/wpa_auth.c 853OBJS += src/ap/wpa_auth_ie.c 854OBJS += src/ap/pmksa_cache_auth.c 855ifdef CONFIG_IEEE80211R 856OBJS += src/ap/wpa_auth_ft.c 857endif 858ifdef CONFIG_PEERKEY 859OBJS += src/ap/peerkey_auth.c 860endif 861endif 862 863ifdef CONFIG_EAP_SERVER 864L_CFLAGS += -DEAP_SERVER 865OBJS_h += src/eap_server/eap_server.c 866OBJS_h += src/eap_server/eap_server_identity.c 867OBJS_h += src/eap_server/eap_server_methods.c 868endif 869 870ifdef CONFIG_RADIUS_CLIENT 871OBJS_h += src/utils/ip_addr.c 872OBJS_h += src/radius/radius.c 873OBJS_h += src/radius/radius_client.c 874endif 875 876ifdef CONFIG_AUTHENTICATOR 877OBJS_h += src/eapol_auth/eapol_auth_sm.c 878OBJS_h += src/ap/ieee802_1x.c 879endif 880 881ifdef CONFIG_WPA_AUTHENTICATOR 882OBJS_h += src/ap/wpa_auth.c 883OBJS_h += src/ap/wpa_auth_ie.c 884OBJS_h += src/ap/pmksa_cache_auth.c 885ifdef CONFIG_IEEE80211R 886OBJS_h += src/ap/wpa_auth_ft.c 887endif 888ifdef CONFIG_PEERKEY 889OBJS_h += src/ap/peerkey_auth.c 890endif 891endif 892 893ifdef CONFIG_PCSC 894# PC/SC interface for smartcards (USIM, GSM SIM) 895L_CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC 896OBJS += src/utils/pcsc_funcs.c 897# -lpthread may not be needed depending on how pcsc-lite was configured 898ifdef CONFIG_NATIVE_WINDOWS 899#Once MinGW gets support for WinScard, -lwinscard could be used instead of the 900#dynamic symbol loading that is now used in pcsc_funcs.c 901#LIBS += -lwinscard 902else 903LIBS += -lpcsclite -lpthread 904endif 905endif 906 907ifdef CONFIG_SIM_SIMULATOR 908L_CFLAGS += -DCONFIG_SIM_SIMULATOR 909NEED_MILENAGE=y 910endif 911 912ifdef CONFIG_USIM_SIMULATOR 913L_CFLAGS += -DCONFIG_USIM_SIMULATOR 914NEED_MILENAGE=y 915endif 916 917ifdef NEED_MILENAGE 918OBJS += src/crypto/milenage.c 919NEED_AES_ENCBLOCK=y 920endif 921 922ifdef CONFIG_PKCS12 923L_CFLAGS += -DPKCS12_FUNCS 924endif 925 926ifdef CONFIG_SMARTCARD 927L_CFLAGS += -DCONFIG_SMARTCARD 928endif 929 930ifdef MS_FUNCS 931OBJS += src/crypto/ms_funcs.c 932NEED_DES=y 933NEED_MD4=y 934endif 935 936ifdef CHAP 937OBJS += src/eap_common/chap.c 938endif 939 940ifdef TLS_FUNCS 941NEED_DES=y 942# Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST) 943OBJS += src/eap_peer/eap_tls_common.c 944OBJS_h += src/eap_server/eap_server_tls_common.c 945ifndef CONFIG_FIPS 946NEED_TLS_PRF=y 947NEED_SHA1=y 948NEED_MD5=y 949endif 950endif 951 952ifndef CONFIG_TLS 953CONFIG_TLS=openssl 954endif 955 956ifdef CONFIG_TLSV11 957L_CFLAGS += -DCONFIG_TLSV11 958endif 959 960ifdef CONFIG_TLSV12 961L_CFLAGS += -DCONFIG_TLSV12 962NEED_SHA256=y 963endif 964 965ifeq ($(CONFIG_TLS), openssl) 966ifdef TLS_FUNCS 967L_CFLAGS += -DEAP_TLS_OPENSSL 968OBJS += src/crypto/tls_openssl.c 969LIBS += -lssl 970endif 971OBJS += src/crypto/crypto_openssl.c 972OBJS_p += src/crypto/crypto_openssl.c 973ifdef NEED_FIPS186_2_PRF 974OBJS += src/crypto/fips_prf_openssl.c 975endif 976LIBS += -lcrypto 977LIBS_p += -lcrypto 978ifdef CONFIG_TLS_ADD_DL 979LIBS += -ldl 980LIBS_p += -ldl 981endif 982endif 983 984ifeq ($(CONFIG_TLS), gnutls) 985ifdef TLS_FUNCS 986OBJS += src/crypto/tls_gnutls.c 987LIBS += -lgnutls -lgpg-error 988endif 989OBJS += src/crypto/crypto_gnutls.c 990OBJS_p += src/crypto/crypto_gnutls.c 991ifdef NEED_FIPS186_2_PRF 992OBJS += src/crypto/fips_prf_internal.c 993OBJS += src/crypto/sha1-internal.c 994endif 995LIBS += -lgcrypt 996LIBS_p += -lgcrypt 997CONFIG_INTERNAL_SHA256=y 998CONFIG_INTERNAL_RC4=y 999CONFIG_INTERNAL_DH_GROUP5=y 1000endif 1001 1002ifeq ($(CONFIG_TLS), internal) 1003ifndef CONFIG_CRYPTO 1004CONFIG_CRYPTO=internal 1005endif 1006ifdef TLS_FUNCS 1007OBJS += src/crypto/crypto_internal-rsa.c 1008OBJS += src/crypto/tls_internal.c 1009OBJS += src/tls/tlsv1_common.c 1010OBJS += src/tls/tlsv1_record.c 1011OBJS += src/tls/tlsv1_cred.c 1012OBJS += src/tls/tlsv1_client.c 1013OBJS += src/tls/tlsv1_client_write.c 1014OBJS += src/tls/tlsv1_client_read.c 1015OBJS += src/tls/asn1.c 1016OBJS += src/tls/rsa.c 1017OBJS += src/tls/x509v3.c 1018OBJS += src/tls/pkcs1.c 1019OBJS += src/tls/pkcs5.c 1020OBJS += src/tls/pkcs8.c 1021NEED_SHA256=y 1022NEED_BASE64=y 1023NEED_TLS_PRF=y 1024ifdef CONFIG_TLSV12 1025NEED_TLS_PRF_SHA256=y 1026endif 1027NEED_MODEXP=y 1028NEED_CIPHER=y 1029L_CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT 1030endif 1031ifdef NEED_CIPHER 1032NEED_DES=y 1033OBJS += src/crypto/crypto_internal-cipher.c 1034endif 1035ifdef NEED_MODEXP 1036OBJS += src/crypto/crypto_internal-modexp.c 1037OBJS += src/tls/bignum.c 1038endif 1039ifeq ($(CONFIG_CRYPTO), libtomcrypt) 1040OBJS += src/crypto/crypto_libtomcrypt.c 1041OBJS_p += src/crypto/crypto_libtomcrypt.c 1042LIBS += -ltomcrypt -ltfm 1043LIBS_p += -ltomcrypt -ltfm 1044CONFIG_INTERNAL_SHA256=y 1045CONFIG_INTERNAL_RC4=y 1046CONFIG_INTERNAL_DH_GROUP5=y 1047endif 1048ifeq ($(CONFIG_CRYPTO), internal) 1049OBJS += src/crypto/crypto_internal.c 1050OBJS_p += src/crypto/crypto_internal.c 1051NEED_AES_ENC=y 1052L_CFLAGS += -DCONFIG_CRYPTO_INTERNAL 1053ifdef CONFIG_INTERNAL_LIBTOMMATH 1054L_CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH 1055ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST 1056L_CFLAGS += -DLTM_FAST 1057endif 1058else 1059LIBS += -ltommath 1060LIBS_p += -ltommath 1061endif 1062CONFIG_INTERNAL_AES=y 1063CONFIG_INTERNAL_DES=y 1064CONFIG_INTERNAL_SHA1=y 1065CONFIG_INTERNAL_MD4=y 1066CONFIG_INTERNAL_MD5=y 1067CONFIG_INTERNAL_SHA256=y 1068CONFIG_INTERNAL_RC4=y 1069CONFIG_INTERNAL_DH_GROUP5=y 1070endif 1071ifeq ($(CONFIG_CRYPTO), cryptoapi) 1072OBJS += src/crypto/crypto_cryptoapi.c 1073OBJS_p += src/crypto/crypto_cryptoapi.c 1074L_CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI 1075CONFIG_INTERNAL_SHA256=y 1076CONFIG_INTERNAL_RC4=y 1077endif 1078endif 1079 1080ifeq ($(CONFIG_TLS), none) 1081ifdef TLS_FUNCS 1082OBJS += src/crypto/tls_none.c 1083L_CFLAGS += -DEAP_TLS_NONE 1084CONFIG_INTERNAL_AES=y 1085CONFIG_INTERNAL_SHA1=y 1086CONFIG_INTERNAL_MD5=y 1087endif 1088OBJS += src/crypto/crypto_none.c 1089OBJS_p += src/crypto/crypto_none.c 1090CONFIG_INTERNAL_SHA256=y 1091CONFIG_INTERNAL_RC4=y 1092endif 1093 1094ifdef TLS_FUNCS 1095ifdef CONFIG_SMARTCARD 1096ifndef CONFIG_NATIVE_WINDOWS 1097ifneq ($(CONFIG_L2_PACKET), freebsd) 1098LIBS += -ldl 1099endif 1100endif 1101endif 1102endif 1103 1104ifndef TLS_FUNCS 1105OBJS += src/crypto/tls_none.c 1106ifeq ($(CONFIG_TLS), internal) 1107CONFIG_INTERNAL_AES=y 1108CONFIG_INTERNAL_SHA1=y 1109CONFIG_INTERNAL_MD5=y 1110CONFIG_INTERNAL_RC4=y 1111endif 1112endif 1113 1114AESOBJS = # none so far (see below) 1115ifdef CONFIG_INTERNAL_AES 1116AESOBJS += src/crypto/aes-internal.c src/crypto/aes-internal-dec.c 1117endif 1118 1119ifneq ($(CONFIG_TLS), openssl) 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 1142ifneq ($(CONFIG_TLS), openssl) 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 NEED_RC4 1219ifdef CONFIG_INTERNAL_RC4 1220OBJS += src/crypto/rc4.c 1221endif 1222endif 1223 1224SHA256OBJS = # none by default 1225ifdef NEED_SHA256 1226L_CFLAGS += -DCONFIG_SHA256 1227ifneq ($(CONFIG_TLS), openssl) 1228SHA256OBJS += src/crypto/sha256.c 1229endif 1230SHA256OBJS += src/crypto/sha256-prf.c 1231ifdef CONFIG_INTERNAL_SHA256 1232SHA256OBJS += src/crypto/sha256-internal.c 1233endif 1234ifdef NEED_TLS_PRF_SHA256 1235SHA256OBJS += src/crypto/sha256-tlsprf.c 1236endif 1237ifdef NEED_HMAC_SHA256_KDF 1238SHA256OBJS += src/crypto/sha256-kdf.c 1239endif 1240OBJS += $(SHA256OBJS) 1241endif 1242ifdef NEED_SHA384 1243L_CFLAGS += -DCONFIG_SHA384 1244endif 1245 1246ifdef NEED_DH_GROUPS 1247OBJS += src/crypto/dh_groups.c 1248endif 1249ifdef NEED_DH_GROUPS_ALL 1250L_CFLAGS += -DALL_DH_GROUPS 1251endif 1252ifdef CONFIG_INTERNAL_DH_GROUP5 1253ifdef NEED_DH_GROUPS 1254OBJS += src/crypto/dh_group5.c 1255endif 1256endif 1257 1258ifdef NEED_ECC 1259L_CFLAGS += -DCONFIG_ECC 1260endif 1261 1262ifdef CONFIG_NO_RANDOM_POOL 1263L_CFLAGS += -DCONFIG_NO_RANDOM_POOL 1264else 1265OBJS += src/crypto/random.c 1266endif 1267 1268ifdef CONFIG_CTRL_IFACE 1269ifeq ($(CONFIG_CTRL_IFACE), y) 1270ifdef CONFIG_NATIVE_WINDOWS 1271CONFIG_CTRL_IFACE=named_pipe 1272else 1273CONFIG_CTRL_IFACE=unix 1274endif 1275endif 1276L_CFLAGS += -DCONFIG_CTRL_IFACE 1277ifeq ($(CONFIG_CTRL_IFACE), unix) 1278L_CFLAGS += -DCONFIG_CTRL_IFACE_UNIX 1279endif 1280ifeq ($(CONFIG_CTRL_IFACE), udp) 1281L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1282endif 1283ifeq ($(CONFIG_CTRL_IFACE), named_pipe) 1284L_CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE 1285endif 1286ifeq ($(CONFIG_CTRL_IFACE), udp-remote) 1287CONFIG_CTRL_IFACE=udp 1288L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP 1289L_CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE 1290endif 1291OBJS += ctrl_iface.c ctrl_iface_$(CONFIG_CTRL_IFACE).c 1292endif 1293 1294ifdef CONFIG_CTRL_IFACE_DBUS 1295DBUS=y 1296DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE 1297DBUS_OBJS += dbus/dbus_old.c dbus/dbus_old_handlers.c 1298ifdef CONFIG_WPS 1299DBUS_OBJS += dbus/dbus_old_handlers_wps.c 1300endif 1301DBUS_OBJS += dbus/dbus_dict_helpers.c 1302ifndef DBUS_LIBS 1303DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1) 1304endif 1305ifndef DBUS_INCLUDE 1306DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1) 1307endif 1308DBUS_CFLAGS += $(DBUS_INCLUDE) 1309endif 1310 1311ifdef CONFIG_CTRL_IFACE_DBUS_NEW 1312DBUS=y 1313DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW 1314DBUS_OBJS ?= dbus/dbus_dict_helpers.c 1315DBUS_OBJS += dbus/dbus_new_helpers.c 1316DBUS_OBJS += dbus/dbus_new.c dbus/dbus_new_handlers.c 1317ifdef CONFIG_WPS 1318DBUS_OBJS += dbus/dbus_new_handlers_wps.c 1319endif 1320ifdef CONFIG_P2P 1321DBUS_OBJS += dbus/dbus_new_handlers_p2p.c 1322endif 1323ifndef DBUS_LIBS 1324DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1) 1325endif 1326ifndef DBUS_INCLUDE 1327DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1) 1328endif 1329ifdef CONFIG_CTRL_IFACE_DBUS_INTRO 1330DBUS_OBJS += dbus/dbus_new_introspect.c 1331DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO 1332endif 1333DBUS_CFLAGS += $(DBUS_INCLUDE) 1334endif 1335 1336ifdef DBUS 1337DBUS_CFLAGS += -DCONFIG_DBUS 1338DBUS_OBJS += dbus/dbus_common.c 1339endif 1340 1341OBJS += $(DBUS_OBJS) 1342L_CFLAGS += $(DBUS_CFLAGS) 1343LIBS += $(DBUS_LIBS) 1344 1345ifdef CONFIG_READLINE 1346OBJS_c += src/utils/edit_readline.c 1347LIBS_c += -lncurses -lreadline 1348else 1349ifdef CONFIG_WPA_CLI_EDIT 1350OBJS_c += src/utils/edit.c 1351else 1352OBJS_c += src/utils/edit_simple.c 1353endif 1354endif 1355 1356ifdef CONFIG_NATIVE_WINDOWS 1357L_CFLAGS += -DCONFIG_NATIVE_WINDOWS 1358LIBS += -lws2_32 -lgdi32 -lcrypt32 1359LIBS_c += -lws2_32 1360LIBS_p += -lws2_32 -lgdi32 1361ifeq ($(CONFIG_CRYPTO), cryptoapi) 1362LIBS_p += -lcrypt32 1363endif 1364endif 1365 1366ifdef CONFIG_NO_STDOUT_DEBUG 1367L_CFLAGS += -DCONFIG_NO_STDOUT_DEBUG 1368ifndef CONFIG_CTRL_IFACE 1369L_CFLAGS += -DCONFIG_NO_WPA_MSG 1370endif 1371endif 1372 1373ifdef CONFIG_ANDROID_LOG 1374L_CFLAGS += -DCONFIG_ANDROID_LOG 1375endif 1376 1377ifdef CONFIG_IPV6 1378# for eapol_test only 1379L_CFLAGS += -DCONFIG_IPV6 1380endif 1381 1382ifdef NEED_BASE64 1383OBJS += src/utils/base64.c 1384endif 1385 1386ifdef NEED_SME 1387OBJS += sme.c 1388L_CFLAGS += -DCONFIG_SME 1389endif 1390 1391OBJS += src/common/ieee802_11_common.c 1392OBJS += src/common/hw_features_common.c 1393 1394ifdef NEED_EAP_COMMON 1395OBJS += src/eap_common/eap_common.c 1396endif 1397 1398ifndef CONFIG_MAIN 1399CONFIG_MAIN=main 1400endif 1401 1402ifdef CONFIG_DEBUG_SYSLOG 1403L_CFLAGS += -DCONFIG_DEBUG_SYSLOG 1404ifdef CONFIG_DEBUG_SYSLOG_FACILITY 1405L_CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)" 1406endif 1407endif 1408 1409ifdef CONFIG_DEBUG_LINUX_TRACING 1410L_CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING 1411endif 1412 1413ifdef CONFIG_DEBUG_FILE 1414L_CFLAGS += -DCONFIG_DEBUG_FILE 1415endif 1416 1417ifdef CONFIG_DELAYED_MIC_ERROR_REPORT 1418L_CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT 1419endif 1420 1421ifdef CONFIG_FIPS 1422L_CFLAGS += -DCONFIG_FIPS 1423endif 1424 1425OBJS += $(SHA1OBJS) $(DESOBJS) 1426 1427OBJS_p += $(SHA1OBJS) 1428OBJS_p += $(SHA256OBJS) 1429 1430ifdef CONFIG_BGSCAN_SIMPLE 1431L_CFLAGS += -DCONFIG_BGSCAN_SIMPLE 1432OBJS += bgscan_simple.c 1433NEED_BGSCAN=y 1434endif 1435 1436ifdef CONFIG_BGSCAN_LEARN 1437L_CFLAGS += -DCONFIG_BGSCAN_LEARN 1438OBJS += bgscan_learn.c 1439NEED_BGSCAN=y 1440endif 1441 1442ifdef NEED_BGSCAN 1443L_CFLAGS += -DCONFIG_BGSCAN 1444OBJS += bgscan.c 1445endif 1446 1447ifdef CONFIG_AUTOSCAN_EXPONENTIAL 1448L_CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL 1449OBJS += autoscan_exponential.c 1450NEED_AUTOSCAN=y 1451endif 1452 1453ifdef CONFIG_AUTOSCAN_PERIODIC 1454L_CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC 1455OBJS += autoscan_periodic.c 1456NEED_AUTOSCAN=y 1457endif 1458 1459ifdef NEED_AUTOSCAN 1460L_CFLAGS += -DCONFIG_AUTOSCAN 1461OBJS += autoscan.c 1462endif 1463 1464ifdef CONFIG_EXT_PASSWORD_TEST 1465OBJS += src/utils/ext_password_test.c 1466L_CFLAGS += -DCONFIG_EXT_PASSWORD_TEST 1467NEED_EXT_PASSWORD=y 1468endif 1469 1470ifdef NEED_EXT_PASSWORD 1471OBJS += src/utils/ext_password.c 1472L_CFLAGS += -DCONFIG_EXT_PASSWORD 1473endif 1474 1475ifdef NEED_GAS 1476OBJS += src/common/gas.c 1477OBJS += gas_query.c 1478L_CFLAGS += -DCONFIG_GAS 1479NEED_OFFCHANNEL=y 1480endif 1481 1482ifdef NEED_OFFCHANNEL 1483OBJS += offchannel.c 1484L_CFLAGS += -DCONFIG_OFFCHANNEL 1485endif 1486 1487OBJS += src/drivers/driver_common.c 1488 1489OBJS_wpa_rm := ctrl_iface.c ctrl_iface_unix.c 1490OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.c 1491ifdef CONFIG_AUTHENTICATOR 1492OBJS_wpa += tests/link_test.c 1493endif 1494OBJS_wpa += $(OBJS_l2) 1495OBJS += wpa_supplicant.c events.c blacklist.c wpas_glue.c scan.c 1496OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.c 1497OBJS_t += src/radius/radius_client.c 1498OBJS_t += src/radius/radius.c 1499ifndef CONFIG_AP 1500OBJS_t += src/utils/ip_addr.c 1501endif 1502OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.c 1503OBJS += $(CONFIG_MAIN).c 1504 1505ifdef CONFIG_PRIVSEP 1506OBJS_priv += $(OBJS_d) src/drivers/drivers.c 1507OBJS_priv += $(OBJS_l2) 1508OBJS_priv += src/utils/os_$(CONFIG_OS).c 1509OBJS_priv += src/utils/$(CONFIG_ELOOP).c 1510OBJS_priv += src/utils/common.c 1511OBJS_priv += src/utils/wpa_debug.c 1512OBJS_priv += src/utils/wpabuf.c 1513OBJS_priv += wpa_priv.c 1514ifdef CONFIG_DRIVER_NL80211 1515OBJS_priv += src/common/ieee802_11_common.c 1516endif 1517OBJS += src/l2_packet/l2_packet_privsep.c 1518OBJS += src/drivers/driver_privsep.c 1519EXTRA_progs += wpa_priv 1520else 1521OBJS += $(OBJS_d) src/drivers/drivers.c 1522OBJS += $(OBJS_l2) 1523endif 1524 1525ifdef CONFIG_NDIS_EVENTS_INTEGRATED 1526L_CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED 1527OBJS += src/drivers/ndis_events.c 1528EXTRALIBS += -loleaut32 -lole32 -luuid 1529ifdef PLATFORMSDKLIB 1530EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib 1531else 1532EXTRALIBS += WbemUuid.Lib 1533endif 1534endif 1535 1536ifndef LDO 1537LDO=$(CC) 1538endif 1539 1540######################## 1541 1542include $(CLEAR_VARS) 1543LOCAL_MODULE := wpa_cli 1544LOCAL_MODULE_TAGS := debug 1545LOCAL_SHARED_LIBRARIES := libc libcutils liblog 1546LOCAL_CFLAGS := $(L_CFLAGS) 1547LOCAL_SRC_FILES := $(OBJS_c) 1548LOCAL_C_INCLUDES := $(INCLUDES) 1549include $(BUILD_EXECUTABLE) 1550 1551######################## 1552include $(CLEAR_VARS) 1553LOCAL_MODULE := wpa_supplicant 1554ifdef CONFIG_DRIVER_CUSTOM 1555LOCAL_STATIC_LIBRARIES := libCustomWifi 1556endif 1557ifneq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),) 1558LOCAL_STATIC_LIBRARIES += $(BOARD_WPA_SUPPLICANT_PRIVATE_LIB) 1559endif 1560LOCAL_SHARED_LIBRARIES := libc libcutils liblog 1561ifdef CONFIG_EAP_PROXY 1562LOCAL_STATIC_LIBRARIES += $(LIB_STATIC_EAP_PROXY) 1563LOCAL_SHARED_LIBRARIES += $(LIB_SHARED_EAP_PROXY) 1564endif 1565ifeq ($(CONFIG_TLS), openssl) 1566LOCAL_SHARED_LIBRARIES += libcrypto libssl libkeystore_binder 1567endif 1568 1569# With BoringSSL we need libkeystore-engine in order to provide access to 1570# keystore keys. 1571ifneq (,$(wildcard external/boringssl/flavor.mk)) 1572LOCAL_SHARED_LIBRARIES += libkeystore-engine 1573endif 1574 1575ifdef CONFIG_DRIVER_NL80211 1576ifneq ($(wildcard external/libnl),) 1577LOCAL_SHARED_LIBRARIES += libnl 1578else 1579LOCAL_STATIC_LIBRARIES += libnl_2 1580endif 1581endif 1582LOCAL_CFLAGS := $(L_CFLAGS) 1583LOCAL_SRC_FILES := $(OBJS) 1584LOCAL_C_INCLUDES := $(INCLUDES) 1585include $(BUILD_EXECUTABLE) 1586 1587######################## 1588# 1589#include $(CLEAR_VARS) 1590#LOCAL_MODULE := eapol_test 1591#ifdef CONFIG_DRIVER_CUSTOM 1592#LOCAL_STATIC_LIBRARIES := libCustomWifi 1593#endif 1594#LOCAL_SHARED_LIBRARIES := libc libcrypto libssl 1595#LOCAL_CFLAGS := $(L_CFLAGS) 1596#LOCAL_SRC_FILES := $(OBJS_t) 1597#LOCAL_C_INCLUDES := $(INCLUDES) 1598#include $(BUILD_EXECUTABLE) 1599# 1600######################## 1601# 1602#local_target_dir := $(TARGET_OUT)/etc/wifi 1603# 1604#include $(CLEAR_VARS) 1605#LOCAL_MODULE := wpa_supplicant.conf 1606#LOCAL_MODULE_CLASS := ETC 1607#LOCAL_MODULE_PATH := $(local_target_dir) 1608#LOCAL_SRC_FILES := $(LOCAL_MODULE) 1609#include $(BUILD_PREBUILT) 1610# 1611######################## 1612 1613include $(CLEAR_VARS) 1614LOCAL_MODULE = libwpa_client 1615LOCAL_CFLAGS = $(L_CFLAGS) 1616LOCAL_SRC_FILES = src/common/wpa_ctrl.c src/utils/os_$(CONFIG_OS).c 1617LOCAL_C_INCLUDES = $(INCLUDES) 1618LOCAL_SHARED_LIBRARIES := libcutils liblog 1619LOCAL_COPY_HEADERS_TO := libwpa_client 1620LOCAL_COPY_HEADERS := src/common/wpa_ctrl.h 1621LOCAL_COPY_HEADERS += src/common/qca-vendor.h 1622include $(BUILD_SHARED_LIBRARY) 1623