Nico Golde:
[apps/madmutt.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
2
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.
8
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
12 # PARTICULAR PURPOSE.
13
14 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
15
16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
17
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)
21 # any later version.
22
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.
27
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
31 # 02111-1307, USA.
32
33 AC_PREREQ([2.52])
34
35 # serial 6
36
37 # AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
38 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
39
40 # Do all the work for Automake.                            -*- Autoconf -*-
41
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.
44
45 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
46 # Free Software Foundation, Inc.
47
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)
51 # any later version.
52
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.
57
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
61 # 02111-1307, USA.
62
63 # serial 10
64
65 AC_PREREQ([2.54])
66
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
70
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])
89 fi
90
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'
95   else
96     CYGPATH_W=echo
97   fi
98 fi
99 AC_SUBST([CYGPATH_W])
100
101 # Define the identity of the package.
102 dnl Distinguish between old-style and new-style calls.
103 m4_ifval([$2],
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
110
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
114
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)
124 AM_PROG_INSTALL_SH
125 AM_PROG_INSTALL_STRIP
126 # We need awk for the "check" target.  The system "awk" is bad on
127 # some platforms.
128 AC_REQUIRE([AC_PROG_AWK])dnl
129 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
130 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
131
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
141 ])
142 ])
143
144
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.
148
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.
154 _am_stamp_count=1
155 for _am_header in $config_headers :; do
156   case $_am_header in
157     $1 | $1:* )
158       break ;;
159     * )
160       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
161   esac
162 done
163 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
164
165 # Copyright 2002  Free Software Foundation, Inc.
166
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)
170 # any later version.
171
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.
176
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
180
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"])
186
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])])
193
194 # Helper functions for option handling.                    -*- Autoconf -*-
195
196 # Copyright 2001, 2002  Free Software Foundation, Inc.
197
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)
201 # any later version.
202
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.
207
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
211 # 02111-1307, USA.
212
213 # serial 2
214
215 # _AM_MANGLE_OPTION(NAME)
216 # -----------------------
217 AC_DEFUN([_AM_MANGLE_OPTION],
218 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
219
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)])
225
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)])])
231
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])])
237
238 #
239 # Check to make sure that the build environment is sane.
240 #
241
242 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
243
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)
247 # any later version.
248
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.
253
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
257 # 02111-1307, USA.
258
259 # serial 3
260
261 # AM_SANITY_CHECK
262 # ---------------
263 AC_DEFUN([AM_SANITY_CHECK],
264 [AC_MSG_CHECKING([whether build environment is sane])
265 # Just in case
266 sleep 1
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
272 # directory).
273 if (
274    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
275    if test "$[*]" = "X"; then
276       # -L didn't work.
277       set X `ls -t $srcdir/configure conftest.file`
278    fi
279    rm -f conftest.file
280    if test "$[*]" != "X $srcdir/configure conftest.file" \
281       && test "$[*]" != "X conftest.file $srcdir/configure"; then
282
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])
289    fi
290
291    test "$[2]" = conftest.file
292    )
293 then
294    # Ok.
295    :
296 else
297    AC_MSG_ERROR([newly created file is older than distributed files!
298 Check your system clock])
299 fi
300 AC_MSG_RESULT(yes)])
301
302 #  -*- Autoconf -*-
303
304
305 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
306
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)
310 # any later version.
311
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.
316
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
320 # 02111-1307, USA.
321
322 # serial 3
323
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"}
329 AC_SUBST($1)])
330
331
332 # AM_MISSING_HAS_RUN
333 # ------------------
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 "
342 else
343   am_missing_run=
344   AC_MSG_WARN([`missing' script is too old or missing])
345 fi
346 ])
347
348 # AM_AUX_DIR_EXPAND
349
350 # Copyright 2001 Free Software Foundation, Inc.
351
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)
355 # any later version.
356
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.
361
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
365 # 02111-1307, USA.
366
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/../..'.
370 #
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.
378 #
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
385 #
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.
390 #
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.
400 #
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.
404
405 # Rely on autoconf to set up CDPATH properly.
406 AC_PREREQ([2.50])
407
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`
411 ])
412
413 # AM_PROG_INSTALL_SH
414 # ------------------
415 # Define $install_sh.
416
417 # Copyright 2001 Free Software Foundation, Inc.
418
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)
422 # any later version.
423
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.
428
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
432 # 02111-1307, USA.
433
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)])
438
439 # AM_PROG_INSTALL_STRIP
440
441 # Copyright 2001 Free Software Foundation, Inc.
442
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)
446 # any later version.
447
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.
452
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
456 # 02111-1307, USA.
457
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], :)
474 fi
475 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
476 AC_SUBST([INSTALL_STRIP_PROGRAM])])
477
478 #                                                          -*- Autoconf -*-
479 # Copyright (C) 2003  Free Software Foundation, Inc.
480
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)
484 # any later version.
485
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.
490
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
494 # 02111-1307, USA.
495
496 # serial 1
497
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
504   am__leading_dot=.
505 else
506   am__leading_dot=_
507 fi
508 rmdir .tst 2>/dev/null
509 AC_SUBST([am__leading_dot])])
510
511 # serial 5                                              -*- Autoconf -*-
512
513 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
514
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)
518 # any later version.
519
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.
524
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
528 # 02111-1307, USA.
529
530
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...
536
537
538
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.
544 #
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
554
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=])
560
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
568   # in D'.
569   mkdir conftest.dir
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
573   cd 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
579   # directory.
580   mkdir sub
581
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`
585   fi
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.
590     #
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.
594     : > sub/conftest.c
595     for i in 1 2 3 4 5 6; do
596       echo '#include "conftst'$i'.h"' >> sub/conftest.c
597       : > sub/conftst$i.h
598     done
599     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
600
601     case $depmode in
602     nosideeffect)
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
606         continue
607       else
608         break
609       fi
610       ;;
611     none) break ;;
612     esac
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
629         break
630       fi
631     fi
632   done
633
634   cd ..
635   rm -rf conftest.dir
636 else
637   am_cv_$1_dependencies_compiler_type=none
638 fi
639 ])
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])
644 ])
645
646
647 # AM_SET_DEPDIR
648 # -------------
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
654 ])
655
656
657 # AM_DEP_TRACK
658 # ------------
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"
665   AMDEPBACKSLASH='\'
666 fi
667 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
668 AC_SUBST([AMDEPBACKSLASH])
669 ])
670
671 # Generate code to set up dependency tracking.   -*- Autoconf -*-
672
673 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
674
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)
678 # any later version.
679
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.
684
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
688 # 02111-1307, USA.
689
690 #serial 2
691
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")`
706   else
707     continue
708   fi
709   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
710   # Extract the definition of DEP_FILES from the Makefile without
711   # running `make'.
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 = .*\\\\$/ {
721       s/^DEP_FILES = //
722       :loop
723         s/\\\\$//
724         p
725         n
726         /\\\\$/ b loop
727       p
728     }
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"
737   done
738 done
739 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
740
741
742 # AM_OUTPUT_DEPENDENCY_COMMANDS
743 # -----------------------------
744 # This macro should only be invoked once -- use via AC_REQUIRE.
745 #
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"])
753 ])
754
755 # Check to see how 'make' treats includes.      -*- Autoconf -*-
756
757 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
758
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)
762 # any later version.
763
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.
768
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
772 # 02111-1307, USA.
773
774 # serial 2
775
776 # AM_MAKE_INCLUDE()
777 # -----------------
778 # Check to see how make treats includes.
779 AC_DEFUN([AM_MAKE_INCLUDE],
780 [am_make=${MAKE-make}
781 cat > confinc << 'END'
782 am__doit:
783         @echo done
784 .PHONY: am__doit
785 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])
788 am__include="#"
789 am__quote=
790 _am_result=none
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
799    am__include=include
800    am__quote=
801    _am_result=GNU
802 fi
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
807       am__include=.include
808       am__quote="\""
809       _am_result=BSD
810    fi
811 fi
812 AC_SUBST([am__include])
813 AC_SUBST([am__quote])
814 AC_MSG_RESULT([$_am_result])
815 rm -f confinc confmf
816 ])
817
818 # AM_CONDITIONAL                                              -*- Autoconf -*-
819
820 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
821
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)
825 # any later version.
826
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.
831
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
835 # 02111-1307, USA.
836
837 # serial 5
838
839 AC_PREREQ(2.52)
840
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
847 AC_SUBST([$1_TRUE])
848 AC_SUBST([$1_FALSE])
849 if $2; then
850   $1_TRUE=
851   $1_FALSE='#'
852 else
853   $1_TRUE='#'
854   $1_FALSE=
855 fi
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.])
860 fi])])
861
862 #serial 1
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
870
871 undefine([AC_ISC_POSIX])
872
873 AC_DEFUN([AC_ISC_POSIX],
874   [
875     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
876     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
877   ]
878 )
879
880
881 # Copyright 1996, 1997, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
882
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)
886 # any later version.
887
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.
892
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
896 # 02111-1307, USA.
897
898 # serial 2
899
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
905   AC_MSG_RESULT(yes)
906   AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
907   U= ANSI2KNR=
908 else
909   AC_MSG_RESULT(no)
910   U=_ ANSI2KNR=./ansi2knr
911 fi
912 # Ensure some checks needed by ansi2knr itself.
913 AC_HEADER_STDC
914 AC_CHECK_HEADERS(string.h)
915 AC_SUBST(U)dnl
916 AC_SUBST(ANSI2KNR)dnl
917 ])
918
919 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
920
921
922 # Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
923
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)
927 # any later version.
928
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.
933
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
937 # 02111-1307, USA.
938
939 # serial 2
940
941 # @defmac AC_PROG_CC_STDC
942 # @maindex PROG_CC_STDC
943 # @ovindex CC
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.
948 #
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.
954 # @end defmac
955
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
962 dnl like #elif.
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
969 ac_save_CC="$CC"
970 # Don't try gcc -ansi; that turns off useful extensions and
971 # breaks some systems' header files.
972 # AIX                   -qlanglvl=ansi
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__"
978 do
979   CC="$ac_save_CC $ac_arg"
980   AC_TRY_COMPILE(
981 [#include <stdarg.h>
982 #include <stdio.h>
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)
989      char **p;
990      int i;
991 {
992   return p[i];
993 }
994 static char *f (char * (*g) (char **, int), char **p, ...)
995 {
996   char *s;
997   va_list v;
998   va_start (v,p);
999   s = g (p, va_arg (v,int));
1000   va_end (v);
1001   return s;
1002 }
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);
1007 int argc;
1008 char **argv;
1009 ], [
1010 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1011 ],
1012 [am_cv_prog_cc_stdc="$ac_arg"; break])
1013 done
1014 CC="$ac_save_CC"
1015 ])
1016 if test -z "$am_cv_prog_cc_stdc"; then
1017   AC_MSG_RESULT([none needed])
1018 else
1019   AC_MSG_RESULT([$am_cv_prog_cc_stdc])
1020 fi
1021 case "x$am_cv_prog_cc_stdc" in
1022   x|xno) ;;
1023   *) CC="$CC $am_cv_prog_cc_stdc" ;;
1024 esac
1025 ])
1026
1027 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1028
1029 dnl types.m4
1030 dnl macros for type checks not covered by autoconf
1031
1032 dnl MUTT_C99_INTTYPES
1033 dnl Brendan Cully
1034 dnl
1035 # MUTT_C99_INTTYPES
1036 # Check for C99 integer type definitions, or define if missing
1037 AC_DEFUN([MUTT_C99_INTTYPES],
1038 [dnl
1039 AC_CHECK_HEADERS([inttypes.h])
1040 AC_CHECK_TYPE([uint32_t],
1041   [AC_DEFINE(HAVE_C99_INTTYPES, 1, [Define if you have the C99 integer types])],
1042   [AC_CHECK_SIZEOF(short)
1043    AC_CHECK_SIZEOF(int)
1044    AC_CHECK_SIZEOF(long)
1045    AC_CHECK_SIZEOF(long long)])
1046 AH_VERBATIM([X_HAVE_C99_INTTYPES],
1047   [#ifndef HAVE_C99_INTTYPES
1048 #  if SIZEOF_SHORT == 4
1049 typedef unsigned short uint32_t;
1050 #  elif SIZEOF_INT == 4
1051 typedef unsigned int uint32_t;
1052 #  elif SIZEOF_LONG == 4
1053 typedef unsigned long uint32_t;
1054 #  endif
1055 #  if SIZEOF_INT == 8
1056 typedef unsigned int uint64_t;
1057 #  elif SIZEOF_LONG == 8
1058 typedef unsigned long uint64_t;
1059 #  elif SIZEOF_LONG_LONG == 8
1060 typedef unsigned long long uint64_t;
1061 #  endif
1062 #endif
1063   ])
1064 ])
1065
1066 dnl ---------------------------------------------------------------------------
1067 dnl Look for the curses libraries.  Older curses implementations may require
1068 dnl termcap/termlib to be linked as well.
1069 AC_DEFUN([CF_CURSES_LIBS],[
1070 AC_CHECK_FUNC(initscr,,[
1071 case $host_os in #(vi
1072 freebsd*) #(vi
1073         AC_CHECK_LIB(mytinfo,tgoto,[LIBS="-lmytinfo $LIBS"])
1074         ;;
1075 hpux10.*|hpux11.*)
1076         AC_CHECK_LIB(cur_colr,initscr,[
1077                 LIBS="-lcur_colr $LIBS"
1078                 CFLAGS="-I/usr/include/curses_colr $CFLAGS"
1079                 ac_cv_func_initscr=yes
1080                 ],[
1081         AC_CHECK_LIB(Hcurses,initscr,[
1082                 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
1083                 LIBS="-lHcurses $LIBS"
1084                 CFLAGS="-D__HP_CURSES -D_HP_CURSES $CFLAGS"
1085                 ac_cv_func_initscr=yes
1086                 ])])
1087         ;;
1088 linux*) # Suse Linux does not follow /usr/lib convention
1089         LIBS="$LIBS -L/lib"
1090         ;;
1091 esac
1092
1093 if test ".$With5lib" != ".no" ; then
1094 if test -d /usr/5lib ; then
1095         # SunOS 3.x or 4.x
1096         CPPFLAGS="$CPPFLAGS -I/usr/5include"
1097         LIBS="$LIBS -L/usr/5lib"
1098 fi
1099 fi
1100
1101 if test ".$ac_cv_func_initscr" != .yes ; then
1102         cf_save_LIBS="$LIBS"
1103         cf_term_lib=""
1104         cf_curs_lib=""
1105
1106         # Check for library containing tgoto.  Do this before curses library
1107         # because it may be needed to link the test-case for initscr.
1108         AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
1109                 for cf_term_lib in termcap termlib unknown
1110                 do
1111                         AC_CHECK_LIB($cf_term_lib,tgoto,[break])
1112                 done
1113         ])
1114
1115         # Check for library containing initscr
1116         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
1117         for cf_curs_lib in cursesX curses ncurses xcurses jcurses unknown
1118         do
1119                 AC_CHECK_LIB($cf_curs_lib,initscr,[break])
1120         done
1121         test $cf_curs_lib = unknown && AC_ERROR(no curses library found)
1122
1123         LIBS="-l$cf_curs_lib $cf_save_LIBS"
1124         if test "$cf_term_lib" = unknown ; then
1125                 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
1126                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1127                         [initscr()],
1128                         [cf_result=yes],
1129                         [cf_result=no])
1130                 AC_MSG_RESULT($cf_result)
1131                 test $cf_result = no && AC_ERROR(Cannot link curses library)
1132         elif test "$cf_term_lib" != predefined ; then
1133                 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
1134                 AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1135                         [initscr(); tgoto((char *)0, 0, 0);],
1136                         [cf_result=no],
1137                         [
1138                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
1139                         AC_TRY_LINK([#include <${cf_cv_ncurses_header-curses.h}>],
1140                                 [initscr()],
1141                                 [cf_result=yes],
1142                                 [cf_result=error])
1143                         ])
1144                 AC_MSG_RESULT($cf_result)
1145         fi
1146 fi
1147
1148 ])])
1149
1150 dnl ---------------------------------------------------------------------------
1151 dnl Check if a function is declared by including a set of include files.
1152 dnl Invoke the corresponding actions according to whether it is found or not.
1153 dnl
1154 dnl Gcc (unlike other compilers) will only warn about the miscast assignment
1155 dnl in the first test, but most compilers will oblige with an error in the
1156 dnl second test.
1157 dnl
1158 dnl CF_CHECK_FUNCDECL(INCLUDES, FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1159 AC_DEFUN([CF_CHECK_FUNCDECL],
1160 [
1161 AC_MSG_CHECKING([for $2 declaration])
1162 AC_CACHE_VAL(ac_cv_func_decl_$2,
1163 [AC_TRY_COMPILE([$1],
1164 [#ifndef ${ac_func}
1165 extern  int     ${ac_func}();
1166 #endif],[
1167 AC_TRY_COMPILE([$1],
1168 [#ifndef ${ac_func}
1169 int     (*p)() = ${ac_func};
1170 #endif],[
1171 eval "ac_cv_func_decl_$2=yes"],[
1172 eval "ac_cv_func_decl_$2=no"])],[
1173 eval "ac_cv_func_decl_$2=yes"])])
1174 if eval "test \"`echo '$ac_cv_func_'decl_$2`\" = yes"; then
1175   AC_MSG_RESULT(yes)
1176   ifelse([$3], , :, [$3])
1177 else
1178   AC_MSG_RESULT(no)
1179 ifelse([$4], , , [$4
1180 ])dnl
1181 fi
1182 ])dnl
1183 dnl ---------------------------------------------------------------------------
1184 dnl Check if functions are declared by including a set of include files.
1185 dnl and define DECL_XXX if not.
1186 dnl
1187 dnl CF_CHECK_FUNCDECLS(INCLUDES, FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
1188 AC_DEFUN([CF_CHECK_FUNCDECLS],
1189 [for ac_func in $2
1190 do
1191 CF_CHECK_FUNCDECL([$1], $ac_func,
1192 [
1193   CF_UPPER(ac_tr_func,HAVE_$ac_func)
1194   AC_DEFINE_UNQUOTED($ac_tr_func) $3],
1195 [$4])dnl
1196 dnl [$3],
1197 dnl [
1198 dnl   CF_UPPER(ac_tr_func,DECL_$ac_func)
1199 dnl   AC_DEFINE_UNQUOTED($ac_tr_func) $4])dnl
1200 done
1201 ])dnl
1202 dnl ---------------------------------------------------------------------------
1203 dnl Make an uppercase version of a variable
1204 dnl $1=uppercase($2)
1205 AC_DEFUN([CF_UPPER],
1206 [
1207 changequote(,)dnl
1208 $1=`echo $2 | tr '[a-z]' '[A-Z]'`
1209 changequote([,])dnl
1210 ])dnl
1211 dnl ---------------------------------------------------------------------------
1212
1213 # gssapi.m4: Find GSSAPI libraries in either Heimdal or MIT implementations
1214 # Brendan Cully <brendan@kublai.com> 20010529
1215
1216 dnl MUTT_AM_PATH_GSSAPI(PREFIX)
1217 dnl Search for a GSSAPI implementation in the standard locations plus PREFIX,
1218 dnl if it is set and not "yes".
1219 dnl Defines GSSAPI_CFLAGS and GSSAPI_LIBS if found.
1220 dnl Defines GSSAPI_IMPL to "Heimdal", "MIT", or "OldMIT", or "none" if not found
1221 AC_DEFUN([MUTT_AM_PATH_GSSAPI],
1222 [
1223   GSSAPI_PREFIX=[$]$1
1224   GSSAPI_IMPL="none"
1225   saved_CPPFLAGS="$CPPFLAGS"
1226   saved_LDFLAGS="$LDFLAGS"
1227   saved_LIBS="$LIBS"
1228   dnl First try krb5-config
1229   if test "$GSSAPI_PREFIX" != "yes"
1230   then
1231     krb5_path="$GSSAPI_PREFIX/bin"
1232   else
1233     krb5_path="$PATH"
1234   fi
1235   AC_PATH_PROG(KRB5CFGPATH, krb5-config, none, $krb5_path)
1236   if test "$KRB5CFGPATH" != "none"
1237   then
1238     GSSAPI_CFLAGS="$CPPFLAGS `$KRB5CFGPATH --cflags gssapi`"
1239     GSSAPI_LIBS="$MUTTLIBS `$KRB5CFGPATH --libs gssapi`"
1240     case "`$KRB5CFGPATH --version`" in
1241       "Kerberos 5 "*)   GSSAPI_IMPL="MIT";;
1242       ?eimdal*)         GSSAPI_IMPL="Heimdal";;
1243       *)                GSSAPI_IMPL="Unknown";;
1244    esac
1245   else
1246     dnl No krb5-config, run the old code
1247     if test "$GSSAPI_PREFIX" != "yes"
1248     then
1249       GSSAPI_CFLAGS="-I$GSSAPI_PREFIX/include"
1250       GSSAPI_LDFLAGS="-L$GSSAPI_PREFIX/lib"
1251       CPPFLAGS="$CPPFLAGS $GSSAPI_CFLAGS"
1252       LDFLAGS="$LDFLAGS $GSSAPI_LDFLAGS"
1253     fi
1254
1255     dnl New MIT kerberos V support
1256     AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, [
1257       GSSAPI_IMPL="MIT",
1258       GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err"
1259       ],, -lkrb5 -lk5crypto -lcom_err)
1260
1261     dnl Heimdal kerberos V support
1262     if test "$GSSAPI_IMPL" = "none"
1263     then
1264       AC_CHECK_LIB(gssapi, gss_init_sec_context, [
1265           GSSAPI_IMPL="Heimdal"
1266           GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi -lkrb5 -ldes -lasn1 -lroken"
1267           GSSAPI_LIBS="$GSSAPI_LIBS -lcrypt -lcom_err"
1268           ],, -lkrb5 -ldes -lasn1 -lroken -lcrypt -lcom_err)
1269     fi
1270
1271     dnl Old MIT Kerberos V
1272     dnl Note: older krb5 distributions use -lcrypto instead of
1273     dnl -lk5crypto, which collides with OpenSSL.  One way of dealing
1274     dnl with that is to extract all objects from krb5's libcrypto
1275     dnl and from openssl's libcrypto into the same directory, then
1276     dnl to create a new libcrypto from these.
1277     if test "$GSSAPI_IMPL" = "none"
1278     then
1279       AC_CHECK_LIB(gssapi_krb5, g_order_init, [
1280         GSSAPI_IMPL="OldMIT",
1281         GSSAPI_LIBS="$GSSAPI_LDFLAGS -lgssapi_krb5 -lkrb5 -lcrypto -lcom_err"
1282         ],, -lkrb5 -lcrypto -lcom_err)
1283     fi
1284   fi
1285
1286   CPPFLAGS="$saved_CPPFLAGS"
1287   LDFLAGS="$saved_LDFLAGS"
1288   LIBS="$saved_LIBS"
1289 ])
1290
1291 dnl Autoconf macros for libgnutls
1292 dnl $id$
1293
1294 # Modified for mutt 20050210 Brendan Cully
1295 # Modified for LIBGNUTLS -- nmav
1296 # Configure paths for LIBGCRYPT
1297 # Shamelessly stolen from the one of XDELTA by Owen Taylor
1298 # Werner Koch   99-12-09
1299
1300 dnl MUTT_AM_PATH_GNUTLS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND ]]])
1301 dnl Test for libgnutls, and define LIBGNUTLS_CFLAGS and LIBGNUTLS_LIBS
1302 dnl
1303 AC_DEFUN([MUTT_AM_PATH_GNUTLS],
1304 [dnl
1305 dnl Get the cflags and libraries from the libgnutls-config script
1306 dnl
1307   libgnutls_config_prefix=$1
1308   min_libgnutls_version=0.1.0
1309
1310   if test x$libgnutls_config_prefix != x ; then
1311      if test x${LIBGNUTLS_CONFIG+set} != xset ; then
1312         LIBGNUTLS_CONFIG=$libgnutls_config_prefix/bin/libgnutls-config
1313      fi
1314   fi
1315
1316   AC_PATH_PROG(LIBGNUTLS_CONFIG, libgnutls-config, no)
1317   AC_MSG_CHECKING(for libgnutls - version >= $min_libgnutls_version)
1318   no_libgnutls=""
1319   if test "$LIBGNUTLS_CONFIG" = "no" ; then
1320     no_libgnutls=yes
1321   else
1322     LIBGNUTLS_CFLAGS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --cflags`
1323     LIBGNUTLS_LIBS=`$LIBGNUTLS_CONFIG $libgnutls_config_args --libs`
1324     libgnutls_config_version=`$LIBGNUTLS_CONFIG $libgnutls_config_args --version`
1325
1326
1327       ac_save_CFLAGS="$CFLAGS"
1328       ac_save_LIBS="$LIBS"
1329       CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
1330       LIBS="$LIBS $LIBGNUTLS_LIBS"
1331
1332 dnl
1333 dnl Now check if the installed libgnutls is sufficiently new. Also sanity
1334 dnl checks the results of libgnutls-config to some extent
1335 dnl
1336       rm -f conf.libgnutlstest
1337       AC_TRY_RUN([
1338 #include <stdio.h>
1339 #include <stdlib.h>
1340 #include <string.h>
1341 #include <gnutls/gnutls.h>
1342
1343 int
1344 main ()
1345 {
1346     system ("touch conf.libgnutlstest");
1347
1348     if( strcmp( gnutls_check_version(NULL), "$libgnutls_config_version" ) )
1349     {
1350       printf("\n*** 'libgnutls-config --version' returned %s, but LIBGNUTLS (%s)\n",
1351              "$libgnutls_config_version", gnutls_check_version(NULL) );
1352       printf("*** was found! If libgnutls-config was correct, then it is best\n");
1353       printf("*** to remove the old version of LIBGNUTLS. You may also be able to fix the error\n");
1354       printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1355       printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1356       printf("*** required on your system.\n");
1357       printf("*** If libgnutls-config was wrong, set the environment variable LIBGNUTLS_CONFIG\n");
1358       printf("*** to point to the correct copy of libgnutls-config, and remove the file config.cache\n");
1359       printf("*** before re-running configure\n");
1360     }
1361     else if ( strcmp(gnutls_check_version(NULL), LIBGNUTLS_VERSION ) )
1362     {
1363       printf("\n*** LIBGNUTLS header file (version %s) does not match\n", LIBGNUTLS_VERSION);
1364       printf("*** library (version %s)\n", gnutls_check_version(NULL) );
1365     }
1366     else
1367     {
1368       if ( gnutls_check_version( "$min_libgnutls_version" ) )
1369       {
1370         return 0;
1371       }
1372      else
1373       {
1374         printf("no\n*** An old version of LIBGNUTLS (%s) was found.\n",
1375                 gnutls_check_version(NULL) );
1376         printf("*** You need a version of LIBGNUTLS newer than %s. The latest version of\n",
1377                "$min_libgnutls_version" );
1378         printf("*** LIBGNUTLS is always available from ftp://gnutls.hellug.gr/pub/gnutls.\n");
1379         printf("*** \n");
1380         printf("*** If you have already installed a sufficiently new version, this error\n");
1381         printf("*** probably means that the wrong copy of the libgnutls-config shell script is\n");
1382         printf("*** being found. The easiest way to fix this is to remove the old version\n");
1383         printf("*** of LIBGNUTLS, but you can also set the LIBGNUTLS_CONFIG environment to point to the\n");
1384         printf("*** correct copy of libgnutls-config. (In this case, you will have to\n");
1385         printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1386         printf("*** so that the correct libraries are found at run-time))\n");
1387       }
1388     }
1389   return 1;
1390 }
1391 ],, no_libgnutls=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1392        CFLAGS="$ac_save_CFLAGS"
1393        LIBS="$ac_save_LIBS"
1394   fi
1395
1396   if test "x$no_libgnutls" = x ; then
1397      AC_MSG_RESULT(yes)
1398      dnl some openssl compatibility code was moved in gnutls 1.2
1399      AC_CHECK_HEADERS([gnutls/openssl.h])
1400      ifelse([$2], , :, [$2])
1401   else
1402      if test -f conf.libgnutlstest ; then
1403         :
1404      else
1405         AC_MSG_RESULT(no)
1406      fi
1407      if test "$LIBGNUTLS_CONFIG" = "no" ; then
1408        echo "*** The libgnutls-config script installed by LIBGNUTLS could not be found"
1409        echo "*** If LIBGNUTLS was installed in PREFIX, make sure PREFIX/bin is in"
1410        echo "*** your path, or set the LIBGNUTLS_CONFIG environment variable to the"
1411        echo "*** full path to libgnutls-config."
1412      else
1413        if test -f conf.libgnutlstest ; then
1414         :
1415        else
1416           echo "*** Could not run libgnutls test program, checking why..."
1417           CFLAGS="$CFLAGS $LIBGNUTLS_CFLAGS"
1418           LIBS="$LIBS $LIBGNUTLS_LIBS"
1419           AC_TRY_LINK([
1420 #include <stdio.h>
1421 #include <stdlib.h>
1422 #include <string.h>
1423 #include <gnutls/gnutls.h>
1424 ],      [ return !!gnutls_check_version(NULL); ],
1425         [ echo "*** The test program compiled, but did not run. This usually means"
1426           echo "*** that the run-time linker is not finding LIBGNUTLS or finding the wrong"
1427           echo "*** version of LIBGNUTLS. If it is not finding LIBGNUTLS, you'll need to set your"
1428           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1429           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1430           echo "*** is required on your system"
1431           echo "***"
1432           echo "*** If you have an old version installed, it is best to remove it, although"
1433           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
1434           echo "***" ],
1435         [ echo "*** The test program failed to compile or link. See the file config.log for the"
1436           echo "*** exact error that occured. This usually means LIBGNUTLS was incorrectly installed"
1437           echo "*** or that you have moved LIBGNUTLS since it was installed. In the latter case, you"
1438           echo "*** may want to edit the libgnutls-config script: $LIBGNUTLS_CONFIG" ])
1439           CFLAGS="$ac_save_CFLAGS"
1440           LIBS="$ac_save_LIBS"
1441        fi
1442      fi
1443      LIBGNUTLS_CFLAGS=""
1444      LIBGNUTLS_LIBS=""
1445      ifelse([$3], , :, [$3])
1446   fi
1447   rm -f conf.libgnutlstest
1448   AC_SUBST(LIBGNUTLS_CFLAGS)
1449   AC_SUBST(LIBGNUTLS_LIBS)
1450 ])
1451
1452 dnl *-*wedit:notab*-*  Please keep this as the last line.
1453
1454 # Macro to add for using GNU gettext.
1455 # Ulrich Drepper <drepper@cygnus.com>, 1995.
1456
1457 #
1458 # Slightly modified by Thomas Roessler <roessler@does-not-exist.org>
1459 # Updated to gettext-0.10.38 by Edmund Grimley Evans <edmundo@rano.org>
1460 # Updated to gettext-0.10.40 by Andrew W. Nosenko <awn@bcs.zp.ua>
1461 #
1462
1463 # This file can be copied and used freely without restrictions.  It can
1464 # be used in projects which are not available under the GNU General Public
1465 # License or the GNU Library General Public License but which still want
1466 # to provide support for the GNU gettext functionality.
1467 # Please note that the actual code of the GNU gettext library is covered
1468 # by the GNU Library General Public License, and the rest of the GNU
1469 # gettext package package is covered by the GNU General Public License.
1470 # They are *not* in the public domain.
1471
1472 # serial 10
1473
1474 dnl Usage: MUTT_AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]).
1475 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
1476 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1477 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
1478 dnl    AM-DISABLE-SHARED). Otherwise, a static library
1479 dnl    $(top_builddir)/intl/libintl.a will be created.
1480 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1481 dnl    implementations (in libc or libintl) without the ngettext() function
1482 dnl    will be ignored.
1483 dnl LIBDIR is used to find the intl libraries.  If empty,
1484 dnl    the value `$(top_builddir)/intl/' is used.
1485 dnl
1486 dnl The result of the configuration is one of three cases:
1487 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1488 dnl    and used.
1489 dnl    Catalog format: GNU --> install in $(datadir)
1490 dnl    Catalog extension: .mo after installation, .gmo in source tree
1491 dnl 2) GNU gettext has been found in the system's C library.
1492 dnl    Catalog format: GNU --> install in $(datadir)
1493 dnl    Catalog extension: .mo after installation, .gmo in source tree
1494 dnl 3) No internationalization, always use English msgid.
1495 dnl    Catalog format: none
1496 dnl    Catalog extension: none
1497 dnl The use of .gmo is historical (it was needed to avoid overwriting the
1498 dnl GNU format catalogs when building on a platform with an X/Open gettext),
1499 dnl but we keep it in order not to force irrelevant filename changes on the
1500 dnl maintainers.
1501 dnl
1502 AC_DEFUN([MUTT_AM_WITH_NLS],
1503   [AC_MSG_CHECKING([whether NLS is requested])
1504     dnl Default is enabled NLS
1505     AC_ARG_ENABLE(nls,
1506       AC_HELP_STRING([--disable-nls], [Do not use Native Language Support]),
1507       USE_NLS=$enableval, USE_NLS=yes)
1508     AC_MSG_RESULT($USE_NLS)
1509     AC_SUBST(USE_NLS)
1510
1511     BUILD_INCLUDED_LIBINTL=no
1512     USE_INCLUDED_LIBINTL=no
1513     INTLLIBS=
1514
1515     dnl If we use NLS figure out what method
1516     if test "$USE_NLS" = "yes"; then
1517       AC_DEFINE(ENABLE_NLS, 1,
1518         [Define to 1 if translation of program messages to the user's native language
1519    is requested.])
1520       AC_MSG_CHECKING([whether included gettext is requested])
1521       AC_ARG_WITH(included-gettext,
1522         AC_HELP_STRING([--with-included-gettext], [Use the GNU gettext library included here]),
1523         nls_cv_force_use_gnu_gettext=$withval,
1524         nls_cv_force_use_gnu_gettext=no)
1525       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1526
1527       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1528       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1529         dnl User does not insist on using GNU NLS library.  Figure out what
1530         dnl to use.  If GNU gettext is available we use this.  Else we have
1531         dnl to fall back to GNU NLS library.
1532         CATOBJEXT=NONE
1533
1534         dnl Add a version number to the cache macros.
1535         define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc])
1536         define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl])
1537
1538         AC_CHECK_HEADER(libintl.h,
1539           [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1540             [AC_TRY_LINK([#include <libintl.h>
1541 extern int _nl_msg_cat_cntr;],
1542                [bindtextdomain ("", "");
1543 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1544                gt_cv_func_gnugettext_libc=yes,
1545                gt_cv_func_gnugettext_libc=no)])
1546
1547            if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1548              AC_CACHE_CHECK([for GNU gettext in libintl],
1549                gt_cv_func_gnugettext_libintl,
1550                [gt_save_LIBS="$LIBS"
1551                 LIBS="$LIBS -lintl $LIBICONV"
1552                 AC_TRY_LINK([#include <libintl.h>
1553 extern int _nl_msg_cat_cntr;],
1554                   [bindtextdomain ("", "");
1555 return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr],
1556                   gt_cv_func_gnugettext_libintl=yes,
1557                   gt_cv_func_gnugettext_libintl=no)
1558                 LIBS="$gt_save_LIBS"])
1559            fi
1560
1561            dnl If an already present or preinstalled GNU gettext() is found,
1562            dnl use it.  But if this macro is used in GNU gettext, and GNU
1563            dnl gettext is already preinstalled in libintl, we update this
1564            dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1565            if test "$gt_cv_func_gnugettext_libc" = "yes" \
1566               || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1567                    && test "$PACKAGE" != gettext; }; then
1568              AC_DEFINE(HAVE_GETTEXT, 1,
1569                [Define if the GNU gettext() function is already present or preinstalled.])
1570
1571              if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1572                dnl If iconv() is in a separate libiconv library, then anyone
1573                dnl linking with libintl{.a,.so} also needs to link with
1574                dnl libiconv.
1575                INTLLIBS="-lintl $LIBICONV"
1576              fi
1577
1578              gt_save_LIBS="$LIBS"
1579              LIBS="$LIBS $INTLLIBS"
1580              AC_CHECK_FUNCS(dcgettext)
1581              LIBS="$gt_save_LIBS"
1582
1583              dnl Search for GNU msgfmt in the PATH.
1584              MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1585                [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1586              AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1587
1588              dnl Search for GNU xgettext in the PATH.
1589              MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1590                [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1591
1592              CATOBJEXT=.gmo
1593            fi
1594         ])
1595
1596         if test "$CATOBJEXT" = "NONE"; then
1597           dnl GNU gettext is not found in the C library.
1598           dnl Fall back on GNU gettext library.
1599           nls_cv_use_gnu_gettext=yes
1600         fi
1601       fi
1602
1603       if test "$nls_cv_use_gnu_gettext" = "yes"; then
1604         dnl Mark actions used to generate GNU NLS library.
1605         INTLOBJS="\$(GETTOBJS)"
1606         MUTT_AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1607           [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
1608         AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1609         MUTT_AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1610           [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
1611         AC_SUBST(MSGFMT)
1612         BUILD_INCLUDED_LIBINTL=yes
1613         USE_INCLUDED_LIBINTL=yes
1614         CATOBJEXT=.gmo
1615         INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
1616         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1617       fi
1618
1619       dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
1620       dnl Test whether we really found GNU msgfmt.
1621       if test "$GMSGFMT" != ":"; then
1622         dnl If it is no GNU msgfmt we define it as : so that the
1623         dnl Makefiles still can work.
1624         if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
1625           : ;
1626         else
1627           AC_MSG_RESULT(
1628             [found msgfmt program is not GNU msgfmt; ignore it])
1629           GMSGFMT=":"
1630         fi
1631       fi
1632
1633       dnl This could go away some day; the MUTT_PATH_PROG_WITH_TEST already does it.
1634       dnl Test whether we really found GNU xgettext.
1635       if test "$XGETTEXT" != ":"; then
1636         dnl If it is no GNU xgettext we define it as : so that the
1637         dnl Makefiles still can work.
1638         if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
1639           : ;
1640         else
1641           AC_MSG_RESULT(
1642             [found xgettext program is not GNU xgettext; ignore it])
1643           XGETTEXT=":"
1644         fi
1645       fi
1646
1647       dnl We need to process the po/ directory.
1648       POSUB=po
1649     fi
1650     AC_OUTPUT_COMMANDS(
1651      [for ac_file in $CONFIG_FILES; do
1652         # Support "outfile[:infile[:infile...]]"
1653         case "$ac_file" in
1654           *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1655         esac
1656         # PO directories have a Makefile.in generated from Makefile.in.in.
1657         case "$ac_file" in */Makefile.in)
1658           # Adjust a relative srcdir.
1659           ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1660           ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1661           ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1662           # In autoconf-2.13 it is called $ac_given_srcdir.
1663           # In autoconf-2.50 it is called $srcdir.
1664           test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1665           case "$ac_given_srcdir" in
1666             .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1667             /*) top_srcdir="$ac_given_srcdir" ;;
1668             *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1669           esac
1670           if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1671             rm -f "$ac_dir/POTFILES"
1672             test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1673             sed -e "/^#/d" -e "/^[      ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
1674             test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1675             sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1676           fi
1677           ;;
1678         esac
1679       done])
1680
1681
1682     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1683     dnl to 'yes' because some of the testsuite requires it.
1684     if test "$PACKAGE" = gettext; then
1685       BUILD_INCLUDED_LIBINTL=yes
1686     fi
1687
1688     dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1689     dnl because plural.y uses bison specific features. It requires at least
1690     dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1691     dnl compile.
1692     dnl bison is only needed for the maintainer (who touches plural.y). But in
1693     dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1694     dnl the rule in general Makefile. Now, some people carelessly touch the
1695     dnl files or have a broken "make" program, hence the plural.c rule will
1696     dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1697     dnl present or too old.
1698     AC_CHECK_PROGS([INTLBISON], [bison])
1699     if test -z "$INTLBISON"; then
1700       ac_verc_fail=yes
1701     else
1702       dnl Found it, now check the version.
1703       AC_MSG_CHECKING([version of bison])
1704 changequote(<<,>>)dnl
1705       ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1706       case $ac_prog_version in
1707         '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1708         1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1709 changequote([,])dnl
1710            ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1711         *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1712       esac
1713       AC_MSG_RESULT([$ac_prog_version])
1714     fi
1715     if test $ac_verc_fail = yes; then
1716       INTLBISON=:
1717     fi
1718
1719     dnl These rules are solely for the distribution goal.  While doing this
1720     dnl we only have to keep exactly one list of the available catalogs
1721     dnl in configure.in.
1722     for lang in $ALL_LINGUAS; do
1723       GMOFILES="$GMOFILES $lang.gmo"
1724       POFILES="$POFILES $lang.po"
1725     done
1726
1727     dnl Make all variables we use known to autoconf.
1728     AC_SUBST(BUILD_INCLUDED_LIBINTL)
1729     AC_SUBST(USE_INCLUDED_LIBINTL)
1730     AC_SUBST(CATALOGS)
1731     AC_SUBST(CATOBJEXT)
1732     AC_SUBST(GMOFILES)
1733     AC_SUBST(INTLLIBS)
1734     AC_SUBST(INTLOBJS)
1735     AC_SUBST(POFILES)
1736     AC_SUBST(POSUB)
1737
1738     dnl For backward compatibility. Some configure.ins may be using this.
1739     nls_cv_header_intl=
1740     nls_cv_header_libgt=
1741
1742     dnl For backward compatibility. Some Makefiles may be using this.
1743     DATADIRNAME=share
1744     AC_SUBST(DATADIRNAME)
1745
1746     dnl For backward compatibility. Some Makefiles may be using this.
1747     INSTOBJEXT=.mo
1748     AC_SUBST(INSTOBJEXT)
1749
1750     dnl For backward compatibility. Some Makefiles may be using this.
1751     GENCAT=gencat
1752     AC_SUBST(GENCAT)
1753   ])
1754
1755 dnl Usage: Just like MUTT_AM_WITH_NLS, which see.
1756 AC_DEFUN([MUTT_AM_GNU_GETTEXT],
1757   [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1758    AC_REQUIRE([AC_PROG_CC])dnl
1759    AC_REQUIRE([AC_CANONICAL_HOST])dnl
1760    AC_REQUIRE([AC_PROG_RANLIB])dnl
1761    AC_REQUIRE([AC_ISC_POSIX])dnl
1762    AC_REQUIRE([AC_HEADER_STDC])dnl
1763    AC_REQUIRE([AC_C_CONST])dnl
1764    AC_REQUIRE([AC_C_INLINE])dnl
1765    AC_REQUIRE([AC_TYPE_OFF_T])dnl
1766    AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1767    AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1768    AC_REQUIRE([AC_FUNC_MMAP])dnl
1769    AC_REQUIRE([MUTT_jm_GLIBC21])dnl
1770
1771    AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1772 stdlib.h string.h unistd.h sys/param.h])
1773    AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
1774 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
1775 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1776
1777    MUTT_AM_ICONV
1778    MUTT_AM_LANGINFO_CODESET
1779    MUTT_AM_LC_MESSAGES
1780    MUTT_AM_WITH_NLS([$1],[$2],[$3])
1781
1782    if test "x$CATOBJEXT" != "x"; then
1783      if test "x$ALL_LINGUAS" = "x"; then
1784        LINGUAS=
1785      else
1786        AC_MSG_CHECKING(for catalogs to be installed)
1787        NEW_LINGUAS=
1788        for presentlang in $ALL_LINGUAS; do
1789          useit=no
1790          for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
1791            # Use the presentlang catalog if desiredlang is
1792            #   a. equal to presentlang, or
1793            #   b. a variant of presentlang (because in this case,
1794            #      presentlang can be used as a fallback for messages
1795            #      which are not translated in the desiredlang catalog).
1796            case "$desiredlang" in
1797              "$presentlang"*) useit=yes;;
1798            esac
1799          done
1800          if test $useit = yes; then
1801            NEW_LINGUAS="$NEW_LINGUAS $presentlang"
1802          fi
1803        done
1804        LINGUAS=$NEW_LINGUAS
1805        AC_MSG_RESULT($LINGUAS)
1806      fi
1807
1808      dnl Construct list of names of catalog files to be constructed.
1809      if test -n "$LINGUAS"; then
1810        for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
1811      fi
1812    fi
1813
1814    dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1815    dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1816    dnl Try to locate is.
1817    MKINSTALLDIRS=
1818    if test -n "$ac_aux_dir"; then
1819      MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1820    fi
1821    if test -z "$MKINSTALLDIRS"; then
1822      MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1823    fi
1824    AC_SUBST(MKINSTALLDIRS)
1825
1826    dnl Enable libtool support if the surrounding package wishes it.
1827    INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
1828    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1829   ])
1830
1831 # Search path for a program which passes the given test.
1832 # Ulrich Drepper <drepper@cygnus.com>, 1996.
1833 #
1834 # This file can be copied and used freely without restrictions.  It can
1835 # be used in projects which are not available under the GNU General Public
1836 # License or the GNU Library General Public License but which still want
1837 # to provide support for the GNU gettext functionality.
1838 # Please note that the actual code of the GNU gettext library is covered
1839 # by the GNU Library General Public License, and the rest of the GNU
1840 # gettext package package is covered by the GNU General Public License.
1841 # They are *not* in the public domain.
1842
1843 # serial 2
1844
1845 dnl MUTT_AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1846 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1847 AC_DEFUN([MUTT_AM_PATH_PROG_WITH_TEST],
1848 [# Extract the first word of "$2", so it can be a program name with args.
1849 set dummy $2; ac_word=[$]2
1850 AC_MSG_CHECKING([for $ac_word])
1851 AC_CACHE_VAL(ac_cv_path_$1,
1852 [case "[$]$1" in
1853   /*)
1854   ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1855   ;;
1856   *)
1857   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
1858   for ac_dir in ifelse([$5], , $PATH, [$5]); do
1859     test -z "$ac_dir" && ac_dir=.
1860     if test -f $ac_dir/$ac_word; then
1861       if [$3]; then
1862         ac_cv_path_$1="$ac_dir/$ac_word"
1863         break
1864       fi
1865     fi
1866   done
1867   IFS="$ac_save_ifs"
1868 dnl If no 4th arg is given, leave the cache variable unset,
1869 dnl so AC_PATH_PROGS will keep looking.
1870 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1871 ])dnl
1872   ;;
1873 esac])dnl
1874 $1="$ac_cv_path_$1"
1875 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1876   AC_MSG_RESULT([$]$1)
1877 else
1878   AC_MSG_RESULT(no)
1879 fi
1880 AC_SUBST($1)dnl
1881 ])
1882
1883 #serial 2
1884
1885 # Test for the GNU C Library, version 2.1 or newer.
1886 # From Bruno Haible.
1887
1888 AC_DEFUN([MUTT_jm_GLIBC21],
1889   [
1890     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
1891       ac_cv_gnu_library_2_1,
1892       [AC_EGREP_CPP([Lucky GNU user],
1893         [
1894 #include <features.h>
1895 #ifdef __GNU_LIBRARY__
1896  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
1897   Lucky GNU user
1898  #endif
1899 #endif
1900         ],
1901         ac_cv_gnu_library_2_1=yes,
1902         ac_cv_gnu_library_2_1=no)
1903       ]
1904     )
1905     AC_SUBST(GLIBC21)
1906     GLIBC21="$ac_cv_gnu_library_2_1"
1907   ]
1908 )
1909
1910 #serial AM2
1911
1912 dnl From Bruno Haible.
1913
1914 AC_DEFUN([MUTT_AM_ICONV],
1915 [
1916   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
1917   dnl those with the standalone portable GNU libiconv installed).
1918
1919   AC_ARG_WITH([libiconv-prefix],
1920 AC_HELP_STRING([--with-libiconv-prefix=DIR], [Search for libiconv in DIR/include and DIR/lib]), [
1921     for dir in `echo "$withval" | tr : ' '`; do
1922       if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi
1923       if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi
1924     done
1925    ])
1926
1927   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
1928     am_cv_func_iconv="no, consider installing GNU libiconv"
1929     am_cv_lib_iconv=no
1930     AC_TRY_LINK([#include <stdlib.h>
1931 #include <iconv.h>],
1932       [iconv_t cd = iconv_open("","");
1933        iconv(cd,NULL,NULL,NULL,NULL);
1934        iconv_close(cd);],
1935       am_cv_func_iconv=yes)
1936     if test "$am_cv_func_iconv" != yes; then
1937       am_save_LIBS="$LIBS"
1938       LIBS="$LIBS -liconv"
1939       AC_TRY_LINK([#include <stdlib.h>
1940 #include <iconv.h>],
1941         [iconv_t cd = iconv_open("","");
1942          iconv(cd,NULL,NULL,NULL,NULL);
1943          iconv_close(cd);],
1944         am_cv_lib_iconv=yes
1945         am_cv_func_iconv=yes)
1946       LIBS="$am_save_LIBS"
1947     fi
1948   ])
1949   if test "$am_cv_func_iconv" = yes; then
1950     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
1951     AC_MSG_CHECKING([for iconv declaration])
1952     AC_CACHE_VAL(am_cv_proto_iconv, [
1953       AC_TRY_COMPILE([
1954 #include <stdlib.h>
1955 #include <iconv.h>
1956 extern
1957 #ifdef __cplusplus
1958 "C"
1959 #endif
1960 #if defined(__STDC__) || defined(__cplusplus)
1961 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
1962 #else
1963 size_t iconv();
1964 #endif
1965 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
1966       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);"])
1967     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
1968     AC_MSG_RESULT([$]{ac_t:-
1969          }[$]am_cv_proto_iconv)
1970     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
1971       [Define as const if the declaration of iconv() needs const.])
1972   fi
1973   LIBICONV=
1974   if test "$am_cv_lib_iconv" = yes; then
1975     LIBICONV="-liconv"
1976   fi
1977   AC_SUBST(LIBICONV)
1978 ])
1979
1980 #serial AM1
1981
1982 dnl From Bruno Haible.
1983
1984 AC_DEFUN([MUTT_AM_LANGINFO_CODESET],
1985 [
1986   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
1987     [AC_TRY_LINK([#include <langinfo.h>],
1988       [char* cs = nl_langinfo(CODESET);],
1989       am_cv_langinfo_codeset=yes,
1990       am_cv_langinfo_codeset=no)
1991     ])
1992   if test $am_cv_langinfo_codeset = yes; then
1993     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
1994       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
1995   fi
1996 ])
1997
1998 # Check whether LC_MESSAGES is available in <locale.h>.
1999 # Ulrich Drepper <drepper@cygnus.com>, 1995.
2000 #
2001 # This file can be copied and used freely without restrictions.  It can
2002 # be used in projects which are not available under the GNU General Public
2003 # License or the GNU Library General Public License but which still want
2004 # to provide support for the GNU gettext functionality.
2005 # Please note that the actual code of the GNU gettext library is covered
2006 # by the GNU Library General Public License, and the rest of the GNU
2007 # gettext package package is covered by the GNU General Public License.
2008 # They are *not* in the public domain.
2009
2010 # serial 2
2011
2012 AC_DEFUN([MUTT_AM_LC_MESSAGES],
2013   [if test $ac_cv_header_locale_h = yes; then
2014     AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2015       [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2016        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2017     if test $am_cv_val_LC_MESSAGES = yes; then
2018       AC_DEFINE(HAVE_LC_MESSAGES, 1,
2019         [Define if your <locale.h> file defines LC_MESSAGES.])
2020     fi
2021   fi])
2022
2023 dnl vim:ft=config:
2024
2025 dnl Search for libesmtp, by Steven Engelhardt <sengelha@yahoo.com>
2026 dnl
2027 dnl libesmtp often requires linking against -lpthread or -lc_r (BSD).
2028 dnl This macro attempts to centralize this code.
2029
2030 AC_DEFUN([MUTT_AM_LIBESMTP],
2031 [
2032   AC_ARG_WITH(
2033     [libesmtp],
2034     [  --with-libesmtp=DIR      Compile in support for libesmtp for the MTA],
2035     [ if test "$with_libesmtp" != "no"
2036       then
2037         mutt_libesmtp_check_path="$PATH"
2038
2039         if test "$with_libesmtp" != "yes"
2040         then
2041           mutt_libesmtp_check_path="$tmp_path:$withval/bin"
2042         fi
2043
2044         dnl 1. Find libesmtp-config
2045         AC_PATH_PROG([mutt_libesmtp_config_path],
2046                      [libesmtp-config],
2047                      [no],
2048                      [$mutt_libesmtp_check_path])
2049
2050         if test "$mutt_libesmtp_config_path" = "no"
2051         then
2052           AC_MSG_ERROR([libesmtp-config binary not found.])
2053         fi
2054
2055         dnl 2. Get CFLAGS and LIBS from libesmtp-config
2056         mutt_libesmtp_cflags=`$mutt_libesmtp_config_path --cflags`
2057         mutt_libesmtp_libs=`$mutt_libesmtp_config_path --libs`
2058
2059         dnl 3. Verify libesmtp.h can be found with these settings
2060         temp_CFLAGS="$CFLAGS"
2061         CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
2062         AC_CHECK_HEADER([libesmtp.h],
2063                         [],
2064                         AC_MSG_ERROR([Could not find libesmtp.h]))
2065         CFLAGS="$temp_CFLAGS"
2066
2067         dnl 4. Verify the libesmtp library can be linked in
2068         temp_CFLAGS="$CFLAGS"
2069         temp_LIBS="$LIBS"
2070         CFLAGS="$CFLAGS $mutt_libesmtp_cflags"
2071         LIBS="$LIBS $mutt_libesmtp_libs"
2072         AC_CHECK_LIB([esmtp],
2073                      [smtp_create_session],
2074                      [],
2075                      AC_MSG_ERROR([Could not find libesmtp]))
2076         CFLAGS="$temp_CFLAGS"
2077         LIBS="$temp_LIBS"
2078
2079         dnl 5. Export use_libesmtp variable so configure.in can
2080         dnl    act accordingly.
2081         use_libesmtp=yes
2082       fi
2083     ]
2084   )
2085 ])
2086