Update build system to Autoconf 2.58, Automake 1.7, gettext 0.12.1.
[pspp-builds.git] / aclocal.m4
1 # generated automatically by aclocal 1.7.9 -*- 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 dnl Check longest integer in digits.
15
16 AC_DEFUN([BLP_INT_DIGITS],
17 [
18 AC_MSG_CHECKING(number of digits in LONG_MIN (incl. sign))
19 AC_CACHE_VAL(blp_int_digits,
20              [AC_TRY_RUN([#include <stdio.h>
21                           #include <limits.h>
22                           int
23                           main()
24                           {
25                             int len;
26                             char s[80];
27                             sprintf(s, "%ld", LONG_MAX);
28                             len = strlen(s);
29                             sprintf(s, "%ld", LONG_MIN);
30                             if(strlen(s)>len) len=strlen(s);
31                             sprintf(s, "%lu", ULONG_MAX);
32                             if(strlen(s)>len) len=strlen(s);
33                             exit(len);
34                           }
35                          ],
36                          eval "blp_int_digits=19",
37                          eval "blp_int_digits=$?"
38                          if test "$blp_int_digits" -lt 11; then
39                            blp_int_digits=11
40                          fi,
41                          eval "blp_int_digits=19")
42              ])
43 AC_DEFINE_UNQUOTED([INT_DIGITS], $blp_int_digits,
44         [Number of digits in longest `long' value, including sign.
45          This is usually 11, for 32-bit `long's, or 19, for 64-bit
46          `long's.])
47 AC_MSG_RESULT($blp_int_digits) ])dnl
48
49 dnl Check quality of this machine's sprintf implementation.
50
51 AC_DEFUN([BLP_IS_SPRINTF_GOOD],
52 [
53 AC_MSG_CHECKING(if sprintf returns a char count)
54 AC_CACHE_VAL(blp_is_sprintf_good,
55              [AC_TRY_RUN([#include <stdio.h>
56                           int 
57                           main()
58                           {
59                             char s[8];
60                             exit((int)sprintf(s, "abcdefg")!=7);
61                           }
62                          ], 
63                          eval "blp_is_sprintf_good=yes",
64                          eval "blp_is_sprintf_good=no",
65                          eval "blp_is_sprintf_good=no")
66              ])
67 if test "$blp_is_sprintf_good" = yes; then
68   AC_DEFINE([HAVE_GOOD_SPRINTF], 1, 
69         [Define if sprintf() returns the number of characters written
70          to the destination string, excluding the null terminator.])
71   AC_MSG_RESULT(yes)
72 else
73   AC_MSG_RESULT(no)
74 fi
75 ])dnl
76
77 dnl Check for proper random number generator.
78
79 AC_DEFUN([BLP_RANDOM],
80 [
81 AC_MSG_CHECKING(random number generator)
82 AC_CACHE_VAL(blp_random_good, 
83   AC_TRY_COMPILE([#include <stdlib.h>], [int x=RAND_MAX;], 
84     blp_random_good=yes, blp_random_good=no))
85 if test "$blp_random_good" = yes; then
86   AC_DEFINE([HAVE_GOOD_RANDOM], 1, 
87         [Define if rand() and company work according to ANSI.])
88   AC_MSG_RESULT(good)
89 else
90   AC_MSG_RESULT(bad)
91 fi
92 ])dnl
93
94 dnl aclocal.m4 ends here
95
96 # Do all the work for Automake.                            -*- Autoconf -*-
97
98 # This macro actually does too much some checks are only needed if
99 # your package does certain things.  But this isn't really a big deal.
100
101 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
102 # Free Software Foundation, Inc.
103
104 # This program is free software; you can redistribute it and/or modify
105 # it under the terms of the GNU General Public License as published by
106 # the Free Software Foundation; either version 2, or (at your option)
107 # any later version.
108
109 # This program is distributed in the hope that it will be useful,
110 # but WITHOUT ANY WARRANTY; without even the implied warranty of
111 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
112 # GNU General Public License for more details.
113
114 # You should have received a copy of the GNU General Public License
115 # along with this program; if not, write to the Free Software
116 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
117 # 02111-1307, USA.
118
119 # serial 10
120
121 AC_PREREQ([2.54])
122
123 # Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
124 # the ones we care about.
125 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
126
127 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
128 # AM_INIT_AUTOMAKE([OPTIONS])
129 # -----------------------------------------------
130 # The call with PACKAGE and VERSION arguments is the old style
131 # call (pre autoconf-2.50), which is being phased out.  PACKAGE
132 # and VERSION should now be passed to AC_INIT and removed from
133 # the call to AM_INIT_AUTOMAKE.
134 # We support both call styles for the transition.  After
135 # the next Automake release, Autoconf can make the AC_INIT
136 # arguments mandatory, and then we can depend on a new Autoconf
137 # release and drop the old call support.
138 AC_DEFUN([AM_INIT_AUTOMAKE],
139 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
140  AC_REQUIRE([AC_PROG_INSTALL])dnl
141 # test to see if srcdir already configured
142 if test "`cd $srcdir && pwd`" != "`pwd`" &&
143    test -f $srcdir/config.status; then
144   AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
145 fi
146
147 # test whether we have cygpath
148 if test -z "$CYGPATH_W"; then
149   if (cygpath --version) >/dev/null 2>/dev/null; then
150     CYGPATH_W='cygpath -w'
151   else
152     CYGPATH_W=echo
153   fi
154 fi
155 AC_SUBST([CYGPATH_W])
156
157 # Define the identity of the package.
158 dnl Distinguish between old-style and new-style calls.
159 m4_ifval([$2],
160 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
161  AC_SUBST([PACKAGE], [$1])dnl
162  AC_SUBST([VERSION], [$2])],
163 [_AM_SET_OPTIONS([$1])dnl
164  AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
165  AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
166
167 _AM_IF_OPTION([no-define],,
168 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
169  AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
170
171 # Some tools Automake needs.
172 AC_REQUIRE([AM_SANITY_CHECK])dnl
173 AC_REQUIRE([AC_ARG_PROGRAM])dnl
174 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
175 AM_MISSING_PROG(AUTOCONF, autoconf)
176 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
177 AM_MISSING_PROG(AUTOHEADER, autoheader)
178 AM_MISSING_PROG(MAKEINFO, makeinfo)
179 AM_MISSING_PROG(AMTAR, tar)
180 AM_PROG_INSTALL_SH
181 AM_PROG_INSTALL_STRIP
182 # We need awk for the "check" target.  The system "awk" is bad on
183 # some platforms.
184 AC_REQUIRE([AC_PROG_AWK])dnl
185 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
186 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
187
188 _AM_IF_OPTION([no-dependencies],,
189 [AC_PROVIDE_IFELSE([AC_PROG_CC],
190                   [_AM_DEPENDENCIES(CC)],
191                   [define([AC_PROG_CC],
192                           defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
193 AC_PROVIDE_IFELSE([AC_PROG_CXX],
194                   [_AM_DEPENDENCIES(CXX)],
195                   [define([AC_PROG_CXX],
196                           defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
197 ])
198 ])
199
200
201 # When config.status generates a header, we must update the stamp-h file.
202 # This file resides in the same directory as the config header
203 # that is generated.  The stamp files are numbered to have different names.
204
205 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
206 # loop where config.status creates the headers, so we can generate
207 # our stamp files there.
208 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
209 [# Compute $1's index in $config_headers.
210 _am_stamp_count=1
211 for _am_header in $config_headers :; do
212   case $_am_header in
213     $1 | $1:* )
214       break ;;
215     * )
216       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
217   esac
218 done
219 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
220
221 # Copyright 2002  Free Software Foundation, Inc.
222
223 # This program is free software; you can redistribute it and/or modify
224 # it under the terms of the GNU General Public License as published by
225 # the Free Software Foundation; either version 2, or (at your option)
226 # any later version.
227
228 # This program is distributed in the hope that it will be useful,
229 # but WITHOUT ANY WARRANTY; without even the implied warranty of
230 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
231 # GNU General Public License for more details.
232
233 # You should have received a copy of the GNU General Public License
234 # along with this program; if not, write to the Free Software
235 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
236
237 # AM_AUTOMAKE_VERSION(VERSION)
238 # ----------------------------
239 # Automake X.Y traces this macro to ensure aclocal.m4 has been
240 # generated from the m4 files accompanying Automake X.Y.
241 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
242
243 # AM_SET_CURRENT_AUTOMAKE_VERSION
244 # -------------------------------
245 # Call AM_AUTOMAKE_VERSION so it can be traced.
246 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
247 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
248          [AM_AUTOMAKE_VERSION([1.7.9])])
249
250 # Helper functions for option handling.                    -*- Autoconf -*-
251
252 # Copyright 2001, 2002  Free Software Foundation, Inc.
253
254 # This program is free software; you can redistribute it and/or modify
255 # it under the terms of the GNU General Public License as published by
256 # the Free Software Foundation; either version 2, or (at your option)
257 # any later version.
258
259 # This program is distributed in the hope that it will be useful,
260 # but WITHOUT ANY WARRANTY; without even the implied warranty of
261 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
262 # GNU General Public License for more details.
263
264 # You should have received a copy of the GNU General Public License
265 # along with this program; if not, write to the Free Software
266 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
267 # 02111-1307, USA.
268
269 # serial 2
270
271 # _AM_MANGLE_OPTION(NAME)
272 # -----------------------
273 AC_DEFUN([_AM_MANGLE_OPTION],
274 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
275
276 # _AM_SET_OPTION(NAME)
277 # ------------------------------
278 # Set option NAME.  Presently that only means defining a flag for this option.
279 AC_DEFUN([_AM_SET_OPTION],
280 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
281
282 # _AM_SET_OPTIONS(OPTIONS)
283 # ----------------------------------
284 # OPTIONS is a space-separated list of Automake options.
285 AC_DEFUN([_AM_SET_OPTIONS],
286 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
287
288 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
289 # -------------------------------------------
290 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
291 AC_DEFUN([_AM_IF_OPTION],
292 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
293
294 #
295 # Check to make sure that the build environment is sane.
296 #
297
298 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
299
300 # This program is free software; you can redistribute it and/or modify
301 # it under the terms of the GNU General Public License as published by
302 # the Free Software Foundation; either version 2, or (at your option)
303 # any later version.
304
305 # This program is distributed in the hope that it will be useful,
306 # but WITHOUT ANY WARRANTY; without even the implied warranty of
307 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
308 # GNU General Public License for more details.
309
310 # You should have received a copy of the GNU General Public License
311 # along with this program; if not, write to the Free Software
312 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
313 # 02111-1307, USA.
314
315 # serial 3
316
317 # AM_SANITY_CHECK
318 # ---------------
319 AC_DEFUN([AM_SANITY_CHECK],
320 [AC_MSG_CHECKING([whether build environment is sane])
321 # Just in case
322 sleep 1
323 echo timestamp > conftest.file
324 # Do `set' in a subshell so we don't clobber the current shell's
325 # arguments.  Must try -L first in case configure is actually a
326 # symlink; some systems play weird games with the mod time of symlinks
327 # (eg FreeBSD returns the mod time of the symlink's containing
328 # directory).
329 if (
330    set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
331    if test "$[*]" = "X"; then
332       # -L didn't work.
333       set X `ls -t $srcdir/configure conftest.file`
334    fi
335    rm -f conftest.file
336    if test "$[*]" != "X $srcdir/configure conftest.file" \
337       && test "$[*]" != "X conftest.file $srcdir/configure"; then
338
339       # If neither matched, then we have a broken ls.  This can happen
340       # if, for instance, CONFIG_SHELL is bash and it inherits a
341       # broken ls alias from the environment.  This has actually
342       # happened.  Such a system could not be considered "sane".
343       AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
344 alias in your environment])
345    fi
346
347    test "$[2]" = conftest.file
348    )
349 then
350    # Ok.
351    :
352 else
353    AC_MSG_ERROR([newly created file is older than distributed files!
354 Check your system clock])
355 fi
356 AC_MSG_RESULT(yes)])
357
358 #  -*- Autoconf -*-
359
360
361 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
362
363 # This program is free software; you can redistribute it and/or modify
364 # it under the terms of the GNU General Public License as published by
365 # the Free Software Foundation; either version 2, or (at your option)
366 # any later version.
367
368 # This program is distributed in the hope that it will be useful,
369 # but WITHOUT ANY WARRANTY; without even the implied warranty of
370 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
371 # GNU General Public License for more details.
372
373 # You should have received a copy of the GNU General Public License
374 # along with this program; if not, write to the Free Software
375 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
376 # 02111-1307, USA.
377
378 # serial 3
379
380 # AM_MISSING_PROG(NAME, PROGRAM)
381 # ------------------------------
382 AC_DEFUN([AM_MISSING_PROG],
383 [AC_REQUIRE([AM_MISSING_HAS_RUN])
384 $1=${$1-"${am_missing_run}$2"}
385 AC_SUBST($1)])
386
387
388 # AM_MISSING_HAS_RUN
389 # ------------------
390 # Define MISSING if not defined so far and test if it supports --run.
391 # If it does, set am_missing_run to use it, otherwise, to nothing.
392 AC_DEFUN([AM_MISSING_HAS_RUN],
393 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
394 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
395 # Use eval to expand $SHELL
396 if eval "$MISSING --run true"; then
397   am_missing_run="$MISSING --run "
398 else
399   am_missing_run=
400   AC_MSG_WARN([`missing' script is too old or missing])
401 fi
402 ])
403
404 # AM_AUX_DIR_EXPAND
405
406 # Copyright 2001 Free Software Foundation, Inc.
407
408 # This program is free software; you can redistribute it and/or modify
409 # it under the terms of the GNU General Public License as published by
410 # the Free Software Foundation; either version 2, or (at your option)
411 # any later version.
412
413 # This program is distributed in the hope that it will be useful,
414 # but WITHOUT ANY WARRANTY; without even the implied warranty of
415 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
416 # GNU General Public License for more details.
417
418 # You should have received a copy of the GNU General Public License
419 # along with this program; if not, write to the Free Software
420 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
421 # 02111-1307, USA.
422
423 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
424 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
425 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
426 #
427 # Of course, Automake must honor this variable whenever it calls a
428 # tool from the auxiliary directory.  The problem is that $srcdir (and
429 # therefore $ac_aux_dir as well) can be either absolute or relative,
430 # depending on how configure is run.  This is pretty annoying, since
431 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
432 # source directory, any form will work fine, but in subdirectories a
433 # relative path needs to be adjusted first.
434 #
435 # $ac_aux_dir/missing
436 #    fails when called from a subdirectory if $ac_aux_dir is relative
437 # $top_srcdir/$ac_aux_dir/missing
438 #    fails if $ac_aux_dir is absolute,
439 #    fails when called from a subdirectory in a VPATH build with
440 #          a relative $ac_aux_dir
441 #
442 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
443 # are both prefixed by $srcdir.  In an in-source build this is usually
444 # harmless because $srcdir is `.', but things will broke when you
445 # start a VPATH build or use an absolute $srcdir.
446 #
447 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
448 # iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
449 #   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
450 # and then we would define $MISSING as
451 #   MISSING="\${SHELL} $am_aux_dir/missing"
452 # This will work as long as MISSING is not called from configure, because
453 # unfortunately $(top_srcdir) has no meaning in configure.
454 # However there are other variables, like CC, which are often used in
455 # configure, and could therefore not use this "fixed" $ac_aux_dir.
456 #
457 # Another solution, used here, is to always expand $ac_aux_dir to an
458 # absolute PATH.  The drawback is that using absolute paths prevent a
459 # configured tree to be moved without reconfiguration.
460
461 # Rely on autoconf to set up CDPATH properly.
462 AC_PREREQ([2.50])
463
464 AC_DEFUN([AM_AUX_DIR_EXPAND], [
465 # expand $ac_aux_dir to an absolute path
466 am_aux_dir=`cd $ac_aux_dir && pwd`
467 ])
468
469 # AM_PROG_INSTALL_SH
470 # ------------------
471 # Define $install_sh.
472
473 # Copyright 2001 Free Software Foundation, Inc.
474
475 # This program is free software; you can redistribute it and/or modify
476 # it under the terms of the GNU General Public License as published by
477 # the Free Software Foundation; either version 2, or (at your option)
478 # any later version.
479
480 # This program is distributed in the hope that it will be useful,
481 # but WITHOUT ANY WARRANTY; without even the implied warranty of
482 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
483 # GNU General Public License for more details.
484
485 # You should have received a copy of the GNU General Public License
486 # along with this program; if not, write to the Free Software
487 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
488 # 02111-1307, USA.
489
490 AC_DEFUN([AM_PROG_INSTALL_SH],
491 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
492 install_sh=${install_sh-"$am_aux_dir/install-sh"}
493 AC_SUBST(install_sh)])
494
495 # AM_PROG_INSTALL_STRIP
496
497 # Copyright 2001 Free Software Foundation, Inc.
498
499 # This program is free software; you can redistribute it and/or modify
500 # it under the terms of the GNU General Public License as published by
501 # the Free Software Foundation; either version 2, or (at your option)
502 # any later version.
503
504 # This program is distributed in the hope that it will be useful,
505 # but WITHOUT ANY WARRANTY; without even the implied warranty of
506 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
507 # GNU General Public License for more details.
508
509 # You should have received a copy of the GNU General Public License
510 # along with this program; if not, write to the Free Software
511 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
512 # 02111-1307, USA.
513
514 # One issue with vendor `install' (even GNU) is that you can't
515 # specify the program used to strip binaries.  This is especially
516 # annoying in cross-compiling environments, where the build's strip
517 # is unlikely to handle the host's binaries.
518 # Fortunately install-sh will honor a STRIPPROG variable, so we
519 # always use install-sh in `make install-strip', and initialize
520 # STRIPPROG with the value of the STRIP variable (set by the user).
521 AC_DEFUN([AM_PROG_INSTALL_STRIP],
522 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
523 # Installed binaries are usually stripped using `strip' when the user
524 # run `make install-strip'.  However `strip' might not be the right
525 # tool to use in cross-compilation environments, therefore Automake
526 # will honor the `STRIP' environment variable to overrule this program.
527 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
528 if test "$cross_compiling" != no; then
529   AC_CHECK_TOOL([STRIP], [strip], :)
530 fi
531 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
532 AC_SUBST([INSTALL_STRIP_PROGRAM])])
533
534 #                                                          -*- Autoconf -*-
535 # Copyright (C) 2003  Free Software Foundation, Inc.
536
537 # This program is free software; you can redistribute it and/or modify
538 # it under the terms of the GNU General Public License as published by
539 # the Free Software Foundation; either version 2, or (at your option)
540 # any later version.
541
542 # This program is distributed in the hope that it will be useful,
543 # but WITHOUT ANY WARRANTY; without even the implied warranty of
544 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
545 # GNU General Public License for more details.
546
547 # You should have received a copy of the GNU General Public License
548 # along with this program; if not, write to the Free Software
549 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
550 # 02111-1307, USA.
551
552 # serial 1
553
554 # Check whether the underlying file-system supports filenames
555 # with a leading dot.  For instance MS-DOS doesn't.
556 AC_DEFUN([AM_SET_LEADING_DOT],
557 [rm -rf .tst 2>/dev/null
558 mkdir .tst 2>/dev/null
559 if test -d .tst; then
560   am__leading_dot=.
561 else
562   am__leading_dot=_
563 fi
564 rmdir .tst 2>/dev/null
565 AC_SUBST([am__leading_dot])])
566
567 # serial 5                                              -*- Autoconf -*-
568
569 # Copyright (C) 1999, 2000, 2001, 2002, 2003  Free Software Foundation, Inc.
570
571 # This program is free software; you can redistribute it and/or modify
572 # it under the terms of the GNU General Public License as published by
573 # the Free Software Foundation; either version 2, or (at your option)
574 # any later version.
575
576 # This program is distributed in the hope that it will be useful,
577 # but WITHOUT ANY WARRANTY; without even the implied warranty of
578 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
579 # GNU General Public License for more details.
580
581 # You should have received a copy of the GNU General Public License
582 # along with this program; if not, write to the Free Software
583 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
584 # 02111-1307, USA.
585
586
587 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
588 # written in clear, in which case automake, when reading aclocal.m4,
589 # will think it sees a *use*, and therefore will trigger all it's
590 # C support machinery.  Also note that it means that autoscan, seeing
591 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
592
593
594
595 # _AM_DEPENDENCIES(NAME)
596 # ----------------------
597 # See how the compiler implements dependency checking.
598 # NAME is "CC", "CXX", "GCJ", or "OBJC".
599 # We try a few techniques and use that to set a single cache variable.
600 #
601 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
602 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
603 # dependency, and given that the user is not expected to run this macro,
604 # just rely on AC_PROG_CC.
605 AC_DEFUN([_AM_DEPENDENCIES],
606 [AC_REQUIRE([AM_SET_DEPDIR])dnl
607 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
608 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
609 AC_REQUIRE([AM_DEP_TRACK])dnl
610
611 ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
612        [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
613        [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
614        [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
615                    [depcc="$$1"   am_compiler_list=])
616
617 AC_CACHE_CHECK([dependency style of $depcc],
618                [am_cv_$1_dependencies_compiler_type],
619 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
620   # We make a subdir and do the tests there.  Otherwise we can end up
621   # making bogus files that we don't know about and never remove.  For
622   # instance it was reported that on HP-UX the gcc test will end up
623   # making a dummy file named `D' -- because `-MD' means `put the output
624   # in D'.
625   mkdir conftest.dir
626   # Copy depcomp to subdir because otherwise we won't find it if we're
627   # using a relative directory.
628   cp "$am_depcomp" conftest.dir
629   cd conftest.dir
630   # We will build objects and dependencies in a subdirectory because
631   # it helps to detect inapplicable dependency modes.  For instance
632   # both Tru64's cc and ICC support -MD to output dependencies as a
633   # side effect of compilation, but ICC will put the dependencies in
634   # the current directory while Tru64 will put them in the object
635   # directory.
636   mkdir sub
637
638   am_cv_$1_dependencies_compiler_type=none
639   if test "$am_compiler_list" = ""; then
640      am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
641   fi
642   for depmode in $am_compiler_list; do
643     # Setup a source with many dependencies, because some compilers
644     # like to wrap large dependency lists on column 80 (with \), and
645     # we should not choose a depcomp mode which is confused by this.
646     #
647     # We need to recreate these files for each test, as the compiler may
648     # overwrite some of them when testing with obscure command lines.
649     # This happens at least with the AIX C compiler.
650     : > sub/conftest.c
651     for i in 1 2 3 4 5 6; do
652       echo '#include "conftst'$i'.h"' >> sub/conftest.c
653       : > sub/conftst$i.h
654     done
655     echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
656
657     case $depmode in
658     nosideeffect)
659       # after this tag, mechanisms are not by side-effect, so they'll
660       # only be used when explicitly requested
661       if test "x$enable_dependency_tracking" = xyes; then
662         continue
663       else
664         break
665       fi
666       ;;
667     none) break ;;
668     esac
669     # We check with `-c' and `-o' for the sake of the "dashmstdout"
670     # mode.  It turns out that the SunPro C++ compiler does not properly
671     # handle `-M -o', and we need to detect this.
672     if depmode=$depmode \
673        source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
674        depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
675        $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
676          >/dev/null 2>conftest.err &&
677        grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
678        grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
679        ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
680       # icc doesn't choke on unknown options, it will just issue warnings
681       # (even with -Werror).  So we grep stderr for any message
682       # that says an option was ignored.
683       if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
684         am_cv_$1_dependencies_compiler_type=$depmode
685         break
686       fi
687     fi
688   done
689
690   cd ..
691   rm -rf conftest.dir
692 else
693   am_cv_$1_dependencies_compiler_type=none
694 fi
695 ])
696 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
697 AM_CONDITIONAL([am__fastdep$1], [
698   test "x$enable_dependency_tracking" != xno \
699   && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
700 ])
701
702
703 # AM_SET_DEPDIR
704 # -------------
705 # Choose a directory name for dependency files.
706 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
707 AC_DEFUN([AM_SET_DEPDIR],
708 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
709 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
710 ])
711
712
713 # AM_DEP_TRACK
714 # ------------
715 AC_DEFUN([AM_DEP_TRACK],
716 [AC_ARG_ENABLE(dependency-tracking,
717 [  --disable-dependency-tracking Speeds up one-time builds
718   --enable-dependency-tracking  Do not reject slow dependency extractors])
719 if test "x$enable_dependency_tracking" != xno; then
720   am_depcomp="$ac_aux_dir/depcomp"
721   AMDEPBACKSLASH='\'
722 fi
723 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
724 AC_SUBST([AMDEPBACKSLASH])
725 ])
726
727 # Generate code to set up dependency tracking.   -*- Autoconf -*-
728
729 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
730
731 # This program is free software; you can redistribute it and/or modify
732 # it under the terms of the GNU General Public License as published by
733 # the Free Software Foundation; either version 2, or (at your option)
734 # any later version.
735
736 # This program is distributed in the hope that it will be useful,
737 # but WITHOUT ANY WARRANTY; without even the implied warranty of
738 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
739 # GNU General Public License for more details.
740
741 # You should have received a copy of the GNU General Public License
742 # along with this program; if not, write to the Free Software
743 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
744 # 02111-1307, USA.
745
746 #serial 2
747
748 # _AM_OUTPUT_DEPENDENCY_COMMANDS
749 # ------------------------------
750 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
751 [for mf in $CONFIG_FILES; do
752   # Strip MF so we end up with the name of the file.
753   mf=`echo "$mf" | sed -e 's/:.*$//'`
754   # Check whether this is an Automake generated Makefile or not.
755   # We used to match only the files named `Makefile.in', but
756   # some people rename them; so instead we look at the file content.
757   # Grep'ing the first line is not enough: some people post-process
758   # each Makefile.in and add a new line on top of each file to say so.
759   # So let's grep whole file.
760   if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
761     dirpart=`AS_DIRNAME("$mf")`
762   else
763     continue
764   fi
765   grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
766   # Extract the definition of DEP_FILES from the Makefile without
767   # running `make'.
768   DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
769   test -z "$DEPDIR" && continue
770   # When using ansi2knr, U may be empty or an underscore; expand it
771   U=`sed -n -e '/^U = / s///p' < "$mf"`
772   test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
773   # We invoke sed twice because it is the simplest approach to
774   # changing $(DEPDIR) to its actual value in the expansion.
775   for file in `sed -n -e '
776     /^DEP_FILES = .*\\\\$/ {
777       s/^DEP_FILES = //
778       :loop
779         s/\\\\$//
780         p
781         n
782         /\\\\$/ b loop
783       p
784     }
785     /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
786        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
787     # Make sure the directory exists.
788     test -f "$dirpart/$file" && continue
789     fdir=`AS_DIRNAME(["$file"])`
790     AS_MKDIR_P([$dirpart/$fdir])
791     # echo "creating $dirpart/$file"
792     echo '# dummy' > "$dirpart/$file"
793   done
794 done
795 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
796
797
798 # AM_OUTPUT_DEPENDENCY_COMMANDS
799 # -----------------------------
800 # This macro should only be invoked once -- use via AC_REQUIRE.
801 #
802 # This code is only required when automatic dependency tracking
803 # is enabled.  FIXME.  This creates each `.P' file that we will
804 # need in order to bootstrap the dependency handling code.
805 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
806 [AC_CONFIG_COMMANDS([depfiles],
807      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
808      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
809 ])
810
811 # Check to see how 'make' treats includes.      -*- Autoconf -*-
812
813 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
814
815 # This program is free software; you can redistribute it and/or modify
816 # it under the terms of the GNU General Public License as published by
817 # the Free Software Foundation; either version 2, or (at your option)
818 # any later version.
819
820 # This program is distributed in the hope that it will be useful,
821 # but WITHOUT ANY WARRANTY; without even the implied warranty of
822 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
823 # GNU General Public License for more details.
824
825 # You should have received a copy of the GNU General Public License
826 # along with this program; if not, write to the Free Software
827 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
828 # 02111-1307, USA.
829
830 # serial 2
831
832 # AM_MAKE_INCLUDE()
833 # -----------------
834 # Check to see how make treats includes.
835 AC_DEFUN([AM_MAKE_INCLUDE],
836 [am_make=${MAKE-make}
837 cat > confinc << 'END'
838 am__doit:
839         @echo done
840 .PHONY: am__doit
841 END
842 # If we don't find an include directive, just comment out the code.
843 AC_MSG_CHECKING([for style of include used by $am_make])
844 am__include="#"
845 am__quote=
846 _am_result=none
847 # First try GNU make style include.
848 echo "include confinc" > confmf
849 # We grep out `Entering directory' and `Leaving directory'
850 # messages which can occur if `w' ends up in MAKEFLAGS.
851 # In particular we don't look at `^make:' because GNU make might
852 # be invoked under some other name (usually "gmake"), in which
853 # case it prints its new name instead of `make'.
854 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
855    am__include=include
856    am__quote=
857    _am_result=GNU
858 fi
859 # Now try BSD make style include.
860 if test "$am__include" = "#"; then
861    echo '.include "confinc"' > confmf
862    if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
863       am__include=.include
864       am__quote="\""
865       _am_result=BSD
866    fi
867 fi
868 AC_SUBST([am__include])
869 AC_SUBST([am__quote])
870 AC_MSG_RESULT([$_am_result])
871 rm -f confinc confmf
872 ])
873
874 # AM_CONDITIONAL                                              -*- Autoconf -*-
875
876 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
877
878 # This program is free software; you can redistribute it and/or modify
879 # it under the terms of the GNU General Public License as published by
880 # the Free Software Foundation; either version 2, or (at your option)
881 # any later version.
882
883 # This program is distributed in the hope that it will be useful,
884 # but WITHOUT ANY WARRANTY; without even the implied warranty of
885 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
886 # GNU General Public License for more details.
887
888 # You should have received a copy of the GNU General Public License
889 # along with this program; if not, write to the Free Software
890 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
891 # 02111-1307, USA.
892
893 # serial 5
894
895 AC_PREREQ(2.52)
896
897 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
898 # -------------------------------------
899 # Define a conditional.
900 AC_DEFUN([AM_CONDITIONAL],
901 [ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
902         [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
903 AC_SUBST([$1_TRUE])
904 AC_SUBST([$1_FALSE])
905 if $2; then
906   $1_TRUE=
907   $1_FALSE='#'
908 else
909   $1_TRUE='#'
910   $1_FALSE=
911 fi
912 AC_CONFIG_COMMANDS_PRE(
913 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
914   AC_MSG_ERROR([conditional "$1" was never defined.
915 Usually this means the macro was only invoked conditionally.])
916 fi])])
917
918 # gettext.m4 serial 20 (gettext-0.12)
919 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
920 dnl This file is free software, distributed under the terms of the GNU
921 dnl General Public License.  As a special exception to the GNU General
922 dnl Public License, this file may be distributed as part of a program
923 dnl that contains a configuration script generated by Autoconf, under
924 dnl the same distribution terms as the rest of that program.
925 dnl
926 dnl This file can can be used in projects which are not available under
927 dnl the GNU General Public License or the GNU Library General Public
928 dnl License but which still want to provide support for the GNU gettext
929 dnl functionality.
930 dnl Please note that the actual code of the GNU gettext library is covered
931 dnl by the GNU Library General Public License, and the rest of the GNU
932 dnl gettext package package is covered by the GNU General Public License.
933 dnl They are *not* in the public domain.
934
935 dnl Authors:
936 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
937 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
938
939 dnl Macro to add for using GNU gettext.
940
941 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
942 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
943 dnl    default (if it is not specified or empty) is 'no-libtool'.
944 dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
945 dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
946 dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
947 dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
948 dnl    depending on --{enable,disable}-{shared,static} and on the presence of
949 dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
950 dnl    $(top_builddir)/intl/libintl.a will be created.
951 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
952 dnl    implementations (in libc or libintl) without the ngettext() function
953 dnl    will be ignored.  If NEEDSYMBOL is specified and is
954 dnl    'need-formatstring-macros', then GNU gettext implementations that don't
955 dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
956 dnl INTLDIR is used to find the intl libraries.  If empty,
957 dnl    the value `$(top_builddir)/intl/' is used.
958 dnl
959 dnl The result of the configuration is one of three cases:
960 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
961 dnl    and used.
962 dnl    Catalog format: GNU --> install in $(datadir)
963 dnl    Catalog extension: .mo after installation, .gmo in source tree
964 dnl 2) GNU gettext has been found in the system's C library.
965 dnl    Catalog format: GNU --> install in $(datadir)
966 dnl    Catalog extension: .mo after installation, .gmo in source tree
967 dnl 3) No internationalization, always use English msgid.
968 dnl    Catalog format: none
969 dnl    Catalog extension: none
970 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
971 dnl The use of .gmo is historical (it was needed to avoid overwriting the
972 dnl GNU format catalogs when building on a platform with an X/Open gettext),
973 dnl but we keep it in order not to force irrelevant filename changes on the
974 dnl maintainers.
975 dnl
976 AC_DEFUN([AM_GNU_GETTEXT],
977 [
978   dnl Argument checking.
979   ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
980     [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
981 ])])])])])
982   ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
983     [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
984 ])])])])
985   define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
986   define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
987
988   AC_REQUIRE([AM_PO_SUBDIRS])dnl
989   ifelse(gt_included_intl, yes, [
990     AC_REQUIRE([AM_INTL_SUBDIR])dnl
991   ])
992
993   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
994   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
995   AC_REQUIRE([AC_LIB_RPATH])
996
997   dnl Sometimes libintl requires libiconv, so first search for libiconv.
998   dnl Ideally we would do this search only after the
999   dnl      if test "$USE_NLS" = "yes"; then
1000   dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1001   dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1002   dnl the configure script would need to contain the same shell code
1003   dnl again, outside any 'if'. There are two solutions:
1004   dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1005   dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1006   dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1007   dnl documented, we avoid it.
1008   ifelse(gt_included_intl, yes, , [
1009     AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1010   ])
1011
1012   dnl Set USE_NLS.
1013   AM_NLS
1014
1015   ifelse(gt_included_intl, yes, [
1016     BUILD_INCLUDED_LIBINTL=no
1017     USE_INCLUDED_LIBINTL=no
1018   ])
1019   LIBINTL=
1020   LTLIBINTL=
1021   POSUB=
1022
1023   dnl If we use NLS figure out what method
1024   if test "$USE_NLS" = "yes"; then
1025     gt_use_preinstalled_gnugettext=no
1026     ifelse(gt_included_intl, yes, [
1027       AC_MSG_CHECKING([whether included gettext is requested])
1028       AC_ARG_WITH(included-gettext,
1029         [  --with-included-gettext use the GNU gettext library included here],
1030         nls_cv_force_use_gnu_gettext=$withval,
1031         nls_cv_force_use_gnu_gettext=no)
1032       AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1033
1034       nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1035       if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1036     ])
1037         dnl User does not insist on using GNU NLS library.  Figure out what
1038         dnl to use.  If GNU gettext is available we use this.  Else we have
1039         dnl to fall back to GNU NLS library.
1040
1041         dnl Add a version number to the cache macros.
1042         define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1043         define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1044         define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1045
1046         AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1047          [AC_TRY_LINK([#include <libintl.h>
1048 ]ifelse([$2], [need-formatstring-macros],
1049 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1050 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1051 #endif
1052 changequote(,)dnl
1053 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1054 changequote([,])dnl
1055 ], [])[extern int _nl_msg_cat_cntr;
1056 extern int *_nl_domain_bindings;],
1057             [bindtextdomain ("", "");
1058 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1059             gt_cv_func_gnugettext_libc=yes,
1060             gt_cv_func_gnugettext_libc=no)])
1061
1062         if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1063           dnl Sometimes libintl requires libiconv, so first search for libiconv.
1064           ifelse(gt_included_intl, yes, , [
1065             AM_ICONV_LINK
1066           ])
1067           dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1068           dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1069           dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1070           dnl even if libiconv doesn't exist.
1071           AC_LIB_LINKFLAGS_BODY([intl])
1072           AC_CACHE_CHECK([for GNU gettext in libintl],
1073             gt_cv_func_gnugettext_libintl,
1074            [gt_save_CPPFLAGS="$CPPFLAGS"
1075             CPPFLAGS="$CPPFLAGS $INCINTL"
1076             gt_save_LIBS="$LIBS"
1077             LIBS="$LIBS $LIBINTL"
1078             dnl Now see whether libintl exists and does not depend on libiconv.
1079             AC_TRY_LINK([#include <libintl.h>
1080 ]ifelse([$2], [need-formatstring-macros],
1081 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1082 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1083 #endif
1084 changequote(,)dnl
1085 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1086 changequote([,])dnl
1087 ], [])[extern int _nl_msg_cat_cntr;
1088 extern
1089 #ifdef __cplusplus
1090 "C"
1091 #endif
1092 const char *_nl_expand_alias ();],
1093               [bindtextdomain ("", "");
1094 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1095               gt_cv_func_gnugettext_libintl=yes,
1096               gt_cv_func_gnugettext_libintl=no)
1097             dnl Now see whether libintl exists and depends on libiconv.
1098             if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1099               LIBS="$LIBS $LIBICONV"
1100               AC_TRY_LINK([#include <libintl.h>
1101 ]ifelse([$2], [need-formatstring-macros],
1102 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1103 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1104 #endif
1105 changequote(,)dnl
1106 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1107 changequote([,])dnl
1108 ], [])[extern int _nl_msg_cat_cntr;
1109 extern
1110 #ifdef __cplusplus
1111 "C"
1112 #endif
1113 const char *_nl_expand_alias ();],
1114                 [bindtextdomain ("", "");
1115 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1116                [LIBINTL="$LIBINTL $LIBICONV"
1117                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1118                 gt_cv_func_gnugettext_libintl=yes
1119                ])
1120             fi
1121             CPPFLAGS="$gt_save_CPPFLAGS"
1122             LIBS="$gt_save_LIBS"])
1123         fi
1124
1125         dnl If an already present or preinstalled GNU gettext() is found,
1126         dnl use it.  But if this macro is used in GNU gettext, and GNU
1127         dnl gettext is already preinstalled in libintl, we update this
1128         dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1129         if test "$gt_cv_func_gnugettext_libc" = "yes" \
1130            || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1131                 && test "$PACKAGE" != gettext-runtime \
1132                 && test "$PACKAGE" != gettext-tools; }; then
1133           gt_use_preinstalled_gnugettext=yes
1134         else
1135           dnl Reset the values set by searching for libintl.
1136           LIBINTL=
1137           LTLIBINTL=
1138           INCINTL=
1139         fi
1140
1141     ifelse(gt_included_intl, yes, [
1142         if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1143           dnl GNU gettext is not found in the C library.
1144           dnl Fall back on included GNU gettext library.
1145           nls_cv_use_gnu_gettext=yes
1146         fi
1147       fi
1148
1149       if test "$nls_cv_use_gnu_gettext" = "yes"; then
1150         dnl Mark actions used to generate GNU NLS library.
1151         BUILD_INCLUDED_LIBINTL=yes
1152         USE_INCLUDED_LIBINTL=yes
1153         LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1154         LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1155         LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1156       fi
1157
1158       if test "$gt_use_preinstalled_gnugettext" = "yes" \
1159          || test "$nls_cv_use_gnu_gettext" = "yes"; then
1160         dnl Mark actions to use GNU gettext tools.
1161         CATOBJEXT=.gmo
1162       fi
1163     ])
1164
1165     if test "$gt_use_preinstalled_gnugettext" = "yes" \
1166        || test "$nls_cv_use_gnu_gettext" = "yes"; then
1167       AC_DEFINE(ENABLE_NLS, 1,
1168         [Define to 1 if translation of program messages to the user's native language
1169    is requested.])
1170     else
1171       USE_NLS=no
1172     fi
1173   fi
1174
1175   AC_MSG_CHECKING([whether to use NLS])
1176   AC_MSG_RESULT([$USE_NLS])
1177   if test "$USE_NLS" = "yes"; then
1178     AC_MSG_CHECKING([where the gettext function comes from])
1179     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1180       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1181         gt_source="external libintl"
1182       else
1183         gt_source="libc"
1184       fi
1185     else
1186       gt_source="included intl directory"
1187     fi
1188     AC_MSG_RESULT([$gt_source])
1189   fi
1190
1191   if test "$USE_NLS" = "yes"; then
1192
1193     if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1194       if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1195         AC_MSG_CHECKING([how to link with libintl])
1196         AC_MSG_RESULT([$LIBINTL])
1197         AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1198       fi
1199
1200       dnl For backward compatibility. Some packages may be using this.
1201       AC_DEFINE(HAVE_GETTEXT, 1,
1202        [Define if the GNU gettext() function is already present or preinstalled.])
1203       AC_DEFINE(HAVE_DCGETTEXT, 1,
1204        [Define if the GNU dcgettext() function is already present or preinstalled.])
1205     fi
1206
1207     dnl We need to process the po/ directory.
1208     POSUB=po
1209   fi
1210
1211   ifelse(gt_included_intl, yes, [
1212     dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1213     dnl to 'yes' because some of the testsuite requires it.
1214     if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
1215       BUILD_INCLUDED_LIBINTL=yes
1216     fi
1217
1218     dnl Make all variables we use known to autoconf.
1219     AC_SUBST(BUILD_INCLUDED_LIBINTL)
1220     AC_SUBST(USE_INCLUDED_LIBINTL)
1221     AC_SUBST(CATOBJEXT)
1222
1223     dnl For backward compatibility. Some configure.ins may be using this.
1224     nls_cv_header_intl=
1225     nls_cv_header_libgt=
1226
1227     dnl For backward compatibility. Some Makefiles may be using this.
1228     DATADIRNAME=share
1229     AC_SUBST(DATADIRNAME)
1230
1231     dnl For backward compatibility. Some Makefiles may be using this.
1232     INSTOBJEXT=.mo
1233     AC_SUBST(INSTOBJEXT)
1234
1235     dnl For backward compatibility. Some Makefiles may be using this.
1236     GENCAT=gencat
1237     AC_SUBST(GENCAT)
1238
1239     dnl For backward compatibility. Some Makefiles may be using this.
1240     if test "$USE_INCLUDED_LIBINTL" = yes; then
1241       INTLOBJS="\$(GETTOBJS)"
1242     fi
1243     AC_SUBST(INTLOBJS)
1244
1245     dnl Enable libtool support if the surrounding package wishes it.
1246     INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1247     AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1248   ])
1249
1250   dnl For backward compatibility. Some Makefiles may be using this.
1251   INTLLIBS="$LIBINTL"
1252   AC_SUBST(INTLLIBS)
1253
1254   dnl Make all documented variables known to autoconf.
1255   AC_SUBST(LIBINTL)
1256   AC_SUBST(LTLIBINTL)
1257   AC_SUBST(POSUB)
1258 ])
1259
1260
1261 dnl Checks for all prerequisites of the intl subdirectory,
1262 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1263 dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1264 AC_DEFUN([AM_INTL_SUBDIR],
1265 [
1266   AC_REQUIRE([AC_PROG_INSTALL])dnl
1267   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1268   AC_REQUIRE([AC_PROG_CC])dnl
1269   AC_REQUIRE([AC_CANONICAL_HOST])dnl
1270   AC_REQUIRE([AC_PROG_RANLIB])dnl
1271   AC_REQUIRE([AC_ISC_POSIX])dnl
1272   AC_REQUIRE([AC_HEADER_STDC])dnl
1273   AC_REQUIRE([AC_C_CONST])dnl
1274   AC_REQUIRE([AC_C_INLINE])dnl
1275   AC_REQUIRE([AC_TYPE_OFF_T])dnl
1276   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1277   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1278   AC_REQUIRE([AC_FUNC_MMAP])dnl
1279   AC_REQUIRE([jm_GLIBC21])dnl
1280   AC_REQUIRE([gt_INTDIV0])dnl
1281   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1282   AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1283   AC_REQUIRE([gt_INTTYPES_PRI])dnl
1284
1285   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1286 stdlib.h string.h unistd.h sys/param.h])
1287   AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1288 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1289 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
1290 __fsetlocking])
1291
1292   AM_ICONV
1293   AM_LANGINFO_CODESET
1294   if test $ac_cv_header_locale_h = yes; then
1295     AM_LC_MESSAGES
1296   fi
1297
1298   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1299   dnl because plural.y uses bison specific features. It requires at least
1300   dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1301   dnl compile.
1302   dnl bison is only needed for the maintainer (who touches plural.y). But in
1303   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1304   dnl the rule in general Makefile. Now, some people carelessly touch the
1305   dnl files or have a broken "make" program, hence the plural.c rule will
1306   dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1307   dnl present or too old.
1308   AC_CHECK_PROGS([INTLBISON], [bison])
1309   if test -z "$INTLBISON"; then
1310     ac_verc_fail=yes
1311   else
1312     dnl Found it, now check the version.
1313     AC_MSG_CHECKING([version of bison])
1314 changequote(<<,>>)dnl
1315     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1316     case $ac_prog_version in
1317       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1318       1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1319 changequote([,])dnl
1320          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1321       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1322     esac
1323     AC_MSG_RESULT([$ac_prog_version])
1324   fi
1325   if test $ac_verc_fail = yes; then
1326     INTLBISON=:
1327   fi
1328 ])
1329
1330
1331 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1332 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1333
1334 # po.m4 serial 1 (gettext-0.12)
1335 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1336 dnl This file is free software, distributed under the terms of the GNU
1337 dnl General Public License.  As a special exception to the GNU General
1338 dnl Public License, this file may be distributed as part of a program
1339 dnl that contains a configuration script generated by Autoconf, under
1340 dnl the same distribution terms as the rest of that program.
1341 dnl
1342 dnl This file can can be used in projects which are not available under
1343 dnl the GNU General Public License or the GNU Library General Public
1344 dnl License but which still want to provide support for the GNU gettext
1345 dnl functionality.
1346 dnl Please note that the actual code of the GNU gettext library is covered
1347 dnl by the GNU Library General Public License, and the rest of the GNU
1348 dnl gettext package package is covered by the GNU General Public License.
1349 dnl They are *not* in the public domain.
1350
1351 dnl Authors:
1352 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1353 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1354
1355 dnl Checks for all prerequisites of the po subdirectory.
1356 AC_DEFUN([AM_PO_SUBDIRS],
1357 [
1358   AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1359   AC_REQUIRE([AC_PROG_INSTALL])dnl
1360   AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1361   AC_REQUIRE([AM_NLS])dnl
1362
1363   dnl Perform the following tests also if --disable-nls has been given,
1364   dnl because they are needed for "make dist" to work.
1365
1366   dnl Search for GNU msgfmt in the PATH.
1367   dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1368   dnl The second test excludes FreeBSD msgfmt.
1369   AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1370     [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1371      (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1372     :)
1373   AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1374
1375   dnl Search for GNU xgettext 0.12 or newer in the PATH.
1376   dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1377   dnl The second test excludes FreeBSD xgettext.
1378   AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1379     [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1380      (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1381     :)
1382   dnl Remove leftover from FreeBSD xgettext call.
1383   rm -f messages.po
1384
1385   dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1386   AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1387     [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1388
1389   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1390   dnl Test whether we really found GNU msgfmt.
1391   if test "$GMSGFMT" != ":"; then
1392     dnl If it is no GNU msgfmt we define it as : so that the
1393     dnl Makefiles still can work.
1394     if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1395        (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1396       : ;
1397     else
1398       GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1399       AC_MSG_RESULT(
1400         [found $GMSGFMT program is not GNU msgfmt; ignore it])
1401       GMSGFMT=":"
1402     fi
1403   fi
1404
1405   dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1406   dnl Test whether we really found GNU xgettext.
1407   if test "$XGETTEXT" != ":"; then
1408     dnl If it is no GNU xgettext we define it as : so that the
1409     dnl Makefiles still can work.
1410     if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1411        (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1412       : ;
1413     else
1414       AC_MSG_RESULT(
1415         [found xgettext program is not GNU xgettext; ignore it])
1416       XGETTEXT=":"
1417     fi
1418     dnl Remove leftover from FreeBSD xgettext call.
1419     rm -f messages.po
1420   fi
1421
1422   AC_OUTPUT_COMMANDS([
1423     for ac_file in $CONFIG_FILES; do
1424       # Support "outfile[:infile[:infile...]]"
1425       case "$ac_file" in
1426         *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1427       esac
1428       # PO directories have a Makefile.in generated from Makefile.in.in.
1429       case "$ac_file" in */Makefile.in)
1430         # Adjust a relative srcdir.
1431         ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1432         ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1433         ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1434         # In autoconf-2.13 it is called $ac_given_srcdir.
1435         # In autoconf-2.50 it is called $srcdir.
1436         test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1437         case "$ac_given_srcdir" in
1438           .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1439           /*) top_srcdir="$ac_given_srcdir" ;;
1440           *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1441         esac
1442         if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1443           rm -f "$ac_dir/POTFILES"
1444           test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1445           cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[   ]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1446           POMAKEFILEDEPS="POTFILES.in"
1447           # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1448           # on $ac_dir but don't depend on user-specified configuration
1449           # parameters.
1450           if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1451             # The LINGUAS file contains the set of available languages.
1452             if test -n "$OBSOLETE_ALL_LINGUAS"; then
1453               test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1454             fi
1455             ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1456             # Hide the ALL_LINGUAS assigment from automake.
1457             eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1458             POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
1459           else
1460             # The set of available languages was given in configure.in.
1461             eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
1462           fi
1463           case "$ac_given_srcdir" in
1464             .) srcdirpre= ;;
1465             *) srcdirpre='$(srcdir)/' ;;
1466           esac
1467           POFILES=
1468           GMOFILES=
1469           UPDATEPOFILES=
1470           DUMMYPOFILES=
1471           for lang in $ALL_LINGUAS; do
1472             POFILES="$POFILES $srcdirpre$lang.po"
1473             GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1474             UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1475             DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1476           done
1477           # CATALOGS depends on both $ac_dir and the user's LINGUAS
1478           # environment variable.
1479           INST_LINGUAS=
1480           if test -n "$ALL_LINGUAS"; then
1481             for presentlang in $ALL_LINGUAS; do
1482               useit=no
1483               if test "%UNSET%" != "$LINGUAS"; then
1484                 desiredlanguages="$LINGUAS"
1485               else
1486                 desiredlanguages="$ALL_LINGUAS"
1487               fi
1488               for desiredlang in $desiredlanguages; do
1489                 # Use the presentlang catalog if desiredlang is
1490                 #   a. equal to presentlang, or
1491                 #   b. a variant of presentlang (because in this case,
1492                 #      presentlang can be used as a fallback for messages
1493                 #      which are not translated in the desiredlang catalog).
1494                 case "$desiredlang" in
1495                   "$presentlang"*) useit=yes;;
1496                 esac
1497               done
1498               if test $useit = yes; then
1499                 INST_LINGUAS="$INST_LINGUAS $presentlang"
1500               fi
1501             done
1502           fi
1503           CATALOGS=
1504           if test -n "$INST_LINGUAS"; then
1505             for lang in $INST_LINGUAS; do
1506               CATALOGS="$CATALOGS $lang.gmo"
1507             done
1508           fi
1509           test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1510           sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1511           for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1512             if test -f "$f"; then
1513               case "$f" in
1514                 *.orig | *.bak | *~) ;;
1515                 *) cat "$f" >> "$ac_dir/Makefile" ;;
1516               esac
1517             fi
1518           done
1519         fi
1520         ;;
1521       esac
1522     done],
1523    [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1524     # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1525     # from automake.
1526     eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
1527     # Capture the value of LINGUAS because we need it to compute CATALOGS.
1528     LINGUAS="${LINGUAS-%UNSET%}"
1529    ])
1530 ])
1531
1532 # nls.m4 serial 1 (gettext-0.12)
1533 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1534 dnl This file is free software, distributed under the terms of the GNU
1535 dnl General Public License.  As a special exception to the GNU General
1536 dnl Public License, this file may be distributed as part of a program
1537 dnl that contains a configuration script generated by Autoconf, under
1538 dnl the same distribution terms as the rest of that program.
1539 dnl
1540 dnl This file can can be used in projects which are not available under
1541 dnl the GNU General Public License or the GNU Library General Public
1542 dnl License but which still want to provide support for the GNU gettext
1543 dnl functionality.
1544 dnl Please note that the actual code of the GNU gettext library is covered
1545 dnl by the GNU Library General Public License, and the rest of the GNU
1546 dnl gettext package package is covered by the GNU General Public License.
1547 dnl They are *not* in the public domain.
1548
1549 dnl Authors:
1550 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1551 dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1552
1553 AC_DEFUN([AM_NLS],
1554 [
1555   AC_MSG_CHECKING([whether NLS is requested])
1556   dnl Default is enabled NLS
1557   AC_ARG_ENABLE(nls,
1558     [  --disable-nls           do not use Native Language Support],
1559     USE_NLS=$enableval, USE_NLS=yes)
1560   AC_MSG_RESULT($USE_NLS)
1561   AC_SUBST(USE_NLS)
1562 ])
1563
1564 AC_DEFUN([AM_MKINSTALLDIRS],
1565 [
1566   dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1567   dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1568   dnl Try to locate it.
1569   MKINSTALLDIRS=
1570   if test -n "$ac_aux_dir"; then
1571     case "$ac_aux_dir" in
1572       /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
1573       *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
1574     esac
1575   fi
1576   if test -z "$MKINSTALLDIRS"; then
1577     MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1578   fi
1579   AC_SUBST(MKINSTALLDIRS)
1580 ])
1581
1582 # progtest.m4 serial 3 (gettext-0.12)
1583 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
1584 dnl This file is free software, distributed under the terms of the GNU
1585 dnl General Public License.  As a special exception to the GNU General
1586 dnl Public License, this file may be distributed as part of a program
1587 dnl that contains a configuration script generated by Autoconf, under
1588 dnl the same distribution terms as the rest of that program.
1589 dnl
1590 dnl This file can can be used in projects which are not available under
1591 dnl the GNU General Public License or the GNU Library General Public
1592 dnl License but which still want to provide support for the GNU gettext
1593 dnl functionality.
1594 dnl Please note that the actual code of the GNU gettext library is covered
1595 dnl by the GNU Library General Public License, and the rest of the GNU
1596 dnl gettext package package is covered by the GNU General Public License.
1597 dnl They are *not* in the public domain.
1598
1599 dnl Authors:
1600 dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
1601
1602 # Search path for a program which passes the given test.
1603
1604 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
1605 dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
1606 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
1607 [
1608 # Prepare PATH_SEPARATOR.
1609 # The user is always right.
1610 if test "${PATH_SEPARATOR+set}" != set; then
1611   echo "#! /bin/sh" >conf$$.sh
1612   echo  "exit 0"   >>conf$$.sh
1613   chmod +x conf$$.sh
1614   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
1615     PATH_SEPARATOR=';'
1616   else
1617     PATH_SEPARATOR=:
1618   fi
1619   rm -f conf$$.sh
1620 fi
1621
1622 # Find out how to test for executable files. Don't use a zero-byte file,
1623 # as systems may use methods other than mode bits to determine executability.
1624 cat >conf$$.file <<_ASEOF
1625 #! /bin/sh
1626 exit 0
1627 _ASEOF
1628 chmod +x conf$$.file
1629 if test -x conf$$.file >/dev/null 2>&1; then
1630   ac_executable_p="test -x"
1631 else
1632   ac_executable_p="test -f"
1633 fi
1634 rm -f conf$$.file
1635
1636 # Extract the first word of "$2", so it can be a program name with args.
1637 set dummy $2; ac_word=[$]2
1638 AC_MSG_CHECKING([for $ac_word])
1639 AC_CACHE_VAL(ac_cv_path_$1,
1640 [case "[$]$1" in
1641   [[\\/]]* | ?:[[\\/]]*)
1642     ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
1643     ;;
1644   *)
1645     ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
1646     for ac_dir in ifelse([$5], , $PATH, [$5]); do
1647       IFS="$ac_save_IFS"
1648       test -z "$ac_dir" && ac_dir=.
1649       for ac_exec_ext in '' $ac_executable_extensions; do
1650         if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
1651           if [$3]; then
1652             ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
1653             break 2
1654           fi
1655         fi
1656       done
1657     done
1658     IFS="$ac_save_IFS"
1659 dnl If no 4th arg is given, leave the cache variable unset,
1660 dnl so AC_PATH_PROGS will keep looking.
1661 ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
1662 ])dnl
1663     ;;
1664 esac])dnl
1665 $1="$ac_cv_path_$1"
1666 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
1667   AC_MSG_RESULT([$]$1)
1668 else
1669   AC_MSG_RESULT(no)
1670 fi
1671 AC_SUBST($1)dnl
1672 ])
1673
1674 # lib-prefix.m4 serial 2 (gettext-0.12)
1675 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1676 dnl This file is free software, distributed under the terms of the GNU
1677 dnl General Public License.  As a special exception to the GNU General
1678 dnl Public License, this file may be distributed as part of a program
1679 dnl that contains a configuration script generated by Autoconf, under
1680 dnl the same distribution terms as the rest of that program.
1681
1682 dnl From Bruno Haible.
1683
1684 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
1685 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
1686 dnl require excessive bracketing.
1687 ifdef([AC_HELP_STRING],
1688 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
1689 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
1690
1691 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1692 dnl to access previously installed libraries. The basic assumption is that
1693 dnl a user will want packages to use other packages he previously installed
1694 dnl with the same --prefix option.
1695 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1696 dnl libraries, but is otherwise very convenient.
1697 AC_DEFUN([AC_LIB_PREFIX],
1698 [
1699   AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1700   AC_REQUIRE([AC_PROG_CC])
1701   AC_REQUIRE([AC_CANONICAL_HOST])
1702   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1703   dnl By default, look in $includedir and $libdir.
1704   use_additional=yes
1705   AC_LIB_WITH_FINAL_PREFIX([
1706     eval additional_includedir=\"$includedir\"
1707     eval additional_libdir=\"$libdir\"
1708   ])
1709   AC_LIB_ARG_WITH([lib-prefix],
1710 [  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1711   --without-lib-prefix    don't search for libraries in includedir and libdir],
1712 [
1713     if test "X$withval" = "Xno"; then
1714       use_additional=no
1715     else
1716       if test "X$withval" = "X"; then
1717         AC_LIB_WITH_FINAL_PREFIX([
1718           eval additional_includedir=\"$includedir\"
1719           eval additional_libdir=\"$libdir\"
1720         ])
1721       else
1722         additional_includedir="$withval/include"
1723         additional_libdir="$withval/lib"
1724       fi
1725     fi
1726 ])
1727   if test $use_additional = yes; then
1728     dnl Potentially add $additional_includedir to $CPPFLAGS.
1729     dnl But don't add it
1730     dnl   1. if it's the standard /usr/include,
1731     dnl   2. if it's already present in $CPPFLAGS,
1732     dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1733     dnl   4. if it doesn't exist as a directory.
1734     if test "X$additional_includedir" != "X/usr/include"; then
1735       haveit=
1736       for x in $CPPFLAGS; do
1737         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1738         if test "X$x" = "X-I$additional_includedir"; then
1739           haveit=yes
1740           break
1741         fi
1742       done
1743       if test -z "$haveit"; then
1744         if test "X$additional_includedir" = "X/usr/local/include"; then
1745           if test -n "$GCC"; then
1746             case $host_os in
1747               linux*) haveit=yes;;
1748             esac
1749           fi
1750         fi
1751         if test -z "$haveit"; then
1752           if test -d "$additional_includedir"; then
1753             dnl Really add $additional_includedir to $CPPFLAGS.
1754             CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1755           fi
1756         fi
1757       fi
1758     fi
1759     dnl Potentially add $additional_libdir to $LDFLAGS.
1760     dnl But don't add it
1761     dnl   1. if it's the standard /usr/lib,
1762     dnl   2. if it's already present in $LDFLAGS,
1763     dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1764     dnl   4. if it doesn't exist as a directory.
1765     if test "X$additional_libdir" != "X/usr/lib"; then
1766       haveit=
1767       for x in $LDFLAGS; do
1768         AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1769         if test "X$x" = "X-L$additional_libdir"; then
1770           haveit=yes
1771           break
1772         fi
1773       done
1774       if test -z "$haveit"; then
1775         if test "X$additional_libdir" = "X/usr/local/lib"; then
1776           if test -n "$GCC"; then
1777             case $host_os in
1778               linux*) haveit=yes;;
1779             esac
1780           fi
1781         fi
1782         if test -z "$haveit"; then
1783           if test -d "$additional_libdir"; then
1784             dnl Really add $additional_libdir to $LDFLAGS.
1785             LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1786           fi
1787         fi
1788       fi
1789     fi
1790   fi
1791 ])
1792
1793 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1794 dnl acl_final_exec_prefix, containing the values to which $prefix and
1795 dnl $exec_prefix will expand at the end of the configure script.
1796 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1797 [
1798   dnl Unfortunately, prefix and exec_prefix get only finally determined
1799   dnl at the end of configure.
1800   if test "X$prefix" = "XNONE"; then
1801     acl_final_prefix="$ac_default_prefix"
1802   else
1803     acl_final_prefix="$prefix"
1804   fi
1805   if test "X$exec_prefix" = "XNONE"; then
1806     acl_final_exec_prefix='${prefix}'
1807   else
1808     acl_final_exec_prefix="$exec_prefix"
1809   fi
1810   acl_save_prefix="$prefix"
1811   prefix="$acl_final_prefix"
1812   eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1813   prefix="$acl_save_prefix"
1814 ])
1815
1816 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1817 dnl variables prefix and exec_prefix bound to the values they will have
1818 dnl at the end of the configure script.
1819 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1820 [
1821   acl_save_prefix="$prefix"
1822   prefix="$acl_final_prefix"
1823   acl_save_exec_prefix="$exec_prefix"
1824   exec_prefix="$acl_final_exec_prefix"
1825   $1
1826   exec_prefix="$acl_save_exec_prefix"
1827   prefix="$acl_save_prefix"
1828 ])
1829
1830 # lib-link.m4 serial 4 (gettext-0.12)
1831 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1832 dnl This file is free software, distributed under the terms of the GNU
1833 dnl General Public License.  As a special exception to the GNU General
1834 dnl Public License, this file may be distributed as part of a program
1835 dnl that contains a configuration script generated by Autoconf, under
1836 dnl the same distribution terms as the rest of that program.
1837
1838 dnl From Bruno Haible.
1839
1840 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1841 dnl the libraries corresponding to explicit and implicit dependencies.
1842 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1843 dnl augments the CPPFLAGS variable.
1844 AC_DEFUN([AC_LIB_LINKFLAGS],
1845 [
1846   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1847   AC_REQUIRE([AC_LIB_RPATH])
1848   define([Name],[translit([$1],[./-], [___])])
1849   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1850                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1851   AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1852     AC_LIB_LINKFLAGS_BODY([$1], [$2])
1853     ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1854     ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1855     ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1856   ])
1857   LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1858   LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1859   INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1860   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1861   AC_SUBST([LIB]NAME)
1862   AC_SUBST([LTLIB]NAME)
1863   dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1864   dnl results of this search when this library appears as a dependency.
1865   HAVE_LIB[]NAME=yes
1866   undefine([Name])
1867   undefine([NAME])
1868 ])
1869
1870 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1871 dnl searches for libname and the libraries corresponding to explicit and
1872 dnl implicit dependencies, together with the specified include files and
1873 dnl the ability to compile and link the specified testcode. If found, it
1874 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1875 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1876 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1877 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1878 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1879 [
1880   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1881   AC_REQUIRE([AC_LIB_RPATH])
1882   define([Name],[translit([$1],[./-], [___])])
1883   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1884                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1885
1886   dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1887   dnl accordingly.
1888   AC_LIB_LINKFLAGS_BODY([$1], [$2])
1889
1890   dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1891   dnl because if the user has installed lib[]Name and not disabled its use
1892   dnl via --without-lib[]Name-prefix, he wants to use it.
1893   ac_save_CPPFLAGS="$CPPFLAGS"
1894   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1895
1896   AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1897     ac_save_LIBS="$LIBS"
1898     LIBS="$LIBS $LIB[]NAME"
1899     AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1900     LIBS="$ac_save_LIBS"
1901   ])
1902   if test "$ac_cv_lib[]Name" = yes; then
1903     HAVE_LIB[]NAME=yes
1904     AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1905     AC_MSG_CHECKING([how to link with lib[]$1])
1906     AC_MSG_RESULT([$LIB[]NAME])
1907   else
1908     HAVE_LIB[]NAME=no
1909     dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1910     dnl $INC[]NAME either.
1911     CPPFLAGS="$ac_save_CPPFLAGS"
1912     LIB[]NAME=
1913     LTLIB[]NAME=
1914   fi
1915   AC_SUBST([HAVE_LIB]NAME)
1916   AC_SUBST([LIB]NAME)
1917   AC_SUBST([LTLIB]NAME)
1918   undefine([Name])
1919   undefine([NAME])
1920 ])
1921
1922 dnl Determine the platform dependent parameters needed to use rpath:
1923 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1924 dnl hardcode_direct, hardcode_minus_L.
1925 AC_DEFUN([AC_LIB_RPATH],
1926 [
1927   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1928   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1929   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1930   AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1931   AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1932     CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1933     ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1934     . ./conftest.sh
1935     rm -f ./conftest.sh
1936     acl_cv_rpath=done
1937   ])
1938   wl="$acl_cv_wl"
1939   libext="$acl_cv_libext"
1940   shlibext="$acl_cv_shlibext"
1941   hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1942   hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1943   hardcode_direct="$acl_cv_hardcode_direct"
1944   hardcode_minus_L="$acl_cv_hardcode_minus_L"
1945   dnl Determine whether the user wants rpath handling at all.
1946   AC_ARG_ENABLE(rpath,
1947     [  --disable-rpath         do not hardcode runtime library paths],
1948     :, enable_rpath=yes)
1949 ])
1950
1951 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1952 dnl the libraries corresponding to explicit and implicit dependencies.
1953 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1954 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1955 [
1956   define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1957                                [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1958   dnl By default, look in $includedir and $libdir.
1959   use_additional=yes
1960   AC_LIB_WITH_FINAL_PREFIX([
1961     eval additional_includedir=\"$includedir\"
1962     eval additional_libdir=\"$libdir\"
1963   ])
1964   AC_LIB_ARG_WITH([lib$1-prefix],
1965 [  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1966   --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1967 [
1968     if test "X$withval" = "Xno"; then
1969       use_additional=no
1970     else
1971       if test "X$withval" = "X"; then
1972         AC_LIB_WITH_FINAL_PREFIX([
1973           eval additional_includedir=\"$includedir\"
1974           eval additional_libdir=\"$libdir\"
1975         ])
1976       else
1977         additional_includedir="$withval/include"
1978         additional_libdir="$withval/lib"
1979       fi
1980     fi
1981 ])
1982   dnl Search the library and its dependencies in $additional_libdir and
1983   dnl $LDFLAGS. Using breadth-first-seach.
1984   LIB[]NAME=
1985   LTLIB[]NAME=
1986   INC[]NAME=
1987   rpathdirs=
1988   ltrpathdirs=
1989   names_already_handled=
1990   names_next_round='$1 $2'
1991   while test -n "$names_next_round"; do
1992     names_this_round="$names_next_round"
1993     names_next_round=
1994     for name in $names_this_round; do
1995       already_handled=
1996       for n in $names_already_handled; do
1997         if test "$n" = "$name"; then
1998           already_handled=yes
1999           break
2000         fi
2001       done
2002       if test -z "$already_handled"; then
2003         names_already_handled="$names_already_handled $name"
2004         dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2005         dnl or AC_LIB_HAVE_LINKFLAGS call.
2006         uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2007         eval value=\"\$HAVE_LIB$uppername\"
2008         if test -n "$value"; then
2009           if test "$value" = yes; then
2010             eval value=\"\$LIB$uppername\"
2011             test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2012             eval value=\"\$LTLIB$uppername\"
2013             test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2014           else
2015             dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2016             dnl that this library doesn't exist. So just drop it.
2017             :
2018           fi
2019         else
2020           dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2021           dnl and the already constructed $LIBNAME/$LTLIBNAME.
2022           found_dir=
2023           found_la=
2024           found_so=
2025           found_a=
2026           if test $use_additional = yes; then
2027             if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2028               found_dir="$additional_libdir"
2029               found_so="$additional_libdir/lib$name.$shlibext"
2030               if test -f "$additional_libdir/lib$name.la"; then
2031                 found_la="$additional_libdir/lib$name.la"
2032               fi
2033             else
2034               if test -f "$additional_libdir/lib$name.$libext"; then
2035                 found_dir="$additional_libdir"
2036                 found_a="$additional_libdir/lib$name.$libext"
2037                 if test -f "$additional_libdir/lib$name.la"; then
2038                   found_la="$additional_libdir/lib$name.la"
2039                 fi
2040               fi
2041             fi
2042           fi
2043           if test "X$found_dir" = "X"; then
2044             for x in $LDFLAGS $LTLIB[]NAME; do
2045               AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2046               case "$x" in
2047                 -L*)
2048                   dir=`echo "X$x" | sed -e 's/^X-L//'`
2049                   if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2050                     found_dir="$dir"
2051                     found_so="$dir/lib$name.$shlibext"
2052                     if test -f "$dir/lib$name.la"; then
2053                       found_la="$dir/lib$name.la"
2054                     fi
2055                   else
2056                     if test -f "$dir/lib$name.$libext"; then
2057                       found_dir="$dir"
2058                       found_a="$dir/lib$name.$libext"
2059                       if test -f "$dir/lib$name.la"; then
2060                         found_la="$dir/lib$name.la"
2061                       fi
2062                     fi
2063                   fi
2064                   ;;
2065               esac
2066               if test "X$found_dir" != "X"; then
2067                 break
2068               fi
2069             done
2070           fi
2071           if test "X$found_dir" != "X"; then
2072             dnl Found the library.
2073             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2074             if test "X$found_so" != "X"; then
2075               dnl Linking with a shared library. We attempt to hardcode its
2076               dnl directory into the executable's runpath, unless it's the
2077               dnl standard /usr/lib.
2078               if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2079                 dnl No hardcoding is needed.
2080                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2081               else
2082                 dnl Use an explicit option to hardcode DIR into the resulting
2083                 dnl binary.
2084                 dnl Potentially add DIR to ltrpathdirs.
2085                 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2086                 haveit=
2087                 for x in $ltrpathdirs; do
2088                   if test "X$x" = "X$found_dir"; then
2089                     haveit=yes
2090                     break
2091                   fi
2092                 done
2093                 if test -z "$haveit"; then
2094                   ltrpathdirs="$ltrpathdirs $found_dir"
2095                 fi
2096                 dnl The hardcoding into $LIBNAME is system dependent.
2097                 if test "$hardcode_direct" = yes; then
2098                   dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2099                   dnl resulting binary.
2100                   LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2101                 else
2102                   if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2103                     dnl Use an explicit option to hardcode DIR into the resulting
2104                     dnl binary.
2105                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2106                     dnl Potentially add DIR to rpathdirs.
2107                     dnl The rpathdirs will be appended to $LIBNAME at the end.
2108                     haveit=
2109                     for x in $rpathdirs; do
2110                       if test "X$x" = "X$found_dir"; then
2111                         haveit=yes
2112                         break
2113                       fi
2114                     done
2115                     if test -z "$haveit"; then
2116                       rpathdirs="$rpathdirs $found_dir"
2117                     fi
2118                   else
2119                     dnl Rely on "-L$found_dir".
2120                     dnl But don't add it if it's already contained in the LDFLAGS
2121                     dnl or the already constructed $LIBNAME
2122                     haveit=
2123                     for x in $LDFLAGS $LIB[]NAME; do
2124                       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2125                       if test "X$x" = "X-L$found_dir"; then
2126                         haveit=yes
2127                         break
2128                       fi
2129                     done
2130                     if test -z "$haveit"; then
2131                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2132                     fi
2133                     if test "$hardcode_minus_L" != no; then
2134                       dnl FIXME: Not sure whether we should use
2135                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2136                       dnl here.
2137                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2138                     else
2139                       dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2140                       dnl here, because this doesn't fit in flags passed to the
2141                       dnl compiler. So give up. No hardcoding. This affects only
2142                       dnl very old systems.
2143                       dnl FIXME: Not sure whether we should use
2144                       dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2145                       dnl here.
2146                       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2147                     fi
2148                   fi
2149                 fi
2150               fi
2151             else
2152               if test "X$found_a" != "X"; then
2153                 dnl Linking with a static library.
2154                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2155               else
2156                 dnl We shouldn't come here, but anyway it's good to have a
2157                 dnl fallback.
2158                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2159               fi
2160             fi
2161             dnl Assume the include files are nearby.
2162             additional_includedir=
2163             case "$found_dir" in
2164               */lib | */lib/)
2165                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2166                 additional_includedir="$basedir/include"
2167                 ;;
2168             esac
2169             if test "X$additional_includedir" != "X"; then
2170               dnl Potentially add $additional_includedir to $INCNAME.
2171               dnl But don't add it
2172               dnl   1. if it's the standard /usr/include,
2173               dnl   2. if it's /usr/local/include and we are using GCC on Linux,
2174               dnl   3. if it's already present in $CPPFLAGS or the already
2175               dnl      constructed $INCNAME,
2176               dnl   4. if it doesn't exist as a directory.
2177               if test "X$additional_includedir" != "X/usr/include"; then
2178                 haveit=
2179                 if test "X$additional_includedir" = "X/usr/local/include"; then
2180                   if test -n "$GCC"; then
2181                     case $host_os in
2182                       linux*) haveit=yes;;
2183                     esac
2184                   fi
2185                 fi
2186                 if test -z "$haveit"; then
2187                   for x in $CPPFLAGS $INC[]NAME; do
2188                     AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2189                     if test "X$x" = "X-I$additional_includedir"; then
2190                       haveit=yes
2191                       break
2192                     fi
2193                   done
2194                   if test -z "$haveit"; then
2195                     if test -d "$additional_includedir"; then
2196                       dnl Really add $additional_includedir to $INCNAME.
2197                       INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2198                     fi
2199                   fi
2200                 fi
2201               fi
2202             fi
2203             dnl Look for dependencies.
2204             if test -n "$found_la"; then
2205               dnl Read the .la file. It defines the variables
2206               dnl dlname, library_names, old_library, dependency_libs, current,
2207               dnl age, revision, installed, dlopen, dlpreopen, libdir.
2208               save_libdir="$libdir"
2209               case "$found_la" in
2210                 */* | *\\*) . "$found_la" ;;
2211                 *) . "./$found_la" ;;
2212               esac
2213               libdir="$save_libdir"
2214               dnl We use only dependency_libs.
2215               for dep in $dependency_libs; do
2216                 case "$dep" in
2217                   -L*)
2218                     additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2219                     dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2220                     dnl But don't add it
2221                     dnl   1. if it's the standard /usr/lib,
2222                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2223                     dnl   3. if it's already present in $LDFLAGS or the already
2224                     dnl      constructed $LIBNAME,
2225                     dnl   4. if it doesn't exist as a directory.
2226                     if test "X$additional_libdir" != "X/usr/lib"; then
2227                       haveit=
2228                       if test "X$additional_libdir" = "X/usr/local/lib"; then
2229                         if test -n "$GCC"; then
2230                           case $host_os in
2231                             linux*) haveit=yes;;
2232                           esac
2233                         fi
2234                       fi
2235                       if test -z "$haveit"; then
2236                         haveit=
2237                         for x in $LDFLAGS $LIB[]NAME; do
2238                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2239                           if test "X$x" = "X-L$additional_libdir"; then
2240                             haveit=yes
2241                             break
2242                           fi
2243                         done
2244                         if test -z "$haveit"; then
2245                           if test -d "$additional_libdir"; then
2246                             dnl Really add $additional_libdir to $LIBNAME.
2247                             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2248                           fi
2249                         fi
2250                         haveit=
2251                         for x in $LDFLAGS $LTLIB[]NAME; do
2252                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2253                           if test "X$x" = "X-L$additional_libdir"; then
2254                             haveit=yes
2255                             break
2256                           fi
2257                         done
2258                         if test -z "$haveit"; then
2259                           if test -d "$additional_libdir"; then
2260                             dnl Really add $additional_libdir to $LTLIBNAME.
2261                             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2262                           fi
2263                         fi
2264                       fi
2265                     fi
2266                     ;;
2267                   -R*)
2268                     dir=`echo "X$dep" | sed -e 's/^X-R//'`
2269                     if test "$enable_rpath" != no; then
2270                       dnl Potentially add DIR to rpathdirs.
2271                       dnl The rpathdirs will be appended to $LIBNAME at the end.
2272                       haveit=
2273                       for x in $rpathdirs; do
2274                         if test "X$x" = "X$dir"; then
2275                           haveit=yes
2276                           break
2277                         fi
2278                       done
2279                       if test -z "$haveit"; then
2280                         rpathdirs="$rpathdirs $dir"
2281                       fi
2282                       dnl Potentially add DIR to ltrpathdirs.
2283                       dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2284                       haveit=
2285                       for x in $ltrpathdirs; do
2286                         if test "X$x" = "X$dir"; then
2287                           haveit=yes
2288                           break
2289                         fi
2290                       done
2291                       if test -z "$haveit"; then
2292                         ltrpathdirs="$ltrpathdirs $dir"
2293                       fi
2294                     fi
2295                     ;;
2296                   -l*)
2297                     dnl Handle this in the next round.
2298                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2299                     ;;
2300                   *.la)
2301                     dnl Handle this in the next round. Throw away the .la's
2302                     dnl directory; it is already contained in a preceding -L
2303                     dnl option.
2304                     names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2305                     ;;
2306                   *)
2307                     dnl Most likely an immediate library name.
2308                     LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2309                     LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2310                     ;;
2311                 esac
2312               done
2313             fi
2314           else
2315             dnl Didn't find the library; assume it is in the system directories
2316             dnl known to the linker and runtime loader. (All the system
2317             dnl directories known to the linker should also be known to the
2318             dnl runtime loader, otherwise the system is severely misconfigured.)
2319             LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2320             LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2321           fi
2322         fi
2323       fi
2324     done
2325   done
2326   if test "X$rpathdirs" != "X"; then
2327     if test -n "$hardcode_libdir_separator"; then
2328       dnl Weird platform: only the last -rpath option counts, the user must
2329       dnl pass all path elements in one option. We can arrange that for a
2330       dnl single library, but not when more than one $LIBNAMEs are used.
2331       alldirs=
2332       for found_dir in $rpathdirs; do
2333         alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2334       done
2335       dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2336       acl_save_libdir="$libdir"
2337       libdir="$alldirs"
2338       eval flag=\"$hardcode_libdir_flag_spec\"
2339       libdir="$acl_save_libdir"
2340       LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2341     else
2342       dnl The -rpath options are cumulative.
2343       for found_dir in $rpathdirs; do
2344         acl_save_libdir="$libdir"
2345         libdir="$found_dir"
2346         eval flag=\"$hardcode_libdir_flag_spec\"
2347         libdir="$acl_save_libdir"
2348         LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2349       done
2350     fi
2351   fi
2352   if test "X$ltrpathdirs" != "X"; then
2353     dnl When using libtool, the option that works for both libraries and
2354     dnl executables is -R. The -R options are cumulative.
2355     for found_dir in $ltrpathdirs; do
2356       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2357     done
2358   fi
2359 ])
2360
2361 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2362 dnl unless already present in VAR.
2363 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2364 dnl contains two or three consecutive elements that belong together.
2365 AC_DEFUN([AC_LIB_APPENDTOVAR],
2366 [
2367   for element in [$2]; do
2368     haveit=
2369     for x in $[$1]; do
2370       AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2371       if test "X$x" = "X$element"; then
2372         haveit=yes
2373         break
2374       fi
2375     done
2376     if test -z "$haveit"; then
2377       [$1]="${[$1]}${[$1]:+ }$element"
2378     fi
2379   done
2380 ])
2381
2382 # lib-ld.m4 serial 2 (gettext-0.12)
2383 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2384 dnl This file is free software, distributed under the terms of the GNU
2385 dnl General Public License.  As a special exception to the GNU General
2386 dnl Public License, this file may be distributed as part of a program
2387 dnl that contains a configuration script generated by Autoconf, under
2388 dnl the same distribution terms as the rest of that program.
2389
2390 dnl Subroutines of libtool.m4,
2391 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2392 dnl with libtool.m4.
2393
2394 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2395 AC_DEFUN([AC_LIB_PROG_LD_GNU],
2396 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2397 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2398 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2399   acl_cv_prog_gnu_ld=yes
2400 else
2401   acl_cv_prog_gnu_ld=no
2402 fi])
2403 with_gnu_ld=$acl_cv_prog_gnu_ld
2404 ])
2405
2406 dnl From libtool-1.4. Sets the variable LD.
2407 AC_DEFUN([AC_LIB_PROG_LD],
2408 [AC_ARG_WITH(gnu-ld,
2409 [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
2410 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2411 AC_REQUIRE([AC_PROG_CC])dnl
2412 AC_REQUIRE([AC_CANONICAL_HOST])dnl
2413 # Prepare PATH_SEPARATOR.
2414 # The user is always right.
2415 if test "${PATH_SEPARATOR+set}" != set; then
2416   echo "#! /bin/sh" >conf$$.sh
2417   echo  "exit 0"   >>conf$$.sh
2418   chmod +x conf$$.sh
2419   if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2420     PATH_SEPARATOR=';'
2421   else
2422     PATH_SEPARATOR=:
2423   fi
2424   rm -f conf$$.sh
2425 fi
2426 ac_prog=ld
2427 if test "$GCC" = yes; then
2428   # Check if gcc -print-prog-name=ld gives a path.
2429   AC_MSG_CHECKING([for ld used by GCC])
2430   case $host in
2431   *-*-mingw*)
2432     # gcc leaves a trailing carriage return which upsets mingw
2433     ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2434   *)
2435     ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2436   esac
2437   case $ac_prog in
2438     # Accept absolute paths.
2439     [[\\/]* | [A-Za-z]:[\\/]*)]
2440       [re_direlt='/[^/][^/]*/\.\./']
2441       # Canonicalize the path of ld
2442       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2443       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2444         ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2445       done
2446       test -z "$LD" && LD="$ac_prog"
2447       ;;
2448   "")
2449     # If it fails, then pretend we aren't using GCC.
2450     ac_prog=ld
2451     ;;
2452   *)
2453     # If it is relative, then search for the first ld in PATH.
2454     with_gnu_ld=unknown
2455     ;;
2456   esac
2457 elif test "$with_gnu_ld" = yes; then
2458   AC_MSG_CHECKING([for GNU ld])
2459 else
2460   AC_MSG_CHECKING([for non-GNU ld])
2461 fi
2462 AC_CACHE_VAL(acl_cv_path_LD,
2463 [if test -z "$LD"; then
2464   IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2465   for ac_dir in $PATH; do
2466     test -z "$ac_dir" && ac_dir=.
2467     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2468       acl_cv_path_LD="$ac_dir/$ac_prog"
2469       # Check to see if the program is GNU ld.  I'd rather use --version,
2470       # but apparently some GNU ld's only accept -v.
2471       # Break only if it was the GNU/non-GNU ld that we prefer.
2472       if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2473         test "$with_gnu_ld" != no && break
2474       else
2475         test "$with_gnu_ld" != yes && break
2476       fi
2477     fi
2478   done
2479   IFS="$ac_save_ifs"
2480 else
2481   acl_cv_path_LD="$LD" # Let the user override the test with a path.
2482 fi])
2483 LD="$acl_cv_path_LD"
2484 if test -n "$LD"; then
2485   AC_MSG_RESULT($LD)
2486 else
2487   AC_MSG_RESULT(no)
2488 fi
2489 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2490 AC_LIB_PROG_LD_GNU
2491 ])
2492
2493 # iconv.m4 serial AM4 (gettext-0.11.3)
2494 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2495 dnl This file is free software, distributed under the terms of the GNU
2496 dnl General Public License.  As a special exception to the GNU General
2497 dnl Public License, this file may be distributed as part of a program
2498 dnl that contains a configuration script generated by Autoconf, under
2499 dnl the same distribution terms as the rest of that program.
2500
2501 dnl From Bruno Haible.
2502
2503 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2504 [
2505   dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2506   AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2507   AC_REQUIRE([AC_LIB_RPATH])
2508
2509   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2510   dnl accordingly.
2511   AC_LIB_LINKFLAGS_BODY([iconv])
2512 ])
2513
2514 AC_DEFUN([AM_ICONV_LINK],
2515 [
2516   dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2517   dnl those with the standalone portable GNU libiconv installed).
2518
2519   dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2520   dnl accordingly.
2521   AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2522
2523   dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2524   dnl because if the user has installed libiconv and not disabled its use
2525   dnl via --without-libiconv-prefix, he wants to use it. The first
2526   dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2527   am_save_CPPFLAGS="$CPPFLAGS"
2528   AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2529
2530   AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2531     am_cv_func_iconv="no, consider installing GNU libiconv"
2532     am_cv_lib_iconv=no
2533     AC_TRY_LINK([#include <stdlib.h>
2534 #include <iconv.h>],
2535       [iconv_t cd = iconv_open("","");
2536        iconv(cd,NULL,NULL,NULL,NULL);
2537        iconv_close(cd);],
2538       am_cv_func_iconv=yes)
2539     if test "$am_cv_func_iconv" != yes; then
2540       am_save_LIBS="$LIBS"
2541       LIBS="$LIBS $LIBICONV"
2542       AC_TRY_LINK([#include <stdlib.h>
2543 #include <iconv.h>],
2544         [iconv_t cd = iconv_open("","");
2545          iconv(cd,NULL,NULL,NULL,NULL);
2546          iconv_close(cd);],
2547         am_cv_lib_iconv=yes
2548         am_cv_func_iconv=yes)
2549       LIBS="$am_save_LIBS"
2550     fi
2551   ])
2552   if test "$am_cv_func_iconv" = yes; then
2553     AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2554   fi
2555   if test "$am_cv_lib_iconv" = yes; then
2556     AC_MSG_CHECKING([how to link with libiconv])
2557     AC_MSG_RESULT([$LIBICONV])
2558   else
2559     dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2560     dnl either.
2561     CPPFLAGS="$am_save_CPPFLAGS"
2562     LIBICONV=
2563     LTLIBICONV=
2564   fi
2565   AC_SUBST(LIBICONV)
2566   AC_SUBST(LTLIBICONV)
2567 ])
2568
2569 AC_DEFUN([AM_ICONV],
2570 [
2571   AM_ICONV_LINK
2572   if test "$am_cv_func_iconv" = yes; then
2573     AC_MSG_CHECKING([for iconv declaration])
2574     AC_CACHE_VAL(am_cv_proto_iconv, [
2575       AC_TRY_COMPILE([
2576 #include <stdlib.h>
2577 #include <iconv.h>
2578 extern
2579 #ifdef __cplusplus
2580 "C"
2581 #endif
2582 #if defined(__STDC__) || defined(__cplusplus)
2583 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2584 #else
2585 size_t iconv();
2586 #endif
2587 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2588       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);"])
2589     am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2590     AC_MSG_RESULT([$]{ac_t:-
2591          }[$]am_cv_proto_iconv)
2592     AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2593       [Define as const if the declaration of iconv() needs const.])
2594   fi
2595 ])
2596
2597 # isc-posix.m4 serial 2 (gettext-0.11.2)
2598 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2599 dnl This file is free software, distributed under the terms of the GNU
2600 dnl General Public License.  As a special exception to the GNU General
2601 dnl Public License, this file may be distributed as part of a program
2602 dnl that contains a configuration script generated by Autoconf, under
2603 dnl the same distribution terms as the rest of that program.
2604
2605 # This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
2606
2607 # This test replaces the one in autoconf.
2608 # Currently this macro should have the same name as the autoconf macro
2609 # because gettext's gettext.m4 (distributed in the automake package)
2610 # still uses it.  Otherwise, the use in gettext.m4 makes autoheader
2611 # give these diagnostics:
2612 #   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2613 #   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2614
2615 undefine([AC_ISC_POSIX])
2616
2617 AC_DEFUN([AC_ISC_POSIX],
2618   [
2619     dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2620     AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2621   ]
2622 )
2623
2624 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2625 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2626 dnl This file is free software, distributed under the terms of the GNU
2627 dnl General Public License.  As a special exception to the GNU General
2628 dnl Public License, this file may be distributed as part of a program
2629 dnl that contains a configuration script generated by Autoconf, under
2630 dnl the same distribution terms as the rest of that program.
2631
2632 # Test for the GNU C Library, version 2.1 or newer.
2633 # From Bruno Haible.
2634
2635 AC_DEFUN([jm_GLIBC21],
2636   [
2637     AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2638       ac_cv_gnu_library_2_1,
2639       [AC_EGREP_CPP([Lucky GNU user],
2640         [
2641 #include <features.h>
2642 #ifdef __GNU_LIBRARY__
2643  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2644   Lucky GNU user
2645  #endif
2646 #endif
2647         ],
2648         ac_cv_gnu_library_2_1=yes,
2649         ac_cv_gnu_library_2_1=no)
2650       ]
2651     )
2652     AC_SUBST(GLIBC21)
2653     GLIBC21="$ac_cv_gnu_library_2_1"
2654   ]
2655 )
2656
2657 # intdiv0.m4 serial 1 (gettext-0.11.3)
2658 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2659 dnl This file is free software, distributed under the terms of the GNU
2660 dnl General Public License.  As a special exception to the GNU General
2661 dnl Public License, this file may be distributed as part of a program
2662 dnl that contains a configuration script generated by Autoconf, under
2663 dnl the same distribution terms as the rest of that program.
2664
2665 dnl From Bruno Haible.
2666
2667 AC_DEFUN([gt_INTDIV0],
2668 [
2669   AC_REQUIRE([AC_PROG_CC])dnl
2670   AC_REQUIRE([AC_CANONICAL_HOST])dnl
2671
2672   AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2673     gt_cv_int_divbyzero_sigfpe,
2674     [
2675       AC_TRY_RUN([
2676 #include <stdlib.h>
2677 #include <signal.h>
2678
2679 static void
2680 #ifdef __cplusplus
2681 sigfpe_handler (int sig)
2682 #else
2683 sigfpe_handler (sig) int sig;
2684 #endif
2685 {
2686   /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
2687   exit (sig != SIGFPE);
2688 }
2689
2690 int x = 1;
2691 int y = 0;
2692 int z;
2693 int nan;
2694
2695 int main ()
2696 {
2697   signal (SIGFPE, sigfpe_handler);
2698 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
2699 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2700   signal (SIGTRAP, sigfpe_handler);
2701 #endif
2702 /* Linux/SPARC yields signal SIGILL.  */
2703 #if defined (__sparc__) && defined (__linux__)
2704   signal (SIGILL, sigfpe_handler);
2705 #endif
2706
2707   z = x / y;
2708   nan = y / y;
2709   exit (1);
2710 }
2711 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2712         [
2713           # Guess based on the CPU.
2714           case "$host_cpu" in
2715             alpha* | i[34567]86 | m68k | s390*)
2716               gt_cv_int_divbyzero_sigfpe="guessing yes";;
2717             *)
2718               gt_cv_int_divbyzero_sigfpe="guessing no";;
2719           esac
2720         ])
2721     ])
2722   case "$gt_cv_int_divbyzero_sigfpe" in
2723     *yes) value=1;;
2724     *) value=0;;
2725   esac
2726   AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2727     [Define if integer division by zero raises signal SIGFPE.])
2728 ])
2729
2730 # uintmax_t.m4 serial 7 (gettext-0.12)
2731 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2732 dnl This file is free software, distributed under the terms of the GNU
2733 dnl General Public License.  As a special exception to the GNU General
2734 dnl Public License, this file may be distributed as part of a program
2735 dnl that contains a configuration script generated by Autoconf, under
2736 dnl the same distribution terms as the rest of that program.
2737
2738 dnl From Paul Eggert.
2739
2740 AC_PREREQ(2.13)
2741
2742 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2743 # if it is not already defined in <stdint.h> or <inttypes.h>.
2744
2745 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2746 [
2747   AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2748   AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2749   if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2750     AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2751     test $ac_cv_type_unsigned_long_long = yes \
2752       && ac_type='unsigned long long' \
2753       || ac_type='unsigned long'
2754     AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2755       [Define to unsigned long or unsigned long long
2756        if <stdint.h> and <inttypes.h> don't define.])
2757   else
2758     AC_DEFINE(HAVE_UINTMAX_T, 1,
2759       [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2760   fi
2761 ])
2762
2763 # inttypes_h.m4 serial 5 (gettext-0.12)
2764 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2765 dnl This file is free software, distributed under the terms of the GNU
2766 dnl General Public License.  As a special exception to the GNU General
2767 dnl Public License, this file may be distributed as part of a program
2768 dnl that contains a configuration script generated by Autoconf, under
2769 dnl the same distribution terms as the rest of that program.
2770
2771 dnl From Paul Eggert.
2772
2773 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2774 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2775
2776 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2777 [
2778   AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2779   [AC_TRY_COMPILE(
2780     [#include <sys/types.h>
2781 #include <inttypes.h>],
2782     [uintmax_t i = (uintmax_t) -1;],
2783     jm_ac_cv_header_inttypes_h=yes,
2784     jm_ac_cv_header_inttypes_h=no)])
2785   if test $jm_ac_cv_header_inttypes_h = yes; then
2786     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2787       [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2788        and declares uintmax_t. ])
2789   fi
2790 ])
2791
2792 # stdint_h.m4 serial 3 (gettext-0.12)
2793 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2794 dnl This file is free software, distributed under the terms of the GNU
2795 dnl General Public License.  As a special exception to the GNU General
2796 dnl Public License, this file may be distributed as part of a program
2797 dnl that contains a configuration script generated by Autoconf, under
2798 dnl the same distribution terms as the rest of that program.
2799
2800 dnl From Paul Eggert.
2801
2802 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2803 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2804
2805 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2806 [
2807   AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2808   [AC_TRY_COMPILE(
2809     [#include <sys/types.h>
2810 #include <stdint.h>],
2811     [uintmax_t i = (uintmax_t) -1;],
2812     jm_ac_cv_header_stdint_h=yes,
2813     jm_ac_cv_header_stdint_h=no)])
2814   if test $jm_ac_cv_header_stdint_h = yes; then
2815     AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2816       [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2817        and declares uintmax_t. ])
2818   fi
2819 ])
2820
2821 # ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2822 dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2823 dnl This file is free software, distributed under the terms of the GNU
2824 dnl General Public License.  As a special exception to the GNU General
2825 dnl Public License, this file may be distributed as part of a program
2826 dnl that contains a configuration script generated by Autoconf, under
2827 dnl the same distribution terms as the rest of that program.
2828
2829 dnl From Paul Eggert.
2830
2831 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2832 [
2833   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2834   [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2835     [unsigned long long ullmax = (unsigned long long) -1;
2836      return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2837     ac_cv_type_unsigned_long_long=yes,
2838     ac_cv_type_unsigned_long_long=no)])
2839   if test $ac_cv_type_unsigned_long_long = yes; then
2840     AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2841       [Define if you have the unsigned long long type.])
2842   fi
2843 ])
2844
2845 # inttypes.m4 serial 1 (gettext-0.11.4)
2846 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2847 dnl This file is free software, distributed under the terms of the GNU
2848 dnl General Public License.  As a special exception to the GNU General
2849 dnl Public License, this file may be distributed as part of a program
2850 dnl that contains a configuration script generated by Autoconf, under
2851 dnl the same distribution terms as the rest of that program.
2852
2853 dnl From Paul Eggert.
2854
2855 # Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2856 # <sys/types.h>.
2857
2858 AC_DEFUN([gt_HEADER_INTTYPES_H],
2859 [
2860   AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2861   [
2862     AC_TRY_COMPILE(
2863       [#include <sys/types.h>
2864 #include <inttypes.h>],
2865       [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2866   ])
2867   if test $gt_cv_header_inttypes_h = yes; then
2868     AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2869       [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2870   fi
2871 ])
2872
2873 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
2874 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2875 dnl This file is free software, distributed under the terms of the GNU
2876 dnl General Public License.  As a special exception to the GNU General
2877 dnl Public License, this file may be distributed as part of a program
2878 dnl that contains a configuration script generated by Autoconf, under
2879 dnl the same distribution terms as the rest of that program.
2880
2881 dnl From Bruno Haible.
2882
2883 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2884 # macros to non-string values.  This is the case on AIX 4.3.3.
2885
2886 AC_DEFUN([gt_INTTYPES_PRI],
2887 [
2888   AC_REQUIRE([gt_HEADER_INTTYPES_H])
2889   if test $gt_cv_header_inttypes_h = yes; then
2890     AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2891       gt_cv_inttypes_pri_broken,
2892       [
2893         AC_TRY_COMPILE([#include <inttypes.h>
2894 #ifdef PRId32
2895 char *p = PRId32;
2896 #endif
2897 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2898       ])
2899   fi
2900   if test "$gt_cv_inttypes_pri_broken" = yes; then
2901     AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2902       [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2903   fi
2904 ])
2905
2906 # codeset.m4 serial AM1 (gettext-0.10.40)
2907 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2908 dnl This file is free software, distributed under the terms of the GNU
2909 dnl General Public License.  As a special exception to the GNU General
2910 dnl Public License, this file may be distributed as part of a program
2911 dnl that contains a configuration script generated by Autoconf, under
2912 dnl the same distribution terms as the rest of that program.
2913
2914 dnl From Bruno Haible.
2915
2916 AC_DEFUN([AM_LANGINFO_CODESET],
2917 [
2918   AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2919     [AC_TRY_LINK([#include <langinfo.h>],
2920       [char* cs = nl_langinfo(CODESET);],
2921       am_cv_langinfo_codeset=yes,
2922       am_cv_langinfo_codeset=no)
2923     ])
2924   if test $am_cv_langinfo_codeset = yes; then
2925     AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2926       [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2927   fi
2928 ])
2929
2930 # lcmessage.m4 serial 3 (gettext-0.11.3)
2931 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2932 dnl This file is free software, distributed under the terms of the GNU
2933 dnl General Public License.  As a special exception to the GNU General
2934 dnl Public License, this file may be distributed as part of a program
2935 dnl that contains a configuration script generated by Autoconf, under
2936 dnl the same distribution terms as the rest of that program.
2937 dnl
2938 dnl This file can can be used in projects which are not available under
2939 dnl the GNU General Public License or the GNU Library General Public
2940 dnl License but which still want to provide support for the GNU gettext
2941 dnl functionality.
2942 dnl Please note that the actual code of the GNU gettext library is covered
2943 dnl by the GNU Library General Public License, and the rest of the GNU
2944 dnl gettext package package is covered by the GNU General Public License.
2945 dnl They are *not* in the public domain.
2946
2947 dnl Authors:
2948 dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
2949
2950 # Check whether LC_MESSAGES is available in <locale.h>.
2951
2952 AC_DEFUN([AM_LC_MESSAGES],
2953 [
2954   AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2955     [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2956        am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2957   if test $am_cv_val_LC_MESSAGES = yes; then
2958     AC_DEFINE(HAVE_LC_MESSAGES, 1,
2959       [Define if your <locale.h> file defines LC_MESSAGES.])
2960   fi
2961 ])
2962