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" ;;
256 dnl ---------------------------------------------------------------------------
257 dnl Look for the curses libraries. Older curses implementations may require
258 dnl termcap/termlib to be linked as well.
259 AC_DEFUN([CF_CURSES_LIBS],[
260 AC_CHECK_FUNC(initscr,,[
261 case $host_os in #(vi
263 AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
266 AC_CHECK_LIB(cur_colr,initscr,[
267 LIBS="-lcur_colr $LIBS"
268 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
269 ac_cv_func_initscr=yes
271 AC_CHECK_LIB(Hcurses,initscr,[
272 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
273 LIBS="-lHcurses $LIBS"
274 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
275 ac_cv_func_initscr=yes
278 linux*) # Suse Linux does not follow /usr/lib convention
283 if test ".$With5lib" != ".no" ; then
284 if test -d /usr/5lib ; then
286 CPPFLAGS="$CPPFLAGS -I/usr/5include"
287 LIBS="$LIBS -L/usr/5lib"
291 if test ".$ac_cv_func_initscr" != .yes ; then
296 # Check for library containing tgoto. Do this before curses library
297 # because it may be needed to link the test-case for initscr.
298 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
299 for cf_term_lib in termcap termlib unknown
301 AC_CHECK_LIB($cf_term_lib,tgoto,[break])
305 # Check for library containing initscr
306 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
307 for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
309 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
311 test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
313 LIBS="-l$cf_curs_lib $cf_save_LIBS"
314 if test "$cf_term_lib" = unknown ; then
315 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
316 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
320 AC_MSG_RESULT($cf_result)
321 test $cf_result = no && AC_ERROR(Cannot link curses library)
322 elif test "$cf_term_lib" != predefined ; then
323 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
324 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
325 [initscr(); tgoto((char *)0, 0, 0);],
328 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
329 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
334 AC_MSG_RESULT($cf_result)
340 dnl ---------------------------------------------------------------------------
341 dnl Check if a function is declared by including a set of include files.
342 dnl Invoke the corresponding actions according to whether it is found or not.
344 dnl Gcc (unlike other compilers) will only warn about the miscast assignment
345 dnl in the first test, but most compilers will oblige with an error in the
348 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
349 AC_DEFUN([CF_CHECK_FUNCDECL],
351 AC_MSG_CHECKING([for $2 declaration])
352 AC_CACHE_VAL(ac_cv_func_decl_$2,
353 [AC_TRY_COMPILE([$1],
355 extern int ${ac_func}();
359 int (*p)() = ${ac_func};
361 eval "ac_cv_func_decl_$2=yes"],[
362 eval "ac_cv_func_decl_$2=no"])],[
363 eval "ac_cv_func_decl_$2=yes"])])
364 if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then
366 ifelse([$3], , :, [$3])
373 dnl ---------------------------------------------------------------------------
374 dnl Check if functions are declared by including a set of include files.
375 dnl and define DECL_XXX if not.
377 dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
378 AC_DEFUN([CF_CHECK_FUNCDECLS],
381 CF_CHECK_FUNCDECL([$1], $ac_func,
383 CF_UPPER(ac_tr_func,HAVE_$ac_func)
384 AC_DEFINE_UNQUOTED($ac_tr_func) $3],
388 dnl CF_UPPER(ac_tr_func,DECL_$ac_func)
389 dnl AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl
392 dnl ---------------------------------------------------------------------------
393 dnl Make an uppercase version of a variable
398 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
401 dnl ---------------------------------------------------------------------------
403 # Define a conditional.
405 AC_DEFUN(AM_CONDITIONAL,
416 # gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations
417 # Brendan Cully <brendan@kublai.com> 20010529
419 dnl MUTT_AM_PATH_GSSAPI(PREFIX)
420 dnl Search for a GSSAPI implementation in the standard locations plus PREFIX,
421 dnl if it is set and not "yes".
422 dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found.
423 dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found
424 AC_DEFUN([MUTT_AM_PATH_GSSAPI],
428 saved_CPPFLAGS="$CPPFLAGS"
429 saved_LDFLAGS="$LDFLAGS"
431 dnl First try krb5-config
432 if test "$GSSAPI_PREFIX" != "yes"
434 krb5_path="$GSSAPI_PREFIX/bin"
438 AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path)
439 if test "$KRB5CFGPATH" != "none"
441 GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
442 GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`"
443 case "`$KRB5CFGPATH --version`" in
444 "Kerberos 5 "*) GSSAPI_IMPL="MIT";;
445 ?eimdal*) GSSAPI_IMPL="Heimdal";;
446 *) GSSAPI_IMPL="Unknown";;
449 dnl No krb5-config, run the old code
450 if test "$GSSAPI_PREFIX" != "yes"
452 GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include"
453 GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib"
454 CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
455 LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
458 dnl New MIT kerberos V support
459 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, [
461 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
462 ],, -lkrb5 -lk5crypto -lcom_err)
464 dnl Heimdal kerberos V support
465 if test "$GSSAPI_IMPL" = "none"
467 AC_CHECK_LIB(gssapi, gss_init_sec_context, [
468 GSSAPI_IMPL="Heimdal"
469 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken"
470 GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"
471 ],, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err)
474 dnl Old MIT Kerberos V
475 dnl Note: older krb5 distributions use -lcrypto instead of
476 dnl -lk5crypto, which collides with OpenSSL. One way of dealing
477 dnl with that is to extract all objects from krb5's libcrypto
478 dnl and from openssl's libcrypto into the same directory, then
479 dnl to create a new libcrypto from these.
480 if test "$GSSAPI_IMPL" = "none"
482 AC_CHECK_LIB(gssapi_krb5, g_order_init, [
483 GSSAPI_IMPL="OldMIT",
484 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
485 ],, -lkrb5 -lcrypto -lcom_err)
489 CPPFLAGS="$saved_CPPFLAGS"
490 LDFLAGS="$saved_LDFLAGS"
494 # Macro to add for using GNU gettext.
495 # Ulrich Drepper <drepper@cygnus.com>, 1995.
498 # Slightly modified by Thomas Roessler <roessler@does-not-exist.org>
499 # Updated to gettext-0.10.38 by Edmund Grimley Evans <edmundo@rano.org>
500 # Updated to gettext-0.10.40 by Andrew W. Nosenko <awn@bcs.zp.ua>
503 # This file can be copied and used freely without restrictions. It can
504 # be used in projects which are not available under the GNU General Public
505 # License or the GNU Library General Public License but which still want
506 # to provide support for the GNU gettext functionality.
507 # Please note that the actual code of the GNU gettext library is covered
508 # by the GNU Library General Public License, and the rest of the GNU
509 # gettext package package is covered by the GNU General Public License.
510 # They are *not* in the public domain.
514 dnl Usage: MUTT_AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
515 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
516 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
517 dnl depending on --{enable,disable}-{shared,static} and on the presence of
518 dnl AM-DISABLE-SHARED). Otherwise, a static library
519 dnl $(top_builddir)/intl/libintl.a will be created.
520 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
521 dnl implementations (in libc or libintl) without the ngettext() function
523 dnl LIBDIR is used to find the intl libraries. If empty,
524 dnl the value `$(top_builddir)/intl/' is used.
526 dnl The result of the configuration is one of three cases:
527 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
529 dnl Catalog format: GNU --> install in $(datadir)
530 dnl Catalog extension: .mo after installation, .gmo in source tree
531 dnl 2) GNU gettext has been found in the system's C library.
532 dnl Catalog format: GNU --> install in $(datadir)
533 dnl Catalog extension: .mo after installation, .gmo in source tree
534 dnl 3) No internationalization, always use English msgid.
535 dnl Catalog format: none
536 dnl Catalog extension: none
537 dnl The use of .gmo is historical (it was needed to avoid overwriting the
538 dnl GNU format catalogs when building on a platform with an X/Open gettext),
539 dnl but we keep it in order not to force irrelevant filename changes on the
542 AC_DEFUN([MUTT_AM_WITH_NLS],
543 [AC_MSG_CHECKING([whether NLS is requested])
544 dnl Default is enabled NLS
546 [ --disable-nls Do not use Native Language Support],
547 USE_NLS=$enableval, USE_NLS=yes)
548 AC_MSG_RESULT($USE_NLS)
551 BUILD_INCLUDED_LIBINTL=no
552 USE_INCLUDED_LIBINTL=no
555 dnl If we use NLS figure out what method
556 if test "$USE_NLS" = "yes"; then
557 AC_DEFINE(ENABLE_NLS, 1,
558 [Define to 1 if translation of program messages to the user's native language
560 AC_MSG_CHECKING([whether included gettext is requested])
561 AC_ARG_WITH(included-gettext,
562 [ --with-included-gettext Use the GNU gettext library included here],
563 nls_cv_force_use_gnu_gettext=$withval,
564 nls_cv_force_use_gnu_gettext=no)
565 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
567 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
568 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
569 dnl User does not insist on using GNU NLS library. Figure out what
570 dnl to use. If GNU gettext is available we use this. Else we have
571 dnl to fall back to GNU NLS library.
574 dnl Add a version number to the cache macros.
575 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
576 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
578 AC_CHECK_HEADER(libintl.h,
579 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
580 [AC_TRY_LINK([#include <libintl.h>
581 extern int _nl_msg_cat_cntr;],
582 [bindtextdomain ("", "");
583 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
584 gt_cv_func_gnugettext_libc=yes,
585 gt_cv_func_gnugettext_libc=no)])
587 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
588 AC_CACHE_CHECK([for GNU gettext in libintl],
589 gt_cv_func_gnugettext_libintl,
590 [gt_save_LIBS="$LIBS"
591 LIBS="$LIBS -lintl $LIBICONV"
592 AC_TRY_LINK([#include <libintl.h>
593 extern int _nl_msg_cat_cntr;],
594 [bindtextdomain ("", "");
595 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
596 gt_cv_func_gnugettext_libintl=yes,
597 gt_cv_func_gnugettext_libintl=no)
598 LIBS="$gt_save_LIBS"])
601 dnl If an already present or preinstalled GNU gettext() is found,
602 dnl use it. But if this macro is used in GNU gettext, and GNU
603 dnl gettext is already preinstalled in libintl, we update this
604 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
605 if test "$gt_cv_func_gnugettext_libc" = "yes" \
606 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
607 && test "$PACKAGE" != gettext; }; then
608 AC_DEFINE(HAVE_GETTEXT, 1,
609 [Define if the GNU gettext() function is already present or preinstalled.])
611 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
612 dnl If iconv() is in a separate libiconv library, then anyone
613 dnl linking with libintl{.a,.so} also needs to link with
615 INTLLIBS="-lintl $LIBICONV"
619 LIBS="$LIBS $INTLLIBS"
620 AC_CHECK_FUNCS(dcgettext)
623 dnl Search for GNU msgfmt in the PATH.
624 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
625 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
626 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
628 dnl Search for GNU xgettext in the PATH.
629 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
630 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
636 if test "$CATOBJEXT" = "NONE"; then
637 dnl GNU gettext is not found in the C library.
638 dnl Fall back on GNU gettext library.
639 nls_cv_use_gnu_gettext=yes
643 if test "$nls_cv_use_gnu_gettext" = "yes"; then
644 dnl Mark actions used to generate GNU NLS library.
645 INTLOBJS="\$(GETTOBJS)"
646 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
647 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
648 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
649 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
650 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
652 BUILD_INCLUDED_LIBINTL=yes
653 USE_INCLUDED_LIBINTL=yes
655 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
656 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
659 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
660 dnl Test whether we really found GNU msgfmt.
661 if test "$GMSGFMT" != ":"; then
662 dnl If it is no GNU msgfmt we define it as : so that the
663 dnl Makefiles still can work.
664 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
668 [found msgfmt program is not GNU msgfmt; ignore it])
673 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
674 dnl Test whether we really found GNU xgettext.
675 if test "$XGETTEXT" != ":"; then
676 dnl If it is no GNU xgettext we define it as : so that the
677 dnl Makefiles still can work.
678 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
682 [found xgettext program is not GNU xgettext; ignore it])
687 dnl We need to process the po/ directory.
691 [for ac_file in $CONFIG_FILES; do
692 # Support "outfile[:infile[:infile...]]"
694 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
696 # PO directories have a Makefile.in generated from Makefile.in.in.
697 case "$ac_file" in */Makefile.in)
698 # Adjust a relative srcdir.
699 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
700 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
701 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
702 # In autoconf-2.13 it is called $ac_given_srcdir.
703 # In autoconf-2.50 it is called $srcdir.
704 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
705 case "$ac_given_srcdir" in
706 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
707 /*) top_srcdir="$ac_given_srcdir" ;;
708 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
710 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
711 rm -f "$ac_dir/POTFILES"
712 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
713 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
714 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
715 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
722 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
723 dnl to 'yes' because some of the testsuite requires it.
724 if test "$PACKAGE" = gettext; then
725 BUILD_INCLUDED_LIBINTL=yes
728 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
729 dnl because plural.y uses bison specific features. It requires at least
730 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
732 dnl bison is only needed for the maintainer (who touches plural.y). But in
733 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
734 dnl the rule in general Makefile. Now, some people carelessly touch the
735 dnl files or have a broken "make" program, hence the plural.c rule will
736 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
737 dnl present or too old.
738 AC_CHECK_PROGS([INTLBISON], [bison])
739 if test -z "$INTLBISON"; then
742 dnl Found it, now check the version.
743 AC_MSG_CHECKING([version of bison])
744 changequote(<<,>>)dnl
745 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
746 case $ac_prog_version in
747 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
748 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
750 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
751 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
753 AC_MSG_RESULT([$ac_prog_version])
755 if test $ac_verc_fail = yes; then
759 dnl These rules are solely for the distribution goal. While doing this
760 dnl we only have to keep exactly one list of the available catalogs
762 for lang in $ALL_LINGUAS; do
763 GMOFILES="$GMOFILES $lang.gmo"
764 POFILES="$POFILES $lang.po"
767 dnl Make all variables we use known to autoconf.
768 AC_SUBST(BUILD_INCLUDED_LIBINTL)
769 AC_SUBST(USE_INCLUDED_LIBINTL)
778 dnl For backward compatibility. Some configure.ins may be using this.
782 dnl For backward compatibility. Some Makefiles may be using this.
784 AC_SUBST(DATADIRNAME)
786 dnl For backward compatibility. Some Makefiles may be using this.
790 dnl For backward compatibility. Some Makefiles may be using this.
795 dnl Usage: Just like MUTT_AM_WITH_NLS, which see.
796 AC_DEFUN([MUTT_AM_GNU_GETTEXT],
797 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
798 AC_REQUIRE([AC_PROG_CC])dnl
799 AC_REQUIRE([AC_CANONICAL_HOST])dnl
800 AC_REQUIRE([AC_PROG_RANLIB])dnl
801 AC_REQUIRE([AC_ISC_POSIX])dnl
802 AC_REQUIRE([AC_HEADER_STDC])dnl
803 AC_REQUIRE([AC_C_CONST])dnl
804 AC_REQUIRE([AC_C_INLINE])dnl
805 AC_REQUIRE([AC_TYPE_OFF_T])dnl
806 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
807 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
808 AC_REQUIRE([AC_FUNC_MMAP])dnl
809 AC_REQUIRE([MUTT_jm_GLIBC21])dnl
811 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
812 stdlib.h string.h unistd.h sys/param.h])
813 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
814 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
815 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
818 MUTT_AM_LANGINFO_CODESET
820 MUTT_AM_WITH_NLS([$1],[$2],[$3])
822 if test "x$CATOBJEXT" != "x"; then
823 if test "x$ALL_LINGUAS" = "x"; then
826 AC_MSG_CHECKING(for catalogs to be installed)
828 for presentlang in $ALL_LINGUAS; do
830 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
831 # Use the presentlang catalog if desiredlang is
832 # a. equal to presentlang, or
833 # b. a variant of presentlang (because in this case,
834 # presentlang can be used as a fallback for messages
835 # which are not translated in the desiredlang catalog).
836 case "$desiredlang" in
837 "$presentlang"*) useit=yes;;
840 if test $useit = yes; then
841 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
845 AC_MSG_RESULT($LINGUAS)
848 dnl Construct list of names of catalog files to be constructed.
849 if test -n "$LINGUAS"; then
850 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
854 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
855 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
856 dnl Try to locate is.
858 if test -n "$ac_aux_dir"; then
859 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
861 if test -z "$MKINSTALLDIRS"; then
862 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
864 AC_SUBST(MKINSTALLDIRS)
866 dnl Enable libtool support if the surrounding package wishes it.
867 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
868 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
871 # Search path for a program which passes the given test.
872 # Ulrich Drepper <drepper@cygnus.com>, 1996.
874 # This file can be copied and used freely without restrictions. It can
875 # be used in projects which are not available under the GNU General Public
876 # License or the GNU Library General Public License but which still want
877 # to provide support for the GNU gettext functionality.
878 # Please note that the actual code of the GNU gettext library is covered
879 # by the GNU Library General Public License, and the rest of the GNU
880 # gettext package package is covered by the GNU General Public License.
881 # They are *not* in the public domain.
885 dnl MUTT_AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
886 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
887 AC_DEFUN([MUTT_AM_PATH_PROG_WITH_TEST],
888 [# Extract the first word of "$2", so it can be a program name with args.
889 set dummy $2; ac_word=[$]2
890 AC_MSG_CHECKING([for $ac_word])
891 AC_CACHE_VAL(ac_cv_path_$1,
894 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
897 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
898 for ac_dir in ifelse([$5], , $PATH, [$5]); do
899 test -z "$ac_dir" && ac_dir=.
900 if test -f $ac_dir/$ac_word; then
902 ac_cv_path_$1="$ac_dir/$ac_word"
908 dnl If no 4th arg is given, leave the cache variable unset,
909 dnl so AC_PATH_PROGS will keep looking.
910 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
915 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
925 # Test for the GNU C Library, version 2.1 or newer.
928 AC_DEFUN([jm_GLIBC21],
930 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
931 ac_cv_gnu_library_2_1,
932 [AC_EGREP_CPP([Lucky GNU user],
934 #include <features.h>
935 #ifdef __GNU_LIBRARY__
936 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
941 ac_cv_gnu_library_2_1=yes,
942 ac_cv_gnu_library_2_1=no)
946 GLIBC21="$ac_cv_gnu_library_2_1"
952 dnl From Bruno Haible.
954 AC_DEFUN([MUTT_AM_ICONV],
956 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
957 dnl those with the standalone portable GNU libiconv installed).
959 AC_ARG_WITH([libiconv-prefix],
960 [ --with-libiconv-prefix=DIR Search for libiconv in DIR/include and DIR/lib], [
961 for dir in `echo "$withval" | tr : ' '`; do
962 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
963 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
967 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
968 am_cv_func_iconv="no, consider installing GNU libiconv"
970 AC_TRY_LINK([#include <stdlib.h>
972 [iconv_t cd = iconv_open("","");
973 iconv(cd,NULL,NULL,NULL,NULL);
975 am_cv_func_iconv=yes)
976 if test "$am_cv_func_iconv" != yes; then
979 AC_TRY_LINK([#include <stdlib.h>
981 [iconv_t cd = iconv_open("","");
982 iconv(cd,NULL,NULL,NULL,NULL);
985 am_cv_func_iconv=yes)
989 if test "$am_cv_func_iconv" = yes; then
990 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
991 AC_MSG_CHECKING([for iconv declaration])
992 AC_CACHE_VAL(am_cv_proto_iconv, [
1000 #if defined(__STDC__) || defined(__cplusplus)
1001 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1005 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1006 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);"])
1007 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1008 AC_MSG_RESULT([$]{ac_t:-
1009 }[$]am_cv_proto_iconv)
1010 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1011 [Define as const if the declaration of iconv() needs const.])
1014 if test "$am_cv_lib_iconv" = yes; then
1022 dnl From Bruno Haible.
1024 AC_DEFUN([MUTT_AM_LANGINFO_CODESET],
1026 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1027 [AC_TRY_LINK([#include <langinfo.h>],
1028 [char* cs = nl_langinfo(CODESET);],
1029 am_cv_langinfo_codeset=yes,
1030 am_cv_langinfo_codeset=no)
1032 if test $am_cv_langinfo_codeset = yes; then
1033 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1034 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1038 # Check whether LC_MESSAGES is available in <locale.h>.
1039 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1041 # This file can be copied and used freely without restrictions. It can
1042 # be used in projects which are not available under the GNU General Public
1043 # License or the GNU Library General Public License but which still want
1044 # to provide support for the GNU gettext functionality.
1045 # Please note that the actual code of the GNU gettext library is covered
1046 # by the GNU Library General Public License, and the rest of the GNU
1047 # gettext package package is covered by the GNU General Public License.
1048 # They are *not* in the public domain.
1052 AC_DEFUN([MUTT_AM_LC_MESSAGES],
1053 [if test $ac_cv_header_locale_h = yes; then
1054 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1055 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1056 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1057 if test $am_cv_val_LC_MESSAGES = yes; then
1058 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1059 [Define if your <locale.h> file defines LC_MESSAGES.])
1065 # Test for the GNU C Library, version 2.1 or newer.
1066 # From Bruno Haible.
1068 AC_DEFUN([MUTT_jm_GLIBC21],
1070 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1071 ac_cv_gnu_library_2_1,
1072 [AC_EGREP_CPP([Lucky GNU user],
1074 #include <features.h>
1075 #ifdef __GNU_LIBRARY__
1076 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1081 ac_cv_gnu_library_2_1=yes,
1082 ac_cv_gnu_library_2_1=no)
1086 GLIBC21="$ac_cv_gnu_library_2_1"
1092 dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
1094 dnl libesmtp often requires linking against -lpthread or -lc_r (BSD).
1095 dnl This macro attempts to centralize this code.
1097 AC_DEFUN([MUTT_AM_LIBESMTP],
1101 [ --with-libesmtp=DIR Compile in support for libesmtp for the MTA],
1102 [ if test "$with_libesmtp" != "no"
1104 mutt_libesmtp_check_path="$PATH"
1106 if test "$with_libesmtp" != "yes"
1108 mutt_libesmtp_check_path="$tmp_path:$withval/bin"
1111 dnl 1. Find libesmtp-config
1112 AC_PATH_PROG([mutt_libesmtp_config_path],
1115 [$mutt_libesmtp_check_path])
1117 if test "$mutt_libesmtp_config_path" = "no"
1119 AC_MSG_ERROR([libesmtp-config binary not found.])
1122 dnl 2. Get CFLAGS and LIBS from libesmtp-config
1123 mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
1124 mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
1126 dnl 3. Verify libesmtp.h can be found with these settings
1127 temp_CFLAGS="$CFLAGS"
1128 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1129 AC_CHECK_HEADER([libesmtp.h],
1131 AC_MSG_ERROR([Could not find libesmtp.h]))
1132 CFLAGS="$temp_CFLAGS"
1134 dnl 4. Verify the libesmtp library can be linked in
1135 temp_CFLAGS="$CFLAGS"
1137 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1138 LIBS="$LIBS $mutt_libesmtp_libs"
1139 AC_CHECK_LIB([esmtp],
1140 [smtp_create_session],
1142 AC_MSG_ERROR([Could not find libesmtp]))
1143 CFLAGS="$temp_CFLAGS"
1146 dnl 5. Export use_libesmtp variable so configure.in can
1147 dnl act accordingly.