4 AM_INIT_AUTOMAKE(abook, 0.5.5pre1)
5 AM_CONFIG_HEADER(config.h)
12 AM_GNU_GETTEXT_VERSION(0.14.1)
14 localedir="$ac_default_prefix/share/locale"
15 AC_ARG_WITH(localedir,
16 [ --with-localedir=PATH Where the locale files are installed ])
17 if test "x$with_localedir" != "x"; then
18 localedir="$with_localedir"
19 elif test "x${prefix}" != "xNONE"; then
20 localedir="$prefix/share/locale"
22 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", [locale directory])
25 dnl ----------------------
26 dnl end of gettext support
27 dnl ----------------------
32 if test "x$U" != "x"; then
33 AC_MSG_ERROR(Compiler not ANSI compliant)
38 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h)
39 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 ***]))
41 AC_CHECK_FUNCS(setlocale)
44 AC_CHECK_HEADER(wchar.h,[
46 AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
48 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
49 AC_CHECK_DECLS(wcwidth)
50 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
52 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
58 dnl -------------------
59 dnl (n)curses detection
60 dnl -------------------
63 AC_ARG_WITH(curses, [ --with-curses=DIR Where ncurses is installed ],
64 [if test $withval != yes; then
65 abook_cv_curses=$withval
67 if test x$abook_cv_curses != x/usr; then
68 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
69 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
72 AC_CHECK_LIB(ncursesw, initscr,
73 [LIBS="$LIBS -lncursesw"
74 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
75 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
77 AC_CHECK_HEADERS(ncurses.h)],[
79 AC_CHECK_LIB(ncurses, initscr,
80 [LIBS="$LIBS -lncurses"
81 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
82 CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
84 AC_CHECK_HEADERS(ncurses.h)],
88 dnl --------------------------
89 dnl end of (n)curses detection
90 dnl --------------------------
92 dnl ------------------
93 dnl readline detection
94 dnl ------------------
96 abook_cv_readline=/usr
97 AC_ARG_WITH(readline, [ --with-readline=DIR Where readline is installed ],
98 [if test $withval != yes; then
99 abook_cv_readline=$withval
101 if test x$abook_cv_readline != x/usr; then
102 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
103 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
108 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
109 AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
112 dnl -------------------------
113 dnl end of readline detection
114 dnl -------------------------
116 if test x$ac_widec_possible = xyes; then
117 AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
120 AC_CHECK_FUNCS(resizeterm)
122 AC_CHECK_FUNCS(snprintf vsnprintf)
124 AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging support ], [case "${enableval}" in
127 *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
128 esac], [debug=false])
130 if test x$debug = xtrue; then
131 CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
135 if test x$GCC = xyes; then
136 CFLAGS="-Wall $CFLAGS"
139 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)