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