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