dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/cw.h)
AC_PREFIX_DEFAULT(/usr/local)
if test $mandir = '${prefix}/man';then
mandir=/usr/share/man/
AC_SUBST(mandir)
fi
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_MSG_CHECKING([for -pedantic (gcc) compiler flag])
ORIG_CFLAGS=""
CFLAGS="-pedantic"
AC_TRY_COMPILE(,[return 0;],AC_MSG_RESULT(yes),AC_MSG_RESULT(no);CFLAGS="")
AC_MSG_CHECKING([for -Wall (gcc) compiler flag])
ORIG_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wall"
AC_TRY_COMPILE(,[return 0;],AC_MSG_RESULT(yes),AC_MSG_RESULT(no);CFLAGS="$ORIG_CFLAGS")
AC_CONFIG_HEADER(config.h)
AC_REQUIRE([AC_HEADER_STDC])
AC_CHECK_LIB(util, openpty)
AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(HAVE_DEV_PTMX, 1, Have /dev/ptmx.))
AC_CHECK_FUNCS(getpt isatty isxdigit openpty putenv regcomp setenv setproctitle setsid sigaction sscanf uname unsetenv vsnprintf waitpid)
AC_CHECK_HEADERS(ctype.h fcntl.h libgen.h libutil.h pty.h regex.h signal.h string.h strings.h stropts.h unix.h util.h sys/ioctl.h sys/stat.h sys/time.h sys/types.h sys/utsname.h sys/wait.h)
AC_OUTPUT(Makefile)
