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 export LIBDIR ?= /usr/local/lib/
     10 export BINDIR ?= /usr/local/sbin/
     11 PKG_CONFIG ?= pkg-config
     12 
     13 CFLAGS += -I../src
     14 CFLAGS += -I../src/utils
     15 
     16 -include .config
     17 
     18 ALL=wpa_supplicant wpa_cli
     19 
     20 ifndef CONFIG_NO_WPA_PASSPHRASE
     21 ALL += wpa_passphrase
     22 endif
     23 
     24 all: verify_config $(ALL) dynamic_eap_methods
     25 
     26 verify_config:
     27 	@if [ ! -r .config ]; then \
     28 		echo 'Building wpa_supplicant requires a configuration file'; \
     29 		echo '(.config). See README for more instructions. You can'; \
     30 		echo 'run "cp defconfig .config" to create an example'; \
     31 		echo 'configuration.'; \
     32 		exit 1; \
     33 	fi
     34 
     35 mkconfig:
     36 	@if [ -f .config ]; then \
     37 		echo '.config exists - did not replace it'; \
     38 		exit 1; \
     39 	fi
     40 	echo CONFIG_DRIVER_HOSTAP=y >> .config
     41 	echo CONFIG_DRIVER_WEXT=y >> .config
     42 
     43 install: all
     44 	mkdir -p $(DESTDIR)$(BINDIR)
     45 	for i in $(ALL); do cp $$i $(DESTDIR)$(BINDIR)/$$i; done
     46 	$(MAKE) -C ../src install
     47 
     48 OBJS = config.o
     49 OBJS += notify.o
     50 OBJS += bss.o
     51 OBJS += eap_register.o
     52 OBJS += ../src/utils/common.o
     53 OBJS += ../src/utils/wpa_debug.o
     54 OBJS += ../src/utils/wpabuf.o
     55 OBJS_p = wpa_passphrase.o
     56 OBJS_p += ../src/utils/common.o
     57 OBJS_p += ../src/utils/wpa_debug.o
     58 OBJS_p += ../src/utils/wpabuf.o
     59 OBJS_c = wpa_cli.o ../src/common/wpa_ctrl.o
     60 OBJS_c += ../src/utils/wpa_debug.o
     61 
     62 ifndef CONFIG_OS
     63 ifdef CONFIG_NATIVE_WINDOWS
     64 CONFIG_OS=win32
     65 else
     66 CONFIG_OS=unix
     67 endif
     68 endif
     69 
     70 ifeq ($(CONFIG_OS), internal)
     71 CFLAGS += -DOS_NO_C_LIB_DEFINES
     72 endif
     73 
     74 OBJS += ../src/utils/os_$(CONFIG_OS).o
     75 OBJS_p += ../src/utils/os_$(CONFIG_OS).o
     76 OBJS_c += ../src/utils/os_$(CONFIG_OS).o
     77 
     78 ifdef CONFIG_WPA_TRACE
     79 CFLAGS += -DWPA_TRACE
     80 OBJS += ../src/utils/trace.o
     81 OBJS_p += ../src/utils/trace.o
     82 OBJS_c += ../src/utils/trace.o
     83 LDFLAGS += -rdynamic
     84 CFLAGS += -funwind-tables
     85 ifdef CONFIG_WPA_TRACE_BFD
     86 CFLAGS += -DWPA_TRACE_BFD
     87 LIBS += -lbfd
     88 LIBS_p += -lbfd
     89 LIBS_c += -lbfd
     90 endif
     91 endif
     92 
     93 ifndef CONFIG_ELOOP
     94 CONFIG_ELOOP=eloop
     95 endif
     96 OBJS += ../src/utils/$(CONFIG_ELOOP).o
     97 OBJS_c += ../src/utils/$(CONFIG_ELOOP).o
     98 
     99 
    100 ifdef CONFIG_EAPOL_TEST
    101 CFLAGS += -Werror -DEAPOL_TEST
    102 endif
    103 
    104 ifndef CONFIG_BACKEND
    105 CONFIG_BACKEND=file
    106 endif
    107 
    108 ifeq ($(CONFIG_BACKEND), file)
    109 OBJS += config_file.o
    110 ifndef CONFIG_NO_CONFIG_BLOBS
    111 NEED_BASE64=y
    112 endif
    113 CFLAGS += -DCONFIG_BACKEND_FILE
    114 endif
    115 
    116 ifeq ($(CONFIG_BACKEND), winreg)
    117 OBJS += config_winreg.o
    118 endif
    119 
    120 ifeq ($(CONFIG_BACKEND), none)
    121 OBJS += config_none.o
    122 endif
    123 
    124 ifdef CONFIG_NO_CONFIG_WRITE
    125 CFLAGS += -DCONFIG_NO_CONFIG_WRITE
    126 endif
    127 
    128 ifdef CONFIG_NO_CONFIG_BLOBS
    129 CFLAGS += -DCONFIG_NO_CONFIG_BLOBS
    130 endif
    131 
    132 ifdef CONFIG_NO_SCAN_PROCESSING
    133 CFLAGS += -DCONFIG_NO_SCAN_PROCESSING
    134 endif
    135 
    136 ifdef CONFIG_IEEE80211W
    137 CFLAGS += -DCONFIG_IEEE80211W
    138 NEED_SHA256=y
    139 NEED_AES_OMAC1=y
    140 endif
    141 
    142 ifdef CONFIG_IEEE80211R
    143 CFLAGS += -DCONFIG_IEEE80211R
    144 OBJS += ../src/rsn_supp/wpa_ft.o
    145 NEED_80211_COMMON=y
    146 NEED_SHA256=y
    147 NEED_AES_OMAC1=y
    148 endif
    149 
    150 ifdef CONFIG_TDLS
    151 CFLAGS += -DCONFIG_TDLS
    152 OBJS += ../src/rsn_supp/tdls.o
    153 NEED_SHA256=y
    154 NEED_AES_OMAC1=y
    155 endif
    156 
    157 ifdef CONFIG_PEERKEY
    158 CFLAGS += -DCONFIG_PEERKEY
    159 endif
    160 
    161 ifndef CONFIG_NO_WPA
    162 OBJS += ../src/rsn_supp/wpa.o
    163 OBJS += ../src/rsn_supp/preauth.o
    164 OBJS += ../src/rsn_supp/pmksa_cache.o
    165 OBJS += ../src/rsn_supp/peerkey.o
    166 OBJS += ../src/rsn_supp/wpa_ie.o
    167 OBJS += ../src/common/wpa_common.o
    168 NEED_AES=y
    169 NEED_SHA1=y
    170 NEED_MD5=y
    171 NEED_RC4=y
    172 else
    173 CFLAGS += -DCONFIG_NO_WPA -DCONFIG_NO_WPA2
    174 endif
    175 
    176 ifdef CONFIG_IBSS_RSN
    177 NEED_RSN_AUTHENTICATOR=y
    178 CFLAGS += -DCONFIG_IBSS_RSN
    179 OBJS += ibss_rsn.o
    180 endif
    181 
    182 ifdef CONFIG_P2P
    183 OBJS += p2p_supplicant.o
    184 OBJS += ../src/p2p/p2p.o
    185 OBJS += ../src/p2p/p2p_utils.o
    186 OBJS += ../src/p2p/p2p_parse.o
    187 OBJS += ../src/p2p/p2p_build.o
    188 OBJS += ../src/p2p/p2p_go_neg.o
    189 OBJS += ../src/p2p/p2p_sd.o
    190 OBJS += ../src/p2p/p2p_pd.o
    191 OBJS += ../src/p2p/p2p_invitation.o
    192 OBJS += ../src/p2p/p2p_dev_disc.o
    193 OBJS += ../src/p2p/p2p_group.o
    194 OBJS += ../src/ap/p2p_hostapd.o
    195 CFLAGS += -DCONFIG_P2P
    196 NEED_80211_COMMON=y
    197 ifdef CONFIG_P2P_STRICT
    198 CFLAGS += -DCONFIG_P2P_STRICT
    199 endif
    200 endif
    201 
    202 ifdef CONFIG_NO_WPA2
    203 CFLAGS += -DCONFIG_NO_WPA2
    204 endif
    205 
    206 include ../src/drivers/drivers.mak
    207 ifdef CONFIG_AP
    208 OBJS_d += $(DRV_BOTH_OBJS)
    209 CFLAGS += $(DRV_BOTH_CFLAGS)
    210 LDFLAGS += $(DRV_BOTH_LDFLAGS)
    211 LIBS += $(DRV_BOTH_LIBS)
    212 else
    213 NEED_AP_MLME=
    214 OBJS_d += $(DRV_WPA_OBJS)
    215 CFLAGS += $(DRV_WPA_CFLAGS)
    216 LDFLAGS += $(DRV_WPA_LDFLAGS)
    217 LIBS += $(DRV_WPA_LIBS)
    218 endif
    219 
    220 ifndef CONFIG_L2_PACKET
    221 CONFIG_L2_PACKET=linux
    222 endif
    223 
    224 OBJS_l2 += ../src/l2_packet/l2_packet_$(CONFIG_L2_PACKET).o
    225 
    226 ifeq ($(CONFIG_L2_PACKET), pcap)
    227 ifdef CONFIG_WINPCAP
    228 CFLAGS += -DCONFIG_WINPCAP
    229 LIBS += -lwpcap -lpacket
    230 LIBS_w += -lwpcap
    231 else
    232 LIBS += -ldnet -lpcap
    233 endif
    234 endif
    235 
    236 ifeq ($(CONFIG_L2_PACKET), winpcap)
    237 LIBS += -lwpcap -lpacket
    238 LIBS_w += -lwpcap
    239 endif
    240 
    241 ifeq ($(CONFIG_L2_PACKET), freebsd)
    242 LIBS += -lpcap
    243 endif
    244 
    245 ifdef CONFIG_EAP_TLS
    246 # EAP-TLS
    247 ifeq ($(CONFIG_EAP_TLS), dyn)
    248 CFLAGS += -DEAP_TLS_DYNAMIC
    249 EAPDYN += ../src/eap_peer/eap_tls.so
    250 else
    251 CFLAGS += -DEAP_TLS
    252 OBJS += ../src/eap_peer/eap_tls.o
    253 OBJS_h += ../src/eap_server/eap_server_tls.o
    254 endif
    255 TLS_FUNCS=y
    256 CONFIG_IEEE8021X_EAPOL=y
    257 endif
    258 
    259 ifdef CONFIG_EAP_PEAP
    260 # EAP-PEAP
    261 ifeq ($(CONFIG_EAP_PEAP), dyn)
    262 CFLAGS += -DEAP_PEAP_DYNAMIC
    263 EAPDYN += ../src/eap_peer/eap_peap.so
    264 else
    265 CFLAGS += -DEAP_PEAP
    266 OBJS += ../src/eap_peer/eap_peap.o
    267 OBJS += ../src/eap_common/eap_peap_common.o
    268 OBJS_h += ../src/eap_server/eap_server_peap.o
    269 endif
    270 TLS_FUNCS=y
    271 CONFIG_IEEE8021X_EAPOL=y
    272 endif
    273 
    274 ifdef CONFIG_EAP_TTLS
    275 # EAP-TTLS
    276 ifeq ($(CONFIG_EAP_TTLS), dyn)
    277 CFLAGS += -DEAP_TTLS_DYNAMIC
    278 EAPDYN += ../src/eap_peer/eap_ttls.so
    279 else
    280 CFLAGS += -DEAP_TTLS
    281 OBJS += ../src/eap_peer/eap_ttls.o
    282 OBJS_h += ../src/eap_server/eap_server_ttls.o
    283 endif
    284 MS_FUNCS=y
    285 TLS_FUNCS=y
    286 CHAP=y
    287 CONFIG_IEEE8021X_EAPOL=y
    288 endif
    289 
    290 ifdef CONFIG_EAP_MD5
    291 # EAP-MD5
    292 ifeq ($(CONFIG_EAP_MD5), dyn)
    293 CFLAGS += -DEAP_MD5_DYNAMIC
    294 EAPDYN += ../src/eap_peer/eap_md5.so
    295 else
    296 CFLAGS += -DEAP_MD5
    297 OBJS += ../src/eap_peer/eap_md5.o
    298 OBJS_h += ../src/eap_server/eap_server_md5.o
    299 endif
    300 CHAP=y
    301 CONFIG_IEEE8021X_EAPOL=y
    302 endif
    303 
    304 # backwards compatibility for old spelling
    305 ifdef CONFIG_MSCHAPV2
    306 ifndef CONFIG_EAP_MSCHAPV2
    307 CONFIG_EAP_MSCHAPV2=y
    308 endif
    309 endif
    310 
    311 ifdef CONFIG_EAP_MSCHAPV2
    312 # EAP-MSCHAPv2
    313 ifeq ($(CONFIG_EAP_MSCHAPV2), dyn)
    314 CFLAGS += -DEAP_MSCHAPv2_DYNAMIC
    315 EAPDYN += ../src/eap_peer/eap_mschapv2.so
    316 EAPDYN += ../src/eap_peer/mschapv2.so
    317 else
    318 CFLAGS += -DEAP_MSCHAPv2
    319 OBJS += ../src/eap_peer/eap_mschapv2.o
    320 OBJS += ../src/eap_peer/mschapv2.o
    321 OBJS_h += ../src/eap_server/eap_server_mschapv2.o
    322 endif
    323 MS_FUNCS=y
    324 CONFIG_IEEE8021X_EAPOL=y
    325 endif
    326 
    327 ifdef CONFIG_EAP_GTC
    328 # EAP-GTC
    329 ifeq ($(CONFIG_EAP_GTC), dyn)
    330 CFLAGS += -DEAP_GTC_DYNAMIC
    331 EAPDYN += ../src/eap_peer/eap_gtc.so
    332 else
    333 CFLAGS += -DEAP_GTC
    334 OBJS += ../src/eap_peer/eap_gtc.o
    335 OBJS_h += ../src/eap_server/eap_server_gtc.o
    336 endif
    337 CONFIG_IEEE8021X_EAPOL=y
    338 endif
    339 
    340 ifdef CONFIG_EAP_OTP
    341 # EAP-OTP
    342 ifeq ($(CONFIG_EAP_OTP), dyn)
    343 CFLAGS += -DEAP_OTP_DYNAMIC
    344 EAPDYN += ../src/eap_peer/eap_otp.so
    345 else
    346 CFLAGS += -DEAP_OTP
    347 OBJS += ../src/eap_peer/eap_otp.o
    348 endif
    349 CONFIG_IEEE8021X_EAPOL=y
    350 endif
    351 
    352 ifdef CONFIG_EAP_SIM
    353 # EAP-SIM
    354 ifeq ($(CONFIG_EAP_SIM), dyn)
    355 CFLAGS += -DEAP_SIM_DYNAMIC
    356 EAPDYN += ../src/eap_peer/eap_sim.so
    357 else
    358 CFLAGS += -DEAP_SIM
    359 OBJS += ../src/eap_peer/eap_sim.o
    360 OBJS_h += ../src/eap_server/eap_server_sim.o
    361 endif
    362 CONFIG_IEEE8021X_EAPOL=y
    363 CONFIG_EAP_SIM_COMMON=y
    364 NEED_AES_CBC=y
    365 endif
    366 
    367 ifdef CONFIG_EAP_LEAP
    368 # EAP-LEAP
    369 ifeq ($(CONFIG_EAP_LEAP), dyn)
    370 CFLAGS += -DEAP_LEAP_DYNAMIC
    371 EAPDYN += ../src/eap_peer/eap_leap.so
    372 else
    373 CFLAGS += -DEAP_LEAP
    374 OBJS += ../src/eap_peer/eap_leap.o
    375 endif
    376 MS_FUNCS=y
    377 CONFIG_IEEE8021X_EAPOL=y
    378 endif
    379 
    380 ifdef CONFIG_EAP_PSK
    381 # EAP-PSK
    382 ifeq ($(CONFIG_EAP_PSK), dyn)
    383 CFLAGS += -DEAP_PSK_DYNAMIC
    384 EAPDYN += ../src/eap_peer/eap_psk.so
    385 else
    386 CFLAGS += -DEAP_PSK
    387 OBJS += ../src/eap_peer/eap_psk.o ../src/eap_common/eap_psk_common.o
    388 OBJS_h += ../src/eap_server/eap_server_psk.o
    389 endif
    390 CONFIG_IEEE8021X_EAPOL=y
    391 NEED_AES=y
    392 NEED_AES_OMAC1=y
    393 NEED_AES_ENCBLOCK=y
    394 NEED_AES_EAX=y
    395 endif
    396 
    397 ifdef CONFIG_EAP_AKA
    398 # EAP-AKA
    399 ifeq ($(CONFIG_EAP_AKA), dyn)
    400 CFLAGS += -DEAP_AKA_DYNAMIC
    401 EAPDYN += ../src/eap_peer/eap_aka.so
    402 else
    403 CFLAGS += -DEAP_AKA
    404 OBJS += ../src/eap_peer/eap_aka.o
    405 OBJS_h += ../src/eap_server/eap_server_aka.o
    406 endif
    407 CONFIG_IEEE8021X_EAPOL=y
    408 CONFIG_EAP_SIM_COMMON=y
    409 NEED_AES_CBC=y
    410 endif
    411 
    412 ifdef CONFIG_EAP_AKA_PRIME
    413 # EAP-AKA'
    414 ifeq ($(CONFIG_EAP_AKA_PRIME), dyn)
    415 CFLAGS += -DEAP_AKA_PRIME_DYNAMIC
    416 else
    417 CFLAGS += -DEAP_AKA_PRIME
    418 endif
    419 NEED_SHA256=y
    420 endif
    421 
    422 ifdef CONFIG_EAP_SIM_COMMON
    423 OBJS += ../src/eap_common/eap_sim_common.o
    424 OBJS_h += ../src/eap_server/eap_sim_db.o
    425 NEED_AES=y
    426 NEED_FIPS186_2_PRF=y
    427 endif
    428 
    429 ifdef CONFIG_EAP_FAST
    430 # EAP-FAST
    431 ifeq ($(CONFIG_EAP_FAST), dyn)
    432 CFLAGS += -DEAP_FAST_DYNAMIC
    433 EAPDYN += ../src/eap_peer/eap_fast.so
    434 EAPDYN += ../src/eap_common/eap_fast_common.o
    435 else
    436 CFLAGS += -DEAP_FAST
    437 OBJS += ../src/eap_peer/eap_fast.o ../src/eap_peer/eap_fast_pac.o
    438 OBJS += ../src/eap_common/eap_fast_common.o
    439 OBJS_h += ../src/eap_server/eap_server_fast.o
    440 endif
    441 TLS_FUNCS=y
    442 CONFIG_IEEE8021X_EAPOL=y
    443 NEED_T_PRF=y
    444 endif
    445 
    446 ifdef CONFIG_EAP_PAX
    447 # EAP-PAX
    448 ifeq ($(CONFIG_EAP_PAX), dyn)
    449 CFLAGS += -DEAP_PAX_DYNAMIC
    450 EAPDYN += ../src/eap_peer/eap_pax.so
    451 else
    452 CFLAGS += -DEAP_PAX
    453 OBJS += ../src/eap_peer/eap_pax.o ../src/eap_common/eap_pax_common.o
    454 OBJS_h += ../src/eap_server/eap_server_pax.o
    455 endif
    456 CONFIG_IEEE8021X_EAPOL=y
    457 endif
    458 
    459 ifdef CONFIG_EAP_SAKE
    460 # EAP-SAKE
    461 ifeq ($(CONFIG_EAP_SAKE), dyn)
    462 CFLAGS += -DEAP_SAKE_DYNAMIC
    463 EAPDYN += ../src/eap_peer/eap_sake.so
    464 else
    465 CFLAGS += -DEAP_SAKE
    466 OBJS += ../src/eap_peer/eap_sake.o ../src/eap_common/eap_sake_common.o
    467 OBJS_h += ../src/eap_server/eap_server_sake.o
    468 endif
    469 CONFIG_IEEE8021X_EAPOL=y
    470 endif
    471 
    472 ifdef CONFIG_EAP_GPSK
    473 # EAP-GPSK
    474 ifeq ($(CONFIG_EAP_GPSK), dyn)
    475 CFLAGS += -DEAP_GPSK_DYNAMIC
    476 EAPDYN += ../src/eap_peer/eap_gpsk.so
    477 else
    478 CFLAGS += -DEAP_GPSK
    479 OBJS += ../src/eap_peer/eap_gpsk.o ../src/eap_common/eap_gpsk_common.o
    480 OBJS_h += ../src/eap_server/eap_server_gpsk.o
    481 endif
    482 CONFIG_IEEE8021X_EAPOL=y
    483 ifdef CONFIG_EAP_GPSK_SHA256
    484 CFLAGS += -DEAP_GPSK_SHA256
    485 endif
    486 NEED_SHA256=y
    487 NEED_AES_OMAC1=y
    488 endif
    489 
    490 ifdef CONFIG_EAP_PWD
    491 CFLAGS += -DEAP_PWD
    492 OBJS += ../src/eap_peer/eap_pwd.o ../src/eap_common/eap_pwd_common.o
    493 OBJS_h += ../src/eap_server/eap_pwd.o
    494 CONFIG_IEEE8021X_EAPOL=y
    495 NEED_SHA256=y
    496 endif
    497 
    498 ifdef CONFIG_WPS
    499 ifdef CONFIG_WPS2
    500 CFLAGS += -DCONFIG_WPS2
    501 endif
    502 
    503 # EAP-WSC
    504 CFLAGS += -DCONFIG_WPS -DEAP_WSC
    505 OBJS += wps_supplicant.o
    506 OBJS += ../src/utils/uuid.o
    507 OBJS += ../src/eap_peer/eap_wsc.o ../src/eap_common/eap_wsc_common.o
    508 OBJS += ../src/wps/wps.o
    509 OBJS += ../src/wps/wps_common.o
    510 OBJS += ../src/wps/wps_attr_parse.o
    511 OBJS += ../src/wps/wps_attr_build.o
    512 OBJS += ../src/wps/wps_attr_process.o
    513 OBJS += ../src/wps/wps_dev_attr.o
    514 OBJS += ../src/wps/wps_enrollee.o
    515 OBJS += ../src/wps/wps_registrar.o
    516 OBJS_h += ../src/eap_server/eap_server_wsc.o
    517 CONFIG_IEEE8021X_EAPOL=y
    518 NEED_DH_GROUPS=y
    519 NEED_SHA256=y
    520 NEED_BASE64=y
    521 NEED_80211_COMMON=y
    522 NEED_AES_CBC=y
    523 NEED_MODEXP=y
    524 
    525 ifdef CONFIG_WPS_UFD
    526 CFLAGS += -DCONFIG_WPS_UFD
    527 OBJS += ../src/wps/wps_ufd.o
    528 NEED_WPS_OOB=y
    529 endif
    530 
    531 ifdef CONFIG_WPS_NFC
    532 CFLAGS += -DCONFIG_WPS_NFC
    533 OBJS += ../src/wps/ndef.o
    534 OBJS += ../src/wps/wps_nfc.o
    535 NEED_WPS_OOB=y
    536 ifdef CONFIG_WPS_NFC_PN531
    537 PN531_PATH ?= /usr/local/src/nfc
    538 CFLAGS += -DCONFIG_WPS_NFC_PN531
    539 CFLAGS += -I${PN531_PATH}/inc
    540 OBJS += ../src/wps/wps_nfc_pn531.o
    541 LIBS += ${PN531_PATH}/lib/wpsnfc.dll
    542 LIBS += ${PN531_PATH}/lib/libnfc_mapping_pn53x.dll
    543 endif
    544 endif
    545 
    546 ifdef NEED_WPS_OOB
    547 CFLAGS += -DCONFIG_WPS_OOB
    548 endif
    549 
    550 ifdef CONFIG_WPS_ER
    551 CONFIG_WPS_UPNP=y
    552 CFLAGS += -DCONFIG_WPS_ER
    553 OBJS += ../src/wps/wps_er.o
    554 OBJS += ../src/wps/wps_er_ssdp.o
    555 endif
    556 
    557 ifdef CONFIG_WPS_UPNP
    558 CFLAGS += -DCONFIG_WPS_UPNP
    559 OBJS += ../src/wps/wps_upnp.o
    560 OBJS += ../src/wps/wps_upnp_ssdp.o
    561 OBJS += ../src/wps/wps_upnp_web.o
    562 OBJS += ../src/wps/wps_upnp_event.o
    563 OBJS += ../src/wps/wps_upnp_ap.o
    564 OBJS += ../src/wps/upnp_xml.o
    565 OBJS += ../src/wps/httpread.o
    566 OBJS += ../src/wps/http_client.o
    567 OBJS += ../src/wps/http_server.o
    568 endif
    569 
    570 ifdef CONFIG_WPS_STRICT
    571 CFLAGS += -DCONFIG_WPS_STRICT
    572 OBJS += ../src/wps/wps_validate.o
    573 endif
    574 
    575 ifdef CONFIG_WPS_TESTING
    576 CFLAGS += -DCONFIG_WPS_TESTING
    577 endif
    578 
    579 ifdef CONFIG_WPS_REG_DISABLE_OPEN
    580 CFLAGS += -DCONFIG_WPS_REG_DISABLE_OPEN
    581 endif
    582 
    583 endif
    584 
    585 ifdef CONFIG_EAP_IKEV2
    586 # EAP-IKEv2
    587 ifeq ($(CONFIG_EAP_IKEV2), dyn)
    588 CFLAGS += -DEAP_IKEV2_DYNAMIC
    589 EAPDYN += ../src/eap_peer/eap_ikev2.so ../src/eap_peer/ikev2.o
    590 EAPDYN += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    591 else
    592 CFLAGS += -DEAP_IKEV2
    593 OBJS += ../src/eap_peer/eap_ikev2.o ../src/eap_peer/ikev2.o
    594 OBJS += ../src/eap_common/eap_ikev2_common.o ../src/eap_common/ikev2_common.o
    595 OBJS_h += ../src/eap_server/eap_server_ikev2.o
    596 OBJS_h += ../src/eap_server/ikev2.o
    597 endif
    598 CONFIG_IEEE8021X_EAPOL=y
    599 NEED_DH_GROUPS=y
    600 NEED_DH_GROUPS_ALL=y
    601 NEED_MODEXP=y
    602 NEED_CIPHER=y
    603 endif
    604 
    605 ifdef CONFIG_EAP_VENDOR_TEST
    606 ifeq ($(CONFIG_EAP_VENDOR_TEST), dyn)
    607 CFLAGS += -DEAP_VENDOR_TEST_DYNAMIC
    608 EAPDYN += ../src/eap_peer/eap_vendor_test.so
    609 else
    610 CFLAGS += -DEAP_VENDOR_TEST
    611 OBJS += ../src/eap_peer/eap_vendor_test.o
    612 OBJS_h += ../src/eap_server/eap_server_vendor_test.o
    613 endif
    614 CONFIG_IEEE8021X_EAPOL=y
    615 endif
    616 
    617 ifdef CONFIG_EAP_TNC
    618 # EAP-TNC
    619 CFLAGS += -DEAP_TNC
    620 OBJS += ../src/eap_peer/eap_tnc.o
    621 OBJS += ../src/eap_peer/tncc.o
    622 OBJS_h += ../src/eap_server/eap_server_tnc.o
    623 OBJS_h += ../src/eap_server/tncs.o
    624 NEED_BASE64=y
    625 ifndef CONFIG_NATIVE_WINDOWS
    626 ifndef CONFIG_DRIVER_BSD
    627 LIBS += -ldl
    628 endif
    629 endif
    630 endif
    631 
    632 ifdef CONFIG_IEEE8021X_EAPOL
    633 # IEEE 802.1X/EAPOL state machines (e.g., for RADIUS authentication)
    634 CFLAGS += -DIEEE8021X_EAPOL
    635 OBJS += ../src/eapol_supp/eapol_supp_sm.o
    636 OBJS += ../src/eap_peer/eap.o ../src/eap_peer/eap_methods.o
    637 NEED_EAP_COMMON=y
    638 ifdef CONFIG_DYNAMIC_EAP_METHODS
    639 CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS
    640 LIBS += -ldl -rdynamic
    641 endif
    642 endif
    643 
    644 ifdef CONFIG_AP
    645 NEED_80211_COMMON=y
    646 NEED_EAP_COMMON=y
    647 NEED_RSN_AUTHENTICATOR=y
    648 CFLAGS += -DCONFIG_AP
    649 OBJS += ap.o
    650 CFLAGS += -DCONFIG_NO_RADIUS
    651 CFLAGS += -DCONFIG_NO_ACCOUNTING
    652 CFLAGS += -DCONFIG_NO_VLAN
    653 OBJS += ../src/ap/hostapd.o
    654 OBJS += ../src/ap/wpa_auth_glue.o
    655 OBJS += ../src/ap/utils.o
    656 OBJS += ../src/ap/authsrv.o
    657 OBJS += ../src/ap/ap_config.o
    658 OBJS += ../src/utils/ip_addr.o
    659 OBJS += ../src/ap/sta_info.o
    660 OBJS += ../src/ap/tkip_countermeasures.o
    661 OBJS += ../src/ap/ap_mlme.o
    662 OBJS += ../src/ap/ieee802_1x.o
    663 OBJS += ../src/eapol_auth/eapol_auth_sm.o
    664 OBJS += ../src/ap/ieee802_11_auth.o
    665 OBJS += ../src/ap/drv_callbacks.o
    666 OBJS += ../src/ap/ap_drv_ops.o
    667 ifdef CONFIG_IEEE80211N
    668 OBJS += ../src/ap/ieee802_11_ht.o
    669 endif
    670 ifdef CONFIG_CTRL_IFACE
    671 OBJS += ../src/ap/ctrl_iface_ap.o
    672 endif
    673 
    674 CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY
    675 OBJS += ../src/eap_server/eap_server.o
    676 OBJS += ../src/eap_server/eap_server_identity.o
    677 OBJS += ../src/eap_server/eap_server_methods.o
    678 
    679 ifdef CONFIG_IEEE80211N
    680 CFLAGS += -DCONFIG_IEEE80211N
    681 endif
    682 
    683 ifdef NEED_AP_MLME
    684 OBJS += ../src/ap/beacon.o
    685 OBJS += ../src/ap/wmm.o
    686 OBJS += ../src/ap/ap_list.o
    687 OBJS += ../src/ap/ieee802_11.o
    688 OBJS += ../src/ap/hw_features.o
    689 CFLAGS += -DNEED_AP_MLME
    690 endif
    691 ifdef CONFIG_WPS
    692 CFLAGS += -DEAP_SERVER_WSC
    693 OBJS += ../src/ap/wps_hostapd.o
    694 OBJS += ../src/eap_server/eap_server_wsc.o
    695 endif
    696 endif
    697 
    698 ifdef NEED_RSN_AUTHENTICATOR
    699 CFLAGS += -DCONFIG_NO_RADIUS
    700 NEED_AES_WRAP=y
    701 OBJS += ../src/ap/wpa_auth.o
    702 OBJS += ../src/ap/wpa_auth_ie.o
    703 OBJS += ../src/ap/pmksa_cache_auth.o
    704 ifdef CONFIG_IEEE80211R
    705 OBJS += ../src/ap/wpa_auth_ft.o
    706 endif
    707 ifdef CONFIG_PEERKEY
    708 OBJS += ../src/ap/peerkey_auth.o
    709 endif
    710 endif
    711 
    712 ifdef CONFIG_EAP_SERVER
    713 CFLAGS += -DEAP_SERVER
    714 OBJS_h += ../src/eap_server/eap_server.o
    715 OBJS_h += ../src/eap_server/eap_server_identity.o
    716 OBJS_h += ../src/eap_server/eap_server_methods.o
    717 endif
    718 
    719 ifdef CONFIG_RADIUS_CLIENT
    720 OBJS_h += ../src/utils/ip_addr.o
    721 OBJS_h += ../src/radius/radius.o
    722 OBJS_h += ../src/radius/radius_client.o
    723 endif
    724 
    725 ifdef CONFIG_AUTHENTICATOR
    726 OBJS_h += ../src/eapol_auth/eapol_auth_sm.o
    727 OBJS_h += ../src/ap/ieee802_1x.o
    728 endif
    729 
    730 ifdef CONFIG_WPA_AUTHENTICATOR
    731 OBJS_h += ../src/ap/wpa_auth.o
    732 OBJS_h += ../src/ap/wpa_auth_ie.o
    733 OBJS_h += ../src/ap/pmksa_cache_auth.o
    734 ifdef CONFIG_IEEE80211R
    735 OBJS_h += ../src/ap/wpa_auth_ft.o
    736 endif
    737 ifdef CONFIG_PEERKEY
    738 OBJS_h += ../src/ap/peerkey_auth.o
    739 endif
    740 endif
    741 
    742 ifdef CONFIG_PCSC
    743 # PC/SC interface for smartcards (USIM, GSM SIM)
    744 CFLAGS += -DPCSC_FUNCS -I/usr/include/PCSC
    745 OBJS += ../src/utils/pcsc_funcs.o
    746 # -lpthread may not be needed depending on how pcsc-lite was configured
    747 ifdef CONFIG_NATIVE_WINDOWS
    748 #Once MinGW gets support for WinScard, -lwinscard could be used instead of the
    749 #dynamic symbol loading that is now used in pcsc_funcs.c
    750 #LIBS += -lwinscard
    751 else
    752 LIBS += -lpcsclite -lpthread
    753 endif
    754 endif
    755 
    756 ifdef CONFIG_SIM_SIMULATOR
    757 CFLAGS += -DCONFIG_SIM_SIMULATOR
    758 NEED_MILENAGE=y
    759 endif
    760 
    761 ifdef CONFIG_USIM_SIMULATOR
    762 CFLAGS += -DCONFIG_USIM_SIMULATOR
    763 NEED_MILENAGE=y
    764 endif
    765 
    766 ifdef NEED_MILENAGE
    767 OBJS += ../src/crypto/milenage.o
    768 endif
    769 
    770 ifdef CONFIG_PKCS12
    771 CFLAGS += -DPKCS12_FUNCS
    772 endif
    773 
    774 ifdef CONFIG_SMARTCARD
    775 CFLAGS += -DCONFIG_SMARTCARD
    776 endif
    777 
    778 ifdef MS_FUNCS
    779 OBJS += ../src/crypto/ms_funcs.o
    780 NEED_DES=y
    781 NEED_MD4=y
    782 endif
    783 
    784 ifdef CHAP
    785 OBJS += ../src/eap_common/chap.o
    786 endif
    787 
    788 ifdef TLS_FUNCS
    789 NEED_DES=y
    790 # Shared TLS functions (needed for EAP_TLS, EAP_PEAP, EAP_TTLS, and EAP_FAST)
    791 OBJS += ../src/eap_peer/eap_tls_common.o
    792 OBJS_h += ../src/eap_server/eap_server_tls_common.o
    793 NEED_TLS_PRF=y
    794 endif
    795 
    796 ifndef CONFIG_TLS
    797 CONFIG_TLS=openssl
    798 endif
    799 
    800 ifeq ($(CONFIG_TLS), openssl)
    801 ifdef TLS_FUNCS
    802 CFLAGS += -DEAP_TLS_OPENSSL
    803 OBJS += ../src/crypto/tls_openssl.o
    804 LIBS += -lssl
    805 endif
    806 OBJS += ../src/crypto/crypto_openssl.o
    807 OBJS_p += ../src/crypto/crypto_openssl.o
    808 ifdef NEED_FIPS186_2_PRF
    809 OBJS += ../src/crypto/fips_prf_openssl.o
    810 endif
    811 LIBS += -lcrypto
    812 LIBS_p += -lcrypto
    813 endif
    814 
    815 ifeq ($(CONFIG_TLS), gnutls)
    816 ifdef TLS_FUNCS
    817 OBJS += ../src/crypto/tls_gnutls.o
    818 LIBS += -lgnutls -lgpg-error
    819 ifdef CONFIG_GNUTLS_EXTRA
    820 CFLAGS += -DCONFIG_GNUTLS_EXTRA
    821 LIBS += -lgnutls-extra
    822 endif
    823 endif
    824 OBJS += ../src/crypto/crypto_gnutls.o
    825 OBJS_p += ../src/crypto/crypto_gnutls.o
    826 ifdef NEED_FIPS186_2_PRF
    827 OBJS += ../src/crypto/fips_prf_gnutls.o
    828 endif
    829 LIBS += -lgcrypt
    830 LIBS_p += -lgcrypt
    831 CONFIG_INTERNAL_SHA256=y
    832 CONFIG_INTERNAL_RC4=y
    833 CONFIG_INTERNAL_DH_GROUP5=y
    834 endif
    835 
    836 ifeq ($(CONFIG_TLS), schannel)
    837 ifdef TLS_FUNCS
    838 OBJS += ../src/crypto/tls_schannel.o
    839 endif
    840 OBJS += ../src/crypto/crypto_cryptoapi.o
    841 OBJS_p += ../src/crypto/crypto_cryptoapi.o
    842 ifdef NEED_FIPS186_2_PRF
    843 OBJS += ../src/crypto/fips_prf_cryptoapi.o
    844 endif
    845 CONFIG_INTERNAL_SHA256=y
    846 CONFIG_INTERNAL_RC4=y
    847 CONFIG_INTERNAL_DH_GROUP5=y
    848 endif
    849 
    850 ifeq ($(CONFIG_TLS), nss)
    851 ifdef TLS_FUNCS
    852 OBJS += ../src/crypto/tls_nss.o
    853 LIBS += -lssl3
    854 endif
    855 OBJS += ../src/crypto/crypto_nss.o
    856 OBJS_p += ../src/crypto/crypto_nss.o
    857 ifdef NEED_FIPS186_2_PRF
    858 OBJS += ../src/crypto/fips_prf_nss.o
    859 endif
    860 LIBS += -lnss3
    861 LIBS_p += -lnss3
    862 CONFIG_INTERNAL_MD4=y
    863 CONFIG_INTERNAL_DH_GROUP5=y
    864 endif
    865 
    866 ifeq ($(CONFIG_TLS), internal)
    867 ifndef CONFIG_CRYPTO
    868 CONFIG_CRYPTO=internal
    869 endif
    870 ifdef TLS_FUNCS
    871 OBJS += ../src/crypto/crypto_internal-rsa.o
    872 OBJS += ../src/crypto/tls_internal.o
    873 OBJS += ../src/tls/tlsv1_common.o
    874 OBJS += ../src/tls/tlsv1_record.o
    875 OBJS += ../src/tls/tlsv1_cred.o
    876 OBJS += ../src/tls/tlsv1_client.o
    877 OBJS += ../src/tls/tlsv1_client_write.o
    878 OBJS += ../src/tls/tlsv1_client_read.o
    879 OBJS += ../src/tls/asn1.o
    880 OBJS += ../src/tls/rsa.o
    881 OBJS += ../src/tls/x509v3.o
    882 OBJS += ../src/tls/pkcs1.o
    883 OBJS += ../src/tls/pkcs5.o
    884 OBJS += ../src/tls/pkcs8.o
    885 NEED_SHA256=y
    886 NEED_BASE64=y
    887 NEED_TLS_PRF=y
    888 NEED_MODEXP=y
    889 NEED_CIPHER=y
    890 CFLAGS += -DCONFIG_TLS_INTERNAL_CLIENT
    891 endif
    892 ifdef NEED_CIPHER
    893 NEED_DES=y
    894 OBJS += ../src/crypto/crypto_internal-cipher.o
    895 endif
    896 ifdef NEED_MODEXP
    897 OBJS += ../src/crypto/crypto_internal-modexp.o
    898 OBJS += ../src/tls/bignum.o
    899 endif
    900 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
    901 OBJS += ../src/crypto/crypto_libtomcrypt.o
    902 OBJS_p += ../src/crypto/crypto_libtomcrypt.o
    903 LIBS += -ltomcrypt -ltfm
    904 LIBS_p += -ltomcrypt -ltfm
    905 CONFIG_INTERNAL_SHA256=y
    906 CONFIG_INTERNAL_RC4=y
    907 CONFIG_INTERNAL_DH_GROUP5=y
    908 endif
    909 ifeq ($(CONFIG_CRYPTO), internal)
    910 OBJS += ../src/crypto/crypto_internal.o
    911 OBJS_p += ../src/crypto/crypto_internal.o
    912 NEED_AES_ENC=y
    913 CFLAGS += -DCONFIG_CRYPTO_INTERNAL
    914 ifdef CONFIG_INTERNAL_LIBTOMMATH
    915 CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
    916 ifdef CONFIG_INTERNAL_LIBTOMMATH_FAST
    917 CFLAGS += -DLTM_FAST
    918 endif
    919 else
    920 LIBS += -ltommath
    921 LIBS_p += -ltommath
    922 endif
    923 CONFIG_INTERNAL_AES=y
    924 CONFIG_INTERNAL_DES=y
    925 CONFIG_INTERNAL_SHA1=y
    926 CONFIG_INTERNAL_MD4=y
    927 CONFIG_INTERNAL_MD5=y
    928 CONFIG_INTERNAL_SHA256=y
    929 CONFIG_INTERNAL_RC4=y
    930 CONFIG_INTERNAL_DH_GROUP5=y
    931 endif
    932 ifeq ($(CONFIG_CRYPTO), cryptoapi)
    933 OBJS += ../src/crypto/crypto_cryptoapi.o
    934 OBJS_p += ../src/crypto/crypto_cryptoapi.o
    935 CFLAGS += -DCONFIG_CRYPTO_CRYPTOAPI
    936 CONFIG_INTERNAL_SHA256=y
    937 CONFIG_INTERNAL_RC4=y
    938 endif
    939 endif
    940 
    941 ifeq ($(CONFIG_TLS), none)
    942 ifdef TLS_FUNCS
    943 OBJS += ../src/crypto/tls_none.o
    944 CFLAGS += -DEAP_TLS_NONE
    945 CONFIG_INTERNAL_AES=y
    946 CONFIG_INTERNAL_SHA1=y
    947 CONFIG_INTERNAL_MD5=y
    948 endif
    949 OBJS += ../src/crypto/crypto_none.o
    950 OBJS_p += ../src/crypto/crypto_none.o
    951 CONFIG_INTERNAL_SHA256=y
    952 CONFIG_INTERNAL_RC4=y
    953 endif
    954 
    955 ifdef TLS_FUNCS
    956 ifdef CONFIG_SMARTCARD
    957 ifndef CONFIG_NATIVE_WINDOWS
    958 ifneq ($(CONFIG_L2_PACKET), freebsd)
    959 LIBS += -ldl
    960 endif
    961 endif
    962 endif
    963 endif
    964 
    965 ifndef TLS_FUNCS
    966 OBJS += ../src/crypto/tls_none.o
    967 ifeq ($(CONFIG_TLS), internal)
    968 CONFIG_INTERNAL_AES=y
    969 CONFIG_INTERNAL_SHA1=y
    970 CONFIG_INTERNAL_MD5=y
    971 CONFIG_INTERNAL_RC4=y
    972 endif
    973 endif
    974 
    975 AESOBJS = # none so far (see below)
    976 ifdef CONFIG_INTERNAL_AES
    977 AESOBJS += ../src/crypto/aes-internal.o ../src/crypto/aes-internal-dec.o
    978 endif
    979 
    980 AESOBJS += ../src/crypto/aes-unwrap.o
    981 ifdef NEED_AES_EAX
    982 AESOBJS += ../src/crypto/aes-eax.o
    983 NEED_AES_CTR=y
    984 endif
    985 ifdef NEED_AES_CTR
    986 AESOBJS += ../src/crypto/aes-ctr.o
    987 endif
    988 ifdef NEED_AES_ENCBLOCK
    989 AESOBJS += ../src/crypto/aes-encblock.o
    990 endif
    991 ifdef NEED_AES_OMAC1
    992 NEED_AES_ENC=y
    993 AESOBJS += ../src/crypto/aes-omac1.o
    994 endif
    995 ifdef NEED_AES_WRAP
    996 NEED_AES_ENC=y
    997 AESOBJS += ../src/crypto/aes-wrap.o
    998 endif
    999 ifdef NEED_AES_CBC
   1000 NEED_AES_ENC=y
   1001 AESOBJS += ../src/crypto/aes-cbc.o
   1002 endif
   1003 ifdef NEED_AES_ENC
   1004 ifdef CONFIG_INTERNAL_AES
   1005 AESOBJS += ../src/crypto/aes-internal-enc.o
   1006 endif
   1007 endif
   1008 ifdef NEED_AES
   1009 OBJS += $(AESOBJS)
   1010 endif
   1011 
   1012 ifdef NEED_SHA1
   1013 SHA1OBJS += ../src/crypto/sha1.o
   1014 ifdef CONFIG_INTERNAL_SHA1
   1015 SHA1OBJS += ../src/crypto/sha1-internal.o
   1016 ifdef NEED_FIPS186_2_PRF
   1017 SHA1OBJS += ../src/crypto/fips_prf_internal.o
   1018 endif
   1019 endif
   1020 ifdef CONFIG_NO_WPA_PASSPHRASE
   1021 CFLAGS += -DCONFIG_NO_PBKDF2
   1022 else
   1023 SHA1OBJS += ../src/crypto/sha1-pbkdf2.o
   1024 endif
   1025 ifdef NEED_T_PRF
   1026 SHA1OBJS += ../src/crypto/sha1-tprf.o
   1027 endif
   1028 ifdef NEED_TLS_PRF
   1029 SHA1OBJS += ../src/crypto/sha1-tlsprf.o
   1030 endif
   1031 endif
   1032 
   1033 MD5OBJS = ../src/crypto/md5.o
   1034 ifdef NEED_MD5
   1035 ifdef CONFIG_INTERNAL_MD5
   1036 MD5OBJS += ../src/crypto/md5-internal.o
   1037 endif
   1038 ifdef CONFIG_FIPS
   1039 MD5OBJS += ../src/crypto/md5-non-fips.o
   1040 endif
   1041 OBJS += $(MD5OBJS)
   1042 OBJS_p += $(MD5OBJS)
   1043 endif
   1044 
   1045 ifdef NEED_MD4
   1046 ifdef CONFIG_INTERNAL_MD4
   1047 OBJS += ../src/crypto/md4-internal.o
   1048 endif
   1049 endif
   1050 
   1051 DESOBJS = # none needed when not internal
   1052 ifdef NEED_DES
   1053 ifdef CONFIG_INTERNAL_DES
   1054 DESOBJS += ../src/crypto/des-internal.o
   1055 endif
   1056 endif
   1057 
   1058 ifdef NEED_RC4
   1059 ifdef CONFIG_INTERNAL_RC4
   1060 OBJS += ../src/crypto/rc4.o
   1061 endif
   1062 endif
   1063 
   1064 SHA256OBJS = # none by default
   1065 ifdef NEED_SHA256
   1066 CFLAGS += -DCONFIG_SHA256
   1067 SHA256OBJS += ../src/crypto/sha256.o
   1068 ifdef CONFIG_INTERNAL_SHA256
   1069 SHA256OBJS += ../src/crypto/sha256-internal.o
   1070 endif
   1071 OBJS += $(SHA256OBJS)
   1072 endif
   1073 
   1074 ifdef NEED_DH_GROUPS
   1075 OBJS += ../src/crypto/dh_groups.o
   1076 endif
   1077 ifdef NEED_DH_GROUPS_ALL
   1078 CFLAGS += -DALL_DH_GROUPS
   1079 endif
   1080 ifdef CONFIG_INTERNAL_DH_GROUP5
   1081 ifdef NEED_DH_GROUPS
   1082 OBJS += ../src/crypto/dh_group5.o
   1083 endif
   1084 endif
   1085 
   1086 ifdef CONFIG_NO_RANDOM_POOL
   1087 CFLAGS += -DCONFIG_NO_RANDOM_POOL
   1088 else
   1089 OBJS += ../src/crypto/random.o
   1090 endif
   1091 
   1092 ifdef CONFIG_CTRL_IFACE
   1093 ifeq ($(CONFIG_CTRL_IFACE), y)
   1094 ifdef CONFIG_NATIVE_WINDOWS
   1095 CONFIG_CTRL_IFACE=named_pipe
   1096 else
   1097 CONFIG_CTRL_IFACE=unix
   1098 endif
   1099 endif
   1100 CFLAGS += -DCONFIG_CTRL_IFACE
   1101 ifeq ($(CONFIG_CTRL_IFACE), unix)
   1102 CFLAGS += -DCONFIG_CTRL_IFACE_UNIX
   1103 endif
   1104 ifeq ($(CONFIG_CTRL_IFACE), udp)
   1105 CFLAGS += -DCONFIG_CTRL_IFACE_UDP
   1106 endif
   1107 ifeq ($(CONFIG_CTRL_IFACE), named_pipe)
   1108 CFLAGS += -DCONFIG_CTRL_IFACE_NAMED_PIPE
   1109 endif
   1110 OBJS += ctrl_iface.o ctrl_iface_$(CONFIG_CTRL_IFACE).o
   1111 endif
   1112 
   1113 ifdef CONFIG_CTRL_IFACE_DBUS
   1114 DBUS=y
   1115 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS -DDBUS_API_SUBJECT_TO_CHANGE
   1116 DBUS_OBJS += dbus/dbus_old.o dbus/dbus_old_handlers.o
   1117 ifdef CONFIG_WPS
   1118 DBUS_OBJS += dbus/dbus_old_handlers_wps.o
   1119 endif
   1120 DBUS_OBJS += dbus/dbus_dict_helpers.o
   1121 ifndef DBUS_LIBS
   1122 DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
   1123 endif
   1124 ifndef DBUS_INCLUDE
   1125 DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
   1126 endif
   1127 dbus_version=$(subst ., ,$(shell $(PKG_CONFIG) --modversion dbus-1))
   1128 DBUS_VERSION_MAJOR=$(word 1,$(dbus_version))
   1129 DBUS_VERSION_MINOR=$(word 2,$(dbus_version))
   1130 ifeq ($(DBUS_VERSION_MAJOR),)
   1131 DBUS_VERSION_MAJOR=0
   1132 endif
   1133 ifeq ($(DBUS_VERSION_MINOR),)
   1134 DBUS_VERSION_MINOR=0
   1135 endif
   1136 DBUS_INCLUDE += -DDBUS_VERSION_MAJOR=$(DBUS_VERSION_MAJOR)
   1137 DBUS_INCLUDE += -DDBUS_VERSION_MINOR=$(DBUS_VERSION_MINOR)
   1138 DBUS_CFLAGS += $(DBUS_INCLUDE)
   1139 endif
   1140 
   1141 ifdef CONFIG_CTRL_IFACE_DBUS_NEW
   1142 DBUS=y
   1143 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_NEW
   1144 DBUS_OBJS ?= dbus/dbus_dict_helpers.o
   1145 DBUS_OBJS += dbus/dbus_new_helpers.o
   1146 DBUS_OBJS += dbus/dbus_new.o dbus/dbus_new_handlers.o
   1147 ifdef CONFIG_WPS
   1148 DBUS_OBJS += dbus/dbus_new_handlers_wps.o
   1149 endif
   1150 ifdef CONFIG_P2P
   1151 DBUS_OBJS += dbus/dbus_new_handlers_p2p.o
   1152 endif
   1153 ifndef DBUS_LIBS
   1154 DBUS_LIBS := $(shell $(PKG_CONFIG) --libs dbus-1)
   1155 endif
   1156 ifndef DBUS_INCLUDE
   1157 DBUS_INCLUDE := $(shell $(PKG_CONFIG) --cflags dbus-1)
   1158 endif
   1159 ifdef CONFIG_CTRL_IFACE_DBUS_INTRO
   1160 DBUS_OBJS += dbus/dbus_new_introspect.o
   1161 DBUS_CFLAGS += -DCONFIG_CTRL_IFACE_DBUS_INTRO
   1162 endif
   1163 DBUS_CFLAGS += $(DBUS_INCLUDE)
   1164 endif
   1165 
   1166 ifdef DBUS
   1167 DBUS_CFLAGS += -DCONFIG_DBUS
   1168 DBUS_OBJS += dbus/dbus_common.o
   1169 endif
   1170 
   1171 OBJS += $(DBUS_OBJS)
   1172 CFLAGS += $(DBUS_CFLAGS)
   1173 LIBS += $(DBUS_LIBS)
   1174 
   1175 ifdef CONFIG_READLINE
   1176 OBJS_c += ../src/utils/edit_readline.o
   1177 LIBS_c += -lncurses -lreadline
   1178 else
   1179 ifdef CONFIG_WPA_CLI_EDIT
   1180 OBJS_c += ../src/utils/edit.o
   1181 else
   1182 OBJS_c += ../src/utils/edit_simple.o
   1183 endif
   1184 endif
   1185 
   1186 ifdef CONFIG_NATIVE_WINDOWS
   1187 CFLAGS += -DCONFIG_NATIVE_WINDOWS
   1188 LIBS += -lws2_32 -lgdi32 -lcrypt32
   1189 LIBS_c += -lws2_32
   1190 LIBS_p += -lws2_32 -lgdi32
   1191 ifeq ($(CONFIG_CRYPTO), cryptoapi)
   1192 LIBS_p += -lcrypt32
   1193 endif
   1194 endif
   1195 
   1196 ifdef CONFIG_NO_STDOUT_DEBUG
   1197 CFLAGS += -DCONFIG_NO_STDOUT_DEBUG
   1198 ifndef CONFIG_CTRL_IFACE
   1199 CFLAGS += -DCONFIG_NO_WPA_MSG
   1200 endif
   1201 endif
   1202 
   1203 ifdef CONFIG_IPV6
   1204 # for eapol_test only
   1205 CFLAGS += -DCONFIG_IPV6
   1206 endif
   1207 
   1208 ifdef NEED_BASE64
   1209 OBJS += ../src/utils/base64.o
   1210 endif
   1211 
   1212 ifdef NEED_SME
   1213 NEED_80211_COMMON=y
   1214 OBJS += sme.o
   1215 CFLAGS += -DCONFIG_SME
   1216 endif
   1217 
   1218 ifdef CONFIG_CLIENT_MLME
   1219 OBJS += mlme.o
   1220 CFLAGS += -DCONFIG_CLIENT_MLME
   1221 NEED_80211_COMMON=y
   1222 endif
   1223 
   1224 ifdef NEED_80211_COMMON
   1225 OBJS += ../src/common/ieee802_11_common.o
   1226 endif
   1227 
   1228 ifdef NEED_EAP_COMMON
   1229 OBJS += ../src/eap_common/eap_common.o
   1230 endif
   1231 
   1232 ifndef CONFIG_MAIN
   1233 CONFIG_MAIN=main
   1234 endif
   1235 
   1236 ifdef CONFIG_DEBUG_SYSLOG
   1237 CFLAGS += -DCONFIG_DEBUG_SYSLOG
   1238 ifdef CONFIG_DEBUG_SYSLOG_FACILITY
   1239 CFLAGS += -DLOG_HOSTAPD="$(CONFIG_DEBUG_SYSLOG_FACILITY)"
   1240 endif
   1241 endif
   1242 
   1243 ifdef CONFIG_DEBUG_FILE
   1244 CFLAGS += -DCONFIG_DEBUG_FILE
   1245 endif
   1246 
   1247 ifdef CONFIG_DELAYED_MIC_ERROR_REPORT
   1248 CFLAGS += -DCONFIG_DELAYED_MIC_ERROR_REPORT
   1249 endif
   1250 
   1251 ifdef CONFIG_FIPS
   1252 CFLAGS += -DCONFIG_FIPS
   1253 endif
   1254 
   1255 OBJS += $(SHA1OBJS) $(DESOBJS)
   1256 
   1257 OBJS_p += $(SHA1OBJS)
   1258 
   1259 ifdef CONFIG_BGSCAN_SIMPLE
   1260 CFLAGS += -DCONFIG_BGSCAN_SIMPLE
   1261 OBJS += bgscan_simple.o
   1262 NEED_BGSCAN=y
   1263 endif
   1264 
   1265 ifdef CONFIG_BGSCAN_LEARN
   1266 CFLAGS += -DCONFIG_BGSCAN_LEARN
   1267 OBJS += bgscan_learn.o
   1268 NEED_BGSCAN=y
   1269 endif
   1270 
   1271 ifdef NEED_BGSCAN
   1272 CFLAGS += -DCONFIG_BGSCAN
   1273 OBJS += bgscan.o
   1274 endif
   1275 
   1276 OBJS_wpa_rm := ctrl_iface.o mlme.o ctrl_iface_unix.o
   1277 OBJS_wpa := $(filter-out $(OBJS_wpa_rm),$(OBJS)) $(OBJS_h) tests/test_wpa.o
   1278 ifdef CONFIG_AUTHENTICATOR
   1279 OBJS_wpa += tests/link_test.o
   1280 endif
   1281 OBJS_wpa += $(OBJS_l2)
   1282 OBJS += wpa_supplicant.o events.o blacklist.o wpas_glue.o scan.o
   1283 OBJS_t := $(OBJS) $(OBJS_l2) eapol_test.o
   1284 OBJS_t += ../src/radius/radius_client.o
   1285 OBJS_t += ../src/radius/radius.o
   1286 ifndef CONFIG_AP
   1287 OBJS_t += ../src/utils/ip_addr.o
   1288 endif
   1289 OBJS_t2 := $(OBJS) $(OBJS_l2) preauth_test.o
   1290 OBJS += $(CONFIG_MAIN).o
   1291 
   1292 ifdef CONFIG_PRIVSEP
   1293 OBJS_priv += $(OBJS_d) ../src/drivers/drivers.o
   1294 OBJS_priv += $(OBJS_l2)
   1295 OBJS_priv += ../src/utils/os_$(CONFIG_OS).o
   1296 OBJS_priv += ../src/utils/$(CONFIG_ELOOP).o
   1297 OBJS_priv += ../src/utils/common.o
   1298 OBJS_priv += ../src/utils/wpa_debug.o
   1299 OBJS_priv += ../src/utils/wpabuf.o
   1300 OBJS_priv += wpa_priv.o
   1301 ifdef CONFIG_DRIVER_TEST
   1302 OBJS_priv += $(SHA1OBJS)
   1303 OBJS_priv += $(MD5OBJS)
   1304 ifeq ($(CONFIG_TLS), openssl)
   1305 OBJS_priv += ../src/crypto/crypto_openssl.o
   1306 endif
   1307 ifeq ($(CONFIG_TLS), gnutls)
   1308 OBJS_priv += ../src/crypto/crypto_gnutls.o
   1309 endif
   1310 ifeq ($(CONFIG_TLS), nss)
   1311 OBJS_priv += ../src/crypto/crypto_nss.o
   1312 endif
   1313 ifeq ($(CONFIG_TLS), internal)
   1314 ifeq ($(CONFIG_CRYPTO), libtomcrypt)
   1315 OBJS_priv += ../src/crypto/crypto_libtomcrypt.o
   1316 else
   1317 OBJS_priv += ../src/crypto/crypto_internal.o
   1318 endif
   1319 endif
   1320 endif # CONFIG_DRIVER_TEST
   1321 OBJS += ../src/l2_packet/l2_packet_privsep.o
   1322 OBJS += ../src/drivers/driver_privsep.o
   1323 EXTRA_progs += wpa_priv
   1324 else
   1325 OBJS += $(OBJS_d) ../src/drivers/drivers.o
   1326 OBJS += $(OBJS_l2)
   1327 endif
   1328 
   1329 ifdef CONFIG_NDIS_EVENTS_INTEGRATED
   1330 CFLAGS += -DCONFIG_NDIS_EVENTS_INTEGRATED
   1331 OBJS += ../src/drivers/ndis_events.o
   1332 EXTRALIBS += -loleaut32 -lole32 -luuid
   1333 ifdef PLATFORMSDKLIB
   1334 EXTRALIBS += $(PLATFORMSDKLIB)/WbemUuid.Lib
   1335 else
   1336 EXTRALIBS += WbemUuid.Lib
   1337 endif
   1338 endif
   1339 
   1340 ifndef LDO
   1341 LDO=$(CC)
   1342 endif
   1343 
   1344 Q=@
   1345 E=echo
   1346 ifeq ($(V), 1)
   1347 Q=
   1348 E=true
   1349 endif
   1350 
   1351 dynamic_eap_methods: $(EAPDYN)
   1352 
   1353 ../src/drivers/build.wpa_supplicant:
   1354 	@if [ -f ../src/drivers/build.hostapd ]; then \
   1355 		$(MAKE) -C ../src/drivers clean; \
   1356 	fi
   1357 	@touch ../src/drivers/build.wpa_supplicant
   1358 
   1359 BCHECK=../src/drivers/build.wpa_supplicant
   1360 
   1361 wpa_priv: $(BCHECK) $(OBJS_priv)
   1362 	$(Q)$(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
   1363 	@$(E) "  LD " $@
   1364 
   1365 wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
   1366 	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
   1367 	@$(E) "  LD " $@
   1368 
   1369 eapol_test: .config $(OBJS_t)
   1370 	$(Q)$(LDO) $(LDFLAGS) -o eapol_test $(OBJS_t) $(LIBS)
   1371 	@$(E) "  LD " $@
   1372 
   1373 preauth_test: .config $(OBJS_t2) 
   1374 	$(Q)$(LDO) $(LDFLAGS) -o preauth_test $(OBJS_t2) $(LIBS)
   1375 	@$(E) "  LD " $@
   1376 
   1377 wpa_passphrase: $(OBJS_p)
   1378 	$(Q)$(LDO) $(LDFLAGS) -o wpa_passphrase $(OBJS_p) $(LIBS_p)
   1379 	@$(E) "  LD " $@
   1380 
   1381 wpa_cli: $(OBJS_c)
   1382 	$(Q)$(LDO) $(LDFLAGS) -o wpa_cli $(OBJS_c) $(LIBS_c)
   1383 	@$(E) "  LD " $@
   1384 
   1385 link_test: $(OBJS) $(OBJS_h) tests/link_test.o
   1386 	$(Q)$(LDO) $(LDFLAGS) -o link_test $(OBJS) $(OBJS_h) tests/link_test.o $(LIBS)
   1387 	@$(E) "  LD " $@
   1388 
   1389 test_wpa: $(OBJS_wpa) $(OBJS_h)
   1390 	$(Q)$(LDO) $(LDFLAGS) -o test_wpa $(OBJS_wpa) $(LIBS)
   1391 	@$(E) "  LD " $@
   1392 
   1393 win_if_list: win_if_list.c
   1394 	$(Q)$(LDO) $(LDFLAGS) -o $@ win_if_list.c $(CFLAGS) $(LIBS_w)
   1395 	@$(E) "  LD " $@
   1396 
   1397 eap_psk.so: ../src/eap_peer/eap_psk.c ../src/eap_common/eap_psk_common.c
   1398 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1399 		-Deap_peer_psk_register=eap_peer_method_dynamic_init
   1400 
   1401 eap_pax.so: ../src/eap_peer/eap_pax.c ../src/eap_common/eap_pax_common.c
   1402 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1403 		-Deap_peer_pax_register=eap_peer_method_dynamic_init
   1404 
   1405 eap_sake.so: ../src/eap_peer/eap_sake.c ../src/eap_common/eap_sake_common.c
   1406 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1407 		-Deap_peer_sake_register=eap_peer_method_dynamic_init
   1408 
   1409 eap_wsc.so: ../src/eap_peer/eap_wsc.c ../src/eap_common/eap_wsc_common.c ../src/wps/wps.c
   1410 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1411 		-Deap_peer_wsc_register=eap_peer_method_dynamic_init
   1412 
   1413 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
   1414 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $^ \
   1415 		-Deap_peer_ikev2_register=eap_peer_method_dynamic_init
   1416 
   1417 %.so: %.c
   1418 	$(CC) $(LDFLAGS) -o $@ $(CFLAGS) -shared -rdynamic -fPIC $< \
   1419 		-D$(*F:eap_%=eap_peer_%)_register=eap_peer_method_dynamic_init
   1420 
   1421 %.o: %.c
   1422 	$(Q)$(CC) -c -o $@ $(CFLAGS) $<
   1423 	@$(E) "  CC " $<
   1424 
   1425 wpa_supplicant.exe: wpa_supplicant
   1426 	mv -f $< $@
   1427 wpa_cli.exe: wpa_cli
   1428 	mv -f $< $@
   1429 wpa_passphrase.exe: wpa_passphrase
   1430 	mv -f $< $@
   1431 win_if_list.exe: win_if_list
   1432 	mv -f $< $@
   1433 eapol_test.exe: eapol_test
   1434 	mv -f $< $@
   1435 
   1436 WINALL=wpa_supplicant.exe wpa_cli.exe wpa_passphrase.exe win_if_list.exe
   1437 
   1438 windows-bin: $(WINALL)
   1439 	$(STRIP) $(WINALL)
   1440 
   1441 wpa_gui/Makefile:
   1442 	qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro 
   1443 
   1444 wpa_gui: wpa_gui/Makefile
   1445 	$(MAKE) -C wpa_gui
   1446 
   1447 wpa_gui-qt4/Makefile:
   1448 	qmake -o wpa_gui-qt4/Makefile wpa_gui-qt4/wpa_gui.pro 
   1449 
   1450 wpa_gui-qt4/lang/wpa_gui_de.qm: wpa_gui-qt4/lang/wpa_gui_de.ts
   1451 	lrelease wpa_gui-qt4/wpa_gui.pro
   1452 
   1453 wpa_gui-qt4: wpa_gui-qt4/Makefile wpa_gui-qt4/lang/wpa_gui_de.qm
   1454 	$(MAKE) -C wpa_gui-qt4
   1455 
   1456 TEST_EAP_SIM_COMMON_OBJS = $(SHA1OBJS) $(MD5OBJS) \
   1457 	../src/utils/common.o ../src/utils/os_unix.o \
   1458 	../src/utils/wpa_debug.o $(AESOBJS) \
   1459 	tests/test_eap_sim_common.o
   1460 test-eap_sim_common: $(TEST_EAP_SIM_COMMON_OBJS)
   1461 	$(LDO) $(LDFLAGS) -o $@ $(TEST_EAP_SIM_COMMON_OBJS) $(LIBS)
   1462 	./test-eap_sim_common
   1463 	rm test-eap_sim_common
   1464 
   1465 tests: test-eap_sim_common
   1466 
   1467 clean:
   1468 	$(MAKE) -C ../src clean
   1469 	$(MAKE) -C dbus clean
   1470 	rm -f core *~ *.o *.d eap_*.so $(ALL) $(WINALL) eapol_test preauth_test
   1471 	rm -f wpa_priv
   1472 
   1473 -include $(OBJS:%.o=%.d)
   1474