4 AM_INIT_AUTOMAKE(abook, 2002-xx-xx)
5 AM_CONFIG_HEADER(config.h)
12 if test "x$U" != "x"; then
13 AC_MSG_ERROR(Compiler not ANSI compliant)
18 AC_CHECK_HEADERS(unistd.h locale.h termios.h linux/termios.h sys/ioctl.h)
19 AC_CHECK_HEADER(stdarg.h,AC_DEFINE(HAVE_STDARG_H),AC_MSG_ERROR([*** stdarg.h is missing on your system ***]))
21 AC_CHECK_FUNCS(setlocale)
23 dnl -------------------
24 dnl (n)curses detection
25 dnl -------------------
28 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
29 [if test $withval != yes; then
30 abook_cv_curses=$withval
32 if test x$abook_cv_curses != x/usr; then
33 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
34 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
37 AC_CHECK_LIB(ncurses, initscr,
38 [LIBS="$LIBS -lncurses"
39 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
40 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
42 AC_CHECK_HEADERS(ncurses.h)],
45 dnl --------------------------
46 dnl end of (n)curses detection
47 dnl --------------------------
51 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
52 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
55 LDFLAGS="$ac_cv_lib_readline $LDFLAGS"
57 AC_CHECK_FUNCS(resizeterm)
59 AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)],)
60 AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)],)
62 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
65 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
68 if test x$debug = xtrue; then
69 CPPFLAGS="-DDEBUG $CPPFLAGS"
73 if test x$GCC = xyes; then
74 CFLAGS="-Wall $CFLAGS"