4 AM_INIT_AUTOMAKE(abook, 0.6.0pre2)
5 AM_CONFIG_HEADER(config.h)
12 AM_GNU_GETTEXT_VERSION(0.14.1)
14 AC_DEFUN([ABOOK_EXPAND_PREFIX], [
16 dnl expanding twice, since from autoconf 2.60 on, $datadir refers to
17 dnl $datarootdir which in turn refers to $prefix
18 $1=`( test "x$prefix" = xNONE && prefix="$ac_default_prefix"
19 eval tmp_abook_prefix=\""[$]$1"\"
20 eval echo $tmp_abook_prefix
24 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
25 localedir="\$(datadir)/locale"
27 AC_ARG_WITH(localedir,
28 [ --with-localedir=PATH Where the locale files are installed ])
29 if test "x$with_localedir" != "x"; then
30 abook_localedir="$with_localedir"
31 localedir="$with_localedir"
34 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
37 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
39 dnl ----------------------
40 dnl end of gettext support
41 dnl ----------------------
46 if test "x$U" != "x"; then
47 AC_MSG_ERROR(Compiler not ANSI compliant)
52 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h iconv.h)
53 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 ***]))
55 AC_CHECK_FUNCS(setlocale)
58 AC_CHECK_HEADER(wchar.h,[
60 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
62 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
63 AC_CHECK_DECLS(wcwidth)
64 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
66 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
72 dnl -------------------
73 dnl (n)curses detection
74 dnl -------------------
77 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
78 [if test $withval != yes; then
79 abook_cv_curses=$withval
81 if test x$abook_cv_curses != x/usr; then
82 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
83 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
86 AC_CHECK_LIB(ncursesw, initscr,
87 [LIBS="$LIBS -lncursesw"
88 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
89 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
91 AC_CHECK_HEADERS(ncurses.h)],[
93 AC_CHECK_LIB(ncurses, initscr,
94 [LIBS="$LIBS -lncurses"
95 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
96 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
98 AC_CHECK_HEADERS(ncurses.h)],
102 dnl --------------------------
103 dnl end of (n)curses detection
104 dnl --------------------------
106 dnl ------------------
107 dnl readline detection
108 dnl ------------------
110 abook_cv_readline=/usr
111 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
112 [if test $withval != yes; then
113 abook_cv_readline=$withval
115 if test x$abook_cv_readline != x/usr; then
116 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
117 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
122 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
123 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
126 dnl -------------------------
127 dnl end of readline detection
128 dnl -------------------------
130 if test x$ac_widec_possible = xyes; then
131 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
134 AC_CHECK_FUNCS(resizeterm)
136 AC_CHECK_FUNCS(snprintf vsnprintf)
138 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
141 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
142 esac], [debug=false])
144 if test x$debug = xtrue; then
145 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
149 if test x$GCC = xyes; then
150 CFLAGS="-Wall $CFLAGS"
153 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)