1 dnl $Id: configure.ac,v 1.18 2003-02-07 19:27:39 bjk Exp $
2 dnl Process this file with autoconf to produce a configure script.
4 AC_INIT(cboard, 0.1-git, [Ben Kibbey bjk@luxsci.net])
5 AC_CONFIG_AUX_DIR(build)
7 AM_INIT_AUTOMAKE([foreign])
9 AC_CONFIG_SRCDIR([src/cboard.c])
10 AM_CONFIG_HEADER([config.h])
11 AC_CONFIG_SUBDIRS([libchess])
15 LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
16 CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
22 CFLAGS="$CFLAGS -D_GNU_SOURCE"
24 dnl Checks for programs.
30 dnl Checks for library functions.
31 AC_CHECK_LIB(ncurses, initscr, ,
32 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
33 AC_CHECK_LIB(panel, new_panel, ,
34 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
35 AC_CHECK_LIB(form, new_form, ,
36 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
37 AC_CHECK_LIB(menu, new_menu, ,
38 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
40 dnl Checks for header files.
44 AC_CHECK_HEADERS([fcntl.h paths.h sys/socket.h limits.h sys/time.h unistd.h \
45 stdlib.h string.h ncurses.h panel.h form.h menu.h getopt.h \
46 sys/param.h regex.h wordexp.h])
48 dnl Checks for typedefs, structures, and compiler characteristics.
56 dnl Checks for library functions.
60 AC_FUNC_SELECT_ARGTYPES
64 AC_CHECK_FUNCS([bzero dup2 getcwd gethostbyname memset mkdir mkfifo regcomp \
65 select socket strcasecmp strdup strerror strrchr strstr \
74 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
77 if test "$ac_cv_sys_debug" = "yes"; then
78 CPPFLAGS="$CPPFLAGS -DDEBUG"
82 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
83 AC_DEBUG([$enableval]), AC_DEBUG)
85 AC_MSG_CHECKING([for Unix98 pty support])
86 if test -c "/dev/ptmx"; then
94 if test "x$have_ptmx" = "xyes"; then
97 #include <sys/types.h>
105 if ((fd = open("/dev/ptmx", O_RDWR)) == -1)
108 if (ptsname(fd) == NULL)
113 ], [ptmx_works=yes], [ptmx_works=no])
115 if test "x$ptmx_works" = "xyes"; then
117 AC_DEFINE([UNIX98], 1, [Define if your system has Unix98 pty support.])
123 if test "x$have_ptmx" = "xno" -o "x$ptmx_works" = "xno"; then
124 # From the GNU Screen package.
125 AC_MSG_CHECKING([pty ranges])
126 if test -d /dev/ptym; then
132 ptys=`echo $pdir/pty??`
134 if test "$ptys" != "$pdir/pty??" ; then
135 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
136 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
138 AC_DEFINE_UNQUOTED([PTY_MAJOR], "$p0", [Pseudo tty ranges.])
139 AC_DEFINE_UNQUOTED([PTY_MINOR], "$p1", [Pseudo tty ranges.])
140 AC_MSG_RESULT($p0 $p1)
146 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile data/Makefile \