1# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
2
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4# Free Software Foundation, Inc.
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14# 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
39AC_PREREQ([2.54])
40
41# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
42# the ones we care about.
43m4_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.
56AC_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
60if 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])
63fi
64
65# test whether we have cygpath
66if 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
72fi
73AC_SUBST([CYGPATH_W])
74
75# Define the identity of the package.
76dnl Distinguish between old-style and new-style calls.
77m4_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.
90AC_REQUIRE([AM_SANITY_CHECK])dnl
91AC_REQUIRE([AC_ARG_PROGRAM])dnl
92AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93AM_MISSING_PROG(AUTOCONF, autoconf)
94AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95AM_MISSING_PROG(AUTOHEADER, autoheader)
96AM_MISSING_PROG(MAKEINFO, makeinfo)
97AM_MISSING_PROG(AMTAR, tar)
98AM_PROG_INSTALL_SH
99AM_PROG_INSTALL_STRIP
100# We need awk for the "check" target.  The system "awk" is bad on
101# some platforms.
102AC_REQUIRE([AC_PROG_AWK])dnl
103AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104AC_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
111AC_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.
126AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127[# Compute $1's index in $config_headers.
128_am_stamp_count=1
129for _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
136done
137echo "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.
159AC_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.
165AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166	 [AM_AUTOMAKE_VERSION([1.7.9])])
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# -----------------------
191AC_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.
197AC_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.
203AC_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.
209AC_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# ---------------
237AC_DEFUN([AM_SANITY_CHECK],
238[AC_MSG_CHECKING([whether build environment is sane])
239# Just in case
240sleep 1
241echo 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).
247if (
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
262alias in your environment])
263   fi
264
265   test "$[2]" = conftest.file
266   )
267then
268   # Ok.
269   :
270else
271   AC_MSG_ERROR([newly created file is older than distributed files!
272Check your system clock])
273fi
274AC_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# ------------------------------
300AC_DEFUN([AM_MISSING_PROG],
301[AC_REQUIRE([AM_MISSING_HAS_RUN])
302$1=${$1-"${am_missing_run}$2"}
303AC_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.
310AC_DEFUN([AM_MISSING_HAS_RUN],
311[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313# Use eval to expand $SHELL
314if eval "$MISSING --run true"; then
315  am_missing_run="$MISSING --run "
316else
317  am_missing_run=
318  AC_MSG_WARN([`missing' script is too old or missing])
319fi
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.
380AC_PREREQ([2.50])
381
382AC_DEFUN([AM_AUX_DIR_EXPAND], [
383# expand $ac_aux_dir to an absolute path
384am_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
408AC_DEFUN([AM_PROG_INSTALL_SH],
409[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410install_sh=${install_sh-"$am_aux_dir/install-sh"}
411AC_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).
439AC_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.
445dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446if test "$cross_compiling" != no; then
447  AC_CHECK_TOOL([STRIP], [strip], :)
448fi
449INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450AC_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.
474AC_DEFUN([AM_SET_LEADING_DOT],
475[rm -rf .tst 2>/dev/null
476mkdir .tst 2>/dev/null
477if test -d .tst; then
478  am__leading_dot=.
479else
480  am__leading_dot=_
481fi
482rmdir .tst 2>/dev/null
483AC_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.
523AC_DEFUN([_AM_DEPENDENCIES],
524[AC_REQUIRE([AM_SET_DEPDIR])dnl
525AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527AC_REQUIRE([AM_DEP_TRACK])dnl
528
529ifelse([$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
535AC_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
610else
611  am_cv_$1_dependencies_compiler_type=none
612fi
613])
614AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615AM_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
625AC_DEFUN([AM_SET_DEPDIR],
626[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
628])
629
630
631# AM_DEP_TRACK
632# ------------
633AC_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])
637if test "x$enable_dependency_tracking" != xno; then
638  am_depcomp="$ac_aux_dir/depcomp"
639  AMDEPBACKSLASH='\'
640fi
641AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642AC_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# ------------------------------
668AC_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
712done
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.
723AC_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.
753AC_DEFUN([AM_MAKE_INCLUDE],
754[am_make=${MAKE-make}
755cat > confinc << 'END'
756am__doit:
757	@echo done
758.PHONY: am__doit
759END
760# If we don't find an include directive, just comment out the code.
761AC_MSG_CHECKING([for style of include used by $am_make])
762am__include="#"
763am__quote=
764_am_result=none
765# First try GNU make style include.
766echo "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'.
772if 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
776fi
777# Now try BSD make style include.
778if 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
785fi
786AC_SUBST([am__include])
787AC_SUBST([am__quote])
788AC_MSG_RESULT([$_am_result])
789rm -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
813AC_PREREQ(2.52)
814
815# AM_CONDITIONAL(NAME, SHELL-CONDITION)
816# -------------------------------------
817# Define a conditional.
818AC_DEFUN([AM_CONDITIONAL],
819[ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
820        [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
821AC_SUBST([$1_TRUE])
822AC_SUBST([$1_FALSE])
823if $2; then
824  $1_TRUE=
825  $1_FALSE='#'
826else
827  $1_TRUE='#'
828  $1_FALSE=
829fi
830AC_CONFIG_COMMANDS_PRE(
831[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832  AC_MSG_ERROR([conditional "$1" was never defined.
833Usually this means the macro was only invoked conditionally.])
834fi])])
835
836# Add --enable-maintainer-mode option to configure.
837# From Jim Meyering
838
839# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
840
841# This program is free software; you can redistribute it and/or modify
842# it under the terms of the GNU General Public License as published by
843# the Free Software Foundation; either version 2, or (at your option)
844# any later version.
845
846# This program is distributed in the hope that it will be useful,
847# but WITHOUT ANY WARRANTY; without even the implied warranty of
848# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
849# GNU General Public License for more details.
850
851# You should have received a copy of the GNU General Public License
852# along with this program; if not, write to the Free Software
853# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
854# 02111-1307, USA.
855
856# serial 2
857
858AC_DEFUN([AM_MAINTAINER_MODE],
859[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
860  dnl maintainer-mode is disabled by default
861  AC_ARG_ENABLE(maintainer-mode,
862[  --enable-maintainer-mode enable make rules and dependencies not useful
863                          (and sometimes confusing) to the casual installer],
864      USE_MAINTAINER_MODE=$enableval,
865      USE_MAINTAINER_MODE=no)
866  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
867  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
868  MAINT=$MAINTAINER_MODE_TRUE
869  AC_SUBST(MAINT)dnl
870]
871)
872
873AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
874
875# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
876
877# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
878
879# This program is free software; you can redistribute it and/or modify
880# it under the terms of the GNU General Public License as published by
881# the Free Software Foundation; either version 2, or (at your option)
882# any later version.
883
884# This program is distributed in the hope that it will be useful,
885# but WITHOUT ANY WARRANTY; without even the implied warranty of
886# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
887# GNU General Public License for more details.
888
889# You should have received a copy of the GNU General Public License
890# along with this program; if not, write to the Free Software
891# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
892# 02111-1307, USA.
893
894AC_PREREQ([2.52])
895
896# serial 6
897
898# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
899AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
900
901# gettext.m4 serial 17 (gettext-0.11.5)
902dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
903dnl This file is free software, distributed under the terms of the GNU
904dnl General Public License.  As a special exception to the GNU General
905dnl Public License, this file may be distributed as part of a program
906dnl that contains a configuration script generated by Autoconf, under
907dnl the same distribution terms as the rest of that program.
908dnl
909dnl This file can can be used in projects which are not available under
910dnl the GNU General Public License or the GNU Library General Public
911dnl License but which still want to provide support for the GNU gettext
912dnl functionality.
913dnl Please note that the actual code of the GNU gettext library is covered
914dnl by the GNU Library General Public License, and the rest of the GNU
915dnl gettext package package is covered by the GNU General Public License.
916dnl They are *not* in the public domain.
917
918dnl Authors:
919dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
920dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2002.
921
922dnl Macro to add for using GNU gettext.
923
924dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
925dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
926dnl    default (if it is not specified or empty) is 'no-libtool'.
927dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
928dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
929dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
930dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
931dnl    depending on --{enable,disable}-{shared,static} and on the presence of
932dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
933dnl    $(top_builddir)/intl/libintl.a will be created.
934dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
935dnl    implementations (in libc or libintl) without the ngettext() function
936dnl    will be ignored.  If NEEDSYMBOL is specified and is
937dnl    'need-formatstring-macros', then GNU gettext implementations that don't
938dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
939dnl INTLDIR is used to find the intl libraries.  If empty,
940dnl    the value `$(top_builddir)/intl/' is used.
941dnl
942dnl The result of the configuration is one of three cases:
943dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
944dnl    and used.
945dnl    Catalog format: GNU --> install in $(datadir)
946dnl    Catalog extension: .mo after installation, .gmo in source tree
947dnl 2) GNU gettext has been found in the system's C library.
948dnl    Catalog format: GNU --> install in $(datadir)
949dnl    Catalog extension: .mo after installation, .gmo in source tree
950dnl 3) No internationalization, always use English msgid.
951dnl    Catalog format: none
952dnl    Catalog extension: none
953dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
954dnl The use of .gmo is historical (it was needed to avoid overwriting the
955dnl GNU format catalogs when building on a platform with an X/Open gettext),
956dnl but we keep it in order not to force irrelevant filename changes on the
957dnl maintainers.
958dnl
959AC_DEFUN([AM_GNU_GETTEXT],
960[
961  dnl Argument checking.
962  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
963    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
964])])])])])
965  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
966    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
967])])])])
968  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
969  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
970
971  AC_REQUIRE([AM_PO_SUBDIRS])dnl
972  ifelse(gt_included_intl, yes, [
973    AC_REQUIRE([AM_INTL_SUBDIR])dnl
974  ])
975
976  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
977  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
978  AC_REQUIRE([AC_LIB_RPATH])
979
980  dnl Sometimes libintl requires libiconv, so first search for libiconv.
981  dnl Ideally we would do this search only after the
982  dnl      if test "$USE_NLS" = "yes"; then
983  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
984  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
985  dnl the configure script would need to contain the same shell code
986  dnl again, outside any 'if'. There are two solutions:
987  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
988  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
989  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
990  dnl documented, we avoid it.
991  ifelse(gt_included_intl, yes, , [
992    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
993  ])
994
995  AC_MSG_CHECKING([whether NLS is requested])
996  dnl Default is enabled NLS
997  AC_ARG_ENABLE(nls,
998    [  --disable-nls           do not use Native Language Support],
999    USE_NLS=$enableval, USE_NLS=yes)
1000  AC_MSG_RESULT($USE_NLS)
1001  AC_SUBST(USE_NLS)
1002
1003  ifelse(gt_included_intl, yes, [
1004    BUILD_INCLUDED_LIBINTL=no
1005    USE_INCLUDED_LIBINTL=no
1006  ])
1007  LIBINTL=
1008  LTLIBINTL=
1009  POSUB=
1010
1011  dnl If we use NLS figure out what method
1012  if test "$USE_NLS" = "yes"; then
1013    gt_use_preinstalled_gnugettext=no
1014    ifelse(gt_included_intl, yes, [
1015      AC_MSG_CHECKING([whether included gettext is requested])
1016      AC_ARG_WITH(included-gettext,
1017        [  --with-included-gettext use the GNU gettext library included here],
1018        nls_cv_force_use_gnu_gettext=$withval,
1019        nls_cv_force_use_gnu_gettext=no)
1020      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1021
1022      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1023      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1024    ])
1025        dnl User does not insist on using GNU NLS library.  Figure out what
1026        dnl to use.  If GNU gettext is available we use this.  Else we have
1027        dnl to fall back to GNU NLS library.
1028
1029        dnl Add a version number to the cache macros.
1030        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1031        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1032        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1033
1034        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1035         [AC_TRY_LINK([#include <libintl.h>
1036]ifelse([$2], [need-formatstring-macros],
1037[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1038#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1039#endif
1040changequote(,)dnl
1041typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1042changequote([,])dnl
1043], [])[extern int _nl_msg_cat_cntr;
1044extern int *_nl_domain_bindings;],
1045            [bindtextdomain ("", "");
1046return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1047            gt_cv_func_gnugettext_libc=yes,
1048            gt_cv_func_gnugettext_libc=no)])
1049
1050        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1051          dnl Sometimes libintl requires libiconv, so first search for libiconv.
1052          ifelse(gt_included_intl, yes, , [
1053            AM_ICONV_LINK
1054          ])
1055          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1056          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1057          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1058          dnl even if libiconv doesn't exist.
1059          AC_LIB_LINKFLAGS_BODY([intl])
1060          AC_CACHE_CHECK([for GNU gettext in libintl],
1061            gt_cv_func_gnugettext_libintl,
1062           [gt_save_CPPFLAGS="$CPPFLAGS"
1063            CPPFLAGS="$CPPFLAGS $INCINTL"
1064            gt_save_LIBS="$LIBS"
1065            LIBS="$LIBS $LIBINTL"
1066            dnl Now see whether libintl exists and does not depend on libiconv.
1067            AC_TRY_LINK([#include <libintl.h>
1068]ifelse([$2], [need-formatstring-macros],
1069[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1070#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1071#endif
1072changequote(,)dnl
1073typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1074changequote([,])dnl
1075], [])[extern int _nl_msg_cat_cntr;
1076extern
1077#ifdef __cplusplus
1078"C"
1079#endif
1080const char *_nl_expand_alias ();],
1081              [bindtextdomain ("", "");
1082return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1083              gt_cv_func_gnugettext_libintl=yes,
1084              gt_cv_func_gnugettext_libintl=no)
1085            dnl Now see whether libintl exists and depends on libiconv.
1086            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1087              LIBS="$LIBS $LIBICONV"
1088              AC_TRY_LINK([#include <libintl.h>
1089]ifelse([$2], [need-formatstring-macros],
1090[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1091#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1092#endif
1093changequote(,)dnl
1094typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1095changequote([,])dnl
1096], [])[extern int _nl_msg_cat_cntr;
1097extern
1098#ifdef __cplusplus
1099"C"
1100#endif
1101const char *_nl_expand_alias ();],
1102                [bindtextdomain ("", "");
1103return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1104               [LIBINTL="$LIBINTL $LIBICONV"
1105                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1106                gt_cv_func_gnugettext_libintl=yes
1107               ])
1108            fi
1109            CPPFLAGS="$gt_save_CPPFLAGS"
1110            LIBS="$gt_save_LIBS"])
1111        fi
1112
1113        dnl If an already present or preinstalled GNU gettext() is found,
1114        dnl use it.  But if this macro is used in GNU gettext, and GNU
1115        dnl gettext is already preinstalled in libintl, we update this
1116        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1117        if test "$gt_cv_func_gnugettext_libc" = "yes" \
1118           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1119                && test "$PACKAGE" != gettext; }; then
1120          gt_use_preinstalled_gnugettext=yes
1121        else
1122          dnl Reset the values set by searching for libintl.
1123          LIBINTL=
1124          LTLIBINTL=
1125          INCINTL=
1126        fi
1127
1128    ifelse(gt_included_intl, yes, [
1129        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1130          dnl GNU gettext is not found in the C library.
1131          dnl Fall back on included GNU gettext library.
1132          nls_cv_use_gnu_gettext=yes
1133        fi
1134      fi
1135
1136      if test "$nls_cv_use_gnu_gettext" = "yes"; then
1137        dnl Mark actions used to generate GNU NLS library.
1138        INTLOBJS="\$(GETTOBJS)"
1139        BUILD_INCLUDED_LIBINTL=yes
1140        USE_INCLUDED_LIBINTL=yes
1141        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1142        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1143        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1144      fi
1145
1146      if test "$gt_use_preinstalled_gnugettext" = "yes" \
1147         || test "$nls_cv_use_gnu_gettext" = "yes"; then
1148        dnl Mark actions to use GNU gettext tools.
1149        CATOBJEXT=.gmo
1150      fi
1151    ])
1152
1153    if test "$gt_use_preinstalled_gnugettext" = "yes" \
1154       || test "$nls_cv_use_gnu_gettext" = "yes"; then
1155      AC_DEFINE(ENABLE_NLS, 1,
1156        [Define to 1 if translation of program messages to the user's native language
1157   is requested.])
1158    else
1159      USE_NLS=no
1160    fi
1161  fi
1162
1163  if test "$USE_NLS" = "yes"; then
1164
1165    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1166      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1167        AC_MSG_CHECKING([how to link with libintl])
1168        AC_MSG_RESULT([$LIBINTL])
1169        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1170      fi
1171
1172      dnl For backward compatibility. Some packages may be using this.
1173      AC_DEFINE(HAVE_GETTEXT, 1,
1174       [Define if the GNU gettext() function is already present or preinstalled.])
1175      AC_DEFINE(HAVE_DCGETTEXT, 1,
1176       [Define if the GNU dcgettext() function is already present or preinstalled.])
1177    fi
1178
1179    dnl We need to process the po/ directory.
1180    POSUB=po
1181  fi
1182
1183  ifelse(gt_included_intl, yes, [
1184    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1185    dnl to 'yes' because some of the testsuite requires it.
1186    if test "$PACKAGE" = gettext; then
1187      BUILD_INCLUDED_LIBINTL=yes
1188    fi
1189
1190    dnl Make all variables we use known to autoconf.
1191    AC_SUBST(BUILD_INCLUDED_LIBINTL)
1192    AC_SUBST(USE_INCLUDED_LIBINTL)
1193    AC_SUBST(CATOBJEXT)
1194    AC_SUBST(INTLOBJS)
1195
1196    dnl For backward compatibility. Some configure.ins may be using this.
1197    nls_cv_header_intl=
1198    nls_cv_header_libgt=
1199
1200    dnl For backward compatibility. Some Makefiles may be using this.
1201    DATADIRNAME=share
1202    AC_SUBST(DATADIRNAME)
1203
1204    dnl For backward compatibility. Some Makefiles may be using this.
1205    INSTOBJEXT=.mo
1206    AC_SUBST(INSTOBJEXT)
1207
1208    dnl For backward compatibility. Some Makefiles may be using this.
1209    GENCAT=gencat
1210    AC_SUBST(GENCAT)
1211
1212    dnl Enable libtool support if the surrounding package wishes it.
1213    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1214    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1215  ])
1216
1217  dnl For backward compatibility. Some Makefiles may be using this.
1218  INTLLIBS="$LIBINTL"
1219  AC_SUBST(INTLLIBS)
1220
1221  dnl Make all documented variables known to autoconf.
1222  AC_SUBST(LIBINTL)
1223  AC_SUBST(LTLIBINTL)
1224  AC_SUBST(POSUB)
1225])
1226
1227
1228dnl Checks for all prerequisites of the po subdirectory,
1229dnl except for USE_NLS.
1230AC_DEFUN([AM_PO_SUBDIRS],
1231[
1232  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1233  AC_REQUIRE([AC_PROG_INSTALL])dnl
1234  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1235
1236  dnl Perform the following tests also if --disable-nls has been given,
1237  dnl because they are needed for "make dist" to work.
1238
1239  dnl Search for GNU msgfmt in the PATH.
1240  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1241  dnl The second test excludes FreeBSD msgfmt.
1242  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1243    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1244     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1245    :)
1246  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1247
1248  dnl Search for GNU xgettext 0.11 or newer in the PATH.
1249  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1250  dnl The second test excludes FreeBSD xgettext.
1251  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1252    [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1253     (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1254    :)
1255  dnl Remove leftover from FreeBSD xgettext call.
1256  rm -f messages.po
1257
1258  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1259  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1260    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1261
1262  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1263  dnl Test whether we really found GNU msgfmt.
1264  if test "$GMSGFMT" != ":"; then
1265    dnl If it is no GNU msgfmt we define it as : so that the
1266    dnl Makefiles still can work.
1267    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1268       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1269      : ;
1270    else
1271      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1272      AC_MSG_RESULT(
1273        [found $GMSGFMT program is not GNU msgfmt; ignore it])
1274      GMSGFMT=":"
1275    fi
1276  fi
1277
1278  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1279  dnl Test whether we really found GNU xgettext.
1280  if test "$XGETTEXT" != ":"; then
1281    dnl If it is no GNU xgettext we define it as : so that the
1282    dnl Makefiles still can work.
1283    if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
1284       (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1285      : ;
1286    else
1287      AC_MSG_RESULT(
1288        [found xgettext program is not GNU xgettext; ignore it])
1289      XGETTEXT=":"
1290    fi
1291    dnl Remove leftover from FreeBSD xgettext call.
1292    rm -f messages.po
1293  fi
1294
1295  AC_OUTPUT_COMMANDS([
1296    for ac_file in $CONFIG_FILES; do
1297      # Support "outfile[:infile[:infile...]]"
1298      case "$ac_file" in
1299        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
1300      esac
1301      # PO directories have a Makefile.in generated from Makefile.in.in.
1302      case "$ac_file" in */Makefile.in)
1303        # Adjust a relative srcdir.
1304        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
1305        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
1306        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
1307        # In autoconf-2.13 it is called $ac_given_srcdir.
1308        # In autoconf-2.50 it is called $srcdir.
1309        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
1310        case "$ac_given_srcdir" in
1311          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
1312          /*) top_srcdir="$ac_given_srcdir" ;;
1313          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
1314        esac
1315        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
1316          rm -f "$ac_dir/POTFILES"
1317          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
1318          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
1319          # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
1320          # on $ac_dir but don't depend on user-specified configuration
1321          # parameters.
1322          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
1323            # The LINGUAS file contains the set of available languages.
1324            if test -n "$ALL_LINGUAS"; then
1325              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
1326            fi
1327            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
1328            # Hide the ALL_LINGUAS assigment from automake.
1329            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
1330          fi
1331          case "$ac_given_srcdir" in
1332            .) srcdirpre= ;;
1333            *) srcdirpre='$(srcdir)/' ;;
1334          esac
1335          POFILES=
1336          GMOFILES=
1337          UPDATEPOFILES=
1338          DUMMYPOFILES=
1339          for lang in $ALL_LINGUAS; do
1340            POFILES="$POFILES $srcdirpre$lang.po"
1341            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
1342            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
1343            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
1344          done
1345          # CATALOGS depends on both $ac_dir and the user's LINGUAS
1346          # environment variable.
1347          INST_LINGUAS=
1348          if test -n "$ALL_LINGUAS"; then
1349            for presentlang in $ALL_LINGUAS; do
1350              useit=no
1351              if test "%UNSET%" != "$LINGUAS"; then
1352                desiredlanguages="$LINGUAS"
1353              else
1354                desiredlanguages="$ALL_LINGUAS"
1355              fi
1356              for desiredlang in $desiredlanguages; do
1357                # Use the presentlang catalog if desiredlang is
1358                #   a. equal to presentlang, or
1359                #   b. a variant of presentlang (because in this case,
1360                #      presentlang can be used as a fallback for messages
1361                #      which are not translated in the desiredlang catalog).
1362                case "$desiredlang" in
1363                  "$presentlang"*) useit=yes;;
1364                esac
1365              done
1366              if test $useit = yes; then
1367                INST_LINGUAS="$INST_LINGUAS $presentlang"
1368              fi
1369            done
1370          fi
1371          CATALOGS=
1372          if test -n "$INST_LINGUAS"; then
1373            for lang in $INST_LINGUAS; do
1374              CATALOGS="$CATALOGS $lang.gmo"
1375            done
1376          fi
1377          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
1378          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" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
1379          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
1380            if test -f "$f"; then
1381              case "$f" in
1382                *.orig | *.bak | *~) ;;
1383                *) cat "$f" >> "$ac_dir/Makefile" ;;
1384              esac
1385            fi
1386          done
1387        fi
1388        ;;
1389      esac
1390    done],
1391   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
1392    # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
1393    # from automake.
1394    eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
1395    # Capture the value of LINGUAS because we need it to compute CATALOGS.
1396    LINGUAS="${LINGUAS-%UNSET%}"
1397   ])
1398])
1399
1400
1401dnl Checks for all prerequisites of the intl subdirectory,
1402dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1403dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1404AC_DEFUN([AM_INTL_SUBDIR],
1405[
1406  AC_REQUIRE([AC_PROG_INSTALL])dnl
1407  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1408  AC_REQUIRE([AC_PROG_CC])dnl
1409  AC_REQUIRE([AC_CANONICAL_HOST])dnl
1410  AC_REQUIRE([AC_PROG_RANLIB])dnl
1411  AC_REQUIRE([AC_ISC_POSIX])dnl
1412  AC_REQUIRE([AC_HEADER_STDC])dnl
1413  AC_REQUIRE([AC_C_CONST])dnl
1414  AC_REQUIRE([AC_C_INLINE])dnl
1415  AC_REQUIRE([AC_TYPE_OFF_T])dnl
1416  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1417  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1418  AC_REQUIRE([AC_FUNC_MMAP])dnl
1419  AC_REQUIRE([jm_GLIBC21])dnl
1420  AC_REQUIRE([gt_INTDIV0])dnl
1421  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1422  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1423  AC_REQUIRE([gt_INTTYPES_PRI])dnl
1424
1425  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1426stdlib.h string.h unistd.h sys/param.h])
1427  AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
1428geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
1429strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
1430
1431  AM_ICONV
1432  AM_LANGINFO_CODESET
1433  if test $ac_cv_header_locale_h = yes; then
1434    AM_LC_MESSAGES
1435  fi
1436
1437  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1438  dnl because plural.y uses bison specific features. It requires at least
1439  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1440  dnl compile.
1441  dnl bison is only needed for the maintainer (who touches plural.y). But in
1442  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1443  dnl the rule in general Makefile. Now, some people carelessly touch the
1444  dnl files or have a broken "make" program, hence the plural.c rule will
1445  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1446  dnl present or too old.
1447  AC_CHECK_PROGS([INTLBISON], [bison])
1448  if test -z "$INTLBISON"; then
1449    ac_verc_fail=yes
1450  else
1451    dnl Found it, now check the version.
1452    AC_MSG_CHECKING([version of bison])
1453changequote(<<,>>)dnl
1454    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1455    case $ac_prog_version in
1456      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1457      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1458changequote([,])dnl
1459         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1460      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1461    esac
1462    AC_MSG_RESULT([$ac_prog_version])
1463  fi
1464  if test $ac_verc_fail = yes; then
1465    INTLBISON=:
1466  fi
1467])
1468
1469
1470AC_DEFUN([AM_MKINSTALLDIRS],
1471[
1472  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
1473  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
1474  dnl Try to locate is.
1475  MKINSTALLDIRS=
1476  if test -n "$ac_aux_dir"; then
1477    MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
1478  fi
1479  if test -z "$MKINSTALLDIRS"; then
1480    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
1481  fi
1482  AC_SUBST(MKINSTALLDIRS)
1483])
1484
1485
1486dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1487AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1488
1489# lib-prefix.m4 serial 1 (gettext-0.11)
1490dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1491dnl This file is free software, distributed under the terms of the GNU
1492dnl General Public License.  As a special exception to the GNU General
1493dnl Public License, this file may be distributed as part of a program
1494dnl that contains a configuration script generated by Autoconf, under
1495dnl the same distribution terms as the rest of that program.
1496
1497dnl From Bruno Haible.
1498
1499dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
1500dnl to access previously installed libraries. The basic assumption is that
1501dnl a user will want packages to use other packages he previously installed
1502dnl with the same --prefix option.
1503dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
1504dnl libraries, but is otherwise very convenient.
1505AC_DEFUN([AC_LIB_PREFIX],
1506[
1507  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
1508  AC_REQUIRE([AC_PROG_CC])
1509  AC_REQUIRE([AC_CANONICAL_HOST])
1510  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1511  dnl By default, look in $includedir and $libdir.
1512  use_additional=yes
1513  AC_LIB_WITH_FINAL_PREFIX([
1514    eval additional_includedir=\"$includedir\"
1515    eval additional_libdir=\"$libdir\"
1516  ])
1517  AC_ARG_WITH([lib-prefix],
1518[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
1519  --without-lib-prefix    don't search for libraries in includedir and libdir],
1520[
1521    if test "X$withval" = "Xno"; then
1522      use_additional=no
1523    else
1524      if test "X$withval" = "X"; then
1525        AC_LIB_WITH_FINAL_PREFIX([
1526          eval additional_includedir=\"$includedir\"
1527          eval additional_libdir=\"$libdir\"
1528        ])
1529      else
1530        additional_includedir="$withval/include"
1531        additional_libdir="$withval/lib"
1532      fi
1533    fi
1534])
1535  if test $use_additional = yes; then
1536    dnl Potentially add $additional_includedir to $CPPFLAGS.
1537    dnl But don't add it
1538    dnl   1. if it's the standard /usr/include,
1539    dnl   2. if it's already present in $CPPFLAGS,
1540    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
1541    dnl   4. if it doesn't exist as a directory.
1542    if test "X$additional_includedir" != "X/usr/include"; then
1543      haveit=
1544      for x in $CPPFLAGS; do
1545        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1546        if test "X$x" = "X-I$additional_includedir"; then
1547          haveit=yes
1548          break
1549        fi
1550      done
1551      if test -z "$haveit"; then
1552        if test "X$additional_includedir" = "X/usr/local/include"; then
1553          if test -n "$GCC"; then
1554            case $host_os in
1555              linux*) haveit=yes;;
1556            esac
1557          fi
1558        fi
1559        if test -z "$haveit"; then
1560          if test -d "$additional_includedir"; then
1561            dnl Really add $additional_includedir to $CPPFLAGS.
1562            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
1563          fi
1564        fi
1565      fi
1566    fi
1567    dnl Potentially add $additional_libdir to $LDFLAGS.
1568    dnl But don't add it
1569    dnl   1. if it's the standard /usr/lib,
1570    dnl   2. if it's already present in $LDFLAGS,
1571    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
1572    dnl   4. if it doesn't exist as a directory.
1573    if test "X$additional_libdir" != "X/usr/lib"; then
1574      haveit=
1575      for x in $LDFLAGS; do
1576        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1577        if test "X$x" = "X-L$additional_libdir"; then
1578          haveit=yes
1579          break
1580        fi
1581      done
1582      if test -z "$haveit"; then
1583        if test "X$additional_libdir" = "X/usr/local/lib"; then
1584          if test -n "$GCC"; then
1585            case $host_os in
1586              linux*) haveit=yes;;
1587            esac
1588          fi
1589        fi
1590        if test -z "$haveit"; then
1591          if test -d "$additional_libdir"; then
1592            dnl Really add $additional_libdir to $LDFLAGS.
1593            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
1594          fi
1595        fi
1596      fi
1597    fi
1598  fi
1599])
1600
1601dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
1602dnl acl_final_exec_prefix, containing the values to which $prefix and
1603dnl $exec_prefix will expand at the end of the configure script.
1604AC_DEFUN([AC_LIB_PREPARE_PREFIX],
1605[
1606  dnl Unfortunately, prefix and exec_prefix get only finally determined
1607  dnl at the end of configure.
1608  if test "X$prefix" = "XNONE"; then
1609    acl_final_prefix="$ac_default_prefix"
1610  else
1611    acl_final_prefix="$prefix"
1612  fi
1613  if test "X$exec_prefix" = "XNONE"; then
1614    acl_final_exec_prefix='${prefix}'
1615  else
1616    acl_final_exec_prefix="$exec_prefix"
1617  fi
1618  acl_save_prefix="$prefix"
1619  prefix="$acl_final_prefix"
1620  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
1621  prefix="$acl_save_prefix"
1622])
1623
1624dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
1625dnl variables prefix and exec_prefix bound to the values they will have
1626dnl at the end of the configure script.
1627AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
1628[
1629  acl_save_prefix="$prefix"
1630  prefix="$acl_final_prefix"
1631  acl_save_exec_prefix="$exec_prefix"
1632  exec_prefix="$acl_final_exec_prefix"
1633  $1
1634  exec_prefix="$acl_save_exec_prefix"
1635  prefix="$acl_save_prefix"
1636])
1637
1638# lib-link.m4 serial 3 (gettext-0.11.3)
1639dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
1640dnl This file is free software, distributed under the terms of the GNU
1641dnl General Public License.  As a special exception to the GNU General
1642dnl Public License, this file may be distributed as part of a program
1643dnl that contains a configuration script generated by Autoconf, under
1644dnl the same distribution terms as the rest of that program.
1645
1646dnl From Bruno Haible.
1647
1648dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
1649dnl the libraries corresponding to explicit and implicit dependencies.
1650dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
1651dnl augments the CPPFLAGS variable.
1652AC_DEFUN([AC_LIB_LINKFLAGS],
1653[
1654  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1655  AC_REQUIRE([AC_LIB_RPATH])
1656  define([Name],[translit([$1],[./-], [___])])
1657  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1658                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1659  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
1660    AC_LIB_LINKFLAGS_BODY([$1], [$2])
1661    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
1662    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
1663    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
1664  ])
1665  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
1666  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
1667  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
1668  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1669  AC_SUBST([LIB]NAME)
1670  AC_SUBST([LTLIB]NAME)
1671  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
1672  dnl results of this search when this library appears as a dependency.
1673  HAVE_LIB[]NAME=yes
1674  undefine([Name])
1675  undefine([NAME])
1676])
1677
1678dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
1679dnl searches for libname and the libraries corresponding to explicit and
1680dnl implicit dependencies, together with the specified include files and
1681dnl the ability to compile and link the specified testcode. If found, it
1682dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
1683dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
1684dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
1685dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
1686AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
1687[
1688  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1689  AC_REQUIRE([AC_LIB_RPATH])
1690  define([Name],[translit([$1],[./-], [___])])
1691  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1692                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1693
1694  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
1695  dnl accordingly.
1696  AC_LIB_LINKFLAGS_BODY([$1], [$2])
1697
1698  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
1699  dnl because if the user has installed lib[]Name and not disabled its use
1700  dnl via --without-lib[]Name-prefix, he wants to use it.
1701  ac_save_CPPFLAGS="$CPPFLAGS"
1702  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
1703
1704  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
1705    ac_save_LIBS="$LIBS"
1706    LIBS="$LIBS $LIB[]NAME"
1707    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
1708    LIBS="$ac_save_LIBS"
1709  ])
1710  if test "$ac_cv_lib[]Name" = yes; then
1711    HAVE_LIB[]NAME=yes
1712    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
1713    AC_MSG_CHECKING([how to link with lib[]$1])
1714    AC_MSG_RESULT([$LIB[]NAME])
1715  else
1716    HAVE_LIB[]NAME=no
1717    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
1718    dnl $INC[]NAME either.
1719    CPPFLAGS="$ac_save_CPPFLAGS"
1720    LIB[]NAME=
1721    LTLIB[]NAME=
1722  fi
1723  AC_SUBST([HAVE_LIB]NAME)
1724  AC_SUBST([LIB]NAME)
1725  AC_SUBST([LTLIB]NAME)
1726  undefine([Name])
1727  undefine([NAME])
1728])
1729
1730dnl Determine the platform dependent parameters needed to use rpath:
1731dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
1732dnl hardcode_direct, hardcode_minus_L,
1733dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
1734AC_DEFUN([AC_LIB_RPATH],
1735[
1736  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
1737  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
1738  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
1739  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
1740  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
1741    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
1742    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
1743    . ./conftest.sh
1744    rm -f ./conftest.sh
1745    acl_cv_rpath=done
1746  ])
1747  wl="$acl_cv_wl"
1748  libext="$acl_cv_libext"
1749  shlibext="$acl_cv_shlibext"
1750  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
1751  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
1752  hardcode_direct="$acl_cv_hardcode_direct"
1753  hardcode_minus_L="$acl_cv_hardcode_minus_L"
1754  sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
1755  sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
1756  dnl Determine whether the user wants rpath handling at all.
1757  AC_ARG_ENABLE(rpath,
1758    [  --disable-rpath         do not hardcode runtime library paths],
1759    :, enable_rpath=yes)
1760])
1761
1762dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
1763dnl the libraries corresponding to explicit and implicit dependencies.
1764dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
1765AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
1766[
1767  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
1768                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
1769  dnl By default, look in $includedir and $libdir.
1770  use_additional=yes
1771  AC_LIB_WITH_FINAL_PREFIX([
1772    eval additional_includedir=\"$includedir\"
1773    eval additional_libdir=\"$libdir\"
1774  ])
1775  AC_ARG_WITH([lib$1-prefix],
1776[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
1777  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
1778[
1779    if test "X$withval" = "Xno"; then
1780      use_additional=no
1781    else
1782      if test "X$withval" = "X"; then
1783        AC_LIB_WITH_FINAL_PREFIX([
1784          eval additional_includedir=\"$includedir\"
1785          eval additional_libdir=\"$libdir\"
1786        ])
1787      else
1788        additional_includedir="$withval/include"
1789        additional_libdir="$withval/lib"
1790      fi
1791    fi
1792])
1793  dnl Search the library and its dependencies in $additional_libdir and
1794  dnl $LDFLAGS. Using breadth-first-seach.
1795  LIB[]NAME=
1796  LTLIB[]NAME=
1797  INC[]NAME=
1798  rpathdirs=
1799  ltrpathdirs=
1800  names_already_handled=
1801  names_next_round='$1 $2'
1802  while test -n "$names_next_round"; do
1803    names_this_round="$names_next_round"
1804    names_next_round=
1805    for name in $names_this_round; do
1806      already_handled=
1807      for n in $names_already_handled; do
1808        if test "$n" = "$name"; then
1809          already_handled=yes
1810          break
1811        fi
1812      done
1813      if test -z "$already_handled"; then
1814        names_already_handled="$names_already_handled $name"
1815        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
1816        dnl or AC_LIB_HAVE_LINKFLAGS call.
1817        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
1818        eval value=\"\$HAVE_LIB$uppername\"
1819        if test -n "$value"; then
1820          if test "$value" = yes; then
1821            eval value=\"\$LIB$uppername\"
1822            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
1823            eval value=\"\$LTLIB$uppername\"
1824            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
1825          else
1826            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
1827            dnl that this library doesn't exist. So just drop it.
1828            :
1829          fi
1830        else
1831          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
1832          dnl and the already constructed $LIBNAME/$LTLIBNAME.
1833          found_dir=
1834          found_la=
1835          found_so=
1836          found_a=
1837          if test $use_additional = yes; then
1838            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
1839              found_dir="$additional_libdir"
1840              found_so="$additional_libdir/lib$name.$shlibext"
1841              if test -f "$additional_libdir/lib$name.la"; then
1842                found_la="$additional_libdir/lib$name.la"
1843              fi
1844            else
1845              if test -f "$additional_libdir/lib$name.$libext"; then
1846                found_dir="$additional_libdir"
1847                found_a="$additional_libdir/lib$name.$libext"
1848                if test -f "$additional_libdir/lib$name.la"; then
1849                  found_la="$additional_libdir/lib$name.la"
1850                fi
1851              fi
1852            fi
1853          fi
1854          if test "X$found_dir" = "X"; then
1855            for x in $LDFLAGS $LTLIB[]NAME; do
1856              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1857              case "$x" in
1858                -L*)
1859                  dir=`echo "X$x" | sed -e 's/^X-L//'`
1860                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
1861                    found_dir="$dir"
1862                    found_so="$dir/lib$name.$shlibext"
1863                    if test -f "$dir/lib$name.la"; then
1864                      found_la="$dir/lib$name.la"
1865                    fi
1866                  else
1867                    if test -f "$dir/lib$name.$libext"; then
1868                      found_dir="$dir"
1869                      found_a="$dir/lib$name.$libext"
1870                      if test -f "$dir/lib$name.la"; then
1871                        found_la="$dir/lib$name.la"
1872                      fi
1873                    fi
1874                  fi
1875                  ;;
1876              esac
1877              if test "X$found_dir" != "X"; then
1878                break
1879              fi
1880            done
1881          fi
1882          if test "X$found_dir" != "X"; then
1883            dnl Found the library.
1884            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
1885            if test "X$found_so" != "X"; then
1886              dnl Linking with a shared library. We attempt to hardcode its
1887              dnl directory into the executable's runpath, unless it's the
1888              dnl standard /usr/lib.
1889              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
1890                dnl No hardcoding is needed.
1891                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1892              else
1893                dnl Use an explicit option to hardcode DIR into the resulting
1894                dnl binary.
1895                dnl Potentially add DIR to ltrpathdirs.
1896                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
1897                haveit=
1898                for x in $ltrpathdirs; do
1899                  if test "X$x" = "X$found_dir"; then
1900                    haveit=yes
1901                    break
1902                  fi
1903                done
1904                if test -z "$haveit"; then
1905                  ltrpathdirs="$ltrpathdirs $found_dir"
1906                fi
1907                dnl The hardcoding into $LIBNAME is system dependent.
1908                if test "$hardcode_direct" = yes; then
1909                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
1910                  dnl resulting binary.
1911                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1912                else
1913                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
1914                    dnl Use an explicit option to hardcode DIR into the resulting
1915                    dnl binary.
1916                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1917                    dnl Potentially add DIR to rpathdirs.
1918                    dnl The rpathdirs will be appended to $LIBNAME at the end.
1919                    haveit=
1920                    for x in $rpathdirs; do
1921                      if test "X$x" = "X$found_dir"; then
1922                        haveit=yes
1923                        break
1924                      fi
1925                    done
1926                    if test -z "$haveit"; then
1927                      rpathdirs="$rpathdirs $found_dir"
1928                    fi
1929                  else
1930                    dnl Rely on "-L$found_dir".
1931                    dnl But don't add it if it's already contained in the LDFLAGS
1932                    dnl or the already constructed $LIBNAME
1933                    haveit=
1934                    for x in $LDFLAGS $LIB[]NAME; do
1935                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
1936                      if test "X$x" = "X-L$found_dir"; then
1937                        haveit=yes
1938                        break
1939                      fi
1940                    done
1941                    if test -z "$haveit"; then
1942                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
1943                    fi
1944                    if test "$hardcode_minus_L" != no; then
1945                      dnl FIXME: Not sure whether we should use
1946                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1947                      dnl here.
1948                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
1949                    else
1950                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
1951                      dnl here, because this doesn't fit in flags passed to the
1952                      dnl compiler. So give up. No hardcoding. This affects only
1953                      dnl very old systems.
1954                      dnl FIXME: Not sure whether we should use
1955                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
1956                      dnl here.
1957                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
1958                    fi
1959                  fi
1960                fi
1961              fi
1962            else
1963              if test "X$found_a" != "X"; then
1964                dnl Linking with a static library.
1965                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
1966              else
1967                dnl We shouldn't come here, but anyway it's good to have a
1968                dnl fallback.
1969                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
1970              fi
1971            fi
1972            dnl Assume the include files are nearby.
1973            additional_includedir=
1974            case "$found_dir" in
1975              */lib | */lib/)
1976                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
1977                additional_includedir="$basedir/include"
1978                ;;
1979            esac
1980            if test "X$additional_includedir" != "X"; then
1981              dnl Potentially add $additional_includedir to $INCNAME.
1982              dnl But don't add it
1983              dnl   1. if it's the standard /usr/include,
1984              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
1985              dnl   3. if it's already present in $CPPFLAGS or the already
1986              dnl      constructed $INCNAME,
1987              dnl   4. if it doesn't exist as a directory.
1988              if test "X$additional_includedir" != "X/usr/include"; then
1989                haveit=
1990                if test "X$additional_includedir" = "X/usr/local/include"; then
1991                  if test -n "$GCC"; then
1992                    case $host_os in
1993                      linux*) haveit=yes;;
1994                    esac
1995                  fi
1996                fi
1997                if test -z "$haveit"; then
1998                  for x in $CPPFLAGS $INC[]NAME; do
1999                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2000                    if test "X$x" = "X-I$additional_includedir"; then
2001                      haveit=yes
2002                      break
2003                    fi
2004                  done
2005                  if test -z "$haveit"; then
2006                    if test -d "$additional_includedir"; then
2007                      dnl Really add $additional_includedir to $INCNAME.
2008                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
2009                    fi
2010                  fi
2011                fi
2012              fi
2013            fi
2014            dnl Look for dependencies.
2015            if test -n "$found_la"; then
2016              dnl Read the .la file. It defines the variables
2017              dnl dlname, library_names, old_library, dependency_libs, current,
2018              dnl age, revision, installed, dlopen, dlpreopen, libdir.
2019              save_libdir="$libdir"
2020              case "$found_la" in
2021                */* | *\\*) . "$found_la" ;;
2022                *) . "./$found_la" ;;
2023              esac
2024              libdir="$save_libdir"
2025              dnl We use only dependency_libs.
2026              for dep in $dependency_libs; do
2027                case "$dep" in
2028                  -L*)
2029                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
2030                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
2031                    dnl But don't add it
2032                    dnl   1. if it's the standard /usr/lib,
2033                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
2034                    dnl   3. if it's already present in $LDFLAGS or the already
2035                    dnl      constructed $LIBNAME,
2036                    dnl   4. if it doesn't exist as a directory.
2037                    if test "X$additional_libdir" != "X/usr/lib"; then
2038                      haveit=
2039                      if test "X$additional_libdir" = "X/usr/local/lib"; then
2040                        if test -n "$GCC"; then
2041                          case $host_os in
2042                            linux*) haveit=yes;;
2043                          esac
2044                        fi
2045                      fi
2046                      if test -z "$haveit"; then
2047                        haveit=
2048                        for x in $LDFLAGS $LIB[]NAME; do
2049                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2050                          if test "X$x" = "X-L$additional_libdir"; then
2051                            haveit=yes
2052                            break
2053                          fi
2054                        done
2055                        if test -z "$haveit"; then
2056                          if test -d "$additional_libdir"; then
2057                            dnl Really add $additional_libdir to $LIBNAME.
2058                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
2059                          fi
2060                        fi
2061                        haveit=
2062                        for x in $LDFLAGS $LTLIB[]NAME; do
2063                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2064                          if test "X$x" = "X-L$additional_libdir"; then
2065                            haveit=yes
2066                            break
2067                          fi
2068                        done
2069                        if test -z "$haveit"; then
2070                          if test -d "$additional_libdir"; then
2071                            dnl Really add $additional_libdir to $LTLIBNAME.
2072                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
2073                          fi
2074                        fi
2075                      fi
2076                    fi
2077                    ;;
2078                  -R*)
2079                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
2080                    if test "$enable_rpath" != no; then
2081                      dnl Potentially add DIR to rpathdirs.
2082                      dnl The rpathdirs will be appended to $LIBNAME at the end.
2083                      haveit=
2084                      for x in $rpathdirs; do
2085                        if test "X$x" = "X$dir"; then
2086                          haveit=yes
2087                          break
2088                        fi
2089                      done
2090                      if test -z "$haveit"; then
2091                        rpathdirs="$rpathdirs $dir"
2092                      fi
2093                      dnl Potentially add DIR to ltrpathdirs.
2094                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2095                      haveit=
2096                      for x in $ltrpathdirs; do
2097                        if test "X$x" = "X$dir"; then
2098                          haveit=yes
2099                          break
2100                        fi
2101                      done
2102                      if test -z "$haveit"; then
2103                        ltrpathdirs="$ltrpathdirs $dir"
2104                      fi
2105                    fi
2106                    ;;
2107                  -l*)
2108                    dnl Handle this in the next round.
2109                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
2110                    ;;
2111                  *.la)
2112                    dnl Handle this in the next round. Throw away the .la's
2113                    dnl directory; it is already contained in a preceding -L
2114                    dnl option.
2115                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
2116                    ;;
2117                  *)
2118                    dnl Most likely an immediate library name.
2119                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
2120                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
2121                    ;;
2122                esac
2123              done
2124            fi
2125          else
2126            dnl Didn't find the library; assume it is in the system directories
2127            dnl known to the linker and runtime loader. (All the system
2128            dnl directories known to the linker should also be known to the
2129            dnl runtime loader, otherwise the system is severely misconfigured.)
2130            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2131            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
2132          fi
2133        fi
2134      fi
2135    done
2136  done
2137  if test "X$rpathdirs" != "X"; then
2138    if test -n "$hardcode_libdir_separator"; then
2139      dnl Weird platform: only the last -rpath option counts, the user must
2140      dnl pass all path elements in one option. We can arrange that for a
2141      dnl single library, but not when more than one $LIBNAMEs are used.
2142      alldirs=
2143      for found_dir in $rpathdirs; do
2144        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
2145      done
2146      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
2147      acl_save_libdir="$libdir"
2148      libdir="$alldirs"
2149      eval flag=\"$hardcode_libdir_flag_spec\"
2150      libdir="$acl_save_libdir"
2151      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2152    else
2153      dnl The -rpath options are cumulative.
2154      for found_dir in $rpathdirs; do
2155        acl_save_libdir="$libdir"
2156        libdir="$found_dir"
2157        eval flag=\"$hardcode_libdir_flag_spec\"
2158        libdir="$acl_save_libdir"
2159        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
2160      done
2161    fi
2162  fi
2163  if test "X$ltrpathdirs" != "X"; then
2164    dnl When using libtool, the option that works for both libraries and
2165    dnl executables is -R. The -R options are cumulative.
2166    for found_dir in $ltrpathdirs; do
2167      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
2168    done
2169  fi
2170])
2171
2172dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
2173dnl unless already present in VAR.
2174dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
2175dnl contains two or three consecutive elements that belong together.
2176AC_DEFUN([AC_LIB_APPENDTOVAR],
2177[
2178  for element in [$2]; do
2179    haveit=
2180    for x in $[$1]; do
2181      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2182      if test "X$x" = "X$element"; then
2183        haveit=yes
2184        break
2185      fi
2186    done
2187    if test -z "$haveit"; then
2188      [$1]="${[$1]}${[$1]:+ }$element"
2189    fi
2190  done
2191])
2192
2193# lib-ld.m4 serial 1 (gettext-0.11)
2194dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2195dnl This file is free software, distributed under the terms of the GNU
2196dnl General Public License.  As a special exception to the GNU General
2197dnl Public License, this file may be distributed as part of a program
2198dnl that contains a configuration script generated by Autoconf, under
2199dnl the same distribution terms as the rest of that program.
2200
2201dnl Subroutines of libtool.m4,
2202dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
2203dnl with libtool.m4.
2204
2205dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
2206AC_DEFUN([AC_LIB_PROG_LD_GNU],
2207[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
2208[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
2209if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
2210  acl_cv_prog_gnu_ld=yes
2211else
2212  acl_cv_prog_gnu_ld=no
2213fi])
2214with_gnu_ld=$acl_cv_prog_gnu_ld
2215])
2216
2217dnl From libtool-1.4. Sets the variable LD.
2218AC_DEFUN([AC_LIB_PROG_LD],
2219[AC_ARG_WITH(gnu-ld,
2220[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
2221test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
2222AC_REQUIRE([AC_PROG_CC])dnl
2223AC_REQUIRE([AC_CANONICAL_HOST])dnl
2224ac_prog=ld
2225if test "$GCC" = yes; then
2226  # Check if gcc -print-prog-name=ld gives a path.
2227  AC_MSG_CHECKING([for ld used by GCC])
2228  case $host in
2229  *-*-mingw*)
2230    # gcc leaves a trailing carriage return which upsets mingw
2231    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
2232  *)
2233    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
2234  esac
2235  case $ac_prog in
2236    # Accept absolute paths.
2237    [[\\/]* | [A-Za-z]:[\\/]*)]
2238      [re_direlt='/[^/][^/]*/\.\./']
2239      # Canonicalize the path of ld
2240      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
2241      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
2242	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
2243      done
2244      test -z "$LD" && LD="$ac_prog"
2245      ;;
2246  "")
2247    # If it fails, then pretend we aren't using GCC.
2248    ac_prog=ld
2249    ;;
2250  *)
2251    # If it is relative, then search for the first ld in PATH.
2252    with_gnu_ld=unknown
2253    ;;
2254  esac
2255elif test "$with_gnu_ld" = yes; then
2256  AC_MSG_CHECKING([for GNU ld])
2257else
2258  AC_MSG_CHECKING([for non-GNU ld])
2259fi
2260AC_CACHE_VAL(acl_cv_path_LD,
2261[if test -z "$LD"; then
2262  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
2263  for ac_dir in $PATH; do
2264    test -z "$ac_dir" && ac_dir=.
2265    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
2266      acl_cv_path_LD="$ac_dir/$ac_prog"
2267      # Check to see if the program is GNU ld.  I'd rather use --version,
2268      # but apparently some GNU ld's only accept -v.
2269      # Break only if it was the GNU/non-GNU ld that we prefer.
2270      if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
2271	test "$with_gnu_ld" != no && break
2272      else
2273	test "$with_gnu_ld" != yes && break
2274      fi
2275    fi
2276  done
2277  IFS="$ac_save_ifs"
2278else
2279  acl_cv_path_LD="$LD" # Let the user override the test with a path.
2280fi])
2281LD="$acl_cv_path_LD"
2282if test -n "$LD"; then
2283  AC_MSG_RESULT($LD)
2284else
2285  AC_MSG_RESULT(no)
2286fi
2287test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
2288AC_LIB_PROG_LD_GNU
2289])
2290
2291# iconv.m4 serial AM4 (gettext-0.11.3)
2292dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2293dnl This file is free software, distributed under the terms of the GNU
2294dnl General Public License.  As a special exception to the GNU General
2295dnl Public License, this file may be distributed as part of a program
2296dnl that contains a configuration script generated by Autoconf, under
2297dnl the same distribution terms as the rest of that program.
2298
2299dnl From Bruno Haible.
2300
2301AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
2302[
2303  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
2304  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2305  AC_REQUIRE([AC_LIB_RPATH])
2306
2307  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2308  dnl accordingly.
2309  AC_LIB_LINKFLAGS_BODY([iconv])
2310])
2311
2312AC_DEFUN([AM_ICONV_LINK],
2313[
2314  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
2315  dnl those with the standalone portable GNU libiconv installed).
2316
2317  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
2318  dnl accordingly.
2319  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
2320
2321  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
2322  dnl because if the user has installed libiconv and not disabled its use
2323  dnl via --without-libiconv-prefix, he wants to use it. The first
2324  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
2325  am_save_CPPFLAGS="$CPPFLAGS"
2326  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
2327
2328  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
2329    am_cv_func_iconv="no, consider installing GNU libiconv"
2330    am_cv_lib_iconv=no
2331    AC_TRY_LINK([#include <stdlib.h>
2332#include <iconv.h>],
2333      [iconv_t cd = iconv_open("","");
2334       iconv(cd,NULL,NULL,NULL,NULL);
2335       iconv_close(cd);],
2336      am_cv_func_iconv=yes)
2337    if test "$am_cv_func_iconv" != yes; then
2338      am_save_LIBS="$LIBS"
2339      LIBS="$LIBS $LIBICONV"
2340      AC_TRY_LINK([#include <stdlib.h>
2341#include <iconv.h>],
2342        [iconv_t cd = iconv_open("","");
2343         iconv(cd,NULL,NULL,NULL,NULL);
2344         iconv_close(cd);],
2345        am_cv_lib_iconv=yes
2346        am_cv_func_iconv=yes)
2347      LIBS="$am_save_LIBS"
2348    fi
2349  ])
2350  if test "$am_cv_func_iconv" = yes; then
2351    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
2352  fi
2353  if test "$am_cv_lib_iconv" = yes; then
2354    AC_MSG_CHECKING([how to link with libiconv])
2355    AC_MSG_RESULT([$LIBICONV])
2356  else
2357    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
2358    dnl either.
2359    CPPFLAGS="$am_save_CPPFLAGS"
2360    LIBICONV=
2361    LTLIBICONV=
2362  fi
2363  AC_SUBST(LIBICONV)
2364  AC_SUBST(LTLIBICONV)
2365])
2366
2367AC_DEFUN([AM_ICONV],
2368[
2369  AM_ICONV_LINK
2370  if test "$am_cv_func_iconv" = yes; then
2371    AC_MSG_CHECKING([for iconv declaration])
2372    AC_CACHE_VAL(am_cv_proto_iconv, [
2373      AC_TRY_COMPILE([
2374#include <stdlib.h>
2375#include <iconv.h>
2376extern
2377#ifdef __cplusplus
2378"C"
2379#endif
2380#if defined(__STDC__) || defined(__cplusplus)
2381size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
2382#else
2383size_t iconv();
2384#endif
2385], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
2386      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);"])
2387    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
2388    AC_MSG_RESULT([$]{ac_t:-
2389         }[$]am_cv_proto_iconv)
2390    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
2391      [Define as const if the declaration of iconv() needs const.])
2392  fi
2393])
2394
2395# progtest.m4 serial 2 (gettext-0.10.40)
2396dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
2397dnl This file is free software, distributed under the terms of the GNU
2398dnl General Public License.  As a special exception to the GNU General
2399dnl Public License, this file may be distributed as part of a program
2400dnl that contains a configuration script generated by Autoconf, under
2401dnl the same distribution terms as the rest of that program.
2402dnl
2403dnl This file can can be used in projects which are not available under
2404dnl the GNU General Public License or the GNU Library General Public
2405dnl License but which still want to provide support for the GNU gettext
2406dnl functionality.
2407dnl Please note that the actual code of the GNU gettext library is covered
2408dnl by the GNU Library General Public License, and the rest of the GNU
2409dnl gettext package package is covered by the GNU General Public License.
2410dnl They are *not* in the public domain.
2411
2412dnl Authors:
2413dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2414
2415# Search path for a program which passes the given test.
2416
2417dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2418dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2419AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2420[# Extract the first word of "$2", so it can be a program name with args.
2421set dummy $2; ac_word=[$]2
2422AC_MSG_CHECKING([for $ac_word])
2423AC_CACHE_VAL(ac_cv_path_$1,
2424[case "[$]$1" in
2425  /*)
2426  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2427  ;;
2428  *)
2429  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
2430  for ac_dir in ifelse([$5], , $PATH, [$5]); do
2431    test -z "$ac_dir" && ac_dir=.
2432    if test -f $ac_dir/$ac_word; then
2433      if [$3]; then
2434	ac_cv_path_$1="$ac_dir/$ac_word"
2435	break
2436      fi
2437    fi
2438  done
2439  IFS="$ac_save_ifs"
2440dnl If no 4th arg is given, leave the cache variable unset,
2441dnl so AC_PATH_PROGS will keep looking.
2442ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2443])dnl
2444  ;;
2445esac])dnl
2446$1="$ac_cv_path_$1"
2447if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2448  AC_MSG_RESULT([$]$1)
2449else
2450  AC_MSG_RESULT(no)
2451fi
2452AC_SUBST($1)dnl
2453])
2454
2455# isc-posix.m4 serial 2 (gettext-0.11.2)
2456dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2457dnl This file is free software, distributed under the terms of the GNU
2458dnl General Public License.  As a special exception to the GNU General
2459dnl Public License, this file may be distributed as part of a program
2460dnl that contains a configuration script generated by Autoconf, under
2461dnl the same distribution terms as the rest of that program.
2462
2463# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
2464
2465# This test replaces the one in autoconf.
2466# Currently this macro should have the same name as the autoconf macro
2467# because gettext's gettext.m4 (distributed in the automake package)
2468# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
2469# give these diagnostics:
2470#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
2471#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
2472
2473undefine([AC_ISC_POSIX])
2474
2475AC_DEFUN([AC_ISC_POSIX],
2476  [
2477    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
2478    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
2479  ]
2480)
2481
2482# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
2483dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2484dnl This file is free software, distributed under the terms of the GNU
2485dnl General Public License.  As a special exception to the GNU General
2486dnl Public License, this file may be distributed as part of a program
2487dnl that contains a configuration script generated by Autoconf, under
2488dnl the same distribution terms as the rest of that program.
2489
2490# Test for the GNU C Library, version 2.1 or newer.
2491# From Bruno Haible.
2492
2493AC_DEFUN([jm_GLIBC21],
2494  [
2495    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
2496      ac_cv_gnu_library_2_1,
2497      [AC_EGREP_CPP([Lucky GNU user],
2498	[
2499#include <features.h>
2500#ifdef __GNU_LIBRARY__
2501 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
2502  Lucky GNU user
2503 #endif
2504#endif
2505	],
2506	ac_cv_gnu_library_2_1=yes,
2507	ac_cv_gnu_library_2_1=no)
2508      ]
2509    )
2510    AC_SUBST(GLIBC21)
2511    GLIBC21="$ac_cv_gnu_library_2_1"
2512  ]
2513)
2514
2515# intdiv0.m4 serial 1 (gettext-0.11.3)
2516dnl Copyright (C) 2002 Free Software Foundation, Inc.
2517dnl This file is free software, distributed under the terms of the GNU
2518dnl General Public License.  As a special exception to the GNU General
2519dnl Public License, this file may be distributed as part of a program
2520dnl that contains a configuration script generated by Autoconf, under
2521dnl the same distribution terms as the rest of that program.
2522
2523dnl From Bruno Haible.
2524
2525AC_DEFUN([gt_INTDIV0],
2526[
2527  AC_REQUIRE([AC_PROG_CC])dnl
2528  AC_REQUIRE([AC_CANONICAL_HOST])dnl
2529
2530  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
2531    gt_cv_int_divbyzero_sigfpe,
2532    [
2533      AC_TRY_RUN([
2534#include <stdlib.h>
2535#include <signal.h>
2536
2537static void
2538#ifdef __cplusplus
2539sigfpe_handler (int sig)
2540#else
2541sigfpe_handler (sig) int sig;
2542#endif
2543{
2544  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
2545  exit (sig != SIGFPE);
2546}
2547
2548int x = 1;
2549int y = 0;
2550int z;
2551int nan;
2552
2553int main ()
2554{
2555  signal (SIGFPE, sigfpe_handler);
2556/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
2557#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
2558  signal (SIGTRAP, sigfpe_handler);
2559#endif
2560/* Linux/SPARC yields signal SIGILL.  */
2561#if defined (__sparc__) && defined (__linux__)
2562  signal (SIGILL, sigfpe_handler);
2563#endif
2564
2565  z = x / y;
2566  nan = y / y;
2567  exit (1);
2568}
2569], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
2570        [
2571          # Guess based on the CPU.
2572          case "$host_cpu" in
2573            alpha* | i[34567]86 | m68k | s390*)
2574              gt_cv_int_divbyzero_sigfpe="guessing yes";;
2575            *)
2576              gt_cv_int_divbyzero_sigfpe="guessing no";;
2577          esac
2578        ])
2579    ])
2580  case "$gt_cv_int_divbyzero_sigfpe" in
2581    *yes) value=1;;
2582    *) value=0;;
2583  esac
2584  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
2585    [Define if integer division by zero raises signal SIGFPE.])
2586])
2587
2588# uintmax_t.m4 serial 6 (gettext-0.11)
2589dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2590dnl This file is free software, distributed under the terms of the GNU
2591dnl General Public License.  As a special exception to the GNU General
2592dnl Public License, this file may be distributed as part of a program
2593dnl that contains a configuration script generated by Autoconf, under
2594dnl the same distribution terms as the rest of that program.
2595
2596dnl From Paul Eggert.
2597
2598AC_PREREQ(2.13)
2599
2600# Define uintmax_t to `unsigned long' or `unsigned long long'
2601# if <inttypes.h> does not exist.
2602
2603AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2604[
2605  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2606  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2607  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2608    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2609    test $ac_cv_type_unsigned_long_long = yes \
2610      && ac_type='unsigned long long' \
2611      || ac_type='unsigned long'
2612    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2613  [Define to unsigned long or unsigned long long
2614   if <inttypes.h> and <stdint.h> don't define.])
2615  fi
2616])
2617
2618# inttypes_h.m4 serial 4 (gettext-0.11.4)
2619dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2620dnl This file is free software, distributed under the terms of the GNU
2621dnl General Public License.  As a special exception to the GNU General
2622dnl Public License, this file may be distributed as part of a program
2623dnl that contains a configuration script generated by Autoconf, under
2624dnl the same distribution terms as the rest of that program.
2625
2626dnl From Paul Eggert.
2627
2628# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2629# doesn't clash with <sys/types.h>, and declares uintmax_t.
2630
2631AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2632[
2633  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2634  [AC_TRY_COMPILE(
2635    [#include <sys/types.h>
2636#include <inttypes.h>],
2637    [uintmax_t i = (uintmax_t) -1;],
2638    jm_ac_cv_header_inttypes_h=yes,
2639    jm_ac_cv_header_inttypes_h=no)])
2640  if test $jm_ac_cv_header_inttypes_h = yes; then
2641    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2642[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2643   and declares uintmax_t. ])
2644  fi
2645])
2646
2647# stdint_h.m4 serial 2 (gettext-0.11.4)
2648dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2649dnl This file is free software, distributed under the terms of the GNU
2650dnl General Public License.  As a special exception to the GNU General
2651dnl Public License, this file may be distributed as part of a program
2652dnl that contains a configuration script generated by Autoconf, under
2653dnl the same distribution terms as the rest of that program.
2654
2655dnl From Paul Eggert.
2656
2657# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2658# doesn't clash with <sys/types.h>, and declares uintmax_t.
2659
2660AC_DEFUN([jm_AC_HEADER_STDINT_H],
2661[
2662  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2663  [AC_TRY_COMPILE(
2664    [#include <sys/types.h>
2665#include <stdint.h>],
2666    [uintmax_t i = (uintmax_t) -1;],
2667    jm_ac_cv_header_stdint_h=yes,
2668    jm_ac_cv_header_stdint_h=no)])
2669  if test $jm_ac_cv_header_stdint_h = yes; then
2670    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2671[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2672   and declares uintmax_t. ])
2673  fi
2674])
2675
2676# ulonglong.m4 serial 2 (fileutils-4.0.32, gettext-0.10.40)
2677dnl Copyright (C) 1999-2002 Free Software Foundation, Inc.
2678dnl This file is free software, distributed under the terms of the GNU
2679dnl General Public License.  As a special exception to the GNU General
2680dnl Public License, this file may be distributed as part of a program
2681dnl that contains a configuration script generated by Autoconf, under
2682dnl the same distribution terms as the rest of that program.
2683
2684dnl From Paul Eggert.
2685
2686AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2687[
2688  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2689  [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2690    [unsigned long long ullmax = (unsigned long long) -1;
2691     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2692    ac_cv_type_unsigned_long_long=yes,
2693    ac_cv_type_unsigned_long_long=no)])
2694  if test $ac_cv_type_unsigned_long_long = yes; then
2695    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2696      [Define if you have the unsigned long long type.])
2697  fi
2698])
2699
2700# inttypes.m4 serial 1 (gettext-0.11.4)
2701dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2702dnl This file is free software, distributed under the terms of the GNU
2703dnl General Public License.  As a special exception to the GNU General
2704dnl Public License, this file may be distributed as part of a program
2705dnl that contains a configuration script generated by Autoconf, under
2706dnl the same distribution terms as the rest of that program.
2707
2708dnl From Paul Eggert.
2709
2710# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
2711# <sys/types.h>.
2712
2713AC_DEFUN([gt_HEADER_INTTYPES_H],
2714[
2715  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
2716  [
2717    AC_TRY_COMPILE(
2718      [#include <sys/types.h>
2719#include <inttypes.h>],
2720      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
2721  ])
2722  if test $gt_cv_header_inttypes_h = yes; then
2723    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
2724      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
2725  fi
2726])
2727
2728# inttypes-pri.m4 serial 1 (gettext-0.11.4)
2729dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
2730dnl This file is free software, distributed under the terms of the GNU
2731dnl General Public License.  As a special exception to the GNU General
2732dnl Public License, this file may be distributed as part of a program
2733dnl that contains a configuration script generated by Autoconf, under
2734dnl the same distribution terms as the rest of that program.
2735
2736dnl From Bruno Haible.
2737
2738# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
2739# macros to non-string values.  This is the case on AIX 4.3.3.
2740
2741AC_DEFUN([gt_INTTYPES_PRI],
2742[
2743  AC_REQUIRE([gt_HEADER_INTTYPES_H])
2744  if test $gt_cv_header_inttypes_h = yes; then
2745    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
2746      gt_cv_inttypes_pri_broken,
2747      [
2748        AC_TRY_COMPILE([#include <inttypes.h>
2749#ifdef PRId32
2750char *p = PRId32;
2751#endif
2752], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
2753      ])
2754  fi
2755  if test "$gt_cv_inttypes_pri_broken" = yes; then
2756    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
2757      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
2758  fi
2759])
2760
2761# codeset.m4 serial AM1 (gettext-0.10.40)
2762dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
2763dnl This file is free software, distributed under the terms of the GNU
2764dnl General Public License.  As a special exception to the GNU General
2765dnl Public License, this file may be distributed as part of a program
2766dnl that contains a configuration script generated by Autoconf, under
2767dnl the same distribution terms as the rest of that program.
2768
2769dnl From Bruno Haible.
2770
2771AC_DEFUN([AM_LANGINFO_CODESET],
2772[
2773  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
2774    [AC_TRY_LINK([#include <langinfo.h>],
2775      [char* cs = nl_langinfo(CODESET);],
2776      am_cv_langinfo_codeset=yes,
2777      am_cv_langinfo_codeset=no)
2778    ])
2779  if test $am_cv_langinfo_codeset = yes; then
2780    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
2781      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
2782  fi
2783])
2784
2785# lcmessage.m4 serial 3 (gettext-0.11.3)
2786dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
2787dnl This file is free software, distributed under the terms of the GNU
2788dnl General Public License.  As a special exception to the GNU General
2789dnl Public License, this file may be distributed as part of a program
2790dnl that contains a configuration script generated by Autoconf, under
2791dnl the same distribution terms as the rest of that program.
2792dnl
2793dnl This file can can be used in projects which are not available under
2794dnl the GNU General Public License or the GNU Library General Public
2795dnl License but which still want to provide support for the GNU gettext
2796dnl functionality.
2797dnl Please note that the actual code of the GNU gettext library is covered
2798dnl by the GNU Library General Public License, and the rest of the GNU
2799dnl gettext package package is covered by the GNU General Public License.
2800dnl They are *not* in the public domain.
2801
2802dnl Authors:
2803dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
2804
2805# Check whether LC_MESSAGES is available in <locale.h>.
2806
2807AC_DEFUN([AM_LC_MESSAGES],
2808[
2809  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
2810    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
2811       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
2812  if test $am_cv_val_LC_MESSAGES = yes; then
2813    AC_DEFINE(HAVE_LC_MESSAGES, 1,
2814      [Define if your <locale.h> file defines LC_MESSAGES.])
2815  fi
2816])
2817
2818