5 WPA_SUPPLICANT_DISTDIR?= ${.CURDIR}/../../../contrib/wpa_supplicant
6 .PATH: ${.CURDIR}/.. ${WPA_SUPPLICANT_DISTDIR}
9 SRCS= config.c eloop.c common.c md5.c rc4.c sha1.c aes_wrap.c \
10 wpa_supplicant.c events.c wpa.c preauth.c pmksa_cache.c \
11 ctrl_iface.c ctrl_iface_unix.c l2_packet.c main.c drivers.c \
12 driver_ndis.c Packet32.c \
14 driver_freebsd.c os_unix.c
16 MAN= wpa_supplicant.8 wpa_supplicant.conf.5
18 .if ${MK_EXAMPLES} != "no"
19 FILESDIR= ${SHAREDIR}/examples/wpa_supplicant
20 FILES= wpa_supplicant.conf
23 CFLAGS+= -I${.CURDIR} -I${WPA_SUPPLICANT_DISTDIR}
24 CFLAGS+= -DCONFIG_DRIVER_BSD
25 CFLAGS+= -DCONFIG_DRIVER_NDIS
26 CFLAGS+= -DCONFIG_DRIVER_WIRED
27 CFLAGS+= -DCONFIG_CTRL_IFACE
28 CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
29 CFLAGS+= -DCONFIG_TERMINATE_ONLASTIF
34 # NB: we only support wpa_supplicant.conf file
35 SRCS+= config_file.c base64.c
36 CFLAGS+=-DCONFIG_BACKEND_FILE
38 # User customizations to the wpa_supplicant build environment
39 CFLAGS+=${WPA_SUPPLICANT_CFLAGS}
40 #DPADD+=${WPA_SUPPLICANT_DPADD}
41 LDADD+=${WPA_SUPPLICANT_LDADD}
42 #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS}
44 .if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
45 SRCS+= eapol_sm.c eap.c eap_methods.c
46 CFLAGS+= -DIEEE8021X_EAPOL
48 .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
49 CFLAGS+=-DEAP_TLS -DEAP_PEAP -DEAP_MSCHAPv2 -DEAP_LEAP -DEAP_PSK \
50 -DEAP_TLV -DEAP_TLS_FUNCS -DEAP_TLS_OPENSSL
51 SRCS+= eap_tls.c eap_peap.c eap_mschapv2.c eap_leap.c \
52 eap_psk.c eap_psk_common.c \
53 eap_tlv.c eap_tls_common.c tls_openssl.c ms_funcs.c crypto.c
55 CFLAGS+=-DEAP_TTLS -DEAP_MD5
56 SRCS+= eap_ttls.c eap_md5.c
58 .if !empty(CFLAGS:M*-DEAP_GTC)
62 .if !empty(CFLAGS:M*-DEAP_OTP)
66 .if !empty(CFLAGS:M*-DEAP_AKA)
71 .if !empty(CFLAGS:M*-DEAP_SIM)
76 .if defined(NEED_SIM_COMMON)
77 SRCS+= eap_sim_common.c
79 # PC/SC interface for smartcards (USIM, GSM SIM)
80 # GSM/UMTS authentication algorithm (for EAP-SIM/EAP-AKA)
81 # NB: requires devel/pcsc-lite
83 # WPA_SUPPLICANT_CFLAGS=-DEAP_AKA -DPCSC_FUNCS -I/usr/local/include/PCSC
84 # WPA_SUPPLICANT_LDADD=-L/usr/local/lib
86 .if !empty(CFLAGS:M*-DPCSC_FUNCS)
89 LDADD+=-lpcsclite -lpthread
93 .if !empty(CFLAGS:M*-DEAP_GPSK)
94 CFLAGS+=-DEAP_GPSK_SHA256
95 SRCS+= eap_gpsk.c eap_gpsk_common.c
99 .if !empty(CFLAGS:M*-DEAP_PAX)
100 SRCS+= eap_pax.c eap_pax_common.c
103 .if !empty(CFLAGS:M*-DEAP_SAKE)
104 SRCS+= eap_sake.c eap_sake_common.c
107 # NB: requires patch to openssl
113 CFLAGS+= -DEAP_TLS_NONE
120 # Configure crypto/cipher support.
122 # EAPOL support requires openssl in which case we use their
123 # cipher code. Otherwise we use our internal versions.
125 .if !defined(NEED_LIBSSL)
126 CFLAGS+= -DINTERNAL_AES
127 CFLAGS+= -DINTERNAL_SHA1
128 CFLAGS+= -DINTERNAL_MD5
130 DPADD+= ${LIBSSL} ${LIBCRYPTO}
131 LDADD+= -lssl -lcrypto
134 .if defined(NEED_SHA256)
135 CFLAGS+=-DINTERNAL_SHA256
139 .include <bsd.prog.mk>