1 # generated automatically by aclocal 1.7.6 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Do all the work for Automake. -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things. But this isn't really a big deal.
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out. PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition. After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58 AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61 test -f $srcdir/config.status; then
62 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67 if (cygpath --version) >/dev/null 2>/dev/null; then
68 CYGPATH_W='cygpath -w'
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79 AC_SUBST([PACKAGE], [$1])dnl
80 AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
100 # We need awk for the "check" target. The system "awk" is bad on
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108 [_AM_DEPENDENCIES(CC)],
109 [define([AC_PROG_CC],
110 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112 [_AM_DEPENDENCIES(CXX)],
113 [define([AC_PROG_CXX],
114 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated. The stamp files are numbered to have different names.
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
129 for _am_header in $config_headers :; do
134 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
139 # Copyright 2002 Free Software Foundation, Inc.
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 # GNU General Public License for more details.
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166 [AM_AUTOMAKE_VERSION([1.7.6])])
168 # Helper functions for option handling. -*- Autoconf -*-
170 # Copyright 2001, 2002 Free Software Foundation, Inc.
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 # GNU General Public License for more details.
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME. Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
213 # Check to make sure that the build environment is sane.
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
226 # GNU General Public License for more details.
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments. Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
248 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249 if test "$[*]" = "X"; then
251 set X `ls -t $srcdir/configure conftest.file`
254 if test "$[*]" != "X $srcdir/configure conftest.file" \
255 && test "$[*]" != "X conftest.file $srcdir/configure"; then
257 # If neither matched, then we have a broken ls. This can happen
258 # if, for instance, CONFIG_SHELL is bash and it inherits a
259 # broken ls alias from the environment. This has actually
260 # happened. Such a system could not be considered "sane".
261 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
262 alias in your environment])
265 test "$[2]" = conftest.file
271 AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
289 # GNU General Public License for more details.
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315 am_missing_run="$MISSING --run "
318 AC_MSG_WARN([`missing' script is too old or missing])
324 # Copyright 2001 Free Software Foundation, Inc.
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
334 # GNU General Public License for more details.
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory. The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run. This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
353 # $ac_aux_dir/missing
354 # fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 # fails if $ac_aux_dir is absolute,
357 # fails when called from a subdirectory in a VPATH build with
358 # a relative $ac_aux_dir
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir. In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
367 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 # MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH. The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
379 # Rely on autoconf to set up CDPATH properly.
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
389 # Define $install_sh.
391 # Copyright 2001 Free Software Foundation, Inc.
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 # GNU General Public License for more details.
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
413 # AM_PROG_INSTALL_STRIP
415 # Copyright 2001 Free Software Foundation, Inc.
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425 # GNU General Public License for more details.
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries. This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'. However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447 AC_CHECK_TOOL([STRIP], [strip], :)
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
453 # Copyright (C) 2003 Free Software Foundation, Inc.
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
463 # GNU General Public License for more details.
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot. For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
485 # serial 5 -*- Autoconf -*-
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497 # GNU General Public License for more details.
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery. Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
529 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
530 [$1], CXX, [depcc="$CXX" am_compiler_list=],
531 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
533 [depcc="$$1" am_compiler_list=])
535 AC_CACHE_CHECK([dependency style of $depcc],
536 [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538 # We make a subdir and do the tests there. Otherwise we can end up
539 # making bogus files that we don't know about and never remove. For
540 # instance it was reported that on HP-UX the gcc test will end up
541 # making a dummy file named `D' -- because `-MD' means `put the output
544 # Copy depcomp to subdir because otherwise we won't find it if we're
545 # using a relative directory.
546 cp "$am_depcomp" conftest.dir
548 # We will build objects and dependencies in a subdirectory because
549 # it helps to detect inapplicable dependency modes. For instance
550 # both Tru64's cc and ICC support -MD to output dependencies as a
551 # side effect of compilation, but ICC will put the dependencies in
552 # the current directory while Tru64 will put them in the object
556 am_cv_$1_dependencies_compiler_type=none
557 if test "$am_compiler_list" = ""; then
558 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
560 for depmode in $am_compiler_list; do
561 # Setup a source with many dependencies, because some compilers
562 # like to wrap large dependency lists on column 80 (with \), and
563 # we should not choose a depcomp mode which is confused by this.
565 # We need to recreate these files for each test, as the compiler may
566 # overwrite some of them when testing with obscure command lines.
567 # This happens at least with the AIX C compiler.
569 for i in 1 2 3 4 5 6; do
570 echo '#include "conftst'$i'.h"' >> sub/conftest.c
573 echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
577 # after this tag, mechanisms are not by side-effect, so they'll
578 # only be used when explicitly requested
579 if test "x$enable_dependency_tracking" = xyes; then
587 # We check with `-c' and `-o' for the sake of the "dashmstdout"
588 # mode. It turns out that the SunPro C++ compiler does not properly
589 # handle `-M -o', and we need to detect this.
590 if depmode=$depmode \
591 source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
592 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
593 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
594 >/dev/null 2>conftest.err &&
595 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
596 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
597 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
598 # icc doesn't choke on unknown options, it will just issue warnings
599 # (even with -Werror). So we grep stderr for any message
600 # that says an option was ignored.
601 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
602 am_cv_$1_dependencies_compiler_type=$depmode
611 am_cv_$1_dependencies_compiler_type=none
614 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
615 AM_CONDITIONAL([am__fastdep$1], [
616 test "x$enable_dependency_tracking" != xno \
617 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
623 # Choose a directory name for dependency files.
624 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
625 AC_DEFUN([AM_SET_DEPDIR],
626 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
627 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
633 AC_DEFUN([AM_DEP_TRACK],
634 [AC_ARG_ENABLE(dependency-tracking,
635 [ --disable-dependency-tracking Speeds up one-time builds
636 --enable-dependency-tracking Do not reject slow dependency extractors])
637 if test "x$enable_dependency_tracking" != xno; then
638 am_depcomp="$ac_aux_dir/depcomp"
641 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
642 AC_SUBST([AMDEPBACKSLASH])
645 # Generate code to set up dependency tracking. -*- Autoconf -*-
647 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
649 # This program is free software; you can redistribute it and/or modify
650 # it under the terms of the GNU General Public License as published by
651 # the Free Software Foundation; either version 2, or (at your option)
654 # This program is distributed in the hope that it will be useful,
655 # but WITHOUT ANY WARRANTY; without even the implied warranty of
656 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
657 # GNU General Public License for more details.
659 # You should have received a copy of the GNU General Public License
660 # along with this program; if not, write to the Free Software
661 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
666 # _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # ------------------------------
668 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
669 [for mf in $CONFIG_FILES; do
670 # Strip MF so we end up with the name of the file.
671 mf=`echo "$mf" | sed -e 's/:.*$//'`
672 # Check whether this is an Automake generated Makefile or not.
673 # We used to match only the files named `Makefile.in', but
674 # some people rename them; so instead we look at the file content.
675 # Grep'ing the first line is not enough: some people post-process
676 # each Makefile.in and add a new line on top of each file to say so.
677 # So let's grep whole file.
678 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
679 dirpart=`AS_DIRNAME("$mf")`
683 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
684 # Extract the definition of DEP_FILES from the Makefile without
686 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
687 test -z "$DEPDIR" && continue
688 # When using ansi2knr, U may be empty or an underscore; expand it
689 U=`sed -n -e '/^U = / s///p' < "$mf"`
690 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
691 # We invoke sed twice because it is the simplest approach to
692 # changing $(DEPDIR) to its actual value in the expansion.
693 for file in `sed -n -e '
694 /^DEP_FILES = .*\\\\$/ {
703 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
704 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
705 # Make sure the directory exists.
706 test -f "$dirpart/$file" && continue
707 fdir=`AS_DIRNAME(["$file"])`
708 AS_MKDIR_P([$dirpart/$fdir])
709 # echo "creating $dirpart/$file"
710 echo '# dummy' > "$dirpart/$file"
713 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
716 # AM_OUTPUT_DEPENDENCY_COMMANDS
717 # -----------------------------
718 # This macro should only be invoked once -- use via AC_REQUIRE.
720 # This code is only required when automatic dependency tracking
721 # is enabled. FIXME. This creates each `.P' file that we will
722 # need in order to bootstrap the dependency handling code.
723 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
724 [AC_CONFIG_COMMANDS([depfiles],
725 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
726 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
729 # Check to see how 'make' treats includes. -*- Autoconf -*-
731 # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
733 # This program is free software; you can redistribute it and/or modify
734 # it under the terms of the GNU General Public License as published by
735 # the Free Software Foundation; either version 2, or (at your option)
738 # This program is distributed in the hope that it will be useful,
739 # but WITHOUT ANY WARRANTY; without even the implied warranty of
740 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
741 # GNU General Public License for more details.
743 # You should have received a copy of the GNU General Public License
744 # along with this program; if not, write to the Free Software
745 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
752 # Check to see how make treats includes.
753 AC_DEFUN([AM_MAKE_INCLUDE],
754 [am_make=${MAKE-make}
755 cat > confinc << 'END'
760 # If we don't find an include directive, just comment out the code.
761 AC_MSG_CHECKING([for style of include used by $am_make])
765 # First try GNU make style include.
766 echo "include confinc" > confmf
767 # We grep out `Entering directory' and `Leaving directory'
768 # messages which can occur if `w' ends up in MAKEFLAGS.
769 # In particular we don't look at `^make:' because GNU make might
770 # be invoked under some other name (usually "gmake"), in which
771 # case it prints its new name instead of `make'.
772 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
777 # Now try BSD make style include.
778 if test "$am__include" = "#"; then
779 echo '.include "confinc"' > confmf
780 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
786 AC_SUBST([am__include])
787 AC_SUBST([am__quote])
788 AC_MSG_RESULT([$_am_result])
792 # AM_CONDITIONAL -*- Autoconf -*-
794 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
796 # This program is free software; you can redistribute it and/or modify
797 # it under the terms of the GNU General Public License as published by
798 # the Free Software Foundation; either version 2, or (at your option)
801 # This program is distributed in the hope that it will be useful,
802 # but WITHOUT ANY WARRANTY; without even the implied warranty of
803 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
804 # GNU General Public License for more details.
806 # You should have received a copy of the GNU General Public License
807 # along with this program; if not, write to the Free Software
808 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
815 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
816 # -------------------------------------
817 # Define a conditional.
818 AC_DEFUN([AM_CONDITIONAL],
819 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
820 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
830 AC_CONFIG_COMMANDS_PRE(
831 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
832 AC_MSG_ERROR([conditional "$1" was never defined.
833 Usually this means the macro was only invoked conditionally.])
838 dnl From Jim Meyering.
839 dnl Find a new-enough version of Perl.
844 dnl FIXME: don't hard-code 5.003
845 dnl FIXME: should we cache the result?
846 AC_MSG_CHECKING([for perl5.003 or newer])
847 if test "${PERL+set}" = set; then
848 # `PERL' is set in the user's environment.
849 candidate_perl_names="$PERL"
852 candidate_perl_names='perl perl5'
858 PERL="$am_missing_run perl"
859 for perl in $candidate_perl_names; do
860 # Run test in a subshell; some versions of sh will print an error if
861 # an executable is not found, even if stderr is redirected.
862 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
869 AC_MSG_RESULT($found)
870 test $found = no && AC_MSG_WARN([
871 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
872 a usable version of the Perl File::Compare module. As a result,
873 you may be unable to run a few tests or to regenerate certain
874 files if you modify the sources from which they are derived.
878 #serial 66 -*- autoconf -*-
880 m4_undefine([AC_LANG_SOURCE(C)])
881 dnl The following is identical to the definition in c.m4
882 dnl from the autoconf cvs repository on 2003-03-07.
883 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
885 # We can't use '#line $LINENO "configure"' here, since
886 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
887 # rejects $LINENO greater than 32767, and some configure scripts
888 # are longer than 32767 lines.
889 m4_define([AC_LANG_SOURCE(C)],
892 cat confdefs.h >>conftest.$ac_ext
893 cat >>conftest.$ac_ext <<_ACEOF
894 /* end confdefs.h. */
898 dnl Misc type-related macros for fileutils, sh-utils, textutils.
900 AC_DEFUN([jm_MACROS],
904 GNU_PACKAGE="GNU $PACKAGE"
905 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
906 [The concatenation of the strings `GNU ', and PACKAGE.])
907 AC_SUBST(GNU_PACKAGE)
909 AM_MISSING_PROG(HELP2MAN, help2man)
910 AC_SUBST(OPTIONAL_BIN_PROGS)
914 dnl This macro actually runs replacement code. See isc-posix.m4.
915 AC_REQUIRE([AC_ISC_POSIX])dnl
918 jm_INCLUDED_REGEX([lib/regex.c])
920 AC_REQUIRE([UTILS_HOST_OS])
921 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
922 AC_REQUIRE([jm_BISON])
923 AC_REQUIRE([jm_ASSERT])
924 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
925 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
926 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
927 AC_REQUIRE([jm_CHECK_DECLS])
929 AC_REQUIRE([jm_PREREQ])
931 AC_REQUIRE([UTILS_FUNC_DIRFD])
932 AC_REQUIRE([AC_FUNC_ACL])
933 AC_REQUIRE([AC_FUNC_FTW])
934 AC_REQUIRE([jm_FUNC_LCHOWN])
935 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
936 AC_REQUIRE([jm_FUNC_CHOWN])
937 AC_REQUIRE([jm_FUNC_MKTIME])
938 AC_REQUIRE([jm_FUNC_LSTAT])
939 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
940 AC_REQUIRE([jm_FUNC_STAT])
941 AC_REQUIRE([AC_FUNC_REALLOC])
942 AC_REQUIRE([AC_FUNC_MALLOC])
943 AC_REQUIRE([AC_FUNC_STRERROR_R])
944 AC_REQUIRE([jm_FUNC_NANOSLEEP])
945 AC_REQUIRE([jm_FUNC_MEMCMP])
946 AC_REQUIRE([gl_MEMCOLL])
947 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
948 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
949 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
950 AC_REQUIRE([jm_FUNC_PUTENV])
952 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
953 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
954 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
955 AC_REQUIRE([gl_FUNC_FNMATCH_GNU])
956 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
957 AC_REQUIRE([jm_FUNC_MKTIME])
958 AC_REQUIRE([jm_FUNC_FPENDING])
960 # This is for od and stat, and any other program that
961 # uses the PRI.MAX macros from inttypes.h.
962 AC_REQUIRE([gt_INTTYPES_PRI])
964 AC_REQUIRE([jm_FUNC_GETGROUPS])
966 AC_REQUIRE([AC_FUNC_FSEEKO])
967 AC_REQUIRE([AC_FUNC_VPRINTF])
968 AC_REQUIRE([AC_FUNC_ALLOCA])
969 AC_REQUIRE([gl_FUNC_ALLOCA])
971 AC_CONFIG_LIBOBJ_DIR([lib])
974 AC_REQUIRE([jm_SYS_PROC_UPTIME])
975 AC_REQUIRE([jm_FUNC_FTRUNCATE])
976 AC_REQUIRE([vb_FUNC_RENAME])
978 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
979 AC_REPLACE_FUNCS(dup2)
980 AC_REPLACE_FUNCS(gethostname getusershell)
981 AC_REPLACE_FUNCS(sig2str)
982 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
983 AC_REPLACE_FUNCS(strpbrk)
984 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
985 AC_REPLACE_FUNCS(atexit)
986 AC_REPLACE_FUNCS(getpass)
988 # raise is used by at least sort and ls.
989 AC_REPLACE_FUNCS(raise)
991 dnl used by e.g. intl/*domain.c and lib/canon-host.c
992 AC_REPLACE_FUNCS(strdup)
994 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
995 AC_CHECK_FUNCS(getpagesize)
997 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
999 # By default, argmatch should fail calling usage (1).
1000 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
1001 [Define to the function xargmatch calls on failures.])
1002 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
1003 [Define to the declaration of the xargmatch failure function.])
1005 dnl Used to define SETVBUF in sys2.h.
1006 dnl This evokes the following warning from autoconf:
1007 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
1008 AC_FUNC_SETVBUF_REVERSED
1010 # used by sleep and shred
1011 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
1012 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
1014 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
1015 # programs in the package would end up linked with that potentially-shared
1016 # library, inducing unnecessary run-time overhead.
1017 fetish_saved_libs=$LIBS
1018 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
1019 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
1020 AC_SUBST(LIB_CLOCK_GETTIME)
1021 AC_CHECK_FUNCS(clock_gettime clock_settime)
1022 LIBS=$fetish_saved_libs
1023 AC_CHECK_FUNCS(gettimeofday)
1024 AC_FUNC_GETTIMEOFDAY_CLOBBER
1026 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
1027 AC_REQUIRE([jm_FUNC_UTIME])
1028 AC_REQUIRE([gl_FUNC_VASPRINTF])
1029 AC_REQUIRE([gl_FUNC_VASNPRINTF])
1063 AC_CHECK_FUNCS(setreuid setregid)
1066 if test $am_cv_func_working_getline != yes; then
1067 AC_CHECK_FUNCS(getdelim)
1072 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1073 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
1074 AC_REQUIRE([GL_FUNC_READDIR])
1076 # See if linking `seq' requires -lm.
1077 # It does on nearly every system. The single exception (so far) is
1078 # BeOS which has all the math functions in the normal runtime library
1079 # and doesn't have a separate math library.
1087 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1088 [ac_seq_save_LIBS="$LIBS"
1090 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1091 LIBS="$ac_seq_save_LIBS"
1097 jm_FUNC_UNLINK_BUSY_TEXT
1099 # These tests are for df.
1100 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1102 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1103 if test $list_mounted_fs = yes && test $space = yes; then
1104 DF_PROG='df$(EXEEXT)'
1106 AC_LIBOBJ(mountlist)
1108 AC_REQUIRE([jm_AC_DOS])
1109 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1111 # If any of these functions don't exist (e.g. DJGPP 2.03),
1112 # use the corresponding stub.
1113 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
1114 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
1115 AC_CHECK_FUNC([lstat], , [AC_LIBOBJ(lstat-stub)])
1116 AC_CHECK_FUNC([readlink], , [AC_LIBOBJ(readlink-stub)])
1117 AC_REQUIRE([AM_STDBOOL_H])
1121 # These tests must be run before any use of AC_CHECK_TYPE,
1122 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1123 # See the definition of ac_includes_default in `configure'.
1124 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1167 # This macro must be invoked before any tests that run the compiler.
1168 AC_DEFUN([jm_CHECK_ALL_TYPES],
1170 dnl This test must come as early as possible after the compiler configuration
1171 dnl tests, because the choice of the file model can (in principle) affect
1172 dnl whether functions and headers are available, whether they work, etc.
1173 AC_REQUIRE([AC_SYS_LARGEFILE])
1175 dnl This test must precede tests of compiler characteristics like
1176 dnl that for the inline keyword, since it may change the degree to
1177 dnl which the compiler supports such features.
1178 AC_REQUIRE([AM_C_PROTOTYPES])
1180 dnl Checks for typedefs, structures, and compiler characteristics.
1181 AC_REQUIRE([AC_C_BIGENDIAN])
1182 AC_REQUIRE([AC_C_CONST])
1183 AC_REQUIRE([AC_C_VOLATILE])
1184 AC_REQUIRE([AC_C_INLINE])
1185 AC_REQUIRE([AC_C_LONG_DOUBLE])
1187 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1188 AC_REQUIRE([AC_HEADER_DIRENT])
1189 AC_REQUIRE([AC_HEADER_STDC])
1191 [struct stat.st_author,
1192 struct stat.st_blksize],,,
1193 [$ac_includes_default
1194 #include <sys/stat.h>
1196 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1198 AC_REQUIRE([AC_STRUCT_TM])
1199 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1200 AC_REQUIRE([AC_HEADER_STAT])
1201 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1202 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1203 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1205 AC_REQUIRE([AC_TYPE_GETGROUPS])
1206 AC_REQUIRE([AC_TYPE_MODE_T])
1207 AC_REQUIRE([AC_TYPE_OFF_T])
1208 AC_REQUIRE([AC_TYPE_PID_T])
1209 AC_REQUIRE([AC_TYPE_SIGNAL])
1210 AC_REQUIRE([AC_TYPE_SIZE_T])
1211 AC_REQUIRE([AC_TYPE_UID_T])
1212 AC_CHECK_TYPE(ino_t, unsigned long)
1214 dnl This relies on the fact that autoconf 2.14a's implementation of
1215 dnl AC_CHECK_TYPE checks includes unistd.h.
1216 AC_CHECK_TYPE(ssize_t, int)
1217 AC_CHECK_TYPE(major_t, unsigned int)
1218 AC_CHECK_TYPE(minor_t, unsigned int)
1220 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1221 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1223 AC_REQUIRE([AC_HEADER_MAJOR])
1224 AC_REQUIRE([AC_HEADER_DIRENT])
1228 # isc-posix.m4 serial 2 (gettext-0.11.2)
1229 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1230 dnl This file is free software, distributed under the terms of the GNU
1231 dnl General Public License. As a special exception to the GNU General
1232 dnl Public License, this file may be distributed as part of a program
1233 dnl that contains a configuration script generated by Autoconf, under
1234 dnl the same distribution terms as the rest of that program.
1236 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1238 # This test replaces the one in autoconf.
1239 # Currently this macro should have the same name as the autoconf macro
1240 # because gettext's gettext.m4 (distributed in the automake package)
1241 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1242 # give these diagnostics:
1243 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1244 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1246 undefine([AC_ISC_POSIX])
1248 AC_DEFUN([AC_ISC_POSIX],
1250 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1251 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1257 dnl Initially derived from code in GNU grep.
1258 dnl Mostly written by Jim Meyering.
1260 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1262 AC_DEFUN([jm_INCLUDED_REGEX],
1264 dnl Even packages that don't use regex.c can use this macro.
1265 dnl Of course, for them it doesn't do anything.
1267 # Assume we'll default to using the included regex.c.
1268 ac_use_included_regex=yes
1270 # However, if the system regex support is good enough that it passes the
1271 # the following run test, then default to *not* using the included regex.c.
1272 # If cross compiling, assume the test would fail and use the included
1273 # regex.c. The first failing regular expression is from `Spencer ere
1274 # test #75' in grep-2.3.
1275 AC_CACHE_CHECK([for working re_compile_pattern],
1276 jm_cv_func_working_re_compile_pattern,
1284 static struct re_pattern_buffer regex;
1286 struct re_registers regs;
1287 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1288 memset (®ex, 0, sizeof (regex));
1289 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1290 /* This should fail with _Invalid character class name_ error. */
1294 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1295 memset (®ex, 0, sizeof (regex));
1296 s = re_compile_pattern ("{1", 2, ®ex);
1301 /* The following example is derived from a problem report
1302 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1303 memset (®ex, 0, sizeof (regex));
1304 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1308 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1309 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1312 memset (®ex, 0, sizeof (regex));
1313 s = re_compile_pattern ("x", 1, ®ex);
1317 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
1318 work with a negative RANGE argument. */
1319 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
1325 jm_cv_func_working_re_compile_pattern=yes,
1326 jm_cv_func_working_re_compile_pattern=no,
1327 dnl When crosscompiling, assume it's broken.
1328 jm_cv_func_working_re_compile_pattern=no))
1329 if test $jm_cv_func_working_re_compile_pattern = yes; then
1330 ac_use_included_regex=no
1333 test -n "$1" || AC_MSG_ERROR([missing argument])
1334 m4_syscmd([test -f $1])
1335 ifelse(m4_sysval, 0,
1337 AC_ARG_WITH(included-regex,
1338 [ --without-included-regex don't compile regex; this is the default on
1339 systems with version 2 of the GNU C library
1340 (use with caution on other system)],
1341 jm_with_regex=$withval,
1342 jm_with_regex=$ac_use_included_regex)
1343 if test "$jm_with_regex" = yes; then
1352 # Prerequisites of lib/regex.c.
1353 AC_DEFUN([jm_PREREQ_REGEX],
1355 dnl FIXME: Maybe provide a btowc replacement someday: Solaris 2.5.1 lacks it.
1356 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1359 dnl Persuade glibc <string.h> to declare mempcpy().
1360 AC_REQUIRE([AC_GNU_SOURCE])
1362 AC_REQUIRE([ACX_C_RESTRICT])
1363 AC_REQUIRE([AC_FUNC_ALLOCA])
1364 AC_REQUIRE([AC_HEADER_STDC])
1365 AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
1366 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
1367 AC_CHECK_FUNCS(btowc)
1371 dnl based on acx_restrict.m4, from the GNU Autoconf Macro Archive at:
1372 dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_restrict.html
1374 # Determine whether the C/C++ compiler supports the "restrict" keyword
1375 # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
1376 # accepts it. Otherwise, if the compiler supports an equivalent (like
1377 # gcc's __restrict__) define "restrict" to be that. Otherwise, define
1378 # "restrict" to be empty.
1380 AC_DEFUN([ACX_C_RESTRICT],
1381 [AC_CACHE_CHECK([for C/C++ restrict keyword], acx_cv_c_restrict,
1382 [acx_cv_c_restrict=no
1383 # Try the official restrict keyword, then gcc's __restrict__.
1384 for acx_kw in restrict __restrict__; do
1385 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
1386 [float * $acx_kw x;])],
1387 [acx_cv_c_restrict=$acx_kw; break])
1390 case $acx_cv_c_restrict in
1392 no) AC_DEFINE(restrict,,
1393 [Define to equivalent of C99 restrict keyword, or to nothing if this
1394 is not supported. Do not define if restrict is supported directly.]) ;;
1395 *) AC_DEFINE_UNQUOTED(restrict, $acx_cv_c_restrict) ;;
1399 # onceonly.m4 serial 2
1400 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
1401 dnl This file is free software, distributed under the terms of the GNU
1402 dnl General Public License. As a special exception to the GNU General
1403 dnl Public License, this file may be distributed as part of a program
1404 dnl that contains a configuration script generated by Autoconf, under
1405 dnl the same distribution terms as the rest of that program.
1407 dnl This file defines some "once only" variants of standard autoconf macros.
1408 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1409 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1410 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1411 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1412 dnl The advantage is that the check for each of the headers/functions/decls
1413 dnl will be put only once into the 'configure' file. It keeps the size of
1414 dnl the 'configure' file down, and avoids redundant output when 'configure'
1416 dnl The drawback is that the checks cannot be conditionalized. If you write
1417 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1418 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1419 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1422 dnl Taken from Autoconf 2.50; can be removed once we assume 2.50 or later.
1423 define([m4_quote], [[$*]])
1425 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1426 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1427 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1429 AC_FOREACH([gl_HEADER_NAME], [$1], [
1430 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
1432 AC_CHECK_HEADERS(gl_HEADER_NAME)
1434 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1439 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1440 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1441 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1443 AC_FOREACH([gl_FUNC_NAME], [$1], [
1444 AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
1445 AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
1447 AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
1451 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1452 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1453 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1455 AC_FOREACH([gl_DECL_NAME], [$1], [
1456 AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
1457 AC_CHECK_DECLS(defn([gl_DECL_NAME]))
1459 AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
1465 dnl From Paul Eggert.
1467 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1468 AC_DEFUN([UTILS_HOST_OS],
1470 AC_CACHE_CHECK([host operating system],
1471 utils_cv_host_operating_system,
1475 # These operating system names do not use the default heuristic below.
1476 # They are in reverse order, so that more-specific prefixes come first.
1477 winnt*) os='Windows NT';;
1479 sysv*) os='Unix System V';;
1480 superux*) os='SUPER-UX';;
1481 sunos*) os='SunOS';;
1483 sco*) os='SCO Unix';;
1484 riscos*) os='RISC OS';;
1485 riscix*) os='RISCiX';;
1489 plan9*) os='Plan 9';;
1492 openbsd*) os='OpenBSD';;
1493 nsk*) os='NonStop Kernel';;
1494 nonstopux*) os='NonStop-UX';;
1495 netbsd*) os='NetBSD';;
1496 msdosdjgpp*) os='DJGPP';;
1497 mpeix*) os='MPE/iX';;
1499 mingw*) os='MinGW';;
1500 lynxos*) os='LynxOS';;
1501 linux*) os='GNU/Linux';;
1505 freebsd*-gnu*) os='GNU/FreeBSD';;
1506 freebsd*) os='FreeBSD';;
1508 bsdi*) os='BSD/OS';;
1512 atheos*) os='AtheOS';;
1513 amigaos*) os='Amiga OS';;
1516 # The default heuristic takes the initial alphabetic string
1517 # from $host_os, but capitalizes its first letter.
1520 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1522 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1526 # If $host_os does not start with an alphabetic string, use it unchanged.
1530 utils_cv_host_operating_system=$os]])
1531 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1532 "$utils_cv_host_operating_system",
1533 [The host operating system.])
1538 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1539 # On such systems, arrange to use a wrapper function that removes any
1541 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1543 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1544 utils_cv_func_mkdir_trailing_slash_bug,
1546 # Arrange for deletion of the temporary directory this test might create.
1547 ac_clean_files="$ac_clean_files confdir-slash"
1549 # include <sys/types.h>
1550 # include <sys/stat.h>
1551 # include <stdlib.h>
1554 rmdir ("confdir-slash");
1555 exit (mkdir ("confdir-slash/", 0700));
1558 utils_cv_func_mkdir_trailing_slash_bug=no,
1559 utils_cv_func_mkdir_trailing_slash_bug=yes,
1560 utils_cv_func_mkdir_trailing_slash_bug=yes
1565 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1567 AC_DEFINE(mkdir, rpl_mkdir,
1568 [Define to rpl_mkdir if the replacement function should be used.])
1574 AC_DEFUN([jm_BISON],
1576 # getdate.y works with bison only.
1577 : ${YACC='bison -y'}
1582 dnl based on code from Eleftherios Gkioulekas
1584 AC_DEFUN([jm_ASSERT],
1586 AC_MSG_CHECKING(whether to enable assertions)
1587 AC_ARG_ENABLE(assert,
1588 [ --disable-assert turn off assertions],
1590 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1591 [ AC_MSG_RESULT(yes) ]
1597 dnl From Jim Meyering
1599 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1600 dnl usually in <utime.h>.
1601 dnl Some systems have utime.h but don't declare the struct anywhere.
1603 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1605 AC_CHECK_HEADERS(utime.h)
1606 AC_REQUIRE([AC_HEADER_TIME])
1607 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1610 #ifdef TIME_WITH_SYS_TIME
1611 # include <sys/time.h>
1614 # ifdef HAVE_SYS_TIME_H
1615 # include <sys/time.h>
1624 [static struct utimbuf x; x.actime = x.modtime;],
1625 fu_cv_sys_struct_utimbuf=yes,
1626 fu_cv_sys_struct_utimbuf=no)
1629 if test $fu_cv_sys_struct_utimbuf = yes; then
1630 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1631 [Define if struct utimbuf is declared -- usually in <utime.h>.
1632 Some systems have utime.h but don't declare the struct anywhere. ])
1638 dnl From Jim Meyering.
1640 dnl Check whether struct dirent has a member named d_type.
1643 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1644 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1645 AC_CACHE_CHECK([for d_type member in directory struct],
1646 jm_cv_struct_dirent_d_type,
1649 #include <sys/types.h>
1650 #ifdef HAVE_DIRENT_H
1651 # include <dirent.h>
1652 #else /* not HAVE_DIRENT_H */
1653 # define dirent direct
1654 # ifdef HAVE_SYS_NDIR_H
1655 # include <sys/ndir.h>
1656 # endif /* HAVE_SYS_NDIR_H */
1657 # ifdef HAVE_SYS_DIR_H
1658 # include <sys/dir.h>
1659 # endif /* HAVE_SYS_DIR_H */
1662 # endif /* HAVE_NDIR_H */
1663 #endif /* HAVE_DIRENT_H */
1665 [struct dirent dp; dp.d_type = 0;],
1667 jm_cv_struct_dirent_d_type=yes,
1668 jm_cv_struct_dirent_d_type=no)
1671 if test $jm_cv_struct_dirent_d_type = yes; then
1672 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1673 [Define if there is a member named d_type in the struct describing
1674 directory headers.])
1681 dnl From Jim Meyering.
1683 dnl Check whether struct dirent has a member named d_ino.
1686 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1687 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1688 AC_CACHE_CHECK([for d_ino member in directory struct],
1689 jm_cv_struct_dirent_d_ino,
1692 #include <sys/types.h>
1693 #ifdef HAVE_DIRENT_H
1694 # include <dirent.h>
1695 #else /* not HAVE_DIRENT_H */
1696 # define dirent direct
1697 # ifdef HAVE_SYS_NDIR_H
1698 # include <sys/ndir.h>
1699 # endif /* HAVE_SYS_NDIR_H */
1700 # ifdef HAVE_SYS_DIR_H
1701 # include <sys/dir.h>
1702 # endif /* HAVE_SYS_DIR_H */
1705 # endif /* HAVE_NDIR_H */
1706 #endif /* HAVE_DIRENT_H */
1708 [struct dirent dp; dp.d_ino = 0;],
1710 jm_cv_struct_dirent_d_ino=yes,
1711 jm_cv_struct_dirent_d_ino=no)
1714 if test $jm_cv_struct_dirent_d_ino = yes; then
1715 AC_DEFINE(D_INO_IN_DIRENT, 1,
1716 [Define if there is a member named d_ino in the struct describing
1717 directory headers.])
1724 dnl This is just a wrapper function to encapsulate this kludge.
1725 dnl Putting it in a separate file like this helps share it between
1726 dnl different packages.
1727 AC_DEFUN([jm_CHECK_DECLS],
1729 AC_REQUIRE([_jm_DECL_HEADERS])
1730 AC_REQUIRE([AC_HEADER_TIME])
1734 # if !STDC_HEADERS && HAVE_MEMORY_H
1735 # include <memory.h>
1737 # include <string.h>
1740 # include <strings.h>
1744 # include <stdlib.h>
1747 # include <unistd.h>
1750 #include <sys/types.h>
1751 #if TIME_WITH_SYS_TIME
1752 # include <sys/time.h>
1755 # if HAVE_SYS_TIME_H
1756 # include <sys/time.h>
1797 ttyname], , , $headers)
1800 dnl FIXME: when autoconf has support for it.
1801 dnl This is a little helper so we can require these header checks.
1802 AC_DEFUN([_jm_DECL_HEADERS],
1804 AC_REQUIRE([AC_HEADER_STDC])
1805 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1806 unistd.h sys/time.h utmp.h utmpx.h)
1811 dnl We use jm_ for non Autoconf macros.
1812 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1813 m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1815 # These are the prerequisite macros for files in the lib/
1816 # directory of the coreutils package.
1818 AC_DEFUN([jm_PREREQ],
1820 AC_REQUIRE([jm_PREREQ_ADDEXT])
1822 # We don't yet use c-stack.c.
1823 # AC_REQUIRE([jm_PREREQ_C_STACK])
1825 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1826 AC_REQUIRE([jm_PREREQ_DIRNAME])
1827 AC_REQUIRE([jm_PREREQ_ERROR])
1828 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1829 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1830 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1831 AC_REQUIRE([jm_PREREQ_HASH])
1832 AC_REQUIRE([gl_HUMAN])
1833 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1834 AC_REQUIRE([jm_PREREQ_MEMCHR])
1835 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1836 AC_REQUIRE([jm_PREREQ_POSIXVER])
1837 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1838 AC_REQUIRE([jm_PREREQ_READUTMP])
1839 AC_REQUIRE([jm_PREREQ_STAT])
1840 AC_REQUIRE([jm_PREREQ_STRNLEN])
1841 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1842 AC_REQUIRE([jm_PREREQ_XGETCWD])
1843 AC_REQUIRE([jm_PREREQ_XREADLINK])
1846 AC_DEFUN([jm_PREREQ_ADDEXT],
1849 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1850 AC_CHECK_FUNCS(pathconf)
1851 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1854 AC_DEFUN([jm_PREREQ_CANON_HOST],
1856 dnl Add any libraries as early as possible.
1857 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1858 dnl so we have to add -lnsl to LIBS before checking for that function.
1859 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1861 dnl These come from -lnsl on Solaris5.5.1.
1862 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1864 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1865 netinet/in.h arpa/inet.h)
1868 AC_DEFUN([jm_PREREQ_DIRNAME],
1870 AC_REQUIRE([AC_HEADER_STDC])
1871 AC_CHECK_HEADERS(string.h)
1874 AC_DEFUN([jm_PREREQ_EXCLUDE],
1876 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1877 AC_REQUIRE([AC_HEADER_STDBOOL])
1880 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1882 AC_CHECK_FUNCS(getpagesize)
1883 AC_CHECK_HEADERS(OS.h unistd.h)
1886 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1888 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1889 AC_CHECK_FUNCS(setlocale)
1890 AC_REQUIRE([AM_C_PROTOTYPES])
1893 AC_DEFUN([jm_PREREQ_HASH],
1895 AC_CHECK_HEADERS(stdlib.h)
1896 AC_REQUIRE([AC_HEADER_STDBOOL])
1897 AC_REQUIRE([jm_CHECK_DECLS])
1900 AC_DEFUN([jm_PREREQ_MEMCHR],
1902 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1905 # Check for the external symbol, _system_configuration,
1906 # a struct with member `physmem'.
1907 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
1908 [AC_CACHE_CHECK(for external symbol _system_configuration,
1909 gl_cv_var__system_configuration,
1910 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
1911 [[#include <sys/systemcfg.h>
1913 [double x = _system_configuration.physmem;])],
1914 [gl_cv_var__system_configuration=yes],
1915 [gl_cv_var__system_configuration=no])])
1917 if test $gl_cv_var__system_configuration = yes; then
1918 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
1919 [Define to 1 if you have the external variable,
1920 _system_configuration with a member named physmem.])
1925 AC_DEFUN([jm_PREREQ_PHYSMEM],
1927 AC_CHECK_HEADERS([unistd.h sys/pstat.h sys/sysmp.h sys/sysinfo.h \
1928 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
1930 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
1932 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
1935 AC_DEFUN([jm_PREREQ_POSIXVER],
1937 AC_CHECK_HEADERS(unistd.h)
1938 AC_CHECK_DECLS([getenv])
1941 AC_DEFUN([jm_PREREQ_QUOTEARG],
1943 AC_CHECK_FUNCS(isascii iswprint)
1944 AC_REQUIRE([jm_FUNC_MBRTOWC])
1945 AC_REQUIRE([jm_FUNC_MEMCMP])
1946 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1947 AC_REQUIRE([AC_HEADER_STDC])
1948 AC_REQUIRE([AC_C_BACKSLASH_A])
1949 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1950 AC_REQUIRE([AM_C_PROTOTYPES])
1953 AC_DEFUN([jm_PREREQ_READUTMP],
1955 AC_REQUIRE([AC_HEADER_STDC])
1956 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1957 AC_CHECK_FUNCS(utmpname)
1958 AC_CHECK_FUNCS(utmpxname)
1959 AC_REQUIRE([AM_C_PROTOTYPES])
1961 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1963 $ac_includes_default
1971 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1972 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1973 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1974 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1975 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1976 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1977 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1978 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1979 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1980 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1982 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1983 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1984 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1985 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1987 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1988 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1989 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1990 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1995 AC_DEFUN([jm_PREREQ_STAT],
1997 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1998 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1999 AC_CHECK_FUNCS(statvfs)
2001 # For `struct statfs' on Ultrix 4.4.
2002 AC_CHECK_HEADERS(netinet/in.h nfs/nfs_clnt.h nfs/vfs.h)
2004 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2007 $ac_includes_default
2008 #if HAVE_SYS_STATVFS_H
2009 # include <sys/statvfs.h>
2012 # include <sys/vfs.h>
2014 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
2015 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
2016 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
2017 # include <sys/param.h>
2018 # include <sys/mount.h>
2019 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
2020 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
2021 # include <netinet/in.h>
2022 # include <nfs/nfs_clnt.h>
2023 # include <nfs/vfs.h>
2027 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
2028 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
2029 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
2030 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
2031 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
2032 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
2033 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
2034 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
2035 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
2036 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
2037 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
2040 AC_DEFUN([jm_PREREQ_STRNLEN],
2042 AC_REQUIRE([AC_FUNC_STRNLEN])
2043 AC_REQUIRE([AC_HEADER_STDC])
2044 AC_CHECK_HEADERS(memory.h)
2045 AC_CHECK_DECLS([memchr])
2047 # This is necessary because automake-1.6.1 doesn't understand
2048 # that the above use of AC_FUNC_STRNLEN means we may have to use
2050 test $ac_cv_func_strnlen_working = yes \
2051 && AC_LIBOBJ(strnlen)
2054 AC_DEFUN([jm_PREREQ_TEMPNAME],
2056 AC_REQUIRE([AC_HEADER_STDC])
2057 AC_REQUIRE([AC_HEADER_STAT])
2058 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
2059 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
2060 AC_CHECK_DECLS([getenv])
2061 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2064 AC_DEFUN([jm_PREREQ_XGETCWD],
2066 AC_REQUIRE([AC_C_PROTOTYPES])
2067 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
2068 AC_CHECK_FUNCS(getcwd)
2069 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
2072 AC_DEFUN([jm_PREREQ_XREADLINK],
2074 AC_REQUIRE([AC_C_PROTOTYPES])
2075 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
2080 AC_DEFUN([gl_ERROR],
2082 AC_FUNC_ERROR_AT_LINE
2083 dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
2087 # Prerequisites of lib/error.c.
2088 AC_DEFUN([jm_PREREQ_ERROR],
2090 AC_REQUIRE([AC_HEADER_STDC])
2091 AC_REQUIRE([AC_FUNC_VPRINTF])
2092 AC_CHECK_FUNCS(strerror)
2093 AC_CHECK_DECLS([strerror])
2098 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2099 dnl This file is free software, distributed under the terms of the GNU
2100 dnl General Public License. As a special exception to the GNU General
2101 dnl Public License, this file may be distributed as part of a program
2102 dnl that contains a configuration script generated by Autoconf, under
2103 dnl the same distribution terms as the rest of that program.
2105 AC_DEFUN([gl_HUMAN],
2107 dnl Prerequisites of lib/human.h.
2108 AC_REQUIRE([AM_STDBOOL_H])
2109 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2111 dnl Prerequisites of lib/human.c.
2112 AC_CHECK_HEADERS_ONCE(locale.h stdlib.h string.h)
2113 AC_CHECK_DECLS_ONCE(getenv)
2114 AC_CHECK_FUNCS_ONCE(localeconv)
2117 # Check for stdbool.h that conforms to C99.
2119 # Copyright (C) 2002-2003 Free Software Foundation, Inc.
2121 # This program is free software; you can redistribute it and/or modify
2122 # it under the terms of the GNU General Public License as published by
2123 # the Free Software Foundation; either version 2, or (at your option)
2124 # any later version.
2126 # This program is distributed in the hope that it will be useful,
2127 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2128 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2129 # GNU General Public License for more details.
2131 # You should have received a copy of the GNU General Public License
2132 # along with this program; if not, write to the Free Software
2133 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2136 # Prepare for substituting <stdbool.h> if it is not supported.
2138 AC_DEFUN([AM_STDBOOL_H],
2140 AC_REQUIRE([AC_HEADER_STDBOOL])
2142 # Define two additional variables used in the Makefile substitution.
2144 if test "$ac_cv_header_stdbool_h" = yes; then
2147 STDBOOL_H='stdbool.h'
2149 AC_SUBST([STDBOOL_H])
2151 if test "$ac_cv_type__Bool" = yes; then
2156 AC_SUBST([HAVE__BOOL])
2159 # This macro is only needed in autoconf <= 2.54. Newer versions of autoconf
2160 # have this macro built-in.
2162 AC_DEFUN([AC_HEADER_STDBOOL],
2163 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2164 [ac_cv_header_stdbool_h],
2167 #include <stdbool.h>
2169 "error: bool is not defined"
2172 "error: false is not defined"
2175 "error: false is not 0"
2178 "error: false is not defined"
2181 "error: true is not 1"
2183 #ifndef __bool_true_false_are_defined
2184 "error: __bool_true_false_are_defined is not defined"
2187 struct s { _Bool s: 1; _Bool t; } s;
2189 char a[true == 1 ? 1 : -1];
2190 char b[false == 0 ? 1 : -1];
2191 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2192 char d[(bool) -0.5 == true ? 1 : -1];
2194 char f[(_Bool) -0.0 == false ? 1 : -1];
2196 char h[sizeof (_Bool)];
2199 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2200 [ac_cv_header_stdbool_h=yes],
2201 [ac_cv_header_stdbool_h=no])])
2202 AC_CHECK_TYPES([_Bool])
2203 if test $ac_cv_header_stdbool_h = yes; then
2204 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2207 # uintmax_t.m4 serial 7 (gettext-0.12)
2208 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2209 dnl This file is free software, distributed under the terms of the GNU
2210 dnl General Public License. As a special exception to the GNU General
2211 dnl Public License, this file may be distributed as part of a program
2212 dnl that contains a configuration script generated by Autoconf, under
2213 dnl the same distribution terms as the rest of that program.
2215 dnl From Paul Eggert.
2219 # Define uintmax_t to 'unsigned long' or 'unsigned long long'
2220 # if it is not already defined in <stdint.h> or <inttypes.h>.
2222 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2224 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
2225 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
2226 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
2227 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2228 test $ac_cv_type_unsigned_long_long = yes \
2229 && ac_type='unsigned long long' \
2230 || ac_type='unsigned long'
2231 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2232 [Define to unsigned long or unsigned long long
2233 if <stdint.h> and <inttypes.h> don't define.])
2235 AC_DEFINE(HAVE_UINTMAX_T, 1,
2236 [Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>.])
2240 # inttypes_h.m4 serial 5 (gettext-0.12)
2241 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2242 dnl This file is free software, distributed under the terms of the GNU
2243 dnl General Public License. As a special exception to the GNU General
2244 dnl Public License, this file may be distributed as part of a program
2245 dnl that contains a configuration script generated by Autoconf, under
2246 dnl the same distribution terms as the rest of that program.
2248 dnl From Paul Eggert.
2250 # Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
2251 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2253 AC_DEFUN([jm_AC_HEADER_INTTYPES_H],
2255 AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
2257 [#include <sys/types.h>
2258 #include <inttypes.h>],
2259 [uintmax_t i = (uintmax_t) -1;],
2260 jm_ac_cv_header_inttypes_h=yes,
2261 jm_ac_cv_header_inttypes_h=no)])
2262 if test $jm_ac_cv_header_inttypes_h = yes; then
2263 AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
2264 [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
2265 and declares uintmax_t. ])
2269 # stdint_h.m4 serial 3 (gettext-0.12)
2270 dnl Copyright (C) 1997-2003 Free Software Foundation, Inc.
2271 dnl This file is free software, distributed under the terms of the GNU
2272 dnl General Public License. As a special exception to the GNU General
2273 dnl Public License, this file may be distributed as part of a program
2274 dnl that contains a configuration script generated by Autoconf, under
2275 dnl the same distribution terms as the rest of that program.
2277 dnl From Paul Eggert.
2279 # Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
2280 # doesn't clash with <sys/types.h>, and declares uintmax_t.
2282 AC_DEFUN([jm_AC_HEADER_STDINT_H],
2284 AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
2286 [#include <sys/types.h>
2287 #include <stdint.h>],
2288 [uintmax_t i = (uintmax_t) -1;],
2289 jm_ac_cv_header_stdint_h=yes,
2290 jm_ac_cv_header_stdint_h=no)])
2291 if test $jm_ac_cv_header_stdint_h = yes; then
2292 AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
2293 [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
2294 and declares uintmax_t. ])
2300 dnl From Paul Eggert.
2302 # Define HAVE_LONG_LONG if 'long long' works.
2304 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2306 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2307 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2308 [long long llmax = (long long) -1;
2309 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2310 ac_cv_type_long_long=yes,
2311 ac_cv_type_long_long=no)])
2312 if test $ac_cv_type_long_long = yes; then
2313 AC_DEFINE(HAVE_LONG_LONG, 1,
2314 [Define if you have the long long type.])
2318 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2320 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2322 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2323 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2324 [unsigned long long ullmax = (unsigned long long) -1;
2325 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2326 ac_cv_type_unsigned_long_long=yes,
2327 ac_cv_type_unsigned_long_long=no)])
2328 if test $ac_cv_type_unsigned_long_long = yes; then
2329 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2330 [Define if you have the unsigned long long type.])
2336 dnl autoconf tests required for use of mbswidth.c
2337 dnl From Bruno Haible.
2339 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2341 AC_REQUIRE([AC_HEADER_STDC])
2342 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2343 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2346 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2348 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2350 # include <string.h>
2357 char *p = (char *) wcwidth;
2359 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2360 if test $ac_cv_have_decl_wcwidth = yes; then
2365 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2366 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2371 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2372 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2373 dnl This file is free software, distributed under the terms of the GNU
2374 dnl General Public License. As a special exception to the GNU General
2375 dnl Public License, this file may be distributed as part of a program
2376 dnl that contains a configuration script generated by Autoconf, under
2377 dnl the same distribution terms as the rest of that program.
2379 dnl From Paul Eggert
2381 AC_DEFUN([jm_FUNC_MBRTOWC],
2383 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2386 [#include <wchar.h>],
2387 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2388 jm_cv_func_mbrtowc=yes,
2389 jm_cv_func_mbrtowc=no)])
2390 if test $jm_cv_func_mbrtowc = yes; then
2391 AC_DEFINE(HAVE_MBRTOWC, 1,
2392 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2398 dnl A replacement for autoconf's macro by the same name. This version
2399 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2400 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2401 dnl run only if one of the listed libraries ends up being used (and not in
2402 dnl the `none required' case.
2403 dnl I hope it's only temporary while we wait for that version to be fixed.
2404 undefine([AC_SEARCH_LIBS])
2406 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2407 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2408 # [OTHER-LIBRARIES])
2409 # --------------------------------------------------------
2410 # Search for a library defining FUNC, if it's not already available.
2411 AC_DEFUN([AC_SEARCH_LIBS],
2413 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2415 ac_func_search_save_LIBS=$LIBS
2417 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2418 if test "$ac_cv_search_$1" = no; then
2419 for ac_lib in $2; do
2420 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2421 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2424 LIBS=$ac_func_search_save_LIBS
2427 if test "$ac_cv_search_$1" = no; then :
2430 if test "$ac_cv_search_$1" = 'none required'; then :
2433 LIBS="$ac_cv_search_$1 $LIBS"
2440 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2442 # This program is free software; you can redistribute it and/or modify
2443 # it under the terms of the GNU General Public License as published by
2444 # the Free Software Foundation; either version 2, or (at your option)
2445 # any later version.
2447 # This program is distributed in the hope that it will be useful,
2448 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2449 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2450 # GNU General Public License for more details.
2452 # You should have received a copy of the GNU General Public License
2453 # along with this program; if not, write to the Free Software
2454 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2459 AC_DEFUN([AM_C_PROTOTYPES],
2460 [AC_REQUIRE([AM_PROG_CC_STDC])
2461 AC_REQUIRE([AC_PROG_CPP])
2462 AC_MSG_CHECKING([for function prototypes])
2463 if test "$am_cv_prog_cc_stdc" != no; then
2465 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2469 U=_ ANSI2KNR=./ansi2knr
2471 # Ensure some checks needed by ansi2knr itself.
2473 AC_CHECK_HEADERS(string.h)
2475 AC_SUBST(ANSI2KNR)dnl
2478 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2481 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2483 # This program is free software; you can redistribute it and/or modify
2484 # it under the terms of the GNU General Public License as published by
2485 # the Free Software Foundation; either version 2, or (at your option)
2486 # any later version.
2488 # This program is distributed in the hope that it will be useful,
2489 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2490 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2491 # GNU General Public License for more details.
2493 # You should have received a copy of the GNU General Public License
2494 # along with this program; if not, write to the Free Software
2495 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2500 # @defmac AC_PROG_CC_STDC
2501 # @maindex PROG_CC_STDC
2503 # If the C compiler in not in ANSI C mode by default, try to add an option
2504 # to output variable @code{CC} to make it so. This macro tries various
2505 # options that select ANSI C on some system or another. It considers the
2506 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2508 # If you use this macro, you should check after calling it whether the C
2509 # compiler has been set to accept ANSI C; if not, the shell variable
2510 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2511 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2512 # program @code{ansi2knr}, which comes with Ghostscript.
2515 AC_DEFUN([AM_PROG_CC_STDC],
2516 [AC_REQUIRE([AC_PROG_CC])
2517 AC_BEFORE([$0], [AC_C_INLINE])
2518 AC_BEFORE([$0], [AC_C_CONST])
2519 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2520 dnl a magic option to avoid problems with ANSI preprocessor commands
2522 dnl FIXME: can't do this because then AC_AIX won't work due to a
2523 dnl circular dependency.
2524 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2525 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2526 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2527 [am_cv_prog_cc_stdc=no
2529 # Don't try gcc -ansi; that turns off useful extensions and
2530 # breaks some systems' header files.
2531 # AIX -qlanglvl=ansi
2532 # Ultrix and OSF/1 -std1
2533 # HP-UX 10.20 and later -Ae
2534 # HP-UX older versions -Aa -D_HPUX_SOURCE
2535 # SVR4 -Xc -D__EXTENSIONS__
2536 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2538 CC="$ac_save_CC $ac_arg"
2540 [#include <stdarg.h>
2542 #include <sys/types.h>
2543 #include <sys/stat.h>
2544 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2545 struct buf { int x; };
2546 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2547 static char *e (p, i)
2553 static char *f (char * (*g) (char **, int), char **p, ...)
2558 s = g (p, va_arg (v,int));
2562 int test (int i, double x);
2563 struct s1 {int (*f) (int a);};
2564 struct s2 {int (*f) (double a);};
2565 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2569 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2571 [am_cv_prog_cc_stdc="$ac_arg"; break])
2575 if test -z "$am_cv_prog_cc_stdc"; then
2576 AC_MSG_RESULT([none needed])
2578 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2580 case "x$am_cv_prog_cc_stdc" in
2582 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2586 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2590 AC_DEFUN([jm_FUNC_MEMCMP],
2591 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2592 if test $ac_cv_func_memcmp_working = no; then
2593 AC_DEFINE(memcmp, rpl_memcmp,
2594 [Define to rpl_memcmp if the replacement function should be used.])
2598 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2600 # Copyright 2001 Free Software Foundation, Inc.
2602 # This program is free software; you can redistribute it and/or modify
2603 # it under the terms of the GNU General Public License as published by
2604 # the Free Software Foundation; either version 2, or (at your option)
2605 # any later version.
2607 # This program is distributed in the hope that it will be useful,
2608 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2609 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2610 # GNU General Public License for more details.
2612 # You should have received a copy of the GNU General Public License
2613 # along with this program; if not, write to the Free Software Foundation,
2614 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2616 # Written by Paul Eggert.
2618 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2619 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2620 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2621 [ac_cv_func_getcwd_null],
2624 # ifdef HAVE_STDLIB_H
2625 # include <stdlib.h>
2627 # ifdef HAVE_UNISTD_H
2628 # include <unistd.h>
2636 if (chdir ("/") != 0)
2640 char *f = getcwd (NULL, 0);
2641 exit (! (f && f[0] == '/' && !f[1]));
2644 [ac_cv_func_getcwd_null=yes],
2645 [ac_cv_func_getcwd_null=no],
2646 [ac_cv_func_getcwd_null=no])])
2647 if test $ac_cv_func_getcwd_null = yes; then
2648 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2649 [Define if getcwd (NULL, 0) allocates memory for result.])
2654 dnl Find out how to get the file descriptor associated with an open DIR*.
2655 dnl From Jim Meyering
2657 AC_DEFUN([UTILS_FUNC_DIRFD],
2659 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2660 AC_REQUIRE([AC_PROG_CPP])
2661 AC_REQUIRE([AC_PROG_EGREP])
2666 # include <dirent.h>
2667 #else /* not HAVE_DIRENT_H */
2668 # define dirent direct
2669 # if HAVE_SYS_NDIR_H
2670 # include <sys/ndir.h>
2671 # endif /* HAVE_SYS_NDIR_H */
2673 # include <sys/dir.h>
2674 # endif /* HAVE_SYS_DIR_H */
2677 # endif /* HAVE_NDIR_H */
2678 #endif /* HAVE_DIRENT_H */
2680 AC_CHECK_FUNCS(dirfd)
2681 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2683 AC_CACHE_CHECK([whether dirfd is a macro],
2684 jm_cv_func_dirfd_macro,
2685 [AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2687 dirent_header_defines_dirfd
2689 jm_cv_func_dirfd_macro=yes,
2690 jm_cv_func_dirfd_macro=no)])
2692 # Use the replacement only if we have no function, macro,
2693 # or declaration with that name.
2694 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2696 AC_REPLACE_FUNCS([dirfd])
2698 [how to get the file descriptor associated with an open DIR*],
2699 gl_cv_sys_dir_fd_member_name,
2701 dirfd_save_CFLAGS=$CFLAGS
2702 for ac_expr in d_fd dd_fd; do
2704 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2708 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2711 CFLAGS=$dirfd_save_CFLAGS
2712 test "$dir_fd_found" = yes && break
2714 test "$dir_fd_found" = yes || ac_expr=no_such_member
2716 gl_cv_sys_dir_fd_member_name=$ac_expr
2719 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
2720 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2721 $gl_cv_sys_dir_fd_member_name,
2722 [the name of the file descriptor member of DIR])
2724 AH_VERBATIM(DIR_TO_FD,
2725 [#ifdef DIR_FD_MEMBER_NAME
2726 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2728 # define DIR_TO_FD(Dir_p) -1
2735 # acl.m4 - check for access control list (ACL) primitives
2737 # Copyright (C) 2002 Free Software Foundation, Inc.
2739 # This program is free software; you can redistribute it and/or modify
2740 # it under the terms of the GNU General Public License as published by
2741 # the Free Software Foundation; either version 2, or (at your option)
2742 # any later version.
2744 # This program is distributed in the hope that it will be useful,
2745 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2746 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2747 # GNU General Public License for more details.
2749 # You should have received a copy of the GNU General Public License
2750 # along with this program; if not, write to the Free Software Foundation,
2751 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2753 # Written by Paul Eggert.
2755 AC_DEFUN([AC_FUNC_ACL],
2756 [AC_CHECK_HEADERS(sys/acl.h)
2757 AC_CHECK_FUNCS(acl)])
2760 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2761 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
2762 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
2763 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
2764 # objects and arrange to use lib/search.h if necessary.
2767 AC_DEFUN([AC_FUNC_FTW],
2770 AC_REQUIRE([AC_HEADER_STAT])
2771 AC_REQUIRE([jm_FUNC_LSTAT])
2772 AC_REQUIRE([AC_HEADER_DIRENT])
2773 AC_CHECK_HEADERS(sys/param.h)
2774 AC_CHECK_DECLS([stpcpy])
2776 # In the event that we have to use the replacement ftw.c,
2777 # see if we'll also need the replacement tsearch.c.
2778 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2780 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
2781 ac_cv_func_ftw_working,
2783 # The following test would fail prior to glibc-2.3.2, because `depth'
2784 # would be 2 rather than 4. Of course, now that we require FTW_DCH
2785 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
2786 mkdir -p conftest.dir/a/b/c
2787 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2792 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2793 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2794 static char **p = _f;
2798 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2800 if (strcmp (file, *p++) != 0)
2809 /* Require these symbols, too. */
2813 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2814 exit ((err == 0 && depth == 4) ? 0 : 1);
2817 [ac_cv_func_ftw_working=yes],
2818 [ac_cv_func_ftw_working=no],
2819 [ac_cv_func_ftw_working=no])])
2821 if test $ac_cv_func_ftw_working = no; then
2823 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2824 # Add tsearch.o IFF we have to use the replacement ftw.c.
2825 if test -n "$need_tdestroy"; then
2826 AC_LIBOBJ([tsearch])
2827 # Link search.h to search_.h if we use the replacement tsearch.c.
2829 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2836 dnl From Jim Meyering.
2837 dnl Determine whether lstat has the bug that it succeeds when given the
2838 dnl zero-length file name argument. The lstat from SunOS 4.1.4 and the Hurd
2839 dnl (as of 1998-11-01) do this.
2841 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2842 dnl compile the wrapper function.
2845 AC_DEFUN([jm_FUNC_LSTAT],
2847 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2848 AC_CACHE_CHECK([whether lstat accepts an empty string],
2849 jm_cv_func_lstat_empty_string_bug,
2851 # include <sys/types.h>
2852 # include <sys/stat.h>
2858 exit (lstat ("", &sbuf) ? 1 : 0);
2861 jm_cv_func_lstat_empty_string_bug=yes,
2862 jm_cv_func_lstat_empty_string_bug=no,
2863 dnl When crosscompiling, assume lstat is broken.
2864 jm_cv_func_lstat_empty_string_bug=yes)
2866 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2868 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2869 [Define if lstat has the bug that it succeeds when given the zero-length
2870 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2877 dnl From Jim Meyering.
2878 dnl Provide lchown on systems that lack it.
2880 AC_DEFUN([jm_FUNC_LCHOWN],
2882 AC_REQUIRE([AC_TYPE_UID_T])
2883 AC_REPLACE_FUNCS(lchown)
2888 # When rmdir fails because the specified directory is not empty, it sets
2889 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2890 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2891 # in general, to avoid depending on the use of any particular symbol, this
2892 # test runs a test to determine the actual numeric value.
2893 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2895 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2896 fetish_cv_func_rmdir_errno_not_empty,
2898 # Arrange for deletion of the temporary directory this test creates.
2899 ac_clean_files="$ac_clean_files confdir2"
2900 mkdir confdir2; : > confdir2/file
2913 s = fopen ("confdir2/errno", "w");
2914 fprintf (s, "%d\n", val);
2918 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2919 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2920 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2925 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2926 $fetish_cv_func_rmdir_errno_not_empty,
2927 [the value to which errno is set when rmdir fails on a nonempty directory])
2932 dnl From Jim Meyering.
2933 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2934 dnl If it doesn't, arrange to use the replacement function.
2937 AC_DEFUN([jm_FUNC_CHOWN],
2938 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2939 test -z "$ac_cv_header_unistd_h" \
2940 && AC_CHECK_HEADERS(unistd.h)
2941 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2943 # include <sys/types.h>
2944 # include <sys/stat.h>
2946 # ifdef HAVE_UNISTD_H
2947 # include <unistd.h>
2953 char *f = "conftest.chown";
2954 struct stat before, after;
2956 if (creat (f, 0600) < 0)
2958 if (stat (f, &before) < 0)
2960 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2962 if (stat (f, &after) < 0)
2964 exit ((before.st_uid == after.st_uid
2965 && before.st_gid == after.st_gid) ? 0 : 1);
2968 jm_cv_func_working_chown=yes,
2969 jm_cv_func_working_chown=no,
2970 dnl When crosscompiling, assume chown is broken.
2971 jm_cv_func_working_chown=no)
2973 if test $jm_cv_func_working_chown = no; then
2975 AC_DEFINE(chown, rpl_chown,
2976 [Define to rpl_chown if the replacement function should be used.])
2982 dnl From Jim Meyering.
2983 dnl A wrapper around AC_FUNC_MKTIME.
2985 AC_DEFUN([jm_FUNC_MKTIME],
2986 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2988 dnl mktime.c uses localtime_r if it exists. Check for it.
2989 AC_CHECK_FUNCS(localtime_r)
2991 if test $ac_cv_func_working_mktime = no; then
2992 AC_DEFINE(mktime, rpl_mktime,
2993 [Define to rpl_mktime if the replacement function should be used.])
2997 # mktime.m4 serial 2
2998 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2999 dnl This file is free software, distributed under the terms of the GNU
3000 dnl General Public License. As a special exception to the GNU General
3001 dnl Public License, this file may be distributed as part of a program
3002 dnl that contains a configuration script generated by Autoconf, under
3003 dnl the same distribution terms as the rest of that program.
3005 dnl From Jim Meyering.
3007 # Redefine AC_FUNC_MKTIME, to fix a bug in Autoconf 2.57 and earlier.
3008 # This redefinition can be removed once a new version of Autoconf comes out.
3009 # The redefinition is taken from
3010 # <http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/autoconf/autoconf/lib/autoconf/functions.m4?rev=1.78>.
3013 AC_DEFUN([AC_FUNC_MKTIME],
3014 [AC_REQUIRE([AC_HEADER_TIME])dnl
3015 AC_CHECK_HEADERS(stdlib.h sys/time.h unistd.h)
3016 AC_CHECK_FUNCS(alarm)
3017 AC_CACHE_CHECK([for working mktime], ac_cv_func_working_mktime,
3018 [AC_RUN_IFELSE([AC_LANG_SOURCE(
3019 [[/* Test program from Paul Eggert and Tony Leneis. */
3020 #if TIME_WITH_SYS_TIME
3021 # include <sys/time.h>
3024 # if HAVE_SYS_TIME_H
3025 # include <sys/time.h>
3032 # include <stdlib.h>
3036 # include <unistd.h>
3040 # define alarm(X) /* empty */
3043 /* Work around redefinition to rpl_putenv by other config tests. */
3046 static time_t time_t_max;
3047 static time_t time_t_min;
3049 /* Values we'll use to set the TZ environment variable. */
3050 static char *tz_strings[] = {
3051 (char *) 0, "TZ=GMT0", "TZ=JST-9",
3052 "TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00"
3054 #define N_STRINGS (sizeof (tz_strings) / sizeof (tz_strings[0]))
3056 /* Fail if mktime fails to convert a date in the spring-forward gap.
3057 Based on a problem report from Andreas Jaeger. */
3059 spring_forward_gap ()
3061 /* glibc (up to about 1998-10-07) failed this test. */
3064 /* Use the portable POSIX.1 specification "TZ=PST8PDT,M4.1.0,M10.5.0"
3065 instead of "TZ=America/Vancouver" in order to detect the bug even
3066 on systems that don't support the Olson extension, or don't have the
3067 full zoneinfo tables installed. */
3068 putenv ("TZ=PST8PDT,M4.1.0,M10.5.0");
3077 if (mktime (&tm) == (time_t)-1)
3086 if ((lt = localtime (&now)) && mktime (lt) != now)
3095 mktime_test1 ((time_t) (time_t_max - now));
3096 mktime_test1 ((time_t) (time_t_min + now));
3102 /* Based on code from Ariel Faigon. */
3112 if (tm.tm_mon != 2 || tm.tm_mday != 31)
3122 tm.tm_year = tm.tm_mon = tm.tm_mday = tm.tm_hour = tm.tm_min = tm.tm_sec = j;
3124 if (now != (time_t) -1)
3126 struct tm *lt = localtime (&now);
3128 && lt->tm_year == tm.tm_year
3129 && lt->tm_mon == tm.tm_mon
3130 && lt->tm_mday == tm.tm_mday
3131 && lt->tm_hour == tm.tm_hour
3132 && lt->tm_min == tm.tm_min
3133 && lt->tm_sec == tm.tm_sec
3134 && lt->tm_yday == tm.tm_yday
3135 && lt->tm_wday == tm.tm_wday
3136 && ((lt->tm_isdst < 0 ? -1 : 0 < lt->tm_isdst)
3137 == (tm.tm_isdst < 0 ? -1 : 0 < tm.tm_isdst))))
3148 /* This test makes some buggy mktime implementations loop.
3149 Give up after 60 seconds; a mktime slower than that
3150 isn't worth using anyway. */
3153 for (time_t_max = 1; 0 < time_t_max; time_t_max *= 2)
3156 if ((time_t) -1 < 0)
3157 for (time_t_min = -1; (time_t) (time_t_min * 2) < 0; time_t_min *= 2)
3159 delta = time_t_max / 997; /* a suitable prime number */
3160 for (i = 0; i < N_STRINGS; i++)
3163 putenv (tz_strings[i]);
3165 for (t = 0; t <= time_t_max - delta; t += delta)
3167 mktime_test ((time_t) 1);
3168 mktime_test ((time_t) (60 * 60));
3169 mktime_test ((time_t) (60 * 60 * 24));
3171 for (j = 1; 0 < j; j *= 2)
3173 bigtime_test (j - 1);
3176 spring_forward_gap ();
3179 [ac_cv_func_working_mktime=yes],
3180 [ac_cv_func_working_mktime=no],
3181 [ac_cv_func_working_mktime=no])])
3182 if test $ac_cv_func_working_mktime = no; then
3187 AC_DEFUN([gl_FUNC_MKTIME],
3189 AC_REQUIRE([AC_FUNC_MKTIME])
3190 if test $ac_cv_func_working_mktime = no; then
3191 AC_DEFINE(mktime, rpl_mktime,
3192 [Define to rpl_mktime if the replacement function should be used.])
3197 # Prerequisites of lib/mktime.c.
3198 AC_DEFUN([gl_PREREQ_MKTIME], [
3199 AC_REQUIRE([AC_HEADER_STDC])
3200 AC_CHECK_HEADERS_ONCE(limits.h)
3205 dnl From Jim Meyering.
3206 dnl Determine whether stat has the bug that it succeeds when given the
3207 dnl zero-length file name argument. The stat from SunOS 4.1.4 and the Hurd
3208 dnl (as of 1998-11-01) do this.
3210 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
3211 dnl compile the wrapper function.
3214 AC_DEFUN([jm_FUNC_STAT],
3216 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
3217 AC_CACHE_CHECK([whether stat accepts an empty string],
3218 jm_cv_func_stat_empty_string_bug,
3220 # include <sys/types.h>
3221 # include <sys/stat.h>
3227 exit (stat ("", &sbuf) ? 1 : 0);
3230 jm_cv_func_stat_empty_string_bug=yes,
3231 jm_cv_func_stat_empty_string_bug=no,
3232 dnl When crosscompiling, assume stat is broken.
3233 jm_cv_func_stat_empty_string_bug=yes)
3235 if test $jm_cv_func_stat_empty_string_bug = yes; then
3237 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
3238 [Define if stat has the bug that it succeeds when given the zero-length
3239 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
3246 dnl From Jim Meyering.
3247 dnl Check for the nanosleep function.
3248 dnl If not found, use the supplied replacement.
3251 AC_DEFUN([jm_FUNC_NANOSLEEP],
3253 nanosleep_save_libs=$LIBS
3255 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
3256 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
3257 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
3258 AC_SUBST(LIB_NANOSLEEP)
3260 AC_CACHE_CHECK([whether nanosleep works],
3261 jm_cv_func_nanosleep_works,
3263 AC_REQUIRE([AC_HEADER_TIME])
3265 # if TIME_WITH_SYS_TIME
3266 # include <sys/time.h>
3269 # if HAVE_SYS_TIME_H
3270 # include <sys/time.h>
3279 struct timespec ts_sleep, ts_remaining;
3280 ts_sleep.tv_sec = 0;
3281 ts_sleep.tv_nsec = 1;
3282 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
3285 jm_cv_func_nanosleep_works=yes,
3286 jm_cv_func_nanosleep_works=no,
3287 dnl When crosscompiling, assume the worst.
3288 jm_cv_func_nanosleep_works=no)
3290 if test $jm_cv_func_nanosleep_works = no; then
3291 AC_LIBOBJ(nanosleep)
3292 AC_DEFINE(nanosleep, rpl_nanosleep,
3293 [Define to rpl_nanosleep if the replacement function should be used.])
3296 LIBS=$nanosleep_save_libs
3299 # memcoll.m4 serial 2
3300 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3301 dnl This file is free software, distributed under the terms of the GNU
3302 dnl General Public License. As a special exception to the GNU General
3303 dnl Public License, this file may be distributed as part of a program
3304 dnl that contains a configuration script generated by Autoconf, under
3305 dnl the same distribution terms as the rest of that program.
3307 AC_DEFUN([gl_MEMCOLL],
3309 dnl Prerequisites of lib/memcoll.c.
3310 AC_REQUIRE([AC_FUNC_MEMCMP])
3311 AC_CHECK_HEADERS_ONCE(string.h)
3315 #serial 7 -*- autoconf -*-
3317 dnl From Jim Meyering.
3319 dnl See if the glibc *_unlocked I/O macros are available.
3320 dnl Use only those *_unlocked macros that are declared.
3323 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
3325 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
3326 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
3327 fread_unlocked, fwrite_unlocked, getc_unlocked,
3328 getchar_unlocked, putc_unlocked, putchar_unlocked])])
3332 dnl Written by Jim Meyering
3334 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
3336 dnl Do this replacement check manually because I want the hyphen
3337 dnl (not the underscore) in the filename.
3338 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3344 dnl From Jim Meyering.
3346 dnl Check whether putenv ("FOO") removes FOO from the environment.
3347 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3350 AC_DEFUN([jm_FUNC_PUTENV],
3351 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3356 /* Put it in env. */
3357 if (putenv ("CONFTEST_putenv=val"))
3360 /* Try to remove it. */
3361 if (putenv ("CONFTEST_putenv"))
3364 /* Make sure it was deleted. */
3365 if (getenv ("CONFTEST_putenv") != 0)
3371 jm_cv_func_svid_putenv=yes,
3372 jm_cv_func_svid_putenv=no,
3373 dnl When crosscompiling, assume putenv is broken.
3374 jm_cv_func_svid_putenv=no)
3376 if test $jm_cv_func_svid_putenv = no; then
3378 AC_DEFINE(putenv, rpl_putenv,
3379 [Define to rpl_putenv if the replacement function should be used.])
3387 AC_MSG_CHECKING(for AFS)
3388 if test -d /afs; then
3389 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3394 AC_MSG_RESULT($ac_result)
3399 # autoconf tests required for use of xstrtoumax.c
3401 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3403 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3404 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3405 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3406 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3407 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3408 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3410 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3411 jm_cv_func_strtoumax_macro,
3412 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3414 inttypes_h_defines_strtoumax
3416 jm_cv_func_strtoumax_macro=yes,
3417 jm_cv_func_strtoumax_macro=no))
3419 if test "$jm_cv_func_strtoumax_macro" != yes; then
3420 AC_REPLACE_FUNCS(strtoumax)
3423 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3424 dnl so we need the replacements only if strtoumax does not exist.
3425 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3427 AC_REPLACE_FUNCS(strtoul)
3429 dnl We don't need (and can't compile) the replacement strtoull
3430 dnl unless the type `unsigned long long' exists.
3431 if test "$ac_cv_type_unsigned_long_long" = yes; then
3432 AC_REPLACE_FUNCS(strtoull)
3438 # intmax_t.m4 serial 1
3439 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3440 dnl This file is free software, distributed under the terms of the GNU
3441 dnl General Public License. As a special exception to the GNU General
3442 dnl Public License, this file may be distributed as part of a program
3443 dnl that contains a configuration script generated by Autoconf, under
3444 dnl the same distribution terms as the rest of that program.
3446 dnl From Paul Eggert.
3450 # Define intmax_t to 'long' or 'long long'
3451 # if it is not already defined in <stdint.h> or <inttypes.h>.
3453 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
3455 dnl For simplicity, we assume that a header file defines 'intmax_t' if and
3456 dnl only if it defines 'uintmax_t'.
3457 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3458 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3459 if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
3460 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3461 test $ac_cv_type_long_long = yes \
3462 && ac_type='long long' \
3464 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3465 [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
3467 AC_DEFINE(HAVE_INTMAX_T, 1,
3468 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3472 dnl An alternative would be to explicitly test for 'intmax_t'.
3474 AC_DEFUN([gt_AC_TYPE_INTMAX_T],
3476 AC_REQUIRE([jm_AC_HEADER_INTTYPES_H])
3477 AC_REQUIRE([jm_AC_HEADER_STDINT_H])
3478 AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
3482 #if HAVE_STDINT_H_WITH_UINTMAX
3485 #if HAVE_INTTYPES_H_WITH_UINTMAX
3486 #include <inttypes.h>
3488 ], [intmax_t x = -1;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
3489 if test $gt_cv_c_intmax_t = yes; then
3490 AC_DEFINE(HAVE_INTMAX_T, 1,
3491 [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
3493 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3494 test $ac_cv_type_long_long = yes \
3495 && ac_type='long long' \
3497 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
3498 [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
3503 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3505 # autoconf tests required for use of xstrtoimax.c
3507 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3509 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3510 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3511 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3512 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3513 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3514 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3516 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3517 jm_cv_func_strtoimax_macro,
3518 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3520 inttypes_h_defines_strtoimax
3522 jm_cv_func_strtoimax_macro=yes,
3523 jm_cv_func_strtoimax_macro=no))
3525 if test "$jm_cv_func_strtoimax_macro" != yes; then
3526 AC_REPLACE_FUNCS(strtoimax)
3529 dnl Only the replacement strtoimax invokes strtol and strtoll,
3530 dnl so we need the replacements only if strtoimax does not exist.
3531 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3533 AC_REPLACE_FUNCS(strtol)
3535 dnl We don't need (and can't compile) the replacement strtoll
3536 dnl unless the type `long long' exists.
3537 if test "$ac_cv_type_long_long" = yes; then
3538 AC_REPLACE_FUNCS(strtoll)
3545 dnl Run a program to determine whether whether link(2) follows symlinks.
3546 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3548 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3551 [whether link(2) dereferences a symlink specified with a trailing slash],
3552 jm_ac_cv_func_link_follows_symlink,
3554 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3555 dnl the appropriate framework.
3556 test -z "$ac_cv_header_unistd_h" \
3557 && AC_CHECK_HEADERS(unistd.h)
3559 # Create a regular file.
3560 echo > conftest.file
3563 # include <sys/types.h>
3564 # include <sys/stat.h>
3565 # ifdef HAVE_UNISTD_H
3566 # include <unistd.h>
3569 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3570 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3571 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3576 const char *file = "conftest.file";
3577 const char *sym = "conftest.sym";
3578 const char *hard = "conftest.hard";
3579 struct stat sb_file, sb_hard;
3581 /* Create a symlink to the regular file. */
3582 if (symlink (file, sym))
3585 /* Create a hard link to that symlink. */
3586 if (link (sym, hard))
3589 if (lstat (hard, &sb_hard))
3591 if (lstat (file, &sb_file))
3594 /* If the dev/inode of hard and file are the same, then
3595 the link call followed the symlink. */
3596 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3599 jm_ac_cv_func_link_follows_symlink=yes,
3600 jm_ac_cv_func_link_follows_symlink=no,
3601 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3604 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3605 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3606 [Define if `link(2)' dereferences symbolic links.])
3610 # Check for fnmatch.
3612 # This is a modified version of autoconf's AC_FUNC_FNMATCH.
3613 # This file should be simplified after Autoconf 2.57 is required.
3615 # Copyright (C) 2000-2003 Free Software Foundation, Inc.
3617 # This program is free software; you can redistribute it and/or modify
3618 # it under the terms of the GNU General Public License as published by
3619 # the Free Software Foundation; either version 2, or (at your option)
3620 # any later version.
3622 # This program is distributed in the hope that it will be useful,
3623 # but WITHOUT ANY WARRANTY; without even the implied warranty of
3624 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3625 # GNU General Public License for more details.
3627 # You should have received a copy of the GNU General Public License
3628 # along with this program; if not, write to the Free Software
3629 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3632 # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
3633 # -------------------------------------------------------------------------
3634 # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise
3635 # IF-FALSE. Use CACHE_VAR.
3636 AC_DEFUN([_AC_FUNC_FNMATCH_IF],
3638 [for working $1 fnmatch],
3640 [# Some versions of Solaris, SCO, and the GNU C Library
3641 # have a broken or incompatible fnmatch.
3642 # So we run a test program. If we are cross-compiling, take no chance.
3643 # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
3647 # include <stdlib.h>
3648 # include <fnmatch.h>
3649 # define y(a, b, c) (fnmatch (a, b, c) == 0)
3650 # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
3653 (!(y ("a*", "abc", 0)
3654 && n ("d*/*1", "d/s/1", FNM_PATHNAME)
3655 && y ("a\\\\bc", "abc", 0)
3656 && n ("a\\\\bc", "abc", FNM_NOESCAPE)
3657 && y ("*x", ".x", 0)
3658 && n ("*x", ".x", FNM_PERIOD)
3659 && m4_if([$1], [GNU],
3660 [y ("xxXX", "xXxX", FNM_CASEFOLD)
3661 && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
3662 && n ("d*/*1", "d/s/1", FNM_FILE_NAME)
3663 && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
3664 && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
3665 && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)],
3670 AS_IF([test $$2 = yes], [$3], [$4])
3671 ])# _AC_FUNC_FNMATCH_IF
3674 # _AC_LIBOBJ_FNMATCH
3675 # ------------------
3676 # Prepare the replacement of fnmatch.
3677 AC_DEFUN([_AC_LIBOBJ_FNMATCH],
3678 [AC_REQUIRE([AC_C_CONST])dnl
3679 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
3680 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
3681 AC_CHECK_DECLS([getenv])
3682 AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
3683 AC_CHECK_HEADERS([wchar.h wctype.h])
3684 AC_LIBOBJ([fnmatch])
3686 AC_DEFINE(fnmatch, rpl_fnmatch,
3687 [Define to rpl_fnmatch if the replacement function should be used.])
3688 ])# _AC_LIBOBJ_FNMATCH
3691 # Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
3692 AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
3694 AC_REQUIRE([AC_HEADER_STDC])
3695 AC_CHECK_HEADERS_ONCE(string.h strings.h)
3699 AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
3702 _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix],
3703 [rm -f lib/fnmatch.h],
3704 [_AC_LIBOBJ_FNMATCH])
3705 if test $ac_cv_func_fnmatch_posix != yes; then
3706 gl_PREREQ_FNMATCH_EXTRA
3707 dnl We must choose a different name for our function, since on ELF systems
3708 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
3709 dnl compiled into a shared library.
3710 AC_DEFINE([fnmatch], [posix_fnmatch],
3711 [Define to a replacement function name for fnmatch().])
3713 AC_SUBST([FNMATCH_H])
3717 AC_DEFUN([gl_FUNC_FNMATCH_GNU],
3719 dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
3720 AC_REQUIRE([AC_GNU_SOURCE])
3723 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
3724 [rm -f lib/fnmatch.h],
3725 [_AC_LIBOBJ_FNMATCH])
3726 if test $ac_cv_func_fnmatch_gnu != yes; then
3727 gl_PREREQ_FNMATCH_EXTRA
3728 dnl We must choose a different name for our function, since on ELF systems
3729 dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
3730 dnl compiled into a shared library.
3731 AC_DEFINE([fnmatch], [gnu_fnmatch],
3732 [Define to a replacement function name for fnmatch().])
3734 AC_SUBST([FNMATCH_H])
3739 dnl This macro is intended to be used solely in this file.
3740 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3741 AC_DEFUN([_jm_STRFTIME_PREREQS],
3743 dnl strftime.c uses the underyling system strftime if it exists.
3746 AC_CHECK_HEADERS_ONCE(limits.h)
3747 AC_CHECK_FUNCS_ONCE(memcpy mempcpy)
3748 AC_CHECK_FUNCS(tzset memset)
3750 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3753 AC_CHECK_FUNCS(mblen mbrlen)
3756 AC_REQUIRE([gl_TM_GMTOFF])
3757 AC_REQUIRE([gl_FUNC_TZSET_CLOBBER])
3760 dnl From Jim Meyering.
3762 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3763 [AC_REQUIRE([AC_HEADER_TIME])dnl
3765 _jm_STRFTIME_PREREQS
3767 AC_REQUIRE([AC_C_CONST])dnl
3768 AC_REQUIRE([AC_HEADER_STDC])dnl
3769 AC_CHECK_HEADERS_ONCE(sys/time.h)
3770 AC_DEFINE([my_strftime], [nstrftime],
3771 [Define to the name of the strftime replacement function.])
3774 AC_DEFUN([jm_FUNC_STRFTIME],
3776 _jm_STRFTIME_PREREQS
3779 # tm_gmtoff.m4 serial 1
3780 dnl Copyright (C) 2002 Free Software Foundation, Inc.
3781 dnl This file is free software, distributed under the terms of the GNU
3782 dnl General Public License. As a special exception to the GNU General
3783 dnl Public License, this file may be distributed as part of a program
3784 dnl that contains a configuration script generated by Autoconf, under
3785 dnl the same distribution terms as the rest of that program.
3787 AC_DEFUN([gl_TM_GMTOFF],
3789 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3790 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3791 [Define if struct tm has the tm_gmtoff member.])],
3793 [#include <time.h>])
3797 # See if we have a working tzset function.
3798 # If so, arrange to compile the wrapper function.
3799 # For at least Solaris 2.5.1 and 2.6, this is necessary
3800 # because tzset can clobber the contents of the buffer
3801 # used by localtime.
3803 # Written by Paul Eggert and Jim Meyering.
3805 AC_DEFUN([gl_FUNC_TZSET_CLOBBER],
3807 AC_REQUIRE([AC_HEADER_TIME])
3808 AC_CACHE_CHECK([whether tzset clobbers localtime buffer],
3809 gl_cv_func_tzset_clobber,
3811 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3812 #if TIME_WITH_SYS_TIME
3813 # include <sys/time.h>
3816 # if HAVE_SYS_TIME_H
3817 # include <sys/time.h>
3827 time_t t1 = 853958121;
3830 p = localtime (&t1);
3832 putenv ("TZ=EST+3EDT+2,M10.1.0/00:00:00,M2.3.0/00:00:00");
3834 exit (p->tm_year != s.tm_year
3835 || p->tm_mon != s.tm_mon
3836 || p->tm_mday != s.tm_mday
3837 || p->tm_hour != s.tm_hour
3838 || p->tm_min != s.tm_min
3839 || p->tm_sec != s.tm_sec);
3842 [gl_cv_func_tzset_clobber=no],
3843 [gl_cv_func_tzset_clobber=yes],
3844 [gl_cv_func_tzset_clobber=yes])])
3846 AC_DEFINE(HAVE_RUN_TZSET_TEST, 1,
3847 [Define to 1 if you have run the test for working tzset.])
3849 if test $gl_cv_func_tzset_clobber = yes; then
3850 # Caution: the following few lines should be the same
3851 # as those in gettimeofday.m4.
3852 AC_LIBOBJ(gettimeofday)
3853 AC_DEFINE(gmtime, rpl_gmtime,
3854 [Define to rpl_gmtime if the replacement function should be used.])
3855 AC_DEFINE(localtime, rpl_localtime,
3856 [Define to rpl_localtime if the replacement function should be used.])
3858 AC_DEFINE(tzset, rpl_tzset,
3859 [Define to rpl_tzset if the wrapper function should be used.])
3860 AC_DEFINE(TZSET_CLOBBERS_LOCALTIME_BUFFER, 1,
3861 [Define if tzset clobbers localtime's static buffer.])
3867 dnl From Jim Meyering
3868 dnl Using code from emacs, based on suggestions from Paul Eggert
3869 dnl and Ulrich Drepper.
3871 dnl Find out how to determine the number of pending output bytes on a stream.
3872 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3873 dnl we have to grub around in the FILE struct.
3875 AC_DEFUN([jm_FUNC_FPENDING],
3877 AC_CHECK_HEADERS(stdio_ext.h)
3878 AC_REPLACE_FUNCS([__fpending])
3880 # if HAVE_STDIO_EXT_H
3881 # include <stdio_ext.h>
3884 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3885 if test $ac_cv_func___fpending = no; then
3887 [how to determine the number of pending output bytes on a stream],
3888 ac_cv_sys_pending_output_n_bytes,
3893 'fp->_IO_write_ptr - fp->_IO_write_base' \
3895 '# traditional Unix' \
3896 'fp->_ptr - fp->_base' \
3899 'fp->_p - fp->_bf._base' \
3902 'fp->__ptr - fp->__base' \
3905 'fp->__bufp - fp->__buffer' \
3907 '# old glibc iostream?' \
3908 'fp->_pptr - fp->_pbase' \
3911 '(*fp)->_ptr - (*fp)->_base' \
3913 '# e.g., DGUX R4.11; the info is not available' \
3917 # Skip each embedded comment.
3918 case "$ac_expr" in '#'*) continue;; esac
3923 [FILE *fp = stdin; (void) ($ac_expr);],
3926 test "$fp_done" = yes && break
3929 ac_cv_sys_pending_output_n_bytes=$ac_expr
3932 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3933 $ac_cv_sys_pending_output_n_bytes,
3934 [the number of pending output bytes on stream `fp'])
3938 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3939 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3940 dnl This file is free software, distributed under the terms of the GNU
3941 dnl General Public License. As a special exception to the GNU General
3942 dnl Public License, this file may be distributed as part of a program
3943 dnl that contains a configuration script generated by Autoconf, under
3944 dnl the same distribution terms as the rest of that program.
3946 dnl From Bruno Haible.
3948 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3949 # macros to non-string values. This is the case on AIX 4.3.3.
3951 AC_DEFUN([gt_INTTYPES_PRI],
3953 # autoconf-2.52 has a proper check for inttypes.h.
3956 if test $ac_cv_header_inttypes_h = yes; then
3957 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3958 gt_cv_inttypes_pri_broken,
3960 AC_TRY_COMPILE([#include <inttypes.h>
3964 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3967 if test "$gt_cv_inttypes_pri_broken" = yes; then
3968 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3969 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3975 dnl From Jim Meyering.
3976 dnl A wrapper around AC_FUNC_GETGROUPS.
3978 AC_DEFUN([jm_FUNC_GETGROUPS],
3979 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
3980 if test $ac_cv_func_getgroups_works = no; then
3981 AC_LIBOBJ(getgroups)
3982 AC_DEFINE(getgroups, rpl_getgroups,
3983 [Define as rpl_getgroups if getgroups doesn't work right.])
3985 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3988 # alloca.m4 serial 2 (gettext-0.12)
3989 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
3990 dnl This file is free software, distributed under the terms of the GNU
3991 dnl General Public License. As a special exception to the GNU General
3992 dnl Public License, this file may be distributed as part of a program
3993 dnl that contains a configuration script generated by Autoconf, under
3994 dnl the same distribution terms as the rest of that program.
3996 AC_DEFUN([gl_FUNC_ALLOCA],
3998 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
3999 AC_REQUIRE([AC_PROG_CPP])
4000 AC_REQUIRE([AC_PROG_EGREP])
4002 AC_REQUIRE([AC_FUNC_ALLOCA])
4003 if test $ac_cv_func_alloca_works = no; then
4007 # Define an additional variable used in the Makefile substitution.
4009 AC_EGREP_CPP([Need own alloca], [
4010 #if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
4016 AC_SUBST([ALLOCA_H])
4019 # Prerequisites of lib/alloca.c.
4020 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
4021 AC_DEFUN([gl_PREREQ_ALLOCA], [
4022 AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
4029 AC_DEFUN([jm_SYS_PROC_UPTIME],
4030 [ dnl Require AC_PROG_CC to see if we're cross compiling.
4031 AC_REQUIRE([AC_PROG_CC])
4032 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
4033 [jm_cv_have_proc_uptime=no
4034 test -f /proc/uptime \
4035 && test "$cross_compiling" = no \
4036 && cat < /proc/uptime >/dev/null 2>/dev/null \
4037 && jm_cv_have_proc_uptime=yes])
4038 if test $jm_cv_have_proc_uptime = yes; then
4039 AC_DEFINE(HAVE_PROC_UPTIME, 1,
4040 [ Define if your system has the /proc/uptime special file.])
4046 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
4048 AC_DEFUN([jm_FUNC_FTRUNCATE],
4050 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
4052 if test "$ftruncate_missing" = yes; then
4053 AC_CHECK_HEADERS([unistd.h])
4054 AC_CHECK_FUNCS([chsize])
4055 AC_LIBOBJ(ftruncate)
4061 dnl From Volker Borchert.
4062 dnl Determine whether rename works for source paths with a trailing slash.
4063 dnl The rename from SunOS 4.1.1_U1 doesn't.
4065 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
4066 dnl to compile the wrapper function.
4069 AC_DEFUN([vb_FUNC_RENAME],
4071 AC_CACHE_CHECK([whether rename is broken],
4072 vb_cv_func_rename_trailing_slash_bug,
4074 rm -rf conftest.d1 conftest.d2
4075 mkdir conftest.d1 ||
4076 AC_MSG_ERROR([cannot create temporary directory])
4082 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
4085 vb_cv_func_rename_trailing_slash_bug=no,
4086 vb_cv_func_rename_trailing_slash_bug=yes,
4087 dnl When crosscompiling, assume rename is broken.
4088 vb_cv_func_rename_trailing_slash_bug=yes)
4090 rm -rf conftest.d1 conftest.d2
4092 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
4094 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
4095 [Define if rename does not work for source paths with a trailing slash,
4096 like the one from SunOS 4.1.1_U1.])
4102 # On some hosts (e.g., HP-UX 10.20, SunOS 4.1.4, Solaris 2.5.1), mkstemp has a
4103 # silly limit that it can create no more than 26 files from a given template.
4104 # Other systems lack mkstemp altogether. On either type of system, arrange
4105 # to use the replacement function.
4106 AC_DEFUN([UTILS_FUNC_MKSTEMP],
4108 AC_REPLACE_FUNCS(mkstemp)
4109 if test $ac_cv_func_mkstemp = no; then
4110 utils_cv_func_mkstemp_limitations=yes
4112 AC_CACHE_CHECK([for mkstemp limitations],
4113 utils_cv_func_mkstemp_limitations,
4116 # include <stdlib.h>
4120 for (i = 0; i < 30; i++)
4122 char template[] = "conftestXXXXXX";
4123 int fd = mkstemp (template);
4131 utils_cv_func_mkstemp_limitations=no,
4132 utils_cv_func_mkstemp_limitations=yes,
4133 utils_cv_func_mkstemp_limitations=yes
4139 if test $utils_cv_func_mkstemp_limitations = yes; then
4142 AC_DEFINE(mkstemp, rpl_mkstemp,
4143 [Define to rpl_mkstemp if the replacement function should be used.])
4149 dnl From Jim Meyering.
4151 dnl See if gettimeofday clobbers the static buffer that localtime uses
4152 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
4153 dnl i.e. Darwin 1.3.7 has this problem.
4155 dnl If it does, then arrange to use gettimeofday and localtime only via
4156 dnl the wrapper functions that work around the problem.
4158 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
4160 AC_REQUIRE([AC_HEADER_TIME])
4161 AC_CHECK_HEADERS(string.h stdlib.h)
4162 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
4163 jm_cv_func_gettimeofday_clobber,
4167 # include <string.h>
4170 #if TIME_WITH_SYS_TIME
4171 # include <sys/time.h>
4174 # if HAVE_SYS_TIME_H
4175 # include <sys/time.h>
4182 # include <stdlib.h>
4192 lt = localtime (&t);
4194 gettimeofday (&tv, NULL);
4195 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
4201 jm_cv_func_gettimeofday_clobber=no,
4202 jm_cv_func_gettimeofday_clobber=yes,
4203 dnl When crosscompiling, assume it is broken.
4204 jm_cv_func_gettimeofday_clobber=yes)
4206 if test $jm_cv_func_gettimeofday_clobber = yes; then
4207 # Caution: the following few lines should be the same
4208 # as those in gettimeofday.m4.
4209 AC_LIBOBJ(gettimeofday)
4210 AC_DEFINE(gmtime, rpl_gmtime,
4211 [Define to rpl_gmtime if the replacement function should be used.])
4212 AC_DEFINE(localtime, rpl_localtime,
4213 [Define to rpl_localtime if the replacement function should be used.])
4215 AC_DEFINE(gettimeofday, rpl_gettimeofday,
4216 [Define to rpl_gettimeofday if the replacement function should be used.])
4217 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
4218 [Define if gettimeofday clobbers localtime's static buffer.])
4224 dnl From Jim Meyering
4225 dnl Replace the utime function on systems that need it.
4229 AC_DEFUN([jm_FUNC_UTIME],
4231 AC_CHECK_HEADERS(utime.h)
4232 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
4233 AC_REQUIRE([AC_FUNC_UTIME_NULL])
4235 if test $ac_cv_func_utime_null = no; then
4237 AC_REPLACE_FUNCS(utime)
4243 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
4244 dnl then do case-insensitive s/utime/utimes/.
4246 AC_DEFUN([jm_FUNC_UTIMES_NULL],
4247 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
4248 [rm -f conftest.data; > conftest.data
4250 /* In case stat has been defined to rpl_stat, undef it here. */
4252 #include <sys/types.h>
4253 #include <sys/stat.h>
4256 exit(!(stat ("conftest.data", &s) == 0
4257 && utimes("conftest.data", (long *)0) == 0
4258 && stat("conftest.data", &t) == 0
4259 && t.st_mtime >= s.st_mtime
4260 && t.st_mtime - s.st_mtime < 120));
4262 ac_cv_func_utimes_null=yes,
4263 ac_cv_func_utimes_null=no,
4264 ac_cv_func_utimes_null=no)
4265 rm -f core core.* *.core])
4267 if test $ac_cv_func_utimes_null = yes; then
4268 AC_DEFINE(HAVE_UTIMES_NULL, 1,
4269 [Define if utimes accepts a null argument])
4274 # vasprintf.m4 serial 1
4275 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4276 dnl This file is free software, distributed under the terms of the GNU
4277 dnl General Public License. As a special exception to the GNU General
4278 dnl Public License, this file may be distributed as part of a program
4279 dnl that contains a configuration script generated by Autoconf, under
4280 dnl the same distribution terms as the rest of that program.
4282 AC_DEFUN([gl_FUNC_VASPRINTF],
4284 AC_REPLACE_FUNCS(vasprintf)
4285 if test $ac_cv_func_vasprintf = no; then
4292 # Prerequisites of lib/vasprintf.c.
4293 AC_DEFUN([gl_PREREQ_VASPRINTF],
4297 # Prerequisites of lib/asprintf.c.
4298 AC_DEFUN([gl_PREREQ_ASPRINTF],
4302 # vasnprintf.m4 serial 1
4303 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4304 dnl This file is free software, distributed under the terms of the GNU
4305 dnl General Public License. As a special exception to the GNU General
4306 dnl Public License, this file may be distributed as part of a program
4307 dnl that contains a configuration script generated by Autoconf, under
4308 dnl the same distribution terms as the rest of that program.
4310 AC_DEFUN([gl_FUNC_VASNPRINTF],
4312 AC_REPLACE_FUNCS(vasnprintf)
4313 if test $ac_cv_func_vasnprintf = no; then
4314 AC_LIBOBJ(printf-args)
4315 AC_LIBOBJ(printf-parse)
4316 AC_LIBOBJ(asnprintf)
4317 gl_PREREQ_PRINTF_ARGS
4318 gl_PREREQ_PRINTF_PARSE
4319 gl_PREREQ_VASNPRINTF
4324 # Prequisites of lib/printf-args.h, lib/printf-args.c.
4325 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
4327 AC_REQUIRE([bh_C_SIGNED])
4328 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4329 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4330 AC_REQUIRE([gt_TYPE_WCHAR_T])
4331 AC_REQUIRE([gt_TYPE_WINT_T])
4334 # Prequisites of lib/printf-parse.h, lib/printf-parse.c.
4335 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
4337 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4338 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4339 AC_REQUIRE([gt_TYPE_WCHAR_T])
4340 AC_REQUIRE([gt_TYPE_WINT_T])
4341 AC_REQUIRE([AC_TYPE_SIZE_T])
4342 AC_CHECK_TYPES(ptrdiff_t)
4343 AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
4346 # Prerequisites of lib/vasnprintf.c.
4347 AC_DEFUN([gl_PREREQ_VASNPRINTF],
4349 AC_REQUIRE([AC_FUNC_ALLOCA])
4350 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
4351 AC_REQUIRE([gt_TYPE_LONGDOUBLE])
4352 AC_REQUIRE([gt_TYPE_WCHAR_T])
4353 AC_REQUIRE([gt_TYPE_WINT_T])
4354 AC_CHECK_FUNCS(snprintf)
4357 # Prerequisites of lib/asnprintf.c.
4358 AC_DEFUN([gl_PREREQ_ASNPRINTF],
4362 # signed.m4 serial 1 (gettext-0.10.40)
4363 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4364 dnl This file is free software, distributed under the terms of the GNU
4365 dnl General Public License. As a special exception to the GNU General
4366 dnl Public License, this file may be distributed as part of a program
4367 dnl that contains a configuration script generated by Autoconf, under
4368 dnl the same distribution terms as the rest of that program.
4370 dnl From Bruno Haible.
4372 AC_DEFUN([bh_C_SIGNED],
4374 AC_CACHE_CHECK([for signed], bh_cv_c_signed,
4375 [AC_TRY_COMPILE(, [signed char x;], bh_cv_c_signed=yes, bh_cv_c_signed=no)])
4376 if test $bh_cv_c_signed = no; then
4378 [Define to empty if the C compiler doesn't support this keyword.])
4382 # longdouble.m4 serial 1 (gettext-0.12)
4383 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4384 dnl This file is free software, distributed under the terms of the GNU
4385 dnl General Public License. As a special exception to the GNU General
4386 dnl Public License, this file may be distributed as part of a program
4387 dnl that contains a configuration script generated by Autoconf, under
4388 dnl the same distribution terms as the rest of that program.
4390 dnl From Bruno Haible.
4391 dnl Test whether the compiler supports the 'long double' type.
4392 dnl Prerequisite: AC_PROG_CC
4394 AC_DEFUN([gt_TYPE_LONGDOUBLE],
4396 AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
4397 [if test "$GCC" = yes; then
4398 gt_cv_c_long_double=yes
4401 /* The Stardent Vistra knows sizeof(long double), but does not support it. */
4402 long double foo = 0.0;
4403 /* On Ultrix 4.3 cc, long double is 4 and double is 8. */
4404 int array [2*(sizeof(long double) >= sizeof(double)) - 1];
4406 gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
4408 if test $gt_cv_c_long_double = yes; then
4409 AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
4413 # wchar_t.m4 serial 1 (gettext-0.12)
4414 dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
4415 dnl This file is free software, distributed under the terms of the GNU
4416 dnl General Public License. As a special exception to the GNU General
4417 dnl Public License, this file may be distributed as part of a program
4418 dnl that contains a configuration script generated by Autoconf, under
4419 dnl the same distribution terms as the rest of that program.
4421 dnl From Bruno Haible.
4422 dnl Test whether <stddef.h> has the 'wchar_t' type.
4423 dnl Prerequisite: AC_PROG_CC
4425 AC_DEFUN([gt_TYPE_WCHAR_T],
4427 AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
4428 [AC_TRY_COMPILE([#include <stddef.h>
4429 wchar_t foo = (wchar_t)'\0';], ,
4430 gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
4431 if test $gt_cv_c_wchar_t = yes; then
4432 AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
4436 # wint_t.m4 serial 1 (gettext-0.12)
4437 dnl Copyright (C) 2003 Free Software Foundation, Inc.
4438 dnl This file is free software, distributed under the terms of the GNU
4439 dnl General Public License. As a special exception to the GNU General
4440 dnl Public License, this file may be distributed as part of a program
4441 dnl that contains a configuration script generated by Autoconf, under
4442 dnl the same distribution terms as the rest of that program.
4444 dnl From Bruno Haible.
4445 dnl Test whether <wchar.h> has the 'wint_t' type.
4446 dnl Prerequisite: AC_PROG_CC
4448 AC_DEFUN([gt_TYPE_WINT_T],
4450 AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
4451 [AC_TRY_COMPILE([#include <wchar.h>
4452 wint_t foo = (wchar_t)'\0';], ,
4453 gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
4454 if test $gt_cv_c_wint_t = yes; then
4455 AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
4461 dnl See if there's a working, system-supplied version of the getline function.
4462 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
4463 dnl have a function by that name in -linet that doesn't have anything
4464 dnl to do with the function we need.
4465 AC_DEFUN([AM_FUNC_GETLINE],
4467 am_getline_needs_run_time_check=no
4468 AC_CHECK_FUNC(getline,
4469 dnl Found it in some library. Verify that it works.
4470 am_getline_needs_run_time_check=yes,
4471 am_cv_func_working_getline=no)
4472 if test $am_getline_needs_run_time_check = yes; then
4473 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
4474 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
4477 # include <sys/types.h>
4478 # include <string.h>
4480 { /* Based on a test program from Karl Heuer. */
4484 FILE *in = fopen ("./conftest.data", "r");
4487 len = getline (&line, &siz, in);
4488 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
4490 ], am_cv_func_working_getline=yes dnl The library version works.
4491 , am_cv_func_working_getline=no dnl The library version does NOT work.
4492 , am_cv_func_working_getline=no dnl We're cross compiling.
4496 if test $am_cv_func_working_getline = no; then
4502 # Determine approximately how many files may be open simultaneously
4503 # in one process. This is approximate, since while running this test,
4504 # the configure script already has a few files open.
4507 AC_DEFUN([UTILS_SYS_OPEN_MAX],
4509 AC_CACHE_CHECK([determine how many files may be open simultaneously],
4510 utils_cv_sys_open_max,
4512 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4519 FILE *result = fopen ("conftest.omax", "w");
4521 /* Impose an arbitrary limit, in case some system has no
4522 effective limit on the number of simultaneously open files. */
4525 FILE *s = fopen ("conftest.op", "w");
4530 fprintf (result, "%d\n", i);
4531 exit (fclose (result) == EOF);
4534 [utils_cv_sys_open_max=`cat conftest.omax`],
4535 [utils_cv_sys_open_max='internal error in open-max.m4'],
4536 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
4538 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
4539 $utils_cv_sys_open_max,
4540 [the maximum number of simultaneously open files per process])
4544 # Check whether getcwd has the bug that it succeeds for a working directory
4545 # longer than PATH_MAX, yet returns a truncated directory name.
4546 # If so, arrange to compile the wrapper function.
4548 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
4549 # I've heard that this is due to a Linux kernel bug, and that it has
4550 # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */
4554 AC_DEFUN([GL_FUNC_GETCWD_PATH_MAX],
4556 AC_CHECK_DECLS([getcwd])
4557 AC_CACHE_CHECK([whether getcwd properly handles paths longer than PATH_MAX],
4558 gl_cv_func_getcwd_vs_path_max,
4560 # Arrange for deletion of the temporary directory this test creates.
4561 ac_clean_files="$ac_clean_files confdir3"
4562 AC_RUN_IFELSE([AC_LANG_SOURCE([[
4567 #include <sys/stat.h>
4568 #include <sys/types.h>
4570 /* Don't get link errors because mkdir is redefined to rpl_mkdir. */
4577 /* The extra casts work around common compiler bugs. */
4578 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
4579 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
4580 It is necessary at least when t == time_t. */
4581 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
4582 ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
4583 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
4586 # define INT_MAX TYPE_MAXIMUM (int)
4589 /* The length of this name must be 8. */
4590 #define DIR_NAME "confdir3"
4596 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
4597 at least not on a local file system. And if we were to start worrying
4598 about remote file systems, we'd have to enable the wrapper function
4599 all of the time, just to be safe. That's not worth the cost. */
4601 #elif INT_MAX - 9 <= PATH_MAX
4602 /* The '9', above, comes from strlen (DIR_NAME) + 1. */
4603 /* FIXME: Assuming there's a system for which this is true,
4604 this should be done in a compile test. */
4607 char buf[PATH_MAX + 20];
4608 char *cwd = getcwd (buf, PATH_MAX);
4611 size_t n_chdirs = 0;
4616 cwd_len = strlen (cwd);
4623 cwd_len += 1 + strlen (DIR_NAME);
4624 /* If mkdir or chdir fails, be pessimistic and consider that
4625 as a failure, too. */
4626 if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0)
4631 if ((c = getcwd (buf, PATH_MAX)) == NULL)
4633 /* This allows any failure to indicate there is no bug.
4634 FIXME: check errno? */
4637 if ((len = strlen (c)) != cwd_len)
4647 /* Leaving behind such a deep directory is not polite.
4648 So clean up here, right away, even though the driving
4649 shell script would also clean up. */
4653 /* Unlink first, in case the chdir failed. */
4655 for (i = 0; i <= n_chdirs; i++)
4657 if (chdir ("..") < 0)
4667 [gl_cv_func_getcwd_vs_path_max=yes],
4668 [gl_cv_func_getcwd_vs_path_max=no],
4669 [gl_cv_func_getcwd_vs_path_max=no])])
4671 if test $gl_cv_func_getcwd_vs_path_max = yes; then
4673 AC_DEFINE(getcwd, rpl_getcwd,
4674 [Define to rpl_getcwd if the wrapper function should be used.])
4680 dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
4681 dnl to test whether a NULL return value really means there are no more files
4682 dnl in the directory.
4684 dnl And the rm from coreutils-5.0 exposes a similar problem when there
4685 dnl are 338 or more files in a directory on a Darwin-6.5 system
4687 dnl Detect the problem by creating a directory containing 500 files (254 not
4688 dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
4689 dnl if a loop doing `readdir; unlink' removes all of them.
4691 dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
4693 dnl Written by Jim Meyering.
4695 AC_DEFUN([GL_FUNC_READDIR],
4697 AC_REQUIRE([AC_HEADER_DIRENT])
4698 AC_CHECK_HEADERS(string.h)
4699 AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
4701 # Arrange for deletion of the temporary directory this test creates, in
4702 # case the test itself fails to delete everything -- as happens on Sunos.
4703 ac_clean_files="$ac_clean_files conf-dir"
4706 [# include <stdio.h>
4707 # include <sys/types.h>
4709 # include <string.h>
4712 # ifdef HAVE_DIRENT_H
4713 # include <dirent.h>
4714 # define NLENGTH(direct) (strlen((direct)->d_name))
4715 # else /* not HAVE_DIRENT_H */
4716 # define dirent direct
4717 # define NLENGTH(direct) ((direct)->d_namlen)
4718 # ifdef HAVE_SYS_NDIR_H
4719 # include <sys/ndir.h>
4720 # endif /* HAVE_SYS_NDIR_H */
4721 # ifdef HAVE_SYS_DIR_H
4722 # include <sys/dir.h>
4723 # endif /* HAVE_SYS_DIR_H */
4726 # endif /* HAVE_NDIR_H */
4727 # endif /* HAVE_DIRENT_H */
4729 # define DOT_OR_DOTDOT(Basename) \
4730 (Basename[0] == '.' && (Basename[1] == '\0' \
4731 || (Basename[1] == '.' && Basename[2] == '\0')))
4733 /* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
4737 create_N_file_dir (const char *dir, size_t n_files)
4741 if (mkdir (dir, 0700))
4746 for (i = 0; i < n_files; i++)
4751 sprintf (file_name, "%03d", i);
4752 out = fopen (file_name, "w");
4755 if (fclose (out) == EOF)
4764 remove_dir (const char *dir)
4771 dirp = opendir (".");
4777 struct dirent *dp = readdir (dirp);
4781 if (DOT_OR_DOTDOT (dp->d_name))
4784 if (unlink (dp->d_name))
4799 const char *dir = "conf-dir";
4800 create_N_file_dir (dir, 500);
4804 gl_cv_func_working_readdir=yes,
4805 gl_cv_func_working_readdir=no,
4806 gl_cv_func_working_readdir=no)])
4808 if test $gl_cv_func_working_readdir = yes; then
4809 AC_DEFINE(HAVE_WORKING_READDIR, 1,
4810 [Define if readdir is found to work properly in some unusual cases. ])
4814 # codeset.m4 serial AM1 (gettext-0.10.40)
4815 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4816 dnl This file is free software, distributed under the terms of the GNU
4817 dnl General Public License. As a special exception to the GNU General
4818 dnl Public License, this file may be distributed as part of a program
4819 dnl that contains a configuration script generated by Autoconf, under
4820 dnl the same distribution terms as the rest of that program.
4822 dnl From Bruno Haible.
4824 AC_DEFUN([AM_LANGINFO_CODESET],
4826 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
4827 [AC_TRY_LINK([#include <langinfo.h>],
4828 [char* cs = nl_langinfo(CODESET);],
4829 am_cv_langinfo_codeset=yes,
4830 am_cv_langinfo_codeset=no)
4832 if test $am_cv_langinfo_codeset = yes; then
4833 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
4834 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
4838 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
4839 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4840 dnl This file is free software, distributed under the terms of the GNU
4841 dnl General Public License. As a special exception to the GNU General
4842 dnl Public License, this file may be distributed as part of a program
4843 dnl that contains a configuration script generated by Autoconf, under
4844 dnl the same distribution terms as the rest of that program.
4846 # Test for the GNU C Library, version 2.1 or newer.
4847 # From Bruno Haible.
4849 AC_DEFUN([jm_GLIBC21],
4851 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
4852 ac_cv_gnu_library_2_1,
4853 [AC_EGREP_CPP([Lucky GNU user],
4855 #include <features.h>
4856 #ifdef __GNU_LIBRARY__
4857 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
4862 ac_cv_gnu_library_2_1=yes,
4863 ac_cv_gnu_library_2_1=no)
4867 GLIBC21="$ac_cv_gnu_library_2_1"
4871 # iconv.m4 serial AM4 (gettext-0.11.3)
4872 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4873 dnl This file is free software, distributed under the terms of the GNU
4874 dnl General Public License. As a special exception to the GNU General
4875 dnl Public License, this file may be distributed as part of a program
4876 dnl that contains a configuration script generated by Autoconf, under
4877 dnl the same distribution terms as the rest of that program.
4879 dnl From Bruno Haible.
4881 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4883 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4884 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4885 AC_REQUIRE([AC_LIB_RPATH])
4887 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4889 AC_LIB_LINKFLAGS_BODY([iconv])
4892 AC_DEFUN([AM_ICONV_LINK],
4894 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4895 dnl those with the standalone portable GNU libiconv installed).
4897 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4899 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4901 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4902 dnl because if the user has installed libiconv and not disabled its use
4903 dnl via --without-libiconv-prefix, he wants to use it. The first
4904 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4905 am_save_CPPFLAGS="$CPPFLAGS"
4906 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4908 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4909 am_cv_func_iconv="no, consider installing GNU libiconv"
4911 AC_TRY_LINK([#include <stdlib.h>
4912 #include <iconv.h>],
4913 [iconv_t cd = iconv_open("","");
4914 iconv(cd,NULL,NULL,NULL,NULL);
4916 am_cv_func_iconv=yes)
4917 if test "$am_cv_func_iconv" != yes; then
4918 am_save_LIBS="$LIBS"
4919 LIBS="$LIBS $LIBICONV"
4920 AC_TRY_LINK([#include <stdlib.h>
4921 #include <iconv.h>],
4922 [iconv_t cd = iconv_open("","");
4923 iconv(cd,NULL,NULL,NULL,NULL);
4926 am_cv_func_iconv=yes)
4927 LIBS="$am_save_LIBS"
4930 if test "$am_cv_func_iconv" = yes; then
4931 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4933 if test "$am_cv_lib_iconv" = yes; then
4934 AC_MSG_CHECKING([how to link with libiconv])
4935 AC_MSG_RESULT([$LIBICONV])
4937 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4939 CPPFLAGS="$am_save_CPPFLAGS"
4944 AC_SUBST(LTLIBICONV)
4947 AC_DEFUN([AM_ICONV],
4950 if test "$am_cv_func_iconv" = yes; then
4951 AC_MSG_CHECKING([for iconv declaration])
4952 AC_CACHE_VAL(am_cv_proto_iconv, [
4960 #if defined(__STDC__) || defined(__cplusplus)
4961 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4965 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4966 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);"])
4967 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4968 AC_MSG_RESULT([$]{ac_t:-
4969 }[$]am_cv_proto_iconv)
4970 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4971 [Define as const if the declaration of iconv() needs const.])
4975 # lib-prefix.m4 serial 1 (gettext-0.11)
4976 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4977 dnl This file is free software, distributed under the terms of the GNU
4978 dnl General Public License. As a special exception to the GNU General
4979 dnl Public License, this file may be distributed as part of a program
4980 dnl that contains a configuration script generated by Autoconf, under
4981 dnl the same distribution terms as the rest of that program.
4983 dnl From Bruno Haible.
4985 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
4986 dnl to access previously installed libraries. The basic assumption is that
4987 dnl a user will want packages to use other packages he previously installed
4988 dnl with the same --prefix option.
4989 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
4990 dnl libraries, but is otherwise very convenient.
4991 AC_DEFUN([AC_LIB_PREFIX],
4993 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4994 AC_REQUIRE([AC_PROG_CC])
4995 AC_REQUIRE([AC_CANONICAL_HOST])
4996 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4997 dnl By default, look in $includedir and $libdir.
4999 AC_LIB_WITH_FINAL_PREFIX([
5000 eval additional_includedir=\"$includedir\"
5001 eval additional_libdir=\"$libdir\"
5003 AC_ARG_WITH([lib-prefix],
5004 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
5005 --without-lib-prefix don't search for libraries in includedir and libdir],
5007 if test "X$withval" = "Xno"; then
5010 if test "X$withval" = "X"; then
5011 AC_LIB_WITH_FINAL_PREFIX([
5012 eval additional_includedir=\"$includedir\"
5013 eval additional_libdir=\"$libdir\"
5016 additional_includedir="$withval/include"
5017 additional_libdir="$withval/lib"
5021 if test $use_additional = yes; then
5022 dnl Potentially add $additional_includedir to $CPPFLAGS.
5023 dnl But don't add it
5024 dnl 1. if it's the standard /usr/include,
5025 dnl 2. if it's already present in $CPPFLAGS,
5026 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
5027 dnl 4. if it doesn't exist as a directory.
5028 if test "X$additional_includedir" != "X/usr/include"; then
5030 for x in $CPPFLAGS; do
5031 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5032 if test "X$x" = "X-I$additional_includedir"; then
5037 if test -z "$haveit"; then
5038 if test "X$additional_includedir" = "X/usr/local/include"; then
5039 if test -n "$GCC"; then
5041 linux*) haveit=yes;;
5045 if test -z "$haveit"; then
5046 if test -d "$additional_includedir"; then
5047 dnl Really add $additional_includedir to $CPPFLAGS.
5048 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
5053 dnl Potentially add $additional_libdir to $LDFLAGS.
5054 dnl But don't add it
5055 dnl 1. if it's the standard /usr/lib,
5056 dnl 2. if it's already present in $LDFLAGS,
5057 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
5058 dnl 4. if it doesn't exist as a directory.
5059 if test "X$additional_libdir" != "X/usr/lib"; then
5061 for x in $LDFLAGS; do
5062 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5063 if test "X$x" = "X-L$additional_libdir"; then
5068 if test -z "$haveit"; then
5069 if test "X$additional_libdir" = "X/usr/local/lib"; then
5070 if test -n "$GCC"; then
5072 linux*) haveit=yes;;
5076 if test -z "$haveit"; then
5077 if test -d "$additional_libdir"; then
5078 dnl Really add $additional_libdir to $LDFLAGS.
5079 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
5087 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
5088 dnl acl_final_exec_prefix, containing the values to which $prefix and
5089 dnl $exec_prefix will expand at the end of the configure script.
5090 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
5092 dnl Unfortunately, prefix and exec_prefix get only finally determined
5093 dnl at the end of configure.
5094 if test "X$prefix" = "XNONE"; then
5095 acl_final_prefix="$ac_default_prefix"
5097 acl_final_prefix="$prefix"
5099 if test "X$exec_prefix" = "XNONE"; then
5100 acl_final_exec_prefix='${prefix}'
5102 acl_final_exec_prefix="$exec_prefix"
5104 acl_save_prefix="$prefix"
5105 prefix="$acl_final_prefix"
5106 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
5107 prefix="$acl_save_prefix"
5110 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
5111 dnl variables prefix and exec_prefix bound to the values they will have
5112 dnl at the end of the configure script.
5113 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
5115 acl_save_prefix="$prefix"
5116 prefix="$acl_final_prefix"
5117 acl_save_exec_prefix="$exec_prefix"
5118 exec_prefix="$acl_final_exec_prefix"
5120 exec_prefix="$acl_save_exec_prefix"
5121 prefix="$acl_save_prefix"
5124 # lib-link.m4 serial 3 (gettext-0.11.3)
5125 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
5126 dnl This file is free software, distributed under the terms of the GNU
5127 dnl General Public License. As a special exception to the GNU General
5128 dnl Public License, this file may be distributed as part of a program
5129 dnl that contains a configuration script generated by Autoconf, under
5130 dnl the same distribution terms as the rest of that program.
5132 dnl From Bruno Haible.
5134 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
5135 dnl the libraries corresponding to explicit and implicit dependencies.
5136 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
5137 dnl augments the CPPFLAGS variable.
5138 AC_DEFUN([AC_LIB_LINKFLAGS],
5140 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5141 AC_REQUIRE([AC_LIB_RPATH])
5142 define([Name],[translit([$1],[./-], [___])])
5143 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5144 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5145 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
5146 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5147 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
5148 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
5149 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
5151 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
5152 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
5153 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
5154 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5156 AC_SUBST([LTLIB]NAME)
5157 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
5158 dnl results of this search when this library appears as a dependency.
5164 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
5165 dnl searches for libname and the libraries corresponding to explicit and
5166 dnl implicit dependencies, together with the specified include files and
5167 dnl the ability to compile and link the specified testcode. If found, it
5168 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
5169 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
5170 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
5171 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
5172 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
5174 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5175 AC_REQUIRE([AC_LIB_RPATH])
5176 define([Name],[translit([$1],[./-], [___])])
5177 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5178 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5180 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
5182 AC_LIB_LINKFLAGS_BODY([$1], [$2])
5184 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
5185 dnl because if the user has installed lib[]Name and not disabled its use
5186 dnl via --without-lib[]Name-prefix, he wants to use it.
5187 ac_save_CPPFLAGS="$CPPFLAGS"
5188 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
5190 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
5191 ac_save_LIBS="$LIBS"
5192 LIBS="$LIBS $LIB[]NAME"
5193 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
5194 LIBS="$ac_save_LIBS"
5196 if test "$ac_cv_lib[]Name" = yes; then
5198 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
5199 AC_MSG_CHECKING([how to link with lib[]$1])
5200 AC_MSG_RESULT([$LIB[]NAME])
5203 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
5204 dnl $INC[]NAME either.
5205 CPPFLAGS="$ac_save_CPPFLAGS"
5209 AC_SUBST([HAVE_LIB]NAME)
5211 AC_SUBST([LTLIB]NAME)
5216 dnl Determine the platform dependent parameters needed to use rpath:
5217 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
5218 dnl hardcode_direct, hardcode_minus_L,
5219 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
5220 AC_DEFUN([AC_LIB_RPATH],
5222 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
5223 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
5224 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
5225 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
5226 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
5227 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
5228 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
5234 libext="$acl_cv_libext"
5235 shlibext="$acl_cv_shlibext"
5236 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
5237 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
5238 hardcode_direct="$acl_cv_hardcode_direct"
5239 hardcode_minus_L="$acl_cv_hardcode_minus_L"
5240 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
5241 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
5242 dnl Determine whether the user wants rpath handling at all.
5243 AC_ARG_ENABLE(rpath,
5244 [ --disable-rpath do not hardcode runtime library paths],
5245 :, enable_rpath=yes)
5248 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
5249 dnl the libraries corresponding to explicit and implicit dependencies.
5250 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
5251 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
5253 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
5254 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
5255 dnl By default, look in $includedir and $libdir.
5257 AC_LIB_WITH_FINAL_PREFIX([
5258 eval additional_includedir=\"$includedir\"
5259 eval additional_libdir=\"$libdir\"
5261 AC_ARG_WITH([lib$1-prefix],
5262 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
5263 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
5265 if test "X$withval" = "Xno"; then
5268 if test "X$withval" = "X"; then
5269 AC_LIB_WITH_FINAL_PREFIX([
5270 eval additional_includedir=\"$includedir\"
5271 eval additional_libdir=\"$libdir\"
5274 additional_includedir="$withval/include"
5275 additional_libdir="$withval/lib"
5279 dnl Search the library and its dependencies in $additional_libdir and
5280 dnl $LDFLAGS. Using breadth-first-seach.
5286 names_already_handled=
5287 names_next_round='$1 $2'
5288 while test -n "$names_next_round"; do
5289 names_this_round="$names_next_round"
5291 for name in $names_this_round; do
5293 for n in $names_already_handled; do
5294 if test "$n" = "$name"; then
5299 if test -z "$already_handled"; then
5300 names_already_handled="$names_already_handled $name"
5301 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
5302 dnl or AC_LIB_HAVE_LINKFLAGS call.
5303 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
5304 eval value=\"\$HAVE_LIB$uppername\"
5305 if test -n "$value"; then
5306 if test "$value" = yes; then
5307 eval value=\"\$LIB$uppername\"
5308 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
5309 eval value=\"\$LTLIB$uppername\"
5310 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
5312 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
5313 dnl that this library doesn't exist. So just drop it.
5317 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
5318 dnl and the already constructed $LIBNAME/$LTLIBNAME.
5323 if test $use_additional = yes; then
5324 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
5325 found_dir="$additional_libdir"
5326 found_so="$additional_libdir/lib$name.$shlibext"
5327 if test -f "$additional_libdir/lib$name.la"; then
5328 found_la="$additional_libdir/lib$name.la"
5331 if test -f "$additional_libdir/lib$name.$libext"; then
5332 found_dir="$additional_libdir"
5333 found_a="$additional_libdir/lib$name.$libext"
5334 if test -f "$additional_libdir/lib$name.la"; then
5335 found_la="$additional_libdir/lib$name.la"
5340 if test "X$found_dir" = "X"; then
5341 for x in $LDFLAGS $LTLIB[]NAME; do
5342 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5345 dir=`echo "X$x" | sed -e 's/^X-L//'`
5346 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
5348 found_so="$dir/lib$name.$shlibext"
5349 if test -f "$dir/lib$name.la"; then
5350 found_la="$dir/lib$name.la"
5353 if test -f "$dir/lib$name.$libext"; then
5355 found_a="$dir/lib$name.$libext"
5356 if test -f "$dir/lib$name.la"; then
5357 found_la="$dir/lib$name.la"
5363 if test "X$found_dir" != "X"; then
5368 if test "X$found_dir" != "X"; then
5369 dnl Found the library.
5370 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
5371 if test "X$found_so" != "X"; then
5372 dnl Linking with a shared library. We attempt to hardcode its
5373 dnl directory into the executable's runpath, unless it's the
5374 dnl standard /usr/lib.
5375 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
5376 dnl No hardcoding is needed.
5377 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5379 dnl Use an explicit option to hardcode DIR into the resulting
5381 dnl Potentially add DIR to ltrpathdirs.
5382 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5384 for x in $ltrpathdirs; do
5385 if test "X$x" = "X$found_dir"; then
5390 if test -z "$haveit"; then
5391 ltrpathdirs="$ltrpathdirs $found_dir"
5393 dnl The hardcoding into $LIBNAME is system dependent.
5394 if test "$hardcode_direct" = yes; then
5395 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
5396 dnl resulting binary.
5397 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5399 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
5400 dnl Use an explicit option to hardcode DIR into the resulting
5402 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5403 dnl Potentially add DIR to rpathdirs.
5404 dnl The rpathdirs will be appended to $LIBNAME at the end.
5406 for x in $rpathdirs; do
5407 if test "X$x" = "X$found_dir"; then
5412 if test -z "$haveit"; then
5413 rpathdirs="$rpathdirs $found_dir"
5416 dnl Rely on "-L$found_dir".
5417 dnl But don't add it if it's already contained in the LDFLAGS
5418 dnl or the already constructed $LIBNAME
5420 for x in $LDFLAGS $LIB[]NAME; do
5421 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5422 if test "X$x" = "X-L$found_dir"; then
5427 if test -z "$haveit"; then
5428 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
5430 if test "$hardcode_minus_L" != no; then
5431 dnl FIXME: Not sure whether we should use
5432 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5434 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
5436 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
5437 dnl here, because this doesn't fit in flags passed to the
5438 dnl compiler. So give up. No hardcoding. This affects only
5439 dnl very old systems.
5440 dnl FIXME: Not sure whether we should use
5441 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
5443 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5449 if test "X$found_a" != "X"; then
5450 dnl Linking with a static library.
5451 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
5453 dnl We shouldn't come here, but anyway it's good to have a
5455 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
5458 dnl Assume the include files are nearby.
5459 additional_includedir=
5460 case "$found_dir" in
5462 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
5463 additional_includedir="$basedir/include"
5466 if test "X$additional_includedir" != "X"; then
5467 dnl Potentially add $additional_includedir to $INCNAME.
5468 dnl But don't add it
5469 dnl 1. if it's the standard /usr/include,
5470 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
5471 dnl 3. if it's already present in $CPPFLAGS or the already
5472 dnl constructed $INCNAME,
5473 dnl 4. if it doesn't exist as a directory.
5474 if test "X$additional_includedir" != "X/usr/include"; then
5476 if test "X$additional_includedir" = "X/usr/local/include"; then
5477 if test -n "$GCC"; then
5479 linux*) haveit=yes;;
5483 if test -z "$haveit"; then
5484 for x in $CPPFLAGS $INC[]NAME; do
5485 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5486 if test "X$x" = "X-I$additional_includedir"; then
5491 if test -z "$haveit"; then
5492 if test -d "$additional_includedir"; then
5493 dnl Really add $additional_includedir to $INCNAME.
5494 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
5500 dnl Look for dependencies.
5501 if test -n "$found_la"; then
5502 dnl Read the .la file. It defines the variables
5503 dnl dlname, library_names, old_library, dependency_libs, current,
5504 dnl age, revision, installed, dlopen, dlpreopen, libdir.
5505 save_libdir="$libdir"
5507 */* | *\\*) . "$found_la" ;;
5508 *) . "./$found_la" ;;
5510 libdir="$save_libdir"
5511 dnl We use only dependency_libs.
5512 for dep in $dependency_libs; do
5515 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
5516 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
5517 dnl But don't add it
5518 dnl 1. if it's the standard /usr/lib,
5519 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
5520 dnl 3. if it's already present in $LDFLAGS or the already
5521 dnl constructed $LIBNAME,
5522 dnl 4. if it doesn't exist as a directory.
5523 if test "X$additional_libdir" != "X/usr/lib"; then
5525 if test "X$additional_libdir" = "X/usr/local/lib"; then
5526 if test -n "$GCC"; then
5528 linux*) haveit=yes;;
5532 if test -z "$haveit"; then
5534 for x in $LDFLAGS $LIB[]NAME; do
5535 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5536 if test "X$x" = "X-L$additional_libdir"; then
5541 if test -z "$haveit"; then
5542 if test -d "$additional_libdir"; then
5543 dnl Really add $additional_libdir to $LIBNAME.
5544 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
5548 for x in $LDFLAGS $LTLIB[]NAME; do
5549 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5550 if test "X$x" = "X-L$additional_libdir"; then
5555 if test -z "$haveit"; then
5556 if test -d "$additional_libdir"; then
5557 dnl Really add $additional_libdir to $LTLIBNAME.
5558 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
5565 dir=`echo "X$dep" | sed -e 's/^X-R//'`
5566 if test "$enable_rpath" != no; then
5567 dnl Potentially add DIR to rpathdirs.
5568 dnl The rpathdirs will be appended to $LIBNAME at the end.
5570 for x in $rpathdirs; do
5571 if test "X$x" = "X$dir"; then
5576 if test -z "$haveit"; then
5577 rpathdirs="$rpathdirs $dir"
5579 dnl Potentially add DIR to ltrpathdirs.
5580 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
5582 for x in $ltrpathdirs; do
5583 if test "X$x" = "X$dir"; then
5588 if test -z "$haveit"; then
5589 ltrpathdirs="$ltrpathdirs $dir"
5594 dnl Handle this in the next round.
5595 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
5598 dnl Handle this in the next round. Throw away the .la's
5599 dnl directory; it is already contained in a preceding -L
5601 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
5604 dnl Most likely an immediate library name.
5605 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
5606 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
5612 dnl Didn't find the library; assume it is in the system directories
5613 dnl known to the linker and runtime loader. (All the system
5614 dnl directories known to the linker should also be known to the
5615 dnl runtime loader, otherwise the system is severely misconfigured.)
5616 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
5617 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
5623 if test "X$rpathdirs" != "X"; then
5624 if test -n "$hardcode_libdir_separator"; then
5625 dnl Weird platform: only the last -rpath option counts, the user must
5626 dnl pass all path elements in one option. We can arrange that for a
5627 dnl single library, but not when more than one $LIBNAMEs are used.
5629 for found_dir in $rpathdirs; do
5630 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
5632 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
5633 acl_save_libdir="$libdir"
5635 eval flag=\"$hardcode_libdir_flag_spec\"
5636 libdir="$acl_save_libdir"
5637 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5639 dnl The -rpath options are cumulative.
5640 for found_dir in $rpathdirs; do
5641 acl_save_libdir="$libdir"
5643 eval flag=\"$hardcode_libdir_flag_spec\"
5644 libdir="$acl_save_libdir"
5645 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
5649 if test "X$ltrpathdirs" != "X"; then
5650 dnl When using libtool, the option that works for both libraries and
5651 dnl executables is -R. The -R options are cumulative.
5652 for found_dir in $ltrpathdirs; do
5653 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
5658 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
5659 dnl unless already present in VAR.
5660 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
5661 dnl contains two or three consecutive elements that belong together.
5662 AC_DEFUN([AC_LIB_APPENDTOVAR],
5664 for element in [$2]; do
5667 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
5668 if test "X$x" = "X$element"; then
5673 if test -z "$haveit"; then
5674 [$1]="${[$1]}${[$1]:+ }$element"
5679 # lib-ld.m4 serial 2
5680 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
5681 dnl This file is free software, distributed under the terms of the GNU
5682 dnl General Public License. As a special exception to the GNU General
5683 dnl Public License, this file may be distributed as part of a program
5684 dnl that contains a configuration script generated by Autoconf, under
5685 dnl the same distribution terms as the rest of that program.
5687 dnl Subroutines of libtool.m4,
5688 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
5689 dnl with libtool.m4.
5691 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
5692 AC_DEFUN([AC_LIB_PROG_LD_GNU],
5693 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
5694 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
5695 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
5696 acl_cv_prog_gnu_ld=yes
5698 acl_cv_prog_gnu_ld=no
5700 with_gnu_ld=$acl_cv_prog_gnu_ld
5703 dnl From libtool-1.4. Sets the variable LD.
5704 AC_DEFUN([AC_LIB_PROG_LD],
5705 [AC_ARG_WITH(gnu-ld,
5706 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
5707 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
5708 AC_REQUIRE([AC_PROG_CC])dnl
5709 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5711 if test "$GCC" = yes; then
5712 # Check if gcc -print-prog-name=ld gives a path.
5713 AC_MSG_CHECKING([for ld used by GCC])
5716 # gcc leaves a trailing carriage return which upsets mingw
5717 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
5719 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
5722 # Accept absolute paths.
5723 [[\\/]* | [A-Za-z]:[\\/]*)]
5724 [re_direlt='/[^/][^/]*/\.\./']
5725 # Canonicalize the path of ld
5726 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
5727 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
5728 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
5730 test -z "$LD" && LD="$ac_prog"
5733 # If it fails, then pretend we aren't using GCC.
5737 # If it is relative, then search for the first ld in PATH.
5741 elif test "$with_gnu_ld" = yes; then
5742 AC_MSG_CHECKING([for GNU ld])
5744 AC_MSG_CHECKING([for non-GNU ld])
5746 AC_CACHE_VAL(acl_cv_path_LD,
5747 [if test -z "$LD"; then
5748 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
5749 for ac_dir in $PATH; do
5750 test -z "$ac_dir" && ac_dir=.
5751 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
5752 acl_cv_path_LD="$ac_dir/$ac_prog"
5753 # Check to see if the program is GNU ld. I'd rather use --version,
5754 # but apparently some GNU ld's only accept -v.
5755 # Break only if it was the GNU/non-GNU ld that we prefer.
5756 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
5757 test "$with_gnu_ld" != no && break
5759 test "$with_gnu_ld" != yes && break
5765 acl_cv_path_LD="$LD" # Let the user override the test with a path.
5767 LD="$acl_cv_path_LD"
5768 if test -n "$LD"; then
5773 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
5779 dnl From J. David Anglin.
5781 dnl HPUX and other systems can't unlink shared text that is being executed.
5783 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
5785 AC_CACHE_CHECK([whether a running program can be unlinked],
5786 jm_cv_func_unlink_busy_text,
5795 exit (unlink (argv[0]));
5798 jm_cv_func_unlink_busy_text=yes,
5799 jm_cv_func_unlink_busy_text=no,
5800 jm_cv_func_unlink_busy_text=no
5805 if test $jm_cv_func_unlink_busy_text = no; then
5806 INSTALL=$ac_install_sh
5812 dnl From Jim Meyering.
5814 dnl This is not pretty. I've just taken the autoconf code and wrapped
5815 dnl it in an AC_DEFUN.
5818 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5819 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
5821 AC_CHECK_FUNCS(listmntent getmntinfo)
5822 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
5823 getfsstat_includes="\
5824 $ac_includes_default
5825 #if HAVE_SYS_PARAM_H
5826 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
5828 #if HAVE_SYS_UCRED_H
5829 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
5831 #if HAVE_SYS_MOUNT_H
5832 # include <sys/mount.h>
5834 #if HAVE_SYS_FS_TYPES_H
5835 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
5838 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
5840 # Determine how to get the list of mounted filesystems.
5843 # If the getmntent function is available but not in the standard library,
5844 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
5847 # This test must precede the ones for getmntent because Unicos-9 is
5848 # reported to have the getmntent function, but its support is incompatible
5849 # with other getmntent implementations.
5851 # NOTE: Normally, I wouldn't use a check for system type as I've done for
5852 # `CRAY' below since that goes against the whole autoconf philosophy. But
5853 # I think there is too great a chance that some non-Cray system has a
5854 # function named listmntent to risk the false positive.
5856 if test -z "$ac_list_mounted_fs"; then
5858 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
5859 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
5860 [fu_cv_sys_mounted_cray_listmntent=no
5865 ], [test $ac_cv_func_listmntent = yes \
5866 && fu_cv_sys_mounted_cray_listmntent=yes]
5870 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
5871 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
5872 ac_list_mounted_fs=found
5873 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
5874 [Define if there is a function named listmntent that can be used to
5875 list all mounted filesystems. (UNICOS)])
5879 if test -z "$ac_list_mounted_fs"; then
5881 AC_MSG_CHECKING([for mntctl function and struct vmount])
5882 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
5883 [AC_TRY_CPP([#include <fshelp.h>],
5884 fu_cv_sys_mounted_vmount=yes,
5885 fu_cv_sys_mounted_vmount=no)])
5886 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
5887 if test $fu_cv_sys_mounted_vmount = yes; then
5888 ac_list_mounted_fs=found
5889 AC_DEFINE(MOUNTED_VMOUNT, 1,
5890 [Define if there is a function named mntctl that can be used to read
5891 the list of mounted filesystems, and there is a system header file
5892 that declares `struct vmount.' (AIX)])
5896 if test $ac_cv_func_getmntent = yes; then
5898 # This system has the getmntent function.
5899 # Determine whether it's the one-argument variant or the two-argument one.
5901 if test -z "$ac_list_mounted_fs"; then
5902 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
5903 AC_MSG_CHECKING([for one-argument getmntent function])
5904 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
5906 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
5910 #if !defined MOUNTED
5911 # if defined _PATH_MOUNTED /* GNU libc */
5912 # define MOUNTED _PATH_MOUNTED
5914 # if defined MNT_MNTTAB /* HP-UX. */
5915 # define MOUNTED MNT_MNTTAB
5917 # if defined MNTTABNAME /* Dynix. */
5918 # define MOUNTED MNTTABNAME
5922 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
5923 fu_cv_sys_mounted_getmntent1=yes,
5924 fu_cv_sys_mounted_getmntent1=no)])
5925 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
5926 if test $fu_cv_sys_mounted_getmntent1 = yes; then
5927 ac_list_mounted_fs=found
5928 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
5929 [Define if there is a function named getmntent for reading the list
5930 of mounted filesystems, and that function takes a single argument.
5931 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
5935 if test -z "$ac_list_mounted_fs"; then
5937 AC_MSG_CHECKING([for two-argument getmntent function])
5938 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
5939 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
5940 fu_cv_sys_mounted_getmntent2=yes,
5941 fu_cv_sys_mounted_getmntent2=no)])
5942 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
5943 if test $fu_cv_sys_mounted_getmntent2 = yes; then
5944 ac_list_mounted_fs=found
5945 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
5946 [Define if there is a function named getmntent for reading the list of
5947 mounted filesystems, and that function takes two arguments. (SVR4)])
5953 if test -z "$ac_list_mounted_fs"; then
5954 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
5955 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
5957 AC_MSG_CHECKING([for getfsstat function])
5958 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
5960 #include <sys/types.h>
5961 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
5962 # define FS_TYPE(Ent) ((Ent).f_fstypename)
5964 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
5966 ]$getfsstat_includes
5968 [struct statfs *stats;
5969 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
5970 char *t = FS_TYPE (*stats); ],
5971 fu_cv_sys_mounted_getfsstat=yes,
5972 fu_cv_sys_mounted_getfsstat=no)])
5973 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
5974 if test $fu_cv_sys_mounted_getfsstat = yes; then
5975 ac_list_mounted_fs=found
5976 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
5977 [Define if there is a function named getfsstat for reading the
5978 list of mounted filesystems. (DEC Alpha running OSF/1)])
5982 if test -z "$ac_list_mounted_fs"; then
5984 AC_MSG_CHECKING([for FIXME existence of three headers])
5985 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
5987 #include <sys/statfs.h>
5988 #include <sys/fstyp.h>
5989 #include <mnttab.h>],
5990 fu_cv_sys_mounted_fread_fstyp=yes,
5991 fu_cv_sys_mounted_fread_fstyp=no)])
5992 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
5993 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
5994 ac_list_mounted_fs=found
5995 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
5996 [Define if (like SVR2) there is no specific function for reading the
5997 list of mounted filesystems, and your system has these header files:
5998 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
6002 if test -z "$ac_list_mounted_fs"; then
6003 # 4.4BSD and DEC OSF/1.
6004 AC_MSG_CHECKING([for getmntinfo function])
6005 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
6007 test "$ac_cv_func_getmntinfo" = yes \
6008 && fu_cv_sys_mounted_getmntinfo=yes \
6009 || fu_cv_sys_mounted_getmntinfo=no
6011 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
6012 if test $fu_cv_sys_mounted_getmntinfo = yes; then
6013 ac_list_mounted_fs=found
6014 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
6015 [Define if there is a function named getmntinfo for reading the
6016 list of mounted filesystems. (4.4BSD, Darwin)])
6020 if test -z "$ac_list_mounted_fs"; then
6022 AC_MSG_CHECKING([for getmnt function])
6023 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
6025 #include <sys/fs_types.h>
6026 #include <sys/mount.h>],
6027 fu_cv_sys_mounted_getmnt=yes,
6028 fu_cv_sys_mounted_getmnt=no)])
6029 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
6030 if test $fu_cv_sys_mounted_getmnt = yes; then
6031 ac_list_mounted_fs=found
6032 AC_DEFINE(MOUNTED_GETMNT, 1,
6033 [Define if there is a function named getmnt for reading the list of
6034 mounted filesystems. (Ultrix)])
6038 if test -z "$ac_list_mounted_fs"; then
6040 AC_CHECK_FUNCS(next_dev fs_stat_dev)
6041 AC_CHECK_HEADERS(fs_info.h)
6042 AC_MSG_CHECKING([for BEOS mounted file system support functions])
6043 if test $ac_cv_header_fs_info_h = yes \
6044 && test $ac_cv_func_next_dev = yes \
6045 && test $ac_cv_func_fs_stat_dev = yes; then
6050 AC_MSG_RESULT($fu_result)
6051 if test $fu_result = yes; then
6052 ac_list_mounted_fs=found
6053 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
6054 [Define if there are functions named next_dev and fs_stat_dev for
6055 reading the list of mounted filesystems. (BeOS)])
6059 if test -z "$ac_list_mounted_fs"; then
6061 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
6062 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
6063 [AC_TRY_CPP([#include <mnttab.h>],
6064 fu_cv_sys_mounted_fread=yes,
6065 fu_cv_sys_mounted_fread=no)])
6066 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
6067 if test $fu_cv_sys_mounted_fread = yes; then
6068 ac_list_mounted_fs=found
6069 AC_DEFINE(MOUNTED_FREAD, 1,
6070 [Define if there is no specific function for reading the list of
6071 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
6075 if test -z "$ac_list_mounted_fs"; then
6076 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
6077 # FIXME -- no need to abort building the whole package
6078 # Can't build mountlist.c or anything that needs its functions
6081 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
6087 dnl From Jim Meyering.
6089 dnl See if struct statfs has the f_fstypename member.
6090 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
6093 AC_DEFUN([jm_FSTYPENAME],
6095 AC_CACHE_CHECK([for f_fstypename in struct statfs],
6096 fu_cv_sys_f_fstypename_in_statfs,
6100 #include <sys/param.h>
6101 #include <sys/types.h>
6102 #include <sys/mount.h>
6104 [struct statfs s; int i = sizeof s.f_fstypename;],
6105 fu_cv_sys_f_fstypename_in_statfs=yes,
6106 fu_cv_sys_f_fstypename_in_statfs=no
6111 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
6112 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
6113 [Define if struct statfs has the f_fstypename member.])
6120 # From fileutils/configure.in
6122 # Try to determine how a program can obtain filesystem usage information.
6123 # If successful, define the appropriate symbol (see fsusage.c) and
6124 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
6126 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6128 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
6131 echo "checking how to get filesystem space usage..."
6134 # Perform only the link test since it seems there are no variants of the
6135 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
6136 # because that got a false positive on SCO OSR5. Adding the declaration
6137 # of a `struct statvfs' causes this test to fail (as it should) on such
6138 # systems. That system is reported to work fine with STAT_STATFS4 which
6139 # is what it gets when this test fails.
6140 if test $ac_fsusage_space = no; then
6142 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
6143 [AC_TRY_LINK([#include <sys/types.h>
6145 Do not use statvfs on systems with GNU libc, because that function stats
6146 all preceding entries in /proc/mounts, and that makes df hang if even
6147 one of the corresponding file systems is hard-mounted, but not available.
6149 #include <sys/statvfs.h>],
6150 [struct statvfs fsd; statvfs (0, &fsd);],
6151 fu_cv_sys_stat_statvfs=yes,
6152 fu_cv_sys_stat_statvfs=no)])
6153 if test $fu_cv_sys_stat_statvfs = yes; then
6154 ac_fsusage_space=yes
6155 AC_DEFINE(STAT_STATVFS, 1,
6156 [ Define if there is a function named statvfs. (SVR4)])
6160 if test $ac_fsusage_space = no; then
6161 # DEC Alpha running OSF/1
6162 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
6163 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
6165 #include <sys/param.h>
6166 #include <sys/types.h>
6167 #include <sys/mount.h>
6172 exit (statfs (".", &fsd, sizeof (struct statfs)));
6174 fu_cv_sys_stat_statfs3_osf1=yes,
6175 fu_cv_sys_stat_statfs3_osf1=no,
6176 fu_cv_sys_stat_statfs3_osf1=no)])
6177 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
6178 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
6179 ac_fsusage_space=yes
6180 AC_DEFINE(STAT_STATFS3_OSF1, 1,
6181 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
6185 if test $ac_fsusage_space = no; then
6187 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
6188 member (AIX, 4.3BSD)])
6189 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
6191 #ifdef HAVE_SYS_PARAM_H
6192 #include <sys/param.h>
6194 #ifdef HAVE_SYS_MOUNT_H
6195 #include <sys/mount.h>
6197 #ifdef HAVE_SYS_VFS_H
6198 #include <sys/vfs.h>
6204 exit (statfs (".", &fsd));
6206 fu_cv_sys_stat_statfs2_bsize=yes,
6207 fu_cv_sys_stat_statfs2_bsize=no,
6208 fu_cv_sys_stat_statfs2_bsize=no)])
6209 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
6210 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
6211 ac_fsusage_space=yes
6212 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
6213 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
6214 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
6218 if test $ac_fsusage_space = no; then
6220 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
6221 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
6222 [AC_TRY_RUN([#include <sys/types.h>
6223 #include <sys/statfs.h>
6227 exit (statfs (".", &fsd, sizeof fsd, 0));
6229 fu_cv_sys_stat_statfs4=yes,
6230 fu_cv_sys_stat_statfs4=no,
6231 fu_cv_sys_stat_statfs4=no)])
6232 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
6233 if test $fu_cv_sys_stat_statfs4 = yes; then
6234 ac_fsusage_space=yes
6235 AC_DEFINE(STAT_STATFS4, 1,
6236 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
6240 if test $ac_fsusage_space = no; then
6242 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
6243 member (4.4BSD and NetBSD)])
6244 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
6245 [AC_TRY_RUN([#include <sys/types.h>
6246 #ifdef HAVE_SYS_PARAM_H
6247 #include <sys/param.h>
6249 #ifdef HAVE_SYS_MOUNT_H
6250 #include <sys/mount.h>
6256 exit (statfs (".", &fsd));
6258 fu_cv_sys_stat_statfs2_fsize=yes,
6259 fu_cv_sys_stat_statfs2_fsize=no,
6260 fu_cv_sys_stat_statfs2_fsize=no)])
6261 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
6262 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
6263 ac_fsusage_space=yes
6264 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
6265 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
6270 if test $ac_fsusage_space = no; then
6272 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
6273 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
6274 [AC_TRY_RUN([#include <sys/types.h>
6275 #ifdef HAVE_SYS_PARAM_H
6276 #include <sys/param.h>
6278 #ifdef HAVE_SYS_MOUNT_H
6279 #include <sys/mount.h>
6281 #ifdef HAVE_SYS_FS_TYPES_H
6282 #include <sys/fs_types.h>
6287 /* Ultrix's statfs returns 1 for success,
6288 0 for not mounted, -1 for failure. */
6289 exit (statfs (".", &fsd) != 1);
6291 fu_cv_sys_stat_fs_data=yes,
6292 fu_cv_sys_stat_fs_data=no,
6293 fu_cv_sys_stat_fs_data=no)])
6294 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
6295 if test $fu_cv_sys_stat_fs_data = yes; then
6296 ac_fsusage_space=yes
6297 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
6298 [ Define if statfs takes 2 args and the second argument has
6299 type struct fs_data. (Ultrix)])
6303 if test $ac_fsusage_space = no; then
6305 AC_TRY_CPP([#include <sys/filsys.h>
6307 AC_DEFINE(STAT_READ_FILSYS, 1,
6308 [Define if there is no specific function for reading filesystems usage
6309 information and you have the <sys/filsys.h> header file. (SVR2)])
6310 ac_fsusage_space=yes)
6313 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
6319 # Define some macros required for proper operation of code in lib/*.c
6320 # on MSDOS/Windows systems.
6322 # From Jim Meyering.
6324 AC_DEFUN([jm_AC_DOS],
6326 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
6329 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
6330 neither MSDOS nor Windows
6332 [ac_cv_win_or_dos=yes],
6333 [ac_cv_win_or_dos=no])
6336 if test x"$ac_cv_win_or_dos" = xyes; then
6337 ac_fs_accepts_drive_letter_prefix=1
6338 ac_fs_backslash_is_file_name_separator=1
6340 ac_fs_accepts_drive_letter_prefix=0
6341 ac_fs_backslash_is_file_name_separator=0
6344 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
6345 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
6346 # define FILESYSTEM_PREFIX_LEN(Filename) \
6347 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
6349 # define FILESYSTEM_PREFIX_LEN(Filename) 0
6352 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
6353 $ac_fs_accepts_drive_letter_prefix,
6354 [Define on systems for which file names may have a so-called
6355 `drive letter' prefix, define this to compute the length of that
6356 prefix, including the colon.])
6358 AH_VERBATIM(ISSLASH,
6359 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
6360 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
6362 # define ISSLASH(C) ((C) == '/')
6365 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
6366 $ac_fs_backslash_is_file_name_separator,
6367 [Define if the backslash character may also serve as a file name
6368 component separator.])
6372 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
6374 AC_REQUIRE([AC_HEADER_STDC])
6375 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
6376 AC_CHECK_FUNCS(resolvepath)
6377 AC_REQUIRE([AC_HEADER_STAT])
6379 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
6380 # if the function name weren't so long. Besides, I would rather
6381 # not have underscores in file names.
6382 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
6387 dnl From Paul Eggert.
6389 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
6392 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
6393 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
6394 ac_cv_struct_st_mtim_nsec,
6395 [ac_save_CPPFLAGS="$CPPFLAGS"
6396 ac_cv_struct_st_mtim_nsec=no
6397 # tv_nsec -- the usual case
6398 # _tv_nsec -- Solaris 2.6, if
6399 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
6400 # && !defined __EXTENSIONS__)
6401 # st__tim.tv_nsec -- UnixWare 2.1.2
6402 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
6403 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
6404 AC_TRY_COMPILE([#include <sys/types.h>
6405 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
6406 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
6408 CPPFLAGS="$ac_save_CPPFLAGS"])
6410 if test $ac_cv_struct_st_mtim_nsec != no; then
6411 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
6412 [Define to be the nanoseconds member of struct stat's st_mtim,
6420 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
6422 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
6423 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
6424 [AC_TRY_COMPILE([#include <sys/types.h>
6425 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
6426 ac_cv_struct_st_dm_mode=yes,
6427 ac_cv_struct_st_dm_mode=no)])
6429 if test $ac_cv_struct_st_dm_mode = yes; then
6430 AC_DEFINE(HAVE_ST_DM_MODE, 1,
6431 [Define if struct stat has an st_dm_mode member. ])
6438 dnl From Jim Meyering
6440 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
6441 dnl in time.h or sys/time.h.
6443 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
6445 AC_REQUIRE([AC_HEADER_TIME])
6446 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
6449 # if TIME_WITH_SYS_TIME
6450 # include <sys/time.h>
6453 # if HAVE_SYS_TIME_H
6454 # include <sys/time.h>
6460 [static struct timespec x; x.tv_sec = x.tv_nsec;],
6461 fu_cv_sys_struct_timespec=yes,
6462 fu_cv_sys_struct_timespec=no)
6465 if test $fu_cv_sys_struct_timespec = yes; then
6466 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
6467 [Define if struct timespec is declared in <time.h>. ])
6472 dnl From Jim Meyering and Paul Eggert.
6473 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
6474 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6475 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
6476 jm_cv_sys_tiocgwinsz_needs_termios_h,
6477 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
6479 if test $ac_cv_sys_posix_termios = yes; then
6481 [#include <sys/types.h>
6482 # include <termios.h>
6486 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
6491 AC_DEFUN([jm_WINSIZE_IN_PTEM],
6492 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
6493 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
6494 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
6495 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
6496 if test $ac_cv_sys_posix_termios = yes; then
6497 AC_TRY_COMPILE([#include <termios.h>]
6498 [struct winsize x;],
6499 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6501 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6502 AC_TRY_COMPILE([#include <sys/ptem.h>],
6503 [struct winsize x;],
6504 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
6506 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
6507 AC_DEFINE([WINSIZE_IN_PTEM], 1,
6508 [Define if sys/ptem.h is required for struct winsize.])
6511 # Determine whether this system has infrastructure for obtaining the boot time.
6513 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
6514 * ----------------------------------------------------------
6515 AC_DEFUN([GNULIB_BOOT_TIME],
6517 AC_CHECK_FUNCS(sysctl)
6518 AC_CHECK_HEADERS(sys/sysctl.h)
6520 [whether we can get the system boot time],
6521 [gnulib_cv_have_boot_time],
6525 [AC_INCLUDES_DEFAULT
6526 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
6527 # include <sys/param.h> /* needed for OpenBSD 3.0 */
6528 # include <sys/sysctl.h>
6537 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
6538 /* your system *does* have the infrastructure to determine boot time */
6540 please_tell_us_how_to_determine_boot_time_on_your_system
6543 gnulib_cv_have_boot_time=yes,
6544 gnulib_cv_have_boot_time=no)
6546 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
6551 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
6552 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
6553 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
6554 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
6555 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
6557 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
6559 [#include <sys/types.h>
6560 # include <sys/ioctl.h>
6564 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
6567 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
6568 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
6569 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
6575 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
6577 AC_DEFUN([jm_LIB_CHECK],
6580 # Check for libypsec.a on Dolphin M88K machines.
6581 AC_CHECK_LIB(ypsec, main)
6583 # m88k running dgux 5.4 needs this
6584 AC_CHECK_LIB(ldgc, main)
6586 # Some programs need to link with -lm. printf does if it uses
6587 # lib/strtod.c which uses pow. And seq uses the math functions,
6588 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
6590 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
6591 # Check for these math functions used by seq.
6592 ac_su_saved_lib="$LIBS"
6594 AC_CHECK_FUNCS(floor modf rint)
6595 LIBS="$ac_su_saved_lib"
6598 AC_CHECK_FUNCS(sqrt)
6599 if test $ac_cv_func_sqrt = no; then
6600 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
6603 AC_SUBST(FESETROUND_LIBM)
6604 AC_CHECK_FUNCS(fesetround)
6605 if test $ac_cv_func_fesetround = no; then
6606 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
6609 # The -lsun library is required for YP support on Irix-4.0.5 systems.
6610 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
6611 AC_SEARCH_LIBS(yp_match, [sun ypsec])
6613 # SysV needs -lsec, older versions of Linux need -lshadow for
6614 # shadow passwords. UnixWare 7 needs -lgen.
6615 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
6617 AC_CHECK_HEADERS(shadow.h)
6619 # Requirements for su.c.
6621 $ac_includes_default
6623 # include <shadow.h>
6626 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
6627 AC_CHECK_FUNCS(getspnam)
6629 # SCO-ODT-3.0 is reported to need -lufc for crypt.
6630 # NetBSD needs -lcrypt for crypt.
6631 ac_su_saved_lib="$LIBS"
6632 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
6633 LIBS="$ac_su_saved_lib"
6637 # gettext.m4 serial 17 (gettext-0.11.5)
6638 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6639 dnl This file is free software, distributed under the terms of the GNU
6640 dnl General Public License. As a special exception to the GNU General
6641 dnl Public License, this file may be distributed as part of a program
6642 dnl that contains a configuration script generated by Autoconf, under
6643 dnl the same distribution terms as the rest of that program.
6645 dnl This file can can be used in projects which are not available under
6646 dnl the GNU General Public License or the GNU Library General Public
6647 dnl License but which still want to provide support for the GNU gettext
6649 dnl Please note that the actual code of the GNU gettext library is covered
6650 dnl by the GNU Library General Public License, and the rest of the GNU
6651 dnl gettext package package is covered by the GNU General Public License.
6652 dnl They are *not* in the public domain.
6655 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
6656 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
6658 dnl Macro to add for using GNU gettext.
6660 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
6661 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
6662 dnl default (if it is not specified or empty) is 'no-libtool'.
6663 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
6664 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
6665 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
6666 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
6667 dnl depending on --{enable,disable}-{shared,static} and on the presence of
6668 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
6669 dnl $(top_builddir)/intl/libintl.a will be created.
6670 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
6671 dnl implementations (in libc or libintl) without the ngettext() function
6672 dnl will be ignored. If NEEDSYMBOL is specified and is
6673 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
6674 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
6675 dnl INTLDIR is used to find the intl libraries. If empty,
6676 dnl the value `$(top_builddir)/intl/' is used.
6678 dnl The result of the configuration is one of three cases:
6679 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
6681 dnl Catalog format: GNU --> install in $(datadir)
6682 dnl Catalog extension: .mo after installation, .gmo in source tree
6683 dnl 2) GNU gettext has been found in the system's C library.
6684 dnl Catalog format: GNU --> install in $(datadir)
6685 dnl Catalog extension: .mo after installation, .gmo in source tree
6686 dnl 3) No internationalization, always use English msgid.
6687 dnl Catalog format: none
6688 dnl Catalog extension: none
6689 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
6690 dnl The use of .gmo is historical (it was needed to avoid overwriting the
6691 dnl GNU format catalogs when building on a platform with an X/Open gettext),
6692 dnl but we keep it in order not to force irrelevant filename changes on the
6695 AC_DEFUN([AM_GNU_GETTEXT],
6697 dnl Argument checking.
6698 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
6699 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
6701 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
6702 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
6704 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
6705 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
6707 AC_REQUIRE([AM_PO_SUBDIRS])dnl
6708 ifelse(gt_included_intl, yes, [
6709 AC_REQUIRE([AM_INTL_SUBDIR])dnl
6712 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
6713 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
6714 AC_REQUIRE([AC_LIB_RPATH])
6716 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6717 dnl Ideally we would do this search only after the
6718 dnl if test "$USE_NLS" = "yes"; then
6719 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6720 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
6721 dnl the configure script would need to contain the same shell code
6722 dnl again, outside any 'if'. There are two solutions:
6723 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
6724 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
6725 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
6726 dnl documented, we avoid it.
6727 ifelse(gt_included_intl, yes, , [
6728 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
6731 AC_MSG_CHECKING([whether NLS is requested])
6732 dnl Default is enabled NLS
6734 [ --disable-nls do not use Native Language Support],
6735 USE_NLS=$enableval, USE_NLS=yes)
6736 AC_MSG_RESULT($USE_NLS)
6739 ifelse(gt_included_intl, yes, [
6740 BUILD_INCLUDED_LIBINTL=no
6741 USE_INCLUDED_LIBINTL=no
6747 dnl If we use NLS figure out what method
6748 if test "$USE_NLS" = "yes"; then
6749 gt_use_preinstalled_gnugettext=no
6750 ifelse(gt_included_intl, yes, [
6751 AC_MSG_CHECKING([whether included gettext is requested])
6752 AC_ARG_WITH(included-gettext,
6753 [ --with-included-gettext use the GNU gettext library included here],
6754 nls_cv_force_use_gnu_gettext=$withval,
6755 nls_cv_force_use_gnu_gettext=no)
6756 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
6758 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
6759 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
6761 dnl User does not insist on using GNU NLS library. Figure out what
6762 dnl to use. If GNU gettext is available we use this. Else we have
6763 dnl to fall back to GNU NLS library.
6765 dnl Add a version number to the cache macros.
6766 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
6767 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
6768 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
6770 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
6771 [AC_TRY_LINK([#include <libintl.h>
6772 ]ifelse([$2], [need-formatstring-macros],
6773 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6774 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6777 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6779 ], [])[extern int _nl_msg_cat_cntr;
6780 extern int *_nl_domain_bindings;],
6781 [bindtextdomain ("", "");
6782 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
6783 gt_cv_func_gnugettext_libc=yes,
6784 gt_cv_func_gnugettext_libc=no)])
6786 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
6787 dnl Sometimes libintl requires libiconv, so first search for libiconv.
6788 ifelse(gt_included_intl, yes, , [
6791 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
6792 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
6793 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
6794 dnl even if libiconv doesn't exist.
6795 AC_LIB_LINKFLAGS_BODY([intl])
6796 AC_CACHE_CHECK([for GNU gettext in libintl],
6797 gt_cv_func_gnugettext_libintl,
6798 [gt_save_CPPFLAGS="$CPPFLAGS"
6799 CPPFLAGS="$CPPFLAGS $INCINTL"
6800 gt_save_LIBS="$LIBS"
6801 LIBS="$LIBS $LIBINTL"
6802 dnl Now see whether libintl exists and does not depend on libiconv.
6803 AC_TRY_LINK([#include <libintl.h>
6804 ]ifelse([$2], [need-formatstring-macros],
6805 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6806 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6809 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6811 ], [])[extern int _nl_msg_cat_cntr;
6816 const char *_nl_expand_alias ();],
6817 [bindtextdomain ("", "");
6818 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6819 gt_cv_func_gnugettext_libintl=yes,
6820 gt_cv_func_gnugettext_libintl=no)
6821 dnl Now see whether libintl exists and depends on libiconv.
6822 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
6823 LIBS="$LIBS $LIBICONV"
6824 AC_TRY_LINK([#include <libintl.h>
6825 ]ifelse([$2], [need-formatstring-macros],
6826 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
6827 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
6830 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
6832 ], [])[extern int _nl_msg_cat_cntr;
6837 const char *_nl_expand_alias ();],
6838 [bindtextdomain ("", "");
6839 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
6840 [LIBINTL="$LIBINTL $LIBICONV"
6841 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
6842 gt_cv_func_gnugettext_libintl=yes
6845 CPPFLAGS="$gt_save_CPPFLAGS"
6846 LIBS="$gt_save_LIBS"])
6849 dnl If an already present or preinstalled GNU gettext() is found,
6850 dnl use it. But if this macro is used in GNU gettext, and GNU
6851 dnl gettext is already preinstalled in libintl, we update this
6852 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
6853 if test "$gt_cv_func_gnugettext_libc" = "yes" \
6854 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
6855 && test "$PACKAGE" != gettext; }; then
6856 gt_use_preinstalled_gnugettext=yes
6858 dnl Reset the values set by searching for libintl.
6864 ifelse(gt_included_intl, yes, [
6865 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
6866 dnl GNU gettext is not found in the C library.
6867 dnl Fall back on included GNU gettext library.
6868 nls_cv_use_gnu_gettext=yes
6872 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6873 dnl Mark actions used to generate GNU NLS library.
6874 INTLOBJS="\$(GETTOBJS)"
6875 BUILD_INCLUDED_LIBINTL=yes
6876 USE_INCLUDED_LIBINTL=yes
6877 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
6878 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
6879 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6882 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6883 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6884 dnl Mark actions to use GNU gettext tools.
6889 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6890 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6891 AC_DEFINE(ENABLE_NLS, 1,
6892 [Define to 1 if translation of program messages to the user's native language
6899 if test "$USE_NLS" = "yes"; then
6901 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
6902 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
6903 AC_MSG_CHECKING([how to link with libintl])
6904 AC_MSG_RESULT([$LIBINTL])
6905 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
6908 dnl For backward compatibility. Some packages may be using this.
6909 AC_DEFINE(HAVE_GETTEXT, 1,
6910 [Define if the GNU gettext() function is already present or preinstalled.])
6911 AC_DEFINE(HAVE_DCGETTEXT, 1,
6912 [Define if the GNU dcgettext() function is already present or preinstalled.])
6915 dnl We need to process the po/ directory.
6919 ifelse(gt_included_intl, yes, [
6920 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
6921 dnl to 'yes' because some of the testsuite requires it.
6922 if test "$PACKAGE" = gettext; then
6923 BUILD_INCLUDED_LIBINTL=yes
6926 dnl Make all variables we use known to autoconf.
6927 AC_SUBST(BUILD_INCLUDED_LIBINTL)
6928 AC_SUBST(USE_INCLUDED_LIBINTL)
6932 dnl For backward compatibility. Some configure.ins may be using this.
6934 nls_cv_header_libgt=
6936 dnl For backward compatibility. Some Makefiles may be using this.
6938 AC_SUBST(DATADIRNAME)
6940 dnl For backward compatibility. Some Makefiles may be using this.
6942 AC_SUBST(INSTOBJEXT)
6944 dnl For backward compatibility. Some Makefiles may be using this.
6948 dnl Enable libtool support if the surrounding package wishes it.
6949 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
6950 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
6953 dnl For backward compatibility. Some Makefiles may be using this.
6957 dnl Make all documented variables known to autoconf.
6964 dnl Checks for all prerequisites of the po subdirectory,
6965 dnl except for USE_NLS.
6966 AC_DEFUN([AM_PO_SUBDIRS],
6968 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
6969 AC_REQUIRE([AC_PROG_INSTALL])dnl
6970 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6972 dnl Perform the following tests also if --disable-nls has been given,
6973 dnl because they are needed for "make dist" to work.
6975 dnl Search for GNU msgfmt in the PATH.
6976 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
6977 dnl The second test excludes FreeBSD msgfmt.
6978 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
6979 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
6980 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
6982 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
6984 dnl Search for GNU xgettext 0.11 or newer in the PATH.
6985 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
6986 dnl The second test excludes FreeBSD xgettext.
6987 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6988 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6989 (if $ac_dir/$ac_word --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
6991 dnl Remove leftover from FreeBSD xgettext call.
6994 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
6995 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
6996 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
6998 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6999 dnl Test whether we really found GNU msgfmt.
7000 if test "$GMSGFMT" != ":"; then
7001 dnl If it is no GNU msgfmt we define it as : so that the
7002 dnl Makefiles still can work.
7003 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
7004 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
7007 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
7009 [found $GMSGFMT program is not GNU msgfmt; ignore it])
7014 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
7015 dnl Test whether we really found GNU xgettext.
7016 if test "$XGETTEXT" != ":"; then
7017 dnl If it is no GNU xgettext we define it as : so that the
7018 dnl Makefiles still can work.
7019 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
7020 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
7024 [found xgettext program is not GNU xgettext; ignore it])
7027 dnl Remove leftover from FreeBSD xgettext call.
7031 AC_OUTPUT_COMMANDS([
7032 for ac_file in $CONFIG_FILES; do
7033 # Support "outfile[:infile[:infile...]]"
7035 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
7037 # PO directories have a Makefile.in generated from Makefile.in.in.
7038 case "$ac_file" in */Makefile.in)
7039 # Adjust a relative srcdir.
7040 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
7041 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
7042 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
7043 # In autoconf-2.13 it is called $ac_given_srcdir.
7044 # In autoconf-2.50 it is called $srcdir.
7045 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
7046 case "$ac_given_srcdir" in
7047 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
7048 /*) top_srcdir="$ac_given_srcdir" ;;
7049 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
7051 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
7052 rm -f "$ac_dir/POTFILES"
7053 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
7054 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
7055 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
7056 # on $ac_dir but don't depend on user-specified configuration
7058 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
7059 # The LINGUAS file contains the set of available languages.
7060 if test -n "$ALL_LINGUAS"; then
7061 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
7063 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
7064 # Hide the ALL_LINGUAS assigment from automake.
7065 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
7067 case "$ac_given_srcdir" in
7069 *) srcdirpre='$(srcdir)/' ;;
7075 for lang in $ALL_LINGUAS; do
7076 POFILES="$POFILES $srcdirpre$lang.po"
7077 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
7078 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
7079 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
7081 # CATALOGS depends on both $ac_dir and the user's LINGUAS
7082 # environment variable.
7084 if test -n "$ALL_LINGUAS"; then
7085 for presentlang in $ALL_LINGUAS; do
7087 if test "%UNSET%" != "$LINGUAS"; then
7088 desiredlanguages="$LINGUAS"
7090 desiredlanguages="$ALL_LINGUAS"
7092 for desiredlang in $desiredlanguages; do
7093 # Use the presentlang catalog if desiredlang is
7094 # a. equal to presentlang, or
7095 # b. a variant of presentlang (because in this case,
7096 # presentlang can be used as a fallback for messages
7097 # which are not translated in the desiredlang catalog).
7098 case "$desiredlang" in
7099 "$presentlang"*) useit=yes;;
7102 if test $useit = yes; then
7103 INST_LINGUAS="$INST_LINGUAS $presentlang"
7108 if test -n "$INST_LINGUAS"; then
7109 for lang in $INST_LINGUAS; do
7110 CATALOGS="$CATALOGS $lang.gmo"
7113 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
7114 sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
7115 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
7116 if test -f "$f"; then
7118 *.orig | *.bak | *~) ;;
7119 *) cat "$f" >> "$ac_dir/Makefile" ;;
7127 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
7128 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
7130 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
7131 # Capture the value of LINGUAS because we need it to compute CATALOGS.
7132 LINGUAS="${LINGUAS-%UNSET%}"
7137 dnl Checks for all prerequisites of the intl subdirectory,
7138 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
7139 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
7140 AC_DEFUN([AM_INTL_SUBDIR],
7142 AC_REQUIRE([AC_PROG_INSTALL])dnl
7143 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
7144 AC_REQUIRE([AC_PROG_CC])dnl
7145 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7146 AC_REQUIRE([AC_PROG_RANLIB])dnl
7147 AC_REQUIRE([AC_ISC_POSIX])dnl
7148 AC_REQUIRE([AC_HEADER_STDC])dnl
7149 AC_REQUIRE([AC_C_CONST])dnl
7150 AC_REQUIRE([AC_C_INLINE])dnl
7151 AC_REQUIRE([AC_TYPE_OFF_T])dnl
7152 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
7153 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
7154 AC_REQUIRE([AC_FUNC_MMAP])dnl
7155 AC_REQUIRE([jm_GLIBC21])dnl
7156 AC_REQUIRE([gt_INTDIV0])dnl
7157 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
7158 AC_REQUIRE([gt_INTTYPES_PRI])dnl
7160 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
7161 stdlib.h string.h unistd.h sys/param.h])
7162 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
7163 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
7164 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
7168 if test $ac_cv_header_locale_h = yes; then
7172 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
7173 dnl because plural.y uses bison specific features. It requires at least
7174 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
7176 dnl bison is only needed for the maintainer (who touches plural.y). But in
7177 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
7178 dnl the rule in general Makefile. Now, some people carelessly touch the
7179 dnl files or have a broken "make" program, hence the plural.c rule will
7180 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
7181 dnl present or too old.
7182 AC_CHECK_PROGS([INTLBISON], [bison])
7183 if test -z "$INTLBISON"; then
7186 dnl Found it, now check the version.
7187 AC_MSG_CHECKING([version of bison])
7188 changequote(<<,>>)dnl
7189 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
7190 case $ac_prog_version in
7191 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
7192 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
7194 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
7195 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
7197 AC_MSG_RESULT([$ac_prog_version])
7199 if test $ac_verc_fail = yes; then
7205 AC_DEFUN([AM_MKINSTALLDIRS],
7207 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
7208 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
7209 dnl Try to locate is.
7211 if test -n "$ac_aux_dir"; then
7212 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
7214 if test -z "$MKINSTALLDIRS"; then
7215 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
7217 AC_SUBST(MKINSTALLDIRS)
7221 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
7222 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
7224 # progtest.m4 serial 3
7225 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
7226 dnl This file is free software, distributed under the terms of the GNU
7227 dnl General Public License. As a special exception to the GNU General
7228 dnl Public License, this file may be distributed as part of a program
7229 dnl that contains a configuration script generated by Autoconf, under
7230 dnl the same distribution terms as the rest of that program.
7232 dnl This file can can be used in projects which are not available under
7233 dnl the GNU General Public License or the GNU Library General Public
7234 dnl License but which still want to provide support for the GNU gettext
7236 dnl Please note that the actual code of the GNU gettext library is covered
7237 dnl by the GNU Library General Public License, and the rest of the GNU
7238 dnl gettext package package is covered by the GNU General Public License.
7239 dnl They are *not* in the public domain.
7242 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
7244 # Search path for a program which passes the given test.
7246 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
7247 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
7248 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
7249 [# Extract the first word of "$2", so it can be a program name with args.
7250 set dummy $2; ac_word=[$]2
7251 AC_MSG_CHECKING([for $ac_word])
7252 AC_CACHE_VAL(ac_cv_path_$1,
7255 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
7258 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
7259 for ac_dir in ifelse([$5], , $PATH, [$5]); do
7260 test -z "$ac_dir" && ac_dir=.
7261 if test -f $ac_dir/$ac_word; then
7263 ac_cv_path_$1="$ac_dir/$ac_word"
7269 dnl If no 4th arg is given, leave the cache variable unset,
7270 dnl so AC_PATH_PROGS will keep looking.
7271 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
7276 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
7277 AC_MSG_RESULT([$]$1)
7284 # intdiv0.m4 serial 1 (gettext-0.11.3)
7285 dnl Copyright (C) 2002 Free Software Foundation, Inc.
7286 dnl This file is free software, distributed under the terms of the GNU
7287 dnl General Public License. As a special exception to the GNU General
7288 dnl Public License, this file may be distributed as part of a program
7289 dnl that contains a configuration script generated by Autoconf, under
7290 dnl the same distribution terms as the rest of that program.
7292 dnl From Bruno Haible.
7294 AC_DEFUN([gt_INTDIV0],
7296 AC_REQUIRE([AC_PROG_CC])dnl
7297 AC_REQUIRE([AC_CANONICAL_HOST])dnl
7299 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
7300 gt_cv_int_divbyzero_sigfpe,
7308 sigfpe_handler (int sig)
7310 sigfpe_handler (sig) int sig;
7313 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
7314 exit (sig != SIGFPE);
7324 signal (SIGFPE, sigfpe_handler);
7325 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
7326 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
7327 signal (SIGTRAP, sigfpe_handler);
7329 /* Linux/SPARC yields signal SIGILL. */
7330 #if defined (__sparc__) && defined (__linux__)
7331 signal (SIGILL, sigfpe_handler);
7338 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
7340 # Guess based on the CPU.
7342 alpha* | i[34567]86 | m68k | s390*)
7343 gt_cv_int_divbyzero_sigfpe="guessing yes";;
7345 gt_cv_int_divbyzero_sigfpe="guessing no";;
7349 case "$gt_cv_int_divbyzero_sigfpe" in
7353 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
7354 [Define if integer division by zero raises signal SIGFPE.])
7357 # lcmessage.m4 serial 3 (gettext-0.11.3)
7358 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
7359 dnl This file is free software, distributed under the terms of the GNU
7360 dnl General Public License. As a special exception to the GNU General
7361 dnl Public License, this file may be distributed as part of a program
7362 dnl that contains a configuration script generated by Autoconf, under
7363 dnl the same distribution terms as the rest of that program.
7365 dnl This file can can be used in projects which are not available under
7366 dnl the GNU General Public License or the GNU Library General Public
7367 dnl License but which still want to provide support for the GNU gettext
7369 dnl Please note that the actual code of the GNU gettext library is covered
7370 dnl by the GNU Library General Public License, and the rest of the GNU
7371 dnl gettext package package is covered by the GNU General Public License.
7372 dnl They are *not* in the public domain.
7375 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
7377 # Check whether LC_MESSAGES is available in <locale.h>.
7379 AC_DEFUN([AM_LC_MESSAGES],
7381 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
7382 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
7383 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
7384 if test $am_cv_val_LC_MESSAGES = yes; then
7385 AC_DEFINE(HAVE_LC_MESSAGES, 1,
7386 [Define if your <locale.h> file defines LC_MESSAGES.])