1# $FreeBSD$ 2 3.include "${.CURDIR}/../Makefile.inc" 4 5.PATH.c:${WPA_SUPPLICANT_DISTDIR} \ 6 ${WPA_DISTDIR}/src/drivers \ 7 ${WPA_DISTDIR}/src/eap_peer \ 8 ${WPA_DISTDIR}/src/rsn_supp 9 ${WPA_DISTDIR}/src/crypto 10 11PROG= wpa_supplicant 12SRCS= aes-cbc.c aes-ctr.c aes-eax.c aes-encblock.c \ 13 aes-internal.c aes-omac1.c aes-unwrap.c \ 14 aes-wrap.c bss.c blacklist.c common.c config.c ctrl_iface.c \ 15 ctrl_iface_unix.c drivers.c eloop.c events.c l2_packet_freebsd.c main.c\ 16 md5.c notify.c preauth.c pmksa_cache.c scan.c \ 17 sha1-pbkdf2.c sha1-tlsprf.c sha1-tprf.c sha1.c \ 18 wpa.c wpa_common.c wpa_debug.c wpa_ie.c wpa_supplicant.c \ 19 wpabuf.c wpas_glue.c \ 20 driver_ndis.c Packet32.c \ 21 driver_wired.c \ 22 driver_freebsd.c os_unix.c 23 24MAN= wpa_supplicant.8 wpa_supplicant.conf.5 25 26.if ${MK_EXAMPLES} != "no" 27FILESDIR= ${SHAREDIR}/examples/etc 28.PATH: ${WPA_SUPPLICANT_DISTDIR} 29FILES= wpa_supplicant.conf 30.endif 31 32CFLAGS+=-I${WPA_SUPPLICANT_DISTDIR} 33CFLAGS+=-I${WPA_DISTDIR}/src/drivers 34CFLAGS+=-I${WPA_DISTDIR}/src/rsn_supp 35 36CFLAGS+= -DCONFIG_DRIVER_BSD 37CFLAGS+= -DCONFIG_DRIVER_NDIS 38CFLAGS+= -DCONFIG_DRIVER_WIRED 39CFLAGS+= -DCONFIG_TERMINATE_ONLASTIF 40CFLAGS+= -DCONFIG_DEBUG_SYSLOG 41#CFLAGS+= -g 42DPADD+= ${LIBPCAP} 43LDADD+= -lpcap 44 45# NB: we only support wpa_supplicant.conf file 46SRCS+= config_file.c base64.c 47CFLAGS+=-DCONFIG_BACKEND_FILE 48 49# User customizations to the wpa_supplicant build environment 50CFLAGS+=${WPA_SUPPLICANT_CFLAGS} 51#DPADD+=${WPA_SUPPLICANT_DPADD} 52LDADD+=${WPA_SUPPLICANT_LDADD} 53#LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS} 54 55.if ${MK_WPA_SUPPLICANT_EAPOL} != "no" 56SRCS+= eapol_supp_sm.c eap.c eap_common.c eap_methods.c eap_register.c 57CFLAGS+= -DIEEE8021X_EAPOL 58 59.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) 60CFLAGS+=-DEAP_TLS -DEAP_PEAP -DEAP_MSCHAPv2 -DEAP_LEAP -DEAP_PSK \ 61 -DEAP_TLV -DEAP_TLS_FUNCS -DEAP_TLS_OPENSSL 62SRCS+= chap.c crypto_openssl.c \ 63 eap_leap.c \ 64 eap_mschapv2.c \ 65 eap_peap.c eap_peap_common.c \ 66 eap_psk.c eap_psk_common.c \ 67 eap_tls.c eap_tls_common.c \ 68 mschapv2.c ms_funcs.c tls_openssl.c 69 70CFLAGS+=-DEAP_TTLS -DEAP_MD5 71SRCS+= eap_ttls.c eap_md5.c 72 73.if !empty(CFLAGS:M*-DEAP_GTC) 74SRCS+= eap_gtc.c 75.endif 76 77.if !empty(CFLAGS:M*-DEAP_OTP) 78SRCS+= eap_otp.c 79.endif 80 81.if !empty(CFLAGS:M*-DEAP_AKA) 82NEED_SIM_COMMON= true 83SRCS+= eap_aka.c 84.endif 85 86.if !empty(CFLAGS:M*-DEAP_SIM) 87NEED_SIM_COMMON= true 88SRCS+= eap_sim.c 89.endif 90 91.if defined(NEED_SIM_COMMON) 92SRCS+= eap_sim_common.c 93 94# PC/SC interface for smartcards (USIM, GSM SIM) 95# GSM/UMTS authentication algorithm (for EAP-SIM/EAP-AKA) 96# NB: requires devel/pcsc-lite 97# 98# WPA_SUPPLICANT_CFLAGS=-DEAP_AKA -DPCSC_FUNCS -I/usr/local/include/PCSC 99# WPA_SUPPLICANT_LDADD=-L/usr/local/lib 100# 101.if !empty(CFLAGS:M*-DPCSC_FUNCS) 102SRCS+= pcsc_funcs.c 103DPADD+=${LIBPTHREAD} 104LDADD+=-lpcsclite -lpthread 105.endif 106.endif 107 108.if !empty(CFLAGS:M*-DEAP_GPSK) 109CFLAGS+=-DEAP_GPSK_SHA256 110SRCS+= eap_gpsk.c eap_gpsk_common.c 111NEED_SHA256= true 112.endif 113 114.if !empty(CFLAGS:M*-DEAP_PAX) 115SRCS+= eap_pax.c eap_pax_common.c 116.endif 117 118.if !empty(CFLAGS:M*-DEAP_SAKE) 119SRCS+= eap_sake.c eap_sake_common.c 120.endif 121 122# NB: requires patch to openssl 123#CFLAGS+= -DEAP_FAST 124#SRCS+= eap_fast.c 125 126NEED_LIBSSL= true 127.else 128CFLAGS+= -DEAP_TLS_NONE 129SRCS+= tls_none.c 130.endif 131 132.endif 133 134# 135# Configure crypto/cipher support. 136# 137# EAPOL support requires openssl in which case we use their 138# cipher code. Otherwise we use our internal versions. 139# 140.if !defined(NEED_LIBSSL) 141CFLAGS+= -DINTERNAL_AES 142CFLAGS+= -DINTERNAL_SHA1 143CFLAGS+= -DINTERNAL_MD5 144.else 145DPADD+= ${LIBSSL} ${LIBCRYPTO} 146LDADD+= -lssl -lcrypto 147.endif 148 149.if defined(NEED_SHA256) 150CFLAGS+=-DINTERNAL_SHA256 151SRCS+= sha256.c 152.endif 153 154.include <bsd.prog.mk> 155