Home | History | Annotate | Download | only in wpa_supplicant
      1 ifndef CC
      2 CC=gcc
      3 endif
      4 
      5 ifndef CFLAGS
      6 CFLAGS = -MMD -O2 -Wall -g
      7 endif
      8 
      9 ifdef LIBS
     10 # If LIBS is set with some global build system defaults, clone those for
     11 # LIBS_c and LIBS_p to cover wpa_passphrase and wpa_cli as well.
     12 ifndef LIBS_c
     13 LIBS_c := $(LIBS)
     14 endif
     15 ifndef LIBS_p
     16 LIBS_p := $(LIBS)
     17 endif
     18 endif
     19 
     20 export LIBDIR ?= /usr/local/lib/
     21 export INCDIR ?= /usr/local/include/
     22 export BINDIR ?= /usr/local/sbin/
     23 PKG_CONFIG ?= pkg-config
     24 
     25 CFLAGS += $(EXTRA_CFLAGS)
     26 CFLAGS += -I$(abspath ../src)
     27 CFLAGS += -I$(abspath ../src/utils)
     28 
     29 -include .config
     30 
     31 ifndef CONFIG_NO_GITVER
     32 # Add VERSION_STR postfix for builds from a git repository
     33 ifeq ($(wildcard ../.git),../.git)
     34 GITVER := $(shell git describe --dirty=+)
     35 ifneq ($(GITVER),)
     36 CFLAGS += -DGIT_VERSION_STR_POSTFIX=\"-$(GITVER)\"
     37 endif
     38 endif
     39 endif
     40 
     41 ifdef CONFIG_TESTING_OPTIONS
     42 CFLAGS += -DCONFIG_TESTING_OPTIONS
     43 CONFIG_WPS_TESTING=y
     44 CONFIG_TDLS_TESTING=y
     45 endif
     46 
     47 BINALL=wpa_supplicant wpa_cli
     48 
     49 ifndef CONFIG_NO_WPA_PASSPHRASE
     50 BINALL += wpa_passphrase
     51 endif
     52 
     53 ALL = $(BINALL)
     54 ALL += systemd/wpa_supplicant.service
     55 ALL += systemd/wpa_supplicant@.service
     56 ALL += systemd/wpa_supplicant-nl80211@.service
     57 ALL += systemd/wpa_supplicant-wired@.service
     58 ALL += dbus/fi.epitest.hostap.WPASupplicant.service
     59 ALL += dbus/fi.w1.wpa_supplicant1.service
     60 ifdef CONFIG_BUILD_WPA_CLIENT_SO
     61 ALL += libwpa_client.so
     62 endif
     63 
     64 
     65 all: verify_config $(ALL) dynamic_eap_methods
     66 
     67 verify_config:
     68 	@if [ ! -r .config ]; then \
     69 		echo 'Building wpa_supplicant requires a configuration file'; \
     70 		echo '(.config). See README for more instructions. You can'; \
     71 		echo 'run "cp defconfig .config" to create an example'; \
     72 		echo 'configuration.'; \
     73 		exit 1; \
     74 	fi
     75 
     76 mkconfig:
     77 	@if [ -f .config ]; then \
     78 		echo '.config exists - did not replace it'; \
     79 		exit 1; \
     80 	fi
     81 	echo CONFIG_DRIVER_HOSTAP=y >> .config
     82 	echo CONFIG_DRIVER_WEXT=y >> .config
     83 
     84 $(DESTDIR)$(BINDIR)/%: %
     85 	install -D $(<) $(@)
     86 
     87 install: $(addprefix $(DESTDIR)$(BINDIR)/,$(BINALL))
     88 	$(MAKE) -C ../src install
     89 ifdef CONFIG_BUILD_WPA_CLIENT_SO
     90 	install -m 0644 -D libwpa_client.so $(DESTDIR)/$(LIBDIR)/libwpa_client.so
     91 	install -m 0644 -D ../src/common/wpa_ctrl.h $(DESTDIR)/$(INCDIR)/wpa_ctrl.h
     92 endif
     93 
     94 ifdef CONFIG_FIPS
     95 CONFIG_NO_RANDOM_POOL=
     96 CONFIG_OPENSSL_CMAC=y
     97 endif
     98 
     99 OBJS = config.o
    100 OBJS += notify.o
    101 OBJS += bss.o
    102 OBJS += eap_register.o
    103 OBJS += ../src/utils/common.o
    104 OBJS += ../src/utils/wpa_debug.o
    105 OBJS += ../src/utils/wpabuf.o
    106 OBJS += ../src/utils/bitfield.o
    107 OBJS += op_classes.o
    108 OBJS += rrm.o
    109 OBJS_p = wpa_passphrase.o
    110 OBJS_p += ../src/utils/common.o
    111 OBJS_p += ../src/utils/wpa_debug.o
    112 OBJS_p += ../src/utils/wpabuf.o
    113 OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
    114 OBJS_c += ../src/utils/wpa_debug.o
    115 OBJS_c += ../src/utils/common.o
    116 OBJS_c += ../src/common/cli.o
    117 OBJS += wmm_ac.o
    118 
    119 ifndef CONFIG_OS
    120 ifdef CONFIG_NATIVE_WINDOWS
    121 CONFIG_OS=win32
    122 else
    123 CONFIG_OS=unix
    124 endif
    125 endif
    126 
    127 ifeq ($(CONFIG_OS), internal)
    128 CFLAGS += -DOS_NO_C_LIB_DEFINES
    129 endif
    130 
    131 OBJS += ../src/utils/os_$(CONFIG_OS).o
    132 OBJS_p += ../src/utils/os_$(CONFIG_OS).o
    133 OBJS_c += ../src/utils/os_$(CONFIG_OS).o
    134 
    135 ifdef CONFIG_WPA_TRACE
    136 CFLAGS += -DWPA_TRACE
    137 OBJS += ../src/utils/trace.o
    138 OBJS_p += ../src/utils/trace.o
    139 OBJS_c += ../src/utils/trace.o
    140 OBJS_priv += ../src/utils/trace.o
    141 LIBCTRL += ../src/utils/trace.o
    142 LIBCTRLSO += ../src/utils/trace.c
    143 LDFLAGS += -rdynamic
    144 CFLAGS += -funwind-tables
    145 ifdef CONFIG_WPA_TRACE_BFD
    146 CFLAGS += -DPACKAGE="wpa_supplicant" -DWPA_TRACE_BFD
    147 LIBS += -lbfd -ldl -liberty -lz
    148 LIBS_p += -lbfd -ldl -liberty -lz
    149 LIBS_c += -lbfd -ldl -liberty -lz
    150 endif
    151 endif
    152 
    153 ifndef CONFIG_ELOOP
    154 CONFIG_ELOOP=eloop
    155 endif
    156 OBJS += ../src/utils/$(CONFIG_ELOOP).o
    157 OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
    158 
    159 ifndef CONFIG_OSX
    160 ifeq ($(CONFIG_ELOOP), eloop)
    161 # Using glibc < 2.17 requires -lrt for clock_gettime()
    162 # OS X has an alternate implementation
    163 LIBS += -lrt
    164 LIBS_c += -lrt
    165 LIBS_p += -lrt
    166 endif
    167 endif
    168 
    169 ifdef CONFIG_ELOOP_POLL
    170 CFLAGS += -DCONFIG_ELOOP_POLL
    171 endif
    172 
    173 ifdef CONFIG_ELOOP_EPOLL
    174 CFLAGS += -DCONFIG_ELOOP_EPOLL
    175 endif
    176 
    177 ifdef CONFIG_ELOOP_KQUEUE
    178 CFLAGS += -DCONFIG_ELOOP_KQUEUE
    179 endif
    180 
    181 ifdef CONFIG_EAPOL_TEST
    182 CFLAGS += -Werror -DEAPOL_TEST
    183 endif
    184 
    185 ifdef CONFIG_CODE_COVERAGE
    186 CFLAGS += -O0 -fprofile-arcs -ftest-coverage
    187 LIBS += -lgcov
    188 LIBS_c += -lgcov
    189 LIBS_p += -lgcov
    190 endif
    191 
    192 ifdef CONFIG_HT_OVERRIDES
    193 CFLAGS += -DCONFIG_HT_OVERRIDES
    194 endif
    195 
    196 ifdef CONFIG_VHT_OVERRIDES
    197 CFLAGS += -DCONFIG_VHT_OVERRIDES
    198 endif
    199 
    200 ifndef CONFIG_BACKEND
    201 CONFIG_BACKEND=file
    202 endif
    203 
    204 ifeq ($(CONFIG_BACKEND), file)
    205 OBJS += config_file.o
    206 ifndef CONFIG_NO_CONFIG_BLOBS
    207 NEED_BASE64=y
    208 endif
    209 CFLAGS += -DCONFIG_BACKEND_FILE
    210 endif
    211 
    212 ifeq ($(CONFIG_BACKEND), winreg)
    213 OBJS += config_winreg.o
    214 endif
    215 
    216 ifeq ($(CONFIG_BACKEND), none)
    217 OBJS += config_none.o
    218 endif
    219 
    220 ifdef CONFIG_NO_CONFIG_WRITE
    221 CFLAGS += -DCONFIG_NO_CONFIG_WRITE
    222 endif
    223 
    224 ifdef CONFIG_NO_CONFIG_BLOBS
    225 CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
    226 endif
    227 
    228 ifdef CONFIG_NO_SCAN_PROCESSING
    229 CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
    230 endif
    231 
    232 ifdef CONFIG_SUITEB
    233 CFLAGS += -DCONFIG_SUITEB
    234 NEED_SHA256=y
    235 NEED_AES_OMAC1=y
    236 endif
    237 
    238 ifdef CONFIG_SUITEB192
    239 CFLAGS += -DCONFIG_SUITEB192
    240 NEED_SHA384=y
    241 endif
    242 
    243 ifdef CONFIG_IEEE80211W
    244 CFLAGS += -DCONFIG_IEEE80211W
    245 NEED_SHA256=y
    246 NEED_AES_OMAC1=y
    247 endif
    248 
    249 ifdef CONFIG_IEEE80211R_AP
    250 CONFIG_IEEE80211R=y
    251 endif
    252 
    253 ifdef CONFIG_IEEE80211R
    254 CFLAGS += -DCONFIG_IEEE80211R
    255 OBJS += ../src/rsn_supp/wpa_ft.o
    256 NEED_SHA256=y
    257 NEED_AES_OMAC1=y
    258 endif
    259 
    260 ifdef CONFIG_MESH
    261 NEED_80211_COMMON=y
    262 NEED_SHA256=y
    263 NEED_AES_SIV=y
    264 CONFIG_SAE=y
    265 CONFIG_AP=y
    266 CFLAGS += -DCONFIG_MESH
    267 OBJS += mesh.o
    268 OBJS += mesh_mpm.o
    269 OBJS += mesh_rsn.o
    270 endif
    271 
    272 ifdef CONFIG_SAE
    273 CFLAGS += -DCONFIG_SAE
    274 OBJS += ../src/common/sae.o
    275 NEED_ECC=y
    276 NEED_DH_GROUPS=y
    277 endif
    278 
    279 ifdef CONFIG_DPP
    280 CFLAGS += -DCONFIG_DPP
    281 OBJS += ../src/common/dpp.o
    282 OBJS += dpp_supplicant.o
    283 NEED_AES_SIV=y
    284 NEED_HMAC_SHA256_KDF=y
    285 NEED_HMAC_SHA384_KDF=y
    286 NEED_HMAC_SHA512_KDF=y
    287 NEED_SHA256=y
    288 NEED_SHA384=y
    289 NEED_SHA512=y
    290 NEED_JSON=y
    291 NEED_GAS_SERVER=y
    292 NEED_BASE64=y
    293 endif
    294 
    295 ifdef CONFIG_OWE
    296 CFLAGS += -DCONFIG_OWE
    297 NEED_ECC=y
    298 NEED_HMAC_SHA256_KDF=y
    299 NEED_HMAC_SHA384_KDF=y
    300 NEED_HMAC_SHA512_KDF=y
    301 NEED_SHA256=y
    302 NEED_SHA384=y
    303 NEED_SHA512=y
    304 endif
    305 
    306 ifdef CONFIG_FILS
    307 CFLAGS += -DCONFIG_FILS
    308 NEED_SHA384=y
    309 NEED_AES_SIV=y
    310 ifdef CONFIG_FILS_SK_PFS
    311 CFLAGS += -DCONFIG_FILS_SK_PFS
    312 NEED_ECC=y
    313 endif
    314 endif
    315 
    316 ifdef CONFIG_MBO
    317 CONFIG_WNM=y
    318 endif
    319 
    320 ifdef CONFIG_WNM
    321 CFLAGS += -DCONFIG_WNM
    322 OBJS += wnm_sta.o
    323 endif
    324 
    325 ifdef CONFIG_TDLS
    326 CFLAGS += -DCONFIG_TDLS
    327 OBJS += ../src/rsn_supp/tdls.o
    328 NEED_SHA256=y
    329 NEED_AES_OMAC1=y
    330 endif
    331 
    332 ifdef CONFIG_TDLS_TESTING
    333 CFLAGS += -DCONFIG_TDLS_TESTING
    334 endif
    335 
    336 ifdef CONFIG_PMKSA_CACHE_EXTERNAL
    337 CFLAGS += -DCONFIG_PMKSA_CACHE_EXTERNAL
    338 endif
    339 
    340 ifndef CONFIG_NO_WPA
    341 OBJS += ../src/rsn_supp/wpa.o
    342 OBJS += ../src/rsn_supp/preauth.o
    343 OBJS += ../src/rsn_supp/pmksa_cache.o
    344 OBJS += ../src/rsn_supp/wpa_ie.o
    345 OBJS += ../src/common/wpa_common.o
    346 NEED_AES=y
    347 NEED_SHA1=y
    348 NEED_MD5=y
    349 NEED_RC4=y
    350 else
    351 CFLAGS += -DCONFIG_NO_WPA
    352 ifeq ($(CONFIG_TLS), internal)
    353 NEED_SHA1=y
    354 NEED_MD5=y
    355 endif
    356 endif
    357 
    358 ifdef CONFIG_IBSS_RSN
    359 NEED_RSN_AUTHENTICATOR=y
    360 CFLAGS += -DCONFIG_IBSS_RSN
    361 CFLAGS += -DCONFIG_NO_VLAN
    362 OBJS += ibss_rsn.o
    363 endif
    364 
    365 ifdef CONFIG_MATCH_IFACE
    366 CFLAGS += -DCONFIG_MATCH_IFACE
    367 endif
    368 
    369 ifdef CONFIG_P2P
    370 OBJS += p2p_supplicant.o
    371 OBJS += p2p_supplicant_sd.o
    372 OBJS += ../src/p2p/p2p.o
    373 OBJS += ../src/p2p/p2p_utils.o
    374 OBJS += ../src/p2p/p2p_parse.o
    375 OBJS += ../src/p2p/p2p_build.o
    376 OBJS += ../src/p2p/p2p_go_neg.o
    377 OBJS += ../src/p2p/p2p_sd.o
    378 OBJS += ../src/p2p/p2p_pd.o
    379 OBJS += ../src/p2p/p2p_invitation.o
    380 OBJS += ../src/p2p/p2p_dev_disc.o
    381 OBJS += ../src/p2p/p2p_group.o
    382 OBJS += ../src/ap/p2p_hostapd.o
    383 CFLAGS += -DCONFIG_P2P
    384 NEED_GAS=y
    385 NEED_OFFCHANNEL=y
    386 CONFIG_WPS=y
    387 CONFIG_AP=y
    388 ifdef CONFIG_P2P_STRICT
    389 CFLAGS += -DCONFIG_P2P_STRICT
    390 endif
    391 endif
    392 
    393 ifdef CONFIG_WIFI_DISPLAY
    394 CFLAGS += -DCONFIG_WIFI_DISPLAY
    395 OBJS += wifi_display.o
    396 endif
    397 
    398 ifdef CONFIG_HS20
    399 OBJS += hs20_supplicant.o
    400 CFLAGS += -DCONFIG_HS20
    401 CONFIG_INTERWORKING=y
    402 NEED_AES_OMAC1=y
    403 endif
    404 
    405 ifdef CONFIG_INTERWORKING
    406 OBJS += interworking.o
    407 CFLAGS += -DCONFIG_INTERWORKING
    408 NEED_GAS=y
    409 endif
    410 
    411 ifdef CONFIG_NO_ROAMING
    412 CFLAGS += -DCONFIG_NO_ROAMING
    413 endif
    414 
    415 include ../src/drivers/drivers.mak
    416 ifdef CONFIG_AP
    417 OBJS_d += $(DRV_BOTH_OBJS)
    418 CFLAGS += $(DRV_BOTH_CFLAGS)
    419 LDFLAGS += $(DRV_BOTH_LDFLAGS)
    420 LIBS += $(DRV_BOTH_LIBS)
    421 else
    422 NEED_AP_MLME=
    423 OBJS_d += $(DRV_WPA_OBJS)
    424 CFLAGS += $(DRV_WPA_CFLAGS)
    425 LDFLAGS += $(DRV_WPA_LDFLAGS)
    426 LIBS += $(DRV_WPA_LIBS)
    427 endif
    428 
    429 ifndef CONFIG_L2_PACKET
    430 CONFIG_L2_PACKET=linux
    431 endif
    432 
    433 OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
    434 
    435 ifeq ($(CONFIG_L2_PACKET), pcap)
    436 ifdef CONFIG_WINPCAP
    437 CFLAGS += -DCONFIG_WINPCAP
    438 LIBS += -lwpcap -lpacket
    439 LIBS_w += -lwpcap
    440 else
    441 LIBS += -ldnet -lpcap
    442 endif
    443 endif
    444 
    445 ifeq ($(CONFIG_L2_PACKET), winpcap)
    446 LIBS += -lwpcap -lpacket
    447 LIBS_w += -lwpcap
    448 endif
    449 
    450 ifeq ($(CONFIG_L2_PACKET), freebsd)
    451 LIBS += -lpcap
    452 endif
    453 
    454 ifdef CONFIG_ERP
    455 CFLAGS += -DCONFIG_ERP
    456 NEED_SHA256=y
    457 NEED_HMAC_SHA256_KDF=y
    458 endif
    459 
    460 ifdef CONFIG_EAP_TLS
    461 # EAP-TLS
    462 ifeq ($(CONFIG_EAP_TLS), dyn)
    463 CFLAGS += -DEAP_TLS_DYNAMIC
    464 EAPDYN += ../src/eap_peer/eap_tls.so
    465 else
    466 CFLAGS += -DEAP_TLS
    467 OBJS += ../src/eap_peer/eap_tls.o
    468 endif
    469 TLS_FUNCS=y
    470 CONFIG_IEEE8021X_EAPOL=y
    471 endif
    472 
    473 ifdef CONFIG_EAP_UNAUTH_TLS
    474 # EAP-UNAUTH-TLS
    475 CFLAGS += -DEAP_UNAUTH_TLS
    476 ifndef CONFIG_EAP_TLS
    477 OBJS += ../src/eap_peer/eap_tls.o
    478 TLS_FUNCS=y
    479 endif
    480 CONFIG_IEEE8021X_EAPOL=y
    481 endif
    482 
    483 ifdef CONFIG_EAP_PEAP
    484 # EAP-PEAP
    485 ifeq ($(CONFIG_EAP_PEAP), dyn)
    486 CFLAGS += -DEAP_PEAP_DYNAMIC
    487 EAPDYN += ../src/eap_peer/eap_peap.so
    488 else
    489 CFLAGS += -DEAP_PEAP
    490 OBJS += ../src/eap_peer/eap_peap.o
    491 OBJS += ../src/eap_common/eap_peap_common.o
    492 endif
    493 TLS_FUNCS=y
    494 CONFIG_IEEE8021X_EAPOL=y
    495 endif
    496 
    497 ifdef CONFIG_EAP_TTLS
    498 # EAP-TTLS
    499 ifeq ($(CONFIG_EAP_TTLS), dyn)
    500 CFLAGS += -DEAP_TTLS_DYNAMIC
    501 EAPDYN += ../src/eap_peer/eap_ttls.so
    502 else
    503 CFLAGS += -DEAP_TTLS
    504 OBJS += ../src/eap_peer/eap_ttls.o
    505 endif
    506 TLS_FUNCS=y
    507 ifndef CONFIG_FIPS
    508 MS_FUNCS=y
    509 CHAP=y
    510 endif
    511 CONFIG_IEEE8021X_EAPOL=y
    512 endif
    513 
    514 ifdef CONFIG_EAP_MD5
    515 # EAP-MD5
    516 ifeq ($(CONFIG_EAP_MD5), dyn)
    517 CFLAGS += -DEAP_MD5_DYNAMIC
    518 EAPDYN += ../src/eap_peer/eap_md5.so
    519 else
    520 CFLAGS += -DEAP_MD5
    521 OBJS += ../src/eap_peer/eap_md5.o
    522 endif
    523 CHAP=y
    524 CONFIG_IEEE8021X_EAPOL=y
    525 endif
    526 
    527 # backwards compatibility for old spelling
    528 ifdef CONFIG_MSCHAPV2
    529 ifndef CONFIG_EAP_MSCHAPV2
    530 CONFIG_EAP_MSCHAPV2=y
    531 endif
    532 endif
    533 
    534 ifdef CONFIG_EAP_MSCHAPV2
    535 # EAP-MSCHAPv2
    536 ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
    537 CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
    538 EAPDYN += ../src/eap_peer/eap_mschapv2.so
    539 EAPDYN += ../src/eap_peer/mschapv2.so
    540 else
    541 CFLAGS += -DEAP_MSCHAPv2
    542 OBJS += ../src/eap_peer/eap_mschapv2.o
    543 OBJS += ../src/eap_peer/mschapv2.o
    544 endif
    545 MS_FUNCS=y
    546 CONFIG_IEEE8021X_EAPOL=y
    547 endif
    548 
    549 ifdef CONFIG_EAP_GTC
    550 # EAP-GTC
    551 ifeq ($(CONFIG_EAP_GTC), dyn)
    552 CFLAGS += -DEAP_GTC_DYNAMIC
    553 EAPDYN += ../src/eap_peer/eap_gtc.so
    554 else
    555 CFLAGS += -DEAP_GTC
    556 OBJS += ../src/eap_peer/eap_gtc.o
    557 endif
    558 CONFIG_IEEE8021X_EAPOL=y
    559 endif
    560 
    561 ifdef CONFIG_EAP_OTP
    562 # EAP-OTP
    563 ifeq ($(CONFIG_EAP_OTP), dyn)
    564 CFLAGS += -DEAP_OTP_DYNAMIC
    565 EAPDYN += ../src/eap_peer/eap_otp.so
    566 else
    567 CFLAGS += -DEAP_OTP
    568 OBJS += ../src/eap_peer/eap_otp.o
    569 endif
    570 CONFIG_IEEE8021X_EAPOL=y
    571 endif
    572 
    573 ifdef CONFIG_EAP_SIM
    574 # EAP-SIM
    575 ifeq ($(CONFIG_EAP_SIM), dyn)
    576 CFLAGS += -DEAP_SIM_DYNAMIC
    577 EAPDYN += ../src/eap_peer/eap_sim.so
    578 else
    579 CFLAGS += -DEAP_SIM
    580 OBJS += ../src/eap_peer/eap_sim.o
    581 endif
    582 CONFIG_IEEE8021X_EAPOL=y
    583 CONFIG_EAP_SIM_COMMON=y
    584 NEED_AES_CBC=y
    585 endif
    586 
    587 ifdef CONFIG_EAP_LEAP
    588 # EAP-LEAP
    589 ifeq ($(CONFIG_EAP_LEAP), dyn)
    590 CFLAGS += -DEAP_LEAP_DYNAMIC
    591 EAPDYN += ../src/eap_peer/eap_leap.so
    592 else
    593 CFLAGS += -DEAP_LEAP
    594 OBJS += ../src/eap_peer/eap_leap.o
    595 endif
    596 MS_FUNCS=y
    597 CONFIG_IEEE8021X_EAPOL=y
    598 endif
    599 
    600 ifdef CONFIG_EAP_PSK
    601 # EAP-PSK
    602 ifeq ($(CONFIG_EAP_PSK), dyn)
    603 CFLAGS += -DEAP_PSK_DYNAMIC
    604 EAPDYN += ../src/eap_peer/eap_psk.so
    605 else
    606 CFLAGS += -DEAP_PSK
    607 OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
    608 endif
    609 CONFIG_IEEE8021X_EAPOL=y
    610 NEED_AES=y
    611 NEED_AES_OMAC1=y
    612 NEED_AES_ENCBLOCK=y
    613 NEED_AES_EAX=y
    614 endif
    615 
    616 ifdef CONFIG_EAP_AKA
    617 # EAP-AKA
    618 ifeq ($(CONFIG_EAP_AKA), dyn)
    619 CFLAGS += -DEAP_AKA_DYNAMIC
    620 EAPDYN += ../src/eap_peer/eap_aka.so
    621 else
    622 CFLAGS += -DEAP_AKA
    623 OBJS += ../src/eap_peer/eap_aka.o
    624 endif
    625 CONFIG_IEEE8021X_EAPOL=y
    626 CONFIG_EAP_SIM_COMMON=y
    627 NEED_AES_CBC=y
    628 endif
    629 
    630 ifdef CONFIG_EAP_PROXY
    631 CFLAGS += -DCONFIG_EAP_PROXY
    632 OBJS += ../src/eap_peer/eap_proxy_$(CONFIG_EAP_PROXY).o
    633 include eap_proxy_$(CONFIG_EAP_PROXY).mak
    634 CONFIG_IEEE8021X_EAPOL=y
    635 endif
    636 
    637 ifdef CONFIG_EAP_AKA_PRIME
    638 # EAP-AKA'
    639 ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
    640 CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
    641 else
    642 CFLAGS += -DEAP_AKA_PRIME
    643 endif
    644 NEED_SHA256=y
    645 endif
    646 
    647 ifdef CONFIG_EAP_SIM_COMMON
    648 OBJS += ../src/eap_common/eap_sim_common.o
    649 NEED_AES=y
    650 NEED_FIPS186_2_PRF=y
    651 endif
    652 
    653 ifdef CONFIG_EAP_FAST
    654 # EAP-FAST
    655 ifeq ($(CONFIG_EAP_FAST), dyn)
    656 CFLAGS += -DEAP_FAST_DYNAMIC
    657 EAPDYN += ../src/eap_peer/eap_fast.so
    658 EAPDYN += ../src/eap_common/eap_fast_common.o
    659 else
    660 CFLAGS += -DEAP_FAST
    661 OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
    662 OBJS += ../src/eap_common/eap_fast_common.o
    663 endif
    664 TLS_FUNCS=y
    665 CONFIG_IEEE8021X_EAPOL=y
    666 NEED_T_PRF=y
    667 endif
    668 
    669 ifdef CONFIG_EAP_PAX
    670 # EAP-PAX
    671 ifeq ($(CONFIG_EAP_PAX), dyn)
    672 CFLAGS += -DEAP_PAX_DYNAMIC
    673 EAPDYN += ../src/eap_peer/eap_pax.so
    674 else
    675 CFLAGS += -DEAP_PAX
    676 OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
    677 endif
    678 CONFIG_IEEE8021X_EAPOL=y
    679 endif
    680 
    681 ifdef CONFIG_EAP_SAKE
    682 # EAP-SAKE
    683 ifeq ($(CONFIG_EAP_SAKE), dyn)
    684 CFLAGS += -DEAP_SAKE_DYNAMIC
    685 EAPDYN += ../src/eap_peer/eap_sake.so
    686 else
    687 CFLAGS += -DEAP_SAKE
    688 OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
    689 endif
    690 CONFIG_IEEE8021X_EAPOL=y
    691 endif
    692 
    693 ifdef CONFIG_EAP_GPSK
    694 # EAP-GPSK
    695 ifeq ($(CONFIG_EAP_GPSK), dyn)
    696 CFLAGS += -DEAP_GPSK_DYNAMIC
    697 EAPDYN += ../src/eap_peer/eap_gpsk.so
    698 else
    699 CFLAGS += -DEAP_GPSK
    700 OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
    701 endif
    702 CONFIG_IEEE8021X_EAPOL=y
    703 ifdef CONFIG_EAP_GPSK_SHA256
    704 CFLAGS += -DEAP_GPSK_SHA256
    705 endif
    706 NEED_SHA256=y
    707 NEED_AES_OMAC1=y
    708 endif
    709 
    710 ifdef CONFIG_EAP_PWD
    711 CFLAGS += -DEAP_PWD
    712 OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
    713 CONFIG_IEEE8021X_EAPOL=y
    714 NEED_SHA256=y
    715 endif
    716 
    717 ifdef CONFIG_EAP_EKE
    718 # EAP-EKE
    719 ifeq ($(CONFIG_EAP_EKE), dyn)
    720 CFLAGS += -DEAP_EKE_DYNAMIC
    721 EAPDYN += ../src/eap_peer/eap_eke.so
    722 else
    723 CFLAGS += -DEAP_EKE
    724 OBJS += ../src/eap_peer/eap_eke.o ../src/eap_common/eap_eke_common.o
    725 endif
    726 CONFIG_IEEE8021X_EAPOL=y
    727 NEED_DH_GROUPS=y
    728 NEED_DH_GROUPS_ALL=y
    729 NEED_SHA256=y
    730 NEED_AES_CBC=y
    731 endif
    732 
    733 ifdef CONFIG_WPS
    734 # EAP-WSC
    735 CFLAGS += -DCONFIG_WPS -DEAP_WSC
    736 OBJS += wps_supplicant.o
    737 OBJS += ../src/utils/uuid.o
    738 OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
    739 OBJS += ../src/wps/wps.o
    740 OBJS += ../src/wps/wps_common.o
    741 OBJS += ../src/wps/wps_attr_parse.o
    742 OBJS += ../src/wps/wps_attr_build.o
    743 OBJS += ../src/wps/wps_attr_process.o
    744 OBJS += ../src/wps/wps_dev_attr.o
    745 OBJS += ../src/wps/wps_enrollee.o
    746 OBJS += ../src/wps/wps_registrar.o
    747 CONFIG_IEEE8021X_EAPOL=y
    748 NEED_DH_GROUPS=y
    749 NEED_SHA256=y
    750 NEED_BASE64=y
    751 NEED_AES_CBC=y
    752 NEED_MODEXP=y
    753 
    754 ifdef CONFIG_WPS_NFC
    755 CFLAGS += -DCONFIG_WPS_NFC
    756 OBJS += ../src/wps/ndef.o
    757 NEED_WPS_OOB=y
    758 endif
    759 
    760 ifdef NEED_WPS_OOB
    761 CFLAGS += -DCONFIG_WPS_OOB
    762 endif
    763 
    764 ifdef CONFIG_WPS_ER
    765 CONFIG_WPS_UPNP=y
    766 CFLAGS += -DCONFIG_WPS_ER
    767 OBJS += ../src/wps/wps_er.o
    768 OBJS += ../src/wps/wps_er_ssdp.o
    769 endif
    770 
    771 ifdef CONFIG_WPS_UPNP
    772 CFLAGS += -DCONFIG_WPS_UPNP
    773 OBJS += ../src/wps/wps_upnp.o
    774 OBJS += ../src/wps/wps_upnp_ssdp.o
    775 OBJS += ../src/wps/wps_upnp_web.o
    776 OBJS += ../src/wps/wps_upnp_event.o
    777 OBJS += ../src/wps/wps_upnp_ap.o
    778 OBJS += ../src/wps/upnp_xml.o
    779 OBJS += ../src/wps/httpread.o
    780 OBJS += ../src/wps/http_client.o
    781 OBJS += ../src/wps/http_server.o
    782 endif
    783 
    784 ifdef CONFIG_WPS_STRICT
    785 CFLAGS += -DCONFIG_WPS_STRICT
    786 OBJS += ../src/wps/wps_validate.o
    787 endif
    788 
    789 ifdef CONFIG_WPS_TESTING
    790 CFLAGS += -DCONFIG_WPS_TESTING
    791 endif
    792 
    793 ifdef CONFIG_WPS_REG_DISABLE_OPEN
    794 CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
    795 endif
    796 
    797 endif
    798 
    799 ifdef CONFIG_EAP_IKEV2
    800 # EAP-IKEv2
    801 ifeq ($(CONFIG_EAP_IKEV2), dyn)
    802 CFLAGS += -DEAP_IKEV2_DYNAMIC
    803 EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
    804 EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    805 else
    806 CFLAGS += -DEAP_IKEV2
    807 OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
    808 OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    809 endif
    810 CONFIG_IEEE8021X_EAPOL=y
    811 NEED_DH_GROUPS=y
    812 NEED_DH_GROUPS_ALL=y
    813 NEED_MODEXP=y
    814 NEED_CIPHER=y
    815 endif
    816 
    817 ifdef CONFIG_EAP_VENDOR_TEST
    818 ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
    819 CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
    820 EAPDYN += ../src/eap_peer/eap_vendor_test.so
    821 else
    822 CFLAGS += -DEAP_VENDOR_TEST
    823 OBJS += ../src/eap_peer/eap_vendor_test.o
    824 endif
    825 CONFIG_IEEE8021X_EAPOL=y
    826 endif
    827 
    828 ifdef CONFIG_EAP_TNC
    829 # EAP-TNC
    830 CFLAGS += -DEAP_TNC
    831 OBJS += ../src/eap_peer/eap_tnc.o
    832 OBJS += ../src/eap_peer/tncc.o
    833 NEED_BASE64=y
    834 ifndef CONFIG_NATIVE_WINDOWS
    835 ifndef CONFIG_DRIVER_BSD
    836 LIBS += -ldl
    837 endif
    838 endif
    839 endif
    840 
    841 ifdef CONFIG_MACSEC
    842 CFLAGS += -DCONFIG_MACSEC
    843 CONFIG_IEEE8021X_EAPOL=y
    844 NEED_AES_ENCBLOCK=y
    845 NEED_AES_UNWRAP=y
    846 NEED_AES_WRAP=y
    847 NEED_AES_OMAC1=y
    848 OBJS += wpas_kay.o
    849 OBJS += ../src/pae/ieee802_1x_cp.o
    850 OBJS += ../src/pae/ieee802_1x_kay.o
    851 OBJS += ../src/pae/ieee802_1x_key.o
    852 OBJS += ../src/pae/ieee802_1x_secy_ops.o
    853 endif
    854 
    855 ifdef CONFIG_IEEE8021X_EAPOL
    856 # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
    857 CFLAGS += -DIEEE8021X_EAPOL
    858 OBJS += ../src/eapol_supp/eapol_supp_sm.o
    859 OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
    860 NEED_EAP_COMMON=y
    861 ifdef CONFIG_DYNAMIC_EAP_METHODS
    862 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
    863 LIBS += -ldl -rdynamic
    864 endif
    865 endif
    866 
    867 ifdef CONFIG_AP
    868 NEED_EAP_COMMON=y
    869 NEED_RSN_AUTHENTICATOR=y
    870 CFLAGS += -DCONFIG_AP
    871 OBJS += ap.o
    872 CFLAGS += -DCONFIG_NO_RADIUS
    873 CFLAGS += -DCONFIG_NO_ACCOUNTING
    874 CFLAGS += -DCONFIG_NO_VLAN
    875 OBJS += ../src/ap/hostapd.o
    876 OBJS += ../src/ap/wpa_auth_glue.o
    877 OBJS += ../src/ap/utils.o
    878 OBJS += ../src/ap/authsrv.o
    879 OBJS += ../src/ap/ap_config.o
    880 OBJS += ../src/utils/ip_addr.o
    881 OBJS += ../src/ap/sta_info.o
    882 OBJS += ../src/ap/tkip_countermeasures.o
    883 OBJS += ../src/ap/ap_mlme.o
    884 OBJS += ../src/ap/ieee802_1x.o
    885 OBJS += ../src/eapol_auth/eapol_auth_sm.o
    886 OBJS += ../src/ap/ieee802_11_auth.o
    887 OBJS += ../src/ap/ieee802_11_shared.o
    888 OBJS += ../src/ap/drv_callbacks.o
    889 OBJS += ../src/ap/ap_drv_ops.o
    890 OBJS += ../src/ap/beacon.o
    891 OBJS += ../src/ap/bss_load.o
    892 OBJS += ../src/ap/eap_user_db.o
    893 OBJS += ../src/ap/neighbor_db.o
    894 OBJS += ../src/ap/rrm.o
    895 ifdef CONFIG_IEEE80211N
    896 OBJS += ../src/ap/ieee802_11_ht.o
    897 ifdef CONFIG_IEEE80211AC
    898 OBJS += ../src/ap/ieee802_11_vht.o
    899 endif
    900 ifdef CONFIG_IEEE80211AX
    901 OBJS += ../src/ap/ieee802_11_he.o
    902 endif
    903 endif
    904 ifdef CONFIG_WNM_AP
    905 CFLAGS += -DCONFIG_WNM_AP
    906 OBJS += ../src/ap/wnm_ap.o
    907 endif
    908 ifdef CONFIG_MBO
    909 OBJS += ../src/ap/mbo_ap.o
    910 endif
    911 ifdef CONFIG_FILS
    912 OBJS += ../src/ap/fils_hlp.o
    913 endif
    914 ifdef CONFIG_CTRL_IFACE
    915 OBJS += ../src/ap/ctrl_iface_ap.o
    916 endif
    917 
    918 CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
    919 OBJS += ../src/eap_server/eap_server.o
    920 OBJS += ../src/eap_server/eap_server_identity.o
    921 OBJS += ../src/eap_server/eap_server_methods.o
    922 
    923 ifdef CONFIG_IEEE80211N
    924 CFLAGS += -DCONFIG_IEEE80211N
    925 ifdef CONFIG_IEEE80211AC
    926 CFLAGS += -DCONFIG_IEEE80211AC
    927 endif
    928 ifdef CONFIG_IEEE80211AX
    929 CFLAGS += -DCONFIG_IEEE80211AX
    930 endif
    931 endif
    932 
    933 ifdef NEED_AP_MLME
    934 OBJS += ../src/ap/wmm.o
    935 OBJS += ../src/ap/ap_list.o
    936 OBJS += ../src/ap/ieee802_11.o
    937 OBJS += ../src/ap/hw_features.o
    938 OBJS += ../src/ap/dfs.o
    939 CFLAGS += -DNEED_AP_MLME
    940 endif
    941 ifdef CONFIG_WPS
    942 CFLAGS += -DEAP_SERVER_WSC
    943 OBJS += ../src/ap/wps_hostapd.o
    944 OBJS += ../src/eap_server/eap_server_wsc.o
    945 endif
    946 ifdef CONFIG_DPP
    947 OBJS += ../src/ap/dpp_hostapd.o
    948 OBJS += ../src/ap/gas_query_ap.o
    949 endif
    950 ifdef CONFIG_INTERWORKING
    951 OBJS += ../src/ap/gas_serv.o
    952 endif
    953 ifdef CONFIG_HS20
    954 OBJS += ../src/ap/hs20.o
    955 endif
    956 endif
    957 
    958 ifdef CONFIG_MBO
    959 OBJS += mbo.o
    960 CFLAGS += -DCONFIG_MBO
    961 endif
    962 
    963 ifdef NEED_RSN_AUTHENTICATOR
    964 CFLAGS += -DCONFIG_NO_RADIUS
    965 NEED_AES_WRAP=y
    966 OBJS += ../src/ap/wpa_auth.o
    967 OBJS += ../src/ap/wpa_auth_ie.o
    968 OBJS += ../src/ap/pmksa_cache_auth.o
    969 ifdef CONFIG_IEEE80211R_AP
    970 CFLAGS += -DCONFIG_IEEE80211R_AP
    971 OBJS += ../src/ap/wpa_auth_ft.o
    972 endif
    973 endif
    974 
    975 ifdef CONFIG_ACS
    976 CFLAGS += -DCONFIG_ACS
    977 OBJS += ../src/ap/acs.o
    978 LIBS += -lm
    979 endif
    980 
    981 ifdef CONFIG_PCSC
    982 # PC/SC interface for smartcards (USIM, GSM SIM)
    983 CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
    984 OBJS += ../src/utils/pcsc_funcs.o
    985 # -lpthread may not be needed depending on how pcsc-lite was configured
    986 ifdef CONFIG_NATIVE_WINDOWS
    987 #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
    988 #dynamic symbol loading that is now used in pcsc_funcs.c
    989 #LIBS += -lwinscard
    990 else
    991 ifdef CONFIG_OSX
    992 LIBS += -framework PCSC
    993 else
    994 LIBS += -lpcsclite -lpthread
    995 endif
    996 endif
    997 endif
    998 
    999 ifdef CONFIG_SIM_SIMULATOR
   1000 CFLAGS += -DCONFIG_SIM_SIMULATOR
   1001 NEED_MILENAGE=y
   1002 endif
   1003 
   1004 ifdef CONFIG_USIM_SIMULATOR
   1005 CFLAGS += -DCONFIG_USIM_SIMULATOR
   1006 NEED_MILENAGE=y
   1007 endif
   1008 
   1009 ifdef NEED_MILENAGE
   1010 OBJS += ../src/crypto/milenage.o
   1011 NEED_AES_ENCBLOCK=y
   1012 endif
   1013 
   1014 ifdef CONFIG_PKCS12
   1015 CFLAGS += -DPKCS12_FUNCS
   1016 endif
   1017 
   1018 ifdef CONFIG_SMARTCARD
   1019 CFLAGS += -DCONFIG_SMARTCARD
   1020 endif
   1021 
   1022 ifdef MS_FUNCS
   1023 OBJS += ../src/crypto/ms_funcs.o
   1024 NEED_DES=y
   1025 NEED_MD4=y
   1026 endif
   1027 
   1028 ifdef CHAP
   1029 OBJS += ../src/eap_common/chap.o
   1030 endif
   1031 
   1032 ifdef TLS_FUNCS
   1033 NEED_DES=y
   1034 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
   1035 OBJS += ../src/eap_peer/eap_tls_common.o
   1036 ifndef CONFIG_FIPS
   1037 NEED_TLS_PRF=y
   1038 NEED_SHA1=y
   1039 NEED_MD5=y
   1040 endif
   1041 endif
   1042 
   1043 ifndef CONFIG_TLS
   1044 CONFIG_TLS=openssl
   1045 endif
   1046 
   1047 ifdef CONFIG_TLSV11
   1048 CFLAGS += -DCONFIG_TLSV11
   1049 endif
   1050 
   1051 ifdef CONFIG_TLSV12
   1052 CFLAGS += -DCONFIG_TLSV12
   1053 NEED_SHA256=y
   1054 endif
   1055 
   1056 ifeq ($(CONFIG_TLS), openssl)
   1057 ifdef TLS_FUNCS
   1058 CFLAGS += -DEAP_TLS_OPENSSL
   1059 OBJS += ../src/crypto/tls_openssl.o
   1060 OBJS += ../src/crypto/tls_openssl_ocsp.o
   1061 LIBS += -lssl
   1062 endif
   1063 OBJS += ../src/crypto/crypto_openssl.o
   1064 OBJS_p += ../src/crypto/crypto_openssl.o
   1065 OBJS_priv += ../src/crypto/crypto_openssl.o
   1066 ifdef NEED_FIPS186_2_PRF
   1067 OBJS += ../src/crypto/fips_prf_openssl.o
   1068 endif
   1069 NEED_SHA256=y
   1070 NEED_TLS_PRF_SHA256=y
   1071 LIBS += -lcrypto
   1072 LIBS_p += -lcrypto
   1073 ifdef CONFIG_TLS_ADD_DL
   1074 LIBS += -ldl
   1075 LIBS_p += -ldl
   1076 endif
   1077 ifndef CONFIG_TLS_DEFAULT_CIPHERS
   1078 CONFIG_TLS_DEFAULT_CIPHERS = "DEFAULT:!EXP:!LOW"
   1079 endif
   1080 CFLAGS += -DTLS_DEFAULT_CIPHERS=\"$(CONFIG_TLS_DEFAULT_CIPHERS)\"
   1081 endif
   1082 
   1083 ifeq ($(CONFIG_TLS), gnutls)
   1084 ifdef TLS_FUNCS
   1085 OBJS += ../src/crypto/tls_gnutls.o
   1086 LIBS += -lgnutls -lgpg-error
   1087 endif
   1088 OBJS += ../src/crypto/crypto_gnutls.o
   1089 OBJS_p += ../src/crypto/crypto_gnutls.o
   1090 OBJS_priv += ../src/crypto/crypto_gnutls.o
   1091 ifdef NEED_FIPS186_2_PRF
   1092 OBJS += ../src/crypto/fips_prf_internal.o
   1093 SHA1OBJS += ../src/crypto/sha1-internal.o
   1094 endif
   1095 LIBS += -lgcrypt
   1096 LIBS_p += -lgcrypt
   1097 CONFIG_INTERNAL_SHA256=y
   1098 CONFIG_INTERNAL_RC4=y
   1099 CONFIG_INTERNAL_DH_GROUP5=y
   1100 endif
   1101 
   1102 ifeq ($(CONFIG_TLS), internal)
   1103 ifndef CONFIG_CRYPTO
   1104 CONFIG_CRYPTO=internal
   1105 endif
   1106 ifdef TLS_FUNCS
   1107 OBJS += ../src/crypto/crypto_internal-rsa.o
   1108 OBJS += ../src/crypto/tls_internal.o
   1109 OBJS += ../src/tls/tlsv1_common.o
   1110 OBJS += ../src/tls/tlsv1_record.o
   1111 OBJS += ../src/tls/tlsv1_cred.o
   1112 OBJS += ../src/tls/tlsv1_client.o
   1113 OBJS += ../src/tls/tlsv1_client_write.o
   1114 OBJS += ../src/tls/tlsv1_client_read.o
   1115 OBJS += ../src/tls/tlsv1_client_ocsp.o
   1116 OBJS += ../src/tls/asn1.o
   1117 OBJS += ../src/tls/rsa.o
   1118 OBJS += ../src/tls/x509v3.o
   1119 OBJS += ../src/tls/pkcs1.o
   1120 OBJS += ../src/tls/pkcs5.o
   1121 OBJS += ../src/tls/pkcs8.o
   1122 NEED_SHA256=y
   1123 NEED_BASE64=y
   1124 NEED_TLS_PRF=y
   1125 ifdef CONFIG_TLSV12
   1126 NEED_TLS_PRF_SHA256=y
   1127 endif
   1128 NEED_MODEXP=y
   1129 NEED_CIPHER=y
   1130 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
   1131 endif
   1132 ifdef NEED_CIPHER
   1133 NEED_DES=y
   1134 OBJS += ../src/crypto/crypto_internal-cipher.o
   1135 endif
   1136 ifdef NEED_MODEXP
   1137 OBJS += ../src/crypto/crypto_internal-modexp.o
   1138 OBJS += ../src/tls/bignum.o
   1139 endif
   1140 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
   1141 OBJS += ../src/crypto/crypto_libtomcrypt.o
   1142 OBJS_p += ../src/crypto/crypto_libtomcrypt.o
   1143 LIBS += -ltomcrypt -ltfm
   1144 LIBS_p += -ltomcrypt -ltfm
   1145 CONFIG_INTERNAL_SHA256=y
   1146 CONFIG_INTERNAL_RC4=y
   1147 CONFIG_INTERNAL_DH_GROUP5=y
   1148 endif
   1149 ifeq ($(CONFIG_CRYPTO), internal)
   1150 OBJS += ../src/crypto/crypto_internal.o
   1151 OBJS_p += ../src/crypto/crypto_internal.o
   1152 NEED_AES_ENC=y
   1153 CFLAGS += -DCONFIG_CRYPTO_INTERNAL
   1154 ifdef CONFIG_INTERNAL_LIBTOMMATH
   1155 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
   1156 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
   1157 CFLAGS += -DLTM_FAST
   1158 endif
   1159 else
   1160 LIBS += -ltommath
   1161 LIBS_p += -ltommath
   1162 endif
   1163 CONFIG_INTERNAL_AES=y
   1164 CONFIG_INTERNAL_DES=y
   1165 CONFIG_INTERNAL_SHA1=y
   1166 CONFIG_INTERNAL_MD4=y
   1167 CONFIG_INTERNAL_MD5=y
   1168 CONFIG_INTERNAL_SHA256=y
   1169 CONFIG_INTERNAL_SHA384=y
   1170 CONFIG_INTERNAL_SHA512=y
   1171 CONFIG_INTERNAL_RC4=y
   1172 CONFIG_INTERNAL_DH_GROUP5=y
   1173 endif
   1174 ifeq ($(CONFIG_CRYPTO), cryptoapi)
   1175 OBJS += ../src/crypto/crypto_cryptoapi.o
   1176 OBJS_p += ../src/crypto/crypto_cryptoapi.o
   1177 CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
   1178 CONFIG_INTERNAL_SHA256=y
   1179 CONFIG_INTERNAL_RC4=y
   1180 endif
   1181 endif
   1182 
   1183 ifeq ($(CONFIG_TLS), linux)
   1184 OBJS += ../src/crypto/crypto_linux.o
   1185 OBJS_p += ../src/crypto/crypto_linux.o
   1186 ifdef TLS_FUNCS
   1187 OBJS += ../src/crypto/crypto_internal-rsa.o
   1188 OBJS += ../src/crypto/tls_internal.o
   1189 OBJS += ../src/tls/tlsv1_common.o
   1190 OBJS += ../src/tls/tlsv1_record.o
   1191 OBJS += ../src/tls/tlsv1_cred.o
   1192 OBJS += ../src/tls/tlsv1_client.o
   1193 OBJS += ../src/tls/tlsv1_client_write.o
   1194 OBJS += ../src/tls/tlsv1_client_read.o
   1195 OBJS += ../src/tls/tlsv1_client_ocsp.o
   1196 OBJS += ../src/tls/asn1.o
   1197 OBJS += ../src/tls/rsa.o
   1198 OBJS += ../src/tls/x509v3.o
   1199 OBJS += ../src/tls/pkcs1.o
   1200 OBJS += ../src/tls/pkcs5.o
   1201 OBJS += ../src/tls/pkcs8.o
   1202 NEED_SHA256=y
   1203 NEED_BASE64=y
   1204 NEED_TLS_PRF=y
   1205 ifdef CONFIG_TLSV12
   1206 NEED_TLS_PRF_SHA256=y
   1207 endif
   1208 NEED_MODEXP=y
   1209 NEED_CIPHER=y
   1210 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
   1211 endif
   1212 ifdef NEED_MODEXP
   1213 OBJS += ../src/crypto/crypto_internal-modexp.o
   1214 OBJS += ../src/tls/bignum.o
   1215 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
   1216 CFLAGS += -DLTM_FAST
   1217 endif
   1218 CONFIG_INTERNAL_DH_GROUP5=y
   1219 ifdef NEED_FIPS186_2_PRF
   1220 OBJS += ../src/crypto/fips_prf_internal.o
   1221 OBJS += ../src/crypto/sha1-internal.o
   1222 endif
   1223 endif
   1224 
   1225 ifeq ($(CONFIG_TLS), none)
   1226 ifdef TLS_FUNCS
   1227 OBJS += ../src/crypto/tls_none.o
   1228 CFLAGS += -DEAP_TLS_NONE
   1229 CONFIG_INTERNAL_AES=y
   1230 CONFIG_INTERNAL_SHA1=y
   1231 CONFIG_INTERNAL_MD5=y
   1232 endif
   1233 OBJS += ../src/crypto/crypto_none.o
   1234 OBJS_p += ../src/crypto/crypto_none.o
   1235 CONFIG_INTERNAL_SHA256=y
   1236 CONFIG_INTERNAL_RC4=y
   1237 endif
   1238 
   1239 ifdef TLS_FUNCS
   1240 ifdef CONFIG_SMARTCARD
   1241 ifndef CONFIG_NATIVE_WINDOWS
   1242 ifneq ($(CONFIG_L2_PACKET), freebsd)
   1243 LIBS += -ldl
   1244 endif
   1245 endif
   1246 endif
   1247 endif
   1248 
   1249 ifndef TLS_FUNCS
   1250 OBJS += ../src/crypto/tls_none.o
   1251 ifeq ($(CONFIG_TLS), internal)
   1252 CONFIG_INTERNAL_AES=y
   1253 CONFIG_INTERNAL_SHA1=y
   1254 CONFIG_INTERNAL_MD5=y
   1255 CONFIG_INTERNAL_RC4=y
   1256 endif
   1257 endif
   1258 
   1259 AESOBJS = # none so far (see below)
   1260 ifdef CONFIG_INTERNAL_AES
   1261 AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
   1262 endif
   1263 
   1264 ifneq ($(CONFIG_TLS), openssl)
   1265 NEED_INTERNAL_AES_WRAP=y
   1266 endif
   1267 ifdef CONFIG_OPENSSL_INTERNAL_AES_WRAP
   1268 # Seems to be needed at least with BoringSSL
   1269 NEED_INTERNAL_AES_WRAP=y
   1270 CFLAGS += -DCONFIG_OPENSSL_INTERNAL_AES_WRAP
   1271 endif
   1272 ifdef CONFIG_FIPS
   1273 # Have to use internal AES key wrap routines to use OpenSSL EVP since the
   1274 # OpenSSL AES_wrap_key()/AES_unwrap_key() API is not available in FIPS mode.
   1275 NEED_INTERNAL_AES_WRAP=y
   1276 endif
   1277 
   1278 ifdef NEED_INTERNAL_AES_WRAP
   1279 ifneq ($(CONFIG_TLS), linux)
   1280 AESOBJS += ../src/crypto/aes-unwrap.o
   1281 endif
   1282 endif
   1283 ifdef NEED_AES_EAX
   1284 AESOBJS += ../src/crypto/aes-eax.o
   1285 NEED_AES_CTR=y
   1286 NEED_AES_OMAC1=y
   1287 endif
   1288 ifdef NEED_AES_SIV
   1289 AESOBJS += ../src/crypto/aes-siv.o
   1290 NEED_AES_CTR=y
   1291 NEED_AES_OMAC1=y
   1292 endif
   1293 ifdef NEED_AES_CTR
   1294 AESOBJS += ../src/crypto/aes-ctr.o
   1295 endif
   1296 ifdef NEED_AES_ENCBLOCK
   1297 AESOBJS += ../src/crypto/aes-encblock.o
   1298 endif
   1299 ifdef NEED_AES_OMAC1
   1300 NEED_AES_ENC=y
   1301 ifdef CONFIG_OPENSSL_CMAC
   1302 CFLAGS += -DCONFIG_OPENSSL_CMAC
   1303 else
   1304 ifneq ($(CONFIG_TLS), linux)
   1305 AESOBJS += ../src/crypto/aes-omac1.o
   1306 endif
   1307 endif
   1308 endif
   1309 ifdef NEED_AES_WRAP
   1310 NEED_AES_ENC=y
   1311 ifdef NEED_INTERNAL_AES_WRAP
   1312 AESOBJS += ../src/crypto/aes-wrap.o
   1313 endif
   1314 endif
   1315 ifdef NEED_AES_CBC
   1316 NEED_AES_ENC=y
   1317 ifneq ($(CONFIG_TLS), openssl)
   1318 ifneq ($(CONFIG_TLS), linux)
   1319 AESOBJS += ../src/crypto/aes-cbc.o
   1320 endif
   1321 endif
   1322 endif
   1323 ifdef NEED_AES_ENC
   1324 ifdef CONFIG_INTERNAL_AES
   1325 AESOBJS += ../src/crypto/aes-internal-enc.o
   1326 endif
   1327 endif
   1328 ifdef NEED_AES
   1329 OBJS += $(AESOBJS)
   1330 endif
   1331 
   1332 ifdef NEED_SHA1
   1333 ifneq ($(CONFIG_TLS), openssl)
   1334 ifneq ($(CONFIG_TLS), linux)
   1335 SHA1OBJS += ../src/crypto/sha1.o
   1336 endif
   1337 endif
   1338 SHA1OBJS += ../src/crypto/sha1-prf.o
   1339 ifdef CONFIG_INTERNAL_SHA1
   1340 SHA1OBJS += ../src/crypto/sha1-internal.o
   1341 ifdef NEED_FIPS186_2_PRF
   1342 SHA1OBJS += ../src/crypto/fips_prf_internal.o
   1343 endif
   1344 endif
   1345 ifdef CONFIG_NO_WPA_PASSPHRASE
   1346 CFLAGS += -DCONFIG_NO_PBKDF2
   1347 else
   1348 ifneq ($(CONFIG_TLS), openssl)
   1349 SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
   1350 endif
   1351 endif
   1352 ifdef NEED_T_PRF
   1353 SHA1OBJS += ../src/crypto/sha1-tprf.o
   1354 endif
   1355 ifdef NEED_TLS_PRF
   1356 SHA1OBJS += ../src/crypto/sha1-tlsprf.o
   1357 endif
   1358 endif
   1359 
   1360 ifndef CONFIG_FIPS
   1361 ifneq ($(CONFIG_TLS), openssl)
   1362 ifneq ($(CONFIG_TLS), linux)
   1363 MD5OBJS += ../src/crypto/md5.o
   1364 endif
   1365 endif
   1366 endif
   1367 ifdef NEED_MD5
   1368 ifdef CONFIG_INTERNAL_MD5
   1369 MD5OBJS += ../src/crypto/md5-internal.o
   1370 endif
   1371 OBJS += $(MD5OBJS)
   1372 OBJS_p += $(MD5OBJS)
   1373 OBJS_priv += $(MD5OBJS)
   1374 endif
   1375 
   1376 ifdef NEED_MD4
   1377 ifdef CONFIG_INTERNAL_MD4
   1378 OBJS += ../src/crypto/md4-internal.o
   1379 endif
   1380 endif
   1381 
   1382 DESOBJS = # none needed when not internal
   1383 ifdef NEED_DES
   1384 ifdef CONFIG_INTERNAL_DES
   1385 DESOBJS += ../src/crypto/des-internal.o
   1386 endif
   1387 endif
   1388 
   1389 ifdef CONFIG_NO_RC4
   1390 CFLAGS += -DCONFIG_NO_RC4
   1391 endif
   1392 
   1393 ifdef NEED_RC4
   1394 ifdef CONFIG_INTERNAL_RC4
   1395 ifndef CONFIG_NO_RC4
   1396 OBJS += ../src/crypto/rc4.o
   1397 endif
   1398 endif
   1399 endif
   1400 
   1401 SHA256OBJS = # none by default
   1402 ifdef NEED_SHA256
   1403 CFLAGS += -DCONFIG_SHA256
   1404 ifneq ($(CONFIG_TLS), openssl)
   1405 ifneq ($(CONFIG_TLS), linux)
   1406 SHA256OBJS += ../src/crypto/sha256.o
   1407 endif
   1408 endif
   1409 SHA256OBJS += ../src/crypto/sha256-prf.o
   1410 ifdef CONFIG_INTERNAL_SHA256
   1411 SHA256OBJS += ../src/crypto/sha256-internal.o
   1412 endif
   1413 ifdef CONFIG_INTERNAL_SHA384
   1414 CFLAGS += -DCONFIG_INTERNAL_SHA384
   1415 SHA256OBJS += ../src/crypto/sha384-internal.o
   1416 endif
   1417 ifdef CONFIG_INTERNAL_SHA512
   1418 CFLAGS += -DCONFIG_INTERNAL_SHA512
   1419 SHA256OBJS += ../src/crypto/sha512-internal.o
   1420 endif
   1421 ifdef NEED_TLS_PRF_SHA256
   1422 SHA256OBJS += ../src/crypto/sha256-tlsprf.o
   1423 endif
   1424 ifdef NEED_HMAC_SHA256_KDF
   1425 CFLAGS += -DCONFIG_HMAC_SHA256_KDF
   1426 OBJS += ../src/crypto/sha256-kdf.o
   1427 endif
   1428 ifdef NEED_HMAC_SHA384_KDF
   1429 CFLAGS += -DCONFIG_HMAC_SHA384_KDF
   1430 OBJS += ../src/crypto/sha384-kdf.o
   1431 endif
   1432 ifdef NEED_HMAC_SHA512_KDF
   1433 CFLAGS += -DCONFIG_HMAC_SHA512_KDF
   1434 OBJS += ../src/crypto/sha512-kdf.o
   1435 endif
   1436 OBJS += $(SHA256OBJS)
   1437 endif
   1438 ifdef NEED_SHA384
   1439 ifneq ($(CONFIG_TLS), openssl)
   1440 ifneq ($(CONFIG_TLS), linux)
   1441 OBJS += ../src/crypto/sha384.o
   1442 endif
   1443 endif
   1444 CFLAGS += -DCONFIG_SHA384
   1445 OBJS += ../src/crypto/sha384-prf.o
   1446 endif
   1447 ifdef NEED_SHA512
   1448 ifneq ($(CONFIG_TLS), openssl)
   1449 ifneq ($(CONFIG_TLS), linux)
   1450 OBJS += ../src/crypto/sha512.o
   1451 endif
   1452 endif
   1453 CFLAGS += -DCONFIG_SHA512
   1454 OBJS += ../src/crypto/sha512-prf.o
   1455 endif
   1456 
   1457 ifdef NEED_DH_GROUPS
   1458 OBJS += ../src/crypto/dh_groups.o
   1459 endif
   1460 ifdef NEED_DH_GROUPS_ALL
   1461 CFLAGS += -DALL_DH_GROUPS
   1462 endif
   1463 ifdef CONFIG_INTERNAL_DH_GROUP5
   1464 ifdef NEED_DH_GROUPS
   1465 OBJS += ../src/crypto/dh_group5.o
   1466 endif
   1467 endif
   1468 
   1469 ifdef NEED_ECC
   1470 CFLAGS += -DCONFIG_ECC
   1471 endif
   1472 
   1473 ifdef CONFIG_NO_RANDOM_POOL
   1474 CFLAGS += -DCONFIG_NO_RANDOM_POOL
   1475 else
   1476 OBJS += ../src/crypto/random.o
   1477 endif
   1478 
   1479 ifdef CONFIG_CTRL_IFACE
   1480 ifeq ($(CONFIG_CTRL_IFACE), y)
   1481 ifdef CONFIG_NATIVE_WINDOWS
   1482 CONFIG_CTRL_IFACE=named_pipe
   1483 else
   1484 CONFIG_CTRL_IFACE=unix
   1485 endif
   1486 endif
   1487 CFLAGS += -DCONFIG_CTRL_IFACE
   1488 ifeq ($(CONFIG_CTRL_IFACE), unix)
   1489 CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
   1490 OBJS += ../src/common/ctrl_iface_common.o
   1491 endif
   1492 ifeq ($(CONFIG_CTRL_IFACE), udp)
   1493 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
   1494 endif
   1495 ifeq ($(CONFIG_CTRL_IFACE), udp6)
   1496 CONFIG_CTRL_IFACE=udp
   1497 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
   1498 CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
   1499 endif
   1500 ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
   1501 CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
   1502 endif
   1503 ifeq ($(CONFIG_CTRL_IFACE), udp-remote)
   1504 CONFIG_CTRL_IFACE=udp
   1505 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
   1506 CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
   1507 endif
   1508 ifeq ($(CONFIG_CTRL_IFACE), udp6-remote)
   1509 CONFIG_CTRL_IFACE=udp
   1510 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
   1511 CFLAGS += -DCONFIG_CTRL_IFACE_UDP_REMOTE
   1512 CFLAGS += -DCONFIG_CTRL_IFACE_UDP_IPV6
   1513 endif
   1514 OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
   1515 endif
   1516 
   1517 ifdef CONFIG_CTRL_IFACE_DBUS
   1518 DBUS=y
   1519 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
   1520 DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
   1521 ifdef CONFIG_WPS
   1522 DBUS_OBJS += dbus/dbus_old_handlers_wps.o
   1523 endif
   1524 DBUS_OBJS += dbus/dbus_dict_helpers.o
   1525 ifndef DBUS_LIBS
   1526 DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
   1527 endif
   1528 ifndef DBUS_INCLUDE
   1529 DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
   1530 endif
   1531 DBUS_CFLAGS += $(DBUS_INCLUDE)
   1532 DBUS_INTERFACE=fi.epitest.hostap.WPASupplicant
   1533 endif
   1534 
   1535 ifdef CONFIG_CTRL_IFACE_DBUS_NEW
   1536 DBUS=y
   1537 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
   1538 DBUS_OBJS ?= dbus/dbus_dict_helpers.o
   1539 DBUS_OBJS += dbus/dbus_new_helpers.o
   1540 DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
   1541 ifdef CONFIG_WPS
   1542 DBUS_OBJS += dbus/dbus_new_handlers_wps.o
   1543 endif
   1544 ifdef CONFIG_P2P
   1545 DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
   1546 endif
   1547 ifndef DBUS_LIBS
   1548 DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
   1549 endif
   1550 ifndef DBUS_INCLUDE
   1551 DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
   1552 endif
   1553 ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
   1554 DBUS_OBJS += dbus/dbus_new_introspect.o
   1555 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
   1556 endif
   1557 DBUS_CFLAGS += $(DBUS_INCLUDE)
   1558 DBUS_INTERFACE=fi.w1.wpa_supplicant1
   1559 endif
   1560 
   1561 ifdef DBUS
   1562 DBUS_CFLAGS += -DCONFIG_DBUS
   1563 DBUS_OBJS += dbus/dbus_common.o
   1564 endif
   1565 
   1566 OBJS += $(DBUS_OBJS)
   1567 CFLAGS += $(DBUS_CFLAGS)
   1568 LIBS += $(DBUS_LIBS)
   1569 
   1570 ifdef CONFIG_READLINE
   1571 OBJS_c += ../src/utils/edit_readline.o
   1572 LIBS_c += -lreadline -lncurses
   1573 else
   1574 ifdef CONFIG_WPA_CLI_EDIT
   1575 OBJS_c += ../src/utils/edit.o
   1576 else
   1577 OBJS_c += ../src/utils/edit_simple.o
   1578 endif
   1579 endif
   1580 
   1581 ifdef CONFIG_NATIVE_WINDOWS
   1582 CFLAGS += -DCONFIG_NATIVE_WINDOWS
   1583 LIBS += -lws2_32 -lgdi32 -lcrypt32
   1584 LIBS_c += -lws2_32
   1585 LIBS_p += -lws2_32 -lgdi32
   1586 ifeq ($(CONFIG_CRYPTO), cryptoapi)
   1587 LIBS_p += -lcrypt32
   1588 endif
   1589 endif
   1590 
   1591 ifdef CONFIG_NO_STDOUT_DEBUG
   1592 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
   1593 ifndef CONFIG_CTRL_IFACE
   1594 CFLAGS += -DCONFIG_NO_WPA_MSG
   1595 endif
   1596 endif
   1597 
   1598 ifdef CONFIG_IPV6
   1599 # for eapol_test only
   1600 CFLAGS += -DCONFIG_IPV6
   1601 endif
   1602 
   1603 ifdef CONFIG_NO_LINUX_PACKET_SOCKET_WAR
   1604 CFLAGS += -DCONFIG_NO_LINUX_PACKET_SOCKET_WAR
   1605 endif
   1606 
   1607 ifdef NEED_BASE64
   1608 OBJS += ../src/utils/base64.o
   1609 endif
   1610 
   1611 ifdef NEED_SME
   1612 OBJS += sme.o
   1613 CFLAGS += -DCONFIG_SME
   1614 endif
   1615 
   1616 OBJS += ../src/common/ieee802_11_common.o
   1617 OBJS += ../src/common/hw_features_common.o
   1618 
   1619 ifdef NEED_EAP_COMMON
   1620 OBJS += ../src/eap_common/eap_common.o
   1621 endif
   1622 
   1623 ifndef CONFIG_MAIN
   1624 CONFIG_MAIN=main
   1625 endif
   1626 
   1627 ifdef CONFIG_DEBUG_SYSLOG
   1628 CFLAGS += -DCONFIG_DEBUG_SYSLOG
   1629 ifdef CONFIG_DEBUG_SYSLOG_FACILITY
   1630 CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
   1631 endif
   1632 endif
   1633 
   1634 ifdef CONFIG_DEBUG_LINUX_TRACING
   1635 CFLAGS += -DCONFIG_DEBUG_LINUX_TRACING
   1636 endif
   1637 
   1638 ifdef CONFIG_DEBUG_FILE
   1639 CFLAGS += -DCONFIG_DEBUG_FILE
   1640 endif
   1641 
   1642 ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
   1643 CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
   1644 endif
   1645 
   1646 ifdef CONFIG_FIPS
   1647 CFLAGS += -DCONFIG_FIPS
   1648 ifneq ($(CONFIG_TLS), openssl)
   1649 $(error CONFIG_FIPS=y requires CONFIG_TLS=openssl)
   1650 endif
   1651 endif
   1652 
   1653 OBJS += $(SHA1OBJS) $(DESOBJS)
   1654 
   1655 OBJS_p += $(SHA1OBJS)
   1656 OBJS_p += $(SHA256OBJS)
   1657 OBJS_priv += $(SHA1OBJS)
   1658 
   1659 ifdef CONFIG_BGSCAN_SIMPLE
   1660 CFLAGS += -DCONFIG_BGSCAN_SIMPLE
   1661 OBJS += bgscan_simple.o
   1662 NEED_BGSCAN=y
   1663 endif
   1664 
   1665 ifdef CONFIG_BGSCAN_LEARN
   1666 CFLAGS += -DCONFIG_BGSCAN_LEARN
   1667 OBJS += bgscan_learn.o
   1668 NEED_BGSCAN=y
   1669 endif
   1670 
   1671 ifdef NEED_BGSCAN
   1672 CFLAGS += -DCONFIG_BGSCAN
   1673 OBJS += bgscan.o
   1674 endif
   1675 
   1676 ifdef CONFIG_AUTOSCAN_EXPONENTIAL
   1677 CFLAGS += -DCONFIG_AUTOSCAN_EXPONENTIAL
   1678 OBJS += autoscan_exponential.o
   1679 NEED_AUTOSCAN=y
   1680 endif
   1681 
   1682 ifdef CONFIG_AUTOSCAN_PERIODIC
   1683 CFLAGS += -DCONFIG_AUTOSCAN_PERIODIC
   1684 OBJS += autoscan_periodic.o
   1685 NEED_AUTOSCAN=y
   1686 endif
   1687 
   1688 ifdef NEED_AUTOSCAN
   1689 CFLAGS += -DCONFIG_AUTOSCAN
   1690 OBJS += autoscan.o
   1691 endif
   1692 
   1693 ifdef CONFIG_EXT_PASSWORD_TEST
   1694 OBJS += ../src/utils/ext_password_test.o
   1695 CFLAGS += -DCONFIG_EXT_PASSWORD_TEST
   1696 NEED_EXT_PASSWORD=y
   1697 endif
   1698 
   1699 ifdef NEED_EXT_PASSWORD
   1700 OBJS += ../src/utils/ext_password.o
   1701 CFLAGS += -DCONFIG_EXT_PASSWORD
   1702 endif
   1703 
   1704 ifdef NEED_GAS_SERVER
   1705 OBJS += ../src/common/gas_server.o
   1706 CFLAGS += -DCONFIG_GAS_SERVER
   1707 NEED_GAS=y
   1708 endif
   1709 
   1710 ifdef NEED_GAS
   1711 OBJS += ../src/common/gas.o
   1712 OBJS += gas_query.o
   1713 CFLAGS += -DCONFIG_GAS
   1714 NEED_OFFCHANNEL=y
   1715 endif
   1716 
   1717 ifdef NEED_OFFCHANNEL
   1718 OBJS += offchannel.o
   1719 CFLAGS += -DCONFIG_OFFCHANNEL
   1720 endif
   1721 
   1722 ifdef NEED_JSON
   1723 OBJS += ../src/utils/json.o
   1724 CFLAGS += -DCONFIG_JSON
   1725 endif
   1726 
   1727 ifdef CONFIG_MODULE_TESTS
   1728 CFLAGS += -DCONFIG_MODULE_TESTS
   1729 OBJS += wpas_module_tests.o
   1730 OBJS += ../src/utils/utils_module_tests.o
   1731 OBJS += ../src/common/common_module_tests.o
   1732 OBJS += ../src/crypto/crypto_module_tests.o
   1733 ifdef CONFIG_WPS
   1734 OBJS += ../src/wps/wps_module_tests.o
   1735 endif
   1736 endif
   1737 
   1738 OBJS += ../src/drivers/driver_common.o
   1739 OBJS_priv += ../src/drivers/driver_common.o
   1740 
   1741 OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
   1742 OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
   1743 OBJS_t += ../src/radius/radius_client.o
   1744 OBJS_t += ../src/radius/radius.o
   1745 ifndef CONFIG_AP
   1746 OBJS_t += ../src/utils/ip_addr.o
   1747 endif
   1748 OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
   1749 
   1750 OBJS_nfc := $(OBJS) $(OBJS_l2) nfc_pw_token.o
   1751 OBJS_nfc += $(OBJS_d) ../src/drivers/drivers.o
   1752 
   1753 OBJS += $(CONFIG_MAIN).o
   1754 
   1755 ifdef CONFIG_PRIVSEP
   1756 OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
   1757 OBJS_priv += $(OBJS_l2)
   1758 OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
   1759 OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
   1760 OBJS_priv += ../src/utils/common.o
   1761 OBJS_priv += ../src/utils/wpa_debug.o
   1762 OBJS_priv += ../src/utils/wpabuf.o
   1763 OBJS_priv += wpa_priv.o
   1764 ifdef CONFIG_DRIVER_NL80211
   1765 OBJS_priv += ../src/common/ieee802_11_common.o
   1766 endif
   1767 OBJS += ../src/l2_packet/l2_packet_privsep.o
   1768 OBJS += ../src/drivers/driver_privsep.o
   1769 EXTRA_progs += wpa_priv
   1770 else
   1771 OBJS += $(OBJS_d) ../src/drivers/drivers.o
   1772 OBJS += $(OBJS_l2)
   1773 endif
   1774 
   1775 ifdef CONFIG_NDIS_EVENTS_INTEGRATED
   1776 CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
   1777 OBJS += ../src/drivers/ndis_events.o
   1778 EXTRALIBS += -loleaut32 -lole32 -luuid
   1779 ifdef PLATFORMSDKLIB
   1780 EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
   1781 else
   1782 EXTRALIBS += WbemUuid.Lib
   1783 endif
   1784 endif
   1785 
   1786 ifdef CONFIG_FST
   1787 CFLAGS += -DCONFIG_FST
   1788 ifdef CONFIG_FST_TEST
   1789 CFLAGS += -DCONFIG_FST_TEST
   1790 endif
   1791 FST_OBJS += ../src/fst/fst.o
   1792 FST_OBJS += ../src/fst/fst_session.o
   1793 FST_OBJS += ../src/fst/fst_iface.o
   1794 FST_OBJS += ../src/fst/fst_group.o
   1795 FST_OBJS += ../src/fst/fst_ctrl_aux.o
   1796 ifdef CONFIG_CTRL_IFACE
   1797 FST_OBJS += ../src/fst/fst_ctrl_iface.o
   1798 endif
   1799 OBJS += $(FST_OBJS)
   1800 OBJS_t += $(FST_OBJS)
   1801 OBJS_t2 += $(FST_OBJS)
   1802 OBJS_nfc += $(FST_OBJS)
   1803 endif
   1804 
   1805 ifndef LDO
   1806 LDO=$(CC)
   1807 endif
   1808 
   1809 Q=@
   1810 E=echo
   1811 ifeq ($(V), 1)
   1812 Q=
   1813 E=true
   1814 endif
   1815 ifeq ($(QUIET), 1)
   1816 Q=@
   1817 E=true
   1818 endif
   1819 
   1820 dynamic_eap_methods: $(EAPDYN)
   1821 
   1822 ../src/drivers/build.wpa_supplicant:
   1823 	@if [ -f ../src/drivers/build.hostapd ]; then \
   1824 		$(MAKE) -C ../src/drivers clean; \
   1825 	fi
   1826 	@touch ../src/drivers/build.wpa_supplicant
   1827 
   1828 BCHECK=../src/drivers/build.wpa_supplicant
   1829 
   1830 wpa_priv: $(BCHECK) $(OBJS_priv)
   1831 	$(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
   1832 	@$(E) "  LD " $@
   1833 
   1834 $(OBJS_c) $(OBJS_t) $(OBJS_t2) $(OBJS) $(BCHECK) $(EXTRA_progs): .config
   1835 
   1836 wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs)
   1837 	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
   1838 	@$(E) "  LD " $@
   1839 
   1840 eapol_test: $(OBJS_t)
   1841 	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
   1842 	@$(E) "  LD " $@
   1843 
   1844 preauth_test: $(OBJS_t2)
   1845 	$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
   1846 	@$(E) "  LD " $@
   1847 
   1848 wpa_passphrase: $(OBJS_p)
   1849 	$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
   1850 	@$(E) "  LD " $@
   1851 
   1852 wpa_cli: $(OBJS_c)
   1853 	$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
   1854 	@$(E) "  LD " $@
   1855 
   1856 LIBCTRL += ../src/common/wpa_ctrl.o
   1857 LIBCTRL += ../src/utils/os_$(CONFIG_OS).o
   1858 LIBCTRL += ../src/utils/common.o
   1859 LIBCTRL += ../src/utils/wpa_debug.o
   1860 LIBCTRLSO += ../src/common/wpa_ctrl.c
   1861 LIBCTRLSO += ../src/utils/os_$(CONFIG_OS).c
   1862 LIBCTRLSO += ../src/utils/common.c
   1863 LIBCTRLSO += ../src/utils/wpa_debug.c
   1864 
   1865 libwpa_client.a: $(LIBCTRL)
   1866 	$(Q)rm -f $@
   1867 	$(Q)$(AR) crs $@ $?
   1868 	@$(E) "  AR " $@
   1869 
   1870 libwpa_client.so: $(LIBCTRLSO)
   1871 	@$(E) "  CC  $@ ($^)"
   1872 	$(Q)$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -fPIC $^
   1873 
   1874 libwpa_test1: libwpa_test.o libwpa_client.a
   1875 	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test1 libwpa_test.o libwpa_client.a $(LIBS_c)
   1876 	@$(E) "  LD " $@
   1877 
   1878 libwpa_test2: libwpa_test.o libwpa_client.so
   1879 	$(Q)$(LDO) $(LDFLAGS) -o libwpa_test2 libwpa_test.o -L. -lwpa_client $(LIBS_c)
   1880 	@$(E) "  LD " $@
   1881 
   1882 nfc_pw_token: $(OBJS_nfc)
   1883 	$(Q)$(LDO) $(LDFLAGS) -o nfc_pw_token $(OBJS_nfc) $(LIBS)
   1884 	@$(E) "  LD " $@
   1885 
   1886 win_if_list: win_if_list.c
   1887 	$(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
   1888 	@$(E) "  LD " $@
   1889 
   1890 eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
   1891 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1892 		-Deap_peer_psk_register=eap_peer_method_dynamic_init
   1893 
   1894 eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
   1895 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1896 		-Deap_peer_pax_register=eap_peer_method_dynamic_init
   1897 
   1898 eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
   1899 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1900 		-Deap_peer_sake_register=eap_peer_method_dynamic_init
   1901 
   1902 eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
   1903 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1904 		-Deap_peer_wsc_register=eap_peer_method_dynamic_init
   1905 
   1906 eap_ikev2.so: ../src/eap_peer/eap_ikev2.c ../src/eap_peer/ikev2.c ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.c
   1907 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1908 		-Deap_peer_ikev2_register=eap_peer_method_dynamic_init
   1909 
   1910 eap_eke.so: ../src/eap_peer/eap_eke.c ../src/eap_common/eap_eke_common.c
   1911 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1912 		-Deap_peer_eke_register=eap_peer_method_dynamic_init
   1913 
   1914 %.so: %.c
   1915 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
   1916 		-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
   1917 
   1918 ifdef CONFIG_CODE_COVERAGE
   1919 %.o: %.c
   1920 	@$(E) "  CC " $<
   1921 	$(Q)cd $(dir $@); $(CC) -c -o $(notdir $@) $(CFLAGS) $(notdir $<)
   1922 else
   1923 %.o: %.c
   1924 	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
   1925 	@$(E) "  CC " $<
   1926 endif
   1927 
   1928 %.service: %.service.in
   1929 	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
   1930 		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
   1931 	@$(E) "  sed" $<
   1932 
   1933 %@.service: %.service.arg.in
   1934 	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' \
   1935 		-e 's|\@DBUS_INTERFACE\@|$(DBUS_INTERFACE)|g' $< >$@
   1936 	@$(E) "  sed" $<
   1937 
   1938 wpa_supplicant.exe: wpa_supplicant
   1939 	mv -f $< $@
   1940 wpa_cli.exe: wpa_cli
   1941 	mv -f $< $@
   1942 wpa_passphrase.exe: wpa_passphrase
   1943 	mv -f $< $@
   1944 win_if_list.exe: win_if_list
   1945 	mv -f $< $@
   1946 eapol_test.exe: eapol_test
   1947 	mv -f $< $@
   1948 
   1949 WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
   1950 
   1951 windows-bin: $(WINALL)
   1952 	$(STRIP) $(WINALL)
   1953 
   1954 wpa_gui:
   1955 	@echo "wpa_gui has been removed - see wpa_gui-qt4 for replacement"
   1956 
   1957 wpa_gui-qt4/Makefile:
   1958 	qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro
   1959 
   1960 wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
   1961 	lrelease wpa_gui-qt4/wpa_gui.pro
   1962 
   1963 wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
   1964 	$(MAKE) -C wpa_gui-qt4
   1965 
   1966 FIPSDIR=/usr/local/ssl/fips-2.0
   1967 FIPSLD=$(FIPSDIR)/bin/fipsld
   1968 fips:
   1969 	$(MAKE) CC=$(FIPSLD) FIPSLD_CC="$(CC)"
   1970 
   1971 lcov-html: wpa_supplicant.gcda
   1972 	lcov -c -d .. > lcov.info
   1973 	genhtml lcov.info --output-directory lcov-html
   1974 
   1975 clean:
   1976 	$(MAKE) -C ../src clean
   1977 	$(MAKE) -C dbus clean
   1978 	rm -f core *~ *.o *.d *.gcno *.gcda *.gcov
   1979 	rm -f eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
   1980 	rm -f wpa_priv
   1981 	rm -f nfc_pw_token
   1982 	rm -f lcov.info
   1983 	rm -rf lcov-html
   1984 	rm -f libwpa_client.a
   1985 	rm -f libwpa_client.so
   1986 	rm -f libwpa_test1 libwpa_test2
   1987 
   1988 -include $(OBJS:%.o=%.d)
   1989