mutt stable branch with some hacks
1dnl Process this file with autoconf to produce a configure script.
2
3dnl !!! WHEN ADDING NEW CONFIGURE TESTS, PLEASE ADD CODE TO MAIN.C !!!
4dnl !!! TO DUMP THEIR RESULTS WHEN MUTT -V IS CALLED !!!
5
6AC_INIT([mutt],[m4_esyscmd(tr -d \\n <VERSION)])
7AC_CONFIG_SRCDIR(mutt.h)
8AM_INIT_AUTOMAKE
9AC_CONFIG_HEADERS([config.h])
10
11AC_SUBST([CONFIG_STATUS_DEPENDENCIES], ['$(top_srcdir)/VERSION'])
12
13AC_USE_SYSTEM_EXTENSIONS
14
15ALL_LINGUAS="de eu ru it es uk fr pl nl cs id sk ko el zh_TW zh_CN pt_BR eo gl sv da lt tr ja hu et ca bg ga fi"
16
17AC_CANONICAL_HOST
18
19AC_MSG_CHECKING([for prefix])
20if test x$prefix = xNONE; then
21 mutt_cv_prefix=$ac_default_prefix
22else
23 mutt_cv_prefix=$prefix
24fi
25AC_MSG_RESULT($mutt_cv_prefix)
26
27AC_PROG_CC
28AC_PROG_CC_C99
29AC_SEARCH_LIBS([strerror],[cposix])
30if test "x$U" != "x"; then
31 AC_MSG_ERROR(Compiler not ANSI compliant)
32fi
33AC_PROG_CPP
34AC_PROG_MAKE_SET
35AC_PROG_INSTALL
36AC_PROG_MKDIR_P
37AC_PROG_RANLIB
38AC_CHECK_TOOL(AR, ar, ar)
39
40AC_CACHE_CHECK([for GNU make],
41 [mutt_cv_gnu_make_command],
42 [mutt_cv_gnu_make_command="no"
43 if ${MAKE:-make} --version 2> /dev/null | grep "GNU Make" 2>&1 > /dev/null ; then
44 mutt_cv_gnu_make_command="yes"
45 fi])
46AM_CONDITIONAL(GNU_MAKE, test x$mutt_cv_gnu_make_command = xyes)
47
48AC_C_INLINE
49AC_C_CONST
50AC_C_BIGENDIAN
51
52AC_SYS_LARGEFILE
53AC_FUNC_FSEEKO
54AC_CHECK_SIZEOF(off_t)
55
56AC_PATH_PROG(DBX, dbx, no)
57AC_PATH_PROG(GDB, gdb, no)
58AC_PATH_PROG(SDB, sdb, no)
59
60if test $GDB != no ; then
61 DEBUGGER=$GDB
62elif test $DBX != no ; then
63 DEBUGGER=$DBX
64elif test $SDB != no ; then
65 DEBUGGER=$SDB
66else
67 DEBUGGER=no
68fi
69
70AC_SUBST([DEBUGGER])
71
72AH_TEMPLATE([sig_atomic_t],
73 [/* Define to `int' if <signal.h> doesn't define.])
74AH_TEMPLATE([HAVE_START_COLOR],
75 [Define if you have start_color, as a function or macro.])
76AH_TEMPLATE([HAVE_TYPEAHEAD],
77 [Define if you have typeahead, as a function or macro.])
78AH_TEMPLATE([HAVE_BKGDSET],
79 [Define if you have bkgdset, as a function or macro.])
80AH_TEMPLATE([HAVE_CURS_SET],
81 [Define if you have curs_set, as a function or macro.])
82AH_TEMPLATE([HAVE_META],
83 [Define if you have meta, as a function or macro.])
84AH_TEMPLATE([HAVE_USE_DEFAULT_COLORS],
85 [Define if you have use_default_colors, as a function or macro.])
86AH_TEMPLATE([HAVE_RESIZETERM],
87 [Define if you have resizeterm, as a function or macro.])
88AH_TEMPLATE([SIG_ATOMIC_VOLATILE_T],
89 [Some systems declare sig_atomic_t as volatile, some others -- no.
90 This define will have value `sig_atomic_t' or
91 `volatile sig_atomic_t' accordingly.])
92AH_TEMPLATE([ICONV_NONTRANS],
93 [Define as 1 if iconv() only converts exactly and we should treat
94 all return values other than (size_t)(-1) as equivalent.])
95
96AH_BOTTOM([/* fseeko portability defines */
97#ifdef HAVE_FSEEKO
98# define LOFF_T off_t
99# if HAVE_C99_INTTYPES && HAVE_INTTYPES_H
100# if SIZEOF_OFF_T == 8
101# define OFF_T_FMT "%" PRId64
102# else
103# define OFF_T_FMT "%" PRId32
104# endif
105# else
106# if (SIZEOF_OFF_T == 8) && (SIZEOF_LONG == 4)
107# define OFF_T_FMT "%lld"
108# else
109# define OFF_T_FMT "%ld"
110# endif
111# endif
112#else
113# define LOFF_T long
114# define fseeko fseek
115# define ftello ftell
116# define OFF_T_FMT "%ld"
117#endif
118])
119MUTT_C99_INTTYPES
120AC_TYPE_LONG_LONG_INT
121
122ac_aux_path_sendmail=/usr/sbin:/usr/lib
123AC_PATH_PROG(SENDMAIL, sendmail, /usr/sbin/sendmail, $PATH:$ac_aux_path_sendmail)
124AC_DEFINE_UNQUOTED(SENDMAIL,"$ac_cv_path_SENDMAIL", [Where to find sendmail on your system.])
125
126OPS='$(srcdir)/OPS'
127
128AC_ARG_WITH(sqlite3,
129 AS_HELP_STRING([--with-sqlite3@<:@=PFX@:>@],
130 [Enable sqlite3 support. Required by autocrypt.]),
131 [],
132 [with_sqlite3=no])
133if test x$with_sqlite3 != xno; then
134 if test x$with_sqlite3 != xyes; then
135 LDFLAGS="$LDFLAGS -L$with_sqlite3/lib"
136 CPPFLAGS="$CPPFLAGS -I$with_sqlite3/include"
137 fi
138 saved_LIBS="$LIBS"
139
140 AC_CHECK_LIB(sqlite3, sqlite3_open, [],
141 AC_MSG_ERROR([Unable to find sqlite3 library]))
142
143 LIBS="$saved_LIBS"
144 MUTTLIBS="$MUTTLIBS -lsqlite3"
145fi
146
147AC_ARG_ENABLE(autocrypt,
148 AS_HELP_STRING([--enable-autocrypt],[Enable autocrypt support]),
149 [],
150 [enable_autocrypt=no])
151if test x$enable_autocrypt = xyes; then
152 if test x$with_sqlite3 = xno; then
153 AC_MSG_ERROR([autocrypt requires --with-sqlite3])
154 fi
155 AC_DEFINE(USE_AUTOCRYPT,1,[ Define if you want support for autocrypt. ])
156 LIBAUTOCRYPT="-Lautocrypt -lautocrypt"
157 LIBAUTOCRYPTDEPS="\$(top_srcdir)/autocrypt/autocrypt.h autocrypt/libautocrypt.a"
158 mutt_enable_gpgme=yes
159 echo "enabling autocrypt..."
160 mutt_gpgme_version="1.8.0"
161 echo "Note: autocrypt requires GPGME version $mutt_gpgme_version or greater"
162fi
163AM_CONDITIONAL(BUILD_AUTOCRYPT, test x$enable_autocrypt = xyes)
164AC_SUBST(LIBAUTOCRYPT)
165AC_SUBST(LIBAUTOCRYPTDEPS)
166
167if test x$mutt_enable_gpgme != xyes; then
168 AC_ARG_ENABLE(gpgme, AS_HELP_STRING([--enable-gpgme],[Enable GPGME support]),
169 [ if test x$enableval = xyes; then
170 mutt_enable_gpgme=yes
171 mutt_gpgme_version="1.4.0"
172 fi
173 ])
174fi
175
176AC_MSG_CHECKING([whether to build with GPGME support])
177if test x"$mutt_enable_gpgme" = xyes; then
178 AC_MSG_RESULT(yes)
179 AM_PATH_GPGME([$mutt_gpgme_version], AC_DEFINE(CRYPT_BACKEND_GPGME, 1,
180 [Defined, if GPGME support is enabled]),
181 [gpgme_found=no])
182 if test x"$gpgme_found" = xno; then
183 AC_MSG_ERROR([*** GPGME not found or version is older than $mutt_gpgme_version ***])
184 else
185 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS crypt-gpgme.o crypt-mod-pgp-gpgme.o crypt-mod-smime-gpgme.o"
186 AM_PATH_GPG_ERROR(1.33)
187 fi
188else
189 AC_MSG_RESULT([no])
190fi
191
192AC_ARG_ENABLE(pgp, AS_HELP_STRING([--disable-pgp],[Disable PGP support]),
193[ if test x$enableval = xno ; then
194 have_pgp=no
195 fi
196])
197
198if test x$have_pgp != xno ; then
199 AC_DEFINE(CRYPT_BACKEND_CLASSIC_PGP,1, [Define if you want classic PGP support.])
200 PGPAUX_TARGET="mutt_pgpring\$(EXEEXT) pgpewrap\$(EXEEXT)"
201 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pgp.o pgpinvoke.o pgpkey.o pgplib.o gnupgparse.o pgpmicalg.o pgppacket.o crypt-mod-pgp-classic.o"
202fi
203
204AC_ARG_ENABLE(smime, AS_HELP_STRING([--disable-smime],[Disable SMIME support]),
205[ if test x$enableval = xno ; then
206 have_smime=no
207 fi
208])
209
210if test x$have_smime != xno ; then
211 AC_DEFINE(CRYPT_BACKEND_CLASSIC_SMIME, 1, [Define if you want classic S/MIME support.])
212 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smime.o crypt-mod-smime-classic.o"
213 SMIMEAUX_TARGET="smime_keys"
214fi
215
216AC_ARG_ENABLE(sidebar, AC_HELP_STRING([--enable-sidebar], [Enable Sidebar support]),
217[ if test x$enableval = xyes ; then
218 AC_DEFINE(USE_SIDEBAR, 1, [Define if you want support for the sidebar.])
219 OPS="$OPS \$(srcdir)/OPS.SIDEBAR"
220 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS sidebar.o"
221 fi
222])
223
224AC_ARG_ENABLE(compressed, AC_HELP_STRING([--enable-compressed], [Enable compressed folders support]),
225 enable_compressed=$enableval, enable_compressed=no
226)
227AS_IF([test x$enable_compressed = "xyes"], [
228 AC_DEFINE(USE_COMPRESSED, 1, [Define to enable compressed folders support.])
229 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS compress.o"
230])
231AM_CONDITIONAL(BUILD_COMPRESS, test x$enable_compressed = xyes)
232
233AC_ARG_WITH(mixmaster, AS_HELP_STRING([--with-mixmaster@<:@=PATH@:>@],[Include Mixmaster support]),
234 [if test "$withval" != no
235 then
236 if test -x "$withval"
237 then
238 MIXMASTER="$withval"
239 else
240 MIXMASTER="mixmaster"
241 fi
242 OPS="$OPS \$(srcdir)/OPS.MIX"
243 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS remailer.o"
244 AC_DEFINE_UNQUOTED(MIXMASTER,"$MIXMASTER", [Where to find mixmaster on your system.])
245 fi])
246
247# We now require all OPS
248OPS="$OPS \$(srcdir)/OPS.PGP \$(srcdir)/OPS.SMIME \$(srcdir)/OPS.CRYPT "
249AC_SUBST([OPS])
250
251AC_SUBST(PGPAUX_TARGET)
252AC_SUBST(SMIMEAUX_TARGET)
253
254AC_PATH_PROG(ISPELL, ispell, no)
255if test $ISPELL != no; then
256 AC_DEFINE_UNQUOTED(ISPELL,"$ISPELL",[ Where to find ispell on your system. ])
257fi
258
259AC_ARG_WITH(slang, AS_HELP_STRING([--with-slang@<:@=DIR@:>@],[Use S-Lang instead of ncurses]),
260 [AC_CACHE_CHECK([if this is a BSD system], mutt_cv_bsdish,
261 [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/param.h>
262#include <stdlib.h>
263
264main ()
265{
266#ifdef BSD
267 exit (0);
268#else
269 exit (1);
270#endif
271}]])],[mutt_cv_bsdish=yes],[mutt_cv_bsdish=no],[mutt_cv_bsdish=no])])
272
273 AC_MSG_CHECKING(for S-Lang)
274 if test $withval = yes; then
275 if test -d $srcdir/../slang; then
276 mutt_cv_slang=$srcdir/../slang/src
277 CPPFLAGS="$CPPFLAGS -I${mutt_cv_slang}"
278 LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
279 else
280 if test -d $mutt_cv_prefix/include/slang; then
281 CPPFLAGS="$CPPFLAGS -I$mutt_cv_prefix/include/slang"
282 elif test -d /usr/include/slang; then
283 CPPFLAGS="$CPPFLAGS -I/usr/include/slang"
284 fi
285 mutt_cv_slang=yes
286 fi
287 else
288 dnl ---Check to see if $withval is a source directory
289 if test -f $withval/src/slang.h; then
290 mutt_cv_slang=$withval/src
291 CPPFLAGS="$CPPFLAGS -I${mutt_cv_slang}"
292 LDFLAGS="$LDFLAGS -L${mutt_cv_slang}/objs"
293 else
294 dnl ---Must be installed somewhere
295 mutt_cv_slang=$withval
296 if test -d $withval/include/slang; then
297 CPPFLAGS="$CPPFLAGS -I${withval}/include/slang"
298 elif test -d $withval/include; then
299 CPPFLAGS="$CPPFLAGS -I${withval}/include"
300 fi
301 LDFLAGS="$LDFLAGS -L${withval}/lib"
302 fi
303 fi
304 AC_MSG_RESULT($mutt_cv_slang)
305 if test $mutt_cv_bsdish = yes; then
306 AC_CHECK_LIB(termlib, main)
307 fi
308 AC_DEFINE(USE_SLANG_CURSES,1,
309 [ Define if you compile with SLang instead of curses/ncurses. ])
310 AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ])
311 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
312
313 dnl --- now that we've found it, check the link
314
315 AC_CHECK_LIB(slang, SLtt_get_terminfo,
316 [MUTTLIBS="$MUTTLIBS -lslang -lm"],
317 [AC_MSG_ERROR(unable to compile. check config.log)], -lm)
318
319 ],
320
321 [mutt_cv_curses=/usr
322 AC_ARG_WITH(curses, AS_HELP_STRING([--with-curses=DIR],[Where ncurses is installed]),
323 [if test x$withval != xyes; then
324 mutt_cv_curses=$withval
325 fi
326 if test x$mutt_cv_curses != x/usr; then
327 LDFLAGS="$LDFLAGS -L${mutt_cv_curses}/lib"
328 CPPFLAGS="$CPPFLAGS -I${mutt_cv_curses}/include"
329 fi])
330
331 AC_CHECK_FUNC(initscr,,[
332 cf_ncurses="ncurses"
333 for lib in ncurses ncursesw
334 do
335 AC_CHECK_LIB($lib, waddnwstr, [cf_ncurses="$lib"; break])
336 done
337 AC_CHECK_LIB($cf_ncurses, initscr,
338 [MUTTLIBS="$MUTTLIBS -l$cf_ncurses"
339
340 if test "$cf_ncurses" = ncursesw; then
341 AC_CHECK_LIB(tinfow, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfow"],
342 AC_CHECK_LIB(tinfo, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfo"]))
343
344 AC_CHECK_HEADERS(ncursesw/ncurses.h,[cf_cv_ncurses_header="ncursesw/ncurses.h"],
345 [AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])])
346 else
347 AC_CHECK_LIB(tinfo, tgetent, [MUTTLIBS="$MUTTLIBS -ltinfo"])
348
349 AC_CHECK_HEADERS(ncurses/ncurses.h,[cf_cv_ncurses_header="ncurses/ncurses.h"],
350 [AC_CHECK_HEADERS(ncurses.h,[cf_cv_ncurses_header="ncurses.h"])])
351 fi],
352
353 [CF_CURSES_LIBS])
354 ])
355
356 old_LIBS="$LIBS"
357 LIBS="$LIBS $MUTTLIBS"
358 CF_CHECK_FUNCDECLS([#include <${cf_cv_ncurses_header-curses.h}>],
359 [start_color typeahead bkgdset curs_set meta use_default_colors resizeterm])
360 if test "$ac_cv_func_decl_start_color" = yes; then
361 AC_DEFINE(HAVE_COLOR,1,[ Define if your curses library supports color. ])
362 fi
363 if test "$ac_cv_func_decl_resizeterm" = yes; then
364 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS resize.o"
365 fi
366 AC_CHECK_FUNCS([use_extended_names])
367 LIBS="$old_LIBS"
368 ])
369
370AC_HEADER_STDC
371
372AC_CHECK_HEADERS(stdarg.h sys/ioctl.h ioctl.h sysexits.h)
373AC_CHECK_HEADERS(sys/time.h sys/resource.h)
374AC_CHECK_HEADERS(unix.h)
375
376AC_CHECK_FUNCS(setrlimit getsid)
377AC_CHECK_FUNCS(fgets_unlocked fgetc_unlocked)
378
379AC_MSG_CHECKING(for sig_atomic_t in signal.h)
380AC_EGREP_HEADER(sig_atomic_t,signal.h,
381 [
382 ac_cv_type_sig_atomic_t=yes;
383 AC_EGREP_HEADER(volatile.*sig_atomic_t,
384 signal.h,
385 [
386 is_sig_atomic_t_volatile=yes;
387 AC_MSG_RESULT([yes, volatile])
388 ],
389 [
390 is_sig_atomic_t_volatile=no;
391 AC_MSG_RESULT([yes, non volatile])
392 ])
393 ],
394 [
395 AC_MSG_RESULT(no)
396 AC_CHECK_TYPE(sig_atomic_t, int)
397 is_sig_atomic_t_volatile=no
398 ])
399if test $is_sig_atomic_t_volatile = 'yes'
400then
401 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, sig_atomic_t)
402else
403 AC_DEFINE(SIG_ATOMIC_VOLATILE_T, [volatile sig_atomic_t])
404fi
405
406AC_CHECK_DECLS([sys_siglist],[],[],[#include <signal.h>
407/* NetBSD declares sys_siglist in unistd.h. */
408#ifdef HAVE_UNISTD_H
409# include <unistd.h>
410#endif
411])
412
413
414AC_TYPE_PID_T
415AC_CHECK_TYPE(ssize_t, int)
416
417AC_CHECK_FUNCS(fgetpos memmove setegid srand48 strerror)
418
419AC_REPLACE_FUNCS([setenv strcasecmp strdup strsep strtok_r wcscasecmp])
420AC_REPLACE_FUNCS([strcasestr mkdtemp])
421
422AC_CHECK_FUNC(getopt)
423if test $ac_cv_func_getopt = yes; then
424 AC_CHECK_HEADERS(getopt.h)
425fi
426
427SNPRINTFOBJS=""
428AC_CHECK_FUNC(snprintf, [mutt_cv_func_snprintf=yes], [mutt_cv_func_snprintf=no])
429AC_CHECK_FUNC(vsnprintf, [mutt_cv_func_vsnprintf=yes], [mutt_cv_func_vsnprintf=no])
430if test $mutt_cv_func_snprintf = yes; then
431AC_CACHE_CHECK([whether your system's snprintf is C99 compliant],
432 [mutt_cv_c99_snprintf],
433 AC_RUN_IFELSE([AC_LANG_SOURCE([[
434#include <stdio.h>
435int main()
436{
437changequote(, )dnl
438 char buf[8];
439 int len = snprintf(buf, 4, "1234567");
440 return (len != 7 || buf[3] != '\0');
441changequote([, ])dnl
442}
443 ]])],[mutt_cv_c99_snprintf=yes],[mutt_cv_c99_snprintf=no],[mutt_cv_c99_snprintf=no]))
444else
445 mutt_cv_c99_snprintf=no
446fi
447if test $mutt_cv_func_vsnprintf = yes; then
448AC_CACHE_CHECK([whether your system's vsnprintf is C99 compliant],
449 [mutt_cv_c99_vsnprintf],
450 AC_RUN_IFELSE([AC_LANG_SOURCE([[
451#include <stdarg.h>
452#include <stdio.h>
453int foo(const char *fmt, ...)
454{
455changequote(, )dnl
456 char buf[8];
457 int len;
458 va_list ap;
459 va_start(ap, fmt);
460 len = vsnprintf(buf, 4, fmt, ap);
461 va_end(ap);
462 return (len != 7 || buf[3] != '\0');
463changequote([, ])dnl
464}
465
466int main()
467{
468 return foo("%s", "1234567");
469}
470 ]])],[mutt_cv_c99_vsnprintf=yes],[mutt_cv_c99_vsnprintf=no],[mutt_cv_c99_vsnprintf=no]))
471else
472 mutt_cv_c99_vsnprintf=no
473fi
474if test $mutt_cv_c99_snprintf = yes; then
475 AC_DEFINE(HAVE_SNPRINTF, 1, [ Define to 1 if you have a C99 compliant snprintf function. ])
476fi
477if test $mutt_cv_c99_vsnprintf = yes; then
478 AC_DEFINE(HAVE_VSNPRINTF, 1, [ Define to 1 if you have a C99 compliant vsnprintf function. ])
479fi
480if test $mutt_cv_c99_snprintf = no -o $mutt_cv_c99_vsnprintf = no; then
481 AC_LIBOBJ(snprintf)
482fi
483
484XIPH_FUNC_VA_COPY
485
486dnl SCO uses chsize() instead of ftruncate()
487AC_CHECK_FUNCS(ftruncate, , [AC_CHECK_LIB(x, chsize)])
488
489dnl SCO has strftime() in libintl
490AC_CHECK_FUNCS(strftime, , [AC_CHECK_LIB(intl, strftime)])
491
492dnl Set the atime of files
493AC_CHECK_FUNCS(futimens)
494
495dnl Check for struct timespec
496AC_CHECK_TYPES([struct timespec],,,[[#include <time.h>]])
497
498dnl Check for stat nanosecond resolutions
499AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec,
500 struct stat.st_mtim.tv_nsec,
501 struct stat.st_ctim.tv_nsec],,,[[#include <sys/stat.h>]])
502
503dnl Check for utimesnsat
504AC_CHECK_FUNCS(utimensat)
505
506dnl Check for clock_gettime
507AC_CHECK_FUNCS(clock_gettime)
508
509dnl AIX may not have fchdir()
510AC_CHECK_FUNCS(fchdir, , [mutt_cv_fchdir=no])
511
512AC_ARG_WITH(bundled-regex,
513 AS_HELP_STRING([--with-bundled-regex],[Use the bundled GNU regex library]),
514 [mutt_cv_regex=yes],
515 [AC_CHECK_FUNCS(regcomp, mutt_cv_regex=no, mutt_cv_regex=yes)])
516
517if test $mutt_cv_regex = no ; then
518AC_CACHE_CHECK([whether your system's regexp library is completely broken],
519 [mutt_cv_regex_broken],
520 AC_RUN_IFELSE([AC_LANG_SOURCE([[
521#include <unistd.h>
522#include <regex.h>
523int main() {
524 regex_t blah;
525 regmatch_t p;
526 p.rm_eo = p.rm_eo;
527 if (regcomp(&blah, "foo.*bar", REG_NOSUB) ||
528 regexec(&blah, "foobar", 0, NULL, 0))
529 return(1);
530 regfree(&blah);
531 return(0);
532}]])],
533 [mutt_cv_regex_broken=no],
534 [mutt_cv_regex_broken=yes],
535 [mutt_cv_regex_broken=yes]))
536
537 if test $mutt_cv_regex_broken = yes ; then
538 echo "Using the included GNU regex instead." >&AS_MESSAGE_FD
539 mutt_cv_regex=yes
540 fi
541fi
542
543if test $mutt_cv_regex = yes; then
544 AC_DEFINE(USE_GNU_REGEX,1,[ Define if you want to use the included regex.c. ])
545 AC_LIBOBJ(regex)
546fi
547
548
549AC_ARG_WITH(homespool,
550 AS_HELP_STRING([--with-homespool@<:@=FILE@:>@],[File in user's directory where new mail is spooled]), with_homespool=${withval})
551if test x$with_homespool != x; then
552 if test $with_homespool = yes; then
553 with_homespool=mailbox
554 fi
555 AC_DEFINE_UNQUOTED(MAILPATH,"$with_homespool",[ Where new mail is spooled. ])
556 AC_DEFINE(HOMESPOOL,1,
557 [Is mail spooled to the user's home directory? If defined,
558 MAILPATH should be set to the filename of the spool mailbox
559 relative the the home directory.
560 use: configure --with-homespool=FILE])
561 AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ])
562 mutt_cv_setgid=no
563else
564 AC_ARG_WITH(mailpath, AS_HELP_STRING([--with-mailpath=DIR],[Directory where spool mailboxes are located]),
565 [mutt_cv_mailpath=$withval],
566 [ AC_CACHE_CHECK(where new mail is stored, mutt_cv_mailpath,
567 [mutt_cv_mailpath=no
568 if test -d /var/mail; then
569 mutt_cv_mailpath=/var/mail
570 elif test -d /var/spool/mail; then
571 mutt_cv_mailpath=/var/spool/mail
572 elif test -d /usr/spool/mail; then
573 mutt_cv_mailpath=/usr/spool/mail
574 elif test -d /usr/mail; then
575 mutt_cv_mailpath=/usr/mail
576 fi])
577 ])
578 if test "$mutt_cv_mailpath" = no; then
579 AC_MSG_ERROR("Could not determine where new mail is stored.")
580 fi
581 AC_DEFINE_UNQUOTED(MAILPATH,"$mutt_cv_mailpath",[ Where new mail is spooled. ])
582
583 AC_CACHE_CHECK(if $mutt_cv_mailpath is world writable, mutt_cv_worldwrite, [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
584#include <sys/stat.h>
585#include <stdlib.h>
586
587int main (int argc, char **argv)
588{
589 struct stat s;
590
591 if (stat ("$mutt_cv_mailpath", &s)) exit (1);
592 if (s.st_mode & S_IWOTH) exit (0);
593 exit (1);
594}]])],[mutt_cv_worldwrite=yes],[mutt_cv_worldwrite=no],[mutt_cv_worldwrite=no])])
595
596 mutt_cv_setgid=no
597 if test $mutt_cv_worldwrite = yes; then
598 AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ])
599 else
600
601 AC_CACHE_CHECK(if $mutt_cv_mailpath is group writable, mutt_cv_groupwrite, [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <sys/types.h>
602#include <sys/stat.h>
603#include <stdlib.h>
604
605int main (int argc, char **argv)
606{
607 struct stat s;
608
609 if (stat ("$mutt_cv_mailpath", &s)) exit (1);
610 if (s.st_mode & S_IWGRP) exit (0);
611 exit (1);
612}]])],[mutt_cv_groupwrite=yes],[mutt_cv_groupwrite=no],[mutt_cv_groupwrite=no])])
613
614 if test $mutt_cv_groupwrite = yes; then
615 AC_DEFINE(USE_DOTLOCK,1,[ Define to use dotlocking for mailboxes. ])
616 AC_DEFINE(USE_SETGID,1,[ Define if mutt should run setgid "mail". ])
617 mutt_cv_setgid=yes
618 fi
619 fi
620fi
621
622AC_ARG_ENABLE(external_dotlock, AS_HELP_STRING([--enable-external-dotlock],[Force use of an external dotlock program]),
623 [mutt_cv_external_dotlock="$enableval"])
624
625if test "x$mutt_cv_setgid" = "xyes" || test "x$mutt_cv_fchdir" = "xno" \
626 || test "x$mutt_cv_external_dotlock" = "xyes"
627then
628 AC_DEFINE(DL_STANDALONE,1,[ Define if you want to use an external dotlocking program. ])
629 DOTLOCK_TARGET="mutt_dotlock\$(EXEEXT)"
630else
631 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS dotlock.o"
632fi
633
634AC_SUBST(DOTLOCK_TARGET)
635
636dnl autoconf <2.60 compatibility
637if test -z "$datarootdir"; then
638 datarootdir='${prefix}/share'
639fi
640AC_SUBST([datarootdir])
641
642AC_MSG_CHECKING(where to put the documentation)
643AC_ARG_WITH(docdir, AS_HELP_STRING([--with-docdir=PATH],[Specify where to put the documentation]),
644 [mutt_cv_docdir=$withval],
645 [mutt_cv_docdir='${datarootdir}/doc/mutt'])
646AC_MSG_RESULT($mutt_cv_docdir)
647if test -z "$docdir" -o -n "$with_docdir"
648then
649 docdir=$mutt_cv_docdir
650fi
651AC_SUBST(docdir)
652
653if test x$mutt_cv_setgid = xyes; then
654 DOTLOCK_GROUP='mail'
655 DOTLOCK_PERMISSION=2755
656else
657 DOTLOCK_GROUP=''
658 DOTLOCK_PERMISSION=755
659fi
660AC_SUBST(DOTLOCK_GROUP)
661AC_SUBST(DOTLOCK_PERMISSION)
662
663AC_ARG_WITH(domain, AS_HELP_STRING([--with-domain=DOMAIN],[Specify your DNS domain name]),
664 [if test $withval != yes; then
665 if test $withval != no; then
666 AC_DEFINE_UNQUOTED(DOMAIN,"$withval",[ Define your domain name. ])
667 fi
668 fi])
669
670need_socket="no"
671
672dnl -- socket dependencies --
673
674dnl getaddrinfo is used by getdomain.c, and requires libnsl and
675dnl libsocket on some platforms
676AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
677AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
678AC_CHECK_FUNCS(getaddrinfo)
679
680AC_ARG_ENABLE(pop, AS_HELP_STRING([--enable-pop],[Enable POP3 support]),
681[ if test x$enableval = xyes ; then
682 AC_DEFINE(USE_POP,1,[ Define if you want support for the POP3 protocol. ])
683 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS pop.o pop_lib.o pop_auth.o"
684 need_pop="yes"
685 need_socket="yes"
686 need_md5="yes"
687 fi
688])
689
690AC_ARG_ENABLE(imap, AS_HELP_STRING([--enable-imap],[Enable IMAP support]),
691[ if test x$enableval = xyes ; then
692 AC_DEFINE(USE_IMAP,1,[ Define if you want support for the IMAP protocol. ])
693 LIBIMAP="-Limap -limap"
694 LIBIMAPDEPS="\$(top_srcdir)/imap/imap.h imap/libimap.a"
695 need_imap="yes"
696 need_socket="yes"
697 need_md5="yes"
698 fi
699])
700AM_CONDITIONAL(BUILD_IMAP, test x$need_imap = xyes)
701
702AC_ARG_ENABLE(smtp, AS_HELP_STRING([--enable-smtp],[include internal SMTP relay support]),
703 [if test $enableval = yes; then
704 AC_DEFINE(USE_SMTP, 1, [Include internal SMTP relay support])
705 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS smtp.o"
706 need_socket="yes"
707 fi])
708
709if test x"$need_imap" = xyes -o x"$need_pop" = xyes ; then
710 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS bcache.o"
711fi
712
713dnl -- end socket dependencies --
714
715if test "$need_socket" = "yes"
716then
717 AC_CHECK_HEADERS([sys/select.h])
718
719 AC_MSG_CHECKING([for socklen_t])
720 AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]),
721 AC_MSG_RESULT([no])
722 AC_DEFINE(socklen_t,int,
723 [ Define to 'int' if <sys/socket.h> doesn't have it. ]))
724 AC_DEFINE(USE_SOCKET,1,
725 [ Include code for socket support. Set automatically if you enable POP3 or IMAP ])
726 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS account.o mutt_socket.o mutt_tunnel.o"
727fi
728
729dnl -- imap dependencies --
730
731AC_ARG_WITH(gss, AS_HELP_STRING([--with-gss@<:@=PFX@:>@],[Compile in GSSAPI authentication for IMAP]),
732 gss_prefix="$withval", gss_prefix="no")
733if test "$gss_prefix" != "no"
734then
735 if test "$need_imap" = "yes"
736 then
737 MUTT_AM_PATH_GSSAPI(gss_prefix)
738 AC_MSG_CHECKING(GSSAPI implementation)
739 AC_MSG_RESULT($GSSAPI_IMPL)
740 if test "$GSSAPI_IMPL" = "none"
741 then
742 AC_CACHE_SAVE
743 AC_MSG_RESULT([GSSAPI libraries not found])
744 fi
745 if test "$GSSAPI_IMPL" = "Heimdal"
746 then
747 AC_DEFINE(HAVE_HEIMDAL,1,[ Define if your GSSAPI implementation is Heimdal ])
748 fi
749 CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
750 MUTTLIBS="$MUTTLIBS $GSSAPI_LIBS"
751 AC_DEFINE(USE_GSS,1,[ Define if you have GSSAPI libraries available ])
752 need_gss="yes"
753 else
754 AC_MSG_WARN([GSS was requested but IMAP is not enabled])
755 fi
756fi
757AM_CONDITIONAL(USE_GSS, test x$need_gss = xyes)
758
759dnl -- end imap dependencies --
760
761AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl@<:@=PFX@:>@],[Enable TLS support using OpenSSL]),
762[ if test "$with_ssl" != "no"
763 then
764 if test "$need_socket" != "yes"; then
765 AC_MSG_WARN([SSL support is only useful with POP, IMAP or SMTP support])
766 else
767 if test "$with_ssl" != "yes"
768 then
769 LDFLAGS="$LDFLAGS -L$withval/lib"
770 CPPFLAGS="$CPPFLAGS -I$withval/include"
771 fi
772 saved_LIBS="$LIBS"
773
774 crypto_libs=""
775 AC_CHECK_LIB(z, deflate, [crypto_libs=-lz])
776 AC_CHECK_LIB(crypto, X509_STORE_CTX_new,
777 [crypto_libs="-lcrypto $crypto_libs"],
778 AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
779 AC_CHECK_LIB(ssl, SSL_new,,
780 AC_MSG_ERROR([Unable to find SSL library]), [$crypto_libs])
781
782 LIBS="$LIBS $crypto_libs"
783 AC_CHECK_FUNCS(RAND_status RAND_egd)
784 AC_CHECK_DECLS([SSL_set_mode, SSL_MODE_AUTO_RETRY],,
785 AC_MSG_ERROR([Unable to find decent SSL header]), [[#include <openssl/ssl.h>]])
786
787 AC_CHECK_DECL([X509_V_FLAG_PARTIAL_CHAIN],
788 AC_DEFINE(HAVE_SSL_PARTIAL_CHAIN,1,[ Define if OpenSSL supports partial chains. ]),
789 ,
790 [[#include <openssl/x509_vfy.h>]])
791
792 AC_DEFINE(USE_SSL,1,[ Define if you want support for SSL. ])
793 AC_DEFINE(USE_SSL_OPENSSL,1,[ Define if you want support for SSL via OpenSSL. ])
794 LIBS="$saved_LIBS"
795 MUTTLIBS="$MUTTLIBS -lssl $crypto_libs"
796 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl.o"
797 need_ssl=yes
798 fi
799 fi
800])
801
802AC_ARG_WITH([gnutls], AS_HELP_STRING([--with-gnutls@<:@=PFX@:>@],[enable TLS support using gnutls]),
803 [gnutls_prefix="$withval"], [gnutls_prefix="no"])
804if test "$gnutls_prefix" != "no" && test x"$need_ssl" != xyes
805then
806 if test "$need_socket" != "yes"
807 then
808 AC_MSG_WARN([SSL support is only useful with POP, IMAP or SMTP support])
809 else
810 if test "$gnutls_prefix" != "yes"
811 then
812 LDFLAGS="$LDFLAGS -L$gnutls_prefix/lib"
813 CPPFLAGS="$CPPFLAGS -I$gnutls_prefix/include"
814 fi
815 saved_LIBS="$LIBS"
816
817 AC_CHECK_LIB(gnutls, gnutls_check_version,
818 [dnl GNUTLS found
819 AC_CHECK_DECLS([GNUTLS_VERIFY_DISABLE_TIME_CHECKS], [], [],
820 [[#include <gnutls/x509.h>]])
821
822 LIBS="$LIBS -lgnutls"
823 AC_CHECK_FUNCS(gnutls_priority_set_direct)
824 AC_CHECK_TYPES([gnutls_certificate_credentials_t,
825 gnutls_certificate_status_t,
826 gnutls_datum_t,
827 gnutls_digest_algorithm_t,
828 gnutls_session_t,
829 gnutls_transport_ptr_t,
830 gnutls_x509_crt_t], [], [], [[#include <gnutls/gnutls.h>]])
831
832 LIBS="$saved_LIBS"
833 MUTTLIBS="$MUTTLIBS -lgnutls"
834
835 AC_DEFINE(USE_SSL, 1, [ Define if you want support for SSL. ])
836 AC_DEFINE(USE_SSL_GNUTLS, 1, [ Define if you want support for SSL via GNUTLS. ])
837
838 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_ssl_gnutls.o"
839 need_ssl=yes],
840 [AC_MSG_ERROR([could not find libgnutls])])
841 fi
842fi
843
844AM_CONDITIONAL(USE_SSL, test x$need_ssl = xyes)
845
846AC_ARG_WITH(sasl, AS_HELP_STRING([--with-sasl@<:@=PFX@:>@],[Use SASL network security library]),
847 [
848 if test "$with_sasl" != "no"
849 then
850 if test "$need_socket" != "yes"
851 then
852 AC_MSG_ERROR([SASL support is only useful with POP or IMAP support])
853 fi
854
855 if test "$with_sasl" != "yes"
856 then
857 CPPFLAGS="$CPPFLAGS -I$with_sasl/include"
858 LDFLAGS="$LDFLAGS -L$with_sasl/lib"
859 fi
860
861 saved_LIBS="$LIBS"
862 LIBS=
863
864 # OpenSolaris provides a SASL2 interface in libsasl
865 sasl_libs="sasl2 sasl"
866 AC_SEARCH_LIBS(sasl_encode64, [$sasl_libs],,
867 AC_MSG_ERROR([could not find sasl lib]),)
868
869 MUTTLIBS="$MUTTLIBS $LIBS"
870 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_sasl.o"
871 LIBS="$saved_LIBS"
872
873 AC_DEFINE(USE_SASL,1,
874 [ Define if want to use the SASL library for POP/IMAP authentication. ])
875 need_sasl=yes
876 fi
877 ])
878AM_CONDITIONAL(USE_SASL, test x$need_sasl = xyes)
879
880dnl -- end socket --
881
882AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug],[Enable debugging support]),
883 [ if test x$enableval = xyes ; then
884 AC_DEFINE(DEBUG,1,[ Define to enable debugging info. ])
885 fi
886 ])
887
888AC_ARG_ENABLE(flock, AS_HELP_STRING([--enable-flock],[Use flock() to lock files]),
889 [if test $enableval = yes; then
890 AC_DEFINE(USE_FLOCK,1, [ Define to use flock() to lock mailboxes. ])
891 fi])
892
893mutt_cv_fcntl=yes
894AC_ARG_ENABLE(fcntl, AS_HELP_STRING([--disable-fcntl],[Do NOT use fcntl() to lock files]),
895 [if test $enableval = no; then mutt_cv_fcntl=no; fi])
896
897if test $mutt_cv_fcntl = yes; then
898 AC_DEFINE(USE_FCNTL,1, [ Define to use fcntl() to lock folders. ])
899fi
900
901AC_ARG_ENABLE(filemonitor, AS_HELP_STRING([--disable-filemonitor],[Disable file monitoring support (Linux only)]),
902[ if test x$enableval = xno ; then
903 have_filemonitor=no
904 fi
905])
906
907if test x$have_filemonitor != xno ; then
908 AC_CHECK_FUNCS(inotify_init inotify_add_watch inotify_rm_watch,
909 [], [have_filemonitor=no])
910 if test x$have_filemonitor != xno ; then
911 AC_DEFINE(USE_INOTIFY,1,[ Define if want to use inotify for filesystem monitoring (available in Linux only). ])
912 AC_CHECK_FUNCS_ONCE(inotify_init1)
913 AC_CHECK_HEADERS(sys/inotify.h)
914 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS monitor.o"
915 fi
916fi
917
918AC_MSG_CHECKING(whether struct dirent defines d_ino)
919ac_cv_dirent_d_ino=no
920AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <dirent.h>]], [[struct dirent dp; (void)dp.d_ino]])],[ac_cv_dirent_d_ino=yes],[])
921if test x$ac_cv_dirent_d_ino = xyes ; then
922 AC_DEFINE(HAVE_DIRENT_D_INO,1,
923 [Define to 1 if your system has the dirent::d_ino member])
924fi
925AC_MSG_RESULT($ac_cv_dirent_d_ino)
926
927mutt_cv_warnings=yes
928AC_ARG_ENABLE(warnings, AS_HELP_STRING([--disable-warnings],[Turn off compiler warnings (not recommended)]),
929[if test $enableval = no; then
930 mutt_cv_warnings=no
931fi])
932
933if test x$GCC = xyes && test $mutt_cv_warnings = yes; then
934 CFLAGS="-Wall -pedantic -Wno-long-long $CFLAGS"
935fi
936
937AC_ARG_ENABLE(nfs-fix, AS_HELP_STRING([--enable-nfs-fix],[Work around an NFS with broken attributes caching]),
938 [if test x$enableval = xyes; then
939 AC_DEFINE(NFS_ATTRIBUTE_HACK,1,
940 [Define if you have problems with mutt not detecting
941 new/old mailboxes over NFS. Some NFS implementations
942 incorrectly cache the attributes of small files.])
943 fi])
944
945AC_ARG_ENABLE(mailtool, AS_HELP_STRING([--enable-mailtool],[Enable Sun mailtool attachments support]),
946 [if test x$enableval = xyes; then
947 AC_DEFINE(SUN_ATTACHMENT,1,[ Define to enable Sun mailtool attachments support. ])
948 fi])
949
950AC_ARG_ENABLE(locales-fix, AS_HELP_STRING([--enable-locales-fix],[The result of isprint() is unreliable]),
951 [if test x$enableval = xyes; then
952 AC_DEFINE(LOCALES_HACK,1,[ Define if the result of isprint() is unreliable. ])
953 fi])
954
955AC_ARG_WITH(exec-shell, AS_HELP_STRING([--with-exec-shell=SHELL],[Specify alternate shell (ONLY if /bin/sh is broken)]),
956 [if test $withval != yes; then
957 AC_DEFINE_UNQUOTED(EXECSHELL, "$withval",
958 [program to use for shell commands])
959 else
960 AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh")
961 fi],
962 [AC_DEFINE_UNQUOTED(EXECSHELL, "/bin/sh")])
963
964AC_ARG_ENABLE(exact-address, AS_HELP_STRING([--enable-exact-address],[Enable regeneration of email addresses]),
965 [if test $enableval = yes; then
966 AC_DEFINE(EXACT_ADDRESS,1,
967 [Enable exact regeneration of email addresses as parsed?
968 NOTE: this requires significant more memory when defined.])
969
970 fi])
971
972dnl -- start cache --
973db_found=no
974db_requested=auto
975AC_ARG_ENABLE(hcache, AS_HELP_STRING([--enable-hcache],[Enable header caching]))
976AC_ARG_WITH(tokyocabinet, AS_HELP_STRING([--without-tokyocabinet],[Don't use tokyocabinet even if it is available]))
977AC_ARG_WITH(qdbm, AS_HELP_STRING([--without-qdbm],[Don't use qdbm even if it is available]))
978AC_ARG_WITH(gdbm, AS_HELP_STRING([--without-gdbm],[Don't use gdbm even if it is available]))
979AC_ARG_WITH(bdb, AS_HELP_STRING([--with-bdb@<:@=DIR@:>@],[Use BerkeleyDB4 if gdbm is not available]))
980AC_ARG_WITH(lmdb, AS_HELP_STRING([--with-lmdb@<:@=DIR@:>@],[Use LMDB if gdbm is not available]))
981AC_ARG_WITH(kyotocabinet, AS_HELP_STRING([--with-kyotocabinet@<:@=DIR@:>@],[Use kyotocabinet if gdbm is not available]))
982
983db_found=no
984if test x$enable_hcache = xyes
985then
986 AC_DEFINE(USE_HCACHE, 1, [Enable header caching])
987 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS hcache.o"
988
989 OLDCPPFLAGS="$CPPFLAGS"
990 OLDLDFLAGS="$LDFLAGS"
991 OLDLIBS="$LIBS"
992
993 need_md5="yes"
994
995 if test -n "$with_tokyocabinet" && test "$with_tokyocabinet" != "no"
996 then
997 db_requested=tc
998 fi
999 if test -n "$with_qdbm" && test "$with_qdbm" != "no"
1000 then
1001 if test "$db_requested" != "auto"
1002 then
1003 AC_MSG_ERROR([more than one header cache engine requested.])
1004 else
1005 db_requested=qdbm
1006 fi
1007 fi
1008 if test -n "$with_gdbm" && test "$with_gdbm" != "no"
1009 then
1010 if test "$db_requested" != "auto"
1011 then
1012 AC_MSG_ERROR([more than one header cache engine requested.])
1013 else
1014 db_requested=gdbm
1015 fi
1016 fi
1017 if test -n "$with_bdb" && test "$with_bdb" != "no"
1018 then
1019 if test "$db_requested" != "auto"
1020 then
1021 AC_MSG_ERROR([more than one header cache engine requested.])
1022 else
1023 db_requested=bdb
1024 fi
1025 fi
1026 if test -n "$with_lmdb" && test "$with_lmdb" != "no"
1027 then
1028 if test "$db_requested" != "auto"
1029 then
1030 AC_MSG_ERROR([more than one header cache engine requested.])
1031 else
1032 db_requested=lmdb
1033 fi
1034 fi
1035 if test -n "$with_kyotocabinet" && test "$with_kyotocabinet" != "no"
1036 then
1037 if test "$db_requested" != "auto"
1038 then
1039 AC_MSG_ERROR([more than one header cache engine requested.])
1040 else
1041 db_requested=kc
1042 fi
1043 fi
1044
1045 dnl -- Tokyo Cabinet --
1046 if test "$with_tokyocabinet" != "no" \
1047 && test "$db_requested" = auto -o "$db_requested" = tc
1048 then
1049 if test -n "$with_tokyocabinet" && test "$with_tokyocabinet" != "yes"
1050 then
1051 CPPFLAGS="$CPPFLAGS -I$with_tokyocabinet/include"
1052 LDFLAGS="$LDFLAGS -L$with_tokyocabinet/lib"
1053 fi
1054
1055 AC_CHECK_HEADER(tcbdb.h,
1056 AC_CHECK_LIB(tokyocabinet, tcbdbopen,
1057 [MUTTLIBS="$MUTTLIBS -ltokyocabinet"
1058 AC_DEFINE(HAVE_TC, 1, [Tokyo Cabinet Support])
1059 db_found=tc],
1060 [CPPFLAGS="$OLDCPPFLAGS"
1061 LDFLAGS="$OLDLDFLAGS"]))
1062 if test "$db_requested" != auto && test "$db_found" != "$db_requested"
1063 then
1064 AC_MSG_ERROR([Tokyo Cabinet could not be used. Check config.log for details.])
1065 fi
1066 fi
1067
1068 dnl -- QDBM --
1069 if test "$with_qdbm" != "no" && test $db_found = no \
1070 && test "$db_requested" = auto -o "$db_requested" = qdbm
1071 then
1072 if test -n "$with_qdbm" && test "$with_qdbm" != "yes"
1073 then
1074 if test -d $with_qdbm/include/qdbm; then
1075 CPPFLAGS="$CPPFLAGS -I$with_qdbm/include/qdbm"
1076 else
1077 CPPFLAGS="$CPPFLAGS -I$with_qdbm/include"
1078 fi
1079 LDFLAGS="$LDFLAGS -L$with_qdbm/lib"
1080 else
1081 if test -d /usr/include/qdbm; then
1082 CPPFLAGS="$CPPFLAGS -I/usr/include/qdbm"
1083 fi
1084 fi
1085
1086 saved_LIBS="$LIBS"
1087 AC_CHECK_HEADERS(villa.h)
1088 AC_CHECK_LIB(qdbm, vlopen,
1089 [MUTTLIBS="$MUTTLIBS -lqdbm"
1090 AC_DEFINE(HAVE_QDBM, 1, [QDBM Support])
1091 db_found=qdbm],
1092 [CPPFLAGS="$OLDCPPFLAGS"
1093 LDFLAGS="$OLDLDFLAGS"])
1094 LIBS="$saved_LIBS"
1095 if test "$db_requested" != auto && test "$db_found" != "$db_requested"
1096 then
1097 AC_MSG_ERROR([QDBM could not be used. Check config.log for details.])
1098 fi
1099 fi
1100
1101 dnl -- GDBM --
1102 if test x$with_gdbm != xno && test $db_found = no \
1103 && test "$db_requested" = auto -o "$db_requested" = gdbm
1104 then
1105 if test "$with_gdbm" != "yes"
1106 then
1107 CPPFLAGS="$CPPFLAGS -I$with_gdbm/include"
1108 LDFLAGS="$LDFLAGS -L$with_gdbm/lib"
1109 fi
1110 saved_LIBS="$LIBS"
1111 LIBS="$LIBS -lgdbm"
1112 AC_CACHE_CHECK(for gdbm_open, ac_cv_gdbmopen,[
1113 ac_cv_gdbmopen=no
1114 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <gdbm.h>]], [[gdbm_open(0,0,0,0,0);]])],[ac_cv_gdbmopen=yes],[])
1115 ])
1116 LIBS="$saved_LIBS"
1117 if test "$ac_cv_gdbmopen" = yes
1118 then
1119 AC_DEFINE(HAVE_GDBM, 1, [GDBM Support])
1120 MUTTLIBS="$MUTTLIBS -lgdbm"
1121 db_found=gdbm
1122 fi
1123 if test "$db_requested" != auto && test "$db_found" != "$db_requested"
1124 then
1125 AC_MSG_ERROR([GDBM could not be used. Check config.log for details.])
1126 fi
1127 fi
1128
1129 dnl -- BDB --
1130 ac_bdb_prefix="$with_bdb"
1131 if test x$with_bdb != xno && test $db_found = no \
1132 && test "$db_requested" = auto -o "$db_requested" = bdb
1133 then
1134 if test x$ac_bdb_prefix = xyes || test x$ac_bdb_prefix = x
1135 then
1136 ac_bdb_prefix="$mutt_cv_prefix /opt/csw/bdb4 /opt /usr/local /usr"
1137 fi
1138 for d in $ac_bdb_prefix; do
1139 bdbpfx="$bdbpfx $d"
1140 for v in BerkeleyDB.4.3 BerkeleyDB.4.2 BerkeleyDB.4.1; do
1141 bdbpfx="$bdbpfx $d/$v"
1142 done
1143 done
1144 BDB_VERSIONS="db-4 db4 db-5 db5 db-5.2 db5.2 db52 db-5.1 db5.1 db51 db-5.0 db5.0 db50 db-4.8 db4.8 db48 db-4.7 db4.7 db47 db-4.6 db4.6 db46 db-4.5 db4.5 db45 db-4.4 db4.4 db44 db-4.3 db4.3 db43 db-4.2 db4.2 db42 db-4.1 db4.1 db41 db ''"
1145 AC_MSG_CHECKING([for BerkeleyDB > 4.0])
1146 for d in $bdbpfx; do
1147 BDB_INCLUDE_DIR=""
1148 BDB_LIB_DIR=""
1149 for v in / $BDB_VERSIONS; do
1150 if test -r "$d/include/$v/db.h"; then
1151 BDB_INCLUDE_DIR="$d/include/$v"
1152 for bdblibdir in "$d/lib/$v" "$d/lib"; do
1153 test -d "$bdblibdir" || continue
1154 BDB_LIB_DIR="$bdblibdir"
1155 for l in `echo $BDB_VERSIONS`; do
1156 CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
1157 LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$l"
1158 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1159 #include <stdlib.h>
1160 #include <db.h>
1161 ]], [[
1162 DB *db = NULL;
1163 db->open(db,NULL,NULL,NULL,0,0,0);
1164 ]])],[
1165 ac_cv_dbcreate=yes
1166 BDB_LIB="$l"
1167 break
1168 ],[])
1169 done
1170 test x$ac_cv_dbcreate = xyes && break 2
1171 done
1172 fi
1173 done
1174 test x$BDB_LIB != x && break
1175 done
1176 if test x$ac_cv_dbcreate = xyes
1177 then
1178 AC_MSG_RESULT(yes)
1179 CPPFLAGS="$OLDCPPFLAGS -I$BDB_INCLUDE_DIR"
1180 LIBS="$OLDLIBS -L$BDB_LIB_DIR -l$BDB_LIB"
1181 AC_DEFINE(HAVE_DB4, 1, [Berkeley DB4 Support])
1182 db_found=bdb
1183 else
1184 AC_MSG_RESULT(no)
1185 fi
1186 fi
1187
1188 dnl -- LMDB --
1189 if test x$with_lmdb != xno && test $db_found = no \
1190 && test "$db_requested" = auto -o "$db_requested" = lmdb
1191 then
1192 if test "$with_lmdb" != "yes"
1193 then
1194 CPPFLAGS="$CPPFLAGS -I$with_lmdb/include"
1195 LDFLAGS="$LDFLAGS -L$with_lmdb/lib"
1196 fi
1197 saved_LIBS="$LIBS"
1198 LIBS="$LIBS -llmdb"
1199 AC_CACHE_CHECK(for mdb_env_create, ac_cv_mdbenvcreate,[
1200 ac_cv_mdbenvcreate=no
1201 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <lmdb.h>]], [[mdb_env_create(0);]])],[ac_cv_mdbenvcreate=yes],[])
1202 ])
1203 LIBS="$saved_LIBS"
1204 if test "$ac_cv_mdbenvcreate" = yes
1205 then
1206 AC_DEFINE(HAVE_LMDB, 1, [LMDB Support])
1207 MUTTLIBS="$MUTTLIBS -llmdb"
1208 db_found=lmdb
1209 fi
1210 if test "$db_requested" != auto && test "$db_found" != "$db_requested"
1211 then
1212 AC_MSG_ERROR([LMDB could not be used. Check config.log for details.])
1213 fi
1214 fi
1215
1216 dnl -- Kyoto Cabinet --
1217 if test x$with_kyotocabinet != xno && test $db_found = no \
1218 && test "$db_requested" = auto -o "$db_requested" = kc
1219 then
1220 if test -n "$with_kyotocabinet" && test "$with_kyotocabinet" != "yes"
1221 then
1222 CPPFLAGS="$CPPFLAGS -I$with_kyotocabinet/include"
1223 LDFLAGS="$LDFLAGS -L$with_kyotocabinet/lib"
1224 fi
1225
1226 AC_CHECK_HEADER(kclangc.h,
1227 AC_CHECK_LIB(kyotocabinet, kcdbopen,
1228 [MUTTLIBS="$MUTTLIBS -lkyotocabinet"
1229 AC_DEFINE(HAVE_KC, 1, [Kyoto Cabinet Support])
1230 db_found=kc],
1231 [CPPFLAGS="$OLDCPPFLAGS"
1232 LDFLAGS="$OLDLDFLAGS"]))
1233 if test "$db_requested" != auto && test "$db_found" != "$db_requested"
1234 then
1235 AC_MSG_ERROR([Kyoto Cabinet could not be used. Check config.log for details.])
1236 fi
1237 fi
1238
1239 if test $db_found = no
1240 then
1241 AC_MSG_ERROR([You need Tokyo Cabinet, Kyoto Cabinet, QDBM, GDBM, LMDB or Berkeley DB4 for hcache])
1242 fi
1243fi
1244dnl -- end cache --
1245
1246AM_CONDITIONAL(BUILD_HCACHE, test x$db_found != xno)
1247
1248if test "$need_md5" = "yes"
1249then
1250 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS md5.o"
1251fi
1252
1253if test x$db_found != xno ; then
1254 MUTT_MD5="mutt_md5$EXEEXT"
1255fi
1256AC_SUBST(MUTT_MD5)
1257
1258AC_SUBST(MUTTLIBS)
1259AC_SUBST(MUTT_LIB_OBJECTS)
1260AC_SUBST(LIBIMAP)
1261AC_SUBST(LIBIMAPDEPS)
1262
1263dnl -- iconv/gettext --
1264
1265AC_ARG_ENABLE(iconv, AS_HELP_STRING([--disable-iconv],[Disable iconv support]),
1266 [if test x$enableval = xno ; then
1267 am_cv_func_iconv=no
1268 fi
1269])
1270
1271MUTT_AM_GNU_GETTEXT
1272
1273if test "$am_cv_func_iconv" != "yes"
1274then
1275 AC_MSG_WARN([Configuring without iconv support. See INSTALL for details])
1276else
1277
1278AC_CHECK_HEADERS(iconv.h,
1279 [AC_MSG_CHECKING(whether iconv.h defines iconv_t)
1280 AC_EGREP_HEADER([typedef.*iconv_t],iconv.h,
1281 [AC_MSG_RESULT(yes)
1282 AC_DEFINE(HAVE_ICONV_T_DEF, 1,
1283 [Define if <iconv.h> defines iconv_t.])],
1284 AC_MSG_RESULT(no))])
1285
1286dnl (1) Some implementations of iconv won't convert from UTF-8 to UTF-8.
1287dnl (2) In glibc-2.1.2 and earlier there is a bug that messes up ob and
1288dnl obl when args 2 and 3 are 0 (fixed in glibc-2.1.3).
1289AC_CACHE_CHECK([whether this iconv is good enough], mutt_cv_iconv_good,
1290 mutt_save_LIBS="$LIBS"
1291 LIBS="$LIBS $LIBICONV"
1292 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1293#include <iconv.h>
1294int main()
1295{
1296 iconv_t cd;
1297changequote(, )dnl
1298 char buf[4];
1299changequote([, ])dnl
1300 char *ob;
1301 size_t obl;
1302 ob = buf, obl = sizeof(buf);
1303 return ((cd = iconv_open("UTF-8", "UTF-8")) != (iconv_t)(-1) &&
1304 (iconv(cd, 0, 0, &ob, &obl) ||
1305 !(ob == buf && obl == sizeof(buf)) ||
1306 iconv_close(cd)));
1307}
1308 ]])],[mutt_cv_iconv_good=yes],[mutt_cv_iconv_good=no],[mutt_cv_iconv_good=yes])
1309 LIBS="$mutt_save_LIBS")
1310if test "$mutt_cv_iconv_good" = no; then
1311 AC_MSG_ERROR(Try using libiconv instead)
1312fi
1313
1314dnl This is to detect implementations such as the one in glibc-2.1,
1315dnl which always convert exactly but return the number of characters
1316dnl converted instead of the number converted inexactly.
1317AC_CACHE_CHECK([whether iconv is non-transcribing], mutt_cv_iconv_nontrans,
1318 mutt_save_LIBS="$LIBS"
1319 LIBS="$LIBS $LIBICONV"
1320 AC_RUN_IFELSE([AC_LANG_SOURCE([[
1321#include <iconv.h>
1322#include <string.h>
1323int main()
1324{
1325 iconv_t cd;
1326 const char *ib;
1327 char *ob;
1328 size_t ibl, obl;
1329 const char *s = "\304\211";
1330changequote(, )dnl
1331 char t[3];
1332changequote([, ])dnl
1333 ib = s, ibl = 2, ob = t, obl = 3;
1334 return ((cd = iconv_open("UTF-8", "UTF-8")) == (iconv_t)(-1) ||
1335 iconv(cd, &ib, &ibl, &ob, &obl));
1336}
1337 ]])],[mutt_cv_iconv_nontrans=no],[mutt_cv_iconv_nontrans=yes],[mutt_cv_iconv_nontrans=no])
1338 LIBS="$mutt_save_LIBS")
1339if test "$mutt_cv_iconv_nontrans" = yes; then
1340 AC_DEFINE(ICONV_NONTRANS, 1)
1341else
1342 AC_DEFINE(ICONV_NONTRANS, 0)
1343fi
1344
1345CPPFLAGS="$CPPFLAGS -I\$(top_srcdir)/intl"
1346
1347if test "$BUILD_INCLUDED_LIBINTL" = "yes"; then
1348 AC_DEFINE(HAVE_BIND_TEXTDOMAIN_CODESET,1,
1349 [ Define if your gettext has bind_textdomain_codeset. ])
1350else
1351 mutt_save_LIBS="$LIBS"
1352 LIBS="$LIBS $INTLLIBS"
1353 AC_CHECK_FUNCS(bind_textdomain_codeset)
1354 LIBS="$mutt_save_LIBS"
1355fi
1356
1357fi # libiconv
1358
1359dnl -- IDN depends on iconv
1360
1361dnl mutt_idna.c will perform charset transformations (for smtputf8
1362dnl support) as long as at least iconv is installed. If there is no
1363dnl iconv, then it doesn't need to be included in the build.
1364if test "$am_cv_func_iconv" = yes; then
1365 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS mutt_idna.o"
1366fi
1367
1368AC_ARG_WITH(idn, AS_HELP_STRING([--with-idn=@<:@PFX@:>@],[Use GNU libidn for internationalized domain names]),
1369 [
1370 if test "$with_idn" != "no" ; then
1371 if test "$with_idn" != "yes" ; then
1372 CPPFLAGS="$CPPFLAGS -I$with_idn/include"
1373 LDFLAGS="$LDFLAGS -L$with_idn/lib"
1374 fi
1375 fi
1376 ],
1377 [with_idn=auto])
1378
1379AC_ARG_WITH(idn2, AS_HELP_STRING([--with-idn2=@<:@PFX@:>@],[Use GNU libidn2 for internationalized domain names]),
1380 [
1381 if test "$with_idn2" != "no" ; then
1382 if test "$with_idn" = "auto"; then
1383 with_idn="no"
1384 fi
1385
1386 if test "$with_idn" != "no"; then
1387 AC_MSG_ERROR([Cannot enable IDN and IDN2 support at the same time])
1388 fi
1389
1390 if test "$with_idn2" != "yes" ; then
1391 CPPFLAGS="$CPPFLAGS -I$with_idn2/include"
1392 LDFLAGS="$LDFLAGS -L$with_idn2/lib"
1393 fi
1394 fi
1395 ],
1396 [with_idn2=no])
1397
1398if test "x$with_idn" != "xno"; then
1399 if test "$am_cv_func_iconv" != "yes"; then
1400 if test "$with_idn" != "auto"; then
1401 AC_MSG_ERROR([IDN requested but iconv is disabled or unavailable])
1402 fi
1403 else
1404 dnl Solaris 11 has /usr/include/idn
1405 have_stringprep_h=no
1406 AC_CHECK_HEADERS([stringprep.h idn/stringprep.h], [
1407 have_stringprep_h=yes
1408 break])
1409 have_idna_h=no
1410 AC_CHECK_HEADERS([idna.h idn/idna.h], [
1411 have_idna_h=yes
1412 break])
1413
1414 mutt_save_LIBS="$LIBS"
1415 LIBS=
1416
1417 AC_SEARCH_LIBS([stringprep_check_version], [idn], [
1418 AC_DEFINE([HAVE_LIBIDN], 1, [Define to 1 if you have the GNU idn library])
1419 MUTTLIBS="$MUTTLIBS $LIBS"
1420
1421 LIBS="$LIBS $LIBICONV"
1422 AC_CHECK_FUNCS(idna_to_unicode_utf8_from_utf8 idna_to_unicode_8z8z)
1423 AC_CHECK_FUNCS(idna_to_ascii_from_utf8 idna_to_ascii_8z)
1424 AC_CHECK_FUNCS(idna_to_ascii_lz idna_to_ascii_from_locale)
1425 ])
1426
1427 LIBS="$mutt_save_LIBS"
1428
1429 if test "$with_idn" != auto; then
1430 if test $have_stringprep_h = no || test $have_idna_h = no || test $ac_cv_search_stringprep_check_version = no; then
1431 AC_MSG_ERROR([IDN was requested, but libidn was not usable on this system])
1432 fi
1433 fi
1434 fi
1435fi
1436
1437dnl idna2
1438if test "x$with_idn2" != "xno"; then
1439 if test "$am_cv_func_iconv" != "yes"; then
1440 AC_MSG_ERROR([IDN2 requested but iconv is disabled or unavailable])
1441 else
1442 dnl Solaris 11 has /usr/include/idn
1443 have_idn2_h=no
1444 AC_CHECK_HEADERS([idn2.h idn/idn2.h], [
1445 have_idn2_h=yes
1446 break])
1447
1448 mutt_save_LIBS="$LIBS"
1449 LIBS=
1450
1451 AC_SEARCH_LIBS([idn2_check_version], [idn2], [
1452 AC_DEFINE([HAVE_LIBIDN2], 1, [Define to 1 if you have the GNU idn2 library])
1453 MUTTLIBS="$MUTTLIBS $LIBS"
1454
1455 dnl -lunistring is needed for static linking, and has to come
1456 dnl after the -lidn2
1457 AC_SEARCH_LIBS([u8_strconv_from_locale], [unistring], [
1458 if test "$ac_cv_search_u8_strconv_from_locale" != "none required"; then
1459 MUTTLIBS="$MUTTLIBS -lunistring"
1460 fi
1461 ])
1462
1463 dnl libidn2 >= 2.0.0 declares compatibility macros in idn2.h
1464 LIBS="$LIBS $LIBICONV"
1465 AC_CHECK_DECL([idna_to_unicode_8z8z],
1466 [AC_DEFINE([HAVE_IDNA_TO_UNICODE_8Z8Z])], [],
1467 [[
1468#if defined(HAVE_IDN2_H)
1469#include <idn2.h>
1470#elif defined(HAVE_IDN_IDN2_H)
1471#include <idn/idn2.h>
1472#endif
1473 ]])
1474 AC_CHECK_DECL([idna_to_ascii_8z],
1475 [AC_DEFINE([HAVE_IDNA_TO_ASCII_8Z])], [],
1476 [[
1477#if defined(HAVE_IDN2_H)
1478#include <idn2.h>
1479#elif defined(HAVE_IDN_IDN2_H)
1480#include <idn/idn2.h>
1481#endif
1482 ]])
1483 AC_CHECK_DECL([idna_to_ascii_lz],
1484 [AC_DEFINE([HAVE_IDNA_TO_ASCII_LZ])], [],
1485 [[
1486#if defined(HAVE_IDN2_H)
1487#include <idn2.h>
1488#elif defined(HAVE_IDN_IDN2_H)
1489#include <idn/idn2.h>
1490#endif
1491 ]])
1492 ])
1493
1494 LIBS="$mutt_save_LIBS"
1495
1496 if test "$have_idn2_h" = "no" || \
1497 test "$ac_cv_search_idn2_check_version" = "no" || \
1498 test "x$ac_cv_have_decl_idna_to_unicode_8z8z" != "xyes" || \
1499 test "x$ac_cv_have_decl_idna_to_ascii_8z" != "xyes" || \
1500 test "x$ac_cv_have_decl_idna_to_ascii_lz" != "xyes"
1501 then
1502 AC_MSG_ERROR([IDN2 was requested, but libidn2 was not usable on this system])
1503 fi
1504 fi
1505fi
1506
1507dnl -- locales --
1508
1509AC_CHECK_HEADERS(wchar.h)
1510
1511AC_CACHE_CHECK([for wchar_t], mutt_cv_wchar_t,
1512 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1513#include <stddef.h>
1514#include <stdlib.h>
1515#ifdef HAVE_WCHAR_H
1516#include <wchar.h>
1517#endif
1518 ]], [[ wchar_t wc; return 0; ]])],[mutt_cv_wchar_t=yes],[mutt_cv_wchar_t=no]))
1519
1520if test "$mutt_cv_wchar_t" = no; then
1521 AC_DEFINE(wchar_t,int,[ Define to 'int' if system headers don't define. ])
1522fi
1523
1524AC_CACHE_CHECK([for wint_t], mutt_cv_wint_t,
1525 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1526#include <stddef.h>
1527#include <stdlib.h>
1528#ifdef HAVE_WCHAR_H
1529#include <wchar.h>
1530#endif
1531 ]], [[ wint_t wc; return 0; ]])],[mutt_cv_wint_t=yes],[mutt_cv_wint_t=no]))
1532
1533if test "$mutt_cv_wint_t" = no; then
1534 AC_DEFINE(wint_t,int,[ Define to 'int' if system headers don't define. ])
1535fi
1536
1537AC_CHECK_HEADERS(wctype.h)
1538AC_CHECK_FUNCS(iswalnum iswalpha iswblank iswcntrl iswdigit)
1539AC_CHECK_FUNCS(iswgraph iswlower iswprint iswpunct iswspace iswupper)
1540AC_CHECK_FUNCS(iswxdigit towupper towlower)
1541
1542AC_CACHE_CHECK([for mbstate_t], mutt_cv_mbstate_t,
1543 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1544#include <stddef.h>
1545#include <stdlib.h>
1546#ifdef HAVE_WCHAR_H
1547#include <wchar.h>
1548#endif
1549 ]], [[ mbstate_t s; return 0; ]])],[mutt_cv_mbstate_t=yes],[mutt_cv_mbstate_t=no]))
1550
1551if test "$mutt_cv_mbstate_t" = no; then
1552 AC_DEFINE(mbstate_t,int,[ Define to 'int' if system headers don't define. ])
1553fi
1554
1555wc_funcs=maybe
1556AC_ARG_WITH(wc-funcs, AS_HELP_STRING([--without-wc-funcs],[Do not use the system's wchar_t functions]),
1557 wc_funcs=$withval)
1558
1559if test "$wc_funcs" != yes && test "$wc_funcs" != no; then
1560 AC_CACHE_CHECK([for wchar_t functions], mutt_cv_wc_funcs,
1561 mutt_cv_wc_funcs=no
1562 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
1563#define _XOPEN_SOURCE 600
1564#include <stddef.h>
1565#include <stdlib.h>
1566#ifdef HAVE_WCHAR_H
1567#include <wchar.h>
1568#endif
1569#ifdef HAVE_WCTYPE_H
1570#include <wctype.h>
1571#endif]], [[mbrtowc(0, 0, 0, 0); wctomb(0, 0); wcwidth(0);
1572 iswprint(0); iswspace(0); towlower(0); towupper(0); iswalnum(0)]])],[mutt_cv_wc_funcs=yes],[]))
1573 wc_funcs=$mutt_cv_wc_funcs
1574fi
1575
1576if test $wc_funcs = yes; then
1577 AC_DEFINE(HAVE_WC_FUNCS,1,[ Define if you are using the system's wchar_t functions. ])
1578else
1579 MUTT_LIB_OBJECTS="$MUTT_LIB_OBJECTS utf8.o wcwidth.o"
1580fi
1581
1582AC_CACHE_CHECK([for nl_langinfo and CODESET], mutt_cv_langinfo_codeset,
1583 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[char* cs = nl_langinfo(CODESET);]])],[mutt_cv_langinfo_codeset=yes],[mutt_cv_langinfo_codeset=no])])
1584if test $mutt_cv_langinfo_codeset = yes; then
1585 AC_DEFINE(HAVE_LANGINFO_CODESET,1,[ Define if you have <langinfo.h> and nl_langinfo(CODESET). ])
1586fi
1587
1588AC_CACHE_CHECK([for nl_langinfo and YESEXPR], mutt_cv_langinfo_yesexpr,
1589 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <langinfo.h>]], [[char* cs = nl_langinfo(YESEXPR);]])],[mutt_cv_langinfo_yesexpr=yes],[mutt_cv_langinfo_yesexpr=no])])
1590if test $mutt_cv_langinfo_yesexpr = yes; then
1591 AC_DEFINE(HAVE_LANGINFO_YESEXPR,1,[ Define if you have <langinfo.h> and nl_langinfo(YESEXPR). ])
1592fi
1593
1594dnl Documentation tools
1595have_openjade="no"
1596AC_PATH_PROG([OSPCAT], [ospcat], [none])
1597if test "$OSPCAT" != "none"
1598then
1599 AC_MSG_CHECKING([for openjade docbook stylesheets])
1600 dslosfile=`ospcat --public-id="-//Norman Walsh//DOCUMENT DocBook Print Stylesheet//EN"`
1601 DSLROOT=`echo $dslosfile | sed -n -e "s/.*SOIBASE='\(@<:@^'@:>@*\)\/catalog'.*/\1/p"`
1602 # ospcat may spit out an absolute path without an SOIBASE
1603 if test -z "$DSLROOT"
1604 then
1605 DSLROOT=`echo $dslosfile | sed -e 's|<OSFILE>\(.*\)/print/docbook.dsl|\1|'`
1606 fi
1607 if test -f $DSLROOT/print/docbook.dsl
1608 then
1609 AC_MSG_RESULT([in $DSLROOT])
1610 have_openjade="yes"
1611 else
1612 AC_MSG_RESULT([not found: PDF documentation will not be built.])
1613 fi
1614fi
1615AC_SUBST(DSLROOT)
1616
1617AC_PATH_PROGS([DB2XTEXI], [docbook2x-texi db2x_docbook2texi docbook2texi], [none])
1618if test "$DB2XTEXI" != "none"; then
1619 AC_PATH_PROG([MAKEINFO], [makeinfo], [none])
1620 if test "$MAKEINFO" != "none"; then
1621 do_build_info=yes
1622 fi
1623fi
1624AM_CONDITIONAL(BUILD_INFO, test x$do_build_info = xyes)
1625AC_SUBST(DB2XTEXI)
1626AC_SUBST(MAKEINFO)
1627
1628AC_ARG_ENABLE(doc, AS_HELP_STRING([--disable-doc],[Do not build the documentation]),
1629[ if test x$enableval = xno ; then
1630 do_build_doc=no
1631 fi
1632])
1633AM_CONDITIONAL(BUILD_DOC, test x$do_build_doc != xno)
1634
1635AC_ARG_ENABLE(full_doc,
1636 AS_HELP_STRING([--disable-full-doc],[Omit disabled variables]),
1637[ if test x$enableval = xno ; then
1638 full_doc=no
1639 fi
1640])
1641if test x$full_doc != xno ; then
1642 AC_DEFINE(MAKEDOC_FULL,1, [Define if you want complete documentation.])
1643fi
1644
1645AC_CONFIG_FILES(Makefile contrib/Makefile doc/Makefile imap/Makefile
1646 intl/Makefile m4/Makefile po/Makefile.in autocrypt/Makefile
1647 hcachever.sh doc/instdoc.sh)
1648AC_OUTPUT