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 \
13 driver_freebsd.c os_unix.c
16 MAN= wpa_supplicant.8 wpa_supplicant.conf.5
18 CFLAGS+= -I${.CURDIR} -I${WPA_SUPPLICANT_DISTDIR}
19 CFLAGS+= -DCONFIG_DRIVER_BSD
20 CFLAGS+= -DCONFIG_DRIVER_NDIS
21 CFLAGS+= -DCONFIG_CTRL_IFACE
22 CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX
23 CFLAGS+= -DCONFIG_TERMINATE_ONLASTIF
28 # NB: we only support wpa_supplicant.conf file
29 SRCS+= config_file.c base64.c
30 CFLAGS+=-DCONFIG_BACKEND_FILE
32 # User customizations to the wpa_supplicant build environment
33 CFLAGS+=${WPA_SUPPLICANT_CFLAGS}
34 #DPADD+=${WPA_SUPPLICANT_DPADD}
35 LDADD+=${WPA_SUPPLICANT_LDADD}
36 #LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS}
38 .if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
39 SRCS+= eapol_sm.c eap.c eap_methods.c
40 CFLAGS+= -DIEEE8021X_EAPOL
42 .if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
43 CFLAGS+=-DEAP_TLS -DEAP_PEAP -DEAP_MSCHAPv2 -DEAP_LEAP -DEAP_PSK \
44 -DEAP_TLV -DEAP_TLS_FUNCS -DEAP_TLS_OPENSSL
45 SRCS+= eap_tls.c eap_peap.c eap_mschapv2.c eap_leap.c \
46 eap_psk.c eap_psk_common.c \
47 eap_tlv.c eap_tls_common.c tls_openssl.c ms_funcs.c crypto.c
49 CFLAGS+=-DEAP_TTLS -DEAP_MD5
50 SRCS+= eap_ttls.c eap_md5.c
52 .if !empty(CFLAGS:M*-DEAP_GTC)
56 .if !empty(CFLAGS:M*-DEAP_OTP)
60 .if !empty(CFLAGS:M*-DEAP_AKA)
65 .if !empty(CFLAGS:M*-DEAP_SIM)
70 .if defined(NEED_SIM_COMMON)
71 SRCS+= eap_sim_common.c
73 # PC/SC interface for smartcards (USIM, GSM SIM)
74 # GSM/UMTS authentication algorithm (for EAP-SIM/EAP-AKA)
75 # NB: requires devel/pcsc-lite
77 # WPA_SUPPLICANT_CFLAGS=-DEAP_AKA -DPCSC_FUNCS -I/usr/local/include/PCSC
78 # WPA_SUPPLICANT_LDADD=-L/usr/local/lib
80 .if !empty(CFLAGS:M*-DPCSC_FUNCS)
83 LDADD+=-lpcsclite -lpthread
87 .if !empty(CFLAGS:M*-DEAP_GPSK)
88 CFLAGS+=-DEAP_GPSK_SHA256
89 SRCS+= eap_gpsk.c eap_gpsk_common.c
93 .if !empty(CFLAGS:M*-DEAP_PAX)
94 SRCS+= eap_pax.c eap_pax_common.c
97 .if !empty(CFLAGS:M*-DEAP_SAKE)
98 SRCS+= eap_sake.c eap_sake_common.c
101 .if defined(NEED_SHA256)
102 CFLAGS+=-DINTERNAL_SHA256
106 # NB: requires patch to openssl
110 DPADD+= ${LIBSSL} ${LIBCRYPTO}
111 LDADD+= -lssl -lcrypto
113 CFLAGS+= -DEAP_TLS_NONE
114 CFLAGS+= -DINTERNAL_AES
115 CFLAGS+= -DINTERNAL_SHA1
116 CFLAGS+= -DINTERNAL_MD5
122 .include <bsd.prog.mk>