1 # generated automatically by aclocal 1.7.2 -*- 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 1996, 1997, 1998, 1999, 2000, 2001, 2002
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
39 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
40 # written in clear, in which case automake, when reading aclocal.m4,
41 # will think it sees a *use*, and therefore will trigger all it's
42 # C support machinery. Also note that it means that autoscan, seeing
43 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
48 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
49 # the ones we care about.
50 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
52 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
53 # AM_INIT_AUTOMAKE([OPTIONS])
54 # -----------------------------------------------
55 # The call with PACKAGE and VERSION arguments is the old style
56 # call (pre autoconf-2.50), which is being phased out. PACKAGE
57 # and VERSION should now be passed to AC_INIT and removed from
58 # the call to AM_INIT_AUTOMAKE.
59 # We support both call styles for the transition. After
60 # the next Automake release, Autoconf can make the AC_INIT
61 # arguments mandatory, and then we can depend on a new Autoconf
62 # release and drop the old call support.
63 AC_DEFUN([AM_INIT_AUTOMAKE],
64 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
65 AC_REQUIRE([AC_PROG_INSTALL])dnl
66 # test to see if srcdir already configured
67 if test "`cd $srcdir && pwd`" != "`pwd`" &&
68 test -f $srcdir/config.status; then
69 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
72 # test whether we have cygpath
73 if test -z "$CYGPATH_W"; then
74 if (cygpath --version) >/dev/null 2>/dev/null; then
75 CYGPATH_W='cygpath -w'
82 # Define the identity of the package.
83 dnl Distinguish between old-style and new-style calls.
85 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
86 AC_SUBST([PACKAGE], [$1])dnl
87 AC_SUBST([VERSION], [$2])],
88 [_AM_SET_OPTIONS([$1])dnl
89 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
90 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
92 _AM_IF_OPTION([no-define],,
93 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
94 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
96 # Some tools Automake needs.
97 AC_REQUIRE([AM_SANITY_CHECK])dnl
98 AC_REQUIRE([AC_ARG_PROGRAM])dnl
99 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
100 AM_MISSING_PROG(AUTOCONF, autoconf)
101 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
102 AM_MISSING_PROG(AUTOHEADER, autoheader)
103 AM_MISSING_PROG(MAKEINFO, makeinfo)
104 AM_MISSING_PROG(AMTAR, tar)
106 AM_PROG_INSTALL_STRIP
107 # We need awk for the "check" target. The system "awk" is bad on
109 AC_REQUIRE([AC_PROG_AWK])dnl
110 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
112 _AM_IF_OPTION([no-dependencies],,
113 [AC_PROVIDE_IFELSE([AC_PROG_CC],
114 [_AM_DEPENDENCIES(CC)],
115 [define([AC_PROG_CC],
116 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
117 AC_PROVIDE_IFELSE([AC_PROG_CXX],
118 [_AM_DEPENDENCIES(CXX)],
119 [define([AC_PROG_CXX],
120 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
125 # When config.status generates a header, we must update the stamp-h file.
126 # This file resides in the same directory as the config header
127 # that is generated. The stamp files are numbered to have different names.
129 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
130 # loop where config.status creates the headers, so we can generate
131 # our stamp files there.
132 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
133 [_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
134 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
136 # Copyright 2002 Free Software Foundation, Inc.
138 # This program is free software; you can redistribute it and/or modify
139 # it under the terms of the GNU General Public License as published by
140 # the Free Software Foundation; either version 2, or (at your option)
143 # This program is distributed in the hope that it will be useful,
144 # but WITHOUT ANY WARRANTY; without even the implied warranty of
145 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
146 # GNU General Public License for more details.
148 # You should have received a copy of the GNU General Public License
149 # along with this program; if not, write to the Free Software
150 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
152 # AM_AUTOMAKE_VERSION(VERSION)
153 # ----------------------------
154 # Automake X.Y traces this macro to ensure aclocal.m4 has been
155 # generated from the m4 files accompanying Automake X.Y.
156 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
158 # AM_SET_CURRENT_AUTOMAKE_VERSION
159 # -------------------------------
160 # Call AM_AUTOMAKE_VERSION so it can be traced.
161 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
162 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
163 [AM_AUTOMAKE_VERSION([1.7.2])])
165 # Helper functions for option handling. -*- Autoconf -*-
167 # Copyright 2001, 2002 Free Software Foundation, Inc.
169 # This program is free software; you can redistribute it and/or modify
170 # it under the terms of the GNU General Public License as published by
171 # the Free Software Foundation; either version 2, or (at your option)
174 # This program is distributed in the hope that it will be useful,
175 # but WITHOUT ANY WARRANTY; without even the implied warranty of
176 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
177 # GNU General Public License for more details.
179 # You should have received a copy of the GNU General Public License
180 # along with this program; if not, write to the Free Software
181 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
186 # _AM_MANGLE_OPTION(NAME)
187 # -----------------------
188 AC_DEFUN([_AM_MANGLE_OPTION],
189 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
191 # _AM_SET_OPTION(NAME)
192 # ------------------------------
193 # Set option NAME. Presently that only means defining a flag for this option.
194 AC_DEFUN([_AM_SET_OPTION],
195 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
197 # _AM_SET_OPTIONS(OPTIONS)
198 # ----------------------------------
199 # OPTIONS is a space-separated list of Automake options.
200 AC_DEFUN([_AM_SET_OPTIONS],
201 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
203 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
204 # -------------------------------------------
205 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
206 AC_DEFUN([_AM_IF_OPTION],
207 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
210 # Check to make sure that the build environment is sane.
213 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
215 # This program is free software; you can redistribute it and/or modify
216 # it under the terms of the GNU General Public License as published by
217 # the Free Software Foundation; either version 2, or (at your option)
220 # This program is distributed in the hope that it will be useful,
221 # but WITHOUT ANY WARRANTY; without even the implied warranty of
222 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
223 # GNU General Public License for more details.
225 # You should have received a copy of the GNU General Public License
226 # along with this program; if not, write to the Free Software
227 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
234 AC_DEFUN([AM_SANITY_CHECK],
235 [AC_MSG_CHECKING([whether build environment is sane])
238 echo timestamp > conftest.file
239 # Do `set' in a subshell so we don't clobber the current shell's
240 # arguments. Must try -L first in case configure is actually a
241 # symlink; some systems play weird games with the mod time of symlinks
242 # (eg FreeBSD returns the mod time of the symlink's containing
245 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
246 if test "$[*]" = "X"; then
248 set X `ls -t $srcdir/configure conftest.file`
251 if test "$[*]" != "X $srcdir/configure conftest.file" \
252 && test "$[*]" != "X conftest.file $srcdir/configure"; then
254 # If neither matched, then we have a broken ls. This can happen
255 # if, for instance, CONFIG_SHELL is bash and it inherits a
256 # broken ls alias from the environment. This has actually
257 # happened. Such a system could not be considered "sane".
258 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
259 alias in your environment])
262 test "$[2]" = conftest.file
268 AC_MSG_ERROR([newly created file is older than distributed files!
269 Check your system clock])
276 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
278 # This program is free software; you can redistribute it and/or modify
279 # it under the terms of the GNU General Public License as published by
280 # the Free Software Foundation; either version 2, or (at your option)
283 # This program is distributed in the hope that it will be useful,
284 # but WITHOUT ANY WARRANTY; without even the implied warranty of
285 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
286 # GNU General Public License for more details.
288 # You should have received a copy of the GNU General Public License
289 # along with this program; if not, write to the Free Software
290 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
295 # AM_MISSING_PROG(NAME, PROGRAM)
296 # ------------------------------
297 AC_DEFUN([AM_MISSING_PROG],
298 [AC_REQUIRE([AM_MISSING_HAS_RUN])
299 $1=${$1-"${am_missing_run}$2"}
305 # Define MISSING if not defined so far and test if it supports --run.
306 # If it does, set am_missing_run to use it, otherwise, to nothing.
307 AC_DEFUN([AM_MISSING_HAS_RUN],
308 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
309 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
310 # Use eval to expand $SHELL
311 if eval "$MISSING --run true"; then
312 am_missing_run="$MISSING --run "
315 AC_MSG_WARN([`missing' script is too old or missing])
321 # Copyright 2001 Free Software Foundation, Inc.
323 # This program is free software; you can redistribute it and/or modify
324 # it under the terms of the GNU General Public License as published by
325 # the Free Software Foundation; either version 2, or (at your option)
328 # This program is distributed in the hope that it will be useful,
329 # but WITHOUT ANY WARRANTY; without even the implied warranty of
330 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
331 # GNU General Public License for more details.
333 # You should have received a copy of the GNU General Public License
334 # along with this program; if not, write to the Free Software
335 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
338 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
339 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
340 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
342 # Of course, Automake must honor this variable whenever it calls a
343 # tool from the auxiliary directory. The problem is that $srcdir (and
344 # therefore $ac_aux_dir as well) can be either absolute or relative,
345 # depending on how configure is run. This is pretty annoying, since
346 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
347 # source directory, any form will work fine, but in subdirectories a
348 # relative path needs to be adjusted first.
350 # $ac_aux_dir/missing
351 # fails when called from a subdirectory if $ac_aux_dir is relative
352 # $top_srcdir/$ac_aux_dir/missing
353 # fails if $ac_aux_dir is absolute,
354 # fails when called from a subdirectory in a VPATH build with
355 # a relative $ac_aux_dir
357 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
358 # are both prefixed by $srcdir. In an in-source build this is usually
359 # harmless because $srcdir is `.', but things will broke when you
360 # start a VPATH build or use an absolute $srcdir.
362 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
363 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
364 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
365 # and then we would define $MISSING as
366 # MISSING="\${SHELL} $am_aux_dir/missing"
367 # This will work as long as MISSING is not called from configure, because
368 # unfortunately $(top_srcdir) has no meaning in configure.
369 # However there are other variables, like CC, which are often used in
370 # configure, and could therefore not use this "fixed" $ac_aux_dir.
372 # Another solution, used here, is to always expand $ac_aux_dir to an
373 # absolute PATH. The drawback is that using absolute paths prevent a
374 # configured tree to be moved without reconfiguration.
376 # Rely on autoconf to set up CDPATH properly.
379 AC_DEFUN([AM_AUX_DIR_EXPAND], [
380 # expand $ac_aux_dir to an absolute path
381 am_aux_dir=`cd $ac_aux_dir && pwd`
386 # Define $install_sh.
388 # Copyright 2001 Free Software Foundation, Inc.
390 # This program is free software; you can redistribute it and/or modify
391 # it under the terms of the GNU General Public License as published by
392 # the Free Software Foundation; either version 2, or (at your option)
395 # This program is distributed in the hope that it will be useful,
396 # but WITHOUT ANY WARRANTY; without even the implied warranty of
397 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
398 # GNU General Public License for more details.
400 # You should have received a copy of the GNU General Public License
401 # along with this program; if not, write to the Free Software
402 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
405 AC_DEFUN([AM_PROG_INSTALL_SH],
406 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
407 install_sh=${install_sh-"$am_aux_dir/install-sh"}
408 AC_SUBST(install_sh)])
410 # AM_PROG_INSTALL_STRIP
412 # Copyright 2001 Free Software Foundation, Inc.
414 # This program is free software; you can redistribute it and/or modify
415 # it under the terms of the GNU General Public License as published by
416 # the Free Software Foundation; either version 2, or (at your option)
419 # This program is distributed in the hope that it will be useful,
420 # but WITHOUT ANY WARRANTY; without even the implied warranty of
421 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
422 # GNU General Public License for more details.
424 # You should have received a copy of the GNU General Public License
425 # along with this program; if not, write to the Free Software
426 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
429 # One issue with vendor `install' (even GNU) is that you can't
430 # specify the program used to strip binaries. This is especially
431 # annoying in cross-compiling environments, where the build's strip
432 # is unlikely to handle the host's binaries.
433 # Fortunately install-sh will honor a STRIPPROG variable, so we
434 # always use install-sh in `make install-strip', and initialize
435 # STRIPPROG with the value of the STRIP variable (set by the user).
436 AC_DEFUN([AM_PROG_INSTALL_STRIP],
437 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
438 # Installed binaries are usually stripped using `strip' when the user
439 # run `make install-strip'. However `strip' might not be the right
440 # tool to use in cross-compilation environments, therefore Automake
441 # will honor the `STRIP' environment variable to overrule this program.
442 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
443 if test "$cross_compiling" != no; then
444 AC_CHECK_TOOL([STRIP], [strip], :)
446 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
447 AC_SUBST([INSTALL_STRIP_PROGRAM])])
449 # serial 4 -*- Autoconf -*-
451 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
453 # This program is free software; you can redistribute it and/or modify
454 # it under the terms of the GNU General Public License as published by
455 # the Free Software Foundation; either version 2, or (at your option)
458 # This program is distributed in the hope that it will be useful,
459 # but WITHOUT ANY WARRANTY; without even the implied warranty of
460 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
461 # GNU General Public License for more details.
463 # You should have received a copy of the GNU General Public License
464 # along with this program; if not, write to the Free Software
465 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
469 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
470 # written in clear, in which case automake, when reading aclocal.m4,
471 # will think it sees a *use*, and therefore will trigger all it's
472 # C support machinery. Also note that it means that autoscan, seeing
473 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
477 # _AM_DEPENDENCIES(NAME)
478 # ----------------------
479 # See how the compiler implements dependency checking.
480 # NAME is "CC", "CXX", "GCJ", or "OBJC".
481 # We try a few techniques and use that to set a single cache variable.
483 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
484 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
485 # dependency, and given that the user is not expected to run this macro,
486 # just rely on AC_PROG_CC.
487 AC_DEFUN([_AM_DEPENDENCIES],
488 [AC_REQUIRE([AM_SET_DEPDIR])dnl
489 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
490 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
491 AC_REQUIRE([AM_DEP_TRACK])dnl
493 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
494 [$1], CXX, [depcc="$CXX" am_compiler_list=],
495 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
496 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
497 [depcc="$$1" am_compiler_list=])
499 AC_CACHE_CHECK([dependency style of $depcc],
500 [am_cv_$1_dependencies_compiler_type],
501 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
502 # We make a subdir and do the tests there. Otherwise we can end up
503 # making bogus files that we don't know about and never remove. For
504 # instance it was reported that on HP-UX the gcc test will end up
505 # making a dummy file named `D' -- because `-MD' means `put the output
508 # Copy depcomp to subdir because otherwise we won't find it if we're
509 # using a relative directory.
510 cp "$am_depcomp" conftest.dir
513 am_cv_$1_dependencies_compiler_type=none
514 if test "$am_compiler_list" = ""; then
515 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
517 for depmode in $am_compiler_list; do
518 # We need to recreate these files for each test, as the compiler may
519 # overwrite some of them when testing with obscure command lines.
520 # This happens at least with the AIX C compiler.
521 echo '#include "conftest.h"' > conftest.c
522 echo 'int i;' > conftest.h
523 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
527 # after this tag, mechanisms are not by side-effect, so they'll
528 # only be used when explicitly requested
529 if test "x$enable_dependency_tracking" = xyes; then
537 # We check with `-c' and `-o' for the sake of the "dashmstdout"
538 # mode. It turns out that the SunPro C++ compiler does not properly
539 # handle `-M -o', and we need to detect this.
540 if depmode=$depmode \
541 source=conftest.c object=conftest.o \
542 depfile=conftest.Po tmpdepfile=conftest.TPo \
543 $SHELL ./depcomp $depcc -c -o conftest.o conftest.c >/dev/null 2>&1 &&
544 grep conftest.h conftest.Po > /dev/null 2>&1 &&
545 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
546 am_cv_$1_dependencies_compiler_type=$depmode
554 am_cv_$1_dependencies_compiler_type=none
557 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
558 AM_CONDITIONAL([am__fastdep$1], [
559 test "x$enable_dependency_tracking" != xno \
560 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
566 # Choose a directory name for dependency files.
567 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
568 AC_DEFUN([AM_SET_DEPDIR],
569 [rm -f .deps 2>/dev/null
570 mkdir .deps 2>/dev/null
571 if test -d .deps; then
574 # MS-DOS does not allow filenames that begin with a dot.
577 rmdir .deps 2>/dev/null
584 AC_DEFUN([AM_DEP_TRACK],
585 [AC_ARG_ENABLE(dependency-tracking,
586 [ --disable-dependency-tracking Speeds up one-time builds
587 --enable-dependency-tracking Do not reject slow dependency extractors])
588 if test "x$enable_dependency_tracking" != xno; then
589 am_depcomp="$ac_aux_dir/depcomp"
592 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
593 AC_SUBST([AMDEPBACKSLASH])
596 # Generate code to set up dependency tracking. -*- Autoconf -*-
598 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
600 # This program is free software; you can redistribute it and/or modify
601 # it under the terms of the GNU General Public License as published by
602 # the Free Software Foundation; either version 2, or (at your option)
605 # This program is distributed in the hope that it will be useful,
606 # but WITHOUT ANY WARRANTY; without even the implied warranty of
607 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
608 # GNU General Public License for more details.
610 # You should have received a copy of the GNU General Public License
611 # along with this program; if not, write to the Free Software
612 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
617 # _AM_OUTPUT_DEPENDENCY_COMMANDS
618 # ------------------------------
619 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
620 [for mf in $CONFIG_FILES; do
621 # Strip MF so we end up with the name of the file.
622 mf=`echo "$mf" | sed -e 's/:.*$//'`
623 # Check whether this is an Automake generated Makefile or not.
624 # We used to match only the files named `Makefile.in', but
625 # some people rename them; so instead we look at the file content.
626 # Grep'ing the first line is not enough: some people post-process
627 # each Makefile.in and add a new line on top of each file to say so.
628 # So let's grep whole file.
629 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
630 dirpart=`AS_DIRNAME("$mf")`
634 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
635 # Extract the definition of DEP_FILES from the Makefile without
637 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
638 test -z "$DEPDIR" && continue
639 # When using ansi2knr, U may be empty or an underscore; expand it
640 U=`sed -n -e '/^U = / s///p' < "$mf"`
641 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
642 # We invoke sed twice because it is the simplest approach to
643 # changing $(DEPDIR) to its actual value in the expansion.
644 for file in `sed -n -e '
645 /^DEP_FILES = .*\\\\$/ {
654 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
655 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
656 # Make sure the directory exists.
657 test -f "$dirpart/$file" && continue
658 fdir=`AS_DIRNAME(["$file"])`
659 AS_MKDIR_P([$dirpart/$fdir])
660 # echo "creating $dirpart/$file"
661 echo '# dummy' > "$dirpart/$file"
664 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
667 # AM_OUTPUT_DEPENDENCY_COMMANDS
668 # -----------------------------
669 # This macro should only be invoked once -- use via AC_REQUIRE.
671 # This code is only required when automatic dependency tracking
672 # is enabled. FIXME. This creates each `.P' file that we will
673 # need in order to bootstrap the dependency handling code.
674 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
675 [AC_CONFIG_COMMANDS([depfiles],
676 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
677 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
680 # Check to see how 'make' treats includes. -*- Autoconf -*-
682 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
684 # This program is free software; you can redistribute it and/or modify
685 # it under the terms of the GNU General Public License as published by
686 # the Free Software Foundation; either version 2, or (at your option)
689 # This program is distributed in the hope that it will be useful,
690 # but WITHOUT ANY WARRANTY; without even the implied warranty of
691 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
692 # GNU General Public License for more details.
694 # You should have received a copy of the GNU General Public License
695 # along with this program; if not, write to the Free Software
696 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
703 # Check to see how make treats includes.
704 AC_DEFUN([AM_MAKE_INCLUDE],
705 [am_make=${MAKE-make}
706 cat > confinc << 'END'
710 # If we don't find an include directive, just comment out the code.
711 AC_MSG_CHECKING([for style of include used by $am_make])
715 # First try GNU make style include.
716 echo "include confinc" > confmf
717 # We grep out `Entering directory' and `Leaving directory'
718 # messages which can occur if `w' ends up in MAKEFLAGS.
719 # In particular we don't look at `^make:' because GNU make might
720 # be invoked under some other name (usually "gmake"), in which
721 # case it prints its new name instead of `make'.
722 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
727 # Now try BSD make style include.
728 if test "$am__include" = "#"; then
729 echo '.include "confinc"' > confmf
730 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
736 AC_SUBST(am__include)
738 AC_MSG_RESULT($_am_result)
742 # AM_CONDITIONAL -*- Autoconf -*-
744 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
746 # This program is free software; you can redistribute it and/or modify
747 # it under the terms of the GNU General Public License as published by
748 # the Free Software Foundation; either version 2, or (at your option)
751 # This program is distributed in the hope that it will be useful,
752 # but WITHOUT ANY WARRANTY; without even the implied warranty of
753 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
754 # GNU General Public License for more details.
756 # You should have received a copy of the GNU General Public License
757 # along with this program; if not, write to the Free Software
758 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
765 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
766 # -------------------------------------
767 # Define a conditional.
768 AC_DEFUN([AM_CONDITIONAL],
769 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
770 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
780 AC_CONFIG_COMMANDS_PRE(
781 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
782 AC_MSG_ERROR([conditional "$1" was never defined.
783 Usually this means the macro was only invoked conditionally.])
788 dnl From Jim Meyering.
789 dnl Find a new-enough version of Perl.
794 dnl FIXME: don't hard-code 5.003
795 dnl FIXME: should we cache the result?
796 AC_MSG_CHECKING([for perl5.003 or newer])
797 if test "${PERL+set}" = set; then
798 # `PERL' is set in the user's environment.
799 candidate_perl_names="$PERL"
802 candidate_perl_names='perl perl5'
808 PERL="$missing_dir/missing perl"
809 for perl in $candidate_perl_names; do
810 # Run test in a subshell; some versions of sh will print an error if
811 # an executable is not found, even if stderr is redirected.
812 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
819 AC_MSG_RESULT($found)
820 test $found = no && AC_MSG_WARN([
821 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
822 a usable version of the Perl File::Compare module. As a result,
823 you may be unable to run a few tests or to regenerate certain
824 files if you modify the sources from which they are derived.
828 #serial 58 -*- autoconf -*-
830 dnl Misc type-related macros for fileutils, sh-utils, textutils.
832 AC_DEFUN([jm_MACROS],
836 GNU_PACKAGE="GNU $PACKAGE"
837 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
838 [The concatenation of the strings `GNU ', and PACKAGE.])
839 AC_SUBST(GNU_PACKAGE)
841 AM_MISSING_PROG(HELP2MAN, help2man)
842 AC_SUBST(OPTIONAL_BIN_PROGS)
843 AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
847 dnl This macro actually runs replacement code. See isc-posix.m4.
848 AC_REQUIRE([AC_ISC_POSIX])dnl
851 jm_INCLUDED_REGEX([lib/regex.c])
853 AC_REQUIRE([UTILS_HOST_OS])
854 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
855 AC_REQUIRE([jm_BISON])
856 AC_REQUIRE([jm_ASSERT])
857 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
858 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
859 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
860 AC_REQUIRE([jm_CHECK_DECLS])
862 AC_REQUIRE([jm_PREREQ])
864 AC_REQUIRE([UTILS_FUNC_DIRFD])
865 AC_REQUIRE([AC_FUNC_ACL])
866 AC_REQUIRE([AC_FUNC_FTW])
867 AC_REQUIRE([jm_FUNC_LCHOWN])
868 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
869 AC_REQUIRE([jm_FUNC_CHOWN])
870 AC_REQUIRE([jm_FUNC_MKTIME])
871 AC_REQUIRE([jm_FUNC_LSTAT])
872 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
873 AC_REQUIRE([jm_FUNC_STAT])
874 AC_REQUIRE([AC_FUNC_REALLOC])
875 AC_REQUIRE([AC_FUNC_MALLOC])
876 AC_REQUIRE([AC_FUNC_STRERROR_R])
877 AC_REQUIRE([jm_FUNC_NANOSLEEP])
878 AC_REQUIRE([jm_FUNC_MEMCMP])
879 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
880 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
881 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
882 AC_REQUIRE([jm_FUNC_PUTENV])
884 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
885 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
886 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
887 AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
888 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
889 AC_REQUIRE([jm_FUNC_MKTIME])
890 AC_REQUIRE([jm_FUNC_FPENDING])
892 # This is for od and stat, and any other program that
893 # uses the PRI.MAX macros from inttypes.h.
894 AC_REQUIRE([gt_INTTYPES_PRI])
896 AC_REQUIRE([jm_FUNC_GETGROUPS])
898 AC_REQUIRE([AC_FUNC_FSEEKO])
899 AC_REQUIRE([AC_FUNC_VPRINTF])
900 AC_REQUIRE([AC_FUNC_ALLOCA])
902 AC_CONFIG_LIBOBJ_DIR([lib])
905 AC_REQUIRE([jm_SYS_PROC_UPTIME])
906 AC_REQUIRE([jm_FUNC_FTRUNCATE])
907 AC_REQUIRE([vb_FUNC_RENAME])
909 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
910 AC_REPLACE_FUNCS(dup2)
911 AC_REPLACE_FUNCS(gethostname getusershell)
912 AC_REPLACE_FUNCS(sig2str)
913 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
914 AC_REPLACE_FUNCS(strpbrk)
915 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
916 AC_REPLACE_FUNCS(atexit)
917 AC_REPLACE_FUNCS(getpass)
919 # raise is used by at least sort and ls.
920 AC_REPLACE_FUNCS(raise)
922 dnl used by e.g. intl/*domain.c and lib/canon-host.c
923 AC_REPLACE_FUNCS(strdup)
925 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
926 AC_CHECK_FUNCS(getpagesize)
928 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
930 # By default, argmatch should fail calling usage (1).
931 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
932 [Define to the function xargmatch calls on failures.])
933 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
934 [Define to the declaration of the xargmatch failure function.])
936 dnl Used to define SETVBUF in sys2.h.
937 dnl This evokes the following warning from autoconf:
938 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
939 AC_FUNC_SETVBUF_REVERSED
941 # used by sleep and shred
942 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
943 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
945 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
946 # programs in the package would end up linked with that potentially-shared
947 # library, inducing unnecessary run-time overhead.
948 fetish_saved_libs=$LIBS
949 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
950 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
951 AC_SUBST(LIB_CLOCK_GETTIME)
952 AC_CHECK_FUNCS(clock_gettime clock_settime)
953 LIBS=$fetish_saved_libs
954 AC_CHECK_FUNCS(gettimeofday)
955 AC_FUNC_GETTIMEOFDAY_CLOBBER
957 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
958 AC_REQUIRE([jm_FUNC_UTIME])
992 if test $am_cv_func_working_getline != yes; then
993 AC_CHECK_FUNCS(getdelim)
998 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1000 # See if linking `seq' requires -lm.
1001 # It does on nearly every system. The single exception (so far) is
1002 # BeOS which has all the math functions in the normal runtime library
1003 # and doesn't have a separate math library.
1011 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1012 [ac_seq_save_LIBS="$LIBS"
1014 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1015 LIBS="$ac_seq_save_LIBS"
1021 jm_FUNC_UNLINK_BUSY_TEXT
1023 # These tests are for df.
1024 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1026 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1027 if test $list_mounted_fs = yes && test $space = yes; then
1030 AC_LIBOBJ(mountlist)
1032 AC_REQUIRE([jm_AC_DOS])
1033 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1037 # These tests must be run before any use of AC_CHECK_TYPE,
1038 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1039 # See the definition of ac_includes_default in `configure'.
1040 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1083 # This macro must be invoked before any tests that run the compiler.
1084 AC_DEFUN([jm_CHECK_ALL_TYPES],
1086 dnl This test must come as early as possible after the compiler configuration
1087 dnl tests, because the choice of the file model can (in principle) affect
1088 dnl whether functions and headers are available, whether they work, etc.
1089 AC_REQUIRE([AC_SYS_LARGEFILE])
1091 dnl This test must precede tests of compiler characteristics like
1092 dnl that for the inline keyword, since it may change the degree to
1093 dnl which the compiler supports such features.
1094 AC_REQUIRE([AM_C_PROTOTYPES])
1096 dnl Checks for typedefs, structures, and compiler characteristics.
1097 AC_REQUIRE([AC_C_BIGENDIAN])
1098 AC_REQUIRE([AC_C_CONST])
1099 AC_REQUIRE([AC_C_VOLATILE])
1100 AC_REQUIRE([AC_C_INLINE])
1101 AC_REQUIRE([AC_C_LONG_DOUBLE])
1103 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1104 AC_REQUIRE([AC_HEADER_DIRENT])
1105 AC_REQUIRE([AC_HEADER_STDC])
1107 [struct stat.st_author,
1108 struct stat.st_blksize],,,
1109 [$ac_includes_default
1110 #include <sys/stat.h>
1112 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1114 AC_REQUIRE([AC_STRUCT_TM])
1115 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1116 AC_REQUIRE([AC_HEADER_STAT])
1117 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1118 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1119 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1121 AC_REQUIRE([AC_TYPE_GETGROUPS])
1122 AC_REQUIRE([AC_TYPE_MODE_T])
1123 AC_REQUIRE([AC_TYPE_OFF_T])
1124 AC_REQUIRE([AC_TYPE_PID_T])
1125 AC_REQUIRE([AC_TYPE_SIGNAL])
1126 AC_REQUIRE([AC_TYPE_SIZE_T])
1127 AC_REQUIRE([AC_TYPE_UID_T])
1128 AC_CHECK_TYPE(ino_t, unsigned long)
1130 dnl This relies on the fact that autoconf 2.14a's implementation of
1131 dnl AC_CHECK_TYPE checks includes unistd.h.
1132 AC_CHECK_TYPE(ssize_t, int)
1133 AC_CHECK_TYPE(major_t, unsigned int)
1134 AC_CHECK_TYPE(minor_t, unsigned int)
1136 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1137 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1139 AC_REQUIRE([AC_HEADER_MAJOR])
1140 AC_REQUIRE([AC_HEADER_DIRENT])
1144 # isc-posix.m4 serial 2 (gettext-0.11.2)
1145 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1146 dnl This file is free software, distributed under the terms of the GNU
1147 dnl General Public License. As a special exception to the GNU General
1148 dnl Public License, this file may be distributed as part of a program
1149 dnl that contains a configuration script generated by Autoconf, under
1150 dnl the same distribution terms as the rest of that program.
1152 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1154 # This test replaces the one in autoconf.
1155 # Currently this macro should have the same name as the autoconf macro
1156 # because gettext's gettext.m4 (distributed in the automake package)
1157 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1158 # give these diagnostics:
1159 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1160 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1162 undefine([AC_ISC_POSIX])
1164 AC_DEFUN([AC_ISC_POSIX],
1166 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1167 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1173 dnl Initially derived from code in GNU grep.
1174 dnl Mostly written by Jim Meyering.
1176 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1178 AC_DEFUN([jm_INCLUDED_REGEX],
1180 dnl Even packages that don't use regex.c can use this macro.
1181 dnl Of course, for them it doesn't do anything.
1183 # Assume we'll default to using the included regex.c.
1184 ac_use_included_regex=yes
1186 # However, if the system regex support is good enough that it passes the
1187 # the following run test, then default to *not* using the included regex.c.
1188 # If cross compiling, assume the test would fail and use the included
1189 # regex.c. The first failing regular expression is from `Spencer ere
1190 # test #75' in grep-2.3.
1191 AC_CACHE_CHECK([for working re_compile_pattern],
1192 jm_cv_func_working_re_compile_pattern,
1200 static struct re_pattern_buffer regex;
1202 struct re_registers regs;
1203 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1204 memset (®ex, 0, sizeof (regex));
1205 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1206 /* This should fail with _Invalid character class name_ error. */
1210 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1211 memset (®ex, 0, sizeof (regex));
1212 s = re_compile_pattern ("{1", 2, ®ex);
1217 /* The following example is derived from a problem report
1218 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1219 memset (®ex, 0, sizeof (regex));
1220 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1224 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1225 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1228 memset (®ex, 0, sizeof (regex));
1229 s = re_compile_pattern ("x", 1, ®ex);
1233 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
1234 work with a negative RANGE argument. */
1235 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
1241 jm_cv_func_working_re_compile_pattern=yes,
1242 jm_cv_func_working_re_compile_pattern=no,
1243 dnl When crosscompiling, assume it's broken.
1244 jm_cv_func_working_re_compile_pattern=no))
1245 if test $jm_cv_func_working_re_compile_pattern = yes; then
1246 ac_use_included_regex=no
1249 test -n "$1" || AC_MSG_ERROR([missing argument])
1250 m4_syscmd([test -f $1])
1251 ifelse(m4_sysval, 0,
1253 AC_ARG_WITH(included-regex,
1254 [ --without-included-regex don't compile regex; this is the default on
1255 systems with version 2 of the GNU C library
1256 (use with caution on other system)],
1257 jm_with_regex=$withval,
1258 jm_with_regex=$ac_use_included_regex)
1259 if test "$jm_with_regex" = yes; then
1268 # Prerequisites of lib/regex.c.
1269 AC_DEFUN([jm_PREREQ_REGEX],
1271 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
1272 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1275 dnl Persuade glibc <string.h> to declare mempcpy().
1276 AC_REQUIRE([AC_GNU_SOURCE])
1278 AC_REQUIRE([AC_FUNC_ALLOCA])
1279 AC_REQUIRE([AC_HEADER_STDC])
1280 AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
1281 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
1282 AC_CHECK_FUNCS(btowc)
1285 # onceonly.m4 serial 1
1286 dnl Copyright (C) 2002 Free Software Foundation, Inc.
1287 dnl This file is free software, distributed under the terms of the GNU
1288 dnl General Public License. As a special exception to the GNU General
1289 dnl Public License, this file may be distributed as part of a program
1290 dnl that contains a configuration script generated by Autoconf, under
1291 dnl the same distribution terms as the rest of that program.
1293 dnl This file defines some "once only" variants of standard autoconf macros.
1294 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1295 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1296 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1297 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1298 dnl The advantage is that the check for each of the headers/functions/decls
1299 dnl will be put only once into the 'configure' file. It keeps the size of
1300 dnl the 'configure' file down, and avoids redundant output when 'configure'
1302 dnl The drawback is that the checks cannot be conditionalized. If you write
1303 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1304 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1305 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1308 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1309 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1310 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1312 AC_FOREACH([gl_HEADER_NAME], [$1], [
1313 AC_DEFUN([gl_CHECK_HEADER_]translit(gl_HEADER_NAME,[./-], [___]), [
1314 AC_CHECK_HEADERS(gl_HEADER_NAME)
1316 AC_REQUIRE([gl_CHECK_HEADER_]translit(gl_HEADER_NAME,[./-], [___]))
1320 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1321 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1322 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1324 AC_FOREACH([gl_FUNC_NAME], [$1], [
1325 AC_DEFUN([gl_CHECK_FUNC_]gl_FUNC_NAME, [
1326 AC_CHECK_FUNCS(gl_FUNC_NAME)
1328 AC_REQUIRE([gl_CHECK_FUNC_]gl_FUNC_NAME)
1332 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1333 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1334 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1336 AC_FOREACH([gl_DECL_NAME], [$1], [
1337 AC_DEFUN([gl_CHECK_DECL_]gl_DECL_NAME, [
1338 AC_CHECK_DECLS(gl_DECL_NAME)
1340 AC_REQUIRE([gl_CHECK_DECL_]gl_DECL_NAME)
1346 dnl From Paul Eggert.
1348 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1349 AC_DEFUN([UTILS_HOST_OS],
1351 AC_CACHE_CHECK([host operating system],
1352 utils_cv_host_operating_system,
1356 # These operating system names do not use the default heuristic below.
1357 # They are in reverse order, so that more-specific prefixes come first.
1358 winnt*) os='Windows NT';;
1360 sysv*) os='Unix System V';;
1361 superux*) os='SUPER-UX';;
1362 sunos*) os='SunOS';;
1364 sco*) os='SCO Unix';;
1365 riscos*) os='RISC OS';;
1366 riscix*) os='RISCiX';;
1370 plan9*) os='Plan 9';;
1373 openbsd*) os='OpenBSD';;
1374 nsk*) os='NonStop Kernel';;
1375 nonstopux*) os='NonStop-UX';;
1376 netbsd*) os='NetBSD';;
1377 msdosdjgpp*) os='DJGPP';;
1378 mpeix*) os='MPE/iX';;
1380 mingw*) os='MinGW';;
1381 lynxos*) os='LynxOS';;
1382 linux*) os='GNU/Linux';;
1386 freebsd*-gnu*) os='GNU/FreeBSD';;
1387 freebsd*) os='FreeBSD';;
1389 bsdi*) os='BSD/OS';;
1393 atheos*) os='AtheOS';;
1394 amigaos*) os='Amiga OS';;
1397 # The default heuristic takes the initial alphabetic string
1398 # from $host_os, but capitalizes its first letter.
1401 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1403 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1407 # If $host_os does not start with an alphabetic string, use it unchanged.
1411 utils_cv_host_operating_system=$os]])
1412 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1413 "$utils_cv_host_operating_system",
1414 [The host operating system.])
1419 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1420 # On such systems, arrange to use a wrapper function that removes any
1422 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1424 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1425 utils_cv_func_mkdir_trailing_slash_bug,
1427 # Arrange for deletion of the temporary directory this test might create.
1428 ac_clean_files="$ac_clean_files confdir-slash"
1430 # include <sys/types.h>
1431 # include <sys/stat.h>
1432 # include <stdlib.h>
1435 rmdir ("confdir-slash");
1436 exit (mkdir ("confdir-slash/", 0700));
1439 utils_cv_func_mkdir_trailing_slash_bug=no,
1440 utils_cv_func_mkdir_trailing_slash_bug=yes,
1441 utils_cv_func_mkdir_trailing_slash_bug=yes
1446 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1448 AC_DEFINE(mkdir, rpl_mkdir,
1449 [Define to rpl_mkdir if the replacement function should be used.])
1455 AC_DEFUN([jm_BISON],
1457 # getdate.y works with bison only.
1458 : ${YACC='bison -y'}
1463 dnl based on code from Eleftherios Gkioulekas
1465 AC_DEFUN([jm_ASSERT],
1467 AC_MSG_CHECKING(whether to enable assertions)
1468 AC_ARG_ENABLE(assert,
1469 [ --disable-assert turn off assertions],
1471 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1472 [ AC_MSG_RESULT(yes) ]
1478 dnl From Jim Meyering
1480 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1481 dnl usually in <utime.h>.
1482 dnl Some systems have utime.h but don't declare the struct anywhere.
1484 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1486 AC_CHECK_HEADERS(utime.h)
1487 AC_REQUIRE([AC_HEADER_TIME])
1488 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1491 #ifdef TIME_WITH_SYS_TIME
1492 # include <sys/time.h>
1495 # ifdef HAVE_SYS_TIME_H
1496 # include <sys/time.h>
1505 [static struct utimbuf x; x.actime = x.modtime;],
1506 fu_cv_sys_struct_utimbuf=yes,
1507 fu_cv_sys_struct_utimbuf=no)
1510 if test $fu_cv_sys_struct_utimbuf = yes; then
1511 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1512 [Define if struct utimbuf is declared -- usually in <utime.h>.
1513 Some systems have utime.h but don't declare the struct anywhere. ])
1519 dnl From Jim Meyering.
1521 dnl Check whether struct dirent has a member named d_type.
1524 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1525 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1526 AC_CACHE_CHECK([for d_type member in directory struct],
1527 jm_cv_struct_dirent_d_type,
1530 #include <sys/types.h>
1531 #ifdef HAVE_DIRENT_H
1532 # include <dirent.h>
1533 #else /* not HAVE_DIRENT_H */
1534 # define dirent direct
1535 # ifdef HAVE_SYS_NDIR_H
1536 # include <sys/ndir.h>
1537 # endif /* HAVE_SYS_NDIR_H */
1538 # ifdef HAVE_SYS_DIR_H
1539 # include <sys/dir.h>
1540 # endif /* HAVE_SYS_DIR_H */
1543 # endif /* HAVE_NDIR_H */
1544 #endif /* HAVE_DIRENT_H */
1546 [struct dirent dp; dp.d_type = 0;],
1548 jm_cv_struct_dirent_d_type=yes,
1549 jm_cv_struct_dirent_d_type=no)
1552 if test $jm_cv_struct_dirent_d_type = yes; then
1553 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1554 [Define if there is a member named d_type in the struct describing
1555 directory headers.])
1562 dnl From Jim Meyering.
1564 dnl Check whether struct dirent has a member named d_ino.
1567 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1568 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1569 AC_CACHE_CHECK([for d_ino member in directory struct],
1570 jm_cv_struct_dirent_d_ino,
1573 #include <sys/types.h>
1574 #ifdef HAVE_DIRENT_H
1575 # include <dirent.h>
1576 #else /* not HAVE_DIRENT_H */
1577 # define dirent direct
1578 # ifdef HAVE_SYS_NDIR_H
1579 # include <sys/ndir.h>
1580 # endif /* HAVE_SYS_NDIR_H */
1581 # ifdef HAVE_SYS_DIR_H
1582 # include <sys/dir.h>
1583 # endif /* HAVE_SYS_DIR_H */
1586 # endif /* HAVE_NDIR_H */
1587 #endif /* HAVE_DIRENT_H */
1589 [struct dirent dp; dp.d_ino = 0;],
1591 jm_cv_struct_dirent_d_ino=yes,
1592 jm_cv_struct_dirent_d_ino=no)
1595 if test $jm_cv_struct_dirent_d_ino = yes; then
1596 AC_DEFINE(D_INO_IN_DIRENT, 1,
1597 [Define if there is a member named d_ino in the struct describing
1598 directory headers.])
1605 dnl This is just a wrapper function to encapsulate this kludge.
1606 dnl Putting it in a separate file like this helps share it between
1607 dnl different packages.
1608 AC_DEFUN([jm_CHECK_DECLS],
1610 AC_REQUIRE([_jm_DECL_HEADERS])
1611 AC_REQUIRE([AC_HEADER_TIME])
1615 # if !STDC_HEADERS && HAVE_MEMORY_H
1616 # include <memory.h>
1618 # include <string.h>
1621 # include <strings.h>
1625 # include <stdlib.h>
1628 # include <unistd.h>
1631 #include <sys/types.h>
1632 #if TIME_WITH_SYS_TIME
1633 # include <sys/time.h>
1636 # if HAVE_SYS_TIME_H
1637 # include <sys/time.h>
1677 ttyname], , , $headers)
1680 dnl FIXME: when autoconf has support for it.
1681 dnl This is a little helper so we can require these header checks.
1682 AC_DEFUN([_jm_DECL_HEADERS],
1684 AC_REQUIRE([AC_HEADER_STDC])
1685 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1686 unistd.h sys/time.h utmp.h utmpx.h)
1691 dnl We use jm_ for non Autoconf macros.
1692 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1694 # These are the prerequisite macros for files in the lib/
1695 # directory of the coreutils package.
1697 AC_DEFUN([jm_PREREQ],
1699 AC_REQUIRE([jm_PREREQ_ADDEXT])
1700 AC_REQUIRE([jm_PREREQ_C_STACK])
1701 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1702 AC_REQUIRE([jm_PREREQ_DIRNAME])
1703 AC_REQUIRE([jm_PREREQ_ERROR])
1704 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1705 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1706 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1707 AC_REQUIRE([jm_PREREQ_HASH])
1708 AC_REQUIRE([jm_PREREQ_HUMAN])
1709 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1710 AC_REQUIRE([jm_PREREQ_MEMCHR])
1711 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1712 AC_REQUIRE([jm_PREREQ_POSIXVER])
1713 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1714 AC_REQUIRE([jm_PREREQ_READUTMP])
1715 AC_REQUIRE([jm_PREREQ_STAT])
1716 AC_REQUIRE([jm_PREREQ_STRNLEN])
1717 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1718 AC_REQUIRE([jm_PREREQ_XGETCWD])
1719 AC_REQUIRE([jm_PREREQ_XREADLINK])
1722 AC_DEFUN([jm_PREREQ_ADDEXT],
1725 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1726 AC_CHECK_FUNCS(pathconf)
1727 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1730 AC_DEFUN([jm_PREREQ_CANON_HOST],
1732 dnl Add any libraries as early as possible.
1733 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1734 dnl so we have to add -lnsl to LIBS before checking for that function.
1735 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1737 dnl These come from -lnsl on Solaris5.5.1.
1738 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1740 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1741 netinet/in.h arpa/inet.h)
1744 AC_DEFUN([jm_PREREQ_DIRNAME],
1746 AC_REQUIRE([AC_HEADER_STDC])
1747 AC_CHECK_HEADERS(string.h)
1750 AC_DEFUN([jm_PREREQ_EXCLUDE],
1752 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1753 AC_REQUIRE([AC_HEADER_STDBOOL])
1756 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1758 AC_CHECK_FUNCS(getpagesize)
1759 AC_CHECK_HEADERS(OS.h unistd.h)
1762 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1764 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1765 AC_CHECK_FUNCS(setlocale)
1766 AC_REQUIRE([AM_C_PROTOTYPES])
1769 AC_DEFUN([jm_PREREQ_HASH],
1771 AC_CHECK_HEADERS(stdlib.h)
1772 AC_REQUIRE([AC_HEADER_STDBOOL])
1773 AC_REQUIRE([jm_CHECK_DECLS])
1776 # If you use human.c, you need the following files:
1777 # inttypes.m4 longlong.m4
1778 AC_DEFUN([jm_PREREQ_HUMAN],
1780 AC_CHECK_HEADERS(locale.h)
1781 AC_CHECK_DECLS([getenv])
1782 AC_CHECK_FUNCS(localeconv)
1783 AC_REQUIRE([AC_HEADER_STDBOOL])
1784 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1787 AC_DEFUN([jm_PREREQ_MEMCHR],
1789 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1792 AC_DEFUN([jm_PREREQ_PHYSMEM],
1794 AC_CHECK_HEADERS(sys/pstat.h unistd.h)
1795 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
1798 AC_DEFUN([jm_PREREQ_POSIXVER],
1800 AC_CHECK_HEADERS(unistd.h)
1801 AC_CHECK_DECLS([getenv])
1804 AC_DEFUN([jm_PREREQ_QUOTEARG],
1806 AC_CHECK_FUNCS(isascii iswprint)
1807 AC_REQUIRE([jm_FUNC_MBRTOWC])
1808 AC_REQUIRE([jm_FUNC_MEMCMP])
1809 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1810 AC_REQUIRE([AC_HEADER_STDC])
1811 AC_REQUIRE([AC_C_BACKSLASH_A])
1812 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1813 AC_REQUIRE([AM_C_PROTOTYPES])
1816 AC_DEFUN([jm_PREREQ_READUTMP],
1818 AC_REQUIRE([AC_HEADER_STDC])
1819 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1820 AC_CHECK_FUNCS(utmpname)
1821 AC_CHECK_FUNCS(utmpxname)
1822 AC_REQUIRE([AM_C_PROTOTYPES])
1824 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1826 $ac_includes_default
1834 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1835 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1836 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1837 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1838 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1839 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1840 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1841 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1842 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1843 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1845 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1846 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1847 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1848 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1850 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1851 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1852 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1853 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1858 AC_DEFUN([jm_PREREQ_STAT],
1860 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1861 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1862 AC_CHECK_FUNCS(statvfs)
1863 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
1866 $ac_includes_default
1867 #if HAVE_SYS_STATVFS_H
1868 # include <sys/statvfs.h>
1871 # include <sys/vfs.h>
1873 #if ( ! HAVE_SYS_STATVFS_H && ! HAVE_SYS_VFS_H && HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H )
1874 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
1875 # include <sys/param.h>
1876 # include <sys/mount.h>
1879 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
1880 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
1881 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
1882 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
1883 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
1884 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
1885 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
1886 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
1887 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
1888 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
1889 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
1892 AC_DEFUN([jm_PREREQ_STRNLEN],
1894 AC_REQUIRE([AC_FUNC_STRNLEN])
1895 AC_REQUIRE([AC_HEADER_STDC])
1896 AC_CHECK_HEADERS(memory.h)
1897 AC_CHECK_DECLS([memchr])
1899 # This is necessary because automake-1.6.1 doesn't understand
1900 # that the above use of AC_FUNC_STRNLEN means we may have to use
1902 test $ac_cv_func_strnlen_working = yes \
1903 && AC_LIBOBJ(strnlen)
1906 AC_DEFUN([jm_PREREQ_TEMPNAME],
1908 AC_REQUIRE([AC_HEADER_STDC])
1909 AC_REQUIRE([AC_HEADER_STAT])
1910 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
1911 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
1912 AC_CHECK_DECLS([getenv])
1913 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1916 AC_DEFUN([jm_PREREQ_XGETCWD],
1918 AC_REQUIRE([AC_C_PROTOTYPES])
1919 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
1920 AC_CHECK_FUNCS(getcwd)
1921 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
1924 AC_DEFUN([jm_PREREQ_XREADLINK],
1926 AC_REQUIRE([AC_C_PROTOTYPES])
1927 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
1930 # Check prerequisites for compiling lib/c-stack.c.
1932 # Copyright (C) 2002 Free Software Foundation, Inc.
1934 # This program is free software; you can redistribute it and/or modify
1935 # it under the terms of the GNU General Public License as published by
1936 # the Free Software Foundation; either version 2, or (at your option)
1937 # any later version.
1939 # This program is distributed in the hope that it will be useful,
1940 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1941 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1942 # GNU General Public License for more details.
1944 # You should have received a copy of the GNU General Public License
1945 # along with this program; if not, write to the Free Software
1946 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1949 # Written by Paul Eggert.
1951 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
1952 [# for STACK_DIRECTION
1953 AC_REQUIRE([AC_FUNC_ALLOCA])
1955 AC_CACHE_CHECK([for working C stack overflow detection],
1956 ac_cv_sys_xsi_stack_overflow_heuristic,
1960 #include <ucontext.h>
1964 char buffer[SIGSTKSZ];
1968 } alternate_signal_stack;
1971 # define find_stack_direction(ptr) STACK_DIRECTION
1974 find_stack_direction (char const *addr)
1977 return (! addr ? find_stack_direction (&dummy)
1978 : addr < &dummy ? 1 : -1);
1983 segv_handler (int signo, siginfo_t *info, void *context)
1985 if (0 < info->si_code)
1987 ucontext_t const *user_context = context;
1988 char const *stack_min = user_context->uc_stack.ss_sp;
1989 size_t stack_size = user_context->uc_stack.ss_size;
1990 char const *faulting_address = info->si_addr;
1991 size_t s = faulting_address - stack_min;
1992 size_t page_size = sysconf (_SC_PAGESIZE);
1993 if (find_stack_direction (0) < 0)
1995 if (s < stack_size + page_size)
2003 c_stack_action (void)
2006 struct sigaction act;
2010 st.ss_sp = alternate_signal_stack.buffer;
2011 st.ss_size = sizeof alternate_signal_stack.buffer;
2012 r = sigaltstack (&st, 0);
2016 sigemptyset (&act.sa_mask);
2017 act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
2018 act.sa_sigaction = segv_handler;
2019 return sigaction (SIGSEGV, &act, 0);
2027 return *p + recurse (array);
2034 return recurse ("\1");
2037 [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
2038 [ac_cv_sys_xsi_stack_overflow_heuristic=no],
2039 [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
2041 if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
2042 AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1,
2043 [Define to 1 if extending the stack slightly past the limit causes
2044 a SIGSEGV, and an alternate stack can be established with sigaltstack,
2045 and the signal handler is passed a context that specifies the
2046 run time stack. This behavior is defined by POSIX 1003.1-2001
2047 with the X/Open System Interface (XSI) option
2048 and is a standardized way to implement a SEGV-based stack
2049 overflow detection heuristic.])
2053 AC_DEFUN([jm_PREREQ_C_STACK],
2054 [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
2056 # for STACK_DIRECTION
2057 AC_REQUIRE([AC_FUNC_ALLOCA])
2059 AC_CHECK_FUNCS(getcontext sigaltstack)
2060 AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
2061 AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
2063 AC_CHECK_HEADERS(sys/resource.h ucontext.h unistd.h)
2065 AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
2069 dnl FIXME: put these prerequisite-only *.m4 files in a separate
2070 dnl directory -- otherwise, they'll conflict with existing files.
2072 dnl These are the prerequisite macros for GNU's error.c file.
2073 AC_DEFUN([jm_PREREQ_ERROR],
2075 AC_CHECK_FUNCS(strerror vprintf doprnt)
2076 AC_CHECK_DECLS([strerror])
2077 AC_CHECK_HEADERS([libintl.h])
2084 dnl autoconf tests required for use of mbswidth.c
2085 dnl From Bruno Haible.
2087 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2089 AC_REQUIRE([AC_HEADER_STDC])
2090 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2091 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2094 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2096 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2098 # include <string.h>
2105 char *p = (char *) wcwidth;
2107 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2108 if test $ac_cv_have_decl_wcwidth = yes; then
2113 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2114 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2119 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2120 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2121 dnl This file is free software, distributed under the terms of the GNU
2122 dnl General Public License. As a special exception to the GNU General
2123 dnl Public License, this file may be distributed as part of a program
2124 dnl that contains a configuration script generated by Autoconf, under
2125 dnl the same distribution terms as the rest of that program.
2127 dnl From Paul Eggert
2129 AC_DEFUN([jm_FUNC_MBRTOWC],
2131 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2134 [#include <wchar.h>],
2135 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2136 jm_cv_func_mbrtowc=yes,
2137 jm_cv_func_mbrtowc=no)])
2138 if test $jm_cv_func_mbrtowc = yes; then
2139 AC_DEFINE(HAVE_MBRTOWC, 1,
2140 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2146 dnl A replacement for autoconf's macro by the same name. This version
2147 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2148 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2149 dnl run only if one of the listed libraries ends up being used (and not in
2150 dnl the `none required' case.
2151 dnl I hope it's only temporary while we wait for that version to be fixed.
2152 undefine([AC_SEARCH_LIBS])
2154 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2155 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2156 # [OTHER-LIBRARIES])
2157 # --------------------------------------------------------
2158 # Search for a library defining FUNC, if it's not already available.
2159 AC_DEFUN([AC_SEARCH_LIBS],
2161 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2163 ac_func_search_save_LIBS=$LIBS
2165 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2166 if test "$ac_cv_search_$1" = no; then
2167 for ac_lib in $2; do
2168 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2169 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2172 LIBS=$ac_func_search_save_LIBS
2175 if test "$ac_cv_search_$1" = no; then :
2178 if test "$ac_cv_search_$1" = 'none required'; then :
2181 LIBS="$ac_cv_search_$1 $LIBS"
2187 # Check for stdbool.h that conforms to C99.
2189 # Copyright (C) 2002 Free Software Foundation, Inc.
2191 # This program is free software; you can redistribute it and/or modify
2192 # it under the terms of the GNU General Public License as published by
2193 # the Free Software Foundation; either version 2, or (at your option)
2194 # any later version.
2196 # This program is distributed in the hope that it will be useful,
2197 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2198 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2199 # GNU General Public License for more details.
2201 # You should have received a copy of the GNU General Public License
2202 # along with this program; if not, write to the Free Software
2203 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2206 AC_DEFUN([AC_HEADER_STDBOOL],
2207 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2208 [ac_cv_header_stdbool_h],
2211 #include <stdbool.h>
2213 "error: bool is not defined"
2216 "error: false is not defined"
2219 "error: false is not 0"
2222 "error: false is not defined"
2225 "error: true is not 1"
2227 #ifndef __bool_true_false_are_defined
2228 "error: __bool_true_false_are_defined is not defined"
2231 struct s { _Bool s: 1; _Bool t; } s;
2233 char a[true == 1 ? 1 : -1];
2234 char b[false == 0 ? 1 : -1];
2235 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2236 char d[(bool) -0.5 == true ? 1 : -1];
2238 char f[(_Bool) -0.0 == false ? 1 : -1];
2240 char h[sizeof (_Bool)];
2243 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2244 [ac_cv_header_stdbool_h=yes],
2245 [ac_cv_header_stdbool_h=no])])
2246 if test $ac_cv_header_stdbool_h = yes; then
2247 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2251 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2253 # This program is free software; you can redistribute it and/or modify
2254 # it under the terms of the GNU General Public License as published by
2255 # the Free Software Foundation; either version 2, or (at your option)
2256 # any later version.
2258 # This program is distributed in the hope that it will be useful,
2259 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2260 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2261 # GNU General Public License for more details.
2263 # You should have received a copy of the GNU General Public License
2264 # along with this program; if not, write to the Free Software
2265 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2270 AC_DEFUN([AM_C_PROTOTYPES],
2271 [AC_REQUIRE([AM_PROG_CC_STDC])
2272 AC_REQUIRE([AC_PROG_CPP])
2273 AC_MSG_CHECKING([for function prototypes])
2274 if test "$am_cv_prog_cc_stdc" != no; then
2276 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2280 U=_ ANSI2KNR=./ansi2knr
2282 # Ensure some checks needed by ansi2knr itself.
2284 AC_CHECK_HEADERS(string.h)
2286 AC_SUBST(ANSI2KNR)dnl
2289 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2292 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2294 # This program is free software; you can redistribute it and/or modify
2295 # it under the terms of the GNU General Public License as published by
2296 # the Free Software Foundation; either version 2, or (at your option)
2297 # any later version.
2299 # This program is distributed in the hope that it will be useful,
2300 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2302 # GNU General Public License for more details.
2304 # You should have received a copy of the GNU General Public License
2305 # along with this program; if not, write to the Free Software
2306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2311 # @defmac AC_PROG_CC_STDC
2312 # @maindex PROG_CC_STDC
2314 # If the C compiler in not in ANSI C mode by default, try to add an option
2315 # to output variable @code{CC} to make it so. This macro tries various
2316 # options that select ANSI C on some system or another. It considers the
2317 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2319 # If you use this macro, you should check after calling it whether the C
2320 # compiler has been set to accept ANSI C; if not, the shell variable
2321 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2322 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2323 # program @code{ansi2knr}, which comes with Ghostscript.
2326 AC_DEFUN([AM_PROG_CC_STDC],
2327 [AC_REQUIRE([AC_PROG_CC])
2328 AC_BEFORE([$0], [AC_C_INLINE])
2329 AC_BEFORE([$0], [AC_C_CONST])
2330 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2331 dnl a magic option to avoid problems with ANSI preprocessor commands
2333 dnl FIXME: can't do this because then AC_AIX won't work due to a
2334 dnl circular dependency.
2335 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2336 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2337 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2338 [am_cv_prog_cc_stdc=no
2340 # Don't try gcc -ansi; that turns off useful extensions and
2341 # breaks some systems' header files.
2342 # AIX -qlanglvl=ansi
2343 # Ultrix and OSF/1 -std1
2344 # HP-UX 10.20 and later -Ae
2345 # HP-UX older versions -Aa -D_HPUX_SOURCE
2346 # SVR4 -Xc -D__EXTENSIONS__
2347 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2349 CC="$ac_save_CC $ac_arg"
2351 [#include <stdarg.h>
2353 #include <sys/types.h>
2354 #include <sys/stat.h>
2355 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2356 struct buf { int x; };
2357 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2358 static char *e (p, i)
2364 static char *f (char * (*g) (char **, int), char **p, ...)
2369 s = g (p, va_arg (v,int));
2373 int test (int i, double x);
2374 struct s1 {int (*f) (int a);};
2375 struct s2 {int (*f) (double a);};
2376 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2380 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2382 [am_cv_prog_cc_stdc="$ac_arg"; break])
2386 if test -z "$am_cv_prog_cc_stdc"; then
2387 AC_MSG_RESULT([none needed])
2389 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2391 case "x$am_cv_prog_cc_stdc" in
2393 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2397 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2401 dnl From Paul Eggert.
2405 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
2407 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
2409 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2410 AC_CHECK_TYPE(intmax_t, ,
2411 [test $ac_cv_type_long_long = yes \
2412 && ac_type='long long' \
2414 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
2415 [Define to widest signed type if <inttypes.h> doesn't define.])])
2418 # Define uintmax_t to unsigned long or unsigned long long
2419 # if <inttypes.h> doesn't define.
2421 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2423 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2424 AC_CHECK_TYPE(uintmax_t, ,
2425 [test $ac_cv_type_unsigned_long_long = yes \
2426 && ac_type='unsigned long long' \
2427 || ac_type='unsigned long'
2428 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2429 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
2434 dnl From Paul Eggert.
2436 # Define HAVE_LONG_LONG if 'long long' works.
2438 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2440 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2441 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2442 [long long llmax = (long long) -1;
2443 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2444 ac_cv_type_long_long=yes,
2445 ac_cv_type_long_long=no)])
2446 if test $ac_cv_type_long_long = yes; then
2447 AC_DEFINE(HAVE_LONG_LONG, 1,
2448 [Define if you have the long long type.])
2452 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2454 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2456 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2457 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2458 [unsigned long long ullmax = (unsigned long long) -1;
2459 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2460 ac_cv_type_unsigned_long_long=yes,
2461 ac_cv_type_unsigned_long_long=no)])
2462 if test $ac_cv_type_unsigned_long_long = yes; then
2463 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2464 [Define if you have the unsigned long long type.])
2470 AC_DEFUN([jm_FUNC_MEMCMP],
2471 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2472 if test $ac_cv_func_memcmp_working = no; then
2473 AC_DEFINE(memcmp, rpl_memcmp,
2474 [Define to rpl_memcmp if the replacement function should be used.])
2478 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2480 # Copyright 2001 Free Software Foundation, Inc.
2482 # This program is free software; you can redistribute it and/or modify
2483 # it under the terms of the GNU General Public License as published by
2484 # the Free Software Foundation; either version 2, or (at your option)
2485 # any later version.
2487 # This program is distributed in the hope that it will be useful,
2488 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2489 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2490 # GNU General Public License for more details.
2492 # You should have received a copy of the GNU General Public License
2493 # along with this program; if not, write to the Free Software Foundation,
2494 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2496 # Written by Paul Eggert.
2498 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2499 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2500 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2501 [ac_cv_func_getcwd_null],
2504 # ifdef HAVE_STDLIB_H
2505 # include <stdlib.h>
2507 # ifdef HAVE_UNISTD_H
2508 # include <unistd.h>
2516 if (chdir ("/") != 0)
2520 char *f = getcwd (NULL, 0);
2521 exit (! (f && f[0] == '/' && !f[1]));
2524 [ac_cv_func_getcwd_null=yes],
2525 [ac_cv_func_getcwd_null=no],
2526 [ac_cv_func_getcwd_null=no])])
2527 if test $ac_cv_func_getcwd_null = yes; then
2528 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2529 [Define if getcwd (NULL, 0) allocates memory for result.])
2534 dnl Find out how to get the file descriptor associated with an open DIR*.
2535 dnl From Jim Meyering
2537 AC_DEFUN([UTILS_FUNC_DIRFD],
2539 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2540 AC_REQUIRE([AC_PROG_CPP])
2541 AC_REQUIRE([AC_PROG_EGREP])
2546 # include <dirent.h>
2547 #else /* not HAVE_DIRENT_H */
2548 # define dirent direct
2549 # if HAVE_SYS_NDIR_H
2550 # include <sys/ndir.h>
2551 # endif /* HAVE_SYS_NDIR_H */
2553 # include <sys/dir.h>
2554 # endif /* HAVE_SYS_DIR_H */
2557 # endif /* HAVE_NDIR_H */
2558 #endif /* HAVE_DIRENT_H */
2560 AC_CHECK_FUNCS(dirfd)
2561 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2563 AC_CACHE_CHECK([whether dirfd is a macro],
2564 jm_cv_func_dirfd_macro,
2565 AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2567 dirent_header_defines_dirfd
2569 jm_cv_func_dirfd_macro=yes,
2570 jm_cv_func_dirfd_macro=no))
2572 # Use the replacement only if we have no function, macro,
2573 # or declaration with that name.
2574 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2576 AC_REPLACE_FUNCS([dirfd])
2578 [how to get the file descriptor associated with an open DIR*],
2579 ac_cv_sys_dir_fd_member_name,
2581 dirfd_save_CFLAGS=$CFLAGS
2582 for ac_expr in d_fd dd_fd; do
2584 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2588 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2591 CFLAGS=$dirfd_save_CFLAGS
2592 test "$dir_fd_found" = yes && break
2594 test "$dir_fd_found" = yes || ac_expr=-1
2596 ac_cv_sys_dir_fd_member_name=$ac_expr
2599 if test $ac_cv_have_decl_dirfd = no; then
2600 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2601 $ac_cv_sys_dir_fd_member_name,
2602 [the name of the file descriptor member of DIR])
2604 AH_VERBATIM(DIR_TO_FD,
2605 [#ifdef DIR_FD_MEMBER_NAME
2606 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2608 # define DIR_TO_FD(Dir_p) -1
2615 # acl.m4 - check for access control list (ACL) primitives
2617 # Copyright (C) 2002 Free Software Foundation, Inc.
2619 # This program is free software; you can redistribute it and/or modify
2620 # it under the terms of the GNU General Public License as published by
2621 # the Free Software Foundation; either version 2, or (at your option)
2622 # any later version.
2624 # This program is distributed in the hope that it will be useful,
2625 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2626 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2627 # GNU General Public License for more details.
2629 # You should have received a copy of the GNU General Public License
2630 # along with this program; if not, write to the Free Software Foundation,
2631 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2633 # Written by Paul Eggert.
2635 AC_DEFUN([AC_FUNC_ACL],
2636 [AC_CHECK_HEADERS(sys/acl.h)
2637 AC_CHECK_FUNCS(acl)])
2640 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2641 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
2642 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
2643 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
2644 # objects and arrange to use lib/search.h if necessary.
2647 AC_DEFUN([AC_FUNC_FTW],
2650 AC_REQUIRE([jm_FUNC_LSTAT])
2651 AC_REQUIRE([AC_HEADER_DIRENT])
2652 AC_CHECK_HEADERS(sys/param.h)
2653 AC_CHECK_DECLS([stpcpy])
2655 # In the event that we have to use the replacement ftw.c,
2656 # see if we'll also need the replacement tsearch.c.
2657 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2659 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
2660 ac_cv_func_ftw_working,
2662 # The following test would fail prior to glibc-2.3.2, because `depth'
2663 # would be 2 rather than 4. Of course, now that we require FTW_DCH
2664 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
2665 mkdir -p conftest.dir/a/b/c
2666 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2671 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2672 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2673 static char **p = _f;
2677 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2679 if (strcmp (file, *p++) != 0)
2688 /* Require these symbols, too. */
2692 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2693 exit ((err == 0 && depth == 4) ? 0 : 1);
2696 [ac_cv_func_ftw_working=yes],
2697 [ac_cv_func_ftw_working=no],
2698 [ac_cv_func_ftw_working=no])])
2700 if test $ac_cv_func_ftw_working = no; then
2702 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2703 # Add tsearch.o IFF we have to use the replacement ftw.c.
2704 if test -n "$need_tdestroy"; then
2705 AC_LIBOBJ([tsearch])
2706 # Link search.h to search_.h if we use the replacement tsearch.c.
2708 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2715 dnl From Jim Meyering.
2716 dnl Determine whether lstat has the bug that it succeeds when given the
2717 dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
2718 dnl (as of 1998-11-01) do this.
2720 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2721 dnl compile the wrapper function.
2724 AC_DEFUN([jm_FUNC_LSTAT],
2726 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2727 AC_CACHE_CHECK([whether lstat accepts an empty string],
2728 jm_cv_func_lstat_empty_string_bug,
2730 # include <sys/types.h>
2731 # include <sys/stat.h>
2737 exit (lstat ("", &sbuf) ? 1 : 0);
2740 jm_cv_func_lstat_empty_string_bug=yes,
2741 jm_cv_func_lstat_empty_string_bug=no,
2742 dnl When crosscompiling, assume lstat is broken.
2743 jm_cv_func_lstat_empty_string_bug=yes)
2745 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2747 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2748 [Define if lstat has the bug that it succeeds when given the zero-length
2749 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2756 dnl From Jim Meyering.
2757 dnl Provide lchown on systems that lack it.
2759 AC_DEFUN([jm_FUNC_LCHOWN],
2761 AC_REQUIRE([AC_TYPE_UID_T])
2762 AC_REPLACE_FUNCS(lchown)
2767 # When rmdir fails because the specified directory is not empty, it sets
2768 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2769 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2770 # in general, to avoid depending on the use of any particular symbol, this
2771 # test runs a test to determine the actual numeric value.
2772 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2774 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2775 fetish_cv_func_rmdir_errno_not_empty,
2777 # Arrange for deletion of the temporary directory this test creates.
2778 ac_clean_files="$ac_clean_files confdir2"
2779 mkdir confdir2; : > confdir2/file
2792 s = fopen ("confdir2/errno", "w");
2793 fprintf (s, "%d\n", val);
2797 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2798 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2799 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2804 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2805 $fetish_cv_func_rmdir_errno_not_empty,
2806 [the value to which errno is set when rmdir fails on a nonempty directory])
2811 dnl From Jim Meyering.
2812 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2813 dnl If it doesn't, arrange to use the replacement function.
2816 AC_DEFUN([jm_FUNC_CHOWN],
2817 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2818 test -z "$ac_cv_header_unistd_h" \
2819 && AC_CHECK_HEADERS(unistd.h)
2820 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2822 # include <sys/types.h>
2823 # include <sys/stat.h>
2825 # ifdef HAVE_UNISTD_H
2826 # include <unistd.h>
2832 char *f = "conftest.chown";
2833 struct stat before, after;
2835 if (creat (f, 0600) < 0)
2837 if (stat (f, &before) < 0)
2839 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2841 if (stat (f, &after) < 0)
2843 exit ((before.st_uid == after.st_uid
2844 && before.st_gid == after.st_gid) ? 0 : 1);
2847 jm_cv_func_working_chown=yes,
2848 jm_cv_func_working_chown=no,
2849 dnl When crosscompiling, assume chown is broken.
2850 jm_cv_func_working_chown=no)
2852 if test $jm_cv_func_working_chown = no; then
2854 AC_DEFINE(chown, rpl_chown,
2855 [Define to rpl_chown if the replacement function should be used.])
2861 dnl From Jim Meyering.
2862 dnl A wrapper around AC_FUNC_MKTIME.
2864 AC_DEFUN([jm_FUNC_MKTIME],
2865 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2867 dnl mktime.c uses localtime_r if it exists. Check for it.
2868 AC_CHECK_FUNCS(localtime_r)
2870 if test $ac_cv_func_working_mktime = no; then
2871 AC_DEFINE(mktime, rpl_mktime,
2872 [Define to rpl_mktime if the replacement function should be used.])
2878 dnl From Jim Meyering.
2879 dnl Determine whether stat has the bug that it succeeds when given the
2880 dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
2881 dnl (as of 1998-11-01) do this.
2883 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
2884 dnl compile the wrapper function.
2887 AC_DEFUN([jm_FUNC_STAT],
2889 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2890 AC_CACHE_CHECK([whether stat accepts an empty string],
2891 jm_cv_func_stat_empty_string_bug,
2893 # include <sys/types.h>
2894 # include <sys/stat.h>
2900 exit (stat ("", &sbuf) ? 1 : 0);
2903 jm_cv_func_stat_empty_string_bug=yes,
2904 jm_cv_func_stat_empty_string_bug=no,
2905 dnl When crosscompiling, assume stat is broken.
2906 jm_cv_func_stat_empty_string_bug=yes)
2908 if test $jm_cv_func_stat_empty_string_bug = yes; then
2910 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
2911 [Define if stat has the bug that it succeeds when given the zero-length
2912 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2919 dnl From Jim Meyering.
2920 dnl Check for the nanosleep function.
2921 dnl If not found, use the supplied replacement.
2924 AC_DEFUN([jm_FUNC_NANOSLEEP],
2926 nanosleep_save_libs=$LIBS
2928 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
2929 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
2930 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
2931 AC_SUBST(LIB_NANOSLEEP)
2933 AC_CACHE_CHECK([whether nanosleep works],
2934 jm_cv_func_nanosleep_works,
2936 AC_REQUIRE([AC_HEADER_TIME])
2938 # if TIME_WITH_SYS_TIME
2939 # include <sys/time.h>
2942 # if HAVE_SYS_TIME_H
2943 # include <sys/time.h>
2952 struct timespec ts_sleep, ts_remaining;
2953 ts_sleep.tv_sec = 0;
2954 ts_sleep.tv_nsec = 1;
2955 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
2958 jm_cv_func_nanosleep_works=yes,
2959 jm_cv_func_nanosleep_works=no,
2960 dnl When crosscompiling, assume the worst.
2961 jm_cv_func_nanosleep_works=no)
2963 if test $jm_cv_func_nanosleep_works = no; then
2964 AC_LIBOBJ(nanosleep)
2965 AC_DEFINE(nanosleep, rpl_nanosleep,
2966 [Define to rpl_nanosleep if the replacement function should be used.])
2969 LIBS=$nanosleep_save_libs
2972 #serial 7 -*- autoconf -*-
2974 dnl From Jim Meyering.
2976 dnl See if the glibc *_unlocked I/O macros are available.
2977 dnl Use only those *_unlocked macros that are declared.
2980 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
2982 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
2983 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2984 fread_unlocked, fwrite_unlocked, getc_unlocked,
2985 getchar_unlocked, putc_unlocked, putchar_unlocked])])
2989 dnl Written by Jim Meyering
2991 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
2993 dnl Do this replacement check manually because I want the hyphen
2994 dnl (not the underscore) in the filename.
2995 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3001 dnl From Jim Meyering.
3003 dnl Check whether putenv ("FOO") removes FOO from the environment.
3004 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3007 AC_DEFUN([jm_FUNC_PUTENV],
3008 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3013 /* Put it in env. */
3014 if (putenv ("CONFTEST_putenv=val"))
3017 /* Try to remove it. */
3018 if (putenv ("CONFTEST_putenv"))
3021 /* Make sure it was deleted. */
3022 if (getenv ("CONFTEST_putenv") != 0)
3028 jm_cv_func_svid_putenv=yes,
3029 jm_cv_func_svid_putenv=no,
3030 dnl When crosscompiling, assume putenv is broken.
3031 jm_cv_func_svid_putenv=no)
3033 if test $jm_cv_func_svid_putenv = no; then
3035 AC_DEFINE(putenv, rpl_putenv,
3036 [Define to rpl_putenv if the replacement function should be used.])
3044 AC_MSG_CHECKING(for AFS)
3045 if test -d /afs; then
3046 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3051 AC_MSG_RESULT($ac_result)
3056 # autoconf tests required for use of xstrtoumax.c
3058 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3060 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3061 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3062 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3063 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3064 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3065 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3067 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3068 jm_cv_func_strtoumax_macro,
3069 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3071 inttypes_h_defines_strtoumax
3073 jm_cv_func_strtoumax_macro=yes,
3074 jm_cv_func_strtoumax_macro=no))
3076 if test "$jm_cv_func_strtoumax_macro" != yes; then
3077 AC_REPLACE_FUNCS(strtoumax)
3080 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3081 dnl so we need the replacements only if strtoumax does not exist.
3082 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3084 AC_REPLACE_FUNCS(strtoul)
3086 dnl We don't need (and can't compile) the replacement strtoull
3087 dnl unless the type `unsigned long long' exists.
3088 if test "$ac_cv_type_unsigned_long_long" = yes; then
3089 AC_REPLACE_FUNCS(strtoull)
3096 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3098 # autoconf tests required for use of xstrtoimax.c
3100 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3102 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3103 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3104 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3105 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3106 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3107 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3109 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3110 jm_cv_func_strtoimax_macro,
3111 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3113 inttypes_h_defines_strtoimax
3115 jm_cv_func_strtoimax_macro=yes,
3116 jm_cv_func_strtoimax_macro=no))
3118 if test "$jm_cv_func_strtoimax_macro" != yes; then
3119 AC_REPLACE_FUNCS(strtoimax)
3122 dnl Only the replacement strtoimax invokes strtol and strtoll,
3123 dnl so we need the replacements only if strtoimax does not exist.
3124 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3126 AC_REPLACE_FUNCS(strtol)
3128 dnl We don't need (and can't compile) the replacement strtoll
3129 dnl unless the type `long long' exists.
3130 if test "$ac_cv_type_long_long" = yes; then
3131 AC_REPLACE_FUNCS(strtoll)
3138 dnl Run a program to determine whether whether link(2) follows symlinks.
3139 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3141 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3144 [whether link(2) dereferences a symlink specified with a trailing slash],
3145 jm_ac_cv_func_link_follows_symlink,
3147 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3148 dnl the appropriate framework.
3149 test -z "$ac_cv_header_unistd_h" \
3150 && AC_CHECK_HEADERS(unistd.h)
3152 # Create a regular file.
3153 echo > conftest.file
3156 # include <sys/types.h>
3157 # include <sys/stat.h>
3158 # ifdef HAVE_UNISTD_H
3159 # include <unistd.h>
3162 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3163 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3164 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3169 const char *file = "conftest.file";
3170 const char *sym = "conftest.sym";
3171 const char *hard = "conftest.hard";
3172 struct stat sb_file, sb_hard;
3174 /* Create a symlink to the regular file. */
3175 if (symlink (file, sym))
3178 /* Create a hard link to that symlink. */
3179 if (link (sym, hard))
3182 if (lstat (hard, &sb_hard))
3184 if (lstat (file, &sb_file))
3187 /* If the dev/inode of hard and file are the same, then
3188 the link call followed the symlink. */
3189 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3192 jm_ac_cv_func_link_follows_symlink=yes,
3193 jm_ac_cv_func_link_follows_symlink=no,
3194 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3197 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3198 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3199 [Define if `link(2)' dereferences symbolic links.])
3205 dnl This macro is intended to be used solely in this file.
3206 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3207 AC_DEFUN([_jm_STRFTIME_PREREQS],
3209 dnl strftime.c uses localtime_r and the underyling system strftime
3211 AC_CHECK_FUNCS(localtime_r strftime)
3213 AC_CHECK_HEADERS(limits.h)
3214 AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
3216 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3219 AC_CHECK_FUNCS(mblen mbrlen)
3221 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3222 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3223 [Define if struct tm has the tm_gmtoff member.])],
3225 [#include <time.h>])
3228 dnl From Jim Meyering.
3230 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3231 [AC_REQUIRE([AC_HEADER_TIME])dnl
3233 _jm_STRFTIME_PREREQS
3235 AC_REQUIRE([AC_C_CONST])dnl
3236 AC_REQUIRE([AC_HEADER_STDC])dnl
3237 AC_CHECK_HEADERS(sys/time.h)
3238 AC_DEFINE([my_strftime], [nstrftime],
3239 [Define to the name of the strftime replacement function.])
3242 AC_DEFUN([jm_FUNC_STRFTIME],
3244 _jm_STRFTIME_PREREQS
3249 dnl From Jim Meyering
3250 dnl Using code from emacs, based on suggestions from Paul Eggert
3251 dnl and Ulrich Drepper.
3253 dnl Find out how to determine the number of pending output bytes on a stream.
3254 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3255 dnl we have to grub around in the FILE struct.
3257 AC_DEFUN([jm_FUNC_FPENDING],
3259 AC_CHECK_HEADERS(stdio_ext.h)
3260 AC_REPLACE_FUNCS([__fpending])
3262 # if HAVE_STDIO_EXT_H
3263 # include <stdio_ext.h>
3266 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3267 if test $ac_cv_func___fpending = no; then
3269 [how to determine the number of pending output bytes on a stream],
3270 ac_cv_sys_pending_output_n_bytes,
3275 'fp->_IO_write_ptr - fp->_IO_write_base' \
3277 '# traditional Unix' \
3278 'fp->_ptr - fp->_base' \
3281 'fp->_p - fp->_bf._base' \
3284 'fp->__ptr - fp->__base' \
3287 'fp->__bufp - fp->__buffer' \
3289 '# old glibc iostream?' \
3290 'fp->_pptr - fp->_pbase' \
3293 '(*fp)->_ptr - (*fp)->_base' \
3295 '# e.g., DGUX R4.11; the info is not available' \
3299 # Skip each embedded comment.
3300 case "$ac_expr" in '#'*) continue;; esac
3305 [FILE *fp = stdin; (void) ($ac_expr);],
3308 test "$fp_done" = yes && break
3311 ac_cv_sys_pending_output_n_bytes=$ac_expr
3314 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3315 $ac_cv_sys_pending_output_n_bytes,
3316 [the number of pending output bytes on stream `fp'])
3320 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3321 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3322 dnl This file is free software, distributed under the terms of the GNU
3323 dnl General Public License. As a special exception to the GNU General
3324 dnl Public License, this file may be distributed as part of a program
3325 dnl that contains a configuration script generated by Autoconf, under
3326 dnl the same distribution terms as the rest of that program.
3328 dnl From Bruno Haible.
3330 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3331 # macros to non-string values. This is the case on AIX 4.3.3.
3333 AC_DEFUN([gt_INTTYPES_PRI],
3335 # autoconf-2.52 has a proper check for inttypes.h.
3338 if test $ac_cv_header_inttypes_h = yes; then
3339 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3340 gt_cv_inttypes_pri_broken,
3342 AC_TRY_COMPILE([#include <inttypes.h>
3346 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3349 if test "$gt_cv_inttypes_pri_broken" = yes; then
3350 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3351 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3357 dnl From Jim Meyering.
3358 dnl A wrapper around AC_FUNC_GETGROUPS.
3360 AC_DEFUN([jm_FUNC_GETGROUPS],
3361 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
3362 if test $ac_cv_func_getgroups_works = no; then
3363 AC_LIBOBJ(getgroups)
3364 AC_DEFINE(getgroups, rpl_getgroups,
3365 [Define as rpl_getgroups if getgroups doesn't work right.])
3367 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3374 AC_DEFUN([jm_SYS_PROC_UPTIME],
3375 [ dnl Require AC_PROG_CC to see if we're cross compiling.
3376 AC_REQUIRE([AC_PROG_CC])
3377 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
3378 [jm_cv_have_proc_uptime=no
3379 test -f /proc/uptime \
3380 && test "$cross_compiling" = no \
3381 && cat < /proc/uptime >/dev/null 2>/dev/null \
3382 && jm_cv_have_proc_uptime=yes])
3383 if test $jm_cv_have_proc_uptime = yes; then
3384 AC_DEFINE(HAVE_PROC_UPTIME, 1,
3385 [ Define if your system has the /proc/uptime special file.])
3391 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
3393 AC_DEFUN([jm_FUNC_FTRUNCATE],
3395 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
3397 if test "$ftruncate_missing" = yes; then
3398 AC_CHECK_HEADERS([unistd.h])
3399 AC_CHECK_FUNCS([chsize])
3400 AC_LIBOBJ(ftruncate)
3406 dnl From Volker Borchert.
3407 dnl Determine whether rename works for source paths with a trailing slash.
3408 dnl The rename from SunOS 4.1.1_U1 doesn't.
3410 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
3411 dnl to compile the wrapper function.
3414 AC_DEFUN([vb_FUNC_RENAME],
3416 AC_CACHE_CHECK([whether rename is broken],
3417 vb_cv_func_rename_trailing_slash_bug,
3419 rm -rf conftest.d1 conftest.d2
3420 mkdir conftest.d1 ||
3421 AC_MSG_ERROR([cannot create temporary directory])
3427 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
3430 vb_cv_func_rename_trailing_slash_bug=no,
3431 vb_cv_func_rename_trailing_slash_bug=yes,
3432 dnl When crosscompiling, assume rename is broken.
3433 vb_cv_func_rename_trailing_slash_bug=yes)
3435 rm -rf conftest.d1 conftest.d2
3437 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
3439 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
3440 [Define if rename does not work for source paths with a trailing slash,
3441 like the one from SunOS 4.1.1_U1.])
3447 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
3448 # silly limit that it can create no more than 26 files from a given template.
3449 # Other systems lack mkstemp altogether. On either type of system, arrange
3450 # to use the replacement function.
3451 AC_DEFUN([UTILS_FUNC_MKSTEMP],
3453 AC_REPLACE_FUNCS(mkstemp)
3454 if test $ac_cv_func_mkstemp = no; then
3455 utils_cv_func_mkstemp_limitations=yes
3457 AC_CACHE_CHECK([for mkstemp limitations],
3458 utils_cv_func_mkstemp_limitations,
3461 # include <stdlib.h>
3465 for (i = 0; i < 30; i++)
3467 char template[] = "conftestXXXXXX";
3468 int fd = mkstemp (template);
3476 utils_cv_func_mkstemp_limitations=no,
3477 utils_cv_func_mkstemp_limitations=yes,
3478 utils_cv_func_mkstemp_limitations=yes
3484 if test $utils_cv_func_mkstemp_limitations = yes; then
3487 AC_DEFINE(mkstemp, rpl_mkstemp,
3488 [Define to rpl_mkstemp if the replacement function should be used.])
3494 dnl From Jim Meyering.
3496 dnl See if gettimeofday clobbers the static buffer that localtime uses
3497 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
3498 dnl i.e. Darwin 1.3.7 has this problem.
3500 dnl If it does, then arrange to use gettimeofday and localtime only via
3501 dnl the wrapper functions that work around the problem.
3503 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
3505 AC_REQUIRE([AC_HEADER_TIME])
3506 AC_CHECK_HEADERS(string.h stdlib.h)
3507 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
3508 jm_cv_func_gettimeofday_clobber,
3512 # include <string.h>
3515 #if TIME_WITH_SYS_TIME
3516 # include <sys/time.h>
3519 # if HAVE_SYS_TIME_H
3520 # include <sys/time.h>
3527 # include <stdlib.h>
3537 lt = localtime (&t);
3539 gettimeofday (&tv, NULL);
3540 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
3546 jm_cv_func_gettimeofday_clobber=no,
3547 jm_cv_func_gettimeofday_clobber=yes,
3548 dnl When crosscompiling, assume it is broken.
3549 jm_cv_func_gettimeofday_clobber=yes)
3551 if test $jm_cv_func_gettimeofday_clobber = yes; then
3552 AC_LIBOBJ(gettimeofday)
3553 AC_DEFINE(localtime, rpl_localtime,
3554 [Define to rpl_localtime if the replacement function should be used.])
3555 AC_DEFINE(gettimeofday, rpl_gettimeofday,
3556 [Define to rpl_gettimeofday if the replacement function should be used.])
3557 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
3558 [Define if gettimeofday clobbers localtime's static buffer.])
3564 dnl From Jim Meyering
3565 dnl Replace the utime function on systems that need it.
3569 AC_DEFUN([jm_FUNC_UTIME],
3571 AC_CHECK_HEADERS(utime.h)
3572 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
3573 AC_REQUIRE([AC_FUNC_UTIME_NULL])
3575 if test $ac_cv_func_utime_null = no; then
3577 AC_REPLACE_FUNCS(utime)
3583 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
3584 dnl then do case-insensitive s/utime/utimes/.
3586 AC_DEFUN([jm_FUNC_UTIMES_NULL],
3587 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
3588 [rm -f conftest.data; > conftest.data
3590 /* In case stat has been defined to rpl_stat, undef it here. */
3592 #include <sys/types.h>
3593 #include <sys/stat.h>
3596 exit(!(stat ("conftest.data", &s) == 0
3597 && utimes("conftest.data", (long *)0) == 0
3598 && stat("conftest.data", &t) == 0
3599 && t.st_mtime >= s.st_mtime
3600 && t.st_mtime - s.st_mtime < 120));
3602 ac_cv_func_utimes_null=yes,
3603 ac_cv_func_utimes_null=no,
3604 ac_cv_func_utimes_null=no)
3605 rm -f core core.* *.core])
3607 if test $ac_cv_func_utimes_null = yes; then
3608 AC_DEFINE(HAVE_UTIMES_NULL, 1,
3609 [Define if utimes accepts a null argument])
3616 dnl See if there's a working, system-supplied version of the getline function.
3617 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
3618 dnl have a function by that name in -linet that doesn't have anything
3619 dnl to do with the function we need.
3620 AC_DEFUN([AM_FUNC_GETLINE],
3622 am_getline_needs_run_time_check=no
3623 AC_CHECK_FUNC(getline,
3624 dnl Found it in some library. Verify that it works.
3625 am_getline_needs_run_time_check=yes,
3626 am_cv_func_working_getline=no)
3627 if test $am_getline_needs_run_time_check = yes; then
3628 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
3629 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
3632 # include <sys/types.h>
3633 # include <string.h>
3635 { /* Based on a test program from Karl Heuer. */
3639 FILE *in = fopen ("./conftest.data", "r");
3642 len = getline (&line, &siz, in);
3643 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
3645 ], am_cv_func_working_getline=yes dnl The library version works.
3646 , am_cv_func_working_getline=no dnl The library version does NOT work.
3647 , am_cv_func_working_getline=no dnl We're cross compiling.
3651 if test $am_cv_func_working_getline = no; then
3657 # Determine approximately how many files may be open simultaneously
3658 # in one process. This is approximate, since while running this test,
3659 # the configure script already has a few files open.
3662 AC_DEFUN([UTILS_SYS_OPEN_MAX],
3664 AC_CACHE_CHECK([determine how many files may be open simultaneously],
3665 utils_cv_sys_open_max,
3667 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3674 FILE *result = fopen ("conftest.omax", "w");
3676 /* Impose an arbitrary limit, in case some system has no
3677 effective limit on the number of simultaneously open files. */
3680 FILE *s = fopen ("conftest.op", "w");
3685 fprintf (result, "%d\n", i);
3686 exit (fclose (result) == EOF);
3689 [utils_cv_sys_open_max=`cat conftest.omax`],
3690 [utils_cv_sys_open_max='internal error in open-max.m4'],
3691 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
3693 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
3694 $utils_cv_sys_open_max,
3695 [the maximum number of simultaneously open files per process])
3698 # codeset.m4 serial AM1 (gettext-0.10.40)
3699 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3700 dnl This file is free software, distributed under the terms of the GNU
3701 dnl General Public License. As a special exception to the GNU General
3702 dnl Public License, this file may be distributed as part of a program
3703 dnl that contains a configuration script generated by Autoconf, under
3704 dnl the same distribution terms as the rest of that program.
3706 dnl From Bruno Haible.
3708 AC_DEFUN([AM_LANGINFO_CODESET],
3710 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3711 [AC_TRY_LINK([#include <langinfo.h>],
3712 [char* cs = nl_langinfo(CODESET);],
3713 am_cv_langinfo_codeset=yes,
3714 am_cv_langinfo_codeset=no)
3716 if test $am_cv_langinfo_codeset = yes; then
3717 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3718 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3722 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3723 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3724 dnl This file is free software, distributed under the terms of the GNU
3725 dnl General Public License. As a special exception to the GNU General
3726 dnl Public License, this file may be distributed as part of a program
3727 dnl that contains a configuration script generated by Autoconf, under
3728 dnl the same distribution terms as the rest of that program.
3730 # Test for the GNU C Library, version 2.1 or newer.
3731 # From Bruno Haible.
3733 AC_DEFUN([jm_GLIBC21],
3735 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3736 ac_cv_gnu_library_2_1,
3737 [AC_EGREP_CPP([Lucky GNU user],
3739 #include <features.h>
3740 #ifdef __GNU_LIBRARY__
3741 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3746 ac_cv_gnu_library_2_1=yes,
3747 ac_cv_gnu_library_2_1=no)
3751 GLIBC21="$ac_cv_gnu_library_2_1"
3755 # iconv.m4 serial AM4 (gettext-0.11.3)
3756 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3757 dnl This file is free software, distributed under the terms of the GNU
3758 dnl General Public License. As a special exception to the GNU General
3759 dnl Public License, this file may be distributed as part of a program
3760 dnl that contains a configuration script generated by Autoconf, under
3761 dnl the same distribution terms as the rest of that program.
3763 dnl From Bruno Haible.
3765 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
3767 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3768 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3769 AC_REQUIRE([AC_LIB_RPATH])
3771 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3773 AC_LIB_LINKFLAGS_BODY([iconv])
3776 AC_DEFUN([AM_ICONV_LINK],
3778 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
3779 dnl those with the standalone portable GNU libiconv installed).
3781 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3783 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
3785 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
3786 dnl because if the user has installed libiconv and not disabled its use
3787 dnl via --without-libiconv-prefix, he wants to use it. The first
3788 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
3789 am_save_CPPFLAGS="$CPPFLAGS"
3790 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
3792 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
3793 am_cv_func_iconv="no, consider installing GNU libiconv"
3795 AC_TRY_LINK([#include <stdlib.h>
3796 #include <iconv.h>],
3797 [iconv_t cd = iconv_open("","");
3798 iconv(cd,NULL,NULL,NULL,NULL);
3800 am_cv_func_iconv=yes)
3801 if test "$am_cv_func_iconv" != yes; then
3802 am_save_LIBS="$LIBS"
3803 LIBS="$LIBS $LIBICONV"
3804 AC_TRY_LINK([#include <stdlib.h>
3805 #include <iconv.h>],
3806 [iconv_t cd = iconv_open("","");
3807 iconv(cd,NULL,NULL,NULL,NULL);
3810 am_cv_func_iconv=yes)
3811 LIBS="$am_save_LIBS"
3814 if test "$am_cv_func_iconv" = yes; then
3815 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
3817 if test "$am_cv_lib_iconv" = yes; then
3818 AC_MSG_CHECKING([how to link with libiconv])
3819 AC_MSG_RESULT([$LIBICONV])
3821 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
3823 CPPFLAGS="$am_save_CPPFLAGS"
3828 AC_SUBST(LTLIBICONV)
3831 AC_DEFUN([AM_ICONV],
3834 if test "$am_cv_func_iconv" = yes; then
3835 AC_MSG_CHECKING([for iconv declaration])
3836 AC_CACHE_VAL(am_cv_proto_iconv, [
3844 #if defined(__STDC__) || defined(__cplusplus)
3845 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
3849 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
3850 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);"])
3851 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
3852 AC_MSG_RESULT([$]{ac_t:-
3853 }[$]am_cv_proto_iconv)
3854 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
3855 [Define as const if the declaration of iconv() needs const.])
3859 # lib-prefix.m4 serial 1 (gettext-0.11)
3860 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3861 dnl This file is free software, distributed under the terms of the GNU
3862 dnl General Public License. As a special exception to the GNU General
3863 dnl Public License, this file may be distributed as part of a program
3864 dnl that contains a configuration script generated by Autoconf, under
3865 dnl the same distribution terms as the rest of that program.
3867 dnl From Bruno Haible.
3869 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3870 dnl to access previously installed libraries. The basic assumption is that
3871 dnl a user will want packages to use other packages he previously installed
3872 dnl with the same --prefix option.
3873 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3874 dnl libraries, but is otherwise very convenient.
3875 AC_DEFUN([AC_LIB_PREFIX],
3877 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
3878 AC_REQUIRE([AC_PROG_CC])
3879 AC_REQUIRE([AC_CANONICAL_HOST])
3880 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3881 dnl By default, look in $includedir and $libdir.
3883 AC_LIB_WITH_FINAL_PREFIX([
3884 eval additional_includedir=\"$includedir\"
3885 eval additional_libdir=\"$libdir\"
3887 AC_ARG_WITH([lib-prefix],
3888 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
3889 --without-lib-prefix don't search for libraries in includedir and libdir],
3891 if test "X$withval" = "Xno"; then
3894 if test "X$withval" = "X"; then
3895 AC_LIB_WITH_FINAL_PREFIX([
3896 eval additional_includedir=\"$includedir\"
3897 eval additional_libdir=\"$libdir\"
3900 additional_includedir="$withval/include"
3901 additional_libdir="$withval/lib"
3905 if test $use_additional = yes; then
3906 dnl Potentially add $additional_includedir to $CPPFLAGS.
3907 dnl But don't add it
3908 dnl 1. if it's the standard /usr/include,
3909 dnl 2. if it's already present in $CPPFLAGS,
3910 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
3911 dnl 4. if it doesn't exist as a directory.
3912 if test "X$additional_includedir" != "X/usr/include"; then
3914 for x in $CPPFLAGS; do
3915 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3916 if test "X$x" = "X-I$additional_includedir"; then
3921 if test -z "$haveit"; then
3922 if test "X$additional_includedir" = "X/usr/local/include"; then
3923 if test -n "$GCC"; then
3925 linux*) haveit=yes;;
3929 if test -z "$haveit"; then
3930 if test -d "$additional_includedir"; then
3931 dnl Really add $additional_includedir to $CPPFLAGS.
3932 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
3937 dnl Potentially add $additional_libdir to $LDFLAGS.
3938 dnl But don't add it
3939 dnl 1. if it's the standard /usr/lib,
3940 dnl 2. if it's already present in $LDFLAGS,
3941 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
3942 dnl 4. if it doesn't exist as a directory.
3943 if test "X$additional_libdir" != "X/usr/lib"; then
3945 for x in $LDFLAGS; do
3946 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3947 if test "X$x" = "X-L$additional_libdir"; then
3952 if test -z "$haveit"; then
3953 if test "X$additional_libdir" = "X/usr/local/lib"; then
3954 if test -n "$GCC"; then
3956 linux*) haveit=yes;;
3960 if test -z "$haveit"; then
3961 if test -d "$additional_libdir"; then
3962 dnl Really add $additional_libdir to $LDFLAGS.
3963 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3971 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3972 dnl acl_final_exec_prefix, containing the values to which $prefix and
3973 dnl $exec_prefix will expand at the end of the configure script.
3974 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3976 dnl Unfortunately, prefix and exec_prefix get only finally determined
3977 dnl at the end of configure.
3978 if test "X$prefix" = "XNONE"; then
3979 acl_final_prefix="$ac_default_prefix"
3981 acl_final_prefix="$prefix"
3983 if test "X$exec_prefix" = "XNONE"; then
3984 acl_final_exec_prefix='${prefix}'
3986 acl_final_exec_prefix="$exec_prefix"
3988 acl_save_prefix="$prefix"
3989 prefix="$acl_final_prefix"
3990 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3991 prefix="$acl_save_prefix"
3994 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3995 dnl variables prefix and exec_prefix bound to the values they will have
3996 dnl at the end of the configure script.
3997 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3999 acl_save_prefix="$prefix"
4000 prefix="$acl_final_prefix"
4001 acl_save_exec_prefix="$exec_prefix"
4002 exec_prefix="$acl_final_exec_prefix"
4004 exec_prefix="$acl_save_exec_prefix"
4005 prefix="$acl_save_prefix"
4008 # lib-link.m4 serial 3 (gettext-0.11.3)
4009 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4010 dnl This file is free software, distributed under the terms of the GNU
4011 dnl General Public License. As a special exception to the GNU General
4012 dnl Public License, this file may be distributed as part of a program
4013 dnl that contains a configuration script generated by Autoconf, under
4014 dnl the same distribution terms as the rest of that program.
4016 dnl From Bruno Haible.
4018 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
4019 dnl the libraries corresponding to explicit and implicit dependencies.
4020 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
4021 dnl augments the CPPFLAGS variable.
4022 AC_DEFUN([AC_LIB_LINKFLAGS],
4024 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4025 AC_REQUIRE([AC_LIB_RPATH])
4026 define([Name],[translit([$1],[./-], [___])])
4027 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4028 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4029 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
4030 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4031 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
4032 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
4033 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
4035 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
4036 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
4037 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
4038 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4040 AC_SUBST([LTLIB]NAME)
4041 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
4042 dnl results of this search when this library appears as a dependency.
4048 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
4049 dnl searches for libname and the libraries corresponding to explicit and
4050 dnl implicit dependencies, together with the specified include files and
4051 dnl the ability to compile and link the specified testcode. If found, it
4052 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
4053 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
4054 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
4055 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
4056 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
4058 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4059 AC_REQUIRE([AC_LIB_RPATH])
4060 define([Name],[translit([$1],[./-], [___])])
4061 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4062 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4064 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
4066 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4068 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
4069 dnl because if the user has installed lib[]Name and not disabled its use
4070 dnl via --without-lib[]Name-prefix, he wants to use it.
4071 ac_save_CPPFLAGS="$CPPFLAGS"
4072 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4074 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
4075 ac_save_LIBS="$LIBS"
4076 LIBS="$LIBS $LIB[]NAME"
4077 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
4078 LIBS="$ac_save_LIBS"
4080 if test "$ac_cv_lib[]Name" = yes; then
4082 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
4083 AC_MSG_CHECKING([how to link with lib[]$1])
4084 AC_MSG_RESULT([$LIB[]NAME])
4087 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
4088 dnl $INC[]NAME either.
4089 CPPFLAGS="$ac_save_CPPFLAGS"
4093 AC_SUBST([HAVE_LIB]NAME)
4095 AC_SUBST([LTLIB]NAME)
4100 dnl Determine the platform dependent parameters needed to use rpath:
4101 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
4102 dnl hardcode_direct, hardcode_minus_L,
4103 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
4104 AC_DEFUN([AC_LIB_RPATH],
4106 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
4107 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
4108 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
4109 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
4110 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
4111 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
4112 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
4118 libext="$acl_cv_libext"
4119 shlibext="$acl_cv_shlibext"
4120 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
4121 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
4122 hardcode_direct="$acl_cv_hardcode_direct"
4123 hardcode_minus_L="$acl_cv_hardcode_minus_L"
4124 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
4125 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
4126 dnl Determine whether the user wants rpath handling at all.
4127 AC_ARG_ENABLE(rpath,
4128 [ --disable-rpath do not hardcode runtime library paths],
4129 :, enable_rpath=yes)
4132 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
4133 dnl the libraries corresponding to explicit and implicit dependencies.
4134 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
4135 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
4137 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4138 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4139 dnl By default, look in $includedir and $libdir.
4141 AC_LIB_WITH_FINAL_PREFIX([
4142 eval additional_includedir=\"$includedir\"
4143 eval additional_libdir=\"$libdir\"
4145 AC_ARG_WITH([lib$1-prefix],
4146 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
4147 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
4149 if test "X$withval" = "Xno"; then
4152 if test "X$withval" = "X"; then
4153 AC_LIB_WITH_FINAL_PREFIX([
4154 eval additional_includedir=\"$includedir\"
4155 eval additional_libdir=\"$libdir\"
4158 additional_includedir="$withval/include"
4159 additional_libdir="$withval/lib"
4163 dnl Search the library and its dependencies in $additional_libdir and
4164 dnl $LDFLAGS. Using breadth-first-seach.
4170 names_already_handled=
4171 names_next_round='$1 $2'
4172 while test -n "$names_next_round"; do
4173 names_this_round="$names_next_round"
4175 for name in $names_this_round; do
4177 for n in $names_already_handled; do
4178 if test "$n" = "$name"; then
4183 if test -z "$already_handled"; then
4184 names_already_handled="$names_already_handled $name"
4185 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
4186 dnl or AC_LIB_HAVE_LINKFLAGS call.
4187 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4188 eval value=\"\$HAVE_LIB$uppername\"
4189 if test -n "$value"; then
4190 if test "$value" = yes; then
4191 eval value=\"\$LIB$uppername\"
4192 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
4193 eval value=\"\$LTLIB$uppername\"
4194 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
4196 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
4197 dnl that this library doesn't exist. So just drop it.
4201 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
4202 dnl and the already constructed $LIBNAME/$LTLIBNAME.
4207 if test $use_additional = yes; then
4208 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
4209 found_dir="$additional_libdir"
4210 found_so="$additional_libdir/lib$name.$shlibext"
4211 if test -f "$additional_libdir/lib$name.la"; then
4212 found_la="$additional_libdir/lib$name.la"
4215 if test -f "$additional_libdir/lib$name.$libext"; then
4216 found_dir="$additional_libdir"
4217 found_a="$additional_libdir/lib$name.$libext"
4218 if test -f "$additional_libdir/lib$name.la"; then
4219 found_la="$additional_libdir/lib$name.la"
4224 if test "X$found_dir" = "X"; then
4225 for x in $LDFLAGS $LTLIB[]NAME; do
4226 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4229 dir=`echo "X$x" | sed -e 's/^X-L//'`
4230 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
4232 found_so="$dir/lib$name.$shlibext"
4233 if test -f "$dir/lib$name.la"; then
4234 found_la="$dir/lib$name.la"
4237 if test -f "$dir/lib$name.$libext"; then
4239 found_a="$dir/lib$name.$libext"
4240 if test -f "$dir/lib$name.la"; then
4241 found_la="$dir/lib$name.la"
4247 if test "X$found_dir" != "X"; then
4252 if test "X$found_dir" != "X"; then
4253 dnl Found the library.
4254 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4255 if test "X$found_so" != "X"; then
4256 dnl Linking with a shared library. We attempt to hardcode its
4257 dnl directory into the executable's runpath, unless it's the
4258 dnl standard /usr/lib.
4259 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
4260 dnl No hardcoding is needed.
4261 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4263 dnl Use an explicit option to hardcode DIR into the resulting
4265 dnl Potentially add DIR to ltrpathdirs.
4266 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4268 for x in $ltrpathdirs; do
4269 if test "X$x" = "X$found_dir"; then
4274 if test -z "$haveit"; then
4275 ltrpathdirs="$ltrpathdirs $found_dir"
4277 dnl The hardcoding into $LIBNAME is system dependent.
4278 if test "$hardcode_direct" = yes; then
4279 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4280 dnl resulting binary.
4281 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4283 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4284 dnl Use an explicit option to hardcode DIR into the resulting
4286 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4287 dnl Potentially add DIR to rpathdirs.
4288 dnl The rpathdirs will be appended to $LIBNAME at the end.
4290 for x in $rpathdirs; do
4291 if test "X$x" = "X$found_dir"; then
4296 if test -z "$haveit"; then
4297 rpathdirs="$rpathdirs $found_dir"
4300 dnl Rely on "-L$found_dir".
4301 dnl But don't add it if it's already contained in the LDFLAGS
4302 dnl or the already constructed $LIBNAME
4304 for x in $LDFLAGS $LIB[]NAME; do
4305 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4306 if test "X$x" = "X-L$found_dir"; then
4311 if test -z "$haveit"; then
4312 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4314 if test "$hardcode_minus_L" != no; then
4315 dnl FIXME: Not sure whether we should use
4316 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4318 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4320 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4321 dnl here, because this doesn't fit in flags passed to the
4322 dnl compiler. So give up. No hardcoding. This affects only
4323 dnl very old systems.
4324 dnl FIXME: Not sure whether we should use
4325 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4327 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4333 if test "X$found_a" != "X"; then
4334 dnl Linking with a static library.
4335 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4337 dnl We shouldn't come here, but anyway it's good to have a
4339 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4342 dnl Assume the include files are nearby.
4343 additional_includedir=
4344 case "$found_dir" in
4346 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4347 additional_includedir="$basedir/include"
4350 if test "X$additional_includedir" != "X"; then
4351 dnl Potentially add $additional_includedir to $INCNAME.
4352 dnl But don't add it
4353 dnl 1. if it's the standard /usr/include,
4354 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
4355 dnl 3. if it's already present in $CPPFLAGS or the already
4356 dnl constructed $INCNAME,
4357 dnl 4. if it doesn't exist as a directory.
4358 if test "X$additional_includedir" != "X/usr/include"; then
4360 if test "X$additional_includedir" = "X/usr/local/include"; then
4361 if test -n "$GCC"; then
4363 linux*) haveit=yes;;
4367 if test -z "$haveit"; then
4368 for x in $CPPFLAGS $INC[]NAME; do
4369 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4370 if test "X$x" = "X-I$additional_includedir"; then
4375 if test -z "$haveit"; then
4376 if test -d "$additional_includedir"; then
4377 dnl Really add $additional_includedir to $INCNAME.
4378 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4384 dnl Look for dependencies.
4385 if test -n "$found_la"; then
4386 dnl Read the .la file. It defines the variables
4387 dnl dlname, library_names, old_library, dependency_libs, current,
4388 dnl age, revision, installed, dlopen, dlpreopen, libdir.
4389 save_libdir="$libdir"
4391 */* | *\\*) . "$found_la" ;;
4392 *) . "./$found_la" ;;
4394 libdir="$save_libdir"
4395 dnl We use only dependency_libs.
4396 for dep in $dependency_libs; do
4399 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4400 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4401 dnl But don't add it
4402 dnl 1. if it's the standard /usr/lib,
4403 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
4404 dnl 3. if it's already present in $LDFLAGS or the already
4405 dnl constructed $LIBNAME,
4406 dnl 4. if it doesn't exist as a directory.
4407 if test "X$additional_libdir" != "X/usr/lib"; then
4409 if test "X$additional_libdir" = "X/usr/local/lib"; then
4410 if test -n "$GCC"; then
4412 linux*) haveit=yes;;
4416 if test -z "$haveit"; then
4418 for x in $LDFLAGS $LIB[]NAME; do
4419 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4420 if test "X$x" = "X-L$additional_libdir"; then
4425 if test -z "$haveit"; then
4426 if test -d "$additional_libdir"; then
4427 dnl Really add $additional_libdir to $LIBNAME.
4428 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4432 for x in $LDFLAGS $LTLIB[]NAME; do
4433 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4434 if test "X$x" = "X-L$additional_libdir"; then
4439 if test -z "$haveit"; then
4440 if test -d "$additional_libdir"; then
4441 dnl Really add $additional_libdir to $LTLIBNAME.
4442 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4449 dir=`echo "X$dep" | sed -e 's/^X-R//'`
4450 if test "$enable_rpath" != no; then
4451 dnl Potentially add DIR to rpathdirs.
4452 dnl The rpathdirs will be appended to $LIBNAME at the end.
4454 for x in $rpathdirs; do
4455 if test "X$x" = "X$dir"; then
4460 if test -z "$haveit"; then
4461 rpathdirs="$rpathdirs $dir"
4463 dnl Potentially add DIR to ltrpathdirs.
4464 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4466 for x in $ltrpathdirs; do
4467 if test "X$x" = "X$dir"; then
4472 if test -z "$haveit"; then
4473 ltrpathdirs="$ltrpathdirs $dir"
4478 dnl Handle this in the next round.
4479 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4482 dnl Handle this in the next round. Throw away the .la's
4483 dnl directory; it is already contained in a preceding -L
4485 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4488 dnl Most likely an immediate library name.
4489 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4490 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4496 dnl Didn't find the library; assume it is in the system directories
4497 dnl known to the linker and runtime loader. (All the system
4498 dnl directories known to the linker should also be known to the
4499 dnl runtime loader, otherwise the system is severely misconfigured.)
4500 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4501 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4507 if test "X$rpathdirs" != "X"; then
4508 if test -n "$hardcode_libdir_separator"; then
4509 dnl Weird platform: only the last -rpath option counts, the user must
4510 dnl pass all path elements in one option. We can arrange that for a
4511 dnl single library, but not when more than one $LIBNAMEs are used.
4513 for found_dir in $rpathdirs; do
4514 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4516 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4517 acl_save_libdir="$libdir"
4519 eval flag=\"$hardcode_libdir_flag_spec\"
4520 libdir="$acl_save_libdir"
4521 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4523 dnl The -rpath options are cumulative.
4524 for found_dir in $rpathdirs; do
4525 acl_save_libdir="$libdir"
4527 eval flag=\"$hardcode_libdir_flag_spec\"
4528 libdir="$acl_save_libdir"
4529 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4533 if test "X$ltrpathdirs" != "X"; then
4534 dnl When using libtool, the option that works for both libraries and
4535 dnl executables is -R. The -R options are cumulative.
4536 for found_dir in $ltrpathdirs; do
4537 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4542 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4543 dnl unless already present in VAR.
4544 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4545 dnl contains two or three consecutive elements that belong together.
4546 AC_DEFUN([AC_LIB_APPENDTOVAR],
4548 for element in [$2]; do
4551 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4552 if test "X$x" = "X$element"; then
4557 if test -z "$haveit"; then
4558 [$1]="${[$1]}${[$1]:+ }$element"
4563 # lib-ld.m4 serial 1 (gettext-0.11)
4564 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4565 dnl This file is free software, distributed under the terms of the GNU
4566 dnl General Public License. As a special exception to the GNU General
4567 dnl Public License, this file may be distributed as part of a program
4568 dnl that contains a configuration script generated by Autoconf, under
4569 dnl the same distribution terms as the rest of that program.
4571 dnl Subroutines of libtool.m4,
4572 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4573 dnl with libtool.m4.
4575 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4576 AC_DEFUN([AC_LIB_PROG_LD_GNU],
4577 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4578 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4579 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4580 acl_cv_prog_gnu_ld=yes
4582 acl_cv_prog_gnu_ld=no
4584 with_gnu_ld=$acl_cv_prog_gnu_ld
4587 dnl From libtool-1.4. Sets the variable LD.
4588 AC_DEFUN([AC_LIB_PROG_LD],
4589 [AC_ARG_WITH(gnu-ld,
4590 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
4591 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4592 AC_REQUIRE([AC_PROG_CC])dnl
4593 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4595 if test "$GCC" = yes; then
4596 # Check if gcc -print-prog-name=ld gives a path.
4597 AC_MSG_CHECKING([for ld used by GCC])
4600 # gcc leaves a trailing carriage return which upsets mingw
4601 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4603 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4606 # Accept absolute paths.
4607 [[\\/]* | [A-Za-z]:[\\/]*)]
4608 [re_direlt='/[^/][^/]*/\.\./']
4609 # Canonicalize the path of ld
4610 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4611 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4612 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4614 test -z "$LD" && LD="$ac_prog"
4617 # If it fails, then pretend we aren't using GCC.
4621 # If it is relative, then search for the first ld in PATH.
4625 elif test "$with_gnu_ld" = yes; then
4626 AC_MSG_CHECKING([for GNU ld])
4628 AC_MSG_CHECKING([for non-GNU ld])
4630 AC_CACHE_VAL(acl_cv_path_LD,
4631 [if test -z "$LD"; then
4632 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4633 for ac_dir in $PATH; do
4634 test -z "$ac_dir" && ac_dir=.
4635 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4636 acl_cv_path_LD="$ac_dir/$ac_prog"
4637 # Check to see if the program is GNU ld. I'd rather use --version,
4638 # but apparently some GNU ld's only accept -v.
4639 # Break only if it was the GNU/non-GNU ld that we prefer.
4640 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4641 test "$with_gnu_ld" != no && break
4643 test "$with_gnu_ld" != yes && break
4649 acl_cv_path_LD="$LD" # Let the user override the test with a path.
4651 LD="$acl_cv_path_LD"
4652 if test -n "$LD"; then
4657 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4663 dnl From J. David Anglin.
4665 dnl HPUX and other systems can't unlink shared text that is being executed.
4667 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
4669 AC_CACHE_CHECK([whether a running program can be unlinked],
4670 jm_cv_func_unlink_busy_text,
4679 exit (unlink (argv[0]));
4682 jm_cv_func_unlink_busy_text=yes,
4683 jm_cv_func_unlink_busy_text=no,
4684 jm_cv_func_unlink_busy_text=no
4689 if test $jm_cv_func_unlink_busy_text = no; then
4690 INSTALL=$ac_install_sh
4696 dnl From Jim Meyering.
4698 dnl This is not pretty. I've just taken the autoconf code and wrapped
4699 dnl it in an AC_DEFUN.
4702 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4703 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
4705 AC_CHECK_FUNCS(listmntent getmntinfo)
4706 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
4707 getfsstat_includes="\
4708 $ac_includes_default
4709 #if HAVE_SYS_PARAM_H
4710 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
4712 #if HAVE_SYS_UCRED_H
4713 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
4715 #if HAVE_SYS_MOUNT_H
4716 # include <sys/mount.h>
4718 #if HAVE_SYS_FS_TYPES_H
4719 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
4722 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
4724 # Determine how to get the list of mounted filesystems.
4727 # If the getmntent function is available but not in the standard library,
4728 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
4731 # This test must precede the ones for getmntent because Unicos-9 is
4732 # reported to have the getmntent function, but its support is incompatible
4733 # with other getmntent implementations.
4735 # NOTE: Normally, I wouldn't use a check for system type as I've done for
4736 # `CRAY' below since that goes against the whole autoconf philosophy. But
4737 # I think there is too great a chance that some non-Cray system has a
4738 # function named listmntent to risk the false positive.
4740 if test -z "$ac_list_mounted_fs"; then
4742 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
4743 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
4744 [fu_cv_sys_mounted_cray_listmntent=no
4749 ], [test $ac_cv_func_listmntent = yes \
4750 && fu_cv_sys_mounted_cray_listmntent=yes]
4754 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
4755 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
4756 ac_list_mounted_fs=found
4757 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
4758 [Define if there is a function named listmntent that can be used to
4759 list all mounted filesystems. (UNICOS)])
4763 if test $ac_cv_func_getmntent = yes; then
4765 # This system has the getmntent function.
4766 # Determine whether it's the one-argument variant or the two-argument one.
4768 if test -z "$ac_list_mounted_fs"; then
4769 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
4770 AC_MSG_CHECKING([for one-argument getmntent function])
4771 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
4773 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
4777 #if !defined MOUNTED
4778 # if defined _PATH_MOUNTED /* GNU libc */
4779 # define MOUNTED _PATH_MOUNTED
4781 # if defined MNT_MNTTAB /* HP-UX. */
4782 # define MOUNTED MNT_MNTTAB
4784 # if defined MNTTABNAME /* Dynix. */
4785 # define MOUNTED MNTTABNAME
4789 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
4790 fu_cv_sys_mounted_getmntent1=yes,
4791 fu_cv_sys_mounted_getmntent1=no)])
4792 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
4793 if test $fu_cv_sys_mounted_getmntent1 = yes; then
4794 ac_list_mounted_fs=found
4795 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
4796 [Define if there is a function named getmntent for reading the list
4797 of mounted filesystems, and that function takes a single argument.
4798 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
4802 if test -z "$ac_list_mounted_fs"; then
4804 AC_MSG_CHECKING([for two-argument getmntent function])
4805 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
4806 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
4807 fu_cv_sys_mounted_getmntent2=yes,
4808 fu_cv_sys_mounted_getmntent2=no)])
4809 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
4810 if test $fu_cv_sys_mounted_getmntent2 = yes; then
4811 ac_list_mounted_fs=found
4812 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
4813 [Define if there is a function named getmntent for reading the list of
4814 mounted filesystems, and that function takes two arguments. (SVR4)])
4820 if test -z "$ac_list_mounted_fs"; then
4821 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
4822 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
4824 AC_MSG_CHECKING([for getfsstat function])
4825 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
4827 #include <sys/types.h>
4828 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
4829 # define FS_TYPE(Ent) ((Ent).f_fstypename)
4831 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
4833 ]$getfsstat_includes
4835 [struct statfs *stats;
4836 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
4837 char *t = FS_TYPE (*stats); ],
4838 fu_cv_sys_mounted_getfsstat=yes,
4839 fu_cv_sys_mounted_getfsstat=no)])
4840 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
4841 if test $fu_cv_sys_mounted_getfsstat = yes; then
4842 ac_list_mounted_fs=found
4843 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
4844 [Define if there is a function named getfsstat for reading the
4845 list of mounted filesystems. (DEC Alpha running OSF/1)])
4849 if test -z "$ac_list_mounted_fs"; then
4851 AC_MSG_CHECKING([for mntctl function and struct vmount])
4852 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
4853 [AC_TRY_CPP([#include <fshelp.h>],
4854 fu_cv_sys_mounted_vmount=yes,
4855 fu_cv_sys_mounted_vmount=no)])
4856 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
4857 if test $fu_cv_sys_mounted_vmount = yes; then
4858 ac_list_mounted_fs=found
4859 AC_DEFINE(MOUNTED_VMOUNT, 1,
4860 [Define if there is a function named mntctl that can be used to read
4861 the list of mounted filesystems, and there is a system header file
4862 that declares `struct vmount.' (AIX)])
4866 if test -z "$ac_list_mounted_fs"; then
4868 AC_MSG_CHECKING([for FIXME existence of three headers])
4869 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
4871 #include <sys/statfs.h>
4872 #include <sys/fstyp.h>
4873 #include <mnttab.h>],
4874 fu_cv_sys_mounted_fread_fstyp=yes,
4875 fu_cv_sys_mounted_fread_fstyp=no)])
4876 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
4877 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
4878 ac_list_mounted_fs=found
4879 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
4880 [Define if (like SVR2) there is no specific function for reading the
4881 list of mounted filesystems, and your system has these header files:
4882 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
4886 if test -z "$ac_list_mounted_fs"; then
4887 # 4.4BSD and DEC OSF/1.
4888 AC_MSG_CHECKING([for getmntinfo function])
4889 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
4891 test "$ac_cv_func_getmntinfo" = yes \
4892 && fu_cv_sys_mounted_getmntinfo=yes \
4893 || fu_cv_sys_mounted_getmntinfo=no
4895 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
4896 if test $fu_cv_sys_mounted_getmntinfo = yes; then
4897 ac_list_mounted_fs=found
4898 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
4899 [Define if there is a function named getmntinfo for reading the
4900 list of mounted filesystems. (4.4BSD, Darwin)])
4904 if test -z "$ac_list_mounted_fs"; then
4906 AC_MSG_CHECKING([for getmnt function])
4907 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
4909 #include <sys/fs_types.h>
4910 #include <sys/mount.h>],
4911 fu_cv_sys_mounted_getmnt=yes,
4912 fu_cv_sys_mounted_getmnt=no)])
4913 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
4914 if test $fu_cv_sys_mounted_getmnt = yes; then
4915 ac_list_mounted_fs=found
4916 AC_DEFINE(MOUNTED_GETMNT, 1,
4917 [Define if there is a function named getmnt for reading the list of
4918 mounted filesystems. (Ultrix)])
4922 if test -z "$ac_list_mounted_fs"; then
4924 AC_CHECK_FUNCS(next_dev fs_stat_dev)
4925 AC_CHECK_HEADERS(fs_info.h)
4926 AC_MSG_CHECKING([for BEOS mounted file system support functions])
4927 if test $ac_cv_header_fs_info_h = yes \
4928 && test $ac_cv_func_next_dev = yes \
4929 && test $ac_cv_func_fs_stat_dev = yes; then
4934 AC_MSG_RESULT($fu_result)
4935 if test $fu_result = yes; then
4936 ac_list_mounted_fs=found
4937 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
4938 [Define if there are functions named next_dev and fs_stat_dev for
4939 reading the list of mounted filesystems. (BeOS)])
4943 if test -z "$ac_list_mounted_fs"; then
4945 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
4946 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
4947 [AC_TRY_CPP([#include <mnttab.h>],
4948 fu_cv_sys_mounted_fread=yes,
4949 fu_cv_sys_mounted_fread=no)])
4950 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
4951 if test $fu_cv_sys_mounted_fread = yes; then
4952 ac_list_mounted_fs=found
4953 AC_DEFINE(MOUNTED_FREAD, 1,
4954 [Define if there is no specific function for reading the list of
4955 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
4959 if test -z "$ac_list_mounted_fs"; then
4960 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
4961 # FIXME -- no need to abort building the whole package
4962 # Can't build mountlist.c or anything that needs its functions
4965 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
4971 dnl From Jim Meyering.
4973 dnl See if struct statfs has the f_fstypename member.
4974 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
4977 AC_DEFUN([jm_FSTYPENAME],
4979 AC_CACHE_CHECK([for f_fstypename in struct statfs],
4980 fu_cv_sys_f_fstypename_in_statfs,
4984 #include <sys/param.h>
4985 #include <sys/types.h>
4986 #include <sys/mount.h>
4988 [struct statfs s; int i = sizeof s.f_fstypename;],
4989 fu_cv_sys_f_fstypename_in_statfs=yes,
4990 fu_cv_sys_f_fstypename_in_statfs=no
4995 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
4996 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
4997 [Define if struct statfs has the f_fstypename member.])
5004 # From fileutils/configure.in
5006 # Try to determine how a program can obtain filesystem usage information.
5007 # If successful, define the appropriate symbol (see fsusage.c) and
5008 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
5010 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5012 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
5015 echo "checking how to get filesystem space usage..."
5018 # Perform only the link test since it seems there are no variants of the
5019 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
5020 # because that got a false positive on SCO OSR5. Adding the declaration
5021 # of a `struct statvfs' causes this test to fail (as it should) on such
5022 # systems. That system is reported to work fine with STAT_STATFS4 which
5023 # is what it gets when this test fails.
5024 if test $ac_fsusage_space = no; then
5026 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
5027 [AC_TRY_LINK([#include <sys/types.h>
5028 #include <sys/statvfs.h>],
5029 [struct statvfs fsd; statvfs (0, &fsd);],
5030 fu_cv_sys_stat_statvfs=yes,
5031 fu_cv_sys_stat_statvfs=no)])
5032 if test $fu_cv_sys_stat_statvfs = yes; then
5033 ac_fsusage_space=yes
5034 AC_DEFINE(STAT_STATVFS, 1,
5035 [ Define if there is a function named statvfs. (SVR4)])
5039 if test $ac_fsusage_space = no; then
5040 # DEC Alpha running OSF/1
5041 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
5042 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
5044 #include <sys/param.h>
5045 #include <sys/types.h>
5046 #include <sys/mount.h>
5051 exit (statfs (".", &fsd, sizeof (struct statfs)));
5053 fu_cv_sys_stat_statfs3_osf1=yes,
5054 fu_cv_sys_stat_statfs3_osf1=no,
5055 fu_cv_sys_stat_statfs3_osf1=no)])
5056 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
5057 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
5058 ac_fsusage_space=yes
5059 AC_DEFINE(STAT_STATFS3_OSF1, 1,
5060 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
5064 if test $ac_fsusage_space = no; then
5066 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
5067 member (AIX, 4.3BSD)])
5068 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
5070 #ifdef HAVE_SYS_PARAM_H
5071 #include <sys/param.h>
5073 #ifdef HAVE_SYS_MOUNT_H
5074 #include <sys/mount.h>
5076 #ifdef HAVE_SYS_VFS_H
5077 #include <sys/vfs.h>
5083 exit (statfs (".", &fsd));
5085 fu_cv_sys_stat_statfs2_bsize=yes,
5086 fu_cv_sys_stat_statfs2_bsize=no,
5087 fu_cv_sys_stat_statfs2_bsize=no)])
5088 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
5089 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
5090 ac_fsusage_space=yes
5091 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
5092 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
5093 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
5097 if test $ac_fsusage_space = no; then
5099 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
5100 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
5101 [AC_TRY_RUN([#include <sys/types.h>
5102 #include <sys/statfs.h>
5106 exit (statfs (".", &fsd, sizeof fsd, 0));
5108 fu_cv_sys_stat_statfs4=yes,
5109 fu_cv_sys_stat_statfs4=no,
5110 fu_cv_sys_stat_statfs4=no)])
5111 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
5112 if test $fu_cv_sys_stat_statfs4 = yes; then
5113 ac_fsusage_space=yes
5114 AC_DEFINE(STAT_STATFS4, 1,
5115 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
5119 if test $ac_fsusage_space = no; then
5121 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
5122 member (4.4BSD and NetBSD)])
5123 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
5124 [AC_TRY_RUN([#include <sys/types.h>
5125 #ifdef HAVE_SYS_PARAM_H
5126 #include <sys/param.h>
5128 #ifdef HAVE_SYS_MOUNT_H
5129 #include <sys/mount.h>
5135 exit (statfs (".", &fsd));
5137 fu_cv_sys_stat_statfs2_fsize=yes,
5138 fu_cv_sys_stat_statfs2_fsize=no,
5139 fu_cv_sys_stat_statfs2_fsize=no)])
5140 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
5141 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
5142 ac_fsusage_space=yes
5143 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
5144 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
5149 if test $ac_fsusage_space = no; then
5151 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
5152 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
5153 [AC_TRY_RUN([#include <sys/types.h>
5154 #ifdef HAVE_SYS_PARAM_H
5155 #include <sys/param.h>
5157 #ifdef HAVE_SYS_MOUNT_H
5158 #include <sys/mount.h>
5160 #ifdef HAVE_SYS_FS_TYPES_H
5161 #include <sys/fs_types.h>
5166 /* Ultrix's statfs returns 1 for success,
5167 0 for not mounted, -1 for failure. */
5168 exit (statfs (".", &fsd) != 1);
5170 fu_cv_sys_stat_fs_data=yes,
5171 fu_cv_sys_stat_fs_data=no,
5172 fu_cv_sys_stat_fs_data=no)])
5173 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
5174 if test $fu_cv_sys_stat_fs_data = yes; then
5175 ac_fsusage_space=yes
5176 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
5177 [ Define if statfs takes 2 args and the second argument has
5178 type struct fs_data. (Ultrix)])
5182 if test $ac_fsusage_space = no; then
5184 AC_TRY_CPP([#include <sys/filsys.h>
5186 AC_DEFINE(STAT_READ_FILSYS, 1,
5187 [Define if there is no specific function for reading filesystems usage
5188 information and you have the <sys/filsys.h> header file. (SVR2)])
5189 ac_fsusage_space=yes)
5192 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
5198 # Define some macros required for proper operation of code in lib/*.c
5199 # on MSDOS/Windows systems.
5201 # From Jim Meyering.
5203 AC_DEFUN([jm_AC_DOS],
5205 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
5208 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
5209 neither MSDOS nor Windows
5211 [ac_cv_win_or_dos=yes],
5212 [ac_cv_win_or_dos=no])
5215 if test x"$ac_cv_win_or_dos" = xyes; then
5216 ac_fs_accepts_drive_letter_prefix=1
5217 ac_fs_backslash_is_file_name_separator=1
5219 ac_fs_accepts_drive_letter_prefix=0
5220 ac_fs_backslash_is_file_name_separator=0
5223 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
5224 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
5225 # define FILESYSTEM_PREFIX_LEN(Filename) \
5226 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
5228 # define FILESYSTEM_PREFIX_LEN(Filename) 0
5231 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
5232 $ac_fs_accepts_drive_letter_prefix,
5233 [Define on systems for which file names may have a so-called
5234 `drive letter' prefix, define this to compute the length of that
5235 prefix, including the colon.])
5237 AH_VERBATIM(ISSLASH,
5238 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
5239 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
5241 # define ISSLASH(C) ((C) == '/')
5244 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
5245 $ac_fs_backslash_is_file_name_separator,
5246 [Define if the backslash character may also serve as a file name
5247 component separator.])
5251 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
5253 AC_REQUIRE([AC_HEADER_STDC])
5254 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
5255 AC_CHECK_FUNCS(resolvepath)
5256 AC_REQUIRE([AC_HEADER_STAT])
5258 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
5259 # if the function name weren't so long. Besides, I would rather
5260 # not have underscores in file names.
5261 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
5266 dnl From Paul Eggert.
5268 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
5271 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
5272 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
5273 ac_cv_struct_st_mtim_nsec,
5274 [ac_save_CPPFLAGS="$CPPFLAGS"
5275 ac_cv_struct_st_mtim_nsec=no
5276 # tv_nsec -- the usual case
5277 # _tv_nsec -- Solaris 2.6, if
5278 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
5279 # && !defined __EXTENSIONS__)
5280 # st__tim.tv_nsec -- UnixWare 2.1.2
5281 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
5282 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
5283 AC_TRY_COMPILE([#include <sys/types.h>
5284 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
5285 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
5287 CPPFLAGS="$ac_save_CPPFLAGS"])
5289 if test $ac_cv_struct_st_mtim_nsec != no; then
5290 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
5291 [Define to be the nanoseconds member of struct stat's st_mtim,
5299 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
5301 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
5302 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
5303 [AC_TRY_COMPILE([#include <sys/types.h>
5304 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
5305 ac_cv_struct_st_dm_mode=yes,
5306 ac_cv_struct_st_dm_mode=no)])
5308 if test $ac_cv_struct_st_dm_mode = yes; then
5309 AC_DEFINE(HAVE_ST_DM_MODE, 1,
5310 [Define if struct stat has an st_dm_mode member. ])
5317 dnl From Jim Meyering
5319 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
5320 dnl in time.h or sys/time.h.
5322 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
5324 AC_REQUIRE([AC_HEADER_TIME])
5325 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
5328 # if TIME_WITH_SYS_TIME
5329 # include <sys/time.h>
5332 # if HAVE_SYS_TIME_H
5333 # include <sys/time.h>
5339 [static struct timespec x; x.tv_sec = x.tv_nsec;],
5340 fu_cv_sys_struct_timespec=yes,
5341 fu_cv_sys_struct_timespec=no)
5344 if test $fu_cv_sys_struct_timespec = yes; then
5345 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
5346 [Define if struct timespec is declared in <time.h>. ])
5351 dnl From Jim Meyering and Paul Eggert.
5352 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
5353 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5354 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
5355 jm_cv_sys_tiocgwinsz_needs_termios_h,
5356 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
5358 if test $ac_cv_sys_posix_termios = yes; then
5360 [#include <sys/types.h>
5361 # include <termios.h>
5365 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
5370 AC_DEFUN([jm_WINSIZE_IN_PTEM],
5371 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5372 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
5373 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
5374 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
5375 if test $ac_cv_sys_posix_termios = yes; then
5376 AC_TRY_COMPILE([#include <termios.h>]
5377 [struct winsize x;],
5378 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5380 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5381 AC_TRY_COMPILE([#include <sys/ptem.h>],
5382 [struct winsize x;],
5383 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5385 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5386 AC_DEFINE([WINSIZE_IN_PTEM], 1,
5387 [Define if sys/ptem.h is required for struct winsize.])
5390 # Determine whether this system has infrastructure for obtaining the boot time.
5392 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5393 * ----------------------------------------------------------
5394 AC_DEFUN([GNULIB_BOOT_TIME],
5396 AC_CHECK_FUNCS(sysctl)
5397 AC_CHECK_HEADERS(sys/sysctl.h)
5399 [whether we can get the system boot time],
5400 [gnulib_cv_have_boot_time],
5404 [AC_INCLUDES_DEFAULT
5405 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
5406 # include <sys/param.h> /* needed for OpenBSD 3.0 */
5407 # include <sys/sysctl.h>
5416 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
5417 /* your system *does* have the infrastructure to determine boot time */
5419 please_tell_us_how_to_determine_boot_time_on_your_system
5422 gnulib_cv_have_boot_time=yes,
5423 gnulib_cv_have_boot_time=no)
5425 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
5430 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
5431 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
5432 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
5433 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
5434 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
5436 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
5438 [#include <sys/types.h>
5439 # include <sys/ioctl.h>
5443 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
5446 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
5447 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
5448 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
5454 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
5456 AC_DEFUN([jm_LIB_CHECK],
5459 # Check for libypsec.a on Dolphin M88K machines.
5460 AC_CHECK_LIB(ypsec, main)
5462 # m88k running dgux 5.4 needs this
5463 AC_CHECK_LIB(ldgc, main)
5465 # Some programs need to link with -lm. printf does if it uses
5466 # lib/strtod.c which uses pow. And seq uses the math functions,
5467 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
5469 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
5470 # Check for these math functions used by seq.
5471 ac_su_saved_lib="$LIBS"
5473 AC_CHECK_FUNCS(floor modf rint)
5474 LIBS="$ac_su_saved_lib"
5477 AC_CHECK_FUNCS(sqrt)
5478 if test $ac_cv_func_sqrt = no; then
5479 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
5482 AC_SUBST(FESETROUND_LIBM)
5483 AC_CHECK_FUNCS(fesetround)
5484 if test $ac_cv_func_fesetround = no; then
5485 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
5488 # The -lsun library is required for YP support on Irix-4.0.5 systems.
5489 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
5490 AC_SEARCH_LIBS(yp_match, [sun ypsec])
5492 # SysV needs -lsec, older versions of Linux need -lshadow for
5493 # shadow passwords. UnixWare 7 needs -lgen.
5494 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
5496 AC_CHECK_HEADERS(shadow.h)
5498 # Requirements for su.c.
5500 $ac_includes_default
5502 # include <shadow.h>
5505 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
5506 AC_CHECK_FUNCS(getspnam)
5508 # SCO-ODT-3.0 is reported to need -lufc for crypt.
5509 # NetBSD needs -lcrypt for crypt.
5510 ac_su_saved_lib="$LIBS"
5511 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
5512 LIBS="$ac_su_saved_lib"
5516 # gettext.m4 serial 17 (gettext-0.11.5)
5517 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5518 dnl This file is free software, distributed under the terms of the GNU
5519 dnl General Public License. As a special exception to the GNU General
5520 dnl Public License, this file may be distributed as part of a program
5521 dnl that contains a configuration script generated by Autoconf, under
5522 dnl the same distribution terms as the rest of that program.
5524 dnl This file can can be used in projects which are not available under
5525 dnl the GNU General Public License or the GNU Library General Public
5526 dnl License but which still want to provide support for the GNU gettext
5528 dnl Please note that the actual code of the GNU gettext library is covered
5529 dnl by the GNU Library General Public License, and the rest of the GNU
5530 dnl gettext package package is covered by the GNU General Public License.
5531 dnl They are *not* in the public domain.
5534 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5535 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5537 dnl Macro to add for using GNU gettext.
5539 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5540 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5541 dnl default (if it is not specified or empty) is 'no-libtool'.
5542 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
5543 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5544 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
5545 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
5546 dnl depending on --{enable,disable}-{shared,static} and on the presence of
5547 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
5548 dnl $(top_builddir)/intl/libintl.a will be created.
5549 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
5550 dnl implementations (in libc or libintl) without the ngettext() function
5551 dnl will be ignored. If NEEDSYMBOL is specified and is
5552 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
5553 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
5554 dnl INTLDIR is used to find the intl libraries. If empty,
5555 dnl the value `$(top_builddir)/intl/' is used.
5557 dnl The result of the configuration is one of three cases:
5558 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
5560 dnl Catalog format: GNU --> install in $(datadir)
5561 dnl Catalog extension: .mo after installation, .gmo in source tree
5562 dnl 2) GNU gettext has been found in the system's C library.
5563 dnl Catalog format: GNU --> install in $(datadir)
5564 dnl Catalog extension: .mo after installation, .gmo in source tree
5565 dnl 3) No internationalization, always use English msgid.
5566 dnl Catalog format: none
5567 dnl Catalog extension: none
5568 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
5569 dnl The use of .gmo is historical (it was needed to avoid overwriting the
5570 dnl GNU format catalogs when building on a platform with an X/Open gettext),
5571 dnl but we keep it in order not to force irrelevant filename changes on the
5574 AC_DEFUN([AM_GNU_GETTEXT],
5576 dnl Argument checking.
5577 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5578 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5580 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
5581 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5583 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5584 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5586 AC_REQUIRE([AM_PO_SUBDIRS])dnl
5587 ifelse(gt_included_intl, yes, [
5588 AC_REQUIRE([AM_INTL_SUBDIR])dnl
5591 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5592 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5593 AC_REQUIRE([AC_LIB_RPATH])
5595 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5596 dnl Ideally we would do this search only after the
5597 dnl if test "$USE_NLS" = "yes"; then
5598 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5599 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5600 dnl the configure script would need to contain the same shell code
5601 dnl again, outside any 'if'. There are two solutions:
5602 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5603 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5604 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5605 dnl documented, we avoid it.
5606 ifelse(gt_included_intl, yes, , [
5607 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5610 AC_MSG_CHECKING([whether NLS is requested])
5611 dnl Default is enabled NLS
5613 [ --disable-nls do not use Native Language Support],
5614 USE_NLS=$enableval, USE_NLS=yes)
5615 AC_MSG_RESULT($USE_NLS)
5618 ifelse(gt_included_intl, yes, [
5619 BUILD_INCLUDED_LIBINTL=no
5620 USE_INCLUDED_LIBINTL=no
5626 dnl If we use NLS figure out what method
5627 if test "$USE_NLS" = "yes"; then
5628 gt_use_preinstalled_gnugettext=no
5629 ifelse(gt_included_intl, yes, [
5630 AC_MSG_CHECKING([whether included gettext is requested])
5631 AC_ARG_WITH(included-gettext,
5632 [ --with-included-gettext use the GNU gettext library included here],
5633 nls_cv_force_use_gnu_gettext=$withval,
5634 nls_cv_force_use_gnu_gettext=no)
5635 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
5637 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5638 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5640 dnl User does not insist on using GNU NLS library. Figure out what
5641 dnl to use. If GNU gettext is available we use this. Else we have
5642 dnl to fall back to GNU NLS library.
5644 dnl Add a version number to the cache macros.
5645 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
5646 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5647 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
5649 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5650 [AC_TRY_LINK([#include <libintl.h>
5651 ]ifelse([$2], [need-formatstring-macros],
5652 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5653 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5656 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5658 ], [])[extern int _nl_msg_cat_cntr;
5659 extern int *_nl_domain_bindings;],
5660 [bindtextdomain ("", "");
5661 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5662 gt_cv_func_gnugettext_libc=yes,
5663 gt_cv_func_gnugettext_libc=no)])
5665 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5666 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5667 ifelse(gt_included_intl, yes, , [
5670 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5671 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5672 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5673 dnl even if libiconv doesn't exist.
5674 AC_LIB_LINKFLAGS_BODY([intl])
5675 AC_CACHE_CHECK([for GNU gettext in libintl],
5676 gt_cv_func_gnugettext_libintl,
5677 [gt_save_CPPFLAGS="$CPPFLAGS"
5678 CPPFLAGS="$CPPFLAGS $INCINTL"
5679 gt_save_LIBS="$LIBS"
5680 LIBS="$LIBS $LIBINTL"
5681 dnl Now see whether libintl exists and does not depend on libiconv.
5682 AC_TRY_LINK([#include <libintl.h>
5683 ]ifelse([$2], [need-formatstring-macros],
5684 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5685 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5688 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5690 ], [])[extern int _nl_msg_cat_cntr;
5695 const char *_nl_expand_alias ();],
5696 [bindtextdomain ("", "");
5697 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5698 gt_cv_func_gnugettext_libintl=yes,
5699 gt_cv_func_gnugettext_libintl=no)
5700 dnl Now see whether libintl exists and depends on libiconv.
5701 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5702 LIBS="$LIBS $LIBICONV"
5703 AC_TRY_LINK([#include <libintl.h>
5704 ]ifelse([$2], [need-formatstring-macros],
5705 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5706 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5709 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5711 ], [])[extern int _nl_msg_cat_cntr;
5716 const char *_nl_expand_alias ();],
5717 [bindtextdomain ("", "");
5718 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5719 [LIBINTL="$LIBINTL $LIBICONV"
5720 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
5721 gt_cv_func_gnugettext_libintl=yes
5724 CPPFLAGS="$gt_save_CPPFLAGS"
5725 LIBS="$gt_save_LIBS"])
5728 dnl If an already present or preinstalled GNU gettext() is found,
5729 dnl use it. But if this macro is used in GNU gettext, and GNU
5730 dnl gettext is already preinstalled in libintl, we update this
5731 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
5732 if test "$gt_cv_func_gnugettext_libc" = "yes" \
5733 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5734 && test "$PACKAGE" != gettext; }; then
5735 gt_use_preinstalled_gnugettext=yes
5737 dnl Reset the values set by searching for libintl.
5743 ifelse(gt_included_intl, yes, [
5744 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5745 dnl GNU gettext is not found in the C library.
5746 dnl Fall back on included GNU gettext library.
5747 nls_cv_use_gnu_gettext=yes
5751 if test "$nls_cv_use_gnu_gettext" = "yes"; then
5752 dnl Mark actions used to generate GNU NLS library.
5753 INTLOBJS="\$(GETTOBJS)"
5754 BUILD_INCLUDED_LIBINTL=yes
5755 USE_INCLUDED_LIBINTL=yes
5756 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5757 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5758 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
5761 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5762 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5763 dnl Mark actions to use GNU gettext tools.
5768 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5769 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5770 AC_DEFINE(ENABLE_NLS, 1,
5771 [Define to 1 if translation of program messages to the user's native language
5778 if test "$USE_NLS" = "yes"; then
5780 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5781 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5782 AC_MSG_CHECKING([how to link with libintl])
5783 AC_MSG_RESULT([$LIBINTL])
5784 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
5787 dnl For backward compatibility. Some packages may be using this.
5788 AC_DEFINE(HAVE_GETTEXT, 1,
5789 [Define if the GNU gettext() function is already present or preinstalled.])
5790 AC_DEFINE(HAVE_DCGETTEXT, 1,
5791 [Define if the GNU dcgettext() function is already present or preinstalled.])
5794 dnl We need to process the po/ directory.
5798 ifelse(gt_included_intl, yes, [
5799 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
5800 dnl to 'yes' because some of the testsuite requires it.
5801 if test "$PACKAGE" = gettext; then
5802 BUILD_INCLUDED_LIBINTL=yes
5805 dnl Make all variables we use known to autoconf.
5806 AC_SUBST(BUILD_INCLUDED_LIBINTL)
5807 AC_SUBST(USE_INCLUDED_LIBINTL)
5811 dnl For backward compatibility. Some configure.ins may be using this.
5813 nls_cv_header_libgt=
5815 dnl For backward compatibility. Some Makefiles may be using this.
5817 AC_SUBST(DATADIRNAME)
5819 dnl For backward compatibility. Some Makefiles may be using this.
5821 AC_SUBST(INSTOBJEXT)
5823 dnl For backward compatibility. Some Makefiles may be using this.
5827 dnl Enable libtool support if the surrounding package wishes it.
5828 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5829 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
5832 dnl For backward compatibility. Some Makefiles may be using this.
5836 dnl Make all documented variables known to autoconf.
5843 dnl Checks for all prerequisites of the po subdirectory,
5844 dnl except for USE_NLS.
5845 AC_DEFUN([AM_PO_SUBDIRS],
5847 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5848 AC_REQUIRE([AC_PROG_INSTALL])dnl
5849 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5851 dnl Perform the following tests also if --disable-nls has been given,
5852 dnl because they are needed for "make dist" to work.
5854 dnl Search for GNU msgfmt in the PATH.
5855 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5856 dnl The second test excludes FreeBSD msgfmt.
5857 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5858 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5859 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5861 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5863 dnl Search for GNU xgettext 0.11 or newer in the PATH.
5864 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
5865 dnl The second test excludes FreeBSD xgettext.
5866 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5867 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5868 (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)],
5870 dnl Remove leftover from FreeBSD xgettext call.
5873 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
5874 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
5875 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
5877 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5878 dnl Test whether we really found GNU msgfmt.
5879 if test "$GMSGFMT" != ":"; then
5880 dnl If it is no GNU msgfmt we define it as : so that the
5881 dnl Makefiles still can work.
5882 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
5883 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5886 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
5888 [found $GMSGFMT program is not GNU msgfmt; ignore it])
5893 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5894 dnl Test whether we really found GNU xgettext.
5895 if test "$XGETTEXT" != ":"; then
5896 dnl If it is no GNU xgettext we define it as : so that the
5897 dnl Makefiles still can work.
5898 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5899 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5903 [found xgettext program is not GNU xgettext; ignore it])
5906 dnl Remove leftover from FreeBSD xgettext call.
5910 AC_OUTPUT_COMMANDS([
5911 for ac_file in $CONFIG_FILES; do
5912 # Support "outfile[:infile[:infile...]]"
5914 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5916 # PO directories have a Makefile.in generated from Makefile.in.in.
5917 case "$ac_file" in */Makefile.in)
5918 # Adjust a relative srcdir.
5919 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
5920 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
5921 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
5922 # In autoconf-2.13 it is called $ac_given_srcdir.
5923 # In autoconf-2.50 it is called $srcdir.
5924 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
5925 case "$ac_given_srcdir" in
5926 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
5927 /*) top_srcdir="$ac_given_srcdir" ;;
5928 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
5930 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
5931 rm -f "$ac_dir/POTFILES"
5932 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
5933 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
5934 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
5935 # on $ac_dir but don't depend on user-specified configuration
5937 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
5938 # The LINGUAS file contains the set of available languages.
5939 if test -n "$ALL_LINGUAS"; then
5940 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
5942 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
5943 # Hide the ALL_LINGUAS assigment from automake.
5944 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
5946 case "$ac_given_srcdir" in
5948 *) srcdirpre='$(srcdir)/' ;;
5954 for lang in $ALL_LINGUAS; do
5955 POFILES="$POFILES $srcdirpre$lang.po"
5956 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
5957 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
5958 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
5960 # CATALOGS depends on both $ac_dir and the user's LINGUAS
5961 # environment variable.
5963 if test -n "$ALL_LINGUAS"; then
5964 for presentlang in $ALL_LINGUAS; do
5966 if test "%UNSET%" != "$LINGUAS"; then
5967 desiredlanguages="$LINGUAS"
5969 desiredlanguages="$ALL_LINGUAS"
5971 for desiredlang in $desiredlanguages; do
5972 # Use the presentlang catalog if desiredlang is
5973 # a. equal to presentlang, or
5974 # b. a variant of presentlang (because in this case,
5975 # presentlang can be used as a fallback for messages
5976 # which are not translated in the desiredlang catalog).
5977 case "$desiredlang" in
5978 "$presentlang"*) useit=yes;;
5981 if test $useit = yes; then
5982 INST_LINGUAS="$INST_LINGUAS $presentlang"
5987 if test -n "$INST_LINGUAS"; then
5988 for lang in $INST_LINGUAS; do
5989 CATALOGS="$CATALOGS $lang.gmo"
5992 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
5993 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"
5994 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
5995 if test -f "$f"; then
5997 *.orig | *.bak | *~) ;;
5998 *) cat "$f" >> "$ac_dir/Makefile" ;;
6006 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
6007 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
6009 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
6010 # Capture the value of LINGUAS because we need it to compute CATALOGS.
6011 LINGUAS="${LINGUAS-%UNSET%}"
6016 dnl Checks for all prerequisites of the intl subdirectory,
6017 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
6018 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
6019 AC_DEFUN([AM_INTL_SUBDIR],
6021 AC_REQUIRE([AC_PROG_INSTALL])dnl
6022 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6023 AC_REQUIRE([AC_PROG_CC])dnl
6024 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6025 AC_REQUIRE([AC_PROG_RANLIB])dnl
6026 AC_REQUIRE([AC_ISC_POSIX])dnl
6027 AC_REQUIRE([AC_HEADER_STDC])dnl
6028 AC_REQUIRE([AC_C_CONST])dnl
6029 AC_REQUIRE([AC_C_INLINE])dnl
6030 AC_REQUIRE([AC_TYPE_OFF_T])dnl
6031 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
6032 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
6033 AC_REQUIRE([AC_FUNC_MMAP])dnl
6034 AC_REQUIRE([jm_GLIBC21])dnl
6035 AC_REQUIRE([gt_INTDIV0])dnl
6036 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
6037 AC_REQUIRE([gt_INTTYPES_PRI])dnl
6039 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
6040 stdlib.h string.h unistd.h sys/param.h])
6041 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
6042 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
6043 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
6047 if test $ac_cv_header_locale_h = yes; then
6051 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
6052 dnl because plural.y uses bison specific features. It requires at least
6053 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
6055 dnl bison is only needed for the maintainer (who touches plural.y). But in
6056 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
6057 dnl the rule in general Makefile. Now, some people carelessly touch the
6058 dnl files or have a broken "make" program, hence the plural.c rule will
6059 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
6060 dnl present or too old.
6061 AC_CHECK_PROGS([INTLBISON], [bison])
6062 if test -z "$INTLBISON"; then
6065 dnl Found it, now check the version.
6066 AC_MSG_CHECKING([version of bison])
6067 changequote(<<,>>)dnl
6068 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6069 case $ac_prog_version in
6070 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6071 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6073 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6074 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6076 AC_MSG_RESULT([$ac_prog_version])
6078 if test $ac_verc_fail = yes; then
6084 AC_DEFUN([AM_MKINSTALLDIRS],
6086 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
6087 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
6088 dnl Try to locate is.
6090 if test -n "$ac_aux_dir"; then
6091 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6093 if test -z "$MKINSTALLDIRS"; then
6094 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6096 AC_SUBST(MKINSTALLDIRS)
6100 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
6101 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
6103 # progtest.m4 serial 2 (gettext-0.10.40)
6104 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
6105 dnl This file is free software, distributed under the terms of the GNU
6106 dnl General Public License. As a special exception to the GNU General
6107 dnl Public License, this file may be distributed as part of a program
6108 dnl that contains a configuration script generated by Autoconf, under
6109 dnl the same distribution terms as the rest of that program.
6111 dnl This file can can be used in projects which are not available under
6112 dnl the GNU General Public License or the GNU Library General Public
6113 dnl License but which still want to provide support for the GNU gettext
6115 dnl Please note that the actual code of the GNU gettext library is covered
6116 dnl by the GNU Library General Public License, and the rest of the GNU
6117 dnl gettext package package is covered by the GNU General Public License.
6118 dnl They are *not* in the public domain.
6121 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
6123 # Search path for a program which passes the given test.
6125 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
6126 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
6127 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
6128 [# Extract the first word of "$2", so it can be a program name with args.
6129 set dummy $2; ac_word=[$]2
6130 AC_MSG_CHECKING([for $ac_word])
6131 AC_CACHE_VAL(ac_cv_path_$1,
6134 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
6137 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6138 for ac_dir in ifelse([$5], , $PATH, [$5]); do
6139 test -z "$ac_dir" && ac_dir=.
6140 if test -f $ac_dir/$ac_word; then
6142 ac_cv_path_$1="$ac_dir/$ac_word"
6148 dnl If no 4th arg is given, leave the cache variable unset,
6149 dnl so AC_PATH_PROGS will keep looking.
6150 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
6155 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
6156 AC_MSG_RESULT([$]$1)
6163 # intdiv0.m4 serial 1 (gettext-0.11.3)
6164 dnl Copyright (C) 2002 Free Software Foundation, Inc.
6165 dnl This file is free software, distributed under the terms of the GNU
6166 dnl General Public License. As a special exception to the GNU General
6167 dnl Public License, this file may be distributed as part of a program
6168 dnl that contains a configuration script generated by Autoconf, under
6169 dnl the same distribution terms as the rest of that program.
6171 dnl From Bruno Haible.
6173 AC_DEFUN([gt_INTDIV0],
6175 AC_REQUIRE([AC_PROG_CC])dnl
6176 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6178 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
6179 gt_cv_int_divbyzero_sigfpe,
6187 sigfpe_handler (int sig)
6189 sigfpe_handler (sig) int sig;
6192 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
6193 exit (sig != SIGFPE);
6203 signal (SIGFPE, sigfpe_handler);
6204 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
6205 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
6206 signal (SIGTRAP, sigfpe_handler);
6208 /* Linux/SPARC yields signal SIGILL. */
6209 #if defined (__sparc__) && defined (__linux__)
6210 signal (SIGILL, sigfpe_handler);
6217 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
6219 # Guess based on the CPU.
6221 alpha* | i[34567]86 | m68k | s390*)
6222 gt_cv_int_divbyzero_sigfpe="guessing yes";;
6224 gt_cv_int_divbyzero_sigfpe="guessing no";;
6228 case "$gt_cv_int_divbyzero_sigfpe" in
6232 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
6233 [Define if integer division by zero raises signal SIGFPE.])
6236 # lcmessage.m4 serial 3 (gettext-0.11.3)
6237 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6238 dnl This file is free software, distributed under the terms of the GNU
6239 dnl General Public License. As a special exception to the GNU General
6240 dnl Public License, this file may be distributed as part of a program
6241 dnl that contains a configuration script generated by Autoconf, under
6242 dnl the same distribution terms as the rest of that program.
6244 dnl This file can can be used in projects which are not available under
6245 dnl the GNU General Public License or the GNU Library General Public
6246 dnl License but which still want to provide support for the GNU gettext
6248 dnl Please note that the actual code of the GNU gettext library is covered
6249 dnl by the GNU Library General Public License, and the rest of the GNU
6250 dnl gettext package package is covered by the GNU General Public License.
6251 dnl They are *not* in the public domain.
6254 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
6256 # Check whether LC_MESSAGES is available in <locale.h>.
6258 AC_DEFUN([AM_LC_MESSAGES],
6260 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6261 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
6262 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
6263 if test $am_cv_val_LC_MESSAGES = yes; then
6264 AC_DEFINE(HAVE_LC_MESSAGES, 1,
6265 [Define if your <locale.h> file defines LC_MESSAGES.])