4 AM_INIT_AUTOMAKE(abook, 0.5.5pre1)
5 AM_CONFIG_HEADER(config.h)
12 AM_GNU_GETTEXT_VERSION(0.14.1)
14 AC_DEFUN([ABOOK_EXPAND_PREFIX], [
16 $1=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix"
17 eval echo \""[$]$1"\" )`
20 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
21 localedir="\$(datadir)/locale"
23 AC_ARG_WITH(localedir,
24 [ --with-localedir=PATH Where the locale files are installed ])
25 if test "x$with_localedir" != "x"; then
26 abook_localedir="$with_localedir"
27 localedir="$with_localedir"
30 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
33 dnl ----------------------
34 dnl end of gettext support
35 dnl ----------------------
40 if test "x$U" != "x"; then
41 AC_MSG_ERROR(Compiler not ANSI compliant)
46 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h)
47 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 ***]))
49 AC_CHECK_FUNCS(setlocale)
52 AC_CHECK_HEADER(wchar.h,[
54 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
56 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
57 AC_CHECK_DECLS(wcwidth)
58 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
60 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
66 dnl -------------------
67 dnl (n)curses detection
68 dnl -------------------
71 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
72 [if test $withval != yes; then
73 abook_cv_curses=$withval
75 if test x$abook_cv_curses != x/usr; then
76 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
77 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
80 AC_CHECK_LIB(ncursesw, initscr,
81 [LIBS="$LIBS -lncursesw"
82 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
83 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
85 AC_CHECK_HEADERS(ncurses.h)],[
87 AC_CHECK_LIB(ncurses, initscr,
88 [LIBS="$LIBS -lncurses"
89 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
90 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
92 AC_CHECK_HEADERS(ncurses.h)],
96 dnl --------------------------
97 dnl end of (n)curses detection
98 dnl --------------------------
100 dnl ------------------
101 dnl readline detection
102 dnl ------------------
104 abook_cv_readline=/usr
105 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
106 [if test $withval != yes; then
107 abook_cv_readline=$withval
109 if test x$abook_cv_readline != x/usr; then
110 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
111 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
116 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
117 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
120 dnl -------------------------
121 dnl end of readline detection
122 dnl -------------------------
124 if test x$ac_widec_possible = xyes; then
125 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
128 AC_CHECK_FUNCS(resizeterm)
130 AC_CHECK_FUNCS(snprintf vsnprintf)
132 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
135 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
136 esac], [debug=false])
138 if test x$debug = xtrue; then
139 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
143 if test x$GCC = xyes; then
144 CFLAGS="-Wall $CFLAGS"
147 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)