4 AM_INIT_AUTOMAKE(abook, 0.6.0pre1)
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"\" )`
21 dnl dnl Use this with autoconf >= 2.60
23 dnl ABOOK_EXPAND_PREFIX(abook_localedir, "$datarootdir/locale")
24 dnl localedir="\$(datarootdir)/locale"
27 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
28 localedir="\$(datadir)/locale"
30 AC_ARG_WITH(localedir,
31 [ --with-localedir=PATH Where the locale files are installed ])
32 if test "x$with_localedir" != "x"; then
33 abook_localedir="$with_localedir"
34 localedir="$with_localedir"
37 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
40 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
42 dnl ----------------------
43 dnl end of gettext support
44 dnl ----------------------
49 if test "x$U" != "x"; then
50 AC_MSG_ERROR(Compiler not ANSI compliant)
55 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h iconv.h)
56 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 ***]))
58 AC_CHECK_FUNCS(setlocale)
61 AC_CHECK_HEADER(wchar.h,[
63 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
65 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
66 AC_CHECK_DECLS(wcwidth)
67 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
69 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
75 dnl -------------------
76 dnl (n)curses detection
77 dnl -------------------
80 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
81 [if test $withval != yes; then
82 abook_cv_curses=$withval
84 if test x$abook_cv_curses != x/usr; then
85 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
86 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
89 AC_CHECK_LIB(ncursesw, initscr,
90 [LIBS="$LIBS -lncursesw"
91 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
92 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
94 AC_CHECK_HEADERS(ncurses.h)],[
96 AC_CHECK_LIB(ncurses, initscr,
97 [LIBS="$LIBS -lncurses"
98 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
99 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
101 AC_CHECK_HEADERS(ncurses.h)],
105 dnl --------------------------
106 dnl end of (n)curses detection
107 dnl --------------------------
109 dnl ------------------
110 dnl readline detection
111 dnl ------------------
113 abook_cv_readline=/usr
114 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
115 [if test $withval != yes; then
116 abook_cv_readline=$withval
118 if test x$abook_cv_readline != x/usr; then
119 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
120 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
125 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
126 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
129 dnl -------------------------
130 dnl end of readline detection
131 dnl -------------------------
133 if test x$ac_widec_possible = xyes; then
134 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
137 AC_CHECK_FUNCS(resizeterm)
139 AC_CHECK_FUNCS(snprintf vsnprintf)
141 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
144 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
145 esac], [debug=false])
147 if test x$debug = xtrue; then
148 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
152 if test x$GCC = xyes; then
153 CFLAGS="-Wall $CFLAGS"
156 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)