4 AM_INIT_AUTOMAKE(abook, 0.5.0)
5 AM_CONFIG_HEADER(config.h)
7 AC_DEFINE(HAVE_SNPRINTF, 0, [Define if snprintf is available.])
8 AC_DEFINE(HAVE_VSNPRINTF, 0, [Define if vsnprintf is available.])
9 AC_DEFINE(HAVE_STDARG_H, 0, [Define if you have the <stdarg.h> header file.])
10 AC_DEFINE(HAVE_NCURSES, 0, [Define if you have the <ncurses.h> header file.])
17 if test "x$U" != "x"; then
18 AC_MSG_ERROR(Compiler not ANSI compliant)
23 AC_CHECK_HEADERS(unistd.h locale.h termios.h linux/termios.h sys/ioctl.h)
24 AC_CHECK_HEADER(stdarg.h,AC_DEFINE(HAVE_STDARG_H),AC_MSG_ERROR([*** stdarg.h is missing on your system ***]))
26 AC_CHECK_FUNCS(setlocale)
28 dnl -------------------
29 dnl (n)curses detection
30 dnl -------------------
33 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
34 [if test $withval != yes; then
35 abook_cv_curses=$withval
37 if test x$abook_cv_curses != x/usr; then
38 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
39 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
42 AC_CHECK_LIB(ncurses, initscr,
43 [LIBS="$LIBS -lncurses"
44 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
45 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
47 AC_CHECK_HEADERS(ncurses.h)],
50 dnl --------------------------
51 dnl end of (n)curses detection
52 dnl --------------------------
54 dnl ------------------
55 dnl readline detection
56 dnl ------------------
58 abook_cv_readline=/usr
59 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
60 [if test $withval != yes; then
61 abook_cv_readline=$withval
63 if test x$abook_cv_readline != x/usr; then
64 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
65 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
70 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
71 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
74 dnl -------------------------
75 dnl end of readline detection
76 dnl -------------------------
78 AC_CHECK_FUNCS(resizeterm)
80 AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)],)
81 AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)],)
83 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
86 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
89 if test x$debug = xtrue; then
90 CPPFLAGS="-DDEBUG $CPPFLAGS"
94 if test x$GCC = xyes; then
95 CFLAGS="-Wall $CFLAGS"
98 AC_OUTPUT(Makefile abook.spec)