]> git.deb.at Git - pkg/abook.git/blob - configure.in
readline tweaks
[pkg/abook.git] / configure.in
1 dnl abook configure.in
2
3 AC_INIT(abook.c)
4 AM_INIT_AUTOMAKE(abook, 2002-03-11)
5 AM_CONFIG_HEADER(config.h)
6
7 AC_CANONICAL_HOST
8
9 AC_PROG_CC
10 AC_ISC_POSIX
11 AM_C_PROTOTYPES
12 if test "x$U" != "x"; then
13         AC_MSG_ERROR(Compiler not ANSI compliant)
14 fi
15 AC_C_INLINE
16 AC_PROG_INSTALL
17 AC_HEADER_STDC
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 ***]))
20 AC_FUNC_STRCOLL
21 AC_CHECK_FUNCS(setlocale)
22
23 dnl -------------------
24 dnl (n)curses detection
25 dnl -------------------
26
27 abook_cv_curses=/usr
28 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
29         [if test $withval != yes; then
30                 abook_cv_curses=$withval
31         fi
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"
35         fi])
36
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"
41         fi
42         AC_CHECK_HEADERS(ncurses.h)],
43         [CF_CURSES_LIBS])
44
45 dnl --------------------------
46 dnl end of (n)curses detection
47 dnl --------------------------
48
49 AC_LIB_READLINE
50
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 ***])
53 fi
54
55 AC_CHECK_FUNCS(resizeterm)
56
57 AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)],)
58 AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)],)
59
60 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
61         yes) debug=true ;;
62         no) debug=false ;;
63         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
64         esac], [debug=false])
65
66 if test x$debug = xtrue; then
67         CPPFLAGS="-DDEBUG $CPPFLAGS"
68         CFLAGS="-g $CFLAGS"
69 fi
70
71 if test x$GCC = xyes; then
72         CFLAGS="-Wall $CFLAGS"
73 fi
74
75 AC_OUTPUT(Makefile)
76