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