# A NetBSD TARGET
# $Id: T_netbsd,v 1.13 2007/02/18 16:07:24 tlaronde Exp $
#
# Copyright 2004 Thierry LARONDE <tlaronde@polynum.com>
# Public Domain

#----- TARGET environment dependent
TARGET="netbsd"
TARGET_RELEASE=${TARGET_RELEASE:-$(uname -r)}
TARGET_ARCH=${TARGET_ARCH:-$(uname -m)}

# pkgsrc users can define LOCALBASE to set the directory under which
# they want third party packages to be installed. Set them in the conf
# or environment. Value specified in the environment takes precedent.
# If not, take LOCALBASE. Default to /usr/pkg if not set.
DISTDIR=${DISTDIR:-$LOCALBASE}
[ "x$DISTDIR" != "x" ] || DISTDIR="/usr/pkg"
TARGETBINDIR="$DISTDIR/bin"
TARGETSBINDIR="$DISTDIR/sbin"

OBJECT_FORMAT="ELF"

# What kind of libraries are supported? static, sshared (static shared),
# dshared (dynamic shared), or unset if use default.
LIB_TYPES="static dshared"

# The substitution expression for translating rkcomp
# fixed library naming scheme in the host supported one. 
# static lib
LIB_A_TR='-e s!\(lib[^/]\{1,\}\)__\([0-9.]\{1,\}\)!\1.a.\2!'
LIB_A_TR="$LIB_A_TR "'-e s!\(lib[^/]\{1,\}\)__$!\1.a!'
LIB_A_TR="$LIB_A_TR "'-e s!\(lib[^/]\{1,\}\)__\([^0-9.]\)!\1.a\2!'

# The dynamic shared lib name.
# We take into account the fact that a lib can be not versionned.
# So we keep all the :<version> and removed the `:` if it exists.
LIB_DSH_TR='-e s!\(lib[^/]\{1,\}\)__\([0-9.]\{1,\}\)!\1.so.\2!'
LIB_DSH_TR="$LIB_DSH_TR "'-e s!\(lib[^/]\{1,\}\)__$!\1.so!'
LIB_DSH_TR="$LIB_DSH_TR "'-e s!\(lib[^/]\{1,\}\)__\([^0-9.]\)!\1.so\2!'

# Standard libes shall be mapped
CLIB=$(rk_which_lib_of libc__ stdio.h)
MATHLIB=$(rk_which_lib_of libm__ math.h)
YACCLIB=$(rk_which_lib_of liby__ NULL)
LEXLIB=$(rk_which_lib_of libl__ NULL)

# POSIX extensions
ICONVLIB=$CLIB
RK_ICONV_DEFS=rk_iconv_defs.h
RK_PTY_TYPE=PTY_BSD

# C99
HAVE_VSNPRINTF=YES
