SRCDIR=	${.CURDIR}/../../kame/libinet6

LIB=	inet6
CFLAGS=	-DSTDC_HEADERS=1 -DHAVE_FCNTL_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_UNISTD_H=1 -DTIME_WITH_SYS_TIME=1 -DDNS=1 -DUSE_GETIPNODEBY=1 -DINET6=1 -DHAVE_GETHOSTNAME=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_SELECT=1 -DHAVE_SOCKET=1 -DHAVE_STRDUP=1 -DHAVE_STRERROR=1 -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_PORTABLE_PROTOTYPE=1 -DSIZEOF_CHAR=1 -DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4 -DHAVE_U_INT8_T=1 -DHAVE_U_INT16_T=1 -DHAVE_U_INT32_T=1 -DHAVE_ADDRINFO=1 -DHAVE_SOCKADDR_STORAGE=1 -DHAVE_INADDRSZ=1 -DHAVE_IN6ADDRSZ=1 -DHAVE_RES_USE_INET6=1 -DHAVE_AAAA=1 -DHAVE_RES_STATE_EXT=1 -DHAVE_NEW_RES_STATE=1 -DHAVE_H_ERRNO -DHAVE_IF_NAMEINDEX -DFILTER_V4MAPPED -DHAVE_SOCKLEN_T -DBSDI_LIBC
#for debug
CFLAGS+= -g

SRCS=	getaddrinfo.c getnameinfo.c vars.c rresvport_af.c
SRCS+=	if_indextoname.c if_nameindex.c if_nametoindex.c
#SRCS+=	rcmd.c
SRCS+=	rthdr.c ip6opt.c
# We should not use name6.c any more.
#SRCS+=	name6.c
# BSDI4 libc has correct inet_pton(3)
#SRCS+=	inet_pton.c
SRCS+=	getifaddrs.c
SRCS+=	strlcat.c strlcpy.c
#SRCS+=	mconnect.c
SRCS+=	scope.c

.PATH: ${SRCDIR}

##KAME patched bind8 files. Most of them are necessary just to avoid
##conflict with libc objects (XXX). include it after .PATH setting above
##to moake sure that KAME derived files are preferred.
.include "${.CURDIR}/bind/Makefile.inc"

MAN3=	getaddrinfo.0 getnameinfo.0 resolver.0 \
	rresvport_af.0 if_indextoname.0 inet6_option_space.0 \
	inet6_rthdr_space.0 inet6_opt_init.0 inet6_rth_space.0 getifaddrs.0 \
	strlcpy.0
MLINKS=	getaddrinfo.3 freeaddrinfo.3 \
	getaddrinfo.3 gai_strerror.3 \
	if_indextoname.3 if_nametoindex.3 \
	if_indextoname.3 if_nameindex.3 \
	if_indextoname.3 if_freenameindex.3 \
	inet6_option_space.3 inet6_option_init.3 \
	inet6_option_space.3 inet6_option_append.3 \
	inet6_option_space.3 inet6_option_alloc.3 \
	inet6_option_space.3 inet6_option_next.3 \
	inet6_option_space.3 inet6_option_find.3 \
	inet6_rthdr_space.3 inet6_rthdr_init.3 \
	inet6_rthdr_space.3 inet6_rthdr_add.3 \
	inet6_rthdr_space.3 inet6_rthdr_lasthop.3 \
	inet6_rthdr_space.3 inet6_rthdr_reverse.3 \
	inet6_rthdr_space.3 inet6_rthdr_segments.3 \
	inet6_rthdr_space.3 inet6_rthdr_getaddr.3 \
	inet6_rthdr_space.3 inet6_rthdr_getflags.3 \
	inet6_opt_init.3 inet6_opt_append.3 \
	inet6_opt_init.3 inet6_opt_finish.3 \
	inet6_opt_init.3 inet6_opt_set_val.3 \
	inet6_opt_init.3 inet6_opt_next.3 \
	inet6_opt_init.3 inet6_opt_find.3 \
	inet6_opt_init.3 inet6_opt_get_val.3 \
	inet6_rth_space.3 inet6_rth_init.3 \
	inet6_rth_space.3 inet6_rth_add.3 \
	inet6_rth_space.3 inet6_rth_reverse.3 \
	inet6_rth_space.3 inet6_rth_segments.3 \
	inet6_rth_space.3 inet6_rth_getaddr.3 \
	getifaddrs.3 freeifaddrs.3 \
	strlcpy.3 strlcat.3

# If you attempt to build shared library, enable the following lines.
# Do it at your own risk!  libinet6 is updated frequently so version
# management would be very hard...
#SHLIB_MAJOR=	1
#SHLIB_MINOR=	0
NODYNAMIC=	yes

.include <bsd.lib.mk>
