]> git.deb.at Git - pkg/abook.git/blob - configure.in
Fetch real Portuguese debconf translation
[pkg/abook.git] / configure.in
1 dnl abook configure.in
2
3 AC_INIT(abook.c)
4 AM_INIT_AUTOMAKE(abook, 0.6.0pre2)
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 AC_DEFUN([ABOOK_EXPAND_PREFIX], [
15         $1=$2
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
21                 )`
22 ])
23
24 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
25 localedir="\$(datadir)/locale"
26
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"
32 fi
33
34 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
35 AC_SUBST(localedir)
36
37 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
38
39 dnl ----------------------
40 dnl end of gettext support
41 dnl ----------------------
42
43 AC_PROG_CC
44 AC_ISC_POSIX
45 AM_C_PROTOTYPES
46 if test "x$U" != "x"; then
47         AC_MSG_ERROR(Compiler not ANSI compliant)
48 fi
49 AC_C_INLINE
50 AC_PROG_INSTALL
51 AC_HEADER_STDC
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 ***]))
54 AC_FUNC_STRCOLL
55 AC_CHECK_FUNCS(setlocale)
56
57 ac_widec_funcs=yes
58 AC_CHECK_HEADER(wchar.h,[
59         ac_have_wchar_h=yes
60         AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
61         [ac_have_wchar_h=no])
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)
65
66 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
67         ac_widec_possible=yes
68 else
69         ac_widec_possible=no
70 fi
71
72 dnl -------------------
73 dnl (n)curses detection
74 dnl -------------------
75
76 abook_cv_curses=/usr
77 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
78         [if test $withval != yes; then
79                 abook_cv_curses=$withval
80         fi
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"
84         fi])
85
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"
90         fi
91         AC_CHECK_HEADERS(ncurses.h)],[
92         ac_widec_possible=no
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"
97                 fi
98                 AC_CHECK_HEADERS(ncurses.h)],
99                 [CF_CURSES_LIBS])
100         ])
101
102 dnl --------------------------
103 dnl end of (n)curses detection
104 dnl --------------------------
105
106 dnl ------------------
107 dnl readline detection
108 dnl ------------------
109
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
114         fi
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"
118         fi])
119
120 AC_LIB_READLINE
121
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 ***])
124 fi
125
126 dnl -------------------------
127 dnl end of readline detection
128 dnl -------------------------
129
130 if test x$ac_widec_possible = xyes; then
131         AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
132 fi
133
134 AC_CHECK_FUNCS(resizeterm)
135
136 AC_CHECK_FUNCS(snprintf vsnprintf)
137
138 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
139         yes) debug=true ;;
140         no) debug=false ;;
141         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
142         esac], [debug=false])
143
144 if test x$debug = xtrue; then
145         CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
146         CFLAGS="-g $CFLAGS"
147 fi
148
149 if test x$GCC = xyes; then
150         CFLAGS="-Wall $CFLAGS"
151 fi
152
153 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)
154