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# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
837
838# Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
839
840# This program is free software; you can redistribute it and/or modify
841# it under the terms of the GNU General Public License as published by
842# the Free Software Foundation; either version 2, or (at your option)
843# any later version.
844
845# This program is distributed in the hope that it will be useful,
846# but WITHOUT ANY WARRANTY; without even the implied warranty of
847# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
848# GNU General Public License for more details.
849
850# You should have received a copy of the GNU General Public License
851# along with this program; if not, write to the Free Software
852# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
853# 02111-1307, USA.
854
855AC_PREREQ([2.52])
856
857# serial 6
858
859# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
860AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
861
862# Add --enable-maintainer-mode option to configure.
863# From Jim Meyering
864
865# Copyright 1996, 1998, 2000, 2001, 2002  Free Software Foundation, Inc.
866
867# This program is free software; you can redistribute it and/or modify
868# it under the terms of the GNU General Public License as published by
869# the Free Software Foundation; either version 2, or (at your option)
870# any later version.
871
872# This program is distributed in the hope that it will be useful,
873# but WITHOUT ANY WARRANTY; without even the implied warranty of
874# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
875# GNU General Public License for more details.
876
877# You should have received a copy of the GNU General Public License
878# along with this program; if not, write to the Free Software
879# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
880# 02111-1307, USA.
881
882# serial 2
883
884AC_DEFUN([AM_MAINTAINER_MODE],
885[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
886  dnl maintainer-mode is disabled by default
887  AC_ARG_ENABLE(maintainer-mode,
888[  --enable-maintainer-mode enable make rules and dependencies not useful
889                          (and sometimes confusing) to the casual installer],
890      USE_MAINTAINER_MODE=$enableval,
891      USE_MAINTAINER_MODE=no)
892  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
893  AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
894  MAINT=$MAINTAINER_MODE_TRUE
895  AC_SUBST(MAINT)dnl
896]
897)
898
899AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
900
901# isc-posix.m4 serial 2 (gettext-0.11.2)
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.
908
909# This file is not needed with autoconf-2.53 and newer.  Remove it in 2005.
910
911# This test replaces the one in autoconf.
912# Currently this macro should have the same name as the autoconf macro
913# because gettext's gettext.m4 (distributed in the automake package)
914# still uses it.  Otherwise, the use in gettext.m4 makes autoheader
915# give these diagnostics:
916#   configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
917#   configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
918
919undefine([AC_ISC_POSIX])
920
921AC_DEFUN([AC_ISC_POSIX],
922  [
923    dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
924    AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
925  ]
926)
927
928
929# Copyright 1996, 1997, 1999, 2000, 2001, 2002  Free Software Foundation, Inc.
930
931# This program is free software; you can redistribute it and/or modify
932# it under the terms of the GNU General Public License as published by
933# the Free Software Foundation; either version 2, or (at your option)
934# any later version.
935
936# This program is distributed in the hope that it will be useful,
937# but WITHOUT ANY WARRANTY; without even the implied warranty of
938# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
939# GNU General Public License for more details.
940
941# You should have received a copy of the GNU General Public License
942# along with this program; if not, write to the Free Software
943# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
944# 02111-1307, USA.
945
946# serial 2
947
948# @defmac AC_PROG_CC_STDC
949# @maindex PROG_CC_STDC
950# @ovindex CC
951# If the C compiler in not in ANSI C mode by default, try to add an option
952# to output variable @code{CC} to make it so.  This macro tries various
953# options that select ANSI C on some system or another.  It considers the
954# compiler to be in ANSI C mode if it handles function prototypes correctly.
955#
956# If you use this macro, you should check after calling it whether the C
957# compiler has been set to accept ANSI C; if not, the shell variable
958# @code{am_cv_prog_cc_stdc} is set to @samp{no}.  If you wrote your source
959# code in ANSI C, you can make an un-ANSIfied copy of it by using the
960# program @code{ansi2knr}, which comes with Ghostscript.
961# @end defmac
962
963AC_DEFUN([AM_PROG_CC_STDC],
964[AC_REQUIRE([AC_PROG_CC])
965AC_BEFORE([$0], [AC_C_INLINE])
966AC_BEFORE([$0], [AC_C_CONST])
967dnl Force this before AC_PROG_CPP.  Some cpp's, eg on HPUX, require
968dnl a magic option to avoid problems with ANSI preprocessor commands
969dnl like #elif.
970dnl FIXME: can't do this because then AC_AIX won't work due to a
971dnl circular dependency.
972dnl AC_BEFORE([$0], [AC_PROG_CPP])
973AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
974AC_CACHE_VAL(am_cv_prog_cc_stdc,
975[am_cv_prog_cc_stdc=no
976ac_save_CC="$CC"
977# Don't try gcc -ansi; that turns off useful extensions and
978# breaks some systems' header files.
979# AIX			-qlanglvl=ansi
980# Ultrix and OSF/1	-std1
981# HP-UX 10.20 and later	-Ae
982# HP-UX older versions	-Aa -D_HPUX_SOURCE
983# SVR4			-Xc -D__EXTENSIONS__
984for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
985do
986  CC="$ac_save_CC $ac_arg"
987  AC_TRY_COMPILE(
988[#include <stdarg.h>
989#include <stdio.h>
990#include <sys/types.h>
991#include <sys/stat.h>
992/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
993struct buf { int x; };
994FILE * (*rcsopen) (struct buf *, struct stat *, int);
995static char *e (p, i)
996     char **p;
997     int i;
998{
999  return p[i];
1000}
1001static char *f (char * (*g) (char **, int), char **p, ...)
1002{
1003  char *s;
1004  va_list v;
1005  va_start (v,p);
1006  s = g (p, va_arg (v,int));
1007  va_end (v);
1008  return s;
1009}
1010int test (int i, double x);
1011struct s1 {int (*f) (int a);};
1012struct s2 {int (*f) (double a);};
1013int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1014int argc;
1015char **argv;
1016], [
1017return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1018],
1019[am_cv_prog_cc_stdc="$ac_arg"; break])
1020done
1021CC="$ac_save_CC"
1022])
1023if test -z "$am_cv_prog_cc_stdc"; then
1024  AC_MSG_RESULT([none needed])
1025else
1026  AC_MSG_RESULT([$am_cv_prog_cc_stdc])
1027fi
1028case "x$am_cv_prog_cc_stdc" in
1029  x|xno) ;;
1030  *) CC="$CC $am_cv_prog_cc_stdc" ;;
1031esac
1032])
1033
1034AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
1035
1036# Configure paths for GLIB
1037# Owen Taylor     1997-2001
1038
1039dnl AM_PATH_GLIB_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1040dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if gmodule, gobject or
1041dnl gthread is specified in MODULES, pass to pkg-config
1042dnl
1043AC_DEFUN(AM_PATH_GLIB_2_0,
1044[dnl
1045dnl Get the cflags and libraries from pkg-config
1046dnl
1047AC_ARG_ENABLE(glibtest, [  --disable-glibtest      do not try to compile and run a test GLIB program],
1048		    , enable_glibtest=yes)
1049
1050  pkg_config_args=glib-2.0
1051  for module in . $4
1052  do
1053      case "$module" in
1054         gmodule)
1055             pkg_config_args="$pkg_config_args gmodule-2.0"
1056         ;;
1057         gobject)
1058             pkg_config_args="$pkg_config_args gobject-2.0"
1059         ;;
1060         gthread)
1061             pkg_config_args="$pkg_config_args gthread-2.0"
1062         ;;
1063      esac
1064  done
1065
1066  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1067
1068  no_glib=""
1069
1070  if test x$PKG_CONFIG != xno ; then
1071    if $PKG_CONFIG --atleast-pkgconfig-version 0.7 ; then
1072      :
1073    else
1074      echo *** pkg-config too old; version 0.7 or better required.
1075      no_glib=yes
1076      PKG_CONFIG=no
1077    fi
1078  else
1079    no_glib=yes
1080  fi
1081
1082  min_glib_version=ifelse([$1], ,2.0.0,$1)
1083  AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
1084
1085  if test x$PKG_CONFIG != xno ; then
1086    ## don't try to run the test against uninstalled libtool libs
1087    if $PKG_CONFIG --uninstalled $pkg_config_args; then
1088	  echo "Will use uninstalled version of GLib found in PKG_CONFIG_PATH"
1089	  enable_glibtest=no
1090    fi
1091
1092    if $PKG_CONFIG --atleast-version $min_glib_version $pkg_config_args; then
1093	  :
1094    else
1095	  no_glib=yes
1096    fi
1097  fi
1098
1099  if test x"$no_glib" = x ; then
1100    GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
1101    GOBJECT_QUERY=`$PKG_CONFIG --variable=gobject_query glib-2.0`
1102    GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
1103
1104    GLIB_CFLAGS=`$PKG_CONFIG --cflags $pkg_config_args`
1105    GLIB_LIBS=`$PKG_CONFIG --libs $pkg_config_args`
1106    glib_config_major_version=`$PKG_CONFIG --modversion glib-2.0 | \
1107           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1108    glib_config_minor_version=`$PKG_CONFIG --modversion glib-2.0 | \
1109           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1110    glib_config_micro_version=`$PKG_CONFIG --modversion glib-2.0 | \
1111           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1112    if test "x$enable_glibtest" = "xyes" ; then
1113      ac_save_CFLAGS="$CFLAGS"
1114      ac_save_LIBS="$LIBS"
1115      CFLAGS="$CFLAGS $GLIB_CFLAGS"
1116      LIBS="$GLIB_LIBS $LIBS"
1117dnl
1118dnl Now check if the installed GLIB is sufficiently new. (Also sanity
1119dnl checks the results of pkg-config to some extent)
1120dnl
1121      rm -f conf.glibtest
1122      AC_TRY_RUN([
1123#include <glib.h>
1124#include <stdio.h>
1125#include <stdlib.h>
1126
1127int
1128main ()
1129{
1130  int major, minor, micro;
1131  char *tmp_version;
1132
1133  system ("touch conf.glibtest");
1134
1135  /* HP/UX 9 (%@#!) writes to sscanf strings */
1136  tmp_version = g_strdup("$min_glib_version");
1137  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1138     printf("%s, bad version string\n", "$min_glib_version");
1139     exit(1);
1140   }
1141
1142  if ((glib_major_version != $glib_config_major_version) ||
1143      (glib_minor_version != $glib_config_minor_version) ||
1144      (glib_micro_version != $glib_config_micro_version))
1145    {
1146      printf("\n*** 'pkg-config --modversion glib-2.0' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
1147             $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
1148             glib_major_version, glib_minor_version, glib_micro_version);
1149      printf ("*** was found! If pkg-config was correct, then it is best\n");
1150      printf ("*** to remove the old version of GLib. You may also be able to fix the error\n");
1151      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1152      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1153      printf("*** required on your system.\n");
1154      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
1155      printf("*** to point to the correct configuration files\n");
1156    }
1157  else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
1158	   (glib_minor_version != GLIB_MINOR_VERSION) ||
1159           (glib_micro_version != GLIB_MICRO_VERSION))
1160    {
1161      printf("*** GLIB header files (version %d.%d.%d) do not match\n",
1162	     GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
1163      printf("*** library (version %d.%d.%d)\n",
1164	     glib_major_version, glib_minor_version, glib_micro_version);
1165    }
1166  else
1167    {
1168      if ((glib_major_version > major) ||
1169        ((glib_major_version == major) && (glib_minor_version > minor)) ||
1170        ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
1171      {
1172        return 0;
1173       }
1174     else
1175      {
1176        printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
1177               glib_major_version, glib_minor_version, glib_micro_version);
1178        printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
1179	       major, minor, micro);
1180        printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
1181        printf("***\n");
1182        printf("*** If you have already installed a sufficiently new version, this error\n");
1183        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
1184        printf("*** being found. The easiest way to fix this is to remove the old version\n");
1185        printf("*** of GLIB, but you can also set the PKG_CONFIG environment to point to the\n");
1186        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
1187        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1188        printf("*** so that the correct libraries are found at run-time))\n");
1189      }
1190    }
1191  return 1;
1192}
1193],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1194       CFLAGS="$ac_save_CFLAGS"
1195       LIBS="$ac_save_LIBS"
1196     fi
1197  fi
1198  if test "x$no_glib" = x ; then
1199     AC_MSG_RESULT(yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version))
1200     ifelse([$2], , :, [$2])
1201  else
1202     AC_MSG_RESULT(no)
1203     if test "$PKG_CONFIG" = "no" ; then
1204       echo "*** A new enough version of pkg-config was not found."
1205       echo "*** See http://www.freedesktop.org/software/pkgconfig/"
1206     else
1207       if test -f conf.glibtest ; then
1208        :
1209       else
1210          echo "*** Could not run GLIB test program, checking why..."
1211          ac_save_CFLAGS="$CFLAGS"
1212          ac_save_LIBS="$LIBS"
1213          CFLAGS="$CFLAGS $GLIB_CFLAGS"
1214          LIBS="$LIBS $GLIB_LIBS"
1215          AC_TRY_LINK([
1216#include <glib.h>
1217#include <stdio.h>
1218],      [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
1219        [ echo "*** The test program compiled, but did not run. This usually means"
1220          echo "*** that the run-time linker is not finding GLIB or finding the wrong"
1221          echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
1222          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1223          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1224          echo "*** is required on your system"
1225	  echo "***"
1226          echo "*** If you have an old version installed, it is best to remove it, although"
1227          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1228        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1229          echo "*** exact error that occured. This usually means GLIB is incorrectly installed."])
1230          CFLAGS="$ac_save_CFLAGS"
1231          LIBS="$ac_save_LIBS"
1232       fi
1233     fi
1234     GLIB_CFLAGS=""
1235     GLIB_LIBS=""
1236     GLIB_GENMARSHAL=""
1237     GOBJECT_QUERY=""
1238     GLIB_MKENUMS=""
1239     ifelse([$3], , :, [$3])
1240  fi
1241  AC_SUBST(GLIB_CFLAGS)
1242  AC_SUBST(GLIB_LIBS)
1243  AC_SUBST(GLIB_GENMARSHAL)
1244  AC_SUBST(GOBJECT_QUERY)
1245  AC_SUBST(GLIB_MKENUMS)
1246  rm -f conf.glibtest
1247])
1248
1249# Configure paths for GTK+
1250# Owen Taylor     1997-2001
1251
1252dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
1253dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
1254dnl pass to pkg-config
1255dnl
1256AC_DEFUN(AM_PATH_GTK_2_0,
1257[dnl
1258dnl Get the cflags and libraries from pkg-config
1259dnl
1260AC_ARG_ENABLE(gtktest, [  --disable-gtktest       do not try to compile and run a test GTK+ program],
1261		    , enable_gtktest=yes)
1262
1263  pkg_config_args=gtk+-2.0
1264  for module in . $4
1265  do
1266      case "$module" in
1267         gthread)
1268             pkg_config_args="$pkg_config_args gthread-2.0"
1269         ;;
1270      esac
1271  done
1272
1273  no_gtk=""
1274
1275  AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1276
1277  if test x$PKG_CONFIG != xno ; then
1278    if pkg-config --atleast-pkgconfig-version 0.7 ; then
1279      :
1280    else
1281      echo *** pkg-config too old; version 0.7 or better required.
1282      no_gtk=yes
1283      PKG_CONFIG=no
1284    fi
1285  else
1286    no_gtk=yes
1287  fi
1288
1289  min_gtk_version=ifelse([$1], ,2.0.0,$1)
1290  AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
1291
1292  if test x$PKG_CONFIG != xno ; then
1293    ## don't try to run the test against uninstalled libtool libs
1294    if $PKG_CONFIG --uninstalled $pkg_config_args; then
1295	  echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
1296	  enable_gtktest=no
1297    fi
1298
1299    if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
1300	  :
1301    else
1302	  no_gtk=yes
1303    fi
1304  fi
1305
1306  if test x"$no_gtk" = x ; then
1307    GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
1308    GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
1309    gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1310           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
1311    gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1312           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
1313    gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
1314           sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
1315    if test "x$enable_gtktest" = "xyes" ; then
1316      ac_save_CFLAGS="$CFLAGS"
1317      ac_save_LIBS="$LIBS"
1318      CFLAGS="$CFLAGS $GTK_CFLAGS"
1319      LIBS="$GTK_LIBS $LIBS"
1320dnl
1321dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
1322dnl checks the results of pkg-config to some extent)
1323dnl
1324      rm -f conf.gtktest
1325      AC_TRY_RUN([
1326#include <gtk/gtk.h>
1327#include <stdio.h>
1328#include <stdlib.h>
1329
1330int
1331main ()
1332{
1333  int major, minor, micro;
1334  char *tmp_version;
1335
1336  system ("touch conf.gtktest");
1337
1338  /* HP/UX 9 (%@#!) writes to sscanf strings */
1339  tmp_version = g_strdup("$min_gtk_version");
1340  if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
1341     printf("%s, bad version string\n", "$min_gtk_version");
1342     exit(1);
1343   }
1344
1345  if ((gtk_major_version != $gtk_config_major_version) ||
1346      (gtk_minor_version != $gtk_config_minor_version) ||
1347      (gtk_micro_version != $gtk_config_micro_version))
1348    {
1349      printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
1350             $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
1351             gtk_major_version, gtk_minor_version, gtk_micro_version);
1352      printf ("*** was found! If pkg-config was correct, then it is best\n");
1353      printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
1354      printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
1355      printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
1356      printf("*** required on your system.\n");
1357      printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
1358      printf("*** to point to the correct configuration files\n");
1359    }
1360  else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
1361	   (gtk_minor_version != GTK_MINOR_VERSION) ||
1362           (gtk_micro_version != GTK_MICRO_VERSION))
1363    {
1364      printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
1365	     GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
1366      printf("*** library (version %d.%d.%d)\n",
1367	     gtk_major_version, gtk_minor_version, gtk_micro_version);
1368    }
1369  else
1370    {
1371      if ((gtk_major_version > major) ||
1372        ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
1373        ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
1374      {
1375        return 0;
1376       }
1377     else
1378      {
1379        printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
1380               gtk_major_version, gtk_minor_version, gtk_micro_version);
1381        printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
1382	       major, minor, micro);
1383        printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
1384        printf("***\n");
1385        printf("*** If you have already installed a sufficiently new version, this error\n");
1386        printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
1387        printf("*** being found. The easiest way to fix this is to remove the old version\n");
1388        printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
1389        printf("*** correct copy of pkg-config. (In this case, you will have to\n");
1390        printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
1391        printf("*** so that the correct libraries are found at run-time))\n");
1392      }
1393    }
1394  return 1;
1395}
1396],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
1397       CFLAGS="$ac_save_CFLAGS"
1398       LIBS="$ac_save_LIBS"
1399     fi
1400  fi
1401  if test "x$no_gtk" = x ; then
1402     AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
1403     ifelse([$2], , :, [$2])
1404  else
1405     AC_MSG_RESULT(no)
1406     if test "$PKG_CONFIG" = "no" ; then
1407       echo "*** A new enough version of pkg-config was not found."
1408       echo "*** See http://pkgconfig.sourceforge.net"
1409     else
1410       if test -f conf.gtktest ; then
1411        :
1412       else
1413          echo "*** Could not run GTK+ test program, checking why..."
1414	  ac_save_CFLAGS="$CFLAGS"
1415	  ac_save_LIBS="$LIBS"
1416          CFLAGS="$CFLAGS $GTK_CFLAGS"
1417          LIBS="$LIBS $GTK_LIBS"
1418          AC_TRY_LINK([
1419#include <gtk/gtk.h>
1420#include <stdio.h>
1421],      [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
1422        [ echo "*** The test program compiled, but did not run. This usually means"
1423          echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
1424          echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
1425          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
1426          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
1427          echo "*** is required on your system"
1428	  echo "***"
1429          echo "*** If you have an old version installed, it is best to remove it, although"
1430          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
1431        [ echo "*** The test program failed to compile or link. See the file config.log for the"
1432          echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
1433          CFLAGS="$ac_save_CFLAGS"
1434          LIBS="$ac_save_LIBS"
1435       fi
1436     fi
1437     GTK_CFLAGS=""
1438     GTK_LIBS=""
1439     ifelse([$3], , :, [$3])
1440  fi
1441  AC_SUBST(GTK_CFLAGS)
1442  AC_SUBST(GTK_LIBS)
1443  rm -f conf.gtktest
1444])
1445
1446# gettext.m4 serial 28 (gettext-0.13)
1447dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1448dnl This file is free software, distributed under the terms of the GNU
1449dnl General Public License.  As a special exception to the GNU General
1450dnl Public License, this file may be distributed as part of a program
1451dnl that contains a configuration script generated by Autoconf, under
1452dnl the same distribution terms as the rest of that program.
1453dnl
1454dnl This file can can be used in projects which are not available under
1455dnl the GNU General Public License or the GNU Library General Public
1456dnl License but which still want to provide support for the GNU gettext
1457dnl functionality.
1458dnl Please note that the actual code of the GNU gettext library is covered
1459dnl by the GNU Library General Public License, and the rest of the GNU
1460dnl gettext package package is covered by the GNU General Public License.
1461dnl They are *not* in the public domain.
1462
1463dnl Authors:
1464dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1465dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1466
1467dnl Macro to add for using GNU gettext.
1468
1469dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
1470dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
1471dnl    default (if it is not specified or empty) is 'no-libtool'.
1472dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
1473dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
1474dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
1475dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
1476dnl    depending on --{enable,disable}-{shared,static} and on the presence of
1477dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
1478dnl    $(top_builddir)/intl/libintl.a will be created.
1479dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
1480dnl    implementations (in libc or libintl) without the ngettext() function
1481dnl    will be ignored.  If NEEDSYMBOL is specified and is
1482dnl    'need-formatstring-macros', then GNU gettext implementations that don't
1483dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
1484dnl INTLDIR is used to find the intl libraries.  If empty,
1485dnl    the value `$(top_builddir)/intl/' is used.
1486dnl
1487dnl The result of the configuration is one of three cases:
1488dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
1489dnl    and used.
1490dnl    Catalog format: GNU --> install in $(datadir)
1491dnl    Catalog extension: .mo after installation, .gmo in source tree
1492dnl 2) GNU gettext has been found in the system's C library.
1493dnl    Catalog format: GNU --> install in $(datadir)
1494dnl    Catalog extension: .mo after installation, .gmo in source tree
1495dnl 3) No internationalization, always use English msgid.
1496dnl    Catalog format: none
1497dnl    Catalog extension: none
1498dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
1499dnl The use of .gmo is historical (it was needed to avoid overwriting the
1500dnl GNU format catalogs when building on a platform with an X/Open gettext),
1501dnl but we keep it in order not to force irrelevant filename changes on the
1502dnl maintainers.
1503dnl
1504AC_DEFUN([AM_GNU_GETTEXT],
1505[
1506  dnl Argument checking.
1507  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
1508    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
1509])])])])])
1510  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
1511    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
1512])])])])
1513  define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
1514  define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
1515
1516  AC_REQUIRE([AM_PO_SUBDIRS])dnl
1517  ifelse(gt_included_intl, yes, [
1518    AC_REQUIRE([AM_INTL_SUBDIR])dnl
1519  ])
1520
1521  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
1522  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
1523  AC_REQUIRE([AC_LIB_RPATH])
1524
1525  dnl Sometimes libintl requires libiconv, so first search for libiconv.
1526  dnl Ideally we would do this search only after the
1527  dnl      if test "$USE_NLS" = "yes"; then
1528  dnl        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1529  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
1530  dnl the configure script would need to contain the same shell code
1531  dnl again, outside any 'if'. There are two solutions:
1532  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
1533  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
1534  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
1535  dnl documented, we avoid it.
1536  ifelse(gt_included_intl, yes, , [
1537    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
1538  ])
1539
1540  dnl Set USE_NLS.
1541  AM_NLS
1542
1543  ifelse(gt_included_intl, yes, [
1544    BUILD_INCLUDED_LIBINTL=no
1545    USE_INCLUDED_LIBINTL=no
1546  ])
1547  LIBINTL=
1548  LTLIBINTL=
1549  POSUB=
1550
1551  dnl If we use NLS figure out what method
1552  if test "$USE_NLS" = "yes"; then
1553    gt_use_preinstalled_gnugettext=no
1554    ifelse(gt_included_intl, yes, [
1555      AC_MSG_CHECKING([whether included gettext is requested])
1556      AC_ARG_WITH(included-gettext,
1557        [  --with-included-gettext use the GNU gettext library included here],
1558        nls_cv_force_use_gnu_gettext=$withval,
1559        nls_cv_force_use_gnu_gettext=no)
1560      AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
1561
1562      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
1563      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
1564    ])
1565        dnl User does not insist on using GNU NLS library.  Figure out what
1566        dnl to use.  If GNU gettext is available we use this.  Else we have
1567        dnl to fall back to GNU NLS library.
1568
1569        dnl Add a version number to the cache macros.
1570        define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
1571        define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
1572        define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
1573
1574        AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
1575         [AC_TRY_LINK([#include <libintl.h>
1576]ifelse([$2], [need-formatstring-macros],
1577[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1578#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1579#endif
1580changequote(,)dnl
1581typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1582changequote([,])dnl
1583], [])[extern int _nl_msg_cat_cntr;
1584extern int *_nl_domain_bindings;],
1585            [bindtextdomain ("", "");
1586return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
1587            gt_cv_func_gnugettext_libc=yes,
1588            gt_cv_func_gnugettext_libc=no)])
1589
1590        if test "$gt_cv_func_gnugettext_libc" != "yes"; then
1591          dnl Sometimes libintl requires libiconv, so first search for libiconv.
1592          ifelse(gt_included_intl, yes, , [
1593            AM_ICONV_LINK
1594          ])
1595          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
1596          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
1597          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
1598          dnl even if libiconv doesn't exist.
1599          AC_LIB_LINKFLAGS_BODY([intl])
1600          AC_CACHE_CHECK([for GNU gettext in libintl],
1601            gt_cv_func_gnugettext_libintl,
1602           [gt_save_CPPFLAGS="$CPPFLAGS"
1603            CPPFLAGS="$CPPFLAGS $INCINTL"
1604            gt_save_LIBS="$LIBS"
1605            LIBS="$LIBS $LIBINTL"
1606            dnl Now see whether libintl exists and does not depend on libiconv.
1607            AC_TRY_LINK([#include <libintl.h>
1608]ifelse([$2], [need-formatstring-macros],
1609[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1610#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1611#endif
1612changequote(,)dnl
1613typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1614changequote([,])dnl
1615], [])[extern int _nl_msg_cat_cntr;
1616extern
1617#ifdef __cplusplus
1618"C"
1619#endif
1620const char *_nl_expand_alias ();],
1621              [bindtextdomain ("", "");
1622return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1623              gt_cv_func_gnugettext_libintl=yes,
1624              gt_cv_func_gnugettext_libintl=no)
1625            dnl Now see whether libintl exists and depends on libiconv.
1626            if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
1627              LIBS="$LIBS $LIBICONV"
1628              AC_TRY_LINK([#include <libintl.h>
1629]ifelse([$2], [need-formatstring-macros],
1630[#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
1631#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
1632#endif
1633changequote(,)dnl
1634typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
1635changequote([,])dnl
1636], [])[extern int _nl_msg_cat_cntr;
1637extern
1638#ifdef __cplusplus
1639"C"
1640#endif
1641const char *_nl_expand_alias ();],
1642                [bindtextdomain ("", "");
1643return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
1644               [LIBINTL="$LIBINTL $LIBICONV"
1645                LTLIBINTL="$LTLIBINTL $LTLIBICONV"
1646                gt_cv_func_gnugettext_libintl=yes
1647               ])
1648            fi
1649            CPPFLAGS="$gt_save_CPPFLAGS"
1650            LIBS="$gt_save_LIBS"])
1651        fi
1652
1653        dnl If an already present or preinstalled GNU gettext() is found,
1654        dnl use it.  But if this macro is used in GNU gettext, and GNU
1655        dnl gettext is already preinstalled in libintl, we update this
1656        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
1657        if test "$gt_cv_func_gnugettext_libc" = "yes" \
1658           || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
1659                && test "$PACKAGE" != gettext-runtime \
1660                && test "$PACKAGE" != gettext-tools; }; then
1661          gt_use_preinstalled_gnugettext=yes
1662        else
1663          dnl Reset the values set by searching for libintl.
1664          LIBINTL=
1665          LTLIBINTL=
1666          INCINTL=
1667        fi
1668
1669    ifelse(gt_included_intl, yes, [
1670        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
1671          dnl GNU gettext is not found in the C library.
1672          dnl Fall back on included GNU gettext library.
1673          nls_cv_use_gnu_gettext=yes
1674        fi
1675      fi
1676
1677      if test "$nls_cv_use_gnu_gettext" = "yes"; then
1678        dnl Mark actions used to generate GNU NLS library.
1679        BUILD_INCLUDED_LIBINTL=yes
1680        USE_INCLUDED_LIBINTL=yes
1681        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
1682        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
1683        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
1684      fi
1685
1686      if test "$gt_use_preinstalled_gnugettext" = "yes" \
1687         || test "$nls_cv_use_gnu_gettext" = "yes"; then
1688        dnl Mark actions to use GNU gettext tools.
1689        CATOBJEXT=.gmo
1690      fi
1691    ])
1692
1693    if test "$gt_use_preinstalled_gnugettext" = "yes" \
1694       || test "$nls_cv_use_gnu_gettext" = "yes"; then
1695      AC_DEFINE(ENABLE_NLS, 1,
1696        [Define to 1 if translation of program messages to the user's native language
1697   is requested.])
1698    else
1699      USE_NLS=no
1700    fi
1701  fi
1702
1703  AC_MSG_CHECKING([whether to use NLS])
1704  AC_MSG_RESULT([$USE_NLS])
1705  if test "$USE_NLS" = "yes"; then
1706    AC_MSG_CHECKING([where the gettext function comes from])
1707    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1708      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1709        gt_source="external libintl"
1710      else
1711        gt_source="libc"
1712      fi
1713    else
1714      gt_source="included intl directory"
1715    fi
1716    AC_MSG_RESULT([$gt_source])
1717  fi
1718
1719  if test "$USE_NLS" = "yes"; then
1720
1721    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
1722      if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
1723        AC_MSG_CHECKING([how to link with libintl])
1724        AC_MSG_RESULT([$LIBINTL])
1725        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
1726      fi
1727
1728      dnl For backward compatibility. Some packages may be using this.
1729      AC_DEFINE(HAVE_GETTEXT, 1,
1730       [Define if the GNU gettext() function is already present or preinstalled.])
1731      AC_DEFINE(HAVE_DCGETTEXT, 1,
1732       [Define if the GNU dcgettext() function is already present or preinstalled.])
1733    fi
1734
1735    dnl We need to process the po/ directory.
1736    POSUB=po
1737  fi
1738
1739  ifelse(gt_included_intl, yes, [
1740    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
1741    dnl to 'yes' because some of the testsuite requires it.
1742    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
1743      BUILD_INCLUDED_LIBINTL=yes
1744    fi
1745
1746    dnl Make all variables we use known to autoconf.
1747    AC_SUBST(BUILD_INCLUDED_LIBINTL)
1748    AC_SUBST(USE_INCLUDED_LIBINTL)
1749    AC_SUBST(CATOBJEXT)
1750
1751    dnl For backward compatibility. Some configure.ins may be using this.
1752    nls_cv_header_intl=
1753    nls_cv_header_libgt=
1754
1755    dnl For backward compatibility. Some Makefiles may be using this.
1756    DATADIRNAME=share
1757    AC_SUBST(DATADIRNAME)
1758
1759    dnl For backward compatibility. Some Makefiles may be using this.
1760    INSTOBJEXT=.mo
1761    AC_SUBST(INSTOBJEXT)
1762
1763    dnl For backward compatibility. Some Makefiles may be using this.
1764    GENCAT=gencat
1765    AC_SUBST(GENCAT)
1766
1767    dnl For backward compatibility. Some Makefiles may be using this.
1768    if test "$USE_INCLUDED_LIBINTL" = yes; then
1769      INTLOBJS="\$(GETTOBJS)"
1770    fi
1771    AC_SUBST(INTLOBJS)
1772
1773    dnl Enable libtool support if the surrounding package wishes it.
1774    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
1775    AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
1776  ])
1777
1778  dnl For backward compatibility. Some Makefiles may be using this.
1779  INTLLIBS="$LIBINTL"
1780  AC_SUBST(INTLLIBS)
1781
1782  dnl Make all documented variables known to autoconf.
1783  AC_SUBST(LIBINTL)
1784  AC_SUBST(LTLIBINTL)
1785  AC_SUBST(POSUB)
1786])
1787
1788
1789dnl Checks for all prerequisites of the intl subdirectory,
1790dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
1791dnl            USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
1792AC_DEFUN([AM_INTL_SUBDIR],
1793[
1794  AC_REQUIRE([AC_PROG_INSTALL])dnl
1795  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1796  AC_REQUIRE([AC_PROG_CC])dnl
1797  AC_REQUIRE([AC_CANONICAL_HOST])dnl
1798  AC_REQUIRE([AC_PROG_RANLIB])dnl
1799  AC_REQUIRE([AC_ISC_POSIX])dnl
1800  AC_REQUIRE([AC_HEADER_STDC])dnl
1801  AC_REQUIRE([AC_C_CONST])dnl
1802  AC_REQUIRE([bh_C_SIGNED])dnl
1803  AC_REQUIRE([AC_C_INLINE])dnl
1804  AC_REQUIRE([AC_TYPE_OFF_T])dnl
1805  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
1806  AC_REQUIRE([jm_AC_TYPE_LONG_LONG])dnl
1807  AC_REQUIRE([gt_TYPE_LONGDOUBLE])dnl
1808  AC_REQUIRE([gt_TYPE_WCHAR_T])dnl
1809  AC_REQUIRE([gt_TYPE_WINT_T])dnl
1810  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
1811  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
1812  AC_REQUIRE([gt_TYPE_INTMAX_T])
1813  AC_REQUIRE([gt_PRINTF_POSIX])
1814  AC_REQUIRE([AC_FUNC_ALLOCA])dnl
1815  AC_REQUIRE([AC_FUNC_MMAP])dnl
1816  AC_REQUIRE([jm_GLIBC21])dnl
1817  AC_REQUIRE([gt_INTDIV0])dnl
1818  AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
1819  AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
1820  AC_REQUIRE([gt_INTTYPES_PRI])dnl
1821  AC_REQUIRE([gl_XSIZE])dnl
1822
1823  AC_CHECK_TYPE([ptrdiff_t], ,
1824    [AC_DEFINE([ptrdiff_t], [long],
1825       [Define as the type of the result of subtracting two pointers, if the system doesn't define it.])
1826    ])
1827  AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
1828stdlib.h string.h unistd.h sys/param.h])
1829  AC_CHECK_FUNCS([asprintf fwprintf getcwd getegid geteuid getgid getuid \
1830mempcpy munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup \
1831strtoul tsearch wcslen __argz_count __argz_stringify __argz_next \
1832__fsetlocking])
1833
1834  dnl Use the _snprintf function only if it is declared (because on NetBSD it
1835  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
1836  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
1837  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
1838
1839  dnl Use the *_unlocked functions only if they are declared.
1840  dnl (because some of them were defined without being declared in Solaris
1841  dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
1842  dnl on Solaris 2.5.1 to run on Solaris 2.6).
1843  dnl Don't use AC_CHECK_DECLS because it isn't supported in autoconf-2.13.
1844  gt_CHECK_DECL(feof_unlocked, [#include <stdio.h>])
1845  gt_CHECK_DECL(fgets_unlocked, [#include <stdio.h>])
1846  gt_CHECK_DECL(getc_unlocked, [#include <stdio.h>])
1847
1848  case $gt_cv_func_printf_posix in
1849    *yes) HAVE_POSIX_PRINTF=1 ;;
1850    *) HAVE_POSIX_PRINTF=0 ;;
1851  esac
1852  AC_SUBST([HAVE_POSIX_PRINTF])
1853  if test "$ac_cv_func_asprintf" = yes; then
1854    HAVE_ASPRINTF=1
1855  else
1856    HAVE_ASPRINTF=0
1857  fi
1858  AC_SUBST([HAVE_ASPRINTF])
1859  if test "$ac_cv_func_snprintf" = yes; then
1860    HAVE_SNPRINTF=1
1861  else
1862    HAVE_SNPRINTF=0
1863  fi
1864  AC_SUBST([HAVE_SNPRINTF])
1865  if test "$ac_cv_func_wprintf" = yes; then
1866    HAVE_WPRINTF=1
1867  else
1868    HAVE_WPRINTF=0
1869  fi
1870  AC_SUBST([HAVE_WPRINTF])
1871
1872  AM_ICONV
1873  AM_LANGINFO_CODESET
1874  if test $ac_cv_header_locale_h = yes; then
1875    AM_LC_MESSAGES
1876  fi
1877
1878  dnl intl/plural.c is generated from intl/plural.y. It requires bison,
1879  dnl because plural.y uses bison specific features. It requires at least
1880  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
1881  dnl compile.
1882  dnl bison is only needed for the maintainer (who touches plural.y). But in
1883  dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
1884  dnl the rule in general Makefile. Now, some people carelessly touch the
1885  dnl files or have a broken "make" program, hence the plural.c rule will
1886  dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
1887  dnl present or too old.
1888  AC_CHECK_PROGS([INTLBISON], [bison])
1889  if test -z "$INTLBISON"; then
1890    ac_verc_fail=yes
1891  else
1892    dnl Found it, now check the version.
1893    AC_MSG_CHECKING([version of bison])
1894changequote(<<,>>)dnl
1895    ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
1896    case $ac_prog_version in
1897      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
1898      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
1899changequote([,])dnl
1900         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
1901      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
1902    esac
1903    AC_MSG_RESULT([$ac_prog_version])
1904  fi
1905  if test $ac_verc_fail = yes; then
1906    INTLBISON=:
1907  fi
1908])
1909
1910
1911dnl gt_CHECK_DECL(FUNC, INCLUDES)
1912dnl Check whether a function is declared.
1913AC_DEFUN([gt_CHECK_DECL],
1914[
1915  AC_CACHE_CHECK([whether $1 is declared], ac_cv_have_decl_$1,
1916    [AC_TRY_COMPILE([$2], [
1917#ifndef $1
1918  char *p = (char *) $1;
1919#endif
1920], ac_cv_have_decl_$1=yes, ac_cv_have_decl_$1=no)])
1921  if test $ac_cv_have_decl_$1 = yes; then
1922    gt_value=1
1923  else
1924    gt_value=0
1925  fi
1926  AC_DEFINE_UNQUOTED([HAVE_DECL_]translit($1, [a-z], [A-Z]), [$gt_value],
1927    [Define to 1 if you have the declaration of `$1', and to 0 if you don't.])
1928])
1929
1930
1931dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
1932AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
1933
1934# po.m4 serial 3 (gettext-0.14)
1935dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
1936dnl This file is free software, distributed under the terms of the GNU
1937dnl General Public License.  As a special exception to the GNU General
1938dnl Public License, this file may be distributed as part of a program
1939dnl that contains a configuration script generated by Autoconf, under
1940dnl the same distribution terms as the rest of that program.
1941dnl
1942dnl This file can can be used in projects which are not available under
1943dnl the GNU General Public License or the GNU Library General Public
1944dnl License but which still want to provide support for the GNU gettext
1945dnl functionality.
1946dnl Please note that the actual code of the GNU gettext library is covered
1947dnl by the GNU Library General Public License, and the rest of the GNU
1948dnl gettext package package is covered by the GNU General Public License.
1949dnl They are *not* in the public domain.
1950
1951dnl Authors:
1952dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
1953dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
1954
1955dnl Checks for all prerequisites of the po subdirectory.
1956AC_DEFUN([AM_PO_SUBDIRS],
1957[
1958  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
1959  AC_REQUIRE([AC_PROG_INSTALL])dnl
1960  AC_REQUIRE([AM_MKINSTALLDIRS])dnl
1961  AC_REQUIRE([AM_NLS])dnl
1962
1963  dnl Perform the following tests also if --disable-nls has been given,
1964  dnl because they are needed for "make dist" to work.
1965
1966  dnl Search for GNU msgfmt in the PATH.
1967  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
1968  dnl The second test excludes FreeBSD msgfmt.
1969  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
1970    [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
1971     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1972    :)
1973  AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
1974
1975  dnl Search for GNU xgettext 0.12 or newer in the PATH.
1976  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
1977  dnl The second test excludes FreeBSD xgettext.
1978  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
1979    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
1980     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
1981    :)
1982  dnl Remove leftover from FreeBSD xgettext call.
1983  rm -f messages.po
1984
1985  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
1986  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
1987    [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
1988
1989  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
1990  dnl Test whether we really found GNU msgfmt.
1991  if test "$GMSGFMT" != ":"; then
1992    dnl If it is no GNU msgfmt we define it as : so that the
1993    dnl Makefiles still can work.
1994    if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
1995       (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
1996      : ;
1997    else
1998      GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
1999      AC_MSG_RESULT(
2000        [found $GMSGFMT program is not GNU msgfmt; ignore it])
2001      GMSGFMT=":"
2002    fi
2003  fi
2004
2005  dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
2006  dnl Test whether we really found GNU xgettext.
2007  if test "$XGETTEXT" != ":"; then
2008    dnl If it is no GNU xgettext we define it as : so that the
2009    dnl Makefiles still can work.
2010    if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
2011       (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
2012      : ;
2013    else
2014      AC_MSG_RESULT(
2015        [found xgettext program is not GNU xgettext; ignore it])
2016      XGETTEXT=":"
2017    fi
2018    dnl Remove leftover from FreeBSD xgettext call.
2019    rm -f messages.po
2020  fi
2021
2022  AC_OUTPUT_COMMANDS([
2023    for ac_file in $CONFIG_FILES; do
2024      # Support "outfile[:infile[:infile...]]"
2025      case "$ac_file" in
2026        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
2027      esac
2028      # PO directories have a Makefile.in generated from Makefile.in.in.
2029      case "$ac_file" in */Makefile.in)
2030        # Adjust a relative srcdir.
2031        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2032        ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2033        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2034        # In autoconf-2.13 it is called $ac_given_srcdir.
2035        # In autoconf-2.50 it is called $srcdir.
2036        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2037        case "$ac_given_srcdir" in
2038          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2039          /*) top_srcdir="$ac_given_srcdir" ;;
2040          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2041        esac
2042        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
2043          rm -f "$ac_dir/POTFILES"
2044          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
2045          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ 	]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
2046          POMAKEFILEDEPS="POTFILES.in"
2047          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
2048          # on $ac_dir but don't depend on user-specified configuration
2049          # parameters.
2050          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2051            # The LINGUAS file contains the set of available languages.
2052            if test -n "$OBSOLETE_ALL_LINGUAS"; then
2053              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2054            fi
2055            ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2056            # Hide the ALL_LINGUAS assigment from automake.
2057            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2058            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2059          else
2060            # The set of available languages was given in configure.in.
2061            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
2062          fi
2063          # Compute POFILES
2064          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2065          # Compute UPDATEPOFILES
2066          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2067          # Compute DUMMYPOFILES
2068          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2069          # Compute GMOFILES
2070          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2071          case "$ac_given_srcdir" in
2072            .) srcdirpre= ;;
2073            *) srcdirpre='$(srcdir)/' ;;
2074          esac
2075          POFILES=
2076          UPDATEPOFILES=
2077          DUMMYPOFILES=
2078          GMOFILES=
2079          for lang in $ALL_LINGUAS; do
2080            POFILES="$POFILES $srcdirpre$lang.po"
2081            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2082            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2083            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2084          done
2085          # CATALOGS depends on both $ac_dir and the user's LINGUAS
2086          # environment variable.
2087          INST_LINGUAS=
2088          if test -n "$ALL_LINGUAS"; then
2089            for presentlang in $ALL_LINGUAS; do
2090              useit=no
2091              if test "%UNSET%" != "$LINGUAS"; then
2092                desiredlanguages="$LINGUAS"
2093              else
2094                desiredlanguages="$ALL_LINGUAS"
2095              fi
2096              for desiredlang in $desiredlanguages; do
2097                # Use the presentlang catalog if desiredlang is
2098                #   a. equal to presentlang, or
2099                #   b. a variant of presentlang (because in this case,
2100                #      presentlang can be used as a fallback for messages
2101                #      which are not translated in the desiredlang catalog).
2102                case "$desiredlang" in
2103                  "$presentlang"*) useit=yes;;
2104                esac
2105              done
2106              if test $useit = yes; then
2107                INST_LINGUAS="$INST_LINGUAS $presentlang"
2108              fi
2109            done
2110          fi
2111          CATALOGS=
2112          if test -n "$INST_LINGUAS"; then
2113            for lang in $INST_LINGUAS; do
2114              CATALOGS="$CATALOGS $lang.gmo"
2115            done
2116          fi
2117          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
2118          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
2119          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
2120            if test -f "$f"; then
2121              case "$f" in
2122                *.orig | *.bak | *~) ;;
2123                *) cat "$f" >> "$ac_dir/Makefile" ;;
2124              esac
2125            fi
2126          done
2127        fi
2128        ;;
2129      esac
2130    done],
2131   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
2132    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
2133    # from automake.
2134    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
2135    # Capture the value of LINGUAS because we need it to compute CATALOGS.
2136    LINGUAS="${LINGUAS-%UNSET%}"
2137   ])
2138])
2139
2140dnl Postprocesses a Makefile in a directory containing PO files.
2141AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
2142[
2143  # When this code is run, in config.status, two variables have already been
2144  # set:
2145  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
2146  # - LINGUAS is the value of the environment variable LINGUAS at configure
2147  #   time.
2148
2149changequote(,)dnl
2150  # Adjust a relative srcdir.
2151  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
2152  ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
2153  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
2154  # In autoconf-2.13 it is called $ac_given_srcdir.
2155  # In autoconf-2.50 it is called $srcdir.
2156  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
2157  case "$ac_given_srcdir" in
2158    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
2159    /*) top_srcdir="$ac_given_srcdir" ;;
2160    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
2161  esac
2162
2163  # Find a way to echo strings without interpreting backslash.
2164  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
2165    gt_echo='echo'
2166  else
2167    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
2168      gt_echo='printf %s\n'
2169    else
2170      echo_func () {
2171        cat <<EOT
2172$*
2173EOT
2174      }
2175      gt_echo='echo_func'
2176    fi
2177  fi
2178
2179  # A sed script that extracts the value of VARIABLE from a Makefile.
2180  sed_x_variable='
2181# Test if the hold space is empty.
2182x
2183s/P/P/
2184x
2185ta
2186# Yes it was empty. Look if we have the expected variable definition.
2187/^[	 ]*VARIABLE[	 ]*=/{
2188  # Seen the first line of the variable definition.
2189  s/^[	 ]*VARIABLE[	 ]*=//
2190  ba
2191}
2192bd
2193:a
2194# Here we are processing a line from the variable definition.
2195# Remove comment, more precisely replace it with a space.
2196s/#.*$/ /
2197# See if the line ends in a backslash.
2198tb
2199:b
2200s/\\$//
2201# Print the line, without the trailing backslash.
2202p
2203tc
2204# There was no trailing backslash. The end of the variable definition is
2205# reached. Clear the hold space.
2206s/^.*$//
2207x
2208bd
2209:c
2210# A trailing backslash means that the variable definition continues in the
2211# next line. Put a nonempty string into the hold space to indicate this.
2212s/^.*$/P/
2213x
2214:d
2215'
2216changequote([,])dnl
2217
2218  # Set POTFILES to the value of the Makefile variable POTFILES.
2219  sed_x_POTFILES="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`"
2220  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
2221  # Compute POTFILES_DEPS as
2222  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
2223  POTFILES_DEPS=
2224  for file in $POTFILES; do
2225    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
2226  done
2227  POMAKEFILEDEPS=""
2228
2229  if test -n "$OBSOLETE_ALL_LINGUAS"; then
2230    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
2231  fi
2232  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
2233    # The LINGUAS file contains the set of available languages.
2234    ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
2235    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
2236  else
2237    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
2238    sed_x_LINGUAS="`$gt_echo \"$sed_x_variable\" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`"
2239    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
2240  fi
2241  # Hide the ALL_LINGUAS assigment from automake.
2242  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
2243  # Compute POFILES
2244  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
2245  # Compute UPDATEPOFILES
2246  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
2247  # Compute DUMMYPOFILES
2248  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
2249  # Compute GMOFILES
2250  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
2251  # Compute PROPERTIESFILES
2252  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
2253  # Compute CLASSFILES
2254  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
2255  # Compute QMFILES
2256  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
2257  # Compute MSGFILES
2258  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
2259  # Compute RESOURCESDLLFILES
2260  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
2261  case "$ac_given_srcdir" in
2262    .) srcdirpre= ;;
2263    *) srcdirpre='$(srcdir)/' ;;
2264  esac
2265  POFILES=
2266  UPDATEPOFILES=
2267  DUMMYPOFILES=
2268  GMOFILES=
2269  PROPERTIESFILES=
2270  CLASSFILES=
2271  QMFILES=
2272  MSGFILES=
2273  RESOURCESDLLFILES=
2274  for lang in $ALL_LINGUAS; do
2275    POFILES="$POFILES $srcdirpre$lang.po"
2276    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
2277    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
2278    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
2279    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
2280    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
2281    QMFILES="$QMFILES $srcdirpre$lang.qm"
2282    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2283    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
2284    frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2285    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
2286  done
2287  # CATALOGS depends on both $ac_dir and the user's LINGUAS
2288  # environment variable.
2289  INST_LINGUAS=
2290  if test -n "$ALL_LINGUAS"; then
2291    for presentlang in $ALL_LINGUAS; do
2292      useit=no
2293      if test "%UNSET%" != "$LINGUAS"; then
2294        desiredlanguages="$LINGUAS"
2295      else
2296        desiredlanguages="$ALL_LINGUAS"
2297      fi
2298      for desiredlang in $desiredlanguages; do
2299        # Use the presentlang catalog if desiredlang is
2300        #   a. equal to presentlang, or
2301        #   b. a variant of presentlang (because in this case,
2302        #      presentlang can be used as a fallback for messages
2303        #      which are not translated in the desiredlang catalog).
2304        case "$desiredlang" in
2305          "$presentlang"*) useit=yes;;
2306        esac
2307      done
2308      if test $useit = yes; then
2309        INST_LINGUAS="$INST_LINGUAS $presentlang"
2310      fi
2311    done
2312  fi
2313  CATALOGS=
2314  JAVACATALOGS=
2315  QTCATALOGS=
2316  TCLCATALOGS=
2317  CSHARPCATALOGS=
2318  if test -n "$INST_LINGUAS"; then
2319    for lang in $INST_LINGUAS; do
2320      CATALOGS="$CATALOGS $lang.gmo"
2321      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
2322      QTCATALOGS="$QTCATALOGS $lang.qm"
2323      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2324      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
2325      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2326      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
2327    done
2328  fi
2329
2330  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
2331  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
2332    # Add dependencies that cannot be formulated as a simple suffix rule.
2333    for lang in $ALL_LINGUAS; do
2334      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
2335      cat >> "$ac_file.tmp" <<EOF
2336$frobbedlang.msg: $lang.po
2337	@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
2338	\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2339EOF
2340    done
2341  fi
2342  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
2343    # Add dependencies that cannot be formulated as a simple suffix rule.
2344    for lang in $ALL_LINGUAS; do
2345      frobbedlang=`echo $lang | sed -e 's/_/-/g'`
2346      cat >> "$ac_file.tmp" <<EOF
2347$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
2348	@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
2349	\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
2350EOF
2351    done
2352  fi
2353  if test -n "$POMAKEFILEDEPS"; then
2354    cat >> "$ac_file.tmp" <<EOF
2355Makefile: $POMAKEFILEDEPS
2356EOF
2357  fi
2358  mv "$ac_file.tmp" "$ac_file"
2359])
2360
2361# nls.m4 serial 1 (gettext-0.12)
2362dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
2363dnl This file is free software, distributed under the terms of the GNU
2364dnl General Public License.  As a special exception to the GNU General
2365dnl Public License, this file may be distributed as part of a program
2366dnl that contains a configuration script generated by Autoconf, under
2367dnl the same distribution terms as the rest of that program.
2368dnl
2369dnl This file can can be used in projects which are not available under
2370dnl the GNU General Public License or the GNU Library General Public
2371dnl License but which still want to provide support for the GNU gettext
2372dnl functionality.
2373dnl Please note that the actual code of the GNU gettext library is covered
2374dnl by the GNU Library General Public License, and the rest of the GNU
2375dnl gettext package package is covered by the GNU General Public License.
2376dnl They are *not* in the public domain.
2377
2378dnl Authors:
2379dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
2380dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
2381
2382AC_DEFUN([AM_NLS],
2383[
2384  AC_MSG_CHECKING([whether NLS is requested])
2385  dnl Default is enabled NLS
2386  AC_ARG_ENABLE(nls,
2387    [  --disable-nls           do not use Native Language Support],
2388    USE_NLS=$enableval, USE_NLS=yes)
2389  AC_MSG_RESULT($USE_NLS)
2390  AC_SUBST(USE_NLS)
2391])
2392
2393AC_DEFUN([AM_MKINSTALLDIRS],
2394[
2395  dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
2396  dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
2397  dnl Try to locate it.
2398  MKINSTALLDIRS=
2399  if test -n "$ac_aux_dir"; then
2400    case "$ac_aux_dir" in
2401      /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
2402      *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
2403    esac
2404  fi
2405  if test -z "$MKINSTALLDIRS"; then
2406    MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
2407  fi
2408  AC_SUBST(MKINSTALLDIRS)
2409])
2410
2411# progtest.m4 serial 3 (gettext-0.12)
2412dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
2413dnl This file is free software, distributed under the terms of the GNU
2414dnl General Public License.  As a special exception to the GNU General
2415dnl Public License, this file may be distributed as part of a program
2416dnl that contains a configuration script generated by Autoconf, under
2417dnl the same distribution terms as the rest of that program.
2418dnl
2419dnl This file can can be used in projects which are not available under
2420dnl the GNU General Public License or the GNU Library General Public
2421dnl License but which still want to provide support for the GNU gettext
2422dnl functionality.
2423dnl Please note that the actual code of the GNU gettext library is covered
2424dnl by the GNU Library General Public License, and the rest of the GNU
2425dnl gettext package package is covered by the GNU General Public License.
2426dnl They are *not* in the public domain.
2427
2428dnl Authors:
2429dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
2430
2431# Search path for a program which passes the given test.
2432
2433dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
2434dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
2435AC_DEFUN([AM_PATH_PROG_WITH_TEST],
2436[
2437# Prepare PATH_SEPARATOR.
2438# The user is always right.
2439if test "${PATH_SEPARATOR+set}" != set; then
2440  echo "#! /bin/sh" >conf$$.sh
2441  echo  "exit 0"   >>conf$$.sh
2442  chmod +x conf$$.sh
2443  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
2444    PATH_SEPARATOR=';'
2445  else
2446    PATH_SEPARATOR=:
2447  fi
2448  rm -f conf$$.sh
2449fi
2450
2451# Find out how to test for executable files. Don't use a zero-byte file,
2452# as systems may use methods other than mode bits to determine executability.
2453cat >conf$$.file <<_ASEOF
2454#! /bin/sh
2455exit 0
2456_ASEOF
2457chmod +x conf$$.file
2458if test -x conf$$.file >/dev/null 2>&1; then
2459  ac_executable_p="test -x"
2460else
2461  ac_executable_p="test -f"
2462fi
2463rm -f conf$$.file
2464
2465# Extract the first word of "$2", so it can be a program name with args.
2466set dummy $2; ac_word=[$]2
2467AC_MSG_CHECKING([for $ac_word])
2468AC_CACHE_VAL(ac_cv_path_$1,
2469[case "[$]$1" in
2470  [[\\/]]* | ?:[[\\/]]*)
2471    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
2472    ;;
2473  *)
2474    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
2475    for ac_dir in ifelse([$5], , $PATH, [$5]); do
2476      IFS="$ac_save_IFS"
2477      test -z "$ac_dir" && ac_dir=.
2478      for ac_exec_ext in '' $ac_executable_extensions; do
2479        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
2480          if [$3]; then
2481            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
2482            break 2
2483          fi
2484        fi
2485      done
2486    done
2487    IFS="$ac_save_IFS"
2488dnl If no 4th arg is given, leave the cache variable unset,
2489dnl so AC_PATH_PROGS will keep looking.
2490ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
2491])dnl
2492    ;;
2493esac])dnl
2494$1="$ac_cv_path_$1"
2495if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
2496  AC_MSG_RESULT([$]$1)
2497else
2498  AC_MSG_RESULT(no)
2499fi
2500AC_SUBST($1)dnl
2501])
2502
2503# lib-prefix.m4 serial 3 (gettext-0.13)
2504dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
2505dnl This file is free software, distributed under the terms of the GNU
2506dnl General Public License.  As a special exception to the GNU General
2507dnl Public License, this file may be distributed as part of a program
2508dnl that contains a configuration script generated by Autoconf, under
2509dnl the same distribution terms as the rest of that program.
2510
2511dnl From Bruno Haible.
2512
2513dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
2514dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
2515dnl require excessive bracketing.
2516ifdef([AC_HELP_STRING],
2517[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
2518[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
2519
2520dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
2521dnl to access previously installed libraries. The basic assumption is that
2522dnl a user will want packages to use other packages he previously installed
2523dnl with the same --prefix option.
2524dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
2525dnl libraries, but is otherwise very convenient.
2526AC_DEFUN([AC_LIB_PREFIX],
2527[
2528  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
2529  AC_REQUIRE([AC_PROG_CC])
2530  AC_REQUIRE([AC_CANONICAL_HOST])
2531  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2532  dnl By default, look in $includedir and $libdir.
2533  use_additional=yes
2534  AC_LIB_WITH_FINAL_PREFIX([
2535    eval additional_includedir=\"$includedir\"
2536    eval additional_libdir=\"$libdir\"
2537  ])
2538  AC_LIB_ARG_WITH([lib-prefix],
2539[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
2540  --without-lib-prefix    don't search for libraries in includedir and libdir],
2541[
2542    if test "X$withval" = "Xno"; then
2543      use_additional=no
2544    else
2545      if test "X$withval" = "X"; then
2546        AC_LIB_WITH_FINAL_PREFIX([
2547          eval additional_includedir=\"$includedir\"
2548          eval additional_libdir=\"$libdir\"
2549        ])
2550      else
2551        additional_includedir="$withval/include"
2552        additional_libdir="$withval/lib"
2553      fi
2554    fi
2555])
2556  if test $use_additional = yes; then
2557    dnl Potentially add $additional_includedir to $CPPFLAGS.
2558    dnl But don't add it
2559    dnl   1. if it's the standard /usr/include,
2560    dnl   2. if it's already present in $CPPFLAGS,
2561    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
2562    dnl   4. if it doesn't exist as a directory.
2563    if test "X$additional_includedir" != "X/usr/include"; then
2564      haveit=
2565      for x in $CPPFLAGS; do
2566        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2567        if test "X$x" = "X-I$additional_includedir"; then
2568          haveit=yes
2569          break
2570        fi
2571      done
2572      if test -z "$haveit"; then
2573        if test "X$additional_includedir" = "X/usr/local/include"; then
2574          if test -n "$GCC"; then
2575            case $host_os in
2576              linux*) haveit=yes;;
2577            esac
2578          fi
2579        fi
2580        if test -z "$haveit"; then
2581          if test -d "$additional_includedir"; then
2582            dnl Really add $additional_includedir to $CPPFLAGS.
2583            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
2584          fi
2585        fi
2586      fi
2587    fi
2588    dnl Potentially add $additional_libdir to $LDFLAGS.
2589    dnl But don't add it
2590    dnl   1. if it's the standard /usr/lib,
2591    dnl   2. if it's already present in $LDFLAGS,
2592    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
2593    dnl   4. if it doesn't exist as a directory.
2594    if test "X$additional_libdir" != "X/usr/lib"; then
2595      haveit=
2596      for x in $LDFLAGS; do
2597        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2598        if test "X$x" = "X-L$additional_libdir"; then
2599          haveit=yes
2600          break
2601        fi
2602      done
2603      if test -z "$haveit"; then
2604        if test "X$additional_libdir" = "X/usr/local/lib"; then
2605          if test -n "$GCC"; then
2606            case $host_os in
2607              linux*) haveit=yes;;
2608            esac
2609          fi
2610        fi
2611        if test -z "$haveit"; then
2612          if test -d "$additional_libdir"; then
2613            dnl Really add $additional_libdir to $LDFLAGS.
2614            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
2615          fi
2616        fi
2617      fi
2618    fi
2619  fi
2620])
2621
2622dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
2623dnl acl_final_exec_prefix, containing the values to which $prefix and
2624dnl $exec_prefix will expand at the end of the configure script.
2625AC_DEFUN([AC_LIB_PREPARE_PREFIX],
2626[
2627  dnl Unfortunately, prefix and exec_prefix get only finally determined
2628  dnl at the end of configure.
2629  if test "X$prefix" = "XNONE"; then
2630    acl_final_prefix="$ac_default_prefix"
2631  else
2632    acl_final_prefix="$prefix"
2633  fi
2634  if test "X$exec_prefix" = "XNONE"; then
2635    acl_final_exec_prefix='${prefix}'
2636  else
2637    acl_final_exec_prefix="$exec_prefix"
2638  fi
2639  acl_save_prefix="$prefix"
2640  prefix="$acl_final_prefix"
2641  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
2642  prefix="$acl_save_prefix"
2643])
2644
2645dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
2646dnl variables prefix and exec_prefix bound to the values they will have
2647dnl at the end of the configure script.
2648AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
2649[
2650  acl_save_prefix="$prefix"
2651  prefix="$acl_final_prefix"
2652  acl_save_exec_prefix="$exec_prefix"
2653  exec_prefix="$acl_final_exec_prefix"
2654  $1
2655  exec_prefix="$acl_save_exec_prefix"
2656  prefix="$acl_save_prefix"
2657])
2658
2659# lib-link.m4 serial 4 (gettext-0.12)
2660dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
2661dnl This file is free software, distributed under the terms of the GNU
2662dnl General Public License.  As a special exception to the GNU General
2663dnl Public License, this file may be distributed as part of a program
2664dnl that contains a configuration script generated by Autoconf, under
2665dnl the same distribution terms as the rest of that program.
2666
2667dnl From Bruno Haible.
2668
2669dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
2670dnl the libraries corresponding to explicit and implicit dependencies.
2671dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
2672dnl augments the CPPFLAGS variable.
2673AC_DEFUN([AC_LIB_LINKFLAGS],
2674[
2675  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2676  AC_REQUIRE([AC_LIB_RPATH])
2677  define([Name],[translit([$1],[./-], [___])])
2678  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2679                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2680  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
2681    AC_LIB_LINKFLAGS_BODY([$1], [$2])
2682    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
2683    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
2684    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
2685  ])
2686  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
2687  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
2688  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
2689  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2690  AC_SUBST([LIB]NAME)
2691  AC_SUBST([LTLIB]NAME)
2692  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
2693  dnl results of this search when this library appears as a dependency.
2694  HAVE_LIB[]NAME=yes
2695  undefine([Name])
2696  undefine([NAME])
2697])
2698
2699dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
2700dnl searches for libname and the libraries corresponding to explicit and
2701dnl implicit dependencies, together with the specified include files and
2702dnl the ability to compile and link the specified testcode. If found, it
2703dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
2704dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
2705dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
2706dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
2707AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
2708[
2709  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
2710  AC_REQUIRE([AC_LIB_RPATH])
2711  define([Name],[translit([$1],[./-], [___])])
2712  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2713                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2714
2715  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
2716  dnl accordingly.
2717  AC_LIB_LINKFLAGS_BODY([$1], [$2])
2718
2719  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
2720  dnl because if the user has installed lib[]Name and not disabled its use
2721  dnl via --without-lib[]Name-prefix, he wants to use it.
2722  ac_save_CPPFLAGS="$CPPFLAGS"
2723  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
2724
2725  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
2726    ac_save_LIBS="$LIBS"
2727    LIBS="$LIBS $LIB[]NAME"
2728    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
2729    LIBS="$ac_save_LIBS"
2730  ])
2731  if test "$ac_cv_lib[]Name" = yes; then
2732    HAVE_LIB[]NAME=yes
2733    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
2734    AC_MSG_CHECKING([how to link with lib[]$1])
2735    AC_MSG_RESULT([$LIB[]NAME])
2736  else
2737    HAVE_LIB[]NAME=no
2738    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
2739    dnl $INC[]NAME either.
2740    CPPFLAGS="$ac_save_CPPFLAGS"
2741    LIB[]NAME=
2742    LTLIB[]NAME=
2743  fi
2744  AC_SUBST([HAVE_LIB]NAME)
2745  AC_SUBST([LIB]NAME)
2746  AC_SUBST([LTLIB]NAME)
2747  undefine([Name])
2748  undefine([NAME])
2749])
2750
2751dnl Determine the platform dependent parameters needed to use rpath:
2752dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
2753dnl hardcode_direct, hardcode_minus_L.
2754AC_DEFUN([AC_LIB_RPATH],
2755[
2756  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
2757  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
2758  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
2759  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
2760  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
2761    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
2762    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
2763    . ./conftest.sh
2764    rm -f ./conftest.sh
2765    acl_cv_rpath=done
2766  ])
2767  wl="$acl_cv_wl"
2768  libext="$acl_cv_libext"
2769  shlibext="$acl_cv_shlibext"
2770  hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
2771  hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
2772  hardcode_direct="$acl_cv_hardcode_direct"
2773  hardcode_minus_L="$acl_cv_hardcode_minus_L"
2774  dnl Determine whether the user wants rpath handling at all.
2775  AC_ARG_ENABLE(rpath,
2776    [  --disable-rpath         do not hardcode runtime library paths],
2777    :, enable_rpath=yes)
2778])
2779
2780dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
2781dnl the libraries corresponding to explicit and implicit dependencies.
2782dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
2783AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
2784[
2785  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
2786                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
2787  dnl By default, look in $includedir and $libdir.
2788  use_additional=yes
2789  AC_LIB_WITH_FINAL_PREFIX([
2790    eval additional_includedir=\"$includedir\"
2791    eval additional_libdir=\"$libdir\"
2792  ])
2793  AC_LIB_ARG_WITH([lib$1-prefix],
2794[  --with-lib$1-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
2795  --without-lib$1-prefix     don't search for lib$1 in includedir and libdir],
2796[
2797    if test "X$withval" = "Xno"; then
2798      use_additional=no
2799    else
2800      if test "X$withval" = "X"; then
2801        AC_LIB_WITH_FINAL_PREFIX([
2802          eval additional_includedir=\"$includedir\"
2803          eval additional_libdir=\"$libdir\"
2804        ])
2805      else
2806        additional_includedir="$withval/include"
2807        additional_libdir="$withval/lib"
2808      fi
2809    fi
2810])
2811  dnl Search the library and its dependencies in $additional_libdir and
2812  dnl $LDFLAGS. Using breadth-first-seach.
2813  LIB[]NAME=
2814  LTLIB[]NAME=
2815  INC[]NAME=
2816  rpathdirs=
2817  ltrpathdirs=
2818  names_already_handled=
2819  names_next_round='$1 $2'
2820  while test -n "$names_next_round"; do
2821    names_this_round="$names_next_round"
2822    names_next_round=
2823    for name in $names_this_round; do
2824      already_handled=
2825      for n in $names_already_handled; do
2826        if test "$n" = "$name"; then
2827          already_handled=yes
2828          break
2829        fi
2830      done
2831      if test -z "$already_handled"; then
2832        names_already_handled="$names_already_handled $name"
2833        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
2834        dnl or AC_LIB_HAVE_LINKFLAGS call.
2835        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
2836        eval value=\"\$HAVE_LIB$uppername\"
2837        if test -n "$value"; then
2838          if test "$value" = yes; then
2839            eval value=\"\$LIB$uppername\"
2840            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
2841            eval value=\"\$LTLIB$uppername\"
2842            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
2843          else
2844            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
2845            dnl that this library doesn't exist. So just drop it.
2846            :
2847          fi
2848        else
2849          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
2850          dnl and the already constructed $LIBNAME/$LTLIBNAME.
2851          found_dir=
2852          found_la=
2853          found_so=
2854          found_a=
2855          if test $use_additional = yes; then
2856            if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
2857              found_dir="$additional_libdir"
2858              found_so="$additional_libdir/lib$name.$shlibext"
2859              if test -f "$additional_libdir/lib$name.la"; then
2860                found_la="$additional_libdir/lib$name.la"
2861              fi
2862            else
2863              if test -f "$additional_libdir/lib$name.$libext"; then
2864                found_dir="$additional_libdir"
2865                found_a="$additional_libdir/lib$name.$libext"
2866                if test -f "$additional_libdir/lib$name.la"; then
2867                  found_la="$additional_libdir/lib$name.la"
2868                fi
2869              fi
2870            fi
2871          fi
2872          if test "X$found_dir" = "X"; then
2873            for x in $LDFLAGS $LTLIB[]NAME; do
2874              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2875              case "$x" in
2876                -L*)
2877                  dir=`echo "X$x" | sed -e 's/^X-L//'`
2878                  if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
2879                    found_dir="$dir"
2880                    found_so="$dir/lib$name.$shlibext"
2881                    if test -f "$dir/lib$name.la"; then
2882                      found_la="$dir/lib$name.la"
2883                    fi
2884                  else
2885                    if test -f "$dir/lib$name.$libext"; then
2886                      found_dir="$dir"
2887                      found_a="$dir/lib$name.$libext"
2888                      if test -f "$dir/lib$name.la"; then
2889                        found_la="$dir/lib$name.la"
2890                      fi
2891                    fi
2892                  fi
2893                  ;;
2894              esac
2895              if test "X$found_dir" != "X"; then
2896                break
2897              fi
2898            done
2899          fi
2900          if test "X$found_dir" != "X"; then
2901            dnl Found the library.
2902            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
2903            if test "X$found_so" != "X"; then
2904              dnl Linking with a shared library. We attempt to hardcode its
2905              dnl directory into the executable's runpath, unless it's the
2906              dnl standard /usr/lib.
2907              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
2908                dnl No hardcoding is needed.
2909                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2910              else
2911                dnl Use an explicit option to hardcode DIR into the resulting
2912                dnl binary.
2913                dnl Potentially add DIR to ltrpathdirs.
2914                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
2915                haveit=
2916                for x in $ltrpathdirs; do
2917                  if test "X$x" = "X$found_dir"; then
2918                    haveit=yes
2919                    break
2920                  fi
2921                done
2922                if test -z "$haveit"; then
2923                  ltrpathdirs="$ltrpathdirs $found_dir"
2924                fi
2925                dnl The hardcoding into $LIBNAME is system dependent.
2926                if test "$hardcode_direct" = yes; then
2927                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
2928                  dnl resulting binary.
2929                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2930                else
2931                  if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
2932                    dnl Use an explicit option to hardcode DIR into the resulting
2933                    dnl binary.
2934                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2935                    dnl Potentially add DIR to rpathdirs.
2936                    dnl The rpathdirs will be appended to $LIBNAME at the end.
2937                    haveit=
2938                    for x in $rpathdirs; do
2939                      if test "X$x" = "X$found_dir"; then
2940                        haveit=yes
2941                        break
2942                      fi
2943                    done
2944                    if test -z "$haveit"; then
2945                      rpathdirs="$rpathdirs $found_dir"
2946                    fi
2947                  else
2948                    dnl Rely on "-L$found_dir".
2949                    dnl But don't add it if it's already contained in the LDFLAGS
2950                    dnl or the already constructed $LIBNAME
2951                    haveit=
2952                    for x in $LDFLAGS $LIB[]NAME; do
2953                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
2954                      if test "X$x" = "X-L$found_dir"; then
2955                        haveit=yes
2956                        break
2957                      fi
2958                    done
2959                    if test -z "$haveit"; then
2960                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
2961                    fi
2962                    if test "$hardcode_minus_L" != no; then
2963                      dnl FIXME: Not sure whether we should use
2964                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2965                      dnl here.
2966                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
2967                    else
2968                      dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
2969                      dnl here, because this doesn't fit in flags passed to the
2970                      dnl compiler. So give up. No hardcoding. This affects only
2971                      dnl very old systems.
2972                      dnl FIXME: Not sure whether we should use
2973                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
2974                      dnl here.
2975                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
2976                    fi
2977                  fi
2978                fi
2979              fi
2980            else
2981              if test "X$found_a" != "X"; then
2982                dnl Linking with a static library.
2983                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
2984              else
2985                dnl We shouldn't come here, but anyway it's good to have a
2986                dnl fallback.
2987                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
2988              fi
2989            fi
2990            dnl Assume the include files are nearby.
2991            additional_includedir=
2992            case "$found_dir" in
2993              */lib | */lib/)
2994                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
2995                additional_includedir="$basedir/include"
2996                ;;
2997            esac
2998            if test "X$additional_includedir" != "X"; then
2999              dnl Potentially add $additional_includedir to $INCNAME.
3000              dnl But don't add it
3001              dnl   1. if it's the standard /usr/include,
3002              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
3003              dnl   3. if it's already present in $CPPFLAGS or the already
3004              dnl      constructed $INCNAME,
3005              dnl   4. if it doesn't exist as a directory.
3006              if test "X$additional_includedir" != "X/usr/include"; then
3007                haveit=
3008                if test "X$additional_includedir" = "X/usr/local/include"; then
3009                  if test -n "$GCC"; then
3010                    case $host_os in
3011                      linux*) haveit=yes;;
3012                    esac
3013                  fi
3014                fi
3015                if test -z "$haveit"; then
3016                  for x in $CPPFLAGS $INC[]NAME; do
3017                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3018                    if test "X$x" = "X-I$additional_includedir"; then
3019                      haveit=yes
3020                      break
3021                    fi
3022                  done
3023                  if test -z "$haveit"; then
3024                    if test -d "$additional_includedir"; then
3025                      dnl Really add $additional_includedir to $INCNAME.
3026                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
3027                    fi
3028                  fi
3029                fi
3030              fi
3031            fi
3032            dnl Look for dependencies.
3033            if test -n "$found_la"; then
3034              dnl Read the .la file. It defines the variables
3035              dnl dlname, library_names, old_library, dependency_libs, current,
3036              dnl age, revision, installed, dlopen, dlpreopen, libdir.
3037              save_libdir="$libdir"
3038              case "$found_la" in
3039                */* | *\\*) . "$found_la" ;;
3040                *) . "./$found_la" ;;
3041              esac
3042              libdir="$save_libdir"
3043              dnl We use only dependency_libs.
3044              for dep in $dependency_libs; do
3045                case "$dep" in
3046                  -L*)
3047                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
3048                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
3049                    dnl But don't add it
3050                    dnl   1. if it's the standard /usr/lib,
3051                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
3052                    dnl   3. if it's already present in $LDFLAGS or the already
3053                    dnl      constructed $LIBNAME,
3054                    dnl   4. if it doesn't exist as a directory.
3055                    if test "X$additional_libdir" != "X/usr/lib"; then
3056                      haveit=
3057                      if test "X$additional_libdir" = "X/usr/local/lib"; then
3058                        if test -n "$GCC"; then
3059                          case $host_os in
3060                            linux*) haveit=yes;;
3061                          esac
3062                        fi
3063                      fi
3064                      if test -z "$haveit"; then
3065                        haveit=
3066                        for x in $LDFLAGS $LIB[]NAME; do
3067                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3068                          if test "X$x" = "X-L$additional_libdir"; then
3069                            haveit=yes
3070                            break
3071                          fi
3072                        done
3073                        if test -z "$haveit"; then
3074                          if test -d "$additional_libdir"; then
3075                            dnl Really add $additional_libdir to $LIBNAME.
3076                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
3077                          fi
3078                        fi
3079                        haveit=
3080                        for x in $LDFLAGS $LTLIB[]NAME; do
3081                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3082                          if test "X$x" = "X-L$additional_libdir"; then
3083                            haveit=yes
3084                            break
3085                          fi
3086                        done
3087                        if test -z "$haveit"; then
3088                          if test -d "$additional_libdir"; then
3089                            dnl Really add $additional_libdir to $LTLIBNAME.
3090                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
3091                          fi
3092                        fi
3093                      fi
3094                    fi
3095                    ;;
3096                  -R*)
3097                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
3098                    if test "$enable_rpath" != no; then
3099                      dnl Potentially add DIR to rpathdirs.
3100                      dnl The rpathdirs will be appended to $LIBNAME at the end.
3101                      haveit=
3102                      for x in $rpathdirs; do
3103                        if test "X$x" = "X$dir"; then
3104                          haveit=yes
3105                          break
3106                        fi
3107                      done
3108                      if test -z "$haveit"; then
3109                        rpathdirs="$rpathdirs $dir"
3110                      fi
3111                      dnl Potentially add DIR to ltrpathdirs.
3112                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
3113                      haveit=
3114                      for x in $ltrpathdirs; do
3115                        if test "X$x" = "X$dir"; then
3116                          haveit=yes
3117                          break
3118                        fi
3119                      done
3120                      if test -z "$haveit"; then
3121                        ltrpathdirs="$ltrpathdirs $dir"
3122                      fi
3123                    fi
3124                    ;;
3125                  -l*)
3126                    dnl Handle this in the next round.
3127                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
3128                    ;;
3129                  *.la)
3130                    dnl Handle this in the next round. Throw away the .la's
3131                    dnl directory; it is already contained in a preceding -L
3132                    dnl option.
3133                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
3134                    ;;
3135                  *)
3136                    dnl Most likely an immediate library name.
3137                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
3138                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
3139                    ;;
3140                esac
3141              done
3142            fi
3143          else
3144            dnl Didn't find the library; assume it is in the system directories
3145            dnl known to the linker and runtime loader. (All the system
3146            dnl directories known to the linker should also be known to the
3147            dnl runtime loader, otherwise the system is severely misconfigured.)
3148            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
3149            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
3150          fi
3151        fi
3152      fi
3153    done
3154  done
3155  if test "X$rpathdirs" != "X"; then
3156    if test -n "$hardcode_libdir_separator"; then
3157      dnl Weird platform: only the last -rpath option counts, the user must
3158      dnl pass all path elements in one option. We can arrange that for a
3159      dnl single library, but not when more than one $LIBNAMEs are used.
3160      alldirs=
3161      for found_dir in $rpathdirs; do
3162        alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
3163      done
3164      dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
3165      acl_save_libdir="$libdir"
3166      libdir="$alldirs"
3167      eval flag=\"$hardcode_libdir_flag_spec\"
3168      libdir="$acl_save_libdir"
3169      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3170    else
3171      dnl The -rpath options are cumulative.
3172      for found_dir in $rpathdirs; do
3173        acl_save_libdir="$libdir"
3174        libdir="$found_dir"
3175        eval flag=\"$hardcode_libdir_flag_spec\"
3176        libdir="$acl_save_libdir"
3177        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
3178      done
3179    fi
3180  fi
3181  if test "X$ltrpathdirs" != "X"; then
3182    dnl When using libtool, the option that works for both libraries and
3183    dnl executables is -R. The -R options are cumulative.
3184    for found_dir in $ltrpathdirs; do
3185      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
3186    done
3187  fi
3188])
3189
3190dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
3191dnl unless already present in VAR.
3192dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
3193dnl contains two or three consecutive elements that belong together.
3194AC_DEFUN([AC_LIB_APPENDTOVAR],
3195[
3196  for element in [$2]; do
3197    haveit=
3198    for x in $[$1]; do
3199      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3200      if test "X$x" = "X$element"; then
3201        haveit=yes
3202        break
3203      fi
3204    done
3205    if test -z "$haveit"; then
3206      [$1]="${[$1]}${[$1]:+ }$element"
3207    fi
3208  done
3209])
3210
3211# lib-ld.m4 serial 3 (gettext-0.13)
3212dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
3213dnl This file is free software, distributed under the terms of the GNU
3214dnl General Public License.  As a special exception to the GNU General
3215dnl Public License, this file may be distributed as part of a program
3216dnl that contains a configuration script generated by Autoconf, under
3217dnl the same distribution terms as the rest of that program.
3218
3219dnl Subroutines of libtool.m4,
3220dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
3221dnl with libtool.m4.
3222
3223dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
3224AC_DEFUN([AC_LIB_PROG_LD_GNU],
3225[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
3226[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
3227case `$LD -v 2>&1 </dev/null` in
3228*GNU* | *'with BFD'*)
3229  acl_cv_prog_gnu_ld=yes ;;
3230*)
3231  acl_cv_prog_gnu_ld=no ;;
3232esac])
3233with_gnu_ld=$acl_cv_prog_gnu_ld
3234])
3235
3236dnl From libtool-1.4. Sets the variable LD.
3237AC_DEFUN([AC_LIB_PROG_LD],
3238[AC_ARG_WITH(gnu-ld,
3239[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
3240test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
3241AC_REQUIRE([AC_PROG_CC])dnl
3242AC_REQUIRE([AC_CANONICAL_HOST])dnl
3243# Prepare PATH_SEPARATOR.
3244# The user is always right.
3245if test "${PATH_SEPARATOR+set}" != set; then
3246  echo "#! /bin/sh" >conf$$.sh
3247  echo  "exit 0"   >>conf$$.sh
3248  chmod +x conf$$.sh
3249  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
3250    PATH_SEPARATOR=';'
3251  else
3252    PATH_SEPARATOR=:
3253  fi
3254  rm -f conf$$.sh
3255fi
3256ac_prog=ld
3257if test "$GCC" = yes; then
3258  # Check if gcc -print-prog-name=ld gives a path.
3259  AC_MSG_CHECKING([for ld used by GCC])
3260  case $host in
3261  *-*-mingw*)
3262    # gcc leaves a trailing carriage return which upsets mingw
3263    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
3264  *)
3265    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
3266  esac
3267  case $ac_prog in
3268    # Accept absolute paths.
3269    [[\\/]* | [A-Za-z]:[\\/]*)]
3270      [re_direlt='/[^/][^/]*/\.\./']
3271      # Canonicalize the path of ld
3272      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
3273      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
3274	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
3275      done
3276      test -z "$LD" && LD="$ac_prog"
3277      ;;
3278  "")
3279    # If it fails, then pretend we aren't using GCC.
3280    ac_prog=ld
3281    ;;
3282  *)
3283    # If it is relative, then search for the first ld in PATH.
3284    with_gnu_ld=unknown
3285    ;;
3286  esac
3287elif test "$with_gnu_ld" = yes; then
3288  AC_MSG_CHECKING([for GNU ld])
3289else
3290  AC_MSG_CHECKING([for non-GNU ld])
3291fi
3292AC_CACHE_VAL(acl_cv_path_LD,
3293[if test -z "$LD"; then
3294  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
3295  for ac_dir in $PATH; do
3296    test -z "$ac_dir" && ac_dir=.
3297    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
3298      acl_cv_path_LD="$ac_dir/$ac_prog"
3299      # Check to see if the program is GNU ld.  I'd rather use --version,
3300      # but apparently some GNU ld's only accept -v.
3301      # Break only if it was the GNU/non-GNU ld that we prefer.
3302      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
3303      *GNU* | *'with BFD'*)
3304	test "$with_gnu_ld" != no && break ;;
3305      *)
3306	test "$with_gnu_ld" != yes && break ;;
3307      esac
3308    fi
3309  done
3310  IFS="$ac_save_ifs"
3311else
3312  acl_cv_path_LD="$LD" # Let the user override the test with a path.
3313fi])
3314LD="$acl_cv_path_LD"
3315if test -n "$LD"; then
3316  AC_MSG_RESULT($LD)
3317else
3318  AC_MSG_RESULT(no)
3319fi
3320test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
3321AC_LIB_PROG_LD_GNU
3322])
3323
3324# iconv.m4 serial AM4 (gettext-0.11.3)
3325dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3326dnl This file is free software, distributed under the terms of the GNU
3327dnl General Public License.  As a special exception to the GNU General
3328dnl Public License, this file may be distributed as part of a program
3329dnl that contains a configuration script generated by Autoconf, under
3330dnl the same distribution terms as the rest of that program.
3331
3332dnl From Bruno Haible.
3333
3334AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
3335[
3336  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3337  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3338  AC_REQUIRE([AC_LIB_RPATH])
3339
3340  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3341  dnl accordingly.
3342  AC_LIB_LINKFLAGS_BODY([iconv])
3343])
3344
3345AC_DEFUN([AM_ICONV_LINK],
3346[
3347  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
3348  dnl those with the standalone portable GNU libiconv installed).
3349
3350  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3351  dnl accordingly.
3352  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
3353
3354  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
3355  dnl because if the user has installed libiconv and not disabled its use
3356  dnl via --without-libiconv-prefix, he wants to use it. The first
3357  dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
3358  am_save_CPPFLAGS="$CPPFLAGS"
3359  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
3360
3361  AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
3362    am_cv_func_iconv="no, consider installing GNU libiconv"
3363    am_cv_lib_iconv=no
3364    AC_TRY_LINK([#include <stdlib.h>
3365#include <iconv.h>],
3366      [iconv_t cd = iconv_open("","");
3367       iconv(cd,NULL,NULL,NULL,NULL);
3368       iconv_close(cd);],
3369      am_cv_func_iconv=yes)
3370    if test "$am_cv_func_iconv" != yes; then
3371      am_save_LIBS="$LIBS"
3372      LIBS="$LIBS $LIBICONV"
3373      AC_TRY_LINK([#include <stdlib.h>
3374#include <iconv.h>],
3375        [iconv_t cd = iconv_open("","");
3376         iconv(cd,NULL,NULL,NULL,NULL);
3377         iconv_close(cd);],
3378        am_cv_lib_iconv=yes
3379        am_cv_func_iconv=yes)
3380      LIBS="$am_save_LIBS"
3381    fi
3382  ])
3383  if test "$am_cv_func_iconv" = yes; then
3384    AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
3385  fi
3386  if test "$am_cv_lib_iconv" = yes; then
3387    AC_MSG_CHECKING([how to link with libiconv])
3388    AC_MSG_RESULT([$LIBICONV])
3389  else
3390    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
3391    dnl either.
3392    CPPFLAGS="$am_save_CPPFLAGS"
3393    LIBICONV=
3394    LTLIBICONV=
3395  fi
3396  AC_SUBST(LIBICONV)
3397  AC_SUBST(LTLIBICONV)
3398])
3399
3400AC_DEFUN([AM_ICONV],
3401[
3402  AM_ICONV_LINK
3403  if test "$am_cv_func_iconv" = yes; then
3404    AC_MSG_CHECKING([for iconv declaration])
3405    AC_CACHE_VAL(am_cv_proto_iconv, [
3406      AC_TRY_COMPILE([
3407#include <stdlib.h>
3408#include <iconv.h>
3409extern
3410#ifdef __cplusplus
3411"C"
3412#endif
3413#if defined(__STDC__) || defined(__cplusplus)
3414size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
3415#else
3416size_t iconv();
3417#endif
3418], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
3419      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);"])
3420    am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
3421    AC_MSG_RESULT([$]{ac_t:-
3422         }[$]am_cv_proto_iconv)
3423    AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
3424      [Define as const if the declaration of iconv() needs const.])
3425  fi
3426])
3427
3428# signed.m4 serial 1 (gettext-0.10.40)
3429dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3430dnl This file is free software, distributed under the terms of the GNU
3431dnl General Public License.  As a special exception to the GNU General
3432dnl Public License, this file may be distributed as part of a program
3433dnl that contains a configuration script generated by Autoconf, under
3434dnl the same distribution terms as the rest of that program.
3435
3436dnl From Bruno Haible.
3437
3438AC_DEFUN([bh_C_SIGNED],
3439[
3440  AC_CACHE_CHECK([for signed], bh_cv_c_signed,
3441   [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
3442  if test $bh_cv_c_signed = no; then
3443    AC_DEFINE(signed, ,
3444              [Define to empty if the C compiler doesn't support this keyword.])
3445  fi
3446])
3447
3448# longlong.m4 serial 4
3449dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
3450dnl This file is free software, distributed under the terms of the GNU
3451dnl General Public License.  As a special exception to the GNU General
3452dnl Public License, this file may be distributed as part of a program
3453dnl that contains a configuration script generated by Autoconf, under
3454dnl the same distribution terms as the rest of that program.
3455
3456dnl From Paul Eggert.
3457
3458# Define HAVE_LONG_LONG if 'long long' works.
3459
3460AC_DEFUN([jm_AC_TYPE_LONG_LONG],
3461[
3462  AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
3463  [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
3464    [long long llmax = (long long) -1;
3465     return ll << i | ll >> i | llmax / ll | llmax % ll;],
3466    ac_cv_type_long_long=yes,
3467    ac_cv_type_long_long=no)])
3468  if test $ac_cv_type_long_long = yes; then
3469    AC_DEFINE(HAVE_LONG_LONG, 1,
3470      [Define if you have the 'long long' type.])
3471  fi
3472])
3473
3474# longdouble.m4 serial 1 (gettext-0.12)
3475dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3476dnl This file is free software, distributed under the terms of the GNU
3477dnl General Public License.  As a special exception to the GNU General
3478dnl Public License, this file may be distributed as part of a program
3479dnl that contains a configuration script generated by Autoconf, under
3480dnl the same distribution terms as the rest of that program.
3481
3482dnl From Bruno Haible.
3483dnl Test whether the compiler supports the 'long double' type.
3484dnl Prerequisite: AC_PROG_CC
3485
3486AC_DEFUN([gt_TYPE_LONGDOUBLE],
3487[
3488  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
3489    [if test "$GCC" = yes; then
3490       gt_cv_c_long_double=yes
3491     else
3492       AC_TRY_COMPILE([
3493         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
3494         long double foo = 0.0;
3495         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
3496         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
3497         ], ,
3498         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
3499     fi])
3500  if test $gt_cv_c_long_double = yes; then
3501    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
3502  fi
3503])
3504
3505# wchar_t.m4 serial 1 (gettext-0.12)
3506dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3507dnl This file is free software, distributed under the terms of the GNU
3508dnl General Public License.  As a special exception to the GNU General
3509dnl Public License, this file may be distributed as part of a program
3510dnl that contains a configuration script generated by Autoconf, under
3511dnl the same distribution terms as the rest of that program.
3512
3513dnl From Bruno Haible.
3514dnl Test whether <stddef.h> has the 'wchar_t' type.
3515dnl Prerequisite: AC_PROG_CC
3516
3517AC_DEFUN([gt_TYPE_WCHAR_T],
3518[
3519  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
3520    [AC_TRY_COMPILE([#include <stddef.h>
3521       wchar_t foo = (wchar_t)'\0';], ,
3522       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
3523  if test $gt_cv_c_wchar_t = yes; then
3524    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
3525  fi
3526])
3527
3528# wint_t.m4 serial 1 (gettext-0.12)
3529dnl Copyright (C) 2003 Free Software Foundation, Inc.
3530dnl This file is free software, distributed under the terms of the GNU
3531dnl General Public License.  As a special exception to the GNU General
3532dnl Public License, this file may be distributed as part of a program
3533dnl that contains a configuration script generated by Autoconf, under
3534dnl the same distribution terms as the rest of that program.
3535
3536dnl From Bruno Haible.
3537dnl Test whether <wchar.h> has the 'wint_t' type.
3538dnl Prerequisite: AC_PROG_CC
3539
3540AC_DEFUN([gt_TYPE_WINT_T],
3541[
3542  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
3543    [AC_TRY_COMPILE([#include <wchar.h>
3544       wint_t foo = (wchar_t)'\0';], ,
3545       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
3546  if test $gt_cv_c_wint_t = yes; then
3547    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
3548  fi
3549])
3550
3551# inttypes_h.m4 serial 5 (gettext-0.12)
3552dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3553dnl This file is free software, distributed under the terms of the GNU
3554dnl General Public License.  As a special exception to the GNU General
3555dnl Public License, this file may be distributed as part of a program
3556dnl that contains a configuration script generated by Autoconf, under
3557dnl the same distribution terms as the rest of that program.
3558
3559dnl From Paul Eggert.
3560
3561# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
3562# doesn't clash with <sys/types.h>, and declares uintmax_t.
3563
3564AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
3565[
3566  AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
3567  [AC_TRY_COMPILE(
3568    [#include <sys/types.h>
3569#include <inttypes.h>],
3570    [uintmax_t i = (uintmax_t) -1;],
3571    jm_ac_cv_header_inttypes_h=yes,
3572    jm_ac_cv_header_inttypes_h=no)])
3573  if test $jm_ac_cv_header_inttypes_h = yes; then
3574    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
3575      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
3576       and declares uintmax_t. ])
3577  fi
3578])
3579
3580# stdint_h.m4 serial 3 (gettext-0.12)
3581dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3582dnl This file is free software, distributed under the terms of the GNU
3583dnl General Public License.  As a special exception to the GNU General
3584dnl Public License, this file may be distributed as part of a program
3585dnl that contains a configuration script generated by Autoconf, under
3586dnl the same distribution terms as the rest of that program.
3587
3588dnl From Paul Eggert.
3589
3590# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
3591# doesn't clash with <sys/types.h>, and declares uintmax_t.
3592
3593AC_DEFUN([jm_AC_HEADER_STDINT_H],
3594[
3595  AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
3596  [AC_TRY_COMPILE(
3597    [#include <sys/types.h>
3598#include <stdint.h>],
3599    [uintmax_t i = (uintmax_t) -1;],
3600    jm_ac_cv_header_stdint_h=yes,
3601    jm_ac_cv_header_stdint_h=no)])
3602  if test $jm_ac_cv_header_stdint_h = yes; then
3603    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
3604      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
3605       and declares uintmax_t. ])
3606  fi
3607])
3608
3609# intmax.m4 serial 1 (gettext-0.12)
3610dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3611dnl This file is free software, distributed under the terms of the GNU
3612dnl General Public License.  As a special exception to the GNU General
3613dnl Public License, this file may be distributed as part of a program
3614dnl that contains a configuration script generated by Autoconf, under
3615dnl the same distribution terms as the rest of that program.
3616
3617dnl From Bruno Haible.
3618dnl Test whether the system has the 'intmax_t' type, but don't attempt to
3619dnl find a replacement if it is lacking.
3620
3621AC_DEFUN([gt_TYPE_INTMAX_T],
3622[
3623  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3624  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3625  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3626    [AC_TRY_COMPILE([
3627#include <stddef.h>
3628#include <stdlib.h>
3629#if HAVE_STDINT_H_WITH_UINTMAX
3630#include <stdint.h>
3631#endif
3632#if HAVE_INTTYPES_H_WITH_UINTMAX
3633#include <inttypes.h>
3634#endif
3635], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3636  if test $gt_cv_c_intmax_t = yes; then
3637    AC_DEFINE(HAVE_INTMAX_T, 1,
3638      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3639  fi
3640])
3641
3642# printf-posix.m4 serial 2 (gettext-0.13.1)
3643dnl Copyright (C) 2003 Free Software Foundation, Inc.
3644dnl This file is free software, distributed under the terms of the GNU
3645dnl General Public License.  As a special exception to the GNU General
3646dnl Public License, this file may be distributed as part of a program
3647dnl that contains a configuration script generated by Autoconf, under
3648dnl the same distribution terms as the rest of that program.
3649
3650dnl From Bruno Haible.
3651dnl Test whether the printf() function supports POSIX/XSI format strings with
3652dnl positions.
3653
3654AC_DEFUN([gt_PRINTF_POSIX],
3655[
3656  AC_REQUIRE([AC_PROG_CC])
3657  AC_CACHE_CHECK([whether printf() supports POSIX/XSI format strings],
3658    gt_cv_func_printf_posix,
3659    [
3660      AC_TRY_RUN([
3661#include <stdio.h>
3662#include <string.h>
3663/* The string "%2$d %1$d", with dollar characters protected from the shell's
3664   dollar expansion (possibly an autoconf bug).  */
3665static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
3666static char buf[100];
3667int main ()
3668{
3669  sprintf (buf, format, 33, 55);
3670  return (strcmp (buf, "55 33") != 0);
3671}], gt_cv_func_printf_posix=yes, gt_cv_func_printf_posix=no,
3672      [
3673        AC_EGREP_CPP(notposix, [
3674#if defined __NetBSD__ || defined _MSC_VER || defined __MINGW32__ || defined __CYGWIN__
3675  notposix
3676#endif
3677        ], gt_cv_func_printf_posix="guessing no",
3678           gt_cv_func_printf_posix="guessing yes")
3679      ])
3680    ])
3681  case $gt_cv_func_printf_posix in
3682    *yes)
3683      AC_DEFINE(HAVE_POSIX_PRINTF, 1,
3684        [Define if your printf() function supports format strings with positions.])
3685      ;;
3686  esac
3687])
3688
3689# glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3690dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3691dnl This file is free software, distributed under the terms of the GNU
3692dnl General Public License.  As a special exception to the GNU General
3693dnl Public License, this file may be distributed as part of a program
3694dnl that contains a configuration script generated by Autoconf, under
3695dnl the same distribution terms as the rest of that program.
3696
3697# Test for the GNU C Library, version 2.1 or newer.
3698# From Bruno Haible.
3699
3700AC_DEFUN([jm_GLIBC21],
3701  [
3702    AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3703      ac_cv_gnu_library_2_1,
3704      [AC_EGREP_CPP([Lucky GNU user],
3705	[
3706#include <features.h>
3707#ifdef __GNU_LIBRARY__
3708 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3709  Lucky GNU user
3710 #endif
3711#endif
3712	],
3713	ac_cv_gnu_library_2_1=yes,
3714	ac_cv_gnu_library_2_1=no)
3715      ]
3716    )
3717    AC_SUBST(GLIBC21)
3718    GLIBC21="$ac_cv_gnu_library_2_1"
3719  ]
3720)
3721
3722# intdiv0.m4 serial 1 (gettext-0.11.3)
3723dnl Copyright (C) 2002 Free Software Foundation, Inc.
3724dnl This file is free software, distributed under the terms of the GNU
3725dnl General Public License.  As a special exception to the GNU General
3726dnl Public License, this file may be distributed as part of a program
3727dnl that contains a configuration script generated by Autoconf, under
3728dnl the same distribution terms as the rest of that program.
3729
3730dnl From Bruno Haible.
3731
3732AC_DEFUN([gt_INTDIV0],
3733[
3734  AC_REQUIRE([AC_PROG_CC])dnl
3735  AC_REQUIRE([AC_CANONICAL_HOST])dnl
3736
3737  AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
3738    gt_cv_int_divbyzero_sigfpe,
3739    [
3740      AC_TRY_RUN([
3741#include <stdlib.h>
3742#include <signal.h>
3743
3744static void
3745#ifdef __cplusplus
3746sigfpe_handler (int sig)
3747#else
3748sigfpe_handler (sig) int sig;
3749#endif
3750{
3751  /* Exit with code 0 if SIGFPE, with code 1 if any other signal.  */
3752  exit (sig != SIGFPE);
3753}
3754
3755int x = 1;
3756int y = 0;
3757int z;
3758int nan;
3759
3760int main ()
3761{
3762  signal (SIGFPE, sigfpe_handler);
3763/* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP.  */
3764#if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
3765  signal (SIGTRAP, sigfpe_handler);
3766#endif
3767/* Linux/SPARC yields signal SIGILL.  */
3768#if defined (__sparc__) && defined (__linux__)
3769  signal (SIGILL, sigfpe_handler);
3770#endif
3771
3772  z = x / y;
3773  nan = y / y;
3774  exit (1);
3775}
3776], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
3777        [
3778          # Guess based on the CPU.
3779          case "$host_cpu" in
3780            alpha* | i[34567]86 | m68k | s390*)
3781              gt_cv_int_divbyzero_sigfpe="guessing yes";;
3782            *)
3783              gt_cv_int_divbyzero_sigfpe="guessing no";;
3784          esac
3785        ])
3786    ])
3787  case "$gt_cv_int_divbyzero_sigfpe" in
3788    *yes) value=1;;
3789    *) value=0;;
3790  esac
3791  AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
3792    [Define if integer division by zero raises signal SIGFPE.])
3793])
3794
3795# uintmax_t.m4 serial 7 (gettext-0.12)
3796dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3797dnl This file is free software, distributed under the terms of the GNU
3798dnl General Public License.  As a special exception to the GNU General
3799dnl Public License, this file may be distributed as part of a program
3800dnl that contains a configuration script generated by Autoconf, under
3801dnl the same distribution terms as the rest of that program.
3802
3803dnl From Paul Eggert.
3804
3805AC_PREREQ(2.13)
3806
3807# Define uintmax_t to 'unsigned long' or 'unsigned long long'
3808# if it is not already defined in <stdint.h> or <inttypes.h>.
3809
3810AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
3811[
3812  AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3813  AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3814  if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3815    AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3816    test $ac_cv_type_unsigned_long_long = yes \
3817      && ac_type='unsigned long long' \
3818      || ac_type='unsigned long'
3819    AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
3820      [Define to unsigned long or unsigned long long
3821       if <stdint.h> and <inttypes.h> don't define.])
3822  else
3823    AC_DEFINE(HAVE_UINTMAX_T, 1,
3824      [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
3825  fi
3826])
3827
3828# ulonglong.m4 serial 3
3829dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
3830dnl This file is free software, distributed under the terms of the GNU
3831dnl General Public License.  As a special exception to the GNU General
3832dnl Public License, this file may be distributed as part of a program
3833dnl that contains a configuration script generated by Autoconf, under
3834dnl the same distribution terms as the rest of that program.
3835
3836dnl From Paul Eggert.
3837
3838# Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
3839
3840AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
3841[
3842  AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
3843  [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
3844    [unsigned long long ullmax = (unsigned long long) -1;
3845     return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
3846    ac_cv_type_unsigned_long_long=yes,
3847    ac_cv_type_unsigned_long_long=no)])
3848  if test $ac_cv_type_unsigned_long_long = yes; then
3849    AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
3850      [Define if you have the 'unsigned long long' type.])
3851  fi
3852])
3853
3854# inttypes.m4 serial 1 (gettext-0.11.4)
3855dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3856dnl This file is free software, distributed under the terms of the GNU
3857dnl General Public License.  As a special exception to the GNU General
3858dnl Public License, this file may be distributed as part of a program
3859dnl that contains a configuration script generated by Autoconf, under
3860dnl the same distribution terms as the rest of that program.
3861
3862dnl From Paul Eggert.
3863
3864# Define HAVE_INTTYPES_H if <inttypes.h> exists and doesn't clash with
3865# <sys/types.h>.
3866
3867AC_DEFUN([gt_HEADER_INTTYPES_H],
3868[
3869  AC_CACHE_CHECK([for inttypes.h], gt_cv_header_inttypes_h,
3870  [
3871    AC_TRY_COMPILE(
3872      [#include <sys/types.h>
3873#include <inttypes.h>],
3874      [], gt_cv_header_inttypes_h=yes, gt_cv_header_inttypes_h=no)
3875  ])
3876  if test $gt_cv_header_inttypes_h = yes; then
3877    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H, 1,
3878      [Define if <inttypes.h> exists and doesn't clash with <sys/types.h>.])
3879  fi
3880])
3881
3882# inttypes-pri.m4 serial 1 (gettext-0.11.4)
3883dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3884dnl This file is free software, distributed under the terms of the GNU
3885dnl General Public License.  As a special exception to the GNU General
3886dnl Public License, this file may be distributed as part of a program
3887dnl that contains a configuration script generated by Autoconf, under
3888dnl the same distribution terms as the rest of that program.
3889
3890dnl From Bruno Haible.
3891
3892# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3893# macros to non-string values.  This is the case on AIX 4.3.3.
3894
3895AC_DEFUN([gt_INTTYPES_PRI],
3896[
3897  AC_REQUIRE([gt_HEADER_INTTYPES_H])
3898  if test $gt_cv_header_inttypes_h = yes; then
3899    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3900      gt_cv_inttypes_pri_broken,
3901      [
3902        AC_TRY_COMPILE([#include <inttypes.h>
3903#ifdef PRId32
3904char *p = PRId32;
3905#endif
3906], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3907      ])
3908  fi
3909  if test "$gt_cv_inttypes_pri_broken" = yes; then
3910    AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3911      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3912  fi
3913])
3914
3915# xsize.m4 serial 2
3916dnl Copyright (C) 2003 Free Software Foundation, Inc.
3917dnl This file is free software, distributed under the terms of the GNU
3918dnl General Public License.  As a special exception to the GNU General
3919dnl Public License, this file may be distributed as part of a program
3920dnl that contains a configuration script generated by Autoconf, under
3921dnl the same distribution terms as the rest of that program.
3922
3923AC_DEFUN([gl_XSIZE],
3924[
3925  dnl Prerequisites of lib/xsize.h.
3926  AC_REQUIRE([gl_SIZE_MAX])
3927  AC_CHECK_HEADERS(stdint.h)
3928])
3929
3930# size_max.m4 serial 2
3931dnl Copyright (C) 2003 Free Software Foundation, Inc.
3932dnl This file is free software, distributed under the terms of the GNU
3933dnl General Public License.  As a special exception to the GNU General
3934dnl Public License, this file may be distributed as part of a program
3935dnl that contains a configuration script generated by Autoconf, under
3936dnl the same distribution terms as the rest of that program.
3937
3938dnl From Bruno Haible.
3939
3940AC_DEFUN([gl_SIZE_MAX],
3941[
3942  AC_CHECK_HEADERS(stdint.h)
3943  dnl First test whether the system already has SIZE_MAX.
3944  AC_MSG_CHECKING([for SIZE_MAX])
3945  result=
3946  AC_EGREP_CPP([Found it], [
3947#include <limits.h>
3948#if HAVE_STDINT_H
3949#include <stdint.h>
3950#endif
3951#ifdef SIZE_MAX
3952Found it
3953#endif
3954], result=yes)
3955  if test -z "$result"; then
3956    dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
3957    dnl than the type 'unsigned long'.
3958    dnl The _AC_COMPUTE_INT macro works up to LONG_MAX, since it uses 'expr',
3959    dnl which is guaranteed to work from LONG_MIN to LONG_MAX.
3960    _AC_COMPUTE_INT([~(size_t)0 / 10], res_hi,
3961      [#include <stddef.h>], result=?)
3962    _AC_COMPUTE_INT([~(size_t)0 % 10], res_lo,
3963      [#include <stddef.h>], result=?)
3964    _AC_COMPUTE_INT([sizeof (size_t) <= sizeof (unsigned int)], fits_in_uint,
3965      [#include <stddef.h>], result=?)
3966    if test "$fits_in_uint" = 1; then
3967      dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
3968      dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
3969      AC_TRY_COMPILE([#include <stddef.h>
3970        extern size_t foo;
3971        extern unsigned long foo;
3972        ], [], fits_in_uint=0)
3973    fi
3974    if test -z "$result"; then
3975      if test "$fits_in_uint" = 1; then
3976        result="$res_hi$res_lo"U
3977      else
3978        result="$res_hi$res_lo"UL
3979      fi
3980    else
3981      dnl Shouldn't happen, but who knows...
3982      result='~(size_t)0'
3983    fi
3984  fi
3985  AC_MSG_RESULT([$result])
3986  if test "$result" != yes; then
3987    AC_DEFINE_UNQUOTED([SIZE_MAX], [$result],
3988      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
3989  fi
3990])
3991
3992# codeset.m4 serial AM1 (gettext-0.10.40)
3993dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3994dnl This file is free software, distributed under the terms of the GNU
3995dnl General Public License.  As a special exception to the GNU General
3996dnl Public License, this file may be distributed as part of a program
3997dnl that contains a configuration script generated by Autoconf, under
3998dnl the same distribution terms as the rest of that program.
3999
4000dnl From Bruno Haible.
4001
4002AC_DEFUN([AM_LANGINFO_CODESET],
4003[
4004  AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
4005    [AC_TRY_LINK([#include <langinfo.h>],
4006      [char* cs = nl_langinfo(CODESET);],
4007      am_cv_langinfo_codeset=yes,
4008      am_cv_langinfo_codeset=no)
4009    ])
4010  if test $am_cv_langinfo_codeset = yes; then
4011    AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
4012      [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
4013  fi
4014])
4015
4016# lcmessage.m4 serial 3 (gettext-0.11.3)
4017dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
4018dnl This file is free software, distributed under the terms of the GNU
4019dnl General Public License.  As a special exception to the GNU General
4020dnl Public License, this file may be distributed as part of a program
4021dnl that contains a configuration script generated by Autoconf, under
4022dnl the same distribution terms as the rest of that program.
4023dnl
4024dnl This file can can be used in projects which are not available under
4025dnl the GNU General Public License or the GNU Library General Public
4026dnl License but which still want to provide support for the GNU gettext
4027dnl functionality.
4028dnl Please note that the actual code of the GNU gettext library is covered
4029dnl by the GNU Library General Public License, and the rest of the GNU
4030dnl gettext package package is covered by the GNU General Public License.
4031dnl They are *not* in the public domain.
4032
4033dnl Authors:
4034dnl   Ulrich Drepper <drepper@cygnus.com>, 1995.
4035
4036# Check whether LC_MESSAGES is available in <locale.h>.
4037
4038AC_DEFUN([AM_LC_MESSAGES],
4039[
4040  AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
4041    [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
4042       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
4043  if test $am_cv_val_LC_MESSAGES = yes; then
4044    AC_DEFINE(HAVE_LC_MESSAGES, 1,
4045      [Define if your <locale.h> file defines LC_MESSAGES.])
4046  fi
4047])
4048
4049