1 # aclocal.m4 generated automatically by aclocal 1.6b -*- Autoconf -*-
3 # Copyright 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 # Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
16 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
18 # This program is free software; you can redistribute it and/or modify
19 # it under the terms of the GNU General Public License as published by
20 # the Free Software Foundation; either version 2, or (at your option)
23 # This program is distributed in the hope that it will be useful,
24 # but WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 # GNU General Public License for more details.
28 # You should have received a copy of the GNU General Public License
29 # along with this program; if not, write to the Free Software
30 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
37 # AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
38 AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
40 # Do all the work for Automake. -*- Autoconf -*-
42 # This macro actually does too much some checks are only needed if
43 # your package does certain things. But this isn't really a big deal.
45 # Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002
46 # Free Software Foundation, Inc.
48 # This program is free software; you can redistribute it and/or modify
49 # it under the terms of the GNU General Public License as published by
50 # the Free Software Foundation; either version 2, or (at your option)
53 # This program is distributed in the hope that it will be useful,
54 # but WITHOUT ANY WARRANTY; without even the implied warranty of
55 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56 # GNU General Public License for more details.
58 # You should have received a copy of the GNU General Public License
59 # along with this program; if not, write to the Free Software
60 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
65 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
66 # written in clear, in which case automake, when reading aclocal.m4,
67 # will think it sees a *use*, and therefore will trigger all it's
68 # C support machinery. Also note that it means that autoscan, seeing
69 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
74 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
75 # the ones we care about.
76 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
78 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
79 # AM_INIT_AUTOMAKE([OPTIONS])
80 # -----------------------------------------------
81 # The call with PACKAGE and VERSION arguments is the old style
82 # call (pre autoconf-2.50), which is being phased out. PACKAGE
83 # and VERSION should now be passed to AC_INIT and removed from
84 # the call to AM_INIT_AUTOMAKE.
85 # We support both call styles for the transition. After
86 # the next Automake release, Autoconf can make the AC_INIT
87 # arguments mandatory, and then we can depend on a new Autoconf
88 # release and drop the old call support.
89 AC_DEFUN([AM_INIT_AUTOMAKE],
90 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
91 AC_REQUIRE([AC_PROG_INSTALL])dnl
92 # test to see if srcdir already configured
93 if test "`cd $srcdir && pwd`" != "`pwd`" &&
94 test -f $srcdir/config.status; then
95 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
98 # Define the identity of the package.
99 dnl Distinguish between old-style and new-style calls.
101 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
102 AC_SUBST([PACKAGE], [$1])dnl
103 AC_SUBST([VERSION], [$2])],
104 [_AM_SET_OPTIONS([$1])dnl
105 AC_SUBST([PACKAGE], [AC_PACKAGE_TARNAME])dnl
106 AC_SUBST([VERSION], [AC_PACKAGE_VERSION])])dnl
108 _AM_IF_OPTION([no-define],,
109 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
110 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
112 # Some tools Automake needs.
113 AC_REQUIRE([AM_SANITY_CHECK])dnl
114 AC_REQUIRE([AC_ARG_PROGRAM])dnl
115 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
116 AM_MISSING_PROG(AUTOCONF, autoconf)
117 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
118 AM_MISSING_PROG(AUTOHEADER, autoheader)
119 AM_MISSING_PROG(MAKEINFO, makeinfo)
120 AM_MISSING_PROG(AMTAR, tar)
122 AM_PROG_INSTALL_STRIP
123 # We need awk for the "check" target. The system "awk" is bad on
125 AC_REQUIRE([AC_PROG_AWK])dnl
126 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
128 _AM_IF_OPTION([no-dependencies],,
129 [AC_PROVIDE_IFELSE([AC_PROG_CC],
130 [_AM_DEPENDENCIES(CC)],
131 [define([AC_PROG_CC],
132 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
133 AC_PROVIDE_IFELSE([AC_PROG_CXX],
134 [_AM_DEPENDENCIES(CXX)],
135 [define([AC_PROG_CXX],
136 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
141 # When config.status generates a header, we must update the stamp-h file.
142 # This file resides in the same directory as the config header
143 # that is generated. The stamp files are numbered to have different names.
145 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
146 # loop where config.status creates the headers, so we can generate
147 # our stamp files there.
148 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
149 [_am_stamp_count=`expr ${_am_stamp_count-0} + 1`
150 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
152 # Copyright 2002 Free Software Foundation, Inc.
154 # This program is free software; you can redistribute it and/or modify
155 # it under the terms of the GNU General Public License as published by
156 # the Free Software Foundation; either version 2, or (at your option)
159 # This program is distributed in the hope that it will be useful,
160 # but WITHOUT ANY WARRANTY; without even the implied warranty of
161 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
162 # GNU General Public License for more details.
164 # You should have received a copy of the GNU General Public License
165 # along with this program; if not, write to the Free Software
166 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
168 # AM_AUTOMAKE_VERSION(VERSION)
169 # ----------------------------
170 # Automake X.Y traces this macro to ensure aclocal.m4 has been
171 # generated from the m4 files accompanying Automake X.Y.
172 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.6b"])
174 # AM_SET_CURRENT_AUTOMAKE_VERSION
175 # -------------------------------
176 # Call AM_AUTOMAKE_VERSION so it can be traced.
177 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
178 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
179 [AM_AUTOMAKE_VERSION([1.6b])])
181 # Helper functions for option handling. -*- Autoconf -*-
183 # Copyright 2001, 2002 Free Software Foundation, Inc.
185 # This program is free software; you can redistribute it and/or modify
186 # it under the terms of the GNU General Public License as published by
187 # the Free Software Foundation; either version 2, or (at your option)
190 # This program is distributed in the hope that it will be useful,
191 # but WITHOUT ANY WARRANTY; without even the implied warranty of
192 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
193 # GNU General Public License for more details.
195 # You should have received a copy of the GNU General Public License
196 # along with this program; if not, write to the Free Software
197 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
202 # _AM_MANGLE_OPTION(NAME)
203 # -----------------------
204 AC_DEFUN([_AM_MANGLE_OPTION],
205 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
207 # _AM_SET_OPTION(NAME)
208 # ------------------------------
209 # Set option NAME. Presently that only means defining a flag for this option.
210 AC_DEFUN([_AM_SET_OPTION],
211 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
213 # _AM_SET_OPTIONS(OPTIONS)
214 # ----------------------------------
215 # OPTIONS is a space-separated list of Automake options.
216 AC_DEFUN([_AM_SET_OPTIONS],
217 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
219 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
220 # -------------------------------------------
221 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
222 AC_DEFUN([_AM_IF_OPTION],
223 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
226 # Check to make sure that the build environment is sane.
229 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
231 # This program is free software; you can redistribute it and/or modify
232 # it under the terms of the GNU General Public License as published by
233 # the Free Software Foundation; either version 2, or (at your option)
236 # This program is distributed in the hope that it will be useful,
237 # but WITHOUT ANY WARRANTY; without even the implied warranty of
238 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
239 # GNU General Public License for more details.
241 # You should have received a copy of the GNU General Public License
242 # along with this program; if not, write to the Free Software
243 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
250 AC_DEFUN([AM_SANITY_CHECK],
251 [AC_MSG_CHECKING([whether build environment is sane])
254 echo timestamp > conftest.file
255 # Do `set' in a subshell so we don't clobber the current shell's
256 # arguments. Must try -L first in case configure is actually a
257 # symlink; some systems play weird games with the mod time of symlinks
258 # (eg FreeBSD returns the mod time of the symlink's containing
261 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
262 if test "$[*]" = "X"; then
264 set X `ls -t $srcdir/configure conftest.file`
267 if test "$[*]" != "X $srcdir/configure conftest.file" \
268 && test "$[*]" != "X conftest.file $srcdir/configure"; then
270 # If neither matched, then we have a broken ls. This can happen
271 # if, for instance, CONFIG_SHELL is bash and it inherits a
272 # broken ls alias from the environment. This has actually
273 # happened. Such a system could not be considered "sane".
274 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
275 alias in your environment])
278 test "$[2]" = conftest.file
284 AC_MSG_ERROR([newly created file is older than distributed files!
285 Check your system clock])
292 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
294 # This program is free software; you can redistribute it and/or modify
295 # it under the terms of the GNU General Public License as published by
296 # the Free Software Foundation; either version 2, or (at your option)
299 # This program is distributed in the hope that it will be useful,
300 # but WITHOUT ANY WARRANTY; without even the implied warranty of
301 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
302 # GNU General Public License for more details.
304 # You should have received a copy of the GNU General Public License
305 # along with this program; if not, write to the Free Software
306 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
311 # AM_MISSING_PROG(NAME, PROGRAM)
312 # ------------------------------
313 AC_DEFUN([AM_MISSING_PROG],
314 [AC_REQUIRE([AM_MISSING_HAS_RUN])
315 $1=${$1-"${am_missing_run}$2"}
321 # Define MISSING if not defined so far and test if it supports --run.
322 # If it does, set am_missing_run to use it, otherwise, to nothing.
323 AC_DEFUN([AM_MISSING_HAS_RUN],
324 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
325 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
326 # Use eval to expand $SHELL
327 if eval "$MISSING --run true"; then
328 am_missing_run="$MISSING --run "
331 AC_MSG_WARN([`missing' script is too old or missing])
337 # Copyright 2001 Free Software Foundation, Inc.
339 # This program is free software; you can redistribute it and/or modify
340 # it under the terms of the GNU General Public License as published by
341 # the Free Software Foundation; either version 2, or (at your option)
344 # This program is distributed in the hope that it will be useful,
345 # but WITHOUT ANY WARRANTY; without even the implied warranty of
346 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
347 # GNU General Public License for more details.
349 # You should have received a copy of the GNU General Public License
350 # along with this program; if not, write to the Free Software
351 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
354 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
355 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
356 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
358 # Of course, Automake must honor this variable whenever it calls a
359 # tool from the auxiliary directory. The problem is that $srcdir (and
360 # therefore $ac_aux_dir as well) can be either absolute or relative,
361 # depending on how configure is run. This is pretty annoying, since
362 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
363 # source directory, any form will work fine, but in subdirectories a
364 # relative path needs to be adjusted first.
366 # $ac_aux_dir/missing
367 # fails when called from a subdirectory if $ac_aux_dir is relative
368 # $top_srcdir/$ac_aux_dir/missing
369 # fails if $ac_aux_dir is absolute,
370 # fails when called from a subdirectory in a VPATH build with
371 # a relative $ac_aux_dir
373 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
374 # are both prefixed by $srcdir. In an in-source build this is usually
375 # harmless because $srcdir is `.', but things will broke when you
376 # start a VPATH build or use an absolute $srcdir.
378 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
379 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
380 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
381 # and then we would define $MISSING as
382 # MISSING="\${SHELL} $am_aux_dir/missing"
383 # This will work as long as MISSING is not called from configure, because
384 # unfortunately $(top_srcdir) has no meaning in configure.
385 # However there are other variables, like CC, which are often used in
386 # configure, and could therefore not use this "fixed" $ac_aux_dir.
388 # Another solution, used here, is to always expand $ac_aux_dir to an
389 # absolute PATH. The drawback is that using absolute paths prevent a
390 # configured tree to be moved without reconfiguration.
392 # Rely on autoconf to set up CDPATH properly.
395 AC_DEFUN([AM_AUX_DIR_EXPAND], [
396 # expand $ac_aux_dir to an absolute path
397 am_aux_dir=`cd $ac_aux_dir && pwd`
402 # Define $install_sh.
404 # Copyright 2001 Free Software Foundation, Inc.
406 # This program is free software; you can redistribute it and/or modify
407 # it under the terms of the GNU General Public License as published by
408 # the Free Software Foundation; either version 2, or (at your option)
411 # This program is distributed in the hope that it will be useful,
412 # but WITHOUT ANY WARRANTY; without even the implied warranty of
413 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
414 # GNU General Public License for more details.
416 # You should have received a copy of the GNU General Public License
417 # along with this program; if not, write to the Free Software
418 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
421 AC_DEFUN([AM_PROG_INSTALL_SH],
422 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
423 install_sh=${install_sh-"$am_aux_dir/install-sh"}
424 AC_SUBST(install_sh)])
426 # AM_PROG_INSTALL_STRIP
428 # Copyright 2001 Free Software Foundation, Inc.
430 # This program is free software; you can redistribute it and/or modify
431 # it under the terms of the GNU General Public License as published by
432 # the Free Software Foundation; either version 2, or (at your option)
435 # This program is distributed in the hope that it will be useful,
436 # but WITHOUT ANY WARRANTY; without even the implied warranty of
437 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
438 # GNU General Public License for more details.
440 # You should have received a copy of the GNU General Public License
441 # along with this program; if not, write to the Free Software
442 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
445 # One issue with vendor `install' (even GNU) is that you can't
446 # specify the program used to strip binaries. This is especially
447 # annoying in cross-compiling environments, where the build's strip
448 # is unlikely to handle the host's binaries.
449 # Fortunately install-sh will honor a STRIPPROG variable, so we
450 # always use install-sh in `make install-strip', and initialize
451 # STRIPPROG with the value of the STRIP variable (set by the user).
452 AC_DEFUN([AM_PROG_INSTALL_STRIP],
453 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
454 # Installed binaries are usually stripped using `strip' when the user
455 # run `make install-strip'. However `strip' might not be the right
456 # tool to use in cross-compilation environments, therefore Automake
457 # will honor the `STRIP' environment variable to overrule this program.
458 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
459 if test "$cross_compiling" != no; then
460 AC_CHECK_TOOL([STRIP], [strip], :)
462 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
463 AC_SUBST([INSTALL_STRIP_PROGRAM])])
465 # serial 4 -*- Autoconf -*-
467 # Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
469 # This program is free software; you can redistribute it and/or modify
470 # it under the terms of the GNU General Public License as published by
471 # the Free Software Foundation; either version 2, or (at your option)
474 # This program is distributed in the hope that it will be useful,
475 # but WITHOUT ANY WARRANTY; without even the implied warranty of
476 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477 # GNU General Public License for more details.
479 # You should have received a copy of the GNU General Public License
480 # along with this program; if not, write to the Free Software
481 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
485 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
486 # written in clear, in which case automake, when reading aclocal.m4,
487 # will think it sees a *use*, and therefore will trigger all it's
488 # C support machinery. Also note that it means that autoscan, seeing
489 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
493 # _AM_DEPENDENCIES(NAME)
494 # ----------------------
495 # See how the compiler implements dependency checking.
496 # NAME is "CC", "CXX", "GCJ", or "OBJC".
497 # We try a few techniques and use that to set a single cache variable.
499 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
500 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
501 # dependency, and given that the user is not expected to run this macro,
502 # just rely on AC_PROG_CC.
503 AC_DEFUN([_AM_DEPENDENCIES],
504 [AC_REQUIRE([AM_SET_DEPDIR])dnl
505 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
506 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
507 AC_REQUIRE([AM_DEP_TRACK])dnl
509 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
510 [$1], CXX, [depcc="$CXX" am_compiler_list=],
511 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
512 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
513 [depcc="$$1" am_compiler_list=])
515 AC_CACHE_CHECK([dependency style of $depcc],
516 [am_cv_$1_dependencies_compiler_type],
517 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
518 # We make a subdir and do the tests there. Otherwise we can end up
519 # making bogus files that we don't know about and never remove. For
520 # instance it was reported that on HP-UX the gcc test will end up
521 # making a dummy file named `D' -- because `-MD' means `put the output
524 # Copy depcomp to subdir because otherwise we won't find it if we're
525 # using a relative directory.
526 cp "$am_depcomp" conftest.dir
529 am_cv_$1_dependencies_compiler_type=none
530 if test "$am_compiler_list" = ""; then
531 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
533 for depmode in $am_compiler_list; do
534 # We need to recreate these files for each test, as the compiler may
535 # overwrite some of them when testing with obscure command lines.
536 # This happens at least with the AIX C compiler.
537 echo '#include "conftest.h"' > conftest.c
538 echo 'int i;' > conftest.h
539 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
543 # after this tag, mechanisms are not by side-effect, so they'll
544 # only be used when explicitly requested
545 if test "x$enable_dependency_tracking" = xyes; then
553 # We check with `-c' and `-o' for the sake of the "dashmstdout"
554 # mode. It turns out that the SunPro C++ compiler does not properly
555 # handle `-M -o', and we need to detect this.
556 if depmode=$depmode \
557 source=conftest.c object=conftest.o \
558 depfile=conftest.Po tmpdepfile=conftest.TPo \
559 $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
560 grep conftest.h conftest.Po > /dev/null 2>&1 &&
561 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
562 am_cv_$1_dependencies_compiler_type=$depmode
570 am_cv_$1_dependencies_compiler_type=none
573 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
574 AM_CONDITIONAL([am__fastdep$1], [
575 test "x$enable_dependency_tracking" != xno \
576 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
582 # Choose a directory name for dependency files.
583 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
584 AC_DEFUN([AM_SET_DEPDIR],
585 [rm -f .deps 2>/dev/null
586 mkdir .deps 2>/dev/null
587 if test -d .deps; then
590 # MS-DOS does not allow filenames that begin with a dot.
593 rmdir .deps 2>/dev/null
600 AC_DEFUN([AM_DEP_TRACK],
601 [AC_ARG_ENABLE(dependency-tracking,
602 [ --disable-dependency-tracking Speeds up one-time builds
603 --enable-dependency-tracking Do not reject slow dependency extractors])
604 if test "x$enable_dependency_tracking" != xno; then
605 am_depcomp="$ac_aux_dir/depcomp"
608 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
609 AC_SUBST([AMDEPBACKSLASH])
612 # Generate code to set up dependency tracking. -*- Autoconf -*-
614 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
616 # This program is free software; you can redistribute it and/or modify
617 # it under the terms of the GNU General Public License as published by
618 # the Free Software Foundation; either version 2, or (at your option)
621 # This program is distributed in the hope that it will be useful,
622 # but WITHOUT ANY WARRANTY; without even the implied warranty of
623 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
624 # GNU General Public License for more details.
626 # You should have received a copy of the GNU General Public License
627 # along with this program; if not, write to the Free Software
628 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
633 # _AM_OUTPUT_DEPENDENCY_COMMANDS
634 # ------------------------------
635 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
636 [for mf in $CONFIG_FILES; do
637 # Strip MF so we end up with the name of the file.
638 mf=`echo "$mf" | sed -e 's/:.*$//'`
639 # Check whether this is an Automake generated Makefile or not.
640 # We used to match only the files named `Makefile.in', but
641 # some people rename them; so instead we look at the file content.
642 # Grep'ing the first line is not enough: some people post-process
643 # each Makefile.in and add a new line on top of each file to say so.
644 # So let's grep whole file.
645 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
646 dirpart=`AS_DIRNAME("$mf")`
650 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
651 # Extract the definition of DEP_FILES from the Makefile without
653 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
654 test -z "$DEPDIR" && continue
655 # When using ansi2knr, U may be empty or an underscore; expand it
656 U=`sed -n -e '/^U = / s///p' < "$mf"`
657 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
658 # We invoke sed twice because it is the simplest approach to
659 # changing $(DEPDIR) to its actual value in the expansion.
660 for file in `sed -n -e '
661 /^DEP_FILES = .*\\\\$/ {
670 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
671 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
672 # Make sure the directory exists.
673 test -f "$dirpart/$file" && continue
674 fdir=`AS_DIRNAME(["$file"])`
675 AS_MKDIR_P([$dirpart/$fdir])
676 # echo "creating $dirpart/$file"
677 echo '# dummy' > "$dirpart/$file"
680 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
683 # AM_OUTPUT_DEPENDENCY_COMMANDS
684 # -----------------------------
685 # This macro should only be invoked once -- use via AC_REQUIRE.
687 # This code is only required when automatic dependency tracking
688 # is enabled. FIXME. This creates each `.P' file that we will
689 # need in order to bootstrap the dependency handling code.
690 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
691 [AC_CONFIG_COMMANDS([depfiles],
692 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
693 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
696 # Check to see how 'make' treats includes. -*- Autoconf -*-
698 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
700 # This program is free software; you can redistribute it and/or modify
701 # it under the terms of the GNU General Public License as published by
702 # the Free Software Foundation; either version 2, or (at your option)
705 # This program is distributed in the hope that it will be useful,
706 # but WITHOUT ANY WARRANTY; without even the implied warranty of
707 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
708 # GNU General Public License for more details.
710 # You should have received a copy of the GNU General Public License
711 # along with this program; if not, write to the Free Software
712 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
719 # Check to see how make treats includes.
720 AC_DEFUN([AM_MAKE_INCLUDE],
721 [am_make=${MAKE-make}
722 cat > confinc << 'END'
726 # If we don't find an include directive, just comment out the code.
727 AC_MSG_CHECKING([for style of include used by $am_make])
731 # First try GNU make style include.
732 echo "include confinc" > confmf
733 # We grep out `Entering directory' and `Leaving directory'
734 # messages which can occur if `w' ends up in MAKEFLAGS.
735 # In particular we don't look at `^make:' because GNU make might
736 # be invoked under some other name (usually "gmake"), in which
737 # case it prints its new name instead of `make'.
738 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
743 # Now try BSD make style include.
744 if test "$am__include" = "#"; then
745 echo '.include "confinc"' > confmf
746 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
752 AC_SUBST(am__include)
754 AC_MSG_RESULT($_am_result)
758 # AM_CONDITIONAL -*- Autoconf -*-
760 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
762 # This program is free software; you can redistribute it and/or modify
763 # it under the terms of the GNU General Public License as published by
764 # the Free Software Foundation; either version 2, or (at your option)
767 # This program is distributed in the hope that it will be useful,
768 # but WITHOUT ANY WARRANTY; without even the implied warranty of
769 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
770 # GNU General Public License for more details.
772 # You should have received a copy of the GNU General Public License
773 # along with this program; if not, write to the Free Software
774 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
781 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
782 # -------------------------------------
783 # Define a conditional.
784 AC_DEFUN([AM_CONDITIONAL],
785 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
786 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
796 AC_CONFIG_COMMANDS_PRE(
797 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
798 AC_MSG_ERROR([conditional \"$1\" was never defined.
799 Usually this means the macro was only invoked conditionally.])
804 AC_DEFUN([AC_GNU_SOURCE],
805 [AH_VERBATIM([_GNU_SOURCE],
806 [/* Enable GNU extensions on systems that have them. */
810 AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
811 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
812 AC_DEFINE([_GNU_SOURCE])
817 dnl From Jim Meyering.
818 dnl Find a new-enough version of Perl.
823 dnl FIXME: don't hard-code 5.003
824 dnl FIXME: should we cache the result?
825 AC_MSG_CHECKING([for perl5.003 or newer])
826 if test "${PERL+set}" = set; then
827 # `PERL' is set in the user's environment.
828 candidate_perl_names="$PERL"
831 candidate_perl_names='perl perl5'
837 PERL="$missing_dir/missing perl"
838 for perl in $candidate_perl_names; do
839 # Run test in a subshell; some versions of sh will print an error if
840 # an executable is not found, even if stderr is redirected.
841 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
848 AC_MSG_RESULT($found)
849 test $found = no && AC_MSG_WARN([
850 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
851 a usable version of the Perl File::Compare module. As a result,
852 you may be unable to run a few tests or to regenerate certain
853 files if you modify the sources from which they are derived.
857 #serial 49 -*- autoconf -*-
859 dnl Misc type-related macros for fileutils, sh-utils, textutils.
861 AC_DEFUN([jm_MACROS],
865 GNU_PACKAGE="GNU $PACKAGE"
866 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
867 [The concatenation of the strings `GNU ', and PACKAGE.])
868 AC_SUBST(GNU_PACKAGE)
870 AM_MISSING_PROG(HELP2MAN, help2man)
871 AC_SUBST(OPTIONAL_BIN_PROGS)
872 AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
876 dnl This macro actually runs replacement code. See isc-posix.m4.
877 AC_REQUIRE([AC_ISC_POSIX])dnl
880 jm_INCLUDED_REGEX([lib/regex.c])
882 AC_REQUIRE([UTILS_HOST_OS])
883 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
884 AC_REQUIRE([jm_BISON])
885 AC_REQUIRE([jm_ASSERT])
886 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
887 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
888 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
889 AC_REQUIRE([jm_CHECK_DECLS])
891 AC_REQUIRE([jm_PREREQ])
893 AC_REQUIRE([UTILS_FUNC_DIRFD])
894 AC_REQUIRE([AC_FUNC_ACL])
895 AC_REQUIRE([jm_FUNC_LCHOWN])
896 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
897 AC_REQUIRE([jm_FUNC_CHOWN])
898 AC_REQUIRE([jm_FUNC_MKTIME])
899 AC_REQUIRE([jm_FUNC_LSTAT])
900 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
901 AC_REQUIRE([jm_FUNC_STAT])
902 AC_REQUIRE([AC_FUNC_REALLOC])
903 AC_REQUIRE([AC_FUNC_MALLOC])
904 AC_REQUIRE([AC_FUNC_STRERROR_R])
905 AC_REQUIRE([jm_FUNC_NANOSLEEP])
906 AC_REQUIRE([jm_FUNC_MEMCMP])
907 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
908 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
909 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
910 AC_REQUIRE([jm_FUNC_PUTENV])
912 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
913 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
914 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
915 AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
916 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
917 AC_REQUIRE([jm_FUNC_MKTIME])
918 AC_REQUIRE([jm_FUNC_FPENDING])
920 AC_REQUIRE([jm_FUNC_GETGROUPS])
921 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
923 AC_REQUIRE([AC_FUNC_FSEEKO])
924 AC_REQUIRE([AC_FUNC_VPRINTF])
925 AC_REQUIRE([AC_FUNC_ALLOCA])
926 AC_FUNC_GETLOADAVG([lib])
927 AC_REQUIRE([jm_SYS_PROC_UPTIME])
928 AC_REQUIRE([jm_FUNC_FTRUNCATE])
929 AC_REQUIRE([vb_FUNC_RENAME])
931 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
932 AC_REPLACE_FUNCS(dup2)
933 AC_REPLACE_FUNCS(gethostname getusershell)
934 AC_REPLACE_FUNCS(sig2str)
935 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
936 AC_REPLACE_FUNCS(strpbrk)
937 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
938 AC_REPLACE_FUNCS(atexit)
939 AC_REPLACE_FUNCS(getpass)
941 dnl used by e.g. intl/*domain.c and lib/canon-host.c
942 AC_REPLACE_FUNCS(strdup)
944 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
945 AC_CHECK_FUNCS(getpagesize)
947 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
949 # By default, argmatch should fail calling usage (1).
950 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
951 [Define to the function xargmatch calls on failures.])
952 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
953 [Define to the declaration of the xargmatch failure function.])
955 dnl Used to define SETVBUF in sys2.h.
956 dnl This evokes the following warning from autoconf:
957 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
958 AC_FUNC_SETVBUF_REVERSED
960 # used by sleep and shred
961 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
962 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
964 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
965 # programs in the package would end up linked with that potentially-shared
966 # library, inducing unnecessary run-time overhead.
967 fetish_saved_libs=$LIBS
968 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
969 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
970 AC_SUBST(LIB_CLOCK_GETTIME)
971 AC_CHECK_FUNCS(clock_gettime clock_settime)
972 LIBS=$fetish_saved_libs
973 AC_CHECK_FUNCS(gettimeofday)
974 AC_FUNC_GETTIMEOFDAY_CLOBBER
976 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
977 AC_REQUIRE([jm_FUNC_UTIME])
981 canonicalize_file_name \
1013 if test $am_cv_func_working_getline != yes; then
1014 AC_CHECK_FUNCS(getdelim)
1020 # See if linking `seq' requires -lm.
1021 # It does on nearly every system. The single exception (so far) is
1022 # BeOS which has all the math functions in the normal runtime library
1023 # and doesn't have a separate math library.
1031 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1032 [ac_seq_save_LIBS="$LIBS"
1034 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1035 LIBS="$ac_seq_save_LIBS"
1041 jm_FUNC_UNLINK_BUSY_TEXT
1043 # These tests are for df.
1044 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1046 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1047 if test $list_mounted_fs = yes && test $space = yes; then
1050 AC_LIBOBJ(mountlist)
1052 AC_REQUIRE([jm_AC_DOS])
1056 # These tests must be run before any use of AC_CHECK_TYPE,
1057 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1058 # See the definition of ac_includes_default in `configure'.
1059 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1103 # This macro must be invoked before any tests that run the compiler.
1104 AC_DEFUN([jm_CHECK_ALL_TYPES],
1106 dnl This test must come as early as possible after the compiler configuration
1107 dnl tests, because the choice of the file model can (in principle) affect
1108 dnl whether functions and headers are available, whether they work, etc.
1109 AC_REQUIRE([AC_SYS_LARGEFILE])
1111 dnl This test must precede tests of compiler characteristics like
1112 dnl that for the inline keyword, since it may change the degree to
1113 dnl which the compiler supports such features.
1114 AC_REQUIRE([AM_C_PROTOTYPES])
1116 dnl Checks for typedefs, structures, and compiler characteristics.
1117 AC_REQUIRE([AC_C_BIGENDIAN])
1118 AC_REQUIRE([AC_C_CONST])
1119 AC_REQUIRE([AC_C_VOLATILE])
1120 AC_REQUIRE([AC_C_INLINE])
1121 AC_REQUIRE([AC_C_LONG_DOUBLE])
1123 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1124 AC_REQUIRE([AC_HEADER_DIRENT])
1125 AC_REQUIRE([AC_HEADER_STDC])
1127 [struct stat.st_author,
1128 struct stat.st_blksize],,,
1129 [$ac_includes_default
1130 #include <sys/stat.h>
1132 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1134 AC_REQUIRE([AC_STRUCT_TM])
1135 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1136 AC_REQUIRE([AC_HEADER_STAT])
1137 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1138 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1139 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1141 AC_REQUIRE([AC_TYPE_GETGROUPS])
1142 AC_REQUIRE([AC_TYPE_MODE_T])
1143 AC_REQUIRE([AC_TYPE_OFF_T])
1144 AC_REQUIRE([AC_TYPE_PID_T])
1145 AC_REQUIRE([AC_TYPE_SIGNAL])
1146 AC_REQUIRE([AC_TYPE_SIZE_T])
1147 AC_REQUIRE([AC_TYPE_UID_T])
1148 AC_CHECK_TYPE(ino_t, unsigned long)
1150 dnl This relies on the fact that autoconf 2.14a's implementation of
1151 dnl AC_CHECK_TYPE checks includes unistd.h.
1152 AC_CHECK_TYPE(ssize_t, int)
1153 AC_CHECK_TYPE(major_t, unsigned int)
1154 AC_CHECK_TYPE(minor_t, unsigned int)
1156 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1157 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1159 AC_REQUIRE([AC_HEADER_MAJOR])
1160 AC_REQUIRE([AC_HEADER_DIRENT])
1164 # isc-posix.m4 serial 2 (gettext-0.11.2)
1165 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1166 dnl This file is free software, distributed under the terms of the GNU
1167 dnl General Public License. As a special exception to the GNU General
1168 dnl Public License, this file may be distributed as part of a program
1169 dnl that contains a configuration script generated by Autoconf, under
1170 dnl the same distribution terms as the rest of that program.
1172 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1174 # This test replaces the one in autoconf.
1175 # Currently this macro should have the same name as the autoconf macro
1176 # because gettext's gettext.m4 (distributed in the automake package)
1177 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1178 # give these diagnostics:
1179 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1180 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1182 undefine([AC_ISC_POSIX])
1184 AC_DEFUN([AC_ISC_POSIX],
1186 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1187 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1193 dnl Initially derived from code in GNU grep.
1194 dnl Mostly written by Jim Meyering.
1196 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1198 AC_DEFUN([jm_INCLUDED_REGEX],
1200 dnl Even packages that don't use regex.c can use this macro.
1201 dnl Of course, for them it doesn't do anything.
1203 # Assume we'll default to using the included regex.c.
1204 ac_use_included_regex=yes
1206 # However, if the system regex support is good enough that it passes the
1207 # the following run test, then default to *not* using the included regex.c.
1208 # If cross compiling, assume the test would fail and use the included
1209 # regex.c. The first failing regular expression is from `Spencer ere
1210 # test #75' in grep-2.3.
1211 AC_CACHE_CHECK([for working re_compile_pattern],
1212 jm_cv_func_working_re_compile_pattern,
1219 static struct re_pattern_buffer regex;
1221 struct re_registers regs;
1222 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1223 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1224 /* This should fail with _Invalid character class name_ error. */
1228 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1229 s = re_compile_pattern ("{1", 2, ®ex);
1234 /* The following example is derived from a problem report
1235 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1236 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1240 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1241 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1247 jm_cv_func_working_re_compile_pattern=yes,
1248 jm_cv_func_working_re_compile_pattern=no,
1249 dnl When crosscompiling, assume it's broken.
1250 jm_cv_func_working_re_compile_pattern=no))
1251 if test $jm_cv_func_working_re_compile_pattern = yes; then
1252 ac_use_included_regex=no
1255 test -n "$1" || AC_MSG_ERROR([missing argument])
1256 m4_syscmd([test -f $1])
1257 ifelse(m4_sysval, 0,
1259 AC_ARG_WITH(included-regex,
1260 [ --without-included-regex don't compile regex; this is the default on
1261 systems with version 2 of the GNU C library
1262 (use with caution on other system)],
1263 jm_with_regex=$withval,
1264 jm_with_regex=$ac_use_included_regex)
1265 if test "$jm_with_regex" = yes; then
1275 dnl From Paul Eggert.
1277 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1278 AC_DEFUN([UTILS_HOST_OS],
1280 AC_CACHE_CHECK([host operating system],
1281 utils_cv_host_operating_system,
1285 # These operating system names do not use the default heuristic below.
1286 # They are in reverse order, so that more-specific prefixes come first.
1287 winnt*) os='Windows NT';;
1289 sysv*) os='Unix System V';;
1290 superux*) os='SUPER-UX';;
1291 sunos*) os='SunOS';;
1293 sco*) os='SCO Unix';;
1294 riscos*) os='RISC OS';;
1295 riscix*) os='RISCiX';;
1299 plan9*) os='Plan 9';;
1302 openbsd*) os='OpenBSD';;
1303 nsk*) os='NonStop Kernel';;
1304 nonstopux*) os='NonStop-UX';;
1305 netbsd*) os='NetBSD';;
1306 msdosdjgpp*) os='DJGPP';;
1307 mpeix*) os='MPE/iX';;
1309 mingw*) os='MinGW';;
1310 lynxos*) os='LynxOS';;
1311 linux*) os='GNU/Linux';;
1315 freebsd*) os='FreeBSD';;
1317 bsdi*) os='BSD/OS';;
1321 atheos*) os='AtheOS';;
1322 amigaos*) os='Amiga OS';;
1325 # The default heuristic takes the initial alphabetic string
1326 # from $host_os, but capitalizes its first letter.
1329 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1331 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1335 # If $host_os does not start with an alphabetic string, use it unchanged.
1339 utils_cv_host_operating_system=$os]])
1340 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1341 "$utils_cv_host_operating_system",
1342 [The host operating system.])
1347 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1348 # On such systems, arrange to use a wrapper function that removes any
1350 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1352 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1353 utils_cv_func_mkdir_trailing_slash_bug,
1355 # Arrange for deletion of the temporary directory this test might create.
1356 ac_clean_files="$ac_clean_files confdir-slash"
1358 # include <sys/types.h>
1359 # include <sys/stat.h>
1360 # include <stdlib.h>
1363 rmdir ("confdir-slash");
1364 exit (mkdir ("confdir-slash/", 0700));
1367 utils_cv_func_mkdir_trailing_slash_bug=no,
1368 utils_cv_func_mkdir_trailing_slash_bug=yes,
1369 utils_cv_func_mkdir_trailing_slash_bug=yes
1374 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1376 AC_DEFINE(mkdir, rpl_mkdir,
1377 [Define to rpl_mkdir if the replacement function should be used.])
1383 AC_DEFUN([jm_BISON],
1385 # getdate.y works with bison only.
1386 : ${YACC='bison -y'}
1391 dnl based on code from Eleftherios Gkioulekas
1393 AC_DEFUN([jm_ASSERT],
1395 AC_MSG_CHECKING(whether to enable assertions)
1396 AC_ARG_ENABLE(assert,
1397 [ --disable-assert turn off assertions],
1399 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1400 [ AC_MSG_RESULT(yes) ]
1406 dnl From Jim Meyering
1408 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1409 dnl usually in <utime.h>.
1410 dnl Some systems have utime.h but don't declare the struct anywhere.
1412 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1414 AC_CHECK_HEADERS(utime.h)
1415 AC_REQUIRE([AC_HEADER_TIME])
1416 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1419 #ifdef TIME_WITH_SYS_TIME
1420 # include <sys/time.h>
1423 # ifdef HAVE_SYS_TIME_H
1424 # include <sys/time.h>
1433 [static struct utimbuf x; x.actime = x.modtime;],
1434 fu_cv_sys_struct_utimbuf=yes,
1435 fu_cv_sys_struct_utimbuf=no)
1438 if test $fu_cv_sys_struct_utimbuf = yes; then
1439 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1440 [Define if struct utimbuf is declared -- usually in <utime.h>.
1441 Some systems have utime.h but don't declare the struct anywhere. ])
1447 dnl From Jim Meyering.
1449 dnl Check whether struct dirent has a member named d_type.
1452 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1453 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1454 AC_CACHE_CHECK([for d_type member in directory struct],
1455 jm_cv_struct_dirent_d_type,
1458 #include <sys/types.h>
1459 #ifdef HAVE_DIRENT_H
1460 # include <dirent.h>
1461 #else /* not HAVE_DIRENT_H */
1462 # define dirent direct
1463 # ifdef HAVE_SYS_NDIR_H
1464 # include <sys/ndir.h>
1465 # endif /* HAVE_SYS_NDIR_H */
1466 # ifdef HAVE_SYS_DIR_H
1467 # include <sys/dir.h>
1468 # endif /* HAVE_SYS_DIR_H */
1471 # endif /* HAVE_NDIR_H */
1472 #endif /* HAVE_DIRENT_H */
1474 [struct dirent dp; dp.d_type = 0;],
1476 jm_cv_struct_dirent_d_type=yes,
1477 jm_cv_struct_dirent_d_type=no)
1480 if test $jm_cv_struct_dirent_d_type = yes; then
1481 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1482 [Define if there is a member named d_type in the struct describing
1483 directory headers.])
1490 dnl From Jim Meyering.
1492 dnl Check whether struct dirent has a member named d_ino.
1495 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1496 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1497 AC_CACHE_CHECK([for d_ino member in directory struct],
1498 jm_cv_struct_dirent_d_ino,
1501 #include <sys/types.h>
1502 #ifdef HAVE_DIRENT_H
1503 # include <dirent.h>
1504 #else /* not HAVE_DIRENT_H */
1505 # define dirent direct
1506 # ifdef HAVE_SYS_NDIR_H
1507 # include <sys/ndir.h>
1508 # endif /* HAVE_SYS_NDIR_H */
1509 # ifdef HAVE_SYS_DIR_H
1510 # include <sys/dir.h>
1511 # endif /* HAVE_SYS_DIR_H */
1514 # endif /* HAVE_NDIR_H */
1515 #endif /* HAVE_DIRENT_H */
1517 [struct dirent dp; dp.d_ino = 0;],
1519 jm_cv_struct_dirent_d_ino=yes,
1520 jm_cv_struct_dirent_d_ino=no)
1523 if test $jm_cv_struct_dirent_d_ino = yes; then
1524 AC_DEFINE(D_INO_IN_DIRENT, 1,
1525 [Define if there is a member named d_ino in the struct describing
1526 directory headers.])
1533 dnl This is just a wrapper function to encapsulate this kludge.
1534 dnl Putting it in a separate file like this helps share it between
1535 dnl different packages.
1536 AC_DEFUN([jm_CHECK_DECLS],
1538 AC_REQUIRE([_jm_DECL_HEADERS])
1539 AC_REQUIRE([AC_HEADER_TIME])
1543 # if !STDC_HEADERS && HAVE_MEMORY_H
1544 # include <memory.h>
1546 # include <string.h>
1549 # include <strings.h>
1553 # include <stdlib.h>
1556 # include <unistd.h>
1559 #include <sys/types.h>
1560 #if TIME_WITH_SYS_TIME
1561 # include <sys/time.h>
1564 # if HAVE_SYS_TIME_H
1565 # include <sys/time.h>
1605 ttyname], , , $headers)
1608 dnl FIXME: when autoconf has support for it.
1609 dnl This is a little helper so we can require these header checks.
1610 AC_DEFUN([_jm_DECL_HEADERS],
1612 AC_REQUIRE([AC_HEADER_STDC])
1613 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1614 unistd.h sys/time.h utmp.h utmpx.h)
1619 dnl These are the prerequisite macros for files in the lib/
1620 dnl directories of the fileutils, sh-utils, and textutils packages.
1622 AC_DEFUN([jm_PREREQ],
1626 jm_PREREQ_CANON_HOST
1630 jm_PREREQ_GETPAGESIZE
1631 jm_PREREQ_HARD_LOCALE
1643 jm_PREREQ_TEMPNAME # called by mkstemp
1648 AC_DEFUN([jm_PREREQ_ADDEXT],
1651 AC_SYS_LONG_FILE_NAMES
1652 AC_CHECK_FUNCS(pathconf)
1653 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1656 AC_DEFUN([jm_PREREQ_CANON_HOST],
1658 dnl Add any libraries as early as possible.
1659 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1660 dnl so we have to add -lnsl to LIBS before checking for that function.
1661 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1663 dnl These come from -lnsl on Solaris5.5.1.
1664 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1666 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1667 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1668 netinet/in.h arpa/inet.h)
1671 AC_DEFUN([jm_PREREQ_DIRNAME],
1674 AC_CHECK_HEADERS(string.h)
1677 AC_DEFUN([jm_PREREQ_EXCLUDE],
1683 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1685 AC_CHECK_FUNCS(getpagesize)
1686 AC_CHECK_HEADERS(OS.h unistd.h)
1689 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1691 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1692 AC_CHECK_FUNCS(setlocale)
1696 AC_DEFUN([jm_PREREQ_HASH],
1698 AC_CHECK_HEADERS(stdlib.h)
1700 AC_REQUIRE([jm_CHECK_DECLS])
1703 # If you use human.c, you need the following files:
1704 # inttypes.m4 ulonglong.m4
1705 AC_DEFUN([jm_PREREQ_HUMAN],
1707 AC_CHECK_HEADERS(limits.h stdlib.h string.h)
1708 AC_CHECK_DECLS([getenv])
1709 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1712 AC_DEFUN([jm_PREREQ_MEMCHR],
1714 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1717 AC_DEFUN([jm_PREREQ_PHYSMEM],
1719 AC_CHECK_HEADERS(sys/pstat.h unistd.h)
1720 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
1723 AC_DEFUN([jm_PREREQ_POSIXVER],
1725 AC_CHECK_HEADERS(unistd.h)
1726 AC_CHECK_DECLS([getenv])
1729 AC_DEFUN([jm_PREREQ_QUOTEARG],
1731 AC_CHECK_FUNCS(isascii iswprint)
1733 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1740 AC_DEFUN([jm_PREREQ_READUTMP],
1743 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1744 AC_CHECK_FUNCS(utmpname)
1745 AC_CHECK_FUNCS(utmpxname)
1748 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1750 $ac_includes_default
1758 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1759 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1760 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1761 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1762 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1763 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1764 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1765 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1766 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1767 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1769 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1770 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1771 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1772 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1774 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1775 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1776 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1777 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1782 AC_DEFUN([jm_PREREQ_REGEX],
1784 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
1785 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1787 AC_CHECK_FUNCS(bzero bcopy isascii btowc)
1788 AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
1793 AC_DEFUN([jm_PREREQ_STAT],
1795 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1796 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1797 AC_CHECK_FUNCS(statvfs)
1798 jm_AC_TYPE_LONG_LONG
1801 $ac_includes_default
1802 #if HAVE_SYS_STATVFS_H
1803 # include <sys/statvfs.h>
1806 # include <sys/vfs.h>
1808 #if ( ! HAVE_SYS_STATVFS_H && ! HAVE_SYS_VFS_H && HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H )
1809 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
1810 # include <sys/param.h>
1811 # include <sys/mount.h>
1814 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
1815 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
1816 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
1817 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
1818 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
1819 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
1820 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
1821 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
1822 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
1823 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
1824 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
1827 AC_DEFUN([jm_PREREQ_STRNLEN],
1831 AC_CHECK_HEADERS(memory.h)
1832 AC_CHECK_DECLS([memchr])
1834 # This is necessary because automake-1.6.1 doesn't understand
1835 # that the above use of AC_FUNC_STRNLEN means we may have to use
1837 test $ac_cv_func_strnlen_working = yes \
1838 && AC_LIBOBJ(strnlen)
1841 AC_DEFUN([jm_PREREQ_TEMPNAME],
1845 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
1846 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
1847 AC_CHECK_DECLS([getenv])
1848 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1851 AC_DEFUN([jm_PREREQ_XGETCWD],
1854 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
1855 AC_CHECK_FUNCS(getcwd)
1859 AC_DEFUN([jm_PREREQ_XREADLINK],
1862 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
1865 # Check prerequisites for compiling lib/c-stack.c.
1867 # Copyright (C) 2002 Free Software Foundation, Inc.
1869 # This program is free software; you can redistribute it and/or modify
1870 # it under the terms of the GNU General Public License as published by
1871 # the Free Software Foundation; either version 2, or (at your option)
1872 # any later version.
1874 # This program is distributed in the hope that it will be useful,
1875 # but WITHOUT ANY WARRANTY; without even the implied warranty of
1876 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1877 # GNU General Public License for more details.
1879 # You should have received a copy of the GNU General Public License
1880 # along with this program; if not, write to the Free Software
1881 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
1884 # Written by Paul Eggert.
1886 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
1887 [# for STACK_DIRECTION
1888 AC_REQUIRE([AC_FUNC_ALLOCA])
1890 AC_CACHE_CHECK([for working C stack overflow detection],
1891 ac_cv_sys_xsi_stack_overflow_heuristic,
1895 #include <ucontext.h>
1899 char buffer[SIGSTKSZ];
1903 } alternate_signal_stack;
1906 # define find_stack_direction(ptr) STACK_DIRECTION
1909 find_stack_direction (char const *addr)
1912 return (! addr ? find_stack_direction (&dummy)
1913 : addr < &dummy ? 1 : -1);
1918 segv_handler (int signo, siginfo_t *info, void *context)
1920 if (0 < info->si_code)
1922 ucontext_t const *user_context = context;
1923 char const *stack_min = user_context->uc_stack.ss_sp;
1924 size_t stack_size = user_context->uc_stack.ss_size;
1925 char const *faulting_address = info->si_addr;
1926 size_t s = faulting_address - stack_min;
1927 size_t page_size = sysconf (_SC_PAGESIZE);
1928 if (find_stack_direction (0) < 0)
1930 if (s < stack_size + page_size)
1938 c_stack_action (void)
1941 struct sigaction act;
1945 st.ss_sp = alternate_signal_stack.buffer;
1946 st.ss_size = sizeof alternate_signal_stack.buffer;
1947 r = sigaltstack (&st, 0);
1951 sigemptyset (&act.sa_mask);
1952 act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
1953 act.sa_sigaction = segv_handler;
1954 return sigaction (SIGSEGV, &act, 0);
1962 return *p + recurse (array);
1969 return recurse ("\1");
1972 [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
1973 [ac_cv_sys_xsi_stack_overflow_heuristic=no],
1974 [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
1976 if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
1977 AC_DEFINE(HAVE_XSI_STACK_OVERFLOW_HEURISTIC, 1,
1978 [Define to 1 if extending the stack slightly past the limit causes
1979 a SIGSEGV, and an alternate stack can be established with sigaltstack,
1980 and the signal handler is passed a context that specifies the
1981 run time stack. This behavior is defined by POSIX 1003.1-2001
1982 with the X/Open System Interface (XSI) option
1983 and is a standardized way to implement a SEGV-based stack
1984 overflow detection heuristic.])
1988 AC_DEFUN([jm_PREREQ_C_STACK],
1989 [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
1991 # for STACK_DIRECTION
1992 AC_REQUIRE([AC_FUNC_ALLOCA])
1994 AC_CHECK_FUNCS(getcontext sigaltstack)
1995 AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
1996 AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
1998 AC_CHECK_HEADERS(sys/resource.h ucontext.h unistd.h)
2000 AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
2004 dnl FIXME: put these prerequisite-only *.m4 files in a separate
2005 dnl directory -- otherwise, they'll conflict with existing files.
2007 dnl These are the prerequisite macros for GNU's error.c file.
2008 AC_DEFUN([jm_PREREQ_ERROR],
2010 AC_CHECK_FUNCS(strerror vprintf doprnt)
2011 AC_CHECK_DECLS([strerror])
2017 # Experimental replacement for the function in the latest CVS autoconf.
2018 # Use with the error.c file in ../lib.
2020 # Copyright 2001 Free Software Foundation, Inc.
2022 # This program is free software; you can redistribute it and/or modify
2023 # it under the terms of the GNU General Public License as published by
2024 # the Free Software Foundation; either version 2, or (at your option)
2025 # any later version.
2027 # This program is distributed in the hope that it will be useful,
2028 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2029 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2030 # GNU General Public License for more details.
2032 # You should have received a copy of the GNU General Public License
2033 # along with this program; if not, write to the Free Software Foundation,
2034 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2036 undefine([AC_FUNC_STRERROR_R])
2038 # AC_FUNC_STRERROR_R
2039 # ------------------
2040 AC_DEFUN([AC_FUNC_STRERROR_R],
2041 [AC_CHECK_DECLS([strerror_r])
2042 AC_CHECK_FUNCS([strerror_r])
2043 AC_CACHE_CHECK([whether strerror_r returns char *],
2044 ac_cv_func_strerror_r_char_p,
2046 ac_cv_func_strerror_r_char_p=no
2047 if test $ac_cv_have_decl_strerror_r = yes; then
2048 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],
2051 char x = *strerror_r (0, buf, sizeof buf);
2052 char *p = strerror_r (0, buf, sizeof buf);
2054 ac_cv_func_strerror_r_char_p=yes)
2056 # strerror_r is not declared. Choose between
2057 # systems that have relatively inaccessible declarations for the
2058 # function. BeOS and DEC UNIX 4.0 fall in this category, but the
2059 # former has a strerror_r that returns char*, while the latter
2060 # has a strerror_r that returns `int'.
2061 # This test should segfault on the DEC system.
2062 AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT
2063 extern char *strerror_r ();],
2065 char x = *strerror_r (0, buf, sizeof buf);
2066 exit (!isalpha (x));]])],
2067 ac_cv_func_strerror_r_char_p=yes, , :)
2070 if test $ac_cv_func_strerror_r_char_p = yes; then
2071 AC_DEFINE([STRERROR_R_CHAR_P], 1,
2072 [Define to 1 if strerror_r returns char *.])
2074 ])# AC_FUNC_STRERROR_R
2078 dnl autoconf tests required for use of mbswidth.c
2079 dnl From Bruno Haible.
2081 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2083 AC_REQUIRE([AC_HEADER_STDC])
2084 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2085 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2088 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2090 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2092 # include <string.h>
2099 char *p = (char *) wcwidth;
2101 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2102 if test $ac_cv_have_decl_wcwidth = yes; then
2107 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2108 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2113 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2114 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2115 dnl This file is free software, distributed under the terms of the GNU
2116 dnl General Public License. As a special exception to the GNU General
2117 dnl Public License, this file may be distributed as part of a program
2118 dnl that contains a configuration script generated by Autoconf, under
2119 dnl the same distribution terms as the rest of that program.
2121 dnl From Paul Eggert
2123 AC_DEFUN([jm_FUNC_MBRTOWC],
2125 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2128 [#include <wchar.h>],
2129 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2130 jm_cv_func_mbrtowc=yes,
2131 jm_cv_func_mbrtowc=no)])
2132 if test $jm_cv_func_mbrtowc = yes; then
2133 AC_DEFINE(HAVE_MBRTOWC, 1,
2134 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2138 # mbstate_t.m4 serial 9
2139 dnl Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
2140 dnl This file is free software, distributed under the terms of the GNU
2141 dnl General Public License. As a special exception to the GNU General
2142 dnl Public License, this file may be distributed as part of a program
2143 dnl that contains a configuration script generated by Autoconf, under
2144 dnl the same distribution terms as the rest of that program.
2148 # BeOS 5 has <wchar.h> but does not define mbstate_t,
2149 # so you can't declare an object of that type.
2150 # Check for this incompatibility with Standard C.
2154 AC_DEFUN([AC_TYPE_MBSTATE_T],
2155 [AC_CACHE_CHECK([for mbstate_t], ac_cv_type_mbstate_t,
2158 [AC_INCLUDES_DEFAULT
2159 # include <wchar.h>],
2160 [mbstate_t x; return sizeof x;])],
2161 [ac_cv_type_mbstate_t=yes],
2162 [ac_cv_type_mbstate_t=no])])
2163 if test $ac_cv_type_mbstate_t = yes; then
2164 AC_DEFINE([HAVE_MBSTATE_T], 1,
2165 [Define to 1 if <wchar.h> declares mbstate_t.])
2167 AC_DEFINE([mbstate_t], int,
2168 [Define to a type if <wchar.h> does not define.])
2173 dnl A replacement for autoconf's macro by the same name. This version
2174 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2175 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2176 dnl run only if one of the listed libraries ends up being used (and not in
2177 dnl the `none required' case.
2178 dnl I hope it's only temporary while we wait for that version to be fixed.
2179 undefine([AC_SEARCH_LIBS])
2181 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2182 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2183 # [OTHER-LIBRARIES])
2184 # --------------------------------------------------------
2185 # Search for a library defining FUNC, if it's not already available.
2186 AC_DEFUN([AC_SEARCH_LIBS],
2188 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2190 ac_func_search_save_LIBS=$LIBS
2192 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2193 if test "$ac_cv_search_$1" = no; then
2194 for ac_lib in $2; do
2195 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2196 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2199 LIBS=$ac_func_search_save_LIBS
2202 if test "$ac_cv_search_$1" = no; then :
2205 if test "$ac_cv_search_$1" = 'none required'; then :
2208 LIBS="$ac_cv_search_$1 $LIBS"
2214 # Check for fnmatch.
2216 # This is a modified version of autoconf's AC_FUNC_FNMATCH.
2217 # This file should be removed after Autoconf 2.54 is required.
2219 # Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
2221 # This program is free software; you can redistribute it and/or modify
2222 # it under the terms of the GNU General Public License as published by
2223 # the Free Software Foundation; either version 2, or (at your option)
2224 # any later version.
2226 # This program is distributed in the hope that it will be useful,
2227 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2228 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2229 # GNU General Public License for more details.
2231 # You should have received a copy of the GNU General Public License
2232 # along with this program; if not, write to the Free Software
2233 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2236 # _AC_FUNC_FNMATCH_IF(STANDARD = GNU | POSIX, CACHE_VAR, IF-TRUE, IF-FALSE)
2237 # -------------------------------------------------------------------------
2238 # If a STANDARD compliant fnmatch is found, run IF-TRUE, otherwise
2239 # IF-FALSE. Use CACHE_VAR.
2240 AC_DEFUN([_AC_FUNC_FNMATCH_IF],
2242 [for working $1 fnmatch],
2244 [# Some versions of Solaris, SCO, and the GNU C Library
2245 # have a broken or incompatible fnmatch.
2246 # So we run a test program. If we are cross-compiling, take no chance.
2247 # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
2250 [#include <fnmatch.h>
2251 # define y(a, b, c) (fnmatch (a, b, c) == 0)
2252 # define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
2255 (!(y ("a*", "abc", 0)
2256 && n ("d*/*1", "d/s/1", FNM_PATHNAME)
2257 && y ("a\\\\bc", "abc", 0)
2258 && n ("a\\\\bc", "abc", FNM_NOESCAPE)
2259 && y ("*x", ".x", 0)
2260 && n ("*x", ".x", FNM_PERIOD)
2261 && m4_if([$1], [GNU],
2262 [y ("xxXX", "xXxX", FNM_CASEFOLD)
2263 && y ("a++(x|yy)b", "a+xyyyyxb", FNM_EXTMATCH)
2264 && n ("d*/*1", "d/s/1", FNM_FILE_NAME)
2265 && y ("*", "x", FNM_FILE_NAME | FNM_LEADING_DIR)
2266 && y ("x*", "x/y/z", FNM_FILE_NAME | FNM_LEADING_DIR)
2267 && y ("*c*", "c/x", FNM_FILE_NAME | FNM_LEADING_DIR)],
2272 AS_IF([test $$2 = yes], [$3], [$4])
2273 ])# _AC_FUNC_FNMATCH_IF
2276 # _AC_LIBOBJ_FNMATCH
2277 # ------------------
2278 # Prepare the replacement of fnmatch.
2279 AC_DEFUN([_AC_LIBOBJ_FNMATCH],
2280 [AC_REQUIRE([AC_C_CONST])dnl
2281 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
2282 AC_REQUIRE([AC_TYPE_MBSTATE_T])dnl
2283 AC_CHECK_DECLS([getenv])
2284 AC_CHECK_FUNCS([btowc mbsrtowcs mempcpy wmempcpy])
2285 AC_CHECK_HEADERS([wchar.h wctype.h])
2286 AC_LIBOBJ([fnmatch])
2287 AC_CONFIG_LINKS([lib/fnmatch.h:lib/fnmatch_.h])
2288 AC_DEFINE(fnmatch, rpl_fnmatch,
2289 [Define to rpl_fnmatch if the replacement function should be used.])
2290 ])# _AC_LIBOBJ_FNMATCH
2293 # AC_FUNC_FNMATCH_GNU
2294 # -------------------
2295 AC_DEFUN([AC_FUNC_FNMATCH_GNU],
2296 [AC_REQUIRE([AC_GNU_SOURCE])
2297 _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
2298 [rm -f lib/fnmatch.h],
2299 [_AC_LIBOBJ_FNMATCH])
2300 ])# AC_FUNC_FNMATCH_GNU
2302 # Check for stdbool.h that conforms to C99.
2304 # Copyright (C) 2002 Free Software Foundation, Inc.
2306 # This program is free software; you can redistribute it and/or modify
2307 # it under the terms of the GNU General Public License as published by
2308 # the Free Software Foundation; either version 2, or (at your option)
2309 # any later version.
2311 # This program is distributed in the hope that it will be useful,
2312 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2313 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2314 # GNU General Public License for more details.
2316 # You should have received a copy of the GNU General Public License
2317 # along with this program; if not, write to the Free Software
2318 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2321 AC_DEFUN([AC_HEADER_STDBOOL],
2322 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2323 [ac_cv_header_stdbool_h],
2326 #include <stdbool.h>
2328 "error: bool is not defined"
2331 "error: false is not defined"
2334 "error: false is not 0"
2337 "error: false is not defined"
2340 "error: true is not 1"
2342 #ifndef __bool_true_false_are_defined
2343 "error: __bool_true_false_are_defined is not defined"
2346 struct s { _Bool s: 1; _Bool t; } s;
2348 char a[true == 1 ? 1 : -1];
2349 char b[false == 0 ? 1 : -1];
2350 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2351 char d[(bool) -0.5 == true ? 1 : -1];
2353 char f[(_Bool) -0.0 == false ? 1 : -1];
2355 char h[sizeof (_Bool)];
2358 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2359 [ac_cv_header_stdbool_h=yes],
2360 [ac_cv_header_stdbool_h=no])])
2361 if test $ac_cv_header_stdbool_h = yes; then
2362 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2366 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2368 # This program is free software; you can redistribute it and/or modify
2369 # it under the terms of the GNU General Public License as published by
2370 # the Free Software Foundation; either version 2, or (at your option)
2371 # any later version.
2373 # This program is distributed in the hope that it will be useful,
2374 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2375 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2376 # GNU General Public License for more details.
2378 # You should have received a copy of the GNU General Public License
2379 # along with this program; if not, write to the Free Software
2380 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2385 AC_DEFUN([AM_C_PROTOTYPES],
2386 [AC_REQUIRE([AM_PROG_CC_STDC])
2387 AC_REQUIRE([AC_PROG_CPP])
2388 AC_MSG_CHECKING([for function prototypes])
2389 if test "$am_cv_prog_cc_stdc" != no; then
2391 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2395 U=_ ANSI2KNR=./ansi2knr
2397 # Ensure some checks needed by ansi2knr itself.
2399 AC_CHECK_HEADERS(string.h)
2401 AC_SUBST(ANSI2KNR)dnl
2404 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2407 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2409 # This program is free software; you can redistribute it and/or modify
2410 # it under the terms of the GNU General Public License as published by
2411 # the Free Software Foundation; either version 2, or (at your option)
2412 # any later version.
2414 # This program is distributed in the hope that it will be useful,
2415 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2416 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2417 # GNU General Public License for more details.
2419 # You should have received a copy of the GNU General Public License
2420 # along with this program; if not, write to the Free Software
2421 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2426 # @defmac AC_PROG_CC_STDC
2427 # @maindex PROG_CC_STDC
2429 # If the C compiler in not in ANSI C mode by default, try to add an option
2430 # to output variable @code{CC} to make it so. This macro tries various
2431 # options that select ANSI C on some system or another. It considers the
2432 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2434 # If you use this macro, you should check after calling it whether the C
2435 # compiler has been set to accept ANSI C; if not, the shell variable
2436 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2437 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2438 # program @code{ansi2knr}, which comes with Ghostscript.
2441 AC_DEFUN([AM_PROG_CC_STDC],
2442 [AC_REQUIRE([AC_PROG_CC])
2443 AC_BEFORE([$0], [AC_C_INLINE])
2444 AC_BEFORE([$0], [AC_C_CONST])
2445 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2446 dnl a magic option to avoid problems with ANSI preprocessor commands
2448 dnl FIXME: can't do this because then AC_AIX won't work due to a
2449 dnl circular dependency.
2450 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2451 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2452 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2453 [am_cv_prog_cc_stdc=no
2455 # Don't try gcc -ansi; that turns off useful extensions and
2456 # breaks some systems' header files.
2457 # AIX -qlanglvl=ansi
2458 # Ultrix and OSF/1 -std1
2459 # HP-UX 10.20 and later -Ae
2460 # HP-UX older versions -Aa -D_HPUX_SOURCE
2461 # SVR4 -Xc -D__EXTENSIONS__
2462 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2464 CC="$ac_save_CC $ac_arg"
2466 [#include <stdarg.h>
2468 #include <sys/types.h>
2469 #include <sys/stat.h>
2470 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2471 struct buf { int x; };
2472 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2473 static char *e (p, i)
2479 static char *f (char * (*g) (char **, int), char **p, ...)
2484 s = g (p, va_arg (v,int));
2488 int test (int i, double x);
2489 struct s1 {int (*f) (int a);};
2490 struct s2 {int (*f) (double a);};
2491 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2495 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2497 [am_cv_prog_cc_stdc="$ac_arg"; break])
2501 if test -z "$am_cv_prog_cc_stdc"; then
2502 AC_MSG_RESULT([none needed])
2504 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2506 case "x$am_cv_prog_cc_stdc" in
2508 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2512 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2516 dnl From Paul Eggert.
2520 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
2522 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
2524 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2525 AC_CHECK_TYPE(intmax_t, ,
2526 [test $ac_cv_type_long_long = yes \
2527 && ac_type='long long' \
2529 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
2530 [Define to widest signed type if <inttypes.h> doesn't define.])])
2533 # Define uintmax_t to unsigned long or unsigned long long
2534 # if <inttypes.h> doesn't define.
2536 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2538 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2539 AC_CHECK_TYPE(uintmax_t, ,
2540 [test $ac_cv_type_unsigned_long_long = yes \
2541 && ac_type='unsigned long long' \
2542 || ac_type='unsigned long'
2543 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2544 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
2549 dnl From Paul Eggert.
2551 # Define HAVE_LONG_LONG if 'long long' works.
2553 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2555 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2556 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2557 [long long llmax = (long long) -1;
2558 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2559 ac_cv_type_long_long=yes,
2560 ac_cv_type_long_long=no)])
2561 if test $ac_cv_type_long_long = yes; then
2562 AC_DEFINE(HAVE_LONG_LONG, 1,
2563 [Define if you have the long long type.])
2567 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2569 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2571 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2572 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2573 [unsigned long long ullmax = (unsigned long long) -1;
2574 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2575 ac_cv_type_unsigned_long_long=yes,
2576 ac_cv_type_unsigned_long_long=no)])
2577 if test $ac_cv_type_unsigned_long_long = yes; then
2578 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2579 [Define if you have the unsigned long long type.])
2583 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2585 # Copyright 2001 Free Software Foundation, Inc.
2587 # This program is free software; you can redistribute it and/or modify
2588 # it under the terms of the GNU General Public License as published by
2589 # the Free Software Foundation; either version 2, or (at your option)
2590 # any later version.
2592 # This program is distributed in the hope that it will be useful,
2593 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2594 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2595 # GNU General Public License for more details.
2597 # You should have received a copy of the GNU General Public License
2598 # along with this program; if not, write to the Free Software Foundation,
2599 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2601 # Written by Paul Eggert.
2603 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2604 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2605 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2606 [ac_cv_func_getcwd_null],
2609 # ifdef HAVE_STDLIB_H
2610 # include <stdlib.h>
2612 # ifdef HAVE_UNISTD_H
2613 # include <unistd.h>
2621 if (chdir ("/") != 0)
2625 char *f = getcwd (NULL, 0);
2626 exit (! (f && f[0] == '/' && !f[1]));
2629 [ac_cv_func_getcwd_null=yes],
2630 [ac_cv_func_getcwd_null=no],
2631 [ac_cv_func_getcwd_null=no])])
2632 if test $ac_cv_func_getcwd_null = yes; then
2633 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2634 [Define if getcwd (NULL, 0) allocates memory for result.])
2639 dnl Find out how to get the file descriptor associated with an open DIR*.
2640 dnl From Jim Meyering
2642 AC_DEFUN([UTILS_FUNC_DIRFD],
2647 # include <dirent.h>
2648 #else /* not HAVE_DIRENT_H */
2649 # define dirent direct
2650 # if HAVE_SYS_NDIR_H
2651 # include <sys/ndir.h>
2652 # endif /* HAVE_SYS_NDIR_H */
2654 # include <sys/dir.h>
2655 # endif /* HAVE_SYS_DIR_H */
2658 # endif /* HAVE_NDIR_H */
2659 #endif /* HAVE_DIRENT_H */
2661 AC_CHECK_FUNCS(dirfd)
2662 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2664 AC_CACHE_CHECK([whether dirfd is a macro],
2665 jm_cv_func_dirfd_macro,
2666 AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2668 dirent_header_defines_dirfd
2670 jm_cv_func_dirfd_macro=yes,
2671 jm_cv_func_dirfd_macro=no))
2673 # Use the replacement only if we have no function, macro,
2674 # or declaration with that name.
2675 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2677 AC_REPLACE_FUNCS([dirfd])
2679 [how to get the file descriptor associated with an open DIR*],
2680 ac_cv_sys_dir_fd_member_name,
2682 dirfd_save_CFLAGS=$CFLAGS
2683 for ac_expr in d_fd dd_fd; do
2685 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2689 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2692 CFLAGS=$dirfd_save_CFLAGS
2693 test "$dir_fd_found" = yes && break
2695 test "$dir_fd_found" = yes || ac_expr=-1
2697 ac_cv_sys_dir_fd_member_name=$ac_expr
2700 if test $ac_cv_have_decl_dirfd = -1; then
2701 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2702 $ac_cv_sys_dir_fd_member_name,
2703 [the name of the file descriptor member of DIR])
2705 AH_VERBATIM(DIR_TO_FD,
2706 [#ifdef DIR_FD_MEMBER_NAME
2707 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2709 # define DIR_TO_FD(Dir_p) -1
2716 # acl.m4 - check for access control list (ACL) primitives
2718 # Copyright (C) 2002 Free Software Foundation, Inc.
2720 # This program is free software; you can redistribute it and/or modify
2721 # it under the terms of the GNU General Public License as published by
2722 # the Free Software Foundation; either version 2, or (at your option)
2723 # any later version.
2725 # This program is distributed in the hope that it will be useful,
2726 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2727 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2728 # GNU General Public License for more details.
2730 # You should have received a copy of the GNU General Public License
2731 # along with this program; if not, write to the Free Software Foundation,
2732 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2734 # Written by Paul Eggert.
2736 AC_DEFUN([AC_FUNC_ACL],
2737 [AC_CHECK_HEADERS(sys/acl.h)
2738 AC_CHECK_FUNCS(acl)])
2742 dnl From Jim Meyering.
2743 dnl Provide lchown on systems that lack it.
2745 AC_DEFUN([jm_FUNC_LCHOWN],
2747 AC_REQUIRE([AC_TYPE_UID_T])
2748 AC_REPLACE_FUNCS(lchown)
2753 # When rmdir fails because the specified directory is not empty, it sets
2754 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2755 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2756 # in general, to avoid depending on the use of any particular symbol, this
2757 # test runs a test to determine the actual numeric value.
2758 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2760 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2761 fetish_cv_func_rmdir_errno_not_empty,
2763 # Arrange for deletion of the temporary directory this test creates.
2764 ac_clean_files="$ac_clean_files confdir2"
2765 mkdir confdir2; : > confdir2/file
2778 s = fopen ("confdir2/errno", "w");
2779 fprintf (s, "%d\n", val);
2783 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2784 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2785 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2790 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2791 $fetish_cv_func_rmdir_errno_not_empty,
2792 [the value to which errno is set when rmdir fails on a nonempty directory])
2797 dnl From Jim Meyering.
2798 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2799 dnl If it doesn't, arrange to use the replacement function.
2802 AC_DEFUN([jm_FUNC_CHOWN],
2803 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2804 test -z "$ac_cv_header_unistd_h" \
2805 && AC_CHECK_HEADERS(unistd.h)
2806 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2808 # include <sys/types.h>
2809 # include <sys/stat.h>
2811 # ifdef HAVE_UNISTD_H
2812 # include <unistd.h>
2818 char *f = "conftest.chown";
2819 struct stat before, after;
2821 if (creat (f, 0600) < 0)
2823 if (stat (f, &before) < 0)
2825 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2827 if (stat (f, &after) < 0)
2829 exit ((before.st_uid == after.st_uid
2830 && before.st_gid == after.st_gid) ? 0 : 1);
2833 jm_cv_func_working_chown=yes,
2834 jm_cv_func_working_chown=no,
2835 dnl When crosscompiling, assume chown is broken.
2836 jm_cv_func_working_chown=no)
2838 if test $jm_cv_func_working_chown = no; then
2840 AC_DEFINE(chown, rpl_chown,
2841 [Define to rpl_chown if the replacement function should be used.])
2847 dnl From Jim Meyering.
2848 dnl A wrapper around AC_FUNC_MKTIME.
2850 AC_DEFUN([jm_FUNC_MKTIME],
2851 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2853 dnl mktime.c uses localtime_r if it exists. Check for it.
2854 AC_CHECK_FUNCS(localtime_r)
2856 if test $ac_cv_func_working_mktime = no; then
2857 AC_DEFINE(mktime, rpl_mktime,
2858 [Define to rpl_mktime if the replacement function should be used.])
2864 dnl From Jim Meyering.
2865 dnl Determine whether lstat has the bug that it succeeds when given the
2866 dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
2867 dnl (as of 1998-11-01) do this.
2869 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2870 dnl compile the wrapper function.
2873 AC_DEFUN([jm_FUNC_LSTAT],
2875 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2876 AC_CACHE_CHECK([whether lstat accepts an empty string],
2877 jm_cv_func_lstat_empty_string_bug,
2879 # include <sys/types.h>
2880 # include <sys/stat.h>
2886 exit (lstat ("", &sbuf) ? 1 : 0);
2889 jm_cv_func_lstat_empty_string_bug=yes,
2890 jm_cv_func_lstat_empty_string_bug=no,
2891 dnl When crosscompiling, assume lstat is broken.
2892 jm_cv_func_lstat_empty_string_bug=yes)
2894 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2896 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2897 [Define if lstat has the bug that it succeeds when given the zero-length
2898 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2905 dnl From Jim Meyering.
2906 dnl Determine whether stat has the bug that it succeeds when given the
2907 dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
2908 dnl (as of 1998-11-01) do this.
2910 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
2911 dnl compile the wrapper function.
2914 AC_DEFUN([jm_FUNC_STAT],
2916 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2917 AC_CACHE_CHECK([whether stat accepts an empty string],
2918 jm_cv_func_stat_empty_string_bug,
2920 # include <sys/types.h>
2921 # include <sys/stat.h>
2927 exit (stat ("", &sbuf) ? 1 : 0);
2930 jm_cv_func_stat_empty_string_bug=yes,
2931 jm_cv_func_stat_empty_string_bug=no,
2932 dnl When crosscompiling, assume stat is broken.
2933 jm_cv_func_stat_empty_string_bug=yes)
2935 if test $jm_cv_func_stat_empty_string_bug = yes; then
2937 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
2938 [Define if stat has the bug that it succeeds when given the zero-length
2939 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2946 dnl From Jim Meyering.
2947 dnl Check for the nanosleep function.
2948 dnl If not found, use the supplied replacement.
2951 AC_DEFUN([jm_FUNC_NANOSLEEP],
2953 nanosleep_save_libs=$LIBS
2955 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
2956 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
2957 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
2958 AC_SUBST(LIB_NANOSLEEP)
2960 AC_CACHE_CHECK([whether nanosleep works],
2961 jm_cv_func_nanosleep_works,
2963 AC_REQUIRE([AC_HEADER_TIME])
2965 # if TIME_WITH_SYS_TIME
2966 # include <sys/time.h>
2969 # if HAVE_SYS_TIME_H
2970 # include <sys/time.h>
2979 struct timespec ts_sleep, ts_remaining;
2980 ts_sleep.tv_sec = 0;
2981 ts_sleep.tv_nsec = 1;
2982 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
2985 jm_cv_func_nanosleep_works=yes,
2986 jm_cv_func_nanosleep_works=no,
2987 dnl When crosscompiling, assume the worst.
2988 jm_cv_func_nanosleep_works=no)
2990 if test $jm_cv_func_nanosleep_works = no; then
2991 AC_LIBOBJ(nanosleep)
2992 AC_DEFINE(nanosleep, rpl_nanosleep,
2993 [Define to rpl_nanosleep if the replacement function should be used.])
2996 LIBS=$nanosleep_save_libs
3001 AC_DEFUN([jm_FUNC_MEMCMP],
3002 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
3003 if test $ac_cv_func_memcmp_working = no; then
3004 AC_DEFINE(memcmp, rpl_memcmp,
3005 [Define to rpl_memcmp if the replacement function should be used.])
3009 dnl This file is automatically generated from jm-glibc-io.m4n.
3011 #serial 6 -*- autoconf -*-
3013 dnl From Jim Meyering.
3015 dnl See if the glibc *_unlocked I/O macros are available.
3016 dnl Use only those *_unlocked macros that are declared.
3019 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
3021 # Kludge (not executed) to make autoheader do the right thing.
3023 AC_CHECK_DECLS([clearerr_unlocked,feof_unlocked,ferror_unlocked,fflush_unlocked,fgets_unlocked,fputc_unlocked,fputs_unlocked,fread_unlocked,fwrite_unlocked,getc_unlocked,getchar_unlocked,putc_unlocked,putchar_unlocked])
3024 AC_CHECK_FUNCS(clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked)
3027 io_functions='clearerr_unlocked feof_unlocked ferror_unlocked fflush_unlocked fgets_unlocked fputc_unlocked fputs_unlocked fread_unlocked fwrite_unlocked getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked'
3029 for jm_io_func in $io_functions; do
3030 # Check for the existence of each function only if it is declared.
3031 # Otherwise, we'd get the Solaris5.5.1 functions that are not
3032 # declared, and that have been removed from Solaris5.6. The resulting
3033 # 5.5.1 binaries would not run on 5.6 due to shared library differences.
3034 AC_CHECK_DECLS([$jm_io_func],
3037 [#include <stdio.h>])
3038 if test $jm_declared = yes; then
3039 AC_CHECK_FUNCS($jm_io_func)
3047 dnl Written by Jim Meyering
3049 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
3051 dnl Do this replacement check manually because I want the hyphen
3052 dnl (not the underscore) in the filename.
3053 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3059 dnl From Jim Meyering.
3061 dnl Check whether putenv ("FOO") removes FOO from the environment.
3062 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3065 AC_DEFUN([jm_FUNC_PUTENV],
3066 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3071 /* Put it in env. */
3072 if (putenv ("CONFTEST_putenv=val"))
3075 /* Try to remove it. */
3076 if (putenv ("CONFTEST_putenv"))
3079 /* Make sure it was deleted. */
3080 if (getenv ("CONFTEST_putenv") != 0)
3086 jm_cv_func_svid_putenv=yes,
3087 jm_cv_func_svid_putenv=no,
3088 dnl When crosscompiling, assume putenv is broken.
3089 jm_cv_func_svid_putenv=no)
3091 if test $jm_cv_func_svid_putenv = no; then
3093 AC_DEFINE(putenv, rpl_putenv,
3094 [Define to rpl_putenv if the replacement function should be used.])
3102 AC_MSG_CHECKING(for AFS)
3103 if test -d /afs; then
3104 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3109 AC_MSG_RESULT($ac_result)
3114 # autoconf tests required for use of xstrtoumax.c
3116 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3118 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3119 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3120 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3121 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3122 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3123 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3125 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3126 jm_cv_func_strtoumax_macro,
3127 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3129 inttypes_h_defines_strtoumax
3131 jm_cv_func_strtoumax_macro=yes,
3132 jm_cv_func_strtoumax_macro=no))
3134 if test "$jm_cv_func_strtoumax_macro" != yes; then
3135 AC_REPLACE_FUNCS(strtoumax)
3138 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3139 dnl so we need the replacements only if strtoumax does not exist.
3140 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3142 AC_REPLACE_FUNCS(strtoul)
3144 dnl We don't need (and can't compile) the replacement strtoull
3145 dnl unless the type `unsigned long long' exists.
3146 if test "$ac_cv_type_unsigned_long_long" = yes; then
3147 AC_REPLACE_FUNCS(strtoull)
3154 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3156 # autoconf tests required for use of xstrtoimax.c
3158 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3160 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3161 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3162 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3163 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3164 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3165 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3167 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3168 jm_cv_func_strtoimax_macro,
3169 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3171 inttypes_h_defines_strtoimax
3173 jm_cv_func_strtoimax_macro=yes,
3174 jm_cv_func_strtoimax_macro=no))
3176 if test "$jm_cv_func_strtoimax_macro" != yes; then
3177 AC_REPLACE_FUNCS(strtoimax)
3180 dnl Only the replacement strtoimax invokes strtol and strtoll,
3181 dnl so we need the replacements only if strtoimax does not exist.
3182 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3184 AC_REPLACE_FUNCS(strtol)
3186 dnl We don't need (and can't compile) the replacement strtoll
3187 dnl unless the type `long long' exists.
3188 if test "$ac_cv_type_long_long" = yes; then
3189 AC_REPLACE_FUNCS(strtoll)
3196 dnl Run a program to determine whether whether link(2) follows symlinks.
3197 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3199 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3202 [whether link(2) dereferences a symlink specified with a trailing slash],
3203 jm_ac_cv_func_link_follows_symlink,
3205 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3206 dnl the appropriate framework.
3207 test -z "$ac_cv_header_unistd_h" \
3208 && AC_CHECK_HEADERS(unistd.h)
3210 # Create a regular file.
3211 echo > conftest.file
3214 # include <sys/types.h>
3215 # include <sys/stat.h>
3216 # ifdef HAVE_UNISTD_H
3217 # include <unistd.h>
3220 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3221 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3222 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3227 const char *file = "conftest.file";
3228 const char *sym = "conftest.sym";
3229 const char *hard = "conftest.hard";
3230 struct stat sb_file, sb_hard;
3232 /* Create a symlink to the regular file. */
3233 if (symlink (file, sym))
3236 /* Create a hard link to that symlink. */
3237 if (link (sym, hard))
3240 if (lstat (hard, &sb_hard))
3242 if (lstat (file, &sb_file))
3245 /* If the dev/inode of hard and file are the same, then
3246 the link call followed the symlink. */
3247 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3250 jm_ac_cv_func_link_follows_symlink=yes,
3251 jm_ac_cv_func_link_follows_symlink=no,
3252 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3255 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3256 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3257 [Define if `link(2)' dereferences symbolic links.])
3263 dnl This macro is intended to be used solely in this file.
3264 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3265 AC_DEFUN([_jm_STRFTIME_PREREQS],
3267 dnl strftime.c uses localtime_r and the underyling system strftime
3269 AC_CHECK_FUNCS(localtime_r strftime)
3271 AC_CHECK_HEADERS(limits.h)
3272 AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
3274 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3277 AC_CHECK_FUNCS(mblen mbrlen)
3279 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3280 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3281 [Define if struct tm has the tm_gmtoff member.])],
3283 [#include <time.h>])
3286 dnl From Jim Meyering.
3288 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3289 [AC_REQUIRE([AC_HEADER_TIME])dnl
3291 _jm_STRFTIME_PREREQS
3293 AC_REQUIRE([AC_C_CONST])dnl
3294 AC_REQUIRE([AC_HEADER_STDC])dnl
3295 AC_CHECK_HEADERS(sys/time.h)
3296 AC_DEFINE([my_strftime], [nstrftime],
3297 [Define to the name of the strftime replacement function.])
3300 AC_DEFUN([jm_FUNC_STRFTIME],
3302 _jm_STRFTIME_PREREQS
3307 dnl From Jim Meyering
3308 dnl Using code from emacs, based on suggestions from Paul Eggert
3309 dnl and Ulrich Drepper.
3311 dnl Find out how to determine the number of pending output bytes on a stream.
3312 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3313 dnl we have to grub around in the FILE struct.
3315 AC_DEFUN([jm_FUNC_FPENDING],
3317 AC_CHECK_HEADERS(stdio_ext.h)
3318 AC_REPLACE_FUNCS([__fpending])
3320 # if HAVE_STDIO_EXT_H
3321 # include <stdio_ext.h>
3324 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3325 if test $ac_cv_func___fpending = no; then
3327 [how to determine the number of pending output bytes on a stream],
3328 ac_cv_sys_pending_output_n_bytes,
3333 'fp->_IO_write_ptr - fp->_IO_write_base' \
3335 '# traditional Unix' \
3336 'fp->_ptr - fp->_base' \
3339 'fp->_p - fp->_bf._base' \
3342 'fp->__ptr - fp->__base' \
3345 'fp->__bufp - fp->__buffer' \
3347 '# old glibc iostream?' \
3348 'fp->_pptr - fp->_pbase' \
3351 '(*fp)->_ptr - (*fp)->_base' \
3353 '# e.g., DGUX R4.11; the info is not available' \
3357 # Skip each embedded comment.
3358 case "$ac_expr" in '#'*) continue;; esac
3363 [FILE *fp = stdin; (void) ($ac_expr);],
3366 test "$fp_done" = yes && break
3369 ac_cv_sys_pending_output_n_bytes=$ac_expr
3372 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3373 $ac_cv_sys_pending_output_n_bytes,
3374 [the number of pending output bytes on stream `fp'])
3380 dnl From Jim Meyering.
3382 dnl Invoking code should check $GETGROUPS_LIB something like this:
3383 dnl jm_FUNC_GETGROUPS
3384 dnl test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3387 AC_DEFUN([jm_FUNC_GETGROUPS],
3388 [AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
3389 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
3390 AC_CHECK_FUNCS(getgroups)
3392 # If we don't yet have getgroups, see if it's in -lbsd.
3393 # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
3394 if test $ac_cv_func_getgroups = no; then
3395 jm_cv_sys_getgroups_saved_lib="$LIBS"
3396 AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
3397 LIBS="$jm_cv_sys_getgroups_saved_lib"
3400 # Run the program to test the functionality of the system-supplied
3401 # getgroups function only if there is such a function.
3402 if test $ac_cv_func_getgroups = yes; then
3403 AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
3408 /* On Ultrix 4.3, getgroups (0, 0) always fails. */
3409 exit (getgroups (0, 0) == -1 ? 1 : 0);
3412 jm_cv_func_working_getgroups=yes,
3413 jm_cv_func_working_getgroups=no,
3414 dnl When crosscompiling, assume getgroups is broken.
3415 jm_cv_func_working_getgroups=no)
3417 if test $jm_cv_func_working_getgroups = no; then
3418 AC_LIBOBJ(getgroups)
3419 AC_DEFINE(getgroups, rpl_getgroups,
3420 [Define as rpl_getgroups if getgroups doesn't work right.])
3427 # A replacement for autoconf's macro by the same name. This version
3428 # accepts an optional argument specifying the name of the $srcdir-relative
3429 # directory in which the file getloadavg.c may be found. It is unusual
3430 # (but justified, imho) that this file is required at ./configure time.
3432 undefine([AC_FUNC_GETLOADAVG])
3434 # AC_FUNC_GETLOADAVG
3435 # ------------------
3436 AC_DEFUN([AC_FUNC_GETLOADAVG],
3437 [ac_have_func=no # yes means we've found a way to get the load average.
3439 AC_CHECK_HEADERS(locale.h unistd.h mach/mach.h fcntl.h)
3440 AC_CHECK_FUNCS(setlocale)
3442 # By default, expect to find getloadavg.c in $srcdir/.
3443 ac_lib_dir_getloadavg=$srcdir
3444 # But if there's an argument, DIR, expect to find getloadavg.c in $srcdir/DIR.
3445 m4_ifval([$1], [ac_lib_dir_getloadavg=$srcdir/$1])
3446 # Make sure getloadavg.c is where it belongs, at ./configure-time.
3447 test -f $ac_lib_dir_getloadavg/getloadavg.c \
3448 || AC_MSG_ERROR([getloadavg.c is not in $ac_lib_dir_getloadavg])
3449 # FIXME: Add an autoconf-time test, too?
3453 # Check for getloadavg, but be sure not to touch the cache variable.
3454 (AC_CHECK_FUNC(getloadavg, exit 0, exit 1)) && ac_have_func=yes
3456 # On HPUX9, an unprivileged user can get load averages through this function.
3457 AC_CHECK_FUNCS(pstat_getdynamic)
3459 # Solaris has libkstat which does not require root.
3460 AC_CHECK_LIB(kstat, kstat_open)
3461 test $ac_cv_lib_kstat_kstat_open = yes && ac_have_func=yes
3463 # Some systems with -lutil have (and need) -lkvm as well, some do not.
3464 # On Solaris, -lkvm requires nlist from -lelf, so check that first
3465 # to get the right answer into the cache.
3466 # For kstat on solaris, we need libelf to force the definition of SVR4 below.
3467 if test $ac_have_func = no; then
3468 AC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS")
3470 if test $ac_have_func = no; then
3471 AC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS")
3472 # Check for the 4.4BSD definition of getloadavg.
3473 AC_CHECK_LIB(util, getloadavg,
3474 [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes])
3477 if test $ac_have_func = no; then
3478 # There is a commonly available library for RS/6000 AIX.
3479 # Since it is not a standard part of AIX, it might be installed locally.
3480 ac_getloadavg_LIBS=$LIBS
3481 LIBS="-L/usr/local/lib $LIBS"
3482 AC_CHECK_LIB(getloadavg, getloadavg,
3483 [LIBS="-lgetloadavg $LIBS"], [LIBS=$ac_getloadavg_LIBS])
3486 # Make sure it is really in the library, if we think we found it,
3487 # otherwise set up the replacement function.
3488 AC_CHECK_FUNCS(getloadavg, [],
3489 [_AC_LIBOBJ_GETLOADAVG])
3491 # Some definitions of getloadavg require that the program be installed setgid.
3492 AC_CACHE_CHECK(whether getloadavg requires setgid,
3493 ac_cv_func_getloadavg_setgid,
3494 [AC_EGREP_CPP([Yowza Am I SETGID yet],
3495 [#include "$ac_lib_dir_getloadavg/getloadavg.c"
3496 #ifdef LDAV_PRIVILEGED
3497 Yowza Am I SETGID yet
3499 ac_cv_func_getloadavg_setgid=yes,
3500 ac_cv_func_getloadavg_setgid=no)])
3501 if test $ac_cv_func_getloadavg_setgid = yes; then
3503 AC_DEFINE(GETLOADAVG_PRIVILEGED, 1,
3504 [Define if the `getloadavg' function needs to be run setuid
3509 AC_SUBST(NEED_SETGID)dnl
3511 if test $ac_cv_func_getloadavg_setgid = yes; then
3512 AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem,
3513 [ # On Solaris, /dev/kmem is a symlink. Get info on the real file.
3514 ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null`
3515 # If we got an error (system does not support symlinks), try without -L.
3516 test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem`
3517 ac_cv_group_kmem=`echo $ac_ls_output \
3518 | sed -ne ['s/[ ][ ]*/ /g;
3519 s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/;
3522 AC_SUBST(KMEM_GROUP, $ac_cv_group_kmem)dnl
3524 if test "x$ac_save_LIBS" = x; then
3525 GETLOADAVG_LIBS=$LIBS
3527 GETLOADAVG_LIBS=`echo "$LIBS" | sed "s!$ac_save_LIBS!!"`
3531 AC_SUBST(GETLOADAVG_LIBS)dnl
3532 ])# AC_FUNC_GETLOADAVG
3538 AC_DEFUN([jm_SYS_PROC_UPTIME],
3539 [ dnl Require AC_PROG_CC to see if we're cross compiling.
3540 AC_REQUIRE([AC_PROG_CC])
3541 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
3542 [jm_cv_have_proc_uptime=no
3543 test -f /proc/uptime \
3544 && test "$cross_compiling" = no \
3545 && cat < /proc/uptime >/dev/null 2>/dev/null \
3546 && jm_cv_have_proc_uptime=yes])
3547 if test $jm_cv_have_proc_uptime = yes; then
3548 AC_DEFINE(HAVE_PROC_UPTIME, 1,
3549 [ Define if your system has the /proc/uptime special file.])
3555 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
3557 AC_DEFUN([jm_FUNC_FTRUNCATE],
3559 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
3561 if test "$ftruncate_missing" = yes; then
3562 AC_CHECK_HEADERS([unistd.h])
3563 AC_CHECK_FUNCS([chsize])
3564 AC_LIBOBJ(ftruncate)
3570 dnl From Volker Borchert.
3571 dnl Determine whether rename works for source paths with a trailing slash.
3572 dnl The rename from SunOS 4.1.1_U1 doesn't.
3574 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
3575 dnl to compile the wrapper function.
3578 AC_DEFUN([vb_FUNC_RENAME],
3580 AC_CACHE_CHECK([whether rename is broken],
3581 vb_cv_func_rename_trailing_slash_bug,
3583 rm -rf conftest.d1 conftest.d2
3584 mkdir conftest.d1 ||
3585 AC_MSG_ERROR([cannot create temporary directory])
3591 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
3594 vb_cv_func_rename_trailing_slash_bug=no,
3595 vb_cv_func_rename_trailing_slash_bug=yes,
3596 dnl When crosscompiling, assume rename is broken.
3597 vb_cv_func_rename_trailing_slash_bug=yes)
3599 rm -rf conftest.d1 conftest.d2
3601 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
3603 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
3604 [Define if rename does not work for source paths with a trailing slash,
3605 like the one from SunOS 4.1.1_U1.])
3611 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
3612 # silly limit that it can create no more than 26 files from a given template.
3613 # Other systems lack mkstemp altogether. On either type of system, arrange
3614 # to use the replacement function.
3615 AC_DEFUN([UTILS_FUNC_MKSTEMP],
3617 AC_REPLACE_FUNCS(mkstemp)
3618 if test $ac_cv_func_mkstemp = no; then
3619 utils_cv_func_mkstemp_limitations=yes
3621 AC_CACHE_CHECK([for mkstemp limitations],
3622 utils_cv_func_mkstemp_limitations,
3625 # include <stdlib.h>
3629 for (i = 0; i < 30; i++)
3631 char template[] = "conftestXXXXXX";
3632 int fd = mkstemp (template);
3640 utils_cv_func_mkstemp_limitations=no,
3641 utils_cv_func_mkstemp_limitations=yes,
3642 utils_cv_func_mkstemp_limitations=yes
3648 if test $utils_cv_func_mkstemp_limitations = yes; then
3651 AC_DEFINE(mkstemp, rpl_mkstemp,
3652 [Define to rpl_mkstemp if the replacement function should be used.])
3658 dnl From Jim Meyering.
3660 dnl See if gettimeofday clobbers the static buffer that localtime uses
3661 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
3662 dnl i.e. Darwin 1.3.7 has this problem.
3664 dnl If it does, then arrange to use gettimeofday and localtime only via
3665 dnl the wrapper functions that work around the problem.
3667 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
3669 AC_REQUIRE([AC_HEADER_TIME])
3670 AC_CHECK_HEADERS(string.h stdlib.h)
3671 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
3672 jm_cv_func_gettimeofday_clobber,
3676 # include <string.h>
3679 #if TIME_WITH_SYS_TIME
3680 # include <sys/time.h>
3683 # if HAVE_SYS_TIME_H
3684 # include <sys/time.h>
3691 # include <stdlib.h>
3701 lt = localtime (&t);
3703 gettimeofday (&tv, NULL);
3704 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
3710 jm_cv_func_gettimeofday_clobber=no,
3711 jm_cv_func_gettimeofday_clobber=yes,
3712 dnl When crosscompiling, assume it is broken.
3713 jm_cv_func_gettimeofday_clobber=yes)
3715 if test $jm_cv_func_gettimeofday_clobber = yes; then
3716 AC_LIBOBJ(gettimeofday)
3717 AC_DEFINE(localtime, rpl_localtime,
3718 [Define to rpl_localtime if the replacement function should be used.])
3719 AC_DEFINE(gettimeofday, rpl_gettimeofday,
3720 [Define to rpl_gettimeofday if the replacement function should be used.])
3721 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
3722 [Define if gettimeofday clobbers localtime's static buffer.])
3728 dnl From Jim Meyering
3729 dnl Replace the utime function on systems that need it.
3733 AC_DEFUN([jm_FUNC_UTIME],
3735 AC_CHECK_HEADERS(utime.h)
3736 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
3737 AC_REQUIRE([AC_FUNC_UTIME_NULL])
3739 if test $ac_cv_func_utime_null = no; then
3741 AC_REPLACE_FUNCS(utime)
3747 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
3748 dnl then do case-insensitive s/utime/utimes/.
3750 AC_DEFUN([jm_FUNC_UTIMES_NULL],
3751 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
3752 [rm -f conftest.data; > conftest.data
3754 /* In case stat has been defined to rpl_stat, undef it here. */
3756 #include <sys/types.h>
3757 #include <sys/stat.h>
3760 exit(!(stat ("conftest.data", &s) == 0
3761 && utimes("conftest.data", (long *)0) == 0
3762 && stat("conftest.data", &t) == 0
3763 && t.st_mtime >= s.st_mtime
3764 && t.st_mtime - s.st_mtime < 120));
3766 ac_cv_func_utimes_null=yes,
3767 ac_cv_func_utimes_null=no,
3768 ac_cv_func_utimes_null=no)
3769 rm -f core core.* *.core])
3771 if test $ac_cv_func_utimes_null = yes; then
3772 AC_DEFINE(HAVE_UTIMES_NULL, 1,
3773 [Define if utimes accepts a null argument])
3780 dnl See if there's a working, system-supplied version of the getline function.
3781 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
3782 dnl have a function by that name in -linet that doesn't have anything
3783 dnl to do with the function we need.
3784 AC_DEFUN([AM_FUNC_GETLINE],
3786 am_getline_needs_run_time_check=no
3787 AC_CHECK_FUNC(getline,
3788 dnl Found it in some library. Verify that it works.
3789 am_getline_needs_run_time_check=yes,
3790 am_cv_func_working_getline=no)
3791 if test $am_getline_needs_run_time_check = yes; then
3792 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
3793 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
3796 # include <sys/types.h>
3797 # include <string.h>
3799 { /* Based on a test program from Karl Heuer. */
3803 FILE *in = fopen ("./conftest.data", "r");
3806 len = getline (&line, &siz, in);
3807 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
3809 ], am_cv_func_working_getline=yes dnl The library version works.
3810 , am_cv_func_working_getline=no dnl The library version does NOT work.
3811 , am_cv_func_working_getline=no dnl We're cross compiling.
3815 if test $am_cv_func_working_getline = no; then
3820 # codeset.m4 serial AM1 (gettext-0.10.40)
3821 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3822 dnl This file is free software, distributed under the terms of the GNU
3823 dnl General Public License. As a special exception to the GNU General
3824 dnl Public License, this file may be distributed as part of a program
3825 dnl that contains a configuration script generated by Autoconf, under
3826 dnl the same distribution terms as the rest of that program.
3828 dnl From Bruno Haible.
3830 AC_DEFUN([AM_LANGINFO_CODESET],
3832 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3833 [AC_TRY_LINK([#include <langinfo.h>],
3834 [char* cs = nl_langinfo(CODESET);],
3835 am_cv_langinfo_codeset=yes,
3836 am_cv_langinfo_codeset=no)
3838 if test $am_cv_langinfo_codeset = yes; then
3839 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3840 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3844 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3845 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3846 dnl This file is free software, distributed under the terms of the GNU
3847 dnl General Public License. As a special exception to the GNU General
3848 dnl Public License, this file may be distributed as part of a program
3849 dnl that contains a configuration script generated by Autoconf, under
3850 dnl the same distribution terms as the rest of that program.
3852 # Test for the GNU C Library, version 2.1 or newer.
3853 # From Bruno Haible.
3855 AC_DEFUN([jm_GLIBC21],
3857 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
3858 ac_cv_gnu_library_2_1,
3859 [AC_EGREP_CPP([Lucky GNU user],
3861 #include <features.h>
3862 #ifdef __GNU_LIBRARY__
3863 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
3868 ac_cv_gnu_library_2_1=yes,
3869 ac_cv_gnu_library_2_1=no)
3873 GLIBC21="$ac_cv_gnu_library_2_1"
3877 # iconv.m4 serial AM4 (gettext-0.11.3)
3878 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3879 dnl This file is free software, distributed under the terms of the GNU
3880 dnl General Public License. As a special exception to the GNU General
3881 dnl Public License, this file may be distributed as part of a program
3882 dnl that contains a configuration script generated by Autoconf, under
3883 dnl the same distribution terms as the rest of that program.
3885 dnl From Bruno Haible.
3887 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
3889 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
3890 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
3891 AC_REQUIRE([AC_LIB_RPATH])
3893 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3895 AC_LIB_LINKFLAGS_BODY([iconv])
3898 AC_DEFUN([AM_ICONV_LINK],
3900 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
3901 dnl those with the standalone portable GNU libiconv installed).
3903 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
3905 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
3907 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
3908 dnl because if the user has installed libiconv and not disabled its use
3909 dnl via --without-libiconv-prefix, he wants to use it. The first
3910 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
3911 am_save_CPPFLAGS="$CPPFLAGS"
3912 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
3914 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
3915 am_cv_func_iconv="no, consider installing GNU libiconv"
3917 AC_TRY_LINK([#include <stdlib.h>
3918 #include <iconv.h>],
3919 [iconv_t cd = iconv_open("","");
3920 iconv(cd,NULL,NULL,NULL,NULL);
3922 am_cv_func_iconv=yes)
3923 if test "$am_cv_func_iconv" != yes; then
3924 am_save_LIBS="$LIBS"
3925 LIBS="$LIBS $LIBICONV"
3926 AC_TRY_LINK([#include <stdlib.h>
3927 #include <iconv.h>],
3928 [iconv_t cd = iconv_open("","");
3929 iconv(cd,NULL,NULL,NULL,NULL);
3932 am_cv_func_iconv=yes)
3933 LIBS="$am_save_LIBS"
3936 if test "$am_cv_func_iconv" = yes; then
3937 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
3939 if test "$am_cv_lib_iconv" = yes; then
3940 AC_MSG_CHECKING([how to link with libiconv])
3941 AC_MSG_RESULT([$LIBICONV])
3943 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
3945 CPPFLAGS="$am_save_CPPFLAGS"
3950 AC_SUBST(LTLIBICONV)
3953 AC_DEFUN([AM_ICONV],
3956 if test "$am_cv_func_iconv" = yes; then
3957 AC_MSG_CHECKING([for iconv declaration])
3958 AC_CACHE_VAL(am_cv_proto_iconv, [
3966 #if defined(__STDC__) || defined(__cplusplus)
3967 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
3971 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
3972 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);"])
3973 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
3974 AC_MSG_RESULT([$]{ac_t:-
3975 }[$]am_cv_proto_iconv)
3976 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
3977 [Define as const if the declaration of iconv() needs const.])
3981 # lib-prefix.m4 serial 1 (gettext-0.11)
3982 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
3983 dnl This file is free software, distributed under the terms of the GNU
3984 dnl General Public License. As a special exception to the GNU General
3985 dnl Public License, this file may be distributed as part of a program
3986 dnl that contains a configuration script generated by Autoconf, under
3987 dnl the same distribution terms as the rest of that program.
3989 dnl From Bruno Haible.
3991 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
3992 dnl to access previously installed libraries. The basic assumption is that
3993 dnl a user will want packages to use other packages he previously installed
3994 dnl with the same --prefix option.
3995 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
3996 dnl libraries, but is otherwise very convenient.
3997 AC_DEFUN([AC_LIB_PREFIX],
3999 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4000 AC_REQUIRE([AC_PROG_CC])
4001 AC_REQUIRE([AC_CANONICAL_HOST])
4002 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4003 dnl By default, look in $includedir and $libdir.
4005 AC_LIB_WITH_FINAL_PREFIX([
4006 eval additional_includedir=\"$includedir\"
4007 eval additional_libdir=\"$libdir\"
4009 AC_ARG_WITH([lib-prefix],
4010 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
4011 --without-lib-prefix don't search for libraries in includedir and libdir],
4013 if test "X$withval" = "Xno"; then
4016 if test "X$withval" = "X"; then
4017 AC_LIB_WITH_FINAL_PREFIX([
4018 eval additional_includedir=\"$includedir\"
4019 eval additional_libdir=\"$libdir\"
4022 additional_includedir="$withval/include"
4023 additional_libdir="$withval/lib"
4027 if test $use_additional = yes; then
4028 dnl Potentially add $additional_includedir to $CPPFLAGS.
4029 dnl But don't add it
4030 dnl 1. if it's the standard /usr/include,
4031 dnl 2. if it's already present in $CPPFLAGS,
4032 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
4033 dnl 4. if it doesn't exist as a directory.
4034 if test "X$additional_includedir" != "X/usr/include"; then
4036 for x in $CPPFLAGS; do
4037 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4038 if test "X$x" = "X-I$additional_includedir"; then
4043 if test -z "$haveit"; then
4044 if test "X$additional_includedir" = "X/usr/local/include"; then
4045 if test -n "$GCC"; then
4047 linux*) haveit=yes;;
4051 if test -z "$haveit"; then
4052 if test -d "$additional_includedir"; then
4053 dnl Really add $additional_includedir to $CPPFLAGS.
4054 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
4059 dnl Potentially add $additional_libdir to $LDFLAGS.
4060 dnl But don't add it
4061 dnl 1. if it's the standard /usr/lib,
4062 dnl 2. if it's already present in $LDFLAGS,
4063 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
4064 dnl 4. if it doesn't exist as a directory.
4065 if test "X$additional_libdir" != "X/usr/lib"; then
4067 for x in $LDFLAGS; do
4068 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4069 if test "X$x" = "X-L$additional_libdir"; then
4074 if test -z "$haveit"; then
4075 if test "X$additional_libdir" = "X/usr/local/lib"; then
4076 if test -n "$GCC"; then
4078 linux*) haveit=yes;;
4082 if test -z "$haveit"; then
4083 if test -d "$additional_libdir"; then
4084 dnl Really add $additional_libdir to $LDFLAGS.
4085 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
4093 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
4094 dnl acl_final_exec_prefix, containing the values to which $prefix and
4095 dnl $exec_prefix will expand at the end of the configure script.
4096 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
4098 dnl Unfortunately, prefix and exec_prefix get only finally determined
4099 dnl at the end of configure.
4100 if test "X$prefix" = "XNONE"; then
4101 acl_final_prefix="$ac_default_prefix"
4103 acl_final_prefix="$prefix"
4105 if test "X$exec_prefix" = "XNONE"; then
4106 acl_final_exec_prefix='${prefix}'
4108 acl_final_exec_prefix="$exec_prefix"
4110 acl_save_prefix="$prefix"
4111 prefix="$acl_final_prefix"
4112 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
4113 prefix="$acl_save_prefix"
4116 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
4117 dnl variables prefix and exec_prefix bound to the values they will have
4118 dnl at the end of the configure script.
4119 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
4121 acl_save_prefix="$prefix"
4122 prefix="$acl_final_prefix"
4123 acl_save_exec_prefix="$exec_prefix"
4124 exec_prefix="$acl_final_exec_prefix"
4126 exec_prefix="$acl_save_exec_prefix"
4127 prefix="$acl_save_prefix"
4130 # lib-link.m4 serial 3 (gettext-0.11.3)
4131 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4132 dnl This file is free software, distributed under the terms of the GNU
4133 dnl General Public License. As a special exception to the GNU General
4134 dnl Public License, this file may be distributed as part of a program
4135 dnl that contains a configuration script generated by Autoconf, under
4136 dnl the same distribution terms as the rest of that program.
4138 dnl From Bruno Haible.
4140 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
4141 dnl the libraries corresponding to explicit and implicit dependencies.
4142 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
4143 dnl augments the CPPFLAGS variable.
4144 AC_DEFUN([AC_LIB_LINKFLAGS],
4146 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4147 AC_REQUIRE([AC_LIB_RPATH])
4148 define([Name],[translit([$1],[./-], [___])])
4149 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4150 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4151 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
4152 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4153 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
4154 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
4155 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
4157 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
4158 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
4159 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
4160 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4162 AC_SUBST([LTLIB]NAME)
4163 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
4164 dnl results of this search when this library appears as a dependency.
4170 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
4171 dnl searches for libname and the libraries corresponding to explicit and
4172 dnl implicit dependencies, together with the specified include files and
4173 dnl the ability to compile and link the specified testcode. If found, it
4174 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
4175 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
4176 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
4177 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
4178 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
4180 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4181 AC_REQUIRE([AC_LIB_RPATH])
4182 define([Name],[translit([$1],[./-], [___])])
4183 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4184 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4186 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
4188 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4190 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
4191 dnl because if the user has installed lib[]Name and not disabled its use
4192 dnl via --without-lib[]Name-prefix, he wants to use it.
4193 ac_save_CPPFLAGS="$CPPFLAGS"
4194 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4196 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
4197 ac_save_LIBS="$LIBS"
4198 LIBS="$LIBS $LIB[]NAME"
4199 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
4200 LIBS="$ac_save_LIBS"
4202 if test "$ac_cv_lib[]Name" = yes; then
4204 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
4205 AC_MSG_CHECKING([how to link with lib[]$1])
4206 AC_MSG_RESULT([$LIB[]NAME])
4209 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
4210 dnl $INC[]NAME either.
4211 CPPFLAGS="$ac_save_CPPFLAGS"
4215 AC_SUBST([HAVE_LIB]NAME)
4217 AC_SUBST([LTLIB]NAME)
4222 dnl Determine the platform dependent parameters needed to use rpath:
4223 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
4224 dnl hardcode_direct, hardcode_minus_L,
4225 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
4226 AC_DEFUN([AC_LIB_RPATH],
4228 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
4229 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
4230 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
4231 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
4232 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
4233 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
4234 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
4240 libext="$acl_cv_libext"
4241 shlibext="$acl_cv_shlibext"
4242 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
4243 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
4244 hardcode_direct="$acl_cv_hardcode_direct"
4245 hardcode_minus_L="$acl_cv_hardcode_minus_L"
4246 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
4247 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
4248 dnl Determine whether the user wants rpath handling at all.
4249 AC_ARG_ENABLE(rpath,
4250 [ --disable-rpath do not hardcode runtime library paths],
4251 :, enable_rpath=yes)
4254 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
4255 dnl the libraries corresponding to explicit and implicit dependencies.
4256 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
4257 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
4259 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4260 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4261 dnl By default, look in $includedir and $libdir.
4263 AC_LIB_WITH_FINAL_PREFIX([
4264 eval additional_includedir=\"$includedir\"
4265 eval additional_libdir=\"$libdir\"
4267 AC_ARG_WITH([lib$1-prefix],
4268 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
4269 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
4271 if test "X$withval" = "Xno"; then
4274 if test "X$withval" = "X"; then
4275 AC_LIB_WITH_FINAL_PREFIX([
4276 eval additional_includedir=\"$includedir\"
4277 eval additional_libdir=\"$libdir\"
4280 additional_includedir="$withval/include"
4281 additional_libdir="$withval/lib"
4285 dnl Search the library and its dependencies in $additional_libdir and
4286 dnl $LDFLAGS. Using breadth-first-seach.
4292 names_already_handled=
4293 names_next_round='$1 $2'
4294 while test -n "$names_next_round"; do
4295 names_this_round="$names_next_round"
4297 for name in $names_this_round; do
4299 for n in $names_already_handled; do
4300 if test "$n" = "$name"; then
4305 if test -z "$already_handled"; then
4306 names_already_handled="$names_already_handled $name"
4307 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
4308 dnl or AC_LIB_HAVE_LINKFLAGS call.
4309 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4310 eval value=\"\$HAVE_LIB$uppername\"
4311 if test -n "$value"; then
4312 if test "$value" = yes; then
4313 eval value=\"\$LIB$uppername\"
4314 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
4315 eval value=\"\$LTLIB$uppername\"
4316 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
4318 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
4319 dnl that this library doesn't exist. So just drop it.
4323 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
4324 dnl and the already constructed $LIBNAME/$LTLIBNAME.
4329 if test $use_additional = yes; then
4330 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
4331 found_dir="$additional_libdir"
4332 found_so="$additional_libdir/lib$name.$shlibext"
4333 if test -f "$additional_libdir/lib$name.la"; then
4334 found_la="$additional_libdir/lib$name.la"
4337 if test -f "$additional_libdir/lib$name.$libext"; then
4338 found_dir="$additional_libdir"
4339 found_a="$additional_libdir/lib$name.$libext"
4340 if test -f "$additional_libdir/lib$name.la"; then
4341 found_la="$additional_libdir/lib$name.la"
4346 if test "X$found_dir" = "X"; then
4347 for x in $LDFLAGS $LTLIB[]NAME; do
4348 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4351 dir=`echo "X$x" | sed -e 's/^X-L//'`
4352 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
4354 found_so="$dir/lib$name.$shlibext"
4355 if test -f "$dir/lib$name.la"; then
4356 found_la="$dir/lib$name.la"
4359 if test -f "$dir/lib$name.$libext"; then
4361 found_a="$dir/lib$name.$libext"
4362 if test -f "$dir/lib$name.la"; then
4363 found_la="$dir/lib$name.la"
4369 if test "X$found_dir" != "X"; then
4374 if test "X$found_dir" != "X"; then
4375 dnl Found the library.
4376 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4377 if test "X$found_so" != "X"; then
4378 dnl Linking with a shared library. We attempt to hardcode its
4379 dnl directory into the executable's runpath, unless it's the
4380 dnl standard /usr/lib.
4381 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
4382 dnl No hardcoding is needed.
4383 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4385 dnl Use an explicit option to hardcode DIR into the resulting
4387 dnl Potentially add DIR to ltrpathdirs.
4388 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4390 for x in $ltrpathdirs; do
4391 if test "X$x" = "X$found_dir"; then
4396 if test -z "$haveit"; then
4397 ltrpathdirs="$ltrpathdirs $found_dir"
4399 dnl The hardcoding into $LIBNAME is system dependent.
4400 if test "$hardcode_direct" = yes; then
4401 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4402 dnl resulting binary.
4403 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4405 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4406 dnl Use an explicit option to hardcode DIR into the resulting
4408 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4409 dnl Potentially add DIR to rpathdirs.
4410 dnl The rpathdirs will be appended to $LIBNAME at the end.
4412 for x in $rpathdirs; do
4413 if test "X$x" = "X$found_dir"; then
4418 if test -z "$haveit"; then
4419 rpathdirs="$rpathdirs $found_dir"
4422 dnl Rely on "-L$found_dir".
4423 dnl But don't add it if it's already contained in the LDFLAGS
4424 dnl or the already constructed $LIBNAME
4426 for x in $LDFLAGS $LIB[]NAME; do
4427 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4428 if test "X$x" = "X-L$found_dir"; then
4433 if test -z "$haveit"; then
4434 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4436 if test "$hardcode_minus_L" != no; then
4437 dnl FIXME: Not sure whether we should use
4438 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4440 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4442 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4443 dnl here, because this doesn't fit in flags passed to the
4444 dnl compiler. So give up. No hardcoding. This affects only
4445 dnl very old systems.
4446 dnl FIXME: Not sure whether we should use
4447 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4449 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4455 if test "X$found_a" != "X"; then
4456 dnl Linking with a static library.
4457 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4459 dnl We shouldn't come here, but anyway it's good to have a
4461 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4464 dnl Assume the include files are nearby.
4465 additional_includedir=
4466 case "$found_dir" in
4468 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4469 additional_includedir="$basedir/include"
4472 if test "X$additional_includedir" != "X"; then
4473 dnl Potentially add $additional_includedir to $INCNAME.
4474 dnl But don't add it
4475 dnl 1. if it's the standard /usr/include,
4476 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
4477 dnl 3. if it's already present in $CPPFLAGS or the already
4478 dnl constructed $INCNAME,
4479 dnl 4. if it doesn't exist as a directory.
4480 if test "X$additional_includedir" != "X/usr/include"; then
4482 if test "X$additional_includedir" = "X/usr/local/include"; then
4483 if test -n "$GCC"; then
4485 linux*) haveit=yes;;
4489 if test -z "$haveit"; then
4490 for x in $CPPFLAGS $INC[]NAME; do
4491 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4492 if test "X$x" = "X-I$additional_includedir"; then
4497 if test -z "$haveit"; then
4498 if test -d "$additional_includedir"; then
4499 dnl Really add $additional_includedir to $INCNAME.
4500 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4506 dnl Look for dependencies.
4507 if test -n "$found_la"; then
4508 dnl Read the .la file. It defines the variables
4509 dnl dlname, library_names, old_library, dependency_libs, current,
4510 dnl age, revision, installed, dlopen, dlpreopen, libdir.
4511 save_libdir="$libdir"
4513 */* | *\\*) . "$found_la" ;;
4514 *) . "./$found_la" ;;
4516 libdir="$save_libdir"
4517 dnl We use only dependency_libs.
4518 for dep in $dependency_libs; do
4521 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4522 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4523 dnl But don't add it
4524 dnl 1. if it's the standard /usr/lib,
4525 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
4526 dnl 3. if it's already present in $LDFLAGS or the already
4527 dnl constructed $LIBNAME,
4528 dnl 4. if it doesn't exist as a directory.
4529 if test "X$additional_libdir" != "X/usr/lib"; then
4531 if test "X$additional_libdir" = "X/usr/local/lib"; then
4532 if test -n "$GCC"; then
4534 linux*) haveit=yes;;
4538 if test -z "$haveit"; then
4540 for x in $LDFLAGS $LIB[]NAME; do
4541 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4542 if test "X$x" = "X-L$additional_libdir"; then
4547 if test -z "$haveit"; then
4548 if test -d "$additional_libdir"; then
4549 dnl Really add $additional_libdir to $LIBNAME.
4550 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4554 for x in $LDFLAGS $LTLIB[]NAME; do
4555 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4556 if test "X$x" = "X-L$additional_libdir"; then
4561 if test -z "$haveit"; then
4562 if test -d "$additional_libdir"; then
4563 dnl Really add $additional_libdir to $LTLIBNAME.
4564 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4571 dir=`echo "X$dep" | sed -e 's/^X-R//'`
4572 if test "$enable_rpath" != no; then
4573 dnl Potentially add DIR to rpathdirs.
4574 dnl The rpathdirs will be appended to $LIBNAME at the end.
4576 for x in $rpathdirs; do
4577 if test "X$x" = "X$dir"; then
4582 if test -z "$haveit"; then
4583 rpathdirs="$rpathdirs $dir"
4585 dnl Potentially add DIR to ltrpathdirs.
4586 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4588 for x in $ltrpathdirs; do
4589 if test "X$x" = "X$dir"; then
4594 if test -z "$haveit"; then
4595 ltrpathdirs="$ltrpathdirs $dir"
4600 dnl Handle this in the next round.
4601 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4604 dnl Handle this in the next round. Throw away the .la's
4605 dnl directory; it is already contained in a preceding -L
4607 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4610 dnl Most likely an immediate library name.
4611 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4612 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4618 dnl Didn't find the library; assume it is in the system directories
4619 dnl known to the linker and runtime loader. (All the system
4620 dnl directories known to the linker should also be known to the
4621 dnl runtime loader, otherwise the system is severely misconfigured.)
4622 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4623 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4629 if test "X$rpathdirs" != "X"; then
4630 if test -n "$hardcode_libdir_separator"; then
4631 dnl Weird platform: only the last -rpath option counts, the user must
4632 dnl pass all path elements in one option. We can arrange that for a
4633 dnl single library, but not when more than one $LIBNAMEs are used.
4635 for found_dir in $rpathdirs; do
4636 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4638 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4639 acl_save_libdir="$libdir"
4641 eval flag=\"$hardcode_libdir_flag_spec\"
4642 libdir="$acl_save_libdir"
4643 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4645 dnl The -rpath options are cumulative.
4646 for found_dir in $rpathdirs; do
4647 acl_save_libdir="$libdir"
4649 eval flag=\"$hardcode_libdir_flag_spec\"
4650 libdir="$acl_save_libdir"
4651 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4655 if test "X$ltrpathdirs" != "X"; then
4656 dnl When using libtool, the option that works for both libraries and
4657 dnl executables is -R. The -R options are cumulative.
4658 for found_dir in $ltrpathdirs; do
4659 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4664 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4665 dnl unless already present in VAR.
4666 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4667 dnl contains two or three consecutive elements that belong together.
4668 AC_DEFUN([AC_LIB_APPENDTOVAR],
4670 for element in [$2]; do
4673 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4674 if test "X$x" = "X$element"; then
4679 if test -z "$haveit"; then
4680 [$1]="${[$1]}${[$1]:+ }$element"
4685 # lib-ld.m4 serial 1 (gettext-0.11)
4686 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
4687 dnl This file is free software, distributed under the terms of the GNU
4688 dnl General Public License. As a special exception to the GNU General
4689 dnl Public License, this file may be distributed as part of a program
4690 dnl that contains a configuration script generated by Autoconf, under
4691 dnl the same distribution terms as the rest of that program.
4693 dnl Subroutines of libtool.m4,
4694 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4695 dnl with libtool.m4.
4697 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4698 AC_DEFUN([AC_LIB_PROG_LD_GNU],
4699 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4700 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4701 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4702 acl_cv_prog_gnu_ld=yes
4704 acl_cv_prog_gnu_ld=no
4706 with_gnu_ld=$acl_cv_prog_gnu_ld
4709 dnl From libtool-1.4. Sets the variable LD.
4710 AC_DEFUN([AC_LIB_PROG_LD],
4711 [AC_ARG_WITH(gnu-ld,
4712 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
4713 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4714 AC_REQUIRE([AC_PROG_CC])dnl
4715 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4717 if test "$GCC" = yes; then
4718 # Check if gcc -print-prog-name=ld gives a path.
4719 AC_MSG_CHECKING([for ld used by GCC])
4722 # gcc leaves a trailing carriage return which upsets mingw
4723 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4725 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4728 # Accept absolute paths.
4729 [[\\/]* | [A-Za-z]:[\\/]*)]
4730 [re_direlt='/[^/][^/]*/\.\./']
4731 # Canonicalize the path of ld
4732 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4733 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4734 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4736 test -z "$LD" && LD="$ac_prog"
4739 # If it fails, then pretend we aren't using GCC.
4743 # If it is relative, then search for the first ld in PATH.
4747 elif test "$with_gnu_ld" = yes; then
4748 AC_MSG_CHECKING([for GNU ld])
4750 AC_MSG_CHECKING([for non-GNU ld])
4752 AC_CACHE_VAL(acl_cv_path_LD,
4753 [if test -z "$LD"; then
4754 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4755 for ac_dir in $PATH; do
4756 test -z "$ac_dir" && ac_dir=.
4757 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4758 acl_cv_path_LD="$ac_dir/$ac_prog"
4759 # Check to see if the program is GNU ld. I'd rather use --version,
4760 # but apparently some GNU ld's only accept -v.
4761 # Break only if it was the GNU/non-GNU ld that we prefer.
4762 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4763 test "$with_gnu_ld" != no && break
4765 test "$with_gnu_ld" != yes && break
4771 acl_cv_path_LD="$LD" # Let the user override the test with a path.
4773 LD="$acl_cv_path_LD"
4774 if test -n "$LD"; then
4779 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4785 dnl From J. David Anglin.
4787 dnl HPUX and other systems can't unlink shared text that is being executed.
4789 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
4791 AC_CACHE_CHECK([whether a running program can be unlinked],
4792 jm_cv_func_unlink_busy_text,
4801 exit (unlink (argv[0]));
4804 jm_cv_func_unlink_busy_text=yes,
4805 jm_cv_func_unlink_busy_text=no,
4806 jm_cv_func_unlink_busy_text=no
4811 if test $jm_cv_func_unlink_busy_text = no; then
4812 INSTALL=$ac_install_sh
4818 dnl From Jim Meyering.
4820 dnl This is not pretty. I've just taken the autoconf code and wrapped
4821 dnl it in an AC_DEFUN.
4824 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4825 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
4827 AC_CHECK_FUNCS(listmntent getmntinfo)
4828 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
4829 getfsstat_includes="\
4830 $ac_includes_default
4831 #if HAVE_SYS_PARAM_H
4832 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
4834 #if HAVE_SYS_UCRED_H
4835 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
4837 #if HAVE_SYS_MOUNT_H
4838 # include <sys/mount.h>
4840 #if HAVE_SYS_FS_TYPES_H
4841 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
4844 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
4846 # Determine how to get the list of mounted filesystems.
4849 # If the getmntent function is available but not in the standard library,
4850 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
4853 # This test must precede the ones for getmntent because Unicos-9 is
4854 # reported to have the getmntent function, but its support is incompatible
4855 # with other getmntent implementations.
4857 # NOTE: Normally, I wouldn't use a check for system type as I've done for
4858 # `CRAY' below since that goes against the whole autoconf philosophy. But
4859 # I think there is too great a chance that some non-Cray system has a
4860 # function named listmntent to risk the false positive.
4862 if test -z "$ac_list_mounted_fs"; then
4864 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
4865 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
4866 [fu_cv_sys_mounted_cray_listmntent=no
4871 ], [test $ac_cv_func_listmntent = yes \
4872 && fu_cv_sys_mounted_cray_listmntent=yes]
4876 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
4877 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
4878 ac_list_mounted_fs=found
4879 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
4880 [Define if there is a function named listmntent that can be used to
4881 list all mounted filesystems. (UNICOS)])
4885 if test $ac_cv_func_getmntent = yes; then
4887 # This system has the getmntent function.
4888 # Determine whether it's the one-argument variant or the two-argument one.
4890 if test -z "$ac_list_mounted_fs"; then
4891 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
4892 AC_MSG_CHECKING([for one-argument getmntent function])
4893 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
4895 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
4899 #if !defined MOUNTED
4900 # if defined _PATH_MOUNTED /* GNU libc */
4901 # define MOUNTED _PATH_MOUNTED
4903 # if defined MNT_MNTTAB /* HP-UX. */
4904 # define MOUNTED MNT_MNTTAB
4906 # if defined MNTTABNAME /* Dynix. */
4907 # define MOUNTED MNTTABNAME
4911 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
4912 fu_cv_sys_mounted_getmntent1=yes,
4913 fu_cv_sys_mounted_getmntent1=no)])
4914 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
4915 if test $fu_cv_sys_mounted_getmntent1 = yes; then
4916 ac_list_mounted_fs=found
4917 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
4918 [Define if there is a function named getmntent for reading the list
4919 of mounted filesystems, and that function takes a single argument.
4920 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
4924 if test -z "$ac_list_mounted_fs"; then
4926 AC_MSG_CHECKING([for two-argument getmntent function])
4927 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
4928 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
4929 fu_cv_sys_mounted_getmntent2=yes,
4930 fu_cv_sys_mounted_getmntent2=no)])
4931 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
4932 if test $fu_cv_sys_mounted_getmntent2 = yes; then
4933 ac_list_mounted_fs=found
4934 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
4935 [Define if there is a function named getmntent for reading the list of
4936 mounted filesystems, and that function takes two arguments. (SVR4)])
4942 if test -z "$ac_list_mounted_fs"; then
4943 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
4944 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
4946 AC_MSG_CHECKING([for getfsstat function])
4947 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
4949 #include <sys/types.h>
4950 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
4951 # define FS_TYPE(Ent) ((Ent).f_fstypename)
4953 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
4955 ]$getfsstat_includes
4957 [struct statfs *stats;
4958 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
4959 char *t = FS_TYPE (*stats); ],
4960 fu_cv_sys_mounted_getfsstat=yes,
4961 fu_cv_sys_mounted_getfsstat=no)])
4962 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
4963 if test $fu_cv_sys_mounted_getfsstat = yes; then
4964 ac_list_mounted_fs=found
4965 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
4966 [Define if there is a function named getfsstat for reading the
4967 list of mounted filesystems. (DEC Alpha running OSF/1)])
4971 if test -z "$ac_list_mounted_fs"; then
4973 AC_MSG_CHECKING([for mntctl function and struct vmount])
4974 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
4975 [AC_TRY_CPP([#include <fshelp.h>],
4976 fu_cv_sys_mounted_vmount=yes,
4977 fu_cv_sys_mounted_vmount=no)])
4978 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
4979 if test $fu_cv_sys_mounted_vmount = yes; then
4980 ac_list_mounted_fs=found
4981 AC_DEFINE(MOUNTED_VMOUNT, 1,
4982 [Define if there is a function named mntctl that can be used to read
4983 the list of mounted filesystems, and there is a system header file
4984 that declares `struct vmount.' (AIX)])
4988 if test -z "$ac_list_mounted_fs"; then
4990 AC_MSG_CHECKING([for FIXME existence of three headers])
4991 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
4993 #include <sys/statfs.h>
4994 #include <sys/fstyp.h>
4995 #include <mnttab.h>],
4996 fu_cv_sys_mounted_fread_fstyp=yes,
4997 fu_cv_sys_mounted_fread_fstyp=no)])
4998 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
4999 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
5000 ac_list_mounted_fs=found
5001 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
5002 [Define if (like SVR2) there is no specific function for reading the
5003 list of mounted filesystems, and your system has these header files:
5004 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
5008 if test -z "$ac_list_mounted_fs"; then
5009 # 4.4BSD and DEC OSF/1.
5010 AC_MSG_CHECKING([for getmntinfo function])
5011 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
5013 test "$ac_cv_func_getmntinfo" = yes \
5014 && fu_cv_sys_mounted_getmntinfo=yes \
5015 || fu_cv_sys_mounted_getmntinfo=no
5017 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
5018 if test $fu_cv_sys_mounted_getmntinfo = yes; then
5019 ac_list_mounted_fs=found
5020 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
5021 [Define if there is a function named getmntinfo for reading the
5022 list of mounted filesystems. (4.4BSD, Darwin)])
5026 if test -z "$ac_list_mounted_fs"; then
5028 AC_MSG_CHECKING([for getmnt function])
5029 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
5031 #include <sys/fs_types.h>
5032 #include <sys/mount.h>],
5033 fu_cv_sys_mounted_getmnt=yes,
5034 fu_cv_sys_mounted_getmnt=no)])
5035 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
5036 if test $fu_cv_sys_mounted_getmnt = yes; then
5037 ac_list_mounted_fs=found
5038 AC_DEFINE(MOUNTED_GETMNT, 1,
5039 [Define if there is a function named getmnt for reading the list of
5040 mounted filesystems. (Ultrix)])
5044 if test -z "$ac_list_mounted_fs"; then
5046 AC_CHECK_FUNCS(next_dev fs_stat_dev)
5047 AC_CHECK_HEADERS(fs_info.h)
5048 AC_MSG_CHECKING([for BEOS mounted file system support functions])
5049 if test $ac_cv_header_fs_info_h = yes \
5050 && test $ac_cv_func_next_dev = yes \
5051 && test $ac_cv_func_fs_stat_dev = yes; then
5056 AC_MSG_RESULT($fu_result)
5057 if test $fu_result = yes; then
5058 ac_list_mounted_fs=found
5059 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
5060 [Define if there are functions named next_dev and fs_stat_dev for
5061 reading the list of mounted filesystems. (BeOS)])
5065 if test -z "$ac_list_mounted_fs"; then
5067 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
5068 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
5069 [AC_TRY_CPP([#include <mnttab.h>],
5070 fu_cv_sys_mounted_fread=yes,
5071 fu_cv_sys_mounted_fread=no)])
5072 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
5073 if test $fu_cv_sys_mounted_fread = yes; then
5074 ac_list_mounted_fs=found
5075 AC_DEFINE(MOUNTED_FREAD, 1,
5076 [Define if there is no specific function for reading the list of
5077 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
5081 if test -z "$ac_list_mounted_fs"; then
5082 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
5083 # FIXME -- no need to abort building the whole package
5084 # Can't build mountlist.c or anything that needs its functions
5087 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
5093 dnl From Jim Meyering.
5095 dnl See if struct statfs has the f_fstypename member.
5096 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
5099 AC_DEFUN([jm_FSTYPENAME],
5101 AC_CACHE_CHECK([for f_fstypename in struct statfs],
5102 fu_cv_sys_f_fstypename_in_statfs,
5106 #include <sys/param.h>
5107 #include <sys/types.h>
5108 #include <sys/mount.h>
5110 [struct statfs s; int i = sizeof s.f_fstypename;],
5111 fu_cv_sys_f_fstypename_in_statfs=yes,
5112 fu_cv_sys_f_fstypename_in_statfs=no
5117 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
5118 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
5119 [Define if struct statfs has the f_fstypename member.])
5126 # From fileutils/configure.in
5128 # Try to determine how a program can obtain filesystem usage information.
5129 # If successful, define the appropriate symbol (see fsusage.c) and
5130 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
5132 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5134 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
5137 echo "checking how to get filesystem space usage..."
5140 # Perform only the link test since it seems there are no variants of the
5141 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
5142 # because that got a false positive on SCO OSR5. Adding the declaration
5143 # of a `struct statvfs' causes this test to fail (as it should) on such
5144 # systems. That system is reported to work fine with STAT_STATFS4 which
5145 # is what it gets when this test fails.
5146 if test $ac_fsusage_space = no; then
5148 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
5149 [AC_TRY_LINK([#include <sys/types.h>
5150 #include <sys/statvfs.h>],
5151 [struct statvfs fsd; statvfs (0, &fsd);],
5152 fu_cv_sys_stat_statvfs=yes,
5153 fu_cv_sys_stat_statvfs=no)])
5154 if test $fu_cv_sys_stat_statvfs = yes; then
5155 ac_fsusage_space=yes
5156 AC_DEFINE(STAT_STATVFS, 1,
5157 [ Define if there is a function named statvfs. (SVR4)])
5161 if test $ac_fsusage_space = no; then
5162 # DEC Alpha running OSF/1
5163 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
5164 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
5166 #include <sys/param.h>
5167 #include <sys/types.h>
5168 #include <sys/mount.h>
5173 exit (statfs (".", &fsd, sizeof (struct statfs)));
5175 fu_cv_sys_stat_statfs3_osf1=yes,
5176 fu_cv_sys_stat_statfs3_osf1=no,
5177 fu_cv_sys_stat_statfs3_osf1=no)])
5178 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
5179 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
5180 ac_fsusage_space=yes
5181 AC_DEFINE(STAT_STATFS3_OSF1, 1,
5182 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
5186 if test $ac_fsusage_space = no; then
5188 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
5189 member (AIX, 4.3BSD)])
5190 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
5192 #ifdef HAVE_SYS_PARAM_H
5193 #include <sys/param.h>
5195 #ifdef HAVE_SYS_MOUNT_H
5196 #include <sys/mount.h>
5198 #ifdef HAVE_SYS_VFS_H
5199 #include <sys/vfs.h>
5205 exit (statfs (".", &fsd));
5207 fu_cv_sys_stat_statfs2_bsize=yes,
5208 fu_cv_sys_stat_statfs2_bsize=no,
5209 fu_cv_sys_stat_statfs2_bsize=no)])
5210 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
5211 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
5212 ac_fsusage_space=yes
5213 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
5214 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
5215 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
5219 if test $ac_fsusage_space = no; then
5221 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
5222 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
5223 [AC_TRY_RUN([#include <sys/types.h>
5224 #include <sys/statfs.h>
5228 exit (statfs (".", &fsd, sizeof fsd, 0));
5230 fu_cv_sys_stat_statfs4=yes,
5231 fu_cv_sys_stat_statfs4=no,
5232 fu_cv_sys_stat_statfs4=no)])
5233 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
5234 if test $fu_cv_sys_stat_statfs4 = yes; then
5235 ac_fsusage_space=yes
5236 AC_DEFINE(STAT_STATFS4, 1,
5237 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
5241 if test $ac_fsusage_space = no; then
5243 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
5244 member (4.4BSD and NetBSD)])
5245 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
5246 [AC_TRY_RUN([#include <sys/types.h>
5247 #ifdef HAVE_SYS_PARAM_H
5248 #include <sys/param.h>
5250 #ifdef HAVE_SYS_MOUNT_H
5251 #include <sys/mount.h>
5257 exit (statfs (".", &fsd));
5259 fu_cv_sys_stat_statfs2_fsize=yes,
5260 fu_cv_sys_stat_statfs2_fsize=no,
5261 fu_cv_sys_stat_statfs2_fsize=no)])
5262 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
5263 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
5264 ac_fsusage_space=yes
5265 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
5266 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
5271 if test $ac_fsusage_space = no; then
5273 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
5274 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
5275 [AC_TRY_RUN([#include <sys/types.h>
5276 #ifdef HAVE_SYS_PARAM_H
5277 #include <sys/param.h>
5279 #ifdef HAVE_SYS_MOUNT_H
5280 #include <sys/mount.h>
5282 #ifdef HAVE_SYS_FS_TYPES_H
5283 #include <sys/fs_types.h>
5288 /* Ultrix's statfs returns 1 for success,
5289 0 for not mounted, -1 for failure. */
5290 exit (statfs (".", &fsd) != 1);
5292 fu_cv_sys_stat_fs_data=yes,
5293 fu_cv_sys_stat_fs_data=no,
5294 fu_cv_sys_stat_fs_data=no)])
5295 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
5296 if test $fu_cv_sys_stat_fs_data = yes; then
5297 ac_fsusage_space=yes
5298 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
5299 [ Define if statfs takes 2 args and the second argument has
5300 type struct fs_data. (Ultrix)])
5304 if test $ac_fsusage_space = no; then
5306 AC_TRY_CPP([#include <sys/filsys.h>
5308 AC_DEFINE(STAT_READ_FILSYS, 1,
5309 [Define if there is no specific function for reading filesystems usage
5310 information and you have the <sys/filsys.h> header file. (SVR2)])
5311 ac_fsusage_space=yes)
5314 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
5320 # Define some macros required for proper operation of code in lib/*.c
5321 # on MSDOS/Windows systems.
5323 # From Jim Meyering.
5325 AC_DEFUN([jm_AC_DOS],
5327 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
5330 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
5331 neither MSDOS nor Windows
5333 [ac_cv_win_or_dos=yes],
5334 [ac_cv_win_or_dos=no])
5337 if test x"$ac_cv_win_or_dos" = xyes; then
5338 ac_fs_accepts_drive_letter_prefix=1
5339 ac_fs_backslash_is_file_name_separator=1
5341 ac_fs_accepts_drive_letter_prefix=0
5342 ac_fs_backslash_is_file_name_separator=0
5345 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
5346 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
5347 # define FILESYSTEM_PREFIX_LEN(Filename) \
5348 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
5350 # define FILESYSTEM_PREFIX_LEN(Filename) 0
5353 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
5354 $ac_fs_accepts_drive_letter_prefix,
5355 [Define on systems for which file names may have a so-called
5356 `drive letter' prefix, define this to compute the length of that
5357 prefix, including the colon.])
5359 AH_VERBATIM(ISSLASH,
5360 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
5361 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
5363 # define ISSLASH(C) ((C) == '/')
5366 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
5367 $ac_fs_backslash_is_file_name_separator,
5368 [Define if the backslash character may also serve as a file name
5369 component separator.])
5374 dnl From Paul Eggert.
5376 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
5379 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
5380 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
5381 ac_cv_struct_st_mtim_nsec,
5382 [ac_save_CPPFLAGS="$CPPFLAGS"
5383 ac_cv_struct_st_mtim_nsec=no
5384 # tv_nsec -- the usual case
5385 # _tv_nsec -- Solaris 2.6, if
5386 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
5387 # && !defined __EXTENSIONS__)
5388 # st__tim.tv_nsec -- UnixWare 2.1.2
5389 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
5390 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
5391 AC_TRY_COMPILE([#include <sys/types.h>
5392 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
5393 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
5395 CPPFLAGS="$ac_save_CPPFLAGS"])
5397 if test $ac_cv_struct_st_mtim_nsec != no; then
5398 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
5399 [Define to be the nanoseconds member of struct stat's st_mtim,
5407 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
5409 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
5410 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
5411 [AC_TRY_COMPILE([#include <sys/types.h>
5412 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
5413 ac_cv_struct_st_dm_mode=yes,
5414 ac_cv_struct_st_dm_mode=no)])
5416 if test $ac_cv_struct_st_dm_mode = yes; then
5417 AC_DEFINE(HAVE_ST_DM_MODE, 1,
5418 [Define if struct stat has an st_dm_mode member. ])
5425 dnl From Jim Meyering
5427 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
5428 dnl in time.h or sys/time.h.
5430 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
5432 AC_REQUIRE([AC_HEADER_TIME])
5433 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
5436 # if TIME_WITH_SYS_TIME
5437 # include <sys/time.h>
5440 # if HAVE_SYS_TIME_H
5441 # include <sys/time.h>
5447 [static struct timespec x; x.tv_sec = x.tv_nsec;],
5448 fu_cv_sys_struct_timespec=yes,
5449 fu_cv_sys_struct_timespec=no)
5452 if test $fu_cv_sys_struct_timespec = yes; then
5453 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
5454 [Define if struct timespec is declared in <time.h>. ])
5458 # Helper functions for option handling. -*- Autoconf -*-
5460 # Copyright 2002 Free Software Foundation, Inc.
5462 # This program is free software; you can redistribute it and/or modify
5463 # it under the terms of the GNU General Public License as published by
5464 # the Free Software Foundation; either version 2, or (at your option)
5465 # any later version.
5467 # This program is distributed in the hope that it will be useful,
5468 # but WITHOUT ANY WARRANTY; without even the implied warranty of
5469 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5470 # GNU General Public License for more details.
5472 # You should have received a copy of the GNU General Public License
5473 # along with this program; if not, write to the Free Software
5474 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
5479 # Obsolete Automake macros.
5481 # We put here only the macros whose substitution is not an Automake
5482 # macro; otherwise including this file would trigger dependencies for
5483 # all the subsitutions. Generally, obsolete Automake macros are
5484 # better AU_DEFUNed in the same file as their replacement, or alone in
5485 # a separate file (see obsol-gt.m4 or obsol-lt.m4 for instance).
5487 AU_DEFUN([AC_FEATURE_CTYPE], [AC_HEADER_STDC])
5488 AU_DEFUN([AC_FEATURE_ERRNO], [AC_REPLACE_FUNCS([strerror])])
5489 AU_DEFUN([AM_CYGWIN32], [AC_CYGWIN])
5490 AU_DEFUN([AM_EXEEXT], [AC_EXEEXT])
5491 AU_DEFUN([AM_FUNC_MKTIME], [AC_FUNC_MKTIME])
5492 AU_DEFUN([AM_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
5493 [AC_HEADER_TIOCGWINSZ])
5494 AU_DEFUN([AM_MINGW32], [AC_MINGW32])
5495 AU_DEFUN([AM_PROG_INSTALL], [AC_PROG_INSTALL])
5496 AU_DEFUN([AM_SANITY_CHECK_CC], [AC_PROG_CC])
5497 AU_DEFUN([AM_SYS_POSIX_TERMIOS], [AC_SYS_POSIX_TERMIOS])
5498 AU_DEFUN([fp_FUNC_FNMATCH], [AC_FUNC_FNMATCH])
5499 AU_DEFUN([fp_PROG_INSTALL], [AC_PROG_INSTALL])
5500 AU_DEFUN([md_TYPE_PTRDIFF_T], [AC_CHECK_TYPES([ptrdiff_t])])
5502 # Don't know how to translate these.
5503 # If used, Autoconf will complain that they are possibly unexpended;
5504 # this seems a good enough error message.
5509 dnl From Jim Meyering and Paul Eggert.
5510 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
5511 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5512 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
5513 jm_cv_sys_tiocgwinsz_needs_termios_h,
5514 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
5516 if test $am_cv_sys_posix_termios = yes; then
5518 [#include <sys/types.h>
5519 # include <termios.h>
5523 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
5528 AC_DEFUN([jm_WINSIZE_IN_PTEM],
5529 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5530 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
5531 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
5532 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
5533 if test $am_cv_sys_posix_termios = yes; then
5534 AC_TRY_COMPILE([#include <termios.h>]
5535 [struct winsize x;],
5536 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5538 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5539 AC_TRY_COMPILE([#include <sys/ptem.h>],
5540 [struct winsize x;],
5541 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5543 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5544 AC_DEFINE([WINSIZE_IN_PTEM], 1,
5545 [Define if sys/ptem.h is required for struct winsize.])
5548 # Determine whether this system has infrastructure for obtaining the boot time.
5550 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5551 * ----------------------------------------------------------
5552 AC_DEFUN([GNULIB_BOOT_TIME],
5554 AC_CHECK_FUNCS(sysctl)
5555 AC_CHECK_HEADERS(sys/sysctl.h)
5557 [whether we can get the system boot time],
5558 [gnulib_cv_have_boot_time],
5562 [AC_INCLUDES_DEFAULT
5563 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
5564 # include <sys/param.h> /* needed for OpenBSD 3.0 */
5565 # include <sys/sysctl.h>
5574 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
5575 /* your system *does* have the infrastructure to determine boot time */
5577 please_tell_us_how_to_determine_boot_time_on_your_system
5580 gnulib_cv_have_boot_time=yes,
5581 gnulib_cv_have_boot_time=no)
5583 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
5588 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
5589 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
5590 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
5591 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
5592 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
5594 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
5596 [#include <sys/types.h>
5597 # include <sys/ioctl.h>
5601 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
5604 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
5605 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
5606 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
5612 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
5614 AC_DEFUN([jm_LIB_CHECK],
5617 # Check for libypsec.a on Dolphin M88K machines.
5618 AC_CHECK_LIB(ypsec, main)
5620 # m88k running dgux 5.4 needs this
5621 AC_CHECK_LIB(ldgc, main)
5623 # Some programs need to link with -lm. printf does if it uses
5624 # lib/strtod.c which uses pow. And seq uses the math functions,
5625 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
5627 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
5628 # Check for these math functions used by seq.
5629 ac_su_saved_lib="$LIBS"
5631 AC_CHECK_FUNCS(floor modf rint)
5632 LIBS="$ac_su_saved_lib"
5635 AC_CHECK_FUNCS(sqrt)
5636 if test $ac_cv_func_sqrt = no; then
5637 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
5640 AC_SUBST(FESETROUND_LIBM)
5641 AC_CHECK_FUNCS(fesetround)
5642 if test $ac_cv_func_fesetround = no; then
5643 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
5646 # The -lsun library is required for YP support on Irix-4.0.5 systems.
5647 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
5648 AC_SEARCH_LIBS(yp_match, [sun ypsec])
5650 # SysV needs -lsec, older versions of Linux need -lshadow for
5651 # shadow passwords. UnixWare 7 needs -lgen.
5652 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
5654 AC_CHECK_HEADERS(shadow.h)
5656 # Requirements for su.c.
5658 $ac_includes_default
5660 # include <shadow.h>
5663 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
5664 AC_CHECK_FUNCS(getspnam)
5666 # SCO-ODT-3.0 is reported to need -lufc for crypt.
5667 # NetBSD needs -lcrypt for crypt.
5668 ac_su_saved_lib="$LIBS"
5669 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
5670 LIBS="$ac_su_saved_lib"
5674 # gettext.m4 serial 15 (gettext-0.11.3)
5675 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5676 dnl This file is free software, distributed under the terms of the GNU
5677 dnl General Public License. As a special exception to the GNU General
5678 dnl Public License, this file may be distributed as part of a program
5679 dnl that contains a configuration script generated by Autoconf, under
5680 dnl the same distribution terms as the rest of that program.
5682 dnl This file can can be used in projects which are not available under
5683 dnl the GNU General Public License or the GNU Library General Public
5684 dnl License but which still want to provide support for the GNU gettext
5686 dnl Please note that the actual code of the GNU gettext library is covered
5687 dnl by the GNU Library General Public License, and the rest of the GNU
5688 dnl gettext package package is covered by the GNU General Public License.
5689 dnl They are *not* in the public domain.
5692 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5693 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5695 dnl Macro to add for using GNU gettext.
5697 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5698 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5699 dnl default (if it is not specified or empty) is 'no-libtool'.
5700 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
5701 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5702 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
5703 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
5704 dnl depending on --{enable,disable}-{shared,static} and on the presence of
5705 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
5706 dnl $(top_builddir)/intl/libintl.a will be created.
5707 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
5708 dnl implementations (in libc or libintl) without the ngettext() function
5709 dnl will be ignored.
5710 dnl INTLDIR is used to find the intl libraries. If empty,
5711 dnl the value `$(top_builddir)/intl/' is used.
5713 dnl The result of the configuration is one of three cases:
5714 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
5716 dnl Catalog format: GNU --> install in $(datadir)
5717 dnl Catalog extension: .mo after installation, .gmo in source tree
5718 dnl 2) GNU gettext has been found in the system's C library.
5719 dnl Catalog format: GNU --> install in $(datadir)
5720 dnl Catalog extension: .mo after installation, .gmo in source tree
5721 dnl 3) No internationalization, always use English msgid.
5722 dnl Catalog format: none
5723 dnl Catalog extension: none
5724 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
5725 dnl The use of .gmo is historical (it was needed to avoid overwriting the
5726 dnl GNU format catalogs when building on a platform with an X/Open gettext),
5727 dnl but we keep it in order not to force irrelevant filename changes on the
5730 AC_DEFUN([AM_GNU_GETTEXT],
5732 dnl Argument checking.
5733 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5734 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5736 ifelse([$2], [], , [ifelse([$2], [need-ngettext], ,
5737 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5739 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5740 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5742 AC_REQUIRE([AM_PO_SUBDIRS])dnl
5743 ifelse(gt_included_intl, yes, [
5744 AC_REQUIRE([AM_INTL_SUBDIR])dnl
5747 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5748 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5749 AC_REQUIRE([AC_LIB_RPATH])
5751 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5752 dnl Ideally we would do this search only after the
5753 dnl if test "$USE_NLS" = "yes"; then
5754 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5755 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5756 dnl the configure script would need to contain the same shell code
5757 dnl again, outside any 'if'. There are two solutions:
5758 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5759 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5760 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5761 dnl documented, we avoid it.
5762 ifelse(gt_included_intl, yes, , [
5763 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5766 AC_MSG_CHECKING([whether NLS is requested])
5767 dnl Default is enabled NLS
5769 [ --disable-nls do not use Native Language Support],
5770 USE_NLS=$enableval, USE_NLS=yes)
5771 AC_MSG_RESULT($USE_NLS)
5774 ifelse(gt_included_intl, yes, [
5775 BUILD_INCLUDED_LIBINTL=no
5776 USE_INCLUDED_LIBINTL=no
5782 dnl If we use NLS figure out what method
5783 if test "$USE_NLS" = "yes"; then
5784 gt_use_preinstalled_gnugettext=no
5785 ifelse(gt_included_intl, yes, [
5786 AC_MSG_CHECKING([whether included gettext is requested])
5787 AC_ARG_WITH(included-gettext,
5788 [ --with-included-gettext use the GNU gettext library included here],
5789 nls_cv_force_use_gnu_gettext=$withval,
5790 nls_cv_force_use_gnu_gettext=no)
5791 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
5793 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5794 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5796 dnl User does not insist on using GNU NLS library. Figure out what
5797 dnl to use. If GNU gettext is available we use this. Else we have
5798 dnl to fall back to GNU NLS library.
5800 dnl Add a version number to the cache macros.
5801 define([gt_api_version], ifelse([$2], [need-ngettext], 2, 1))
5802 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5803 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
5805 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5806 [AC_TRY_LINK([#include <libintl.h>
5807 extern int _nl_msg_cat_cntr;
5808 extern int *_nl_domain_bindings;],
5809 [bindtextdomain ("", "");
5810 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5811 gt_cv_func_gnugettext_libc=yes,
5812 gt_cv_func_gnugettext_libc=no)])
5814 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5815 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5816 ifelse(gt_included_intl, yes, , [
5819 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5820 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5821 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5822 dnl even if libiconv doesn't exist.
5823 AC_LIB_LINKFLAGS_BODY([intl])
5824 AC_CACHE_CHECK([for GNU gettext in libintl],
5825 gt_cv_func_gnugettext_libintl,
5826 [gt_save_CPPFLAGS="$CPPFLAGS"
5827 CPPFLAGS="$CPPFLAGS $INCINTL"
5828 gt_save_LIBS="$LIBS"
5829 LIBS="$LIBS $LIBINTL"
5830 dnl Now see whether libintl exists and does not depend on libiconv.
5831 AC_TRY_LINK([#include <libintl.h>
5832 extern int _nl_msg_cat_cntr;
5837 const char *_nl_expand_alias ();],
5838 [bindtextdomain ("", "");
5839 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5840 gt_cv_func_gnugettext_libintl=yes,
5841 gt_cv_func_gnugettext_libintl=no)
5842 dnl Now see whether libintl exists and depends on libiconv.
5843 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5844 LIBS="$LIBS $LIBICONV"
5845 AC_TRY_LINK([#include <libintl.h>
5846 extern int _nl_msg_cat_cntr;
5851 const char *_nl_expand_alias ();],
5852 [bindtextdomain ("", "");
5853 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5854 [LIBINTL="$LIBINTL $LIBICONV"
5855 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
5856 gt_cv_func_gnugettext_libintl=yes
5859 CPPFLAGS="$gt_save_CPPFLAGS"
5860 LIBS="$gt_save_LIBS"])
5863 dnl If an already present or preinstalled GNU gettext() is found,
5864 dnl use it. But if this macro is used in GNU gettext, and GNU
5865 dnl gettext is already preinstalled in libintl, we update this
5866 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
5867 if test "$gt_cv_func_gnugettext_libc" = "yes" \
5868 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
5869 && test "$PACKAGE" != gettext; }; then
5870 gt_use_preinstalled_gnugettext=yes
5872 dnl Reset the values set by searching for libintl.
5878 ifelse(gt_included_intl, yes, [
5879 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
5880 dnl GNU gettext is not found in the C library.
5881 dnl Fall back on included GNU gettext library.
5882 nls_cv_use_gnu_gettext=yes
5886 if test "$nls_cv_use_gnu_gettext" = "yes"; then
5887 dnl Mark actions used to generate GNU NLS library.
5888 INTLOBJS="\$(GETTOBJS)"
5889 BUILD_INCLUDED_LIBINTL=yes
5890 USE_INCLUDED_LIBINTL=yes
5891 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
5892 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
5893 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
5896 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5897 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5898 dnl Mark actions to use GNU gettext tools.
5903 if test "$gt_use_preinstalled_gnugettext" = "yes" \
5904 || test "$nls_cv_use_gnu_gettext" = "yes"; then
5905 AC_DEFINE(ENABLE_NLS, 1,
5906 [Define to 1 if translation of program messages to the user's native language
5913 if test "$USE_NLS" = "yes"; then
5915 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
5916 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
5917 AC_MSG_CHECKING([how to link with libintl])
5918 AC_MSG_RESULT([$LIBINTL])
5919 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
5922 dnl For backward compatibility. Some packages may be using this.
5923 AC_DEFINE(HAVE_GETTEXT, 1,
5924 [Define if the GNU gettext() function is already present or preinstalled.])
5925 AC_DEFINE(HAVE_DCGETTEXT, 1,
5926 [Define if the GNU dcgettext() function is already present or preinstalled.])
5929 dnl We need to process the po/ directory.
5933 ifelse(gt_included_intl, yes, [
5934 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
5935 dnl to 'yes' because some of the testsuite requires it.
5936 if test "$PACKAGE" = gettext; then
5937 BUILD_INCLUDED_LIBINTL=yes
5940 dnl Make all variables we use known to autoconf.
5941 AC_SUBST(BUILD_INCLUDED_LIBINTL)
5942 AC_SUBST(USE_INCLUDED_LIBINTL)
5946 dnl For backward compatibility. Some configure.ins may be using this.
5948 nls_cv_header_libgt=
5950 dnl For backward compatibility. Some Makefiles may be using this.
5952 AC_SUBST(DATADIRNAME)
5954 dnl For backward compatibility. Some Makefiles may be using this.
5956 AC_SUBST(INSTOBJEXT)
5958 dnl For backward compatibility. Some Makefiles may be using this.
5962 dnl Enable libtool support if the surrounding package wishes it.
5963 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
5964 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
5967 dnl For backward compatibility. Some Makefiles may be using this.
5971 dnl Make all documented variables known to autoconf.
5978 dnl Checks for all prerequisites of the po subdirectory,
5979 dnl except for USE_NLS.
5980 AC_DEFUN([AM_PO_SUBDIRS],
5982 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
5983 AC_REQUIRE([AC_PROG_INSTALL])dnl
5984 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
5986 dnl Perform the following tests also if --disable-nls has been given,
5987 dnl because they are needed for "make dist" to work.
5989 dnl Search for GNU msgfmt in the PATH.
5990 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
5991 dnl The second test excludes FreeBSD msgfmt.
5992 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
5993 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
5994 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
5996 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
5998 dnl Search for GNU xgettext 0.11 or newer in the PATH.
5999 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
6000 dnl The second test excludes FreeBSD xgettext.
6001 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6002 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6003 (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)],
6005 dnl Remove leftover from FreeBSD xgettext call.
6008 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
6009 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
6010 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
6012 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6013 dnl Test whether we really found GNU msgfmt.
6014 if test "$GMSGFMT" != ":"; then
6015 dnl If it is no GNU msgfmt we define it as : so that the
6016 dnl Makefiles still can work.
6017 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
6018 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6021 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
6023 [found $GMSGFMT program is not GNU msgfmt; ignore it])
6028 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6029 dnl Test whether we really found GNU xgettext.
6030 if test "$XGETTEXT" != ":"; then
6031 dnl If it is no GNU xgettext we define it as : so that the
6032 dnl Makefiles still can work.
6033 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6034 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6038 [found xgettext program is not GNU xgettext; ignore it])
6041 dnl Remove leftover from FreeBSD xgettext call.
6045 AC_OUTPUT_COMMANDS([
6046 for ac_file in $CONFIG_FILES; do
6047 # Support "outfile[:infile[:infile...]]"
6049 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6051 # PO directories have a Makefile.in generated from Makefile.in.in.
6052 case "$ac_file" in */Makefile.in)
6053 # Adjust a relative srcdir.
6054 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
6055 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
6056 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
6057 # In autoconf-2.13 it is called $ac_given_srcdir.
6058 # In autoconf-2.50 it is called $srcdir.
6059 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
6060 case "$ac_given_srcdir" in
6061 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
6062 /*) top_srcdir="$ac_given_srcdir" ;;
6063 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
6065 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
6066 rm -f "$ac_dir/POTFILES"
6067 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
6068 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
6069 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
6070 # on $ac_dir but don't depend on user-specified configuration
6072 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
6073 # The LINGUAS file contains the set of available languages.
6074 if test -n "$ALL_LINGUAS"; then
6075 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
6077 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
6078 # Hide the ALL_LINGUAS assigment from automake.
6079 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
6081 case "$ac_given_srcdir" in
6083 *) srcdirpre='$(srcdir)/' ;;
6089 for lang in $ALL_LINGUAS; do
6090 POFILES="$POFILES $srcdirpre$lang.po"
6091 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
6092 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
6093 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
6095 # CATALOGS depends on both $ac_dir and the user's LINGUAS
6096 # environment variable.
6098 if test -n "$ALL_LINGUAS"; then
6099 for presentlang in $ALL_LINGUAS; do
6101 if test "%UNSET%" != "$LINGUAS"; then
6102 desiredlanguages="$LINGUAS"
6104 desiredlanguages="$ALL_LINGUAS"
6106 for desiredlang in $desiredlanguages; do
6107 # Use the presentlang catalog if desiredlang is
6108 # a. equal to presentlang, or
6109 # b. a variant of presentlang (because in this case,
6110 # presentlang can be used as a fallback for messages
6111 # which are not translated in the desiredlang catalog).
6112 case "$desiredlang" in
6113 "$presentlang"*) useit=yes;;
6116 if test $useit = yes; then
6117 INST_LINGUAS="$INST_LINGUAS $presentlang"
6122 if test -n "$INST_LINGUAS"; then
6123 for lang in $INST_LINGUAS; do
6124 CATALOGS="$CATALOGS $lang.gmo"
6127 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
6128 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"
6129 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
6130 if test -f "$f"; then
6132 *.orig | *.bak | *~) ;;
6133 *) cat "$f" >> "$ac_dir/Makefile" ;;
6141 [# Capture the value of obsolete $ALL_LINGUAS because we need it to compute
6142 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
6144 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
6145 # Capture the value of LINGUAS because we need it to compute CATALOGS.
6146 LINGUAS="${LINGUAS-%UNSET%}"
6151 dnl Checks for all prerequisites of the intl subdirectory,
6152 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
6153 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
6154 AC_DEFUN([AM_INTL_SUBDIR],
6156 AC_REQUIRE([AC_PROG_INSTALL])dnl
6157 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6158 AC_REQUIRE([AC_PROG_CC])dnl
6159 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6160 AC_REQUIRE([AC_PROG_RANLIB])dnl
6161 AC_REQUIRE([AC_ISC_POSIX])dnl
6162 AC_REQUIRE([AC_HEADER_STDC])dnl
6163 AC_REQUIRE([AC_C_CONST])dnl
6164 AC_REQUIRE([AC_C_INLINE])dnl
6165 AC_REQUIRE([AC_TYPE_OFF_T])dnl
6166 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
6167 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
6168 AC_REQUIRE([AC_FUNC_MMAP])dnl
6169 AC_REQUIRE([jm_GLIBC21])dnl
6170 AC_REQUIRE([gt_INTDIV0])dnl
6172 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
6173 stdlib.h string.h unistd.h sys/param.h])
6174 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
6175 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
6176 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
6180 if test $ac_cv_header_locale_h = yes; then
6184 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
6185 dnl because plural.y uses bison specific features. It requires at least
6186 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
6188 dnl bison is only needed for the maintainer (who touches plural.y). But in
6189 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
6190 dnl the rule in general Makefile. Now, some people carelessly touch the
6191 dnl files or have a broken "make" program, hence the plural.c rule will
6192 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
6193 dnl present or too old.
6194 AC_CHECK_PROGS([INTLBISON], [bison])
6195 if test -z "$INTLBISON"; then
6198 dnl Found it, now check the version.
6199 AC_MSG_CHECKING([version of bison])
6200 changequote(<<,>>)dnl
6201 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6202 case $ac_prog_version in
6203 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6204 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6206 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6207 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6209 AC_MSG_RESULT([$ac_prog_version])
6211 if test $ac_verc_fail = yes; then
6217 AC_DEFUN([AM_MKINSTALLDIRS],
6219 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
6220 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
6221 dnl Try to locate is.
6223 if test -n "$ac_aux_dir"; then
6224 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6226 if test -z "$MKINSTALLDIRS"; then
6227 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6229 AC_SUBST(MKINSTALLDIRS)
6232 # progtest.m4 serial 2 (gettext-0.10.40)
6233 dnl Copyright (C) 1996-2002 Free Software Foundation, Inc.
6234 dnl This file is free software, distributed under the terms of the GNU
6235 dnl General Public License. As a special exception to the GNU General
6236 dnl Public License, this file may be distributed as part of a program
6237 dnl that contains a configuration script generated by Autoconf, under
6238 dnl the same distribution terms as the rest of that program.
6240 dnl This file can can be used in projects which are not available under
6241 dnl the GNU General Public License or the GNU Library General Public
6242 dnl License but which still want to provide support for the GNU gettext
6244 dnl Please note that the actual code of the GNU gettext library is covered
6245 dnl by the GNU Library General Public License, and the rest of the GNU
6246 dnl gettext package package is covered by the GNU General Public License.
6247 dnl They are *not* in the public domain.
6250 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
6252 # Search path for a program which passes the given test.
6254 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
6255 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
6256 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
6257 [# Extract the first word of "$2", so it can be a program name with args.
6258 set dummy $2; ac_word=[$]2
6259 AC_MSG_CHECKING([for $ac_word])
6260 AC_CACHE_VAL(ac_cv_path_$1,
6263 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
6266 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6267 for ac_dir in ifelse([$5], , $PATH, [$5]); do
6268 test -z "$ac_dir" && ac_dir=.
6269 if test -f $ac_dir/$ac_word; then
6271 ac_cv_path_$1="$ac_dir/$ac_word"
6277 dnl If no 4th arg is given, leave the cache variable unset,
6278 dnl so AC_PATH_PROGS will keep looking.
6279 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
6284 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
6285 AC_MSG_RESULT([$]$1)
6292 # intdiv0.m4 serial 1 (gettext-0.11.3)
6293 dnl Copyright (C) 2002 Free Software Foundation, Inc.
6294 dnl This file is free software, distributed under the terms of the GNU
6295 dnl General Public License. As a special exception to the GNU General
6296 dnl Public License, this file may be distributed as part of a program
6297 dnl that contains a configuration script generated by Autoconf, under
6298 dnl the same distribution terms as the rest of that program.
6300 dnl From Bruno Haible.
6302 AC_DEFUN([gt_INTDIV0],
6304 AC_REQUIRE([AC_PROG_CC])dnl
6305 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6307 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
6308 gt_cv_int_divbyzero_sigfpe,
6316 sigfpe_handler (int sig)
6318 sigfpe_handler (sig) int sig;
6321 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
6322 exit (sig != SIGFPE);
6332 signal (SIGFPE, sigfpe_handler);
6333 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
6334 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
6335 signal (SIGTRAP, sigfpe_handler);
6337 /* Linux/SPARC yields signal SIGILL. */
6338 #if defined (__sparc__) && defined (__linux__)
6339 signal (SIGILL, sigfpe_handler);
6346 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
6348 # Guess based on the CPU.
6350 alpha* | i[34567]86 | m68k | s390*)
6351 gt_cv_int_divbyzero_sigfpe="guessing yes";;
6353 gt_cv_int_divbyzero_sigfpe="guessing no";;
6357 case "$gt_cv_int_divbyzero_sigfpe" in
6361 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
6362 [Define if integer division by zero raises signal SIGFPE.])
6365 # lcmessage.m4 serial 3 (gettext-0.11.3)
6366 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6367 dnl This file is free software, distributed under the terms of the GNU
6368 dnl General Public License. As a special exception to the GNU General
6369 dnl Public License, this file may be distributed as part of a program
6370 dnl that contains a configuration script generated by Autoconf, under
6371 dnl the same distribution terms as the rest of that program.
6373 dnl This file can can be used in projects which are not available under
6374 dnl the GNU General Public License or the GNU Library General Public
6375 dnl License but which still want to provide support for the GNU gettext
6377 dnl Please note that the actual code of the GNU gettext library is covered
6378 dnl by the GNU Library General Public License, and the rest of the GNU
6379 dnl gettext package package is covered by the GNU General Public License.
6380 dnl They are *not* in the public domain.
6383 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
6385 # Check whether LC_MESSAGES is available in <locale.h>.
6387 AC_DEFUN([AM_LC_MESSAGES],
6389 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6390 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
6391 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
6392 if test $am_cv_val_LC_MESSAGES = yes; then
6393 AC_DEFINE(HAVE_LC_MESSAGES, 1,
6394 [Define if your <locale.h> file defines LC_MESSAGES.])