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