AC_INIT(inetd.c)
AC_PREFIX_DEFAULT(/usr/local/v6)

AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL

dnl Check where to put the config file
AC_MSG_CHECKING(where to find config file)
AC_ARG_WITH(configfile,
[  --with-configfile	Path to the inetd config file [SYSCONF/inetd.conf]],
	_PATH_INETDCONF=$withval,
	_PATH_INETDCONF=${sysconfdir}/inetd.conf)
AC_MSG_RESULT($_PATH_INETDCONF)
AC_SUBST(_PATH_INETDCONF)

dnl Check where to put the pidfile
AC_MSG_CHECKING(where to put pidfile)
AC_ARG_WITH(pidfile,
[  --with-pidfile	Path to the inetd pid file [/var/run/inetd.pid]],
	_PATH_INETDPID=$withval, 
	_PATH_INETDPID=/var/run/inetd.pid)
AC_MSG_RESULT($_PATH_INETDPID)
AC_SUBST(_PATH_INETDPID)

INSTALL_LIB="\${INSTALL_DATA}"
AC_SUBST(INSTALL_LIB)
INSTALL_DIR="\${INSTALL} -d"
AC_SUBST(INSTALL_DIR)

AC_REPLACE_FUNCS(daemon)

CFLAGS="-I../libinet6/include $CFLAGS"
LIBS="-L../libinet6 -linet6 $LIBS"

AC_OUTPUT(Makefile)
