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 57 -*- 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)
999 # See if linking `seq' requires -lm.
1000 # It does on nearly every system. The single exception (so far) is
1001 # BeOS which has all the math functions in the normal runtime library
1002 # and doesn't have a separate math library.
1010 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1011 [ac_seq_save_LIBS="$LIBS"
1013 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1014 LIBS="$ac_seq_save_LIBS"
1020 jm_FUNC_UNLINK_BUSY_TEXT
1022 # These tests are for df.
1023 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1025 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1026 if test $list_mounted_fs = yes && test $space = yes; then
1029 AC_LIBOBJ(mountlist)
1031 AC_REQUIRE([jm_AC_DOS])
1032 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1036 # These tests must be run before any use of AC_CHECK_TYPE,
1037 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1038 # See the definition of ac_includes_default in `configure'.
1039 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1082 # This macro must be invoked before any tests that run the compiler.
1083 AC_DEFUN([jm_CHECK_ALL_TYPES],
1085 dnl This test must come as early as possible after the compiler configuration
1086 dnl tests, because the choice of the file model can (in principle) affect
1087 dnl whether functions and headers are available, whether they work, etc.
1088 AC_REQUIRE([AC_SYS_LARGEFILE])
1090 dnl This test must precede tests of compiler characteristics like
1091 dnl that for the inline keyword, since it may change the degree to
1092 dnl which the compiler supports such features.
1093 AC_REQUIRE([AM_C_PROTOTYPES])
1095 dnl Checks for typedefs, structures, and compiler characteristics.
1096 AC_REQUIRE([AC_C_BIGENDIAN])
1097 AC_REQUIRE([AC_C_CONST])
1098 AC_REQUIRE([AC_C_VOLATILE])
1099 AC_REQUIRE([AC_C_INLINE])
1100 AC_REQUIRE([AC_C_LONG_DOUBLE])
1102 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1103 AC_REQUIRE([AC_HEADER_DIRENT])
1104 AC_REQUIRE([AC_HEADER_STDC])
1106 [struct stat.st_author,
1107 struct stat.st_blksize],,,
1108 [$ac_includes_default
1109 #include <sys/stat.h>
1111 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1113 AC_REQUIRE([AC_STRUCT_TM])
1114 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1115 AC_REQUIRE([AC_HEADER_STAT])
1116 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1117 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1118 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1120 AC_REQUIRE([AC_TYPE_GETGROUPS])
1121 AC_REQUIRE([AC_TYPE_MODE_T])
1122 AC_REQUIRE([AC_TYPE_OFF_T])
1123 AC_REQUIRE([AC_TYPE_PID_T])
1124 AC_REQUIRE([AC_TYPE_SIGNAL])
1125 AC_REQUIRE([AC_TYPE_SIZE_T])
1126 AC_REQUIRE([AC_TYPE_UID_T])
1127 AC_CHECK_TYPE(ino_t, unsigned long)
1129 dnl This relies on the fact that autoconf 2.14a's implementation of
1130 dnl AC_CHECK_TYPE checks includes unistd.h.
1131 AC_CHECK_TYPE(ssize_t, int)
1132 AC_CHECK_TYPE(major_t, unsigned int)
1133 AC_CHECK_TYPE(minor_t, unsigned int)
1135 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1136 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1138 AC_REQUIRE([AC_HEADER_MAJOR])
1139 AC_REQUIRE([AC_HEADER_DIRENT])
1143 # isc-posix.m4 serial 2 (gettext-0.11.2)
1144 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1145 dnl This file is free software, distributed under the terms of the GNU
1146 dnl General Public License. As a special exception to the GNU General
1147 dnl Public License, this file may be distributed as part of a program
1148 dnl that contains a configuration script generated by Autoconf, under
1149 dnl the same distribution terms as the rest of that program.
1151 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1153 # This test replaces the one in autoconf.
1154 # Currently this macro should have the same name as the autoconf macro
1155 # because gettext's gettext.m4 (distributed in the automake package)
1156 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1157 # give these diagnostics:
1158 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1159 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1161 undefine([AC_ISC_POSIX])
1163 AC_DEFUN([AC_ISC_POSIX],
1165 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1166 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1172 dnl Initially derived from code in GNU grep.
1173 dnl Mostly written by Jim Meyering.
1175 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1177 AC_DEFUN([jm_INCLUDED_REGEX],
1179 dnl Even packages that don't use regex.c can use this macro.
1180 dnl Of course, for them it doesn't do anything.
1182 # Assume we'll default to using the included regex.c.
1183 ac_use_included_regex=yes
1185 # However, if the system regex support is good enough that it passes the
1186 # the following run test, then default to *not* using the included regex.c.
1187 # If cross compiling, assume the test would fail and use the included
1188 # regex.c. The first failing regular expression is from `Spencer ere
1189 # test #75' in grep-2.3.
1190 AC_CACHE_CHECK([for working re_compile_pattern],
1191 jm_cv_func_working_re_compile_pattern,
1199 static struct re_pattern_buffer regex;
1201 struct re_registers regs;
1202 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1203 memset (®ex, 0, sizeof (regex));
1204 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1205 /* This should fail with _Invalid character class name_ error. */
1209 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1210 memset (®ex, 0, sizeof (regex));
1211 s = re_compile_pattern ("{1", 2, ®ex);
1216 /* The following example is derived from a problem report
1217 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1218 memset (®ex, 0, sizeof (regex));
1219 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1223 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1224 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1230 jm_cv_func_working_re_compile_pattern=yes,
1231 jm_cv_func_working_re_compile_pattern=no,
1232 dnl When crosscompiling, assume it's broken.
1233 jm_cv_func_working_re_compile_pattern=no))
1234 if test $jm_cv_func_working_re_compile_pattern = yes; then
1235 ac_use_included_regex=no
1238 test -n "$1" || AC_MSG_ERROR([missing argument])
1239 m4_syscmd([test -f $1])
1240 ifelse(m4_sysval, 0,
1242 AC_ARG_WITH(included-regex,
1243 [ --without-included-regex don't compile regex; this is the default on
1244 systems with version 2 of the GNU C library
1245 (use with caution on other system)],
1246 jm_with_regex=$withval,
1247 jm_with_regex=$ac_use_included_regex)
1248 if test "$jm_with_regex" = yes; then
1258 dnl From Paul Eggert.
1260 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1261 AC_DEFUN([UTILS_HOST_OS],
1263 AC_CACHE_CHECK([host operating system],
1264 utils_cv_host_operating_system,
1268 # These operating system names do not use the default heuristic below.
1269 # They are in reverse order, so that more-specific prefixes come first.
1270 winnt*) os='Windows NT';;
1272 sysv*) os='Unix System V';;
1273 superux*) os='SUPER-UX';;
1274 sunos*) os='SunOS';;
1276 sco*) os='SCO Unix';;
1277 riscos*) os='RISC OS';;
1278 riscix*) os='RISCiX';;
1282 plan9*) os='Plan 9';;
1285 openbsd*) os='OpenBSD';;
1286 nsk*) os='NonStop Kernel';;
1287 nonstopux*) os='NonStop-UX';;
1288 netbsd*) os='NetBSD';;
1289 msdosdjgpp*) os='DJGPP';;
1290 mpeix*) os='MPE/iX';;
1292 mingw*) os='MinGW';;
1293 lynxos*) os='LynxOS';;
1294 linux*) os='GNU/Linux';;
1298 freebsd*-gnu*) os='GNU/FreeBSD';;
1299 freebsd*) os='FreeBSD';;
1301 bsdi*) os='BSD/OS';;
1305 atheos*) os='AtheOS';;
1306 amigaos*) os='Amiga OS';;
1309 # The default heuristic takes the initial alphabetic string
1310 # from $host_os, but capitalizes its first letter.
1313 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1315 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1319 # If $host_os does not start with an alphabetic string, use it unchanged.
1323 utils_cv_host_operating_system=$os]])
1324 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1325 "$utils_cv_host_operating_system",
1326 [The host operating system.])
1331 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1332 # On such systems, arrange to use a wrapper function that removes any
1334 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1336 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1337 utils_cv_func_mkdir_trailing_slash_bug,
1339 # Arrange for deletion of the temporary directory this test might create.
1340 ac_clean_files="$ac_clean_files confdir-slash"
1342 # include <sys/types.h>
1343 # include <sys/stat.h>
1344 # include <stdlib.h>
1347 rmdir ("confdir-slash");
1348 exit (mkdir ("confdir-slash/", 0700));
1351 utils_cv_func_mkdir_trailing_slash_bug=no,
1352 utils_cv_func_mkdir_trailing_slash_bug=yes,
1353 utils_cv_func_mkdir_trailing_slash_bug=yes
1358 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1360 AC_DEFINE(mkdir, rpl_mkdir,
1361 [Define to rpl_mkdir if the replacement function should be used.])
1367 AC_DEFUN([jm_BISON],
1369 # getdate.y works with bison only.
1370 : ${YACC='bison -y'}
1375 dnl based on code from Eleftherios Gkioulekas
1377 AC_DEFUN([jm_ASSERT],
1379 AC_MSG_CHECKING(whether to enable assertions)
1380 AC_ARG_ENABLE(assert,
1381 [ --disable-assert turn off assertions],
1383 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1384 [ AC_MSG_RESULT(yes) ]
1390 dnl From Jim Meyering
1392 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1393 dnl usually in <utime.h>.
1394 dnl Some systems have utime.h but don't declare the struct anywhere.
1396 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1398 AC_CHECK_HEADERS(utime.h)
1399 AC_REQUIRE([AC_HEADER_TIME])
1400 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1403 #ifdef TIME_WITH_SYS_TIME
1404 # include <sys/time.h>
1407 # ifdef HAVE_SYS_TIME_H
1408 # include <sys/time.h>
1417 [static struct utimbuf x; x.actime = x.modtime;],
1418 fu_cv_sys_struct_utimbuf=yes,
1419 fu_cv_sys_struct_utimbuf=no)
1422 if test $fu_cv_sys_struct_utimbuf = yes; then
1423 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1424 [Define if struct utimbuf is declared -- usually in <utime.h>.
1425 Some systems have utime.h but don't declare the struct anywhere. ])
1431 dnl From Jim Meyering.
1433 dnl Check whether struct dirent has a member named d_type.
1436 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1437 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1438 AC_CACHE_CHECK([for d_type member in directory struct],
1439 jm_cv_struct_dirent_d_type,
1442 #include <sys/types.h>
1443 #ifdef HAVE_DIRENT_H
1444 # include <dirent.h>
1445 #else /* not HAVE_DIRENT_H */
1446 # define dirent direct
1447 # ifdef HAVE_SYS_NDIR_H
1448 # include <sys/ndir.h>
1449 # endif /* HAVE_SYS_NDIR_H */
1450 # ifdef HAVE_SYS_DIR_H
1451 # include <sys/dir.h>
1452 # endif /* HAVE_SYS_DIR_H */
1455 # endif /* HAVE_NDIR_H */
1456 #endif /* HAVE_DIRENT_H */
1458 [struct dirent dp; dp.d_type = 0;],
1460 jm_cv_struct_dirent_d_type=yes,
1461 jm_cv_struct_dirent_d_type=no)
1464 if test $jm_cv_struct_dirent_d_type = yes; then
1465 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1466 [Define if there is a member named d_type in the struct describing
1467 directory headers.])
1474 dnl From Jim Meyering.
1476 dnl Check whether struct dirent has a member named d_ino.
1479 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1480 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1481 AC_CACHE_CHECK([for d_ino member in directory struct],
1482 jm_cv_struct_dirent_d_ino,
1485 #include <sys/types.h>
1486 #ifdef HAVE_DIRENT_H
1487 # include <dirent.h>
1488 #else /* not HAVE_DIRENT_H */
1489 # define dirent direct
1490 # ifdef HAVE_SYS_NDIR_H
1491 # include <sys/ndir.h>
1492 # endif /* HAVE_SYS_NDIR_H */
1493 # ifdef HAVE_SYS_DIR_H
1494 # include <sys/dir.h>
1495 # endif /* HAVE_SYS_DIR_H */
1498 # endif /* HAVE_NDIR_H */
1499 #endif /* HAVE_DIRENT_H */
1501 [struct dirent dp; dp.d_ino = 0;],
1503 jm_cv_struct_dirent_d_ino=yes,
1504 jm_cv_struct_dirent_d_ino=no)
1507 if test $jm_cv_struct_dirent_d_ino = yes; then
1508 AC_DEFINE(D_INO_IN_DIRENT, 1,
1509 [Define if there is a member named d_ino in the struct describing
1510 directory headers.])
1517 dnl This is just a wrapper function to encapsulate this kludge.
1518 dnl Putting it in a separate file like this helps share it between
1519 dnl different packages.
1520 AC_DEFUN([jm_CHECK_DECLS],
1522 AC_REQUIRE([_jm_DECL_HEADERS])
1523 AC_REQUIRE([AC_HEADER_TIME])
1527 # if !STDC_HEADERS && HAVE_MEMORY_H
1528 # include <memory.h>
1530 # include <string.h>
1533 # include <strings.h>
1537 # include <stdlib.h>
1540 # include <unistd.h>
1543 #include <sys/types.h>
1544 #if TIME_WITH_SYS_TIME
1545 # include <sys/time.h>
1548 # if HAVE_SYS_TIME_H
1549 # include <sys/time.h>
1589 ttyname], , , $headers)
1592 dnl FIXME: when autoconf has support for it.
1593 dnl This is a little helper so we can require these header checks.
1594 AC_DEFUN([_jm_DECL_HEADERS],
1596 AC_REQUIRE([AC_HEADER_STDC])
1597 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1598 unistd.h sys/time.h utmp.h utmpx.h)
1603 dnl We use jm_ for non Autoconf macros.
1604 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1606 # These are the prerequisite macros for files in the lib/
1607 # directory of the coreutils package.
1609 AC_DEFUN([jm_PREREQ],
1611 AC_REQUIRE([jm_PREREQ_ADDEXT])
1612 AC_REQUIRE([jm_PREREQ_C_STACK])
1613 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1614 AC_REQUIRE([jm_PREREQ_DIRNAME])
1615 AC_REQUIRE([jm_PREREQ_ERROR])
1616 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1617 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1618 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1619 AC_REQUIRE([jm_PREREQ_HASH])
1620 AC_REQUIRE([jm_PREREQ_HUMAN])
1621 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1622 AC_REQUIRE([jm_PREREQ_MEMCHR])
1623 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1624 AC_REQUIRE([jm_PREREQ_POSIXVER])
1625 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1626 AC_REQUIRE([jm_PREREQ_READUTMP])
1627 AC_REQUIRE([jm_PREREQ_REGEX])
1628 AC_REQUIRE([jm_PREREQ_STAT])
1629 AC_REQUIRE([jm_PREREQ_STRNLEN])
1630 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1631 AC_REQUIRE([jm_PREREQ_XGETCWD])
1632 AC_REQUIRE([jm_PREREQ_XREADLINK])
1635 AC_DEFUN([jm_PREREQ_ADDEXT],
1638 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1639 AC_CHECK_FUNCS(pathconf)
1640 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1643 AC_DEFUN([jm_PREREQ_CANON_HOST],
1645 dnl Add any libraries as early as possible.
1646 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1647 dnl so we have to add -lnsl to LIBS before checking for that function.
1648 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1650 dnl These come from -lnsl on Solaris5.5.1.
1651 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1653 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1654 netinet/in.h arpa/inet.h)
1657 AC_DEFUN([jm_PREREQ_DIRNAME],
1659 AC_REQUIRE([AC_HEADER_STDC])
1660 AC_CHECK_HEADERS(string.h)
1663 AC_DEFUN([jm_PREREQ_EXCLUDE],
1665 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1666 AC_REQUIRE([AC_HEADER_STDBOOL])
1669 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1671 AC_CHECK_FUNCS(getpagesize)
1672 AC_CHECK_HEADERS(OS.h unistd.h)
1675 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1677 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1678 AC_CHECK_FUNCS(setlocale)
1679 AC_REQUIRE([AM_C_PROTOTYPES])
1682 AC_DEFUN([jm_PREREQ_HASH],
1684 AC_CHECK_HEADERS(stdlib.h)
1685 AC_REQUIRE([AC_HEADER_STDBOOL])
1686 AC_REQUIRE([jm_CHECK_DECLS])
1689 # If you use human.c, you need the following files:
1690 # inttypes.m4 longlong.m4
1691 AC_DEFUN([jm_PREREQ_HUMAN],
1693 AC_CHECK_HEADERS(locale.h)
1694 AC_CHECK_DECLS([getenv])
1695 AC_CHECK_FUNCS(localeconv)
1696 AC_REQUIRE([AC_HEADER_STDBOOL])
1697 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1700 AC_DEFUN([jm_PREREQ_MEMCHR],
1702 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1705 AC_DEFUN([jm_PREREQ_PHYSMEM],
1707 AC_CHECK_HEADERS(sys/pstat.h unistd.h)
1708 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
1711 AC_DEFUN([jm_PREREQ_POSIXVER],
1713 AC_CHECK_HEADERS(unistd.h)
1714 AC_CHECK_DECLS([getenv])
1717 AC_DEFUN([jm_PREREQ_QUOTEARG],
1719 AC_CHECK_FUNCS(isascii iswprint)
1720 AC_REQUIRE([jm_FUNC_MBRTOWC])
1721 AC_REQUIRE([jm_FUNC_MEMCMP])
1722 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1723 AC_REQUIRE([AC_HEADER_STDC])
1724 AC_REQUIRE([AC_C_BACKSLASH_A])
1725 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1726 AC_REQUIRE([AM_C_PROTOTYPES])
1729 AC_DEFUN([jm_PREREQ_READUTMP],
1731 AC_REQUIRE([AC_HEADER_STDC])
1732 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1733 AC_CHECK_FUNCS(utmpname)
1734 AC_CHECK_FUNCS(utmpxname)
1735 AC_REQUIRE([AM_C_PROTOTYPES])
1737 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1739 $ac_includes_default
1747 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1748 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1749 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1750 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1751 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1752 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1753 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1754 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1755 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1756 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1758 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1759 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1760 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1761 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1763 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1764 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1765 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1766 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1771 AC_DEFUN([jm_PREREQ_REGEX],
1773 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
1774 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1776 AC_CHECK_FUNCS(bzero bcopy isascii btowc)
1777 AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
1778 AC_REQUIRE([AC_HEADER_STDC])
1779 AC_REQUIRE([AC_FUNC_ALLOCA])
1782 AC_DEFUN([jm_PREREQ_STAT],
1784 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1785 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1786 AC_CHECK_FUNCS(statvfs)
1787 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
1790 $ac_includes_default
1791 #if HAVE_SYS_STATVFS_H
1792 # include <sys/statvfs.h>
1795 # include <sys/vfs.h>
1797 #if ( ! HAVE_SYS_STATVFS_H && ! HAVE_SYS_VFS_H && HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H )
1798 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
1799 # include <sys/param.h>
1800 # include <sys/mount.h>
1803 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
1804 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
1805 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
1806 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
1807 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
1808 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
1809 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
1810 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
1811 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
1812 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
1813 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
1816 AC_DEFUN([jm_PREREQ_STRNLEN],
1818 AC_REQUIRE([AC_FUNC_STRNLEN])
1819 AC_REQUIRE([AC_HEADER_STDC])
1820 AC_CHECK_HEADERS(memory.h)
1821 AC_CHECK_DECLS([memchr])
1823 # This is necessary because automake-1.6.1 doesn't understand
1824 # that the above use of AC_FUNC_STRNLEN means we may have to use
1826 test $ac_cv_func_strnlen_working = yes \
1827 && AC_LIBOBJ(strnlen)
1830 AC_DEFUN([jm_PREREQ_TEMPNAME],
1832 AC_REQUIRE([AC_HEADER_STDC])
1833 AC_REQUIRE([AC_HEADER_STAT])
1834 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
1835 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
1836 AC_CHECK_DECLS([getenv])
1837 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1840 AC_DEFUN([jm_PREREQ_XGETCWD],
1842 AC_REQUIRE([AC_C_PROTOTYPES])
1843 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
1844 AC_CHECK_FUNCS(getcwd)
1845 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
1848 AC_DEFUN([jm_PREREQ_XREADLINK],
1850 AC_REQUIRE([AC_C_PROTOTYPES])
1851 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
1854 # Check prerequisites for compiling lib/c-stack.c.
1856 # Copyright (C) 2002 Free Software Foundation, Inc.
1858 # This program is free software; you can redistribute it and/or modify
1859 # it under the terms of the GNU General Public License as published by
1860 # the Free Software Foundation; either version 2, or (at your option)
1861 # any later version.
1863 # This program is distributed in the hope that it will be useful,
1864 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1865 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1866 # GNU General Public License for more details.
1868 # You should have received a copy of the GNU General Public License
1869 # along with this program; if not, write to the Free Software
1870 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1873 # Written by Paul Eggert.
1875 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
1876 [# for STACK_DIRECTION
1877 AC_REQUIRE([AC_FUNC_ALLOCA])
1879 AC_CACHE_CHECK([for working C stack overflow detection],
1880 ac_cv_sys_xsi_stack_overflow_heuristic,
1884 #include <ucontext.h>
1888 char buffer[SIGSTKSZ];
1892 } alternate_signal_stack;
1895 # define find_stack_direction(ptr) STACK_DIRECTION
1898 find_stack_direction (char const *addr)
1901 return (! addr ? find_stack_direction (&dummy)
1902 : addr < &dummy ? 1 : -1);
1907 segv_handler (int signo, siginfo_t *info, void *context)
1909 if (0 < info->si_code)
1911 ucontext_t const *user_context = context;
1912 char const *stack_min = user_context->uc_stack.ss_sp;
1913 size_t stack_size = user_context->uc_stack.ss_size;
1914 char const *faulting_address = info->si_addr;
1915 size_t s = faulting_address - stack_min;
1916 size_t page_size = sysconf (_SC_PAGESIZE);
1917 if (find_stack_direction (0) < 0)
1919 if (s < stack_size + page_size)
1927 c_stack_action (void)
1930 struct sigaction act;
1934 st.ss_sp = alternate_signal_stack.buffer;
1935 st.ss_size = sizeof alternate_signal_stack.buffer;
1936 r = sigaltstack (&st, 0);
1940 sigemptyset (&act.sa_mask);
1941 act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
1942 act.sa_sigaction = segv_handler;
1943 return sigaction (SIGSEGV, &act, 0);
1951 return *p + recurse (array);
1958 return recurse ("\1");
1961 [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
1962 [ac_cv_sys_xsi_stack_overflow_heuristic=no],
1963 [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
1965 if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
1966 AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1,
1967 [Define to 1 if extending the stack slightly past the limit causes
1968 a SIGSEGV, and an alternate stack can be established with sigaltstack,
1969 and the signal handler is passed a context that specifies the
1970 run time stack. This behavior is defined by POSIX 1003.1-2001
1971 with the X/Open System Interface (XSI) option
1972 and is a standardized way to implement a SEGV-based stack
1973 overflow detection heuristic.])
1977 AC_DEFUN([jm_PREREQ_C_STACK],
1978 [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
1980 # for STACK_DIRECTION
1981 AC_REQUIRE([AC_FUNC_ALLOCA])
1983 AC_CHECK_FUNCS(getcontext sigaltstack)
1984 AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
1985 AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
1987 AC_CHECK_HEADERS(sys/resource.h ucontext.h unistd.h)
1989 AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
1993 dnl FIXME: put these prerequisite-only *.m4 files in a separate
1994 dnl directory -- otherwise, they'll conflict with existing files.
1996 dnl These are the prerequisite macros for GNU's error.c file.
1997 AC_DEFUN([jm_PREREQ_ERROR],
1999 AC_CHECK_FUNCS(strerror vprintf doprnt)
2000 AC_CHECK_DECLS([strerror])
2001 AC_CHECK_HEADERS([libintl.h])
2008 dnl autoconf tests required for use of mbswidth.c
2009 dnl From Bruno Haible.
2011 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2013 AC_REQUIRE([AC_HEADER_STDC])
2014 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2015 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2018 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2020 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2022 # include <string.h>
2029 char *p = (char *) wcwidth;
2031 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2032 if test $ac_cv_have_decl_wcwidth = yes; then
2037 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2038 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2043 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2044 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2045 dnl This file is free software, distributed under the terms of the GNU
2046 dnl General Public License. As a special exception to the GNU General
2047 dnl Public License, this file may be distributed as part of a program
2048 dnl that contains a configuration script generated by Autoconf, under
2049 dnl the same distribution terms as the rest of that program.
2051 dnl From Paul Eggert
2053 AC_DEFUN([jm_FUNC_MBRTOWC],
2055 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2058 [#include <wchar.h>],
2059 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2060 jm_cv_func_mbrtowc=yes,
2061 jm_cv_func_mbrtowc=no)])
2062 if test $jm_cv_func_mbrtowc = yes; then
2063 AC_DEFINE(HAVE_MBRTOWC, 1,
2064 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2070 dnl A replacement for autoconf's macro by the same name. This version
2071 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2072 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2073 dnl run only if one of the listed libraries ends up being used (and not in
2074 dnl the `none required' case.
2075 dnl I hope it's only temporary while we wait for that version to be fixed.
2076 undefine([AC_SEARCH_LIBS])
2078 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2079 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2080 # [OTHER-LIBRARIES])
2081 # --------------------------------------------------------
2082 # Search for a library defining FUNC, if it's not already available.
2083 AC_DEFUN([AC_SEARCH_LIBS],
2085 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2087 ac_func_search_save_LIBS=$LIBS
2089 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2090 if test "$ac_cv_search_$1" = no; then
2091 for ac_lib in $2; do
2092 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2093 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2096 LIBS=$ac_func_search_save_LIBS
2099 if test "$ac_cv_search_$1" = no; then :
2102 if test "$ac_cv_search_$1" = 'none required'; then :
2105 LIBS="$ac_cv_search_$1 $LIBS"
2111 # Check for stdbool.h that conforms to C99.
2113 # Copyright (C) 2002 Free Software Foundation, Inc.
2115 # This program is free software; you can redistribute it and/or modify
2116 # it under the terms of the GNU General Public License as published by
2117 # the Free Software Foundation; either version 2, or (at your option)
2118 # any later version.
2120 # This program is distributed in the hope that it will be useful,
2121 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2122 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2123 # GNU General Public License for more details.
2125 # You should have received a copy of the GNU General Public License
2126 # along with this program; if not, write to the Free Software
2127 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2130 AC_DEFUN([AC_HEADER_STDBOOL],
2131 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2132 [ac_cv_header_stdbool_h],
2135 #include <stdbool.h>
2137 "error: bool is not defined"
2140 "error: false is not defined"
2143 "error: false is not 0"
2146 "error: false is not defined"
2149 "error: true is not 1"
2151 #ifndef __bool_true_false_are_defined
2152 "error: __bool_true_false_are_defined is not defined"
2155 struct s { _Bool s: 1; _Bool t; } s;
2157 char a[true == 1 ? 1 : -1];
2158 char b[false == 0 ? 1 : -1];
2159 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2160 char d[(bool) -0.5 == true ? 1 : -1];
2162 char f[(_Bool) -0.0 == false ? 1 : -1];
2164 char h[sizeof (_Bool)];
2167 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2168 [ac_cv_header_stdbool_h=yes],
2169 [ac_cv_header_stdbool_h=no])])
2170 if test $ac_cv_header_stdbool_h = yes; then
2171 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2175 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2177 # This program is free software; you can redistribute it and/or modify
2178 # it under the terms of the GNU General Public License as published by
2179 # the Free Software Foundation; either version 2, or (at your option)
2180 # any later version.
2182 # This program is distributed in the hope that it will be useful,
2183 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2184 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2185 # GNU General Public License for more details.
2187 # You should have received a copy of the GNU General Public License
2188 # along with this program; if not, write to the Free Software
2189 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2194 AC_DEFUN([AM_C_PROTOTYPES],
2195 [AC_REQUIRE([AM_PROG_CC_STDC])
2196 AC_REQUIRE([AC_PROG_CPP])
2197 AC_MSG_CHECKING([for function prototypes])
2198 if test "$am_cv_prog_cc_stdc" != no; then
2200 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2204 U=_ ANSI2KNR=./ansi2knr
2206 # Ensure some checks needed by ansi2knr itself.
2208 AC_CHECK_HEADERS(string.h)
2210 AC_SUBST(ANSI2KNR)dnl
2213 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2216 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2218 # This program is free software; you can redistribute it and/or modify
2219 # it under the terms of the GNU General Public License as published by
2220 # the Free Software Foundation; either version 2, or (at your option)
2221 # any later version.
2223 # This program is distributed in the hope that it will be useful,
2224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2226 # GNU General Public License for more details.
2228 # You should have received a copy of the GNU General Public License
2229 # along with this program; if not, write to the Free Software
2230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2235 # @defmac AC_PROG_CC_STDC
2236 # @maindex PROG_CC_STDC
2238 # If the C compiler in not in ANSI C mode by default, try to add an option
2239 # to output variable @code{CC} to make it so. This macro tries various
2240 # options that select ANSI C on some system or another. It considers the
2241 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2243 # If you use this macro, you should check after calling it whether the C
2244 # compiler has been set to accept ANSI C; if not, the shell variable
2245 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2246 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2247 # program @code{ansi2knr}, which comes with Ghostscript.
2250 AC_DEFUN([AM_PROG_CC_STDC],
2251 [AC_REQUIRE([AC_PROG_CC])
2252 AC_BEFORE([$0], [AC_C_INLINE])
2253 AC_BEFORE([$0], [AC_C_CONST])
2254 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2255 dnl a magic option to avoid problems with ANSI preprocessor commands
2257 dnl FIXME: can't do this because then AC_AIX won't work due to a
2258 dnl circular dependency.
2259 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2260 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2261 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2262 [am_cv_prog_cc_stdc=no
2264 # Don't try gcc -ansi; that turns off useful extensions and
2265 # breaks some systems' header files.
2266 # AIX -qlanglvl=ansi
2267 # Ultrix and OSF/1 -std1
2268 # HP-UX 10.20 and later -Ae
2269 # HP-UX older versions -Aa -D_HPUX_SOURCE
2270 # SVR4 -Xc -D__EXTENSIONS__
2271 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2273 CC="$ac_save_CC $ac_arg"
2275 [#include <stdarg.h>
2277 #include <sys/types.h>
2278 #include <sys/stat.h>
2279 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2280 struct buf { int x; };
2281 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2282 static char *e (p, i)
2288 static char *f (char * (*g) (char **, int), char **p, ...)
2293 s = g (p, va_arg (v,int));
2297 int test (int i, double x);
2298 struct s1 {int (*f) (int a);};
2299 struct s2 {int (*f) (double a);};
2300 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2304 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2306 [am_cv_prog_cc_stdc="$ac_arg"; break])
2310 if test -z "$am_cv_prog_cc_stdc"; then
2311 AC_MSG_RESULT([none needed])
2313 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2315 case "x$am_cv_prog_cc_stdc" in
2317 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2321 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2325 dnl From Paul Eggert.
2329 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
2331 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
2333 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2334 AC_CHECK_TYPE(intmax_t, ,
2335 [test $ac_cv_type_long_long = yes \
2336 && ac_type='long long' \
2338 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
2339 [Define to widest signed type if <inttypes.h> doesn't define.])])
2342 # Define uintmax_t to unsigned long or unsigned long long
2343 # if <inttypes.h> doesn't define.
2345 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2347 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2348 AC_CHECK_TYPE(uintmax_t, ,
2349 [test $ac_cv_type_unsigned_long_long = yes \
2350 && ac_type='unsigned long long' \
2351 || ac_type='unsigned long'
2352 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2353 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
2358 dnl From Paul Eggert.
2360 # Define HAVE_LONG_LONG if 'long long' works.
2362 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2364 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2365 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2366 [long long llmax = (long long) -1;
2367 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2368 ac_cv_type_long_long=yes,
2369 ac_cv_type_long_long=no)])
2370 if test $ac_cv_type_long_long = yes; then
2371 AC_DEFINE(HAVE_LONG_LONG, 1,
2372 [Define if you have the long long type.])
2376 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2378 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2380 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2381 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2382 [unsigned long long ullmax = (unsigned long long) -1;
2383 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2384 ac_cv_type_unsigned_long_long=yes,
2385 ac_cv_type_unsigned_long_long=no)])
2386 if test $ac_cv_type_unsigned_long_long = yes; then
2387 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2388 [Define if you have the unsigned long long type.])
2394 AC_DEFUN([jm_FUNC_MEMCMP],
2395 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2396 if test $ac_cv_func_memcmp_working = no; then
2397 AC_DEFINE(memcmp, rpl_memcmp,
2398 [Define to rpl_memcmp if the replacement function should be used.])
2402 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2404 # Copyright 2001 Free Software Foundation, Inc.
2406 # This program is free software; you can redistribute it and/or modify
2407 # it under the terms of the GNU General Public License as published by
2408 # the Free Software Foundation; either version 2, or (at your option)
2409 # any later version.
2411 # This program is distributed in the hope that it will be useful,
2412 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2413 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2414 # GNU General Public License for more details.
2416 # You should have received a copy of the GNU General Public License
2417 # along with this program; if not, write to the Free Software Foundation,
2418 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2420 # Written by Paul Eggert.
2422 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2423 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2424 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2425 [ac_cv_func_getcwd_null],
2428 # ifdef HAVE_STDLIB_H
2429 # include <stdlib.h>
2431 # ifdef HAVE_UNISTD_H
2432 # include <unistd.h>
2440 if (chdir ("/") != 0)
2444 char *f = getcwd (NULL, 0);
2445 exit (! (f && f[0] == '/' && !f[1]));
2448 [ac_cv_func_getcwd_null=yes],
2449 [ac_cv_func_getcwd_null=no],
2450 [ac_cv_func_getcwd_null=no])])
2451 if test $ac_cv_func_getcwd_null = yes; then
2452 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2453 [Define if getcwd (NULL, 0) allocates memory for result.])
2458 dnl Find out how to get the file descriptor associated with an open DIR*.
2459 dnl From Jim Meyering
2461 AC_DEFUN([UTILS_FUNC_DIRFD],
2466 # include <dirent.h>
2467 #else /* not HAVE_DIRENT_H */
2468 # define dirent direct
2469 # if HAVE_SYS_NDIR_H
2470 # include <sys/ndir.h>
2471 # endif /* HAVE_SYS_NDIR_H */
2473 # include <sys/dir.h>
2474 # endif /* HAVE_SYS_DIR_H */
2477 # endif /* HAVE_NDIR_H */
2478 #endif /* HAVE_DIRENT_H */
2480 AC_CHECK_FUNCS(dirfd)
2481 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2483 AC_CACHE_CHECK([whether dirfd is a macro],
2484 jm_cv_func_dirfd_macro,
2485 AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2487 dirent_header_defines_dirfd
2489 jm_cv_func_dirfd_macro=yes,
2490 jm_cv_func_dirfd_macro=no))
2492 # Use the replacement only if we have no function, macro,
2493 # or declaration with that name.
2494 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2496 AC_REPLACE_FUNCS([dirfd])
2498 [how to get the file descriptor associated with an open DIR*],
2499 ac_cv_sys_dir_fd_member_name,
2501 dirfd_save_CFLAGS=$CFLAGS
2502 for ac_expr in d_fd dd_fd; do
2504 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2508 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2511 CFLAGS=$dirfd_save_CFLAGS
2512 test "$dir_fd_found" = yes && break
2514 test "$dir_fd_found" = yes || ac_expr=-1
2516 ac_cv_sys_dir_fd_member_name=$ac_expr
2519 if test $ac_cv_have_decl_dirfd = -1; then
2520 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2521 $ac_cv_sys_dir_fd_member_name,
2522 [the name of the file descriptor member of DIR])
2524 AH_VERBATIM(DIR_TO_FD,
2525 [#ifdef DIR_FD_MEMBER_NAME
2526 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2528 # define DIR_TO_FD(Dir_p) -1
2535 # acl.m4 - check for access control list (ACL) primitives
2537 # Copyright (C) 2002 Free Software Foundation, Inc.
2539 # This program is free software; you can redistribute it and/or modify
2540 # it under the terms of the GNU General Public License as published by
2541 # the Free Software Foundation; either version 2, or (at your option)
2542 # any later version.
2544 # This program is distributed in the hope that it will be useful,
2545 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2546 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2547 # GNU General Public License for more details.
2549 # You should have received a copy of the GNU General Public License
2550 # along with this program; if not, write to the Free Software Foundation,
2551 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2553 # Written by Paul Eggert.
2555 AC_DEFUN([AC_FUNC_ACL],
2556 [AC_CHECK_HEADERS(sys/acl.h)
2557 AC_CHECK_FUNCS(acl)])
2560 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2563 AC_DEFUN([AC_FUNC_FTW],
2566 AC_REQUIRE([AC_HEADER_DIRENT])
2567 AC_CHECK_HEADERS(sys/param.h)
2568 AC_CHECK_DECLS([stpcpy])
2570 # In the event that we have to use the replacement ftw.c,
2571 # see if we'll also need the replacement tsearch.c.
2572 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2574 AC_CACHE_CHECK([for working GNU ftw], ac_cv_func_ftw_working,
2576 # The following test would fail prior to glibc-2.3.2, because `depth'
2577 # would be 2 rather than 4.
2578 mkdir -p conftest.dir/a/b/c
2579 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2584 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2585 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2586 static char **p = _f;
2590 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2592 if (strcmp (file, *p++) != 0)
2601 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2602 exit ((err == 0 && depth == 4) ? 0 : 1);
2605 [ac_cv_func_ftw_working=yes],
2606 [ac_cv_func_ftw_working=no],
2607 [ac_cv_func_ftw_working=no])])
2609 if test $ac_cv_func_ftw_working = no; then
2611 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2612 # Add tsearch.o IFF we have to use the replacement ftw.c.
2613 if test -n "$need_tdestroy"; then
2614 AC_LIBOBJ([tsearch])
2615 # Link search.h to search_.h if we use the replacement tsearch.c.
2617 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2624 dnl From Jim Meyering.
2625 dnl Provide lchown on systems that lack it.
2627 AC_DEFUN([jm_FUNC_LCHOWN],
2629 AC_REQUIRE([AC_TYPE_UID_T])
2630 AC_REPLACE_FUNCS(lchown)
2635 # When rmdir fails because the specified directory is not empty, it sets
2636 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2637 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2638 # in general, to avoid depending on the use of any particular symbol, this
2639 # test runs a test to determine the actual numeric value.
2640 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2642 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2643 fetish_cv_func_rmdir_errno_not_empty,
2645 # Arrange for deletion of the temporary directory this test creates.
2646 ac_clean_files="$ac_clean_files confdir2"
2647 mkdir confdir2; : > confdir2/file
2660 s = fopen ("confdir2/errno", "w");
2661 fprintf (s, "%d\n", val);
2665 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2666 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2667 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2672 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2673 $fetish_cv_func_rmdir_errno_not_empty,
2674 [the value to which errno is set when rmdir fails on a nonempty directory])
2679 dnl From Jim Meyering.
2680 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2681 dnl If it doesn't, arrange to use the replacement function.
2684 AC_DEFUN([jm_FUNC_CHOWN],
2685 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2686 test -z "$ac_cv_header_unistd_h" \
2687 && AC_CHECK_HEADERS(unistd.h)
2688 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2690 # include <sys/types.h>
2691 # include <sys/stat.h>
2693 # ifdef HAVE_UNISTD_H
2694 # include <unistd.h>
2700 char *f = "conftest.chown";
2701 struct stat before, after;
2703 if (creat (f, 0600) < 0)
2705 if (stat (f, &before) < 0)
2707 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2709 if (stat (f, &after) < 0)
2711 exit ((before.st_uid == after.st_uid
2712 && before.st_gid == after.st_gid) ? 0 : 1);
2715 jm_cv_func_working_chown=yes,
2716 jm_cv_func_working_chown=no,
2717 dnl When crosscompiling, assume chown is broken.
2718 jm_cv_func_working_chown=no)
2720 if test $jm_cv_func_working_chown = no; then
2722 AC_DEFINE(chown, rpl_chown,
2723 [Define to rpl_chown if the replacement function should be used.])
2729 dnl From Jim Meyering.
2730 dnl A wrapper around AC_FUNC_MKTIME.
2732 AC_DEFUN([jm_FUNC_MKTIME],
2733 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2735 dnl mktime.c uses localtime_r if it exists. Check for it.
2736 AC_CHECK_FUNCS(localtime_r)
2738 if test $ac_cv_func_working_mktime = no; then
2739 AC_DEFINE(mktime, rpl_mktime,
2740 [Define to rpl_mktime if the replacement function should be used.])
2746 dnl From Jim Meyering.
2747 dnl Determine whether lstat has the bug that it succeeds when given the
2748 dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
2749 dnl (as of 1998-11-01) do this.
2751 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2752 dnl compile the wrapper function.
2755 AC_DEFUN([jm_FUNC_LSTAT],
2757 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2758 AC_CACHE_CHECK([whether lstat accepts an empty string],
2759 jm_cv_func_lstat_empty_string_bug,
2761 # include <sys/types.h>
2762 # include <sys/stat.h>
2768 exit (lstat ("", &sbuf) ? 1 : 0);
2771 jm_cv_func_lstat_empty_string_bug=yes,
2772 jm_cv_func_lstat_empty_string_bug=no,
2773 dnl When crosscompiling, assume lstat is broken.
2774 jm_cv_func_lstat_empty_string_bug=yes)
2776 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2778 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2779 [Define if lstat has the bug that it succeeds when given the zero-length
2780 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2787 dnl From Jim Meyering.
2788 dnl Determine whether stat has the bug that it succeeds when given the
2789 dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
2790 dnl (as of 1998-11-01) do this.
2792 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
2793 dnl compile the wrapper function.
2796 AC_DEFUN([jm_FUNC_STAT],
2798 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2799 AC_CACHE_CHECK([whether stat accepts an empty string],
2800 jm_cv_func_stat_empty_string_bug,
2802 # include <sys/types.h>
2803 # include <sys/stat.h>
2809 exit (stat ("", &sbuf) ? 1 : 0);
2812 jm_cv_func_stat_empty_string_bug=yes,
2813 jm_cv_func_stat_empty_string_bug=no,
2814 dnl When crosscompiling, assume stat is broken.
2815 jm_cv_func_stat_empty_string_bug=yes)
2817 if test $jm_cv_func_stat_empty_string_bug = yes; then
2819 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
2820 [Define if stat has the bug that it succeeds when given the zero-length
2821 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2828 dnl From Jim Meyering.
2829 dnl Check for the nanosleep function.
2830 dnl If not found, use the supplied replacement.
2833 AC_DEFUN([jm_FUNC_NANOSLEEP],
2835 nanosleep_save_libs=$LIBS
2837 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
2838 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
2839 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
2840 AC_SUBST(LIB_NANOSLEEP)
2842 AC_CACHE_CHECK([whether nanosleep works],
2843 jm_cv_func_nanosleep_works,
2845 AC_REQUIRE([AC_HEADER_TIME])
2847 # if TIME_WITH_SYS_TIME
2848 # include <sys/time.h>
2851 # if HAVE_SYS_TIME_H
2852 # include <sys/time.h>
2861 struct timespec ts_sleep, ts_remaining;
2862 ts_sleep.tv_sec = 0;
2863 ts_sleep.tv_nsec = 1;
2864 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
2867 jm_cv_func_nanosleep_works=yes,
2868 jm_cv_func_nanosleep_works=no,
2869 dnl When crosscompiling, assume the worst.
2870 jm_cv_func_nanosleep_works=no)
2872 if test $jm_cv_func_nanosleep_works = no; then
2873 AC_LIBOBJ(nanosleep)
2874 AC_DEFINE(nanosleep, rpl_nanosleep,
2875 [Define to rpl_nanosleep if the replacement function should be used.])
2878 LIBS=$nanosleep_save_libs
2881 #serial 7 -*- autoconf -*-
2883 dnl From Jim Meyering.
2885 dnl See if the glibc *_unlocked I/O macros are available.
2886 dnl Use only those *_unlocked macros that are declared.
2889 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
2891 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
2892 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2893 fread_unlocked, fwrite_unlocked, getc_unlocked,
2894 getchar_unlocked, putc_unlocked, putchar_unlocked])])
2898 dnl Written by Jim Meyering
2900 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
2902 dnl Do this replacement check manually because I want the hyphen
2903 dnl (not the underscore) in the filename.
2904 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
2910 dnl From Jim Meyering.
2912 dnl Check whether putenv ("FOO") removes FOO from the environment.
2913 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
2916 AC_DEFUN([jm_FUNC_PUTENV],
2917 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
2922 /* Put it in env. */
2923 if (putenv ("CONFTEST_putenv=val"))
2926 /* Try to remove it. */
2927 if (putenv ("CONFTEST_putenv"))
2930 /* Make sure it was deleted. */
2931 if (getenv ("CONFTEST_putenv") != 0)
2937 jm_cv_func_svid_putenv=yes,
2938 jm_cv_func_svid_putenv=no,
2939 dnl When crosscompiling, assume putenv is broken.
2940 jm_cv_func_svid_putenv=no)
2942 if test $jm_cv_func_svid_putenv = no; then
2944 AC_DEFINE(putenv, rpl_putenv,
2945 [Define to rpl_putenv if the replacement function should be used.])
2953 AC_MSG_CHECKING(for AFS)
2954 if test -d /afs; then
2955 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
2960 AC_MSG_RESULT($ac_result)
2965 # autoconf tests required for use of xstrtoumax.c
2967 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
2969 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
2970 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2971 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2972 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2973 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
2974 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
2976 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
2977 jm_cv_func_strtoumax_macro,
2978 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
2980 inttypes_h_defines_strtoumax
2982 jm_cv_func_strtoumax_macro=yes,
2983 jm_cv_func_strtoumax_macro=no))
2985 if test "$jm_cv_func_strtoumax_macro" != yes; then
2986 AC_REPLACE_FUNCS(strtoumax)
2989 dnl Only the replacement strtoumax invokes strtoul and strtoull,
2990 dnl so we need the replacements only if strtoumax does not exist.
2991 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
2993 AC_REPLACE_FUNCS(strtoul)
2995 dnl We don't need (and can't compile) the replacement strtoull
2996 dnl unless the type `unsigned long long' exists.
2997 if test "$ac_cv_type_unsigned_long_long" = yes; then
2998 AC_REPLACE_FUNCS(strtoull)
3005 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3007 # autoconf tests required for use of xstrtoimax.c
3009 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3011 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3012 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3013 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3014 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3015 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3016 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3018 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3019 jm_cv_func_strtoimax_macro,
3020 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3022 inttypes_h_defines_strtoimax
3024 jm_cv_func_strtoimax_macro=yes,
3025 jm_cv_func_strtoimax_macro=no))
3027 if test "$jm_cv_func_strtoimax_macro" != yes; then
3028 AC_REPLACE_FUNCS(strtoimax)
3031 dnl Only the replacement strtoimax invokes strtol and strtoll,
3032 dnl so we need the replacements only if strtoimax does not exist.
3033 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3035 AC_REPLACE_FUNCS(strtol)
3037 dnl We don't need (and can't compile) the replacement strtoll
3038 dnl unless the type `long long' exists.
3039 if test "$ac_cv_type_long_long" = yes; then
3040 AC_REPLACE_FUNCS(strtoll)
3047 dnl Run a program to determine whether whether link(2) follows symlinks.
3048 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3050 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3053 [whether link(2) dereferences a symlink specified with a trailing slash],
3054 jm_ac_cv_func_link_follows_symlink,
3056 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3057 dnl the appropriate framework.
3058 test -z "$ac_cv_header_unistd_h" \
3059 && AC_CHECK_HEADERS(unistd.h)
3061 # Create a regular file.
3062 echo > conftest.file
3065 # include <sys/types.h>
3066 # include <sys/stat.h>
3067 # ifdef HAVE_UNISTD_H
3068 # include <unistd.h>
3071 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3072 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3073 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3078 const char *file = "conftest.file";
3079 const char *sym = "conftest.sym";
3080 const char *hard = "conftest.hard";
3081 struct stat sb_file, sb_hard;
3083 /* Create a symlink to the regular file. */
3084 if (symlink (file, sym))
3087 /* Create a hard link to that symlink. */
3088 if (link (sym, hard))
3091 if (lstat (hard, &sb_hard))
3093 if (lstat (file, &sb_file))
3096 /* If the dev/inode of hard and file are the same, then
3097 the link call followed the symlink. */
3098 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3101 jm_ac_cv_func_link_follows_symlink=yes,
3102 jm_ac_cv_func_link_follows_symlink=no,
3103 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3106 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3107 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3108 [Define if `link(2)' dereferences symbolic links.])
3114 dnl This macro is intended to be used solely in this file.
3115 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3116 AC_DEFUN([_jm_STRFTIME_PREREQS],
3118 dnl strftime.c uses localtime_r and the underyling system strftime
3120 AC_CHECK_FUNCS(localtime_r strftime)
3122 AC_CHECK_HEADERS(limits.h)
3123 AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
3125 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3128 AC_CHECK_FUNCS(mblen mbrlen)
3130 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3131 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3132 [Define if struct tm has the tm_gmtoff member.])],
3134 [#include <time.h>])
3137 dnl From Jim Meyering.
3139 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3140 [AC_REQUIRE([AC_HEADER_TIME])dnl
3142 _jm_STRFTIME_PREREQS
3144 AC_REQUIRE([AC_C_CONST])dnl
3145 AC_REQUIRE([AC_HEADER_STDC])dnl
3146 AC_CHECK_HEADERS(sys/time.h)
3147 AC_DEFINE([my_strftime], [nstrftime],
3148 [Define to the name of the strftime replacement function.])
3151 AC_DEFUN([jm_FUNC_STRFTIME],
3153 _jm_STRFTIME_PREREQS
3158 dnl From Jim Meyering
3159 dnl Using code from emacs, based on suggestions from Paul Eggert
3160 dnl and Ulrich Drepper.
3162 dnl Find out how to determine the number of pending output bytes on a stream.
3163 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3164 dnl we have to grub around in the FILE struct.
3166 AC_DEFUN([jm_FUNC_FPENDING],
3168 AC_CHECK_HEADERS(stdio_ext.h)
3169 AC_REPLACE_FUNCS([__fpending])
3171 # if HAVE_STDIO_EXT_H
3172 # include <stdio_ext.h>
3175 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3176 if test $ac_cv_func___fpending = no; then
3178 [how to determine the number of pending output bytes on a stream],
3179 ac_cv_sys_pending_output_n_bytes,
3184 'fp->_IO_write_ptr - fp->_IO_write_base' \
3186 '# traditional Unix' \
3187 'fp->_ptr - fp->_base' \
3190 'fp->_p - fp->_bf._base' \
3193 'fp->__ptr - fp->__base' \
3196 'fp->__bufp - fp->__buffer' \
3198 '# old glibc iostream?' \
3199 'fp->_pptr - fp->_pbase' \
3202 '(*fp)->_ptr - (*fp)->_base' \
3204 '# e.g., DGUX R4.11; the info is not available' \
3208 # Skip each embedded comment.
3209 case "$ac_expr" in '#'*) continue;; esac
3214 [FILE *fp = stdin; (void) ($ac_expr);],
3217 test "$fp_done" = yes && break
3220 ac_cv_sys_pending_output_n_bytes=$ac_expr
3223 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3224 $ac_cv_sys_pending_output_n_bytes,
3225 [the number of pending output bytes on stream `fp'])
3229 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3230 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3231 dnl This file is free software, distributed under the terms of the GNU
3232 dnl General Public License. As a special exception to the GNU General
3233 dnl Public License, this file may be distributed as part of a program
3234 dnl that contains a configuration script generated by Autoconf, under
3235 dnl the same distribution terms as the rest of that program.
3237 dnl From Bruno Haible.
3239 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3240 # macros to non-string values. This is the case on AIX 4.3.3.
3242 AC_DEFUN([gt_INTTYPES_PRI],
3244 # autoconf-2.52 has a proper check for inttypes.h.
3247 if test $ac_cv_header_inttypes_h = yes; then
3248 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3249 gt_cv_inttypes_pri_broken,
3251 AC_TRY_COMPILE([#include <inttypes.h>
3255 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3258 if test "$gt_cv_inttypes_pri_broken" = yes; then
3259 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3260 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3266 dnl From Jim Meyering.
3267 dnl A wrapper around AC_FUNC_GETGROUPS.
3269 AC_DEFUN([jm_FUNC_GETGROUPS],
3270 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
3271 if test $ac_cv_func_getgroups_works = no; then
3272 AC_LIBOBJ(getgroups)
3273 AC_DEFINE(getgroups, rpl_getgroups,
3274 [Define as rpl_getgroups if getgroups doesn't work right.])
3276 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3283 AC_DEFUN([jm_SYS_PROC_UPTIME],
3284 [ dnl Require AC_PROG_CC to see if we're cross compiling.
3285 AC_REQUIRE([AC_PROG_CC])
3286 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
3287 [jm_cv_have_proc_uptime=no
3288 test -f /proc/uptime \
3289 && test "$cross_compiling" = no \
3290 && cat < /proc/uptime >/dev/null 2>/dev/null \
3291 && jm_cv_have_proc_uptime=yes])
3292 if test $jm_cv_have_proc_uptime = yes; then
3293 AC_DEFINE(HAVE_PROC_UPTIME, 1,
3294 [ Define if your system has the /proc/uptime special file.])
3300 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
3302 AC_DEFUN([jm_FUNC_FTRUNCATE],
3304 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
3306 if test "$ftruncate_missing" = yes; then
3307 AC_CHECK_HEADERS([unistd.h])
3308 AC_CHECK_FUNCS([chsize])
3309 AC_LIBOBJ(ftruncate)
3315 dnl From Volker Borchert.
3316 dnl Determine whether rename works for source paths with a trailing slash.
3317 dnl The rename from SunOS 4.1.1_U1 doesn't.
3319 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
3320 dnl to compile the wrapper function.
3323 AC_DEFUN([vb_FUNC_RENAME],
3325 AC_CACHE_CHECK([whether rename is broken],
3326 vb_cv_func_rename_trailing_slash_bug,
3328 rm -rf conftest.d1 conftest.d2
3329 mkdir conftest.d1 ||
3330 AC_MSG_ERROR([cannot create temporary directory])
3336 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
3339 vb_cv_func_rename_trailing_slash_bug=no,
3340 vb_cv_func_rename_trailing_slash_bug=yes,
3341 dnl When crosscompiling, assume rename is broken.
3342 vb_cv_func_rename_trailing_slash_bug=yes)
3344 rm -rf conftest.d1 conftest.d2
3346 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
3348 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
3349 [Define if rename does not work for source paths with a trailing slash,
3350 like the one from SunOS 4.1.1_U1.])
3356 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
3357 # silly limit that it can create no more than 26 files from a given template.
3358 # Other systems lack mkstemp altogether. On either type of system, arrange
3359 # to use the replacement function.
3360 AC_DEFUN([UTILS_FUNC_MKSTEMP],
3362 AC_REPLACE_FUNCS(mkstemp)
3363 if test $ac_cv_func_mkstemp = no; then
3364 utils_cv_func_mkstemp_limitations=yes
3366 AC_CACHE_CHECK([for mkstemp limitations],
3367 utils_cv_func_mkstemp_limitations,
3370 # include <stdlib.h>
3374 for (i = 0; i < 30; i++)
3376 char template[] = "conftestXXXXXX";
3377 int fd = mkstemp (template);
3385 utils_cv_func_mkstemp_limitations=no,
3386 utils_cv_func_mkstemp_limitations=yes,
3387 utils_cv_func_mkstemp_limitations=yes
3393 if test $utils_cv_func_mkstemp_limitations = yes; then
3396 AC_DEFINE(mkstemp, rpl_mkstemp,
3397 [Define to rpl_mkstemp if the replacement function should be used.])
3403 dnl From Jim Meyering.
3405 dnl See if gettimeofday clobbers the static buffer that localtime uses
3406 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
3407 dnl i.e. Darwin 1.3.7 has this problem.
3409 dnl If it does, then arrange to use gettimeofday and localtime only via
3410 dnl the wrapper functions that work around the problem.
3412 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
3414 AC_REQUIRE([AC_HEADER_TIME])
3415 AC_CHECK_HEADERS(string.h stdlib.h)
3416 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
3417 jm_cv_func_gettimeofday_clobber,
3421 # include <string.h>
3424 #if TIME_WITH_SYS_TIME
3425 # include <sys/time.h>
3428 # if HAVE_SYS_TIME_H
3429 # include <sys/time.h>
3436 # include <stdlib.h>
3446 lt = localtime (&t);
3448 gettimeofday (&tv, NULL);
3449 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
3455 jm_cv_func_gettimeofday_clobber=no,
3456 jm_cv_func_gettimeofday_clobber=yes,
3457 dnl When crosscompiling, assume it is broken.
3458 jm_cv_func_gettimeofday_clobber=yes)
3460 if test $jm_cv_func_gettimeofday_clobber = yes; then
3461 AC_LIBOBJ(gettimeofday)
3462 AC_DEFINE(localtime, rpl_localtime,
3463 [Define to rpl_localtime if the replacement function should be used.])
3464 AC_DEFINE(gettimeofday, rpl_gettimeofday,
3465 [Define to rpl_gettimeofday if the replacement function should be used.])
3466 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
3467 [Define if gettimeofday clobbers localtime's static buffer.])
3473 dnl From Jim Meyering
3474 dnl Replace the utime function on systems that need it.
3478 AC_DEFUN([jm_FUNC_UTIME],
3480 AC_CHECK_HEADERS(utime.h)
3481 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
3482 AC_REQUIRE([AC_FUNC_UTIME_NULL])
3484 if test $ac_cv_func_utime_null = no; then
3486 AC_REPLACE_FUNCS(utime)
3492 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
3493 dnl then do case-insensitive s/utime/utimes/.
3495 AC_DEFUN([jm_FUNC_UTIMES_NULL],
3496 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
3497 [rm -f conftest.data; > conftest.data
3499 /* In case stat has been defined to rpl_stat, undef it here. */
3501 #include <sys/types.h>
3502 #include <sys/stat.h>
3505 exit(!(stat ("conftest.data", &s) == 0
3506 && utimes("conftest.data", (long *)0) == 0
3507 && stat("conftest.data", &t) == 0
3508 && t.st_mtime >= s.st_mtime
3509 && t.st_mtime - s.st_mtime < 120));
3511 ac_cv_func_utimes_null=yes,
3512 ac_cv_func_utimes_null=no,
3513 ac_cv_func_utimes_null=no)
3514 rm -f core core.* *.core])
3516 if test $ac_cv_func_utimes_null = yes; then
3517 AC_DEFINE(HAVE_UTIMES_NULL, 1,
3518 [Define if utimes accepts a null argument])
3525 dnl See if there's a working, system-supplied version of the getline function.
3526 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
3527 dnl have a function by that name in -linet that doesn't have anything
3528 dnl to do with the function we need.
3529 AC_DEFUN([AM_FUNC_GETLINE],
3531 am_getline_needs_run_time_check=no
3532 AC_CHECK_FUNC(getline,
3533 dnl Found it in some library. Verify that it works.
3534 am_getline_needs_run_time_check=yes,
3535 am_cv_func_working_getline=no)
3536 if test $am_getline_needs_run_time_check = yes; then
3537 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
3538 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
3541 # include <sys/types.h>
3542 # include <string.h>
3544 { /* Based on a test program from Karl Heuer. */
3548 FILE *in = fopen ("./conftest.data", "r");
3551 len = getline (&line, &siz, in);
3552 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
3554 ], am_cv_func_working_getline=yes dnl The library version works.
3555 , am_cv_func_working_getline=no dnl The library version does NOT work.
3556 , am_cv_func_working_getline=no dnl We're cross compiling.
3560 if test $am_cv_func_working_getline = no; then
3565 # codeset.m4 serial AM1 (gettext-0.10.40)
3566 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3567 dnl This file is free software, distributed under the terms of the GNU
3568 dnl General Public License. As a special exception to the GNU General
3569 dnl Public License, this file may be distributed as part of a program
3570 dnl that contains a configuration script generated by Autoconf, under
3571 dnl the same distribution terms as the rest of that program.
3573 dnl From Bruno Haible.
3575 AC_DEFUN([AM_LANGINFO_CODESET],
3577 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3578 [AC_TRY_LINK([#include <langinfo.h>],
3579 [char* cs = nl_langinfo(CODESET);],
3580 am_cv_langinfo_codeset=yes,
3581 am_cv_langinfo_codeset=no)
3583 if test $am_cv_langinfo_codeset = yes; then
3584 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3585 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3589 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3590 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3591 dnl This file is free software, distributed under the terms of the GNU
3592 dnl General Public License. As a special exception to the GNU General
3593 dnl Public License, this file may be distributed as part of a program
3594 dnl that contains a configuration script generated by Autoconf, under
3595 dnl the same distribution terms as the rest of that program.
3597 # Test for the GNU C Library, version 2.1 or newer.
3598 # From Bruno Haible.
3600 AC_DEFUN([jm_GLIBC21],
3602 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3603 ac_cv_gnu_library_2_1,
3604 [AC_EGREP_CPP([Lucky GNU user],
3606 #include <features.h>
3607 #ifdef __GNU_LIBRARY__
3608 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3613 ac_cv_gnu_library_2_1=yes,
3614 ac_cv_gnu_library_2_1=no)
3618 GLIBC21="$ac_cv_gnu_library_2_1"
3622 # iconv.m4 serial AM4 (gettext-0.11.3)
3623 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3624 dnl This file is free software, distributed under the terms of the GNU
3625 dnl General Public License. As a special exception to the GNU General
3626 dnl Public License, this file may be distributed as part of a program
3627 dnl that contains a configuration script generated by Autoconf, under
3628 dnl the same distribution terms as the rest of that program.
3630 dnl From Bruno Haible.
3632 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
3634 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3635 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3636 AC_REQUIRE([AC_LIB_RPATH])
3638 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3640 AC_LIB_LINKFLAGS_BODY([iconv])
3643 AC_DEFUN([AM_ICONV_LINK],
3645 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
3646 dnl those with the standalone portable GNU libiconv installed).
3648 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3650 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
3652 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
3653 dnl because if the user has installed libiconv and not disabled its use
3654 dnl via --without-libiconv-prefix, he wants to use it. The first
3655 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
3656 am_save_CPPFLAGS="$CPPFLAGS"
3657 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
3659 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
3660 am_cv_func_iconv="no, consider installing GNU libiconv"
3662 AC_TRY_LINK([#include <stdlib.h>
3663 #include <iconv.h>],
3664 [iconv_t cd = iconv_open("","");
3665 iconv(cd,NULL,NULL,NULL,NULL);
3667 am_cv_func_iconv=yes)
3668 if test "$am_cv_func_iconv" != yes; then
3669 am_save_LIBS="$LIBS"
3670 LIBS="$LIBS $LIBICONV"
3671 AC_TRY_LINK([#include <stdlib.h>
3672 #include <iconv.h>],
3673 [iconv_t cd = iconv_open("","");
3674 iconv(cd,NULL,NULL,NULL,NULL);
3677 am_cv_func_iconv=yes)
3678 LIBS="$am_save_LIBS"
3681 if test "$am_cv_func_iconv" = yes; then
3682 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
3684 if test "$am_cv_lib_iconv" = yes; then
3685 AC_MSG_CHECKING([how to link with libiconv])
3686 AC_MSG_RESULT([$LIBICONV])
3688 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
3690 CPPFLAGS="$am_save_CPPFLAGS"
3695 AC_SUBST(LTLIBICONV)
3698 AC_DEFUN([AM_ICONV],
3701 if test "$am_cv_func_iconv" = yes; then
3702 AC_MSG_CHECKING([for iconv declaration])
3703 AC_CACHE_VAL(am_cv_proto_iconv, [
3711 #if defined(__STDC__) || defined(__cplusplus)
3712 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
3716 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
3717 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);"])
3718 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
3719 AC_MSG_RESULT([$]{ac_t:-
3720 }[$]am_cv_proto_iconv)
3721 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
3722 [Define as const if the declaration of iconv() needs const.])
3726 # lib-prefix.m4 serial 1 (gettext-0.11)
3727 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3728 dnl This file is free software, distributed under the terms of the GNU
3729 dnl General Public License. As a special exception to the GNU General
3730 dnl Public License, this file may be distributed as part of a program
3731 dnl that contains a configuration script generated by Autoconf, under
3732 dnl the same distribution terms as the rest of that program.
3734 dnl From Bruno Haible.
3736 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3737 dnl to access previously installed libraries. The basic assumption is that
3738 dnl a user will want packages to use other packages he previously installed
3739 dnl with the same --prefix option.
3740 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3741 dnl libraries, but is otherwise very convenient.
3742 AC_DEFUN([AC_LIB_PREFIX],
3744 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
3745 AC_REQUIRE([AC_PROG_CC])
3746 AC_REQUIRE([AC_CANONICAL_HOST])
3747 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3748 dnl By default, look in $includedir and $libdir.
3750 AC_LIB_WITH_FINAL_PREFIX([
3751 eval additional_includedir=\"$includedir\"
3752 eval additional_libdir=\"$libdir\"
3754 AC_ARG_WITH([lib-prefix],
3755 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
3756 --without-lib-prefix don't search for libraries in includedir and libdir],
3758 if test "X$withval" = "Xno"; then
3761 if test "X$withval" = "X"; then
3762 AC_LIB_WITH_FINAL_PREFIX([
3763 eval additional_includedir=\"$includedir\"
3764 eval additional_libdir=\"$libdir\"
3767 additional_includedir="$withval/include"
3768 additional_libdir="$withval/lib"
3772 if test $use_additional = yes; then
3773 dnl Potentially add $additional_includedir to $CPPFLAGS.
3774 dnl But don't add it
3775 dnl 1. if it's the standard /usr/include,
3776 dnl 2. if it's already present in $CPPFLAGS,
3777 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
3778 dnl 4. if it doesn't exist as a directory.
3779 if test "X$additional_includedir" != "X/usr/include"; then
3781 for x in $CPPFLAGS; do
3782 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3783 if test "X$x" = "X-I$additional_includedir"; then
3788 if test -z "$haveit"; then
3789 if test "X$additional_includedir" = "X/usr/local/include"; then
3790 if test -n "$GCC"; then
3792 linux*) haveit=yes;;
3796 if test -z "$haveit"; then
3797 if test -d "$additional_includedir"; then
3798 dnl Really add $additional_includedir to $CPPFLAGS.
3799 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
3804 dnl Potentially add $additional_libdir to $LDFLAGS.
3805 dnl But don't add it
3806 dnl 1. if it's the standard /usr/lib,
3807 dnl 2. if it's already present in $LDFLAGS,
3808 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
3809 dnl 4. if it doesn't exist as a directory.
3810 if test "X$additional_libdir" != "X/usr/lib"; then
3812 for x in $LDFLAGS; do
3813 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
3814 if test "X$x" = "X-L$additional_libdir"; then
3819 if test -z "$haveit"; then
3820 if test "X$additional_libdir" = "X/usr/local/lib"; then
3821 if test -n "$GCC"; then
3823 linux*) haveit=yes;;
3827 if test -z "$haveit"; then
3828 if test -d "$additional_libdir"; then
3829 dnl Really add $additional_libdir to $LDFLAGS.
3830 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
3838 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
3839 dnl acl_final_exec_prefix, containing the values to which $prefix and
3840 dnl $exec_prefix will expand at the end of the configure script.
3841 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
3843 dnl Unfortunately, prefix and exec_prefix get only finally determined
3844 dnl at the end of configure.
3845 if test "X$prefix" = "XNONE"; then
3846 acl_final_prefix="$ac_default_prefix"
3848 acl_final_prefix="$prefix"
3850 if test "X$exec_prefix" = "XNONE"; then
3851 acl_final_exec_prefix='${prefix}'
3853 acl_final_exec_prefix="$exec_prefix"
3855 acl_save_prefix="$prefix"
3856 prefix="$acl_final_prefix"
3857 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
3858 prefix="$acl_save_prefix"
3861 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
3862 dnl variables prefix and exec_prefix bound to the values they will have
3863 dnl at the end of the configure script.
3864 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
3866 acl_save_prefix="$prefix"
3867 prefix="$acl_final_prefix"
3868 acl_save_exec_prefix="$exec_prefix"
3869 exec_prefix="$acl_final_exec_prefix"
3871 exec_prefix="$acl_save_exec_prefix"
3872 prefix="$acl_save_prefix"
3875 # lib-link.m4 serial 3 (gettext-0.11.3)
3876 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3877 dnl This file is free software, distributed under the terms of the GNU
3878 dnl General Public License. As a special exception to the GNU General
3879 dnl Public License, this file may be distributed as part of a program
3880 dnl that contains a configuration script generated by Autoconf, under
3881 dnl the same distribution terms as the rest of that program.
3883 dnl From Bruno Haible.
3885 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
3886 dnl the libraries corresponding to explicit and implicit dependencies.
3887 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
3888 dnl augments the CPPFLAGS variable.
3889 AC_DEFUN([AC_LIB_LINKFLAGS],
3891 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3892 AC_REQUIRE([AC_LIB_RPATH])
3893 define([Name],[translit([$1],[./-], [___])])
3894 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3895 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3896 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
3897 AC_LIB_LINKFLAGS_BODY([$1], [$2])
3898 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
3899 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
3900 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
3902 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
3903 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
3904 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
3905 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
3907 AC_SUBST([LTLIB]NAME)
3908 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
3909 dnl results of this search when this library appears as a dependency.
3915 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
3916 dnl searches for libname and the libraries corresponding to explicit and
3917 dnl implicit dependencies, together with the specified include files and
3918 dnl the ability to compile and link the specified testcode. If found, it
3919 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
3920 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
3921 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
3922 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
3923 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
3925 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3926 AC_REQUIRE([AC_LIB_RPATH])
3927 define([Name],[translit([$1],[./-], [___])])
3928 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
3929 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
3931 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
3933 AC_LIB_LINKFLAGS_BODY([$1], [$2])
3935 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
3936 dnl because if the user has installed lib[]Name and not disabled its use
3937 dnl via --without-lib[]Name-prefix, he wants to use it.
3938 ac_save_CPPFLAGS="$CPPFLAGS"
3939 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
3941 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
3942 ac_save_LIBS="$LIBS"
3943 LIBS="$LIBS $LIB[]NAME"
3944 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
3945 LIBS="$ac_save_LIBS"
3947 if test "$ac_cv_lib[]Name" = yes; then
3949 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
3950 AC_MSG_CHECKING([how to link with lib[]$1])
3951 AC_MSG_RESULT([$LIB[]NAME])
3954 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
3955 dnl $INC[]NAME either.
3956 CPPFLAGS="$ac_save_CPPFLAGS"
3960 AC_SUBST([HAVE_LIB]NAME)
3962 AC_SUBST([LTLIB]NAME)
3967 dnl Determine the platform dependent parameters needed to use rpath:
3968 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
3969 dnl hardcode_direct, hardcode_minus_L,
3970 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
3971 AC_DEFUN([AC_LIB_RPATH],
3973 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
3974 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
3975 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
3976 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
3977 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
3978 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
3979 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
3985 libext="$acl_cv_libext"
3986 shlibext="$acl_cv_shlibext"
3987 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
3988 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
3989 hardcode_direct="$acl_cv_hardcode_direct"
3990 hardcode_minus_L="$acl_cv_hardcode_minus_L"
3991 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
3992 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
3993 dnl Determine whether the user wants rpath handling at all.
3994 AC_ARG_ENABLE(rpath,
3995 [ --disable-rpath do not hardcode runtime library paths],
3996 :, enable_rpath=yes)
3999 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
4000 dnl the libraries corresponding to explicit and implicit dependencies.
4001 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
4002 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
4004 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4005 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4006 dnl By default, look in $includedir and $libdir.
4008 AC_LIB_WITH_FINAL_PREFIX([
4009 eval additional_includedir=\"$includedir\"
4010 eval additional_libdir=\"$libdir\"
4012 AC_ARG_WITH([lib$1-prefix],
4013 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
4014 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
4016 if test "X$withval" = "Xno"; then
4019 if test "X$withval" = "X"; then
4020 AC_LIB_WITH_FINAL_PREFIX([
4021 eval additional_includedir=\"$includedir\"
4022 eval additional_libdir=\"$libdir\"
4025 additional_includedir="$withval/include"
4026 additional_libdir="$withval/lib"
4030 dnl Search the library and its dependencies in $additional_libdir and
4031 dnl $LDFLAGS. Using breadth-first-seach.
4037 names_already_handled=
4038 names_next_round='$1 $2'
4039 while test -n "$names_next_round"; do
4040 names_this_round="$names_next_round"
4042 for name in $names_this_round; do
4044 for n in $names_already_handled; do
4045 if test "$n" = "$name"; then
4050 if test -z "$already_handled"; then
4051 names_already_handled="$names_already_handled $name"
4052 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
4053 dnl or AC_LIB_HAVE_LINKFLAGS call.
4054 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4055 eval value=\"\$HAVE_LIB$uppername\"
4056 if test -n "$value"; then
4057 if test "$value" = yes; then
4058 eval value=\"\$LIB$uppername\"
4059 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
4060 eval value=\"\$LTLIB$uppername\"
4061 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
4063 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
4064 dnl that this library doesn't exist. So just drop it.
4068 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
4069 dnl and the already constructed $LIBNAME/$LTLIBNAME.
4074 if test $use_additional = yes; then
4075 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
4076 found_dir="$additional_libdir"
4077 found_so="$additional_libdir/lib$name.$shlibext"
4078 if test -f "$additional_libdir/lib$name.la"; then
4079 found_la="$additional_libdir/lib$name.la"
4082 if test -f "$additional_libdir/lib$name.$libext"; then
4083 found_dir="$additional_libdir"
4084 found_a="$additional_libdir/lib$name.$libext"
4085 if test -f "$additional_libdir/lib$name.la"; then
4086 found_la="$additional_libdir/lib$name.la"
4091 if test "X$found_dir" = "X"; then
4092 for x in $LDFLAGS $LTLIB[]NAME; do
4093 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4096 dir=`echo "X$x" | sed -e 's/^X-L//'`
4097 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
4099 found_so="$dir/lib$name.$shlibext"
4100 if test -f "$dir/lib$name.la"; then
4101 found_la="$dir/lib$name.la"
4104 if test -f "$dir/lib$name.$libext"; then
4106 found_a="$dir/lib$name.$libext"
4107 if test -f "$dir/lib$name.la"; then
4108 found_la="$dir/lib$name.la"
4114 if test "X$found_dir" != "X"; then
4119 if test "X$found_dir" != "X"; then
4120 dnl Found the library.
4121 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4122 if test "X$found_so" != "X"; then
4123 dnl Linking with a shared library. We attempt to hardcode its
4124 dnl directory into the executable's runpath, unless it's the
4125 dnl standard /usr/lib.
4126 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
4127 dnl No hardcoding is needed.
4128 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4130 dnl Use an explicit option to hardcode DIR into the resulting
4132 dnl Potentially add DIR to ltrpathdirs.
4133 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4135 for x in $ltrpathdirs; do
4136 if test "X$x" = "X$found_dir"; then
4141 if test -z "$haveit"; then
4142 ltrpathdirs="$ltrpathdirs $found_dir"
4144 dnl The hardcoding into $LIBNAME is system dependent.
4145 if test "$hardcode_direct" = yes; then
4146 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4147 dnl resulting binary.
4148 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4150 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4151 dnl Use an explicit option to hardcode DIR into the resulting
4153 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4154 dnl Potentially add DIR to rpathdirs.
4155 dnl The rpathdirs will be appended to $LIBNAME at the end.
4157 for x in $rpathdirs; do
4158 if test "X$x" = "X$found_dir"; then
4163 if test -z "$haveit"; then
4164 rpathdirs="$rpathdirs $found_dir"
4167 dnl Rely on "-L$found_dir".
4168 dnl But don't add it if it's already contained in the LDFLAGS
4169 dnl or the already constructed $LIBNAME
4171 for x in $LDFLAGS $LIB[]NAME; do
4172 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4173 if test "X$x" = "X-L$found_dir"; then
4178 if test -z "$haveit"; then
4179 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4181 if test "$hardcode_minus_L" != no; then
4182 dnl FIXME: Not sure whether we should use
4183 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4185 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4187 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4188 dnl here, because this doesn't fit in flags passed to the
4189 dnl compiler. So give up. No hardcoding. This affects only
4190 dnl very old systems.
4191 dnl FIXME: Not sure whether we should use
4192 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4194 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4200 if test "X$found_a" != "X"; then
4201 dnl Linking with a static library.
4202 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4204 dnl We shouldn't come here, but anyway it's good to have a
4206 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4209 dnl Assume the include files are nearby.
4210 additional_includedir=
4211 case "$found_dir" in
4213 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4214 additional_includedir="$basedir/include"
4217 if test "X$additional_includedir" != "X"; then
4218 dnl Potentially add $additional_includedir to $INCNAME.
4219 dnl But don't add it
4220 dnl 1. if it's the standard /usr/include,
4221 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
4222 dnl 3. if it's already present in $CPPFLAGS or the already
4223 dnl constructed $INCNAME,
4224 dnl 4. if it doesn't exist as a directory.
4225 if test "X$additional_includedir" != "X/usr/include"; then
4227 if test "X$additional_includedir" = "X/usr/local/include"; then
4228 if test -n "$GCC"; then
4230 linux*) haveit=yes;;
4234 if test -z "$haveit"; then
4235 for x in $CPPFLAGS $INC[]NAME; do
4236 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4237 if test "X$x" = "X-I$additional_includedir"; then
4242 if test -z "$haveit"; then
4243 if test -d "$additional_includedir"; then
4244 dnl Really add $additional_includedir to $INCNAME.
4245 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4251 dnl Look for dependencies.
4252 if test -n "$found_la"; then
4253 dnl Read the .la file. It defines the variables
4254 dnl dlname, library_names, old_library, dependency_libs, current,
4255 dnl age, revision, installed, dlopen, dlpreopen, libdir.
4256 save_libdir="$libdir"
4258 */* | *\\*) . "$found_la" ;;
4259 *) . "./$found_la" ;;
4261 libdir="$save_libdir"
4262 dnl We use only dependency_libs.
4263 for dep in $dependency_libs; do
4266 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4267 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4268 dnl But don't add it
4269 dnl 1. if it's the standard /usr/lib,
4270 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
4271 dnl 3. if it's already present in $LDFLAGS or the already
4272 dnl constructed $LIBNAME,
4273 dnl 4. if it doesn't exist as a directory.
4274 if test "X$additional_libdir" != "X/usr/lib"; then
4276 if test "X$additional_libdir" = "X/usr/local/lib"; then
4277 if test -n "$GCC"; then
4279 linux*) haveit=yes;;
4283 if test -z "$haveit"; then
4285 for x in $LDFLAGS $LIB[]NAME; do
4286 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4287 if test "X$x" = "X-L$additional_libdir"; then
4292 if test -z "$haveit"; then
4293 if test -d "$additional_libdir"; then
4294 dnl Really add $additional_libdir to $LIBNAME.
4295 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4299 for x in $LDFLAGS $LTLIB[]NAME; do
4300 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4301 if test "X$x" = "X-L$additional_libdir"; then
4306 if test -z "$haveit"; then
4307 if test -d "$additional_libdir"; then
4308 dnl Really add $additional_libdir to $LTLIBNAME.
4309 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4316 dir=`echo "X$dep" | sed -e 's/^X-R//'`
4317 if test "$enable_rpath" != no; then
4318 dnl Potentially add DIR to rpathdirs.
4319 dnl The rpathdirs will be appended to $LIBNAME at the end.
4321 for x in $rpathdirs; do
4322 if test "X$x" = "X$dir"; then
4327 if test -z "$haveit"; then
4328 rpathdirs="$rpathdirs $dir"
4330 dnl Potentially add DIR to ltrpathdirs.
4331 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4333 for x in $ltrpathdirs; do
4334 if test "X$x" = "X$dir"; then
4339 if test -z "$haveit"; then
4340 ltrpathdirs="$ltrpathdirs $dir"
4345 dnl Handle this in the next round.
4346 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4349 dnl Handle this in the next round. Throw away the .la's
4350 dnl directory; it is already contained in a preceding -L
4352 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4355 dnl Most likely an immediate library name.
4356 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4357 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4363 dnl Didn't find the library; assume it is in the system directories
4364 dnl known to the linker and runtime loader. (All the system
4365 dnl directories known to the linker should also be known to the
4366 dnl runtime loader, otherwise the system is severely misconfigured.)
4367 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4368 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4374 if test "X$rpathdirs" != "X"; then
4375 if test -n "$hardcode_libdir_separator"; then
4376 dnl Weird platform: only the last -rpath option counts, the user must
4377 dnl pass all path elements in one option. We can arrange that for a
4378 dnl single library, but not when more than one $LIBNAMEs are used.
4380 for found_dir in $rpathdirs; do
4381 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4383 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4384 acl_save_libdir="$libdir"
4386 eval flag=\"$hardcode_libdir_flag_spec\"
4387 libdir="$acl_save_libdir"
4388 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4390 dnl The -rpath options are cumulative.
4391 for found_dir in $rpathdirs; do
4392 acl_save_libdir="$libdir"
4394 eval flag=\"$hardcode_libdir_flag_spec\"
4395 libdir="$acl_save_libdir"
4396 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4400 if test "X$ltrpathdirs" != "X"; then
4401 dnl When using libtool, the option that works for both libraries and
4402 dnl executables is -R. The -R options are cumulative.
4403 for found_dir in $ltrpathdirs; do
4404 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4409 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4410 dnl unless already present in VAR.
4411 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4412 dnl contains two or three consecutive elements that belong together.
4413 AC_DEFUN([AC_LIB_APPENDTOVAR],
4415 for element in [$2]; do
4418 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4419 if test "X$x" = "X$element"; then
4424 if test -z "$haveit"; then
4425 [$1]="${[$1]}${[$1]:+ }$element"
4430 # lib-ld.m4 serial 1 (gettext-0.11)
4431 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4432 dnl This file is free software, distributed under the terms of the GNU
4433 dnl General Public License. As a special exception to the GNU General
4434 dnl Public License, this file may be distributed as part of a program
4435 dnl that contains a configuration script generated by Autoconf, under
4436 dnl the same distribution terms as the rest of that program.
4438 dnl Subroutines of libtool.m4,
4439 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4440 dnl with libtool.m4.
4442 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4443 AC_DEFUN([AC_LIB_PROG_LD_GNU],
4444 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4445 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4446 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4447 acl_cv_prog_gnu_ld=yes
4449 acl_cv_prog_gnu_ld=no
4451 with_gnu_ld=$acl_cv_prog_gnu_ld
4454 dnl From libtool-1.4. Sets the variable LD.
4455 AC_DEFUN([AC_LIB_PROG_LD],
4456 [AC_ARG_WITH(gnu-ld,
4457 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
4458 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4459 AC_REQUIRE([AC_PROG_CC])dnl
4460 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4462 if test "$GCC" = yes; then
4463 # Check if gcc -print-prog-name=ld gives a path.
4464 AC_MSG_CHECKING([for ld used by GCC])
4467 # gcc leaves a trailing carriage return which upsets mingw
4468 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4470 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4473 # Accept absolute paths.
4474 [[\\/]* | [A-Za-z]:[\\/]*)]
4475 [re_direlt='/[^/][^/]*/\.\./']
4476 # Canonicalize the path of ld
4477 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4478 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4479 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4481 test -z "$LD" && LD="$ac_prog"
4484 # If it fails, then pretend we aren't using GCC.
4488 # If it is relative, then search for the first ld in PATH.
4492 elif test "$with_gnu_ld" = yes; then
4493 AC_MSG_CHECKING([for GNU ld])
4495 AC_MSG_CHECKING([for non-GNU ld])
4497 AC_CACHE_VAL(acl_cv_path_LD,
4498 [if test -z "$LD"; then
4499 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4500 for ac_dir in $PATH; do
4501 test -z "$ac_dir" && ac_dir=.
4502 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4503 acl_cv_path_LD="$ac_dir/$ac_prog"
4504 # Check to see if the program is GNU ld. I'd rather use --version,
4505 # but apparently some GNU ld's only accept -v.
4506 # Break only if it was the GNU/non-GNU ld that we prefer.
4507 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4508 test "$with_gnu_ld" != no && break
4510 test "$with_gnu_ld" != yes && break
4516 acl_cv_path_LD="$LD" # Let the user override the test with a path.
4518 LD="$acl_cv_path_LD"
4519 if test -n "$LD"; then
4524 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4530 dnl From J. David Anglin.
4532 dnl HPUX and other systems can't unlink shared text that is being executed.
4534 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
4536 AC_CACHE_CHECK([whether a running program can be unlinked],
4537 jm_cv_func_unlink_busy_text,
4546 exit (unlink (argv[0]));
4549 jm_cv_func_unlink_busy_text=yes,
4550 jm_cv_func_unlink_busy_text=no,
4551 jm_cv_func_unlink_busy_text=no
4556 if test $jm_cv_func_unlink_busy_text = no; then
4557 INSTALL=$ac_install_sh
4563 dnl From Jim Meyering.
4565 dnl This is not pretty. I've just taken the autoconf code and wrapped
4566 dnl it in an AC_DEFUN.
4569 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4570 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
4572 AC_CHECK_FUNCS(listmntent getmntinfo)
4573 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
4574 getfsstat_includes="\
4575 $ac_includes_default
4576 #if HAVE_SYS_PARAM_H
4577 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
4579 #if HAVE_SYS_UCRED_H
4580 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
4582 #if HAVE_SYS_MOUNT_H
4583 # include <sys/mount.h>
4585 #if HAVE_SYS_FS_TYPES_H
4586 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
4589 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
4591 # Determine how to get the list of mounted filesystems.
4594 # If the getmntent function is available but not in the standard library,
4595 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
4598 # This test must precede the ones for getmntent because Unicos-9 is
4599 # reported to have the getmntent function, but its support is incompatible
4600 # with other getmntent implementations.
4602 # NOTE: Normally, I wouldn't use a check for system type as I've done for
4603 # `CRAY' below since that goes against the whole autoconf philosophy. But
4604 # I think there is too great a chance that some non-Cray system has a
4605 # function named listmntent to risk the false positive.
4607 if test -z "$ac_list_mounted_fs"; then
4609 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
4610 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
4611 [fu_cv_sys_mounted_cray_listmntent=no
4616 ], [test $ac_cv_func_listmntent = yes \
4617 && fu_cv_sys_mounted_cray_listmntent=yes]
4621 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
4622 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
4623 ac_list_mounted_fs=found
4624 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
4625 [Define if there is a function named listmntent that can be used to
4626 list all mounted filesystems. (UNICOS)])
4630 if test $ac_cv_func_getmntent = yes; then
4632 # This system has the getmntent function.
4633 # Determine whether it's the one-argument variant or the two-argument one.
4635 if test -z "$ac_list_mounted_fs"; then
4636 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
4637 AC_MSG_CHECKING([for one-argument getmntent function])
4638 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
4640 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
4644 #if !defined MOUNTED
4645 # if defined _PATH_MOUNTED /* GNU libc */
4646 # define MOUNTED _PATH_MOUNTED
4648 # if defined MNT_MNTTAB /* HP-UX. */
4649 # define MOUNTED MNT_MNTTAB
4651 # if defined MNTTABNAME /* Dynix. */
4652 # define MOUNTED MNTTABNAME
4656 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
4657 fu_cv_sys_mounted_getmntent1=yes,
4658 fu_cv_sys_mounted_getmntent1=no)])
4659 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
4660 if test $fu_cv_sys_mounted_getmntent1 = yes; then
4661 ac_list_mounted_fs=found
4662 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
4663 [Define if there is a function named getmntent for reading the list
4664 of mounted filesystems, and that function takes a single argument.
4665 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
4669 if test -z "$ac_list_mounted_fs"; then
4671 AC_MSG_CHECKING([for two-argument getmntent function])
4672 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
4673 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
4674 fu_cv_sys_mounted_getmntent2=yes,
4675 fu_cv_sys_mounted_getmntent2=no)])
4676 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
4677 if test $fu_cv_sys_mounted_getmntent2 = yes; then
4678 ac_list_mounted_fs=found
4679 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
4680 [Define if there is a function named getmntent for reading the list of
4681 mounted filesystems, and that function takes two arguments. (SVR4)])
4687 if test -z "$ac_list_mounted_fs"; then
4688 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
4689 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
4691 AC_MSG_CHECKING([for getfsstat function])
4692 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
4694 #include <sys/types.h>
4695 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
4696 # define FS_TYPE(Ent) ((Ent).f_fstypename)
4698 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
4700 ]$getfsstat_includes
4702 [struct statfs *stats;
4703 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
4704 char *t = FS_TYPE (*stats); ],
4705 fu_cv_sys_mounted_getfsstat=yes,
4706 fu_cv_sys_mounted_getfsstat=no)])
4707 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
4708 if test $fu_cv_sys_mounted_getfsstat = yes; then
4709 ac_list_mounted_fs=found
4710 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
4711 [Define if there is a function named getfsstat for reading the
4712 list of mounted filesystems. (DEC Alpha running OSF/1)])
4716 if test -z "$ac_list_mounted_fs"; then
4718 AC_MSG_CHECKING([for mntctl function and struct vmount])
4719 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
4720 [AC_TRY_CPP([#include <fshelp.h>],
4721 fu_cv_sys_mounted_vmount=yes,
4722 fu_cv_sys_mounted_vmount=no)])
4723 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
4724 if test $fu_cv_sys_mounted_vmount = yes; then
4725 ac_list_mounted_fs=found
4726 AC_DEFINE(MOUNTED_VMOUNT, 1,
4727 [Define if there is a function named mntctl that can be used to read
4728 the list of mounted filesystems, and there is a system header file
4729 that declares `struct vmount.' (AIX)])
4733 if test -z "$ac_list_mounted_fs"; then
4735 AC_MSG_CHECKING([for FIXME existence of three headers])
4736 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
4738 #include <sys/statfs.h>
4739 #include <sys/fstyp.h>
4740 #include <mnttab.h>],
4741 fu_cv_sys_mounted_fread_fstyp=yes,
4742 fu_cv_sys_mounted_fread_fstyp=no)])
4743 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
4744 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
4745 ac_list_mounted_fs=found
4746 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
4747 [Define if (like SVR2) there is no specific function for reading the
4748 list of mounted filesystems, and your system has these header files:
4749 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
4753 if test -z "$ac_list_mounted_fs"; then
4754 # 4.4BSD and DEC OSF/1.
4755 AC_MSG_CHECKING([for getmntinfo function])
4756 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
4758 test "$ac_cv_func_getmntinfo" = yes \
4759 && fu_cv_sys_mounted_getmntinfo=yes \
4760 || fu_cv_sys_mounted_getmntinfo=no
4762 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
4763 if test $fu_cv_sys_mounted_getmntinfo = yes; then
4764 ac_list_mounted_fs=found
4765 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
4766 [Define if there is a function named getmntinfo for reading the
4767 list of mounted filesystems. (4.4BSD, Darwin)])
4771 if test -z "$ac_list_mounted_fs"; then
4773 AC_MSG_CHECKING([for getmnt function])
4774 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
4776 #include <sys/fs_types.h>
4777 #include <sys/mount.h>],
4778 fu_cv_sys_mounted_getmnt=yes,
4779 fu_cv_sys_mounted_getmnt=no)])
4780 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
4781 if test $fu_cv_sys_mounted_getmnt = yes; then
4782 ac_list_mounted_fs=found
4783 AC_DEFINE(MOUNTED_GETMNT, 1,
4784 [Define if there is a function named getmnt for reading the list of
4785 mounted filesystems. (Ultrix)])
4789 if test -z "$ac_list_mounted_fs"; then
4791 AC_CHECK_FUNCS(next_dev fs_stat_dev)
4792 AC_CHECK_HEADERS(fs_info.h)
4793 AC_MSG_CHECKING([for BEOS mounted file system support functions])
4794 if test $ac_cv_header_fs_info_h = yes \
4795 && test $ac_cv_func_next_dev = yes \
4796 && test $ac_cv_func_fs_stat_dev = yes; then
4801 AC_MSG_RESULT($fu_result)
4802 if test $fu_result = yes; then
4803 ac_list_mounted_fs=found
4804 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
4805 [Define if there are functions named next_dev and fs_stat_dev for
4806 reading the list of mounted filesystems. (BeOS)])
4810 if test -z "$ac_list_mounted_fs"; then
4812 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
4813 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
4814 [AC_TRY_CPP([#include <mnttab.h>],
4815 fu_cv_sys_mounted_fread=yes,
4816 fu_cv_sys_mounted_fread=no)])
4817 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
4818 if test $fu_cv_sys_mounted_fread = yes; then
4819 ac_list_mounted_fs=found
4820 AC_DEFINE(MOUNTED_FREAD, 1,
4821 [Define if there is no specific function for reading the list of
4822 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
4826 if test -z "$ac_list_mounted_fs"; then
4827 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
4828 # FIXME -- no need to abort building the whole package
4829 # Can't build mountlist.c or anything that needs its functions
4832 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
4838 dnl From Jim Meyering.
4840 dnl See if struct statfs has the f_fstypename member.
4841 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
4844 AC_DEFUN([jm_FSTYPENAME],
4846 AC_CACHE_CHECK([for f_fstypename in struct statfs],
4847 fu_cv_sys_f_fstypename_in_statfs,
4851 #include <sys/param.h>
4852 #include <sys/types.h>
4853 #include <sys/mount.h>
4855 [struct statfs s; int i = sizeof s.f_fstypename;],
4856 fu_cv_sys_f_fstypename_in_statfs=yes,
4857 fu_cv_sys_f_fstypename_in_statfs=no
4862 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
4863 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
4864 [Define if struct statfs has the f_fstypename member.])
4871 # From fileutils/configure.in
4873 # Try to determine how a program can obtain filesystem usage information.
4874 # If successful, define the appropriate symbol (see fsusage.c) and
4875 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
4877 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4879 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
4882 echo "checking how to get filesystem space usage..."
4885 # Perform only the link test since it seems there are no variants of the
4886 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
4887 # because that got a false positive on SCO OSR5. Adding the declaration
4888 # of a `struct statvfs' causes this test to fail (as it should) on such
4889 # systems. That system is reported to work fine with STAT_STATFS4 which
4890 # is what it gets when this test fails.
4891 if test $ac_fsusage_space = no; then
4893 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
4894 [AC_TRY_LINK([#include <sys/types.h>
4895 #include <sys/statvfs.h>],
4896 [struct statvfs fsd; statvfs (0, &fsd);],
4897 fu_cv_sys_stat_statvfs=yes,
4898 fu_cv_sys_stat_statvfs=no)])
4899 if test $fu_cv_sys_stat_statvfs = yes; then
4900 ac_fsusage_space=yes
4901 AC_DEFINE(STAT_STATVFS, 1,
4902 [ Define if there is a function named statvfs. (SVR4)])
4906 if test $ac_fsusage_space = no; then
4907 # DEC Alpha running OSF/1
4908 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
4909 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
4911 #include <sys/param.h>
4912 #include <sys/types.h>
4913 #include <sys/mount.h>
4918 exit (statfs (".", &fsd, sizeof (struct statfs)));
4920 fu_cv_sys_stat_statfs3_osf1=yes,
4921 fu_cv_sys_stat_statfs3_osf1=no,
4922 fu_cv_sys_stat_statfs3_osf1=no)])
4923 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
4924 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
4925 ac_fsusage_space=yes
4926 AC_DEFINE(STAT_STATFS3_OSF1, 1,
4927 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
4931 if test $ac_fsusage_space = no; then
4933 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
4934 member (AIX, 4.3BSD)])
4935 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
4937 #ifdef HAVE_SYS_PARAM_H
4938 #include <sys/param.h>
4940 #ifdef HAVE_SYS_MOUNT_H
4941 #include <sys/mount.h>
4943 #ifdef HAVE_SYS_VFS_H
4944 #include <sys/vfs.h>
4950 exit (statfs (".", &fsd));
4952 fu_cv_sys_stat_statfs2_bsize=yes,
4953 fu_cv_sys_stat_statfs2_bsize=no,
4954 fu_cv_sys_stat_statfs2_bsize=no)])
4955 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
4956 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
4957 ac_fsusage_space=yes
4958 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
4959 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
4960 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
4964 if test $ac_fsusage_space = no; then
4966 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
4967 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
4968 [AC_TRY_RUN([#include <sys/types.h>
4969 #include <sys/statfs.h>
4973 exit (statfs (".", &fsd, sizeof fsd, 0));
4975 fu_cv_sys_stat_statfs4=yes,
4976 fu_cv_sys_stat_statfs4=no,
4977 fu_cv_sys_stat_statfs4=no)])
4978 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
4979 if test $fu_cv_sys_stat_statfs4 = yes; then
4980 ac_fsusage_space=yes
4981 AC_DEFINE(STAT_STATFS4, 1,
4982 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
4986 if test $ac_fsusage_space = no; then
4988 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
4989 member (4.4BSD and NetBSD)])
4990 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
4991 [AC_TRY_RUN([#include <sys/types.h>
4992 #ifdef HAVE_SYS_PARAM_H
4993 #include <sys/param.h>
4995 #ifdef HAVE_SYS_MOUNT_H
4996 #include <sys/mount.h>
5002 exit (statfs (".", &fsd));
5004 fu_cv_sys_stat_statfs2_fsize=yes,
5005 fu_cv_sys_stat_statfs2_fsize=no,
5006 fu_cv_sys_stat_statfs2_fsize=no)])
5007 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
5008 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
5009 ac_fsusage_space=yes
5010 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
5011 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
5016 if test $ac_fsusage_space = no; then
5018 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
5019 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
5020 [AC_TRY_RUN([#include <sys/types.h>
5021 #ifdef HAVE_SYS_PARAM_H
5022 #include <sys/param.h>
5024 #ifdef HAVE_SYS_MOUNT_H
5025 #include <sys/mount.h>
5027 #ifdef HAVE_SYS_FS_TYPES_H
5028 #include <sys/fs_types.h>
5033 /* Ultrix's statfs returns 1 for success,
5034 0 for not mounted, -1 for failure. */
5035 exit (statfs (".", &fsd) != 1);
5037 fu_cv_sys_stat_fs_data=yes,
5038 fu_cv_sys_stat_fs_data=no,
5039 fu_cv_sys_stat_fs_data=no)])
5040 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
5041 if test $fu_cv_sys_stat_fs_data = yes; then
5042 ac_fsusage_space=yes
5043 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
5044 [ Define if statfs takes 2 args and the second argument has
5045 type struct fs_data. (Ultrix)])
5049 if test $ac_fsusage_space = no; then
5051 AC_TRY_CPP([#include <sys/filsys.h>
5053 AC_DEFINE(STAT_READ_FILSYS, 1,
5054 [Define if there is no specific function for reading filesystems usage
5055 information and you have the <sys/filsys.h> header file. (SVR2)])
5056 ac_fsusage_space=yes)
5059 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
5065 # Define some macros required for proper operation of code in lib/*.c
5066 # on MSDOS/Windows systems.
5068 # From Jim Meyering.
5070 AC_DEFUN([jm_AC_DOS],
5072 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
5075 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
5076 neither MSDOS nor Windows
5078 [ac_cv_win_or_dos=yes],
5079 [ac_cv_win_or_dos=no])
5082 if test x"$ac_cv_win_or_dos" = xyes; then
5083 ac_fs_accepts_drive_letter_prefix=1
5084 ac_fs_backslash_is_file_name_separator=1
5086 ac_fs_accepts_drive_letter_prefix=0
5087 ac_fs_backslash_is_file_name_separator=0
5090 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
5091 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
5092 # define FILESYSTEM_PREFIX_LEN(Filename) \
5093 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
5095 # define FILESYSTEM_PREFIX_LEN(Filename) 0
5098 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
5099 $ac_fs_accepts_drive_letter_prefix,
5100 [Define on systems for which file names may have a so-called
5101 `drive letter' prefix, define this to compute the length of that
5102 prefix, including the colon.])
5104 AH_VERBATIM(ISSLASH,
5105 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
5106 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
5108 # define ISSLASH(C) ((C) == '/')
5111 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
5112 $ac_fs_backslash_is_file_name_separator,
5113 [Define if the backslash character may also serve as a file name
5114 component separator.])
5118 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
5120 AC_REQUIRE([AC_HEADER_STDC])
5121 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
5122 AC_CHECK_FUNCS(resolvepath)
5123 AC_REQUIRE([AC_HEADER_STAT])
5125 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
5126 # if the function name weren't so long. Besides, I would rather
5127 # not have underscores in file names.
5128 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
5133 dnl From Paul Eggert.
5135 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
5138 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
5139 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
5140 ac_cv_struct_st_mtim_nsec,
5141 [ac_save_CPPFLAGS="$CPPFLAGS"
5142 ac_cv_struct_st_mtim_nsec=no
5143 # tv_nsec -- the usual case
5144 # _tv_nsec -- Solaris 2.6, if
5145 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
5146 # && !defined __EXTENSIONS__)
5147 # st__tim.tv_nsec -- UnixWare 2.1.2
5148 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
5149 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
5150 AC_TRY_COMPILE([#include <sys/types.h>
5151 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
5152 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
5154 CPPFLAGS="$ac_save_CPPFLAGS"])
5156 if test $ac_cv_struct_st_mtim_nsec != no; then
5157 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
5158 [Define to be the nanoseconds member of struct stat's st_mtim,
5166 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
5168 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
5169 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
5170 [AC_TRY_COMPILE([#include <sys/types.h>
5171 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
5172 ac_cv_struct_st_dm_mode=yes,
5173 ac_cv_struct_st_dm_mode=no)])
5175 if test $ac_cv_struct_st_dm_mode = yes; then
5176 AC_DEFINE(HAVE_ST_DM_MODE, 1,
5177 [Define if struct stat has an st_dm_mode member. ])
5184 dnl From Jim Meyering
5186 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
5187 dnl in time.h or sys/time.h.
5189 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
5191 AC_REQUIRE([AC_HEADER_TIME])
5192 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
5195 # if TIME_WITH_SYS_TIME
5196 # include <sys/time.h>
5199 # if HAVE_SYS_TIME_H
5200 # include <sys/time.h>
5206 [static struct timespec x; x.tv_sec = x.tv_nsec;],
5207 fu_cv_sys_struct_timespec=yes,
5208 fu_cv_sys_struct_timespec=no)
5211 if test $fu_cv_sys_struct_timespec = yes; then
5212 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
5213 [Define if struct timespec is declared in <time.h>. ])
5218 dnl From Jim Meyering and Paul Eggert.
5219 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
5220 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5221 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
5222 jm_cv_sys_tiocgwinsz_needs_termios_h,
5223 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
5225 if test $ac_cv_sys_posix_termios = yes; then
5227 [#include <sys/types.h>
5228 # include <termios.h>
5232 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
5237 AC_DEFUN([jm_WINSIZE_IN_PTEM],
5238 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5239 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
5240 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
5241 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
5242 if test $ac_cv_sys_posix_termios = yes; then
5243 AC_TRY_COMPILE([#include <termios.h>]
5244 [struct winsize x;],
5245 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5247 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5248 AC_TRY_COMPILE([#include <sys/ptem.h>],
5249 [struct winsize x;],
5250 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5252 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5253 AC_DEFINE([WINSIZE_IN_PTEM], 1,
5254 [Define if sys/ptem.h is required for struct winsize.])
5257 # Determine whether this system has infrastructure for obtaining the boot time.
5259 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5260 * ----------------------------------------------------------
5261 AC_DEFUN([GNULIB_BOOT_TIME],
5263 AC_CHECK_FUNCS(sysctl)
5264 AC_CHECK_HEADERS(sys/sysctl.h)
5266 [whether we can get the system boot time],
5267 [gnulib_cv_have_boot_time],
5271 [AC_INCLUDES_DEFAULT
5272 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
5273 # include <sys/param.h> /* needed for OpenBSD 3.0 */
5274 # include <sys/sysctl.h>
5283 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
5284 /* your system *does* have the infrastructure to determine boot time */
5286 please_tell_us_how_to_determine_boot_time_on_your_system
5289 gnulib_cv_have_boot_time=yes,
5290 gnulib_cv_have_boot_time=no)
5292 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
5297 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
5298 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
5299 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
5300 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
5301 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
5303 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
5305 [#include <sys/types.h>
5306 # include <sys/ioctl.h>
5310 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
5313 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
5314 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
5315 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
5321 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
5323 AC_DEFUN([jm_LIB_CHECK],
5326 # Check for libypsec.a on Dolphin M88K machines.
5327 AC_CHECK_LIB(ypsec, main)
5329 # m88k running dgux 5.4 needs this
5330 AC_CHECK_LIB(ldgc, main)
5332 # Some programs need to link with -lm. printf does if it uses
5333 # lib/strtod.c which uses pow. And seq uses the math functions,
5334 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
5336 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
5337 # Check for these math functions used by seq.
5338 ac_su_saved_lib="$LIBS"
5340 AC_CHECK_FUNCS(floor modf rint)
5341 LIBS="$ac_su_saved_lib"
5344 AC_CHECK_FUNCS(sqrt)
5345 if test $ac_cv_func_sqrt = no; then
5346 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
5349 AC_SUBST(FESETROUND_LIBM)
5350 AC_CHECK_FUNCS(fesetround)
5351 if test $ac_cv_func_fesetround = no; then
5352 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
5355 # The -lsun library is required for YP support on Irix-4.0.5 systems.
5356 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
5357 AC_SEARCH_LIBS(yp_match, [sun ypsec])
5359 # SysV needs -lsec, older versions of Linux need -lshadow for
5360 # shadow passwords. UnixWare 7 needs -lgen.
5361 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
5363 AC_CHECK_HEADERS(shadow.h)
5365 # Requirements for su.c.
5367 $ac_includes_default
5369 # include <shadow.h>
5372 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
5373 AC_CHECK_FUNCS(getspnam)
5375 # SCO-ODT-3.0 is reported to need -lufc for crypt.
5376 # NetBSD needs -lcrypt for crypt.
5377 ac_su_saved_lib="$LIBS"
5378 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
5379 LIBS="$ac_su_saved_lib"
5383 # gettext.m4 serial 17 (gettext-0.11.5)
5384 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5385 dnl This file is free software, distributed under the terms of the GNU
5386 dnl General Public License. As a special exception to the GNU General
5387 dnl Public License, this file may be distributed as part of a program
5388 dnl that contains a configuration script generated by Autoconf, under
5389 dnl the same distribution terms as the rest of that program.
5391 dnl This file can can be used in projects which are not available under
5392 dnl the GNU General Public License or the GNU Library General Public
5393 dnl License but which still want to provide support for the GNU gettext
5395 dnl Please note that the actual code of the GNU gettext library is covered
5396 dnl by the GNU Library General Public License, and the rest of the GNU
5397 dnl gettext package package is covered by the GNU General Public License.
5398 dnl They are *not* in the public domain.
5401 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5402 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5404 dnl Macro to add for using GNU gettext.
5406 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5407 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5408 dnl default (if it is not specified or empty) is 'no-libtool'.
5409 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
5410 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5411 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
5412 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
5413 dnl depending on --{enable,disable}-{shared,static} and on the presence of
5414 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
5415 dnl $(top_builddir)/intl/libintl.a will be created.
5416 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
5417 dnl implementations (in libc or libintl) without the ngettext() function
5418 dnl will be ignored. If NEEDSYMBOL is specified and is
5419 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
5420 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
5421 dnl INTLDIR is used to find the intl libraries. If empty,
5422 dnl the value `$(top_builddir)/intl/' is used.
5424 dnl The result of the configuration is one of three cases:
5425 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
5427 dnl Catalog format: GNU --> install in $(datadir)
5428 dnl Catalog extension: .mo after installation, .gmo in source tree
5429 dnl 2) GNU gettext has been found in the system's C library.
5430 dnl Catalog format: GNU --> install in $(datadir)
5431 dnl Catalog extension: .mo after installation, .gmo in source tree
5432 dnl 3) No internationalization, always use English msgid.
5433 dnl Catalog format: none
5434 dnl Catalog extension: none
5435 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
5436 dnl The use of .gmo is historical (it was needed to avoid overwriting the
5437 dnl GNU format catalogs when building on a platform with an X/Open gettext),
5438 dnl but we keep it in order not to force irrelevant filename changes on the
5441 AC_DEFUN([AM_GNU_GETTEXT],
5443 dnl Argument checking.
5444 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5445 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5447 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
5448 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5450 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5451 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5453 AC_REQUIRE([AM_PO_SUBDIRS])dnl
5454 ifelse(gt_included_intl, yes, [
5455 AC_REQUIRE([AM_INTL_SUBDIR])dnl
5458 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5459 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5460 AC_REQUIRE([AC_LIB_RPATH])
5462 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5463 dnl Ideally we would do this search only after the
5464 dnl if test "$USE_NLS" = "yes"; then
5465 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5466 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5467 dnl the configure script would need to contain the same shell code
5468 dnl again, outside any 'if'. There are two solutions:
5469 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5470 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5471 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5472 dnl documented, we avoid it.
5473 ifelse(gt_included_intl, yes, , [
5474 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5477 AC_MSG_CHECKING([whether NLS is requested])
5478 dnl Default is enabled NLS
5480 [ --disable-nls do not use Native Language Support],
5481 USE_NLS=$enableval, USE_NLS=yes)
5482 AC_MSG_RESULT($USE_NLS)
5485 ifelse(gt_included_intl, yes, [
5486 BUILD_INCLUDED_LIBINTL=no
5487 USE_INCLUDED_LIBINTL=no
5493 dnl If we use NLS figure out what method
5494 if test "$USE_NLS" = "yes"; then
5495 gt_use_preinstalled_gnugettext=no
5496 ifelse(gt_included_intl, yes, [
5497 AC_MSG_CHECKING([whether included gettext is requested])
5498 AC_ARG_WITH(included-gettext,
5499 [ --with-included-gettext use the GNU gettext library included here],
5500 nls_cv_force_use_gnu_gettext=$withval,
5501 nls_cv_force_use_gnu_gettext=no)
5502 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
5504 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5505 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5507 dnl User does not insist on using GNU NLS library. Figure out what
5508 dnl to use. If GNU gettext is available we use this. Else we have
5509 dnl to fall back to GNU NLS library.
5511 dnl Add a version number to the cache macros.
5512 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
5513 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5514 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
5516 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5517 [AC_TRY_LINK([#include <libintl.h>
5518 ]ifelse([$2], [need-formatstring-macros],
5519 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5520 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5523 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5525 ], [])[extern int _nl_msg_cat_cntr;
5526 extern int *_nl_domain_bindings;],
5527 [bindtextdomain ("", "");
5528 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5529 gt_cv_func_gnugettext_libc=yes,
5530 gt_cv_func_gnugettext_libc=no)])
5532 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5533 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5534 ifelse(gt_included_intl, yes, , [
5537 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5538 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5539 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5540 dnl even if libiconv doesn't exist.
5541 AC_LIB_LINKFLAGS_BODY([intl])
5542 AC_CACHE_CHECK([for GNU gettext in libintl],
5543 gt_cv_func_gnugettext_libintl,
5544 [gt_save_CPPFLAGS="$CPPFLAGS"
5545 CPPFLAGS="$CPPFLAGS $INCINTL"
5546 gt_save_LIBS="$LIBS"
5547 LIBS="$LIBS $LIBINTL"
5548 dnl Now see whether libintl exists and does not depend on libiconv.
5549 AC_TRY_LINK([#include <libintl.h>
5550 ]ifelse([$2], [need-formatstring-macros],
5551 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5552 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5555 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5557 ], [])[extern int _nl_msg_cat_cntr;
5562 const char *_nl_expand_alias ();],
5563 [bindtextdomain ("", "");
5564 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5565 gt_cv_func_gnugettext_libintl=yes,
5566 gt_cv_func_gnugettext_libintl=no)
5567 dnl Now see whether libintl exists and depends on libiconv.
5568 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5569 LIBS="$LIBS $LIBICONV"
5570 AC_TRY_LINK([#include <libintl.h>
5571 ]ifelse([$2], [need-formatstring-macros],
5572 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5573 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5576 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5578 ], [])[extern int _nl_msg_cat_cntr;
5583 const char *_nl_expand_alias ();],
5584 [bindtextdomain ("", "");
5585 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5586 [LIBINTL="$LIBINTL $LIBICONV"
5587 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
5588 gt_cv_func_gnugettext_libintl=yes
5591 CPPFLAGS="$gt_save_CPPFLAGS"
5592 LIBS="$gt_save_LIBS"])
5595 dnl If an already present or preinstalled GNU gettext() is found,
5596 dnl use it. But if this macro is used in GNU gettext, and GNU
5597 dnl gettext is already preinstalled in libintl, we update this
5598 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
5599 if test "$gt_cv_func_gnugettext_libc" = "yes" \
5600 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5601 && test "$PACKAGE" != gettext; }; then
5602 gt_use_preinstalled_gnugettext=yes
5604 dnl Reset the values set by searching for libintl.
5610 ifelse(gt_included_intl, yes, [
5611 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5612 dnl GNU gettext is not found in the C library.
5613 dnl Fall back on included GNU gettext library.
5614 nls_cv_use_gnu_gettext=yes
5618 if test "$nls_cv_use_gnu_gettext" = "yes"; then
5619 dnl Mark actions used to generate GNU NLS library.
5620 INTLOBJS="\$(GETTOBJS)"
5621 BUILD_INCLUDED_LIBINTL=yes
5622 USE_INCLUDED_LIBINTL=yes
5623 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5624 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5625 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
5628 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5629 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5630 dnl Mark actions to use GNU gettext tools.
5635 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5636 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5637 AC_DEFINE(ENABLE_NLS, 1,
5638 [Define to 1 if translation of program messages to the user's native language
5645 if test "$USE_NLS" = "yes"; then
5647 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5648 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5649 AC_MSG_CHECKING([how to link with libintl])
5650 AC_MSG_RESULT([$LIBINTL])
5651 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
5654 dnl For backward compatibility. Some packages may be using this.
5655 AC_DEFINE(HAVE_GETTEXT, 1,
5656 [Define if the GNU gettext() function is already present or preinstalled.])
5657 AC_DEFINE(HAVE_DCGETTEXT, 1,
5658 [Define if the GNU dcgettext() function is already present or preinstalled.])
5661 dnl We need to process the po/ directory.
5665 ifelse(gt_included_intl, yes, [
5666 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
5667 dnl to 'yes' because some of the testsuite requires it.
5668 if test "$PACKAGE" = gettext; then
5669 BUILD_INCLUDED_LIBINTL=yes
5672 dnl Make all variables we use known to autoconf.
5673 AC_SUBST(BUILD_INCLUDED_LIBINTL)
5674 AC_SUBST(USE_INCLUDED_LIBINTL)
5678 dnl For backward compatibility. Some configure.ins may be using this.
5680 nls_cv_header_libgt=
5682 dnl For backward compatibility. Some Makefiles may be using this.
5684 AC_SUBST(DATADIRNAME)
5686 dnl For backward compatibility. Some Makefiles may be using this.
5688 AC_SUBST(INSTOBJEXT)
5690 dnl For backward compatibility. Some Makefiles may be using this.
5694 dnl Enable libtool support if the surrounding package wishes it.
5695 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5696 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
5699 dnl For backward compatibility. Some Makefiles may be using this.
5703 dnl Make all documented variables known to autoconf.
5710 dnl Checks for all prerequisites of the po subdirectory,
5711 dnl except for USE_NLS.
5712 AC_DEFUN([AM_PO_SUBDIRS],
5714 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5715 AC_REQUIRE([AC_PROG_INSTALL])dnl
5716 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5718 dnl Perform the following tests also if --disable-nls has been given,
5719 dnl because they are needed for "make dist" to work.
5721 dnl Search for GNU msgfmt in the PATH.
5722 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5723 dnl The second test excludes FreeBSD msgfmt.
5724 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5725 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5726 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5728 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5730 dnl Search for GNU xgettext 0.11 or newer in the PATH.
5731 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
5732 dnl The second test excludes FreeBSD xgettext.
5733 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
5734 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5735 (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)],
5737 dnl Remove leftover from FreeBSD xgettext call.
5740 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
5741 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
5742 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
5744 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5745 dnl Test whether we really found GNU msgfmt.
5746 if test "$GMSGFMT" != ":"; then
5747 dnl If it is no GNU msgfmt we define it as : so that the
5748 dnl Makefiles still can work.
5749 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
5750 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5753 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
5755 [found $GMSGFMT program is not GNU msgfmt; ignore it])
5760 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
5761 dnl Test whether we really found GNU xgettext.
5762 if test "$XGETTEXT" != ":"; then
5763 dnl If it is no GNU xgettext we define it as : so that the
5764 dnl Makefiles still can work.
5765 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
5766 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
5770 [found xgettext program is not GNU xgettext; ignore it])
5773 dnl Remove leftover from FreeBSD xgettext call.
5777 AC_OUTPUT_COMMANDS([
5778 for ac_file in $CONFIG_FILES; do
5779 # Support "outfile[:infile[:infile...]]"
5781 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
5783 # PO directories have a Makefile.in generated from Makefile.in.in.
5784 case "$ac_file" in */Makefile.in)
5785 # Adjust a relative srcdir.
5786 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
5787 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
5788 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
5789 # In autoconf-2.13 it is called $ac_given_srcdir.
5790 # In autoconf-2.50 it is called $srcdir.
5791 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
5792 case "$ac_given_srcdir" in
5793 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
5794 /*) top_srcdir="$ac_given_srcdir" ;;
5795 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
5797 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
5798 rm -f "$ac_dir/POTFILES"
5799 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
5800 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
5801 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
5802 # on $ac_dir but don't depend on user-specified configuration
5804 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
5805 # The LINGUAS file contains the set of available languages.
5806 if test -n "$ALL_LINGUAS"; then
5807 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
5809 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
5810 # Hide the ALL_LINGUAS assigment from automake.
5811 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
5813 case "$ac_given_srcdir" in
5815 *) srcdirpre='$(srcdir)/' ;;
5821 for lang in $ALL_LINGUAS; do
5822 POFILES="$POFILES $srcdirpre$lang.po"
5823 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
5824 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
5825 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
5827 # CATALOGS depends on both $ac_dir and the user's LINGUAS
5828 # environment variable.
5830 if test -n "$ALL_LINGUAS"; then
5831 for presentlang in $ALL_LINGUAS; do
5833 if test "%UNSET%" != "$LINGUAS"; then
5834 desiredlanguages="$LINGUAS"
5836 desiredlanguages="$ALL_LINGUAS"
5838 for desiredlang in $desiredlanguages; do
5839 # Use the presentlang catalog if desiredlang is
5840 # a. equal to presentlang, or
5841 # b. a variant of presentlang (because in this case,
5842 # presentlang can be used as a fallback for messages
5843 # which are not translated in the desiredlang catalog).
5844 case "$desiredlang" in
5845 "$presentlang"*) useit=yes;;
5848 if test $useit = yes; then
5849 INST_LINGUAS="$INST_LINGUAS $presentlang"
5854 if test -n "$INST_LINGUAS"; then
5855 for lang in $INST_LINGUAS; do
5856 CATALOGS="$CATALOGS $lang.gmo"
5859 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
5860 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"
5861 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
5862 if test -f "$f"; then
5864 *.orig | *.bak | *~) ;;
5865 *) cat "$f" >> "$ac_dir/Makefile" ;;
5873 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
5874 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
5876 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
5877 # Capture the value of LINGUAS because we need it to compute CATALOGS.
5878 LINGUAS="${LINGUAS-%UNSET%}"
5883 dnl Checks for all prerequisites of the intl subdirectory,
5884 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
5885 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
5886 AC_DEFUN([AM_INTL_SUBDIR],
5888 AC_REQUIRE([AC_PROG_INSTALL])dnl
5889 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5890 AC_REQUIRE([AC_PROG_CC])dnl
5891 AC_REQUIRE([AC_CANONICAL_HOST])dnl
5892 AC_REQUIRE([AC_PROG_RANLIB])dnl
5893 AC_REQUIRE([AC_ISC_POSIX])dnl
5894 AC_REQUIRE([AC_HEADER_STDC])dnl
5895 AC_REQUIRE([AC_C_CONST])dnl
5896 AC_REQUIRE([AC_C_INLINE])dnl
5897 AC_REQUIRE([AC_TYPE_OFF_T])dnl
5898 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
5899 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
5900 AC_REQUIRE([AC_FUNC_MMAP])dnl
5901 AC_REQUIRE([jm_GLIBC21])dnl
5902 AC_REQUIRE([gt_INTDIV0])dnl
5903 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
5904 AC_REQUIRE([gt_INTTYPES_PRI])dnl
5906 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
5907 stdlib.h string.h unistd.h sys/param.h])
5908 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
5909 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
5910 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
5914 if test $ac_cv_header_locale_h = yes; then
5918 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
5919 dnl because plural.y uses bison specific features. It requires at least
5920 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
5922 dnl bison is only needed for the maintainer (who touches plural.y). But in
5923 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
5924 dnl the rule in general Makefile. Now, some people carelessly touch the
5925 dnl files or have a broken "make" program, hence the plural.c rule will
5926 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
5927 dnl present or too old.
5928 AC_CHECK_PROGS([INTLBISON], [bison])
5929 if test -z "$INTLBISON"; then
5932 dnl Found it, now check the version.
5933 AC_MSG_CHECKING([version of bison])
5934 changequote(<<,>>)dnl
5935 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
5936 case $ac_prog_version in
5937 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
5938 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
5940 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
5941 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
5943 AC_MSG_RESULT([$ac_prog_version])
5945 if test $ac_verc_fail = yes; then
5951 AC_DEFUN([AM_MKINSTALLDIRS],
5953 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
5954 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
5955 dnl Try to locate is.
5957 if test -n "$ac_aux_dir"; then
5958 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
5960 if test -z "$MKINSTALLDIRS"; then
5961 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
5963 AC_SUBST(MKINSTALLDIRS)
5967 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
5968 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
5970 # progtest.m4 serial 2 (gettext-0.10.40)
5971 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
5972 dnl This file is free software, distributed under the terms of the GNU
5973 dnl General Public License. As a special exception to the GNU General
5974 dnl Public License, this file may be distributed as part of a program
5975 dnl that contains a configuration script generated by Autoconf, under
5976 dnl the same distribution terms as the rest of that program.
5978 dnl This file can can be used in projects which are not available under
5979 dnl the GNU General Public License or the GNU Library General Public
5980 dnl License but which still want to provide support for the GNU gettext
5982 dnl Please note that the actual code of the GNU gettext library is covered
5983 dnl by the GNU Library General Public License, and the rest of the GNU
5984 dnl gettext package package is covered by the GNU General Public License.
5985 dnl They are *not* in the public domain.
5988 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
5990 # Search path for a program which passes the given test.
5992 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
5993 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
5994 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
5995 [# Extract the first word of "$2", so it can be a program name with args.
5996 set dummy $2; ac_word=[$]2
5997 AC_MSG_CHECKING([for $ac_word])
5998 AC_CACHE_VAL(ac_cv_path_$1,
6001 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
6004 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6005 for ac_dir in ifelse([$5], , $PATH, [$5]); do
6006 test -z "$ac_dir" && ac_dir=.
6007 if test -f $ac_dir/$ac_word; then
6009 ac_cv_path_$1="$ac_dir/$ac_word"
6015 dnl If no 4th arg is given, leave the cache variable unset,
6016 dnl so AC_PATH_PROGS will keep looking.
6017 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
6022 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
6023 AC_MSG_RESULT([$]$1)
6030 # intdiv0.m4 serial 1 (gettext-0.11.3)
6031 dnl Copyright (C) 2002 Free Software Foundation, Inc.
6032 dnl This file is free software, distributed under the terms of the GNU
6033 dnl General Public License. As a special exception to the GNU General
6034 dnl Public License, this file may be distributed as part of a program
6035 dnl that contains a configuration script generated by Autoconf, under
6036 dnl the same distribution terms as the rest of that program.
6038 dnl From Bruno Haible.
6040 AC_DEFUN([gt_INTDIV0],
6042 AC_REQUIRE([AC_PROG_CC])dnl
6043 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6045 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
6046 gt_cv_int_divbyzero_sigfpe,
6054 sigfpe_handler (int sig)
6056 sigfpe_handler (sig) int sig;
6059 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
6060 exit (sig != SIGFPE);
6070 signal (SIGFPE, sigfpe_handler);
6071 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
6072 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
6073 signal (SIGTRAP, sigfpe_handler);
6075 /* Linux/SPARC yields signal SIGILL. */
6076 #if defined (__sparc__) && defined (__linux__)
6077 signal (SIGILL, sigfpe_handler);
6084 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
6086 # Guess based on the CPU.
6088 alpha* | i[34567]86 | m68k | s390*)
6089 gt_cv_int_divbyzero_sigfpe="guessing yes";;
6091 gt_cv_int_divbyzero_sigfpe="guessing no";;
6095 case "$gt_cv_int_divbyzero_sigfpe" in
6099 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
6100 [Define if integer division by zero raises signal SIGFPE.])
6103 # lcmessage.m4 serial 3 (gettext-0.11.3)
6104 dnl Copyright (C) 1995-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>, 1995.
6123 # Check whether LC_MESSAGES is available in <locale.h>.
6125 AC_DEFUN([AM_LC_MESSAGES],
6127 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6128 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
6129 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
6130 if test $am_cv_val_LC_MESSAGES = yes; then
6131 AC_DEFINE(HAVE_LC_MESSAGES, 1,
6132 [Define if your <locale.h> file defines LC_MESSAGES.])