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