4 AM_INIT_AUTOMAKE(abook, 0.5.5)
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, "$datarootdir/locale")
21 localedir="\$(datarootdir)/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 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
35 dnl ----------------------
36 dnl end of gettext support
37 dnl ----------------------
42 if test "x$U" != "x"; then
43 AC_MSG_ERROR(Compiler not ANSI compliant)
48 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h iconv.h)
49 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 ***]))
51 AC_CHECK_FUNCS(setlocale)
54 AC_CHECK_HEADER(wchar.h,[
56 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
58 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
59 AC_CHECK_DECLS(wcwidth)
60 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
62 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
68 dnl -------------------
69 dnl (n)curses detection
70 dnl -------------------
73 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
74 [if test $withval != yes; then
75 abook_cv_curses=$withval
77 if test x$abook_cv_curses != x/usr; then
78 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
79 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
82 AC_CHECK_LIB(ncursesw, initscr,
83 [LIBS="$LIBS -lncursesw"
84 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
85 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
87 AC_CHECK_HEADERS(ncurses.h)],[
89 AC_CHECK_LIB(ncurses, initscr,
90 [LIBS="$LIBS -lncurses"
91 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
92 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
94 AC_CHECK_HEADERS(ncurses.h)],
98 dnl --------------------------
99 dnl end of (n)curses detection
100 dnl --------------------------
102 dnl ------------------
103 dnl readline detection
104 dnl ------------------
106 abook_cv_readline=/usr
107 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
108 [if test $withval != yes; then
109 abook_cv_readline=$withval
111 if test x$abook_cv_readline != x/usr; then
112 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
113 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
118 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
119 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
122 dnl -------------------------
123 dnl end of readline detection
124 dnl -------------------------
126 if test x$ac_widec_possible = xyes; then
127 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
130 AC_CHECK_FUNCS(resizeterm)
132 AC_CHECK_FUNCS(snprintf vsnprintf)
134 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
137 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
138 esac], [debug=false])
140 if test x$debug = xtrue; then
141 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
145 if test x$GCC = xyes; then
146 CFLAGS="-Wall $CFLAGS"
149 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)