1# $FreeBSD$
2
3.include <src.opts.mk>
4
5.include "../Makefile.inc"
6
7.PATH.c:${WPA_SUPPLICANT_DISTDIR} \
8	${WPA_DISTDIR}/src/eap_peer \
9	${WPA_DISTDIR}/src/drivers
10
11PACKAGE=	wpa
12PROG=	wpa_supplicant
13
14SRCS=	base64.c bitfield.c blacklist.c bss.c cli.c common.c \
15	config.c config_file.c \
16	ctrl_iface.c ctrl_iface_common.c ctrl_iface_unix.c \
17	dh_groups.c driver_bsd.c driver_common.c \
18	driver_ndis.c driver_wired.c driver_wired_common.c drivers.c \
19	eap_register.c eap_wsc.c eap_wsc_common.c eloop.c \
20	events.c gas.c gas_query.c hs20_supplicant.c \
21	http_client.c http_server.c \
22	httpread.c hw_features_common.c \
23	ieee802_11_common.c interworking.c l2_packet_freebsd.c main.c \
24	notify.c offchannel.c op_classes.c os_unix.c pmksa_cache.c preauth.c \
25	rrm.c scan.c upnp_xml.c uuid.c \
26	wmm_ac.c wpa.c wpa_common.c wpa_ctrl.c \
27	wpa_debug.c wpa_ft.c wpa_ie.c wpa_supplicant.c wpabuf.c wpas_glue.c \
28	wps.c wps_attr_build.c wps_attr_parse.c wps_attr_process.c \
29	wps_common.c wps_dev_attr.c wps_enrollee.c wps_registrar.c \
30	wps_supplicant.c wps_upnp.c wps_upnp_ap.c wps_upnp_event.c \
31	wps_upnp_ssdp.c wps_upnp_web.c \
32	Packet32.c
33
34MAN=	wpa_supplicant.8 wpa_supplicant.conf.5
35
36.if ${MK_EXAMPLES} != "no"
37FILESDIR= ${SHAREDIR}/examples/etc
38.PATH:	${WPA_SUPPLICANT_DISTDIR}
39FILES=	wpa_supplicant.conf
40.endif
41
42CFLAGS+=-DCONFIG_BACKEND_FILE \
43	-DCONFIG_DEBUG_SYSLOG \
44	-DCONFIG_DRIVER_BSD \
45	-DCONFIG_DRIVER_NDIS \
46	-DCONFIG_DRIVER_WIRED \
47	-DCONFIG_GAS \
48	-DCONFIG_HS20 \
49	-DCONFIG_IEEE80211R \
50	-DCONFIG_INTERWORKING \
51	-DCONFIG_PEERKEY \
52	-DCONFIG_PRIVSEP \
53	-DCONFIG_SMARTCARD \
54	-DCONFIG_TERMINATE_ONLASTIF \
55	-DCONFIG_TLS=openssl \
56	-DCONFIG_WPS \
57	-DCONFIG_WPS2 \
58	-DCONFIG_WPS_UPNP \
59	-DPKCS12_FUNCS
60#CFLAGS+= -g
61LIBADD=	pcap util
62
63# User customizations to the wpa_supplicant build environment
64CFLAGS+=${WPA_SUPPLICANT_CFLAGS}
65#DPADD+=${WPA_SUPPLICANT_DPADD}
66LDADD+=${WPA_SUPPLICANT_LDADD}
67#LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS}
68
69.if ${MK_WPA_SUPPLICANT_EAPOL} != "no"
70CFLAGS+=-DEAP_GTC \
71	-DEAP_LEAP \
72	-DEAP_MD5 \
73	-DEAP_MSCHAPv2 \
74	-DEAP_OTP \
75	-DEAP_PEAP \
76	-DEAP_PSK \
77	-DEAP_TLS \
78	-DEAP_TTLS \
79	-DIEEE8021X_EAPOL
80SRCS+=	chap.c \
81	eap.c \
82	eap_common.c \
83	eap_gtc.c \
84	eap_leap.c \
85	eap_md5.c \
86	eap_methods.c \
87	eap_mschapv2.c \
88	eap_otp.c \
89	eap_peap.c \
90	eap_peap_common.c \
91	eap_psk.c \
92	eap_psk_common.c \
93	eap_tls.c \
94	eap_tls_common.c \
95	eap_ttls.c \
96	eapol_supp_sm.c \
97	ms_funcs.c \
98	mschapv2.c
99TLS_FUNCS=y
100NEED_AES_EAX=y
101NEED_AES_ENCBLOCK=y
102NEED_AES_OMAC1=y
103.endif
104
105.if !empty(CFLAGS:M*-DEAP_AKA)
106SRCS+=	eap_aka.c
107NEED_SIM_COMMON=y
108NEED_AES_CBC=y
109.endif
110
111.if !empty(CFLAGS:M*-DEAP_SIM)
112SRCS+=	eap_sim.c
113NEED_SIM_COMMON=y
114NEED_AES_CBC=y
115.endif
116
117.if defined(NEED_SIM_COMMON)
118SRCS+=	eap_sim_common.c
119NEED_FIPS186_2_PRF=y
120.endif
121
122# PC/SC interface for smartcards (USIM, GSM SIM)
123# GSM/UMTS authentication algorithm (for EAP-SIM/EAP-AKA)
124# NB: requires devel/pcsc-lite
125#
126# WPA_SUPPLICANT_CFLAGS=-DEAP_AKA -DPCSC_FUNCS -I/usr/local/include/PCSC
127# WPA_SUPPLICANT_LDADD=-L/usr/local/lib
128#
129.if !empty(CFLAGS:M*-DPCSC_FUNCS)
130SRCS+=	pcsc_funcs.c
131LIBADD+=	pcslite pthread
132.endif
133
134.if !empty(CFLAGS:M*-DEAP_GPSK)
135CFLAGS+=-DEAP_GPSK_SHA256
136SRCS+=	eap_gpsk.c \
137	eap_gpsk_common.c
138NEED_AES_OMAC1=y
139.endif
140
141.if !empty(CFLAGS:M*-DEAP_PAX)
142SRCS+=	eap_pax.c \
143	eap_pax_common.c
144.endif
145
146.if !empty(CFLAGS:M*-DEAP_SAKE)
147SRCS+=	eap_sake.c \
148	eap_sake_common.c
149.endif
150
151.include "../Makefile.crypto"
152
153.include <bsd.prog.mk>
154