1 dnl aclocal.m4 generated automatically by aclocal 1.4-p4
3 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
4 dnl This file is free software; the Free Software Foundation
5 dnl gives unlimited permission to copy and/or distribute it,
6 dnl with or without modifications, as long as this notice is preserved.
8 dnl This program is distributed in the hope that it will be useful,
9 dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
10 dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11 dnl PARTICULAR PURPOSE.
13 # Like AC_CONFIG_HEADER, but automatically create stamp file.
15 AC_DEFUN(AM_CONFIG_HEADER,
17 AC_CONFIG_HEADER([$1])
18 dnl When config.status generates a header, we must update the stamp-h file.
19 dnl This file resides in the same directory as the config header
20 dnl that is generated. We must strip everything past the first ":",
21 dnl and everything past the last "/".
22 AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
23 ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
24 <<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
26 for am_file in <<$1>>; do
27 case " <<$>>CONFIG_HEADERS " in
28 *" <<$>>am_file "*<<)>>
29 echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
32 am_indx=`expr "<<$>>am_indx" + 1`
36 # Do all the work for Automake. This macro actually does too much --
37 # some checks are only needed if your package does certain things.
38 # But this isn't really a big deal.
43 dnl AM_INIT_AUTOMAKE(package,version, [no-define])
45 AC_DEFUN(AM_INIT_AUTOMAKE,
46 [AC_REQUIRE([AC_PROG_INSTALL])
51 dnl test to see if srcdir already configured
52 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
53 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
56 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
57 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
58 AC_REQUIRE([AM_SANITY_CHECK])
59 AC_REQUIRE([AC_ARG_PROGRAM])
60 dnl FIXME This is truly gross.
61 missing_dir=`cd $ac_aux_dir && pwd`
62 AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
63 AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
64 AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
65 AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
66 AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
67 AC_REQUIRE([AC_PROG_MAKE_SET])])
70 # Check to make sure that the build environment is sane.
73 AC_DEFUN(AM_SANITY_CHECK,
74 [AC_MSG_CHECKING([whether build environment is sane])
77 echo timestamp > conftestfile
78 # Do `set' in a subshell so we don't clobber the current shell's
79 # arguments. Must try -L first in case configure is actually a
80 # symlink; some systems play weird games with the mod time of symlinks
81 # (eg FreeBSD returns the mod time of the symlink's containing
84 set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
85 if test "[$]*" = "X"; then
87 set X `ls -t $srcdir/configure conftestfile`
89 if test "[$]*" != "X $srcdir/configure conftestfile" \
90 && test "[$]*" != "X conftestfile $srcdir/configure"; then
92 # If neither matched, then we have a broken ls. This can happen
93 # if, for instance, CONFIG_SHELL is bash and it inherits a
94 # broken ls alias from the environment. This has actually
95 # happened. Such a system could not be considered "sane".
96 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
97 alias in your environment])
100 test "[$]2" = conftestfile
106 AC_MSG_ERROR([newly created file is older than distributed files!
107 Check your system clock])
112 dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
113 dnl The program must properly implement --version.
114 AC_DEFUN(AM_MISSING_PROG,
115 [AC_MSG_CHECKING(for working $2)
116 # Run test in a subshell; some versions of sh will print an error if
117 # an executable is not found, even if stderr is redirected.
118 # Redirect stdin to placate older versions of autoconf. Sigh.
119 if ($2 --version) < /dev/null > /dev/null 2>&1; then
124 AC_MSG_RESULT(missing)
129 # This test replaces the one in autoconf.
130 # Currently this macro should have the same name as the autoconf macro
131 # because gettext's gettext.m4 (distributed in the automake package)
132 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
133 # give these diagnostics:
134 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
135 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
137 undefine([AC_ISC_POSIX])
139 AC_DEFUN([AC_ISC_POSIX],
141 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
142 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
149 AC_DEFUN(AM_C_PROTOTYPES,
150 [AC_REQUIRE([AM_PROG_CC_STDC])
151 AC_REQUIRE([AC_PROG_CPP])
152 AC_MSG_CHECKING([for function prototypes])
153 if test "$am_cv_prog_cc_stdc" != no; then
155 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
159 U=_ ANSI2KNR=./ansi2knr
160 # Ensure some checks needed by ansi2knr itself.
162 AC_CHECK_HEADERS(string.h)
165 AC_SUBST(ANSI2KNR)dnl
171 # @defmac AC_PROG_CC_STDC
172 # @maindex PROG_CC_STDC
174 # If the C compiler in not in ANSI C mode by default, try to add an option
175 # to output variable @code{CC} to make it so. This macro tries various
176 # options that select ANSI C on some system or another. It considers the
177 # compiler to be in ANSI C mode if it handles function prototypes correctly.
179 # If you use this macro, you should check after calling it whether the C
180 # compiler has been set to accept ANSI C; if not, the shell variable
181 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
182 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
183 # program @code{ansi2knr}, which comes with Ghostscript.
186 AC_DEFUN(AM_PROG_CC_STDC,
187 [AC_REQUIRE([AC_PROG_CC])
188 AC_BEFORE([$0], [AC_C_INLINE])
189 AC_BEFORE([$0], [AC_C_CONST])
190 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
191 dnl a magic option to avoid problems with ANSI preprocessor commands
193 dnl FIXME: can't do this because then AC_AIX won't work due to a
194 dnl circular dependency.
195 dnl AC_BEFORE([$0], [AC_PROG_CPP])
196 AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
197 AC_CACHE_VAL(am_cv_prog_cc_stdc,
198 [am_cv_prog_cc_stdc=no
200 # Don't try gcc -ansi; that turns off useful extensions and
201 # breaks some systems' header files.
203 # Ultrix and OSF/1 -std1
204 # HP-UX -Aa -D_HPUX_SOURCE
205 # SVR4 -Xc -D__EXTENSIONS__
206 for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
208 CC="$ac_save_CC $ac_arg"
212 #include <sys/types.h>
213 #include <sys/stat.h>
214 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
215 struct buf { int x; };
216 FILE * (*rcsopen) (struct buf *, struct stat *, int);
217 static char *e (p, i)
223 static char *f (char * (*g) (char **, int), char **p, ...)
228 s = g (p, va_arg (v,int));
232 int test (int i, double x);
233 struct s1 {int (*f) (int a);};
234 struct s2 {int (*f) (double a);};
235 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
239 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
241 [am_cv_prog_cc_stdc="$ac_arg"; break])
245 if test -z "$am_cv_prog_cc_stdc"; then
246 AC_MSG_RESULT([none needed])
248 AC_MSG_RESULT($am_cv_prog_cc_stdc)
250 case "x$am_cv_prog_cc_stdc" in
252 *) CC="$CC $am_cv_prog_cc_stdc" ;;
257 dnl macros for type checks not covered by autoconf
259 dnl MUTT_C99_INTTYPES
263 # Check for C99 integer type definitions, or define if missing
264 AC_DEFUN([MUTT_C99_INTTYPES],
266 AC_CHECK_HEADERS([inttypes.h])
267 AC_CHECK_TYPE([uint32_t],
268 [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
269 [AC_CHECK_SIZEOF(short)
271 AC_CHECK_SIZEOF(long)
272 AC_CHECK_SIZEOF(long long)])
273 AH_VERBATIM([X_HAVE_C99_INTTYPES],
274 [#ifndef HAVE_C99_INTTYPES
275 # if SIZEOF_SHORT == 4
276 typedef unsigned short uint32_t;
277 # elif SIZEOF_INT == 4
278 typedef unsigned int uint32_t;
279 # elif SIZEOF_LONG == 4
280 typedef unsigned long uint32_t;
283 typedef unsigned int uint64_t;
284 # elif SIZEOF_LONG == 8
285 typedef unsigned long uint64_t;
286 # elif SIZEOF_LONG_LONG == 8
287 typedef unsigned long long uint64_t;
293 dnl ---------------------------------------------------------------------------
294 dnl Look for the curses libraries. Older curses implementations may require
295 dnl termcap/termlib to be linked as well.
296 AC_DEFUN([CF_CURSES_LIBS],[
297 AC_CHECK_FUNC(initscr,,[
298 case $host_os in #(vi
300 AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
303 AC_CHECK_LIB(cur_colr,initscr,[
304 LIBS="-lcur_colr $LIBS"
305 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
306 ac_cv_func_initscr=yes
308 AC_CHECK_LIB(Hcurses,initscr,[
309 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
310 LIBS="-lHcurses $LIBS"
311 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
312 ac_cv_func_initscr=yes
315 linux*) # Suse Linux does not follow /usr/lib convention
320 if test ".$With5lib" != ".no" ; then
321 if test -d /usr/5lib ; then
323 CPPFLAGS="$CPPFLAGS -I/usr/5include"
324 LIBS="$LIBS -L/usr/5lib"
328 if test ".$ac_cv_func_initscr" != .yes ; then
333 # Check for library containing tgoto. Do this before curses library
334 # because it may be needed to link the test-case for initscr.
335 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
336 for cf_term_lib in termcap termlib unknown
338 AC_CHECK_LIB($cf_term_lib,tgoto,[break])
342 # Check for library containing initscr
343 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
344 for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
346 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
348 test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
350 LIBS="-l$cf_curs_lib $cf_save_LIBS"
351 if test "$cf_term_lib" = unknown ; then
352 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
353 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
357 AC_MSG_RESULT($cf_result)
358 test $cf_result = no && AC_ERROR(Cannot link curses library)
359 elif test "$cf_term_lib" != predefined ; then
360 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
361 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
362 [initscr(); tgoto((char *)0, 0, 0);],
365 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
366 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
371 AC_MSG_RESULT($cf_result)
377 dnl ---------------------------------------------------------------------------
378 dnl Check if a function is declared by including a set of include files.
379 dnl Invoke the corresponding actions according to whether it is found or not.
381 dnl Gcc (unlike other compilers) will only warn about the miscast assignment
382 dnl in the first test, but most compilers will oblige with an error in the
385 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
386 AC_DEFUN([CF_CHECK_FUNCDECL],
388 AC_MSG_CHECKING([for $2 declaration])
389 AC_CACHE_VAL(ac_cv_func_decl_$2,
390 [AC_TRY_COMPILE([$1],
392 extern int ${ac_func}();
396 int (*p)() = ${ac_func};
398 eval "ac_cv_func_decl_$2=yes"],[
399 eval "ac_cv_func_decl_$2=no"])],[
400 eval "ac_cv_func_decl_$2=yes"])])
401 if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then
403 ifelse([$3], , :, [$3])
410 dnl ---------------------------------------------------------------------------
411 dnl Check if functions are declared by including a set of include files.
412 dnl and define DECL_XXX if not.
414 dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
415 AC_DEFUN([CF_CHECK_FUNCDECLS],
418 CF_CHECK_FUNCDECL([$1], $ac_func,
420 CF_UPPER(ac_tr_func,HAVE_$ac_func)
421 AC_DEFINE_UNQUOTED($ac_tr_func) $3],
425 dnl CF_UPPER(ac_tr_func,DECL_$ac_func)
426 dnl AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl
429 dnl ---------------------------------------------------------------------------
430 dnl Make an uppercase version of a variable
435 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
438 dnl ---------------------------------------------------------------------------
440 # Define a conditional.
442 AC_DEFUN(AM_CONDITIONAL,
453 # gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations
454 # Brendan Cully <brendan@kublai.com> 20010529
456 dnl MUTT_AM_PATH_GSSAPI(PREFIX)
457 dnl Search for a GSSAPI implementation in the standard locations plus PREFIX,
458 dnl if it is set and not "yes".
459 dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found.
460 dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found
461 AC_DEFUN([MUTT_AM_PATH_GSSAPI],
465 saved_CPPFLAGS="$CPPFLAGS"
466 saved_LDFLAGS="$LDFLAGS"
468 dnl First try krb5-config
469 if test "$GSSAPI_PREFIX" != "yes"
471 krb5_path="$GSSAPI_PREFIX/bin"
475 AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path)
476 if test "$KRB5CFGPATH" != "none"
478 GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
479 GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`"
480 case "`$KRB5CFGPATH --version`" in
481 "Kerberos 5 "*) GSSAPI_IMPL="MIT";;
482 ?eimdal*) GSSAPI_IMPL="Heimdal";;
483 *) GSSAPI_IMPL="Unknown";;
486 dnl No krb5-config, run the old code
487 if test "$GSSAPI_PREFIX" != "yes"
489 GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include"
490 GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib"
491 CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
492 LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
495 dnl New MIT kerberos V support
496 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, [
498 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
499 ],, -lkrb5 -lk5crypto -lcom_err)
501 dnl Heimdal kerberos V support
502 if test "$GSSAPI_IMPL" = "none"
504 AC_CHECK_LIB(gssapi, gss_init_sec_context, [
505 GSSAPI_IMPL="Heimdal"
506 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken"
507 GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"
508 ],, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err)
511 dnl Old MIT Kerberos V
512 dnl Note: older krb5 distributions use -lcrypto instead of
513 dnl -lk5crypto, which collides with OpenSSL. One way of dealing
514 dnl with that is to extract all objects from krb5's libcrypto
515 dnl and from openssl's libcrypto into the same directory, then
516 dnl to create a new libcrypto from these.
517 if test "$GSSAPI_IMPL" = "none"
519 AC_CHECK_LIB(gssapi_krb5, g_order_init, [
520 GSSAPI_IMPL="OldMIT",
521 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
522 ],, -lkrb5 -lcrypto -lcom_err)
526 CPPFLAGS="$saved_CPPFLAGS"
527 LDFLAGS="$saved_LDFLAGS"
531 dnl Autoconf macros for libgnutls
534 # Modified for mutt 20050210 Brendan Cully
535 # Modified for LIBGNUTLS -- nmav
536 # Configure paths for LIBGCRYPT
537 # Shamelessly stolen from the one of XDELTA by Owen Taylor
538 # Werner Koch 99-12-09
540 dnl MUTT_AM_PATH_GNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
541 dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
543 AC_DEFUN([MUTT_AM_PATH_GNUTLS],
545 dnl Get the cflags and libraries from the libgnutls-config script
547 libgnutls_config_prefix=$1
548 min_libgnutls_version=0.1.0
550 if test x$libgnutls_config_prefix != x ; then
551 if test x${LIBGNUTLS_CONFIG+set} != xset ; then
552 LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
556 AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
557 AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
559 if test "$LIBGNUTLS_CONFIG" = "no" ; then
562 LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
563 LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
564 libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
567 ac_save_CFLAGS="$CFLAGS"
569 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
570 LIBS="$LIBS $LIBGNUTLS_LIBS"
573 dnl Now check if the installed libgnutls is sufficiently new. Also sanity
574 dnl checks the results of libgnutls-config to some extent
576 rm -f conf.libgnutlstest
581 #include <gnutls/gnutls.h>
586 system ("touch conf.libgnutlstest");
588 if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
590 printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
591 "$libgnutls_config_version", gnutls_check_version(NULL) );
592 printf("*** was found! If libgnutls-config was correct, then it is best\n");
593 printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
594 printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
595 printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
596 printf("*** required on your system.\n");
597 printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
598 printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
599 printf("*** before re-running configure\n");
601 else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
603 printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
604 printf("*** library (version %s)\n", gnutls_check_version(NULL) );
608 if ( gnutls_check_version( "$min_libgnutls_version" ) )
614 printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
615 gnutls_check_version(NULL) );
616 printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
617 "$min_libgnutls_version" );
618 printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
620 printf("*** If you have already installed a sufficiently new version, this error\n");
621 printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
622 printf("*** being found. The easiest way to fix this is to remove the old version\n");
623 printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
624 printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
625 printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
626 printf("*** so that the correct libraries are found at run-time))\n");
631 ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
632 CFLAGS="$ac_save_CFLAGS"
636 if test "x$no_libgnutls" = x ; then
638 dnl some openssl compatibility code was moved in gnutls 1.2
639 AC_CHECK_HEADERS([gnutls/openssl.h])
640 ifelse([$2], , :, [$2])
642 if test -f conf.libgnutlstest ; then
647 if test "$LIBGNUTLS_CONFIG" = "no" ; then
648 echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
649 echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
650 echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
651 echo "*** full path to libgnutls-config."
653 if test -f conf.libgnutlstest ; then
656 echo "*** Could not run libgnutls test program, checking why..."
657 CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
658 LIBS="$LIBS $LIBGNUTLS_LIBS"
663 #include <gnutls/gnutls.h>
664 ], [ return !!gnutls_check_version(NULL); ],
665 [ echo "*** The test program compiled, but did not run. This usually means"
666 echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
667 echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
668 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
669 echo "*** to the installed location Also, make sure you have run ldconfig if that"
670 echo "*** is required on your system"
672 echo "*** If you have an old version installed, it is best to remove it, although"
673 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
675 [ echo "*** The test program failed to compile or link. See the file config.log for the"
676 echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
677 echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
678 echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
679 CFLAGS="$ac_save_CFLAGS"
685 ifelse([$3], , :, [$3])
687 rm -f conf.libgnutlstest
688 AC_SUBST(LIBGNUTLS_CFLAGS)
689 AC_SUBST(LIBGNUTLS_LIBS)
692 dnl *-*wedit:notab*-* Please keep this as the last line.
694 # Macro to add for using GNU gettext.
695 # Ulrich Drepper <drepper@cygnus.com>, 1995.
698 # Slightly modified by Thomas Roessler <roessler@does-not-exist.org>
699 # Updated to gettext-0.10.38 by Edmund Grimley Evans <edmundo@rano.org>
700 # Updated to gettext-0.10.40 by Andrew W. Nosenko <awn@bcs.zp.ua>
703 # This file can be copied and used freely without restrictions. It can
704 # be used in projects which are not available under the GNU General Public
705 # License or the GNU Library General Public License but which still want
706 # to provide support for the GNU gettext functionality.
707 # Please note that the actual code of the GNU gettext library is covered
708 # by the GNU Library General Public License, and the rest of the GNU
709 # gettext package package is covered by the GNU General Public License.
710 # They are *not* in the public domain.
714 dnl Usage: MUTT_AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
715 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
716 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
717 dnl depending on --{enable,disable}-{shared,static} and on the presence of
718 dnl AM-DISABLE-SHARED). Otherwise, a static library
719 dnl $(top_builddir)/intl/libintl.a will be created.
720 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
721 dnl implementations (in libc or libintl) without the ngettext() function
723 dnl LIBDIR is used to find the intl libraries. If empty,
724 dnl the value `$(top_builddir)/intl/' is used.
726 dnl The result of the configuration is one of three cases:
727 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
729 dnl Catalog format: GNU --> install in $(datadir)
730 dnl Catalog extension: .mo after installation, .gmo in source tree
731 dnl 2) GNU gettext has been found in the system's C library.
732 dnl Catalog format: GNU --> install in $(datadir)
733 dnl Catalog extension: .mo after installation, .gmo in source tree
734 dnl 3) No internationalization, always use English msgid.
735 dnl Catalog format: none
736 dnl Catalog extension: none
737 dnl The use of .gmo is historical (it was needed to avoid overwriting the
738 dnl GNU format catalogs when building on a platform with an X/Open gettext),
739 dnl but we keep it in order not to force irrelevant filename changes on the
742 AC_DEFUN([MUTT_AM_WITH_NLS],
743 [AC_MSG_CHECKING([whether NLS is requested])
744 dnl Default is enabled NLS
746 [ --disable-nls Do not use Native Language Support],
747 USE_NLS=$enableval, USE_NLS=yes)
748 AC_MSG_RESULT($USE_NLS)
751 BUILD_INCLUDED_LIBINTL=no
752 USE_INCLUDED_LIBINTL=no
755 dnl If we use NLS figure out what method
756 if test "$USE_NLS" = "yes"; then
757 AC_DEFINE(ENABLE_NLS, 1,
758 [Define to 1 if translation of program messages to the user's native language
760 AC_MSG_CHECKING([whether included gettext is requested])
761 AC_ARG_WITH(included-gettext,
762 [ --with-included-gettext Use the GNU gettext library included here],
763 nls_cv_force_use_gnu_gettext=$withval,
764 nls_cv_force_use_gnu_gettext=no)
765 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
767 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
768 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
769 dnl User does not insist on using GNU NLS library. Figure out what
770 dnl to use. If GNU gettext is available we use this. Else we have
771 dnl to fall back to GNU NLS library.
774 dnl Add a version number to the cache macros.
775 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
776 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
778 AC_CHECK_HEADER(libintl.h,
779 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
780 [AC_TRY_LINK([#include <libintl.h>
781 extern int _nl_msg_cat_cntr;],
782 [bindtextdomain ("", "");
783 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
784 gt_cv_func_gnugettext_libc=yes,
785 gt_cv_func_gnugettext_libc=no)])
787 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
788 AC_CACHE_CHECK([for GNU gettext in libintl],
789 gt_cv_func_gnugettext_libintl,
790 [gt_save_LIBS="$LIBS"
791 LIBS="$LIBS -lintl $LIBICONV"
792 AC_TRY_LINK([#include <libintl.h>
793 extern int _nl_msg_cat_cntr;],
794 [bindtextdomain ("", "");
795 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
796 gt_cv_func_gnugettext_libintl=yes,
797 gt_cv_func_gnugettext_libintl=no)
798 LIBS="$gt_save_LIBS"])
801 dnl If an already present or preinstalled GNU gettext() is found,
802 dnl use it. But if this macro is used in GNU gettext, and GNU
803 dnl gettext is already preinstalled in libintl, we update this
804 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
805 if test "$gt_cv_func_gnugettext_libc" = "yes" \
806 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
807 && test "$PACKAGE" != gettext; }; then
808 AC_DEFINE(HAVE_GETTEXT, 1,
809 [Define if the GNU gettext() function is already present or preinstalled.])
811 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
812 dnl If iconv() is in a separate libiconv library, then anyone
813 dnl linking with libintl{.a,.so} also needs to link with
815 INTLLIBS="-lintl $LIBICONV"
819 LIBS="$LIBS $INTLLIBS"
820 AC_CHECK_FUNCS(dcgettext)
823 dnl Search for GNU msgfmt in the PATH.
824 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
825 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
826 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
828 dnl Search for GNU xgettext in the PATH.
829 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
830 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
836 if test "$CATOBJEXT" = "NONE"; then
837 dnl GNU gettext is not found in the C library.
838 dnl Fall back on GNU gettext library.
839 nls_cv_use_gnu_gettext=yes
843 if test "$nls_cv_use_gnu_gettext" = "yes"; then
844 dnl Mark actions used to generate GNU NLS library.
845 INTLOBJS="\$(GETTOBJS)"
846 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
847 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
848 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
849 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
850 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
852 BUILD_INCLUDED_LIBINTL=yes
853 USE_INCLUDED_LIBINTL=yes
855 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
856 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
859 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
860 dnl Test whether we really found GNU msgfmt.
861 if test "$GMSGFMT" != ":"; then
862 dnl If it is no GNU msgfmt we define it as : so that the
863 dnl Makefiles still can work.
864 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
868 [found msgfmt program is not GNU msgfmt; ignore it])
873 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
874 dnl Test whether we really found GNU xgettext.
875 if test "$XGETTEXT" != ":"; then
876 dnl If it is no GNU xgettext we define it as : so that the
877 dnl Makefiles still can work.
878 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
882 [found xgettext program is not GNU xgettext; ignore it])
887 dnl We need to process the po/ directory.
891 [for ac_file in $CONFIG_FILES; do
892 # Support "outfile[:infile[:infile...]]"
894 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
896 # PO directories have a Makefile.in generated from Makefile.in.in.
897 case "$ac_file" in */Makefile.in)
898 # Adjust a relative srcdir.
899 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
900 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
901 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
902 # In autoconf-2.13 it is called $ac_given_srcdir.
903 # In autoconf-2.50 it is called $srcdir.
904 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
905 case "$ac_given_srcdir" in
906 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
907 /*) top_srcdir="$ac_given_srcdir" ;;
908 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
910 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
911 rm -f "$ac_dir/POTFILES"
912 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
913 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
914 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
915 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
922 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
923 dnl to 'yes' because some of the testsuite requires it.
924 if test "$PACKAGE" = gettext; then
925 BUILD_INCLUDED_LIBINTL=yes
928 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
929 dnl because plural.y uses bison specific features. It requires at least
930 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
932 dnl bison is only needed for the maintainer (who touches plural.y). But in
933 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
934 dnl the rule in general Makefile. Now, some people carelessly touch the
935 dnl files or have a broken "make" program, hence the plural.c rule will
936 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
937 dnl present or too old.
938 AC_CHECK_PROGS([INTLBISON], [bison])
939 if test -z "$INTLBISON"; then
942 dnl Found it, now check the version.
943 AC_MSG_CHECKING([version of bison])
944 changequote(<<,>>)dnl
945 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
946 case $ac_prog_version in
947 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
948 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
950 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
951 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
953 AC_MSG_RESULT([$ac_prog_version])
955 if test $ac_verc_fail = yes; then
959 dnl These rules are solely for the distribution goal. While doing this
960 dnl we only have to keep exactly one list of the available catalogs
962 for lang in $ALL_LINGUAS; do
963 GMOFILES="$GMOFILES $lang.gmo"
964 POFILES="$POFILES $lang.po"
967 dnl Make all variables we use known to autoconf.
968 AC_SUBST(BUILD_INCLUDED_LIBINTL)
969 AC_SUBST(USE_INCLUDED_LIBINTL)
978 dnl For backward compatibility. Some configure.ins may be using this.
982 dnl For backward compatibility. Some Makefiles may be using this.
984 AC_SUBST(DATADIRNAME)
986 dnl For backward compatibility. Some Makefiles may be using this.
990 dnl For backward compatibility. Some Makefiles may be using this.
995 dnl Usage: Just like MUTT_AM_WITH_NLS, which see.
996 AC_DEFUN([MUTT_AM_GNU_GETTEXT],
997 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
998 AC_REQUIRE([AC_PROG_CC])dnl
999 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1000 AC_REQUIRE([AC_PROG_RANLIB])dnl
1001 AC_REQUIRE([AC_ISC_POSIX])dnl
1002 AC_REQUIRE([AC_HEADER_STDC])dnl
1003 AC_REQUIRE([AC_C_CONST])dnl
1004 AC_REQUIRE([AC_C_INLINE])dnl
1005 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1006 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1007 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1008 AC_REQUIRE([AC_FUNC_MMAP])dnl
1009 AC_REQUIRE([MUTT_jm_GLIBC21])dnl
1011 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1012 stdlib.h string.h unistd.h sys/param.h])
1013 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1014 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1015 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1018 MUTT_AM_LANGINFO_CODESET
1020 MUTT_AM_WITH_NLS([$1],[$2],[$3])
1022 if test "x$CATOBJEXT" != "x"; then
1023 if test "x$ALL_LINGUAS" = "x"; then
1026 AC_MSG_CHECKING(for catalogs to be installed)
1028 for presentlang in $ALL_LINGUAS; do
1030 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1031 # Use the presentlang catalog if desiredlang is
1032 # a. equal to presentlang, or
1033 # b. a variant of presentlang (because in this case,
1034 # presentlang can be used as a fallback for messages
1035 # which are not translated in the desiredlang catalog).
1036 case "$desiredlang" in
1037 "$presentlang"*) useit=yes;;
1040 if test $useit = yes; then
1041 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1044 LINGUAS=$NEW_LINGUAS
1045 AC_MSG_RESULT($LINGUAS)
1048 dnl Construct list of names of catalog files to be constructed.
1049 if test -n "$LINGUAS"; then
1050 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1054 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1055 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1056 dnl Try to locate is.
1058 if test -n "$ac_aux_dir"; then
1059 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1061 if test -z "$MKINSTALLDIRS"; then
1062 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1064 AC_SUBST(MKINSTALLDIRS)
1066 dnl Enable libtool support if the surrounding package wishes it.
1067 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1068 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1071 # Search path for a program which passes the given test.
1072 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1074 # This file can be copied and used freely without restrictions. It can
1075 # be used in projects which are not available under the GNU General Public
1076 # License or the GNU Library General Public License but which still want
1077 # to provide support for the GNU gettext functionality.
1078 # Please note that the actual code of the GNU gettext library is covered
1079 # by the GNU Library General Public License, and the rest of the GNU
1080 # gettext package package is covered by the GNU General Public License.
1081 # They are *not* in the public domain.
1085 dnl MUTT_AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1086 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1087 AC_DEFUN([MUTT_AM_PATH_PROG_WITH_TEST],
1088 [# Extract the first word of "$2", so it can be a program name with args.
1089 set dummy $2; ac_word=[$]2
1090 AC_MSG_CHECKING([for $ac_word])
1091 AC_CACHE_VAL(ac_cv_path_$1,
1094 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1097 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1098 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1099 test -z "$ac_dir" && ac_dir=.
1100 if test -f $ac_dir/$ac_word; then
1102 ac_cv_path_$1="$ac_dir/$ac_word"
1108 dnl If no 4th arg is given, leave the cache variable unset,
1109 dnl so AC_PATH_PROGS will keep looking.
1110 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1115 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1116 AC_MSG_RESULT([$]$1)
1125 # Test for the GNU C Library, version 2.1 or newer.
1126 # From Bruno Haible.
1128 AC_DEFUN([jm_GLIBC21],
1130 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1131 ac_cv_gnu_library_2_1,
1132 [AC_EGREP_CPP([Lucky GNU user],
1134 #include <features.h>
1135 #ifdef __GNU_LIBRARY__
1136 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1141 ac_cv_gnu_library_2_1=yes,
1142 ac_cv_gnu_library_2_1=no)
1146 GLIBC21="$ac_cv_gnu_library_2_1"
1152 dnl From Bruno Haible.
1154 AC_DEFUN([MUTT_AM_ICONV],
1156 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1157 dnl those with the standalone portable GNU libiconv installed).
1159 AC_ARG_WITH([libiconv-prefix],
1160 [ --with-libiconv-prefix=DIR Search for libiconv in DIR/include and DIR/lib], [
1161 for dir in `echo "$withval" | tr : ' '`; do
1162 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1163 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1167 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1168 am_cv_func_iconv="no, consider installing GNU libiconv"
1170 AC_TRY_LINK([#include <stdlib.h>
1171 #include <iconv.h>],
1172 [iconv_t cd = iconv_open("","");
1173 iconv(cd,NULL,NULL,NULL,NULL);
1175 am_cv_func_iconv=yes)
1176 if test "$am_cv_func_iconv" != yes; then
1177 am_save_LIBS="$LIBS"
1178 LIBS="$LIBS -liconv"
1179 AC_TRY_LINK([#include <stdlib.h>
1180 #include <iconv.h>],
1181 [iconv_t cd = iconv_open("","");
1182 iconv(cd,NULL,NULL,NULL,NULL);
1185 am_cv_func_iconv=yes)
1186 LIBS="$am_save_LIBS"
1189 if test "$am_cv_func_iconv" = yes; then
1190 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1191 AC_MSG_CHECKING([for iconv declaration])
1192 AC_CACHE_VAL(am_cv_proto_iconv, [
1200 #if defined(__STDC__) || defined(__cplusplus)
1201 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1205 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1206 am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"])
1207 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1208 AC_MSG_RESULT([$]{ac_t:-
1209 }[$]am_cv_proto_iconv)
1210 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1211 [Define as const if the declaration of iconv() needs const.])
1214 if test "$am_cv_lib_iconv" = yes; then
1222 dnl From Bruno Haible.
1224 AC_DEFUN([MUTT_AM_LANGINFO_CODESET],
1226 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1227 [AC_TRY_LINK([#include <langinfo.h>],
1228 [char* cs = nl_langinfo(CODESET);],
1229 am_cv_langinfo_codeset=yes,
1230 am_cv_langinfo_codeset=no)
1232 if test $am_cv_langinfo_codeset = yes; then
1233 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1234 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1238 # Check whether LC_MESSAGES is available in <locale.h>.
1239 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1241 # This file can be copied and used freely without restrictions. It can
1242 # be used in projects which are not available under the GNU General Public
1243 # License or the GNU Library General Public License but which still want
1244 # to provide support for the GNU gettext functionality.
1245 # Please note that the actual code of the GNU gettext library is covered
1246 # by the GNU Library General Public License, and the rest of the GNU
1247 # gettext package package is covered by the GNU General Public License.
1248 # They are *not* in the public domain.
1252 AC_DEFUN([MUTT_AM_LC_MESSAGES],
1253 [if test $ac_cv_header_locale_h = yes; then
1254 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1255 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1256 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1257 if test $am_cv_val_LC_MESSAGES = yes; then
1258 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1259 [Define if your <locale.h> file defines LC_MESSAGES.])
1265 # Test for the GNU C Library, version 2.1 or newer.
1266 # From Bruno Haible.
1268 AC_DEFUN([MUTT_jm_GLIBC21],
1270 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1271 ac_cv_gnu_library_2_1,
1272 [AC_EGREP_CPP([Lucky GNU user],
1274 #include <features.h>
1275 #ifdef __GNU_LIBRARY__
1276 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1281 ac_cv_gnu_library_2_1=yes,
1282 ac_cv_gnu_library_2_1=no)
1286 GLIBC21="$ac_cv_gnu_library_2_1"
1292 dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
1294 dnl libesmtp often requires linking against -lpthread or -lc_r (BSD).
1295 dnl This macro attempts to centralize this code.
1297 AC_DEFUN([MUTT_AM_LIBESMTP],
1301 [ --with-libesmtp=DIR Compile in support for libesmtp for the MTA],
1302 [ if test "$with_libesmtp" != "no"
1304 mutt_libesmtp_check_path="$PATH"
1306 if test "$with_libesmtp" != "yes"
1308 mutt_libesmtp_check_path="$tmp_path:$withval/bin"
1311 dnl 1. Find libesmtp-config
1312 AC_PATH_PROG([mutt_libesmtp_config_path],
1315 [$mutt_libesmtp_check_path])
1317 if test "$mutt_libesmtp_config_path" = "no"
1319 AC_MSG_ERROR([libesmtp-config binary not found.])
1322 dnl 2. Get CFLAGS and LIBS from libesmtp-config
1323 mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
1324 mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
1326 dnl 3. Verify libesmtp.h can be found with these settings
1327 temp_CFLAGS="$CFLAGS"
1328 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1329 AC_CHECK_HEADER([libesmtp.h],
1331 AC_MSG_ERROR([Could not find libesmtp.h]))
1332 CFLAGS="$temp_CFLAGS"
1334 dnl 4. Verify the libesmtp library can be linked in
1335 temp_CFLAGS="$CFLAGS"
1337 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1338 LIBS="$LIBS $mutt_libesmtp_libs"
1339 AC_CHECK_LIB([esmtp],
1340 [smtp_create_session],
1342 AC_MSG_ERROR([Could not find libesmtp]))
1343 CFLAGS="$temp_CFLAGS"
1346 dnl 5. Export use_libesmtp variable so configure.in can
1347 dnl act accordingly.