4 AM_INIT_AUTOMAKE(abook, 0.5.4)
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 sys/ioctl.h)
19 AC_CHECK_HEADER(stdarg.h,AC_DEFINE(HAVE_STDARG_H, 1, [Define if you have the <stdarg.h> header file.]),AC_MSG_ERROR([*** stdarg.h is missing on your system ***]))
21 AC_CHECK_FUNCS(setlocale)
24 AC_CHECK_HEADER(wchar.h,[
26 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
28 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
29 AC_CHECK_DECLS(wcwidth)
30 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
32 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
38 dnl -------------------
39 dnl (n)curses detection
40 dnl -------------------
43 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
44 [if test $withval != yes; then
45 abook_cv_curses=$withval
47 if test x$abook_cv_curses != x/usr; then
48 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
49 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
52 AC_CHECK_LIB(ncursesw, initscr,
53 [LIBS="$LIBS -lncursesw"
54 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
55 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
57 AC_CHECK_HEADERS(ncurses.h)],[
59 AC_CHECK_LIB(ncurses, initscr,
60 [LIBS="$LIBS -lncurses"
61 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
62 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
64 AC_CHECK_HEADERS(ncurses.h)],
68 dnl --------------------------
69 dnl end of (n)curses detection
70 dnl --------------------------
72 dnl ------------------
73 dnl readline detection
74 dnl ------------------
76 abook_cv_readline=/usr
77 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
78 [if test $withval != yes; then
79 abook_cv_readline=$withval
81 if test x$abook_cv_readline != x/usr; then
82 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
83 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
88 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
89 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
92 dnl -------------------------
93 dnl end of readline detection
94 dnl -------------------------
96 if test x$ac_widec_possible = xyes; then
97 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
100 AC_CHECK_FUNCS(resizeterm)
102 AC_CHECK_FUNCS(snprintf vsnprintf)
104 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
107 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
108 esac], [debug=false])
110 if test x$debug = xtrue; then
111 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
115 if test x$GCC = xyes; then
116 CFLAGS="-Wall $CFLAGS"
119 AC_OUTPUT(Makefile abook.spec)