1# $FreeBSD$ 2 3.include <bsd.own.mk> 4 5HOSTAPD_DISTDIR?= ${.CURDIR}/../../../contrib/hostapd 6.PATH: ${.CURDIR}/.. ${HOSTAPD_DISTDIR} 7 8PROG= hostapd 9SRCS= hostapd.c eloop.c ieee802_1x.c eapol_sm.c radius.c md5.c rc4.c \ 10 common.c ieee802_11.c config.c ieee802_11_auth.c accounting.c \ 11 sta_info.c radius_client.c sha1.c wpa.c aes_wrap.c ctrl_iface.c \ 12 driver_conf.c os_unix.c preauth.c pmksa_cache.c beacon.c \ 13 hw_features.c wme.c ap_list.c reconfig.c mlme.c \ 14 vlan_init.c ieee802_11h.c l2_packet.c driver_freebsd.c 15CLEANFILES=driver_conf.c 16 17MAN= hostapd.8 hostapd.conf.5 18 19.if ${MK_EXAMPLES} != "no" 20FILESDIR= ${SHAREDIR}/examples/hostapd 21FILES= hostapd.conf hostapd.eap_user hostapd.wpa_psk 22.endif 23 24CFLAGS+= -I${.CURDIR} -I${HOSTAPD_DISTDIR} 25CFLAGS+= -DCONFIG_DRIVER_BSD 26CFLAGS+= -DCONFIG_CTRL_IFACE 27CFLAGS+= -DCONFIG_CTRL_IFACE_UNIX 28CFLAGS+= -DCONFIG_DRIVER_RADIUS_ACL 29.if ${MK_INET6} != "no" 30CFLAGS+= -DCONFIG_IPV6 31.endif 32CFLAGS+= -g 33DPADD+= ${LIBPCAP} 34LDADD+= -lpcap 35 36# User customizations for wpa_supplicant/hostapd build environment 37CFLAGS+=${WPA_SUPPLICANT_CFLAGS} 38#DPADD+=${WPA_SUPPLICANT_DPADD} 39LDADD+=${WPA_SUPPLICANT_LDADD} 40#LDFLAGS+=${WPA_SUPPLICANT_LDFLAGS} 41 42.if !empty(CFLAGS:M*-DEAP_SERVER) 43SRCS+= eap.c eap_methods.c eap_identity.c 44 45.if ${MK_OPENSSL} != "no" && !defined(RELEASE_CRUNCH) 46 47CFLAGS+=-DEAP_TLS -DEAP_PEAP -DEAP_MSCHAPv2 -DEAP_PSK \ 48 -DEAP_TLV -DEAP_TLS_FUNCS -DEAP_TLS_OPENSSL 49SRCS+= eap_tls.c eap_peap.c eap_mschapv2.c \ 50 eap_psk.c eap_psk_common.c \ 51 eap_tlv.c eap_tls_common.c tls_openssl.c ms_funcs.c crypto.c 52 53CFLAGS+=-DEAP_TTLS -DEAP_MD5 54SRCS+= eap_ttls.c eap_md5.c 55 56.if !empty(CFLAGS:M*-DEAP_GTC) 57SRCS+= eap_gtc.c 58.endif 59 60.if !empty(CFLAGS:M*-DEAP_AKA) 61NEED_SIM_COMMON= true 62SRCS+= eap_aka.c 63.endif 64 65.if !empty(CFLAGS:M*-DEAP_SIM) 66NEED_SIM_COMMON= true 67SRCS+= eap_sim.c 68.endif 69 70.if defined(NEED_SIM_COMMON) 71SRCS+= eap_sim_common.c eap_sim_db.c 72.endif 73 74.if !empty(CFLAGS:M*-DEAP_GPSK) 75CFLAGS+=-DEAP_GPSK_SHA256 76SRCS+= eap_gpsk.c eap_gpsk_common.c 77NEED_SHA256= true 78.endif 79 80.if !empty(CFLAGS:M*-DEAP_PAX) 81SRCS+= eap_pax.c eap_pax_common.c 82.endif 83 84.if !empty(CFLAGS:M*-DEAP_SAKE) 85SRCS+= eap_sake.c eap_sake_common.c 86.endif 87 88DPADD+= ${LIBSSL} ${LIBCRYPTO} 89LDADD+= -lssl -lcrypto 90.else 91NEED_TLS_NONE= true 92.endif 93 94.else 95NEED_TLS_NONE= true 96.endif 97 98.if defined(NEED_SHA256) 99CFLAGS+=-DINTERNAL_SHA256 100SRCS+= sha256.c 101.endif 102 103.if defined(NEED_TLS_NONE) 104CFLAGS+= -DEAP_TLS_NONE 105CFLAGS+= -DINTERNAL_AES 106CFLAGS+= -DINTERNAL_SHA1 107CFLAGS+= -DINTERNAL_MD5 108SRCS+= tls_none.c 109.endif 110 111driver_conf.c: Makefile 112 rm -f driver_conf.c 113 echo '/* THIS FILE AUTOMATICALLY GENERATED, DO NOT EDIT! */' \ 114 > driver_conf.c 115 echo '#include <stdlib.h>' >> driver_conf.c 116 echo '#include <stdio.h>' >> driver_conf.c 117 echo '#include <sys/types.h>' >> driver_conf.c 118 echo '#include <netinet/in.h>' >> driver_conf.c 119 echo '#include "hostapd.h"' >> driver_conf.c 120 echo '#include "driver.h"' >> driver_conf.c 121 echo "void bsd_driver_register(void);" >> driver_conf.c 122 echo 'void register_drivers(void) {' >> driver_conf.c 123 echo "bsd_driver_register();" >> driver_conf.c 124 echo '}' >> driver_conf.c 125 126.include <bsd.prog.mk> 127