]> git.deb.at Git - pkg/abook.git/blob - configure.ac
misc: release notes updated
[pkg/abook.git] / configure.ac
1 dnl abook configure.in
2
3 AC_INIT
4 AC_CONFIG_SRCDIR([abook.c])
5 AM_INIT_AUTOMAKE(abook, 0.6.0pre2)
6 AC_CONFIG_HEADER(config.h)
7
8 dnl ---------------
9 dnl gettext support
10 dnl ---------------
11
12 AC_USE_SYSTEM_EXTENSIONS
13 AM_GNU_GETTEXT([external])
14 AM_GNU_GETTEXT_VERSION([0.18.1])
15
16 AC_DEFUN([ABOOK_EXPAND_PREFIX], [
17         $1=$2
18         dnl expanding twice, since from autoconf 2.60 on, $datadir refers to
19         dnl $datarootdir which in turn refers to $prefix
20         $1=`(   test "x$prefix" = xNONE && prefix="$ac_default_prefix"
21                 eval tmp_abook_prefix=\""[$]$1"\"
22                 eval echo $tmp_abook_prefix
23                 )`
24 ])
25
26 ABOOK_EXPAND_PREFIX(abook_localedir, "$datadir/locale")
27 localedir="\$(datadir)/locale"
28
29 AC_ARG_WITH(localedir,
30         [  --with-localedir=PATH      Where the locale files are installed ])
31 if test "x$with_localedir" != "x"; then
32         abook_localedir="$with_localedir"
33         localedir="$with_localedir"
34 fi
35
36 AC_DEFINE_UNQUOTED(LOCALEDIR, "$abook_localedir", [locale directory])
37 AC_SUBST(localedir)
38
39 AM_CONDITIONAL(USE_INCLUDED_INTL_H, test x$USE_INCLUDED_LIBINTL = xyes)
40
41 dnl ----------------------
42 dnl end of gettext support
43 dnl ----------------------
44
45 AC_PROG_CC
46 AC_SEARCH_LIBS([strerror],[cposix])
47 AM_C_PROTOTYPES
48 if test "x$U" != "x"; then
49         AC_MSG_ERROR(Compiler not ANSI compliant)
50 fi
51 AC_C_INLINE
52 AC_PROG_INSTALL
53 AC_HEADER_STDC
54 AC_CHECK_HEADERS(unistd.h locale.h sys/ioctl.h iconv.h)
55 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 ***]))
56 AC_FUNC_STRCOLL
57 AC_CHECK_FUNCS(setlocale)
58
59 ac_widec_funcs=yes
60 AC_CHECK_HEADER(wchar.h,[
61         ac_have_wchar_h=yes
62         AC_DEFINE(HAVE_WCHAR_H, 1, [Define if you have the <wchar.h> header file.])],
63         [ac_have_wchar_h=no])
64 AC_CHECK_FUNCS(mbtowc wcwidth mbrtowc mbsinit,,ac_widec_funcs=no)
65 AC_CHECK_DECLS(wcwidth)
66 AC_CHECK_TYPE(wchar_t,,ac_widec_funcs=no)
67
68 if test x$ac_widec_funcs = xyes -a x$ac_have_wchar_h = xyes; then
69         ac_widec_possible=yes
70 else
71         ac_widec_possible=no
72 fi
73
74 dnl -------------------
75 dnl (n)curses detection
76 dnl -------------------
77
78 abook_cv_curses=/usr
79 AC_ARG_WITH(curses, [  --with-curses=DIR       Where ncurses is installed ],
80         [if test $withval != yes; then
81                 abook_cv_curses=$withval
82         fi
83         if test x$abook_cv_curses != x/usr; then
84                 LDFLAGS="-L${abook_cv_curses}/lib $LDFLAGS"
85                 CPPFLAGS="$CPPFLAGS -I${abook_cv_curses}/include"
86         fi])
87
88 AC_CHECK_LIB(ncursesw, initscr,
89         [LIBS="$LIBS -lncursesw"
90         if test x$abook_cv_curses = x/usr -a -d /usr/include/ncursesw; then
91                 CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"
92         fi
93         AC_CHECK_HEADERS(ncurses.h)],[
94         ac_widec_possible=no
95         AC_CHECK_LIB(ncurses, initscr,
96                 [LIBS="$LIBS -lncurses"
97                 if test x$abook_cv_curses = x/usr -a -d /usr/include/ncurses; then
98                         CPPFLAGS="$CPPFLAGS -I/usr/include/ncurses"
99                 fi
100                 AC_CHECK_HEADERS(ncurses.h)],
101                 [CF_CURSES_LIBS])
102         ])
103
104 dnl --------------------------
105 dnl end of (n)curses detection
106 dnl --------------------------
107
108 dnl ------------------
109 dnl readline detection
110 dnl ------------------
111
112 abook_cv_readline=/usr
113 AC_ARG_WITH(readline, [  --with-readline=DIR     Where readline is installed ],
114         [if test $withval != yes; then
115                 abook_cv_readline=$withval
116         fi
117         if test x$abook_cv_readline != x/usr; then
118                 LDFLAGS="-L${abook_cv_readline}/lib $LDFLAGS"
119                 CPPFLAGS="$CPPFLAGS -I${abook_cv_readline}/include"
120         fi])
121
122 AC_LIB_READLINE
123
124 if test x$ac_cv_lib_readline = xno -o x$ac_cv_lib_readline_history = xno; then
125         AC_MSG_ERROR([*** readline library not found or it doesn't support history ***])
126 fi
127
128 dnl -------------------------
129 dnl end of readline detection
130 dnl -------------------------
131
132 dnl ------------------
133 dnl vformat detection
134 dnl ------------------
135
136 AC_ARG_ENABLE(vformat, [  --enable-vformat          Use libvformat is available ], [case "${enableval}" in
137         yes) vformat=true ;;
138         no) vformat=false ;;
139         *) AC_MSG_ERROR(bad value ${enableval} for --enable-vformat) ;;
140         esac], [vformat=false])
141 if test x$vformat = xtrue; then
142    AC_CHECK_HEADER([vf_iface.h], [
143      AC_CHECK_LIB([vformat], [vf_read_file], [
144      MODULES="$MODULES m_vcf"
145      AC_DEFINE(HAVE_VFORMAT,1,[Defined if the vformat library is available])
146      have_vformat=yes
147   ])
148 ])
149 fi
150 AM_CONDITIONAL(ENABLE_VFORMAT_SUPPORT,test x"$have_vformat" = "xyes")
151
152 dnl -------------------------
153 dnl end of vformat detection
154 dnl -------------------------
155
156
157 if test x$ac_widec_possible = xyes; then
158         AC_DEFINE(HANDLE_MULTIBYTE, 1, [Handle multibyte characters])
159 fi
160
161 AC_CHECK_FUNCS(resizeterm)
162
163 AC_CHECK_FUNCS(snprintf vsnprintf)
164
165 AC_CHECK_FUNCS(strcasestr, AC_DEFINE(HAVE_STRCASESTR))
166
167 AC_ARG_ENABLE(debug, [  --enable-debug          Enable debugging support ], [case "${enableval}" in
168         yes) debug=true ;;
169         no) debug=false ;;
170         *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
171         esac], [debug=false])
172
173 if test x$debug = xtrue; then
174         CPPFLAGS="-DDEBUG=1 $CPPFLAGS"
175         CFLAGS="-g $CFLAGS"
176 fi
177
178 if test x$GCC = xyes; then
179         CFLAGS="-Wall $CFLAGS"
180 fi
181
182 AC_CONFIG_FILES([Makefile abook.spec po/Makefile.in])
183 AC_OUTPUT