1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2, or (at your option)
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
37 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
38 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
40 # Do all the work for Automake. -*- Autoconf -*-
42 # This macro actually does too much some checks are only needed if
43 # your package does certain things. But this isn't really a big deal.
45 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
46 # Free Software Foundation, Inc.
48 # This program is free software; you can redistribute it and/or modify
49 # it under the terms of the GNU General Public License as published by
50 # the Free Software Foundation; either version 2, or (at your option)
53 # This program is distributed in the hope that it will be useful,
54 # but WITHOUT ANY WARRANTY; without even the implied warranty of
55 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 # GNU General Public License for more details.
58 # You should have received a copy of the GNU General Public License
59 # along with this program; if not, write to the Free Software
60 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
67 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
68 # the ones we care about.
69 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
71 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
72 # AM_INIT_AUTOMAKE([OPTIONS])
73 # -----------------------------------------------
74 # The call with PACKAGE and VERSION arguments is the old style
75 # call (pre autoconf-2.50), which is being phased out. PACKAGE
76 # and VERSION should now be passed to AC_INIT and removed from
77 # the call to AM_INIT_AUTOMAKE.
78 # We support both call styles for the transition. After
79 # the next Automake release, Autoconf can make the AC_INIT
80 # arguments mandatory, and then we can depend on a new Autoconf
81 # release and drop the old call support.
82 AC_DEFUN([AM_INIT_AUTOMAKE],
83 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
84 AC_REQUIRE([AC_PROG_INSTALL])dnl
85 # test to see if srcdir already configured
86 if test "`cd $srcdir && pwd`" != "`pwd`" &&
87 test -f $srcdir/config.status; then
88 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
91 # test whether we have cygpath
92 if test -z "$CYGPATH_W"; then
93 if (cygpath --version) >/dev/null 2>/dev/null; then
94 CYGPATH_W='cygpath -w'
101 # Define the identity of the package.
102 dnl Distinguish between old-style and new-style calls.
104 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
105 AC_SUBST([PACKAGE], [$1])dnl
106 AC_SUBST([VERSION], [$2])],
107 [_AM_SET_OPTIONS([$1])dnl
108 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
109 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
111 _AM_IF_OPTION([no-define],,
112 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
113 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
115 # Some tools Automake needs.
116 AC_REQUIRE([AM_SANITY_CHECK])dnl
117 AC_REQUIRE([AC_ARG_PROGRAM])dnl
118 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
119 AM_MISSING_PROG(AUTOCONF, autoconf)
120 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
121 AM_MISSING_PROG(AUTOHEADER, autoheader)
122 AM_MISSING_PROG(MAKEINFO, makeinfo)
123 AM_MISSING_PROG(AMTAR, tar)
125 AM_PROG_INSTALL_STRIP
126 # We need awk for the "check" target. The system "awk" is bad on
128 AC_REQUIRE([AC_PROG_AWK])dnl
129 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
130 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
132 _AM_IF_OPTION([no-dependencies],,
133 [AC_PROVIDE_IFELSE([AC_PROG_CC],
134 [_AM_DEPENDENCIES(CC)],
135 [define([AC_PROG_CC],
136 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
137 AC_PROVIDE_IFELSE([AC_PROG_CXX],
138 [_AM_DEPENDENCIES(CXX)],
139 [define([AC_PROG_CXX],
140 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
145 # When config.status generates a header, we must update the stamp-h file.
146 # This file resides in the same directory as the config header
147 # that is generated. The stamp files are numbered to have different names.
149 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
150 # loop where config.status creates the headers, so we can generate
151 # our stamp files there.
152 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
153 [# Compute $1's index in $config_headers.
155 for _am_header in $config_headers :; do
160 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
163 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
165 # Copyright 2002 Free Software Foundation, Inc.
167 # This program is free software; you can redistribute it and/or modify
168 # it under the terms of the GNU General Public License as published by
169 # the Free Software Foundation; either version 2, or (at your option)
172 # This program is distributed in the hope that it will be useful,
173 # but WITHOUT ANY WARRANTY; without even the implied warranty of
174 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
175 # GNU General Public License for more details.
177 # You should have received a copy of the GNU General Public License
178 # along with this program; if not, write to the Free Software
179 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
181 # AM_AUTOMAKE_VERSION(VERSION)
182 # ----------------------------
183 # Automake X.Y traces this macro to ensure aclocal.m4 has been
184 # generated from the m4 files accompanying Automake X.Y.
185 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
187 # AM_SET_CURRENT_AUTOMAKE_VERSION
188 # -------------------------------
189 # Call AM_AUTOMAKE_VERSION so it can be traced.
190 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
191 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
192 [AM_AUTOMAKE_VERSION([1.7.6])])
194 # Helper functions for option handling. -*- Autoconf -*-
196 # Copyright 2001, 2002 Free Software Foundation, Inc.
198 # This program is free software; you can redistribute it and/or modify
199 # it under the terms of the GNU General Public License as published by
200 # the Free Software Foundation; either version 2, or (at your option)
203 # This program is distributed in the hope that it will be useful,
204 # but WITHOUT ANY WARRANTY; without even the implied warranty of
205 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
206 # GNU General Public License for more details.
208 # You should have received a copy of the GNU General Public License
209 # along with this program; if not, write to the Free Software
210 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
215 # _AM_MANGLE_OPTION(NAME)
216 # -----------------------
217 AC_DEFUN([_AM_MANGLE_OPTION],
218 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
220 # _AM_SET_OPTION(NAME)
221 # ------------------------------
222 # Set option NAME. Presently that only means defining a flag for this option.
223 AC_DEFUN([_AM_SET_OPTION],
224 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
226 # _AM_SET_OPTIONS(OPTIONS)
227 # ----------------------------------
228 # OPTIONS is a space-separated list of Automake options.
229 AC_DEFUN([_AM_SET_OPTIONS],
230 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
232 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
233 # -------------------------------------------
234 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
235 AC_DEFUN([_AM_IF_OPTION],
236 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
239 # Check to make sure that the build environment is sane.
242 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
244 # This program is free software; you can redistribute it and/or modify
245 # it under the terms of the GNU General Public License as published by
246 # the Free Software Foundation; either version 2, or (at your option)
249 # This program is distributed in the hope that it will be useful,
250 # but WITHOUT ANY WARRANTY; without even the implied warranty of
251 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
252 # GNU General Public License for more details.
254 # You should have received a copy of the GNU General Public License
255 # along with this program; if not, write to the Free Software
256 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
263 AC_DEFUN([AM_SANITY_CHECK],
264 [AC_MSG_CHECKING([whether build environment is sane])
267 echo timestamp > conftest.file
268 # Do `set' in a subshell so we don't clobber the current shell's
269 # arguments. Must try -L first in case configure is actually a
270 # symlink; some systems play weird games with the mod time of symlinks
271 # (eg FreeBSD returns the mod time of the symlink's containing
274 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
275 if test "$[*]" = "X"; then
277 set X `ls -t $srcdir/configure conftest.file`
280 if test "$[*]" != "X $srcdir/configure conftest.file" \
281 && test "$[*]" != "X conftest.file $srcdir/configure"; then
283 # If neither matched, then we have a broken ls. This can happen
284 # if, for instance, CONFIG_SHELL is bash and it inherits a
285 # broken ls alias from the environment. This has actually
286 # happened. Such a system could not be considered "sane".
287 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
288 alias in your environment])
291 test "$[2]" = conftest.file
297 AC_MSG_ERROR([newly created file is older than distributed files!
298 Check your system clock])
305 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
307 # This program is free software; you can redistribute it and/or modify
308 # it under the terms of the GNU General Public License as published by
309 # the Free Software Foundation; either version 2, or (at your option)
312 # This program is distributed in the hope that it will be useful,
313 # but WITHOUT ANY WARRANTY; without even the implied warranty of
314 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
315 # GNU General Public License for more details.
317 # You should have received a copy of the GNU General Public License
318 # along with this program; if not, write to the Free Software
319 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
324 # AM_MISSING_PROG(NAME, PROGRAM)
325 # ------------------------------
326 AC_DEFUN([AM_MISSING_PROG],
327 [AC_REQUIRE([AM_MISSING_HAS_RUN])
328 $1=${$1-"${am_missing_run}$2"}
334 # Define MISSING if not defined so far and test if it supports --run.
335 # If it does, set am_missing_run to use it, otherwise, to nothing.
336 AC_DEFUN([AM_MISSING_HAS_RUN],
337 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
338 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
339 # Use eval to expand $SHELL
340 if eval "$MISSING --run true"; then
341 am_missing_run="$MISSING --run "
344 AC_MSG_WARN([`missing' script is too old or missing])
350 # Copyright 2001 Free Software Foundation, Inc.
352 # This program is free software; you can redistribute it and/or modify
353 # it under the terms of the GNU General Public License as published by
354 # the Free Software Foundation; either version 2, or (at your option)
357 # This program is distributed in the hope that it will be useful,
358 # but WITHOUT ANY WARRANTY; without even the implied warranty of
359 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
360 # GNU General Public License for more details.
362 # You should have received a copy of the GNU General Public License
363 # along with this program; if not, write to the Free Software
364 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
367 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
368 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
369 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
371 # Of course, Automake must honor this variable whenever it calls a
372 # tool from the auxiliary directory. The problem is that $srcdir (and
373 # therefore $ac_aux_dir as well) can be either absolute or relative,
374 # depending on how configure is run. This is pretty annoying, since
375 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
376 # source directory, any form will work fine, but in subdirectories a
377 # relative path needs to be adjusted first.
379 # $ac_aux_dir/missing
380 # fails when called from a subdirectory if $ac_aux_dir is relative
381 # $top_srcdir/$ac_aux_dir/missing
382 # fails if $ac_aux_dir is absolute,
383 # fails when called from a subdirectory in a VPATH build with
384 # a relative $ac_aux_dir
386 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
387 # are both prefixed by $srcdir. In an in-source build this is usually
388 # harmless because $srcdir is `.', but things will broke when you
389 # start a VPATH build or use an absolute $srcdir.
391 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
392 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
393 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
394 # and then we would define $MISSING as
395 # MISSING="\${SHELL} $am_aux_dir/missing"
396 # This will work as long as MISSING is not called from configure, because
397 # unfortunately $(top_srcdir) has no meaning in configure.
398 # However there are other variables, like CC, which are often used in
399 # configure, and could therefore not use this "fixed" $ac_aux_dir.
401 # Another solution, used here, is to always expand $ac_aux_dir to an
402 # absolute PATH. The drawback is that using absolute paths prevent a
403 # configured tree to be moved without reconfiguration.
405 # Rely on autoconf to set up CDPATH properly.
408 AC_DEFUN([AM_AUX_DIR_EXPAND], [
409 # expand $ac_aux_dir to an absolute path
410 am_aux_dir=`cd $ac_aux_dir && pwd`
415 # Define $install_sh.
417 # Copyright 2001 Free Software Foundation, Inc.
419 # This program is free software; you can redistribute it and/or modify
420 # it under the terms of the GNU General Public License as published by
421 # the Free Software Foundation; either version 2, or (at your option)
424 # This program is distributed in the hope that it will be useful,
425 # but WITHOUT ANY WARRANTY; without even the implied warranty of
426 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
427 # GNU General Public License for more details.
429 # You should have received a copy of the GNU General Public License
430 # along with this program; if not, write to the Free Software
431 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
434 AC_DEFUN([AM_PROG_INSTALL_SH],
435 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
436 install_sh=${install_sh-"$am_aux_dir/install-sh"}
437 AC_SUBST(install_sh)])
439 # AM_PROG_INSTALL_STRIP
441 # Copyright 2001 Free Software Foundation, Inc.
443 # This program is free software; you can redistribute it and/or modify
444 # it under the terms of the GNU General Public License as published by
445 # the Free Software Foundation; either version 2, or (at your option)
448 # This program is distributed in the hope that it will be useful,
449 # but WITHOUT ANY WARRANTY; without even the implied warranty of
450 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
451 # GNU General Public License for more details.
453 # You should have received a copy of the GNU General Public License
454 # along with this program; if not, write to the Free Software
455 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
458 # One issue with vendor `install' (even GNU) is that you can't
459 # specify the program used to strip binaries. This is especially
460 # annoying in cross-compiling environments, where the build's strip
461 # is unlikely to handle the host's binaries.
462 # Fortunately install-sh will honor a STRIPPROG variable, so we
463 # always use install-sh in `make install-strip', and initialize
464 # STRIPPROG with the value of the STRIP variable (set by the user).
465 AC_DEFUN([AM_PROG_INSTALL_STRIP],
466 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
467 # Installed binaries are usually stripped using `strip' when the user
468 # run `make install-strip'. However `strip' might not be the right
469 # tool to use in cross-compilation environments, therefore Automake
470 # will honor the `STRIP' environment variable to overrule this program.
471 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
472 if test "$cross_compiling" != no; then
473 AC_CHECK_TOOL([STRIP], [strip], :)
475 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
476 AC_SUBST([INSTALL_STRIP_PROGRAM])])
479 # Copyright (C) 2003 Free Software Foundation, Inc.
481 # This program is free software; you can redistribute it and/or modify
482 # it under the terms of the GNU General Public License as published by
483 # the Free Software Foundation; either version 2, or (at your option)
486 # This program is distributed in the hope that it will be useful,
487 # but WITHOUT ANY WARRANTY; without even the implied warranty of
488 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
489 # GNU General Public License for more details.
491 # You should have received a copy of the GNU General Public License
492 # along with this program; if not, write to the Free Software
493 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
498 # Check whether the underlying file-system supports filenames
499 # with a leading dot. For instance MS-DOS doesn't.
500 AC_DEFUN([AM_SET_LEADING_DOT],
501 [rm -rf .tst 2>/dev/null
502 mkdir .tst 2>/dev/null
503 if test -d .tst; then
508 rmdir .tst 2>/dev/null
509 AC_SUBST([am__leading_dot])])
511 # serial 5 -*- Autoconf -*-
513 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
515 # This program is free software; you can redistribute it and/or modify
516 # it under the terms of the GNU General Public License as published by
517 # the Free Software Foundation; either version 2, or (at your option)
520 # This program is distributed in the hope that it will be useful,
521 # but WITHOUT ANY WARRANTY; without even the implied warranty of
522 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
523 # GNU General Public License for more details.
525 # You should have received a copy of the GNU General Public License
526 # along with this program; if not, write to the Free Software
527 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
531 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
532 # written in clear, in which case automake, when reading aclocal.m4,
533 # will think it sees a *use*, and therefore will trigger all it's
534 # C support machinery. Also note that it means that autoscan, seeing
535 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
539 # _AM_DEPENDENCIES(NAME)
540 # ----------------------
541 # See how the compiler implements dependency checking.
542 # NAME is "CC", "CXX", "GCJ", or "OBJC".
543 # We try a few techniques and use that to set a single cache variable.
545 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
546 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
547 # dependency, and given that the user is not expected to run this macro,
548 # just rely on AC_PROG_CC.
549 AC_DEFUN([_AM_DEPENDENCIES],
550 [AC_REQUIRE([AM_SET_DEPDIR])dnl
551 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
552 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
553 AC_REQUIRE([AM_DEP_TRACK])dnl
555 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
556 [$1], CXX, [depcc="$CXX" am_compiler_list=],
557 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
558 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
559 [depcc="$$1" am_compiler_list=])
561 AC_CACHE_CHECK([dependency style of $depcc],
562 [am_cv_$1_dependencies_compiler_type],
563 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
564 # We make a subdir and do the tests there. Otherwise we can end up
565 # making bogus files that we don't know about and never remove. For
566 # instance it was reported that on HP-UX the gcc test will end up
567 # making a dummy file named `D' -- because `-MD' means `put the output
570 # Copy depcomp to subdir because otherwise we won't find it if we're
571 # using a relative directory.
572 cp "$am_depcomp" conftest.dir
574 # We will build objects and dependencies in a subdirectory because
575 # it helps to detect inapplicable dependency modes. For instance
576 # both Tru64's cc and ICC support -MD to output dependencies as a
577 # side effect of compilation, but ICC will put the dependencies in
578 # the current directory while Tru64 will put them in the object
582 am_cv_$1_dependencies_compiler_type=none
583 if test "$am_compiler_list" = ""; then
584 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
586 for depmode in $am_compiler_list; do
587 # Setup a source with many dependencies, because some compilers
588 # like to wrap large dependency lists on column 80 (with \), and
589 # we should not choose a depcomp mode which is confused by this.
591 # We need to recreate these files for each test, as the compiler may
592 # overwrite some of them when testing with obscure command lines.
593 # This happens at least with the AIX C compiler.
595 for i in 1 2 3 4 5 6; do
596 echo '#include "conftst'$i'.h"' >> sub/conftest.c
599 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
603 # after this tag, mechanisms are not by side-effect, so they'll
604 # only be used when explicitly requested
605 if test "x$enable_dependency_tracking" = xyes; then
613 # We check with `-c' and `-o' for the sake of the "dashmstdout"
614 # mode. It turns out that the SunPro C++ compiler does not properly
615 # handle `-M -o', and we need to detect this.
616 if depmode=$depmode \
617 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
618 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
619 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
620 >/dev/null 2>conftest.err &&
621 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
622 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
623 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
624 # icc doesn't choke on unknown options, it will just issue warnings
625 # (even with -Werror). So we grep stderr for any message
626 # that says an option was ignored.
627 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
628 am_cv_$1_dependencies_compiler_type=$depmode
637 am_cv_$1_dependencies_compiler_type=none
640 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
641 AM_CONDITIONAL([am__fastdep$1], [
642 test "x$enable_dependency_tracking" != xno \
643 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
649 # Choose a directory name for dependency files.
650 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
651 AC_DEFUN([AM_SET_DEPDIR],
652 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
653 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
659 AC_DEFUN([AM_DEP_TRACK],
660 [AC_ARG_ENABLE(dependency-tracking,
661 [ --disable-dependency-tracking Speeds up one-time builds
662 --enable-dependency-tracking Do not reject slow dependency extractors])
663 if test "x$enable_dependency_tracking" != xno; then
664 am_depcomp="$ac_aux_dir/depcomp"
667 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
668 AC_SUBST([AMDEPBACKSLASH])
671 # Generate code to set up dependency tracking. -*- Autoconf -*-
673 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
675 # This program is free software; you can redistribute it and/or modify
676 # it under the terms of the GNU General Public License as published by
677 # the Free Software Foundation; either version 2, or (at your option)
680 # This program is distributed in the hope that it will be useful,
681 # but WITHOUT ANY WARRANTY; without even the implied warranty of
682 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
683 # GNU General Public License for more details.
685 # You should have received a copy of the GNU General Public License
686 # along with this program; if not, write to the Free Software
687 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
692 # _AM_OUTPUT_DEPENDENCY_COMMANDS
693 # ------------------------------
694 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
695 [for mf in $CONFIG_FILES; do
696 # Strip MF so we end up with the name of the file.
697 mf=`echo "$mf" | sed -e 's/:.*$//'`
698 # Check whether this is an Automake generated Makefile or not.
699 # We used to match only the files named `Makefile.in', but
700 # some people rename them; so instead we look at the file content.
701 # Grep'ing the first line is not enough: some people post-process
702 # each Makefile.in and add a new line on top of each file to say so.
703 # So let's grep whole file.
704 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
705 dirpart=`AS_DIRNAME("$mf")`
709 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
710 # Extract the definition of DEP_FILES from the Makefile without
712 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
713 test -z "$DEPDIR" && continue
714 # When using ansi2knr, U may be empty or an underscore; expand it
715 U=`sed -n -e '/^U = / s///p' < "$mf"`
716 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
717 # We invoke sed twice because it is the simplest approach to
718 # changing $(DEPDIR) to its actual value in the expansion.
719 for file in `sed -n -e '
720 /^DEP_FILES = .*\\\\$/ {
729 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
730 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
731 # Make sure the directory exists.
732 test -f "$dirpart/$file" && continue
733 fdir=`AS_DIRNAME(["$file"])`
734 AS_MKDIR_P([$dirpart/$fdir])
735 # echo "creating $dirpart/$file"
736 echo '# dummy' > "$dirpart/$file"
739 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
742 # AM_OUTPUT_DEPENDENCY_COMMANDS
743 # -----------------------------
744 # This macro should only be invoked once -- use via AC_REQUIRE.
746 # This code is only required when automatic dependency tracking
747 # is enabled. FIXME. This creates each `.P' file that we will
748 # need in order to bootstrap the dependency handling code.
749 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
750 [AC_CONFIG_COMMANDS([depfiles],
751 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
752 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
755 # Check to see how 'make' treats includes. -*- Autoconf -*-
757 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
759 # This program is free software; you can redistribute it and/or modify
760 # it under the terms of the GNU General Public License as published by
761 # the Free Software Foundation; either version 2, or (at your option)
764 # This program is distributed in the hope that it will be useful,
765 # but WITHOUT ANY WARRANTY; without even the implied warranty of
766 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
767 # GNU General Public License for more details.
769 # You should have received a copy of the GNU General Public License
770 # along with this program; if not, write to the Free Software
771 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
778 # Check to see how make treats includes.
779 AC_DEFUN([AM_MAKE_INCLUDE],
780 [am_make=${MAKE-make}
781 cat > confinc << 'END'
786 # If we don't find an include directive, just comment out the code.
787 AC_MSG_CHECKING([for style of include used by $am_make])
791 # First try GNU make style include.
792 echo "include confinc" > confmf
793 # We grep out `Entering directory' and `Leaving directory'
794 # messages which can occur if `w' ends up in MAKEFLAGS.
795 # In particular we don't look at `^make:' because GNU make might
796 # be invoked under some other name (usually "gmake"), in which
797 # case it prints its new name instead of `make'.
798 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
803 # Now try BSD make style include.
804 if test "$am__include" = "#"; then
805 echo '.include "confinc"' > confmf
806 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
812 AC_SUBST([am__include])
813 AC_SUBST([am__quote])
814 AC_MSG_RESULT([$_am_result])
818 # AM_CONDITIONAL -*- Autoconf -*-
820 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
822 # This program is free software; you can redistribute it and/or modify
823 # it under the terms of the GNU General Public License as published by
824 # the Free Software Foundation; either version 2, or (at your option)
827 # This program is distributed in the hope that it will be useful,
828 # but WITHOUT ANY WARRANTY; without even the implied warranty of
829 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
830 # GNU General Public License for more details.
832 # You should have received a copy of the GNU General Public License
833 # along with this program; if not, write to the Free Software
834 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
841 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
842 # -------------------------------------
843 # Define a conditional.
844 AC_DEFUN([AM_CONDITIONAL],
845 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
846 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
856 AC_CONFIG_COMMANDS_PRE(
857 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
858 AC_MSG_ERROR([conditional "$1" was never defined.
859 Usually this means the macro was only invoked conditionally.])
863 # This test replaces the one in autoconf.
864 # Currently this macro should have the same name as the autoconf macro
865 # because gettext's gettext.m4 (distributed in the automake package)
866 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
867 # give these diagnostics:
868 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
869 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
871 undefine([AC_ISC_POSIX])
873 AC_DEFUN([AC_ISC_POSIX],
875 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
876 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
881 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
883 # This program is free software; you can redistribute it and/or modify
884 # it under the terms of the GNU General Public License as published by
885 # the Free Software Foundation; either version 2, or (at your option)
888 # This program is distributed in the hope that it will be useful,
889 # but WITHOUT ANY WARRANTY; without even the implied warranty of
890 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
891 # GNU General Public License for more details.
893 # You should have received a copy of the GNU General Public License
894 # along with this program; if not, write to the Free Software
895 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
900 AC_DEFUN([AM_C_PROTOTYPES],
901 [AC_REQUIRE([AM_PROG_CC_STDC])
902 AC_REQUIRE([AC_PROG_CPP])
903 AC_MSG_CHECKING([for function prototypes])
904 if test "$am_cv_prog_cc_stdc" != no; then
906 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
910 U=_ ANSI2KNR=./ansi2knr
912 # Ensure some checks needed by ansi2knr itself.
914 AC_CHECK_HEADERS(string.h)
916 AC_SUBST(ANSI2KNR)dnl
919 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
922 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
924 # This program is free software; you can redistribute it and/or modify
925 # it under the terms of the GNU General Public License as published by
926 # the Free Software Foundation; either version 2, or (at your option)
929 # This program is distributed in the hope that it will be useful,
930 # but WITHOUT ANY WARRANTY; without even the implied warranty of
931 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
932 # GNU General Public License for more details.
934 # You should have received a copy of the GNU General Public License
935 # along with this program; if not, write to the Free Software
936 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
941 # @defmac AC_PROG_CC_STDC
942 # @maindex PROG_CC_STDC
944 # If the C compiler in not in ANSI C mode by default, try to add an option
945 # to output variable @code{CC} to make it so. This macro tries various
946 # options that select ANSI C on some system or another. It considers the
947 # compiler to be in ANSI C mode if it handles function prototypes correctly.
949 # If you use this macro, you should check after calling it whether the C
950 # compiler has been set to accept ANSI C; if not, the shell variable
951 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
952 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
953 # program @code{ansi2knr}, which comes with Ghostscript.
956 AC_DEFUN([AM_PROG_CC_STDC],
957 [AC_REQUIRE([AC_PROG_CC])
958 AC_BEFORE([$0], [AC_C_INLINE])
959 AC_BEFORE([$0], [AC_C_CONST])
960 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
961 dnl a magic option to avoid problems with ANSI preprocessor commands
963 dnl FIXME: can't do this because then AC_AIX won't work due to a
964 dnl circular dependency.
965 dnl AC_BEFORE([$0], [AC_PROG_CPP])
966 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
967 AC_CACHE_VAL(am_cv_prog_cc_stdc,
968 [am_cv_prog_cc_stdc=no
970 # Don't try gcc -ansi; that turns off useful extensions and
971 # breaks some systems' header files.
973 # Ultrix and OSF/1 -std1
974 # HP-UX 10.20 and later -Ae
975 # HP-UX older versions -Aa -D_HPUX_SOURCE
976 # SVR4 -Xc -D__EXTENSIONS__
977 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
979 CC="$ac_save_CC $ac_arg"
983 #include <sys/types.h>
984 #include <sys/stat.h>
985 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
986 struct buf { int x; };
987 FILE * (*rcsopen) (struct buf *, struct stat *, int);
988 static char *e (p, i)
994 static char *f (char * (*g) (char **, int), char **p, ...)
999 s = g (p, va_arg (v,int));
1003 int test (int i, double x);
1004 struct s1 {int (*f) (int a);};
1005 struct s2 {int (*f) (double a);};
1006 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1010 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
1012 [am_cv_prog_cc_stdc="$ac_arg"; break])
1016 if test -z "$am_cv_prog_cc_stdc"; then
1017 AC_MSG_RESULT([none needed])
1019 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
1021 case "x$am_cv_prog_cc_stdc" in
1023 *) CC="$CC $am_cv_prog_cc_stdc" ;;
1027 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1029 dnl ---------------------------------------------------------------------------
1030 dnl Look for the curses libraries. Older curses implementations may require
1031 dnl termcap/termlib to be linked as well.
1032 AC_DEFUN([CF_CURSES_LIBS],[
1033 AC_CHECK_FUNC(initscr,,[
1034 case $host_os in #(vi
1036 AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
1039 AC_CHECK_LIB(cur_colr,initscr,[
1040 LIBS="-lcur_colr $LIBS"
1041 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
1042 ac_cv_func_initscr=yes
1044 AC_CHECK_LIB(Hcurses,initscr,[
1045 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
1046 LIBS="-lHcurses $LIBS"
1047 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
1048 ac_cv_func_initscr=yes
1051 linux*) # Suse Linux does not follow /usr/lib convention
1056 if test ".$With5lib" != ".no" ; then
1057 if test -d /usr/5lib ; then
1059 CPPFLAGS="$CPPFLAGS -I/usr/5include"
1060 LIBS="$LIBS -L/usr/5lib"
1064 if test ".$ac_cv_func_initscr" != .yes ; then
1065 cf_save_LIBS="$LIBS"
1069 # Check for library containing tgoto. Do this before curses library
1070 # because it may be needed to link the test-case for initscr.
1071 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
1072 for cf_term_lib in termcap termlib unknown
1074 AC_CHECK_LIB($cf_term_lib,tgoto,[break])
1078 # Check for library containing initscr
1079 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
1080 for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
1082 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
1084 test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
1086 LIBS="-l$cf_curs_lib $cf_save_LIBS"
1087 if test "$cf_term_lib" = unknown ; then
1088 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
1089 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1093 AC_MSG_RESULT($cf_result)
1094 test $cf_result = no && AC_ERROR(Cannot link curses library)
1095 elif test "$cf_term_lib" != predefined ; then
1096 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
1097 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1098 [initscr(); tgoto((char *)0, 0, 0);],
1101 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
1102 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1107 AC_MSG_RESULT($cf_result)
1113 dnl ---------------------------------------------------------------------------
1114 dnl Check if a function is declared by including a set of include files.
1115 dnl Invoke the corresponding actions according to whether it is found or not.
1117 dnl Gcc (unlike other compilers) will only warn about the miscast assignment
1118 dnl in the first test, but most compilers will oblige with an error in the
1121 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1122 AC_DEFUN([CF_CHECK_FUNCDECL],
1124 AC_MSG_CHECKING([for $2 declaration])
1125 AC_CACHE_VAL(ac_cv_func_decl_$2,
1126 [AC_TRY_COMPILE([$1],
1128 extern int ${ac_func}();
1130 AC_TRY_COMPILE([$1],
1132 int (*p)() = ${ac_func};
1134 eval "ac_cv_func_decl_$2=yes"],[
1135 eval "ac_cv_func_decl_$2=no"])],[
1136 eval "ac_cv_func_decl_$2=yes"])])
1137 if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then
1139 ifelse([$3], , :, [$3])
1142 ifelse([$4], , , [$4
1146 dnl ---------------------------------------------------------------------------
1147 dnl Check if functions are declared by including a set of include files.
1148 dnl and define DECL_XXX if not.
1150 dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1151 AC_DEFUN([CF_CHECK_FUNCDECLS],
1154 CF_CHECK_FUNCDECL([$1], $ac_func,
1156 CF_UPPER(ac_tr_func,HAVE_$ac_func)
1157 AC_DEFINE_UNQUOTED($ac_tr_func) $3],
1161 dnl CF_UPPER(ac_tr_func,DECL_$ac_func)
1162 dnl AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl
1165 dnl ---------------------------------------------------------------------------
1166 dnl Make an uppercase version of a variable
1167 dnl $1=uppercase($2)
1168 AC_DEFUN([CF_UPPER],
1171 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
1174 dnl ---------------------------------------------------------------------------
1176 # gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations
1177 # Brendan Cully <brendan@kublai.com> 20010529
1179 dnl MUTT_AM_PATH_GSSAPI(PREFIX)
1180 dnl Search for a GSSAPI implementation in the standard locations plus PREFIX,
1181 dnl if it is set and not "yes".
1182 dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found.
1183 dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found
1184 AC_DEFUN([MUTT_AM_PATH_GSSAPI],
1188 saved_CPPFLAGS="$CPPFLAGS"
1189 saved_LDFLAGS="$LDFLAGS"
1191 dnl First try krb5-config
1192 if test "$GSSAPI_PREFIX" != "yes"
1194 krb5_path="$GSSAPI_PREFIX/bin"
1198 AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path)
1199 if test "$KRB5CFGPATH" != "none"
1201 GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
1202 GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`"
1203 case "`$KRB5CFGPATH --version`" in
1204 "Kerberos 5 "*) GSSAPI_IMPL="MIT";;
1205 ?eimdal*) GSSAPI_IMPL="Heimdal";;
1206 *) GSSAPI_IMPL="Unknown";;
1209 dnl No krb5-config, run the old code
1210 if test "$GSSAPI_PREFIX" != "yes"
1212 GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include"
1213 GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib"
1214 CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
1215 LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
1218 dnl New MIT kerberos V support
1219 AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, [
1221 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
1222 ],, -lkrb5 -lk5crypto -lcom_err)
1224 dnl Heimdal kerberos V support
1225 if test "$GSSAPI_IMPL" = "none"
1227 AC_CHECK_LIB(gssapi, gss_init_sec_context, [
1228 GSSAPI_IMPL="Heimdal"
1229 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken"
1230 GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"
1231 ],, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err)
1234 dnl Old MIT Kerberos V
1235 dnl Note: older krb5 distributions use -lcrypto instead of
1236 dnl -lk5crypto, which collides with OpenSSL. One way of dealing
1237 dnl with that is to extract all objects from krb5's libcrypto
1238 dnl and from openssl's libcrypto into the same directory, then
1239 dnl to create a new libcrypto from these.
1240 if test "$GSSAPI_IMPL" = "none"
1242 AC_CHECK_LIB(gssapi_krb5, g_order_init, [
1243 GSSAPI_IMPL="OldMIT",
1244 GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
1245 ],, -lkrb5 -lcrypto -lcom_err)
1249 CPPFLAGS="$saved_CPPFLAGS"
1250 LDFLAGS="$saved_LDFLAGS"
1254 # Macro to add for using GNU gettext.
1255 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1258 # Slightly modified by Thomas Roessler <roessler@does-not-exist.org>
1259 # Updated to gettext-0.10.38 by Edmund Grimley Evans <edmundo@rano.org>
1260 # Updated to gettext-0.10.40 by Andrew W. Nosenko <awn@bcs.zp.ua>
1263 # This file can be copied and used freely without restrictions. It can
1264 # be used in projects which are not available under the GNU General Public
1265 # License or the GNU Library General Public License but which still want
1266 # to provide support for the GNU gettext functionality.
1267 # Please note that the actual code of the GNU gettext library is covered
1268 # by the GNU Library General Public License, and the rest of the GNU
1269 # gettext package package is covered by the GNU General Public License.
1270 # They are *not* in the public domain.
1274 dnl Usage: MUTT_AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1275 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1276 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1277 dnl depending on --{enable,disable}-{shared,static} and on the presence of
1278 dnl AM-DISABLE-SHARED). Otherwise, a static library
1279 dnl $(top_builddir)/intl/libintl.a will be created.
1280 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1281 dnl implementations (in libc or libintl) without the ngettext() function
1282 dnl will be ignored.
1283 dnl LIBDIR is used to find the intl libraries. If empty,
1284 dnl the value `$(top_builddir)/intl/' is used.
1286 dnl The result of the configuration is one of three cases:
1287 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1289 dnl Catalog format: GNU --> install in $(datadir)
1290 dnl Catalog extension: .mo after installation, .gmo in source tree
1291 dnl 2) GNU gettext has been found in the system's C library.
1292 dnl Catalog format: GNU --> install in $(datadir)
1293 dnl Catalog extension: .mo after installation, .gmo in source tree
1294 dnl 3) No internationalization, always use English msgid.
1295 dnl Catalog format: none
1296 dnl Catalog extension: none
1297 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1298 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1299 dnl but we keep it in order not to force irrelevant filename changes on the
1302 AC_DEFUN([MUTT_AM_WITH_NLS],
1303 [AC_MSG_CHECKING([whether NLS is requested])
1304 dnl Default is enabled NLS
1306 [ --disable-nls Do not use Native Language Support],
1307 USE_NLS=$enableval, USE_NLS=yes)
1308 AC_MSG_RESULT($USE_NLS)
1311 BUILD_INCLUDED_LIBINTL=no
1312 USE_INCLUDED_LIBINTL=no
1315 dnl If we use NLS figure out what method
1316 if test "$USE_NLS" = "yes"; then
1317 AC_DEFINE(ENABLE_NLS, 1,
1318 [Define to 1 if translation of program messages to the user's native language
1320 AC_MSG_CHECKING([whether included gettext is requested])
1321 AC_ARG_WITH(included-gettext,
1322 [ --with-included-gettext Use the GNU gettext library included here],
1323 nls_cv_force_use_gnu_gettext=$withval,
1324 nls_cv_force_use_gnu_gettext=no)
1325 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1327 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1328 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1329 dnl User does not insist on using GNU NLS library. Figure out what
1330 dnl to use. If GNU gettext is available we use this. Else we have
1331 dnl to fall back to GNU NLS library.
1334 dnl Add a version number to the cache macros.
1335 define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1336 define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1338 AC_CHECK_HEADER(libintl.h,
1339 [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1340 [AC_TRY_LINK([#include <libintl.h>
1341 extern int _nl_msg_cat_cntr;],
1342 [bindtextdomain ("", "");
1343 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1344 gt_cv_func_gnugettext_libc=yes,
1345 gt_cv_func_gnugettext_libc=no)])
1347 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1348 AC_CACHE_CHECK([for GNU gettext in libintl],
1349 gt_cv_func_gnugettext_libintl,
1350 [gt_save_LIBS="$LIBS"
1351 LIBS="$LIBS -lintl $LIBICONV"
1352 AC_TRY_LINK([#include <libintl.h>
1353 extern int _nl_msg_cat_cntr;],
1354 [bindtextdomain ("", "");
1355 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1356 gt_cv_func_gnugettext_libintl=yes,
1357 gt_cv_func_gnugettext_libintl=no)
1358 LIBS="$gt_save_LIBS"])
1361 dnl If an already present or preinstalled GNU gettext() is found,
1362 dnl use it. But if this macro is used in GNU gettext, and GNU
1363 dnl gettext is already preinstalled in libintl, we update this
1364 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
1365 if test "$gt_cv_func_gnugettext_libc" = "yes" \
1366 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1367 && test "$PACKAGE" != gettext; }; then
1368 AC_DEFINE(HAVE_GETTEXT, 1,
1369 [Define if the GNU gettext() function is already present or preinstalled.])
1371 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1372 dnl If iconv() is in a separate libiconv library, then anyone
1373 dnl linking with libintl{.a,.so} also needs to link with
1375 INTLLIBS="-lintl $LIBICONV"
1378 gt_save_LIBS="$LIBS"
1379 LIBS="$LIBS $INTLLIBS"
1380 AC_CHECK_FUNCS(dcgettext)
1381 LIBS="$gt_save_LIBS"
1383 dnl Search for GNU msgfmt in the PATH.
1384 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1385 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1386 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1388 dnl Search for GNU xgettext in the PATH.
1389 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1390 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1396 if test "$CATOBJEXT" = "NONE"; then
1397 dnl GNU gettext is not found in the C library.
1398 dnl Fall back on GNU gettext library.
1399 nls_cv_use_gnu_gettext=yes
1403 if test "$nls_cv_use_gnu_gettext" = "yes"; then
1404 dnl Mark actions used to generate GNU NLS library.
1405 INTLOBJS="\$(GETTOBJS)"
1406 MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1407 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1408 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1409 MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1410 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1412 BUILD_INCLUDED_LIBINTL=yes
1413 USE_INCLUDED_LIBINTL=yes
1415 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1416 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1419 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
1420 dnl Test whether we really found GNU msgfmt.
1421 if test "$GMSGFMT" != ":"; then
1422 dnl If it is no GNU msgfmt we define it as : so that the
1423 dnl Makefiles still can work.
1424 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1428 [found msgfmt program is not GNU msgfmt; ignore it])
1433 dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
1434 dnl Test whether we really found GNU xgettext.
1435 if test "$XGETTEXT" != ":"; then
1436 dnl If it is no GNU xgettext we define it as : so that the
1437 dnl Makefiles still can work.
1438 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1442 [found xgettext program is not GNU xgettext; ignore it])
1447 dnl We need to process the po/ directory.
1451 [for ac_file in $CONFIG_FILES; do
1452 # Support "outfile[:infile[:infile...]]"
1454 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1456 # PO directories have a Makefile.in generated from Makefile.in.in.
1457 case "$ac_file" in */Makefile.in)
1458 # Adjust a relative srcdir.
1459 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1460 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1461 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1462 # In autoconf-2.13 it is called $ac_given_srcdir.
1463 # In autoconf-2.50 it is called $srcdir.
1464 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1465 case "$ac_given_srcdir" in
1466 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1467 /*) top_srcdir="$ac_given_srcdir" ;;
1468 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
1470 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1471 rm -f "$ac_dir/POTFILES"
1472 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1473 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1474 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1475 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1482 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1483 dnl to 'yes' because some of the testsuite requires it.
1484 if test "$PACKAGE" = gettext; then
1485 BUILD_INCLUDED_LIBINTL=yes
1488 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1489 dnl because plural.y uses bison specific features. It requires at least
1490 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1492 dnl bison is only needed for the maintainer (who touches plural.y). But in
1493 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1494 dnl the rule in general Makefile. Now, some people carelessly touch the
1495 dnl files or have a broken "make" program, hence the plural.c rule will
1496 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1497 dnl present or too old.
1498 AC_CHECK_PROGS([INTLBISON], [bison])
1499 if test -z "$INTLBISON"; then
1502 dnl Found it, now check the version.
1503 AC_MSG_CHECKING([version of bison])
1504 changequote(<<,>>)dnl
1505 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1506 case $ac_prog_version in
1507 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1508 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1510 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1511 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1513 AC_MSG_RESULT([$ac_prog_version])
1515 if test $ac_verc_fail = yes; then
1519 dnl These rules are solely for the distribution goal. While doing this
1520 dnl we only have to keep exactly one list of the available catalogs
1521 dnl in configure.in.
1522 for lang in $ALL_LINGUAS; do
1523 GMOFILES="$GMOFILES $lang.gmo"
1524 POFILES="$POFILES $lang.po"
1527 dnl Make all variables we use known to autoconf.
1528 AC_SUBST(BUILD_INCLUDED_LIBINTL)
1529 AC_SUBST(USE_INCLUDED_LIBINTL)
1538 dnl For backward compatibility. Some configure.ins may be using this.
1540 nls_cv_header_libgt=
1542 dnl For backward compatibility. Some Makefiles may be using this.
1544 AC_SUBST(DATADIRNAME)
1546 dnl For backward compatibility. Some Makefiles may be using this.
1548 AC_SUBST(INSTOBJEXT)
1550 dnl For backward compatibility. Some Makefiles may be using this.
1555 dnl Usage: Just like MUTT_AM_WITH_NLS, which see.
1556 AC_DEFUN([MUTT_AM_GNU_GETTEXT],
1557 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1558 AC_REQUIRE([AC_PROG_CC])dnl
1559 AC_REQUIRE([AC_CANONICAL_HOST])dnl
1560 AC_REQUIRE([AC_PROG_RANLIB])dnl
1561 AC_REQUIRE([AC_ISC_POSIX])dnl
1562 AC_REQUIRE([AC_HEADER_STDC])dnl
1563 AC_REQUIRE([AC_C_CONST])dnl
1564 AC_REQUIRE([AC_C_INLINE])dnl
1565 AC_REQUIRE([AC_TYPE_OFF_T])dnl
1566 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1567 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1568 AC_REQUIRE([AC_FUNC_MMAP])dnl
1569 AC_REQUIRE([MUTT_jm_GLIBC21])dnl
1571 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1572 stdlib.h string.h unistd.h sys/param.h])
1573 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1574 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1575 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1578 MUTT_AM_LANGINFO_CODESET
1580 MUTT_AM_WITH_NLS([$1],[$2],[$3])
1582 if test "x$CATOBJEXT" != "x"; then
1583 if test "x$ALL_LINGUAS" = "x"; then
1586 AC_MSG_CHECKING(for catalogs to be installed)
1588 for presentlang in $ALL_LINGUAS; do
1590 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1591 # Use the presentlang catalog if desiredlang is
1592 # a. equal to presentlang, or
1593 # b. a variant of presentlang (because in this case,
1594 # presentlang can be used as a fallback for messages
1595 # which are not translated in the desiredlang catalog).
1596 case "$desiredlang" in
1597 "$presentlang"*) useit=yes;;
1600 if test $useit = yes; then
1601 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1604 LINGUAS=$NEW_LINGUAS
1605 AC_MSG_RESULT($LINGUAS)
1608 dnl Construct list of names of catalog files to be constructed.
1609 if test -n "$LINGUAS"; then
1610 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1614 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1615 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1616 dnl Try to locate is.
1618 if test -n "$ac_aux_dir"; then
1619 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1621 if test -z "$MKINSTALLDIRS"; then
1622 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1624 AC_SUBST(MKINSTALLDIRS)
1626 dnl Enable libtool support if the surrounding package wishes it.
1627 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1628 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1631 # Search path for a program which passes the given test.
1632 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1634 # This file can be copied and used freely without restrictions. It can
1635 # be used in projects which are not available under the GNU General Public
1636 # License or the GNU Library General Public License but which still want
1637 # to provide support for the GNU gettext functionality.
1638 # Please note that the actual code of the GNU gettext library is covered
1639 # by the GNU Library General Public License, and the rest of the GNU
1640 # gettext package package is covered by the GNU General Public License.
1641 # They are *not* in the public domain.
1645 dnl MUTT_AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1646 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1647 AC_DEFUN([MUTT_AM_PATH_PROG_WITH_TEST],
1648 [# Extract the first word of "$2", so it can be a program name with args.
1649 set dummy $2; ac_word=[$]2
1650 AC_MSG_CHECKING([for $ac_word])
1651 AC_CACHE_VAL(ac_cv_path_$1,
1654 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1657 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1658 for ac_dir in ifelse([$5], , $PATH, [$5]); do
1659 test -z "$ac_dir" && ac_dir=.
1660 if test -f $ac_dir/$ac_word; then
1662 ac_cv_path_$1="$ac_dir/$ac_word"
1668 dnl If no 4th arg is given, leave the cache variable unset,
1669 dnl so AC_PATH_PROGS will keep looking.
1670 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1675 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1676 AC_MSG_RESULT([$]$1)
1685 # Test for the GNU C Library, version 2.1 or newer.
1686 # From Bruno Haible.
1688 AC_DEFUN([MUTT_jm_GLIBC21],
1690 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1691 ac_cv_gnu_library_2_1,
1692 [AC_EGREP_CPP([Lucky GNU user],
1694 #include <features.h>
1695 #ifdef __GNU_LIBRARY__
1696 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1701 ac_cv_gnu_library_2_1=yes,
1702 ac_cv_gnu_library_2_1=no)
1706 GLIBC21="$ac_cv_gnu_library_2_1"
1712 dnl From Bruno Haible.
1714 AC_DEFUN([MUTT_AM_ICONV],
1716 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1717 dnl those with the standalone portable GNU libiconv installed).
1719 AC_ARG_WITH([libiconv-prefix],
1720 [ --with-libiconv-prefix=DIR Search for libiconv in DIR/include and DIR/lib], [
1721 for dir in `echo "$withval" | tr : ' '`; do
1722 if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1723 if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1727 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1728 am_cv_func_iconv="no, consider installing GNU libiconv"
1730 AC_TRY_LINK([#include <stdlib.h>
1731 #include <iconv.h>],
1732 [iconv_t cd = iconv_open("","");
1733 iconv(cd,NULL,NULL,NULL,NULL);
1735 am_cv_func_iconv=yes)
1736 if test "$am_cv_func_iconv" != yes; then
1737 am_save_LIBS="$LIBS"
1738 LIBS="$LIBS -liconv"
1739 AC_TRY_LINK([#include <stdlib.h>
1740 #include <iconv.h>],
1741 [iconv_t cd = iconv_open("","");
1742 iconv(cd,NULL,NULL,NULL,NULL);
1745 am_cv_func_iconv=yes)
1746 LIBS="$am_save_LIBS"
1749 if test "$am_cv_func_iconv" = yes; then
1750 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1751 AC_MSG_CHECKING([for iconv declaration])
1752 AC_CACHE_VAL(am_cv_proto_iconv, [
1760 #if defined(__STDC__) || defined(__cplusplus)
1761 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1765 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1766 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);"])
1767 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1768 AC_MSG_RESULT([$]{ac_t:-
1769 }[$]am_cv_proto_iconv)
1770 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1771 [Define as const if the declaration of iconv() needs const.])
1774 if test "$am_cv_lib_iconv" = yes; then
1782 dnl From Bruno Haible.
1784 AC_DEFUN([MUTT_AM_LANGINFO_CODESET],
1786 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1787 [AC_TRY_LINK([#include <langinfo.h>],
1788 [char* cs = nl_langinfo(CODESET);],
1789 am_cv_langinfo_codeset=yes,
1790 am_cv_langinfo_codeset=no)
1792 if test $am_cv_langinfo_codeset = yes; then
1793 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1794 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1798 # Check whether LC_MESSAGES is available in <locale.h>.
1799 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1801 # This file can be copied and used freely without restrictions. It can
1802 # be used in projects which are not available under the GNU General Public
1803 # License or the GNU Library General Public License but which still want
1804 # to provide support for the GNU gettext functionality.
1805 # Please note that the actual code of the GNU gettext library is covered
1806 # by the GNU Library General Public License, and the rest of the GNU
1807 # gettext package package is covered by the GNU General Public License.
1808 # They are *not* in the public domain.
1812 AC_DEFUN([MUTT_AM_LC_MESSAGES],
1813 [if test $ac_cv_header_locale_h = yes; then
1814 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
1815 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
1816 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
1817 if test $am_cv_val_LC_MESSAGES = yes; then
1818 AC_DEFINE(HAVE_LC_MESSAGES, 1,
1819 [Define if your <locale.h> file defines LC_MESSAGES.])
1825 dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
1827 dnl libesmtp often requires linking against -lpthread or -lc_r (BSD).
1828 dnl This macro attempts to centralize this code.
1830 AC_DEFUN([MUTT_AM_LIBESMTP],
1834 [ --with-libesmtp=DIR Compile in support for libesmtp for the MTA],
1835 [ if test "$with_libesmtp" != "no"
1837 mutt_libesmtp_check_path="$PATH"
1839 if test "$with_libesmtp" != "yes"
1841 mutt_libesmtp_check_path="$tmp_path:$withval/bin"
1844 dnl 1. Find libesmtp-config
1845 AC_PATH_PROG([mutt_libesmtp_config_path],
1848 [$mutt_libesmtp_check_path])
1850 if test "$mutt_libesmtp_config_path" = "no"
1852 AC_MSG_ERROR([libesmtp-config binary not found.])
1855 dnl 2. Get CFLAGS and LIBS from libesmtp-config
1856 mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
1857 mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
1859 dnl 3. Verify libesmtp.h can be found with these settings
1860 temp_CFLAGS="$CFLAGS"
1861 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1862 AC_CHECK_HEADER([libesmtp.h],
1864 AC_MSG_ERROR([Could not find libesmtp.h]))
1865 CFLAGS="$temp_CFLAGS"
1867 dnl 4. Verify the libesmtp library can be linked in
1868 temp_CFLAGS="$CFLAGS"
1870 CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
1871 LIBS="$LIBS $mutt_libesmtp_libs"
1872 AC_CHECK_LIB([esmtp],
1873 [smtp_create_session],
1875 AC_MSG_ERROR([Could not find libesmtp]))
1876 CFLAGS="$temp_CFLAGS"
1879 dnl 5. Export use_libesmtp variable so configure.in can
1880 dnl act accordingly.