]> git.deb.at Git - pkg/abook.git/blob - configure.in
mutt import filter changes
[pkg/abook.git] / configure.in
1 dnl abook configure.in
2
3 AC_INIT(abook.c)
4 AM_INIT_AUTOMAKE(abook, 0.5.1pre)
5 AM_CONFIG_HEADER(config.h)
6
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.])
11
12 AC_CANONICAL_HOST
13
14 AC_PROG_CC
15 AC_ISC_POSIX
16 AM_C_PROTOTYPES
17 if test "x$U" != "x"; then
18         AC_MSG_ERROR(Compiler not ANSI compliant)
19 fi
20 AC_C_INLINE
21 AC_PROG_INSTALL
22 AC_HEADER_STDC
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 ***]))
25 AC_FUNC_STRCOLL
26 AC_CHECK_FUNCS(setlocale)
27
28 dnl -------------------
29 dnl (n)curses detection
30 dnl -------------------
31
32 abook_cv_curses=/usr
33 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
34         [if test $withval != yes; then
35                 abook_cv_curses=$withval
36         fi
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"
40         fi])
41
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"
46         fi
47         AC_CHECK_HEADERS(ncurses.h)],
48         [CF_CURSES_LIBS])
49
50 dnl --------------------------
51 dnl end of (n)curses detection
52 dnl --------------------------
53
54 dnl ------------------
55 dnl readline detection
56 dnl ------------------
57
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
62         fi
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"
66         fi])
67
68 AC_LIB_READLINE
69
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 ***])
72 fi
73
74 dnl -------------------------
75 dnl end of readline detection
76 dnl -------------------------
77
78 AC_CHECK_FUNCS(resizeterm)
79
80 AC_CHECK_FUNC(snprintf, [AC_DEFINE(HAVE_SNPRINTF)],)
81 AC_CHECK_FUNC(vsnprintf, [AC_DEFINE(HAVE_VSNPRINTF)],)
82
83 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
84         yes) debug=true ;;
85         no) debug=false ;;
86         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
87         esac], [debug=false])
88
89 if test x$debug = xtrue; then
90         CPPFLAGS="-DDEBUG $CPPFLAGS"
91         CFLAGS="-g $CFLAGS"
92 fi
93
94 if test x$GCC = xyes; then
95         CFLAGS="-Wall $CFLAGS"
96 fi
97
98 AC_OUTPUT(Makefile abook.spec)
99