]> git.deb.at Git - pkg/abook.git/blob - configure.in
- correct a typo
[pkg/abook.git] / configure.in
1 dnl abook configure.in
2
3 AC_INIT(abook.c)
4 AM_INIT_AUTOMAKE(abook, 0.5.5pre1)
5 AM_CONFIG_HEADER(config.h)
6
7 dnl ---------------
8 dnl gettext support
9 dnl ---------------
10
11 AM_GNU_GETTEXT
12 AM_GNU_GETTEXT_VERSION(0.14.1)
13
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"
21 fi
22 AC_DEFINE_UNQUOTED(LOCALEDIR, "$localedir", [locale directory])
23 AC_SUBST(localedir)
24
25 dnl ----------------------
26 dnl end of gettext support
27 dnl ----------------------
28
29 AC_PROG_CC
30 AC_ISC_POSIX
31 AM_C_PROTOTYPES
32 if test "x$U" != "x"; then
33         AC_MSG_ERROR(Compiler not ANSI compliant)
34 fi
35 AC_C_INLINE
36 AC_PROG_INSTALL
37 AC_HEADER_STDC
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 ***]))
40 AC_FUNC_STRCOLL
41 AC_CHECK_FUNCS(setlocale)
42
43 ac_widec_funcs=yes
44 AC_CHECK_HEADER(wchar.h,[
45         ac_have_wchar_h=yes
46         AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
47         [ac_have_wchar_h=no])
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)
51
52 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
53         ac_widec_possible=yes
54 else
55         ac_widec_possible=no
56 fi
57
58 dnl -------------------
59 dnl (n)curses detection
60 dnl -------------------
61
62 abook_cv_curses=/usr
63 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
64         [if test $withval != yes; then
65                 abook_cv_curses=$withval
66         fi
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"
70         fi])
71
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"
76         fi
77         AC_CHECK_HEADERS(ncurses.h)],[
78         ac_widec_possible=no
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"
83                 fi
84                 AC_CHECK_HEADERS(ncurses.h)],
85                 [CF_CURSES_LIBS])
86         ])
87
88 dnl --------------------------
89 dnl end of (n)curses detection
90 dnl --------------------------
91
92 dnl ------------------
93 dnl readline detection
94 dnl ------------------
95
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
100         fi
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"
104         fi])
105
106 AC_LIB_READLINE
107
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 ***])
110 fi
111
112 dnl -------------------------
113 dnl end of readline detection
114 dnl -------------------------
115
116 if test x$ac_widec_possible = xyes; then
117         AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
118 fi
119
120 AC_CHECK_FUNCS(resizeterm)
121
122 AC_CHECK_FUNCS(snprintf vsnprintf)
123
124 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
125         yes) debug=true ;;
126         no) debug=false ;;
127         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
128         esac], [debug=false])
129
130 if test x$debug = xtrue; then
131         CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
132         CFLAGS="-g $CFLAGS"
133 fi
134
135 if test x$GCC = xyes; then
136         CFLAGS="-Wall $CFLAGS"
137 fi
138
139 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)
140