1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/cw.h)
3AC_PREFIX_DEFAULT(/usr/local)
4if test $mandir = '${prefix}/man';then
5mandir=/usr/share/man/
6AC_SUBST(mandir)
7fi
8AC_PROG_CC
9AC_PROG_INSTALL
10AC_PROG_MAKE_SET
11AC_MSG_CHECKING([for -pedantic (gcc) compiler flag])
12ORIG_CFLAGS=""
13CFLAGS="-pedantic"
14AC_TRY_COMPILE(,[return 0;],AC_MSG_RESULT(yes),AC_MSG_RESULT(no);CFLAGS="")
15AC_MSG_CHECKING([for -Wall (gcc) compiler flag])
16ORIG_CFLAGS="$CFLAGS"
17CFLAGS="$CFLAGS -Wall"
18AC_TRY_COMPILE(,[return 0;],AC_MSG_RESULT(yes),AC_MSG_RESULT(no);CFLAGS="$ORIG_CFLAGS")
19AC_CONFIG_HEADER(config.h)
20AC_REQUIRE([AC_HEADER_STDC])
21AC_CHECK_LIB(util, openpty)
22AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(HAVE_DEV_PTMX, 1, Have /dev/ptmx.))
23AC_CHECK_FUNCS(getpt isatty isxdigit openpty putenv regcomp setenv setproctitle setsid sigaction sscanf uname unsetenv vsnprintf waitpid)
24AC_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)
25AC_OUTPUT(Makefile)
26