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 AC_DEFUN([AC_GNU_SOURCE],
839 [AH_VERBATIM([_GNU_SOURCE],
840 [/* Enable GNU extensions on systems that have them. */
844 /* Enable many GNU extensions on Solaris. */
845 #ifndef __EXTENSIONS__
846 # undef __EXTENSIONS__
848 AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
849 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
850 AC_DEFINE([_GNU_SOURCE])
851 AC_DEFINE([__EXTENSIONS__])
856 dnl From Jim Meyering.
857 dnl Find a new-enough version of Perl.
862 dnl FIXME: don't hard-code 5.003
863 dnl FIXME: should we cache the result?
864 AC_MSG_CHECKING([for perl5.003 or newer])
865 if test "${PERL+set}" = set; then
866 # `PERL' is set in the user's environment.
867 candidate_perl_names="$PERL"
870 candidate_perl_names='perl perl5'
876 PERL="$am_missing_run perl"
877 for perl in $candidate_perl_names; do
878 # Run test in a subshell; some versions of sh will print an error if
879 # an executable is not found, even if stderr is redirected.
880 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
887 AC_MSG_RESULT($found)
888 test $found = no && AC_MSG_WARN([
889 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
890 a usable version of the Perl File::Compare module. As a result,
891 you may be unable to run a few tests or to regenerate certain
892 files if you modify the sources from which they are derived.
896 #serial 66 -*- autoconf -*-
898 m4_undefine([AC_LANG_SOURCE(C)])
899 dnl The following is identical to the definition in c.m4
900 dnl from the autoconf cvs repository on 2003-03-07.
901 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
903 # We can't use '#line $LINENO "configure"' here, since
904 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
905 # rejects $LINENO greater than 32767, and some configure scripts
906 # are longer than 32767 lines.
907 m4_define([AC_LANG_SOURCE(C)],
910 cat confdefs.h >>conftest.$ac_ext
911 cat >>conftest.$ac_ext <<_ACEOF
912 /* end confdefs.h. */
916 dnl Misc type-related macros for fileutils, sh-utils, textutils.
918 AC_DEFUN([jm_MACROS],
922 GNU_PACKAGE="GNU $PACKAGE"
923 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
924 [The concatenation of the strings `GNU ', and PACKAGE.])
925 AC_SUBST(GNU_PACKAGE)
927 AM_MISSING_PROG(HELP2MAN, help2man)
928 AC_SUBST(OPTIONAL_BIN_PROGS)
932 dnl This macro actually runs replacement code. See isc-posix.m4.
933 AC_REQUIRE([AC_ISC_POSIX])dnl
936 jm_INCLUDED_REGEX([lib/regex.c])
938 AC_REQUIRE([UTILS_HOST_OS])
939 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
940 AC_REQUIRE([jm_BISON])
941 AC_REQUIRE([jm_ASSERT])
942 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
943 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
944 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
945 AC_REQUIRE([jm_CHECK_DECLS])
947 AC_REQUIRE([jm_PREREQ])
949 AC_REQUIRE([UTILS_FUNC_DIRFD])
950 AC_REQUIRE([AC_FUNC_ACL])
951 AC_REQUIRE([AC_FUNC_FTW])
952 AC_REQUIRE([jm_FUNC_LCHOWN])
953 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
954 AC_REQUIRE([jm_FUNC_CHOWN])
955 AC_REQUIRE([jm_FUNC_MKTIME])
956 AC_REQUIRE([jm_FUNC_LSTAT])
957 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
958 AC_REQUIRE([jm_FUNC_STAT])
959 AC_REQUIRE([AC_FUNC_REALLOC])
960 AC_REQUIRE([AC_FUNC_MALLOC])
961 AC_REQUIRE([AC_FUNC_STRERROR_R])
962 AC_REQUIRE([jm_FUNC_NANOSLEEP])
963 AC_REQUIRE([jm_FUNC_MEMCMP])
964 AC_REQUIRE([gl_MEMCOLL])
965 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
966 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
967 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
968 AC_REQUIRE([jm_FUNC_PUTENV])
970 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
971 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
972 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
973 AC_REQUIRE([gl_FUNC_FNMATCH_GNU])
974 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
975 AC_REQUIRE([jm_FUNC_MKTIME])
976 AC_REQUIRE([jm_FUNC_FPENDING])
978 # This is for od and stat, and any other program that
979 # uses the PRI.MAX macros from inttypes.h.
980 AC_REQUIRE([gt_INTTYPES_PRI])
982 AC_REQUIRE([jm_FUNC_GETGROUPS])
984 AC_REQUIRE([AC_FUNC_FSEEKO])
985 AC_REQUIRE([AC_FUNC_VPRINTF])
986 AC_REQUIRE([AC_FUNC_ALLOCA])
987 AC_REQUIRE([gl_FUNC_ALLOCA])
989 AC_CONFIG_LIBOBJ_DIR([lib])
992 AC_REQUIRE([jm_SYS_PROC_UPTIME])
993 AC_REQUIRE([jm_FUNC_FTRUNCATE])
994 AC_REQUIRE([vb_FUNC_RENAME])
996 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
997 AC_REPLACE_FUNCS(dup2)
998 AC_REPLACE_FUNCS(gethostname getusershell)
999 AC_REPLACE_FUNCS(sig2str)
1000 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
1001 AC_REPLACE_FUNCS(strpbrk)
1002 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
1003 AC_REPLACE_FUNCS(atexit)
1004 AC_REPLACE_FUNCS(getpass)
1006 # raise is used by at least sort and ls.
1007 AC_REPLACE_FUNCS(raise)
1009 dnl used by e.g. intl/*domain.c and lib/canon-host.c
1010 AC_REPLACE_FUNCS(strdup)
1012 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
1013 AC_CHECK_FUNCS(getpagesize)
1015 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
1017 # By default, argmatch should fail calling usage (1).
1018 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
1019 [Define to the function xargmatch calls on failures.])
1020 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
1021 [Define to the declaration of the xargmatch failure function.])
1023 dnl Used to define SETVBUF in sys2.h.
1024 dnl This evokes the following warning from autoconf:
1025 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
1026 AC_FUNC_SETVBUF_REVERSED
1028 # used by sleep and shred
1029 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
1030 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
1032 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
1033 # programs in the package would end up linked with that potentially-shared
1034 # library, inducing unnecessary run-time overhead.
1035 fetish_saved_libs=$LIBS
1036 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
1037 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
1038 AC_SUBST(LIB_CLOCK_GETTIME)
1039 AC_CHECK_FUNCS(clock_gettime clock_settime)
1040 LIBS=$fetish_saved_libs
1041 AC_CHECK_FUNCS(gettimeofday)
1042 AC_FUNC_GETTIMEOFDAY_CLOBBER
1044 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
1045 AC_REQUIRE([jm_FUNC_UTIME])
1046 AC_REQUIRE([gl_FUNC_VASPRINTF])
1047 AC_REQUIRE([gl_FUNC_VASNPRINTF])
1081 AC_CHECK_FUNCS(setreuid setregid)
1088 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1089 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
1090 AC_REQUIRE([GL_FUNC_READDIR])
1092 # See if linking `seq' requires -lm.
1093 # It does on nearly every system. The single exception (so far) is
1094 # BeOS which has all the math functions in the normal runtime library
1095 # and doesn't have a separate math library.
1103 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1104 [ac_seq_save_LIBS="$LIBS"
1106 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1107 LIBS="$ac_seq_save_LIBS"
1113 jm_FUNC_UNLINK_BUSY_TEXT
1115 # These tests are for df.
1116 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1118 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1119 if test $list_mounted_fs = yes && test $space = yes; then
1120 DF_PROG='df$(EXEEXT)'
1122 AC_LIBOBJ(mountlist)
1124 AC_REQUIRE([jm_AC_DOS])
1125 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1127 # If any of these functions don't exist (e.g. DJGPP 2.03),
1128 # use the corresponding stub.
1129 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
1130 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
1131 AC_CHECK_FUNC([lstat], , [AC_LIBOBJ(lstat-stub)])
1132 AC_CHECK_FUNC([readlink], , [AC_LIBOBJ(readlink-stub)])
1133 AC_REQUIRE([AM_STDBOOL_H])
1137 # These tests must be run before any use of AC_CHECK_TYPE,
1138 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1139 # See the definition of ac_includes_default in `configure'.
1140 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1183 # This macro must be invoked before any tests that run the compiler.
1184 AC_DEFUN([jm_CHECK_ALL_TYPES],
1186 dnl This test must come as early as possible after the compiler configuration
1187 dnl tests, because the choice of the file model can (in principle) affect
1188 dnl whether functions and headers are available, whether they work, etc.
1189 AC_REQUIRE([AC_SYS_LARGEFILE])
1191 dnl This test must precede tests of compiler characteristics like
1192 dnl that for the inline keyword, since it may change the degree to
1193 dnl which the compiler supports such features.
1194 AC_REQUIRE([AM_C_PROTOTYPES])
1196 dnl Checks for typedefs, structures, and compiler characteristics.
1197 AC_REQUIRE([AC_C_BIGENDIAN])
1198 AC_REQUIRE([AC_C_CONST])
1199 AC_REQUIRE([AC_C_VOLATILE])
1200 AC_REQUIRE([AC_C_INLINE])
1201 AC_REQUIRE([AC_C_LONG_DOUBLE])
1203 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1204 AC_REQUIRE([AC_HEADER_DIRENT])
1205 AC_REQUIRE([AC_HEADER_STDC])
1207 [struct stat.st_author,
1208 struct stat.st_blksize],,,
1209 [$ac_includes_default
1210 #include <sys/stat.h>
1212 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1214 AC_REQUIRE([AC_STRUCT_TM])
1215 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1216 AC_REQUIRE([AC_HEADER_STAT])
1217 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1218 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1219 AC_REQUIRE([gl_TIMESPEC])
1221 AC_REQUIRE([AC_TYPE_GETGROUPS])
1222 AC_REQUIRE([AC_TYPE_MODE_T])
1223 AC_REQUIRE([AC_TYPE_OFF_T])
1224 AC_REQUIRE([AC_TYPE_PID_T])
1225 AC_REQUIRE([AC_TYPE_SIGNAL])
1226 AC_REQUIRE([AC_TYPE_SIZE_T])
1227 AC_REQUIRE([AC_TYPE_UID_T])
1228 AC_CHECK_TYPE(ino_t, unsigned long)
1232 dnl This relies on the fact that autoconf 2.14a's implementation of
1233 dnl AC_CHECK_TYPE checks includes unistd.h.
1234 AC_CHECK_TYPE(major_t, unsigned int)
1235 AC_CHECK_TYPE(minor_t, unsigned int)
1237 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1238 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1240 AC_REQUIRE([AC_HEADER_MAJOR])
1241 AC_REQUIRE([AC_HEADER_DIRENT])
1245 # isc-posix.m4 serial 2 (gettext-0.11.2)
1246 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1247 dnl This file is free software, distributed under the terms of the GNU
1248 dnl General Public License. As a special exception to the GNU General
1249 dnl Public License, this file may be distributed as part of a program
1250 dnl that contains a configuration script generated by Autoconf, under
1251 dnl the same distribution terms as the rest of that program.
1253 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1255 # This test replaces the one in autoconf.
1256 # Currently this macro should have the same name as the autoconf macro
1257 # because gettext's gettext.m4 (distributed in the automake package)
1258 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1259 # give these diagnostics:
1260 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1261 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1263 undefine([AC_ISC_POSIX])
1265 AC_DEFUN([AC_ISC_POSIX],
1267 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1268 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1274 dnl Initially derived from code in GNU grep.
1275 dnl Mostly written by Jim Meyering.
1277 AC_DEFUN([gl_REGEX],
1279 jm_INCLUDED_REGEX([lib/regex.c])
1282 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1284 AC_DEFUN([jm_INCLUDED_REGEX],
1286 dnl Even packages that don't use regex.c can use this macro.
1287 dnl Of course, for them it doesn't do anything.
1289 # Assume we'll default to using the included regex.c.
1290 ac_use_included_regex=yes
1292 # However, if the system regex support is good enough that it passes the
1293 # the following run test, then default to *not* using the included regex.c.
1294 # If cross compiling, assume the test would fail and use the included
1295 # regex.c. The first failing regular expression is from `Spencer ere
1296 # test #75' in grep-2.3.
1297 AC_CACHE_CHECK([for working re_compile_pattern],
1298 jm_cv_func_working_re_compile_pattern,
1306 static struct re_pattern_buffer regex;
1308 struct re_registers regs;
1309 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1310 memset (®ex, 0, sizeof (regex));
1311 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1312 /* This should fail with _Invalid character class name_ error. */
1316 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1317 memset (®ex, 0, sizeof (regex));
1318 s = re_compile_pattern ("{1", 2, ®ex);
1323 /* The following example is derived from a problem report
1324 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1325 memset (®ex, 0, sizeof (regex));
1326 s = re_compile_pattern ("[[an\371]]*n", 7, ®ex);
1330 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1331 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1334 memset (®ex, 0, sizeof (regex));
1335 s = re_compile_pattern ("x", 1, ®ex);
1339 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
1340 work with a negative RANGE argument. */
1341 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
1347 jm_cv_func_working_re_compile_pattern=yes,
1348 jm_cv_func_working_re_compile_pattern=no,
1349 dnl When crosscompiling, assume it's broken.
1350 jm_cv_func_working_re_compile_pattern=no))
1351 if test $jm_cv_func_working_re_compile_pattern = yes; then
1352 ac_use_included_regex=no
1355 test -n "$1" || AC_MSG_ERROR([missing argument])
1356 m4_syscmd([test -f $1])
1357 ifelse(m4_sysval, 0,
1359 AC_ARG_WITH(included-regex,
1360 [ --without-included-regex don't compile regex; this is the default on
1361 systems with version 2 of the GNU C library
1362 (use with caution on other system)],
1363 jm_with_regex=$withval,
1364 jm_with_regex=$ac_use_included_regex)
1365 if test "$jm_with_regex" = yes; then
1374 # Prerequisites of lib/regex.c.
1375 AC_DEFUN([jm_PREREQ_REGEX],
1377 dnl FIXME: Maybe provide a btowc replacement someday: Solaris 2.5.1 lacks it.
1378 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1381 dnl Persuade glibc <string.h> to declare mempcpy().
1382 AC_REQUIRE([AC_GNU_SOURCE])
1384 AC_REQUIRE([gl_C_RESTRICT])
1385 AC_REQUIRE([AC_FUNC_ALLOCA])
1386 AC_REQUIRE([AC_HEADER_STDC])
1387 AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
1388 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
1389 AC_CHECK_FUNCS(btowc)
1393 # This macro can be removed once we can rely on Autoconf 2.57a or later,
1394 # since we can then use its AC_C_RESTRICT.
1398 # Determine whether the C/C++ compiler supports the "restrict" keyword
1399 # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
1400 # accepts it. Otherwise, if the compiler supports an equivalent,
1401 # define "restrict" to be that. Here are some variants:
1402 # - GCC supports both __restrict and __restrict__
1403 # - older DEC Alpha C compilers support only __restrict
1404 # - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
1405 # Otherwise, define "restrict" to be empty.
1406 AC_DEFUN([gl_C_RESTRICT],
1407 [AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
1408 [gl_cv_c_restrict=no
1409 # Try the official restrict keyword, then gcc's __restrict, and
1410 # the less common variants.
1411 for ac_kw in restrict __restrict __restrict__ _Restrict; do
1412 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
1413 [float * $ac_kw x;])],
1414 [gl_cv_c_restrict=$ac_kw; break])
1417 case $gl_cv_c_restrict in
1419 no) AC_DEFINE(restrict,,
1420 [Define to equivalent of C99 restrict keyword, or to nothing if this
1421 is not supported. Do not define if restrict is supported directly.]) ;;
1422 *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
1426 # onceonly.m4 serial 2
1427 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
1428 dnl This file is free software, distributed under the terms of the GNU
1429 dnl General Public License. As a special exception to the GNU General
1430 dnl Public License, this file may be distributed as part of a program
1431 dnl that contains a configuration script generated by Autoconf, under
1432 dnl the same distribution terms as the rest of that program.
1434 dnl This file defines some "once only" variants of standard autoconf macros.
1435 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1436 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1437 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1438 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1439 dnl The advantage is that the check for each of the headers/functions/decls
1440 dnl will be put only once into the 'configure' file. It keeps the size of
1441 dnl the 'configure' file down, and avoids redundant output when 'configure'
1443 dnl The drawback is that the checks cannot be conditionalized. If you write
1444 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1445 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1446 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1449 dnl Taken from Autoconf 2.50; can be removed once we assume 2.50 or later.
1450 define([m4_quote], [[$*]])
1452 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1453 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1454 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1456 AC_FOREACH([gl_HEADER_NAME], [$1], [
1457 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
1459 AC_CHECK_HEADERS(gl_HEADER_NAME)
1461 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1466 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1467 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1468 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1470 AC_FOREACH([gl_FUNC_NAME], [$1], [
1471 AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
1472 AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
1474 AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
1478 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1479 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1480 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1482 AC_FOREACH([gl_DECL_NAME], [$1], [
1483 AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
1484 AC_CHECK_DECLS(defn([gl_DECL_NAME]))
1486 AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
1492 dnl From Paul Eggert.
1494 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1495 AC_DEFUN([UTILS_HOST_OS],
1497 AC_CACHE_CHECK([host operating system],
1498 utils_cv_host_operating_system,
1502 # These operating system names do not use the default heuristic below.
1503 # They are in reverse order, so that more-specific prefixes come first.
1504 winnt*) os='Windows NT';;
1506 sysv*) os='Unix System V';;
1507 superux*) os='SUPER-UX';;
1508 sunos*) os='SunOS';;
1510 sco*) os='SCO Unix';;
1511 riscos*) os='RISC OS';;
1512 riscix*) os='RISCiX';;
1516 plan9*) os='Plan 9';;
1519 openbsd*) os='OpenBSD';;
1520 nsk*) os='NonStop Kernel';;
1521 nonstopux*) os='NonStop-UX';;
1522 netbsd*) os='NetBSD';;
1523 msdosdjgpp*) os='DJGPP';;
1524 mpeix*) os='MPE/iX';;
1526 mingw*) os='MinGW';;
1527 lynxos*) os='LynxOS';;
1528 linux*) os='GNU/Linux';;
1532 freebsd*-gnu*) os='GNU/FreeBSD';;
1533 freebsd*) os='FreeBSD';;
1535 bsdi*) os='BSD/OS';;
1539 atheos*) os='AtheOS';;
1540 amigaos*) os='Amiga OS';;
1543 # The default heuristic takes the initial alphabetic string
1544 # from $host_os, but capitalizes its first letter.
1547 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1549 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1553 # If $host_os does not start with an alphabetic string, use it unchanged.
1557 utils_cv_host_operating_system=$os]])
1558 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1559 "$utils_cv_host_operating_system",
1560 [The host operating system.])
1565 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1566 # On such systems, arrange to use a wrapper function that removes any
1568 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1570 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1571 utils_cv_func_mkdir_trailing_slash_bug,
1573 # Arrange for deletion of the temporary directory this test might create.
1574 ac_clean_files="$ac_clean_files confdir-slash"
1576 # include <sys/types.h>
1577 # include <sys/stat.h>
1578 # include <stdlib.h>
1581 rmdir ("confdir-slash");
1582 exit (mkdir ("confdir-slash/", 0700));
1585 utils_cv_func_mkdir_trailing_slash_bug=no,
1586 utils_cv_func_mkdir_trailing_slash_bug=yes,
1587 utils_cv_func_mkdir_trailing_slash_bug=yes
1592 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1594 AC_DEFINE(mkdir, rpl_mkdir,
1595 [Define to rpl_mkdir if the replacement function should be used.])
1601 AC_DEFUN([jm_BISON],
1603 # getdate.y works with bison only.
1604 : ${YACC='bison -y'}
1609 dnl based on code from Eleftherios Gkioulekas
1611 AC_DEFUN([jm_ASSERT],
1613 AC_MSG_CHECKING(whether to enable assertions)
1614 AC_ARG_ENABLE(assert,
1615 [ --disable-assert turn off assertions],
1617 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1618 [ AC_MSG_RESULT(yes) ]
1624 dnl From Jim Meyering
1626 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1627 dnl usually in <utime.h>.
1628 dnl Some systems have utime.h but don't declare the struct anywhere.
1630 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1632 AC_CHECK_HEADERS(utime.h)
1633 AC_REQUIRE([AC_HEADER_TIME])
1634 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1637 #ifdef TIME_WITH_SYS_TIME
1638 # include <sys/time.h>
1641 # ifdef HAVE_SYS_TIME_H
1642 # include <sys/time.h>
1651 [static struct utimbuf x; x.actime = x.modtime;],
1652 fu_cv_sys_struct_utimbuf=yes,
1653 fu_cv_sys_struct_utimbuf=no)
1656 if test $fu_cv_sys_struct_utimbuf = yes; then
1657 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1658 [Define if struct utimbuf is declared -- usually in <utime.h>.
1659 Some systems have utime.h but don't declare the struct anywhere. ])
1665 dnl From Jim Meyering.
1667 dnl Check whether struct dirent has a member named d_type.
1670 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1671 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1672 AC_CACHE_CHECK([for d_type member in directory struct],
1673 jm_cv_struct_dirent_d_type,
1676 #include <sys/types.h>
1677 #ifdef HAVE_DIRENT_H
1678 # include <dirent.h>
1679 #else /* not HAVE_DIRENT_H */
1680 # define dirent direct
1681 # ifdef HAVE_SYS_NDIR_H
1682 # include <sys/ndir.h>
1683 # endif /* HAVE_SYS_NDIR_H */
1684 # ifdef HAVE_SYS_DIR_H
1685 # include <sys/dir.h>
1686 # endif /* HAVE_SYS_DIR_H */
1689 # endif /* HAVE_NDIR_H */
1690 #endif /* HAVE_DIRENT_H */
1692 [struct dirent dp; dp.d_type = 0;],
1694 jm_cv_struct_dirent_d_type=yes,
1695 jm_cv_struct_dirent_d_type=no)
1698 if test $jm_cv_struct_dirent_d_type = yes; then
1699 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1700 [Define if there is a member named d_type in the struct describing
1701 directory headers.])
1708 dnl From Jim Meyering.
1710 dnl Check whether struct dirent has a member named d_ino.
1713 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1714 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1715 AC_CACHE_CHECK([for d_ino member in directory struct],
1716 jm_cv_struct_dirent_d_ino,
1719 #include <sys/types.h>
1720 #ifdef HAVE_DIRENT_H
1721 # include <dirent.h>
1722 #else /* not HAVE_DIRENT_H */
1723 # define dirent direct
1724 # ifdef HAVE_SYS_NDIR_H
1725 # include <sys/ndir.h>
1726 # endif /* HAVE_SYS_NDIR_H */
1727 # ifdef HAVE_SYS_DIR_H
1728 # include <sys/dir.h>
1729 # endif /* HAVE_SYS_DIR_H */
1732 # endif /* HAVE_NDIR_H */
1733 #endif /* HAVE_DIRENT_H */
1735 [struct dirent dp; dp.d_ino = 0;],
1737 jm_cv_struct_dirent_d_ino=yes,
1738 jm_cv_struct_dirent_d_ino=no)
1741 if test $jm_cv_struct_dirent_d_ino = yes; then
1742 AC_DEFINE(D_INO_IN_DIRENT, 1,
1743 [Define if there is a member named d_ino in the struct describing
1744 directory headers.])
1751 dnl This is just a wrapper function to encapsulate this kludge.
1752 dnl Putting it in a separate file like this helps share it between
1753 dnl different packages.
1754 AC_DEFUN([jm_CHECK_DECLS],
1756 AC_REQUIRE([_jm_DECL_HEADERS])
1757 AC_REQUIRE([AC_HEADER_TIME])
1761 # if !STDC_HEADERS && HAVE_MEMORY_H
1762 # include <memory.h>
1764 # include <string.h>
1767 # include <strings.h>
1771 # include <stdlib.h>
1774 # include <unistd.h>
1777 #include <sys/types.h>
1778 #if TIME_WITH_SYS_TIME
1779 # include <sys/time.h>
1782 # if HAVE_SYS_TIME_H
1783 # include <sys/time.h>
1824 ttyname], , , $headers)
1827 dnl FIXME: when autoconf has support for it.
1828 dnl This is a little helper so we can require these header checks.
1829 AC_DEFUN([_jm_DECL_HEADERS],
1831 AC_REQUIRE([AC_HEADER_STDC])
1832 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1833 unistd.h sys/time.h utmp.h utmpx.h)
1838 dnl We use jm_ for non Autoconf macros.
1839 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1840 m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1842 # These are the prerequisite macros for files in the lib/
1843 # directory of the coreutils package.
1845 AC_DEFUN([jm_PREREQ],
1847 AC_REQUIRE([jm_PREREQ_ADDEXT])
1849 # We don't yet use c-stack.c.
1850 # AC_REQUIRE([jm_PREREQ_C_STACK])
1852 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1853 AC_REQUIRE([jm_PREREQ_DIRNAME])
1854 AC_REQUIRE([jm_PREREQ_ERROR])
1855 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1856 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1857 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1858 AC_REQUIRE([jm_PREREQ_HASH])
1859 AC_REQUIRE([gl_HUMAN])
1860 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1861 AC_REQUIRE([jm_PREREQ_MEMCHR])
1862 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1863 AC_REQUIRE([jm_PREREQ_POSIXVER])
1864 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1865 AC_REQUIRE([jm_PREREQ_READUTMP])
1866 AC_REQUIRE([jm_PREREQ_STAT])
1867 AC_REQUIRE([jm_PREREQ_STRNLEN])
1868 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1869 AC_REQUIRE([jm_PREREQ_XGETCWD])
1870 AC_REQUIRE([jm_PREREQ_XREADLINK])
1873 AC_DEFUN([jm_PREREQ_ADDEXT],
1876 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1877 AC_CHECK_FUNCS(pathconf)
1878 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1881 AC_DEFUN([jm_PREREQ_CANON_HOST],
1883 dnl Add any libraries as early as possible.
1884 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1885 dnl so we have to add -lnsl to LIBS before checking for that function.
1886 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1888 dnl These come from -lnsl on Solaris5.5.1.
1889 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1891 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1892 netinet/in.h arpa/inet.h)
1895 AC_DEFUN([jm_PREREQ_DIRNAME],
1897 AC_REQUIRE([AC_HEADER_STDC])
1898 AC_CHECK_HEADERS(string.h)
1901 AC_DEFUN([jm_PREREQ_EXCLUDE],
1903 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1904 AC_REQUIRE([AC_HEADER_STDBOOL])
1907 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1909 AC_CHECK_FUNCS(getpagesize)
1910 AC_CHECK_HEADERS(OS.h unistd.h)
1913 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1915 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1916 AC_CHECK_FUNCS(setlocale)
1917 AC_REQUIRE([AM_C_PROTOTYPES])
1920 AC_DEFUN([jm_PREREQ_HASH],
1922 AC_CHECK_HEADERS(stdlib.h)
1923 AC_REQUIRE([AC_HEADER_STDBOOL])
1924 AC_REQUIRE([jm_CHECK_DECLS])
1927 AC_DEFUN([jm_PREREQ_MEMCHR],
1929 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1932 # Check for the external symbol, _system_configuration,
1933 # a struct with member `physmem'.
1934 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
1935 [AC_CACHE_CHECK(for external symbol _system_configuration,
1936 gl_cv_var__system_configuration,
1937 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
1938 [[#include <sys/systemcfg.h>
1940 [double x = _system_configuration.physmem;])],
1941 [gl_cv_var__system_configuration=yes],
1942 [gl_cv_var__system_configuration=no])])
1944 if test $gl_cv_var__system_configuration = yes; then
1945 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
1946 [Define to 1 if you have the external variable,
1947 _system_configuration with a member named physmem.])
1952 AC_DEFUN([jm_PREREQ_PHYSMEM],
1954 AC_CHECK_HEADERS([unistd.h sys/pstat.h sys/sysmp.h sys/sysinfo.h \
1955 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
1956 sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
1957 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
1959 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
1962 AC_DEFUN([jm_PREREQ_POSIXVER],
1964 AC_CHECK_HEADERS(unistd.h)
1965 AC_CHECK_DECLS([getenv])
1968 AC_DEFUN([jm_PREREQ_QUOTEARG],
1970 AC_CHECK_FUNCS(isascii iswprint)
1971 AC_REQUIRE([jm_FUNC_MBRTOWC])
1972 AC_REQUIRE([jm_FUNC_MEMCMP])
1973 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1974 AC_REQUIRE([AC_HEADER_STDC])
1975 AC_REQUIRE([AC_C_BACKSLASH_A])
1976 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1977 AC_REQUIRE([AM_C_PROTOTYPES])
1980 AC_DEFUN([jm_PREREQ_READUTMP],
1982 AC_REQUIRE([AC_HEADER_STDC])
1983 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1984 AC_CHECK_FUNCS(utmpname)
1985 AC_CHECK_FUNCS(utmpxname)
1986 AC_REQUIRE([AM_C_PROTOTYPES])
1988 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1990 $ac_includes_default
1998 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1999 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
2000 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
2001 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
2002 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
2003 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
2004 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
2005 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
2006 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
2007 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
2009 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
2010 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
2011 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
2012 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
2014 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
2015 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
2016 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
2017 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
2022 AC_DEFUN([jm_PREREQ_STAT],
2024 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
2025 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
2026 AC_CHECK_FUNCS(statvfs)
2028 # For `struct statfs' on Ultrix 4.4.
2029 AC_CHECK_HEADERS([netinet/in.h nfs/nfs_clnt.h nfs/vfs.h],,,
2030 [AC_INCLUDES_DEFAULT])
2032 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2035 $ac_includes_default
2036 #if HAVE_SYS_STATVFS_H
2037 # include <sys/statvfs.h>
2040 # include <sys/vfs.h>
2042 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
2043 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
2044 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
2045 # include <sys/param.h>
2046 # include <sys/mount.h>
2047 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
2048 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
2049 # include <netinet/in.h>
2050 # include <nfs/nfs_clnt.h>
2051 # include <nfs/vfs.h>
2055 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
2056 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
2057 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
2058 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
2059 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
2060 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
2061 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
2062 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
2063 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
2064 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
2065 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
2068 AC_DEFUN([jm_PREREQ_STRNLEN],
2070 AC_REQUIRE([AC_FUNC_STRNLEN])
2071 AC_REQUIRE([AC_HEADER_STDC])
2072 AC_CHECK_HEADERS(memory.h)
2073 AC_CHECK_DECLS([memchr])
2075 # This is necessary because automake-1.6.1 doesn't understand
2076 # that the above use of AC_FUNC_STRNLEN means we may have to use
2078 test $ac_cv_func_strnlen_working = yes \
2079 && AC_LIBOBJ(strnlen)
2082 AC_DEFUN([jm_PREREQ_TEMPNAME],
2084 AC_REQUIRE([AC_HEADER_STDC])
2085 AC_REQUIRE([AC_HEADER_STAT])
2086 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
2087 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
2088 AC_CHECK_DECLS([getenv])
2089 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2092 AC_DEFUN([jm_PREREQ_XGETCWD],
2094 AC_REQUIRE([AC_C_PROTOTYPES])
2095 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
2096 AC_CHECK_FUNCS(getcwd)
2097 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
2100 AC_DEFUN([jm_PREREQ_XREADLINK],
2102 AC_REQUIRE([AC_C_PROTOTYPES])
2103 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
2108 AC_DEFUN([gl_ERROR],
2110 AC_FUNC_ERROR_AT_LINE
2111 dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
2115 # Prerequisites of lib/error.c.
2116 AC_DEFUN([jm_PREREQ_ERROR],
2118 AC_REQUIRE([AC_HEADER_STDC])
2119 AC_REQUIRE([AC_FUNC_VPRINTF])
2120 AC_CHECK_FUNCS(strerror)
2121 AC_CHECK_DECLS([strerror])
2126 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2127 dnl This file is free software, distributed under the terms of the GNU
2128 dnl General Public License. As a special exception to the GNU General
2129 dnl Public License, this file may be distributed as part of a program
2130 dnl that contains a configuration script generated by Autoconf, under
2131 dnl the same distribution terms as the rest of that program.
2133 AC_DEFUN([gl_HUMAN],
2135 dnl Prerequisites of lib/human.h.
2136 AC_REQUIRE([AM_STDBOOL_H])
2137 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2139 dnl Prerequisites of lib/human.c.
2140 AC_CHECK_HEADERS_ONCE(locale.h stdlib.h string.h)
2141 AC_CHECK_DECLS_ONCE(getenv)
2142 AC_CHECK_FUNCS_ONCE(localeconv)
2145 # Check for stdbool.h that conforms to C99.
2147 # Copyright (C) 2002-2003 Free Software Foundation, Inc.
2149 # This program is free software; you can redistribute it and/or modify
2150 # it under the terms of the GNU General Public License as published by
2151 # the Free Software Foundation; either version 2, or (at your option)
2152 # any later version.
2154 # This program is distributed in the hope that it will be useful,
2155 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2156 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2157 # GNU General Public License for more details.
2159 # You should have received a copy of the GNU General Public License
2160 # along with this program; if not, write to the Free Software
2161 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2164 # Prepare for substituting <stdbool.h> if it is not supported.
2166 AC_DEFUN([AM_STDBOOL_H],
2168 AC_REQUIRE([AC_HEADER_STDBOOL])
2170 # Define two additional variables used in the Makefile substitution.
2172 if test "$ac_cv_header_stdbool_h" = yes; then
2175 STDBOOL_H='stdbool.h'
2177 AC_SUBST([STDBOOL_H])
2179 if test "$ac_cv_type__Bool" = yes; then
2184 AC_SUBST([HAVE__BOOL])
2187 # This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
2188 # have this macro built-in.
2190 AC_DEFUN([AC_HEADER_STDBOOL],
2191 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2192 [ac_cv_header_stdbool_h],
2195 #include <stdbool.h>
2197 "error: bool is not defined"
2200 "error: false is not defined"
2203 "error: false is not 0"
2206 "error: false is not defined"
2209 "error: true is not 1"
2211 #ifndef __bool_true_false_are_defined
2212 "error: __bool_true_false_are_defined is not defined"
2215 struct s { _Bool s: 1; _Bool t; } s;
2217 char a[true == 1 ? 1 : -1];
2218 char b[false == 0 ? 1 : -1];
2219 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2220 char d[(bool) -0.5 == true ? 1 : -1];
2222 char f[(_Bool) -0.0 == false ? 1 : -1];
2224 char h[sizeof (_Bool)];
2227 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2228 [ac_cv_header_stdbool_h=yes],
2229 [ac_cv_header_stdbool_h=no])])
2230 AC_CHECK_TYPES([_Bool])
2231 if test $ac_cv_header_stdbool_h = yes; then
2232 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2235 # uintmax_t.m4 serial 7 (gettext-0.12)
2236 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2237 dnl This file is free software, distributed under the terms of the GNU
2238 dnl General Public License. As a special exception to the GNU General
2239 dnl Public License, this file may be distributed as part of a program
2240 dnl that contains a configuration script generated by Autoconf, under
2241 dnl the same distribution terms as the rest of that program.
2243 dnl From Paul Eggert.
2247 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2248 # if it is not already defined in <stdint.h> or <inttypes.h>.
2250 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2252 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2253 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2254 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2255 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2256 test $ac_cv_type_unsigned_long_long = yes \
2257 && ac_type='unsigned long long' \
2258 || ac_type='unsigned long'
2259 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2260 [Define to unsigned long or unsigned long long
2261 if <stdint.h> and <inttypes.h> don't define.])
2263 AC_DEFINE(HAVE_UINTMAX_T, 1,
2264 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2268 # inttypes_h.m4 serial 5 (gettext-0.12)
2269 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2270 dnl This file is free software, distributed under the terms of the GNU
2271 dnl General Public License. As a special exception to the GNU General
2272 dnl Public License, this file may be distributed as part of a program
2273 dnl that contains a configuration script generated by Autoconf, under
2274 dnl the same distribution terms as the rest of that program.
2276 dnl From Paul Eggert.
2278 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2279 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2281 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2283 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2285 [#include <sys/types.h>
2286 #include <inttypes.h>],
2287 [uintmax_t i = (uintmax_t) -1;],
2288 jm_ac_cv_header_inttypes_h=yes,
2289 jm_ac_cv_header_inttypes_h=no)])
2290 if test $jm_ac_cv_header_inttypes_h = yes; then
2291 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2292 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2293 and declares uintmax_t. ])
2297 # stdint_h.m4 serial 3 (gettext-0.12)
2298 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2299 dnl This file is free software, distributed under the terms of the GNU
2300 dnl General Public License. As a special exception to the GNU General
2301 dnl Public License, this file may be distributed as part of a program
2302 dnl that contains a configuration script generated by Autoconf, under
2303 dnl the same distribution terms as the rest of that program.
2305 dnl From Paul Eggert.
2307 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2308 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2310 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2312 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2314 [#include <sys/types.h>
2315 #include <stdint.h>],
2316 [uintmax_t i = (uintmax_t) -1;],
2317 jm_ac_cv_header_stdint_h=yes,
2318 jm_ac_cv_header_stdint_h=no)])
2319 if test $jm_ac_cv_header_stdint_h = yes; then
2320 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2321 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2322 and declares uintmax_t. ])
2328 dnl From Paul Eggert.
2330 # Define HAVE_LONG_LONG if 'long long' works.
2332 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2334 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2335 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2336 [long long llmax = (long long) -1;
2337 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2338 ac_cv_type_long_long=yes,
2339 ac_cv_type_long_long=no)])
2340 if test $ac_cv_type_long_long = yes; then
2341 AC_DEFINE(HAVE_LONG_LONG, 1,
2342 [Define if you have the long long type.])
2346 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2348 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2350 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2351 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2352 [unsigned long long ullmax = (unsigned long long) -1;
2353 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2354 ac_cv_type_unsigned_long_long=yes,
2355 ac_cv_type_unsigned_long_long=no)])
2356 if test $ac_cv_type_unsigned_long_long = yes; then
2357 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2358 [Define if you have the unsigned long long type.])
2364 dnl autoconf tests required for use of mbswidth.c
2365 dnl From Bruno Haible.
2367 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2369 AC_REQUIRE([AC_HEADER_STDC])
2370 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2371 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2374 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2376 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2378 # include <string.h>
2385 char *p = (char *) wcwidth;
2387 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2388 if test $ac_cv_have_decl_wcwidth = yes; then
2393 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2394 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2399 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2400 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2401 dnl This file is free software, distributed under the terms of the GNU
2402 dnl General Public License. As a special exception to the GNU General
2403 dnl Public License, this file may be distributed as part of a program
2404 dnl that contains a configuration script generated by Autoconf, under
2405 dnl the same distribution terms as the rest of that program.
2407 dnl From Paul Eggert
2409 AC_DEFUN([jm_FUNC_MBRTOWC],
2411 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2414 [#include <wchar.h>],
2415 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2416 jm_cv_func_mbrtowc=yes,
2417 jm_cv_func_mbrtowc=no)])
2418 if test $jm_cv_func_mbrtowc = yes; then
2419 AC_DEFINE(HAVE_MBRTOWC, 1,
2420 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2426 dnl A replacement for autoconf's macro by the same name. This version
2427 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2428 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2429 dnl run only if one of the listed libraries ends up being used (and not in
2430 dnl the `none required' case.
2431 dnl I hope it's only temporary while we wait for that version to be fixed.
2432 undefine([AC_SEARCH_LIBS])
2434 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2435 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2436 # [OTHER-LIBRARIES])
2437 # --------------------------------------------------------
2438 # Search for a library defining FUNC, if it's not already available.
2439 AC_DEFUN([AC_SEARCH_LIBS],
2441 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2443 ac_func_search_save_LIBS=$LIBS
2445 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2446 if test "$ac_cv_search_$1" = no; then
2447 for ac_lib in $2; do
2448 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2449 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2452 LIBS=$ac_func_search_save_LIBS
2455 if test "$ac_cv_search_$1" = no; then :
2458 if test "$ac_cv_search_$1" = 'none required'; then :
2461 LIBS="$ac_cv_search_$1 $LIBS"
2468 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2470 # This program is free software; you can redistribute it and/or modify
2471 # it under the terms of the GNU General Public License as published by
2472 # the Free Software Foundation; either version 2, or (at your option)
2473 # any later version.
2475 # This program is distributed in the hope that it will be useful,
2476 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2477 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2478 # GNU General Public License for more details.
2480 # You should have received a copy of the GNU General Public License
2481 # along with this program; if not, write to the Free Software
2482 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2487 AC_DEFUN([AM_C_PROTOTYPES],
2488 [AC_REQUIRE([AM_PROG_CC_STDC])
2489 AC_REQUIRE([AC_PROG_CPP])
2490 AC_MSG_CHECKING([for function prototypes])
2491 if test "$am_cv_prog_cc_stdc" != no; then
2493 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2497 U=_ ANSI2KNR=./ansi2knr
2499 # Ensure some checks needed by ansi2knr itself.
2501 AC_CHECK_HEADERS(string.h)
2503 AC_SUBST(ANSI2KNR)dnl
2506 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2509 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2511 # This program is free software; you can redistribute it and/or modify
2512 # it under the terms of the GNU General Public License as published by
2513 # the Free Software Foundation; either version 2, or (at your option)
2514 # any later version.
2516 # This program is distributed in the hope that it will be useful,
2517 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2518 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2519 # GNU General Public License for more details.
2521 # You should have received a copy of the GNU General Public License
2522 # along with this program; if not, write to the Free Software
2523 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2528 # @defmac AC_PROG_CC_STDC
2529 # @maindex PROG_CC_STDC
2531 # If the C compiler in not in ANSI C mode by default, try to add an option
2532 # to output variable @code{CC} to make it so. This macro tries various
2533 # options that select ANSI C on some system or another. It considers the
2534 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2536 # If you use this macro, you should check after calling it whether the C
2537 # compiler has been set to accept ANSI C; if not, the shell variable
2538 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2539 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2540 # program @code{ansi2knr}, which comes with Ghostscript.
2543 AC_DEFUN([AM_PROG_CC_STDC],
2544 [AC_REQUIRE([AC_PROG_CC])
2545 AC_BEFORE([$0], [AC_C_INLINE])
2546 AC_BEFORE([$0], [AC_C_CONST])
2547 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2548 dnl a magic option to avoid problems with ANSI preprocessor commands
2550 dnl FIXME: can't do this because then AC_AIX won't work due to a
2551 dnl circular dependency.
2552 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2553 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2554 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2555 [am_cv_prog_cc_stdc=no
2557 # Don't try gcc -ansi; that turns off useful extensions and
2558 # breaks some systems' header files.
2559 # AIX -qlanglvl=ansi
2560 # Ultrix and OSF/1 -std1
2561 # HP-UX 10.20 and later -Ae
2562 # HP-UX older versions -Aa -D_HPUX_SOURCE
2563 # SVR4 -Xc -D__EXTENSIONS__
2564 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2566 CC="$ac_save_CC $ac_arg"
2568 [#include <stdarg.h>
2570 #include <sys/types.h>
2571 #include <sys/stat.h>
2572 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2573 struct buf { int x; };
2574 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2575 static char *e (p, i)
2581 static char *f (char * (*g) (char **, int), char **p, ...)
2586 s = g (p, va_arg (v,int));
2590 int test (int i, double x);
2591 struct s1 {int (*f) (int a);};
2592 struct s2 {int (*f) (double a);};
2593 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2597 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2599 [am_cv_prog_cc_stdc="$ac_arg"; break])
2603 if test -z "$am_cv_prog_cc_stdc"; then
2604 AC_MSG_RESULT([none needed])
2606 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2608 case "x$am_cv_prog_cc_stdc" in
2610 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2614 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2618 AC_DEFUN([jm_FUNC_MEMCMP],
2619 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2620 if test $ac_cv_func_memcmp_working = no; then
2621 AC_DEFINE(memcmp, rpl_memcmp,
2622 [Define to rpl_memcmp if the replacement function should be used.])
2626 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2628 # Copyright 2001 Free Software Foundation, Inc.
2630 # This program is free software; you can redistribute it and/or modify
2631 # it under the terms of the GNU General Public License as published by
2632 # the Free Software Foundation; either version 2, or (at your option)
2633 # any later version.
2635 # This program is distributed in the hope that it will be useful,
2636 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2637 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2638 # GNU General Public License for more details.
2640 # You should have received a copy of the GNU General Public License
2641 # along with this program; if not, write to the Free Software Foundation,
2642 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2644 # Written by Paul Eggert.
2646 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2647 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2648 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2649 [ac_cv_func_getcwd_null],
2652 # ifdef HAVE_STDLIB_H
2653 # include <stdlib.h>
2655 # ifdef HAVE_UNISTD_H
2656 # include <unistd.h>
2664 if (chdir ("/") != 0)
2668 char *f = getcwd (NULL, 0);
2669 exit (! (f && f[0] == '/' && !f[1]));
2672 [ac_cv_func_getcwd_null=yes],
2673 [ac_cv_func_getcwd_null=no],
2674 [ac_cv_func_getcwd_null=no])])
2675 if test $ac_cv_func_getcwd_null = yes; then
2676 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2677 [Define if getcwd (NULL, 0) allocates memory for result.])
2682 dnl Find out how to get the file descriptor associated with an open DIR*.
2683 dnl From Jim Meyering
2685 AC_DEFUN([UTILS_FUNC_DIRFD],
2687 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2688 AC_REQUIRE([AC_PROG_CPP])
2689 AC_REQUIRE([AC_PROG_EGREP])
2694 # include <dirent.h>
2695 #else /* not HAVE_DIRENT_H */
2696 # define dirent direct
2697 # if HAVE_SYS_NDIR_H
2698 # include <sys/ndir.h>
2699 # endif /* HAVE_SYS_NDIR_H */
2701 # include <sys/dir.h>
2702 # endif /* HAVE_SYS_DIR_H */
2705 # endif /* HAVE_NDIR_H */
2706 #endif /* HAVE_DIRENT_H */
2708 AC_CHECK_FUNCS(dirfd)
2709 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2711 AC_CACHE_CHECK([whether dirfd is a macro],
2712 jm_cv_func_dirfd_macro,
2713 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2715 dirent_header_defines_dirfd
2717 jm_cv_func_dirfd_macro=yes,
2718 jm_cv_func_dirfd_macro=no)])
2720 # Use the replacement only if we have no function, macro,
2721 # or declaration with that name.
2722 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2724 AC_REPLACE_FUNCS([dirfd])
2726 [how to get the file descriptor associated with an open DIR*],
2727 gl_cv_sys_dir_fd_member_name,
2729 dirfd_save_CFLAGS=$CFLAGS
2730 for ac_expr in d_fd dd_fd; do
2732 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2736 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2739 CFLAGS=$dirfd_save_CFLAGS
2740 test "$dir_fd_found" = yes && break
2742 test "$dir_fd_found" = yes || ac_expr=no_such_member
2744 gl_cv_sys_dir_fd_member_name=$ac_expr
2747 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
2748 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2749 $gl_cv_sys_dir_fd_member_name,
2750 [the name of the file descriptor member of DIR])
2752 AH_VERBATIM(DIR_TO_FD,
2753 [#ifdef DIR_FD_MEMBER_NAME
2754 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2756 # define DIR_TO_FD(Dir_p) -1
2763 # acl.m4 - check for access control list (ACL) primitives
2765 # Copyright (C) 2002 Free Software Foundation, Inc.
2767 # This program is free software; you can redistribute it and/or modify
2768 # it under the terms of the GNU General Public License as published by
2769 # the Free Software Foundation; either version 2, or (at your option)
2770 # any later version.
2772 # This program is distributed in the hope that it will be useful,
2773 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2774 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2775 # GNU General Public License for more details.
2777 # You should have received a copy of the GNU General Public License
2778 # along with this program; if not, write to the Free Software Foundation,
2779 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2781 # Written by Paul Eggert.
2783 AC_DEFUN([AC_FUNC_ACL],
2784 [AC_CHECK_HEADERS(sys/acl.h)
2785 AC_CHECK_FUNCS(acl)])
2788 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2789 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
2790 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
2791 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
2792 # objects and arrange to use lib/search.h if necessary.
2795 AC_DEFUN([AC_FUNC_FTW],
2798 AC_REQUIRE([AC_HEADER_STAT])
2799 AC_REQUIRE([jm_FUNC_LSTAT])
2800 AC_REQUIRE([AC_HEADER_DIRENT])
2801 AC_CHECK_HEADERS(sys/param.h)
2802 AC_CHECK_DECLS([stpcpy])
2804 # In the event that we have to use the replacement ftw.c,
2805 # see if we'll also need the replacement tsearch.c.
2806 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2808 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
2809 ac_cv_func_ftw_working,
2811 # The following test would fail prior to glibc-2.3.2, because `depth'
2812 # would be 2 rather than 4. Of course, now that we require FTW_DCH
2813 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
2814 mkdir -p conftest.dir/a/b/c
2815 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2820 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2821 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2822 static char **p = _f;
2826 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2828 if (strcmp (file, *p++) != 0)
2837 /* Require these symbols, too. */
2841 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2842 exit ((err == 0 && depth == 4) ? 0 : 1);
2845 [ac_cv_func_ftw_working=yes],
2846 [ac_cv_func_ftw_working=no],
2847 [ac_cv_func_ftw_working=no])])
2849 if test $ac_cv_func_ftw_working = no; then
2851 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2852 # Add tsearch.o IFF we have to use the replacement ftw.c.
2853 if test -n "$need_tdestroy"; then
2854 AC_LIBOBJ([tsearch])
2855 # Link search.h to search_.h if we use the replacement tsearch.c.
2857 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2864 dnl From Jim Meyering.
2865 dnl Determine whether lstat has the bug that it succeeds when given the
2866 dnl zero-length file name argument. The lstat from SunOS 4.1.4 and the Hurd
2867 dnl (as of 1998-11-01) do this.
2869 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2870 dnl compile the wrapper function.
2873 AC_DEFUN([jm_FUNC_LSTAT],
2875 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2876 AC_CACHE_CHECK([whether lstat accepts an empty string],
2877 jm_cv_func_lstat_empty_string_bug,
2879 # include <sys/types.h>
2880 # include <sys/stat.h>
2886 exit (lstat ("", &sbuf) ? 1 : 0);
2889 jm_cv_func_lstat_empty_string_bug=yes,
2890 jm_cv_func_lstat_empty_string_bug=no,
2891 dnl When crosscompiling, assume lstat is broken.
2892 jm_cv_func_lstat_empty_string_bug=yes)
2894 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2896 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2897 [Define if lstat has the bug that it succeeds when given the zero-length
2898 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2905 dnl From Jim Meyering.
2906 dnl Provide lchown on systems that lack it.
2908 AC_DEFUN([jm_FUNC_LCHOWN],
2910 AC_REQUIRE([AC_TYPE_UID_T])
2911 AC_REPLACE_FUNCS(lchown)
2916 # When rmdir fails because the specified directory is not empty, it sets
2917 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2918 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2919 # in general, to avoid depending on the use of any particular symbol, this
2920 # test runs a test to determine the actual numeric value.
2921 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2923 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2924 fetish_cv_func_rmdir_errno_not_empty,
2926 # Arrange for deletion of the temporary directory this test creates.
2927 ac_clean_files="$ac_clean_files confdir2"
2928 mkdir confdir2; : > confdir2/file
2941 s = fopen ("confdir2/errno", "w");
2942 fprintf (s, "%d\n", val);
2946 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2947 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2948 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2953 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2954 $fetish_cv_func_rmdir_errno_not_empty,
2955 [the value to which errno is set when rmdir fails on a nonempty directory])
2960 dnl From Jim Meyering.
2961 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2962 dnl If it doesn't, arrange to use the replacement function.
2965 AC_DEFUN([jm_FUNC_CHOWN],
2966 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2967 test -z "$ac_cv_header_unistd_h" \
2968 && AC_CHECK_HEADERS(unistd.h)
2969 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2971 # include <sys/types.h>
2972 # include <sys/stat.h>
2974 # ifdef HAVE_UNISTD_H
2975 # include <unistd.h>
2981 char *f = "conftest.chown";
2982 struct stat before, after;
2984 if (creat (f, 0600) < 0)
2986 if (stat (f, &before) < 0)
2988 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2990 if (stat (f, &after) < 0)
2992 exit ((before.st_uid == after.st_uid
2993 && before.st_gid == after.st_gid) ? 0 : 1);
2996 jm_cv_func_working_chown=yes,
2997 jm_cv_func_working_chown=no,
2998 dnl When crosscompiling, assume chown is broken.
2999 jm_cv_func_working_chown=no)
3001 if test $jm_cv_func_working_chown = no; then
3003 AC_DEFINE(chown, rpl_chown,
3004 [Define to rpl_chown if the replacement function should be used.])
3010 dnl From Jim Meyering.
3011 dnl A wrapper around AC_FUNC_MKTIME.
3013 AC_DEFUN([jm_FUNC_MKTIME],
3014 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
3016 dnl mktime.c uses localtime_r if it exists. Check for it.
3017 AC_CHECK_FUNCS(localtime_r)
3019 if test $ac_cv_func_working_mktime = no; then
3020 AC_DEFINE(mktime, rpl_mktime,
3021 [Define to rpl_mktime if the replacement function should be used.])
3025 # mktime.m4 serial 2
3026 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3027 dnl This file is free software, distributed under the terms of the GNU
3028 dnl General Public License. As a special exception to the GNU General
3029 dnl Public License, this file may be distributed as part of a program
3030 dnl that contains a configuration script generated by Autoconf, under
3031 dnl the same distribution terms as the rest of that program.
3033 dnl From Jim Meyering.
3035 # Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.57 and earlier.
3036 # This redefinition can be removed once a new version of Autoconf comes out.
3037 # The redefinition is taken from
3038 # <http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/autoconf/autoconf/lib/autoconf/functions.m4?rev=1.78>.
3041 AC_DEFUN([AC_FUNC_MKTIME],
3042 [AC_REQUIRE([AC_HEADER_TIME])dnl
3043 AC_CHECK_HEADERS(stdlib.h sys/time.h unistd.h)
3044 AC_CHECK_FUNCS(alarm)
3045 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
3046 [AC_RUN_IFELSE([AC_LANG_SOURCE(
3047 [[/* Test program from Paul Eggert and Tony Leneis. */
3048 #if TIME_WITH_SYS_TIME
3049 # include <sys/time.h>
3052 # if HAVE_SYS_TIME_H
3053 # include <sys/time.h>
3060 # include <stdlib.h>
3064 # include <unistd.h>
3068 # define alarm(X) /* empty */
3071 /* Work around redefinition to rpl_putenv by other config tests. */
3074 static time_t time_t_max;
3075 static time_t time_t_min;
3077 /* Values we'll use to set the TZ environment variable. */
3078 static char *tz_strings[] = {
3079 (char *) 0, "TZ=GMT0", "TZ=JST-9",
3080 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
3082 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
3084 /* Fail if mktime fails to convert a date in the spring-forward gap.
3085 Based on a problem report from Andreas Jaeger. */
3087 spring_forward_gap ()
3089 /* glibc (up to about 1998-10-07) failed this test. */
3092 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
3093 instead of "TZ=America/Vancouver" in order to detect the bug even
3094 on systems that don't support the Olson extension, or don't have the
3095 full zoneinfo tables installed. */
3096 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
3105 if (mktime (&tm) == (time_t)-1)
3114 if ((lt = localtime (&now)) && mktime (lt) != now)
3123 mktime_test1 ((time_t) (time_t_max - now));
3124 mktime_test1 ((time_t) (time_t_min + now));
3130 /* Based on code from Ariel Faigon. */
3140 if (tm.tm_mon != 2 || tm.tm_mday != 31)
3150 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
3152 if (now != (time_t) -1)
3154 struct tm *lt = localtime (&now);
3156 && lt->tm_year == tm.tm_year
3157 && lt->tm_mon == tm.tm_mon
3158 && lt->tm_mday == tm.tm_mday
3159 && lt->tm_hour == tm.tm_hour
3160 && lt->tm_min == tm.tm_min
3161 && lt->tm_sec == tm.tm_sec
3162 && lt->tm_yday == tm.tm_yday
3163 && lt->tm_wday == tm.tm_wday
3164 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
3165 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
3176 /* This test makes some buggy mktime implementations loop.
3177 Give up after 60 seconds; a mktime slower than that
3178 isn't worth using anyway. */
3181 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
3184 if ((time_t) -1 < 0)
3185 for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
3187 delta = time_t_max / 997; /* a suitable prime number */
3188 for (i = 0; i < N_STRINGS; i++)
3191 putenv (tz_strings[i]);
3193 for (t = 0; t <= time_t_max - delta; t += delta)
3195 mktime_test ((time_t) 1);
3196 mktime_test ((time_t) (60 * 60));
3197 mktime_test ((time_t) (60 * 60 * 24));
3199 for (j = 1; 0 < j; j *= 2)
3201 bigtime_test (j - 1);
3204 spring_forward_gap ();
3207 [ac_cv_func_working_mktime=yes],
3208 [ac_cv_func_working_mktime=no],
3209 [ac_cv_func_working_mktime=no])])
3210 if test $ac_cv_func_working_mktime = no; then
3215 AC_DEFUN([gl_FUNC_MKTIME],
3217 AC_REQUIRE([AC_FUNC_MKTIME])
3218 if test $ac_cv_func_working_mktime = no; then
3219 AC_DEFINE(mktime, rpl_mktime,
3220 [Define to rpl_mktime if the replacement function should be used.])
3225 # Prerequisites of lib/mktime.c.
3226 AC_DEFUN([gl_PREREQ_MKTIME], [
3227 AC_REQUIRE([AC_HEADER_STDC])
3228 AC_CHECK_HEADERS_ONCE(limits.h)
3233 dnl From Jim Meyering.
3234 dnl Determine whether stat has the bug that it succeeds when given the
3235 dnl zero-length file name argument. The stat from SunOS 4.1.4 and the Hurd
3236 dnl (as of 1998-11-01) do this.
3238 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
3239 dnl compile the wrapper function.
3242 AC_DEFUN([jm_FUNC_STAT],
3244 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
3245 AC_CACHE_CHECK([whether stat accepts an empty string],
3246 jm_cv_func_stat_empty_string_bug,
3248 # include <sys/types.h>
3249 # include <sys/stat.h>
3255 exit (stat ("", &sbuf) ? 1 : 0);
3258 jm_cv_func_stat_empty_string_bug=yes,
3259 jm_cv_func_stat_empty_string_bug=no,
3260 dnl When crosscompiling, assume stat is broken.
3261 jm_cv_func_stat_empty_string_bug=yes)
3263 if test $jm_cv_func_stat_empty_string_bug = yes; then
3265 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
3266 [Define if stat has the bug that it succeeds when given the zero-length
3267 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
3274 dnl From Jim Meyering.
3275 dnl Check for the nanosleep function.
3276 dnl If not found, use the supplied replacement.
3279 AC_DEFUN([jm_FUNC_NANOSLEEP],
3281 nanosleep_save_libs=$LIBS
3283 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
3284 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
3285 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
3286 AC_SUBST(LIB_NANOSLEEP)
3288 AC_CACHE_CHECK([whether nanosleep works],
3289 jm_cv_func_nanosleep_works,
3291 AC_REQUIRE([AC_HEADER_TIME])
3293 # if TIME_WITH_SYS_TIME
3294 # include <sys/time.h>
3297 # if HAVE_SYS_TIME_H
3298 # include <sys/time.h>
3307 struct timespec ts_sleep, ts_remaining;
3308 ts_sleep.tv_sec = 0;
3309 ts_sleep.tv_nsec = 1;
3310 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
3313 jm_cv_func_nanosleep_works=yes,
3314 jm_cv_func_nanosleep_works=no,
3315 dnl When crosscompiling, assume the worst.
3316 jm_cv_func_nanosleep_works=no)
3318 if test $jm_cv_func_nanosleep_works = no; then
3319 AC_LIBOBJ(nanosleep)
3320 AC_DEFINE(nanosleep, rpl_nanosleep,
3321 [Define to rpl_nanosleep if the replacement function should be used.])
3324 LIBS=$nanosleep_save_libs
3327 # memcoll.m4 serial 2
3328 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3329 dnl This file is free software, distributed under the terms of the GNU
3330 dnl General Public License. As a special exception to the GNU General
3331 dnl Public License, this file may be distributed as part of a program
3332 dnl that contains a configuration script generated by Autoconf, under
3333 dnl the same distribution terms as the rest of that program.
3335 AC_DEFUN([gl_MEMCOLL],
3337 dnl Prerequisites of lib/memcoll.c.
3338 AC_REQUIRE([AC_FUNC_MEMCMP])
3339 AC_CHECK_HEADERS_ONCE(string.h)
3343 #serial 7 -*- autoconf -*-
3345 dnl From Jim Meyering.
3347 dnl See if the glibc *_unlocked I/O macros are available.
3348 dnl Use only those *_unlocked macros that are declared.
3351 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
3353 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
3354 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
3355 fread_unlocked, fwrite_unlocked, getc_unlocked,
3356 getchar_unlocked, putc_unlocked, putchar_unlocked])])
3360 dnl Written by Jim Meyering
3362 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
3364 dnl Do this replacement check manually because I want the hyphen
3365 dnl (not the underscore) in the filename.
3366 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3372 dnl From Jim Meyering.
3374 dnl Check whether putenv ("FOO") removes FOO from the environment.
3375 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3378 AC_DEFUN([jm_FUNC_PUTENV],
3379 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3384 /* Put it in env. */
3385 if (putenv ("CONFTEST_putenv=val"))
3388 /* Try to remove it. */
3389 if (putenv ("CONFTEST_putenv"))
3392 /* Make sure it was deleted. */
3393 if (getenv ("CONFTEST_putenv") != 0)
3399 jm_cv_func_svid_putenv=yes,
3400 jm_cv_func_svid_putenv=no,
3401 dnl When crosscompiling, assume putenv is broken.
3402 jm_cv_func_svid_putenv=no)
3404 if test $jm_cv_func_svid_putenv = no; then
3406 AC_DEFINE(putenv, rpl_putenv,
3407 [Define to rpl_putenv if the replacement function should be used.])
3415 AC_MSG_CHECKING(for AFS)
3416 if test -d /afs; then
3417 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3422 AC_MSG_RESULT($ac_result)
3427 # autoconf tests required for use of xstrtoumax.c
3429 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3431 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3432 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3433 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3434 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3435 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3436 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3438 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3439 jm_cv_func_strtoumax_macro,
3440 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3442 inttypes_h_defines_strtoumax
3444 jm_cv_func_strtoumax_macro=yes,
3445 jm_cv_func_strtoumax_macro=no))
3447 if test "$jm_cv_func_strtoumax_macro" != yes; then
3448 AC_REPLACE_FUNCS(strtoumax)
3451 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3452 dnl so we need the replacements only if strtoumax does not exist.
3453 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3455 AC_REPLACE_FUNCS(strtoul)
3457 dnl We don't need (and can't compile) the replacement strtoull
3458 dnl unless the type `unsigned long long' exists.
3459 if test "$ac_cv_type_unsigned_long_long" = yes; then
3460 AC_REPLACE_FUNCS(strtoull)
3466 # intmax_t.m4 serial 1
3467 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3468 dnl This file is free software, distributed under the terms of the GNU
3469 dnl General Public License. As a special exception to the GNU General
3470 dnl Public License, this file may be distributed as part of a program
3471 dnl that contains a configuration script generated by Autoconf, under
3472 dnl the same distribution terms as the rest of that program.
3474 dnl From Paul Eggert.
3478 # Define intmax_t to 'long' or 'long long'
3479 # if it is not already defined in <stdint.h> or <inttypes.h>.
3481 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
3483 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
3484 dnl only if it defines 'uintmax_t'.
3485 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3486 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3487 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3488 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3489 test $ac_cv_type_long_long = yes \
3490 && ac_type='long long' \
3492 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3493 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
3495 AC_DEFINE(HAVE_INTMAX_T, 1,
3496 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3500 dnl An alternative would be to explicitly test for 'intmax_t'.
3502 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
3504 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3505 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3506 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3510 #if HAVE_STDINT_H_WITH_UINTMAX
3513 #if HAVE_INTTYPES_H_WITH_UINTMAX
3514 #include <inttypes.h>
3516 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3517 if test $gt_cv_c_intmax_t = yes; then
3518 AC_DEFINE(HAVE_INTMAX_T, 1,
3519 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3521 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3522 test $ac_cv_type_long_long = yes \
3523 && ac_type='long long' \
3525 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3526 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
3531 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3533 # autoconf tests required for use of xstrtoimax.c
3535 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3537 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3538 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3539 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3540 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3541 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3542 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3544 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3545 jm_cv_func_strtoimax_macro,
3546 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3548 inttypes_h_defines_strtoimax
3550 jm_cv_func_strtoimax_macro=yes,
3551 jm_cv_func_strtoimax_macro=no))
3553 if test "$jm_cv_func_strtoimax_macro" != yes; then
3554 AC_REPLACE_FUNCS(strtoimax)
3557 dnl Only the replacement strtoimax invokes strtol and strtoll,
3558 dnl so we need the replacements only if strtoimax does not exist.
3559 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3561 AC_REPLACE_FUNCS(strtol)
3563 dnl We don't need (and can't compile) the replacement strtoll
3564 dnl unless the type `long long' exists.
3565 if test "$ac_cv_type_long_long" = yes; then
3566 AC_REPLACE_FUNCS(strtoll)
3573 dnl Run a program to determine whether whether link(2) follows symlinks.
3574 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3576 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3579 [whether link(2) dereferences a symlink specified with a trailing slash],
3580 jm_ac_cv_func_link_follows_symlink,
3582 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3583 dnl the appropriate framework.
3584 test -z "$ac_cv_header_unistd_h" \
3585 && AC_CHECK_HEADERS(unistd.h)
3587 # Create a regular file.
3588 echo > conftest.file
3591 # include <sys/types.h>
3592 # include <sys/stat.h>
3593 # ifdef HAVE_UNISTD_H
3594 # include <unistd.h>
3597 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3598 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3599 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3604 const char *file = "conftest.file";
3605 const char *sym = "conftest.sym";
3606 const char *hard = "conftest.hard";
3607 struct stat sb_file, sb_hard;
3609 /* Create a symlink to the regular file. */
3610 if (symlink (file, sym))
3613 /* Create a hard link to that symlink. */
3614 if (link (sym, hard))
3617 if (lstat (hard, &sb_hard))
3619 if (lstat (file, &sb_file))
3622 /* If the dev/inode of hard and file are the same, then
3623 the link call followed the symlink. */
3624 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3627 jm_ac_cv_func_link_follows_symlink=yes,
3628 jm_ac_cv_func_link_follows_symlink=no,
3629 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3632 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3633 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3634 [Define if `link(2)' dereferences symbolic links.])
3638 # Check for fnmatch.
3640 # This is a modified version of autoconf's AC_FUNC_FNMATCH.
3641 # This file should be simplified after Autoconf 2.57 is required.
3643 # Copyright (C) 2000-2003 Free Software Foundation, Inc.
3645 # This program is free software; you can redistribute it and/or modify
3646 # it under the terms of the GNU General Public License as published by
3647 # the Free Software Foundation; either version 2, or (at your option)
3648 # any later version.
3650 # This program is distributed in the hope that it will be useful,
3651 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3652 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3653 # GNU General Public License for more details.
3655 # You should have received a copy of the GNU General Public License
3656 # along with this program; if not, write to the Free Software
3657 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3660 # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
3661 # -------------------------------------------------------------------------
3662 # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise
3663 # IF-FALSE. Use CACHE_VAR.
3664 AC_DEFUN([_AC_FUNC_FNMATCH_IF],
3666 [for working $1 fnmatch],
3668 [# Some versions of Solaris, SCO, and the GNU C Library
3669 # have a broken or incompatible fnmatch.
3670 # So we run a test program. If we are cross-compiling, take no chance.
3671 # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
3675 # include <stdlib.h>
3676 # include <fnmatch.h>
3677 # define y(a, b, c) (fnmatch (a, b, c) == 0)
3678 # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
3681 (!(y ("a*", "abc", 0)
3682 && n ("d*/*1", "d/s/1", FNM_PATHNAME)
3683 && y ("a\\\\bc", "abc", 0)
3684 && n ("a\\\\bc", "abc", FNM_NOESCAPE)
3685 && y ("*x", ".x", 0)
3686 && n ("*x", ".x", FNM_PERIOD)
3687 && m4_if([$1], [GNU],
3688 [y ("xxXX", "xXxX", FNM_CASEFOLD)
3689 && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
3690 && n ("d*/*1", "d/s/1", FNM_FILE_NAME)
3691 && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
3692 && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
3693 && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)],
3698 AS_IF([test $$2 = yes], [$3], [$4])
3699 ])# _AC_FUNC_FNMATCH_IF
3702 # _AC_LIBOBJ_FNMATCH
3703 # ------------------
3704 # Prepare the replacement of fnmatch.
3705 AC_DEFUN([_AC_LIBOBJ_FNMATCH],
3706 [AC_REQUIRE([AC_C_CONST])dnl
3707 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3708 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
3709 AC_CHECK_DECLS([getenv])
3710 AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
3711 AC_CHECK_HEADERS([wchar.h wctype.h])
3712 AC_LIBOBJ([fnmatch])
3714 AC_DEFINE(fnmatch, rpl_fnmatch,
3715 [Define to rpl_fnmatch if the replacement function should be used.])
3716 ])# _AC_LIBOBJ_FNMATCH
3719 # Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
3720 AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
3722 AC_REQUIRE([AC_HEADER_STDC])
3723 AC_CHECK_HEADERS_ONCE(string.h strings.h)
3727 AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
3730 _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix],
3731 [rm -f lib/fnmatch.h],
3732 [_AC_LIBOBJ_FNMATCH])
3733 if test $ac_cv_func_fnmatch_posix != yes; then
3734 gl_PREREQ_FNMATCH_EXTRA
3735 dnl We must choose a different name for our function, since on ELF systems
3736 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
3737 dnl compiled into a shared library.
3738 AC_DEFINE([fnmatch], [posix_fnmatch],
3739 [Define to a replacement function name for fnmatch().])
3741 AC_SUBST([FNMATCH_H])
3745 AC_DEFUN([gl_FUNC_FNMATCH_GNU],
3747 dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
3748 AC_REQUIRE([AC_GNU_SOURCE])
3751 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
3752 [rm -f lib/fnmatch.h],
3753 [_AC_LIBOBJ_FNMATCH])
3754 if test $ac_cv_func_fnmatch_gnu != yes; then
3755 gl_PREREQ_FNMATCH_EXTRA
3756 dnl We must choose a different name for our function, since on ELF systems
3757 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
3758 dnl compiled into a shared library.
3759 AC_DEFINE([fnmatch], [gnu_fnmatch],
3760 [Define to a replacement function name for fnmatch().])
3762 AC_SUBST([FNMATCH_H])
3767 dnl This macro is intended to be used solely in this file.
3768 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3769 AC_DEFUN([_jm_STRFTIME_PREREQS],
3771 dnl strftime.c uses the underyling system strftime if it exists.
3774 AC_CHECK_HEADERS_ONCE(limits.h)
3775 AC_CHECK_FUNCS_ONCE(memcpy mempcpy)
3776 AC_CHECK_FUNCS(tzset memset)
3778 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3781 AC_CHECK_FUNCS(mblen mbrlen)
3784 AC_REQUIRE([gl_TM_GMTOFF])
3785 AC_REQUIRE([gl_FUNC_TZSET_CLOBBER])
3788 dnl From Jim Meyering.
3790 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3791 [AC_REQUIRE([AC_HEADER_TIME])dnl
3793 _jm_STRFTIME_PREREQS
3795 AC_REQUIRE([AC_C_CONST])dnl
3796 AC_REQUIRE([AC_HEADER_STDC])dnl
3797 AC_CHECK_HEADERS_ONCE(sys/time.h)
3798 AC_DEFINE([my_strftime], [nstrftime],
3799 [Define to the name of the strftime replacement function.])
3802 AC_DEFUN([jm_FUNC_STRFTIME],
3804 _jm_STRFTIME_PREREQS
3807 # tm_gmtoff.m4 serial 1
3808 dnl Copyright (C) 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 AC_DEFUN([gl_TM_GMTOFF],
3817 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3818 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3819 [Define if struct tm has the tm_gmtoff member.])],
3821 [#include <time.h>])
3825 # See if we have a working tzset function.
3826 # If so, arrange to compile the wrapper function.
3827 # For at least Solaris 2.5.1 and 2.6, this is necessary
3828 # because tzset can clobber the contents of the buffer
3829 # used by localtime.
3831 # Written by Paul Eggert and Jim Meyering.
3833 AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
3835 AC_REQUIRE([AC_HEADER_TIME])
3836 AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
3837 gl_cv_func_tzset_clobber,
3839 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3840 #if TIME_WITH_SYS_TIME
3841 # include <sys/time.h>
3844 # if HAVE_SYS_TIME_H
3845 # include <sys/time.h>
3855 time_t t1 = 853958121;
3858 p = localtime (&t1);
3860 putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
3862 exit (p->tm_year != s.tm_year
3863 || p->tm_mon != s.tm_mon
3864 || p->tm_mday != s.tm_mday
3865 || p->tm_hour != s.tm_hour
3866 || p->tm_min != s.tm_min
3867 || p->tm_sec != s.tm_sec);
3870 [gl_cv_func_tzset_clobber=no],
3871 [gl_cv_func_tzset_clobber=yes],
3872 [gl_cv_func_tzset_clobber=yes])])
3874 AC_DEFINE(HAVE_RUN_TZSET_TEST, 1,
3875 [Define to 1 if you have run the test for working tzset.])
3877 if test $gl_cv_func_tzset_clobber = yes; then
3878 # Caution: the following few lines should be the same
3879 # as those in gettimeofday.m4.
3880 AC_LIBOBJ(gettimeofday)
3881 AC_DEFINE(gmtime, rpl_gmtime,
3882 [Define to rpl_gmtime if the replacement function should be used.])
3883 AC_DEFINE(localtime, rpl_localtime,
3884 [Define to rpl_localtime if the replacement function should be used.])
3886 AC_DEFINE(tzset, rpl_tzset,
3887 [Define to rpl_tzset if the wrapper function should be used.])
3888 AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1,
3889 [Define if tzset clobbers localtime's static buffer.])
3895 dnl From Jim Meyering
3896 dnl Using code from emacs, based on suggestions from Paul Eggert
3897 dnl and Ulrich Drepper.
3899 dnl Find out how to determine the number of pending output bytes on a stream.
3900 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3901 dnl we have to grub around in the FILE struct.
3903 AC_DEFUN([jm_FUNC_FPENDING],
3905 AC_CHECK_HEADERS(stdio_ext.h)
3906 AC_REPLACE_FUNCS([__fpending])
3908 # if HAVE_STDIO_EXT_H
3909 # include <stdio_ext.h>
3912 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3913 if test $ac_cv_func___fpending = no; then
3915 [how to determine the number of pending output bytes on a stream],
3916 ac_cv_sys_pending_output_n_bytes,
3921 'fp->_IO_write_ptr - fp->_IO_write_base' \
3923 '# traditional Unix' \
3924 'fp->_ptr - fp->_base' \
3927 'fp->_p - fp->_bf._base' \
3930 'fp->__ptr - fp->__base' \
3933 'fp->__bufp - fp->__buffer' \
3935 '# old glibc iostream?' \
3936 'fp->_pptr - fp->_pbase' \
3939 '(*fp)->_ptr - (*fp)->_base' \
3941 '# e.g., DGUX R4.11; the info is not available' \
3945 # Skip each embedded comment.
3946 case "$ac_expr" in '#'*) continue;; esac
3951 [FILE *fp = stdin; (void) ($ac_expr);],
3954 test "$fp_done" = yes && break
3957 ac_cv_sys_pending_output_n_bytes=$ac_expr
3960 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3961 $ac_cv_sys_pending_output_n_bytes,
3962 [the number of pending output bytes on stream `fp'])
3966 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3967 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3968 dnl This file is free software, distributed under the terms of the GNU
3969 dnl General Public License. As a special exception to the GNU General
3970 dnl Public License, this file may be distributed as part of a program
3971 dnl that contains a configuration script generated by Autoconf, under
3972 dnl the same distribution terms as the rest of that program.
3974 dnl From Bruno Haible.
3976 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3977 # macros to non-string values. This is the case on AIX 4.3.3.
3979 AC_DEFUN([gt_INTTYPES_PRI],
3981 # autoconf-2.52 has a proper check for inttypes.h.
3984 if test $ac_cv_header_inttypes_h = yes; then
3985 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3986 gt_cv_inttypes_pri_broken,
3988 AC_TRY_COMPILE([#include <inttypes.h>
3992 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3995 if test "$gt_cv_inttypes_pri_broken" = yes; then
3996 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3997 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
4003 dnl From Jim Meyering.
4004 dnl A wrapper around AC_FUNC_GETGROUPS.
4006 AC_DEFUN([jm_FUNC_GETGROUPS],
4007 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
4008 if test $ac_cv_func_getgroups_works = no; then
4009 AC_LIBOBJ(getgroups)
4010 AC_DEFINE(getgroups, rpl_getgroups,
4011 [Define as rpl_getgroups if getgroups doesn't work right.])
4013 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
4016 # alloca.m4 serial 2 (gettext-0.12)
4017 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4018 dnl This file is free software, distributed under the terms of the GNU
4019 dnl General Public License. As a special exception to the GNU General
4020 dnl Public License, this file may be distributed as part of a program
4021 dnl that contains a configuration script generated by Autoconf, under
4022 dnl the same distribution terms as the rest of that program.
4024 AC_DEFUN([gl_FUNC_ALLOCA],
4026 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
4027 AC_REQUIRE([AC_PROG_CPP])
4028 AC_REQUIRE([AC_PROG_EGREP])
4030 AC_REQUIRE([AC_FUNC_ALLOCA])
4031 if test $ac_cv_func_alloca_works = no; then
4035 # Define an additional variable used in the Makefile substitution.
4037 AC_EGREP_CPP([Need own alloca], [
4038 #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
4044 AC_SUBST([ALLOCA_H])
4047 # Prerequisites of lib/alloca.c.
4048 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
4049 AC_DEFUN([gl_PREREQ_ALLOCA], [
4050 AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
4057 AC_DEFUN([jm_SYS_PROC_UPTIME],
4058 [ dnl Require AC_PROG_CC to see if we're cross compiling.
4059 AC_REQUIRE([AC_PROG_CC])
4060 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
4061 [jm_cv_have_proc_uptime=no
4062 test -f /proc/uptime \
4063 && test "$cross_compiling" = no \
4064 && cat < /proc/uptime >/dev/null 2>/dev/null \
4065 && jm_cv_have_proc_uptime=yes])
4066 if test $jm_cv_have_proc_uptime = yes; then
4067 AC_DEFINE(HAVE_PROC_UPTIME, 1,
4068 [ Define if your system has the /proc/uptime special file.])
4074 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
4076 AC_DEFUN([jm_FUNC_FTRUNCATE],
4078 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
4080 if test "$ftruncate_missing" = yes; then
4081 AC_CHECK_HEADERS([unistd.h])
4082 AC_CHECK_FUNCS([chsize])
4083 AC_LIBOBJ(ftruncate)
4089 dnl From Volker Borchert.
4090 dnl Determine whether rename works for source paths with a trailing slash.
4091 dnl The rename from SunOS 4.1.1_U1 doesn't.
4093 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
4094 dnl to compile the wrapper function.
4097 AC_DEFUN([vb_FUNC_RENAME],
4099 AC_CACHE_CHECK([whether rename is broken],
4100 vb_cv_func_rename_trailing_slash_bug,
4102 rm -rf conftest.d1 conftest.d2
4103 mkdir conftest.d1 ||
4104 AC_MSG_ERROR([cannot create temporary directory])
4110 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
4113 vb_cv_func_rename_trailing_slash_bug=no,
4114 vb_cv_func_rename_trailing_slash_bug=yes,
4115 dnl When crosscompiling, assume rename is broken.
4116 vb_cv_func_rename_trailing_slash_bug=yes)
4118 rm -rf conftest.d1 conftest.d2
4120 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
4122 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
4123 [Define if rename does not work for source paths with a trailing slash,
4124 like the one from SunOS 4.1.1_U1.])
4130 # On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
4131 # silly limit that it can create no more than 26 files from a given template.
4132 # Other systems lack mkstemp altogether. On either type of system, arrange
4133 # to use the replacement function.
4134 AC_DEFUN([UTILS_FUNC_MKSTEMP],
4136 AC_REPLACE_FUNCS(mkstemp)
4137 if test $ac_cv_func_mkstemp = no; then
4138 utils_cv_func_mkstemp_limitations=yes
4140 AC_CACHE_CHECK([for mkstemp limitations],
4141 utils_cv_func_mkstemp_limitations,
4144 # include <stdlib.h>
4148 for (i = 0; i < 30; i++)
4150 char template[] = "conftestXXXXXX";
4151 int fd = mkstemp (template);
4159 utils_cv_func_mkstemp_limitations=no,
4160 utils_cv_func_mkstemp_limitations=yes,
4161 utils_cv_func_mkstemp_limitations=yes
4167 if test $utils_cv_func_mkstemp_limitations = yes; then
4170 AC_DEFINE(mkstemp, rpl_mkstemp,
4171 [Define to rpl_mkstemp if the replacement function should be used.])
4177 dnl From Jim Meyering.
4179 dnl See if gettimeofday clobbers the static buffer that localtime uses
4180 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
4181 dnl i.e. Darwin 1.3.7 has this problem.
4183 dnl If it does, then arrange to use gettimeofday and localtime only via
4184 dnl the wrapper functions that work around the problem.
4186 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
4188 AC_REQUIRE([AC_HEADER_TIME])
4189 AC_CHECK_HEADERS(string.h stdlib.h)
4190 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
4191 jm_cv_func_gettimeofday_clobber,
4195 # include <string.h>
4198 #if TIME_WITH_SYS_TIME
4199 # include <sys/time.h>
4202 # if HAVE_SYS_TIME_H
4203 # include <sys/time.h>
4210 # include <stdlib.h>
4220 lt = localtime (&t);
4222 gettimeofday (&tv, NULL);
4223 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
4229 jm_cv_func_gettimeofday_clobber=no,
4230 jm_cv_func_gettimeofday_clobber=yes,
4231 dnl When crosscompiling, assume it is broken.
4232 jm_cv_func_gettimeofday_clobber=yes)
4234 if test $jm_cv_func_gettimeofday_clobber = yes; then
4235 # Caution: the following few lines should be the same
4236 # as those in gettimeofday.m4.
4237 AC_LIBOBJ(gettimeofday)
4238 AC_DEFINE(gmtime, rpl_gmtime,
4239 [Define to rpl_gmtime if the replacement function should be used.])
4240 AC_DEFINE(localtime, rpl_localtime,
4241 [Define to rpl_localtime if the replacement function should be used.])
4243 AC_DEFINE(gettimeofday, rpl_gettimeofday,
4244 [Define to rpl_gettimeofday if the replacement function should be used.])
4245 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
4246 [Define if gettimeofday clobbers localtime's static buffer.])
4252 dnl From Jim Meyering
4253 dnl Replace the utime function on systems that need it.
4257 AC_DEFUN([jm_FUNC_UTIME],
4259 AC_CHECK_HEADERS(utime.h)
4260 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
4261 AC_REQUIRE([AC_FUNC_UTIME_NULL])
4263 if test $ac_cv_func_utime_null = no; then
4265 AC_REPLACE_FUNCS(utime)
4271 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
4272 dnl then do case-insensitive s/utime/utimes/.
4274 AC_DEFUN([jm_FUNC_UTIMES_NULL],
4275 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
4276 [rm -f conftest.data; > conftest.data
4278 /* In case stat has been defined to rpl_stat, undef it here. */
4280 #include <sys/types.h>
4281 #include <sys/stat.h>
4284 exit(!(stat ("conftest.data", &s) == 0
4285 && utimes("conftest.data", (long *)0) == 0
4286 && stat("conftest.data", &t) == 0
4287 && t.st_mtime >= s.st_mtime
4288 && t.st_mtime - s.st_mtime < 120));
4290 ac_cv_func_utimes_null=yes,
4291 ac_cv_func_utimes_null=no,
4292 ac_cv_func_utimes_null=no)
4293 rm -f core core.* *.core])
4295 if test $ac_cv_func_utimes_null = yes; then
4296 AC_DEFINE(HAVE_UTIMES_NULL, 1,
4297 [Define if utimes accepts a null argument])
4302 # vasprintf.m4 serial 1
4303 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4304 dnl This file is free software, distributed under the terms of the GNU
4305 dnl General Public License. As a special exception to the GNU General
4306 dnl Public License, this file may be distributed as part of a program
4307 dnl that contains a configuration script generated by Autoconf, under
4308 dnl the same distribution terms as the rest of that program.
4310 AC_DEFUN([gl_FUNC_VASPRINTF],
4312 AC_REPLACE_FUNCS(vasprintf)
4313 if test $ac_cv_func_vasprintf = no; then
4320 # Prerequisites of lib/vasprintf.c.
4321 AC_DEFUN([gl_PREREQ_VASPRINTF],
4325 # Prerequisites of lib/asprintf.c.
4326 AC_DEFUN([gl_PREREQ_ASPRINTF],
4330 # vasnprintf.m4 serial 1
4331 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4332 dnl This file is free software, distributed under the terms of the GNU
4333 dnl General Public License. As a special exception to the GNU General
4334 dnl Public License, this file may be distributed as part of a program
4335 dnl that contains a configuration script generated by Autoconf, under
4336 dnl the same distribution terms as the rest of that program.
4338 AC_DEFUN([gl_FUNC_VASNPRINTF],
4340 AC_REPLACE_FUNCS(vasnprintf)
4341 if test $ac_cv_func_vasnprintf = no; then
4342 AC_LIBOBJ(printf-args)
4343 AC_LIBOBJ(printf-parse)
4344 AC_LIBOBJ(asnprintf)
4345 gl_PREREQ_PRINTF_ARGS
4346 gl_PREREQ_PRINTF_PARSE
4347 gl_PREREQ_VASNPRINTF
4352 # Prequisites of lib/printf-args.h, lib/printf-args.c.
4353 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
4355 AC_REQUIRE([bh_C_SIGNED])
4356 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4357 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4358 AC_REQUIRE([gt_TYPE_WCHAR_T])
4359 AC_REQUIRE([gt_TYPE_WINT_T])
4362 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
4363 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
4365 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4366 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4367 AC_REQUIRE([gt_TYPE_WCHAR_T])
4368 AC_REQUIRE([gt_TYPE_WINT_T])
4369 AC_REQUIRE([AC_TYPE_SIZE_T])
4370 AC_CHECK_TYPES(ptrdiff_t)
4371 AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
4374 # Prerequisites of lib/vasnprintf.c.
4375 AC_DEFUN([gl_PREREQ_VASNPRINTF],
4377 AC_REQUIRE([AC_FUNC_ALLOCA])
4378 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4379 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4380 AC_REQUIRE([gt_TYPE_WCHAR_T])
4381 AC_REQUIRE([gt_TYPE_WINT_T])
4382 AC_CHECK_FUNCS(snprintf)
4385 # Prerequisites of lib/asnprintf.c.
4386 AC_DEFUN([gl_PREREQ_ASNPRINTF],
4390 # signed.m4 serial 1 (gettext-0.10.40)
4391 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4392 dnl This file is free software, distributed under the terms of the GNU
4393 dnl General Public License. As a special exception to the GNU General
4394 dnl Public License, this file may be distributed as part of a program
4395 dnl that contains a configuration script generated by Autoconf, under
4396 dnl the same distribution terms as the rest of that program.
4398 dnl From Bruno Haible.
4400 AC_DEFUN([bh_C_SIGNED],
4402 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
4403 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
4404 if test $bh_cv_c_signed = no; then
4406 [Define to empty if the C compiler doesn't support this keyword.])
4410 # longdouble.m4 serial 1 (gettext-0.12)
4411 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4412 dnl This file is free software, distributed under the terms of the GNU
4413 dnl General Public License. As a special exception to the GNU General
4414 dnl Public License, this file may be distributed as part of a program
4415 dnl that contains a configuration script generated by Autoconf, under
4416 dnl the same distribution terms as the rest of that program.
4418 dnl From Bruno Haible.
4419 dnl Test whether the compiler supports the 'long double' type.
4420 dnl Prerequisite: AC_PROG_CC
4422 AC_DEFUN([gt_TYPE_LONGDOUBLE],
4424 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
4425 [if test "$GCC" = yes; then
4426 gt_cv_c_long_double=yes
4429 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
4430 long double foo = 0.0;
4431 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
4432 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
4434 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
4436 if test $gt_cv_c_long_double = yes; then
4437 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
4441 # wchar_t.m4 serial 1 (gettext-0.12)
4442 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4443 dnl This file is free software, distributed under the terms of the GNU
4444 dnl General Public License. As a special exception to the GNU General
4445 dnl Public License, this file may be distributed as part of a program
4446 dnl that contains a configuration script generated by Autoconf, under
4447 dnl the same distribution terms as the rest of that program.
4449 dnl From Bruno Haible.
4450 dnl Test whether <stddef.h> has the 'wchar_t' type.
4451 dnl Prerequisite: AC_PROG_CC
4453 AC_DEFUN([gt_TYPE_WCHAR_T],
4455 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
4456 [AC_TRY_COMPILE([#include <stddef.h>
4457 wchar_t foo = (wchar_t)'\0';], ,
4458 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
4459 if test $gt_cv_c_wchar_t = yes; then
4460 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
4464 # wint_t.m4 serial 1 (gettext-0.12)
4465 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4466 dnl This file is free software, distributed under the terms of the GNU
4467 dnl General Public License. As a special exception to the GNU General
4468 dnl Public License, this file may be distributed as part of a program
4469 dnl that contains a configuration script generated by Autoconf, under
4470 dnl the same distribution terms as the rest of that program.
4472 dnl From Bruno Haible.
4473 dnl Test whether <wchar.h> has the 'wint_t' type.
4474 dnl Prerequisite: AC_PROG_CC
4476 AC_DEFUN([gt_TYPE_WINT_T],
4478 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
4479 [AC_TRY_COMPILE([#include <wchar.h>
4480 wint_t foo = (wchar_t)'\0';], ,
4481 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
4482 if test $gt_cv_c_wint_t = yes; then
4483 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
4487 # getline.m4 serial 9
4489 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
4490 dnl Foundation, Inc.
4492 dnl This file is free software, distributed under the terms of the GNU
4493 dnl General Public License. As a special exception to the GNU General
4494 dnl Public License, this file may be distributed as part of a program
4495 dnl that contains a configuration script generated by Autoconf, under
4496 dnl the same distribution terms as the rest of that program.
4500 dnl See if there's a working, system-supplied version of the getline function.
4501 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
4502 dnl have a function by that name in -linet that doesn't have anything
4503 dnl to do with the function we need.
4504 AC_DEFUN([AM_FUNC_GETLINE],
4506 dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
4507 AC_REQUIRE([AC_GNU_SOURCE])
4509 am_getline_needs_run_time_check=no
4510 AC_CHECK_FUNC(getline,
4511 dnl Found it in some library. Verify that it works.
4512 am_getline_needs_run_time_check=yes,
4513 am_cv_func_working_getline=no)
4514 if test $am_getline_needs_run_time_check = yes; then
4515 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
4516 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
4519 # include <stdlib.h>
4520 # include <string.h>
4522 { /* Based on a test program from Karl Heuer. */
4526 FILE *in = fopen ("./conftest.data", "r");
4529 len = getline (&line, &siz, in);
4530 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
4532 ], am_cv_func_working_getline=yes dnl The library version works.
4533 , am_cv_func_working_getline=no dnl The library version does NOT work.
4534 , am_cv_func_working_getline=no dnl We're cross compiling.
4538 if test $am_cv_func_working_getline = no; then
4539 dnl We must choose a different name for our function, since on ELF systems
4540 dnl a broken getline() in libc.so would override our getline() in
4541 dnl libgettextlib.so.
4542 AC_DEFINE([getline], [gnu_getline],
4543 [Define to a replacement function name for getline().])
4546 gl_PREREQ_GETNDELIM2
4550 # Prerequisites of lib/getline.c.
4551 AC_DEFUN([gl_PREREQ_GETLINE],
4553 AC_CHECK_FUNCS(getdelim)
4556 # getndelim2.m4 serial 1
4557 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4558 dnl This file is free software, distributed under the terms of the GNU
4559 dnl General Public License. As a special exception to the GNU General
4560 dnl Public License, this file may be distributed as part of a program
4561 dnl that contains a configuration script generated by Autoconf, under
4562 dnl the same distribution terms as the rest of that program.
4564 AC_DEFUN([gl_GETNDELIM2],
4566 gl_PREREQ_GETNDELIM2
4569 # Prerequisites of lib/getndelim2.h and lib/getndelim2.c.
4570 AC_DEFUN([gl_PREREQ_GETNDELIM2],
4572 dnl Prerequisites of lib/getndelim2.h.
4573 AC_REQUIRE([gt_TYPE_SSIZE_T])
4574 dnl Prerequisites of lib/getndelim2.c.
4575 AC_REQUIRE([AC_HEADER_STDC])
4578 # ssize_t.m4 serial 3 (gettext-0.12.2)
4579 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
4580 dnl This file is free software, distributed under the terms of the GNU
4581 dnl General Public License. As a special exception to the GNU General
4582 dnl Public License, this file may be distributed as part of a program
4583 dnl that contains a configuration script generated by Autoconf, under
4584 dnl the same distribution terms as the rest of that program.
4586 dnl From Bruno Haible.
4587 dnl Test whether ssize_t is defined.
4589 AC_DEFUN([gt_TYPE_SSIZE_T],
4591 AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t,
4592 [AC_TRY_COMPILE([#include <sys/types.h>],
4593 [int x = sizeof (ssize_t *) + sizeof (ssize_t);],
4594 gt_cv_ssize_t=yes, gt_cv_ssize_t=no)])
4595 if test $gt_cv_ssize_t = no; then
4596 AC_DEFINE(ssize_t, int,
4597 [Define as a signed type of the same size as size_t.])
4602 # Determine approximately how many files may be open simultaneously
4603 # in one process. This is approximate, since while running this test,
4604 # the configure script already has a few files open.
4607 AC_DEFUN([UTILS_SYS_OPEN_MAX],
4609 AC_CACHE_CHECK([determine how many files may be open simultaneously],
4610 utils_cv_sys_open_max,
4612 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4619 FILE *result = fopen ("conftest.omax", "w");
4621 /* Impose an arbitrary limit, in case some system has no
4622 effective limit on the number of simultaneously open files. */
4625 FILE *s = fopen ("conftest.op", "w");
4630 fprintf (result, "%d\n", i);
4631 exit (fclose (result) == EOF);
4634 [utils_cv_sys_open_max=`cat conftest.omax`],
4635 [utils_cv_sys_open_max='internal error in open-max.m4'],
4636 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
4638 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
4639 $utils_cv_sys_open_max,
4640 [the maximum number of simultaneously open files per process])
4644 # Check whether getcwd has the bug that it succeeds for a working directory
4645 # longer than PATH_MAX, yet returns a truncated directory name.
4646 # If so, arrange to compile the wrapper function.
4648 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
4649 # I've heard that this is due to a Linux kernel bug, and that it has
4650 # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */
4654 AC_DEFUN([GL_FUNC_GETCWD_PATH_MAX],
4656 AC_CHECK_DECLS([getcwd])
4657 AC_CACHE_CHECK([whether getcwd properly handles paths longer than PATH_MAX],
4658 gl_cv_func_getcwd_vs_path_max,
4660 # Arrange for deletion of the temporary directory this test creates.
4661 ac_clean_files="$ac_clean_files confdir3"
4662 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4667 #include <sys/stat.h>
4668 #include <sys/types.h>
4670 /* Don't get link errors because mkdir is redefined to rpl_mkdir. */
4677 /* The extra casts work around common compiler bugs. */
4678 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
4679 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
4680 It is necessary at least when t == time_t. */
4681 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
4682 ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
4683 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
4686 # define INT_MAX TYPE_MAXIMUM (int)
4689 /* The length of this name must be 8. */
4690 #define DIR_NAME "confdir3"
4696 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
4697 at least not on a local file system. And if we were to start worrying
4698 about remote file systems, we'd have to enable the wrapper function
4699 all of the time, just to be safe. That's not worth the cost. */
4701 #elif INT_MAX - 9 <= PATH_MAX
4702 /* The '9', above, comes from strlen (DIR_NAME) + 1. */
4703 /* FIXME: Assuming there's a system for which this is true,
4704 this should be done in a compile test. */
4707 char buf[PATH_MAX + 20];
4708 char *cwd = getcwd (buf, PATH_MAX);
4711 size_t n_chdirs = 0;
4716 cwd_len = strlen (cwd);
4723 cwd_len += 1 + strlen (DIR_NAME);
4724 /* If mkdir or chdir fails, be pessimistic and consider that
4725 as a failure, too. */
4726 if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0)
4731 if ((c = getcwd (buf, PATH_MAX)) == NULL)
4733 /* This allows any failure to indicate there is no bug.
4734 FIXME: check errno? */
4737 if ((len = strlen (c)) != cwd_len)
4747 /* Leaving behind such a deep directory is not polite.
4748 So clean up here, right away, even though the driving
4749 shell script would also clean up. */
4753 /* Unlink first, in case the chdir failed. */
4755 for (i = 0; i <= n_chdirs; i++)
4757 if (chdir ("..") < 0)
4767 [gl_cv_func_getcwd_vs_path_max=yes],
4768 [gl_cv_func_getcwd_vs_path_max=no],
4769 [gl_cv_func_getcwd_vs_path_max=no])])
4771 if test $gl_cv_func_getcwd_vs_path_max = yes; then
4773 AC_DEFINE(getcwd, rpl_getcwd,
4774 [Define to rpl_getcwd if the wrapper function should be used.])
4780 dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
4781 dnl to test whether a NULL return value really means there are no more files
4782 dnl in the directory.
4784 dnl And the rm from coreutils-5.0 exposes a similar problem when there
4785 dnl are 338 or more files in a directory on a Darwin-6.5 system
4787 dnl Detect the problem by creating a directory containing 500 files (254 not
4788 dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
4789 dnl if a loop doing `readdir; unlink' removes all of them.
4791 dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
4793 dnl Written by Jim Meyering.
4795 AC_DEFUN([GL_FUNC_READDIR],
4797 AC_REQUIRE([AC_HEADER_DIRENT])
4798 AC_CHECK_HEADERS(string.h)
4799 AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
4801 # Arrange for deletion of the temporary directory this test creates, in
4802 # case the test itself fails to delete everything -- as happens on Sunos.
4803 ac_clean_files="$ac_clean_files conf-dir"
4806 [# include <stdio.h>
4807 # include <sys/types.h>
4809 # include <string.h>
4812 # ifdef HAVE_DIRENT_H
4813 # include <dirent.h>
4814 # define NLENGTH(direct) (strlen((direct)->d_name))
4815 # else /* not HAVE_DIRENT_H */
4816 # define dirent direct
4817 # define NLENGTH(direct) ((direct)->d_namlen)
4818 # ifdef HAVE_SYS_NDIR_H
4819 # include <sys/ndir.h>
4820 # endif /* HAVE_SYS_NDIR_H */
4821 # ifdef HAVE_SYS_DIR_H
4822 # include <sys/dir.h>
4823 # endif /* HAVE_SYS_DIR_H */
4826 # endif /* HAVE_NDIR_H */
4827 # endif /* HAVE_DIRENT_H */
4829 # define DOT_OR_DOTDOT(Basename) \
4830 (Basename[0] == '.' && (Basename[1] == '\0' \
4831 || (Basename[1] == '.' && Basename[2] == '\0')))
4833 /* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
4837 create_N_file_dir (const char *dir, size_t n_files)
4841 if (mkdir (dir, 0700))
4846 for (i = 0; i < n_files; i++)
4851 sprintf (file_name, "%03d", i);
4852 out = fopen (file_name, "w");
4855 if (fclose (out) == EOF)
4864 remove_dir (const char *dir)
4871 dirp = opendir (".");
4877 struct dirent *dp = readdir (dirp);
4881 if (DOT_OR_DOTDOT (dp->d_name))
4884 if (unlink (dp->d_name))
4899 const char *dir = "conf-dir";
4900 create_N_file_dir (dir, 500);
4904 gl_cv_func_working_readdir=yes,
4905 gl_cv_func_working_readdir=no,
4906 gl_cv_func_working_readdir=no)])
4908 if test $gl_cv_func_working_readdir = yes; then
4909 AC_DEFINE(HAVE_WORKING_READDIR, 1,
4910 [Define if readdir is found to work properly in some unusual cases. ])
4914 # codeset.m4 serial AM1 (gettext-0.10.40)
4915 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4916 dnl This file is free software, distributed under the terms of the GNU
4917 dnl General Public License. As a special exception to the GNU General
4918 dnl Public License, this file may be distributed as part of a program
4919 dnl that contains a configuration script generated by Autoconf, under
4920 dnl the same distribution terms as the rest of that program.
4922 dnl From Bruno Haible.
4924 AC_DEFUN([AM_LANGINFO_CODESET],
4926 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
4927 [AC_TRY_LINK([#include <langinfo.h>],
4928 [char* cs = nl_langinfo(CODESET);],
4929 am_cv_langinfo_codeset=yes,
4930 am_cv_langinfo_codeset=no)
4932 if test $am_cv_langinfo_codeset = yes; then
4933 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
4934 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
4938 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
4939 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4940 dnl This file is free software, distributed under the terms of the GNU
4941 dnl General Public License. As a special exception to the GNU General
4942 dnl Public License, this file may be distributed as part of a program
4943 dnl that contains a configuration script generated by Autoconf, under
4944 dnl the same distribution terms as the rest of that program.
4946 # Test for the GNU C Library, version 2.1 or newer.
4947 # From Bruno Haible.
4949 AC_DEFUN([jm_GLIBC21],
4951 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
4952 ac_cv_gnu_library_2_1,
4953 [AC_EGREP_CPP([Lucky GNU user],
4955 #include <features.h>
4956 #ifdef __GNU_LIBRARY__
4957 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
4962 ac_cv_gnu_library_2_1=yes,
4963 ac_cv_gnu_library_2_1=no)
4967 GLIBC21="$ac_cv_gnu_library_2_1"
4971 # iconv.m4 serial AM4 (gettext-0.11.3)
4972 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4973 dnl This file is free software, distributed under the terms of the GNU
4974 dnl General Public License. As a special exception to the GNU General
4975 dnl Public License, this file may be distributed as part of a program
4976 dnl that contains a configuration script generated by Autoconf, under
4977 dnl the same distribution terms as the rest of that program.
4979 dnl From Bruno Haible.
4981 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4983 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4984 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4985 AC_REQUIRE([AC_LIB_RPATH])
4987 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4989 AC_LIB_LINKFLAGS_BODY([iconv])
4992 AC_DEFUN([AM_ICONV_LINK],
4994 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4995 dnl those with the standalone portable GNU libiconv installed).
4997 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4999 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5001 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
5002 dnl because if the user has installed libiconv and not disabled its use
5003 dnl via --without-libiconv-prefix, he wants to use it. The first
5004 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
5005 am_save_CPPFLAGS="$CPPFLAGS"
5006 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
5008 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
5009 am_cv_func_iconv="no, consider installing GNU libiconv"
5011 AC_TRY_LINK([#include <stdlib.h>
5012 #include <iconv.h>],
5013 [iconv_t cd = iconv_open("","");
5014 iconv(cd,NULL,NULL,NULL,NULL);
5016 am_cv_func_iconv=yes)
5017 if test "$am_cv_func_iconv" != yes; then
5018 am_save_LIBS="$LIBS"
5019 LIBS="$LIBS $LIBICONV"
5020 AC_TRY_LINK([#include <stdlib.h>
5021 #include <iconv.h>],
5022 [iconv_t cd = iconv_open("","");
5023 iconv(cd,NULL,NULL,NULL,NULL);
5026 am_cv_func_iconv=yes)
5027 LIBS="$am_save_LIBS"
5030 if test "$am_cv_func_iconv" = yes; then
5031 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
5033 if test "$am_cv_lib_iconv" = yes; then
5034 AC_MSG_CHECKING([how to link with libiconv])
5035 AC_MSG_RESULT([$LIBICONV])
5037 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
5039 CPPFLAGS="$am_save_CPPFLAGS"
5044 AC_SUBST(LTLIBICONV)
5047 AC_DEFUN([AM_ICONV],
5050 if test "$am_cv_func_iconv" = yes; then
5051 AC_MSG_CHECKING([for iconv declaration])
5052 AC_CACHE_VAL(am_cv_proto_iconv, [
5060 #if defined(__STDC__) || defined(__cplusplus)
5061 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
5065 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
5066 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);"])
5067 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
5068 AC_MSG_RESULT([$]{ac_t:-
5069 }[$]am_cv_proto_iconv)
5070 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
5071 [Define as const if the declaration of iconv() needs const.])
5075 # lib-prefix.m4 serial 1 (gettext-0.11)
5076 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5077 dnl This file is free software, distributed under the terms of the GNU
5078 dnl General Public License. As a special exception to the GNU General
5079 dnl Public License, this file may be distributed as part of a program
5080 dnl that contains a configuration script generated by Autoconf, under
5081 dnl the same distribution terms as the rest of that program.
5083 dnl From Bruno Haible.
5085 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
5086 dnl to access previously installed libraries. The basic assumption is that
5087 dnl a user will want packages to use other packages he previously installed
5088 dnl with the same --prefix option.
5089 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
5090 dnl libraries, but is otherwise very convenient.
5091 AC_DEFUN([AC_LIB_PREFIX],
5093 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
5094 AC_REQUIRE([AC_PROG_CC])
5095 AC_REQUIRE([AC_CANONICAL_HOST])
5096 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5097 dnl By default, look in $includedir and $libdir.
5099 AC_LIB_WITH_FINAL_PREFIX([
5100 eval additional_includedir=\"$includedir\"
5101 eval additional_libdir=\"$libdir\"
5103 AC_ARG_WITH([lib-prefix],
5104 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
5105 --without-lib-prefix don't search for libraries in includedir and libdir],
5107 if test "X$withval" = "Xno"; then
5110 if test "X$withval" = "X"; then
5111 AC_LIB_WITH_FINAL_PREFIX([
5112 eval additional_includedir=\"$includedir\"
5113 eval additional_libdir=\"$libdir\"
5116 additional_includedir="$withval/include"
5117 additional_libdir="$withval/lib"
5121 if test $use_additional = yes; then
5122 dnl Potentially add $additional_includedir to $CPPFLAGS.
5123 dnl But don't add it
5124 dnl 1. if it's the standard /usr/include,
5125 dnl 2. if it's already present in $CPPFLAGS,
5126 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
5127 dnl 4. if it doesn't exist as a directory.
5128 if test "X$additional_includedir" != "X/usr/include"; then
5130 for x in $CPPFLAGS; do
5131 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5132 if test "X$x" = "X-I$additional_includedir"; then
5137 if test -z "$haveit"; then
5138 if test "X$additional_includedir" = "X/usr/local/include"; then
5139 if test -n "$GCC"; then
5141 linux*) haveit=yes;;
5145 if test -z "$haveit"; then
5146 if test -d "$additional_includedir"; then
5147 dnl Really add $additional_includedir to $CPPFLAGS.
5148 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
5153 dnl Potentially add $additional_libdir to $LDFLAGS.
5154 dnl But don't add it
5155 dnl 1. if it's the standard /usr/lib,
5156 dnl 2. if it's already present in $LDFLAGS,
5157 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
5158 dnl 4. if it doesn't exist as a directory.
5159 if test "X$additional_libdir" != "X/usr/lib"; then
5161 for x in $LDFLAGS; do
5162 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5163 if test "X$x" = "X-L$additional_libdir"; then
5168 if test -z "$haveit"; then
5169 if test "X$additional_libdir" = "X/usr/local/lib"; then
5170 if test -n "$GCC"; then
5172 linux*) haveit=yes;;
5176 if test -z "$haveit"; then
5177 if test -d "$additional_libdir"; then
5178 dnl Really add $additional_libdir to $LDFLAGS.
5179 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
5187 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
5188 dnl acl_final_exec_prefix, containing the values to which $prefix and
5189 dnl $exec_prefix will expand at the end of the configure script.
5190 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
5192 dnl Unfortunately, prefix and exec_prefix get only finally determined
5193 dnl at the end of configure.
5194 if test "X$prefix" = "XNONE"; then
5195 acl_final_prefix="$ac_default_prefix"
5197 acl_final_prefix="$prefix"
5199 if test "X$exec_prefix" = "XNONE"; then
5200 acl_final_exec_prefix='${prefix}'
5202 acl_final_exec_prefix="$exec_prefix"
5204 acl_save_prefix="$prefix"
5205 prefix="$acl_final_prefix"
5206 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
5207 prefix="$acl_save_prefix"
5210 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
5211 dnl variables prefix and exec_prefix bound to the values they will have
5212 dnl at the end of the configure script.
5213 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
5215 acl_save_prefix="$prefix"
5216 prefix="$acl_final_prefix"
5217 acl_save_exec_prefix="$exec_prefix"
5218 exec_prefix="$acl_final_exec_prefix"
5220 exec_prefix="$acl_save_exec_prefix"
5221 prefix="$acl_save_prefix"
5224 # lib-link.m4 serial 3 (gettext-0.11.3)
5225 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5226 dnl This file is free software, distributed under the terms of the GNU
5227 dnl General Public License. As a special exception to the GNU General
5228 dnl Public License, this file may be distributed as part of a program
5229 dnl that contains a configuration script generated by Autoconf, under
5230 dnl the same distribution terms as the rest of that program.
5232 dnl From Bruno Haible.
5234 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
5235 dnl the libraries corresponding to explicit and implicit dependencies.
5236 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
5237 dnl augments the CPPFLAGS variable.
5238 AC_DEFUN([AC_LIB_LINKFLAGS],
5240 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5241 AC_REQUIRE([AC_LIB_RPATH])
5242 define([Name],[translit([$1],[./-], [___])])
5243 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5244 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5245 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
5246 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5247 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
5248 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
5249 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
5251 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
5252 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
5253 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
5254 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5256 AC_SUBST([LTLIB]NAME)
5257 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
5258 dnl results of this search when this library appears as a dependency.
5264 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
5265 dnl searches for libname and the libraries corresponding to explicit and
5266 dnl implicit dependencies, together with the specified include files and
5267 dnl the ability to compile and link the specified testcode. If found, it
5268 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
5269 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
5270 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
5271 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
5272 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
5274 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5275 AC_REQUIRE([AC_LIB_RPATH])
5276 define([Name],[translit([$1],[./-], [___])])
5277 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5278 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5280 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
5282 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5284 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
5285 dnl because if the user has installed lib[]Name and not disabled its use
5286 dnl via --without-lib[]Name-prefix, he wants to use it.
5287 ac_save_CPPFLAGS="$CPPFLAGS"
5288 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5290 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5291 ac_save_LIBS="$LIBS"
5292 LIBS="$LIBS $LIB[]NAME"
5293 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5294 LIBS="$ac_save_LIBS"
5296 if test "$ac_cv_lib[]Name" = yes; then
5298 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5299 AC_MSG_CHECKING([how to link with lib[]$1])
5300 AC_MSG_RESULT([$LIB[]NAME])
5303 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5304 dnl $INC[]NAME either.
5305 CPPFLAGS="$ac_save_CPPFLAGS"
5309 AC_SUBST([HAVE_LIB]NAME)
5311 AC_SUBST([LTLIB]NAME)
5316 dnl Determine the platform dependent parameters needed to use rpath:
5317 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5318 dnl hardcode_direct, hardcode_minus_L,
5319 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5320 AC_DEFUN([AC_LIB_RPATH],
5322 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
5323 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
5324 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
5325 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5326 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5327 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5328 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5334 libext="$acl_cv_libext"
5335 shlibext="$acl_cv_shlibext"
5336 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5337 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5338 hardcode_direct="$acl_cv_hardcode_direct"
5339 hardcode_minus_L="$acl_cv_hardcode_minus_L"
5340 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5341 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5342 dnl Determine whether the user wants rpath handling at all.
5343 AC_ARG_ENABLE(rpath,
5344 [ --disable-rpath do not hardcode runtime library paths],
5345 :, enable_rpath=yes)
5348 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5349 dnl the libraries corresponding to explicit and implicit dependencies.
5350 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5351 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5353 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5354 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5355 dnl By default, look in $includedir and $libdir.
5357 AC_LIB_WITH_FINAL_PREFIX([
5358 eval additional_includedir=\"$includedir\"
5359 eval additional_libdir=\"$libdir\"
5361 AC_ARG_WITH([lib$1-prefix],
5362 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
5363 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
5365 if test "X$withval" = "Xno"; then
5368 if test "X$withval" = "X"; then
5369 AC_LIB_WITH_FINAL_PREFIX([
5370 eval additional_includedir=\"$includedir\"
5371 eval additional_libdir=\"$libdir\"
5374 additional_includedir="$withval/include"
5375 additional_libdir="$withval/lib"
5379 dnl Search the library and its dependencies in $additional_libdir and
5380 dnl $LDFLAGS. Using breadth-first-seach.
5386 names_already_handled=
5387 names_next_round='$1 $2'
5388 while test -n "$names_next_round"; do
5389 names_this_round="$names_next_round"
5391 for name in $names_this_round; do
5393 for n in $names_already_handled; do
5394 if test "$n" = "$name"; then
5399 if test -z "$already_handled"; then
5400 names_already_handled="$names_already_handled $name"
5401 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5402 dnl or AC_LIB_HAVE_LINKFLAGS call.
5403 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5404 eval value=\"\$HAVE_LIB$uppername\"
5405 if test -n "$value"; then
5406 if test "$value" = yes; then
5407 eval value=\"\$LIB$uppername\"
5408 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5409 eval value=\"\$LTLIB$uppername\"
5410 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5412 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5413 dnl that this library doesn't exist. So just drop it.
5417 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5418 dnl and the already constructed $LIBNAME/$LTLIBNAME.
5423 if test $use_additional = yes; then
5424 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5425 found_dir="$additional_libdir"
5426 found_so="$additional_libdir/lib$name.$shlibext"
5427 if test -f "$additional_libdir/lib$name.la"; then
5428 found_la="$additional_libdir/lib$name.la"
5431 if test -f "$additional_libdir/lib$name.$libext"; then
5432 found_dir="$additional_libdir"
5433 found_a="$additional_libdir/lib$name.$libext"
5434 if test -f "$additional_libdir/lib$name.la"; then
5435 found_la="$additional_libdir/lib$name.la"
5440 if test "X$found_dir" = "X"; then
5441 for x in $LDFLAGS $LTLIB[]NAME; do
5442 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5445 dir=`echo "X$x" | sed -e 's/^X-L//'`
5446 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5448 found_so="$dir/lib$name.$shlibext"
5449 if test -f "$dir/lib$name.la"; then
5450 found_la="$dir/lib$name.la"
5453 if test -f "$dir/lib$name.$libext"; then
5455 found_a="$dir/lib$name.$libext"
5456 if test -f "$dir/lib$name.la"; then
5457 found_la="$dir/lib$name.la"
5463 if test "X$found_dir" != "X"; then
5468 if test "X$found_dir" != "X"; then
5469 dnl Found the library.
5470 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5471 if test "X$found_so" != "X"; then
5472 dnl Linking with a shared library. We attempt to hardcode its
5473 dnl directory into the executable's runpath, unless it's the
5474 dnl standard /usr/lib.
5475 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5476 dnl No hardcoding is needed.
5477 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5479 dnl Use an explicit option to hardcode DIR into the resulting
5481 dnl Potentially add DIR to ltrpathdirs.
5482 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5484 for x in $ltrpathdirs; do
5485 if test "X$x" = "X$found_dir"; then
5490 if test -z "$haveit"; then
5491 ltrpathdirs="$ltrpathdirs $found_dir"
5493 dnl The hardcoding into $LIBNAME is system dependent.
5494 if test "$hardcode_direct" = yes; then
5495 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5496 dnl resulting binary.
5497 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5499 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5500 dnl Use an explicit option to hardcode DIR into the resulting
5502 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5503 dnl Potentially add DIR to rpathdirs.
5504 dnl The rpathdirs will be appended to $LIBNAME at the end.
5506 for x in $rpathdirs; do
5507 if test "X$x" = "X$found_dir"; then
5512 if test -z "$haveit"; then
5513 rpathdirs="$rpathdirs $found_dir"
5516 dnl Rely on "-L$found_dir".
5517 dnl But don't add it if it's already contained in the LDFLAGS
5518 dnl or the already constructed $LIBNAME
5520 for x in $LDFLAGS $LIB[]NAME; do
5521 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5522 if test "X$x" = "X-L$found_dir"; then
5527 if test -z "$haveit"; then
5528 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5530 if test "$hardcode_minus_L" != no; then
5531 dnl FIXME: Not sure whether we should use
5532 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5534 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5536 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5537 dnl here, because this doesn't fit in flags passed to the
5538 dnl compiler. So give up. No hardcoding. This affects only
5539 dnl very old systems.
5540 dnl FIXME: Not sure whether we should use
5541 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5543 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5549 if test "X$found_a" != "X"; then
5550 dnl Linking with a static library.
5551 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5553 dnl We shouldn't come here, but anyway it's good to have a
5555 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5558 dnl Assume the include files are nearby.
5559 additional_includedir=
5560 case "$found_dir" in
5562 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5563 additional_includedir="$basedir/include"
5566 if test "X$additional_includedir" != "X"; then
5567 dnl Potentially add $additional_includedir to $INCNAME.
5568 dnl But don't add it
5569 dnl 1. if it's the standard /usr/include,
5570 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
5571 dnl 3. if it's already present in $CPPFLAGS or the already
5572 dnl constructed $INCNAME,
5573 dnl 4. if it doesn't exist as a directory.
5574 if test "X$additional_includedir" != "X/usr/include"; then
5576 if test "X$additional_includedir" = "X/usr/local/include"; then
5577 if test -n "$GCC"; then
5579 linux*) haveit=yes;;
5583 if test -z "$haveit"; then
5584 for x in $CPPFLAGS $INC[]NAME; do
5585 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5586 if test "X$x" = "X-I$additional_includedir"; then
5591 if test -z "$haveit"; then
5592 if test -d "$additional_includedir"; then
5593 dnl Really add $additional_includedir to $INCNAME.
5594 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5600 dnl Look for dependencies.
5601 if test -n "$found_la"; then
5602 dnl Read the .la file. It defines the variables
5603 dnl dlname, library_names, old_library, dependency_libs, current,
5604 dnl age, revision, installed, dlopen, dlpreopen, libdir.
5605 save_libdir="$libdir"
5607 */* | *\\*) . "$found_la" ;;
5608 *) . "./$found_la" ;;
5610 libdir="$save_libdir"
5611 dnl We use only dependency_libs.
5612 for dep in $dependency_libs; do
5615 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5616 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5617 dnl But don't add it
5618 dnl 1. if it's the standard /usr/lib,
5619 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
5620 dnl 3. if it's already present in $LDFLAGS or the already
5621 dnl constructed $LIBNAME,
5622 dnl 4. if it doesn't exist as a directory.
5623 if test "X$additional_libdir" != "X/usr/lib"; then
5625 if test "X$additional_libdir" = "X/usr/local/lib"; then
5626 if test -n "$GCC"; then
5628 linux*) haveit=yes;;
5632 if test -z "$haveit"; then
5634 for x in $LDFLAGS $LIB[]NAME; do
5635 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5636 if test "X$x" = "X-L$additional_libdir"; then
5641 if test -z "$haveit"; then
5642 if test -d "$additional_libdir"; then
5643 dnl Really add $additional_libdir to $LIBNAME.
5644 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5648 for x in $LDFLAGS $LTLIB[]NAME; do
5649 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5650 if test "X$x" = "X-L$additional_libdir"; then
5655 if test -z "$haveit"; then
5656 if test -d "$additional_libdir"; then
5657 dnl Really add $additional_libdir to $LTLIBNAME.
5658 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5665 dir=`echo "X$dep" | sed -e 's/^X-R//'`
5666 if test "$enable_rpath" != no; then
5667 dnl Potentially add DIR to rpathdirs.
5668 dnl The rpathdirs will be appended to $LIBNAME at the end.
5670 for x in $rpathdirs; do
5671 if test "X$x" = "X$dir"; then
5676 if test -z "$haveit"; then
5677 rpathdirs="$rpathdirs $dir"
5679 dnl Potentially add DIR to ltrpathdirs.
5680 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5682 for x in $ltrpathdirs; do
5683 if test "X$x" = "X$dir"; then
5688 if test -z "$haveit"; then
5689 ltrpathdirs="$ltrpathdirs $dir"
5694 dnl Handle this in the next round.
5695 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5698 dnl Handle this in the next round. Throw away the .la's
5699 dnl directory; it is already contained in a preceding -L
5701 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5704 dnl Most likely an immediate library name.
5705 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5706 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5712 dnl Didn't find the library; assume it is in the system directories
5713 dnl known to the linker and runtime loader. (All the system
5714 dnl directories known to the linker should also be known to the
5715 dnl runtime loader, otherwise the system is severely misconfigured.)
5716 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5717 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5723 if test "X$rpathdirs" != "X"; then
5724 if test -n "$hardcode_libdir_separator"; then
5725 dnl Weird platform: only the last -rpath option counts, the user must
5726 dnl pass all path elements in one option. We can arrange that for a
5727 dnl single library, but not when more than one $LIBNAMEs are used.
5729 for found_dir in $rpathdirs; do
5730 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5732 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5733 acl_save_libdir="$libdir"
5735 eval flag=\"$hardcode_libdir_flag_spec\"
5736 libdir="$acl_save_libdir"
5737 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5739 dnl The -rpath options are cumulative.
5740 for found_dir in $rpathdirs; do
5741 acl_save_libdir="$libdir"
5743 eval flag=\"$hardcode_libdir_flag_spec\"
5744 libdir="$acl_save_libdir"
5745 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5749 if test "X$ltrpathdirs" != "X"; then
5750 dnl When using libtool, the option that works for both libraries and
5751 dnl executables is -R. The -R options are cumulative.
5752 for found_dir in $ltrpathdirs; do
5753 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5758 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5759 dnl unless already present in VAR.
5760 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5761 dnl contains two or three consecutive elements that belong together.
5762 AC_DEFUN([AC_LIB_APPENDTOVAR],
5764 for element in [$2]; do
5767 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5768 if test "X$x" = "X$element"; then
5773 if test -z "$haveit"; then
5774 [$1]="${[$1]}${[$1]:+ }$element"
5779 # lib-ld.m4 serial 2
5780 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
5781 dnl This file is free software, distributed under the terms of the GNU
5782 dnl General Public License. As a special exception to the GNU General
5783 dnl Public License, this file may be distributed as part of a program
5784 dnl that contains a configuration script generated by Autoconf, under
5785 dnl the same distribution terms as the rest of that program.
5787 dnl Subroutines of libtool.m4,
5788 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5789 dnl with libtool.m4.
5791 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5792 AC_DEFUN([AC_LIB_PROG_LD_GNU],
5793 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5794 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5795 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5796 acl_cv_prog_gnu_ld=yes
5798 acl_cv_prog_gnu_ld=no
5800 with_gnu_ld=$acl_cv_prog_gnu_ld
5803 dnl From libtool-1.4. Sets the variable LD.
5804 AC_DEFUN([AC_LIB_PROG_LD],
5805 [AC_ARG_WITH(gnu-ld,
5806 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5807 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5808 AC_REQUIRE([AC_PROG_CC])dnl
5809 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5811 if test "$GCC" = yes; then
5812 # Check if gcc -print-prog-name=ld gives a path.
5813 AC_MSG_CHECKING([for ld used by GCC])
5816 # gcc leaves a trailing carriage return which upsets mingw
5817 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5819 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5822 # Accept absolute paths.
5823 [[\\/]* | [A-Za-z]:[\\/]*)]
5824 [re_direlt='/[^/][^/]*/\.\./']
5825 # Canonicalize the path of ld
5826 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5827 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5828 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5830 test -z "$LD" && LD="$ac_prog"
5833 # If it fails, then pretend we aren't using GCC.
5837 # If it is relative, then search for the first ld in PATH.
5841 elif test "$with_gnu_ld" = yes; then
5842 AC_MSG_CHECKING([for GNU ld])
5844 AC_MSG_CHECKING([for non-GNU ld])
5846 AC_CACHE_VAL(acl_cv_path_LD,
5847 [if test -z "$LD"; then
5848 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5849 for ac_dir in $PATH; do
5850 test -z "$ac_dir" && ac_dir=.
5851 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5852 acl_cv_path_LD="$ac_dir/$ac_prog"
5853 # Check to see if the program is GNU ld. I'd rather use --version,
5854 # but apparently some GNU ld's only accept -v.
5855 # Break only if it was the GNU/non-GNU ld that we prefer.
5856 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5857 test "$with_gnu_ld" != no && break
5859 test "$with_gnu_ld" != yes && break
5865 acl_cv_path_LD="$LD" # Let the user override the test with a path.
5867 LD="$acl_cv_path_LD"
5868 if test -n "$LD"; then
5873 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5879 dnl From J. David Anglin.
5881 dnl HPUX and other systems can't unlink shared text that is being executed.
5883 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
5885 AC_CACHE_CHECK([whether a running program can be unlinked],
5886 jm_cv_func_unlink_busy_text,
5895 exit (unlink (argv[0]));
5898 jm_cv_func_unlink_busy_text=yes,
5899 jm_cv_func_unlink_busy_text=no,
5900 jm_cv_func_unlink_busy_text=no
5905 if test $jm_cv_func_unlink_busy_text = no; then
5906 INSTALL=$ac_install_sh
5912 dnl From Jim Meyering.
5914 dnl This is not pretty. I've just taken the autoconf code and wrapped
5915 dnl it in an AC_DEFUN.
5918 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5919 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
5921 AC_CHECK_FUNCS(listmntent getmntinfo)
5922 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
5923 getfsstat_includes="\
5924 $ac_includes_default
5925 #if HAVE_SYS_PARAM_H
5926 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
5928 #if HAVE_SYS_UCRED_H
5929 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
5931 #if HAVE_SYS_MOUNT_H
5932 # include <sys/mount.h>
5934 #if HAVE_SYS_FS_TYPES_H
5935 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
5938 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
5940 # Determine how to get the list of mounted filesystems.
5943 # If the getmntent function is available but not in the standard library,
5944 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
5947 # This test must precede the ones for getmntent because Unicos-9 is
5948 # reported to have the getmntent function, but its support is incompatible
5949 # with other getmntent implementations.
5951 # NOTE: Normally, I wouldn't use a check for system type as I've done for
5952 # `CRAY' below since that goes against the whole autoconf philosophy. But
5953 # I think there is too great a chance that some non-Cray system has a
5954 # function named listmntent to risk the false positive.
5956 if test -z "$ac_list_mounted_fs"; then
5958 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
5959 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
5960 [fu_cv_sys_mounted_cray_listmntent=no
5965 ], [test $ac_cv_func_listmntent = yes \
5966 && fu_cv_sys_mounted_cray_listmntent=yes]
5970 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
5971 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
5972 ac_list_mounted_fs=found
5973 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
5974 [Define if there is a function named listmntent that can be used to
5975 list all mounted filesystems. (UNICOS)])
5979 if test -z "$ac_list_mounted_fs"; then
5981 AC_MSG_CHECKING([for mntctl function and struct vmount])
5982 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
5983 [AC_TRY_CPP([#include <fshelp.h>],
5984 fu_cv_sys_mounted_vmount=yes,
5985 fu_cv_sys_mounted_vmount=no)])
5986 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
5987 if test $fu_cv_sys_mounted_vmount = yes; then
5988 ac_list_mounted_fs=found
5989 AC_DEFINE(MOUNTED_VMOUNT, 1,
5990 [Define if there is a function named mntctl that can be used to read
5991 the list of mounted filesystems, and there is a system header file
5992 that declares `struct vmount.' (AIX)])
5996 if test $ac_cv_func_getmntent = yes; then
5998 # This system has the getmntent function.
5999 # Determine whether it's the one-argument variant or the two-argument one.
6001 if test -z "$ac_list_mounted_fs"; then
6002 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
6003 AC_MSG_CHECKING([for one-argument getmntent function])
6004 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
6006 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
6010 #if !defined MOUNTED
6011 # if defined _PATH_MOUNTED /* GNU libc */
6012 # define MOUNTED _PATH_MOUNTED
6014 # if defined MNT_MNTTAB /* HP-UX. */
6015 # define MOUNTED MNT_MNTTAB
6017 # if defined MNTTABNAME /* Dynix. */
6018 # define MOUNTED MNTTABNAME
6022 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
6023 fu_cv_sys_mounted_getmntent1=yes,
6024 fu_cv_sys_mounted_getmntent1=no)])
6025 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
6026 if test $fu_cv_sys_mounted_getmntent1 = yes; then
6027 ac_list_mounted_fs=found
6028 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
6029 [Define if there is a function named getmntent for reading the list
6030 of mounted filesystems, and that function takes a single argument.
6031 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
6035 if test -z "$ac_list_mounted_fs"; then
6037 AC_MSG_CHECKING([for two-argument getmntent function])
6038 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
6039 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
6040 fu_cv_sys_mounted_getmntent2=yes,
6041 fu_cv_sys_mounted_getmntent2=no)])
6042 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
6043 if test $fu_cv_sys_mounted_getmntent2 = yes; then
6044 ac_list_mounted_fs=found
6045 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
6046 [Define if there is a function named getmntent for reading the list of
6047 mounted filesystems, and that function takes two arguments. (SVR4)])
6053 if test -z "$ac_list_mounted_fs"; then
6054 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
6055 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
6057 AC_MSG_CHECKING([for getfsstat function])
6058 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
6060 #include <sys/types.h>
6061 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
6062 # define FS_TYPE(Ent) ((Ent).f_fstypename)
6064 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
6066 ]$getfsstat_includes
6068 [struct statfs *stats;
6069 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
6070 char *t = FS_TYPE (*stats); ],
6071 fu_cv_sys_mounted_getfsstat=yes,
6072 fu_cv_sys_mounted_getfsstat=no)])
6073 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
6074 if test $fu_cv_sys_mounted_getfsstat = yes; then
6075 ac_list_mounted_fs=found
6076 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
6077 [Define if there is a function named getfsstat for reading the
6078 list of mounted filesystems. (DEC Alpha running OSF/1)])
6082 if test -z "$ac_list_mounted_fs"; then
6084 AC_MSG_CHECKING([for FIXME existence of three headers])
6085 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
6087 #include <sys/statfs.h>
6088 #include <sys/fstyp.h>
6089 #include <mnttab.h>],
6090 fu_cv_sys_mounted_fread_fstyp=yes,
6091 fu_cv_sys_mounted_fread_fstyp=no)])
6092 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
6093 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
6094 ac_list_mounted_fs=found
6095 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
6096 [Define if (like SVR2) there is no specific function for reading the
6097 list of mounted filesystems, and your system has these header files:
6098 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
6102 if test -z "$ac_list_mounted_fs"; then
6103 # 4.4BSD and DEC OSF/1.
6104 AC_MSG_CHECKING([for getmntinfo function])
6105 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
6107 test "$ac_cv_func_getmntinfo" = yes \
6108 && fu_cv_sys_mounted_getmntinfo=yes \
6109 || fu_cv_sys_mounted_getmntinfo=no
6111 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
6112 if test $fu_cv_sys_mounted_getmntinfo = yes; then
6113 ac_list_mounted_fs=found
6114 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
6115 [Define if there is a function named getmntinfo for reading the
6116 list of mounted filesystems. (4.4BSD, Darwin)])
6120 if test -z "$ac_list_mounted_fs"; then
6122 AC_MSG_CHECKING([for getmnt function])
6123 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
6125 #include <sys/fs_types.h>
6126 #include <sys/mount.h>],
6127 fu_cv_sys_mounted_getmnt=yes,
6128 fu_cv_sys_mounted_getmnt=no)])
6129 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
6130 if test $fu_cv_sys_mounted_getmnt = yes; then
6131 ac_list_mounted_fs=found
6132 AC_DEFINE(MOUNTED_GETMNT, 1,
6133 [Define if there is a function named getmnt for reading the list of
6134 mounted filesystems. (Ultrix)])
6138 if test -z "$ac_list_mounted_fs"; then
6140 AC_CHECK_FUNCS(next_dev fs_stat_dev)
6141 AC_CHECK_HEADERS(fs_info.h)
6142 AC_MSG_CHECKING([for BEOS mounted file system support functions])
6143 if test $ac_cv_header_fs_info_h = yes \
6144 && test $ac_cv_func_next_dev = yes \
6145 && test $ac_cv_func_fs_stat_dev = yes; then
6150 AC_MSG_RESULT($fu_result)
6151 if test $fu_result = yes; then
6152 ac_list_mounted_fs=found
6153 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
6154 [Define if there are functions named next_dev and fs_stat_dev for
6155 reading the list of mounted filesystems. (BeOS)])
6159 if test -z "$ac_list_mounted_fs"; then
6161 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
6162 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
6163 [AC_TRY_CPP([#include <mnttab.h>],
6164 fu_cv_sys_mounted_fread=yes,
6165 fu_cv_sys_mounted_fread=no)])
6166 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
6167 if test $fu_cv_sys_mounted_fread = yes; then
6168 ac_list_mounted_fs=found
6169 AC_DEFINE(MOUNTED_FREAD, 1,
6170 [Define if there is no specific function for reading the list of
6171 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
6175 if test -z "$ac_list_mounted_fs"; then
6176 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
6177 # FIXME -- no need to abort building the whole package
6178 # Can't build mountlist.c or anything that needs its functions
6181 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
6187 dnl From Jim Meyering.
6189 dnl See if struct statfs has the f_fstypename member.
6190 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
6193 AC_DEFUN([jm_FSTYPENAME],
6195 AC_CACHE_CHECK([for f_fstypename in struct statfs],
6196 fu_cv_sys_f_fstypename_in_statfs,
6200 #include <sys/param.h>
6201 #include <sys/types.h>
6202 #include <sys/mount.h>
6204 [struct statfs s; int i = sizeof s.f_fstypename;],
6205 fu_cv_sys_f_fstypename_in_statfs=yes,
6206 fu_cv_sys_f_fstypename_in_statfs=no
6211 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
6212 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
6213 [Define if struct statfs has the f_fstypename member.])
6220 # From fileutils/configure.in
6222 # Try to determine how a program can obtain filesystem usage information.
6223 # If successful, define the appropriate symbol (see fsusage.c) and
6224 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
6226 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6228 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
6231 echo "checking how to get filesystem space usage..."
6234 # Perform only the link test since it seems there are no variants of the
6235 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
6236 # because that got a false positive on SCO OSR5. Adding the declaration
6237 # of a `struct statvfs' causes this test to fail (as it should) on such
6238 # systems. That system is reported to work fine with STAT_STATFS4 which
6239 # is what it gets when this test fails.
6240 if test $ac_fsusage_space = no; then
6242 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
6243 [AC_TRY_LINK([#include <sys/types.h>
6245 Do not use statvfs on systems with GNU libc, because that function stats
6246 all preceding entries in /proc/mounts, and that makes df hang if even
6247 one of the corresponding file systems is hard-mounted, but not available.
6249 #include <sys/statvfs.h>],
6250 [struct statvfs fsd; statvfs (0, &fsd);],
6251 fu_cv_sys_stat_statvfs=yes,
6252 fu_cv_sys_stat_statvfs=no)])
6253 if test $fu_cv_sys_stat_statvfs = yes; then
6254 ac_fsusage_space=yes
6255 AC_DEFINE(STAT_STATVFS, 1,
6256 [ Define if there is a function named statvfs. (SVR4)])
6260 if test $ac_fsusage_space = no; then
6261 # DEC Alpha running OSF/1
6262 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
6263 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
6265 #include <sys/param.h>
6266 #include <sys/types.h>
6267 #include <sys/mount.h>
6272 exit (statfs (".", &fsd, sizeof (struct statfs)));
6274 fu_cv_sys_stat_statfs3_osf1=yes,
6275 fu_cv_sys_stat_statfs3_osf1=no,
6276 fu_cv_sys_stat_statfs3_osf1=no)])
6277 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
6278 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
6279 ac_fsusage_space=yes
6280 AC_DEFINE(STAT_STATFS3_OSF1, 1,
6281 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
6285 if test $ac_fsusage_space = no; then
6287 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
6288 member (AIX, 4.3BSD)])
6289 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
6291 #ifdef HAVE_SYS_PARAM_H
6292 #include <sys/param.h>
6294 #ifdef HAVE_SYS_MOUNT_H
6295 #include <sys/mount.h>
6297 #ifdef HAVE_SYS_VFS_H
6298 #include <sys/vfs.h>
6304 exit (statfs (".", &fsd));
6306 fu_cv_sys_stat_statfs2_bsize=yes,
6307 fu_cv_sys_stat_statfs2_bsize=no,
6308 fu_cv_sys_stat_statfs2_bsize=no)])
6309 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
6310 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
6311 ac_fsusage_space=yes
6312 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
6313 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
6314 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
6318 if test $ac_fsusage_space = no; then
6320 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
6321 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
6322 [AC_TRY_RUN([#include <sys/types.h>
6323 #include <sys/statfs.h>
6327 exit (statfs (".", &fsd, sizeof fsd, 0));
6329 fu_cv_sys_stat_statfs4=yes,
6330 fu_cv_sys_stat_statfs4=no,
6331 fu_cv_sys_stat_statfs4=no)])
6332 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
6333 if test $fu_cv_sys_stat_statfs4 = yes; then
6334 ac_fsusage_space=yes
6335 AC_DEFINE(STAT_STATFS4, 1,
6336 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
6340 if test $ac_fsusage_space = no; then
6342 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
6343 member (4.4BSD and NetBSD)])
6344 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
6345 [AC_TRY_RUN([#include <sys/types.h>
6346 #ifdef HAVE_SYS_PARAM_H
6347 #include <sys/param.h>
6349 #ifdef HAVE_SYS_MOUNT_H
6350 #include <sys/mount.h>
6356 exit (statfs (".", &fsd));
6358 fu_cv_sys_stat_statfs2_fsize=yes,
6359 fu_cv_sys_stat_statfs2_fsize=no,
6360 fu_cv_sys_stat_statfs2_fsize=no)])
6361 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
6362 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
6363 ac_fsusage_space=yes
6364 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
6365 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
6370 if test $ac_fsusage_space = no; then
6372 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
6373 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
6374 [AC_TRY_RUN([#include <sys/types.h>
6375 #ifdef HAVE_SYS_PARAM_H
6376 #include <sys/param.h>
6378 #ifdef HAVE_SYS_MOUNT_H
6379 #include <sys/mount.h>
6381 #ifdef HAVE_SYS_FS_TYPES_H
6382 #include <sys/fs_types.h>
6387 /* Ultrix's statfs returns 1 for success,
6388 0 for not mounted, -1 for failure. */
6389 exit (statfs (".", &fsd) != 1);
6391 fu_cv_sys_stat_fs_data=yes,
6392 fu_cv_sys_stat_fs_data=no,
6393 fu_cv_sys_stat_fs_data=no)])
6394 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
6395 if test $fu_cv_sys_stat_fs_data = yes; then
6396 ac_fsusage_space=yes
6397 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
6398 [ Define if statfs takes 2 args and the second argument has
6399 type struct fs_data. (Ultrix)])
6403 if test $ac_fsusage_space = no; then
6405 AC_TRY_CPP([#include <sys/filsys.h>
6407 AC_DEFINE(STAT_READ_FILSYS, 1,
6408 [Define if there is no specific function for reading filesystems usage
6409 information and you have the <sys/filsys.h> header file. (SVR2)])
6410 ac_fsusage_space=yes)
6413 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
6419 # Define some macros required for proper operation of code in lib/*.c
6420 # on MSDOS/Windows systems.
6422 # From Jim Meyering.
6424 AC_DEFUN([jm_AC_DOS],
6426 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
6429 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
6430 neither MSDOS nor Windows
6432 [ac_cv_win_or_dos=yes],
6433 [ac_cv_win_or_dos=no])
6436 if test x"$ac_cv_win_or_dos" = xyes; then
6437 ac_fs_accepts_drive_letter_prefix=1
6438 ac_fs_backslash_is_file_name_separator=1
6440 ac_fs_accepts_drive_letter_prefix=0
6441 ac_fs_backslash_is_file_name_separator=0
6444 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
6445 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
6446 # define FILESYSTEM_PREFIX_LEN(Filename) \
6447 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
6449 # define FILESYSTEM_PREFIX_LEN(Filename) 0
6452 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
6453 $ac_fs_accepts_drive_letter_prefix,
6454 [Define on systems for which file names may have a so-called
6455 `drive letter' prefix, define this to compute the length of that
6456 prefix, including the colon.])
6458 AH_VERBATIM(ISSLASH,
6459 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
6460 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
6462 # define ISSLASH(C) ((C) == '/')
6465 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
6466 $ac_fs_backslash_is_file_name_separator,
6467 [Define if the backslash character may also serve as a file name
6468 component separator.])
6472 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
6474 AC_REQUIRE([AC_HEADER_STDC])
6475 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
6476 AC_CHECK_FUNCS(resolvepath)
6477 AC_REQUIRE([AC_HEADER_STAT])
6479 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
6480 # if the function name weren't so long. Besides, I would rather
6481 # not have underscores in file names.
6482 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
6487 dnl From Paul Eggert.
6489 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
6492 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
6493 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
6494 ac_cv_struct_st_mtim_nsec,
6495 [ac_save_CPPFLAGS="$CPPFLAGS"
6496 ac_cv_struct_st_mtim_nsec=no
6497 # tv_nsec -- the usual case
6498 # _tv_nsec -- Solaris 2.6, if
6499 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
6500 # && !defined __EXTENSIONS__)
6501 # st__tim.tv_nsec -- UnixWare 2.1.2
6502 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
6503 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
6504 AC_TRY_COMPILE([#include <sys/types.h>
6505 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
6506 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
6508 CPPFLAGS="$ac_save_CPPFLAGS"])
6510 if test $ac_cv_struct_st_mtim_nsec != no; then
6511 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
6512 [Define to be the nanoseconds member of struct stat's st_mtim,
6520 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
6522 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
6523 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
6524 [AC_TRY_COMPILE([#include <sys/types.h>
6525 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
6526 ac_cv_struct_st_dm_mode=yes,
6527 ac_cv_struct_st_dm_mode=no)])
6529 if test $ac_cv_struct_st_dm_mode = yes; then
6530 AC_DEFINE(HAVE_ST_DM_MODE, 1,
6531 [Define if struct stat has an st_dm_mode member. ])
6538 dnl From Jim Meyering
6540 AC_DEFUN([gl_TIMESPEC],
6542 dnl Prerequisites of lib/timespec.h.
6543 AC_REQUIRE([AC_GNU_SOURCE])
6544 AC_REQUIRE([AC_HEADER_TIME])
6545 AC_CHECK_HEADERS_ONCE(sys/time.h)
6546 jm_CHECK_TYPE_STRUCT_TIMESPEC
6547 AC_STRUCT_ST_MTIM_NSEC
6549 dnl Persuade glibc <time.h> to declare nanosleep().
6550 AC_REQUIRE([AC_GNU_SOURCE])
6552 AC_CHECK_DECLS(nanosleep, , , [#include <time.h>])
6555 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
6556 dnl in time.h or sys/time.h.
6558 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
6560 AC_REQUIRE([AC_GNU_SOURCE])
6561 AC_REQUIRE([AC_HEADER_TIME])
6562 AC_CHECK_HEADERS_ONCE(sys/time.h)
6563 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
6566 # if TIME_WITH_SYS_TIME
6567 # include <sys/time.h>
6570 # if HAVE_SYS_TIME_H
6571 # include <sys/time.h>
6577 [static struct timespec x; x.tv_sec = x.tv_nsec;],
6578 fu_cv_sys_struct_timespec=yes,
6579 fu_cv_sys_struct_timespec=no)
6582 if test $fu_cv_sys_struct_timespec = yes; then
6583 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
6584 [Define if struct timespec is declared in <time.h>. ])
6589 dnl From Jim Meyering and Paul Eggert.
6590 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
6591 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6592 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
6593 jm_cv_sys_tiocgwinsz_needs_termios_h,
6594 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
6596 if test $ac_cv_sys_posix_termios = yes; then
6598 [#include <sys/types.h>
6599 # include <termios.h>
6603 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
6608 AC_DEFUN([jm_WINSIZE_IN_PTEM],
6609 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6610 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
6611 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
6612 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
6613 if test $ac_cv_sys_posix_termios = yes; then
6614 AC_TRY_COMPILE([#include <termios.h>]
6615 [struct winsize x;],
6616 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6618 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6619 AC_TRY_COMPILE([#include <sys/ptem.h>],
6620 [struct winsize x;],
6621 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6623 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6624 AC_DEFINE([WINSIZE_IN_PTEM], 1,
6625 [Define if sys/ptem.h is required for struct winsize.])
6628 # Determine whether this system has infrastructure for obtaining the boot time.
6630 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6631 * ----------------------------------------------------------
6632 AC_DEFUN([GNULIB_BOOT_TIME],
6634 AC_CHECK_FUNCS(sysctl)
6635 AC_CHECK_HEADERS(sys/sysctl.h)
6637 [whether we can get the system boot time],
6638 [gnulib_cv_have_boot_time],
6642 [AC_INCLUDES_DEFAULT
6643 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
6644 # include <sys/param.h> /* needed for OpenBSD 3.0 */
6645 # include <sys/sysctl.h>
6654 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
6655 /* your system *does* have the infrastructure to determine boot time */
6657 please_tell_us_how_to_determine_boot_time_on_your_system
6660 gnulib_cv_have_boot_time=yes,
6661 gnulib_cv_have_boot_time=no)
6663 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
6668 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
6669 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
6670 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
6671 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
6672 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6674 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
6676 [#include <sys/types.h>
6677 # include <sys/ioctl.h>
6681 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
6684 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6685 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
6686 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
6692 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
6694 AC_DEFUN([jm_LIB_CHECK],
6697 # Check for libypsec.a on Dolphin M88K machines.
6698 AC_CHECK_LIB(ypsec, main)
6700 # m88k running dgux 5.4 needs this
6701 AC_CHECK_LIB(ldgc, main)
6703 # Some programs need to link with -lm. printf does if it uses
6704 # lib/strtod.c which uses pow. And seq uses the math functions,
6705 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
6707 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
6708 # Check for these math functions used by seq.
6709 ac_su_saved_lib="$LIBS"
6711 AC_CHECK_FUNCS(floor modf rint)
6712 LIBS="$ac_su_saved_lib"
6715 AC_CHECK_FUNCS(sqrt)
6716 if test $ac_cv_func_sqrt = no; then
6717 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
6720 AC_SUBST(FESETROUND_LIBM)
6721 AC_CHECK_FUNCS(fesetround)
6722 if test $ac_cv_func_fesetround = no; then
6723 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
6726 # The -lsun library is required for YP support on Irix-4.0.5 systems.
6727 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
6728 AC_SEARCH_LIBS(yp_match, [sun ypsec])
6730 # SysV needs -lsec, older versions of Linux need -lshadow for
6731 # shadow passwords. UnixWare 7 needs -lgen.
6732 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
6734 AC_CHECK_HEADERS(shadow.h)
6736 # Requirements for su.c.
6738 $ac_includes_default
6740 # include <shadow.h>
6743 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
6744 AC_CHECK_FUNCS(getspnam)
6746 # SCO-ODT-3.0 is reported to need -lufc for crypt.
6747 # NetBSD needs -lcrypt for crypt.
6748 ac_su_saved_lib="$LIBS"
6749 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
6750 LIBS="$ac_su_saved_lib"
6754 # gettext.m4 serial 17 (gettext-0.11.5)
6755 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6756 dnl This file is free software, distributed under the terms of the GNU
6757 dnl General Public License. As a special exception to the GNU General
6758 dnl Public License, this file may be distributed as part of a program
6759 dnl that contains a configuration script generated by Autoconf, under
6760 dnl the same distribution terms as the rest of that program.
6762 dnl This file can can be used in projects which are not available under
6763 dnl the GNU General Public License or the GNU Library General Public
6764 dnl License but which still want to provide support for the GNU gettext
6766 dnl Please note that the actual code of the GNU gettext library is covered
6767 dnl by the GNU Library General Public License, and the rest of the GNU
6768 dnl gettext package package is covered by the GNU General Public License.
6769 dnl They are *not* in the public domain.
6772 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
6773 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
6775 dnl Macro to add for using GNU gettext.
6777 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
6778 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
6779 dnl default (if it is not specified or empty) is 'no-libtool'.
6780 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
6781 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
6782 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
6783 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
6784 dnl depending on --{enable,disable}-{shared,static} and on the presence of
6785 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
6786 dnl $(top_builddir)/intl/libintl.a will be created.
6787 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
6788 dnl implementations (in libc or libintl) without the ngettext() function
6789 dnl will be ignored. If NEEDSYMBOL is specified and is
6790 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
6791 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
6792 dnl INTLDIR is used to find the intl libraries. If empty,
6793 dnl the value `$(top_builddir)/intl/' is used.
6795 dnl The result of the configuration is one of three cases:
6796 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
6798 dnl Catalog format: GNU --> install in $(datadir)
6799 dnl Catalog extension: .mo after installation, .gmo in source tree
6800 dnl 2) GNU gettext has been found in the system's C library.
6801 dnl Catalog format: GNU --> install in $(datadir)
6802 dnl Catalog extension: .mo after installation, .gmo in source tree
6803 dnl 3) No internationalization, always use English msgid.
6804 dnl Catalog format: none
6805 dnl Catalog extension: none
6806 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
6807 dnl The use of .gmo is historical (it was needed to avoid overwriting the
6808 dnl GNU format catalogs when building on a platform with an X/Open gettext),
6809 dnl but we keep it in order not to force irrelevant filename changes on the
6812 AC_DEFUN([AM_GNU_GETTEXT],
6814 dnl Argument checking.
6815 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
6816 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
6818 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
6819 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
6821 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
6822 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
6824 AC_REQUIRE([AM_PO_SUBDIRS])dnl
6825 ifelse(gt_included_intl, yes, [
6826 AC_REQUIRE([AM_INTL_SUBDIR])dnl
6829 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
6830 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6831 AC_REQUIRE([AC_LIB_RPATH])
6833 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6834 dnl Ideally we would do this search only after the
6835 dnl if test "$USE_NLS" = "yes"; then
6836 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6837 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
6838 dnl the configure script would need to contain the same shell code
6839 dnl again, outside any 'if'. There are two solutions:
6840 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
6841 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
6842 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
6843 dnl documented, we avoid it.
6844 ifelse(gt_included_intl, yes, , [
6845 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
6848 AC_MSG_CHECKING([whether NLS is requested])
6849 dnl Default is enabled NLS
6851 [ --disable-nls do not use Native Language Support],
6852 USE_NLS=$enableval, USE_NLS=yes)
6853 AC_MSG_RESULT($USE_NLS)
6856 ifelse(gt_included_intl, yes, [
6857 BUILD_INCLUDED_LIBINTL=no
6858 USE_INCLUDED_LIBINTL=no
6864 dnl If we use NLS figure out what method
6865 if test "$USE_NLS" = "yes"; then
6866 gt_use_preinstalled_gnugettext=no
6867 ifelse(gt_included_intl, yes, [
6868 AC_MSG_CHECKING([whether included gettext is requested])
6869 AC_ARG_WITH(included-gettext,
6870 [ --with-included-gettext use the GNU gettext library included here],
6871 nls_cv_force_use_gnu_gettext=$withval,
6872 nls_cv_force_use_gnu_gettext=no)
6873 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
6875 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
6876 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
6878 dnl User does not insist on using GNU NLS library. Figure out what
6879 dnl to use. If GNU gettext is available we use this. Else we have
6880 dnl to fall back to GNU NLS library.
6882 dnl Add a version number to the cache macros.
6883 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
6884 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
6885 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
6887 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
6888 [AC_TRY_LINK([#include <libintl.h>
6889 ]ifelse([$2], [need-formatstring-macros],
6890 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6891 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6894 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6896 ], [])[extern int _nl_msg_cat_cntr;
6897 extern int *_nl_domain_bindings;],
6898 [bindtextdomain ("", "");
6899 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
6900 gt_cv_func_gnugettext_libc=yes,
6901 gt_cv_func_gnugettext_libc=no)])
6903 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6904 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6905 ifelse(gt_included_intl, yes, , [
6908 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
6909 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
6910 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
6911 dnl even if libiconv doesn't exist.
6912 AC_LIB_LINKFLAGS_BODY([intl])
6913 AC_CACHE_CHECK([for GNU gettext in libintl],
6914 gt_cv_func_gnugettext_libintl,
6915 [gt_save_CPPFLAGS="$CPPFLAGS"
6916 CPPFLAGS="$CPPFLAGS $INCINTL"
6917 gt_save_LIBS="$LIBS"
6918 LIBS="$LIBS $LIBINTL"
6919 dnl Now see whether libintl exists and does not depend on libiconv.
6920 AC_TRY_LINK([#include <libintl.h>
6921 ]ifelse([$2], [need-formatstring-macros],
6922 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6923 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6926 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6928 ], [])[extern int _nl_msg_cat_cntr;
6933 const char *_nl_expand_alias ();],
6934 [bindtextdomain ("", "");
6935 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6936 gt_cv_func_gnugettext_libintl=yes,
6937 gt_cv_func_gnugettext_libintl=no)
6938 dnl Now see whether libintl exists and depends on libiconv.
6939 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
6940 LIBS="$LIBS $LIBICONV"
6941 AC_TRY_LINK([#include <libintl.h>
6942 ]ifelse([$2], [need-formatstring-macros],
6943 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6944 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6947 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6949 ], [])[extern int _nl_msg_cat_cntr;
6954 const char *_nl_expand_alias ();],
6955 [bindtextdomain ("", "");
6956 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6957 [LIBINTL="$LIBINTL $LIBICONV"
6958 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
6959 gt_cv_func_gnugettext_libintl=yes
6962 CPPFLAGS="$gt_save_CPPFLAGS"
6963 LIBS="$gt_save_LIBS"])
6966 dnl If an already present or preinstalled GNU gettext() is found,
6967 dnl use it. But if this macro is used in GNU gettext, and GNU
6968 dnl gettext is already preinstalled in libintl, we update this
6969 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
6970 if test "$gt_cv_func_gnugettext_libc" = "yes" \
6971 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
6972 && test "$PACKAGE" != gettext; }; then
6973 gt_use_preinstalled_gnugettext=yes
6975 dnl Reset the values set by searching for libintl.
6981 ifelse(gt_included_intl, yes, [
6982 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
6983 dnl GNU gettext is not found in the C library.
6984 dnl Fall back on included GNU gettext library.
6985 nls_cv_use_gnu_gettext=yes
6989 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6990 dnl Mark actions used to generate GNU NLS library.
6991 INTLOBJS="\$(GETTOBJS)"
6992 BUILD_INCLUDED_LIBINTL=yes
6993 USE_INCLUDED_LIBINTL=yes
6994 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
6995 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
6996 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6999 if test "$gt_use_preinstalled_gnugettext" = "yes" \
7000 || test "$nls_cv_use_gnu_gettext" = "yes"; then
7001 dnl Mark actions to use GNU gettext tools.
7006 if test "$gt_use_preinstalled_gnugettext" = "yes" \
7007 || test "$nls_cv_use_gnu_gettext" = "yes"; then
7008 AC_DEFINE(ENABLE_NLS, 1,
7009 [Define to 1 if translation of program messages to the user's native language
7016 if test "$USE_NLS" = "yes"; then
7018 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
7019 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
7020 AC_MSG_CHECKING([how to link with libintl])
7021 AC_MSG_RESULT([$LIBINTL])
7022 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
7025 dnl For backward compatibility. Some packages may be using this.
7026 AC_DEFINE(HAVE_GETTEXT, 1,
7027 [Define if the GNU gettext() function is already present or preinstalled.])
7028 AC_DEFINE(HAVE_DCGETTEXT, 1,
7029 [Define if the GNU dcgettext() function is already present or preinstalled.])
7032 dnl We need to process the po/ directory.
7036 ifelse(gt_included_intl, yes, [
7037 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
7038 dnl to 'yes' because some of the testsuite requires it.
7039 if test "$PACKAGE" = gettext; then
7040 BUILD_INCLUDED_LIBINTL=yes
7043 dnl Make all variables we use known to autoconf.
7044 AC_SUBST(BUILD_INCLUDED_LIBINTL)
7045 AC_SUBST(USE_INCLUDED_LIBINTL)
7049 dnl For backward compatibility. Some configure.ins may be using this.
7051 nls_cv_header_libgt=
7053 dnl For backward compatibility. Some Makefiles may be using this.
7055 AC_SUBST(DATADIRNAME)
7057 dnl For backward compatibility. Some Makefiles may be using this.
7059 AC_SUBST(INSTOBJEXT)
7061 dnl For backward compatibility. Some Makefiles may be using this.
7065 dnl Enable libtool support if the surrounding package wishes it.
7066 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
7067 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
7070 dnl For backward compatibility. Some Makefiles may be using this.
7074 dnl Make all documented variables known to autoconf.
7081 dnl Checks for all prerequisites of the po subdirectory,
7082 dnl except for USE_NLS.
7083 AC_DEFUN([AM_PO_SUBDIRS],
7085 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
7086 AC_REQUIRE([AC_PROG_INSTALL])dnl
7087 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
7089 dnl Perform the following tests also if --disable-nls has been given,
7090 dnl because they are needed for "make dist" to work.
7092 dnl Search for GNU msgfmt in the PATH.
7093 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
7094 dnl The second test excludes FreeBSD msgfmt.
7095 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
7096 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
7097 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
7099 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
7101 dnl Search for GNU xgettext 0.11 or newer in the PATH.
7102 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
7103 dnl The second test excludes FreeBSD xgettext.
7104 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
7105 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
7106 (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)],
7108 dnl Remove leftover from FreeBSD xgettext call.
7111 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
7112 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
7113 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
7115 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
7116 dnl Test whether we really found GNU msgfmt.
7117 if test "$GMSGFMT" != ":"; then
7118 dnl If it is no GNU msgfmt we define it as : so that the
7119 dnl Makefiles still can work.
7120 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
7121 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
7124 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
7126 [found $GMSGFMT program is not GNU msgfmt; ignore it])
7131 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
7132 dnl Test whether we really found GNU xgettext.
7133 if test "$XGETTEXT" != ":"; then
7134 dnl If it is no GNU xgettext we define it as : so that the
7135 dnl Makefiles still can work.
7136 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
7137 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
7141 [found xgettext program is not GNU xgettext; ignore it])
7144 dnl Remove leftover from FreeBSD xgettext call.
7148 AC_OUTPUT_COMMANDS([
7149 for ac_file in $CONFIG_FILES; do
7150 # Support "outfile[:infile[:infile...]]"
7152 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7154 # PO directories have a Makefile.in generated from Makefile.in.in.
7155 case "$ac_file" in */Makefile.in)
7156 # Adjust a relative srcdir.
7157 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
7158 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
7159 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
7160 # In autoconf-2.13 it is called $ac_given_srcdir.
7161 # In autoconf-2.50 it is called $srcdir.
7162 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
7163 case "$ac_given_srcdir" in
7164 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
7165 /*) top_srcdir="$ac_given_srcdir" ;;
7166 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
7168 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
7169 rm -f "$ac_dir/POTFILES"
7170 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
7171 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
7172 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
7173 # on $ac_dir but don't depend on user-specified configuration
7175 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
7176 # The LINGUAS file contains the set of available languages.
7177 if test -n "$ALL_LINGUAS"; then
7178 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
7180 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
7181 # Hide the ALL_LINGUAS assigment from automake.
7182 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
7184 case "$ac_given_srcdir" in
7186 *) srcdirpre='$(srcdir)/' ;;
7192 for lang in $ALL_LINGUAS; do
7193 POFILES="$POFILES $srcdirpre$lang.po"
7194 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
7195 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
7196 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
7198 # CATALOGS depends on both $ac_dir and the user's LINGUAS
7199 # environment variable.
7201 if test -n "$ALL_LINGUAS"; then
7202 for presentlang in $ALL_LINGUAS; do
7204 if test "%UNSET%" != "$LINGUAS"; then
7205 desiredlanguages="$LINGUAS"
7207 desiredlanguages="$ALL_LINGUAS"
7209 for desiredlang in $desiredlanguages; do
7210 # Use the presentlang catalog if desiredlang is
7211 # a. equal to presentlang, or
7212 # b. a variant of presentlang (because in this case,
7213 # presentlang can be used as a fallback for messages
7214 # which are not translated in the desiredlang catalog).
7215 case "$desiredlang" in
7216 "$presentlang"*) useit=yes;;
7219 if test $useit = yes; then
7220 INST_LINGUAS="$INST_LINGUAS $presentlang"
7225 if test -n "$INST_LINGUAS"; then
7226 for lang in $INST_LINGUAS; do
7227 CATALOGS="$CATALOGS $lang.gmo"
7230 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
7231 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"
7232 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
7233 if test -f "$f"; then
7235 *.orig | *.bak | *~) ;;
7236 *) cat "$f" >> "$ac_dir/Makefile" ;;
7244 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
7245 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
7247 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
7248 # Capture the value of LINGUAS because we need it to compute CATALOGS.
7249 LINGUAS="${LINGUAS-%UNSET%}"
7254 dnl Checks for all prerequisites of the intl subdirectory,
7255 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
7256 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
7257 AC_DEFUN([AM_INTL_SUBDIR],
7259 AC_REQUIRE([AC_PROG_INSTALL])dnl
7260 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
7261 AC_REQUIRE([AC_PROG_CC])dnl
7262 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7263 AC_REQUIRE([AC_PROG_RANLIB])dnl
7264 AC_REQUIRE([AC_ISC_POSIX])dnl
7265 AC_REQUIRE([AC_HEADER_STDC])dnl
7266 AC_REQUIRE([AC_C_CONST])dnl
7267 AC_REQUIRE([AC_C_INLINE])dnl
7268 AC_REQUIRE([AC_TYPE_OFF_T])dnl
7269 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
7270 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
7271 AC_REQUIRE([AC_FUNC_MMAP])dnl
7272 AC_REQUIRE([jm_GLIBC21])dnl
7273 AC_REQUIRE([gt_INTDIV0])dnl
7274 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
7275 AC_REQUIRE([gt_INTTYPES_PRI])dnl
7277 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
7278 stdlib.h string.h unistd.h sys/param.h])
7279 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
7280 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
7281 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
7285 if test $ac_cv_header_locale_h = yes; then
7289 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
7290 dnl because plural.y uses bison specific features. It requires at least
7291 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
7293 dnl bison is only needed for the maintainer (who touches plural.y). But in
7294 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
7295 dnl the rule in general Makefile. Now, some people carelessly touch the
7296 dnl files or have a broken "make" program, hence the plural.c rule will
7297 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
7298 dnl present or too old.
7299 AC_CHECK_PROGS([INTLBISON], [bison])
7300 if test -z "$INTLBISON"; then
7303 dnl Found it, now check the version.
7304 AC_MSG_CHECKING([version of bison])
7305 changequote(<<,>>)dnl
7306 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
7307 case $ac_prog_version in
7308 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
7309 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
7311 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
7312 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
7314 AC_MSG_RESULT([$ac_prog_version])
7316 if test $ac_verc_fail = yes; then
7322 AC_DEFUN([AM_MKINSTALLDIRS],
7324 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
7325 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
7326 dnl Try to locate is.
7328 if test -n "$ac_aux_dir"; then
7329 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
7331 if test -z "$MKINSTALLDIRS"; then
7332 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
7334 AC_SUBST(MKINSTALLDIRS)
7338 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
7339 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
7341 # progtest.m4 serial 3
7342 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
7343 dnl This file is free software, distributed under the terms of the GNU
7344 dnl General Public License. As a special exception to the GNU General
7345 dnl Public License, this file may be distributed as part of a program
7346 dnl that contains a configuration script generated by Autoconf, under
7347 dnl the same distribution terms as the rest of that program.
7349 dnl This file can can be used in projects which are not available under
7350 dnl the GNU General Public License or the GNU Library General Public
7351 dnl License but which still want to provide support for the GNU gettext
7353 dnl Please note that the actual code of the GNU gettext library is covered
7354 dnl by the GNU Library General Public License, and the rest of the GNU
7355 dnl gettext package package is covered by the GNU General Public License.
7356 dnl They are *not* in the public domain.
7359 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
7361 # Search path for a program which passes the given test.
7363 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7364 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7365 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
7366 [# Extract the first word of "$2", so it can be a program name with args.
7367 set dummy $2; ac_word=[$]2
7368 AC_MSG_CHECKING([for $ac_word])
7369 AC_CACHE_VAL(ac_cv_path_$1,
7372 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7375 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7376 for ac_dir in ifelse([$5], , $PATH, [$5]); do
7377 test -z "$ac_dir" && ac_dir=.
7378 if test -f $ac_dir/$ac_word; then
7380 ac_cv_path_$1="$ac_dir/$ac_word"
7386 dnl If no 4th arg is given, leave the cache variable unset,
7387 dnl so AC_PATH_PROGS will keep looking.
7388 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7393 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7394 AC_MSG_RESULT([$]$1)
7401 # intdiv0.m4 serial 1 (gettext-0.11.3)
7402 dnl Copyright (C) 2002 Free Software Foundation, Inc.
7403 dnl This file is free software, distributed under the terms of the GNU
7404 dnl General Public License. As a special exception to the GNU General
7405 dnl Public License, this file may be distributed as part of a program
7406 dnl that contains a configuration script generated by Autoconf, under
7407 dnl the same distribution terms as the rest of that program.
7409 dnl From Bruno Haible.
7411 AC_DEFUN([gt_INTDIV0],
7413 AC_REQUIRE([AC_PROG_CC])dnl
7414 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7416 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
7417 gt_cv_int_divbyzero_sigfpe,
7425 sigfpe_handler (int sig)
7427 sigfpe_handler (sig) int sig;
7430 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
7431 exit (sig != SIGFPE);
7441 signal (SIGFPE, sigfpe_handler);
7442 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
7443 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
7444 signal (SIGTRAP, sigfpe_handler);
7446 /* Linux/SPARC yields signal SIGILL. */
7447 #if defined (__sparc__) && defined (__linux__)
7448 signal (SIGILL, sigfpe_handler);
7455 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
7457 # Guess based on the CPU.
7459 alpha* | i[34567]86 | m68k | s390*)
7460 gt_cv_int_divbyzero_sigfpe="guessing yes";;
7462 gt_cv_int_divbyzero_sigfpe="guessing no";;
7466 case "$gt_cv_int_divbyzero_sigfpe" in
7470 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
7471 [Define if integer division by zero raises signal SIGFPE.])
7474 # lcmessage.m4 serial 3 (gettext-0.11.3)
7475 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
7476 dnl This file is free software, distributed under the terms of the GNU
7477 dnl General Public License. As a special exception to the GNU General
7478 dnl Public License, this file may be distributed as part of a program
7479 dnl that contains a configuration script generated by Autoconf, under
7480 dnl the same distribution terms as the rest of that program.
7482 dnl This file can can be used in projects which are not available under
7483 dnl the GNU General Public License or the GNU Library General Public
7484 dnl License but which still want to provide support for the GNU gettext
7486 dnl Please note that the actual code of the GNU gettext library is covered
7487 dnl by the GNU Library General Public License, and the rest of the GNU
7488 dnl gettext package package is covered by the GNU General Public License.
7489 dnl They are *not* in the public domain.
7492 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
7494 # Check whether LC_MESSAGES is available in <locale.h>.
7496 AC_DEFUN([AM_LC_MESSAGES],
7498 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7499 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7500 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7501 if test $am_cv_val_LC_MESSAGES = yes; then
7502 AC_DEFINE(HAVE_LC_MESSAGES, 1,
7503 [Define if your <locale.h> file defines LC_MESSAGES.])