1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
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.
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
14 # Do all the work for Automake. -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things. But this isn't really a big deal.
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out. PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition. After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58 AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61 test -f $srcdir/config.status; then
62 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67 if (cygpath --version) >/dev/null 2>/dev/null; then
68 CYGPATH_W='cygpath -w'
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79 AC_SUBST([PACKAGE], [$1])dnl
80 AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
100 # We need awk for the "check" target. The system "awk" is bad on
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108 [_AM_DEPENDENCIES(CC)],
109 [define([AC_PROG_CC],
110 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112 [_AM_DEPENDENCIES(CXX)],
113 [define([AC_PROG_CXX],
114 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated. The stamp files are numbered to have different names.
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
129 for _am_header in $config_headers :; do
134 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
139 # Copyright 2002 Free Software Foundation, Inc.
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 # GNU General Public License for more details.
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166 [AM_AUTOMAKE_VERSION([1.7.6])])
168 # Helper functions for option handling. -*- Autoconf -*-
170 # Copyright 2001, 2002 Free Software Foundation, Inc.
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 # GNU General Public License for more details.
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME. Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
213 # Check to make sure that the build environment is sane.
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
226 # GNU General Public License for more details.
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments. Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
248 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249 if test "$[*]" = "X"; then
251 set X `ls -t $srcdir/configure conftest.file`
254 if test "$[*]" != "X $srcdir/configure conftest.file" \
255 && test "$[*]" != "X conftest.file $srcdir/configure"; then
257 # If neither matched, then we have a broken ls. This can happen
258 # if, for instance, CONFIG_SHELL is bash and it inherits a
259 # broken ls alias from the environment. This has actually
260 # happened. Such a system could not be considered "sane".
261 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
262 alias in your environment])
265 test "$[2]" = conftest.file
271 AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
289 # GNU General Public License for more details.
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315 am_missing_run="$MISSING --run "
318 AC_MSG_WARN([`missing' script is too old or missing])
324 # Copyright 2001 Free Software Foundation, Inc.
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
334 # GNU General Public License for more details.
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory. The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run. This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
353 # $ac_aux_dir/missing
354 # fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 # fails if $ac_aux_dir is absolute,
357 # fails when called from a subdirectory in a VPATH build with
358 # a relative $ac_aux_dir
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir. In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
367 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 # MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH. The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
379 # Rely on autoconf to set up CDPATH properly.
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
389 # Define $install_sh.
391 # Copyright 2001 Free Software Foundation, Inc.
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 # GNU General Public License for more details.
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
413 # AM_PROG_INSTALL_STRIP
415 # Copyright 2001 Free Software Foundation, Inc.
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425 # GNU General Public License for more details.
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries. This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'. However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447 AC_CHECK_TOOL([STRIP], [strip], :)
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
453 # Copyright (C) 2003 Free Software Foundation, Inc.
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
463 # GNU General Public License for more details.
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot. For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
485 # serial 5 -*- Autoconf -*-
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497 # GNU General Public License for more details.
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery. Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
529 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
530 [$1], CXX, [depcc="$CXX" am_compiler_list=],
531 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
533 [depcc="$$1" am_compiler_list=])
535 AC_CACHE_CHECK([dependency style of $depcc],
536 [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538 # We make a subdir and do the tests there. Otherwise we can end up
539 # making bogus files that we don't know about and never remove. For
540 # instance it was reported that on HP-UX the gcc test will end up
541 # making a dummy file named `D' -- because `-MD' means `put the output
544 # Copy depcomp to subdir because otherwise we won't find it if we're
545 # using a relative directory.
546 cp "$am_depcomp" conftest.dir
548 # We will build objects and dependencies in a subdirectory because
549 # it helps to detect inapplicable dependency modes. For instance
550 # both Tru64's cc and ICC support -MD to output dependencies as a
551 # side effect of compilation, but ICC will put the dependencies in
552 # the current directory while Tru64 will put them in the object
556 am_cv_$1_dependencies_compiler_type=none
557 if test "$am_compiler_list" = ""; then
558 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
560 for depmode in $am_compiler_list; do
561 # Setup a source with many dependencies, because some compilers
562 # like to wrap large dependency lists on column 80 (with \), and
563 # we should not choose a depcomp mode which is confused by this.
565 # We need to recreate these files for each test, as the compiler may
566 # overwrite some of them when testing with obscure command lines.
567 # This happens at least with the AIX C compiler.
569 for i in 1 2 3 4 5 6; do
570 echo '#include "conftst'$i'.h"' >> sub/conftest.c
573 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
577 # after this tag, mechanisms are not by side-effect, so they'll
578 # only be used when explicitly requested
579 if test "x$enable_dependency_tracking" = xyes; then
587 # We check with `-c' and `-o' for the sake of the "dashmstdout"
588 # mode. It turns out that the SunPro C++ compiler does not properly
589 # handle `-M -o', and we need to detect this.
590 if depmode=$depmode \
591 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594 >/dev/null 2>conftest.err &&
595 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598 # icc doesn't choke on unknown options, it will just issue warnings
599 # (even with -Werror). So we grep stderr for any message
600 # that says an option was ignored.
601 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602 am_cv_$1_dependencies_compiler_type=$depmode
611 am_cv_$1_dependencies_compiler_type=none
614 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615 AM_CONDITIONAL([am__fastdep$1], [
616 test "x$enable_dependency_tracking" != xno \
617 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
623 # Choose a directory name for dependency files.
624 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
625 AC_DEFUN([AM_SET_DEPDIR],
626 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
633 AC_DEFUN([AM_DEP_TRACK],
634 [AC_ARG_ENABLE(dependency-tracking,
635 [ --disable-dependency-tracking Speeds up one-time builds
636 --enable-dependency-tracking Do not reject slow dependency extractors])
637 if test "x$enable_dependency_tracking" != xno; then
638 am_depcomp="$ac_aux_dir/depcomp"
641 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642 AC_SUBST([AMDEPBACKSLASH])
645 # Generate code to set up dependency tracking. -*- Autoconf -*-
647 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
649 # This program is free software; you can redistribute it and/or modify
650 # it under the terms of the GNU General Public License as published by
651 # the Free Software Foundation; either version 2, or (at your option)
654 # This program is distributed in the hope that it will be useful,
655 # but WITHOUT ANY WARRANTY; without even the implied warranty of
656 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
657 # GNU General Public License for more details.
659 # You should have received a copy of the GNU General Public License
660 # along with this program; if not, write to the Free Software
661 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # ------------------------------
668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669 [for mf in $CONFIG_FILES; do
670 # Strip MF so we end up with the name of the file.
671 mf=`echo "$mf" | sed -e 's/:.*$//'`
672 # Check whether this is an Automake generated Makefile or not.
673 # We used to match only the files named `Makefile.in', but
674 # some people rename them; so instead we look at the file content.
675 # Grep'ing the first line is not enough: some people post-process
676 # each Makefile.in and add a new line on top of each file to say so.
677 # So let's grep whole file.
678 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679 dirpart=`AS_DIRNAME("$mf")`
683 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684 # Extract the definition of DEP_FILES from the Makefile without
686 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687 test -z "$DEPDIR" && continue
688 # When using ansi2knr, U may be empty or an underscore; expand it
689 U=`sed -n -e '/^U = / s///p' < "$mf"`
690 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691 # We invoke sed twice because it is the simplest approach to
692 # changing $(DEPDIR) to its actual value in the expansion.
693 for file in `sed -n -e '
694 /^DEP_FILES = .*\\\\$/ {
703 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705 # Make sure the directory exists.
706 test -f "$dirpart/$file" && continue
707 fdir=`AS_DIRNAME(["$file"])`
708 AS_MKDIR_P([$dirpart/$fdir])
709 # echo "creating $dirpart/$file"
710 echo '# dummy' > "$dirpart/$file"
713 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
716 # AM_OUTPUT_DEPENDENCY_COMMANDS
717 # -----------------------------
718 # This macro should only be invoked once -- use via AC_REQUIRE.
720 # This code is only required when automatic dependency tracking
721 # is enabled. FIXME. This creates each `.P' file that we will
722 # need in order to bootstrap the dependency handling code.
723 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AC_CONFIG_COMMANDS([depfiles],
725 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
729 # Check to see how 'make' treats includes. -*- Autoconf -*-
731 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
733 # This program is free software; you can redistribute it and/or modify
734 # it under the terms of the GNU General Public License as published by
735 # the Free Software Foundation; either version 2, or (at your option)
738 # This program is distributed in the hope that it will be useful,
739 # but WITHOUT ANY WARRANTY; without even the implied warranty of
740 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
741 # GNU General Public License for more details.
743 # You should have received a copy of the GNU General Public License
744 # along with this program; if not, write to the Free Software
745 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
752 # Check to see how make treats includes.
753 AC_DEFUN([AM_MAKE_INCLUDE],
754 [am_make=${MAKE-make}
755 cat > confinc << 'END'
760 # If we don't find an include directive, just comment out the code.
761 AC_MSG_CHECKING([for style of include used by $am_make])
765 # First try GNU make style include.
766 echo "include confinc" > confmf
767 # We grep out `Entering directory' and `Leaving directory'
768 # messages which can occur if `w' ends up in MAKEFLAGS.
769 # In particular we don't look at `^make:' because GNU make might
770 # be invoked under some other name (usually "gmake"), in which
771 # case it prints its new name instead of `make'.
772 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
777 # Now try BSD make style include.
778 if test "$am__include" = "#"; then
779 echo '.include "confinc"' > confmf
780 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
786 AC_SUBST([am__include])
787 AC_SUBST([am__quote])
788 AC_MSG_RESULT([$_am_result])
792 # AM_CONDITIONAL -*- Autoconf -*-
794 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
796 # This program is free software; you can redistribute it and/or modify
797 # it under the terms of the GNU General Public License as published by
798 # the Free Software Foundation; either version 2, or (at your option)
801 # This program is distributed in the hope that it will be useful,
802 # but WITHOUT ANY WARRANTY; without even the implied warranty of
803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
804 # GNU General Public License for more details.
806 # You should have received a copy of the GNU General Public License
807 # along with this program; if not, write to the Free Software
808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
815 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
816 # -------------------------------------
817 # Define a conditional.
818 AC_DEFUN([AM_CONDITIONAL],
819 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
820 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
830 AC_CONFIG_COMMANDS_PRE(
831 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832 AC_MSG_ERROR([conditional "$1" was never defined.
833 Usually this means the macro was only invoked conditionally.])
838 dnl From Jim Meyering.
839 dnl Find a new-enough version of Perl.
844 dnl FIXME: don't hard-code 5.003
845 dnl FIXME: should we cache the result?
846 AC_MSG_CHECKING([for perl5.003 or newer])
847 if test "${PERL+set}" = set; then
848 # `PERL' is set in the user's environment.
849 candidate_perl_names="$PERL"
852 candidate_perl_names='perl perl5'
858 PERL="$am_missing_run perl"
859 for perl in $candidate_perl_names; do
860 # Run test in a subshell; some versions of sh will print an error if
861 # an executable is not found, even if stderr is redirected.
862 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
869 AC_MSG_RESULT($found)
870 test $found = no && AC_MSG_WARN([
871 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
872 a usable version of the Perl File::Compare module. As a result,
873 you may be unable to run a few tests or to regenerate certain
874 files if you modify the sources from which they are derived.
878 #serial 66 -*- autoconf -*-
880 m4_undefine([AC_LANG_SOURCE(C)])
881 dnl The following is identical to the definition in c.m4
882 dnl from the autoconf cvs repository on 2003-03-07.
883 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
885 # We can't use '#line $LINENO "configure"' here, since
886 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
887 # rejects $LINENO greater than 32767, and some configure scripts
888 # are longer than 32767 lines.
889 m4_define([AC_LANG_SOURCE(C)],
892 cat confdefs.h >>conftest.$ac_ext
893 cat >>conftest.$ac_ext <<_ACEOF
894 /* end confdefs.h. */
898 dnl Misc type-related macros for fileutils, sh-utils, textutils.
900 AC_DEFUN([jm_MACROS],
904 GNU_PACKAGE="GNU $PACKAGE"
905 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
906 [The concatenation of the strings `GNU ', and PACKAGE.])
907 AC_SUBST(GNU_PACKAGE)
909 AM_MISSING_PROG(HELP2MAN, help2man)
910 AC_SUBST(OPTIONAL_BIN_PROGS)
914 dnl This macro actually runs replacement code. See isc-posix.m4.
915 AC_REQUIRE([AC_ISC_POSIX])dnl
918 jm_INCLUDED_REGEX([lib/regex.c])
920 AC_REQUIRE([UTILS_HOST_OS])
921 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
922 AC_REQUIRE([jm_BISON])
923 AC_REQUIRE([jm_ASSERT])
924 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
925 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
926 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
927 AC_REQUIRE([jm_CHECK_DECLS])
929 AC_REQUIRE([jm_PREREQ])
931 AC_REQUIRE([UTILS_FUNC_DIRFD])
932 AC_REQUIRE([AC_FUNC_ACL])
933 AC_REQUIRE([AC_FUNC_FTW])
934 AC_REQUIRE([jm_FUNC_LCHOWN])
935 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
936 AC_REQUIRE([jm_FUNC_CHOWN])
937 AC_REQUIRE([jm_FUNC_MKTIME])
938 AC_REQUIRE([jm_FUNC_LSTAT])
939 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
940 AC_REQUIRE([jm_FUNC_STAT])
941 AC_REQUIRE([AC_FUNC_REALLOC])
942 AC_REQUIRE([AC_FUNC_MALLOC])
943 AC_REQUIRE([AC_FUNC_STRERROR_R])
944 AC_REQUIRE([jm_FUNC_NANOSLEEP])
945 AC_REQUIRE([jm_FUNC_MEMCMP])
946 AC_REQUIRE([gl_MEMCOLL])
947 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
948 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
949 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
950 AC_REQUIRE([jm_FUNC_PUTENV])
952 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
953 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
954 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
955 AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
956 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
957 AC_REQUIRE([jm_FUNC_MKTIME])
958 AC_REQUIRE([jm_FUNC_FPENDING])
960 # This is for od and stat, and any other program that
961 # uses the PRI.MAX macros from inttypes.h.
962 AC_REQUIRE([gt_INTTYPES_PRI])
964 AC_REQUIRE([jm_FUNC_GETGROUPS])
966 AC_REQUIRE([AC_FUNC_FSEEKO])
967 AC_REQUIRE([AC_FUNC_VPRINTF])
968 AC_REQUIRE([AC_FUNC_ALLOCA])
969 AC_REQUIRE([gl_FUNC_ALLOCA])
971 AC_CONFIG_LIBOBJ_DIR([lib])
974 AC_REQUIRE([jm_SYS_PROC_UPTIME])
975 AC_REQUIRE([jm_FUNC_FTRUNCATE])
976 AC_REQUIRE([vb_FUNC_RENAME])
978 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
979 AC_REPLACE_FUNCS(dup2)
980 AC_REPLACE_FUNCS(gethostname getusershell)
981 AC_REPLACE_FUNCS(sig2str)
982 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
983 AC_REPLACE_FUNCS(strpbrk)
984 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
985 AC_REPLACE_FUNCS(atexit)
986 AC_REPLACE_FUNCS(getpass)
988 # raise is used by at least sort and ls.
989 AC_REPLACE_FUNCS(raise)
991 dnl used by e.g. intl/*domain.c and lib/canon-host.c
992 AC_REPLACE_FUNCS(strdup)
994 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
995 AC_CHECK_FUNCS(getpagesize)
997 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
999 # By default, argmatch should fail calling usage (1).
1000 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
1001 [Define to the function xargmatch calls on failures.])
1002 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
1003 [Define to the declaration of the xargmatch failure function.])
1005 dnl Used to define SETVBUF in sys2.h.
1006 dnl This evokes the following warning from autoconf:
1007 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
1008 AC_FUNC_SETVBUF_REVERSED
1010 # used by sleep and shred
1011 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
1012 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
1014 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
1015 # programs in the package would end up linked with that potentially-shared
1016 # library, inducing unnecessary run-time overhead.
1017 fetish_saved_libs=$LIBS
1018 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
1019 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
1020 AC_SUBST(LIB_CLOCK_GETTIME)
1021 AC_CHECK_FUNCS(clock_gettime clock_settime)
1022 LIBS=$fetish_saved_libs
1023 AC_CHECK_FUNCS(gettimeofday)
1024 AC_FUNC_GETTIMEOFDAY_CLOBBER
1026 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
1027 AC_REQUIRE([jm_FUNC_UTIME])
1028 AC_REQUIRE([gl_FUNC_VASPRINTF])
1029 AC_REQUIRE([gl_FUNC_VASNPRINTF])
1063 AC_CHECK_FUNCS(setreuid setregid)
1066 if test $am_cv_func_working_getline != yes; then
1067 AC_CHECK_FUNCS(getdelim)
1072 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1073 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
1074 AC_REQUIRE([GL_FUNC_READDIR])
1076 # See if linking `seq' requires -lm.
1077 # It does on nearly every system. The single exception (so far) is
1078 # BeOS which has all the math functions in the normal runtime library
1079 # and doesn't have a separate math library.
1087 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1088 [ac_seq_save_LIBS="$LIBS"
1090 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1091 LIBS="$ac_seq_save_LIBS"
1097 jm_FUNC_UNLINK_BUSY_TEXT
1099 # These tests are for df.
1100 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1102 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1103 if test $list_mounted_fs = yes && test $space = yes; then
1104 DF_PROG='df$(EXEEXT)'
1106 AC_LIBOBJ(mountlist)
1108 AC_REQUIRE([jm_AC_DOS])
1109 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1111 # If any of these functions don't exist (e.g. DJGPP 2.03),
1112 # use the corresponding stub.
1113 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
1114 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
1115 AC_CHECK_FUNC([lstat], , [AC_LIBOBJ(lstat-stub)])
1116 AC_CHECK_FUNC([readlink], , [AC_LIBOBJ(readlink-stub)])
1117 AC_REQUIRE([AM_STDBOOL_H])
1121 # These tests must be run before any use of AC_CHECK_TYPE,
1122 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1123 # See the definition of ac_includes_default in `configure'.
1124 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1167 # This macro must be invoked before any tests that run the compiler.
1168 AC_DEFUN([jm_CHECK_ALL_TYPES],
1170 dnl This test must come as early as possible after the compiler configuration
1171 dnl tests, because the choice of the file model can (in principle) affect
1172 dnl whether functions and headers are available, whether they work, etc.
1173 AC_REQUIRE([AC_SYS_LARGEFILE])
1175 dnl This test must precede tests of compiler characteristics like
1176 dnl that for the inline keyword, since it may change the degree to
1177 dnl which the compiler supports such features.
1178 AC_REQUIRE([AM_C_PROTOTYPES])
1180 dnl Checks for typedefs, structures, and compiler characteristics.
1181 AC_REQUIRE([AC_C_BIGENDIAN])
1182 AC_REQUIRE([AC_C_CONST])
1183 AC_REQUIRE([AC_C_VOLATILE])
1184 AC_REQUIRE([AC_C_INLINE])
1185 AC_REQUIRE([AC_C_LONG_DOUBLE])
1187 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1188 AC_REQUIRE([AC_HEADER_DIRENT])
1189 AC_REQUIRE([AC_HEADER_STDC])
1191 [struct stat.st_author,
1192 struct stat.st_blksize],,,
1193 [$ac_includes_default
1194 #include <sys/stat.h>
1196 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1198 AC_REQUIRE([AC_STRUCT_TM])
1199 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1200 AC_REQUIRE([AC_HEADER_STAT])
1201 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1202 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1203 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1205 AC_REQUIRE([AC_TYPE_GETGROUPS])
1206 AC_REQUIRE([AC_TYPE_MODE_T])
1207 AC_REQUIRE([AC_TYPE_OFF_T])
1208 AC_REQUIRE([AC_TYPE_PID_T])
1209 AC_REQUIRE([AC_TYPE_SIGNAL])
1210 AC_REQUIRE([AC_TYPE_SIZE_T])
1211 AC_REQUIRE([AC_TYPE_UID_T])
1212 AC_CHECK_TYPE(ino_t, unsigned long)
1214 dnl This relies on the fact that autoconf 2.14a's implementation of
1215 dnl AC_CHECK_TYPE checks includes unistd.h.
1216 AC_CHECK_TYPE(ssize_t, int)
1217 AC_CHECK_TYPE(major_t, unsigned int)
1218 AC_CHECK_TYPE(minor_t, unsigned int)
1220 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1221 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1223 AC_REQUIRE([AC_HEADER_MAJOR])
1224 AC_REQUIRE([AC_HEADER_DIRENT])
1228 # isc-posix.m4 serial 2 (gettext-0.11.2)
1229 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1230 dnl This file is free software, distributed under the terms of the GNU
1231 dnl General Public License. As a special exception to the GNU General
1232 dnl Public License, this file may be distributed as part of a program
1233 dnl that contains a configuration script generated by Autoconf, under
1234 dnl the same distribution terms as the rest of that program.
1236 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1238 # This test replaces the one in autoconf.
1239 # Currently this macro should have the same name as the autoconf macro
1240 # because gettext's gettext.m4 (distributed in the automake package)
1241 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1242 # give these diagnostics:
1243 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1244 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1246 undefine([AC_ISC_POSIX])
1248 AC_DEFUN([AC_ISC_POSIX],
1250 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1251 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1257 dnl Initially derived from code in GNU grep.
1258 dnl Mostly written by Jim Meyering.
1260 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1262 AC_DEFUN([jm_INCLUDED_REGEX],
1264 dnl Even packages that don't use regex.c can use this macro.
1265 dnl Of course, for them it doesn't do anything.
1267 # Assume we'll default to using the included regex.c.
1268 ac_use_included_regex=yes
1270 # However, if the system regex support is good enough that it passes the
1271 # the following run test, then default to *not* using the included regex.c.
1272 # If cross compiling, assume the test would fail and use the included
1273 # regex.c. The first failing regular expression is from `Spencer ere
1274 # test #75' in grep-2.3.
1275 AC_CACHE_CHECK([for working re_compile_pattern],
1276 jm_cv_func_working_re_compile_pattern,
1284 static struct re_pattern_buffer regex;
1286 struct re_registers regs;
1287 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1288 memset (®ex, 0, sizeof (regex));
1289 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1290 /* This should fail with _Invalid character class name_ error. */
1294 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1295 memset (®ex, 0, sizeof (regex));
1296 s = re_compile_pattern ("{1", 2, ®ex);
1301 /* The following example is derived from a problem report
1302 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1303 memset (®ex, 0, sizeof (regex));
1304 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1308 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1309 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1312 memset (®ex, 0, sizeof (regex));
1313 s = re_compile_pattern ("x", 1, ®ex);
1317 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
1318 work with a negative RANGE argument. */
1319 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
1325 jm_cv_func_working_re_compile_pattern=yes,
1326 jm_cv_func_working_re_compile_pattern=no,
1327 dnl When crosscompiling, assume it's broken.
1328 jm_cv_func_working_re_compile_pattern=no))
1329 if test $jm_cv_func_working_re_compile_pattern = yes; then
1330 ac_use_included_regex=no
1333 test -n "$1" || AC_MSG_ERROR([missing argument])
1334 m4_syscmd([test -f $1])
1335 ifelse(m4_sysval, 0,
1337 AC_ARG_WITH(included-regex,
1338 [ --without-included-regex don't compile regex; this is the default on
1339 systems with version 2 of the GNU C library
1340 (use with caution on other system)],
1341 jm_with_regex=$withval,
1342 jm_with_regex=$ac_use_included_regex)
1343 if test "$jm_with_regex" = yes; then
1352 # Prerequisites of lib/regex.c.
1353 AC_DEFUN([jm_PREREQ_REGEX],
1355 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
1356 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1359 dnl Persuade glibc <string.h> to declare mempcpy().
1360 AC_REQUIRE([AC_GNU_SOURCE])
1362 AC_REQUIRE([ACX_C_RESTRICT])
1363 AC_REQUIRE([AC_FUNC_ALLOCA])
1364 AC_REQUIRE([AC_HEADER_STDC])
1365 AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
1366 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
1367 AC_CHECK_FUNCS(btowc)
1371 dnl based on acx_restrict.m4, from the GNU Autoconf Macro Archive at:
1372 dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_restrict.html
1374 # Determine whether the C/C++ compiler supports the "restrict" keyword
1375 # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
1376 # accepts it. Otherwise, if the compiler supports an equivalent (like
1377 # gcc's __restrict__) define "restrict" to be that. Otherwise, define
1378 # "restrict" to be empty.
1380 AC_DEFUN([ACX_C_RESTRICT],
1381 [AC_CACHE_CHECK([for C/C++ restrict keyword], acx_cv_c_restrict,
1382 [acx_cv_c_restrict=no
1383 # Try the official restrict keyword, then gcc's __restrict__.
1384 for acx_kw in restrict __restrict__; do
1385 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
1386 [float * $acx_kw x;])],
1387 [acx_cv_c_restrict=$acx_kw; break])
1390 case $acx_cv_c_restrict in
1392 no) AC_DEFINE(restrict,,
1393 [Define to equivalent of C99 restrict keyword, or to nothing if this
1394 is not supported. Do not define if restrict is supported directly.]) ;;
1395 *) AC_DEFINE_UNQUOTED(restrict, $acx_cv_c_restrict) ;;
1399 # onceonly.m4 serial 2
1400 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
1401 dnl This file is free software, distributed under the terms of the GNU
1402 dnl General Public License. As a special exception to the GNU General
1403 dnl Public License, this file may be distributed as part of a program
1404 dnl that contains a configuration script generated by Autoconf, under
1405 dnl the same distribution terms as the rest of that program.
1407 dnl This file defines some "once only" variants of standard autoconf macros.
1408 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1409 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1410 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1411 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1412 dnl The advantage is that the check for each of the headers/functions/decls
1413 dnl will be put only once into the 'configure' file. It keeps the size of
1414 dnl the 'configure' file down, and avoids redundant output when 'configure'
1416 dnl The drawback is that the checks cannot be conditionalized. If you write
1417 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1418 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1419 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1422 dnl Taken from Autoconf 2.50; can be removed once we assume 2.50 or later.
1423 define([m4_quote], [[$*]])
1425 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1426 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1427 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1429 AC_FOREACH([gl_HEADER_NAME], [$1], [
1430 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
1432 AC_CHECK_HEADERS(gl_HEADER_NAME)
1434 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1439 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1440 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1441 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1443 AC_FOREACH([gl_FUNC_NAME], [$1], [
1444 AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
1445 AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
1447 AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
1451 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1452 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1453 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1455 AC_FOREACH([gl_DECL_NAME], [$1], [
1456 AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
1457 AC_CHECK_DECLS(defn([gl_DECL_NAME]))
1459 AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
1465 dnl From Paul Eggert.
1467 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1468 AC_DEFUN([UTILS_HOST_OS],
1470 AC_CACHE_CHECK([host operating system],
1471 utils_cv_host_operating_system,
1475 # These operating system names do not use the default heuristic below.
1476 # They are in reverse order, so that more-specific prefixes come first.
1477 winnt*) os='Windows NT';;
1479 sysv*) os='Unix System V';;
1480 superux*) os='SUPER-UX';;
1481 sunos*) os='SunOS';;
1483 sco*) os='SCO Unix';;
1484 riscos*) os='RISC OS';;
1485 riscix*) os='RISCiX';;
1489 plan9*) os='Plan 9';;
1492 openbsd*) os='OpenBSD';;
1493 nsk*) os='NonStop Kernel';;
1494 nonstopux*) os='NonStop-UX';;
1495 netbsd*) os='NetBSD';;
1496 msdosdjgpp*) os='DJGPP';;
1497 mpeix*) os='MPE/iX';;
1499 mingw*) os='MinGW';;
1500 lynxos*) os='LynxOS';;
1501 linux*) os='GNU/Linux';;
1505 freebsd*-gnu*) os='GNU/FreeBSD';;
1506 freebsd*) os='FreeBSD';;
1508 bsdi*) os='BSD/OS';;
1512 atheos*) os='AtheOS';;
1513 amigaos*) os='Amiga OS';;
1516 # The default heuristic takes the initial alphabetic string
1517 # from $host_os, but capitalizes its first letter.
1520 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1522 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1526 # If $host_os does not start with an alphabetic string, use it unchanged.
1530 utils_cv_host_operating_system=$os]])
1531 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1532 "$utils_cv_host_operating_system",
1533 [The host operating system.])
1538 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1539 # On such systems, arrange to use a wrapper function that removes any
1541 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1543 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1544 utils_cv_func_mkdir_trailing_slash_bug,
1546 # Arrange for deletion of the temporary directory this test might create.
1547 ac_clean_files="$ac_clean_files confdir-slash"
1549 # include <sys/types.h>
1550 # include <sys/stat.h>
1551 # include <stdlib.h>
1554 rmdir ("confdir-slash");
1555 exit (mkdir ("confdir-slash/", 0700));
1558 utils_cv_func_mkdir_trailing_slash_bug=no,
1559 utils_cv_func_mkdir_trailing_slash_bug=yes,
1560 utils_cv_func_mkdir_trailing_slash_bug=yes
1565 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1567 AC_DEFINE(mkdir, rpl_mkdir,
1568 [Define to rpl_mkdir if the replacement function should be used.])
1574 AC_DEFUN([jm_BISON],
1576 # getdate.y works with bison only.
1577 : ${YACC='bison -y'}
1582 dnl based on code from Eleftherios Gkioulekas
1584 AC_DEFUN([jm_ASSERT],
1586 AC_MSG_CHECKING(whether to enable assertions)
1587 AC_ARG_ENABLE(assert,
1588 [ --disable-assert turn off assertions],
1590 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1591 [ AC_MSG_RESULT(yes) ]
1597 dnl From Jim Meyering
1599 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1600 dnl usually in <utime.h>.
1601 dnl Some systems have utime.h but don't declare the struct anywhere.
1603 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1605 AC_CHECK_HEADERS(utime.h)
1606 AC_REQUIRE([AC_HEADER_TIME])
1607 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1610 #ifdef TIME_WITH_SYS_TIME
1611 # include <sys/time.h>
1614 # ifdef HAVE_SYS_TIME_H
1615 # include <sys/time.h>
1624 [static struct utimbuf x; x.actime = x.modtime;],
1625 fu_cv_sys_struct_utimbuf=yes,
1626 fu_cv_sys_struct_utimbuf=no)
1629 if test $fu_cv_sys_struct_utimbuf = yes; then
1630 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1631 [Define if struct utimbuf is declared -- usually in <utime.h>.
1632 Some systems have utime.h but don't declare the struct anywhere. ])
1638 dnl From Jim Meyering.
1640 dnl Check whether struct dirent has a member named d_type.
1643 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1644 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1645 AC_CACHE_CHECK([for d_type member in directory struct],
1646 jm_cv_struct_dirent_d_type,
1649 #include <sys/types.h>
1650 #ifdef HAVE_DIRENT_H
1651 # include <dirent.h>
1652 #else /* not HAVE_DIRENT_H */
1653 # define dirent direct
1654 # ifdef HAVE_SYS_NDIR_H
1655 # include <sys/ndir.h>
1656 # endif /* HAVE_SYS_NDIR_H */
1657 # ifdef HAVE_SYS_DIR_H
1658 # include <sys/dir.h>
1659 # endif /* HAVE_SYS_DIR_H */
1662 # endif /* HAVE_NDIR_H */
1663 #endif /* HAVE_DIRENT_H */
1665 [struct dirent dp; dp.d_type = 0;],
1667 jm_cv_struct_dirent_d_type=yes,
1668 jm_cv_struct_dirent_d_type=no)
1671 if test $jm_cv_struct_dirent_d_type = yes; then
1672 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1673 [Define if there is a member named d_type in the struct describing
1674 directory headers.])
1681 dnl From Jim Meyering.
1683 dnl Check whether struct dirent has a member named d_ino.
1686 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1687 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1688 AC_CACHE_CHECK([for d_ino member in directory struct],
1689 jm_cv_struct_dirent_d_ino,
1692 #include <sys/types.h>
1693 #ifdef HAVE_DIRENT_H
1694 # include <dirent.h>
1695 #else /* not HAVE_DIRENT_H */
1696 # define dirent direct
1697 # ifdef HAVE_SYS_NDIR_H
1698 # include <sys/ndir.h>
1699 # endif /* HAVE_SYS_NDIR_H */
1700 # ifdef HAVE_SYS_DIR_H
1701 # include <sys/dir.h>
1702 # endif /* HAVE_SYS_DIR_H */
1705 # endif /* HAVE_NDIR_H */
1706 #endif /* HAVE_DIRENT_H */
1708 [struct dirent dp; dp.d_ino = 0;],
1710 jm_cv_struct_dirent_d_ino=yes,
1711 jm_cv_struct_dirent_d_ino=no)
1714 if test $jm_cv_struct_dirent_d_ino = yes; then
1715 AC_DEFINE(D_INO_IN_DIRENT, 1,
1716 [Define if there is a member named d_ino in the struct describing
1717 directory headers.])
1724 dnl This is just a wrapper function to encapsulate this kludge.
1725 dnl Putting it in a separate file like this helps share it between
1726 dnl different packages.
1727 AC_DEFUN([jm_CHECK_DECLS],
1729 AC_REQUIRE([_jm_DECL_HEADERS])
1730 AC_REQUIRE([AC_HEADER_TIME])
1734 # if !STDC_HEADERS && HAVE_MEMORY_H
1735 # include <memory.h>
1737 # include <string.h>
1740 # include <strings.h>
1744 # include <stdlib.h>
1747 # include <unistd.h>
1750 #include <sys/types.h>
1751 #if TIME_WITH_SYS_TIME
1752 # include <sys/time.h>
1755 # if HAVE_SYS_TIME_H
1756 # include <sys/time.h>
1797 ttyname], , , $headers)
1800 dnl FIXME: when autoconf has support for it.
1801 dnl This is a little helper so we can require these header checks.
1802 AC_DEFUN([_jm_DECL_HEADERS],
1804 AC_REQUIRE([AC_HEADER_STDC])
1805 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1806 unistd.h sys/time.h utmp.h utmpx.h)
1811 dnl We use jm_ for non Autoconf macros.
1812 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1813 m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1815 # These are the prerequisite macros for files in the lib/
1816 # directory of the coreutils package.
1818 AC_DEFUN([jm_PREREQ],
1820 AC_REQUIRE([jm_PREREQ_ADDEXT])
1822 # We don't yet use c-stack.c.
1823 # AC_REQUIRE([jm_PREREQ_C_STACK])
1825 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1826 AC_REQUIRE([jm_PREREQ_DIRNAME])
1827 AC_REQUIRE([jm_PREREQ_ERROR])
1828 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1829 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1830 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1831 AC_REQUIRE([jm_PREREQ_HASH])
1832 AC_REQUIRE([gl_HUMAN])
1833 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1834 AC_REQUIRE([jm_PREREQ_MEMCHR])
1835 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1836 AC_REQUIRE([jm_PREREQ_POSIXVER])
1837 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1838 AC_REQUIRE([jm_PREREQ_READUTMP])
1839 AC_REQUIRE([jm_PREREQ_STAT])
1840 AC_REQUIRE([jm_PREREQ_STRNLEN])
1841 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1842 AC_REQUIRE([jm_PREREQ_XGETCWD])
1843 AC_REQUIRE([jm_PREREQ_XREADLINK])
1846 AC_DEFUN([jm_PREREQ_ADDEXT],
1849 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1850 AC_CHECK_FUNCS(pathconf)
1851 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1854 AC_DEFUN([jm_PREREQ_CANON_HOST],
1856 dnl Add any libraries as early as possible.
1857 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1858 dnl so we have to add -lnsl to LIBS before checking for that function.
1859 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1861 dnl These come from -lnsl on Solaris5.5.1.
1862 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1864 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1865 netinet/in.h arpa/inet.h)
1868 AC_DEFUN([jm_PREREQ_DIRNAME],
1870 AC_REQUIRE([AC_HEADER_STDC])
1871 AC_CHECK_HEADERS(string.h)
1874 AC_DEFUN([jm_PREREQ_EXCLUDE],
1876 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1877 AC_REQUIRE([AC_HEADER_STDBOOL])
1880 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1882 AC_CHECK_FUNCS(getpagesize)
1883 AC_CHECK_HEADERS(OS.h unistd.h)
1886 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1888 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1889 AC_CHECK_FUNCS(setlocale)
1890 AC_REQUIRE([AM_C_PROTOTYPES])
1893 AC_DEFUN([jm_PREREQ_HASH],
1895 AC_CHECK_HEADERS(stdlib.h)
1896 AC_REQUIRE([AC_HEADER_STDBOOL])
1897 AC_REQUIRE([jm_CHECK_DECLS])
1900 AC_DEFUN([jm_PREREQ_MEMCHR],
1902 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1905 # Check for the external symbol, _system_configuration,
1906 # a struct with member `physmem'.
1907 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
1908 [AC_CACHE_CHECK(for external symbol _system_configuration,
1909 gl_cv_var__system_configuration,
1910 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
1911 [[#include <sys/systemcfg.h>
1913 [double x = _system_configuration.physmem;])],
1914 [gl_cv_var__system_configuration=yes],
1915 [gl_cv_var__system_configuration=no])])
1917 if test $gl_cv_var__system_configuration = yes; then
1918 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
1919 [Define to 1 if you have the external variable,
1920 _system_configuration with a member named physmem.])
1925 AC_DEFUN([jm_PREREQ_PHYSMEM],
1927 AC_CHECK_HEADERS([unistd.h sys/pstat.h sys/sysmp.h sys/sysinfo.h \
1928 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
1930 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
1932 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
1935 AC_DEFUN([jm_PREREQ_POSIXVER],
1937 AC_CHECK_HEADERS(unistd.h)
1938 AC_CHECK_DECLS([getenv])
1941 AC_DEFUN([jm_PREREQ_QUOTEARG],
1943 AC_CHECK_FUNCS(isascii iswprint)
1944 AC_REQUIRE([jm_FUNC_MBRTOWC])
1945 AC_REQUIRE([jm_FUNC_MEMCMP])
1946 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1947 AC_REQUIRE([AC_HEADER_STDC])
1948 AC_REQUIRE([AC_C_BACKSLASH_A])
1949 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1950 AC_REQUIRE([AM_C_PROTOTYPES])
1953 AC_DEFUN([jm_PREREQ_READUTMP],
1955 AC_REQUIRE([AC_HEADER_STDC])
1956 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1957 AC_CHECK_FUNCS(utmpname)
1958 AC_CHECK_FUNCS(utmpxname)
1959 AC_REQUIRE([AM_C_PROTOTYPES])
1961 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1963 $ac_includes_default
1971 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1972 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1973 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1974 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1975 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1976 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1977 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1978 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1979 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1980 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1982 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1983 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1984 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1985 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1987 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1988 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1989 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1990 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1995 AC_DEFUN([jm_PREREQ_STAT],
1997 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1998 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1999 AC_CHECK_FUNCS(statvfs)
2001 # For `struct statfs' on Ultrix 4.4.
2002 AC_CHECK_HEADERS(netinet/in.h nfs/nfs_clnt.h nfs/vfs.h)
2004 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2007 $ac_includes_default
2008 #if HAVE_SYS_STATVFS_H
2009 # include <sys/statvfs.h>
2012 # include <sys/vfs.h>
2014 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
2015 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
2016 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
2017 # include <sys/param.h>
2018 # include <sys/mount.h>
2019 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
2020 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
2021 # include <netinet/in.h>
2022 # include <nfs/nfs_clnt.h>
2023 # include <nfs/vfs.h>
2027 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
2028 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
2029 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
2030 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
2031 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
2032 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
2033 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
2034 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
2035 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
2036 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
2037 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
2040 AC_DEFUN([jm_PREREQ_STRNLEN],
2042 AC_REQUIRE([AC_FUNC_STRNLEN])
2043 AC_REQUIRE([AC_HEADER_STDC])
2044 AC_CHECK_HEADERS(memory.h)
2045 AC_CHECK_DECLS([memchr])
2047 # This is necessary because automake-1.6.1 doesn't understand
2048 # that the above use of AC_FUNC_STRNLEN means we may have to use
2050 test $ac_cv_func_strnlen_working = yes \
2051 && AC_LIBOBJ(strnlen)
2054 AC_DEFUN([jm_PREREQ_TEMPNAME],
2056 AC_REQUIRE([AC_HEADER_STDC])
2057 AC_REQUIRE([AC_HEADER_STAT])
2058 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
2059 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
2060 AC_CHECK_DECLS([getenv])
2061 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2064 AC_DEFUN([jm_PREREQ_XGETCWD],
2066 AC_REQUIRE([AC_C_PROTOTYPES])
2067 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
2068 AC_CHECK_FUNCS(getcwd)
2069 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
2072 AC_DEFUN([jm_PREREQ_XREADLINK],
2074 AC_REQUIRE([AC_C_PROTOTYPES])
2075 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
2080 dnl FIXME: put these prerequisite-only *.m4 files in a separate
2081 dnl directory -- otherwise, they'll conflict with existing files.
2083 dnl These are the prerequisite macros for GNU's error.c file.
2084 AC_DEFUN([jm_PREREQ_ERROR],
2086 AC_CHECK_FUNCS(strerror vprintf doprnt)
2087 AC_CHECK_DECLS([strerror])
2088 AC_CHECK_HEADERS([libintl.h])
2094 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2095 dnl This file is free software, distributed under the terms of the GNU
2096 dnl General Public License. As a special exception to the GNU General
2097 dnl Public License, this file may be distributed as part of a program
2098 dnl that contains a configuration script generated by Autoconf, under
2099 dnl the same distribution terms as the rest of that program.
2101 AC_DEFUN([gl_HUMAN],
2103 dnl Prerequisites of lib/human.h.
2104 AC_REQUIRE([AM_STDBOOL_H])
2105 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2107 dnl Prerequisites of lib/human.c.
2108 AC_CHECK_HEADERS_ONCE(locale.h stdlib.h string.h)
2109 AC_CHECK_DECLS_ONCE(getenv)
2110 AC_CHECK_FUNCS_ONCE(localeconv)
2113 # Check for stdbool.h that conforms to C99.
2115 # Copyright (C) 2002-2003 Free Software Foundation, Inc.
2117 # This program is free software; you can redistribute it and/or modify
2118 # it under the terms of the GNU General Public License as published by
2119 # the Free Software Foundation; either version 2, or (at your option)
2120 # any later version.
2122 # This program is distributed in the hope that it will be useful,
2123 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2124 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2125 # GNU General Public License for more details.
2127 # You should have received a copy of the GNU General Public License
2128 # along with this program; if not, write to the Free Software
2129 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2132 # Prepare for substituting <stdbool.h> if it is not supported.
2134 AC_DEFUN([AM_STDBOOL_H],
2136 AC_REQUIRE([AC_HEADER_STDBOOL])
2138 # Define two additional variables used in the Makefile substitution.
2140 if test "$ac_cv_header_stdbool_h" = yes; then
2143 STDBOOL_H='stdbool.h'
2145 AC_SUBST([STDBOOL_H])
2147 if test "$ac_cv_type__Bool" = yes; then
2152 AC_SUBST([HAVE__BOOL])
2155 # This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
2156 # have this macro built-in.
2158 AC_DEFUN([AC_HEADER_STDBOOL],
2159 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2160 [ac_cv_header_stdbool_h],
2163 #include <stdbool.h>
2165 "error: bool is not defined"
2168 "error: false is not defined"
2171 "error: false is not 0"
2174 "error: false is not defined"
2177 "error: true is not 1"
2179 #ifndef __bool_true_false_are_defined
2180 "error: __bool_true_false_are_defined is not defined"
2183 struct s { _Bool s: 1; _Bool t; } s;
2185 char a[true == 1 ? 1 : -1];
2186 char b[false == 0 ? 1 : -1];
2187 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2188 char d[(bool) -0.5 == true ? 1 : -1];
2190 char f[(_Bool) -0.0 == false ? 1 : -1];
2192 char h[sizeof (_Bool)];
2195 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2196 [ac_cv_header_stdbool_h=yes],
2197 [ac_cv_header_stdbool_h=no])])
2198 AC_CHECK_TYPES([_Bool])
2199 if test $ac_cv_header_stdbool_h = yes; then
2200 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2203 # uintmax_t.m4 serial 7 (gettext-0.12)
2204 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2205 dnl This file is free software, distributed under the terms of the GNU
2206 dnl General Public License. As a special exception to the GNU General
2207 dnl Public License, this file may be distributed as part of a program
2208 dnl that contains a configuration script generated by Autoconf, under
2209 dnl the same distribution terms as the rest of that program.
2211 dnl From Paul Eggert.
2215 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2216 # if it is not already defined in <stdint.h> or <inttypes.h>.
2218 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2220 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2221 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2222 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2223 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2224 test $ac_cv_type_unsigned_long_long = yes \
2225 && ac_type='unsigned long long' \
2226 || ac_type='unsigned long'
2227 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2228 [Define to unsigned long or unsigned long long
2229 if <stdint.h> and <inttypes.h> don't define.])
2231 AC_DEFINE(HAVE_UINTMAX_T, 1,
2232 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2236 # inttypes_h.m4 serial 5 (gettext-0.12)
2237 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2238 dnl This file is free software, distributed under the terms of the GNU
2239 dnl General Public License. As a special exception to the GNU General
2240 dnl Public License, this file may be distributed as part of a program
2241 dnl that contains a configuration script generated by Autoconf, under
2242 dnl the same distribution terms as the rest of that program.
2244 dnl From Paul Eggert.
2246 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2247 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2249 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2251 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2253 [#include <sys/types.h>
2254 #include <inttypes.h>],
2255 [uintmax_t i = (uintmax_t) -1;],
2256 jm_ac_cv_header_inttypes_h=yes,
2257 jm_ac_cv_header_inttypes_h=no)])
2258 if test $jm_ac_cv_header_inttypes_h = yes; then
2259 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2260 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2261 and declares uintmax_t. ])
2265 # stdint_h.m4 serial 3 (gettext-0.12)
2266 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2267 dnl This file is free software, distributed under the terms of the GNU
2268 dnl General Public License. As a special exception to the GNU General
2269 dnl Public License, this file may be distributed as part of a program
2270 dnl that contains a configuration script generated by Autoconf, under
2271 dnl the same distribution terms as the rest of that program.
2273 dnl From Paul Eggert.
2275 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2276 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2278 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2280 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2282 [#include <sys/types.h>
2283 #include <stdint.h>],
2284 [uintmax_t i = (uintmax_t) -1;],
2285 jm_ac_cv_header_stdint_h=yes,
2286 jm_ac_cv_header_stdint_h=no)])
2287 if test $jm_ac_cv_header_stdint_h = yes; then
2288 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2289 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2290 and declares uintmax_t. ])
2296 dnl From Paul Eggert.
2298 # Define HAVE_LONG_LONG if 'long long' works.
2300 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2302 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2303 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2304 [long long llmax = (long long) -1;
2305 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2306 ac_cv_type_long_long=yes,
2307 ac_cv_type_long_long=no)])
2308 if test $ac_cv_type_long_long = yes; then
2309 AC_DEFINE(HAVE_LONG_LONG, 1,
2310 [Define if you have the long long type.])
2314 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2316 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2318 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2319 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2320 [unsigned long long ullmax = (unsigned long long) -1;
2321 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2322 ac_cv_type_unsigned_long_long=yes,
2323 ac_cv_type_unsigned_long_long=no)])
2324 if test $ac_cv_type_unsigned_long_long = yes; then
2325 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2326 [Define if you have the unsigned long long type.])
2332 dnl autoconf tests required for use of mbswidth.c
2333 dnl From Bruno Haible.
2335 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2337 AC_REQUIRE([AC_HEADER_STDC])
2338 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2339 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2342 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2344 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2346 # include <string.h>
2353 char *p = (char *) wcwidth;
2355 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2356 if test $ac_cv_have_decl_wcwidth = yes; then
2361 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2362 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2367 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2368 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2369 dnl This file is free software, distributed under the terms of the GNU
2370 dnl General Public License. As a special exception to the GNU General
2371 dnl Public License, this file may be distributed as part of a program
2372 dnl that contains a configuration script generated by Autoconf, under
2373 dnl the same distribution terms as the rest of that program.
2375 dnl From Paul Eggert
2377 AC_DEFUN([jm_FUNC_MBRTOWC],
2379 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2382 [#include <wchar.h>],
2383 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2384 jm_cv_func_mbrtowc=yes,
2385 jm_cv_func_mbrtowc=no)])
2386 if test $jm_cv_func_mbrtowc = yes; then
2387 AC_DEFINE(HAVE_MBRTOWC, 1,
2388 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2394 dnl A replacement for autoconf's macro by the same name. This version
2395 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2396 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2397 dnl run only if one of the listed libraries ends up being used (and not in
2398 dnl the `none required' case.
2399 dnl I hope it's only temporary while we wait for that version to be fixed.
2400 undefine([AC_SEARCH_LIBS])
2402 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2403 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2404 # [OTHER-LIBRARIES])
2405 # --------------------------------------------------------
2406 # Search for a library defining FUNC, if it's not already available.
2407 AC_DEFUN([AC_SEARCH_LIBS],
2409 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2411 ac_func_search_save_LIBS=$LIBS
2413 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2414 if test "$ac_cv_search_$1" = no; then
2415 for ac_lib in $2; do
2416 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2417 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2420 LIBS=$ac_func_search_save_LIBS
2423 if test "$ac_cv_search_$1" = no; then :
2426 if test "$ac_cv_search_$1" = 'none required'; then :
2429 LIBS="$ac_cv_search_$1 $LIBS"
2436 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2438 # This program is free software; you can redistribute it and/or modify
2439 # it under the terms of the GNU General Public License as published by
2440 # the Free Software Foundation; either version 2, or (at your option)
2441 # any later version.
2443 # This program is distributed in the hope that it will be useful,
2444 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2445 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2446 # GNU General Public License for more details.
2448 # You should have received a copy of the GNU General Public License
2449 # along with this program; if not, write to the Free Software
2450 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2455 AC_DEFUN([AM_C_PROTOTYPES],
2456 [AC_REQUIRE([AM_PROG_CC_STDC])
2457 AC_REQUIRE([AC_PROG_CPP])
2458 AC_MSG_CHECKING([for function prototypes])
2459 if test "$am_cv_prog_cc_stdc" != no; then
2461 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2465 U=_ ANSI2KNR=./ansi2knr
2467 # Ensure some checks needed by ansi2knr itself.
2469 AC_CHECK_HEADERS(string.h)
2471 AC_SUBST(ANSI2KNR)dnl
2474 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2477 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2479 # This program is free software; you can redistribute it and/or modify
2480 # it under the terms of the GNU General Public License as published by
2481 # the Free Software Foundation; either version 2, or (at your option)
2482 # any later version.
2484 # This program is distributed in the hope that it will be useful,
2485 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2486 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2487 # GNU General Public License for more details.
2489 # You should have received a copy of the GNU General Public License
2490 # along with this program; if not, write to the Free Software
2491 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2496 # @defmac AC_PROG_CC_STDC
2497 # @maindex PROG_CC_STDC
2499 # If the C compiler in not in ANSI C mode by default, try to add an option
2500 # to output variable @code{CC} to make it so. This macro tries various
2501 # options that select ANSI C on some system or another. It considers the
2502 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2504 # If you use this macro, you should check after calling it whether the C
2505 # compiler has been set to accept ANSI C; if not, the shell variable
2506 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2507 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2508 # program @code{ansi2knr}, which comes with Ghostscript.
2511 AC_DEFUN([AM_PROG_CC_STDC],
2512 [AC_REQUIRE([AC_PROG_CC])
2513 AC_BEFORE([$0], [AC_C_INLINE])
2514 AC_BEFORE([$0], [AC_C_CONST])
2515 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2516 dnl a magic option to avoid problems with ANSI preprocessor commands
2518 dnl FIXME: can't do this because then AC_AIX won't work due to a
2519 dnl circular dependency.
2520 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2521 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2522 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2523 [am_cv_prog_cc_stdc=no
2525 # Don't try gcc -ansi; that turns off useful extensions and
2526 # breaks some systems' header files.
2527 # AIX -qlanglvl=ansi
2528 # Ultrix and OSF/1 -std1
2529 # HP-UX 10.20 and later -Ae
2530 # HP-UX older versions -Aa -D_HPUX_SOURCE
2531 # SVR4 -Xc -D__EXTENSIONS__
2532 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2534 CC="$ac_save_CC $ac_arg"
2536 [#include <stdarg.h>
2538 #include <sys/types.h>
2539 #include <sys/stat.h>
2540 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2541 struct buf { int x; };
2542 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2543 static char *e (p, i)
2549 static char *f (char * (*g) (char **, int), char **p, ...)
2554 s = g (p, va_arg (v,int));
2558 int test (int i, double x);
2559 struct s1 {int (*f) (int a);};
2560 struct s2 {int (*f) (double a);};
2561 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2565 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2567 [am_cv_prog_cc_stdc="$ac_arg"; break])
2571 if test -z "$am_cv_prog_cc_stdc"; then
2572 AC_MSG_RESULT([none needed])
2574 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2576 case "x$am_cv_prog_cc_stdc" in
2578 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2582 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2586 AC_DEFUN([jm_FUNC_MEMCMP],
2587 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2588 if test $ac_cv_func_memcmp_working = no; then
2589 AC_DEFINE(memcmp, rpl_memcmp,
2590 [Define to rpl_memcmp if the replacement function should be used.])
2594 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2596 # Copyright 2001 Free Software Foundation, Inc.
2598 # This program is free software; you can redistribute it and/or modify
2599 # it under the terms of the GNU General Public License as published by
2600 # the Free Software Foundation; either version 2, or (at your option)
2601 # any later version.
2603 # This program is distributed in the hope that it will be useful,
2604 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2605 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2606 # GNU General Public License for more details.
2608 # You should have received a copy of the GNU General Public License
2609 # along with this program; if not, write to the Free Software Foundation,
2610 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2612 # Written by Paul Eggert.
2614 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2615 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2616 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2617 [ac_cv_func_getcwd_null],
2620 # ifdef HAVE_STDLIB_H
2621 # include <stdlib.h>
2623 # ifdef HAVE_UNISTD_H
2624 # include <unistd.h>
2632 if (chdir ("/") != 0)
2636 char *f = getcwd (NULL, 0);
2637 exit (! (f && f[0] == '/' && !f[1]));
2640 [ac_cv_func_getcwd_null=yes],
2641 [ac_cv_func_getcwd_null=no],
2642 [ac_cv_func_getcwd_null=no])])
2643 if test $ac_cv_func_getcwd_null = yes; then
2644 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2645 [Define if getcwd (NULL, 0) allocates memory for result.])
2650 dnl Find out how to get the file descriptor associated with an open DIR*.
2651 dnl From Jim Meyering
2653 AC_DEFUN([UTILS_FUNC_DIRFD],
2655 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2656 AC_REQUIRE([AC_PROG_CPP])
2657 AC_REQUIRE([AC_PROG_EGREP])
2662 # include <dirent.h>
2663 #else /* not HAVE_DIRENT_H */
2664 # define dirent direct
2665 # if HAVE_SYS_NDIR_H
2666 # include <sys/ndir.h>
2667 # endif /* HAVE_SYS_NDIR_H */
2669 # include <sys/dir.h>
2670 # endif /* HAVE_SYS_DIR_H */
2673 # endif /* HAVE_NDIR_H */
2674 #endif /* HAVE_DIRENT_H */
2676 AC_CHECK_FUNCS(dirfd)
2677 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2679 AC_CACHE_CHECK([whether dirfd is a macro],
2680 jm_cv_func_dirfd_macro,
2681 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2683 dirent_header_defines_dirfd
2685 jm_cv_func_dirfd_macro=yes,
2686 jm_cv_func_dirfd_macro=no)])
2688 # Use the replacement only if we have no function, macro,
2689 # or declaration with that name.
2690 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2692 AC_REPLACE_FUNCS([dirfd])
2694 [how to get the file descriptor associated with an open DIR*],
2695 gl_cv_sys_dir_fd_member_name,
2697 dirfd_save_CFLAGS=$CFLAGS
2698 for ac_expr in d_fd dd_fd; do
2700 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2704 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2707 CFLAGS=$dirfd_save_CFLAGS
2708 test "$dir_fd_found" = yes && break
2710 test "$dir_fd_found" = yes || ac_expr=no_such_member
2712 gl_cv_sys_dir_fd_member_name=$ac_expr
2715 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
2716 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2717 $gl_cv_sys_dir_fd_member_name,
2718 [the name of the file descriptor member of DIR])
2720 AH_VERBATIM(DIR_TO_FD,
2721 [#ifdef DIR_FD_MEMBER_NAME
2722 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2724 # define DIR_TO_FD(Dir_p) -1
2731 # acl.m4 - check for access control list (ACL) primitives
2733 # Copyright (C) 2002 Free Software Foundation, Inc.
2735 # This program is free software; you can redistribute it and/or modify
2736 # it under the terms of the GNU General Public License as published by
2737 # the Free Software Foundation; either version 2, or (at your option)
2738 # any later version.
2740 # This program is distributed in the hope that it will be useful,
2741 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2742 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2743 # GNU General Public License for more details.
2745 # You should have received a copy of the GNU General Public License
2746 # along with this program; if not, write to the Free Software Foundation,
2747 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2749 # Written by Paul Eggert.
2751 AC_DEFUN([AC_FUNC_ACL],
2752 [AC_CHECK_HEADERS(sys/acl.h)
2753 AC_CHECK_FUNCS(acl)])
2756 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2757 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
2758 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
2759 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
2760 # objects and arrange to use lib/search.h if necessary.
2763 AC_DEFUN([AC_FUNC_FTW],
2766 AC_REQUIRE([AC_HEADER_STAT])
2767 AC_REQUIRE([jm_FUNC_LSTAT])
2768 AC_REQUIRE([AC_HEADER_DIRENT])
2769 AC_CHECK_HEADERS(sys/param.h)
2770 AC_CHECK_DECLS([stpcpy])
2772 # In the event that we have to use the replacement ftw.c,
2773 # see if we'll also need the replacement tsearch.c.
2774 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2776 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
2777 ac_cv_func_ftw_working,
2779 # The following test would fail prior to glibc-2.3.2, because `depth'
2780 # would be 2 rather than 4. Of course, now that we require FTW_DCH
2781 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
2782 mkdir -p conftest.dir/a/b/c
2783 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2788 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2789 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2790 static char **p = _f;
2794 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2796 if (strcmp (file, *p++) != 0)
2805 /* Require these symbols, too. */
2809 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2810 exit ((err == 0 && depth == 4) ? 0 : 1);
2813 [ac_cv_func_ftw_working=yes],
2814 [ac_cv_func_ftw_working=no],
2815 [ac_cv_func_ftw_working=no])])
2817 if test $ac_cv_func_ftw_working = no; then
2819 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2820 # Add tsearch.o IFF we have to use the replacement ftw.c.
2821 if test -n "$need_tdestroy"; then
2822 AC_LIBOBJ([tsearch])
2823 # Link search.h to search_.h if we use the replacement tsearch.c.
2825 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2832 dnl From Jim Meyering.
2833 dnl Determine whether lstat has the bug that it succeeds when given the
2834 dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
2835 dnl (as of 1998-11-01) do this.
2837 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2838 dnl compile the wrapper function.
2841 AC_DEFUN([jm_FUNC_LSTAT],
2843 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2844 AC_CACHE_CHECK([whether lstat accepts an empty string],
2845 jm_cv_func_lstat_empty_string_bug,
2847 # include <sys/types.h>
2848 # include <sys/stat.h>
2854 exit (lstat ("", &sbuf) ? 1 : 0);
2857 jm_cv_func_lstat_empty_string_bug=yes,
2858 jm_cv_func_lstat_empty_string_bug=no,
2859 dnl When crosscompiling, assume lstat is broken.
2860 jm_cv_func_lstat_empty_string_bug=yes)
2862 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2864 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2865 [Define if lstat has the bug that it succeeds when given the zero-length
2866 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2873 dnl From Jim Meyering.
2874 dnl Provide lchown on systems that lack it.
2876 AC_DEFUN([jm_FUNC_LCHOWN],
2878 AC_REQUIRE([AC_TYPE_UID_T])
2879 AC_REPLACE_FUNCS(lchown)
2884 # When rmdir fails because the specified directory is not empty, it sets
2885 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2886 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2887 # in general, to avoid depending on the use of any particular symbol, this
2888 # test runs a test to determine the actual numeric value.
2889 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2891 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2892 fetish_cv_func_rmdir_errno_not_empty,
2894 # Arrange for deletion of the temporary directory this test creates.
2895 ac_clean_files="$ac_clean_files confdir2"
2896 mkdir confdir2; : > confdir2/file
2909 s = fopen ("confdir2/errno", "w");
2910 fprintf (s, "%d\n", val);
2914 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2915 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2916 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2921 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2922 $fetish_cv_func_rmdir_errno_not_empty,
2923 [the value to which errno is set when rmdir fails on a nonempty directory])
2928 dnl From Jim Meyering.
2929 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2930 dnl If it doesn't, arrange to use the replacement function.
2933 AC_DEFUN([jm_FUNC_CHOWN],
2934 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2935 test -z "$ac_cv_header_unistd_h" \
2936 && AC_CHECK_HEADERS(unistd.h)
2937 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2939 # include <sys/types.h>
2940 # include <sys/stat.h>
2942 # ifdef HAVE_UNISTD_H
2943 # include <unistd.h>
2949 char *f = "conftest.chown";
2950 struct stat before, after;
2952 if (creat (f, 0600) < 0)
2954 if (stat (f, &before) < 0)
2956 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2958 if (stat (f, &after) < 0)
2960 exit ((before.st_uid == after.st_uid
2961 && before.st_gid == after.st_gid) ? 0 : 1);
2964 jm_cv_func_working_chown=yes,
2965 jm_cv_func_working_chown=no,
2966 dnl When crosscompiling, assume chown is broken.
2967 jm_cv_func_working_chown=no)
2969 if test $jm_cv_func_working_chown = no; then
2971 AC_DEFINE(chown, rpl_chown,
2972 [Define to rpl_chown if the replacement function should be used.])
2978 dnl From Jim Meyering.
2979 dnl A wrapper around AC_FUNC_MKTIME.
2981 AC_DEFUN([jm_FUNC_MKTIME],
2982 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2984 dnl mktime.c uses localtime_r if it exists. Check for it.
2985 AC_CHECK_FUNCS(localtime_r)
2987 if test $ac_cv_func_working_mktime = no; then
2988 AC_DEFINE(mktime, rpl_mktime,
2989 [Define to rpl_mktime if the replacement function should be used.])
2993 # mktime.m4 serial 2
2994 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2995 dnl This file is free software, distributed under the terms of the GNU
2996 dnl General Public License. As a special exception to the GNU General
2997 dnl Public License, this file may be distributed as part of a program
2998 dnl that contains a configuration script generated by Autoconf, under
2999 dnl the same distribution terms as the rest of that program.
3001 dnl From Jim Meyering.
3003 # Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.57 and earlier.
3004 # This redefinition can be removed once a new version of Autoconf comes out.
3005 # The redefinition is taken from
3006 # <http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/autoconf/autoconf/lib/autoconf/functions.m4?rev=1.78>.
3009 AC_DEFUN([AC_FUNC_MKTIME],
3010 [AC_REQUIRE([AC_HEADER_TIME])dnl
3011 AC_CHECK_HEADERS(stdlib.h sys/time.h unistd.h)
3012 AC_CHECK_FUNCS(alarm)
3013 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
3014 [AC_RUN_IFELSE([AC_LANG_SOURCE(
3015 [[/* Test program from Paul Eggert and Tony Leneis. */
3016 #if TIME_WITH_SYS_TIME
3017 # include <sys/time.h>
3020 # if HAVE_SYS_TIME_H
3021 # include <sys/time.h>
3028 # include <stdlib.h>
3032 # include <unistd.h>
3036 # define alarm(X) /* empty */
3039 /* Work around redefinition to rpl_putenv by other config tests. */
3042 static time_t time_t_max;
3043 static time_t time_t_min;
3045 /* Values we'll use to set the TZ environment variable. */
3046 static char *tz_strings[] = {
3047 (char *) 0, "TZ=GMT0", "TZ=JST-9",
3048 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
3050 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
3052 /* Fail if mktime fails to convert a date in the spring-forward gap.
3053 Based on a problem report from Andreas Jaeger. */
3055 spring_forward_gap ()
3057 /* glibc (up to about 1998-10-07) failed this test. */
3060 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
3061 instead of "TZ=America/Vancouver" in order to detect the bug even
3062 on systems that don't support the Olson extension, or don't have the
3063 full zoneinfo tables installed. */
3064 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
3073 if (mktime (&tm) == (time_t)-1)
3082 if ((lt = localtime (&now)) && mktime (lt) != now)
3091 mktime_test1 ((time_t) (time_t_max - now));
3092 mktime_test1 ((time_t) (time_t_min + now));
3098 /* Based on code from Ariel Faigon. */
3108 if (tm.tm_mon != 2 || tm.tm_mday != 31)
3118 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
3120 if (now != (time_t) -1)
3122 struct tm *lt = localtime (&now);
3124 && lt->tm_year == tm.tm_year
3125 && lt->tm_mon == tm.tm_mon
3126 && lt->tm_mday == tm.tm_mday
3127 && lt->tm_hour == tm.tm_hour
3128 && lt->tm_min == tm.tm_min
3129 && lt->tm_sec == tm.tm_sec
3130 && lt->tm_yday == tm.tm_yday
3131 && lt->tm_wday == tm.tm_wday
3132 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
3133 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
3144 /* This test makes some buggy mktime implementations loop.
3145 Give up after 60 seconds; a mktime slower than that
3146 isn't worth using anyway. */
3149 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
3152 if ((time_t) -1 < 0)
3153 for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
3155 delta = time_t_max / 997; /* a suitable prime number */
3156 for (i = 0; i < N_STRINGS; i++)
3159 putenv (tz_strings[i]);
3161 for (t = 0; t <= time_t_max - delta; t += delta)
3163 mktime_test ((time_t) 1);
3164 mktime_test ((time_t) (60 * 60));
3165 mktime_test ((time_t) (60 * 60 * 24));
3167 for (j = 1; 0 < j; j *= 2)
3169 bigtime_test (j - 1);
3172 spring_forward_gap ();
3175 [ac_cv_func_working_mktime=yes],
3176 [ac_cv_func_working_mktime=no],
3177 [ac_cv_func_working_mktime=no])])
3178 if test $ac_cv_func_working_mktime = no; then
3183 AC_DEFUN([gl_FUNC_MKTIME],
3185 AC_REQUIRE([AC_FUNC_MKTIME])
3186 if test $ac_cv_func_working_mktime = no; then
3187 AC_DEFINE(mktime, rpl_mktime,
3188 [Define to rpl_mktime if the replacement function should be used.])
3193 # Prerequisites of lib/mktime.c.
3194 AC_DEFUN([gl_PREREQ_MKTIME], [
3195 AC_REQUIRE([AC_HEADER_STDC])
3196 AC_CHECK_HEADERS_ONCE(limits.h)
3201 dnl From Jim Meyering.
3202 dnl Determine whether stat has the bug that it succeeds when given the
3203 dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
3204 dnl (as of 1998-11-01) do this.
3206 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
3207 dnl compile the wrapper function.
3210 AC_DEFUN([jm_FUNC_STAT],
3212 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
3213 AC_CACHE_CHECK([whether stat accepts an empty string],
3214 jm_cv_func_stat_empty_string_bug,
3216 # include <sys/types.h>
3217 # include <sys/stat.h>
3223 exit (stat ("", &sbuf) ? 1 : 0);
3226 jm_cv_func_stat_empty_string_bug=yes,
3227 jm_cv_func_stat_empty_string_bug=no,
3228 dnl When crosscompiling, assume stat is broken.
3229 jm_cv_func_stat_empty_string_bug=yes)
3231 if test $jm_cv_func_stat_empty_string_bug = yes; then
3233 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
3234 [Define if stat has the bug that it succeeds when given the zero-length
3235 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
3242 dnl From Jim Meyering.
3243 dnl Check for the nanosleep function.
3244 dnl If not found, use the supplied replacement.
3247 AC_DEFUN([jm_FUNC_NANOSLEEP],
3249 nanosleep_save_libs=$LIBS
3251 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
3252 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
3253 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
3254 AC_SUBST(LIB_NANOSLEEP)
3256 AC_CACHE_CHECK([whether nanosleep works],
3257 jm_cv_func_nanosleep_works,
3259 AC_REQUIRE([AC_HEADER_TIME])
3261 # if TIME_WITH_SYS_TIME
3262 # include <sys/time.h>
3265 # if HAVE_SYS_TIME_H
3266 # include <sys/time.h>
3275 struct timespec ts_sleep, ts_remaining;
3276 ts_sleep.tv_sec = 0;
3277 ts_sleep.tv_nsec = 1;
3278 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
3281 jm_cv_func_nanosleep_works=yes,
3282 jm_cv_func_nanosleep_works=no,
3283 dnl When crosscompiling, assume the worst.
3284 jm_cv_func_nanosleep_works=no)
3286 if test $jm_cv_func_nanosleep_works = no; then
3287 AC_LIBOBJ(nanosleep)
3288 AC_DEFINE(nanosleep, rpl_nanosleep,
3289 [Define to rpl_nanosleep if the replacement function should be used.])
3292 LIBS=$nanosleep_save_libs
3295 # memcoll.m4 serial 2
3296 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3297 dnl This file is free software, distributed under the terms of the GNU
3298 dnl General Public License. As a special exception to the GNU General
3299 dnl Public License, this file may be distributed as part of a program
3300 dnl that contains a configuration script generated by Autoconf, under
3301 dnl the same distribution terms as the rest of that program.
3303 AC_DEFUN([gl_MEMCOLL],
3305 dnl Prerequisites of lib/memcoll.c.
3306 AC_REQUIRE([AC_FUNC_MEMCMP])
3307 AC_CHECK_HEADERS_ONCE(string.h)
3311 #serial 7 -*- autoconf -*-
3313 dnl From Jim Meyering.
3315 dnl See if the glibc *_unlocked I/O macros are available.
3316 dnl Use only those *_unlocked macros that are declared.
3319 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
3321 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
3322 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
3323 fread_unlocked, fwrite_unlocked, getc_unlocked,
3324 getchar_unlocked, putc_unlocked, putchar_unlocked])])
3328 dnl Written by Jim Meyering
3330 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
3332 dnl Do this replacement check manually because I want the hyphen
3333 dnl (not the underscore) in the filename.
3334 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3340 dnl From Jim Meyering.
3342 dnl Check whether putenv ("FOO") removes FOO from the environment.
3343 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3346 AC_DEFUN([jm_FUNC_PUTENV],
3347 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3352 /* Put it in env. */
3353 if (putenv ("CONFTEST_putenv=val"))
3356 /* Try to remove it. */
3357 if (putenv ("CONFTEST_putenv"))
3360 /* Make sure it was deleted. */
3361 if (getenv ("CONFTEST_putenv") != 0)
3367 jm_cv_func_svid_putenv=yes,
3368 jm_cv_func_svid_putenv=no,
3369 dnl When crosscompiling, assume putenv is broken.
3370 jm_cv_func_svid_putenv=no)
3372 if test $jm_cv_func_svid_putenv = no; then
3374 AC_DEFINE(putenv, rpl_putenv,
3375 [Define to rpl_putenv if the replacement function should be used.])
3383 AC_MSG_CHECKING(for AFS)
3384 if test -d /afs; then
3385 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3390 AC_MSG_RESULT($ac_result)
3395 # autoconf tests required for use of xstrtoumax.c
3397 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3399 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3400 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3401 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3402 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3403 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3404 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3406 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3407 jm_cv_func_strtoumax_macro,
3408 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3410 inttypes_h_defines_strtoumax
3412 jm_cv_func_strtoumax_macro=yes,
3413 jm_cv_func_strtoumax_macro=no))
3415 if test "$jm_cv_func_strtoumax_macro" != yes; then
3416 AC_REPLACE_FUNCS(strtoumax)
3419 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3420 dnl so we need the replacements only if strtoumax does not exist.
3421 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3423 AC_REPLACE_FUNCS(strtoul)
3425 dnl We don't need (and can't compile) the replacement strtoull
3426 dnl unless the type `unsigned long long' exists.
3427 if test "$ac_cv_type_unsigned_long_long" = yes; then
3428 AC_REPLACE_FUNCS(strtoull)
3434 # intmax_t.m4 serial 1
3435 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3436 dnl This file is free software, distributed under the terms of the GNU
3437 dnl General Public License. As a special exception to the GNU General
3438 dnl Public License, this file may be distributed as part of a program
3439 dnl that contains a configuration script generated by Autoconf, under
3440 dnl the same distribution terms as the rest of that program.
3442 dnl From Paul Eggert.
3446 # Define intmax_t to 'long' or 'long long'
3447 # if it is not already defined in <stdint.h> or <inttypes.h>.
3449 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
3451 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
3452 dnl only if it defines 'uintmax_t'.
3453 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3454 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3455 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3456 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3457 test $ac_cv_type_long_long = yes \
3458 && ac_type='long long' \
3460 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3461 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
3463 AC_DEFINE(HAVE_INTMAX_T, 1,
3464 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3468 dnl An alternative would be to explicitly test for 'intmax_t'.
3470 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
3472 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3473 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3474 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3478 #if HAVE_STDINT_H_WITH_UINTMAX
3481 #if HAVE_INTTYPES_H_WITH_UINTMAX
3482 #include <inttypes.h>
3484 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3485 if test $gt_cv_c_intmax_t = yes; then
3486 AC_DEFINE(HAVE_INTMAX_T, 1,
3487 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3489 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3490 test $ac_cv_type_long_long = yes \
3491 && ac_type='long long' \
3493 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3494 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
3499 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3501 # autoconf tests required for use of xstrtoimax.c
3503 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3505 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3506 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3507 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3508 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3509 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3510 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3512 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3513 jm_cv_func_strtoimax_macro,
3514 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3516 inttypes_h_defines_strtoimax
3518 jm_cv_func_strtoimax_macro=yes,
3519 jm_cv_func_strtoimax_macro=no))
3521 if test "$jm_cv_func_strtoimax_macro" != yes; then
3522 AC_REPLACE_FUNCS(strtoimax)
3525 dnl Only the replacement strtoimax invokes strtol and strtoll,
3526 dnl so we need the replacements only if strtoimax does not exist.
3527 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3529 AC_REPLACE_FUNCS(strtol)
3531 dnl We don't need (and can't compile) the replacement strtoll
3532 dnl unless the type `long long' exists.
3533 if test "$ac_cv_type_long_long" = yes; then
3534 AC_REPLACE_FUNCS(strtoll)
3541 dnl Run a program to determine whether whether link(2) follows symlinks.
3542 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3544 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3547 [whether link(2) dereferences a symlink specified with a trailing slash],
3548 jm_ac_cv_func_link_follows_symlink,
3550 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3551 dnl the appropriate framework.
3552 test -z "$ac_cv_header_unistd_h" \
3553 && AC_CHECK_HEADERS(unistd.h)
3555 # Create a regular file.
3556 echo > conftest.file
3559 # include <sys/types.h>
3560 # include <sys/stat.h>
3561 # ifdef HAVE_UNISTD_H
3562 # include <unistd.h>
3565 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3566 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3567 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3572 const char *file = "conftest.file";
3573 const char *sym = "conftest.sym";
3574 const char *hard = "conftest.hard";
3575 struct stat sb_file, sb_hard;
3577 /* Create a symlink to the regular file. */
3578 if (symlink (file, sym))
3581 /* Create a hard link to that symlink. */
3582 if (link (sym, hard))
3585 if (lstat (hard, &sb_hard))
3587 if (lstat (file, &sb_file))
3590 /* If the dev/inode of hard and file are the same, then
3591 the link call followed the symlink. */
3592 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3595 jm_ac_cv_func_link_follows_symlink=yes,
3596 jm_ac_cv_func_link_follows_symlink=no,
3597 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3600 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3601 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3602 [Define if `link(2)' dereferences symbolic links.])
3608 dnl This macro is intended to be used solely in this file.
3609 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3610 AC_DEFUN([_jm_STRFTIME_PREREQS],
3612 dnl strftime.c uses the underyling system strftime if it exists.
3615 AC_CHECK_HEADERS_ONCE(limits.h)
3616 AC_CHECK_FUNCS_ONCE(memcpy mempcpy)
3617 AC_CHECK_FUNCS(tzset memset)
3619 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3622 AC_CHECK_FUNCS(mblen mbrlen)
3625 AC_REQUIRE([gl_TM_GMTOFF])
3626 AC_REQUIRE([gl_FUNC_TZSET_CLOBBER])
3629 dnl From Jim Meyering.
3631 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3632 [AC_REQUIRE([AC_HEADER_TIME])dnl
3634 _jm_STRFTIME_PREREQS
3636 AC_REQUIRE([AC_C_CONST])dnl
3637 AC_REQUIRE([AC_HEADER_STDC])dnl
3638 AC_CHECK_HEADERS_ONCE(sys/time.h)
3639 AC_DEFINE([my_strftime], [nstrftime],
3640 [Define to the name of the strftime replacement function.])
3643 AC_DEFUN([jm_FUNC_STRFTIME],
3645 _jm_STRFTIME_PREREQS
3648 # tm_gmtoff.m4 serial 1
3649 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3650 dnl This file is free software, distributed under the terms of the GNU
3651 dnl General Public License. As a special exception to the GNU General
3652 dnl Public License, this file may be distributed as part of a program
3653 dnl that contains a configuration script generated by Autoconf, under
3654 dnl the same distribution terms as the rest of that program.
3656 AC_DEFUN([gl_TM_GMTOFF],
3658 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3659 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3660 [Define if struct tm has the tm_gmtoff member.])],
3662 [#include <time.h>])
3666 # See if we have a working tzset function.
3667 # If so, arrange to compile the wrapper function.
3668 # For at least Solaris 2.5.1 and 2.6, this is necessary
3669 # because tzset can clobber the contents of the buffer
3670 # used by localtime.
3672 # Written by Paul Eggert and Jim Meyering.
3674 AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
3676 AC_REQUIRE([AC_HEADER_TIME])
3677 AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
3678 gl_cv_func_tzset_clobber,
3680 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3681 #if TIME_WITH_SYS_TIME
3682 # include <sys/time.h>
3685 # if HAVE_SYS_TIME_H
3686 # include <sys/time.h>
3696 time_t t1 = 853958121;
3699 p = localtime (&t1);
3701 putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
3703 exit (p->tm_year != s.tm_year
3704 || p->tm_mon != s.tm_mon
3705 || p->tm_mday != s.tm_mday
3706 || p->tm_hour != s.tm_hour
3707 || p->tm_min != s.tm_min
3708 || p->tm_sec != s.tm_sec);
3711 [gl_cv_func_tzset_clobber=no],
3712 [gl_cv_func_tzset_clobber=yes],
3713 [gl_cv_func_tzset_clobber=yes])])
3715 AC_DEFINE(HAVE_RUN_TZSET_TEST, 1,
3716 [Define to 1 if you have run the test for working tzset.])
3718 if test $gl_cv_func_tzset_clobber = yes; then
3719 # Caution: the following few lines should be the same
3720 # as those in gettimeofday.m4.
3721 AC_LIBOBJ(gettimeofday)
3722 AC_DEFINE(gmtime, rpl_gmtime,
3723 [Define to rpl_gmtime if the replacement function should be used.])
3724 AC_DEFINE(localtime, rpl_localtime,
3725 [Define to rpl_localtime if the replacement function should be used.])
3727 AC_DEFINE(tzset, rpl_tzset,
3728 [Define to rpl_tzset if the wrapper function should be used.])
3729 AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1,
3730 [Define if tzset clobbers localtime's static buffer.])
3736 dnl From Jim Meyering
3737 dnl Using code from emacs, based on suggestions from Paul Eggert
3738 dnl and Ulrich Drepper.
3740 dnl Find out how to determine the number of pending output bytes on a stream.
3741 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3742 dnl we have to grub around in the FILE struct.
3744 AC_DEFUN([jm_FUNC_FPENDING],
3746 AC_CHECK_HEADERS(stdio_ext.h)
3747 AC_REPLACE_FUNCS([__fpending])
3749 # if HAVE_STDIO_EXT_H
3750 # include <stdio_ext.h>
3753 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3754 if test $ac_cv_func___fpending = no; then
3756 [how to determine the number of pending output bytes on a stream],
3757 ac_cv_sys_pending_output_n_bytes,
3762 'fp->_IO_write_ptr - fp->_IO_write_base' \
3764 '# traditional Unix' \
3765 'fp->_ptr - fp->_base' \
3768 'fp->_p - fp->_bf._base' \
3771 'fp->__ptr - fp->__base' \
3774 'fp->__bufp - fp->__buffer' \
3776 '# old glibc iostream?' \
3777 'fp->_pptr - fp->_pbase' \
3780 '(*fp)->_ptr - (*fp)->_base' \
3782 '# e.g., DGUX R4.11; the info is not available' \
3786 # Skip each embedded comment.
3787 case "$ac_expr" in '#'*) continue;; esac
3792 [FILE *fp = stdin; (void) ($ac_expr);],
3795 test "$fp_done" = yes && break
3798 ac_cv_sys_pending_output_n_bytes=$ac_expr
3801 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3802 $ac_cv_sys_pending_output_n_bytes,
3803 [the number of pending output bytes on stream `fp'])
3807 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3808 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3809 dnl This file is free software, distributed under the terms of the GNU
3810 dnl General Public License. As a special exception to the GNU General
3811 dnl Public License, this file may be distributed as part of a program
3812 dnl that contains a configuration script generated by Autoconf, under
3813 dnl the same distribution terms as the rest of that program.
3815 dnl From Bruno Haible.
3817 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3818 # macros to non-string values. This is the case on AIX 4.3.3.
3820 AC_DEFUN([gt_INTTYPES_PRI],
3822 # autoconf-2.52 has a proper check for inttypes.h.
3825 if test $ac_cv_header_inttypes_h = yes; then
3826 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3827 gt_cv_inttypes_pri_broken,
3829 AC_TRY_COMPILE([#include <inttypes.h>
3833 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3836 if test "$gt_cv_inttypes_pri_broken" = yes; then
3837 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3838 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3844 dnl From Jim Meyering.
3845 dnl A wrapper around AC_FUNC_GETGROUPS.
3847 AC_DEFUN([jm_FUNC_GETGROUPS],
3848 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
3849 if test $ac_cv_func_getgroups_works = no; then
3850 AC_LIBOBJ(getgroups)
3851 AC_DEFINE(getgroups, rpl_getgroups,
3852 [Define as rpl_getgroups if getgroups doesn't work right.])
3854 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3857 # alloca.m4 serial 2 (gettext-0.12)
3858 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3859 dnl This file is free software, distributed under the terms of the GNU
3860 dnl General Public License. As a special exception to the GNU General
3861 dnl Public License, this file may be distributed as part of a program
3862 dnl that contains a configuration script generated by Autoconf, under
3863 dnl the same distribution terms as the rest of that program.
3865 AC_DEFUN([gl_FUNC_ALLOCA],
3867 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
3868 AC_REQUIRE([AC_PROG_CPP])
3869 AC_REQUIRE([AC_PROG_EGREP])
3871 AC_REQUIRE([AC_FUNC_ALLOCA])
3872 if test $ac_cv_func_alloca_works = no; then
3876 # Define an additional variable used in the Makefile substitution.
3878 AC_EGREP_CPP([Need own alloca], [
3879 #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
3885 AC_SUBST([ALLOCA_H])
3888 # Prerequisites of lib/alloca.c.
3889 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
3890 AC_DEFUN([gl_PREREQ_ALLOCA], [
3891 AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
3898 AC_DEFUN([jm_SYS_PROC_UPTIME],
3899 [ dnl Require AC_PROG_CC to see if we're cross compiling.
3900 AC_REQUIRE([AC_PROG_CC])
3901 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
3902 [jm_cv_have_proc_uptime=no
3903 test -f /proc/uptime \
3904 && test "$cross_compiling" = no \
3905 && cat < /proc/uptime >/dev/null 2>/dev/null \
3906 && jm_cv_have_proc_uptime=yes])
3907 if test $jm_cv_have_proc_uptime = yes; then
3908 AC_DEFINE(HAVE_PROC_UPTIME, 1,
3909 [ Define if your system has the /proc/uptime special file.])
3915 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
3917 AC_DEFUN([jm_FUNC_FTRUNCATE],
3919 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
3921 if test "$ftruncate_missing" = yes; then
3922 AC_CHECK_HEADERS([unistd.h])
3923 AC_CHECK_FUNCS([chsize])
3924 AC_LIBOBJ(ftruncate)
3930 dnl From Volker Borchert.
3931 dnl Determine whether rename works for source paths with a trailing slash.
3932 dnl The rename from SunOS 4.1.1_U1 doesn't.
3934 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
3935 dnl to compile the wrapper function.
3938 AC_DEFUN([vb_FUNC_RENAME],
3940 AC_CACHE_CHECK([whether rename is broken],
3941 vb_cv_func_rename_trailing_slash_bug,
3943 rm -rf conftest.d1 conftest.d2
3944 mkdir conftest.d1 ||
3945 AC_MSG_ERROR([cannot create temporary directory])
3951 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
3954 vb_cv_func_rename_trailing_slash_bug=no,
3955 vb_cv_func_rename_trailing_slash_bug=yes,
3956 dnl When crosscompiling, assume rename is broken.
3957 vb_cv_func_rename_trailing_slash_bug=yes)
3959 rm -rf conftest.d1 conftest.d2
3961 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
3963 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
3964 [Define if rename does not work for source paths with a trailing slash,
3965 like the one from SunOS 4.1.1_U1.])
3971 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
3972 # silly limit that it can create no more than 26 files from a given template.
3973 # Other systems lack mkstemp altogether. On either type of system, arrange
3974 # to use the replacement function.
3975 AC_DEFUN([UTILS_FUNC_MKSTEMP],
3977 AC_REPLACE_FUNCS(mkstemp)
3978 if test $ac_cv_func_mkstemp = no; then
3979 utils_cv_func_mkstemp_limitations=yes
3981 AC_CACHE_CHECK([for mkstemp limitations],
3982 utils_cv_func_mkstemp_limitations,
3985 # include <stdlib.h>
3989 for (i = 0; i < 30; i++)
3991 char template[] = "conftestXXXXXX";
3992 int fd = mkstemp (template);
4000 utils_cv_func_mkstemp_limitations=no,
4001 utils_cv_func_mkstemp_limitations=yes,
4002 utils_cv_func_mkstemp_limitations=yes
4008 if test $utils_cv_func_mkstemp_limitations = yes; then
4011 AC_DEFINE(mkstemp, rpl_mkstemp,
4012 [Define to rpl_mkstemp if the replacement function should be used.])
4018 dnl From Jim Meyering.
4020 dnl See if gettimeofday clobbers the static buffer that localtime uses
4021 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
4022 dnl i.e. Darwin 1.3.7 has this problem.
4024 dnl If it does, then arrange to use gettimeofday and localtime only via
4025 dnl the wrapper functions that work around the problem.
4027 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
4029 AC_REQUIRE([AC_HEADER_TIME])
4030 AC_CHECK_HEADERS(string.h stdlib.h)
4031 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
4032 jm_cv_func_gettimeofday_clobber,
4036 # include <string.h>
4039 #if TIME_WITH_SYS_TIME
4040 # include <sys/time.h>
4043 # if HAVE_SYS_TIME_H
4044 # include <sys/time.h>
4051 # include <stdlib.h>
4061 lt = localtime (&t);
4063 gettimeofday (&tv, NULL);
4064 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
4070 jm_cv_func_gettimeofday_clobber=no,
4071 jm_cv_func_gettimeofday_clobber=yes,
4072 dnl When crosscompiling, assume it is broken.
4073 jm_cv_func_gettimeofday_clobber=yes)
4075 if test $jm_cv_func_gettimeofday_clobber = yes; then
4076 # Caution: the following few lines should be the same
4077 # as those in gettimeofday.m4.
4078 AC_LIBOBJ(gettimeofday)
4079 AC_DEFINE(gmtime, rpl_gmtime,
4080 [Define to rpl_gmtime if the replacement function should be used.])
4081 AC_DEFINE(localtime, rpl_localtime,
4082 [Define to rpl_localtime if the replacement function should be used.])
4084 AC_DEFINE(gettimeofday, rpl_gettimeofday,
4085 [Define to rpl_gettimeofday if the replacement function should be used.])
4086 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
4087 [Define if gettimeofday clobbers localtime's static buffer.])
4093 dnl From Jim Meyering
4094 dnl Replace the utime function on systems that need it.
4098 AC_DEFUN([jm_FUNC_UTIME],
4100 AC_CHECK_HEADERS(utime.h)
4101 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
4102 AC_REQUIRE([AC_FUNC_UTIME_NULL])
4104 if test $ac_cv_func_utime_null = no; then
4106 AC_REPLACE_FUNCS(utime)
4112 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
4113 dnl then do case-insensitive s/utime/utimes/.
4115 AC_DEFUN([jm_FUNC_UTIMES_NULL],
4116 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
4117 [rm -f conftest.data; > conftest.data
4119 /* In case stat has been defined to rpl_stat, undef it here. */
4121 #include <sys/types.h>
4122 #include <sys/stat.h>
4125 exit(!(stat ("conftest.data", &s) == 0
4126 && utimes("conftest.data", (long *)0) == 0
4127 && stat("conftest.data", &t) == 0
4128 && t.st_mtime >= s.st_mtime
4129 && t.st_mtime - s.st_mtime < 120));
4131 ac_cv_func_utimes_null=yes,
4132 ac_cv_func_utimes_null=no,
4133 ac_cv_func_utimes_null=no)
4134 rm -f core core.* *.core])
4136 if test $ac_cv_func_utimes_null = yes; then
4137 AC_DEFINE(HAVE_UTIMES_NULL, 1,
4138 [Define if utimes accepts a null argument])
4143 # vasprintf.m4 serial 1
4144 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4145 dnl This file is free software, distributed under the terms of the GNU
4146 dnl General Public License. As a special exception to the GNU General
4147 dnl Public License, this file may be distributed as part of a program
4148 dnl that contains a configuration script generated by Autoconf, under
4149 dnl the same distribution terms as the rest of that program.
4151 AC_DEFUN([gl_FUNC_VASPRINTF],
4153 AC_REPLACE_FUNCS(vasprintf)
4154 if test $ac_cv_func_vasprintf = no; then
4161 # Prerequisites of lib/vasprintf.c.
4162 AC_DEFUN([gl_PREREQ_VASPRINTF],
4166 # Prerequisites of lib/asprintf.c.
4167 AC_DEFUN([gl_PREREQ_ASPRINTF],
4171 # vasnprintf.m4 serial 1
4172 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4173 dnl This file is free software, distributed under the terms of the GNU
4174 dnl General Public License. As a special exception to the GNU General
4175 dnl Public License, this file may be distributed as part of a program
4176 dnl that contains a configuration script generated by Autoconf, under
4177 dnl the same distribution terms as the rest of that program.
4179 AC_DEFUN([gl_FUNC_VASNPRINTF],
4181 AC_REPLACE_FUNCS(vasnprintf)
4182 if test $ac_cv_func_vasnprintf = no; then
4183 AC_LIBOBJ(printf-args)
4184 AC_LIBOBJ(printf-parse)
4185 AC_LIBOBJ(asnprintf)
4186 gl_PREREQ_PRINTF_ARGS
4187 gl_PREREQ_PRINTF_PARSE
4188 gl_PREREQ_VASNPRINTF
4193 # Prequisites of lib/printf-args.h, lib/printf-args.c.
4194 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
4196 AC_REQUIRE([bh_C_SIGNED])
4197 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4198 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4199 AC_REQUIRE([gt_TYPE_WCHAR_T])
4200 AC_REQUIRE([gt_TYPE_WINT_T])
4203 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
4204 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
4206 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4207 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4208 AC_REQUIRE([gt_TYPE_WCHAR_T])
4209 AC_REQUIRE([gt_TYPE_WINT_T])
4210 AC_REQUIRE([AC_TYPE_SIZE_T])
4211 AC_CHECK_TYPES(ptrdiff_t)
4212 AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
4215 # Prerequisites of lib/vasnprintf.c.
4216 AC_DEFUN([gl_PREREQ_VASNPRINTF],
4218 AC_REQUIRE([AC_FUNC_ALLOCA])
4219 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4220 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4221 AC_REQUIRE([gt_TYPE_WCHAR_T])
4222 AC_REQUIRE([gt_TYPE_WINT_T])
4223 AC_CHECK_FUNCS(snprintf)
4226 # Prerequisites of lib/asnprintf.c.
4227 AC_DEFUN([gl_PREREQ_ASNPRINTF],
4231 # signed.m4 serial 1 (gettext-0.10.40)
4232 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4233 dnl This file is free software, distributed under the terms of the GNU
4234 dnl General Public License. As a special exception to the GNU General
4235 dnl Public License, this file may be distributed as part of a program
4236 dnl that contains a configuration script generated by Autoconf, under
4237 dnl the same distribution terms as the rest of that program.
4239 dnl From Bruno Haible.
4241 AC_DEFUN([bh_C_SIGNED],
4243 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
4244 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
4245 if test $bh_cv_c_signed = no; then
4247 [Define to empty if the C compiler doesn't support this keyword.])
4251 # longdouble.m4 serial 1 (gettext-0.12)
4252 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4253 dnl This file is free software, distributed under the terms of the GNU
4254 dnl General Public License. As a special exception to the GNU General
4255 dnl Public License, this file may be distributed as part of a program
4256 dnl that contains a configuration script generated by Autoconf, under
4257 dnl the same distribution terms as the rest of that program.
4259 dnl From Bruno Haible.
4260 dnl Test whether the compiler supports the 'long double' type.
4261 dnl Prerequisite: AC_PROG_CC
4263 AC_DEFUN([gt_TYPE_LONGDOUBLE],
4265 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
4266 [if test "$GCC" = yes; then
4267 gt_cv_c_long_double=yes
4270 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
4271 long double foo = 0.0;
4272 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
4273 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
4275 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
4277 if test $gt_cv_c_long_double = yes; then
4278 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
4282 # wchar_t.m4 serial 1 (gettext-0.12)
4283 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4284 dnl This file is free software, distributed under the terms of the GNU
4285 dnl General Public License. As a special exception to the GNU General
4286 dnl Public License, this file may be distributed as part of a program
4287 dnl that contains a configuration script generated by Autoconf, under
4288 dnl the same distribution terms as the rest of that program.
4290 dnl From Bruno Haible.
4291 dnl Test whether <stddef.h> has the 'wchar_t' type.
4292 dnl Prerequisite: AC_PROG_CC
4294 AC_DEFUN([gt_TYPE_WCHAR_T],
4296 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
4297 [AC_TRY_COMPILE([#include <stddef.h>
4298 wchar_t foo = (wchar_t)'\0';], ,
4299 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
4300 if test $gt_cv_c_wchar_t = yes; then
4301 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
4305 # wint_t.m4 serial 1 (gettext-0.12)
4306 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4307 dnl This file is free software, distributed under the terms of the GNU
4308 dnl General Public License. As a special exception to the GNU General
4309 dnl Public License, this file may be distributed as part of a program
4310 dnl that contains a configuration script generated by Autoconf, under
4311 dnl the same distribution terms as the rest of that program.
4313 dnl From Bruno Haible.
4314 dnl Test whether <wchar.h> has the 'wint_t' type.
4315 dnl Prerequisite: AC_PROG_CC
4317 AC_DEFUN([gt_TYPE_WINT_T],
4319 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
4320 [AC_TRY_COMPILE([#include <wchar.h>
4321 wint_t foo = (wchar_t)'\0';], ,
4322 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
4323 if test $gt_cv_c_wint_t = yes; then
4324 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
4330 dnl See if there's a working, system-supplied version of the getline function.
4331 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
4332 dnl have a function by that name in -linet that doesn't have anything
4333 dnl to do with the function we need.
4334 AC_DEFUN([AM_FUNC_GETLINE],
4336 am_getline_needs_run_time_check=no
4337 AC_CHECK_FUNC(getline,
4338 dnl Found it in some library. Verify that it works.
4339 am_getline_needs_run_time_check=yes,
4340 am_cv_func_working_getline=no)
4341 if test $am_getline_needs_run_time_check = yes; then
4342 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
4343 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
4346 # include <sys/types.h>
4347 # include <string.h>
4349 { /* Based on a test program from Karl Heuer. */
4353 FILE *in = fopen ("./conftest.data", "r");
4356 len = getline (&line, &siz, in);
4357 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
4359 ], am_cv_func_working_getline=yes dnl The library version works.
4360 , am_cv_func_working_getline=no dnl The library version does NOT work.
4361 , am_cv_func_working_getline=no dnl We're cross compiling.
4365 if test $am_cv_func_working_getline = no; then
4371 # Determine approximately how many files may be open simultaneously
4372 # in one process. This is approximate, since while running this test,
4373 # the configure script already has a few files open.
4376 AC_DEFUN([UTILS_SYS_OPEN_MAX],
4378 AC_CACHE_CHECK([determine how many files may be open simultaneously],
4379 utils_cv_sys_open_max,
4381 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4388 FILE *result = fopen ("conftest.omax", "w");
4390 /* Impose an arbitrary limit, in case some system has no
4391 effective limit on the number of simultaneously open files. */
4394 FILE *s = fopen ("conftest.op", "w");
4399 fprintf (result, "%d\n", i);
4400 exit (fclose (result) == EOF);
4403 [utils_cv_sys_open_max=`cat conftest.omax`],
4404 [utils_cv_sys_open_max='internal error in open-max.m4'],
4405 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
4407 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
4408 $utils_cv_sys_open_max,
4409 [the maximum number of simultaneously open files per process])
4413 # Check whether getcwd has the bug that it succeeds for a working directory
4414 # longer than PATH_MAX, yet returns a truncated directory name.
4415 # If so, arrange to compile the wrapper function.
4417 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
4418 # I've heard that this is due to a Linux kernel bug, and that it has
4419 # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */
4423 AC_DEFUN([GL_FUNC_GETCWD_PATH_MAX],
4425 AC_CHECK_DECLS([getcwd])
4426 AC_CACHE_CHECK([whether getcwd properly handles paths longer than PATH_MAX],
4427 gl_cv_func_getcwd_vs_path_max,
4429 # Arrange for deletion of the temporary directory this test creates.
4430 ac_clean_files="$ac_clean_files confdir3"
4431 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4436 #include <sys/stat.h>
4437 #include <sys/types.h>
4439 /* Don't get link errors because mkdir is redefined to rpl_mkdir. */
4446 /* The extra casts work around common compiler bugs. */
4447 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
4448 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
4449 It is necessary at least when t == time_t. */
4450 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
4451 ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
4452 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
4455 # define INT_MAX TYPE_MAXIMUM (int)
4458 /* The length of this name must be 8. */
4459 #define DIR_NAME "confdir3"
4465 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
4466 at least not on a local file system. And if we were to start worrying
4467 about remote file systems, we'd have to enable the wrapper function
4468 all of the time, just to be safe. That's not worth the cost. */
4470 #elif INT_MAX - 9 <= PATH_MAX
4471 /* The '9', above, comes from strlen (DIR_NAME) + 1. */
4472 /* FIXME: Assuming there's a system for which this is true,
4473 this should be done in a compile test. */
4476 char buf[PATH_MAX + 20];
4477 char *cwd = getcwd (buf, PATH_MAX);
4480 size_t n_chdirs = 0;
4485 cwd_len = strlen (cwd);
4492 cwd_len += 1 + strlen (DIR_NAME);
4493 /* If mkdir or chdir fails, be pessimistic and consider that
4494 as a failure, too. */
4495 if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0)
4500 if ((c = getcwd (buf, PATH_MAX)) == NULL)
4502 /* This allows any failure to indicate there is no bug.
4503 FIXME: check errno? */
4506 if ((len = strlen (c)) != cwd_len)
4516 /* Leaving behind such a deep directory is not polite.
4517 So clean up here, right away, even though the driving
4518 shell script would also clean up. */
4522 /* Unlink first, in case the chdir failed. */
4524 for (i = 0; i <= n_chdirs; i++)
4526 if (chdir ("..") < 0)
4536 [gl_cv_func_getcwd_vs_path_max=yes],
4537 [gl_cv_func_getcwd_vs_path_max=no],
4538 [gl_cv_func_getcwd_vs_path_max=no])])
4540 if test $gl_cv_func_getcwd_vs_path_max = yes; then
4542 AC_DEFINE(getcwd, rpl_getcwd,
4543 [Define to rpl_getcwd if the wrapper function should be used.])
4549 dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
4550 dnl to test whether a NULL return value really means there are no more files
4551 dnl in the directory.
4553 dnl And the rm from coreutils-5.0 exposes a similar problem when there
4554 dnl are 338 or more files in a directory on a Darwin-6.5 system
4556 dnl Detect the problem by creating a directory containing 500 files (254 not
4557 dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
4558 dnl if a loop doing `readdir; unlink' removes all of them.
4560 dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
4562 dnl Written by Jim Meyering.
4564 AC_DEFUN([GL_FUNC_READDIR],
4566 AC_REQUIRE([AC_HEADER_DIRENT])
4567 AC_CHECK_HEADERS(string.h)
4568 AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
4570 # Arrange for deletion of the temporary directory this test creates, in
4571 # case the test itself fails to delete everything -- as happens on Sunos.
4572 ac_clean_files="$ac_clean_files conf-dir"
4575 [# include <stdio.h>
4576 # include <sys/types.h>
4578 # include <string.h>
4581 # ifdef HAVE_DIRENT_H
4582 # include <dirent.h>
4583 # define NLENGTH(direct) (strlen((direct)->d_name))
4584 # else /* not HAVE_DIRENT_H */
4585 # define dirent direct
4586 # define NLENGTH(direct) ((direct)->d_namlen)
4587 # ifdef HAVE_SYS_NDIR_H
4588 # include <sys/ndir.h>
4589 # endif /* HAVE_SYS_NDIR_H */
4590 # ifdef HAVE_SYS_DIR_H
4591 # include <sys/dir.h>
4592 # endif /* HAVE_SYS_DIR_H */
4595 # endif /* HAVE_NDIR_H */
4596 # endif /* HAVE_DIRENT_H */
4598 # define DOT_OR_DOTDOT(Basename) \
4599 (Basename[0] == '.' && (Basename[1] == '\0' \
4600 || (Basename[1] == '.' && Basename[2] == '\0')))
4602 /* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
4606 create_N_file_dir (const char *dir, size_t n_files)
4610 if (mkdir (dir, 0700))
4615 for (i = 0; i < n_files; i++)
4620 sprintf (file_name, "%03d", i);
4621 out = fopen (file_name, "w");
4624 if (fclose (out) == EOF)
4633 remove_dir (const char *dir)
4640 dirp = opendir (".");
4646 struct dirent *dp = readdir (dirp);
4650 if (DOT_OR_DOTDOT (dp->d_name))
4653 if (unlink (dp->d_name))
4668 const char *dir = "conf-dir";
4669 create_N_file_dir (dir, 500);
4673 gl_cv_func_working_readdir=yes,
4674 gl_cv_func_working_readdir=no,
4675 gl_cv_func_working_readdir=no)])
4677 if test $gl_cv_func_working_readdir = yes; then
4678 AC_DEFINE(HAVE_WORKING_READDIR, 1,
4679 [Define if readdir is found to work properly in some unusual cases. ])
4683 # codeset.m4 serial AM1 (gettext-0.10.40)
4684 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4685 dnl This file is free software, distributed under the terms of the GNU
4686 dnl General Public License. As a special exception to the GNU General
4687 dnl Public License, this file may be distributed as part of a program
4688 dnl that contains a configuration script generated by Autoconf, under
4689 dnl the same distribution terms as the rest of that program.
4691 dnl From Bruno Haible.
4693 AC_DEFUN([AM_LANGINFO_CODESET],
4695 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
4696 [AC_TRY_LINK([#include <langinfo.h>],
4697 [char* cs = nl_langinfo(CODESET);],
4698 am_cv_langinfo_codeset=yes,
4699 am_cv_langinfo_codeset=no)
4701 if test $am_cv_langinfo_codeset = yes; then
4702 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
4703 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
4707 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
4708 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4709 dnl This file is free software, distributed under the terms of the GNU
4710 dnl General Public License. As a special exception to the GNU General
4711 dnl Public License, this file may be distributed as part of a program
4712 dnl that contains a configuration script generated by Autoconf, under
4713 dnl the same distribution terms as the rest of that program.
4715 # Test for the GNU C Library, version 2.1 or newer.
4716 # From Bruno Haible.
4718 AC_DEFUN([jm_GLIBC21],
4720 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
4721 ac_cv_gnu_library_2_1,
4722 [AC_EGREP_CPP([Lucky GNU user],
4724 #include <features.h>
4725 #ifdef __GNU_LIBRARY__
4726 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
4731 ac_cv_gnu_library_2_1=yes,
4732 ac_cv_gnu_library_2_1=no)
4736 GLIBC21="$ac_cv_gnu_library_2_1"
4740 # iconv.m4 serial AM4 (gettext-0.11.3)
4741 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4742 dnl This file is free software, distributed under the terms of the GNU
4743 dnl General Public License. As a special exception to the GNU General
4744 dnl Public License, this file may be distributed as part of a program
4745 dnl that contains a configuration script generated by Autoconf, under
4746 dnl the same distribution terms as the rest of that program.
4748 dnl From Bruno Haible.
4750 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4752 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4753 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4754 AC_REQUIRE([AC_LIB_RPATH])
4756 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4758 AC_LIB_LINKFLAGS_BODY([iconv])
4761 AC_DEFUN([AM_ICONV_LINK],
4763 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4764 dnl those with the standalone portable GNU libiconv installed).
4766 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4768 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4770 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4771 dnl because if the user has installed libiconv and not disabled its use
4772 dnl via --without-libiconv-prefix, he wants to use it. The first
4773 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4774 am_save_CPPFLAGS="$CPPFLAGS"
4775 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4777 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4778 am_cv_func_iconv="no, consider installing GNU libiconv"
4780 AC_TRY_LINK([#include <stdlib.h>
4781 #include <iconv.h>],
4782 [iconv_t cd = iconv_open("","");
4783 iconv(cd,NULL,NULL,NULL,NULL);
4785 am_cv_func_iconv=yes)
4786 if test "$am_cv_func_iconv" != yes; then
4787 am_save_LIBS="$LIBS"
4788 LIBS="$LIBS $LIBICONV"
4789 AC_TRY_LINK([#include <stdlib.h>
4790 #include <iconv.h>],
4791 [iconv_t cd = iconv_open("","");
4792 iconv(cd,NULL,NULL,NULL,NULL);
4795 am_cv_func_iconv=yes)
4796 LIBS="$am_save_LIBS"
4799 if test "$am_cv_func_iconv" = yes; then
4800 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4802 if test "$am_cv_lib_iconv" = yes; then
4803 AC_MSG_CHECKING([how to link with libiconv])
4804 AC_MSG_RESULT([$LIBICONV])
4806 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4808 CPPFLAGS="$am_save_CPPFLAGS"
4813 AC_SUBST(LTLIBICONV)
4816 AC_DEFUN([AM_ICONV],
4819 if test "$am_cv_func_iconv" = yes; then
4820 AC_MSG_CHECKING([for iconv declaration])
4821 AC_CACHE_VAL(am_cv_proto_iconv, [
4829 #if defined(__STDC__) || defined(__cplusplus)
4830 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4834 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4835 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);"])
4836 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4837 AC_MSG_RESULT([$]{ac_t:-
4838 }[$]am_cv_proto_iconv)
4839 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4840 [Define as const if the declaration of iconv() needs const.])
4844 # lib-prefix.m4 serial 1 (gettext-0.11)
4845 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4846 dnl This file is free software, distributed under the terms of the GNU
4847 dnl General Public License. As a special exception to the GNU General
4848 dnl Public License, this file may be distributed as part of a program
4849 dnl that contains a configuration script generated by Autoconf, under
4850 dnl the same distribution terms as the rest of that program.
4852 dnl From Bruno Haible.
4854 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
4855 dnl to access previously installed libraries. The basic assumption is that
4856 dnl a user will want packages to use other packages he previously installed
4857 dnl with the same --prefix option.
4858 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
4859 dnl libraries, but is otherwise very convenient.
4860 AC_DEFUN([AC_LIB_PREFIX],
4862 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4863 AC_REQUIRE([AC_PROG_CC])
4864 AC_REQUIRE([AC_CANONICAL_HOST])
4865 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4866 dnl By default, look in $includedir and $libdir.
4868 AC_LIB_WITH_FINAL_PREFIX([
4869 eval additional_includedir=\"$includedir\"
4870 eval additional_libdir=\"$libdir\"
4872 AC_ARG_WITH([lib-prefix],
4873 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
4874 --without-lib-prefix don't search for libraries in includedir and libdir],
4876 if test "X$withval" = "Xno"; then
4879 if test "X$withval" = "X"; then
4880 AC_LIB_WITH_FINAL_PREFIX([
4881 eval additional_includedir=\"$includedir\"
4882 eval additional_libdir=\"$libdir\"
4885 additional_includedir="$withval/include"
4886 additional_libdir="$withval/lib"
4890 if test $use_additional = yes; then
4891 dnl Potentially add $additional_includedir to $CPPFLAGS.
4892 dnl But don't add it
4893 dnl 1. if it's the standard /usr/include,
4894 dnl 2. if it's already present in $CPPFLAGS,
4895 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
4896 dnl 4. if it doesn't exist as a directory.
4897 if test "X$additional_includedir" != "X/usr/include"; then
4899 for x in $CPPFLAGS; do
4900 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4901 if test "X$x" = "X-I$additional_includedir"; then
4906 if test -z "$haveit"; then
4907 if test "X$additional_includedir" = "X/usr/local/include"; then
4908 if test -n "$GCC"; then
4910 linux*) haveit=yes;;
4914 if test -z "$haveit"; then
4915 if test -d "$additional_includedir"; then
4916 dnl Really add $additional_includedir to $CPPFLAGS.
4917 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
4922 dnl Potentially add $additional_libdir to $LDFLAGS.
4923 dnl But don't add it
4924 dnl 1. if it's the standard /usr/lib,
4925 dnl 2. if it's already present in $LDFLAGS,
4926 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
4927 dnl 4. if it doesn't exist as a directory.
4928 if test "X$additional_libdir" != "X/usr/lib"; then
4930 for x in $LDFLAGS; do
4931 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4932 if test "X$x" = "X-L$additional_libdir"; then
4937 if test -z "$haveit"; then
4938 if test "X$additional_libdir" = "X/usr/local/lib"; then
4939 if test -n "$GCC"; then
4941 linux*) haveit=yes;;
4945 if test -z "$haveit"; then
4946 if test -d "$additional_libdir"; then
4947 dnl Really add $additional_libdir to $LDFLAGS.
4948 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
4956 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
4957 dnl acl_final_exec_prefix, containing the values to which $prefix and
4958 dnl $exec_prefix will expand at the end of the configure script.
4959 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
4961 dnl Unfortunately, prefix and exec_prefix get only finally determined
4962 dnl at the end of configure.
4963 if test "X$prefix" = "XNONE"; then
4964 acl_final_prefix="$ac_default_prefix"
4966 acl_final_prefix="$prefix"
4968 if test "X$exec_prefix" = "XNONE"; then
4969 acl_final_exec_prefix='${prefix}'
4971 acl_final_exec_prefix="$exec_prefix"
4973 acl_save_prefix="$prefix"
4974 prefix="$acl_final_prefix"
4975 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
4976 prefix="$acl_save_prefix"
4979 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
4980 dnl variables prefix and exec_prefix bound to the values they will have
4981 dnl at the end of the configure script.
4982 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
4984 acl_save_prefix="$prefix"
4985 prefix="$acl_final_prefix"
4986 acl_save_exec_prefix="$exec_prefix"
4987 exec_prefix="$acl_final_exec_prefix"
4989 exec_prefix="$acl_save_exec_prefix"
4990 prefix="$acl_save_prefix"
4993 # lib-link.m4 serial 3 (gettext-0.11.3)
4994 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4995 dnl This file is free software, distributed under the terms of the GNU
4996 dnl General Public License. As a special exception to the GNU General
4997 dnl Public License, this file may be distributed as part of a program
4998 dnl that contains a configuration script generated by Autoconf, under
4999 dnl the same distribution terms as the rest of that program.
5001 dnl From Bruno Haible.
5003 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
5004 dnl the libraries corresponding to explicit and implicit dependencies.
5005 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
5006 dnl augments the CPPFLAGS variable.
5007 AC_DEFUN([AC_LIB_LINKFLAGS],
5009 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5010 AC_REQUIRE([AC_LIB_RPATH])
5011 define([Name],[translit([$1],[./-], [___])])
5012 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5013 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5014 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
5015 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5016 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
5017 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
5018 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
5020 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
5021 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
5022 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
5023 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5025 AC_SUBST([LTLIB]NAME)
5026 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
5027 dnl results of this search when this library appears as a dependency.
5033 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
5034 dnl searches for libname and the libraries corresponding to explicit and
5035 dnl implicit dependencies, together with the specified include files and
5036 dnl the ability to compile and link the specified testcode. If found, it
5037 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
5038 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
5039 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
5040 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
5041 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
5043 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5044 AC_REQUIRE([AC_LIB_RPATH])
5045 define([Name],[translit([$1],[./-], [___])])
5046 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5047 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5049 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
5051 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5053 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
5054 dnl because if the user has installed lib[]Name and not disabled its use
5055 dnl via --without-lib[]Name-prefix, he wants to use it.
5056 ac_save_CPPFLAGS="$CPPFLAGS"
5057 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5059 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5060 ac_save_LIBS="$LIBS"
5061 LIBS="$LIBS $LIB[]NAME"
5062 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5063 LIBS="$ac_save_LIBS"
5065 if test "$ac_cv_lib[]Name" = yes; then
5067 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5068 AC_MSG_CHECKING([how to link with lib[]$1])
5069 AC_MSG_RESULT([$LIB[]NAME])
5072 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5073 dnl $INC[]NAME either.
5074 CPPFLAGS="$ac_save_CPPFLAGS"
5078 AC_SUBST([HAVE_LIB]NAME)
5080 AC_SUBST([LTLIB]NAME)
5085 dnl Determine the platform dependent parameters needed to use rpath:
5086 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5087 dnl hardcode_direct, hardcode_minus_L,
5088 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5089 AC_DEFUN([AC_LIB_RPATH],
5091 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
5092 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
5093 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
5094 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5095 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5096 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5097 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5103 libext="$acl_cv_libext"
5104 shlibext="$acl_cv_shlibext"
5105 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5106 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5107 hardcode_direct="$acl_cv_hardcode_direct"
5108 hardcode_minus_L="$acl_cv_hardcode_minus_L"
5109 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5110 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5111 dnl Determine whether the user wants rpath handling at all.
5112 AC_ARG_ENABLE(rpath,
5113 [ --disable-rpath do not hardcode runtime library paths],
5114 :, enable_rpath=yes)
5117 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5118 dnl the libraries corresponding to explicit and implicit dependencies.
5119 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5120 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5122 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5123 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5124 dnl By default, look in $includedir and $libdir.
5126 AC_LIB_WITH_FINAL_PREFIX([
5127 eval additional_includedir=\"$includedir\"
5128 eval additional_libdir=\"$libdir\"
5130 AC_ARG_WITH([lib$1-prefix],
5131 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
5132 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
5134 if test "X$withval" = "Xno"; then
5137 if test "X$withval" = "X"; then
5138 AC_LIB_WITH_FINAL_PREFIX([
5139 eval additional_includedir=\"$includedir\"
5140 eval additional_libdir=\"$libdir\"
5143 additional_includedir="$withval/include"
5144 additional_libdir="$withval/lib"
5148 dnl Search the library and its dependencies in $additional_libdir and
5149 dnl $LDFLAGS. Using breadth-first-seach.
5155 names_already_handled=
5156 names_next_round='$1 $2'
5157 while test -n "$names_next_round"; do
5158 names_this_round="$names_next_round"
5160 for name in $names_this_round; do
5162 for n in $names_already_handled; do
5163 if test "$n" = "$name"; then
5168 if test -z "$already_handled"; then
5169 names_already_handled="$names_already_handled $name"
5170 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5171 dnl or AC_LIB_HAVE_LINKFLAGS call.
5172 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5173 eval value=\"\$HAVE_LIB$uppername\"
5174 if test -n "$value"; then
5175 if test "$value" = yes; then
5176 eval value=\"\$LIB$uppername\"
5177 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5178 eval value=\"\$LTLIB$uppername\"
5179 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5181 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5182 dnl that this library doesn't exist. So just drop it.
5186 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5187 dnl and the already constructed $LIBNAME/$LTLIBNAME.
5192 if test $use_additional = yes; then
5193 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5194 found_dir="$additional_libdir"
5195 found_so="$additional_libdir/lib$name.$shlibext"
5196 if test -f "$additional_libdir/lib$name.la"; then
5197 found_la="$additional_libdir/lib$name.la"
5200 if test -f "$additional_libdir/lib$name.$libext"; then
5201 found_dir="$additional_libdir"
5202 found_a="$additional_libdir/lib$name.$libext"
5203 if test -f "$additional_libdir/lib$name.la"; then
5204 found_la="$additional_libdir/lib$name.la"
5209 if test "X$found_dir" = "X"; then
5210 for x in $LDFLAGS $LTLIB[]NAME; do
5211 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5214 dir=`echo "X$x" | sed -e 's/^X-L//'`
5215 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5217 found_so="$dir/lib$name.$shlibext"
5218 if test -f "$dir/lib$name.la"; then
5219 found_la="$dir/lib$name.la"
5222 if test -f "$dir/lib$name.$libext"; then
5224 found_a="$dir/lib$name.$libext"
5225 if test -f "$dir/lib$name.la"; then
5226 found_la="$dir/lib$name.la"
5232 if test "X$found_dir" != "X"; then
5237 if test "X$found_dir" != "X"; then
5238 dnl Found the library.
5239 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5240 if test "X$found_so" != "X"; then
5241 dnl Linking with a shared library. We attempt to hardcode its
5242 dnl directory into the executable's runpath, unless it's the
5243 dnl standard /usr/lib.
5244 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5245 dnl No hardcoding is needed.
5246 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5248 dnl Use an explicit option to hardcode DIR into the resulting
5250 dnl Potentially add DIR to ltrpathdirs.
5251 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5253 for x in $ltrpathdirs; do
5254 if test "X$x" = "X$found_dir"; then
5259 if test -z "$haveit"; then
5260 ltrpathdirs="$ltrpathdirs $found_dir"
5262 dnl The hardcoding into $LIBNAME is system dependent.
5263 if test "$hardcode_direct" = yes; then
5264 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5265 dnl resulting binary.
5266 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5268 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5269 dnl Use an explicit option to hardcode DIR into the resulting
5271 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5272 dnl Potentially add DIR to rpathdirs.
5273 dnl The rpathdirs will be appended to $LIBNAME at the end.
5275 for x in $rpathdirs; do
5276 if test "X$x" = "X$found_dir"; then
5281 if test -z "$haveit"; then
5282 rpathdirs="$rpathdirs $found_dir"
5285 dnl Rely on "-L$found_dir".
5286 dnl But don't add it if it's already contained in the LDFLAGS
5287 dnl or the already constructed $LIBNAME
5289 for x in $LDFLAGS $LIB[]NAME; do
5290 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5291 if test "X$x" = "X-L$found_dir"; then
5296 if test -z "$haveit"; then
5297 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5299 if test "$hardcode_minus_L" != no; then
5300 dnl FIXME: Not sure whether we should use
5301 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5303 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5305 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5306 dnl here, because this doesn't fit in flags passed to the
5307 dnl compiler. So give up. No hardcoding. This affects only
5308 dnl very old systems.
5309 dnl FIXME: Not sure whether we should use
5310 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5312 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5318 if test "X$found_a" != "X"; then
5319 dnl Linking with a static library.
5320 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5322 dnl We shouldn't come here, but anyway it's good to have a
5324 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5327 dnl Assume the include files are nearby.
5328 additional_includedir=
5329 case "$found_dir" in
5331 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5332 additional_includedir="$basedir/include"
5335 if test "X$additional_includedir" != "X"; then
5336 dnl Potentially add $additional_includedir to $INCNAME.
5337 dnl But don't add it
5338 dnl 1. if it's the standard /usr/include,
5339 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
5340 dnl 3. if it's already present in $CPPFLAGS or the already
5341 dnl constructed $INCNAME,
5342 dnl 4. if it doesn't exist as a directory.
5343 if test "X$additional_includedir" != "X/usr/include"; then
5345 if test "X$additional_includedir" = "X/usr/local/include"; then
5346 if test -n "$GCC"; then
5348 linux*) haveit=yes;;
5352 if test -z "$haveit"; then
5353 for x in $CPPFLAGS $INC[]NAME; do
5354 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5355 if test "X$x" = "X-I$additional_includedir"; then
5360 if test -z "$haveit"; then
5361 if test -d "$additional_includedir"; then
5362 dnl Really add $additional_includedir to $INCNAME.
5363 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5369 dnl Look for dependencies.
5370 if test -n "$found_la"; then
5371 dnl Read the .la file. It defines the variables
5372 dnl dlname, library_names, old_library, dependency_libs, current,
5373 dnl age, revision, installed, dlopen, dlpreopen, libdir.
5374 save_libdir="$libdir"
5376 */* | *\\*) . "$found_la" ;;
5377 *) . "./$found_la" ;;
5379 libdir="$save_libdir"
5380 dnl We use only dependency_libs.
5381 for dep in $dependency_libs; do
5384 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5385 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5386 dnl But don't add it
5387 dnl 1. if it's the standard /usr/lib,
5388 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
5389 dnl 3. if it's already present in $LDFLAGS or the already
5390 dnl constructed $LIBNAME,
5391 dnl 4. if it doesn't exist as a directory.
5392 if test "X$additional_libdir" != "X/usr/lib"; then
5394 if test "X$additional_libdir" = "X/usr/local/lib"; then
5395 if test -n "$GCC"; then
5397 linux*) haveit=yes;;
5401 if test -z "$haveit"; then
5403 for x in $LDFLAGS $LIB[]NAME; do
5404 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5405 if test "X$x" = "X-L$additional_libdir"; then
5410 if test -z "$haveit"; then
5411 if test -d "$additional_libdir"; then
5412 dnl Really add $additional_libdir to $LIBNAME.
5413 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5417 for x in $LDFLAGS $LTLIB[]NAME; do
5418 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5419 if test "X$x" = "X-L$additional_libdir"; then
5424 if test -z "$haveit"; then
5425 if test -d "$additional_libdir"; then
5426 dnl Really add $additional_libdir to $LTLIBNAME.
5427 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5434 dir=`echo "X$dep" | sed -e 's/^X-R//'`
5435 if test "$enable_rpath" != no; then
5436 dnl Potentially add DIR to rpathdirs.
5437 dnl The rpathdirs will be appended to $LIBNAME at the end.
5439 for x in $rpathdirs; do
5440 if test "X$x" = "X$dir"; then
5445 if test -z "$haveit"; then
5446 rpathdirs="$rpathdirs $dir"
5448 dnl Potentially add DIR to ltrpathdirs.
5449 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5451 for x in $ltrpathdirs; do
5452 if test "X$x" = "X$dir"; then
5457 if test -z "$haveit"; then
5458 ltrpathdirs="$ltrpathdirs $dir"
5463 dnl Handle this in the next round.
5464 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5467 dnl Handle this in the next round. Throw away the .la's
5468 dnl directory; it is already contained in a preceding -L
5470 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5473 dnl Most likely an immediate library name.
5474 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5475 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5481 dnl Didn't find the library; assume it is in the system directories
5482 dnl known to the linker and runtime loader. (All the system
5483 dnl directories known to the linker should also be known to the
5484 dnl runtime loader, otherwise the system is severely misconfigured.)
5485 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5486 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5492 if test "X$rpathdirs" != "X"; then
5493 if test -n "$hardcode_libdir_separator"; then
5494 dnl Weird platform: only the last -rpath option counts, the user must
5495 dnl pass all path elements in one option. We can arrange that for a
5496 dnl single library, but not when more than one $LIBNAMEs are used.
5498 for found_dir in $rpathdirs; do
5499 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5501 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5502 acl_save_libdir="$libdir"
5504 eval flag=\"$hardcode_libdir_flag_spec\"
5505 libdir="$acl_save_libdir"
5506 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5508 dnl The -rpath options are cumulative.
5509 for found_dir in $rpathdirs; do
5510 acl_save_libdir="$libdir"
5512 eval flag=\"$hardcode_libdir_flag_spec\"
5513 libdir="$acl_save_libdir"
5514 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5518 if test "X$ltrpathdirs" != "X"; then
5519 dnl When using libtool, the option that works for both libraries and
5520 dnl executables is -R. The -R options are cumulative.
5521 for found_dir in $ltrpathdirs; do
5522 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5527 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5528 dnl unless already present in VAR.
5529 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5530 dnl contains two or three consecutive elements that belong together.
5531 AC_DEFUN([AC_LIB_APPENDTOVAR],
5533 for element in [$2]; do
5536 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5537 if test "X$x" = "X$element"; then
5542 if test -z "$haveit"; then
5543 [$1]="${[$1]}${[$1]:+ }$element"
5548 # lib-ld.m4 serial 2
5549 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
5550 dnl This file is free software, distributed under the terms of the GNU
5551 dnl General Public License. As a special exception to the GNU General
5552 dnl Public License, this file may be distributed as part of a program
5553 dnl that contains a configuration script generated by Autoconf, under
5554 dnl the same distribution terms as the rest of that program.
5556 dnl Subroutines of libtool.m4,
5557 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5558 dnl with libtool.m4.
5560 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5561 AC_DEFUN([AC_LIB_PROG_LD_GNU],
5562 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5563 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5564 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5565 acl_cv_prog_gnu_ld=yes
5567 acl_cv_prog_gnu_ld=no
5569 with_gnu_ld=$acl_cv_prog_gnu_ld
5572 dnl From libtool-1.4. Sets the variable LD.
5573 AC_DEFUN([AC_LIB_PROG_LD],
5574 [AC_ARG_WITH(gnu-ld,
5575 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5576 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5577 AC_REQUIRE([AC_PROG_CC])dnl
5578 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5580 if test "$GCC" = yes; then
5581 # Check if gcc -print-prog-name=ld gives a path.
5582 AC_MSG_CHECKING([for ld used by GCC])
5585 # gcc leaves a trailing carriage return which upsets mingw
5586 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5588 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5591 # Accept absolute paths.
5592 [[\\/]* | [A-Za-z]:[\\/]*)]
5593 [re_direlt='/[^/][^/]*/\.\./']
5594 # Canonicalize the path of ld
5595 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5596 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5597 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5599 test -z "$LD" && LD="$ac_prog"
5602 # If it fails, then pretend we aren't using GCC.
5606 # If it is relative, then search for the first ld in PATH.
5610 elif test "$with_gnu_ld" = yes; then
5611 AC_MSG_CHECKING([for GNU ld])
5613 AC_MSG_CHECKING([for non-GNU ld])
5615 AC_CACHE_VAL(acl_cv_path_LD,
5616 [if test -z "$LD"; then
5617 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5618 for ac_dir in $PATH; do
5619 test -z "$ac_dir" && ac_dir=.
5620 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5621 acl_cv_path_LD="$ac_dir/$ac_prog"
5622 # Check to see if the program is GNU ld. I'd rather use --version,
5623 # but apparently some GNU ld's only accept -v.
5624 # Break only if it was the GNU/non-GNU ld that we prefer.
5625 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5626 test "$with_gnu_ld" != no && break
5628 test "$with_gnu_ld" != yes && break
5634 acl_cv_path_LD="$LD" # Let the user override the test with a path.
5636 LD="$acl_cv_path_LD"
5637 if test -n "$LD"; then
5642 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5648 dnl From J. David Anglin.
5650 dnl HPUX and other systems can't unlink shared text that is being executed.
5652 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
5654 AC_CACHE_CHECK([whether a running program can be unlinked],
5655 jm_cv_func_unlink_busy_text,
5664 exit (unlink (argv[0]));
5667 jm_cv_func_unlink_busy_text=yes,
5668 jm_cv_func_unlink_busy_text=no,
5669 jm_cv_func_unlink_busy_text=no
5674 if test $jm_cv_func_unlink_busy_text = no; then
5675 INSTALL=$ac_install_sh
5681 dnl From Jim Meyering.
5683 dnl This is not pretty. I've just taken the autoconf code and wrapped
5684 dnl it in an AC_DEFUN.
5687 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5688 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
5690 AC_CHECK_FUNCS(listmntent getmntinfo)
5691 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
5692 getfsstat_includes="\
5693 $ac_includes_default
5694 #if HAVE_SYS_PARAM_H
5695 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
5697 #if HAVE_SYS_UCRED_H
5698 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
5700 #if HAVE_SYS_MOUNT_H
5701 # include <sys/mount.h>
5703 #if HAVE_SYS_FS_TYPES_H
5704 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
5707 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
5709 # Determine how to get the list of mounted filesystems.
5712 # If the getmntent function is available but not in the standard library,
5713 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
5716 # This test must precede the ones for getmntent because Unicos-9 is
5717 # reported to have the getmntent function, but its support is incompatible
5718 # with other getmntent implementations.
5720 # NOTE: Normally, I wouldn't use a check for system type as I've done for
5721 # `CRAY' below since that goes against the whole autoconf philosophy. But
5722 # I think there is too great a chance that some non-Cray system has a
5723 # function named listmntent to risk the false positive.
5725 if test -z "$ac_list_mounted_fs"; then
5727 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
5728 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
5729 [fu_cv_sys_mounted_cray_listmntent=no
5734 ], [test $ac_cv_func_listmntent = yes \
5735 && fu_cv_sys_mounted_cray_listmntent=yes]
5739 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
5740 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
5741 ac_list_mounted_fs=found
5742 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
5743 [Define if there is a function named listmntent that can be used to
5744 list all mounted filesystems. (UNICOS)])
5748 if test -z "$ac_list_mounted_fs"; then
5750 AC_MSG_CHECKING([for mntctl function and struct vmount])
5751 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
5752 [AC_TRY_CPP([#include <fshelp.h>],
5753 fu_cv_sys_mounted_vmount=yes,
5754 fu_cv_sys_mounted_vmount=no)])
5755 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
5756 if test $fu_cv_sys_mounted_vmount = yes; then
5757 ac_list_mounted_fs=found
5758 AC_DEFINE(MOUNTED_VMOUNT, 1,
5759 [Define if there is a function named mntctl that can be used to read
5760 the list of mounted filesystems, and there is a system header file
5761 that declares `struct vmount.' (AIX)])
5765 if test $ac_cv_func_getmntent = yes; then
5767 # This system has the getmntent function.
5768 # Determine whether it's the one-argument variant or the two-argument one.
5770 if test -z "$ac_list_mounted_fs"; then
5771 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
5772 AC_MSG_CHECKING([for one-argument getmntent function])
5773 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
5775 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
5779 #if !defined MOUNTED
5780 # if defined _PATH_MOUNTED /* GNU libc */
5781 # define MOUNTED _PATH_MOUNTED
5783 # if defined MNT_MNTTAB /* HP-UX. */
5784 # define MOUNTED MNT_MNTTAB
5786 # if defined MNTTABNAME /* Dynix. */
5787 # define MOUNTED MNTTABNAME
5791 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
5792 fu_cv_sys_mounted_getmntent1=yes,
5793 fu_cv_sys_mounted_getmntent1=no)])
5794 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
5795 if test $fu_cv_sys_mounted_getmntent1 = yes; then
5796 ac_list_mounted_fs=found
5797 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
5798 [Define if there is a function named getmntent for reading the list
5799 of mounted filesystems, and that function takes a single argument.
5800 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
5804 if test -z "$ac_list_mounted_fs"; then
5806 AC_MSG_CHECKING([for two-argument getmntent function])
5807 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
5808 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
5809 fu_cv_sys_mounted_getmntent2=yes,
5810 fu_cv_sys_mounted_getmntent2=no)])
5811 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
5812 if test $fu_cv_sys_mounted_getmntent2 = yes; then
5813 ac_list_mounted_fs=found
5814 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
5815 [Define if there is a function named getmntent for reading the list of
5816 mounted filesystems, and that function takes two arguments. (SVR4)])
5822 if test -z "$ac_list_mounted_fs"; then
5823 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
5824 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
5826 AC_MSG_CHECKING([for getfsstat function])
5827 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
5829 #include <sys/types.h>
5830 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
5831 # define FS_TYPE(Ent) ((Ent).f_fstypename)
5833 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
5835 ]$getfsstat_includes
5837 [struct statfs *stats;
5838 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
5839 char *t = FS_TYPE (*stats); ],
5840 fu_cv_sys_mounted_getfsstat=yes,
5841 fu_cv_sys_mounted_getfsstat=no)])
5842 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
5843 if test $fu_cv_sys_mounted_getfsstat = yes; then
5844 ac_list_mounted_fs=found
5845 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
5846 [Define if there is a function named getfsstat for reading the
5847 list of mounted filesystems. (DEC Alpha running OSF/1)])
5851 if test -z "$ac_list_mounted_fs"; then
5853 AC_MSG_CHECKING([for FIXME existence of three headers])
5854 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
5856 #include <sys/statfs.h>
5857 #include <sys/fstyp.h>
5858 #include <mnttab.h>],
5859 fu_cv_sys_mounted_fread_fstyp=yes,
5860 fu_cv_sys_mounted_fread_fstyp=no)])
5861 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
5862 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
5863 ac_list_mounted_fs=found
5864 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
5865 [Define if (like SVR2) there is no specific function for reading the
5866 list of mounted filesystems, and your system has these header files:
5867 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
5871 if test -z "$ac_list_mounted_fs"; then
5872 # 4.4BSD and DEC OSF/1.
5873 AC_MSG_CHECKING([for getmntinfo function])
5874 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
5876 test "$ac_cv_func_getmntinfo" = yes \
5877 && fu_cv_sys_mounted_getmntinfo=yes \
5878 || fu_cv_sys_mounted_getmntinfo=no
5880 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
5881 if test $fu_cv_sys_mounted_getmntinfo = yes; then
5882 ac_list_mounted_fs=found
5883 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
5884 [Define if there is a function named getmntinfo for reading the
5885 list of mounted filesystems. (4.4BSD, Darwin)])
5889 if test -z "$ac_list_mounted_fs"; then
5891 AC_MSG_CHECKING([for getmnt function])
5892 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
5894 #include <sys/fs_types.h>
5895 #include <sys/mount.h>],
5896 fu_cv_sys_mounted_getmnt=yes,
5897 fu_cv_sys_mounted_getmnt=no)])
5898 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
5899 if test $fu_cv_sys_mounted_getmnt = yes; then
5900 ac_list_mounted_fs=found
5901 AC_DEFINE(MOUNTED_GETMNT, 1,
5902 [Define if there is a function named getmnt for reading the list of
5903 mounted filesystems. (Ultrix)])
5907 if test -z "$ac_list_mounted_fs"; then
5909 AC_CHECK_FUNCS(next_dev fs_stat_dev)
5910 AC_CHECK_HEADERS(fs_info.h)
5911 AC_MSG_CHECKING([for BEOS mounted file system support functions])
5912 if test $ac_cv_header_fs_info_h = yes \
5913 && test $ac_cv_func_next_dev = yes \
5914 && test $ac_cv_func_fs_stat_dev = yes; then
5919 AC_MSG_RESULT($fu_result)
5920 if test $fu_result = yes; then
5921 ac_list_mounted_fs=found
5922 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
5923 [Define if there are functions named next_dev and fs_stat_dev for
5924 reading the list of mounted filesystems. (BeOS)])
5928 if test -z "$ac_list_mounted_fs"; then
5930 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
5931 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
5932 [AC_TRY_CPP([#include <mnttab.h>],
5933 fu_cv_sys_mounted_fread=yes,
5934 fu_cv_sys_mounted_fread=no)])
5935 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
5936 if test $fu_cv_sys_mounted_fread = yes; then
5937 ac_list_mounted_fs=found
5938 AC_DEFINE(MOUNTED_FREAD, 1,
5939 [Define if there is no specific function for reading the list of
5940 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
5944 if test -z "$ac_list_mounted_fs"; then
5945 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
5946 # FIXME -- no need to abort building the whole package
5947 # Can't build mountlist.c or anything that needs its functions
5950 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
5956 dnl From Jim Meyering.
5958 dnl See if struct statfs has the f_fstypename member.
5959 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
5962 AC_DEFUN([jm_FSTYPENAME],
5964 AC_CACHE_CHECK([for f_fstypename in struct statfs],
5965 fu_cv_sys_f_fstypename_in_statfs,
5969 #include <sys/param.h>
5970 #include <sys/types.h>
5971 #include <sys/mount.h>
5973 [struct statfs s; int i = sizeof s.f_fstypename;],
5974 fu_cv_sys_f_fstypename_in_statfs=yes,
5975 fu_cv_sys_f_fstypename_in_statfs=no
5980 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
5981 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
5982 [Define if struct statfs has the f_fstypename member.])
5989 # From fileutils/configure.in
5991 # Try to determine how a program can obtain filesystem usage information.
5992 # If successful, define the appropriate symbol (see fsusage.c) and
5993 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
5995 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5997 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
6000 echo "checking how to get filesystem space usage..."
6003 # Perform only the link test since it seems there are no variants of the
6004 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
6005 # because that got a false positive on SCO OSR5. Adding the declaration
6006 # of a `struct statvfs' causes this test to fail (as it should) on such
6007 # systems. That system is reported to work fine with STAT_STATFS4 which
6008 # is what it gets when this test fails.
6009 if test $ac_fsusage_space = no; then
6011 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
6012 [AC_TRY_LINK([#include <sys/types.h>
6014 Do not use statvfs on systems with GNU libc, because that function stats
6015 all preceding entries in /proc/mounts, and that makes df hang if even
6016 one of the corresponding file systems is hard-mounted, but not available.
6018 #include <sys/statvfs.h>],
6019 [struct statvfs fsd; statvfs (0, &fsd);],
6020 fu_cv_sys_stat_statvfs=yes,
6021 fu_cv_sys_stat_statvfs=no)])
6022 if test $fu_cv_sys_stat_statvfs = yes; then
6023 ac_fsusage_space=yes
6024 AC_DEFINE(STAT_STATVFS, 1,
6025 [ Define if there is a function named statvfs. (SVR4)])
6029 if test $ac_fsusage_space = no; then
6030 # DEC Alpha running OSF/1
6031 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
6032 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
6034 #include <sys/param.h>
6035 #include <sys/types.h>
6036 #include <sys/mount.h>
6041 exit (statfs (".", &fsd, sizeof (struct statfs)));
6043 fu_cv_sys_stat_statfs3_osf1=yes,
6044 fu_cv_sys_stat_statfs3_osf1=no,
6045 fu_cv_sys_stat_statfs3_osf1=no)])
6046 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
6047 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
6048 ac_fsusage_space=yes
6049 AC_DEFINE(STAT_STATFS3_OSF1, 1,
6050 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
6054 if test $ac_fsusage_space = no; then
6056 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
6057 member (AIX, 4.3BSD)])
6058 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
6060 #ifdef HAVE_SYS_PARAM_H
6061 #include <sys/param.h>
6063 #ifdef HAVE_SYS_MOUNT_H
6064 #include <sys/mount.h>
6066 #ifdef HAVE_SYS_VFS_H
6067 #include <sys/vfs.h>
6073 exit (statfs (".", &fsd));
6075 fu_cv_sys_stat_statfs2_bsize=yes,
6076 fu_cv_sys_stat_statfs2_bsize=no,
6077 fu_cv_sys_stat_statfs2_bsize=no)])
6078 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
6079 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
6080 ac_fsusage_space=yes
6081 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
6082 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
6083 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
6087 if test $ac_fsusage_space = no; then
6089 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
6090 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
6091 [AC_TRY_RUN([#include <sys/types.h>
6092 #include <sys/statfs.h>
6096 exit (statfs (".", &fsd, sizeof fsd, 0));
6098 fu_cv_sys_stat_statfs4=yes,
6099 fu_cv_sys_stat_statfs4=no,
6100 fu_cv_sys_stat_statfs4=no)])
6101 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
6102 if test $fu_cv_sys_stat_statfs4 = yes; then
6103 ac_fsusage_space=yes
6104 AC_DEFINE(STAT_STATFS4, 1,
6105 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
6109 if test $ac_fsusage_space = no; then
6111 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
6112 member (4.4BSD and NetBSD)])
6113 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
6114 [AC_TRY_RUN([#include <sys/types.h>
6115 #ifdef HAVE_SYS_PARAM_H
6116 #include <sys/param.h>
6118 #ifdef HAVE_SYS_MOUNT_H
6119 #include <sys/mount.h>
6125 exit (statfs (".", &fsd));
6127 fu_cv_sys_stat_statfs2_fsize=yes,
6128 fu_cv_sys_stat_statfs2_fsize=no,
6129 fu_cv_sys_stat_statfs2_fsize=no)])
6130 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
6131 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
6132 ac_fsusage_space=yes
6133 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
6134 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
6139 if test $ac_fsusage_space = no; then
6141 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
6142 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
6143 [AC_TRY_RUN([#include <sys/types.h>
6144 #ifdef HAVE_SYS_PARAM_H
6145 #include <sys/param.h>
6147 #ifdef HAVE_SYS_MOUNT_H
6148 #include <sys/mount.h>
6150 #ifdef HAVE_SYS_FS_TYPES_H
6151 #include <sys/fs_types.h>
6156 /* Ultrix's statfs returns 1 for success,
6157 0 for not mounted, -1 for failure. */
6158 exit (statfs (".", &fsd) != 1);
6160 fu_cv_sys_stat_fs_data=yes,
6161 fu_cv_sys_stat_fs_data=no,
6162 fu_cv_sys_stat_fs_data=no)])
6163 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
6164 if test $fu_cv_sys_stat_fs_data = yes; then
6165 ac_fsusage_space=yes
6166 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
6167 [ Define if statfs takes 2 args and the second argument has
6168 type struct fs_data. (Ultrix)])
6172 if test $ac_fsusage_space = no; then
6174 AC_TRY_CPP([#include <sys/filsys.h>
6176 AC_DEFINE(STAT_READ_FILSYS, 1,
6177 [Define if there is no specific function for reading filesystems usage
6178 information and you have the <sys/filsys.h> header file. (SVR2)])
6179 ac_fsusage_space=yes)
6182 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
6188 # Define some macros required for proper operation of code in lib/*.c
6189 # on MSDOS/Windows systems.
6191 # From Jim Meyering.
6193 AC_DEFUN([jm_AC_DOS],
6195 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
6198 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
6199 neither MSDOS nor Windows
6201 [ac_cv_win_or_dos=yes],
6202 [ac_cv_win_or_dos=no])
6205 if test x"$ac_cv_win_or_dos" = xyes; then
6206 ac_fs_accepts_drive_letter_prefix=1
6207 ac_fs_backslash_is_file_name_separator=1
6209 ac_fs_accepts_drive_letter_prefix=0
6210 ac_fs_backslash_is_file_name_separator=0
6213 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
6214 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
6215 # define FILESYSTEM_PREFIX_LEN(Filename) \
6216 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
6218 # define FILESYSTEM_PREFIX_LEN(Filename) 0
6221 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
6222 $ac_fs_accepts_drive_letter_prefix,
6223 [Define on systems for which file names may have a so-called
6224 `drive letter' prefix, define this to compute the length of that
6225 prefix, including the colon.])
6227 AH_VERBATIM(ISSLASH,
6228 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
6229 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
6231 # define ISSLASH(C) ((C) == '/')
6234 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
6235 $ac_fs_backslash_is_file_name_separator,
6236 [Define if the backslash character may also serve as a file name
6237 component separator.])
6241 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
6243 AC_REQUIRE([AC_HEADER_STDC])
6244 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
6245 AC_CHECK_FUNCS(resolvepath)
6246 AC_REQUIRE([AC_HEADER_STAT])
6248 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
6249 # if the function name weren't so long. Besides, I would rather
6250 # not have underscores in file names.
6251 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
6256 dnl From Paul Eggert.
6258 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
6261 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
6262 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
6263 ac_cv_struct_st_mtim_nsec,
6264 [ac_save_CPPFLAGS="$CPPFLAGS"
6265 ac_cv_struct_st_mtim_nsec=no
6266 # tv_nsec -- the usual case
6267 # _tv_nsec -- Solaris 2.6, if
6268 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
6269 # && !defined __EXTENSIONS__)
6270 # st__tim.tv_nsec -- UnixWare 2.1.2
6271 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
6272 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
6273 AC_TRY_COMPILE([#include <sys/types.h>
6274 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
6275 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
6277 CPPFLAGS="$ac_save_CPPFLAGS"])
6279 if test $ac_cv_struct_st_mtim_nsec != no; then
6280 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
6281 [Define to be the nanoseconds member of struct stat's st_mtim,
6289 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
6291 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
6292 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
6293 [AC_TRY_COMPILE([#include <sys/types.h>
6294 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
6295 ac_cv_struct_st_dm_mode=yes,
6296 ac_cv_struct_st_dm_mode=no)])
6298 if test $ac_cv_struct_st_dm_mode = yes; then
6299 AC_DEFINE(HAVE_ST_DM_MODE, 1,
6300 [Define if struct stat has an st_dm_mode member. ])
6307 dnl From Jim Meyering
6309 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
6310 dnl in time.h or sys/time.h.
6312 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
6314 AC_REQUIRE([AC_HEADER_TIME])
6315 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
6318 # if TIME_WITH_SYS_TIME
6319 # include <sys/time.h>
6322 # if HAVE_SYS_TIME_H
6323 # include <sys/time.h>
6329 [static struct timespec x; x.tv_sec = x.tv_nsec;],
6330 fu_cv_sys_struct_timespec=yes,
6331 fu_cv_sys_struct_timespec=no)
6334 if test $fu_cv_sys_struct_timespec = yes; then
6335 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
6336 [Define if struct timespec is declared in <time.h>. ])
6341 dnl From Jim Meyering and Paul Eggert.
6342 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
6343 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6344 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
6345 jm_cv_sys_tiocgwinsz_needs_termios_h,
6346 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
6348 if test $ac_cv_sys_posix_termios = yes; then
6350 [#include <sys/types.h>
6351 # include <termios.h>
6355 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
6360 AC_DEFUN([jm_WINSIZE_IN_PTEM],
6361 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6362 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
6363 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
6364 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
6365 if test $ac_cv_sys_posix_termios = yes; then
6366 AC_TRY_COMPILE([#include <termios.h>]
6367 [struct winsize x;],
6368 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6370 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6371 AC_TRY_COMPILE([#include <sys/ptem.h>],
6372 [struct winsize x;],
6373 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6375 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6376 AC_DEFINE([WINSIZE_IN_PTEM], 1,
6377 [Define if sys/ptem.h is required for struct winsize.])
6380 # Determine whether this system has infrastructure for obtaining the boot time.
6382 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6383 * ----------------------------------------------------------
6384 AC_DEFUN([GNULIB_BOOT_TIME],
6386 AC_CHECK_FUNCS(sysctl)
6387 AC_CHECK_HEADERS(sys/sysctl.h)
6389 [whether we can get the system boot time],
6390 [gnulib_cv_have_boot_time],
6394 [AC_INCLUDES_DEFAULT
6395 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
6396 # include <sys/param.h> /* needed for OpenBSD 3.0 */
6397 # include <sys/sysctl.h>
6406 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
6407 /* your system *does* have the infrastructure to determine boot time */
6409 please_tell_us_how_to_determine_boot_time_on_your_system
6412 gnulib_cv_have_boot_time=yes,
6413 gnulib_cv_have_boot_time=no)
6415 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
6420 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
6421 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
6422 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
6423 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
6424 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6426 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
6428 [#include <sys/types.h>
6429 # include <sys/ioctl.h>
6433 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
6436 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6437 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
6438 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
6444 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
6446 AC_DEFUN([jm_LIB_CHECK],
6449 # Check for libypsec.a on Dolphin M88K machines.
6450 AC_CHECK_LIB(ypsec, main)
6452 # m88k running dgux 5.4 needs this
6453 AC_CHECK_LIB(ldgc, main)
6455 # Some programs need to link with -lm. printf does if it uses
6456 # lib/strtod.c which uses pow. And seq uses the math functions,
6457 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
6459 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
6460 # Check for these math functions used by seq.
6461 ac_su_saved_lib="$LIBS"
6463 AC_CHECK_FUNCS(floor modf rint)
6464 LIBS="$ac_su_saved_lib"
6467 AC_CHECK_FUNCS(sqrt)
6468 if test $ac_cv_func_sqrt = no; then
6469 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
6472 AC_SUBST(FESETROUND_LIBM)
6473 AC_CHECK_FUNCS(fesetround)
6474 if test $ac_cv_func_fesetround = no; then
6475 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
6478 # The -lsun library is required for YP support on Irix-4.0.5 systems.
6479 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
6480 AC_SEARCH_LIBS(yp_match, [sun ypsec])
6482 # SysV needs -lsec, older versions of Linux need -lshadow for
6483 # shadow passwords. UnixWare 7 needs -lgen.
6484 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
6486 AC_CHECK_HEADERS(shadow.h)
6488 # Requirements for su.c.
6490 $ac_includes_default
6492 # include <shadow.h>
6495 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
6496 AC_CHECK_FUNCS(getspnam)
6498 # SCO-ODT-3.0 is reported to need -lufc for crypt.
6499 # NetBSD needs -lcrypt for crypt.
6500 ac_su_saved_lib="$LIBS"
6501 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
6502 LIBS="$ac_su_saved_lib"
6506 # gettext.m4 serial 17 (gettext-0.11.5)
6507 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6508 dnl This file is free software, distributed under the terms of the GNU
6509 dnl General Public License. As a special exception to the GNU General
6510 dnl Public License, this file may be distributed as part of a program
6511 dnl that contains a configuration script generated by Autoconf, under
6512 dnl the same distribution terms as the rest of that program.
6514 dnl This file can can be used in projects which are not available under
6515 dnl the GNU General Public License or the GNU Library General Public
6516 dnl License but which still want to provide support for the GNU gettext
6518 dnl Please note that the actual code of the GNU gettext library is covered
6519 dnl by the GNU Library General Public License, and the rest of the GNU
6520 dnl gettext package package is covered by the GNU General Public License.
6521 dnl They are *not* in the public domain.
6524 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
6525 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
6527 dnl Macro to add for using GNU gettext.
6529 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
6530 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
6531 dnl default (if it is not specified or empty) is 'no-libtool'.
6532 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
6533 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
6534 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
6535 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
6536 dnl depending on --{enable,disable}-{shared,static} and on the presence of
6537 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
6538 dnl $(top_builddir)/intl/libintl.a will be created.
6539 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
6540 dnl implementations (in libc or libintl) without the ngettext() function
6541 dnl will be ignored. If NEEDSYMBOL is specified and is
6542 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
6543 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
6544 dnl INTLDIR is used to find the intl libraries. If empty,
6545 dnl the value `$(top_builddir)/intl/' is used.
6547 dnl The result of the configuration is one of three cases:
6548 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
6550 dnl Catalog format: GNU --> install in $(datadir)
6551 dnl Catalog extension: .mo after installation, .gmo in source tree
6552 dnl 2) GNU gettext has been found in the system's C library.
6553 dnl Catalog format: GNU --> install in $(datadir)
6554 dnl Catalog extension: .mo after installation, .gmo in source tree
6555 dnl 3) No internationalization, always use English msgid.
6556 dnl Catalog format: none
6557 dnl Catalog extension: none
6558 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
6559 dnl The use of .gmo is historical (it was needed to avoid overwriting the
6560 dnl GNU format catalogs when building on a platform with an X/Open gettext),
6561 dnl but we keep it in order not to force irrelevant filename changes on the
6564 AC_DEFUN([AM_GNU_GETTEXT],
6566 dnl Argument checking.
6567 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
6568 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
6570 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
6571 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
6573 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
6574 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
6576 AC_REQUIRE([AM_PO_SUBDIRS])dnl
6577 ifelse(gt_included_intl, yes, [
6578 AC_REQUIRE([AM_INTL_SUBDIR])dnl
6581 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
6582 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6583 AC_REQUIRE([AC_LIB_RPATH])
6585 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6586 dnl Ideally we would do this search only after the
6587 dnl if test "$USE_NLS" = "yes"; then
6588 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6589 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
6590 dnl the configure script would need to contain the same shell code
6591 dnl again, outside any 'if'. There are two solutions:
6592 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
6593 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
6594 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
6595 dnl documented, we avoid it.
6596 ifelse(gt_included_intl, yes, , [
6597 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
6600 AC_MSG_CHECKING([whether NLS is requested])
6601 dnl Default is enabled NLS
6603 [ --disable-nls do not use Native Language Support],
6604 USE_NLS=$enableval, USE_NLS=yes)
6605 AC_MSG_RESULT($USE_NLS)
6608 ifelse(gt_included_intl, yes, [
6609 BUILD_INCLUDED_LIBINTL=no
6610 USE_INCLUDED_LIBINTL=no
6616 dnl If we use NLS figure out what method
6617 if test "$USE_NLS" = "yes"; then
6618 gt_use_preinstalled_gnugettext=no
6619 ifelse(gt_included_intl, yes, [
6620 AC_MSG_CHECKING([whether included gettext is requested])
6621 AC_ARG_WITH(included-gettext,
6622 [ --with-included-gettext use the GNU gettext library included here],
6623 nls_cv_force_use_gnu_gettext=$withval,
6624 nls_cv_force_use_gnu_gettext=no)
6625 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
6627 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
6628 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
6630 dnl User does not insist on using GNU NLS library. Figure out what
6631 dnl to use. If GNU gettext is available we use this. Else we have
6632 dnl to fall back to GNU NLS library.
6634 dnl Add a version number to the cache macros.
6635 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
6636 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
6637 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
6639 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
6640 [AC_TRY_LINK([#include <libintl.h>
6641 ]ifelse([$2], [need-formatstring-macros],
6642 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6643 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6646 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6648 ], [])[extern int _nl_msg_cat_cntr;
6649 extern int *_nl_domain_bindings;],
6650 [bindtextdomain ("", "");
6651 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
6652 gt_cv_func_gnugettext_libc=yes,
6653 gt_cv_func_gnugettext_libc=no)])
6655 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6656 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6657 ifelse(gt_included_intl, yes, , [
6660 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
6661 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
6662 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
6663 dnl even if libiconv doesn't exist.
6664 AC_LIB_LINKFLAGS_BODY([intl])
6665 AC_CACHE_CHECK([for GNU gettext in libintl],
6666 gt_cv_func_gnugettext_libintl,
6667 [gt_save_CPPFLAGS="$CPPFLAGS"
6668 CPPFLAGS="$CPPFLAGS $INCINTL"
6669 gt_save_LIBS="$LIBS"
6670 LIBS="$LIBS $LIBINTL"
6671 dnl Now see whether libintl exists and does not depend on libiconv.
6672 AC_TRY_LINK([#include <libintl.h>
6673 ]ifelse([$2], [need-formatstring-macros],
6674 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6675 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6678 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6680 ], [])[extern int _nl_msg_cat_cntr;
6685 const char *_nl_expand_alias ();],
6686 [bindtextdomain ("", "");
6687 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6688 gt_cv_func_gnugettext_libintl=yes,
6689 gt_cv_func_gnugettext_libintl=no)
6690 dnl Now see whether libintl exists and depends on libiconv.
6691 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
6692 LIBS="$LIBS $LIBICONV"
6693 AC_TRY_LINK([#include <libintl.h>
6694 ]ifelse([$2], [need-formatstring-macros],
6695 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6696 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6699 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6701 ], [])[extern int _nl_msg_cat_cntr;
6706 const char *_nl_expand_alias ();],
6707 [bindtextdomain ("", "");
6708 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6709 [LIBINTL="$LIBINTL $LIBICONV"
6710 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
6711 gt_cv_func_gnugettext_libintl=yes
6714 CPPFLAGS="$gt_save_CPPFLAGS"
6715 LIBS="$gt_save_LIBS"])
6718 dnl If an already present or preinstalled GNU gettext() is found,
6719 dnl use it. But if this macro is used in GNU gettext, and GNU
6720 dnl gettext is already preinstalled in libintl, we update this
6721 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
6722 if test "$gt_cv_func_gnugettext_libc" = "yes" \
6723 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
6724 && test "$PACKAGE" != gettext; }; then
6725 gt_use_preinstalled_gnugettext=yes
6727 dnl Reset the values set by searching for libintl.
6733 ifelse(gt_included_intl, yes, [
6734 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
6735 dnl GNU gettext is not found in the C library.
6736 dnl Fall back on included GNU gettext library.
6737 nls_cv_use_gnu_gettext=yes
6741 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6742 dnl Mark actions used to generate GNU NLS library.
6743 INTLOBJS="\$(GETTOBJS)"
6744 BUILD_INCLUDED_LIBINTL=yes
6745 USE_INCLUDED_LIBINTL=yes
6746 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
6747 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
6748 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6751 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6752 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6753 dnl Mark actions to use GNU gettext tools.
6758 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6759 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6760 AC_DEFINE(ENABLE_NLS, 1,
6761 [Define to 1 if translation of program messages to the user's native language
6768 if test "$USE_NLS" = "yes"; then
6770 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
6771 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
6772 AC_MSG_CHECKING([how to link with libintl])
6773 AC_MSG_RESULT([$LIBINTL])
6774 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
6777 dnl For backward compatibility. Some packages may be using this.
6778 AC_DEFINE(HAVE_GETTEXT, 1,
6779 [Define if the GNU gettext() function is already present or preinstalled.])
6780 AC_DEFINE(HAVE_DCGETTEXT, 1,
6781 [Define if the GNU dcgettext() function is already present or preinstalled.])
6784 dnl We need to process the po/ directory.
6788 ifelse(gt_included_intl, yes, [
6789 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
6790 dnl to 'yes' because some of the testsuite requires it.
6791 if test "$PACKAGE" = gettext; then
6792 BUILD_INCLUDED_LIBINTL=yes
6795 dnl Make all variables we use known to autoconf.
6796 AC_SUBST(BUILD_INCLUDED_LIBINTL)
6797 AC_SUBST(USE_INCLUDED_LIBINTL)
6801 dnl For backward compatibility. Some configure.ins may be using this.
6803 nls_cv_header_libgt=
6805 dnl For backward compatibility. Some Makefiles may be using this.
6807 AC_SUBST(DATADIRNAME)
6809 dnl For backward compatibility. Some Makefiles may be using this.
6811 AC_SUBST(INSTOBJEXT)
6813 dnl For backward compatibility. Some Makefiles may be using this.
6817 dnl Enable libtool support if the surrounding package wishes it.
6818 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
6819 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
6822 dnl For backward compatibility. Some Makefiles may be using this.
6826 dnl Make all documented variables known to autoconf.
6833 dnl Checks for all prerequisites of the po subdirectory,
6834 dnl except for USE_NLS.
6835 AC_DEFUN([AM_PO_SUBDIRS],
6837 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
6838 AC_REQUIRE([AC_PROG_INSTALL])dnl
6839 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6841 dnl Perform the following tests also if --disable-nls has been given,
6842 dnl because they are needed for "make dist" to work.
6844 dnl Search for GNU msgfmt in the PATH.
6845 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
6846 dnl The second test excludes FreeBSD msgfmt.
6847 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
6848 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
6849 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
6851 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
6853 dnl Search for GNU xgettext 0.11 or newer in the PATH.
6854 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
6855 dnl The second test excludes FreeBSD xgettext.
6856 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6857 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6858 (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)],
6860 dnl Remove leftover from FreeBSD xgettext call.
6863 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
6864 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
6865 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
6867 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6868 dnl Test whether we really found GNU msgfmt.
6869 if test "$GMSGFMT" != ":"; then
6870 dnl If it is no GNU msgfmt we define it as : so that the
6871 dnl Makefiles still can work.
6872 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
6873 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6876 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
6878 [found $GMSGFMT program is not GNU msgfmt; ignore it])
6883 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6884 dnl Test whether we really found GNU xgettext.
6885 if test "$XGETTEXT" != ":"; then
6886 dnl If it is no GNU xgettext we define it as : so that the
6887 dnl Makefiles still can work.
6888 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6889 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6893 [found xgettext program is not GNU xgettext; ignore it])
6896 dnl Remove leftover from FreeBSD xgettext call.
6900 AC_OUTPUT_COMMANDS([
6901 for ac_file in $CONFIG_FILES; do
6902 # Support "outfile[:infile[:infile...]]"
6904 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6906 # PO directories have a Makefile.in generated from Makefile.in.in.
6907 case "$ac_file" in */Makefile.in)
6908 # Adjust a relative srcdir.
6909 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
6910 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
6911 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
6912 # In autoconf-2.13 it is called $ac_given_srcdir.
6913 # In autoconf-2.50 it is called $srcdir.
6914 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
6915 case "$ac_given_srcdir" in
6916 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
6917 /*) top_srcdir="$ac_given_srcdir" ;;
6918 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
6920 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
6921 rm -f "$ac_dir/POTFILES"
6922 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
6923 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
6924 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
6925 # on $ac_dir but don't depend on user-specified configuration
6927 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
6928 # The LINGUAS file contains the set of available languages.
6929 if test -n "$ALL_LINGUAS"; then
6930 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
6932 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
6933 # Hide the ALL_LINGUAS assigment from automake.
6934 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
6936 case "$ac_given_srcdir" in
6938 *) srcdirpre='$(srcdir)/' ;;
6944 for lang in $ALL_LINGUAS; do
6945 POFILES="$POFILES $srcdirpre$lang.po"
6946 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
6947 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
6948 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
6950 # CATALOGS depends on both $ac_dir and the user's LINGUAS
6951 # environment variable.
6953 if test -n "$ALL_LINGUAS"; then
6954 for presentlang in $ALL_LINGUAS; do
6956 if test "%UNSET%" != "$LINGUAS"; then
6957 desiredlanguages="$LINGUAS"
6959 desiredlanguages="$ALL_LINGUAS"
6961 for desiredlang in $desiredlanguages; do
6962 # Use the presentlang catalog if desiredlang is
6963 # a. equal to presentlang, or
6964 # b. a variant of presentlang (because in this case,
6965 # presentlang can be used as a fallback for messages
6966 # which are not translated in the desiredlang catalog).
6967 case "$desiredlang" in
6968 "$presentlang"*) useit=yes;;
6971 if test $useit = yes; then
6972 INST_LINGUAS="$INST_LINGUAS $presentlang"
6977 if test -n "$INST_LINGUAS"; then
6978 for lang in $INST_LINGUAS; do
6979 CATALOGS="$CATALOGS $lang.gmo"
6982 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
6983 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"
6984 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
6985 if test -f "$f"; then
6987 *.orig | *.bak | *~) ;;
6988 *) cat "$f" >> "$ac_dir/Makefile" ;;
6996 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
6997 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
6999 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
7000 # Capture the value of LINGUAS because we need it to compute CATALOGS.
7001 LINGUAS="${LINGUAS-%UNSET%}"
7006 dnl Checks for all prerequisites of the intl subdirectory,
7007 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
7008 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
7009 AC_DEFUN([AM_INTL_SUBDIR],
7011 AC_REQUIRE([AC_PROG_INSTALL])dnl
7012 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
7013 AC_REQUIRE([AC_PROG_CC])dnl
7014 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7015 AC_REQUIRE([AC_PROG_RANLIB])dnl
7016 AC_REQUIRE([AC_ISC_POSIX])dnl
7017 AC_REQUIRE([AC_HEADER_STDC])dnl
7018 AC_REQUIRE([AC_C_CONST])dnl
7019 AC_REQUIRE([AC_C_INLINE])dnl
7020 AC_REQUIRE([AC_TYPE_OFF_T])dnl
7021 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
7022 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
7023 AC_REQUIRE([AC_FUNC_MMAP])dnl
7024 AC_REQUIRE([jm_GLIBC21])dnl
7025 AC_REQUIRE([gt_INTDIV0])dnl
7026 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
7027 AC_REQUIRE([gt_INTTYPES_PRI])dnl
7029 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
7030 stdlib.h string.h unistd.h sys/param.h])
7031 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
7032 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
7033 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
7037 if test $ac_cv_header_locale_h = yes; then
7041 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
7042 dnl because plural.y uses bison specific features. It requires at least
7043 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
7045 dnl bison is only needed for the maintainer (who touches plural.y). But in
7046 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
7047 dnl the rule in general Makefile. Now, some people carelessly touch the
7048 dnl files or have a broken "make" program, hence the plural.c rule will
7049 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
7050 dnl present or too old.
7051 AC_CHECK_PROGS([INTLBISON], [bison])
7052 if test -z "$INTLBISON"; then
7055 dnl Found it, now check the version.
7056 AC_MSG_CHECKING([version of bison])
7057 changequote(<<,>>)dnl
7058 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
7059 case $ac_prog_version in
7060 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
7061 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
7063 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
7064 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
7066 AC_MSG_RESULT([$ac_prog_version])
7068 if test $ac_verc_fail = yes; then
7074 AC_DEFUN([AM_MKINSTALLDIRS],
7076 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
7077 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
7078 dnl Try to locate is.
7080 if test -n "$ac_aux_dir"; then
7081 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
7083 if test -z "$MKINSTALLDIRS"; then
7084 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
7086 AC_SUBST(MKINSTALLDIRS)
7090 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
7091 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
7093 # progtest.m4 serial 3
7094 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
7095 dnl This file is free software, distributed under the terms of the GNU
7096 dnl General Public License. As a special exception to the GNU General
7097 dnl Public License, this file may be distributed as part of a program
7098 dnl that contains a configuration script generated by Autoconf, under
7099 dnl the same distribution terms as the rest of that program.
7101 dnl This file can can be used in projects which are not available under
7102 dnl the GNU General Public License or the GNU Library General Public
7103 dnl License but which still want to provide support for the GNU gettext
7105 dnl Please note that the actual code of the GNU gettext library is covered
7106 dnl by the GNU Library General Public License, and the rest of the GNU
7107 dnl gettext package package is covered by the GNU General Public License.
7108 dnl They are *not* in the public domain.
7111 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
7113 # Search path for a program which passes the given test.
7115 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7116 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7117 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
7118 [# Extract the first word of "$2", so it can be a program name with args.
7119 set dummy $2; ac_word=[$]2
7120 AC_MSG_CHECKING([for $ac_word])
7121 AC_CACHE_VAL(ac_cv_path_$1,
7124 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7127 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7128 for ac_dir in ifelse([$5], , $PATH, [$5]); do
7129 test -z "$ac_dir" && ac_dir=.
7130 if test -f $ac_dir/$ac_word; then
7132 ac_cv_path_$1="$ac_dir/$ac_word"
7138 dnl If no 4th arg is given, leave the cache variable unset,
7139 dnl so AC_PATH_PROGS will keep looking.
7140 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7145 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7146 AC_MSG_RESULT([$]$1)
7153 # intdiv0.m4 serial 1 (gettext-0.11.3)
7154 dnl Copyright (C) 2002 Free Software Foundation, Inc.
7155 dnl This file is free software, distributed under the terms of the GNU
7156 dnl General Public License. As a special exception to the GNU General
7157 dnl Public License, this file may be distributed as part of a program
7158 dnl that contains a configuration script generated by Autoconf, under
7159 dnl the same distribution terms as the rest of that program.
7161 dnl From Bruno Haible.
7163 AC_DEFUN([gt_INTDIV0],
7165 AC_REQUIRE([AC_PROG_CC])dnl
7166 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7168 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
7169 gt_cv_int_divbyzero_sigfpe,
7177 sigfpe_handler (int sig)
7179 sigfpe_handler (sig) int sig;
7182 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
7183 exit (sig != SIGFPE);
7193 signal (SIGFPE, sigfpe_handler);
7194 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
7195 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
7196 signal (SIGTRAP, sigfpe_handler);
7198 /* Linux/SPARC yields signal SIGILL. */
7199 #if defined (__sparc__) && defined (__linux__)
7200 signal (SIGILL, sigfpe_handler);
7207 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
7209 # Guess based on the CPU.
7211 alpha* | i[34567]86 | m68k | s390*)
7212 gt_cv_int_divbyzero_sigfpe="guessing yes";;
7214 gt_cv_int_divbyzero_sigfpe="guessing no";;
7218 case "$gt_cv_int_divbyzero_sigfpe" in
7222 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
7223 [Define if integer division by zero raises signal SIGFPE.])
7226 # lcmessage.m4 serial 3 (gettext-0.11.3)
7227 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
7228 dnl This file is free software, distributed under the terms of the GNU
7229 dnl General Public License. As a special exception to the GNU General
7230 dnl Public License, this file may be distributed as part of a program
7231 dnl that contains a configuration script generated by Autoconf, under
7232 dnl the same distribution terms as the rest of that program.
7234 dnl This file can can be used in projects which are not available under
7235 dnl the GNU General Public License or the GNU Library General Public
7236 dnl License but which still want to provide support for the GNU gettext
7238 dnl Please note that the actual code of the GNU gettext library is covered
7239 dnl by the GNU Library General Public License, and the rest of the GNU
7240 dnl gettext package package is covered by the GNU General Public License.
7241 dnl They are *not* in the public domain.
7244 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
7246 # Check whether LC_MESSAGES is available in <locale.h>.
7248 AC_DEFUN([AM_LC_MESSAGES],
7250 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7251 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7252 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7253 if test $am_cv_val_LC_MESSAGES = yes; then
7254 AC_DEFINE(HAVE_LC_MESSAGES, 1,
7255 [Define if your <locale.h> file defines LC_MESSAGES.])