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.
3 AC_INIT(cboard, 0.1.6, [Ben Kibbey <bjk@arbornet.org>])
4 AC_CONFIG_AUX_DIR(build)
6 AM_INIT_AUTOMAKE([foreign])
8 AC_CONFIG_SRCDIR([src/cboard.c])
9 AM_CONFIG_HEADER([config.h])
13 LDFLAGS="$LDFLAGS -flat_namespace -L/sw/lib"
14 CPPFLAGS="$CPPFLAGS -I/sw/include -L/sw/lib"
20 dnl Checks for programs.
24 dnl Checks for library functions.
25 AC_CHECK_LIB(ncurses, initscr, ,
26 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
27 AC_CHECK_LIB(panel, new_panel, ,
28 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
29 AC_CHECK_LIB(form, new_form, ,
30 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
31 AC_CHECK_LIB(menu, new_menu, ,
32 [AC_MSG_ERROR([Missing or incomplete ncurses installation.])])
34 dnl Checks for header files.
36 AC_CHECK_HEADERS([limits.h sys/time.h unistd.h stdlib.h string.h ncurses.h \
37 panel.h form.h menu.h getopt.h sys/param.h regex.h])
39 dnl Checks for typedefs, structures, and compiler characteristics.
44 dnl Checks for library functions.
46 AC_CHECK_FUNCS([bzero strdup strerror strrchr vasprintf])
48 AH_TOP([/* Maximum line length in a PGN file. */
49 #define MAX_PGN_LINE_LEN 255])
51 AH_TOP([/* Maximum SAN move length without terminating NULL. */
52 #define MAX_PGN_MOVE_LEN 7])
54 AH_TOP([/* Maximum number of NAG entries per move. */
55 #define MAX_PGN_NAG 5])
57 AH_TOP([/* Default internet chess server. */
58 #define DEFAULT_ICS_SERVER "localhost"])
60 AH_TOP([/* Default internet chess server port. */
61 #define DEFAULT_ICS_PORT 5000])
63 AH_TOP([/* Default internet chess server username. */
64 #define DEFAULT_ICS_USER "guest"])
66 AH_TOP([/* Default chess engine. 0=gnuchess, 1=crafty. */
67 #define DEFAULT_ENGINE 0])
75 AC_CACHE_CHECK([if debugging is wanted], [ac_cv_sys_debug],
78 if test "$ac_cv_sys_debug" = "yes"; then
79 CPPFLAGS="$CPPFLAGS -DDEBUG"
83 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging.]),
84 AC_DEBUG([$enableval]), AC_DEBUG)
86 dnl Ripped from the screen package.
87 AC_MSG_CHECKING([pty ranges])
88 if test -d /dev/ptym; then
94 ptys=`echo $pdir/pty??`
96 if test "$ptys" != "$pdir/pty??" ; then
97 p0=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\).$/\1/g' | sort -u | tr -d '\012'`
98 p1=`echo $ptys | tr ' ' '\012' | sed -e 's/^.*\(.\)$/\1/g' | sort -u | tr -d '\012'`
100 AC_DEFINE_UNQUOTED([PTY_MAJOR], "$p0", [Pseudo tty ranges.])
101 AC_DEFINE_UNQUOTED([PTY_MINOR], "$p1", [Pseudo tty ranges.])
102 AC_MSG_RESULT($p0 $p1)
107 AC_CONFIG_FILES([Makefile src/Makefile doc/Makefile data/Makefile])