dnl standard setup for vic/vat/etc. autoconf scripts.
dnl $Header: configure.in.head,v 1.3 96/04/02 20:52:05 mccanne Exp $ (LBL)

AC_CANONICAL_SYSTEM

AC_PROG_CC
AC_PROG_CXX
AC_STDC_HEADERS
AC_HAVE_HEADERS(string.h)

V_INCLUDE=""
V_LIB=""
V_OBJ=""
V_OBJ_CRYPT=""
V_BROKEN_OBJ="strtol.o strtoul.o"

V_SHELL=""
V_TARCMD="tar cfh"
V_SIGRET="void"

AC_CHECK_LIB(Xbsd, main, [V_LIB="$V_LIB -lXbsd"])
AC_CHECK_LIB(socket, poll, [V_LIB="$V_LIB -lsocket"])
AC_CHECK_LIB(nsl, gethostbyname, [V_LIB="$V_LIB -lnsl"])
AC_CHECK_LIB(dnet_stub, getnodebyname, [V_LIB="$V_LIB -ldnet_stub"])

V_TAR_EXTRA=""
V_DEFINE=""

AC_ARG_ENABLE(debug,   --enable-debug		build with debugging enabled, V_CCOPT="-g", V_CCOPT="-O2")

AC_ARG_WITH(fore,	--with-fore=path	specify a pathname for fore atm, d=$withval, d="")
if test "$d" = "" ; then
	if test -d /usr/src/local/fore ; then
		d=/usr/src/local/fore
	fi
fi
if test "$d" != "" ; then
	if test ! -d $d ; then
		echo "'$d' is not a directory"
		exit 1
	fi
	V_INCLUDE="$V_INCLUDE -I$d/include"
	V_LIB="$V_LIB $d/api/libatm.a"
	V_OBJ="$V_OBJ net-atm.o"
fi

if test -z "$PWD" ; then
    PWD=`pwd`
fi

solaris=""
if test `echo "$target_os" | sed 's/\..*//'` = solaris2 ; then
	solaris="yes"
fi

places="desCore.a \
	/usr/src/local/desCore/desCore.a \
	../desCore/desCore.a"
for f in $places; do
	if test -f $f ; then
		V_LIB="$V_LIB $f"
		V_OBJ_CRYPT="$V_OBJ_CRYPT crypt-des.o"
    		break
	fi
done

builtin(include, configure.in.x11)
builtin(include, configure.in.tk)
