xref: /freebsd/usr.sbin/wpa/hostapd/Makefile (revision 80bcb7437d4ddfed925d9b0dc44b6e7b3cf33384)
1# $FreeBSD$
2
3.include "${.CURDIR}/../Makefile.inc"
4
5.PATH.c:${WPA_DISTDIR}/src/drivers
6
7PROG=	hostapd
8SRCS=	accounting.c \
9	aes-wrap.c \
10	ap_config.c \
11	ap_drv_ops.c \
12	ap_mlme.c \
13	authsrv.c \
14	chap.c \
15	common.c \
16	config_file.c \
17	crypto_openssl.c \
18	ctrl_iface.c \
19	ctrl_iface_ap.c \
20	drivers.c \
21	drv_callbacks.c \
22	eap_common.c \
23	eap_peap_common.c \
24	eap_register.c \
25	eapol_auth_dump.c \
26	eapol_auth_sm.c \
27	eap_server.c \
28	eap_server_methods.c \
29	eloop.c \
30	hostapd.c \
31	ieee802_11_auth.c \
32	ieee802_11_common.c \
33	ieee802_1x.c \
34	ip_addr.c \
35	main.c \
36	md5.c \
37	ms_funcs.c \
38	os_unix.c \
39	peerkey_auth.c \
40	pmksa_cache_auth.c \
41	preauth_auth.c \
42	radius.c \
43	radius_client.c \
44	sha1-pbkdf2.c \
45	sha1-tlsprf.c \
46	sha1.c \
47	sta_info.c \
48	tkip_countermeasures.c \
49	utils.c \
50	vlan_init.c \
51	wpa_auth.c \
52	wpa_auth_glue.c \
53	wpa_auth_ie.c \
54	wpa_common.c \
55	wpa_debug.c \
56	wpabuf.c
57SRCS+=	l2_packet_freebsd.c driver_freebsd.c
58
59MAN=	hostapd.8 hostapd.conf.5
60
61.if ${MK_EXAMPLES} != "no"
62FILESDIR= ${SHAREDIR}/examples/hostapd
63.PATH:	${HOSTAPD_DISTDIR}
64FILES=	hostapd.conf hostapd.eap_user hostapd.wpa_psk
65.endif
66
67CFLAGS+=-DCONFIG_DRIVER_BSD \
68	-DHOSTAPD \
69	-DCONFIG_DRIVER_RADIUS_ACL \
70	-DCONFIG_RSN_PREAUTH \
71	-DCONFIG_PEERKEY
72.if ${MK_INET6} != "no"
73CFLAGS+= -DCONFIG_IPV6
74.endif
75#CFLAGS+= -g
76DPADD+=	${LIBPCAP} ${LIBSSL}
77LDADD+=	-lpcap -lssl
78
79# User customizations for wpa_supplicant/hostapd build environment
80CFLAGS+=${HOSTAPD_CFLAGS}
81#DPADD+=${HOSTAPD_DPADD}
82LDADD+=${HOSTAPD_LDADD}
83#LDFLAGS+=${HOSTAPD_LDFLAGS}
84
85.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH)
86
87CFLAGS+=-DDPKCS12_FUNCS \
88	-DEAP_SERVER \
89	-DEAP_SERVER_GTC \
90	-DEAP_SERVER_IDENTITY \
91	-DEAP_SERVER_MD5 \
92	-DEAP_SERVER_MSCHAPV2 \
93	-DEAP_SERVER_PEAP \
94	-DEAP_SERVER_TLS \
95	-DEAP_SERVER_TTLS \
96	-DEAP_TLS_FUNCS \
97	-DCONFIG_NO_DUMP_STATE
98SRCS+=	dump_state.c \
99	eap_server_gtc.c \
100	eap_server_identity.c \
101	eap_server_md5.c \
102	eap_server_mschapv2.c \
103	eap_server_peap.c \
104	eap_server_tls.c \
105	eap_server_tls_common.c \
106	eap_server_ttls.c \
107	tls_openssl.c
108
109.if !empty(CFLAGS:M*-DEAP_SERVER_AKA)
110NEED_SIM_COMMON=	true
111NEED_SHA256=	true
112SRCS+=	eap_server_aka.c
113.endif
114
115.if !empty(CFLAGS:M*-DEAP_SERVER_SIM)
116NEED_SIM_COMMON=	true
117SRCS+=	eap_server_sim.c
118.endif
119
120.if defined(NEED_SIM_COMMON)
121SRCS+=	eap_sim_common.c \
122	eap_sim_db.c
123NEED_AES_CBC=	true
124NEED_FIPS186_2_PRF=	true
125.endif
126
127.if !empty(CFLAGS:M*-DEAP_SERVER_GPSK)
128CFLAGS+=-DEAP_GPSK_SHA256
129SRCS+=	eap_server_gpsk.c \
130	eap_gpsk_common.c
131NEED_SHA256=	true
132NEED_AES_OMAC1=	true
133.endif
134
135.if !empty(CFLAGS:M*-DEAP_SERVER_PAX)
136SRCS+=	eap_server_pax.c \
137	eap_pax_common.c
138.endif
139
140.if !empty(CFLAGS:M*-DEAP_SERVER_SAKE)
141SRCS+=	eap_server_sake.c \
142	eap_sake_common.c
143.endif
144
145DPADD+= ${LIBSSL} ${LIBCRYPTO}
146LDADD+= -lssl -lcrypto
147.else
148NEED_TLS_NONE=	true
149.endif
150
151.if defined(NEED_AES_CBC)
152SRCS+=	aes-cbc.c
153.endif
154
155.if defined(NEED_AES_OMAC1)
156SRCS+=	aes-omac1.c
157.endif
158
159.if defined(NEED_FIPS186_2_PRF)
160SRCS+=	fips_prf_openssl.c
161.endif
162
163.if defined(NEED_SHA256)
164SRCS+=	sha256.c
165.endif
166
167.if defined(NEED_TLS_NONE)
168CFLAGS+= -DEAP_TLS_NONE
169CFLAGS+= -DINTERNAL_AES
170CFLAGS+= -DINTERNAL_SHA1
171CFLAGS+= -DINTERNAL_MD5
172SRCS+=	tls_none.c
173.endif
174
175.include <bsd.prog.mk>
176