]> git.deb.at Git - pkg/abook.git/blob - configure.in
Imported Upstream version 0.5.6+cvs1
[pkg/abook.git] / configure.in
1 dnl abook configure.in
2
3 AC_INIT(abook.c)
4 AM_INIT_AUTOMAKE(abook, 0.5.5)
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         $1=`(   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
17                 eval echo \""[$]$1"\"   )`
18 ])
19
20 ABOOK_EXPAND_PREFIX(abook_localedir, "$datarootdir/locale")
21 localedir="\$(datarootdir)/locale"
22
23 AC_ARG_WITH(localedir,
24         [  --with-localedir=PATH      Where the locale files are installed ])
25 if test "x$with_localedir" != "x"; then
26         abook_localedir="$with_localedir"
27         localedir="$with_localedir"
28 fi
29
30 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
31 AC_SUBST(localedir)
32
33 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
34
35 dnl ----------------------
36 dnl end of gettext support
37 dnl ----------------------
38
39 AC_PROG_CC
40 AC_ISC_POSIX
41 AM_C_PROTOTYPES
42 if test "x$U" != "x"; then
43         AC_MSG_ERROR(Compiler not ANSI compliant)
44 fi
45 AC_C_INLINE
46 AC_PROG_INSTALL
47 AC_HEADER_STDC
48 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h iconv.h)
49 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 ***]))
50 AC_FUNC_STRCOLL
51 AC_CHECK_FUNCS(setlocale)
52
53 ac_widec_funcs=yes
54 AC_CHECK_HEADER(wchar.h,[
55         ac_have_wchar_h=yes
56         AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
57         [ac_have_wchar_h=no])
58 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
59 AC_CHECK_DECLS(wcwidth)
60 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
61
62 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
63         ac_widec_possible=yes
64 else
65         ac_widec_possible=no
66 fi
67
68 dnl -------------------
69 dnl (n)curses detection
70 dnl -------------------
71
72 abook_cv_curses=/usr
73 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
74         [if test $withval != yes; then
75                 abook_cv_curses=$withval
76         fi
77         if test x$abook_cv_curses != x/usr; then
78                 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
79                 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
80         fi])
81
82 AC_CHECK_LIB(ncursesw, initscr,
83         [LIBS="$LIBS -lncursesw"
84         if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
85                 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
86         fi
87         AC_CHECK_HEADERS(ncurses.h)],[
88         ac_widec_possible=no
89         AC_CHECK_LIB(ncurses, initscr,
90                 [LIBS="$LIBS -lncurses"
91                 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
92                         CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
93                 fi
94                 AC_CHECK_HEADERS(ncurses.h)],
95                 [CF_CURSES_LIBS])
96         ])
97
98 dnl --------------------------
99 dnl end of (n)curses detection
100 dnl --------------------------
101
102 dnl ------------------
103 dnl readline detection
104 dnl ------------------
105
106 abook_cv_readline=/usr
107 AC_ARG_WITH(readline, [  --with-readline=DIR     Where readline is installed ],
108         [if test $withval != yes; then
109                 abook_cv_readline=$withval
110         fi
111         if test x$abook_cv_readline != x/usr; then
112                 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
113                 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
114         fi])
115
116 AC_LIB_READLINE
117
118 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
119         AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
120 fi
121
122 dnl -------------------------
123 dnl end of readline detection
124 dnl -------------------------
125
126 if test x$ac_widec_possible = xyes; then
127         AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
128 fi
129
130 AC_CHECK_FUNCS(resizeterm)
131
132 AC_CHECK_FUNCS(snprintf vsnprintf)
133
134 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
135         yes) debug=true ;;
136         no) debug=false ;;
137         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
138         esac], [debug=false])
139
140 if test x$debug = xtrue; then
141         CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
142         CFLAGS="-g $CFLAGS"
143 fi
144
145 if test x$GCC = xyes; then
146         CFLAGS="-Wall $CFLAGS"
147 fi
148
149 AC_OUTPUT(Makefile abook.spec intl/Makefile po/Makefile.in)
150