1 # generated automatically by aclocal 1.7.7 -*- 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.7])])
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.])
836 # Enable extensions on systems that normally disable them.
838 # Copyright (C) 2003 Free Software Foundation, Inc.
840 # This file is free software, distributed under the terms of the GNU
841 # General Public License. As a special exception to the GNU General
842 # Public License, this file may be distributed as part of a program
843 # that contains a configuration script generated by Autoconf, under
844 # the same distribution terms as the rest of that program.
846 # gl_USE_SYSTEM_EXTENSIONS
847 # ------------------------
848 # Enable extensions on systems that normally disable them,
849 # typically due to standards-conformance issues.
850 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], [
851 AC_BEFORE([$0], [AC_COMPILE_IFELSE])
852 AC_BEFORE([$0], [AC_RUN_IFELSE])
854 AC_REQUIRE([AC_GNU_SOURCE])
856 AC_REQUIRE([AC_MINIX])
858 AH_VERBATIM([__EXTENSIONS__],
859 [/* Enable extensions on Solaris. */
860 #ifndef __EXTENSIONS__
861 # undef __EXTENSIONS__
863 AC_DEFINE([__EXTENSIONS__])
868 dnl From Jim Meyering.
869 dnl Find a new-enough version of Perl.
874 dnl FIXME: don't hard-code 5.003
875 dnl FIXME: should we cache the result?
876 AC_MSG_CHECKING([for perl5.003 or newer])
877 if test "${PERL+set}" = set; then
878 # `PERL' is set in the user's environment.
879 candidate_perl_names="$PERL"
882 candidate_perl_names='perl perl5'
888 PERL="$am_missing_run perl"
889 for perl in $candidate_perl_names; do
890 # Run test in a subshell; some versions of sh will print an error if
891 # an executable is not found, even if stderr is redirected.
892 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
899 AC_MSG_RESULT($found)
900 test $found = no && AC_MSG_WARN([
901 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
902 a usable version of the Perl File::Compare module. As a result,
903 you may be unable to run a few tests or to regenerate certain
904 files if you modify the sources from which they are derived.
908 #serial 68 -*- autoconf -*-
910 m4_undefine([AC_LANG_SOURCE(C)])
911 dnl The following is identical to the definition in c.m4
912 dnl from the autoconf cvs repository on 2003-03-07.
913 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
915 # We can't use '#line $LINENO "configure"' here, since
916 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
917 # rejects $LINENO greater than 32767, and some configure scripts
918 # are longer than 32767 lines.
919 m4_define([AC_LANG_SOURCE(C)],
922 cat confdefs.h >>conftest.$ac_ext
923 cat >>conftest.$ac_ext <<_ACEOF
924 /* end confdefs.h. */
928 dnl Misc type-related macros for fileutils, sh-utils, textutils.
930 AC_DEFUN([jm_MACROS],
934 GNU_PACKAGE="GNU $PACKAGE"
935 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
936 [The concatenation of the strings `GNU ', and PACKAGE.])
937 AC_SUBST(GNU_PACKAGE)
939 AM_MISSING_PROG(HELP2MAN, help2man)
940 AC_SUBST(OPTIONAL_BIN_PROGS)
944 dnl This macro actually runs replacement code. See isc-posix.m4.
945 AC_REQUIRE([AC_ISC_POSIX])dnl
949 AC_REQUIRE([UTILS_HOST_OS])
950 AC_REQUIRE([jm_ASSERT])
951 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
952 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
953 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
954 AC_REQUIRE([jm_CHECK_DECLS])
956 AC_REQUIRE([jm_PREREQ])
958 AC_REQUIRE([UTILS_FUNC_DIRFD])
959 AC_REQUIRE([AC_FUNC_ACL])
960 AC_REQUIRE([AC_FUNC_FTW])
961 AC_REQUIRE([jm_FUNC_LCHOWN])
962 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
963 AC_REQUIRE([jm_FUNC_CHOWN])
964 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
965 AC_REQUIRE([AC_FUNC_STRERROR_R])
966 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
968 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
969 AC_REQUIRE([jm_FUNC_FPENDING])
971 # This is for od and stat, and any other program that
972 # uses the PRI.MAX macros from inttypes.h.
973 AC_REQUIRE([gt_INTTYPES_PRI])
975 AC_REQUIRE([jm_FUNC_GETGROUPS])
977 AC_REQUIRE([AC_FUNC_FSEEKO])
978 AC_REQUIRE([AC_FUNC_ALLOCA])
980 AC_CONFIG_LIBOBJ_DIR([lib])
981 AC_FUNC_GETLOADAVG([lib])
983 AC_REQUIRE([jm_SYS_PROC_UPTIME])
984 AC_REQUIRE([jm_FUNC_FTRUNCATE])
986 # raise is used by at least sort and ls.
987 AC_REPLACE_FUNCS(raise)
989 # By default, argmatch should fail calling usage (1).
990 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
991 [Define to the function xargmatch calls on failures.])
992 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
993 [Define to the declaration of the xargmatch failure function.])
995 dnl Used to define SETVBUF in sys2.h.
996 dnl This evokes the following warning from autoconf:
997 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
998 AC_FUNC_SETVBUF_REVERSED
1000 # used by sleep and shred
1001 AC_REQUIRE([gl_CLOCK_TIME])
1002 AC_CHECK_FUNCS(gettimeofday)
1003 AC_FUNC_GETTIMEOFDAY_CLOBBER
1005 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
1034 AC_CHECK_FUNCS(setreuid setregid)
1037 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1038 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
1039 AC_REQUIRE([GL_FUNC_READDIR])
1041 # See if linking `seq' requires -lm.
1042 # It does on nearly every system. The single exception (so far) is
1043 # BeOS which has all the math functions in the normal runtime library
1044 # and doesn't have a separate math library.
1052 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1053 [ac_seq_save_LIBS="$LIBS"
1055 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1056 LIBS="$ac_seq_save_LIBS"
1062 jm_FUNC_UNLINK_BUSY_TEXT
1064 # These tests are for df.
1065 AC_REQUIRE([gl_FSUSAGE])
1066 AC_REQUIRE([gl_MOUNTLIST])
1067 if test $gl_cv_list_mounted_fs = yes && test $gl_cv_fs_space = yes; then
1068 DF_PROG='df$(EXEEXT)'
1070 AC_REQUIRE([jm_AC_DOS])
1071 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1073 # If any of these functions don't exist (e.g. DJGPP 2.03),
1074 # use the corresponding stub.
1075 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
1076 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
1079 # These tests must be run before any use of AC_CHECK_TYPE,
1080 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1081 # See the definition of ac_includes_default in `configure'.
1082 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1125 # This macro must be invoked before any tests that run the compiler.
1126 AC_DEFUN([jm_CHECK_ALL_TYPES],
1128 dnl This test must come as early as possible after the compiler configuration
1129 dnl tests, because the choice of the file model can (in principle) affect
1130 dnl whether functions and headers are available, whether they work, etc.
1131 AC_REQUIRE([AC_SYS_LARGEFILE])
1133 dnl This test must precede tests of compiler characteristics like
1134 dnl that for the inline keyword, since it may change the degree to
1135 dnl which the compiler supports such features.
1136 AC_REQUIRE([AM_C_PROTOTYPES])
1138 dnl Checks for typedefs, structures, and compiler characteristics.
1139 AC_REQUIRE([AC_C_BIGENDIAN])
1140 AC_REQUIRE([AC_C_CONST])
1141 AC_REQUIRE([AC_C_VOLATILE])
1142 AC_REQUIRE([AC_C_INLINE])
1143 AC_REQUIRE([AC_C_LONG_DOUBLE])
1145 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1146 AC_REQUIRE([AC_HEADER_DIRENT])
1147 AC_REQUIRE([AC_HEADER_STDC])
1149 [struct stat.st_author,
1150 struct stat.st_blksize],,,
1151 [$ac_includes_default
1152 #include <sys/stat.h>
1154 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1156 AC_REQUIRE([AC_HEADER_STAT])
1157 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1158 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1160 AC_REQUIRE([AC_TYPE_GETGROUPS])
1161 AC_REQUIRE([AC_TYPE_MODE_T])
1162 AC_REQUIRE([AC_TYPE_OFF_T])
1163 AC_REQUIRE([AC_TYPE_PID_T])
1164 AC_REQUIRE([AC_TYPE_SIGNAL])
1165 AC_REQUIRE([AC_TYPE_SIZE_T])
1166 AC_REQUIRE([AC_TYPE_UID_T])
1167 AC_CHECK_TYPE(ino_t, unsigned long)
1171 dnl This relies on the fact that autoconf 2.14a's implementation of
1172 dnl AC_CHECK_TYPE checks includes unistd.h.
1173 AC_CHECK_TYPE(major_t, unsigned int)
1174 AC_CHECK_TYPE(minor_t, unsigned int)
1176 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1177 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1179 AC_REQUIRE([AC_HEADER_MAJOR])
1180 AC_REQUIRE([AC_HEADER_DIRENT])
1184 # isc-posix.m4 serial 2 (gettext-0.11.2)
1185 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1186 dnl This file is free software, distributed under the terms of the GNU
1187 dnl General Public License. As a special exception to the GNU General
1188 dnl Public License, this file may be distributed as part of a program
1189 dnl that contains a configuration script generated by Autoconf, under
1190 dnl the same distribution terms as the rest of that program.
1192 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1194 # This test replaces the one in autoconf.
1195 # Currently this macro should have the same name as the autoconf macro
1196 # because gettext's gettext.m4 (distributed in the automake package)
1197 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1198 # give these diagnostics:
1199 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1200 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1202 undefine([AC_ISC_POSIX])
1204 AC_DEFUN([AC_ISC_POSIX],
1206 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1207 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1213 dnl From Paul Eggert.
1215 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1216 AC_DEFUN([UTILS_HOST_OS],
1218 AC_CACHE_CHECK([host operating system],
1219 utils_cv_host_operating_system,
1223 # These operating system names do not use the default heuristic below.
1224 # They are in reverse order, so that more-specific prefixes come first.
1225 winnt*) os='Windows NT';;
1227 sysv*) os='Unix System V';;
1228 superux*) os='SUPER-UX';;
1229 sunos*) os='SunOS';;
1231 sco*) os='SCO Unix';;
1232 riscos*) os='RISC OS';;
1233 riscix*) os='RISCiX';;
1237 plan9*) os='Plan 9';;
1240 openbsd*) os='OpenBSD';;
1241 nsk*) os='NonStop Kernel';;
1242 nonstopux*) os='NonStop-UX';;
1243 netbsd*-gnu*) os='GNU/NetBSD';;
1244 netbsd*) os='NetBSD';;
1245 msdosdjgpp*) os='DJGPP';;
1246 mpeix*) os='MPE/iX';;
1248 mingw*) os='MinGW';;
1249 lynxos*) os='LynxOS';;
1250 linux*) os='GNU/Linux';;
1254 freebsd*-gnu*) os='GNU/FreeBSD';;
1255 freebsd*) os='FreeBSD';;
1257 bsdi*) os='BSD/OS';;
1261 atheos*) os='AtheOS';;
1262 amigaos*) os='Amiga OS';;
1265 # The default heuristic takes the initial alphabetic string
1266 # from $host_os, but capitalizes its first letter.
1269 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1271 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1275 # If $host_os does not start with an alphabetic string, use it unchanged.
1279 utils_cv_host_operating_system=$os]])
1280 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1281 "$utils_cv_host_operating_system",
1282 [The host operating system.])
1286 dnl based on code from Eleftherios Gkioulekas
1288 AC_DEFUN([jm_ASSERT],
1290 AC_MSG_CHECKING(whether to enable assertions)
1291 AC_ARG_ENABLE(assert,
1292 [ --disable-assert turn off assertions],
1294 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1295 [ AC_MSG_RESULT(yes) ]
1301 dnl From Jim Meyering
1303 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1304 dnl usually in <utime.h>.
1305 dnl Some systems have utime.h but don't declare the struct anywhere.
1307 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1309 AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
1310 AC_REQUIRE([AC_HEADER_TIME])
1311 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1314 #ifdef TIME_WITH_SYS_TIME
1315 # include <sys/time.h>
1318 # ifdef HAVE_SYS_TIME_H
1319 # include <sys/time.h>
1328 [static struct utimbuf x; x.actime = x.modtime;],
1329 fu_cv_sys_struct_utimbuf=yes,
1330 fu_cv_sys_struct_utimbuf=no)
1333 if test $fu_cv_sys_struct_utimbuf = yes; then
1334 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1335 [Define if struct utimbuf is declared -- usually in <utime.h>.
1336 Some systems have utime.h but don't declare the struct anywhere. ])
1340 # onceonly_2_57.m4 serial 3
1341 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
1342 dnl This file is free software, distributed under the terms of the GNU
1343 dnl General Public License. As a special exception to the GNU General
1344 dnl Public License, this file may be distributed as part of a program
1345 dnl that contains a configuration script generated by Autoconf, under
1346 dnl the same distribution terms as the rest of that program.
1348 dnl This file defines some "once only" variants of standard autoconf macros.
1349 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1350 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1351 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1352 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1353 dnl The advantage is that the check for each of the headers/functions/decls
1354 dnl will be put only once into the 'configure' file. It keeps the size of
1355 dnl the 'configure' file down, and avoids redundant output when 'configure'
1357 dnl The drawback is that the checks cannot be conditionalized. If you write
1358 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1359 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1360 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1363 dnl This is like onceonly.m4, except that it uses diversions to named sections
1364 dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
1365 dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
1366 dnl size reduction is ca. 9%.
1368 dnl Autoconf version 2.57 or newer is recommended.
1371 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1372 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1373 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1375 AC_FOREACH([gl_HEADER_NAME], [$1], [
1376 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1378 m4_divert_text([INIT_PREPARE],
1379 [gl_header_list="$gl_header_list gl_HEADER_NAME"])
1380 gl_HEADERS_EXPANSION
1381 AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
1382 [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
1384 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1388 m4_define([gl_HEADERS_EXPANSION], [
1389 m4_divert_text([DEFAULTS], [gl_header_list=])
1390 AC_CHECK_HEADERS([$gl_header_list])
1391 m4_define([gl_HEADERS_EXPANSION], [])
1394 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1395 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1396 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1398 AC_FOREACH([gl_FUNC_NAME], [$1], [
1399 AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
1400 m4_divert_text([INIT_PREPARE],
1401 [gl_func_list="$gl_func_list gl_FUNC_NAME"])
1403 AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
1404 [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
1406 AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
1409 m4_define([gl_FUNCS_EXPANSION], [
1410 m4_divert_text([DEFAULTS], [gl_func_list=])
1411 AC_CHECK_FUNCS([$gl_func_list])
1412 m4_define([gl_FUNCS_EXPANSION], [])
1415 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1416 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1417 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1419 AC_FOREACH([gl_DECL_NAME], [$1], [
1420 AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
1421 AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
1423 AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
1429 dnl From Jim Meyering.
1431 dnl Check whether struct dirent has a member named d_type.
1434 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1435 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1436 AC_CACHE_CHECK([for d_type member in directory struct],
1437 jm_cv_struct_dirent_d_type,
1440 #include <sys/types.h>
1441 #ifdef HAVE_DIRENT_H
1442 # include <dirent.h>
1443 #else /* not HAVE_DIRENT_H */
1444 # define dirent direct
1445 # ifdef HAVE_SYS_NDIR_H
1446 # include <sys/ndir.h>
1447 # endif /* HAVE_SYS_NDIR_H */
1448 # ifdef HAVE_SYS_DIR_H
1449 # include <sys/dir.h>
1450 # endif /* HAVE_SYS_DIR_H */
1453 # endif /* HAVE_NDIR_H */
1454 #endif /* HAVE_DIRENT_H */
1456 [struct dirent dp; dp.d_type = 0;],
1458 jm_cv_struct_dirent_d_type=yes,
1459 jm_cv_struct_dirent_d_type=no)
1462 if test $jm_cv_struct_dirent_d_type = yes; then
1463 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1464 [Define if there is a member named d_type in the struct describing
1465 directory headers.])
1472 dnl From Jim Meyering.
1474 dnl Check whether struct dirent has a member named d_ino.
1477 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1478 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1479 AC_CACHE_CHECK([for d_ino member in directory struct],
1480 jm_cv_struct_dirent_d_ino,
1483 #include <sys/types.h>
1484 #ifdef HAVE_DIRENT_H
1485 # include <dirent.h>
1486 #else /* not HAVE_DIRENT_H */
1487 # define dirent direct
1488 # ifdef HAVE_SYS_NDIR_H
1489 # include <sys/ndir.h>
1490 # endif /* HAVE_SYS_NDIR_H */
1491 # ifdef HAVE_SYS_DIR_H
1492 # include <sys/dir.h>
1493 # endif /* HAVE_SYS_DIR_H */
1496 # endif /* HAVE_NDIR_H */
1497 #endif /* HAVE_DIRENT_H */
1499 [struct dirent dp; dp.d_ino = 0;],
1501 jm_cv_struct_dirent_d_ino=yes,
1502 jm_cv_struct_dirent_d_ino=no)
1505 if test $jm_cv_struct_dirent_d_ino = yes; then
1506 AC_DEFINE(D_INO_IN_DIRENT, 1,
1507 [Define if there is a member named d_ino in the struct describing
1508 directory headers.])
1515 dnl This is just a wrapper function to encapsulate this kludge.
1516 dnl Putting it in a separate file like this helps share it between
1517 dnl different packages.
1518 AC_DEFUN([jm_CHECK_DECLS],
1520 AC_REQUIRE([_jm_DECL_HEADERS])
1521 AC_REQUIRE([AC_HEADER_TIME])
1528 # include <unistd.h>
1531 #include <sys/types.h>
1532 #if TIME_WITH_SYS_TIME
1533 # include <sys/time.h>
1536 # if HAVE_SYS_TIME_H
1537 # include <sys/time.h>
1577 ttyname], , , $headers)
1580 dnl FIXME: when autoconf has support for it.
1581 dnl This is a little helper so we can require these header checks.
1582 AC_DEFUN([_jm_DECL_HEADERS],
1584 AC_REQUIRE([AC_HEADER_STDC])
1585 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1586 unistd.h sys/time.h utmp.h utmpx.h)
1591 dnl We use jm_ for non Autoconf macros.
1592 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1593 m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1595 # These are the prerequisite macros for files in the lib/
1596 # directory of the coreutils package.
1598 AC_DEFUN([jm_PREREQ],
1600 # We don't yet use c-stack.c.
1601 # AC_REQUIRE([gl_C_STACK])
1603 AC_REQUIRE([AM_FUNC_GETLINE])
1604 AC_REQUIRE([AM_STDBOOL_H])
1605 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
1606 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
1607 AC_REQUIRE([gl_BACKUPFILE])
1608 AC_REQUIRE([gl_CANON_HOST])
1609 AC_REQUIRE([gl_CLOSEOUT])
1610 AC_REQUIRE([gl_DIRNAME])
1611 AC_REQUIRE([gl_ERROR])
1612 AC_REQUIRE([gl_EXCLUDE])
1613 AC_REQUIRE([gl_EXITFAIL])
1614 AC_REQUIRE([gl_FILEBLOCKS])
1615 AC_REQUIRE([gl_FILEMODE])
1616 AC_REQUIRE([gl_FILE_TYPE])
1617 AC_REQUIRE([gl_FSUSAGE])
1618 AC_REQUIRE([gl_FUNC_ALLOCA])
1619 AC_REQUIRE([gl_FUNC_ATEXIT])
1620 AC_REQUIRE([gl_FUNC_DUP2])
1621 AC_REQUIRE([gl_FUNC_EUIDACCESS])
1622 AC_REQUIRE([gl_FUNC_FNMATCH_GNU])
1623 AC_REQUIRE([gl_FUNC_GETHOSTNAME])
1624 AC_REQUIRE([gl_FUNC_GETLOADAVG])
1625 AC_REQUIRE([gl_FUNC_GETPASS])
1626 AC_REQUIRE([gl_FUNC_GETUSERSHELL])
1627 AC_REQUIRE([gl_FUNC_MEMCHR])
1628 AC_REQUIRE([gl_FUNC_MEMCPY])
1629 AC_REQUIRE([gl_FUNC_MEMMOVE])
1630 AC_REQUIRE([gl_FUNC_MEMRCHR])
1631 AC_REQUIRE([gl_FUNC_MEMSET])
1632 AC_REQUIRE([gl_FUNC_MKTIME])
1633 AC_REQUIRE([gl_FUNC_READLINK])
1634 AC_REQUIRE([gl_FUNC_RMDIR])
1635 AC_REQUIRE([gl_FUNC_RPMATCH])
1636 AC_REQUIRE([gl_FUNC_SIG2STR])
1637 AC_REQUIRE([gl_FUNC_STPCPY])
1638 AC_REQUIRE([gl_FUNC_STRCSPN])
1639 AC_REQUIRE([gl_FUNC_STRDUP])
1640 AC_REQUIRE([gl_FUNC_STRNDUP])
1641 AC_REQUIRE([gl_FUNC_STRNLEN])
1642 AC_REQUIRE([gl_FUNC_STRPBRK])
1643 AC_REQUIRE([gl_FUNC_STRSTR])
1644 AC_REQUIRE([gl_FUNC_STRTOD])
1645 AC_REQUIRE([gl_FUNC_STRTOIMAX])
1646 AC_REQUIRE([gl_FUNC_STRTOLL])
1647 AC_REQUIRE([gl_FUNC_STRTOL])
1648 AC_REQUIRE([gl_FUNC_STRTOULL])
1649 AC_REQUIRE([gl_FUNC_STRTOUL])
1650 AC_REQUIRE([gl_FUNC_STRTOUMAX])
1651 AC_REQUIRE([gl_FUNC_STRVERSCMP])
1652 AC_REQUIRE([gl_FUNC_VASNPRINTF])
1653 AC_REQUIRE([gl_FUNC_VASPRINTF])
1654 AC_REQUIRE([gl_GETDATE])
1655 AC_REQUIRE([gl_GETNDELIM2])
1656 AC_REQUIRE([gl_GETOPT])
1657 AC_REQUIRE([gl_GETPAGESIZE])
1658 AC_REQUIRE([gl_GETUGROUPS])
1659 AC_REQUIRE([gl_HARD_LOCALE])
1660 AC_REQUIRE([gl_HASH])
1661 AC_REQUIRE([gl_HUMAN])
1662 AC_REQUIRE([gl_IDCACHE])
1663 AC_REQUIRE([gl_LONG_OPTIONS])
1664 AC_REQUIRE([gl_MAKEPATH])
1665 AC_REQUIRE([gl_MBSWIDTH])
1666 AC_REQUIRE([gl_MD5])
1667 AC_REQUIRE([gl_MEMCOLL])
1668 AC_REQUIRE([gl_MODECHANGE])
1669 AC_REQUIRE([gl_MOUNTLIST])
1670 AC_REQUIRE([gl_OBSTACK])
1671 AC_REQUIRE([gl_PATHMAX])
1672 AC_REQUIRE([gl_PATH_CONCAT])
1673 AC_REQUIRE([gl_PHYSMEM])
1674 AC_REQUIRE([gl_POSIXTM])
1675 AC_REQUIRE([gl_POSIXVER])
1676 AC_REQUIRE([gl_QUOTEARG])
1677 AC_REQUIRE([gl_QUOTE])
1678 AC_REQUIRE([gl_READTOKENS])
1679 AC_REQUIRE([gl_READUTMP])
1680 AC_REQUIRE([gl_REGEX])
1681 AC_REQUIRE([gl_SAFE_READ])
1682 AC_REQUIRE([gl_SAFE_WRITE])
1683 AC_REQUIRE([gl_SAME])
1684 AC_REQUIRE([gl_SAVEDIR])
1685 AC_REQUIRE([gl_SAVE_CWD])
1686 AC_REQUIRE([gl_SETTIME])
1687 AC_REQUIRE([gl_SHA])
1688 AC_REQUIRE([gl_STDIO_SAFER])
1689 AC_REQUIRE([gl_STRCASE])
1690 AC_REQUIRE([gl_TIMESPEC])
1691 AC_REQUIRE([gl_UNICODEIO])
1692 AC_REQUIRE([gl_UNISTD_SAFER])
1693 AC_REQUIRE([gl_USERSPEC])
1694 AC_REQUIRE([gl_UTIMENS])
1695 AC_REQUIRE([gl_XALLOC])
1696 AC_REQUIRE([gl_XGETCWD])
1697 AC_REQUIRE([gl_XREADLINK])
1698 AC_REQUIRE([gl_XSTRTOD])
1699 AC_REQUIRE([gl_XSTRTOL])
1700 AC_REQUIRE([gl_YESNO])
1701 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
1702 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
1703 AC_REQUIRE([jm_FUNC_LSTAT])
1704 AC_REQUIRE([jm_FUNC_MALLOC])
1705 AC_REQUIRE([jm_FUNC_MEMCMP])
1706 AC_REQUIRE([jm_FUNC_NANOSLEEP])
1707 AC_REQUIRE([jm_FUNC_PUTENV])
1708 AC_REQUIRE([jm_FUNC_REALLOC])
1709 AC_REQUIRE([jm_FUNC_STAT])
1710 AC_REQUIRE([jm_FUNC_UTIME])
1711 AC_REQUIRE([jm_PREREQ_STAT])
1712 AC_REQUIRE([jm_XSTRTOIMAX])
1713 AC_REQUIRE([jm_XSTRTOUMAX])
1714 AC_REQUIRE([vb_FUNC_RENAME])
1717 AC_DEFUN([jm_PREREQ_STAT],
1719 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1720 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1721 AC_CHECK_FUNCS(statvfs)
1723 # For `struct statfs' on Ultrix 4.4.
1724 AC_CHECK_HEADERS([netinet/in.h nfs/nfs_clnt.h nfs/vfs.h],,,
1725 [AC_INCLUDES_DEFAULT])
1727 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
1730 $ac_includes_default
1731 #if HAVE_SYS_STATVFS_H
1732 # include <sys/statvfs.h>
1735 # include <sys/vfs.h>
1737 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
1738 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
1739 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
1740 # include <sys/param.h>
1741 # include <sys/mount.h>
1742 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
1743 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
1744 # include <netinet/in.h>
1745 # include <nfs/nfs_clnt.h>
1746 # include <nfs/vfs.h>
1750 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
1751 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
1752 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
1753 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
1754 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
1755 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
1756 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
1757 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
1758 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
1759 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
1760 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
1763 # getline.m4 serial 9
1765 dnl Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software
1766 dnl Foundation, Inc.
1768 dnl This file is free software, distributed under the terms of the GNU
1769 dnl General Public License. As a special exception to the GNU General
1770 dnl Public License, this file may be distributed as part of a program
1771 dnl that contains a configuration script generated by Autoconf, under
1772 dnl the same distribution terms as the rest of that program.
1776 dnl See if there's a working, system-supplied version of the getline function.
1777 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
1778 dnl have a function by that name in -linet that doesn't have anything
1779 dnl to do with the function we need.
1780 AC_DEFUN([AM_FUNC_GETLINE],
1782 dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
1783 AC_REQUIRE([AC_GNU_SOURCE])
1785 am_getline_needs_run_time_check=no
1786 AC_CHECK_FUNC(getline,
1787 dnl Found it in some library. Verify that it works.
1788 am_getline_needs_run_time_check=yes,
1789 am_cv_func_working_getline=no)
1790 if test $am_getline_needs_run_time_check = yes; then
1791 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
1792 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
1795 # include <stdlib.h>
1796 # include <string.h>
1798 { /* Based on a test program from Karl Heuer. */
1802 FILE *in = fopen ("./conftest.data", "r");
1805 len = getline (&line, &siz, in);
1806 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
1808 ], am_cv_func_working_getline=yes dnl The library version works.
1809 , am_cv_func_working_getline=no dnl The library version does NOT work.
1810 , am_cv_func_working_getline=no dnl We're cross compiling.
1814 if test $am_cv_func_working_getline = no; then
1815 dnl We must choose a different name for our function, since on ELF systems
1816 dnl a broken getline() in libc.so would override our getline() in
1817 dnl libgettextlib.so.
1818 AC_DEFINE([getline], [gnu_getline],
1819 [Define to a replacement function name for getline().])
1821 AC_LIBOBJ(getndelim2)
1823 gl_PREREQ_GETNDELIM2
1827 # Prerequisites of lib/getline.c.
1828 AC_DEFUN([gl_PREREQ_GETLINE],
1830 AC_CHECK_FUNCS(getdelim)
1833 # getndelim2.m4 serial 2
1834 dnl Copyright (C) 2003 Free Software Foundation, Inc.
1835 dnl This file is free software, distributed under the terms of the GNU
1836 dnl General Public License. As a special exception to the GNU General
1837 dnl Public License, this file may be distributed as part of a program
1838 dnl that contains a configuration script generated by Autoconf, under
1839 dnl the same distribution terms as the rest of that program.
1841 AC_DEFUN([gl_GETNDELIM2],
1843 AC_LIBOBJ(getndelim2)
1844 gl_PREREQ_GETNDELIM2
1847 # Prerequisites of lib/getndelim2.h and lib/getndelim2.c.
1848 AC_DEFUN([gl_PREREQ_GETNDELIM2],
1850 dnl Prerequisites of lib/getndelim2.h.
1851 AC_REQUIRE([gt_TYPE_SSIZE_T])
1852 dnl No prerequisites of lib/getndelim2.c.
1855 # ssize_t.m4 serial 3 (gettext-0.12.2)
1856 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
1857 dnl This file is free software, distributed under the terms of the GNU
1858 dnl General Public License. As a special exception to the GNU General
1859 dnl Public License, this file may be distributed as part of a program
1860 dnl that contains a configuration script generated by Autoconf, under
1861 dnl the same distribution terms as the rest of that program.
1863 dnl From Bruno Haible.
1864 dnl Test whether ssize_t is defined.
1866 AC_DEFUN([gt_TYPE_SSIZE_T],
1868 AC_CACHE_CHECK([for ssize_t], gt_cv_ssize_t,
1869 [AC_TRY_COMPILE([#include <sys/types.h>],
1870 [int x = sizeof (ssize_t *) + sizeof (ssize_t);],
1871 gt_cv_ssize_t=yes, gt_cv_ssize_t=no)])
1872 if test $gt_cv_ssize_t = no; then
1873 AC_DEFINE(ssize_t, int,
1874 [Define as a signed type of the same size as size_t.])
1878 # Check for stdbool.h that conforms to C99.
1880 # Copyright (C) 2002-2003 Free Software Foundation, Inc.
1882 # This program is free software; you can redistribute it and/or modify
1883 # it under the terms of the GNU General Public License as published by
1884 # the Free Software Foundation; either version 2, or (at your option)
1885 # any later version.
1887 # This program is distributed in the hope that it will be useful,
1888 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1889 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1890 # GNU General Public License for more details.
1892 # You should have received a copy of the GNU General Public License
1893 # along with this program; if not, write to the Free Software
1894 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1897 # Prepare for substituting <stdbool.h> if it is not supported.
1899 AC_DEFUN([AM_STDBOOL_H],
1901 AC_REQUIRE([AC_HEADER_STDBOOL])
1903 # Define two additional variables used in the Makefile substitution.
1905 if test "$ac_cv_header_stdbool_h" = yes; then
1908 STDBOOL_H='stdbool.h'
1910 AC_SUBST([STDBOOL_H])
1912 if test "$ac_cv_type__Bool" = yes; then
1917 AC_SUBST([HAVE__BOOL])
1920 # This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
1921 # have this macro built-in.
1923 AC_DEFUN([AC_HEADER_STDBOOL],
1924 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
1925 [ac_cv_header_stdbool_h],
1928 #include <stdbool.h>
1930 "error: bool is not defined"
1933 "error: false is not defined"
1936 "error: false is not 0"
1939 "error: false is not defined"
1942 "error: true is not 1"
1944 #ifndef __bool_true_false_are_defined
1945 "error: __bool_true_false_are_defined is not defined"
1948 struct s { _Bool s: 1; _Bool t; } s;
1950 char a[true == 1 ? 1 : -1];
1951 char b[false == 0 ? 1 : -1];
1952 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
1953 char d[(bool) -0.5 == true ? 1 : -1];
1955 char f[(_Bool) -0.0 == false ? 1 : -1];
1957 char h[sizeof (_Bool)];
1960 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
1961 [ac_cv_header_stdbool_h=yes],
1962 [ac_cv_header_stdbool_h=no])])
1963 AC_CHECK_TYPES([_Bool])
1964 if test $ac_cv_header_stdbool_h = yes; then
1965 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
1970 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1971 # On such systems, arrange to use a wrapper function that removes any
1973 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1975 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1976 utils_cv_func_mkdir_trailing_slash_bug,
1978 # Arrange for deletion of the temporary directory this test might create.
1979 ac_clean_files="$ac_clean_files confdir-slash"
1981 # include <sys/types.h>
1982 # include <sys/stat.h>
1983 # include <stdlib.h>
1986 rmdir ("confdir-slash");
1987 exit (mkdir ("confdir-slash/", 0700));
1990 utils_cv_func_mkdir_trailing_slash_bug=no,
1991 utils_cv_func_mkdir_trailing_slash_bug=yes,
1992 utils_cv_func_mkdir_trailing_slash_bug=yes
1997 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1999 AC_DEFINE(mkdir, rpl_mkdir,
2000 [Define to rpl_mkdir if the replacement function should be used.])
2005 # Prerequisites of lib/mkdir.c.
2006 AC_DEFUN([gl_PREREQ_MKDIR], [:])
2010 # On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
2011 # silly limit that it can create no more than 26 files from a given template.
2012 # Other systems lack mkstemp altogether.
2013 # On OSF1/Tru64 V4.0F, the system-provided mkstemp function can create
2014 # only 32 files per process.
2015 # On systems like the above, arrange to use the replacement function.
2016 AC_DEFUN([UTILS_FUNC_MKSTEMP],
2018 AC_REPLACE_FUNCS(mkstemp)
2019 if test $ac_cv_func_mkstemp = no; then
2020 utils_cv_func_mkstemp_limitations=yes
2022 AC_CACHE_CHECK([for mkstemp limitations],
2023 utils_cv_func_mkstemp_limitations,
2026 # include <stdlib.h>
2030 for (i = 0; i < 70; i++)
2032 char template[] = "conftestXXXXXX";
2033 int fd = mkstemp (template);
2041 utils_cv_func_mkstemp_limitations=no,
2042 utils_cv_func_mkstemp_limitations=yes,
2043 utils_cv_func_mkstemp_limitations=yes
2049 if test $utils_cv_func_mkstemp_limitations = yes; then
2052 AC_DEFINE(mkstemp, rpl_mkstemp,
2053 [Define to rpl_mkstemp if the replacement function should be used.])
2059 # Prerequisites of lib/mkstemp.c.
2060 AC_DEFUN([gl_PREREQ_MKSTEMP],
2064 # Prerequisites of lib/tempname.c.
2065 AC_DEFUN([jm_PREREQ_TEMPNAME],
2067 AC_REQUIRE([AC_HEADER_STAT])
2068 AC_CHECK_HEADERS_ONCE(fcntl.h sys/time.h unistd.h)
2069 AC_CHECK_HEADERS(stdint.h)
2070 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
2071 AC_CHECK_DECLS_ONCE(getenv)
2072 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2075 # uintmax_t.m4 serial 7 (gettext-0.12)
2076 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2077 dnl This file is free software, distributed under the terms of the GNU
2078 dnl General Public License. As a special exception to the GNU General
2079 dnl Public License, this file may be distributed as part of a program
2080 dnl that contains a configuration script generated by Autoconf, under
2081 dnl the same distribution terms as the rest of that program.
2083 dnl From Paul Eggert.
2087 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2088 # if it is not already defined in <stdint.h> or <inttypes.h>.
2090 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2092 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2093 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2094 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2095 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2096 test $ac_cv_type_unsigned_long_long = yes \
2097 && ac_type='unsigned long long' \
2098 || ac_type='unsigned long'
2099 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2100 [Define to unsigned long or unsigned long long
2101 if <stdint.h> and <inttypes.h> don't define.])
2103 AC_DEFINE(HAVE_UINTMAX_T, 1,
2104 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2108 # inttypes_h.m4 serial 5 (gettext-0.12)
2109 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2110 dnl This file is free software, distributed under the terms of the GNU
2111 dnl General Public License. As a special exception to the GNU General
2112 dnl Public License, this file may be distributed as part of a program
2113 dnl that contains a configuration script generated by Autoconf, under
2114 dnl the same distribution terms as the rest of that program.
2116 dnl From Paul Eggert.
2118 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2119 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2121 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2123 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2125 [#include <sys/types.h>
2126 #include <inttypes.h>],
2127 [uintmax_t i = (uintmax_t) -1;],
2128 jm_ac_cv_header_inttypes_h=yes,
2129 jm_ac_cv_header_inttypes_h=no)])
2130 if test $jm_ac_cv_header_inttypes_h = yes; then
2131 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2132 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2133 and declares uintmax_t. ])
2137 # stdint_h.m4 serial 3 (gettext-0.12)
2138 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2139 dnl This file is free software, distributed under the terms of the GNU
2140 dnl General Public License. As a special exception to the GNU General
2141 dnl Public License, this file may be distributed as part of a program
2142 dnl that contains a configuration script generated by Autoconf, under
2143 dnl the same distribution terms as the rest of that program.
2145 dnl From Paul Eggert.
2147 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2148 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2150 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2152 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2154 [#include <sys/types.h>
2155 #include <stdint.h>],
2156 [uintmax_t i = (uintmax_t) -1;],
2157 jm_ac_cv_header_stdint_h=yes,
2158 jm_ac_cv_header_stdint_h=no)])
2159 if test $jm_ac_cv_header_stdint_h = yes; then
2160 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2161 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2162 and declares uintmax_t. ])
2166 # ulonglong.m4 serial 3
2167 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
2168 dnl This file is free software, distributed under the terms of the GNU
2169 dnl General Public License. As a special exception to the GNU General
2170 dnl Public License, this file may be distributed as part of a program
2171 dnl that contains a configuration script generated by Autoconf, under
2172 dnl the same distribution terms as the rest of that program.
2174 dnl From Paul Eggert.
2176 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2178 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2180 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2181 [AC_TRY_LINK([unsigned long long ull = 1ULL; int i = 63;],
2182 [unsigned long long ullmax = (unsigned long long) -1;
2183 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2184 ac_cv_type_unsigned_long_long=yes,
2185 ac_cv_type_unsigned_long_long=no)])
2186 if test $ac_cv_type_unsigned_long_long = yes; then
2187 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2188 [Define if you have the 'unsigned long long' type.])
2192 # backupfile.m4 serial 3
2193 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2194 dnl This file is free software, distributed under the terms of the GNU
2195 dnl General Public License. As a special exception to the GNU General
2196 dnl Public License, this file may be distributed as part of a program
2197 dnl that contains a configuration script generated by Autoconf, under
2198 dnl the same distribution terms as the rest of that program.
2200 AC_DEFUN([gl_BACKUPFILE],
2202 dnl Prerequisites of lib/backupfile.c.
2203 AC_REQUIRE([AC_HEADER_DIRENT])
2204 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
2205 jm_CHECK_TYPE_STRUCT_DIRENT_D_INO
2207 dnl Prerequisites of lib/addext.c.
2208 AC_REQUIRE([jm_AC_DOS])
2209 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
2210 AC_CHECK_HEADERS_ONCE(unistd.h)
2211 AC_CHECK_FUNCS(pathconf)
2216 # Define some macros required for proper operation of code in lib/*.c
2217 # on MSDOS/Windows systems.
2219 # From Jim Meyering.
2221 AC_DEFUN([jm_AC_DOS],
2223 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
2226 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
2227 neither MSDOS nor Windows
2229 [ac_cv_win_or_dos=yes],
2230 [ac_cv_win_or_dos=no])
2233 if test x"$ac_cv_win_or_dos" = xyes; then
2234 ac_fs_accepts_drive_letter_prefix=1
2235 ac_fs_backslash_is_file_name_separator=1
2237 ac_fs_accepts_drive_letter_prefix=0
2238 ac_fs_backslash_is_file_name_separator=0
2241 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
2242 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
2243 # define FILESYSTEM_PREFIX_LEN(Filename) \
2244 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
2246 # define FILESYSTEM_PREFIX_LEN(Filename) 0
2249 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
2250 $ac_fs_accepts_drive_letter_prefix,
2251 [Define on systems for which file names may have a so-called
2252 `drive letter' prefix, define this to compute the length of that
2253 prefix, including the colon.])
2255 AH_VERBATIM(ISSLASH,
2256 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
2257 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
2259 # define ISSLASH(C) ((C) == '/')
2262 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
2263 $ac_fs_backslash_is_file_name_separator,
2264 [Define if the backslash character may also serve as a file name
2265 component separator.])
2268 # canon-host.m4 serial 3
2269 dnl Copyright (C) 2002, 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 AC_DEFUN([gl_CANON_HOST],
2278 dnl Prerequisites of lib/canon-host.c.
2279 AC_CHECK_HEADERS_ONCE(unistd.h)
2280 AC_CHECK_HEADERS(netdb.h sys/socket.h netinet/in.h arpa/inet.h)
2282 dnl Add any libraries as early as possible.
2283 dnl In particular, inet_ntoa needs -lnsl at least on Solaris 2.5.1,
2284 dnl so we have to add -lnsl to LIBS before checking for that function.
2285 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
2287 dnl These come from -lnsl on Solaris 2.5.1.
2288 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
2293 dnl A replacement for autoconf's macro by the same name. This version
2294 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2295 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2296 dnl run only if one of the listed libraries ends up being used (and not in
2297 dnl the `none required' case.
2298 dnl I hope it's only temporary while we wait for that version to be fixed.
2299 undefine([AC_SEARCH_LIBS])
2301 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2302 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2303 # [OTHER-LIBRARIES])
2304 # --------------------------------------------------------
2305 # Search for a library defining FUNC, if it's not already available.
2306 AC_DEFUN([AC_SEARCH_LIBS],
2308 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2310 ac_func_search_save_LIBS=$LIBS
2312 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2313 if test "$ac_cv_search_$1" = no; then
2314 for ac_lib in $2; do
2315 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2316 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2319 LIBS=$ac_func_search_save_LIBS
2322 if test "$ac_cv_search_$1" = no; then :
2325 if test "$ac_cv_search_$1" = 'none required'; then :
2328 LIBS="$ac_cv_search_$1 $LIBS"
2334 # closeout.m4 serial 2
2335 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2336 dnl This file is free software, distributed under the terms of the GNU
2337 dnl General Public License. As a special exception to the GNU General
2338 dnl Public License, this file may be distributed as part of a program
2339 dnl that contains a configuration script generated by Autoconf, under
2340 dnl the same distribution terms as the rest of that program.
2342 AC_DEFUN([gl_CLOSEOUT],
2344 dnl Prerequisites of lib/closeout.c.
2348 # dirname.m4 serial 2
2349 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2350 dnl This file is free software, distributed under the terms of the GNU
2351 dnl General Public License. As a special exception to the GNU General
2352 dnl Public License, this file may be distributed as part of a program
2353 dnl that contains a configuration script generated by Autoconf, under
2354 dnl the same distribution terms as the rest of that program.
2356 AC_DEFUN([gl_DIRNAME],
2358 dnl Prerequisites of lib/dirname.h.
2359 AC_REQUIRE([jm_AC_DOS])
2361 dnl No prerequisites of lib/basename.c, lib/dirname.c, lib/stripslash.c.
2366 AC_DEFUN([gl_ERROR],
2368 AC_FUNC_ERROR_AT_LINE
2369 dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
2373 # Prerequisites of lib/error.c.
2374 AC_DEFUN([jm_PREREQ_ERROR],
2376 AC_REQUIRE([AC_FUNC_STRERROR_R])
2380 # exclude.m4 serial 3
2381 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2382 dnl This file is free software, distributed under the terms of the GNU
2383 dnl General Public License. As a special exception to the GNU General
2384 dnl Public License, this file may be distributed as part of a program
2385 dnl that contains a configuration script generated by Autoconf, under
2386 dnl the same distribution terms as the rest of that program.
2388 AC_DEFUN([gl_EXCLUDE],
2390 dnl Prerequisites of lib/exclude.c.
2391 AC_REQUIRE([AC_C_INLINE])
2392 AC_REQUIRE([AC_HEADER_STDC])
2393 AC_CHECK_FUNCS_ONCE(isascii)
2396 # exitfail.m4 serial 2
2397 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2398 dnl This file is free software, distributed under the terms of the GNU
2399 dnl General Public License. As a special exception to the GNU General
2400 dnl Public License, this file may be distributed as part of a program
2401 dnl that contains a configuration script generated by Autoconf, under
2402 dnl the same distribution terms as the rest of that program.
2404 dnl Prerequisites of lib/exitfail.c.
2405 AC_DEFUN([gl_EXITFAIL], [:])
2407 # fileblocks.m4 serial 1
2408 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2409 dnl This file is free software, distributed under the terms of the GNU
2410 dnl General Public License. As a special exception to the GNU General
2411 dnl Public License, this file may be distributed as part of a program
2412 dnl that contains a configuration script generated by Autoconf, under
2413 dnl the same distribution terms as the rest of that program.
2415 AC_DEFUN([gl_FILEBLOCKS],
2418 dnl Note: AC_STRUCT_ST_BLOCKS does AC_LIBOBJ(fileblocks).
2419 if test $ac_cv_member_struct_stat_st_blocks = no; then
2420 gl_PREREQ_FILEBLOCKS
2424 # Prerequisites of lib/fileblocks.c.
2425 AC_DEFUN([gl_PREREQ_FILEBLOCKS], [
2426 AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
2429 # filemode.m4 serial 1
2430 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2431 dnl This file is free software, distributed under the terms of the GNU
2432 dnl General Public License. As a special exception to the GNU General
2433 dnl Public License, this file may be distributed as part of a program
2434 dnl that contains a configuration script generated by Autoconf, under
2435 dnl the same distribution terms as the rest of that program.
2437 AC_DEFUN([gl_FILEMODE],
2439 dnl Prerequisites of lib/filemode.c.
2440 AC_REQUIRE([AC_HEADER_STAT])
2443 # file-type.m4 serial 1
2444 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2445 dnl This file is free software, distributed under the terms of the GNU
2446 dnl General Public License. As a special exception to the GNU General
2447 dnl Public License, this file may be distributed as part of a program
2448 dnl that contains a configuration script generated by Autoconf, under
2449 dnl the same distribution terms as the rest of that program.
2451 AC_DEFUN([gl_FILE_TYPE],
2453 dnl Prerequisites of lib/file-type.h.
2454 AC_REQUIRE([AC_HEADER_STAT])
2459 # From fileutils/configure.in
2461 AC_DEFUN([gl_FSUSAGE],
2463 AC_CHECK_HEADERS_ONCE(sys/param.h)
2464 AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs_types.h)
2465 jm_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
2466 if test $gl_cv_fs_space = yes; then
2468 gl_PREREQ_FSUSAGE_EXTRA
2472 # Try to determine how a program can obtain filesystem usage information.
2473 # If successful, define the appropriate symbol (see fsusage.c) and
2474 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
2476 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
2478 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
2481 echo "checking how to get filesystem space usage..."
2484 # Perform only the link test since it seems there are no variants of the
2485 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
2486 # because that got a false positive on SCO OSR5. Adding the declaration
2487 # of a `struct statvfs' causes this test to fail (as it should) on such
2488 # systems. That system is reported to work fine with STAT_STATFS4 which
2489 # is what it gets when this test fails.
2490 if test $ac_fsusage_space = no; then
2492 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
2493 [AC_TRY_LINK([#include <sys/types.h>
2495 Do not use statvfs on systems with GNU libc, because that function stats
2496 all preceding entries in /proc/mounts, and that makes df hang if even
2497 one of the corresponding file systems is hard-mounted, but not available.
2499 #include <sys/statvfs.h>],
2500 [struct statvfs fsd; statvfs (0, &fsd);],
2501 fu_cv_sys_stat_statvfs=yes,
2502 fu_cv_sys_stat_statvfs=no)])
2503 if test $fu_cv_sys_stat_statvfs = yes; then
2504 ac_fsusage_space=yes
2505 AC_DEFINE(STAT_STATVFS, 1,
2506 [ Define if there is a function named statvfs. (SVR4)])
2510 if test $ac_fsusage_space = no; then
2511 # DEC Alpha running OSF/1
2512 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
2513 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
2515 #include <sys/param.h>
2516 #include <sys/types.h>
2517 #include <sys/mount.h>
2522 exit (statfs (".", &fsd, sizeof (struct statfs)));
2524 fu_cv_sys_stat_statfs3_osf1=yes,
2525 fu_cv_sys_stat_statfs3_osf1=no,
2526 fu_cv_sys_stat_statfs3_osf1=no)])
2527 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
2528 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
2529 ac_fsusage_space=yes
2530 AC_DEFINE(STAT_STATFS3_OSF1, 1,
2531 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
2535 if test $ac_fsusage_space = no; then
2537 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
2538 member (AIX, 4.3BSD)])
2539 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
2541 #ifdef HAVE_SYS_PARAM_H
2542 #include <sys/param.h>
2544 #ifdef HAVE_SYS_MOUNT_H
2545 #include <sys/mount.h>
2547 #ifdef HAVE_SYS_VFS_H
2548 #include <sys/vfs.h>
2554 exit (statfs (".", &fsd));
2556 fu_cv_sys_stat_statfs2_bsize=yes,
2557 fu_cv_sys_stat_statfs2_bsize=no,
2558 fu_cv_sys_stat_statfs2_bsize=no)])
2559 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
2560 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
2561 ac_fsusage_space=yes
2562 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
2563 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
2564 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
2568 if test $ac_fsusage_space = no; then
2570 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
2571 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
2572 [AC_TRY_RUN([#include <sys/types.h>
2573 #include <sys/statfs.h>
2577 exit (statfs (".", &fsd, sizeof fsd, 0));
2579 fu_cv_sys_stat_statfs4=yes,
2580 fu_cv_sys_stat_statfs4=no,
2581 fu_cv_sys_stat_statfs4=no)])
2582 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
2583 if test $fu_cv_sys_stat_statfs4 = yes; then
2584 ac_fsusage_space=yes
2585 AC_DEFINE(STAT_STATFS4, 1,
2586 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
2590 if test $ac_fsusage_space = no; then
2592 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
2593 member (4.4BSD and NetBSD)])
2594 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
2595 [AC_TRY_RUN([#include <sys/types.h>
2596 #ifdef HAVE_SYS_PARAM_H
2597 #include <sys/param.h>
2599 #ifdef HAVE_SYS_MOUNT_H
2600 #include <sys/mount.h>
2606 exit (statfs (".", &fsd));
2608 fu_cv_sys_stat_statfs2_fsize=yes,
2609 fu_cv_sys_stat_statfs2_fsize=no,
2610 fu_cv_sys_stat_statfs2_fsize=no)])
2611 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
2612 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
2613 ac_fsusage_space=yes
2614 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
2615 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
2620 if test $ac_fsusage_space = no; then
2622 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
2623 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
2624 [AC_TRY_RUN([#include <sys/types.h>
2625 #ifdef HAVE_SYS_PARAM_H
2626 #include <sys/param.h>
2628 #ifdef HAVE_SYS_MOUNT_H
2629 #include <sys/mount.h>
2631 #ifdef HAVE_SYS_FS_TYPES_H
2632 #include <sys/fs_types.h>
2637 /* Ultrix's statfs returns 1 for success,
2638 0 for not mounted, -1 for failure. */
2639 exit (statfs (".", &fsd) != 1);
2641 fu_cv_sys_stat_fs_data=yes,
2642 fu_cv_sys_stat_fs_data=no,
2643 fu_cv_sys_stat_fs_data=no)])
2644 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
2645 if test $fu_cv_sys_stat_fs_data = yes; then
2646 ac_fsusage_space=yes
2647 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
2648 [ Define if statfs takes 2 args and the second argument has
2649 type struct fs_data. (Ultrix)])
2653 if test $ac_fsusage_space = no; then
2655 AC_TRY_CPP([#include <sys/filsys.h>
2657 AC_DEFINE(STAT_READ_FILSYS, 1,
2658 [Define if there is no specific function for reading filesystems usage
2659 information and you have the <sys/filsys.h> header file. (SVR2)])
2660 ac_fsusage_space=yes)
2663 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
2668 # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
2669 # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
2670 # enable the work-around code in fsusage.c.
2671 AC_DEFUN([jm_STATFS_TRUNCATES],
2673 AC_MSG_CHECKING([for statfs that truncates block counts])
2674 AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
2675 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
2676 #if !defined(sun) && !defined(__sun)
2677 choke -- this is a workaround for a Sun-specific problem
2679 #include <sys/types.h>
2680 #include <sys/vfs.h>]],
2681 [[struct statfs t; long c = *(t.f_spare);]])],
2682 [fu_cv_sys_truncating_statfs=yes],
2683 [fu_cv_sys_truncating_statfs=no])])
2684 if test $fu_cv_sys_truncating_statfs = yes; then
2685 AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
2686 [Define if the block counts reported by statfs may be truncated to 2GB
2687 and the correct values may be stored in the f_spare array.
2688 (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
2689 SunOS 4.1.1 seems not to be affected.)])
2691 AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
2695 # Prerequisites of lib/fsusage.c not done by jm_FILE_SYSTEM_USAGE.
2696 AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
2698 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2699 AC_CHECK_HEADERS_ONCE(fcntl.h)
2700 AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h sys/statvfs.h)
2704 # alloca.m4 serial 3
2705 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
2706 dnl This file is free software, distributed under the terms of the GNU
2707 dnl General Public License. As a special exception to the GNU General
2708 dnl Public License, this file may be distributed as part of a program
2709 dnl that contains a configuration script generated by Autoconf, under
2710 dnl the same distribution terms as the rest of that program.
2712 AC_DEFUN([gl_FUNC_ALLOCA],
2714 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2715 AC_REQUIRE([AC_PROG_CPP])
2716 AC_REQUIRE([AC_PROG_EGREP])
2718 AC_REQUIRE([AC_FUNC_ALLOCA])
2719 if test $ac_cv_func_alloca_works = no; then
2723 # Define an additional variable used in the Makefile substitution.
2725 AC_EGREP_CPP([Need own alloca], [
2726 #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
2732 AC_SUBST([ALLOCA_H])
2735 # Prerequisites of lib/alloca.c.
2736 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
2737 AC_DEFUN([gl_PREREQ_ALLOCA], [:])
2739 # atexit.m4 serial 1
2740 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2741 dnl This file is free software, distributed under the terms of the GNU
2742 dnl General Public License. As a special exception to the GNU General
2743 dnl Public License, this file may be distributed as part of a program
2744 dnl that contains a configuration script generated by Autoconf, under
2745 dnl the same distribution terms as the rest of that program.
2747 AC_DEFUN([gl_FUNC_ATEXIT],
2749 AC_REPLACE_FUNCS(atexit)
2750 if test $ac_cv_func_atexit = no; then
2755 # Prerequisites of lib/atexit.c.
2756 AC_DEFUN([gl_PREREQ_ATEXIT], [
2761 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2762 dnl This file is free software, distributed under the terms of the GNU
2763 dnl General Public License. As a special exception to the GNU General
2764 dnl Public License, this file may be distributed as part of a program
2765 dnl that contains a configuration script generated by Autoconf, under
2766 dnl the same distribution terms as the rest of that program.
2768 AC_DEFUN([gl_FUNC_DUP2],
2770 AC_REPLACE_FUNCS(dup2)
2771 if test $ac_cv_func_dup2 = no; then
2776 # Prerequisites of lib/dup2.c.
2777 AC_DEFUN([gl_PREREQ_DUP2], [
2778 AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
2782 # euidaccess.m4 serial 2
2783 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2784 dnl This file is free software, distributed under the terms of the GNU
2785 dnl General Public License. As a special exception to the GNU General
2786 dnl Public License, this file may be distributed as part of a program
2787 dnl that contains a configuration script generated by Autoconf, under
2788 dnl the same distribution terms as the rest of that program.
2790 AC_DEFUN([gl_FUNC_EUIDACCESS],
2792 dnl Persuade glibc <unistd.h> to declare euidaccess().
2793 AC_REQUIRE([AC_GNU_SOURCE])
2795 AC_CHECK_DECLS([euidaccess])
2796 AC_REPLACE_FUNCS(euidaccess)
2797 if test $ac_cv_func_euidaccess = no; then
2798 gl_PREREQ_EUIDACCESS
2802 # Prerequisites of lib/euidaccess.c.
2803 AC_DEFUN([gl_PREREQ_EUIDACCESS], [
2804 AC_CHECK_HEADERS_ONCE(unistd.h)
2805 AC_REQUIRE([AC_FUNC_GETGROUPS])
2809 # Check for fnmatch.
2811 # This is a modified version of autoconf's AC_FUNC_FNMATCH.
2812 # This file should be simplified after Autoconf 2.57 is required.
2814 # Copyright (C) 2000-2003 Free Software Foundation, Inc.
2816 # This program is free software; you can redistribute it and/or modify
2817 # it under the terms of the GNU General Public License as published by
2818 # the Free Software Foundation; either version 2, or (at your option)
2819 # any later version.
2821 # This program is distributed in the hope that it will be useful,
2822 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2823 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2824 # GNU General Public License for more details.
2826 # You should have received a copy of the GNU General Public License
2827 # along with this program; if not, write to the Free Software
2828 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2831 # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
2832 # -------------------------------------------------------------------------
2833 # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise
2834 # IF-FALSE. Use CACHE_VAR.
2835 AC_DEFUN([_AC_FUNC_FNMATCH_IF],
2837 [for working $1 fnmatch],
2839 [# Some versions of Solaris, SCO, and the GNU C Library
2840 # have a broken or incompatible fnmatch.
2841 # So we run a test program. If we are cross-compiling, take no chance.
2842 # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
2846 # include <stdlib.h>
2847 # include <fnmatch.h>
2848 # define y(a, b, c) (fnmatch (a, b, c) == 0)
2849 # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
2852 (!(y ("a*", "abc", 0)
2853 && n ("d*/*1", "d/s/1", FNM_PATHNAME)
2854 && y ("a\\\\bc", "abc", 0)
2855 && n ("a\\\\bc", "abc", FNM_NOESCAPE)
2856 && y ("*x", ".x", 0)
2857 && n ("*x", ".x", FNM_PERIOD)
2858 && m4_if([$1], [GNU],
2859 [y ("xxXX", "xXxX", FNM_CASEFOLD)
2860 && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
2861 && n ("d*/*1", "d/s/1", FNM_FILE_NAME)
2862 && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
2863 && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
2864 && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)],
2869 AS_IF([test $$2 = yes], [$3], [$4])
2870 ])# _AC_FUNC_FNMATCH_IF
2873 # _AC_LIBOBJ_FNMATCH
2874 # ------------------
2875 # Prepare the replacement of fnmatch.
2876 AC_DEFUN([_AC_LIBOBJ_FNMATCH],
2877 [AC_REQUIRE([AC_C_CONST])dnl
2878 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2879 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
2880 AC_CHECK_DECLS([getenv])
2881 AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
2882 AC_CHECK_HEADERS([wchar.h wctype.h])
2883 AC_LIBOBJ([fnmatch])
2885 AC_DEFINE(fnmatch, rpl_fnmatch,
2886 [Define to rpl_fnmatch if the replacement function should be used.])
2887 ])# _AC_LIBOBJ_FNMATCH
2890 AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
2893 _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix],
2894 [rm -f lib/fnmatch.h],
2895 [_AC_LIBOBJ_FNMATCH])
2896 if test $ac_cv_func_fnmatch_posix != yes; then
2897 dnl We must choose a different name for our function, since on ELF systems
2898 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
2899 dnl compiled into a shared library.
2900 AC_DEFINE([fnmatch], [posix_fnmatch],
2901 [Define to a replacement function name for fnmatch().])
2903 AC_SUBST([FNMATCH_H])
2907 AC_DEFUN([gl_FUNC_FNMATCH_GNU],
2909 dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
2910 AC_REQUIRE([AC_GNU_SOURCE])
2913 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
2914 [rm -f lib/fnmatch.h],
2915 [_AC_LIBOBJ_FNMATCH])
2916 if test $ac_cv_func_fnmatch_gnu != yes; then
2917 dnl We must choose a different name for our function, since on ELF systems
2918 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
2919 dnl compiled into a shared library.
2920 AC_DEFINE([fnmatch], [gnu_fnmatch],
2921 [Define to a replacement function name for fnmatch().])
2923 AC_SUBST([FNMATCH_H])
2926 # gethostname.m4 serial 1
2927 dnl Copyright (C) 2002 Free Software Foundation, Inc.
2928 dnl This file is free software, distributed under the terms of the GNU
2929 dnl General Public License. As a special exception to the GNU General
2930 dnl Public License, this file may be distributed as part of a program
2931 dnl that contains a configuration script generated by Autoconf, under
2932 dnl the same distribution terms as the rest of that program.
2934 AC_DEFUN([gl_FUNC_GETHOSTNAME],
2936 AC_REPLACE_FUNCS(gethostname)
2937 if test $ac_cv_func_gethostname = no; then
2938 gl_PREREQ_GETHOSTNAME
2942 # Prerequisites of lib/gethostname.c.
2943 AC_DEFUN([gl_PREREQ_GETHOSTNAME], [
2944 AC_CHECK_FUNCS(uname)
2950 # A replacement for autoconf's macro by the same name. This version
2951 # accepts an optional argument specifying the name of the $srcdir-relative
2952 # directory in which the file getloadavg.c may be found. It is unusual
2953 # (but justified, imho) that this file is required at ./configure time.
2955 undefine([AC_FUNC_GETLOADAVG])
2957 # AC_FUNC_GETLOADAVG
2958 # ------------------
2959 AC_DEFUN([AC_FUNC_GETLOADAVG],
2960 [ac_have_func=no # yes means we've found a way to get the load average.
2962 AC_CHECK_HEADERS_ONCE(fcntl.h locale.h unistd.h)
2963 AC_CHECK_HEADERS(mach/mach.h)
2964 AC_CHECK_FUNCS(setlocale)
2966 # By default, expect to find getloadavg.c in $srcdir/.
2967 ac_lib_dir_getloadavg=$srcdir
2968 # But if there's an argument, DIR, expect to find getloadavg.c in $srcdir/DIR.
2969 m4_ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1])
2970 # Make sure getloadavg.c is where it belongs, at ./configure-time.
2971 test -f $ac_lib_dir_getloadavg/getloadavg.c \
2972 || AC_MSG_ERROR([getloadavg.c is not in $ac_lib_dir_getloadavg])
2973 # FIXME: Add an autoconf-time test, too?
2977 # Check for getloadavg, but be sure not to touch the cache variable.
2978 (AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && ac_have_func=yes
2980 # On HPUX9, an unprivileged user can get load averages through this function.
2981 AC_CHECK_FUNCS(pstat_getdynamic)
2983 # Solaris has libkstat which does not require root.
2984 AC_CHECK_LIB(kstat, kstat_open)
2985 test $ac_cv_lib_kstat_kstat_open = yes && ac_have_func=yes
2987 # Some systems with -lutil have (and need) -lkvm as well, some do not.
2988 # On Solaris, -lkvm requires nlist from -lelf, so check that first
2989 # to get the right answer into the cache.
2990 # For kstat on solaris, we need libelf to force the definition of SVR4 below.
2991 if test $ac_have_func = no; then
2992 AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
2994 if test $ac_have_func = no; then
2995 AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
2996 # Check for the 4.4BSD definition of getloadavg.
2997 AC_CHECK_LIB(util, getloadavg,
2998 [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
3001 if test $ac_have_func = no; then
3002 # There is a commonly available library for RS/6000 AIX.
3003 # Since it is not a standard part of AIX, it might be installed locally.
3004 ac_getloadavg_LIBS=$LIBS
3005 LIBS="-L/usr/local/lib $LIBS"
3006 AC_CHECK_LIB(getloadavg, getloadavg,
3007 [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
3010 # Make sure it is really in the library, if we think we found it,
3011 # otherwise set up the replacement function.
3012 AC_CHECK_FUNCS(getloadavg, [],
3013 [_AC_LIBOBJ_GETLOADAVG])
3015 # Some definitions of getloadavg require that the program be installed setgid.
3016 AC_CACHE_CHECK(whether getloadavg requires setgid,
3017 ac_cv_func_getloadavg_setgid,
3018 [AC_EGREP_CPP([Yowza Am I SETGID yet],
3019 [#include "$ac_lib_dir_getloadavg/getloadavg.c"
3020 #ifdef LDAV_PRIVILEGED
3021 Yowza Am I SETGID yet
3023 ac_cv_func_getloadavg_setgid=yes,
3024 ac_cv_func_getloadavg_setgid=no)])
3025 if test $ac_cv_func_getloadavg_setgid = yes; then
3027 AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
3028 [Define if the `getloadavg' function needs to be run setuid
3033 AC_SUBST(NEED_SETGID)dnl
3035 if test $ac_cv_func_getloadavg_setgid = yes; then
3036 AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem,
3037 [ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
3038 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
3039 # If we got an error (system does not support symlinks), try without -L.
3040 test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
3041 ac_cv_group_kmem=`echo $ac_ls_output \
3042 | sed -ne ['s/[ ][ ]*/ /g;
3043 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
3046 AC_SUBST(KMEM_GROUP, $ac_cv_group_kmem)dnl
3048 if test "x$ac_save_LIBS" = x; then
3049 GETLOADAVG_LIBS=$LIBS
3051 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"`
3055 AC_SUBST(GETLOADAVG_LIBS)dnl
3056 ])# AC_FUNC_GETLOADAVG
3059 AC_DEFUN([gl_FUNC_GETLOADAVG],
3061 AC_FUNC_GETLOADAVG([lib])
3062 dnl Note AC_FUNC_GETLOADAVG does AC_LIBOBJ(getloadavg).
3063 if test $ac_cv_func_getloadavg = no; then
3064 gl_PREREQ_GETLOADAVG
3068 # Prerequisites of lib/getloadavg.c not done by autoconf's AC_FUNC_GETLOADAVG.
3069 AC_DEFUN([gl_PREREQ_GETLOADAVG],
3071 AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
3074 # getpass.m4 serial 2
3075 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3076 dnl This file is free software, distributed under the terms of the GNU
3077 dnl General Public License. As a special exception to the GNU General
3078 dnl Public License, this file may be distributed as part of a program
3079 dnl that contains a configuration script generated by Autoconf, under
3080 dnl the same distribution terms as the rest of that program.
3082 # Provide a getpass() function if the system doesn't have it.
3083 AC_DEFUN([gl_FUNC_GETPASS],
3085 AC_REPLACE_FUNCS(getpass)
3086 if test $ac_cv_func_getpass = no; then
3091 # Provide the GNU getpass() implementation. It supports passwords of
3092 # arbitrary length (not just 8 bytes as on HP-UX).
3093 AC_DEFUN([gl_FUNC_GETPASS_GNU],
3095 dnl TODO: Detect when GNU getpass() is already found in glibc.
3098 dnl We must choose a different name for our function, since on ELF systems
3099 dnl an unusable getpass() in libc.so would override our getpass() if it is
3100 dnl compiled into a shared library.
3101 AC_DEFINE([getpass], [gnu_getpass],
3102 [Define to a replacement function name for getpass().])
3105 # Prerequisites of lib/getpass.c.
3106 AC_DEFUN([gl_PREREQ_GETPASS], [
3111 # getusershell.m4 serial 2
3112 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3113 dnl This file is free software, distributed under the terms of the GNU
3114 dnl General Public License. As a special exception to the GNU General
3115 dnl Public License, this file may be distributed as part of a program
3116 dnl that contains a configuration script generated by Autoconf, under
3117 dnl the same distribution terms as the rest of that program.
3119 AC_DEFUN([gl_FUNC_GETUSERSHELL],
3121 AC_REPLACE_FUNCS(getusershell)
3122 if test $ac_cv_func_getusershell = no; then
3123 gl_PREREQ_GETUSERSHELL
3127 # Prerequisites of lib/getusershell.c.
3128 AC_DEFUN([gl_PREREQ_GETUSERSHELL], [
3129 AC_REQUIRE([AC_HEADER_STDC])
3130 AC_CHECK_FUNCS_ONCE(isascii)
3133 # memchr.m4 serial 2
3134 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3135 dnl This file is free software, distributed under the terms of the GNU
3136 dnl General Public License. As a special exception to the GNU General
3137 dnl Public License, this file may be distributed as part of a program
3138 dnl that contains a configuration script generated by Autoconf, under
3139 dnl the same distribution terms as the rest of that program.
3141 AC_DEFUN([gl_FUNC_MEMCHR],
3143 AC_REPLACE_FUNCS(memchr)
3144 if test $ac_cv_func_memchr = no; then
3149 # Prerequisites of lib/memchr.c.
3150 AC_DEFUN([jm_PREREQ_MEMCHR], [
3151 AC_CHECK_HEADERS(bp-sym.h)
3154 # memcpy.m4 serial 1
3155 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3156 dnl This file is free software, distributed under the terms of the GNU
3157 dnl General Public License. As a special exception to the GNU General
3158 dnl Public License, this file may be distributed as part of a program
3159 dnl that contains a configuration script generated by Autoconf, under
3160 dnl the same distribution terms as the rest of that program.
3162 AC_DEFUN([gl_FUNC_MEMCPY],
3164 AC_REPLACE_FUNCS(memcpy)
3165 if test $ac_cv_func_memcpy = no; then
3170 # Prerequisites of lib/memcpy.c.
3171 AC_DEFUN([gl_PREREQ_MEMCPY], [
3175 # memmove.m4 serial 1
3176 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3177 dnl This file is free software, distributed under the terms of the GNU
3178 dnl General Public License. As a special exception to the GNU General
3179 dnl Public License, this file may be distributed as part of a program
3180 dnl that contains a configuration script generated by Autoconf, under
3181 dnl the same distribution terms as the rest of that program.
3183 AC_DEFUN([gl_FUNC_MEMMOVE],
3185 AC_REPLACE_FUNCS(memmove)
3186 if test $ac_cv_func_memmove = no; then
3191 # Prerequisites of lib/memmove.c.
3192 AC_DEFUN([gl_PREREQ_MEMMOVE], [
3196 # memrchr.m4 serial 2
3197 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3198 dnl This file is free software, distributed under the terms of the GNU
3199 dnl General Public License. As a special exception to the GNU General
3200 dnl Public License, this file may be distributed as part of a program
3201 dnl that contains a configuration script generated by Autoconf, under
3202 dnl the same distribution terms as the rest of that program.
3204 AC_DEFUN([gl_FUNC_MEMRCHR],
3206 dnl Persuade glibc <string.h> to declare memrchr().
3207 AC_REQUIRE([AC_GNU_SOURCE])
3209 AC_REPLACE_FUNCS(memrchr)
3210 if test $ac_cv_func_memrchr = no; then
3215 # Prerequisites of lib/memrchr.c.
3216 AC_DEFUN([gl_PREREQ_MEMRCHR], [:])
3218 # memset.m4 serial 1
3219 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3220 dnl This file is free software, distributed under the terms of the GNU
3221 dnl General Public License. As a special exception to the GNU General
3222 dnl Public License, this file may be distributed as part of a program
3223 dnl that contains a configuration script generated by Autoconf, under
3224 dnl the same distribution terms as the rest of that program.
3226 AC_DEFUN([gl_FUNC_MEMSET],
3228 AC_REPLACE_FUNCS(memset)
3229 if test $ac_cv_func_memset = no; then
3234 # Prerequisites of lib/memset.c.
3235 AC_DEFUN([gl_PREREQ_MEMSET], [
3239 # mktime.m4 serial 4
3240 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3241 dnl This file is free software, distributed under the terms of the GNU
3242 dnl General Public License. As a special exception to the GNU General
3243 dnl Public License, this file may be distributed as part of a program
3244 dnl that contains a configuration script generated by Autoconf, under
3245 dnl the same distribution terms as the rest of that program.
3247 dnl From Jim Meyering.
3249 # Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.57 and earlier.
3250 # This redefinition can be removed once a new version of Autoconf comes out.
3251 # The redefinition is taken from
3252 # <http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/autoconf/autoconf/lib/autoconf/functions.m4?rev=1.78>.
3255 AC_DEFUN([AC_FUNC_MKTIME],
3256 [AC_REQUIRE([AC_HEADER_TIME])dnl
3257 AC_CHECK_HEADERS(stdlib.h sys/time.h unistd.h)
3258 AC_CHECK_FUNCS(alarm)
3259 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
3260 [AC_RUN_IFELSE([AC_LANG_SOURCE(
3261 [[/* Test program from Paul Eggert and Tony Leneis. */
3262 #if TIME_WITH_SYS_TIME
3263 # include <sys/time.h>
3266 # if HAVE_SYS_TIME_H
3267 # include <sys/time.h>
3274 # include <stdlib.h>
3278 # include <unistd.h>
3282 # define alarm(X) /* empty */
3285 /* Work around redefinition to rpl_putenv by other config tests. */
3288 static time_t time_t_max;
3289 static time_t time_t_min;
3291 /* Values we'll use to set the TZ environment variable. */
3292 static char *tz_strings[] = {
3293 (char *) 0, "TZ=GMT0", "TZ=JST-9",
3294 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
3296 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
3298 /* Fail if mktime fails to convert a date in the spring-forward gap.
3299 Based on a problem report from Andreas Jaeger. */
3301 spring_forward_gap ()
3303 /* glibc (up to about 1998-10-07) failed this test. */
3306 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
3307 instead of "TZ=America/Vancouver" in order to detect the bug even
3308 on systems that don't support the Olson extension, or don't have the
3309 full zoneinfo tables installed. */
3310 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
3319 if (mktime (&tm) == (time_t)-1)
3328 if ((lt = localtime (&now)) && mktime (lt) != now)
3337 mktime_test1 ((time_t) (time_t_max - now));
3338 mktime_test1 ((time_t) (time_t_min + now));
3344 /* Based on code from Ariel Faigon. */
3354 if (tm.tm_mon != 2 || tm.tm_mday != 31)
3364 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
3366 if (now != (time_t) -1)
3368 struct tm *lt = localtime (&now);
3370 && lt->tm_year == tm.tm_year
3371 && lt->tm_mon == tm.tm_mon
3372 && lt->tm_mday == tm.tm_mday
3373 && lt->tm_hour == tm.tm_hour
3374 && lt->tm_min == tm.tm_min
3375 && lt->tm_sec == tm.tm_sec
3376 && lt->tm_yday == tm.tm_yday
3377 && lt->tm_wday == tm.tm_wday
3378 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
3379 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
3390 /* This test makes some buggy mktime implementations loop.
3391 Give up after 60 seconds; a mktime slower than that
3392 isn't worth using anyway. */
3395 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
3398 if ((time_t) -1 < 0)
3399 for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
3401 delta = time_t_max / 997; /* a suitable prime number */
3402 for (i = 0; i < N_STRINGS; i++)
3405 putenv (tz_strings[i]);
3407 for (t = 0; t <= time_t_max - delta; t += delta)
3409 mktime_test ((time_t) 1);
3410 mktime_test ((time_t) (60 * 60));
3411 mktime_test ((time_t) (60 * 60 * 24));
3413 for (j = 1; 0 < j; j *= 2)
3415 bigtime_test (j - 1);
3418 spring_forward_gap ();
3421 [ac_cv_func_working_mktime=yes],
3422 [ac_cv_func_working_mktime=no],
3423 [ac_cv_func_working_mktime=no])])
3424 if test $ac_cv_func_working_mktime = no; then
3429 AC_DEFUN([gl_FUNC_MKTIME],
3431 AC_REQUIRE([AC_FUNC_MKTIME])
3432 if test $ac_cv_func_working_mktime = no; then
3433 AC_DEFINE(mktime, rpl_mktime,
3434 [Define to rpl_mktime if the replacement function should be used.])
3439 # Prerequisites of lib/mktime.c.
3440 AC_DEFUN([gl_PREREQ_MKTIME], [:])
3442 # readlink.m4 serial 2
3443 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3444 dnl This file is free software, distributed under the terms of the GNU
3445 dnl General Public License. As a special exception to the GNU General
3446 dnl Public License, this file may be distributed as part of a program
3447 dnl that contains a configuration script generated by Autoconf, under
3448 dnl the same distribution terms as the rest of that program.
3450 AC_DEFUN([gl_FUNC_READLINK],
3452 AC_CHECK_FUNCS(readlink)
3453 if test $ac_cv_func_readlink = no; then
3459 # Prerequisites of lib/readlink.c.
3460 AC_DEFUN([gl_PREREQ_READLINK],
3466 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3467 dnl This file is free software, distributed under the terms of the GNU
3468 dnl General Public License. As a special exception to the GNU General
3469 dnl Public License, this file may be distributed as part of a program
3470 dnl that contains a configuration script generated by Autoconf, under
3471 dnl the same distribution terms as the rest of that program.
3473 AC_DEFUN([gl_FUNC_RMDIR],
3475 AC_REPLACE_FUNCS(rmdir)
3476 if test $ac_cv_func_rmdir = no; then
3481 # Prerequisites of lib/rmdir.c.
3482 AC_DEFUN([gl_PREREQ_RMDIR], [
3483 AC_REQUIRE([AC_HEADER_STAT])
3488 # rpmatch.m4 serial 4
3489 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3490 dnl This file is free software, distributed under the terms of the GNU
3491 dnl General Public License. As a special exception to the GNU General
3492 dnl Public License, this file may be distributed as part of a program
3493 dnl that contains a configuration script generated by Autoconf, under
3494 dnl the same distribution terms as the rest of that program.
3496 AC_DEFUN([gl_FUNC_RPMATCH],
3498 AC_REPLACE_FUNCS(rpmatch)
3499 if test $ac_cv_func_rpmatch = no; then
3504 # Prerequisites of lib/rpmatch.c.
3505 AC_DEFUN([gl_PREREQ_RPMATCH], [:])
3507 # sig2str.m4 serial 1
3508 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3509 dnl This file is free software, distributed under the terms of the GNU
3510 dnl General Public License. As a special exception to the GNU General
3511 dnl Public License, this file may be distributed as part of a program
3512 dnl that contains a configuration script generated by Autoconf, under
3513 dnl the same distribution terms as the rest of that program.
3515 AC_DEFUN([gl_FUNC_SIG2STR],
3517 AC_REPLACE_FUNCS(sig2str)
3518 if test $ac_cv_func_sig2str = no; then
3523 # Prerequisites of lib/sig2str.c.
3524 AC_DEFUN([gl_PREREQ_SIG2STR], [
3529 # stpcpy.m4 serial 1
3530 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3531 dnl This file is free software, distributed under the terms of the GNU
3532 dnl General Public License. As a special exception to the GNU General
3533 dnl Public License, this file may be distributed as part of a program
3534 dnl that contains a configuration script generated by Autoconf, under
3535 dnl the same distribution terms as the rest of that program.
3537 AC_DEFUN([gl_FUNC_STPCPY],
3539 dnl Persuade glibc <string.h> to declare stpcpy().
3540 AC_REQUIRE([AC_GNU_SOURCE])
3542 AC_REPLACE_FUNCS(stpcpy)
3543 if test $ac_cv_func_stpcpy = no; then
3548 # Prerequisites of lib/stpcpy.c.
3549 AC_DEFUN([gl_PREREQ_STPCPY], [
3554 # strcspn.m4 serial 2
3555 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3556 dnl This file is free software, distributed under the terms of the GNU
3557 dnl General Public License. As a special exception to the GNU General
3558 dnl Public License, this file may be distributed as part of a program
3559 dnl that contains a configuration script generated by Autoconf, under
3560 dnl the same distribution terms as the rest of that program.
3562 AC_DEFUN([gl_FUNC_STRCSPN],
3564 AC_REPLACE_FUNCS(strcspn)
3565 if test $ac_cv_func_strcspn = no; then
3570 # Prerequisites of lib/strcspn.c.
3571 AC_DEFUN([gl_PREREQ_STRCSPN], [:])
3573 # strdup.m4 serial 2
3574 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3575 dnl This file is free software, distributed under the terms of the GNU
3576 dnl General Public License. As a special exception to the GNU General
3577 dnl Public License, this file may be distributed as part of a program
3578 dnl that contains a configuration script generated by Autoconf, under
3579 dnl the same distribution terms as the rest of that program.
3581 AC_DEFUN([gl_FUNC_STRDUP],
3583 AC_REPLACE_FUNCS(strdup)
3584 if test $ac_cv_func_strdup = no; then
3589 # Prerequisites of lib/strdup.c.
3590 AC_DEFUN([gl_PREREQ_STRDUP], [
3595 # strndup.m4 serial 1
3596 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3597 dnl This file is free software, distributed under the terms of the GNU
3598 dnl General Public License. As a special exception to the GNU General
3599 dnl Public License, this file may be distributed as part of a program
3600 dnl that contains a configuration script generated by Autoconf, under
3601 dnl the same distribution terms as the rest of that program.
3603 AC_DEFUN([gl_FUNC_STRNDUP],
3605 dnl Persuade glibc <string.h> to declare strndup().
3606 AC_REQUIRE([AC_GNU_SOURCE])
3608 AC_REPLACE_FUNCS(strndup)
3609 if test $ac_cv_func_strndup = no; then
3614 # Prerequisites of lib/strndup.c.
3615 AC_DEFUN([gl_PREREQ_STRNDUP], [
3616 AC_REQUIRE([AC_HEADER_STDC])
3617 AC_CHECK_DECLS(strnlen)
3621 # strnlen.m4 serial 3
3622 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3623 dnl This file is free software, distributed under the terms of the GNU
3624 dnl General Public License. As a special exception to the GNU General
3625 dnl Public License, this file may be distributed as part of a program
3626 dnl that contains a configuration script generated by Autoconf, under
3627 dnl the same distribution terms as the rest of that program.
3629 AC_DEFUN([gl_FUNC_STRNLEN],
3631 dnl Persuade glibc <string.h> to declare strnlen().
3632 AC_REQUIRE([AC_GNU_SOURCE])
3635 if test $ac_cv_func_strnlen_working = no; then
3636 # This is necessary because automake-1.6.1 doens't understand
3637 # that the above use of AC_FUNC_STRNLEN means we may have to use
3640 AC_DEFINE(strnlen, rpl_strnlen,
3641 [Define to rpl_strnlen if the replacement function should be used.])
3646 # Prerequisites of lib/strnlen.c.
3647 AC_DEFUN([gl_PREREQ_STRNLEN], [:])
3649 # strpbrk.m4 serial 2
3650 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3651 dnl This file is free software, distributed under the terms of the GNU
3652 dnl General Public License. As a special exception to the GNU General
3653 dnl Public License, this file may be distributed as part of a program
3654 dnl that contains a configuration script generated by Autoconf, under
3655 dnl the same distribution terms as the rest of that program.
3657 AC_DEFUN([gl_FUNC_STRPBRK],
3659 AC_REPLACE_FUNCS(strpbrk)
3660 if test $ac_cv_func_strpbrk = no; then
3665 # Prerequisites of lib/strpbrk.c.
3666 AC_DEFUN([gl_PREREQ_STRPBRK], [:])
3668 # strstr.m4 serial 2
3669 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3670 dnl This file is free software, distributed under the terms of the GNU
3671 dnl General Public License. As a special exception to the GNU General
3672 dnl Public License, this file may be distributed as part of a program
3673 dnl that contains a configuration script generated by Autoconf, under
3674 dnl the same distribution terms as the rest of that program.
3676 AC_DEFUN([gl_FUNC_STRSTR],
3678 AC_REPLACE_FUNCS(strstr)
3679 if test $ac_cv_func_strstr = no; then
3684 # Prerequisites of lib/strstr.c.
3685 AC_DEFUN([gl_PREREQ_STRSTR], [:])
3687 # strtod.m4 serial 3
3688 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3689 dnl This file is free software, distributed under the terms of the GNU
3690 dnl General Public License. As a special exception to the GNU General
3691 dnl Public License, this file may be distributed as part of a program
3692 dnl that contains a configuration script generated by Autoconf, under
3693 dnl the same distribution terms as the rest of that program.
3695 AC_DEFUN([gl_FUNC_STRTOD],
3697 AC_REQUIRE([AC_FUNC_STRTOD])
3698 if test $ac_cv_func_strtod = no; then
3699 AC_DEFINE(strtod, rpl_strtod,
3700 [Define to rpl_strtod if the replacement function should be used.])
3705 # Prerequisites of lib/strtod.c.
3706 # The need for pow() is already handled by AC_FUNC_STRTOD.
3707 AC_DEFUN([gl_PREREQ_STRTOD], [
3708 AC_REQUIRE([AC_HEADER_STDC])
3709 AC_CHECK_FUNCS_ONCE(isascii)
3712 # strtoimax.m4 serial 3
3713 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3714 dnl This file is free software, distributed under the terms of the GNU
3715 dnl General Public License. As a special exception to the GNU General
3716 dnl Public License, this file may be distributed as part of a program
3717 dnl that contains a configuration script generated by Autoconf, under
3718 dnl the same distribution terms as the rest of that program.
3720 AC_DEFUN([gl_FUNC_STRTOIMAX],
3722 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
3723 AC_REQUIRE([AC_PROG_CPP])
3724 AC_REQUIRE([AC_PROG_EGREP])
3726 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3727 jm_cv_func_strtoimax_macro,
3728 [AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3730 inttypes_h_defines_strtoimax
3732 jm_cv_func_strtoimax_macro=yes,
3733 jm_cv_func_strtoimax_macro=no)])
3735 if test "$jm_cv_func_strtoimax_macro" != yes; then
3736 AC_REPLACE_FUNCS(strtoimax)
3737 if test $ac_cv_func_strtoimax = no; then
3743 # Prerequisites of lib/strtoimax.c.
3744 AC_DEFUN([gl_PREREQ_STRTOIMAX], [
3746 AC_CHECK_DECLS(strtoll)
3747 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3750 # intmax_t.m4 serial 2
3751 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
3752 dnl This file is free software, distributed under the terms of the GNU
3753 dnl General Public License. As a special exception to the GNU General
3754 dnl Public License, this file may be distributed as part of a program
3755 dnl that contains a configuration script generated by Autoconf, under
3756 dnl the same distribution terms as the rest of that program.
3758 dnl From Paul Eggert.
3762 # Define intmax_t to 'long' or 'long long'
3763 # if it is not already defined in <stdint.h> or <inttypes.h>.
3765 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
3767 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
3768 dnl only if it defines 'uintmax_t'.
3769 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3770 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3771 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3772 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3773 test $ac_cv_type_long_long = yes \
3774 && ac_type='long long' \
3776 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3777 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
3779 AC_DEFINE(HAVE_INTMAX_T, 1,
3780 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3784 dnl An alternative would be to explicitly test for 'intmax_t'.
3786 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
3788 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3789 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3790 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3794 #if HAVE_STDINT_H_WITH_UINTMAX
3797 #if HAVE_INTTYPES_H_WITH_UINTMAX
3798 #include <inttypes.h>
3800 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3801 if test $gt_cv_c_intmax_t = yes; then
3802 AC_DEFINE(HAVE_INTMAX_T, 1,
3803 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3805 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3806 test $ac_cv_type_long_long = yes \
3807 && ac_type='long long' \
3809 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3810 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
3814 # longlong.m4 serial 4
3815 dnl Copyright (C) 1999-2003 Free Software Foundation, Inc.
3816 dnl This file is free software, distributed under the terms of the GNU
3817 dnl General Public License. As a special exception to the GNU General
3818 dnl Public License, this file may be distributed as part of a program
3819 dnl that contains a configuration script generated by Autoconf, under
3820 dnl the same distribution terms as the rest of that program.
3822 dnl From Paul Eggert.
3824 # Define HAVE_LONG_LONG if 'long long' works.
3826 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
3828 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
3829 [AC_TRY_LINK([long long ll = 1LL; int i = 63;],
3830 [long long llmax = (long long) -1;
3831 return ll << i | ll >> i | llmax / ll | llmax % ll;],
3832 ac_cv_type_long_long=yes,
3833 ac_cv_type_long_long=no)])
3834 if test $ac_cv_type_long_long = yes; then
3835 AC_DEFINE(HAVE_LONG_LONG, 1,
3836 [Define if you have the 'long long' type.])
3840 # strtoll.m4 serial 1
3841 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3842 dnl This file is free software, distributed under the terms of the GNU
3843 dnl General Public License. As a special exception to the GNU General
3844 dnl Public License, this file may be distributed as part of a program
3845 dnl that contains a configuration script generated by Autoconf, under
3846 dnl the same distribution terms as the rest of that program.
3848 AC_DEFUN([gl_FUNC_STRTOLL],
3850 dnl We don't need (and can't compile) the replacement strtoll
3851 dnl unless the type 'long long' exists.
3852 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3853 if test "$ac_cv_type_long_long" = yes; then
3854 AC_REPLACE_FUNCS(strtoll)
3855 if test $ac_cv_func_strtoll = no; then
3861 # Prerequisites of lib/strtoll.c.
3862 AC_DEFUN([gl_PREREQ_STRTOLL], [
3867 # strtol.m4 serial 2
3868 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
3869 dnl This file is free software, distributed under the terms of the GNU
3870 dnl General Public License. As a special exception to the GNU General
3871 dnl Public License, this file may be distributed as part of a program
3872 dnl that contains a configuration script generated by Autoconf, under
3873 dnl the same distribution terms as the rest of that program.
3875 AC_DEFUN([gl_FUNC_STRTOL],
3877 AC_REPLACE_FUNCS(strtol)
3878 if test $ac_cv_func_strtol = no; then
3883 # Prerequisites of lib/strtol.c.
3884 AC_DEFUN([gl_PREREQ_STRTOL], [
3885 AC_REQUIRE([AC_HEADER_STDC])
3886 AC_CHECK_FUNCS_ONCE(isascii)
3889 # strtoull.m4 serial 1
3890 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3891 dnl This file is free software, distributed under the terms of the GNU
3892 dnl General Public License. As a special exception to the GNU General
3893 dnl Public License, this file may be distributed as part of a program
3894 dnl that contains a configuration script generated by Autoconf, under
3895 dnl the same distribution terms as the rest of that program.
3897 AC_DEFUN([gl_FUNC_STRTOULL],
3899 dnl We don't need (and can't compile) the replacement strtoull
3900 dnl unless the type 'unsigned long long' exists.
3901 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3902 if test "$ac_cv_type_unsigned_long_long" = yes; then
3903 AC_REPLACE_FUNCS(strtoull)
3904 if test $ac_cv_func_strtoull = no; then
3910 # Prerequisites of lib/strtoull.c.
3911 AC_DEFUN([gl_PREREQ_STRTOULL], [
3916 # strtoul.m4 serial 1
3917 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3918 dnl This file is free software, distributed under the terms of the GNU
3919 dnl General Public License. As a special exception to the GNU General
3920 dnl Public License, this file may be distributed as part of a program
3921 dnl that contains a configuration script generated by Autoconf, under
3922 dnl the same distribution terms as the rest of that program.
3924 AC_DEFUN([gl_FUNC_STRTOUL],
3926 AC_REPLACE_FUNCS(strtoul)
3927 if test $ac_cv_func_strtoul = no; then
3932 # Prerequisites of lib/strtoul.c.
3933 AC_DEFUN([gl_PREREQ_STRTOUL], [
3937 # strtoumax.m4 serial 3
3938 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3939 dnl This file is free software, distributed under the terms of the GNU
3940 dnl General Public License. As a special exception to the GNU General
3941 dnl Public License, this file may be distributed as part of a program
3942 dnl that contains a configuration script generated by Autoconf, under
3943 dnl the same distribution terms as the rest of that program.
3945 AC_DEFUN([gl_FUNC_STRTOUMAX],
3947 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
3948 AC_REQUIRE([AC_PROG_CPP])
3949 AC_REQUIRE([AC_PROG_EGREP])
3951 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3952 jm_cv_func_strtoumax_macro,
3953 [AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3955 inttypes_h_defines_strtoumax
3957 jm_cv_func_strtoumax_macro=yes,
3958 jm_cv_func_strtoumax_macro=no)])
3960 if test "$jm_cv_func_strtoumax_macro" != yes; then
3961 AC_REPLACE_FUNCS(strtoumax)
3962 if test $ac_cv_func_strtoumax = no; then
3968 # Prerequisites of lib/strtoumax.c.
3969 AC_DEFUN([gl_PREREQ_STRTOUMAX], [
3970 jm_AC_TYPE_UINTMAX_T
3971 AC_CHECK_DECLS(strtoull)
3972 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3975 # strverscmp.m4 serial 1
3976 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3977 dnl This file is free software, distributed under the terms of the GNU
3978 dnl General Public License. As a special exception to the GNU General
3979 dnl Public License, this file may be distributed as part of a program
3980 dnl that contains a configuration script generated by Autoconf, under
3981 dnl the same distribution terms as the rest of that program.
3983 AC_DEFUN([gl_FUNC_STRVERSCMP],
3985 dnl Persuade glibc <string.h> to declare strverscmp().
3986 AC_REQUIRE([AC_GNU_SOURCE])
3988 AC_REPLACE_FUNCS(strverscmp)
3989 if test $ac_cv_func_strverscmp = no; then
3990 gl_PREREQ_STRVERSCMP
3994 # Prerequisites of lib/strverscmp.c.
3995 AC_DEFUN([gl_PREREQ_STRVERSCMP], [
4000 # vasnprintf.m4 serial 2
4001 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4002 dnl This file is free software, distributed under the terms of the GNU
4003 dnl General Public License. As a special exception to the GNU General
4004 dnl Public License, this file may be distributed as part of a program
4005 dnl that contains a configuration script generated by Autoconf, under
4006 dnl the same distribution terms as the rest of that program.
4008 AC_DEFUN([gl_FUNC_VASNPRINTF],
4010 AC_REPLACE_FUNCS(vasnprintf)
4011 if test $ac_cv_func_vasnprintf = no; then
4012 AC_LIBOBJ(printf-args)
4013 AC_LIBOBJ(printf-parse)
4014 AC_LIBOBJ(asnprintf)
4015 gl_PREREQ_PRINTF_ARGS
4016 gl_PREREQ_PRINTF_PARSE
4017 gl_PREREQ_VASNPRINTF
4022 # Prequisites of lib/printf-args.h, lib/printf-args.c.
4023 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
4025 AC_REQUIRE([bh_C_SIGNED])
4026 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4027 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4028 AC_REQUIRE([gt_TYPE_WCHAR_T])
4029 AC_REQUIRE([gt_TYPE_WINT_T])
4032 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
4033 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
4035 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4036 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4037 AC_REQUIRE([gt_TYPE_WCHAR_T])
4038 AC_REQUIRE([gt_TYPE_WINT_T])
4039 AC_REQUIRE([AC_TYPE_SIZE_T])
4040 AC_CHECK_TYPES(ptrdiff_t)
4041 AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
4044 # Prerequisites of lib/vasnprintf.c.
4045 AC_DEFUN([gl_PREREQ_VASNPRINTF],
4047 AC_REQUIRE([AC_FUNC_ALLOCA])
4048 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4049 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4050 AC_REQUIRE([gt_TYPE_WCHAR_T])
4051 AC_REQUIRE([gt_TYPE_WINT_T])
4052 AC_CHECK_FUNCS(snprintf wcslen)
4055 # Prerequisites of lib/asnprintf.c.
4056 AC_DEFUN([gl_PREREQ_ASNPRINTF],
4060 # signed.m4 serial 1 (gettext-0.10.40)
4061 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4062 dnl This file is free software, distributed under the terms of the GNU
4063 dnl General Public License. As a special exception to the GNU General
4064 dnl Public License, this file may be distributed as part of a program
4065 dnl that contains a configuration script generated by Autoconf, under
4066 dnl the same distribution terms as the rest of that program.
4068 dnl From Bruno Haible.
4070 AC_DEFUN([bh_C_SIGNED],
4072 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
4073 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
4074 if test $bh_cv_c_signed = no; then
4076 [Define to empty if the C compiler doesn't support this keyword.])
4080 # longdouble.m4 serial 1 (gettext-0.12)
4081 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4082 dnl This file is free software, distributed under the terms of the GNU
4083 dnl General Public License. As a special exception to the GNU General
4084 dnl Public License, this file may be distributed as part of a program
4085 dnl that contains a configuration script generated by Autoconf, under
4086 dnl the same distribution terms as the rest of that program.
4088 dnl From Bruno Haible.
4089 dnl Test whether the compiler supports the 'long double' type.
4090 dnl Prerequisite: AC_PROG_CC
4092 AC_DEFUN([gt_TYPE_LONGDOUBLE],
4094 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
4095 [if test "$GCC" = yes; then
4096 gt_cv_c_long_double=yes
4099 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
4100 long double foo = 0.0;
4101 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
4102 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
4104 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
4106 if test $gt_cv_c_long_double = yes; then
4107 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
4111 # wchar_t.m4 serial 1 (gettext-0.12)
4112 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4113 dnl This file is free software, distributed under the terms of the GNU
4114 dnl General Public License. As a special exception to the GNU General
4115 dnl Public License, this file may be distributed as part of a program
4116 dnl that contains a configuration script generated by Autoconf, under
4117 dnl the same distribution terms as the rest of that program.
4119 dnl From Bruno Haible.
4120 dnl Test whether <stddef.h> has the 'wchar_t' type.
4121 dnl Prerequisite: AC_PROG_CC
4123 AC_DEFUN([gt_TYPE_WCHAR_T],
4125 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
4126 [AC_TRY_COMPILE([#include <stddef.h>
4127 wchar_t foo = (wchar_t)'\0';], ,
4128 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
4129 if test $gt_cv_c_wchar_t = yes; then
4130 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
4134 # wint_t.m4 serial 1 (gettext-0.12)
4135 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4136 dnl This file is free software, distributed under the terms of the GNU
4137 dnl General Public License. As a special exception to the GNU General
4138 dnl Public License, this file may be distributed as part of a program
4139 dnl that contains a configuration script generated by Autoconf, under
4140 dnl the same distribution terms as the rest of that program.
4142 dnl From Bruno Haible.
4143 dnl Test whether <wchar.h> has the 'wint_t' type.
4144 dnl Prerequisite: AC_PROG_CC
4146 AC_DEFUN([gt_TYPE_WINT_T],
4148 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
4149 [AC_TRY_COMPILE([#include <wchar.h>
4150 wint_t foo = (wchar_t)'\0';], ,
4151 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
4152 if test $gt_cv_c_wint_t = yes; then
4153 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
4157 # vasprintf.m4 serial 1
4158 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4159 dnl This file is free software, distributed under the terms of the GNU
4160 dnl General Public License. As a special exception to the GNU General
4161 dnl Public License, this file may be distributed as part of a program
4162 dnl that contains a configuration script generated by Autoconf, under
4163 dnl the same distribution terms as the rest of that program.
4165 AC_DEFUN([gl_FUNC_VASPRINTF],
4167 AC_REPLACE_FUNCS(vasprintf)
4168 if test $ac_cv_func_vasprintf = no; then
4175 # Prerequisites of lib/vasprintf.c.
4176 AC_DEFUN([gl_PREREQ_VASPRINTF],
4180 # Prerequisites of lib/asprintf.c.
4181 AC_DEFUN([gl_PREREQ_ASPRINTF],
4185 # getdate.m4 serial 2
4186 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4187 dnl This file is free software, distributed under the terms of the GNU
4188 dnl General Public License. As a special exception to the GNU General
4189 dnl Public License, this file may be distributed as part of a program
4190 dnl that contains a configuration script generated by Autoconf, under
4191 dnl the same distribution terms as the rest of that program.
4193 AC_DEFUN([gl_GETDATE],
4195 dnl Prerequisites of lib/getdate.h.
4197 AC_CHECK_HEADERS_ONCE(sys/time.h)
4199 dnl Prerequisites of lib/getdate.y.
4200 AC_REQUIRE([jm_BISON])
4201 AC_REQUIRE([AC_FUNC_ALLOCA])
4202 AC_REQUIRE([AC_HEADER_STDC])
4203 AC_CHECK_FUNCS_ONCE(isascii)
4205 AC_REQUIRE([gl_TM_GMTOFF])
4210 AC_DEFUN([jm_BISON],
4212 # getdate.y works with bison only.
4213 : ${YACC='bison -y'}
4217 # tm_gmtoff.m4 serial 1
4218 dnl Copyright (C) 2002 Free Software Foundation, Inc.
4219 dnl This file is free software, distributed under the terms of the GNU
4220 dnl General Public License. As a special exception to the GNU General
4221 dnl Public License, this file may be distributed as part of a program
4222 dnl that contains a configuration script generated by Autoconf, under
4223 dnl the same distribution terms as the rest of that program.
4225 AC_DEFUN([gl_TM_GMTOFF],
4227 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
4228 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
4229 [Define if struct tm has the tm_gmtoff member.])],
4231 [#include <time.h>])
4234 # getopt.m4 serial 2
4235 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4236 dnl This file is free software, distributed under the terms of the GNU
4237 dnl General Public License. As a special exception to the GNU General
4238 dnl Public License, this file may be distributed as part of a program
4239 dnl that contains a configuration script generated by Autoconf, under
4240 dnl the same distribution terms as the rest of that program.
4242 AC_DEFUN([gl_GETOPT],
4244 dnl Prerequisites of lib/getopt.c.
4248 # getpagesize.m4 serial 1
4249 dnl Copyright (C) 2002 Free Software Foundation, Inc.
4250 dnl This file is free software, distributed under the terms of the GNU
4251 dnl General Public License. As a special exception to the GNU General
4252 dnl Public License, this file may be distributed as part of a program
4253 dnl that contains a configuration script generated by Autoconf, under
4254 dnl the same distribution terms as the rest of that program.
4256 AC_DEFUN([gl_GETPAGESIZE],
4258 dnl Prerequisites of lib/getpagesize.h.
4259 AC_CHECK_HEADERS_ONCE(unistd.h)
4260 AC_CHECK_HEADERS(OS.h)
4261 AC_CHECK_FUNCS(getpagesize)
4264 # getugroups.m4 serial 2
4265 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4266 dnl This file is free software, distributed under the terms of the GNU
4267 dnl General Public License. As a special exception to the GNU General
4268 dnl Public License, this file may be distributed as part of a program
4269 dnl that contains a configuration script generated by Autoconf, under
4270 dnl the same distribution terms as the rest of that program.
4272 AC_DEFUN([gl_GETUGROUPS],
4274 dnl Prerequisites of lib/getugroups.c.
4275 AC_CHECK_HEADERS_ONCE(unistd.h)
4279 # hard-locale.m4 serial 2
4280 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4281 dnl This file is free software, distributed under the terms of the GNU
4282 dnl General Public License. As a special exception to the GNU General
4283 dnl Public License, this file may be distributed as part of a program
4284 dnl that contains a configuration script generated by Autoconf, under
4285 dnl the same distribution terms as the rest of that program.
4287 AC_DEFUN([gl_HARD_LOCALE],
4289 dnl Prerequisites of lib/hard-locale.c.
4290 AC_CHECK_HEADERS_ONCE(locale.h)
4291 AC_CHECK_FUNCS_ONCE(setlocale)
4295 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4296 dnl This file is free software, distributed under the terms of the GNU
4297 dnl General Public License. As a special exception to the GNU General
4298 dnl Public License, this file may be distributed as part of a program
4299 dnl that contains a configuration script generated by Autoconf, under
4300 dnl the same distribution terms as the rest of that program.
4304 dnl Prerequisites of lib/hash.c.
4305 AC_REQUIRE([AM_STDBOOL_H])
4309 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4310 dnl This file is free software, distributed under the terms of the GNU
4311 dnl General Public License. As a special exception to the GNU General
4312 dnl Public License, this file may be distributed as part of a program
4313 dnl that contains a configuration script generated by Autoconf, under
4314 dnl the same distribution terms as the rest of that program.
4316 AC_DEFUN([gl_HUMAN],
4318 dnl Prerequisites of lib/human.h.
4319 AC_REQUIRE([AM_STDBOOL_H])
4320 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
4322 dnl Prerequisites of lib/human.c.
4323 AC_CHECK_HEADERS_ONCE(locale.h)
4324 AC_CHECK_FUNCS_ONCE(localeconv)
4327 # idcache.m4 serial 2
4328 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4329 dnl This file is free software, distributed under the terms of the GNU
4330 dnl General Public License. As a special exception to the GNU General
4331 dnl Public License, this file may be distributed as part of a program
4332 dnl that contains a configuration script generated by Autoconf, under
4333 dnl the same distribution terms as the rest of that program.
4335 AC_DEFUN([gl_IDCACHE],
4337 dnl Prerequisites of lib/idcache.c.
4338 AC_CHECK_HEADERS_ONCE(unistd.h)
4341 # long-options.m4 serial 2
4342 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4343 dnl This file is free software, distributed under the terms of the GNU
4344 dnl General Public License. As a special exception to the GNU General
4345 dnl Public License, this file may be distributed as part of a program
4346 dnl that contains a configuration script generated by Autoconf, under
4347 dnl the same distribution terms as the rest of that program.
4349 AC_DEFUN([gl_LONG_OPTIONS],
4351 dnl Prerequisites of lib/long-options.c.
4355 # makepath.m4 serial 2
4356 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4357 dnl This file is free software, distributed under the terms of the GNU
4358 dnl General Public License. As a special exception to the GNU General
4359 dnl Public License, this file may be distributed as part of a program
4360 dnl that contains a configuration script generated by Autoconf, under
4361 dnl the same distribution terms as the rest of that program.
4363 AC_DEFUN([gl_MAKEPATH],
4365 dnl Prerequisites of lib/makepath.c.
4366 AC_REQUIRE([AC_FUNC_ALLOCA])
4367 AC_CHECK_HEADERS_ONCE(unistd.h)
4368 AC_REQUIRE([AC_HEADER_STAT])
4369 AC_REQUIRE([jm_AFS])
4376 AC_MSG_CHECKING(for AFS)
4377 if test -d /afs; then
4378 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
4383 AC_MSG_RESULT($ac_result)
4388 dnl autoconf tests required for use of mbswidth.c
4389 dnl From Bruno Haible.
4391 AC_DEFUN([gl_MBSWIDTH],
4393 AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
4394 AC_CHECK_FUNCS_ONCE(isascii iswprint mbsinit)
4395 AC_CHECK_FUNCS(iswcntrl wcwidth)
4398 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
4400 /* AIX 3.2.5 declares wcwidth in <string.h>. */
4402 # include <string.h>
4409 char *p = (char *) wcwidth;
4411 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
4412 if test $ac_cv_have_decl_wcwidth = yes; then
4417 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
4418 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
4423 # mbrtowc.m4 serial 5
4424 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4425 dnl This file is free software, distributed under the terms of the GNU
4426 dnl General Public License. As a special exception to the GNU General
4427 dnl Public License, this file may be distributed as part of a program
4428 dnl that contains a configuration script generated by Autoconf, under
4429 dnl the same distribution terms as the rest of that program.
4431 dnl From Paul Eggert
4433 dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
4434 dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
4436 AC_DEFUN([jm_FUNC_MBRTOWC],
4438 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
4441 [#include <wchar.h>],
4442 [mbstate_t state; return ! (sizeof state && mbrtowc);],
4443 jm_cv_func_mbrtowc=yes,
4444 jm_cv_func_mbrtowc=no)])
4445 if test $jm_cv_func_mbrtowc = yes; then
4446 AC_DEFINE(HAVE_MBRTOWC, 1,
4447 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
4452 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4453 dnl This file is free software, distributed under the terms of the GNU
4454 dnl General Public License. As a special exception to the GNU General
4455 dnl Public License, this file may be distributed as part of a program
4456 dnl that contains a configuration script generated by Autoconf, under
4457 dnl the same distribution terms as the rest of that program.
4461 dnl Prerequisites of lib/md5.h.
4462 AC_REQUIRE([AC_C_INLINE])
4464 dnl No prerequisites of lib/md5.c.
4467 # memcoll.m4 serial 3
4468 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4469 dnl This file is free software, distributed under the terms of the GNU
4470 dnl General Public License. As a special exception to the GNU General
4471 dnl Public License, this file may be distributed as part of a program
4472 dnl that contains a configuration script generated by Autoconf, under
4473 dnl the same distribution terms as the rest of that program.
4475 AC_DEFUN([gl_MEMCOLL],
4477 dnl Prerequisites of lib/memcoll.c.
4478 AC_REQUIRE([AC_FUNC_MEMCMP])
4482 # modechange.m4 serial 2
4483 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4484 dnl This file is free software, distributed under the terms of the GNU
4485 dnl General Public License. As a special exception to the GNU General
4486 dnl Public License, this file may be distributed as part of a program
4487 dnl that contains a configuration script generated by Autoconf, under
4488 dnl the same distribution terms as the rest of that program.
4490 AC_DEFUN([gl_MODECHANGE],
4492 AC_REQUIRE([AC_HEADER_STAT])
4495 # mountlist.m4 serial 2
4496 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4497 dnl This file is free software, distributed under the terms of the GNU
4498 dnl General Public License. As a special exception to the GNU General
4499 dnl Public License, this file may be distributed as part of a program
4500 dnl that contains a configuration script generated by Autoconf, under
4501 dnl the same distribution terms as the rest of that program.
4503 AC_DEFUN([gl_MOUNTLIST],
4505 jm_LIST_MOUNTED_FILESYSTEMS([gl_cv_list_mounted_fs=yes],
4506 [gl_cv_list_mounted_fs=no])
4507 if test $gl_cv_list_mounted_fs = yes; then
4508 AC_LIBOBJ(mountlist)
4509 gl_PREREQ_MOUNTLIST_EXTRA
4513 # Prerequisites of lib/mountlist.c not done by jm_LIST_MOUNTED_FILESYSTEMS.
4514 AC_DEFUN([gl_PREREQ_MOUNTLIST_EXTRA],
4516 dnl Note jm_LIST_MOUNTED_FILESYSTEMS checks for mntent.h, not sys/mntent.h.
4517 AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
4518 AC_CHECK_HEADERS(sys/mntent.h)
4524 dnl From Jim Meyering.
4526 dnl This is not pretty. I've just taken the autoconf code and wrapped
4527 dnl it in an AC_DEFUN.
4530 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4531 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
4533 AC_CHECK_FUNCS(listmntent getmntinfo)
4534 AC_CHECK_HEADERS_ONCE(sys/param.h)
4535 AC_CHECK_HEADERS(mntent.h sys/ucred.h sys/mount.h sys/fs_types.h)
4536 getfsstat_includes="\
4537 $ac_includes_default
4538 #if HAVE_SYS_PARAM_H
4539 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
4541 #if HAVE_SYS_UCRED_H
4542 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
4544 #if HAVE_SYS_MOUNT_H
4545 # include <sys/mount.h>
4547 #if HAVE_SYS_FS_TYPES_H
4548 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
4551 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
4553 # Determine how to get the list of mounted filesystems.
4556 # If the getmntent function is available but not in the standard library,
4557 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
4560 # This test must precede the ones for getmntent because Unicos-9 is
4561 # reported to have the getmntent function, but its support is incompatible
4562 # with other getmntent implementations.
4564 # NOTE: Normally, I wouldn't use a check for system type as I've done for
4565 # `CRAY' below since that goes against the whole autoconf philosophy. But
4566 # I think there is too great a chance that some non-Cray system has a
4567 # function named listmntent to risk the false positive.
4569 if test -z "$ac_list_mounted_fs"; then
4571 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
4572 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
4573 [fu_cv_sys_mounted_cray_listmntent=no
4578 ], [test $ac_cv_func_listmntent = yes \
4579 && fu_cv_sys_mounted_cray_listmntent=yes]
4583 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
4584 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
4585 ac_list_mounted_fs=found
4586 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
4587 [Define if there is a function named listmntent that can be used to
4588 list all mounted filesystems. (UNICOS)])
4592 if test -z "$ac_list_mounted_fs"; then
4594 AC_MSG_CHECKING([for mntctl function and struct vmount])
4595 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
4596 [AC_TRY_CPP([#include <fshelp.h>],
4597 fu_cv_sys_mounted_vmount=yes,
4598 fu_cv_sys_mounted_vmount=no)])
4599 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
4600 if test $fu_cv_sys_mounted_vmount = yes; then
4601 ac_list_mounted_fs=found
4602 AC_DEFINE(MOUNTED_VMOUNT, 1,
4603 [Define if there is a function named mntctl that can be used to read
4604 the list of mounted filesystems, and there is a system header file
4605 that declares `struct vmount.' (AIX)])
4609 if test $ac_cv_func_getmntent = yes; then
4611 # This system has the getmntent function.
4612 # Determine whether it's the one-argument variant or the two-argument one.
4614 if test -z "$ac_list_mounted_fs"; then
4615 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
4616 AC_MSG_CHECKING([for one-argument getmntent function])
4617 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
4619 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
4623 #if !defined MOUNTED
4624 # if defined _PATH_MOUNTED /* GNU libc */
4625 # define MOUNTED _PATH_MOUNTED
4627 # if defined MNT_MNTTAB /* HP-UX. */
4628 # define MOUNTED MNT_MNTTAB
4630 # if defined MNTTABNAME /* Dynix. */
4631 # define MOUNTED MNTTABNAME
4635 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
4636 fu_cv_sys_mounted_getmntent1=yes,
4637 fu_cv_sys_mounted_getmntent1=no)])
4638 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
4639 if test $fu_cv_sys_mounted_getmntent1 = yes; then
4640 ac_list_mounted_fs=found
4641 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
4642 [Define if there is a function named getmntent for reading the list
4643 of mounted filesystems, and that function takes a single argument.
4644 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
4648 if test -z "$ac_list_mounted_fs"; then
4650 AC_MSG_CHECKING([for two-argument getmntent function])
4651 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
4652 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
4653 fu_cv_sys_mounted_getmntent2=yes,
4654 fu_cv_sys_mounted_getmntent2=no)])
4655 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
4656 if test $fu_cv_sys_mounted_getmntent2 = yes; then
4657 ac_list_mounted_fs=found
4658 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
4659 [Define if there is a function named getmntent for reading the list of
4660 mounted filesystems, and that function takes two arguments. (SVR4)])
4666 if test -z "$ac_list_mounted_fs"; then
4667 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
4668 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
4670 AC_MSG_CHECKING([for getfsstat function])
4671 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
4673 #include <sys/types.h>
4674 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
4675 # define FS_TYPE(Ent) ((Ent).f_fstypename)
4677 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
4679 ]$getfsstat_includes
4681 [struct statfs *stats;
4682 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
4683 char *t = FS_TYPE (*stats); ],
4684 fu_cv_sys_mounted_getfsstat=yes,
4685 fu_cv_sys_mounted_getfsstat=no)])
4686 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
4687 if test $fu_cv_sys_mounted_getfsstat = yes; then
4688 ac_list_mounted_fs=found
4689 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
4690 [Define if there is a function named getfsstat for reading the
4691 list of mounted filesystems. (DEC Alpha running OSF/1)])
4695 if test -z "$ac_list_mounted_fs"; then
4697 AC_MSG_CHECKING([for FIXME existence of three headers])
4698 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
4700 #include <sys/statfs.h>
4701 #include <sys/fstyp.h>
4702 #include <mnttab.h>],
4703 fu_cv_sys_mounted_fread_fstyp=yes,
4704 fu_cv_sys_mounted_fread_fstyp=no)])
4705 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
4706 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
4707 ac_list_mounted_fs=found
4708 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
4709 [Define if (like SVR2) there is no specific function for reading the
4710 list of mounted filesystems, and your system has these header files:
4711 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
4715 if test -z "$ac_list_mounted_fs"; then
4716 # 4.4BSD and DEC OSF/1.
4717 AC_MSG_CHECKING([for getmntinfo function])
4718 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
4720 test "$ac_cv_func_getmntinfo" = yes \
4721 && fu_cv_sys_mounted_getmntinfo=yes \
4722 || fu_cv_sys_mounted_getmntinfo=no
4724 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
4725 if test $fu_cv_sys_mounted_getmntinfo = yes; then
4726 ac_list_mounted_fs=found
4727 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
4728 [Define if there is a function named getmntinfo for reading the
4729 list of mounted filesystems. (4.4BSD, Darwin)])
4733 if test -z "$ac_list_mounted_fs"; then
4735 AC_MSG_CHECKING([for getmnt function])
4736 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
4738 #include <sys/fs_types.h>
4739 #include <sys/mount.h>],
4740 fu_cv_sys_mounted_getmnt=yes,
4741 fu_cv_sys_mounted_getmnt=no)])
4742 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
4743 if test $fu_cv_sys_mounted_getmnt = yes; then
4744 ac_list_mounted_fs=found
4745 AC_DEFINE(MOUNTED_GETMNT, 1,
4746 [Define if there is a function named getmnt for reading the list of
4747 mounted filesystems. (Ultrix)])
4751 if test -z "$ac_list_mounted_fs"; then
4753 AC_CHECK_FUNCS(next_dev fs_stat_dev)
4754 AC_CHECK_HEADERS(fs_info.h)
4755 AC_MSG_CHECKING([for BEOS mounted file system support functions])
4756 if test $ac_cv_header_fs_info_h = yes \
4757 && test $ac_cv_func_next_dev = yes \
4758 && test $ac_cv_func_fs_stat_dev = yes; then
4763 AC_MSG_RESULT($fu_result)
4764 if test $fu_result = yes; then
4765 ac_list_mounted_fs=found
4766 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
4767 [Define if there are functions named next_dev and fs_stat_dev for
4768 reading the list of mounted filesystems. (BeOS)])
4772 if test -z "$ac_list_mounted_fs"; then
4774 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
4775 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
4776 [AC_TRY_CPP([#include <mnttab.h>],
4777 fu_cv_sys_mounted_fread=yes,
4778 fu_cv_sys_mounted_fread=no)])
4779 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
4780 if test $fu_cv_sys_mounted_fread = yes; then
4781 ac_list_mounted_fs=found
4782 AC_DEFINE(MOUNTED_FREAD, 1,
4783 [Define if there is no specific function for reading the list of
4784 mounted filesystems. fread will be used to read /etc/mnttab.
4789 if test -z "$ac_list_mounted_fs"; then
4790 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
4791 # FIXME -- no need to abort building the whole package
4792 # Can't build mountlist.c or anything that needs its functions
4795 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
4801 dnl From Jim Meyering.
4803 dnl See if struct statfs has the f_fstypename member.
4804 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
4807 AC_DEFUN([jm_FSTYPENAME],
4809 AC_CACHE_CHECK([for f_fstypename in struct statfs],
4810 fu_cv_sys_f_fstypename_in_statfs,
4814 #include <sys/param.h>
4815 #include <sys/types.h>
4816 #include <sys/mount.h>
4818 [struct statfs s; int i = sizeof s.f_fstypename;],
4819 fu_cv_sys_f_fstypename_in_statfs=yes,
4820 fu_cv_sys_f_fstypename_in_statfs=no
4825 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
4826 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
4827 [Define if struct statfs has the f_fstypename member.])
4832 # obstack.m4 serial 2
4833 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4834 dnl This file is free software, distributed under the terms of the GNU
4835 dnl General Public License. As a special exception to the GNU General
4836 dnl Public License, this file may be distributed as part of a program
4837 dnl that contains a configuration script generated by Autoconf, under
4838 dnl the same distribution terms as the rest of that program.
4840 AC_DEFUN([gl_OBSTACK],
4843 dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
4844 if test $ac_cv_func_obstack = no; then
4849 # Prerequisites of lib/obstack.c.
4850 AC_DEFUN([gl_PREREQ_OBSTACK], [:])
4852 # pathmax.m4 serial 2
4853 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4854 dnl This file is free software, distributed under the terms of the GNU
4855 dnl General Public License. As a special exception to the GNU General
4856 dnl Public License, this file may be distributed as part of a program
4857 dnl that contains a configuration script generated by Autoconf, under
4858 dnl the same distribution terms as the rest of that program.
4860 AC_DEFUN([gl_PATHMAX],
4862 dnl Prerequisites of lib/pathmax.h.
4863 AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
4866 # path-concat.m4 serial 2
4867 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4868 dnl This file is free software, distributed under the terms of the GNU
4869 dnl General Public License. As a special exception to the GNU General
4870 dnl Public License, this file may be distributed as part of a program
4871 dnl that contains a configuration script generated by Autoconf, under
4872 dnl the same distribution terms as the rest of that program.
4874 AC_DEFUN([gl_PATH_CONCAT],
4876 dnl Prerequisites of lib/path-concat.c.
4877 AC_REQUIRE([jm_AC_DOS])
4878 AC_CHECK_HEADERS_ONCE(unistd.h)
4879 AC_CHECK_FUNCS_ONCE(mempcpy)
4882 # physmem.m4 serial 2
4883 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4884 dnl This file is free software, distributed under the terms of the GNU
4885 dnl General Public License. As a special exception to the GNU General
4886 dnl Public License, this file may be distributed as part of a program
4887 dnl that contains a configuration script generated by Autoconf, under
4888 dnl the same distribution terms as the rest of that program.
4890 # Check for the external symbol, _system_configuration,
4891 # a struct with member `physmem'.
4892 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
4893 [AC_CACHE_CHECK(for external symbol _system_configuration,
4894 gl_cv_var__system_configuration,
4895 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
4896 [[#include <sys/systemcfg.h>
4898 [double x = _system_configuration.physmem;])],
4899 [gl_cv_var__system_configuration=yes],
4900 [gl_cv_var__system_configuration=no])])
4902 if test $gl_cv_var__system_configuration = yes; then
4903 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
4904 [Define to 1 if you have the external variable,
4905 _system_configuration with a member named physmem.])
4910 AC_DEFUN([gl_PHYSMEM],
4912 # Prerequisites of lib/physmem.c.
4913 AC_CHECK_HEADERS_ONCE(unistd.h)
4914 AC_CHECK_HEADERS([sys/pstat.h sys/sysmp.h sys/sysinfo.h \
4915 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
4916 sys/systemcfg.h],,, [AC_INCLUDES_DEFAULT])
4918 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
4919 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
4922 # posixtm.m4 serial 2
4923 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4924 dnl This file is free software, distributed under the terms of the GNU
4925 dnl General Public License. As a special exception to the GNU General
4926 dnl Public License, this file may be distributed as part of a program
4927 dnl that contains a configuration script generated by Autoconf, under
4928 dnl the same distribution terms as the rest of that program.
4930 AC_DEFUN([gl_POSIXTM],
4932 dnl Prerequisites of lib/posixtm.c.
4936 # posixver.m4 serial 2
4937 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4938 dnl This file is free software, distributed under the terms of the GNU
4939 dnl General Public License. As a special exception to the GNU General
4940 dnl Public License, this file may be distributed as part of a program
4941 dnl that contains a configuration script generated by Autoconf, under
4942 dnl the same distribution terms as the rest of that program.
4944 AC_DEFUN([gl_POSIXVER],
4946 AC_CHECK_HEADERS_ONCE(unistd.h)
4949 # quotearg.m4 serial 1
4950 dnl Copyright (C) 2002 Free Software Foundation, Inc.
4951 dnl This file is free software, distributed under the terms of the GNU
4952 dnl General Public License. As a special exception to the GNU General
4953 dnl Public License, this file may be distributed as part of a program
4954 dnl that contains a configuration script generated by Autoconf, under
4955 dnl the same distribution terms as the rest of that program.
4957 AC_DEFUN([gl_QUOTEARG],
4959 dnl Prerequisites of lib/quotearg.c.
4960 AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
4961 AC_CHECK_FUNCS_ONCE(iswprint mbsinit)
4967 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4968 dnl This file is free software, distributed under the terms of the GNU
4969 dnl General Public License. As a special exception to the GNU General
4970 dnl Public License, this file may be distributed as part of a program
4971 dnl that contains a configuration script generated by Autoconf, under
4972 dnl the same distribution terms as the rest of that program.
4974 AC_DEFUN([gl_QUOTE],
4976 dnl Prerequisites of lib/quote.c.
4980 # readtokens.m4 serial 2
4981 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4982 dnl This file is free software, distributed under the terms of the GNU
4983 dnl General Public License. As a special exception to the GNU General
4984 dnl Public License, this file may be distributed as part of a program
4985 dnl that contains a configuration script generated by Autoconf, under
4986 dnl the same distribution terms as the rest of that program.
4988 AC_DEFUN([gl_READTOKENS],
4990 dnl Prerequisites of lib/readtokens.c.
4994 # readutmp.m4 serial 3
4995 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
4996 dnl This file is free software, distributed under the terms of the GNU
4997 dnl General Public License. As a special exception to the GNU General
4998 dnl Public License, this file may be distributed as part of a program
4999 dnl that contains a configuration script generated by Autoconf, under
5000 dnl the same distribution terms as the rest of that program.
5002 AC_DEFUN([gl_READUTMP],
5004 dnl Prerequisites of lib/readutmp.h.
5005 AC_CHECK_HEADERS_ONCE(sys/param.h)
5006 AC_CHECK_HEADERS(utmp.h utmpx.h)
5007 AC_CHECK_FUNCS(utmpname utmpxname)
5008 AC_CHECK_DECLS(getutent,,,[
5013 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
5015 $ac_includes_default
5023 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
5024 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
5025 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
5026 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
5027 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
5028 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
5029 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
5030 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
5031 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
5032 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
5033 AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
5034 AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
5036 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
5037 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
5038 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
5039 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
5041 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
5042 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
5043 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
5044 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
5051 # Prerequisites of lib/readutmp.c.
5052 AC_DEFUN([gl_PREREQ_READUTMP],
5059 dnl Initially derived from code in GNU grep.
5060 dnl Mostly written by Jim Meyering.
5062 AC_DEFUN([gl_REGEX],
5064 jm_INCLUDED_REGEX([lib/regex.c])
5067 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
5069 AC_DEFUN([jm_INCLUDED_REGEX],
5071 dnl Even packages that don't use regex.c can use this macro.
5072 dnl Of course, for them it doesn't do anything.
5074 # Assume we'll default to using the included regex.c.
5075 ac_use_included_regex=yes
5077 # However, if the system regex support is good enough that it passes the
5078 # the following run test, then default to *not* using the included regex.c.
5079 # If cross compiling, assume the test would fail and use the included
5080 # regex.c. The first failing regular expression is from `Spencer ere
5081 # test #75' in grep-2.3.
5082 AC_CACHE_CHECK([for working re_compile_pattern],
5083 jm_cv_func_working_re_compile_pattern,
5091 static struct re_pattern_buffer regex;
5093 struct re_registers regs;
5094 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
5095 memset (®ex, 0, sizeof (regex));
5096 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
5097 /* This should fail with _Invalid character class name_ error. */
5101 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
5102 memset (®ex, 0, sizeof (regex));
5103 s = re_compile_pattern ("{1", 2, ®ex);
5108 /* The following example is derived from a problem report
5109 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
5110 memset (®ex, 0, sizeof (regex));
5111 s = re_compile_pattern ("[[an\371]]*n", 7, ®ex);
5115 /* This should match, but doesn't for e.g. glibc-2.2.1. */
5116 if (re_match (®ex, "an", 2, 0, ®s) != 2)
5119 memset (®ex, 0, sizeof (regex));
5120 s = re_compile_pattern ("x", 1, ®ex);
5124 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
5125 work with a negative RANGE argument. */
5126 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
5132 jm_cv_func_working_re_compile_pattern=yes,
5133 jm_cv_func_working_re_compile_pattern=no,
5134 dnl When crosscompiling, assume it's broken.
5135 jm_cv_func_working_re_compile_pattern=no))
5136 if test $jm_cv_func_working_re_compile_pattern = yes; then
5137 ac_use_included_regex=no
5140 test -n "$1" || AC_MSG_ERROR([missing argument])
5141 m4_syscmd([test -f $1])
5142 ifelse(m4_sysval, 0,
5144 AC_ARG_WITH(included-regex,
5145 [ --without-included-regex don't compile regex; this is the default on
5146 systems with version 2 of the GNU C library
5147 (use with caution on other system)],
5148 jm_with_regex=$withval,
5149 jm_with_regex=$ac_use_included_regex)
5150 if test "$jm_with_regex" = yes; then
5159 # Prerequisites of lib/regex.c.
5160 AC_DEFUN([jm_PREREQ_REGEX],
5162 dnl FIXME: Maybe provide a btowc replacement someday: Solaris 2.5.1 lacks it.
5163 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
5166 dnl Persuade glibc <string.h> to declare mempcpy().
5167 AC_REQUIRE([AC_GNU_SOURCE])
5169 AC_REQUIRE([gl_C_RESTRICT])
5170 AC_REQUIRE([AC_FUNC_ALLOCA])
5171 AC_REQUIRE([AC_HEADER_STDC])
5172 AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
5173 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
5174 AC_CHECK_FUNCS(btowc)
5178 # This macro can be removed once we can rely on Autoconf 2.57a or later,
5179 # since we can then use its AC_C_RESTRICT.
5183 # Determine whether the C/C++ compiler supports the "restrict" keyword
5184 # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
5185 # accepts it. Otherwise, if the compiler supports an equivalent,
5186 # define "restrict" to be that. Here are some variants:
5187 # - GCC supports both __restrict and __restrict__
5188 # - older DEC Alpha C compilers support only __restrict
5189 # - _Restrict is the only spelling accepted by Sun WorkShop 6 update 2 C
5190 # Otherwise, define "restrict" to be empty.
5191 AC_DEFUN([gl_C_RESTRICT],
5192 [AC_CACHE_CHECK([for C/C++ restrict keyword], gl_cv_c_restrict,
5193 [gl_cv_c_restrict=no
5194 # Try the official restrict keyword, then gcc's __restrict, and
5195 # the less common variants.
5196 for ac_kw in restrict __restrict __restrict__ _Restrict; do
5197 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
5198 [float * $ac_kw x;])],
5199 [gl_cv_c_restrict=$ac_kw; break])
5202 case $gl_cv_c_restrict in
5204 no) AC_DEFINE(restrict,,
5205 [Define to equivalent of C99 restrict keyword, or to nothing if this
5206 is not supported. Do not define if restrict is supported directly.]) ;;
5207 *) AC_DEFINE_UNQUOTED(restrict, $gl_cv_c_restrict) ;;
5211 # safe-read.m4 serial 2
5212 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
5213 dnl This file is free software, distributed under the terms of the GNU
5214 dnl General Public License. As a special exception to the GNU General
5215 dnl Public License, this file may be distributed as part of a program
5216 dnl that contains a configuration script generated by Autoconf, under
5217 dnl the same distribution terms as the rest of that program.
5219 AC_DEFUN([gl_SAFE_READ],
5224 # Prerequisites of lib/safe-read.c.
5225 AC_DEFUN([gl_PREREQ_SAFE_READ],
5227 AC_REQUIRE([gt_TYPE_SSIZE_T])
5228 AC_CHECK_HEADERS_ONCE(unistd.h)
5231 # safe-write.m4 serial 1
5232 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5233 dnl This file is free software, distributed under the terms of the GNU
5234 dnl General Public License. As a special exception to the GNU General
5235 dnl Public License, this file may be distributed as part of a program
5236 dnl that contains a configuration script generated by Autoconf, under
5237 dnl the same distribution terms as the rest of that program.
5239 AC_DEFUN([gl_SAFE_WRITE],
5241 gl_PREREQ_SAFE_WRITE
5244 # Prerequisites of lib/safe-write.c.
5245 AC_DEFUN([gl_PREREQ_SAFE_WRITE],
5251 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5252 dnl This file is free software, distributed under the terms of the GNU
5253 dnl General Public License. As a special exception to the GNU General
5254 dnl Public License, this file may be distributed as part of a program
5255 dnl that contains a configuration script generated by Autoconf, under
5256 dnl the same distribution terms as the rest of that program.
5260 dnl Prerequisites of lib/same.c.
5261 AC_CHECK_HEADERS_ONCE(unistd.h)
5262 AC_CHECK_FUNCS(pathconf)
5265 # savedir.m4 serial 2
5266 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5267 dnl This file is free software, distributed under the terms of the GNU
5268 dnl General Public License. As a special exception to the GNU General
5269 dnl Public License, this file may be distributed as part of a program
5270 dnl that contains a configuration script generated by Autoconf, under
5271 dnl the same distribution terms as the rest of that program.
5273 AC_DEFUN([gl_SAVEDIR],
5275 dnl Prerequisites of lib/savedir.c.
5276 AC_REQUIRE([AC_HEADER_DIRENT])
5277 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
5280 # save-cwd.m4 serial 2
5281 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5282 dnl This file is free software, distributed under the terms of the GNU
5283 dnl General Public License. As a special exception to the GNU General
5284 dnl Public License, this file may be distributed as part of a program
5285 dnl that contains a configuration script generated by Autoconf, under
5286 dnl the same distribution terms as the rest of that program.
5288 AC_DEFUN([gl_SAVE_CWD],
5290 dnl Prerequisites for lib/save-cwd.c.
5291 AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
5292 AC_CHECK_FUNCS(fchdir)
5295 # settime.m4 serial 1
5296 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5297 dnl This file is free software, distributed under the terms of the GNU
5298 dnl General Public License. As a special exception to the GNU General
5299 dnl Public License, this file may be distributed as part of a program
5300 dnl that contains a configuration script generated by Autoconf, under
5301 dnl the same distribution terms as the rest of that program.
5303 AC_DEFUN([gl_SETTIME],
5305 dnl Prerequisites of lib/settime.c.
5306 # Need clock_settime.
5307 AC_REQUIRE([gl_CLOCK_TIME])
5310 # clock_time.m4 serial 2
5311 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5312 dnl This file is free software, distributed under the terms of the GNU
5313 dnl General Public License. As a special exception to the GNU General
5314 dnl Public License, this file may be distributed as part of a program
5315 dnl that contains a configuration script generated by Autoconf, under
5316 dnl the same distribution terms as the rest of that program.
5318 # Check for clock_gettime and clock_settime, and sets LIB_CLOCK_GETTIME.
5319 AC_DEFUN([gl_CLOCK_TIME],
5321 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
5322 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
5324 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
5325 # programs in the package would end up linked with that potentially-shared
5326 # library, inducing unnecessary run-time overhead.
5327 fetish_saved_libs=$LIBS
5328 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
5329 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
5330 AC_SUBST(LIB_CLOCK_GETTIME)
5331 AC_CHECK_FUNCS(clock_gettime clock_settime)
5332 LIBS=$fetish_saved_libs
5336 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5337 dnl This file is free software, distributed under the terms of the GNU
5338 dnl General Public License. As a special exception to the GNU General
5339 dnl Public License, this file may be distributed as part of a program
5340 dnl that contains a configuration script generated by Autoconf, under
5341 dnl the same distribution terms as the rest of that program.
5345 dnl Prerequisites of lib/sha.c.
5349 # stdio-safer.m4 serial 1
5350 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5351 dnl This file is free software, distributed under the terms of the GNU
5352 dnl General Public License. As a special exception to the GNU General
5353 dnl Public License, this file may be distributed as part of a program
5354 dnl that contains a configuration script generated by Autoconf, under
5355 dnl the same distribution terms as the rest of that program.
5357 AC_DEFUN([gl_STDIO_SAFER],
5359 dnl Prerequisites of lib/fopen-safer.c.
5360 AC_CHECK_HEADERS_ONCE(unistd.h)
5363 # strcase.m4 serial 1
5364 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5365 dnl This file is free software, distributed under the terms of the GNU
5366 dnl General Public License. As a special exception to the GNU General
5367 dnl Public License, this file may be distributed as part of a program
5368 dnl that contains a configuration script generated by Autoconf, under
5369 dnl the same distribution terms as the rest of that program.
5371 AC_DEFUN([gl_STRCASE],
5377 AC_DEFUN([gl_FUNC_STRCASECMP],
5379 AC_REPLACE_FUNCS(strcasecmp)
5380 if test $ac_cv_func_strcasecmp = no; then
5381 gl_PREREQ_STRCASECMP
5385 AC_DEFUN([gl_FUNC_STRNCASECMP],
5387 AC_REPLACE_FUNCS(strncasecmp)
5388 if test $ac_cv_func_strncasecmp = no; then
5389 gl_PREREQ_STRNCASECMP
5393 # Prerequisites of lib/strcasecmp.c.
5394 AC_DEFUN([gl_PREREQ_STRCASECMP], [
5398 # Prerequisites of lib/strncasecmp.c.
5399 AC_DEFUN([gl_PREREQ_STRNCASECMP], [
5405 dnl From Jim Meyering
5407 AC_DEFUN([gl_TIMESPEC],
5409 dnl Prerequisites of lib/timespec.h.
5410 AC_REQUIRE([AC_HEADER_TIME])
5411 AC_CHECK_HEADERS_ONCE(sys/time.h)
5412 jm_CHECK_TYPE_STRUCT_TIMESPEC
5413 AC_STRUCT_ST_MTIM_NSEC
5415 dnl Persuade glibc <time.h> to declare nanosleep().
5416 AC_REQUIRE([AC_GNU_SOURCE])
5418 AC_CHECK_DECLS(nanosleep, , , [#include <time.h>])
5421 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
5422 dnl in time.h or sys/time.h.
5424 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
5426 dnl Persuade pedantic Solaris to declare struct timespec.
5427 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
5429 AC_REQUIRE([AC_HEADER_TIME])
5430 AC_CHECK_HEADERS_ONCE(sys/time.h)
5431 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
5434 # if TIME_WITH_SYS_TIME
5435 # include <sys/time.h>
5438 # if HAVE_SYS_TIME_H
5439 # include <sys/time.h>
5445 [static struct timespec x; x.tv_sec = x.tv_nsec;],
5446 fu_cv_sys_struct_timespec=yes,
5447 fu_cv_sys_struct_timespec=no)
5450 if test $fu_cv_sys_struct_timespec = yes; then
5451 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
5452 [Define if struct timespec is declared in <time.h>. ])
5458 dnl From Paul Eggert.
5460 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
5463 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
5464 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
5465 ac_cv_struct_st_mtim_nsec,
5466 [ac_save_CPPFLAGS="$CPPFLAGS"
5467 ac_cv_struct_st_mtim_nsec=no
5468 # tv_nsec -- the usual case
5469 # _tv_nsec -- Solaris 2.6, if
5470 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
5471 # && !defined __EXTENSIONS__)
5472 # st__tim.tv_nsec -- UnixWare 2.1.2
5473 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
5474 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
5475 AC_TRY_COMPILE([#include <sys/types.h>
5476 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
5477 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
5479 CPPFLAGS="$ac_save_CPPFLAGS"])
5481 if test $ac_cv_struct_st_mtim_nsec != no; then
5482 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
5483 [Define to be the nanoseconds member of struct stat's st_mtim,
5489 # unicodeio.m4 serial 2
5490 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
5491 dnl This file is free software, distributed under the terms of the GNU
5492 dnl General Public License. As a special exception to the GNU General
5493 dnl Public License, this file may be distributed as part of a program
5494 dnl that contains a configuration script generated by Autoconf, under
5495 dnl the same distribution terms as the rest of that program.
5497 AC_DEFUN([gl_UNICODEIO],
5499 dnl No prerequisites of lib/unicodeio.c.
5503 # unistd-safer.m4 serial 1
5504 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5505 dnl This file is free software, distributed under the terms of the GNU
5506 dnl General Public License. As a special exception to the GNU General
5507 dnl Public License, this file may be distributed as part of a program
5508 dnl that contains a configuration script generated by Autoconf, under
5509 dnl the same distribution terms as the rest of that program.
5511 AC_DEFUN([gl_UNISTD_SAFER],
5516 # Prerequisites of lib/dup-safer.c.
5517 AC_DEFUN([gl_PREREQ_DUP_SAFER], [
5518 AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
5521 # userspec.m4 serial 3
5522 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5523 dnl This file is free software, distributed under the terms of the GNU
5524 dnl General Public License. As a special exception to the GNU General
5525 dnl Public License, this file may be distributed as part of a program
5526 dnl that contains a configuration script generated by Autoconf, under
5527 dnl the same distribution terms as the rest of that program.
5529 AC_DEFUN([gl_USERSPEC],
5531 dnl Prerequisites of lib/userspec.c.
5532 AC_REQUIRE([AC_FUNC_ALLOCA])
5533 AC_CHECK_HEADERS_ONCE(sys/param.h unistd.h)
5536 dnl Copyright (C) 2003 Free Software Foundation, Inc.
5537 dnl This file is free software, distributed under the terms of the GNU
5538 dnl General Public License. As a special exception to the GNU General
5539 dnl Public License, this file may be distributed as part of a program
5540 dnl that contains a configuration script generated by Autoconf, under
5541 dnl the same distribution terms as the rest of that program.
5543 AC_DEFUN([gl_UTIMENS],
5545 dnl Prerequisites of lib/utimens.c.
5546 AC_REQUIRE([gl_TIMESPEC])
5547 AC_REQUIRE([gl_FUNC_UTIMES])
5548 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
5549 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
5552 # See if we need to work around bugs in glibc's implementation of
5553 # utimes from 2003-07-12 to 2003-09-17.
5554 # First, there was a bug that would make utimes set mtime
5555 # and atime to zero (1970-01-01) unconditionally.
5556 # Then, there was code to round rather than truncate.
5558 # From Jim Meyering, with suggestions from Paul Eggert.
5560 AC_DEFUN([gl_FUNC_UTIMES],
5562 AC_CACHE_CHECK([determine whether the utimes function works],
5563 gl_cv_func_working_utimes,
5565 AC_RUN_IFELSE([AC_LANG_SOURCE([[
5566 #include <sys/types.h>
5567 #include <sys/stat.h>
5568 #include <sys/time.h>
5577 static struct timeval timeval[2] = {{9, 10}, {999999, 999999}};
5579 char const *file = "conftest.utimes";
5582 exit ( ! ((f = fopen (file, "w"))
5584 && utimes (file, timeval) == 0
5585 && lstat (file, &sbuf) == 0
5586 && sbuf.st_atime == timeval[0].tv_sec
5587 && sbuf.st_mtime == timeval[1].tv_sec) );
5590 [gl_cv_func_working_utimes=yes],
5591 [gl_cv_func_working_utimes=no],
5592 [gl_cv_func_working_utimes=no])])
5594 if test $gl_cv_func_working_utimes = yes; then
5595 AC_DEFINE([HAVE_WORKING_UTIMES], 1, [Define if utimes works properly. ])
5599 # xalloc.m4 serial 3
5600 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
5601 dnl This file is free software, distributed under the terms of the GNU
5602 dnl General Public License. As a special exception to the GNU General
5603 dnl Public License, this file may be distributed as part of a program
5604 dnl that contains a configuration script generated by Autoconf, under
5605 dnl the same distribution terms as the rest of that program.
5607 AC_DEFUN([gl_XALLOC],
5613 # Prerequisites of lib/xmalloc.c.
5614 AC_DEFUN([gl_PREREQ_XMALLOC], [
5615 AC_REQUIRE([jm_FUNC_MALLOC])
5616 AC_REQUIRE([jm_FUNC_REALLOC])
5619 # Prerequisites of lib/xstrdup.c.
5620 AC_DEFUN([gl_PREREQ_XSTRDUP], [
5624 # malloc.m4 serial 7
5625 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5626 dnl This file is free software, distributed under the terms of the GNU
5627 dnl General Public License. As a special exception to the GNU General
5628 dnl Public License, this file may be distributed as part of a program
5629 dnl that contains a configuration script generated by Autoconf, under
5630 dnl the same distribution terms as the rest of that program.
5632 dnl From Jim Meyering.
5633 dnl Determine whether malloc accepts 0 as its argument.
5634 dnl If it doesn't, arrange to use the replacement function.
5636 AC_DEFUN([jm_FUNC_MALLOC],
5638 AC_REQUIRE([AC_FUNC_MALLOC])
5639 dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works.
5640 if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test X"$ac_cv_func_malloc_works" = Xno; then
5645 # Prerequisites of lib/malloc.c.
5646 AC_DEFUN([gl_PREREQ_MALLOC], [
5650 # realloc.m4 serial 7
5651 dnl Copyright (C) 2002 Free Software Foundation, Inc.
5652 dnl This file is free software, distributed under the terms of the GNU
5653 dnl General Public License. As a special exception to the GNU General
5654 dnl Public License, this file may be distributed as part of a program
5655 dnl that contains a configuration script generated by Autoconf, under
5656 dnl the same distribution terms as the rest of that program.
5658 dnl From Jim Meyering.
5659 dnl Determine whether realloc works when both arguments are 0.
5660 dnl If it doesn't, arrange to use the replacement function.
5662 AC_DEFUN([jm_FUNC_REALLOC],
5664 AC_REQUIRE([AC_FUNC_REALLOC])
5665 dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
5666 if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test X"$ac_cv_func_realloc_works" = Xno; then
5671 # Prerequisites of lib/realloc.c.
5672 AC_DEFUN([gl_PREREQ_REALLOC], [
5676 # xgetcwd.m4 serial 2
5677 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5678 dnl This file is free software, distributed under the terms of the GNU
5679 dnl General Public License. As a special exception to the GNU General
5680 dnl Public License, this file may be distributed as part of a program
5681 dnl that contains a configuration script generated by Autoconf, under
5682 dnl the same distribution terms as the rest of that program.
5684 AC_DEFUN([gl_XGETCWD],
5686 dnl Prerequisites of lib/xgetcwd.c.
5687 AC_CHECK_HEADERS_ONCE(unistd.h)
5688 AC_CHECK_FUNCS(getcwd)
5692 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
5694 # Copyright (C) 2001, 2003 Free Software Foundation, Inc.
5696 # This program is free software; you can redistribute it and/or modify
5697 # it under the terms of the GNU General Public License as published by
5698 # the Free Software Foundation; either version 2, or (at your option)
5699 # any later version.
5701 # This program is distributed in the hope that it will be useful,
5702 # but WITHOUT ANY WARRANTY; without even the implied warranty of
5703 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5704 # GNU General Public License for more details.
5706 # You should have received a copy of the GNU General Public License
5707 # along with this program; if not, write to the Free Software Foundation,
5708 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
5710 # Written by Paul Eggert.
5712 AC_DEFUN([AC_FUNC_GETCWD_NULL],
5714 AC_CHECK_HEADERS_ONCE(unistd.h)
5715 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
5716 [ac_cv_func_getcwd_null],
5719 # include <stdlib.h>
5720 # ifdef HAVE_UNISTD_H
5721 # include <unistd.h>
5729 if (chdir ("/") != 0)
5733 char *f = getcwd (NULL, 0);
5734 exit (! (f && f[0] == '/' && !f[1]));
5737 [ac_cv_func_getcwd_null=yes],
5738 [ac_cv_func_getcwd_null=no],
5739 [ac_cv_func_getcwd_null=no])])
5740 if test $ac_cv_func_getcwd_null = yes; then
5741 AC_DEFINE(HAVE_GETCWD_NULL, 1,
5742 [Define if getcwd (NULL, 0) allocates memory for result.])
5745 # xreadlink.m4 serial 4
5746 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5747 dnl This file is free software, distributed under the terms of the GNU
5748 dnl General Public License. As a special exception to the GNU General
5749 dnl Public License, this file may be distributed as part of a program
5750 dnl that contains a configuration script generated by Autoconf, under
5751 dnl the same distribution terms as the rest of that program.
5753 AC_DEFUN([gl_XREADLINK],
5755 dnl Prerequisites of lib/xreadlink.c.
5756 AC_REQUIRE([gt_TYPE_SSIZE_T])
5757 AC_CHECK_HEADERS_ONCE(unistd.h)
5760 # xstrtod.m4 serial 2
5761 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5762 dnl This file is free software, distributed under the terms of the GNU
5763 dnl General Public License. As a special exception to the GNU General
5764 dnl Public License, this file may be distributed as part of a program
5765 dnl that contains a configuration script generated by Autoconf, under
5766 dnl the same distribution terms as the rest of that program.
5768 # Prerequisites of lib/xstrtod.c.
5769 AC_DEFUN([gl_XSTRTOD],
5774 # xstrtol.m4 serial 3
5775 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
5776 dnl This file is free software, distributed under the terms of the GNU
5777 dnl General Public License. As a special exception to the GNU General
5778 dnl Public License, this file may be distributed as part of a program
5779 dnl that contains a configuration script generated by Autoconf, under
5780 dnl the same distribution terms as the rest of that program.
5782 AC_DEFUN([gl_XSTRTOL],
5784 AC_REQUIRE([gl_PREREQ_XSTRTOL])
5785 AC_REQUIRE([gl_PREREQ_XSTRTOUL])
5788 # Prerequisites of lib/xstrtol.h.
5789 AC_DEFUN([gl_PREREQ_XSTRTOL_H],
5791 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
5792 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
5795 # Prerequisites of lib/xstrtol.c.
5796 AC_DEFUN([gl_PREREQ_XSTRTOL],
5798 AC_REQUIRE([gl_PREREQ_XSTRTOL_H])
5799 AC_REQUIRE([AC_HEADER_STDC])
5800 AC_CHECK_FUNCS_ONCE(isascii)
5801 AC_CHECK_DECLS([strtoimax, strtoumax])
5804 # Prerequisites of lib/xstrtoul.c.
5805 AC_DEFUN([gl_PREREQ_XSTRTOUL],
5807 AC_REQUIRE([gl_PREREQ_XSTRTOL])
5811 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
5812 dnl This file is free software, distributed under the terms of the GNU
5813 dnl General Public License. As a special exception to the GNU General
5814 dnl Public License, this file may be distributed as part of a program
5815 dnl that contains a configuration script generated by Autoconf, under
5816 dnl the same distribution terms as the rest of that program.
5818 AC_DEFUN([gl_YESNO],
5820 dnl No prerequisites of lib/yesno.c.
5824 #serial 8 -*- autoconf -*-
5826 dnl From Jim Meyering.
5828 dnl See if the glibc *_unlocked I/O macros or functions are available.
5829 dnl Use only those *_unlocked macros or functions that are declared
5830 dnl (because some of them were declared in Solaris 2.5.1 but were removed
5831 dnl in Solaris 2.6, whereas we want binaries built on Solaris 2.5.1 to run
5832 dnl on Solaris 2.6).
5834 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
5836 dnl Persuade glibc and Solaris <stdio.h> to declare
5837 dnl fgets_unlocked(), fputs_unlocked() etc.
5838 AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
5840 AC_CHECK_DECLS_ONCE(
5841 [clearerr_unlocked feof_unlocked ferror_unlocked
5842 fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked
5843 fread_unlocked fwrite_unlocked getc_unlocked
5844 getchar_unlocked putc_unlocked putchar_unlocked])
5849 dnl This macro is intended to be used solely in this file.
5850 dnl These are the prerequisite macros for GNU's strftime.c replacement.
5851 AC_DEFUN([_jm_STRFTIME_PREREQS],
5853 dnl strftime.c uses the underyling system strftime if it exists.
5856 AC_CHECK_FUNCS_ONCE(mempcpy)
5857 AC_CHECK_FUNCS(tzset)
5859 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
5862 AC_CHECK_FUNCS(mblen mbrlen)
5865 AC_REQUIRE([gl_TM_GMTOFF])
5866 AC_REQUIRE([gl_FUNC_TZSET_CLOBBER])
5869 dnl From Jim Meyering.
5871 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
5872 [AC_REQUIRE([AC_HEADER_TIME])dnl
5874 _jm_STRFTIME_PREREQS
5876 AC_REQUIRE([AC_C_CONST])dnl
5877 AC_CHECK_HEADERS_ONCE(sys/time.h)
5878 AC_DEFINE([my_strftime], [nstrftime],
5879 [Define to the name of the strftime replacement function.])
5882 AC_DEFUN([jm_FUNC_STRFTIME],
5884 _jm_STRFTIME_PREREQS
5888 # See if we have a working tzset function.
5889 # If so, arrange to compile the wrapper function.
5890 # For at least Solaris 2.5.1 and 2.6, this is necessary
5891 # because tzset can clobber the contents of the buffer
5892 # used by localtime.
5894 # Written by Paul Eggert and Jim Meyering.
5896 AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
5898 AC_REQUIRE([AC_HEADER_TIME])
5899 AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
5900 gl_cv_func_tzset_clobber,
5902 AC_RUN_IFELSE([AC_LANG_SOURCE([[
5903 #if TIME_WITH_SYS_TIME
5904 # include <sys/time.h>
5907 # if HAVE_SYS_TIME_H
5908 # include <sys/time.h>
5918 time_t t1 = 853958121;
5921 p = localtime (&t1);
5923 putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
5925 exit (p->tm_year != s.tm_year
5926 || p->tm_mon != s.tm_mon
5927 || p->tm_mday != s.tm_mday
5928 || p->tm_hour != s.tm_hour
5929 || p->tm_min != s.tm_min
5930 || p->tm_sec != s.tm_sec);
5933 [gl_cv_func_tzset_clobber=no],
5934 [gl_cv_func_tzset_clobber=yes],
5935 [gl_cv_func_tzset_clobber=yes])])
5937 AC_DEFINE(HAVE_RUN_TZSET_TEST, 1,
5938 [Define to 1 if you have run the test for working tzset.])
5940 if test $gl_cv_func_tzset_clobber = yes; then
5941 gl_GETTIMEOFDAY_REPLACE_LOCALTIME
5943 AC_DEFINE(tzset, rpl_tzset,
5944 [Define to rpl_tzset if the wrapper function should be used.])
5945 AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1,
5946 [Define if tzset clobbers localtime's static buffer.])
5952 dnl From Jim Meyering.
5954 dnl See if gettimeofday clobbers the static buffer that localtime uses
5955 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
5956 dnl i.e. Darwin 1.3.7 has this problem.
5958 dnl If it does, then arrange to use gettimeofday and localtime only via
5959 dnl the wrapper functions that work around the problem.
5961 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
5963 AC_REQUIRE([AC_HEADER_TIME])
5964 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
5965 jm_cv_func_gettimeofday_clobber,
5970 #if TIME_WITH_SYS_TIME
5971 # include <sys/time.h>
5974 # if HAVE_SYS_TIME_H
5975 # include <sys/time.h>
5990 lt = localtime (&t);
5992 gettimeofday (&tv, NULL);
5993 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
5999 jm_cv_func_gettimeofday_clobber=no,
6000 jm_cv_func_gettimeofday_clobber=yes,
6001 dnl When crosscompiling, assume it is broken.
6002 jm_cv_func_gettimeofday_clobber=yes)
6004 if test $jm_cv_func_gettimeofday_clobber = yes; then
6005 gl_GETTIMEOFDAY_REPLACE_LOCALTIME
6007 AC_DEFINE(gettimeofday, rpl_gettimeofday,
6008 [Define to rpl_gettimeofday if the replacement function should be used.])
6009 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
6010 [Define if gettimeofday clobbers localtime's static buffer.])
6011 gl_PREREQ_GETTIMEOFDAY
6015 AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
6016 AC_LIBOBJ(gettimeofday)
6017 AC_DEFINE(gmtime, rpl_gmtime,
6018 [Define to rpl_gmtime if the replacement function should be used.])
6019 AC_DEFINE(localtime, rpl_localtime,
6020 [Define to rpl_localtime if the replacement function should be used.])
6023 # Prerequisites of lib/gettimeofday.c.
6024 AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
6025 AC_REQUIRE([AC_HEADER_TIME])
6030 dnl From Jim Meyering.
6031 dnl Determine whether lstat has the bug that it succeeds when given the
6032 dnl zero-length file name argument. The lstat from SunOS 4.1.4 and the Hurd
6033 dnl (as of 1998-11-01) do this.
6035 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
6036 dnl compile the wrapper function.
6039 AC_DEFUN([jm_FUNC_LSTAT],
6042 dnl Note: AC_FUNC_LSTAT does AC_LIBOBJ(lstat).
6043 if test $ac_cv_func_lstat_empty_string_bug = yes; then
6048 # Prerequisites of lib/lstat.c.
6049 AC_DEFUN([gl_PREREQ_LSTAT],
6051 AC_REQUIRE([AC_HEADER_STAT])
6055 # memcmp.m4 serial 9
6056 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6057 dnl This file is free software, distributed under the terms of the GNU
6058 dnl General Public License. As a special exception to the GNU General
6059 dnl Public License, this file may be distributed as part of a program
6060 dnl that contains a configuration script generated by Autoconf, under
6061 dnl the same distribution terms as the rest of that program.
6063 AC_DEFUN([jm_FUNC_MEMCMP],
6065 AC_REQUIRE([AC_FUNC_MEMCMP])
6066 if test $ac_cv_func_memcmp_working = no; then
6067 AC_DEFINE(memcmp, rpl_memcmp,
6068 [Define to rpl_memcmp if the replacement function should be used.])
6073 # Prerequisites of lib/memcmp.c.
6074 AC_DEFUN([gl_PREREQ_MEMCMP], [:])
6078 dnl From Jim Meyering.
6079 dnl Check for the nanosleep function.
6080 dnl If not found, use the supplied replacement.
6083 AC_DEFUN([jm_FUNC_NANOSLEEP],
6085 nanosleep_save_libs=$LIBS
6087 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
6088 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
6089 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
6090 AC_SUBST(LIB_NANOSLEEP)
6092 AC_CACHE_CHECK([whether nanosleep works],
6093 jm_cv_func_nanosleep_works,
6095 AC_REQUIRE([AC_HEADER_TIME])
6096 AC_CHECK_HEADERS_ONCE(sys/time.h)
6098 # if TIME_WITH_SYS_TIME
6099 # include <sys/time.h>
6102 # if HAVE_SYS_TIME_H
6103 # include <sys/time.h>
6112 struct timespec ts_sleep, ts_remaining;
6113 ts_sleep.tv_sec = 0;
6114 ts_sleep.tv_nsec = 1;
6115 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
6118 jm_cv_func_nanosleep_works=yes,
6119 jm_cv_func_nanosleep_works=no,
6120 dnl When crosscompiling, assume the worst.
6121 jm_cv_func_nanosleep_works=no)
6123 if test $jm_cv_func_nanosleep_works = no; then
6124 AC_LIBOBJ(nanosleep)
6125 AC_DEFINE(nanosleep, rpl_nanosleep,
6126 [Define to rpl_nanosleep if the replacement function should be used.])
6130 LIBS=$nanosleep_save_libs
6133 # Prerequisites of lib/nanosleep.c.
6134 AC_DEFUN([gl_PREREQ_NANOSLEEP],
6136 AC_CHECK_HEADERS_ONCE(unistd.h)
6139 # putenv.m4 serial 7
6140 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
6141 dnl This file is free software, distributed under the terms of the GNU
6142 dnl General Public License. As a special exception to the GNU General
6143 dnl Public License, this file may be distributed as part of a program
6144 dnl that contains a configuration script generated by Autoconf, under
6145 dnl the same distribution terms as the rest of that program.
6147 dnl From Jim Meyering.
6149 dnl Check whether putenv ("FOO") removes FOO from the environment.
6150 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
6152 AC_DEFUN([jm_FUNC_PUTENV],
6153 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
6158 /* Put it in env. */
6159 if (putenv ("CONFTEST_putenv=val"))
6162 /* Try to remove it. */
6163 if (putenv ("CONFTEST_putenv"))
6166 /* Make sure it was deleted. */
6167 if (getenv ("CONFTEST_putenv") != 0)
6173 jm_cv_func_svid_putenv=yes,
6174 jm_cv_func_svid_putenv=no,
6175 dnl When crosscompiling, assume putenv is broken.
6176 jm_cv_func_svid_putenv=no)
6178 if test $jm_cv_func_svid_putenv = no; then
6180 AC_DEFINE(putenv, rpl_putenv,
6181 [Define to rpl_putenv if the replacement function should be used.])
6186 # Prerequisites of lib/putenv.c.
6187 AC_DEFUN([gl_PREREQ_PUTENV], [
6188 AC_CHECK_HEADERS_ONCE(unistd.h)
6193 dnl From Jim Meyering.
6194 dnl Determine whether stat has the bug that it succeeds when given the
6195 dnl zero-length file name argument. The stat from SunOS 4.1.4 and the Hurd
6196 dnl (as of 1998-11-01) do this.
6198 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
6199 dnl compile the wrapper function.
6202 AC_DEFUN([jm_FUNC_STAT],
6205 dnl Note: AC_FUNC_STAT does AC_LIBOBJ(stat).
6206 if test $ac_cv_func_stat_empty_string_bug = yes; then
6211 # Prerequisites of lib/stat.c.
6212 AC_DEFUN([gl_PREREQ_STAT],
6219 dnl From Jim Meyering
6220 dnl Replace the utime function on systems that need it.
6224 AC_DEFUN([jm_FUNC_UTIME],
6226 AC_REQUIRE([AC_FUNC_UTIME_NULL])
6227 if test $ac_cv_func_utime_null = no; then
6229 AC_DEFINE(utime, rpl_utime,
6230 [Define to rpl_utime if the replacement function should be used.])
6235 # Prerequisites of lib/utime.c.
6236 AC_DEFUN([gl_PREREQ_UTIME],
6238 AC_CHECK_HEADERS_ONCE(utime.h)
6239 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
6245 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
6246 dnl then do case-insensitive s/utime/utimes/.
6248 AC_DEFUN([jm_FUNC_UTIMES_NULL],
6249 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
6250 [rm -f conftest.data; > conftest.data
6252 /* In case stat has been defined to rpl_stat, undef it here. */
6254 #include <sys/types.h>
6255 #include <sys/stat.h>
6258 exit(!(stat ("conftest.data", &s) == 0
6259 && utimes("conftest.data", (long *)0) == 0
6260 && stat("conftest.data", &t) == 0
6261 && t.st_mtime >= s.st_mtime
6262 && t.st_mtime - s.st_mtime < 120));
6264 ac_cv_func_utimes_null=yes,
6265 ac_cv_func_utimes_null=no,
6266 ac_cv_func_utimes_null=no)
6267 rm -f core core.* *.core])
6269 if test $ac_cv_func_utimes_null = yes; then
6270 AC_DEFINE(HAVE_UTIMES_NULL, 1,
6271 [Define if utimes accepts a null argument])
6277 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
6279 AC_DEFUN([jm_XSTRTOIMAX],
6281 dnl Prerequisites of lib/xstrtoimax.c.
6282 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
6283 AC_REQUIRE([gl_PREREQ_XSTRTOL])
6287 dnl Cloned from xstrtoimax.m4. Keep these files in sync.
6289 AC_DEFUN([jm_XSTRTOUMAX],
6291 dnl Prerequisites of lib/xstrtoumax.c.
6292 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
6293 AC_REQUIRE([gl_PREREQ_XSTRTOL])
6298 dnl From Volker Borchert.
6299 dnl Determine whether rename works for source paths with a trailing slash.
6300 dnl The rename from SunOS 4.1.1_U1 doesn't.
6302 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
6303 dnl to compile the wrapper function.
6306 AC_DEFUN([vb_FUNC_RENAME],
6308 AC_CACHE_CHECK([whether rename is broken],
6309 vb_cv_func_rename_trailing_slash_bug,
6311 rm -rf conftest.d1 conftest.d2
6312 mkdir conftest.d1 ||
6313 AC_MSG_ERROR([cannot create temporary directory])
6319 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
6322 vb_cv_func_rename_trailing_slash_bug=no,
6323 vb_cv_func_rename_trailing_slash_bug=yes,
6324 dnl When crosscompiling, assume rename is broken.
6325 vb_cv_func_rename_trailing_slash_bug=yes)
6327 rm -rf conftest.d1 conftest.d2
6329 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
6331 AC_DEFINE(rename, rpl_rename,
6332 [Define to rpl_rename if the replacement function should be used.])
6333 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
6334 [Define if rename does not work for source paths with a trailing slash,
6335 like the one from SunOS 4.1.1_U1.])
6340 # Prerequisites of lib/rename.c.
6341 AC_DEFUN([gl_PREREQ_RENAME], [:])
6345 dnl Find out how to get the file descriptor associated with an open DIR*.
6346 dnl From Jim Meyering
6348 AC_DEFUN([UTILS_FUNC_DIRFD],
6350 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
6351 AC_REQUIRE([AC_PROG_CPP])
6352 AC_REQUIRE([AC_PROG_EGREP])
6357 # include <dirent.h>
6358 #else /* not HAVE_DIRENT_H */
6359 # define dirent direct
6360 # if HAVE_SYS_NDIR_H
6361 # include <sys/ndir.h>
6362 # endif /* HAVE_SYS_NDIR_H */
6364 # include <sys/dir.h>
6365 # endif /* HAVE_SYS_DIR_H */
6368 # endif /* HAVE_NDIR_H */
6369 #endif /* HAVE_DIRENT_H */
6371 AC_CHECK_FUNCS(dirfd)
6372 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
6374 AC_CACHE_CHECK([whether dirfd is a macro],
6375 jm_cv_func_dirfd_macro,
6376 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
6378 dirent_header_defines_dirfd
6380 jm_cv_func_dirfd_macro=yes,
6381 jm_cv_func_dirfd_macro=no)])
6383 # Use the replacement only if we have no function, macro,
6384 # or declaration with that name.
6385 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
6387 AC_REPLACE_FUNCS([dirfd])
6389 [how to get the file descriptor associated with an open DIR*],
6390 gl_cv_sys_dir_fd_member_name,
6392 dirfd_save_CFLAGS=$CFLAGS
6393 for ac_expr in d_fd dd_fd; do
6395 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
6399 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
6402 CFLAGS=$dirfd_save_CFLAGS
6403 test "$dir_fd_found" = yes && break
6405 test "$dir_fd_found" = yes || ac_expr=no_such_member
6407 gl_cv_sys_dir_fd_member_name=$ac_expr
6410 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
6411 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
6412 $gl_cv_sys_dir_fd_member_name,
6413 [the name of the file descriptor member of DIR])
6415 AH_VERBATIM(DIR_TO_FD,
6416 [#ifdef DIR_FD_MEMBER_NAME
6417 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
6419 # define DIR_TO_FD(Dir_p) -1
6426 # acl.m4 - check for access control list (ACL) primitives
6428 # Copyright (C) 2002 Free Software Foundation, Inc.
6430 # This program is free software; you can redistribute it and/or modify
6431 # it under the terms of the GNU General Public License as published by
6432 # the Free Software Foundation; either version 2, or (at your option)
6433 # any later version.
6435 # This program is distributed in the hope that it will be useful,
6436 # but WITHOUT ANY WARRANTY; without even the implied warranty of
6437 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6438 # GNU General Public License for more details.
6440 # You should have received a copy of the GNU General Public License
6441 # along with this program; if not, write to the Free Software Foundation,
6442 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
6444 # Written by Paul Eggert.
6446 AC_DEFUN([AC_FUNC_ACL],
6448 dnl Prerequisites of lib/acl.c.
6449 AC_CHECK_HEADERS(sys/acl.h)
6454 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
6455 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
6456 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
6457 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
6458 # objects and arrange to use lib/search.h if necessary.
6461 AC_DEFUN([AC_FUNC_FTW],
6464 AC_REQUIRE([AC_HEADER_STAT])
6465 AC_REQUIRE([jm_FUNC_LSTAT])
6466 AC_REQUIRE([AC_HEADER_DIRENT])
6467 AC_CHECK_HEADERS(sys/param.h)
6468 AC_CHECK_DECLS([stpcpy])
6470 # In the event that we have to use the replacement ftw.c,
6471 # see if we'll also need the replacement tsearch.c.
6472 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
6474 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
6475 ac_cv_func_ftw_working,
6477 # The following test would fail prior to glibc-2.3.2, because `depth'
6478 # would be 2 rather than 4. Of course, now that we require FTW_DCH
6479 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
6480 mkdir -p conftest.dir/a/b/c
6481 AC_RUN_IFELSE([AC_LANG_SOURCE([[
6486 static char *_f[] = { "conftest.dir", "conftest.dir/a",
6487 "conftest.dir/a/b", "conftest.dir/a/b/c" };
6488 static char **p = _f;
6492 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
6494 if (strcmp (file, *p++) != 0)
6503 /* Require these symbols, too. */
6507 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
6508 exit ((err == 0 && depth == 4) ? 0 : 1);
6511 [ac_cv_func_ftw_working=yes],
6512 [ac_cv_func_ftw_working=no],
6513 [ac_cv_func_ftw_working=no])])
6515 if test $ac_cv_func_ftw_working = no; then
6517 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
6518 # Add tsearch.o IFF we have to use the replacement ftw.c.
6519 if test -n "$need_tdestroy"; then
6520 AC_LIBOBJ([tsearch])
6521 # Link search.h to search_.h if we use the replacement tsearch.c.
6523 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
6530 dnl From Jim Meyering.
6531 dnl Provide lchown on systems that lack it.
6533 AC_DEFUN([jm_FUNC_LCHOWN],
6535 AC_REQUIRE([AC_TYPE_UID_T])
6536 AC_REPLACE_FUNCS(lchown)
6537 if test $ac_cv_func_lchown = no; then
6542 # Prerequisites of lib/lchown.c.
6543 AC_DEFUN([gl_PREREQ_LCHOWN],
6545 AC_REQUIRE([AC_HEADER_STAT])
6551 # When rmdir fails because the specified directory is not empty, it sets
6552 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
6553 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
6554 # in general, to avoid depending on the use of any particular symbol, this
6555 # test runs a test to determine the actual numeric value.
6556 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
6558 AC_CACHE_CHECK([for rmdir-not-empty errno value],
6559 fetish_cv_func_rmdir_errno_not_empty,
6561 # Arrange for deletion of the temporary directory this test creates.
6562 ac_clean_files="$ac_clean_files confdir2"
6563 mkdir confdir2; : > confdir2/file
6576 s = fopen ("confdir2/errno", "w");
6577 fprintf (s, "%d\n", val);
6581 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
6582 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
6583 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
6588 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
6589 $fetish_cv_func_rmdir_errno_not_empty,
6590 [the value to which errno is set when rmdir fails on a nonempty directory])
6595 dnl From Jim Meyering.
6596 dnl Determine whether chown accepts arguments of -1 for uid and gid.
6597 dnl If it doesn't, arrange to use the replacement function.
6600 AC_DEFUN([jm_FUNC_CHOWN],
6602 AC_REQUIRE([AC_TYPE_UID_T])dnl
6603 AC_REQUIRE([AC_FUNC_CHOWN])
6604 if test $ac_cv_func_chown_works = no; then
6606 AC_DEFINE(chown, rpl_chown,
6607 [Define to rpl_chown if the replacement function should be used.])
6612 # Prerequisites of lib/chown.c.
6613 AC_DEFUN([gl_PREREQ_CHOWN],
6615 AC_CHECK_HEADERS_ONCE(unistd.h)
6620 dnl Written by Jim Meyering
6622 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
6624 dnl Persuade glibc <unistd.h> to declare group_member().
6625 AC_REQUIRE([AC_GNU_SOURCE])
6627 dnl Do this replacement check manually because I want the hyphen
6628 dnl (not the underscore) in the filename.
6629 AC_CHECK_FUNC(group_member, , [
6630 AC_LIBOBJ(group-member)
6631 gl_PREREQ_GROUP_MEMBER
6635 # Prerequisites of lib/group-member.c.
6636 AC_DEFUN([gl_PREREQ_GROUP_MEMBER],
6638 AC_CHECK_HEADERS_ONCE(unistd.h)
6639 AC_REQUIRE([AC_FUNC_GETGROUPS])
6643 dnl Run a program to determine whether whether link(2) follows symlinks.
6644 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
6646 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
6649 [whether link(2) dereferences a symlink specified with a trailing slash],
6650 jm_ac_cv_func_link_follows_symlink,
6652 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
6653 dnl the appropriate framework.
6654 test -z "$ac_cv_header_unistd_h" \
6655 && AC_CHECK_HEADERS(unistd.h)
6657 # Create a regular file.
6658 echo > conftest.file
6661 # include <sys/types.h>
6662 # include <sys/stat.h>
6663 # ifdef HAVE_UNISTD_H
6664 # include <unistd.h>
6667 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
6668 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
6669 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
6674 const char *file = "conftest.file";
6675 const char *sym = "conftest.sym";
6676 const char *hard = "conftest.hard";
6677 struct stat sb_file, sb_hard;
6679 /* Create a symlink to the regular file. */
6680 if (symlink (file, sym))
6683 /* Create a hard link to that symlink. */
6684 if (link (sym, hard))
6687 if (lstat (hard, &sb_hard))
6689 if (lstat (file, &sb_file))
6692 /* If the dev/inode of hard and file are the same, then
6693 the link call followed the symlink. */
6694 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
6697 jm_ac_cv_func_link_follows_symlink=yes,
6698 jm_ac_cv_func_link_follows_symlink=no,
6699 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
6702 if test $jm_ac_cv_func_link_follows_symlink = yes; then
6703 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
6704 [Define if `link(2)' dereferences symbolic links.])
6710 dnl From Jim Meyering
6711 dnl Using code from emacs, based on suggestions from Paul Eggert
6712 dnl and Ulrich Drepper.
6714 dnl Find out how to determine the number of pending output bytes on a stream.
6715 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
6716 dnl we have to grub around in the FILE struct.
6718 AC_DEFUN([jm_FUNC_FPENDING],
6720 AC_CHECK_HEADERS(stdio_ext.h)
6721 AC_REPLACE_FUNCS([__fpending])
6723 # if HAVE_STDIO_EXT_H
6724 # include <stdio_ext.h>
6727 AC_CHECK_DECLS([__fpending], , , $fp_headers)
6728 if test $ac_cv_func___fpending = no; then
6730 [how to determine the number of pending output bytes on a stream],
6731 ac_cv_sys_pending_output_n_bytes,
6736 'fp->_IO_write_ptr - fp->_IO_write_base' \
6738 '# traditional Unix' \
6739 'fp->_ptr - fp->_base' \
6742 'fp->_p - fp->_bf._base' \
6745 'fp->__ptr - fp->__base' \
6748 'fp->__bufp - fp->__buffer' \
6750 '# old glibc iostream?' \
6751 'fp->_pptr - fp->_pbase' \
6754 '(*fp)->_ptr - (*fp)->_base' \
6756 '# e.g., DGUX R4.11; the info is not available' \
6760 # Skip each embedded comment.
6761 case "$ac_expr" in '#'*) continue;; esac
6766 [FILE *fp = stdin; (void) ($ac_expr);],
6769 test "$fp_done" = yes && break
6772 ac_cv_sys_pending_output_n_bytes=$ac_expr
6775 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
6776 $ac_cv_sys_pending_output_n_bytes,
6777 [the number of pending output bytes on stream `fp'])
6781 # inttypes-pri.m4 serial 1 (gettext-0.11.4)
6782 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
6783 dnl This file is free software, distributed under the terms of the GNU
6784 dnl General Public License. As a special exception to the GNU General
6785 dnl Public License, this file may be distributed as part of a program
6786 dnl that contains a configuration script generated by Autoconf, under
6787 dnl the same distribution terms as the rest of that program.
6789 dnl From Bruno Haible.
6791 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
6792 # macros to non-string values. This is the case on AIX 4.3.3.
6794 AC_DEFUN([gt_INTTYPES_PRI],
6796 AC_REQUIRE([gt_HEADER_INTTYPES_H])
6797 if test $gt_cv_header_inttypes_h = yes; then
6798 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
6799 gt_cv_inttypes_pri_broken,
6801 AC_TRY_COMPILE([#include <inttypes.h>
6805 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
6808 if test "$gt_cv_inttypes_pri_broken" = yes; then
6809 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
6810 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
6814 # Assume AM_GNU_GETTEXT([external]) and Autoconf 2.54 or later, for coreutils.
6818 dnl Copyright (C) 2003 Free Software Foundation, Inc.
6819 dnl This file is free software, distributed under the terms of the GNU
6820 dnl General Public License. As a special exception to the GNU General
6821 dnl Public License, this file may be distributed as part of a program
6822 dnl that contains a configuration script generated by Autoconf, under
6823 dnl the same distribution terms as the rest of that program.
6825 dnl From Paul Eggert
6827 dnl Automake doesn't understand that AM_GNU_GETTEXT([external])
6828 dnl never invokes the following macros, because of the [external].
6829 dnl Insert empty macros to pacify Automake.
6831 AC_DEFUN([AM_LC_MESSAGES])
6832 AC_DEFUN([AM_MKINSTALLDIRS])
6833 AC_DEFUN([gt_INTDIV0])
6835 dnl A simpler substitute for gt_INTTYPES_PRI that assumes Autoconf 2.54
6838 AC_DEFUN([gt_HEADER_INTTYPES_H], [
6839 AC_REQUIRE([AC_HEADER_STDC])
6840 gt_cv_header_inttypes_h=$ac_cv_header_inttypes_h
6845 dnl From Jim Meyering.
6846 dnl A wrapper around AC_FUNC_GETGROUPS.
6848 AC_DEFUN([jm_FUNC_GETGROUPS],
6850 AC_REQUIRE([AC_FUNC_GETGROUPS])
6851 if test $ac_cv_func_getgroups_works = no; then
6852 AC_LIBOBJ(getgroups)
6853 AC_DEFINE(getgroups, rpl_getgroups,
6854 [Define as rpl_getgroups if getgroups doesn't work right.])
6857 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
6860 # Prerequisites of lib/getgroups.c.
6861 AC_DEFUN([gl_PREREQ_GETGROUPS],
6863 AC_REQUIRE([AC_TYPE_GETGROUPS])
6870 AC_DEFUN([jm_SYS_PROC_UPTIME],
6871 [ dnl Require AC_PROG_CC to see if we're cross compiling.
6872 AC_REQUIRE([AC_PROG_CC])
6873 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
6874 [jm_cv_have_proc_uptime=no
6875 test -f /proc/uptime \
6876 && test "$cross_compiling" = no \
6877 && cat < /proc/uptime >/dev/null 2>/dev/null \
6878 && jm_cv_have_proc_uptime=yes])
6879 if test $jm_cv_have_proc_uptime = yes; then
6880 AC_DEFINE(HAVE_PROC_UPTIME, 1,
6881 [ Define if your system has the /proc/uptime special file.])
6887 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
6889 AC_DEFUN([jm_FUNC_FTRUNCATE],
6891 AC_REPLACE_FUNCS(ftruncate)
6892 if test $ac_cv_func_ftruncate = no; then
6897 # Prerequisites of lib/ftruncate.c.
6898 AC_DEFUN([gl_PREREQ_FTRUNCATE],
6900 AC_CHECK_HEADERS_ONCE(unistd.h)
6901 AC_CHECK_FUNCS(chsize)
6905 # Determine approximately how many files may be open simultaneously
6906 # in one process. This is approximate, since while running this test,
6907 # the configure script already has a few files open.
6910 AC_DEFUN([UTILS_SYS_OPEN_MAX],
6912 AC_CACHE_CHECK([determine how many files may be open simultaneously],
6913 utils_cv_sys_open_max,
6915 AC_RUN_IFELSE([AC_LANG_SOURCE([[
6922 FILE *result = fopen ("conftest.omax", "w");
6924 /* Impose an arbitrary limit, in case some system has no
6925 effective limit on the number of simultaneously open files. */
6928 FILE *s = fopen ("conftest.op", "w");
6933 fprintf (result, "%d\n", i);
6934 exit (fclose (result) == EOF);
6937 [utils_cv_sys_open_max=`cat conftest.omax`],
6938 [utils_cv_sys_open_max='internal error in open-max.m4'],
6939 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
6941 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
6942 $utils_cv_sys_open_max,
6943 [the maximum number of simultaneously open files per process])
6947 # Check whether getcwd has the bug that it succeeds for a working directory
6948 # longer than PATH_MAX, yet returns a truncated directory name.
6949 # If so, arrange to compile the wrapper function.
6951 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
6952 # I've heard that this is due to a Linux kernel bug, and that it has
6953 # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */
6957 AC_DEFUN([GL_FUNC_GETCWD_PATH_MAX],
6959 AC_CHECK_DECLS([getcwd])
6960 AC_CACHE_CHECK([whether getcwd properly handles paths longer than PATH_MAX],
6961 gl_cv_func_getcwd_vs_path_max,
6963 # Arrange for deletion of the temporary directory this test creates.
6964 ac_clean_files="$ac_clean_files confdir3"
6965 AC_RUN_IFELSE([AC_LANG_SOURCE([[
6970 #include <sys/stat.h>
6971 #include <sys/types.h>
6973 /* Don't get link errors because mkdir is redefined to rpl_mkdir. */
6980 /* The extra casts work around common compiler bugs. */
6981 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
6982 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
6983 It is necessary at least when t == time_t. */
6984 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
6985 ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
6986 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
6989 # define INT_MAX TYPE_MAXIMUM (int)
6992 /* The length of this name must be 8. */
6993 #define DIR_NAME "confdir3"
6999 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
7000 at least not on a local file system. And if we were to start worrying
7001 about remote file systems, we'd have to enable the wrapper function
7002 all of the time, just to be safe. That's not worth the cost. */
7004 #elif INT_MAX - 9 <= PATH_MAX
7005 /* The '9', above, comes from strlen (DIR_NAME) + 1. */
7006 /* FIXME: Assuming there's a system for which this is true,
7007 this should be done in a compile test. */
7010 char buf[PATH_MAX + 20];
7011 char *cwd = getcwd (buf, PATH_MAX);
7014 size_t n_chdirs = 0;
7019 cwd_len = strlen (cwd);
7026 cwd_len += 1 + strlen (DIR_NAME);
7027 /* If mkdir or chdir fails, be pessimistic and consider that
7028 as a failure, too. */
7029 if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0)
7034 if ((c = getcwd (buf, PATH_MAX)) == NULL)
7036 /* This allows any failure to indicate there is no bug.
7037 FIXME: check errno? */
7040 if ((len = strlen (c)) != cwd_len)
7050 /* Leaving behind such a deep directory is not polite.
7051 So clean up here, right away, even though the driving
7052 shell script would also clean up. */
7056 /* Unlink first, in case the chdir failed. */
7058 for (i = 0; i <= n_chdirs; i++)
7060 if (chdir ("..") < 0)
7070 [gl_cv_func_getcwd_vs_path_max=yes],
7071 [gl_cv_func_getcwd_vs_path_max=no],
7072 [gl_cv_func_getcwd_vs_path_max=no])])
7074 if test $gl_cv_func_getcwd_vs_path_max = yes; then
7076 AC_DEFINE(getcwd, rpl_getcwd,
7077 [Define to rpl_getcwd if the wrapper function should be used.])
7083 dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
7084 dnl to test whether a NULL return value really means there are no more files
7085 dnl in the directory.
7087 dnl And the rm from coreutils-5.0 exposes a similar problem when there
7088 dnl are 338 or more files in a directory on a Darwin-6.5 system
7090 dnl Detect the problem by creating a directory containing 500 files (254 not
7091 dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
7092 dnl if a loop doing `readdir; unlink' removes all of them.
7094 dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
7096 dnl Written by Jim Meyering.
7098 AC_DEFUN([GL_FUNC_READDIR],
7100 AC_REQUIRE([AC_HEADER_DIRENT])
7101 AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
7103 # Arrange for deletion of the temporary directory this test creates, in
7104 # case the test itself fails to delete everything -- as happens on Sunos.
7105 ac_clean_files="$ac_clean_files conf-dir"
7108 [# include <stdio.h>
7109 # include <sys/types.h>
7110 # include <string.h>
7112 # ifdef HAVE_DIRENT_H
7113 # include <dirent.h>
7114 # define NLENGTH(direct) (strlen((direct)->d_name))
7115 # else /* not HAVE_DIRENT_H */
7116 # define dirent direct
7117 # define NLENGTH(direct) ((direct)->d_namlen)
7118 # ifdef HAVE_SYS_NDIR_H
7119 # include <sys/ndir.h>
7120 # endif /* HAVE_SYS_NDIR_H */
7121 # ifdef HAVE_SYS_DIR_H
7122 # include <sys/dir.h>
7123 # endif /* HAVE_SYS_DIR_H */
7126 # endif /* HAVE_NDIR_H */
7127 # endif /* HAVE_DIRENT_H */
7129 # define DOT_OR_DOTDOT(Basename) \
7130 (Basename[0] == '.' && (Basename[1] == '\0' \
7131 || (Basename[1] == '.' && Basename[2] == '\0')))
7133 /* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
7137 create_N_file_dir (const char *dir, size_t n_files)
7141 if (mkdir (dir, 0700))
7146 for (i = 0; i < n_files; i++)
7151 sprintf (file_name, "%03d", i);
7152 out = fopen (file_name, "w");
7155 if (fclose (out) == EOF)
7164 remove_dir (const char *dir)
7171 dirp = opendir (".");
7177 struct dirent *dp = readdir (dirp);
7181 if (DOT_OR_DOTDOT (dp->d_name))
7184 if (unlink (dp->d_name))
7199 const char *dir = "conf-dir";
7200 create_N_file_dir (dir, 500);
7204 gl_cv_func_working_readdir=yes,
7205 gl_cv_func_working_readdir=no,
7206 gl_cv_func_working_readdir=no)])
7208 if test $gl_cv_func_working_readdir = yes; then
7209 AC_DEFINE(HAVE_WORKING_READDIR, 1,
7210 [Define if readdir is found to work properly in some unusual cases. ])
7214 # codeset.m4 serial AM1 (gettext-0.10.40)
7215 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
7216 dnl This file is free software, distributed under the terms of the GNU
7217 dnl General Public License. As a special exception to the GNU General
7218 dnl Public License, this file may be distributed as part of a program
7219 dnl that contains a configuration script generated by Autoconf, under
7220 dnl the same distribution terms as the rest of that program.
7222 dnl From Bruno Haible.
7224 AC_DEFUN([AM_LANGINFO_CODESET],
7226 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
7227 [AC_TRY_LINK([#include <langinfo.h>],
7228 [char* cs = nl_langinfo(CODESET);],
7229 am_cv_langinfo_codeset=yes,
7230 am_cv_langinfo_codeset=no)
7232 if test $am_cv_langinfo_codeset = yes; then
7233 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
7234 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
7238 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
7239 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
7240 dnl This file is free software, distributed under the terms of the GNU
7241 dnl General Public License. As a special exception to the GNU General
7242 dnl Public License, this file may be distributed as part of a program
7243 dnl that contains a configuration script generated by Autoconf, under
7244 dnl the same distribution terms as the rest of that program.
7246 # Test for the GNU C Library, version 2.1 or newer.
7247 # From Bruno Haible.
7249 AC_DEFUN([jm_GLIBC21],
7251 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
7252 ac_cv_gnu_library_2_1,
7253 [AC_EGREP_CPP([Lucky GNU user],
7255 #include <features.h>
7256 #ifdef __GNU_LIBRARY__
7257 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
7262 ac_cv_gnu_library_2_1=yes,
7263 ac_cv_gnu_library_2_1=no)
7267 GLIBC21="$ac_cv_gnu_library_2_1"
7271 # iconv.m4 serial AM4 (gettext-0.11.3)
7272 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
7273 dnl This file is free software, distributed under the terms of the GNU
7274 dnl General Public License. As a special exception to the GNU General
7275 dnl Public License, this file may be distributed as part of a program
7276 dnl that contains a configuration script generated by Autoconf, under
7277 dnl the same distribution terms as the rest of that program.
7279 dnl From Bruno Haible.
7281 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
7283 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
7284 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
7285 AC_REQUIRE([AC_LIB_RPATH])
7287 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
7289 AC_LIB_LINKFLAGS_BODY([iconv])
7292 AC_DEFUN([AM_ICONV_LINK],
7294 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
7295 dnl those with the standalone portable GNU libiconv installed).
7297 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
7299 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
7301 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
7302 dnl because if the user has installed libiconv and not disabled its use
7303 dnl via --without-libiconv-prefix, he wants to use it. The first
7304 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
7305 am_save_CPPFLAGS="$CPPFLAGS"
7306 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
7308 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
7309 am_cv_func_iconv="no, consider installing GNU libiconv"
7311 AC_TRY_LINK([#include <stdlib.h>
7312 #include <iconv.h>],
7313 [iconv_t cd = iconv_open("","");
7314 iconv(cd,NULL,NULL,NULL,NULL);
7316 am_cv_func_iconv=yes)
7317 if test "$am_cv_func_iconv" != yes; then
7318 am_save_LIBS="$LIBS"
7319 LIBS="$LIBS $LIBICONV"
7320 AC_TRY_LINK([#include <stdlib.h>
7321 #include <iconv.h>],
7322 [iconv_t cd = iconv_open("","");
7323 iconv(cd,NULL,NULL,NULL,NULL);
7326 am_cv_func_iconv=yes)
7327 LIBS="$am_save_LIBS"
7330 if test "$am_cv_func_iconv" = yes; then
7331 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
7333 if test "$am_cv_lib_iconv" = yes; then
7334 AC_MSG_CHECKING([how to link with libiconv])
7335 AC_MSG_RESULT([$LIBICONV])
7337 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
7339 CPPFLAGS="$am_save_CPPFLAGS"
7344 AC_SUBST(LTLIBICONV)
7347 AC_DEFUN([AM_ICONV],
7350 if test "$am_cv_func_iconv" = yes; then
7351 AC_MSG_CHECKING([for iconv declaration])
7352 AC_CACHE_VAL(am_cv_proto_iconv, [
7360 #if defined(__STDC__) || defined(__cplusplus)
7361 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
7365 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
7366 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);"])
7367 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
7368 AC_MSG_RESULT([$]{ac_t:-
7369 }[$]am_cv_proto_iconv)
7370 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
7371 [Define as const if the declaration of iconv() needs const.])
7375 # lib-prefix.m4 serial 2 (gettext-0.12)
7376 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
7377 dnl This file is free software, distributed under the terms of the GNU
7378 dnl General Public License. As a special exception to the GNU General
7379 dnl Public License, this file may be distributed as part of a program
7380 dnl that contains a configuration script generated by Autoconf, under
7381 dnl the same distribution terms as the rest of that program.
7383 dnl From Bruno Haible.
7385 dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
7386 dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
7387 dnl require excessive bracketing.
7388 ifdef([AC_HELP_STRING],
7389 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
7390 [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
7392 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
7393 dnl to access previously installed libraries. The basic assumption is that
7394 dnl a user will want packages to use other packages he previously installed
7395 dnl with the same --prefix option.
7396 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
7397 dnl libraries, but is otherwise very convenient.
7398 AC_DEFUN([AC_LIB_PREFIX],
7400 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
7401 AC_REQUIRE([AC_PROG_CC])
7402 AC_REQUIRE([AC_CANONICAL_HOST])
7403 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
7404 dnl By default, look in $includedir and $libdir.
7406 AC_LIB_WITH_FINAL_PREFIX([
7407 eval additional_includedir=\"$includedir\"
7408 eval additional_libdir=\"$libdir\"
7410 AC_LIB_ARG_WITH([lib-prefix],
7411 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
7412 --without-lib-prefix don't search for libraries in includedir and libdir],
7414 if test "X$withval" = "Xno"; then
7417 if test "X$withval" = "X"; then
7418 AC_LIB_WITH_FINAL_PREFIX([
7419 eval additional_includedir=\"$includedir\"
7420 eval additional_libdir=\"$libdir\"
7423 additional_includedir="$withval/include"
7424 additional_libdir="$withval/lib"
7428 if test $use_additional = yes; then
7429 dnl Potentially add $additional_includedir to $CPPFLAGS.
7430 dnl But don't add it
7431 dnl 1. if it's the standard /usr/include,
7432 dnl 2. if it's already present in $CPPFLAGS,
7433 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
7434 dnl 4. if it doesn't exist as a directory.
7435 if test "X$additional_includedir" != "X/usr/include"; then
7437 for x in $CPPFLAGS; do
7438 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7439 if test "X$x" = "X-I$additional_includedir"; then
7444 if test -z "$haveit"; then
7445 if test "X$additional_includedir" = "X/usr/local/include"; then
7446 if test -n "$GCC"; then
7448 linux*) haveit=yes;;
7452 if test -z "$haveit"; then
7453 if test -d "$additional_includedir"; then
7454 dnl Really add $additional_includedir to $CPPFLAGS.
7455 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
7460 dnl Potentially add $additional_libdir to $LDFLAGS.
7461 dnl But don't add it
7462 dnl 1. if it's the standard /usr/lib,
7463 dnl 2. if it's already present in $LDFLAGS,
7464 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
7465 dnl 4. if it doesn't exist as a directory.
7466 if test "X$additional_libdir" != "X/usr/lib"; then
7468 for x in $LDFLAGS; do
7469 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7470 if test "X$x" = "X-L$additional_libdir"; then
7475 if test -z "$haveit"; then
7476 if test "X$additional_libdir" = "X/usr/local/lib"; then
7477 if test -n "$GCC"; then
7479 linux*) haveit=yes;;
7483 if test -z "$haveit"; then
7484 if test -d "$additional_libdir"; then
7485 dnl Really add $additional_libdir to $LDFLAGS.
7486 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
7494 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
7495 dnl acl_final_exec_prefix, containing the values to which $prefix and
7496 dnl $exec_prefix will expand at the end of the configure script.
7497 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
7499 dnl Unfortunately, prefix and exec_prefix get only finally determined
7500 dnl at the end of configure.
7501 if test "X$prefix" = "XNONE"; then
7502 acl_final_prefix="$ac_default_prefix"
7504 acl_final_prefix="$prefix"
7506 if test "X$exec_prefix" = "XNONE"; then
7507 acl_final_exec_prefix='${prefix}'
7509 acl_final_exec_prefix="$exec_prefix"
7511 acl_save_prefix="$prefix"
7512 prefix="$acl_final_prefix"
7513 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
7514 prefix="$acl_save_prefix"
7517 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
7518 dnl variables prefix and exec_prefix bound to the values they will have
7519 dnl at the end of the configure script.
7520 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
7522 acl_save_prefix="$prefix"
7523 prefix="$acl_final_prefix"
7524 acl_save_exec_prefix="$exec_prefix"
7525 exec_prefix="$acl_final_exec_prefix"
7527 exec_prefix="$acl_save_exec_prefix"
7528 prefix="$acl_save_prefix"
7531 # lib-link.m4 serial 4 (gettext-0.12)
7532 dnl Copyright (C) 2001-2003 Free Software Foundation, Inc.
7533 dnl This file is free software, distributed under the terms of the GNU
7534 dnl General Public License. As a special exception to the GNU General
7535 dnl Public License, this file may be distributed as part of a program
7536 dnl that contains a configuration script generated by Autoconf, under
7537 dnl the same distribution terms as the rest of that program.
7539 dnl From Bruno Haible.
7541 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
7542 dnl the libraries corresponding to explicit and implicit dependencies.
7543 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
7544 dnl augments the CPPFLAGS variable.
7545 AC_DEFUN([AC_LIB_LINKFLAGS],
7547 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
7548 AC_REQUIRE([AC_LIB_RPATH])
7549 define([Name],[translit([$1],[./-], [___])])
7550 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
7551 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
7552 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
7553 AC_LIB_LINKFLAGS_BODY([$1], [$2])
7554 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
7555 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
7556 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
7558 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
7559 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
7560 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
7561 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
7563 AC_SUBST([LTLIB]NAME)
7564 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
7565 dnl results of this search when this library appears as a dependency.
7571 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
7572 dnl searches for libname and the libraries corresponding to explicit and
7573 dnl implicit dependencies, together with the specified include files and
7574 dnl the ability to compile and link the specified testcode. If found, it
7575 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
7576 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
7577 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
7578 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
7579 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
7581 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
7582 AC_REQUIRE([AC_LIB_RPATH])
7583 define([Name],[translit([$1],[./-], [___])])
7584 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
7585 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
7587 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
7589 AC_LIB_LINKFLAGS_BODY([$1], [$2])
7591 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
7592 dnl because if the user has installed lib[]Name and not disabled its use
7593 dnl via --without-lib[]Name-prefix, he wants to use it.
7594 ac_save_CPPFLAGS="$CPPFLAGS"
7595 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
7597 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
7598 ac_save_LIBS="$LIBS"
7599 LIBS="$LIBS $LIB[]NAME"
7600 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
7601 LIBS="$ac_save_LIBS"
7603 if test "$ac_cv_lib[]Name" = yes; then
7605 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
7606 AC_MSG_CHECKING([how to link with lib[]$1])
7607 AC_MSG_RESULT([$LIB[]NAME])
7610 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
7611 dnl $INC[]NAME either.
7612 CPPFLAGS="$ac_save_CPPFLAGS"
7616 AC_SUBST([HAVE_LIB]NAME)
7618 AC_SUBST([LTLIB]NAME)
7623 dnl Determine the platform dependent parameters needed to use rpath:
7624 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
7625 dnl hardcode_direct, hardcode_minus_L.
7626 AC_DEFUN([AC_LIB_RPATH],
7628 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
7629 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
7630 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
7631 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
7632 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
7633 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
7634 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
7640 libext="$acl_cv_libext"
7641 shlibext="$acl_cv_shlibext"
7642 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
7643 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
7644 hardcode_direct="$acl_cv_hardcode_direct"
7645 hardcode_minus_L="$acl_cv_hardcode_minus_L"
7646 dnl Determine whether the user wants rpath handling at all.
7647 AC_ARG_ENABLE(rpath,
7648 [ --disable-rpath do not hardcode runtime library paths],
7649 :, enable_rpath=yes)
7652 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
7653 dnl the libraries corresponding to explicit and implicit dependencies.
7654 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
7655 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
7657 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
7658 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
7659 dnl By default, look in $includedir and $libdir.
7661 AC_LIB_WITH_FINAL_PREFIX([
7662 eval additional_includedir=\"$includedir\"
7663 eval additional_libdir=\"$libdir\"
7665 AC_LIB_ARG_WITH([lib$1-prefix],
7666 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
7667 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
7669 if test "X$withval" = "Xno"; then
7672 if test "X$withval" = "X"; then
7673 AC_LIB_WITH_FINAL_PREFIX([
7674 eval additional_includedir=\"$includedir\"
7675 eval additional_libdir=\"$libdir\"
7678 additional_includedir="$withval/include"
7679 additional_libdir="$withval/lib"
7683 dnl Search the library and its dependencies in $additional_libdir and
7684 dnl $LDFLAGS. Using breadth-first-seach.
7690 names_already_handled=
7691 names_next_round='$1 $2'
7692 while test -n "$names_next_round"; do
7693 names_this_round="$names_next_round"
7695 for name in $names_this_round; do
7697 for n in $names_already_handled; do
7698 if test "$n" = "$name"; then
7703 if test -z "$already_handled"; then
7704 names_already_handled="$names_already_handled $name"
7705 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
7706 dnl or AC_LIB_HAVE_LINKFLAGS call.
7707 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
7708 eval value=\"\$HAVE_LIB$uppername\"
7709 if test -n "$value"; then
7710 if test "$value" = yes; then
7711 eval value=\"\$LIB$uppername\"
7712 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
7713 eval value=\"\$LTLIB$uppername\"
7714 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
7716 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
7717 dnl that this library doesn't exist. So just drop it.
7721 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
7722 dnl and the already constructed $LIBNAME/$LTLIBNAME.
7727 if test $use_additional = yes; then
7728 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
7729 found_dir="$additional_libdir"
7730 found_so="$additional_libdir/lib$name.$shlibext"
7731 if test -f "$additional_libdir/lib$name.la"; then
7732 found_la="$additional_libdir/lib$name.la"
7735 if test -f "$additional_libdir/lib$name.$libext"; then
7736 found_dir="$additional_libdir"
7737 found_a="$additional_libdir/lib$name.$libext"
7738 if test -f "$additional_libdir/lib$name.la"; then
7739 found_la="$additional_libdir/lib$name.la"
7744 if test "X$found_dir" = "X"; then
7745 for x in $LDFLAGS $LTLIB[]NAME; do
7746 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7749 dir=`echo "X$x" | sed -e 's/^X-L//'`
7750 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
7752 found_so="$dir/lib$name.$shlibext"
7753 if test -f "$dir/lib$name.la"; then
7754 found_la="$dir/lib$name.la"
7757 if test -f "$dir/lib$name.$libext"; then
7759 found_a="$dir/lib$name.$libext"
7760 if test -f "$dir/lib$name.la"; then
7761 found_la="$dir/lib$name.la"
7767 if test "X$found_dir" != "X"; then
7772 if test "X$found_dir" != "X"; then
7773 dnl Found the library.
7774 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
7775 if test "X$found_so" != "X"; then
7776 dnl Linking with a shared library. We attempt to hardcode its
7777 dnl directory into the executable's runpath, unless it's the
7778 dnl standard /usr/lib.
7779 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
7780 dnl No hardcoding is needed.
7781 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
7783 dnl Use an explicit option to hardcode DIR into the resulting
7785 dnl Potentially add DIR to ltrpathdirs.
7786 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
7788 for x in $ltrpathdirs; do
7789 if test "X$x" = "X$found_dir"; then
7794 if test -z "$haveit"; then
7795 ltrpathdirs="$ltrpathdirs $found_dir"
7797 dnl The hardcoding into $LIBNAME is system dependent.
7798 if test "$hardcode_direct" = yes; then
7799 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
7800 dnl resulting binary.
7801 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
7803 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
7804 dnl Use an explicit option to hardcode DIR into the resulting
7806 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
7807 dnl Potentially add DIR to rpathdirs.
7808 dnl The rpathdirs will be appended to $LIBNAME at the end.
7810 for x in $rpathdirs; do
7811 if test "X$x" = "X$found_dir"; then
7816 if test -z "$haveit"; then
7817 rpathdirs="$rpathdirs $found_dir"
7820 dnl Rely on "-L$found_dir".
7821 dnl But don't add it if it's already contained in the LDFLAGS
7822 dnl or the already constructed $LIBNAME
7824 for x in $LDFLAGS $LIB[]NAME; do
7825 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7826 if test "X$x" = "X-L$found_dir"; then
7831 if test -z "$haveit"; then
7832 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
7834 if test "$hardcode_minus_L" != no; then
7835 dnl FIXME: Not sure whether we should use
7836 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
7838 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
7840 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
7841 dnl here, because this doesn't fit in flags passed to the
7842 dnl compiler. So give up. No hardcoding. This affects only
7843 dnl very old systems.
7844 dnl FIXME: Not sure whether we should use
7845 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
7847 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
7853 if test "X$found_a" != "X"; then
7854 dnl Linking with a static library.
7855 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
7857 dnl We shouldn't come here, but anyway it's good to have a
7859 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
7862 dnl Assume the include files are nearby.
7863 additional_includedir=
7864 case "$found_dir" in
7866 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
7867 additional_includedir="$basedir/include"
7870 if test "X$additional_includedir" != "X"; then
7871 dnl Potentially add $additional_includedir to $INCNAME.
7872 dnl But don't add it
7873 dnl 1. if it's the standard /usr/include,
7874 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
7875 dnl 3. if it's already present in $CPPFLAGS or the already
7876 dnl constructed $INCNAME,
7877 dnl 4. if it doesn't exist as a directory.
7878 if test "X$additional_includedir" != "X/usr/include"; then
7880 if test "X$additional_includedir" = "X/usr/local/include"; then
7881 if test -n "$GCC"; then
7883 linux*) haveit=yes;;
7887 if test -z "$haveit"; then
7888 for x in $CPPFLAGS $INC[]NAME; do
7889 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7890 if test "X$x" = "X-I$additional_includedir"; then
7895 if test -z "$haveit"; then
7896 if test -d "$additional_includedir"; then
7897 dnl Really add $additional_includedir to $INCNAME.
7898 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
7904 dnl Look for dependencies.
7905 if test -n "$found_la"; then
7906 dnl Read the .la file. It defines the variables
7907 dnl dlname, library_names, old_library, dependency_libs, current,
7908 dnl age, revision, installed, dlopen, dlpreopen, libdir.
7909 save_libdir="$libdir"
7911 */* | *\\*) . "$found_la" ;;
7912 *) . "./$found_la" ;;
7914 libdir="$save_libdir"
7915 dnl We use only dependency_libs.
7916 for dep in $dependency_libs; do
7919 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
7920 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
7921 dnl But don't add it
7922 dnl 1. if it's the standard /usr/lib,
7923 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
7924 dnl 3. if it's already present in $LDFLAGS or the already
7925 dnl constructed $LIBNAME,
7926 dnl 4. if it doesn't exist as a directory.
7927 if test "X$additional_libdir" != "X/usr/lib"; then
7929 if test "X$additional_libdir" = "X/usr/local/lib"; then
7930 if test -n "$GCC"; then
7932 linux*) haveit=yes;;
7936 if test -z "$haveit"; then
7938 for x in $LDFLAGS $LIB[]NAME; do
7939 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7940 if test "X$x" = "X-L$additional_libdir"; then
7945 if test -z "$haveit"; then
7946 if test -d "$additional_libdir"; then
7947 dnl Really add $additional_libdir to $LIBNAME.
7948 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
7952 for x in $LDFLAGS $LTLIB[]NAME; do
7953 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
7954 if test "X$x" = "X-L$additional_libdir"; then
7959 if test -z "$haveit"; then
7960 if test -d "$additional_libdir"; then
7961 dnl Really add $additional_libdir to $LTLIBNAME.
7962 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
7969 dir=`echo "X$dep" | sed -e 's/^X-R//'`
7970 if test "$enable_rpath" != no; then
7971 dnl Potentially add DIR to rpathdirs.
7972 dnl The rpathdirs will be appended to $LIBNAME at the end.
7974 for x in $rpathdirs; do
7975 if test "X$x" = "X$dir"; then
7980 if test -z "$haveit"; then
7981 rpathdirs="$rpathdirs $dir"
7983 dnl Potentially add DIR to ltrpathdirs.
7984 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
7986 for x in $ltrpathdirs; do
7987 if test "X$x" = "X$dir"; then
7992 if test -z "$haveit"; then
7993 ltrpathdirs="$ltrpathdirs $dir"
7998 dnl Handle this in the next round.
7999 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
8002 dnl Handle this in the next round. Throw away the .la's
8003 dnl directory; it is already contained in a preceding -L
8005 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
8008 dnl Most likely an immediate library name.
8009 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
8010 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
8016 dnl Didn't find the library; assume it is in the system directories
8017 dnl known to the linker and runtime loader. (All the system
8018 dnl directories known to the linker should also be known to the
8019 dnl runtime loader, otherwise the system is severely misconfigured.)
8020 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
8021 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
8027 if test "X$rpathdirs" != "X"; then
8028 if test -n "$hardcode_libdir_separator"; then
8029 dnl Weird platform: only the last -rpath option counts, the user must
8030 dnl pass all path elements in one option. We can arrange that for a
8031 dnl single library, but not when more than one $LIBNAMEs are used.
8033 for found_dir in $rpathdirs; do
8034 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
8036 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
8037 acl_save_libdir="$libdir"
8039 eval flag=\"$hardcode_libdir_flag_spec\"
8040 libdir="$acl_save_libdir"
8041 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
8043 dnl The -rpath options are cumulative.
8044 for found_dir in $rpathdirs; do
8045 acl_save_libdir="$libdir"
8047 eval flag=\"$hardcode_libdir_flag_spec\"
8048 libdir="$acl_save_libdir"
8049 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
8053 if test "X$ltrpathdirs" != "X"; then
8054 dnl When using libtool, the option that works for both libraries and
8055 dnl executables is -R. The -R options are cumulative.
8056 for found_dir in $ltrpathdirs; do
8057 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
8062 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
8063 dnl unless already present in VAR.
8064 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
8065 dnl contains two or three consecutive elements that belong together.
8066 AC_DEFUN([AC_LIB_APPENDTOVAR],
8068 for element in [$2]; do
8071 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
8072 if test "X$x" = "X$element"; then
8077 if test -z "$haveit"; then
8078 [$1]="${[$1]}${[$1]:+ }$element"
8083 # lib-ld.m4 serial 1003 (gettext-0.12)
8084 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
8085 dnl This file is free software, distributed under the terms of the GNU
8086 dnl General Public License. As a special exception to the GNU General
8087 dnl Public License, this file may be distributed as part of a program
8088 dnl that contains a configuration script generated by Autoconf, under
8089 dnl the same distribution terms as the rest of that program.
8091 dnl Subroutines of libtool.m4,
8092 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
8093 dnl with libtool.m4.
8095 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
8096 AC_DEFUN([AC_LIB_PROG_LD_GNU],
8097 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
8098 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
8099 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
8100 acl_cv_prog_gnu_ld=yes
8102 acl_cv_prog_gnu_ld=no
8104 with_gnu_ld=$acl_cv_prog_gnu_ld
8107 dnl From libtool-1.4. Sets the variable LD.
8108 AC_DEFUN([AC_LIB_PROG_LD],
8109 [AC_ARG_WITH(gnu-ld,
8110 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
8111 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
8112 AC_REQUIRE([AC_PROG_CC])dnl
8113 AC_REQUIRE([AC_CANONICAL_HOST])dnl
8114 # Prepare PATH_SEPARATOR.
8115 # The user is always right.
8116 if test "${PATH_SEPARATOR+set}" != set; then
8117 echo "#! /bin/sh" >conf$$.sh
8118 echo "exit 0" >>conf$$.sh
8120 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
8128 if test "$GCC" = yes; then
8129 # Check if gcc -print-prog-name=ld gives a path.
8130 AC_MSG_CHECKING([for ld used by GCC])
8133 # gcc leaves a trailing carriage return which upsets mingw
8134 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
8136 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
8139 # Accept absolute paths.
8140 [[\\/]* | [A-Za-z]:[\\/]*)]
8141 [re_direlt='/[^/][^/]*/\.\./']
8142 # Canonicalize the path of ld
8143 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
8144 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
8145 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
8147 test -z "$LD" && LD="$ac_prog"
8150 # If it fails, then pretend we aren't using GCC.
8154 # If it is relative, then search for the first ld in PATH.
8158 elif test "$with_gnu_ld" = yes; then
8159 AC_MSG_CHECKING([for GNU ld])
8161 AC_MSG_CHECKING([for non-GNU ld])
8163 AC_CACHE_VAL(acl_cv_path_LD,
8164 [if test -z "$LD"; then
8165 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
8166 for ac_dir in $PATH; do
8167 test -z "$ac_dir" && ac_dir=.
8168 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
8169 acl_cv_path_LD="$ac_dir/$ac_prog"
8170 # Check to see if the program is GNU ld. I'd rather use --version,
8171 # but apparently some GNU ld's only accept -v.
8172 # Break only if it was the GNU/non-GNU ld that we prefer.
8173 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
8174 test "$with_gnu_ld" != no && break
8176 test "$with_gnu_ld" != yes && break
8182 acl_cv_path_LD="$LD" # Let the user override the test with a path.
8184 LD="$acl_cv_path_LD"
8185 if test -n "$LD"; then
8190 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
8196 dnl From J. David Anglin.
8198 dnl HPUX and other systems can't unlink shared text that is being executed.
8200 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
8202 AC_CACHE_CHECK([whether a running program can be unlinked],
8203 jm_cv_func_unlink_busy_text,
8212 exit (unlink (argv[0]));
8215 jm_cv_func_unlink_busy_text=yes,
8216 jm_cv_func_unlink_busy_text=no,
8217 jm_cv_func_unlink_busy_text=no
8222 if test $jm_cv_func_unlink_busy_text = no; then
8223 INSTALL=$ac_install_sh
8228 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
8230 AC_REQUIRE([AC_HEADER_STDC])
8231 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
8232 AC_CHECK_FUNCS(resolvepath)
8233 AC_REQUIRE([AC_HEADER_STAT])
8235 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
8236 # if the function name weren't so long. Besides, I would rather
8237 # not have underscores in file names.
8238 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
8242 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
8244 # This program is free software; you can redistribute it and/or modify
8245 # it under the terms of the GNU General Public License as published by
8246 # the Free Software Foundation; either version 2, or (at your option)
8247 # any later version.
8249 # This program is distributed in the hope that it will be useful,
8250 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8251 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8252 # GNU General Public License for more details.
8254 # You should have received a copy of the GNU General Public License
8255 # along with this program; if not, write to the Free Software
8256 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
8261 AC_DEFUN([AM_C_PROTOTYPES],
8262 [AC_REQUIRE([AM_PROG_CC_STDC])
8263 AC_REQUIRE([AC_PROG_CPP])
8264 AC_MSG_CHECKING([for function prototypes])
8265 if test "$am_cv_prog_cc_stdc" != no; then
8267 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
8271 U=_ ANSI2KNR=./ansi2knr
8273 # Ensure some checks needed by ansi2knr itself.
8275 AC_CHECK_HEADERS(string.h)
8277 AC_SUBST(ANSI2KNR)dnl
8280 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
8283 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
8285 # This program is free software; you can redistribute it and/or modify
8286 # it under the terms of the GNU General Public License as published by
8287 # the Free Software Foundation; either version 2, or (at your option)
8288 # any later version.
8290 # This program is distributed in the hope that it will be useful,
8291 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8292 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8293 # GNU General Public License for more details.
8295 # You should have received a copy of the GNU General Public License
8296 # along with this program; if not, write to the Free Software
8297 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
8302 # @defmac AC_PROG_CC_STDC
8303 # @maindex PROG_CC_STDC
8305 # If the C compiler in not in ANSI C mode by default, try to add an option
8306 # to output variable @code{CC} to make it so. This macro tries various
8307 # options that select ANSI C on some system or another. It considers the
8308 # compiler to be in ANSI C mode if it handles function prototypes correctly.
8310 # If you use this macro, you should check after calling it whether the C
8311 # compiler has been set to accept ANSI C; if not, the shell variable
8312 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
8313 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
8314 # program @code{ansi2knr}, which comes with Ghostscript.
8317 AC_DEFUN([AM_PROG_CC_STDC],
8318 [AC_REQUIRE([AC_PROG_CC])
8319 AC_BEFORE([$0], [AC_C_INLINE])
8320 AC_BEFORE([$0], [AC_C_CONST])
8321 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
8322 dnl a magic option to avoid problems with ANSI preprocessor commands
8324 dnl FIXME: can't do this because then AC_AIX won't work due to a
8325 dnl circular dependency.
8326 dnl AC_BEFORE([$0], [AC_PROG_CPP])
8327 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
8328 AC_CACHE_VAL(am_cv_prog_cc_stdc,
8329 [am_cv_prog_cc_stdc=no
8331 # Don't try gcc -ansi; that turns off useful extensions and
8332 # breaks some systems' header files.
8333 # AIX -qlanglvl=ansi
8334 # Ultrix and OSF/1 -std1
8335 # HP-UX 10.20 and later -Ae
8336 # HP-UX older versions -Aa -D_HPUX_SOURCE
8337 # SVR4 -Xc -D__EXTENSIONS__
8338 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
8340 CC="$ac_save_CC $ac_arg"
8342 [#include <stdarg.h>
8344 #include <sys/types.h>
8345 #include <sys/stat.h>
8346 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
8347 struct buf { int x; };
8348 FILE * (*rcsopen) (struct buf *, struct stat *, int);
8349 static char *e (p, i)
8355 static char *f (char * (*g) (char **, int), char **p, ...)
8360 s = g (p, va_arg (v,int));
8364 int test (int i, double x);
8365 struct s1 {int (*f) (int a);};
8366 struct s2 {int (*f) (double a);};
8367 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
8371 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
8373 [am_cv_prog_cc_stdc="$ac_arg"; break])
8377 if test -z "$am_cv_prog_cc_stdc"; then
8378 AC_MSG_RESULT([none needed])
8380 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
8382 case "x$am_cv_prog_cc_stdc" in
8384 *) CC="$CC $am_cv_prog_cc_stdc" ;;
8388 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
8392 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
8394 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
8395 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
8396 [AC_TRY_COMPILE([#include <sys/types.h>
8397 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
8398 ac_cv_struct_st_dm_mode=yes,
8399 ac_cv_struct_st_dm_mode=no)])
8401 if test $ac_cv_struct_st_dm_mode = yes; then
8402 AC_DEFINE(HAVE_ST_DM_MODE, 1,
8403 [Define if struct stat has an st_dm_mode member. ])
8409 dnl From Jim Meyering and Paul Eggert.
8410 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
8411 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
8412 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
8413 jm_cv_sys_tiocgwinsz_needs_termios_h,
8414 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
8416 if test $ac_cv_sys_posix_termios = yes; then
8418 [#include <sys/types.h>
8419 # include <termios.h>
8423 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
8428 AC_DEFUN([jm_WINSIZE_IN_PTEM],
8429 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
8430 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
8431 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
8432 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
8433 if test $ac_cv_sys_posix_termios = yes; then
8434 AC_TRY_COMPILE([#include <termios.h>]
8435 [struct winsize x;],
8436 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
8438 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
8439 AC_TRY_COMPILE([#include <sys/ptem.h>],
8440 [struct winsize x;],
8441 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
8443 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
8444 AC_DEFINE([WINSIZE_IN_PTEM], 1,
8445 [Define if sys/ptem.h is required for struct winsize.])
8448 # Determine whether this system has infrastructure for obtaining the boot time.
8450 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
8451 * ----------------------------------------------------------
8452 AC_DEFUN([GNULIB_BOOT_TIME],
8454 AC_CHECK_FUNCS(sysctl)
8455 AC_CHECK_HEADERS(sys/sysctl.h)
8457 [whether we can get the system boot time],
8458 [gnulib_cv_have_boot_time],
8462 [AC_INCLUDES_DEFAULT
8463 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
8464 # include <sys/param.h> /* needed for OpenBSD 3.0 */
8465 # include <sys/sysctl.h>
8474 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
8475 /* your system *does* have the infrastructure to determine boot time */
8477 please_tell_us_how_to_determine_boot_time_on_your_system
8480 gnulib_cv_have_boot_time=yes,
8481 gnulib_cv_have_boot_time=no)
8483 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
8488 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
8489 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
8490 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
8491 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
8492 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
8494 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
8496 [#include <sys/types.h>
8497 # include <sys/ioctl.h>
8501 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
8504 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
8505 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
8506 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
8512 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
8514 AC_DEFUN([jm_LIB_CHECK],
8517 # Check for libypsec.a on Dolphin M88K machines.
8518 AC_CHECK_LIB(ypsec, main)
8520 # m88k running dgux 5.4 needs this
8521 AC_CHECK_LIB(ldgc, main)
8523 # Some programs need to link with -lm. printf does if it uses
8524 # lib/strtod.c which uses pow. And seq uses the math functions,
8525 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
8527 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
8528 # Check for these math functions used by seq.
8529 ac_su_saved_lib="$LIBS"
8531 AC_CHECK_FUNCS(floor modf rint)
8532 LIBS="$ac_su_saved_lib"
8535 AC_CHECK_FUNCS(sqrt)
8536 if test $ac_cv_func_sqrt = no; then
8537 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
8540 AC_SUBST(FESETROUND_LIBM)
8541 AC_CHECK_FUNCS(fesetround)
8542 if test $ac_cv_func_fesetround = no; then
8543 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
8546 # The -lsun library is required for YP support on Irix-4.0.5 systems.
8547 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
8548 AC_SEARCH_LIBS(yp_match, [sun ypsec])
8550 # SysV needs -lsec, older versions of Linux need -lshadow for
8551 # shadow passwords. UnixWare 7 needs -lgen.
8552 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
8554 AC_CHECK_HEADERS(shadow.h)
8556 # Requirements for su.c.
8558 $ac_includes_default
8560 # include <shadow.h>
8563 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
8564 AC_CHECK_FUNCS(getspnam)
8566 # SCO-ODT-3.0 is reported to need -lufc for crypt.
8567 # NetBSD needs -lcrypt for crypt.
8568 ac_su_saved_lib="$LIBS"
8569 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
8570 LIBS="$ac_su_saved_lib"
8574 # gettext.m4 serial 20 (gettext-0.12)
8575 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
8576 dnl This file is free software, distributed under the terms of the GNU
8577 dnl General Public License. As a special exception to the GNU General
8578 dnl Public License, this file may be distributed as part of a program
8579 dnl that contains a configuration script generated by Autoconf, under
8580 dnl the same distribution terms as the rest of that program.
8582 dnl This file can can be used in projects which are not available under
8583 dnl the GNU General Public License or the GNU Library General Public
8584 dnl License but which still want to provide support for the GNU gettext
8586 dnl Please note that the actual code of the GNU gettext library is covered
8587 dnl by the GNU Library General Public License, and the rest of the GNU
8588 dnl gettext package package is covered by the GNU General Public License.
8589 dnl They are *not* in the public domain.
8592 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
8593 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
8595 dnl Macro to add for using GNU gettext.
8597 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
8598 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
8599 dnl default (if it is not specified or empty) is 'no-libtool'.
8600 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
8601 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
8602 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
8603 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
8604 dnl depending on --{enable,disable}-{shared,static} and on the presence of
8605 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
8606 dnl $(top_builddir)/intl/libintl.a will be created.
8607 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
8608 dnl implementations (in libc or libintl) without the ngettext() function
8609 dnl will be ignored. If NEEDSYMBOL is specified and is
8610 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
8611 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
8612 dnl INTLDIR is used to find the intl libraries. If empty,
8613 dnl the value `$(top_builddir)/intl/' is used.
8615 dnl The result of the configuration is one of three cases:
8616 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
8618 dnl Catalog format: GNU --> install in $(datadir)
8619 dnl Catalog extension: .mo after installation, .gmo in source tree
8620 dnl 2) GNU gettext has been found in the system's C library.
8621 dnl Catalog format: GNU --> install in $(datadir)
8622 dnl Catalog extension: .mo after installation, .gmo in source tree
8623 dnl 3) No internationalization, always use English msgid.
8624 dnl Catalog format: none
8625 dnl Catalog extension: none
8626 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
8627 dnl The use of .gmo is historical (it was needed to avoid overwriting the
8628 dnl GNU format catalogs when building on a platform with an X/Open gettext),
8629 dnl but we keep it in order not to force irrelevant filename changes on the
8632 AC_DEFUN([AM_GNU_GETTEXT],
8634 dnl Argument checking.
8635 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
8636 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
8638 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
8639 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
8641 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
8642 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
8644 AC_REQUIRE([AM_PO_SUBDIRS])dnl
8645 ifelse(gt_included_intl, yes, [
8646 AC_REQUIRE([AM_INTL_SUBDIR])dnl
8649 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
8650 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
8651 AC_REQUIRE([AC_LIB_RPATH])
8653 dnl Sometimes libintl requires libiconv, so first search for libiconv.
8654 dnl Ideally we would do this search only after the
8655 dnl if test "$USE_NLS" = "yes"; then
8656 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
8657 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
8658 dnl the configure script would need to contain the same shell code
8659 dnl again, outside any 'if'. There are two solutions:
8660 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
8661 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
8662 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
8663 dnl documented, we avoid it.
8664 ifelse(gt_included_intl, yes, , [
8665 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
8671 ifelse(gt_included_intl, yes, [
8672 BUILD_INCLUDED_LIBINTL=no
8673 USE_INCLUDED_LIBINTL=no
8679 dnl If we use NLS figure out what method
8680 if test "$USE_NLS" = "yes"; then
8681 gt_use_preinstalled_gnugettext=no
8682 ifelse(gt_included_intl, yes, [
8683 AC_MSG_CHECKING([whether included gettext is requested])
8684 AC_ARG_WITH(included-gettext,
8685 [ --with-included-gettext use the GNU gettext library included here],
8686 nls_cv_force_use_gnu_gettext=$withval,
8687 nls_cv_force_use_gnu_gettext=no)
8688 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
8690 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
8691 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
8693 dnl User does not insist on using GNU NLS library. Figure out what
8694 dnl to use. If GNU gettext is available we use this. Else we have
8695 dnl to fall back to GNU NLS library.
8697 dnl Add a version number to the cache macros.
8698 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
8699 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
8700 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
8702 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
8703 [AC_TRY_LINK([#include <libintl.h>
8704 ]ifelse([$2], [need-formatstring-macros],
8705 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
8706 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
8709 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
8711 ], [])[extern int _nl_msg_cat_cntr;
8712 extern int *_nl_domain_bindings;],
8713 [bindtextdomain ("", "");
8714 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
8715 gt_cv_func_gnugettext_libc=yes,
8716 gt_cv_func_gnugettext_libc=no)])
8718 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
8719 dnl Sometimes libintl requires libiconv, so first search for libiconv.
8720 ifelse(gt_included_intl, yes, , [
8723 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
8724 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
8725 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
8726 dnl even if libiconv doesn't exist.
8727 AC_LIB_LINKFLAGS_BODY([intl])
8728 AC_CACHE_CHECK([for GNU gettext in libintl],
8729 gt_cv_func_gnugettext_libintl,
8730 [gt_save_CPPFLAGS="$CPPFLAGS"
8731 CPPFLAGS="$CPPFLAGS $INCINTL"
8732 gt_save_LIBS="$LIBS"
8733 LIBS="$LIBS $LIBINTL"
8734 dnl Now see whether libintl exists and does not depend on libiconv.
8735 AC_TRY_LINK([#include <libintl.h>
8736 ]ifelse([$2], [need-formatstring-macros],
8737 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
8738 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
8741 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
8743 ], [])[extern int _nl_msg_cat_cntr;
8748 const char *_nl_expand_alias ();],
8749 [bindtextdomain ("", "");
8750 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
8751 gt_cv_func_gnugettext_libintl=yes,
8752 gt_cv_func_gnugettext_libintl=no)
8753 dnl Now see whether libintl exists and depends on libiconv.
8754 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
8755 LIBS="$LIBS $LIBICONV"
8756 AC_TRY_LINK([#include <libintl.h>
8757 ]ifelse([$2], [need-formatstring-macros],
8758 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
8759 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
8762 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
8764 ], [])[extern int _nl_msg_cat_cntr;
8769 const char *_nl_expand_alias ();],
8770 [bindtextdomain ("", "");
8771 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
8772 [LIBINTL="$LIBINTL $LIBICONV"
8773 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
8774 gt_cv_func_gnugettext_libintl=yes
8777 CPPFLAGS="$gt_save_CPPFLAGS"
8778 LIBS="$gt_save_LIBS"])
8781 dnl If an already present or preinstalled GNU gettext() is found,
8782 dnl use it. But if this macro is used in GNU gettext, and GNU
8783 dnl gettext is already preinstalled in libintl, we update this
8784 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
8785 if test "$gt_cv_func_gnugettext_libc" = "yes" \
8786 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
8787 && test "$PACKAGE" != gettext-runtime \
8788 && test "$PACKAGE" != gettext-tools; }; then
8789 gt_use_preinstalled_gnugettext=yes
8791 dnl Reset the values set by searching for libintl.
8797 ifelse(gt_included_intl, yes, [
8798 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
8799 dnl GNU gettext is not found in the C library.
8800 dnl Fall back on included GNU gettext library.
8801 nls_cv_use_gnu_gettext=yes
8805 if test "$nls_cv_use_gnu_gettext" = "yes"; then
8806 dnl Mark actions used to generate GNU NLS library.
8807 BUILD_INCLUDED_LIBINTL=yes
8808 USE_INCLUDED_LIBINTL=yes
8809 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
8810 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
8811 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
8814 if test "$gt_use_preinstalled_gnugettext" = "yes" \
8815 || test "$nls_cv_use_gnu_gettext" = "yes"; then
8816 dnl Mark actions to use GNU gettext tools.
8821 if test "$gt_use_preinstalled_gnugettext" = "yes" \
8822 || test "$nls_cv_use_gnu_gettext" = "yes"; then
8823 AC_DEFINE(ENABLE_NLS, 1,
8824 [Define to 1 if translation of program messages to the user's native language
8831 AC_MSG_CHECKING([whether to use NLS])
8832 AC_MSG_RESULT([$USE_NLS])
8833 if test "$USE_NLS" = "yes"; then
8834 AC_MSG_CHECKING([where the gettext function comes from])
8835 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
8836 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
8837 gt_source="external libintl"
8842 gt_source="included intl directory"
8844 AC_MSG_RESULT([$gt_source])
8847 if test "$USE_NLS" = "yes"; then
8849 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
8850 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
8851 AC_MSG_CHECKING([how to link with libintl])
8852 AC_MSG_RESULT([$LIBINTL])
8853 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
8856 dnl For backward compatibility. Some packages may be using this.
8857 AC_DEFINE(HAVE_GETTEXT, 1,
8858 [Define if the GNU gettext() function is already present or preinstalled.])
8859 AC_DEFINE(HAVE_DCGETTEXT, 1,
8860 [Define if the GNU dcgettext() function is already present or preinstalled.])
8863 dnl We need to process the po/ directory.
8867 ifelse(gt_included_intl, yes, [
8868 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
8869 dnl to 'yes' because some of the testsuite requires it.
8870 if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
8871 BUILD_INCLUDED_LIBINTL=yes
8874 dnl Make all variables we use known to autoconf.
8875 AC_SUBST(BUILD_INCLUDED_LIBINTL)
8876 AC_SUBST(USE_INCLUDED_LIBINTL)
8879 dnl For backward compatibility. Some configure.ins may be using this.
8881 nls_cv_header_libgt=
8883 dnl For backward compatibility. Some Makefiles may be using this.
8885 AC_SUBST(DATADIRNAME)
8887 dnl For backward compatibility. Some Makefiles may be using this.
8889 AC_SUBST(INSTOBJEXT)
8891 dnl For backward compatibility. Some Makefiles may be using this.
8895 dnl For backward compatibility. Some Makefiles may be using this.
8896 if test "$USE_INCLUDED_LIBINTL" = yes; then
8897 INTLOBJS="\$(GETTOBJS)"
8901 dnl Enable libtool support if the surrounding package wishes it.
8902 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
8903 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
8906 dnl For backward compatibility. Some Makefiles may be using this.
8910 dnl Make all documented variables known to autoconf.
8917 dnl Checks for all prerequisites of the intl subdirectory,
8918 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
8919 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
8920 AC_DEFUN([AM_INTL_SUBDIR],
8922 AC_REQUIRE([AC_PROG_INSTALL])dnl
8923 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
8924 AC_REQUIRE([AC_PROG_CC])dnl
8925 AC_REQUIRE([AC_CANONICAL_HOST])dnl
8926 AC_REQUIRE([AC_PROG_RANLIB])dnl
8927 AC_REQUIRE([AC_ISC_POSIX])dnl
8928 AC_REQUIRE([AC_HEADER_STDC])dnl
8929 AC_REQUIRE([AC_C_CONST])dnl
8930 AC_REQUIRE([AC_C_INLINE])dnl
8931 AC_REQUIRE([AC_TYPE_OFF_T])dnl
8932 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
8933 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
8934 AC_REQUIRE([AC_FUNC_MMAP])dnl
8935 AC_REQUIRE([jm_GLIBC21])dnl
8936 AC_REQUIRE([gt_INTDIV0])dnl
8937 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
8938 AC_REQUIRE([gt_HEADER_INTTYPES_H])dnl
8939 AC_REQUIRE([gt_INTTYPES_PRI])dnl
8941 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
8942 stdlib.h string.h unistd.h sys/param.h])
8943 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
8944 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
8945 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next \
8950 if test $ac_cv_header_locale_h = yes; then
8954 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
8955 dnl because plural.y uses bison specific features. It requires at least
8956 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
8958 dnl bison is only needed for the maintainer (who touches plural.y). But in
8959 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
8960 dnl the rule in general Makefile. Now, some people carelessly touch the
8961 dnl files or have a broken "make" program, hence the plural.c rule will
8962 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
8963 dnl present or too old.
8964 AC_CHECK_PROGS([INTLBISON], [bison])
8965 if test -z "$INTLBISON"; then
8968 dnl Found it, now check the version.
8969 AC_MSG_CHECKING([version of bison])
8970 changequote(<<,>>)dnl
8971 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
8972 case $ac_prog_version in
8973 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
8974 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
8976 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
8977 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
8979 AC_MSG_RESULT([$ac_prog_version])
8981 if test $ac_verc_fail = yes; then
8987 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
8988 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
8991 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
8992 dnl This file is free software, distributed under the terms of the GNU
8993 dnl General Public License. As a special exception to the GNU General
8994 dnl Public License, this file may be distributed as part of a program
8995 dnl that contains a configuration script generated by Autoconf, under
8996 dnl the same distribution terms as the rest of that program.
8998 dnl This file can can be used in projects which are not available under
8999 dnl the GNU General Public License or the GNU Library General Public
9000 dnl License but which still want to provide support for the GNU gettext
9002 dnl Please note that the actual code of the GNU gettext library is covered
9003 dnl by the GNU Library General Public License, and the rest of the GNU
9004 dnl gettext package package is covered by the GNU General Public License.
9005 dnl They are *not* in the public domain.
9008 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
9009 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
9011 dnl Checks for all prerequisites of the po subdirectory.
9012 AC_DEFUN([AM_PO_SUBDIRS],
9014 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
9015 AC_REQUIRE([AC_PROG_INSTALL])dnl
9016 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
9017 AC_REQUIRE([AM_NLS])dnl
9019 dnl Perform the following tests also if --disable-nls has been given,
9020 dnl because they are needed for "make dist" to work.
9022 dnl Search for GNU msgfmt in the PATH.
9023 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
9024 dnl The second test excludes FreeBSD msgfmt.
9025 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
9026 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
9027 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
9029 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
9031 dnl Search for GNU xgettext 0.12 or newer in the PATH.
9032 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
9033 dnl The second test excludes FreeBSD xgettext.
9034 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
9035 [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
9036 (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
9038 dnl Remove leftover from FreeBSD xgettext call.
9041 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
9042 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
9043 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
9045 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
9046 dnl Test whether we really found GNU msgfmt.
9047 if test "$GMSGFMT" != ":"; then
9048 dnl If it is no GNU msgfmt we define it as : so that the
9049 dnl Makefiles still can work.
9050 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
9051 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
9054 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
9056 [found $GMSGFMT program is not GNU msgfmt; ignore it])
9061 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
9062 dnl Test whether we really found GNU xgettext.
9063 if test "$XGETTEXT" != ":"; then
9064 dnl If it is no GNU xgettext we define it as : so that the
9065 dnl Makefiles still can work.
9066 if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >/dev/null 2>&1 &&
9067 (if $XGETTEXT --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
9071 [found xgettext program is not GNU xgettext; ignore it])
9074 dnl Remove leftover from FreeBSD xgettext call.
9078 AC_OUTPUT_COMMANDS([
9079 for ac_file in $CONFIG_FILES; do
9080 # Support "outfile[:infile[:infile...]]"
9082 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
9084 # PO directories have a Makefile.in generated from Makefile.in.in.
9085 case "$ac_file" in */Makefile.in)
9086 # Adjust a relative srcdir.
9087 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
9088 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
9089 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
9090 # In autoconf-2.13 it is called $ac_given_srcdir.
9091 # In autoconf-2.50 it is called $srcdir.
9092 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
9093 case "$ac_given_srcdir" in
9094 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
9095 /*) top_srcdir="$ac_given_srcdir" ;;
9096 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
9098 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
9099 rm -f "$ac_dir/POTFILES"
9100 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
9101 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
9102 POMAKEFILEDEPS="POTFILES.in"
9103 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
9104 # on $ac_dir but don't depend on user-specified configuration
9106 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
9107 # The LINGUAS file contains the set of available languages.
9108 if test -n "$OBSOLETE_ALL_LINGUAS"; then
9109 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
9111 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
9112 # Hide the ALL_LINGUAS assigment from automake.
9113 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
9114 POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
9116 # The set of available languages was given in configure.in.
9117 eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
9119 case "$ac_given_srcdir" in
9121 *) srcdirpre='$(srcdir)/' ;;
9127 for lang in $ALL_LINGUAS; do
9128 POFILES="$POFILES $srcdirpre$lang.po"
9129 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
9130 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
9131 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
9133 # CATALOGS depends on both $ac_dir and the user's LINGUAS
9134 # environment variable.
9136 if test -n "$ALL_LINGUAS"; then
9137 for presentlang in $ALL_LINGUAS; do
9139 if test "%UNSET%" != "$LINGUAS"; then
9140 desiredlanguages="$LINGUAS"
9142 desiredlanguages="$ALL_LINGUAS"
9144 for desiredlang in $desiredlanguages; do
9145 # Use the presentlang catalog if desiredlang is
9146 # a. equal to presentlang, or
9147 # b. a variant of presentlang (because in this case,
9148 # presentlang can be used as a fallback for messages
9149 # which are not translated in the desiredlang catalog).
9150 case "$desiredlang" in
9151 "$presentlang"*) useit=yes;;
9154 if test $useit = yes; then
9155 INST_LINGUAS="$INST_LINGUAS $presentlang"
9160 if test -n "$INST_LINGUAS"; then
9161 for lang in $INST_LINGUAS; do
9162 CATALOGS="$CATALOGS $lang.gmo"
9165 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
9166 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" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
9167 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
9168 if test -f "$f"; then
9170 *.orig | *.bak | *~) ;;
9171 *) cat "$f" >> "$ac_dir/Makefile" ;;
9179 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
9180 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
9182 eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
9183 # Capture the value of LINGUAS because we need it to compute CATALOGS.
9184 LINGUAS="${LINGUAS-%UNSET%}"
9189 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
9190 dnl This file is free software, distributed under the terms of the GNU
9191 dnl General Public License. As a special exception to the GNU General
9192 dnl Public License, this file may be distributed as part of a program
9193 dnl that contains a configuration script generated by Autoconf, under
9194 dnl the same distribution terms as the rest of that program.
9196 dnl This file can can be used in projects which are not available under
9197 dnl the GNU General Public License or the GNU Library General Public
9198 dnl License but which still want to provide support for the GNU gettext
9200 dnl Please note that the actual code of the GNU gettext library is covered
9201 dnl by the GNU Library General Public License, and the rest of the GNU
9202 dnl gettext package package is covered by the GNU General Public License.
9203 dnl They are *not* in the public domain.
9206 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
9207 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2003.
9211 AC_MSG_CHECKING([whether NLS is requested])
9212 dnl Default is enabled NLS
9214 [ --disable-nls do not use Native Language Support],
9215 USE_NLS=$enableval, USE_NLS=yes)
9216 AC_MSG_RESULT($USE_NLS)
9220 AC_DEFUN([AM_MKINSTALLDIRS],
9222 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
9223 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
9224 dnl Try to locate it.
9226 if test -n "$ac_aux_dir"; then
9227 case "$ac_aux_dir" in
9228 /*) MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" ;;
9229 *) MKINSTALLDIRS="\$(top_builddir)/$ac_aux_dir/mkinstalldirs" ;;
9232 if test -z "$MKINSTALLDIRS"; then
9233 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
9235 AC_SUBST(MKINSTALLDIRS)
9238 # progtest.m4 serial 3 (gettext-0.12)
9239 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
9240 dnl This file is free software, distributed under the terms of the GNU
9241 dnl General Public License. As a special exception to the GNU General
9242 dnl Public License, this file may be distributed as part of a program
9243 dnl that contains a configuration script generated by Autoconf, under
9244 dnl the same distribution terms as the rest of that program.
9246 dnl This file can can be used in projects which are not available under
9247 dnl the GNU General Public License or the GNU Library General Public
9248 dnl License but which still want to provide support for the GNU gettext
9250 dnl Please note that the actual code of the GNU gettext library is covered
9251 dnl by the GNU Library General Public License, and the rest of the GNU
9252 dnl gettext package package is covered by the GNU General Public License.
9253 dnl They are *not* in the public domain.
9256 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
9258 # Search path for a program which passes the given test.
9260 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
9261 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
9262 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
9264 # Prepare PATH_SEPARATOR.
9265 # The user is always right.
9266 if test "${PATH_SEPARATOR+set}" != set; then
9267 echo "#! /bin/sh" >conf$$.sh
9268 echo "exit 0" >>conf$$.sh
9270 if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
9278 # Find out how to test for executable files. Don't use a zero-byte file,
9279 # as systems may use methods other than mode bits to determine executability.
9280 cat >conf$$.file <<_ASEOF
9284 chmod +x conf$$.file
9285 if test -x conf$$.file >/dev/null 2>&1; then
9286 ac_executable_p="test -x"
9288 ac_executable_p="test -f"
9292 # Extract the first word of "$2", so it can be a program name with args.
9293 set dummy $2; ac_word=[$]2
9294 AC_MSG_CHECKING([for $ac_word])
9295 AC_CACHE_VAL(ac_cv_path_$1,
9297 [[\\/]]* | ?:[[\\/]]*)
9298 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
9301 ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
9302 for ac_dir in ifelse([$5], , $PATH, [$5]); do
9304 test -z "$ac_dir" && ac_dir=.
9305 for ac_exec_ext in '' $ac_executable_extensions; do
9306 if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
9308 ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
9315 dnl If no 4th arg is given, leave the cache variable unset,
9316 dnl so AC_PATH_PROGS will keep looking.
9317 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
9322 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
9323 AC_MSG_RESULT([$]$1)