dnl	This file is an input file used by the GNU "autoconf" program to
dnl	generate the file "configure", which is run during Tk installation
dnl	to configure the system for the local environment.
AC_INIT(tk.h)
AC_UNISTD_H

#--------------------------------------------------------------------
#	Include sys/select.h if it exists and if it supplies things
#	that appear to be useful and aren't already in sys/types.h.
#	This appears to be true only on the RS/6000 under AIX.  Some
#	systems like OSF/1 have a sys/select.h that's of no use, and
#	other systems like SCO UNIX have a sys/select.h that's
#	pernicious.  If "fd_set" isn't defined anywhere then set a
#	special flag.
#--------------------------------------------------------------------

echo checking for sys/select.h
AC_COMPILE_CHECK(fd_set, [#include <sys/types.h>],
	[fd_set readMask, writeMask;], ,
	AC_HEADER_EGREP(fd_mask, sys/select.h, AC_DEFINE(HAVE_SYS_SELECT_H),
		AC_DEFINE(NO_FD_SET)))

#--------------------------------------------------------------------
#	Supply a substitute for stdlib.h if it doesn't define strtol,
#	strtoul, or strtod (which it doesn't in some versions of SunOS).
#--------------------------------------------------------------------

echo checking for proper stdlib.h
AC_HEADER_EGREP(strtol, stdlib.h, tk_stdlib=1, tk_stdlib=0)
AC_HEADER_EGREP(strtoul, stdlib.h, , tk_stdlib=0)
AC_HEADER_EGREP(strtod, stdlib.h, , tk_stdlib=0)
if test $tk_stdlib = 0; then
    AC_DEFINE(NO_STDLIB_H)
fi

#--------------------------------------------------------------------
#	Check for various typedefs and provide substitutes if
#	they don't exist.
#--------------------------------------------------------------------

AC_MODE_T
AC_PID_T
AC_SIZE_T
AC_UID_T


#--------------------------------------------------------------------
#	Check for the existence of various libraries.  The order here
#	is important, so that then end up in the right order in the
#	command line generated by Make.
#--------------------------------------------------------------------

dnl	 AC_HAVE_LIBRARY(Xbsd, [LIBS="$LIBS -lXbsd"])
dnl	 AC_HAVE_LIBRARY(socket, [LIBS="$LIBS -lsocket"])
dnl	 AC_HAVE_LIBRARY(nsl, [LIBS="$LIBS -lnsl"])


AC_OUTPUT(Makefile)
