dnl Process this file with autoconf to produce a configure script.

AC_INIT(t_pwd.h)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(libsrp, 1.2.1)

test "$CFLAGS" = "" && CFLAGS="-O2"

dnl Checks for programs.

AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_RANLIB
AC_ARG_PROGRAM

dnl Checks for libraries.

AC_CHECK_LIB(nsl, gethostbyname)

dnl Checks for header files.

AC_HEADER_STDC
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(termios.h termio.h sgtty.h sys/ioctl.h)

dnl Checks for typedefs, structures, and compiler characteristics.

AC_C_CONST
AC_C_INLINE
AC_HEADER_TIME
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_TRY_COMPILE(, [volatile int i;], , AC_DEFINE(volatile, ))

dnl Checks for library functions.

AC_CHECK_FUNCS(strchr memcpy)
TYPE_SIGNAL
AC_HEADER_CHECK(termios.h,AC_FUNC_CHECK(cfsetispeed,AC_DEFINE(POSIX_TERMIOS)))

dnl User options

AC_ARG_WITH(cryptolib, [  --with-cryptolib		compile to use cryptolib])
if test "$with_cryptolib" = "yes"
then
	AC_DEFINE(CRYPTOLIB)
	LIBS="-L../lib -lcrypt $LIBS"
else
	AC_DEFINE(GNU_MP)
	LIBS="-L../lib -lgmp $LIBS"
fi

AC_ARG_WITH(nis,       [  --with-nis			compile with NIS/YP support])
if test "$with_nis" = "yes"
then
	AC_DEFINE(ENABLE_YP)
fi

dnl Some defines for now.

AC_DEFINE(HIGHFIRST)
AC_DEFINE(SHA1HANDSOFF)

AC_OUTPUT(Makefile)
