1 # generated automatically by aclocal 1.7.4 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
4 # Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # Do all the work for Automake. -*- Autoconf -*-
16 # This macro actually does too much some checks are only needed if
17 # your package does certain things. But this isn't really a big deal.
19 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
20 # Free Software Foundation, Inc.
22 # This program is free software; you can redistribute it and/or modify
23 # it under the terms of the GNU General Public License as published by
24 # the Free Software Foundation; either version 2, or (at your option)
27 # This program is distributed in the hope that it will be useful,
28 # but WITHOUT ANY WARRANTY; without even the implied warranty of
29 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30 # GNU General Public License for more details.
32 # You should have received a copy of the GNU General Public License
33 # along with this program; if not, write to the Free Software
34 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
41 # Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
42 # the ones we care about.
43 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
45 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
46 # AM_INIT_AUTOMAKE([OPTIONS])
47 # -----------------------------------------------
48 # The call with PACKAGE and VERSION arguments is the old style
49 # call (pre autoconf-2.50), which is being phased out. PACKAGE
50 # and VERSION should now be passed to AC_INIT and removed from
51 # the call to AM_INIT_AUTOMAKE.
52 # We support both call styles for the transition. After
53 # the next Automake release, Autoconf can make the AC_INIT
54 # arguments mandatory, and then we can depend on a new Autoconf
55 # release and drop the old call support.
56 AC_DEFUN([AM_INIT_AUTOMAKE],
57 [AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
58 AC_REQUIRE([AC_PROG_INSTALL])dnl
59 # test to see if srcdir already configured
60 if test "`cd $srcdir && pwd`" != "`pwd`" &&
61 test -f $srcdir/config.status; then
62 AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
65 # test whether we have cygpath
66 if test -z "$CYGPATH_W"; then
67 if (cygpath --version) >/dev/null 2>/dev/null; then
68 CYGPATH_W='cygpath -w'
75 # Define the identity of the package.
76 dnl Distinguish between old-style and new-style calls.
78 [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
79 AC_SUBST([PACKAGE], [$1])dnl
80 AC_SUBST([VERSION], [$2])],
81 [_AM_SET_OPTIONS([$1])dnl
82 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
83 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
85 _AM_IF_OPTION([no-define],,
86 [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
87 AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
89 # Some tools Automake needs.
90 AC_REQUIRE([AM_SANITY_CHECK])dnl
91 AC_REQUIRE([AC_ARG_PROGRAM])dnl
92 AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
93 AM_MISSING_PROG(AUTOCONF, autoconf)
94 AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
95 AM_MISSING_PROG(AUTOHEADER, autoheader)
96 AM_MISSING_PROG(MAKEINFO, makeinfo)
97 AM_MISSING_PROG(AMTAR, tar)
100 # We need awk for the "check" target. The system "awk" is bad on
102 AC_REQUIRE([AC_PROG_AWK])dnl
103 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
104 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
106 _AM_IF_OPTION([no-dependencies],,
107 [AC_PROVIDE_IFELSE([AC_PROG_CC],
108 [_AM_DEPENDENCIES(CC)],
109 [define([AC_PROG_CC],
110 defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
111 AC_PROVIDE_IFELSE([AC_PROG_CXX],
112 [_AM_DEPENDENCIES(CXX)],
113 [define([AC_PROG_CXX],
114 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
119 # When config.status generates a header, we must update the stamp-h file.
120 # This file resides in the same directory as the config header
121 # that is generated. The stamp files are numbered to have different names.
123 # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
124 # loop where config.status creates the headers, so we can generate
125 # our stamp files there.
126 AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
127 [# Compute $1's index in $config_headers.
129 for _am_header in $config_headers :; do
134 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
137 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
139 # Copyright 2002 Free Software Foundation, Inc.
141 # This program is free software; you can redistribute it and/or modify
142 # it under the terms of the GNU General Public License as published by
143 # the Free Software Foundation; either version 2, or (at your option)
146 # This program is distributed in the hope that it will be useful,
147 # but WITHOUT ANY WARRANTY; without even the implied warranty of
148 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 # GNU General Public License for more details.
151 # You should have received a copy of the GNU General Public License
152 # along with this program; if not, write to the Free Software
153 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
155 # AM_AUTOMAKE_VERSION(VERSION)
156 # ----------------------------
157 # Automake X.Y traces this macro to ensure aclocal.m4 has been
158 # generated from the m4 files accompanying Automake X.Y.
159 AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
161 # AM_SET_CURRENT_AUTOMAKE_VERSION
162 # -------------------------------
163 # Call AM_AUTOMAKE_VERSION so it can be traced.
164 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
165 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
166 [AM_AUTOMAKE_VERSION([1.7.4])])
168 # Helper functions for option handling. -*- Autoconf -*-
170 # Copyright 2001, 2002 Free Software Foundation, Inc.
172 # This program is free software; you can redistribute it and/or modify
173 # it under the terms of the GNU General Public License as published by
174 # the Free Software Foundation; either version 2, or (at your option)
177 # This program is distributed in the hope that it will be useful,
178 # but WITHOUT ANY WARRANTY; without even the implied warranty of
179 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180 # GNU General Public License for more details.
182 # You should have received a copy of the GNU General Public License
183 # along with this program; if not, write to the Free Software
184 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
189 # _AM_MANGLE_OPTION(NAME)
190 # -----------------------
191 AC_DEFUN([_AM_MANGLE_OPTION],
192 [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
194 # _AM_SET_OPTION(NAME)
195 # ------------------------------
196 # Set option NAME. Presently that only means defining a flag for this option.
197 AC_DEFUN([_AM_SET_OPTION],
198 [m4_define(_AM_MANGLE_OPTION([$1]), 1)])
200 # _AM_SET_OPTIONS(OPTIONS)
201 # ----------------------------------
202 # OPTIONS is a space-separated list of Automake options.
203 AC_DEFUN([_AM_SET_OPTIONS],
204 [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
206 # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
207 # -------------------------------------------
208 # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
209 AC_DEFUN([_AM_IF_OPTION],
210 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
213 # Check to make sure that the build environment is sane.
216 # Copyright 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
218 # This program is free software; you can redistribute it and/or modify
219 # it under the terms of the GNU General Public License as published by
220 # the Free Software Foundation; either version 2, or (at your option)
223 # This program is distributed in the hope that it will be useful,
224 # but WITHOUT ANY WARRANTY; without even the implied warranty of
225 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
226 # GNU General Public License for more details.
228 # You should have received a copy of the GNU General Public License
229 # along with this program; if not, write to the Free Software
230 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
237 AC_DEFUN([AM_SANITY_CHECK],
238 [AC_MSG_CHECKING([whether build environment is sane])
241 echo timestamp > conftest.file
242 # Do `set' in a subshell so we don't clobber the current shell's
243 # arguments. Must try -L first in case configure is actually a
244 # symlink; some systems play weird games with the mod time of symlinks
245 # (eg FreeBSD returns the mod time of the symlink's containing
248 set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
249 if test "$[*]" = "X"; then
251 set X `ls -t $srcdir/configure conftest.file`
254 if test "$[*]" != "X $srcdir/configure conftest.file" \
255 && test "$[*]" != "X conftest.file $srcdir/configure"; then
257 # If neither matched, then we have a broken ls. This can happen
258 # if, for instance, CONFIG_SHELL is bash and it inherits a
259 # broken ls alias from the environment. This has actually
260 # happened. Such a system could not be considered "sane".
261 AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
262 alias in your environment])
265 test "$[2]" = conftest.file
271 AC_MSG_ERROR([newly created file is older than distributed files!
272 Check your system clock])
279 # Copyright 1997, 1999, 2000, 2001 Free Software Foundation, Inc.
281 # This program is free software; you can redistribute it and/or modify
282 # it under the terms of the GNU General Public License as published by
283 # the Free Software Foundation; either version 2, or (at your option)
286 # This program is distributed in the hope that it will be useful,
287 # but WITHOUT ANY WARRANTY; without even the implied warranty of
288 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
289 # GNU General Public License for more details.
291 # You should have received a copy of the GNU General Public License
292 # along with this program; if not, write to the Free Software
293 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
298 # AM_MISSING_PROG(NAME, PROGRAM)
299 # ------------------------------
300 AC_DEFUN([AM_MISSING_PROG],
301 [AC_REQUIRE([AM_MISSING_HAS_RUN])
302 $1=${$1-"${am_missing_run}$2"}
308 # Define MISSING if not defined so far and test if it supports --run.
309 # If it does, set am_missing_run to use it, otherwise, to nothing.
310 AC_DEFUN([AM_MISSING_HAS_RUN],
311 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
312 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
313 # Use eval to expand $SHELL
314 if eval "$MISSING --run true"; then
315 am_missing_run="$MISSING --run "
318 AC_MSG_WARN([`missing' script is too old or missing])
324 # Copyright 2001 Free Software Foundation, Inc.
326 # This program is free software; you can redistribute it and/or modify
327 # it under the terms of the GNU General Public License as published by
328 # the Free Software Foundation; either version 2, or (at your option)
331 # This program is distributed in the hope that it will be useful,
332 # but WITHOUT ANY WARRANTY; without even the implied warranty of
333 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
334 # GNU General Public License for more details.
336 # You should have received a copy of the GNU General Public License
337 # along with this program; if not, write to the Free Software
338 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
341 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
342 # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
343 # `$srcdir', `$srcdir/..', or `$srcdir/../..'.
345 # Of course, Automake must honor this variable whenever it calls a
346 # tool from the auxiliary directory. The problem is that $srcdir (and
347 # therefore $ac_aux_dir as well) can be either absolute or relative,
348 # depending on how configure is run. This is pretty annoying, since
349 # it makes $ac_aux_dir quite unusable in subdirectories: in the top
350 # source directory, any form will work fine, but in subdirectories a
351 # relative path needs to be adjusted first.
353 # $ac_aux_dir/missing
354 # fails when called from a subdirectory if $ac_aux_dir is relative
355 # $top_srcdir/$ac_aux_dir/missing
356 # fails if $ac_aux_dir is absolute,
357 # fails when called from a subdirectory in a VPATH build with
358 # a relative $ac_aux_dir
360 # The reason of the latter failure is that $top_srcdir and $ac_aux_dir
361 # are both prefixed by $srcdir. In an in-source build this is usually
362 # harmless because $srcdir is `.', but things will broke when you
363 # start a VPATH build or use an absolute $srcdir.
365 # So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
366 # iff we strip the leading $srcdir from $ac_aux_dir. That would be:
367 # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
368 # and then we would define $MISSING as
369 # MISSING="\${SHELL} $am_aux_dir/missing"
370 # This will work as long as MISSING is not called from configure, because
371 # unfortunately $(top_srcdir) has no meaning in configure.
372 # However there are other variables, like CC, which are often used in
373 # configure, and could therefore not use this "fixed" $ac_aux_dir.
375 # Another solution, used here, is to always expand $ac_aux_dir to an
376 # absolute PATH. The drawback is that using absolute paths prevent a
377 # configured tree to be moved without reconfiguration.
379 # Rely on autoconf to set up CDPATH properly.
382 AC_DEFUN([AM_AUX_DIR_EXPAND], [
383 # expand $ac_aux_dir to an absolute path
384 am_aux_dir=`cd $ac_aux_dir && pwd`
389 # Define $install_sh.
391 # Copyright 2001 Free Software Foundation, Inc.
393 # This program is free software; you can redistribute it and/or modify
394 # it under the terms of the GNU General Public License as published by
395 # the Free Software Foundation; either version 2, or (at your option)
398 # This program is distributed in the hope that it will be useful,
399 # but WITHOUT ANY WARRANTY; without even the implied warranty of
400 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
401 # GNU General Public License for more details.
403 # You should have received a copy of the GNU General Public License
404 # along with this program; if not, write to the Free Software
405 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
408 AC_DEFUN([AM_PROG_INSTALL_SH],
409 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
410 install_sh=${install_sh-"$am_aux_dir/install-sh"}
411 AC_SUBST(install_sh)])
413 # AM_PROG_INSTALL_STRIP
415 # Copyright 2001 Free Software Foundation, Inc.
417 # This program is free software; you can redistribute it and/or modify
418 # it under the terms of the GNU General Public License as published by
419 # the Free Software Foundation; either version 2, or (at your option)
422 # This program is distributed in the hope that it will be useful,
423 # but WITHOUT ANY WARRANTY; without even the implied warranty of
424 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425 # GNU General Public License for more details.
427 # You should have received a copy of the GNU General Public License
428 # along with this program; if not, write to the Free Software
429 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
432 # One issue with vendor `install' (even GNU) is that you can't
433 # specify the program used to strip binaries. This is especially
434 # annoying in cross-compiling environments, where the build's strip
435 # is unlikely to handle the host's binaries.
436 # Fortunately install-sh will honor a STRIPPROG variable, so we
437 # always use install-sh in `make install-strip', and initialize
438 # STRIPPROG with the value of the STRIP variable (set by the user).
439 AC_DEFUN([AM_PROG_INSTALL_STRIP],
440 [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
441 # Installed binaries are usually stripped using `strip' when the user
442 # run `make install-strip'. However `strip' might not be the right
443 # tool to use in cross-compilation environments, therefore Automake
444 # will honor the `STRIP' environment variable to overrule this program.
445 dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
446 if test "$cross_compiling" != no; then
447 AC_CHECK_TOOL([STRIP], [strip], :)
449 INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
450 AC_SUBST([INSTALL_STRIP_PROGRAM])])
453 # Copyright (C) 2003 Free Software Foundation, Inc.
455 # This program is free software; you can redistribute it and/or modify
456 # it under the terms of the GNU General Public License as published by
457 # the Free Software Foundation; either version 2, or (at your option)
460 # This program is distributed in the hope that it will be useful,
461 # but WITHOUT ANY WARRANTY; without even the implied warranty of
462 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
463 # GNU General Public License for more details.
465 # You should have received a copy of the GNU General Public License
466 # along with this program; if not, write to the Free Software
467 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
472 # Check whether the underlying file-system supports filenames
473 # with a leading dot. For instance MS-DOS doesn't.
474 AC_DEFUN([AM_SET_LEADING_DOT],
475 [rm -rf .tst 2>/dev/null
476 mkdir .tst 2>/dev/null
477 if test -d .tst; then
482 rmdir .tst 2>/dev/null
483 AC_SUBST([am__leading_dot])])
485 # serial 5 -*- Autoconf -*-
487 # Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
489 # This program is free software; you can redistribute it and/or modify
490 # it under the terms of the GNU General Public License as published by
491 # the Free Software Foundation; either version 2, or (at your option)
494 # This program is distributed in the hope that it will be useful,
495 # but WITHOUT ANY WARRANTY; without even the implied warranty of
496 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
497 # GNU General Public License for more details.
499 # You should have received a copy of the GNU General Public License
500 # along with this program; if not, write to the Free Software
501 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
505 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
506 # written in clear, in which case automake, when reading aclocal.m4,
507 # will think it sees a *use*, and therefore will trigger all it's
508 # C support machinery. Also note that it means that autoscan, seeing
509 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
513 # _AM_DEPENDENCIES(NAME)
514 # ----------------------
515 # See how the compiler implements dependency checking.
516 # NAME is "CC", "CXX", "GCJ", or "OBJC".
517 # We try a few techniques and use that to set a single cache variable.
519 # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
520 # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
521 # dependency, and given that the user is not expected to run this macro,
522 # just rely on AC_PROG_CC.
523 AC_DEFUN([_AM_DEPENDENCIES],
524 [AC_REQUIRE([AM_SET_DEPDIR])dnl
525 AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
526 AC_REQUIRE([AM_MAKE_INCLUDE])dnl
527 AC_REQUIRE([AM_DEP_TRACK])dnl
529 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
530 [$1], CXX, [depcc="$CXX" am_compiler_list=],
531 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
532 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
533 [depcc="$$1" am_compiler_list=])
535 AC_CACHE_CHECK([dependency style of $depcc],
536 [am_cv_$1_dependencies_compiler_type],
537 [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
538 # We make a subdir and do the tests there. Otherwise we can end up
539 # making bogus files that we don't know about and never remove. For
540 # instance it was reported that on HP-UX the gcc test will end up
541 # making a dummy file named `D' -- because `-MD' means `put the output
544 # Copy depcomp to subdir because otherwise we won't find it if we're
545 # using a relative directory.
546 cp "$am_depcomp" conftest.dir
549 am_cv_$1_dependencies_compiler_type=none
550 if test "$am_compiler_list" = ""; then
551 am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
553 for depmode in $am_compiler_list; do
554 # We need to recreate these files for each test, as the compiler may
555 # overwrite some of them when testing with obscure command lines.
556 # This happens at least with the AIX C compiler.
557 echo '#include "conftest.h"' > conftest.c
558 echo 'int i;' > conftest.h
559 echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
563 # after this tag, mechanisms are not by side-effect, so they'll
564 # only be used when explicitly requested
565 if test "x$enable_dependency_tracking" = xyes; then
573 # We check with `-c' and `-o' for the sake of the "dashmstdout"
574 # mode. It turns out that the SunPro C++ compiler does not properly
575 # handle `-M -o', and we need to detect this.
576 if depmode=$depmode \
577 source=conftest.c object=conftest.o \
578 depfile=conftest.Po tmpdepfile=conftest.TPo \
579 $SHELL ./depcomp $depcc -c -o conftest.o conftest.c \
580 >/dev/null 2>conftest.err &&
581 grep conftest.h conftest.Po > /dev/null 2>&1 &&
582 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
583 # icc doesn't choke on unknown options, it will just issue warnings
584 # (even with -Werror). So we grep stderr for any message
585 # that says an option was ignored.
586 if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
587 am_cv_$1_dependencies_compiler_type=$depmode
596 am_cv_$1_dependencies_compiler_type=none
599 AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
600 AM_CONDITIONAL([am__fastdep$1], [
601 test "x$enable_dependency_tracking" != xno \
602 && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
608 # Choose a directory name for dependency files.
609 # This macro is AC_REQUIREd in _AM_DEPENDENCIES
610 AC_DEFUN([AM_SET_DEPDIR],
611 [AC_REQUIRE([AM_SET_LEADING_DOT])dnl
612 AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
618 AC_DEFUN([AM_DEP_TRACK],
619 [AC_ARG_ENABLE(dependency-tracking,
620 [ --disable-dependency-tracking Speeds up one-time builds
621 --enable-dependency-tracking Do not reject slow dependency extractors])
622 if test "x$enable_dependency_tracking" != xno; then
623 am_depcomp="$ac_aux_dir/depcomp"
626 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
627 AC_SUBST([AMDEPBACKSLASH])
630 # Generate code to set up dependency tracking. -*- Autoconf -*-
632 # Copyright 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
634 # This program is free software; you can redistribute it and/or modify
635 # it under the terms of the GNU General Public License as published by
636 # the Free Software Foundation; either version 2, or (at your option)
639 # This program is distributed in the hope that it will be useful,
640 # but WITHOUT ANY WARRANTY; without even the implied warranty of
641 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
642 # GNU General Public License for more details.
644 # You should have received a copy of the GNU General Public License
645 # along with this program; if not, write to the Free Software
646 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
651 # _AM_OUTPUT_DEPENDENCY_COMMANDS
652 # ------------------------------
653 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
654 [for mf in $CONFIG_FILES; do
655 # Strip MF so we end up with the name of the file.
656 mf=`echo "$mf" | sed -e 's/:.*$//'`
657 # Check whether this is an Automake generated Makefile or not.
658 # We used to match only the files named `Makefile.in', but
659 # some people rename them; so instead we look at the file content.
660 # Grep'ing the first line is not enough: some people post-process
661 # each Makefile.in and add a new line on top of each file to say so.
662 # So let's grep whole file.
663 if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
664 dirpart=`AS_DIRNAME("$mf")`
668 grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
669 # Extract the definition of DEP_FILES from the Makefile without
671 DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
672 test -z "$DEPDIR" && continue
673 # When using ansi2knr, U may be empty or an underscore; expand it
674 U=`sed -n -e '/^U = / s///p' < "$mf"`
675 test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
676 # We invoke sed twice because it is the simplest approach to
677 # changing $(DEPDIR) to its actual value in the expansion.
678 for file in `sed -n -e '
679 /^DEP_FILES = .*\\\\$/ {
688 /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
689 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
690 # Make sure the directory exists.
691 test -f "$dirpart/$file" && continue
692 fdir=`AS_DIRNAME(["$file"])`
693 AS_MKDIR_P([$dirpart/$fdir])
694 # echo "creating $dirpart/$file"
695 echo '# dummy' > "$dirpart/$file"
698 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
701 # AM_OUTPUT_DEPENDENCY_COMMANDS
702 # -----------------------------
703 # This macro should only be invoked once -- use via AC_REQUIRE.
705 # This code is only required when automatic dependency tracking
706 # is enabled. FIXME. This creates each `.P' file that we will
707 # need in order to bootstrap the dependency handling code.
708 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
709 [AC_CONFIG_COMMANDS([depfiles],
710 [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
711 [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
714 # Check to see how 'make' treats includes. -*- Autoconf -*-
716 # Copyright (C) 2001, 2002 Free Software Foundation, Inc.
718 # This program is free software; you can redistribute it and/or modify
719 # it under the terms of the GNU General Public License as published by
720 # the Free Software Foundation; either version 2, or (at your option)
723 # This program is distributed in the hope that it will be useful,
724 # but WITHOUT ANY WARRANTY; without even the implied warranty of
725 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
726 # GNU General Public License for more details.
728 # You should have received a copy of the GNU General Public License
729 # along with this program; if not, write to the Free Software
730 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
737 # Check to see how make treats includes.
738 AC_DEFUN([AM_MAKE_INCLUDE],
739 [am_make=${MAKE-make}
740 cat > confinc << 'END'
744 # If we don't find an include directive, just comment out the code.
745 AC_MSG_CHECKING([for style of include used by $am_make])
749 # First try GNU make style include.
750 echo "include confinc" > confmf
751 # We grep out `Entering directory' and `Leaving directory'
752 # messages which can occur if `w' ends up in MAKEFLAGS.
753 # In particular we don't look at `^make:' because GNU make might
754 # be invoked under some other name (usually "gmake"), in which
755 # case it prints its new name instead of `make'.
756 if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
761 # Now try BSD make style include.
762 if test "$am__include" = "#"; then
763 echo '.include "confinc"' > confmf
764 if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
770 AC_SUBST(am__include)
772 AC_MSG_RESULT($_am_result)
776 # AM_CONDITIONAL -*- Autoconf -*-
778 # Copyright 1997, 2000, 2001 Free Software Foundation, Inc.
780 # This program is free software; you can redistribute it and/or modify
781 # it under the terms of the GNU General Public License as published by
782 # the Free Software Foundation; either version 2, or (at your option)
785 # This program is distributed in the hope that it will be useful,
786 # but WITHOUT ANY WARRANTY; without even the implied warranty of
787 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
788 # GNU General Public License for more details.
790 # You should have received a copy of the GNU General Public License
791 # along with this program; if not, write to the Free Software
792 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
799 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
800 # -------------------------------------
801 # Define a conditional.
802 AC_DEFUN([AM_CONDITIONAL],
803 [ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
804 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
814 AC_CONFIG_COMMANDS_PRE(
815 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
816 AC_MSG_ERROR([conditional "$1" was never defined.
817 Usually this means the macro was only invoked conditionally.])
822 dnl From Jim Meyering.
823 dnl Find a new-enough version of Perl.
828 dnl FIXME: don't hard-code 5.003
829 dnl FIXME: should we cache the result?
830 AC_MSG_CHECKING([for perl5.003 or newer])
831 if test "${PERL+set}" = set; then
832 # `PERL' is set in the user's environment.
833 candidate_perl_names="$PERL"
836 candidate_perl_names='perl perl5'
842 PERL="$am_missing_run perl"
843 for perl in $candidate_perl_names; do
844 # Run test in a subshell; some versions of sh will print an error if
845 # an executable is not found, even if stderr is redirected.
846 if ( $perl -e 'require 5.003; use File::Compare' ) > /dev/null 2>&1; then
853 AC_MSG_RESULT($found)
854 test $found = no && AC_MSG_WARN([
855 WARNING: You don't seem to have perl5.003 or newer installed, or you lack
856 a usable version of the Perl File::Compare module. As a result,
857 you may be unable to run a few tests or to regenerate certain
858 files if you modify the sources from which they are derived.
862 #serial 62 -*- autoconf -*-
864 m4_undefine([AC_LANG_SOURCE(C)])
865 dnl The following is identical to the definition in c.m4
866 dnl from the autoconf cvs repository on 2003-03-07.
867 dnl FIXME: remove this code once we upgrade to autoconf-2.58.
869 # We can't use '#line $LINENO "configure"' here, since
870 # Sun c89 (Sun WorkShop 6 update 2 C 5.3 Patch 111679-08 2002/05/09)
871 # rejects $LINENO greater than 32767, and some configure scripts
872 # are longer than 32767 lines.
873 m4_define([AC_LANG_SOURCE(C)],
876 cat confdefs.h >>conftest.$ac_ext
877 cat >>conftest.$ac_ext <<_ACEOF
878 /* end confdefs.h. */
882 dnl Misc type-related macros for fileutils, sh-utils, textutils.
884 AC_DEFUN([jm_MACROS],
888 GNU_PACKAGE="GNU $PACKAGE"
889 AC_DEFINE_UNQUOTED(GNU_PACKAGE, "$GNU_PACKAGE",
890 [The concatenation of the strings `GNU ', and PACKAGE.])
891 AC_SUBST(GNU_PACKAGE)
893 AM_MISSING_PROG(HELP2MAN, help2man)
894 AC_SUBST(OPTIONAL_BIN_PROGS)
895 AC_SUBST(OPTIONAL_BIN_ZCRIPTS)
899 dnl This macro actually runs replacement code. See isc-posix.m4.
900 AC_REQUIRE([AC_ISC_POSIX])dnl
903 jm_INCLUDED_REGEX([lib/regex.c])
905 AC_REQUIRE([UTILS_HOST_OS])
906 AC_REQUIRE([UTILS_FUNC_MKDIR_TRAILING_SLASH])
907 AC_REQUIRE([jm_BISON])
908 AC_REQUIRE([jm_ASSERT])
909 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
910 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE])
911 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO])
912 AC_REQUIRE([jm_CHECK_DECLS])
914 AC_REQUIRE([jm_PREREQ])
916 AC_REQUIRE([UTILS_FUNC_DIRFD])
917 AC_REQUIRE([AC_FUNC_ACL])
918 AC_REQUIRE([AC_FUNC_FTW])
919 AC_REQUIRE([jm_FUNC_LCHOWN])
920 AC_REQUIRE([fetish_FUNC_RMDIR_NOTEMPTY])
921 AC_REQUIRE([jm_FUNC_CHOWN])
922 AC_REQUIRE([jm_FUNC_MKTIME])
923 AC_REQUIRE([jm_FUNC_LSTAT])
924 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
925 AC_REQUIRE([jm_FUNC_STAT])
926 AC_REQUIRE([AC_FUNC_REALLOC])
927 AC_REQUIRE([AC_FUNC_MALLOC])
928 AC_REQUIRE([AC_FUNC_STRERROR_R])
929 AC_REQUIRE([jm_FUNC_NANOSLEEP])
930 AC_REQUIRE([jm_FUNC_MEMCMP])
931 AC_REQUIRE([jm_FUNC_GLIBC_UNLOCKED_IO])
932 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
933 AC_REQUIRE([jm_FUNC_GROUP_MEMBER])
934 AC_REQUIRE([jm_FUNC_PUTENV])
936 AC_REQUIRE([jm_AC_PREREQ_XSTRTOUMAX])
937 AC_REQUIRE([jm_AC_PREREQ_XSTRTOIMAX])
938 AC_REQUIRE([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK])
939 AC_REQUIRE([AC_FUNC_ERROR_AT_LINE])
940 AC_REQUIRE([jm_FUNC_GNU_STRFTIME])
941 AC_REQUIRE([jm_FUNC_MKTIME])
942 AC_REQUIRE([jm_FUNC_FPENDING])
944 # This is for od and stat, and any other program that
945 # uses the PRI.MAX macros from inttypes.h.
946 AC_REQUIRE([gt_INTTYPES_PRI])
948 AC_REQUIRE([jm_FUNC_GETGROUPS])
950 AC_REQUIRE([AC_FUNC_FSEEKO])
951 AC_REQUIRE([AC_FUNC_VPRINTF])
952 AC_REQUIRE([AC_FUNC_ALLOCA])
954 AC_CONFIG_LIBOBJ_DIR([lib])
957 AC_REQUIRE([jm_SYS_PROC_UPTIME])
958 AC_REQUIRE([jm_FUNC_FTRUNCATE])
959 AC_REQUIRE([vb_FUNC_RENAME])
961 AC_REPLACE_FUNCS(strcasecmp strncasecmp)
962 AC_REPLACE_FUNCS(dup2)
963 AC_REPLACE_FUNCS(gethostname getusershell)
964 AC_REPLACE_FUNCS(sig2str)
965 AC_REPLACE_FUNCS(strcspn stpcpy strstr strtol strtoul)
966 AC_REPLACE_FUNCS(strpbrk)
967 AC_REPLACE_FUNCS(euidaccess memcmp rmdir rpmatch strndup strverscmp)
968 AC_REPLACE_FUNCS(atexit)
969 AC_REPLACE_FUNCS(getpass)
971 # raise is used by at least sort and ls.
972 AC_REPLACE_FUNCS(raise)
974 dnl used by e.g. intl/*domain.c and lib/canon-host.c
975 AC_REPLACE_FUNCS(strdup)
977 AC_REPLACE_FUNCS(memchr memcpy memmove memrchr memset)
978 AC_CHECK_FUNCS(getpagesize)
980 AC_REQUIRE([UTILS_FUNC_MKSTEMP])
982 # By default, argmatch should fail calling usage (1).
983 AC_DEFINE(ARGMATCH_DIE, [usage (1)],
984 [Define to the function xargmatch calls on failures.])
985 AC_DEFINE(ARGMATCH_DIE_DECL, [extern void usage ()],
986 [Define to the declaration of the xargmatch failure function.])
988 dnl Used to define SETVBUF in sys2.h.
989 dnl This evokes the following warning from autoconf:
990 dnl ...: warning: AC_TRY_RUN called without default to allow cross compiling
991 AC_FUNC_SETVBUF_REVERSED
993 # used by sleep and shred
994 # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
995 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
997 # Save and restore LIBS so e.g., -lrt, isn't added to it. Otherwise, *all*
998 # programs in the package would end up linked with that potentially-shared
999 # library, inducing unnecessary run-time overhead.
1000 fetish_saved_libs=$LIBS
1001 AC_SEARCH_LIBS(clock_gettime, [rt posix4],
1002 [LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
1003 AC_SUBST(LIB_CLOCK_GETTIME)
1004 AC_CHECK_FUNCS(clock_gettime clock_settime)
1005 LIBS=$fetish_saved_libs
1006 AC_CHECK_FUNCS(gettimeofday)
1007 AC_FUNC_GETTIMEOFDAY_CLOBBER
1009 AC_REQUIRE([AC_FUNC_CLOSEDIR_VOID])
1010 AC_REQUIRE([jm_FUNC_UTIME])
1044 AC_CHECK_FUNCS(setreuid setregid)
1047 if test $am_cv_func_working_getline != yes; then
1048 AC_CHECK_FUNCS(getdelim)
1053 AC_REQUIRE([UTILS_SYS_OPEN_MAX])
1054 AC_REQUIRE([GL_FUNC_GETCWD_PATH_MAX])
1055 AC_REQUIRE([GL_FUNC_READDIR])
1057 # See if linking `seq' requires -lm.
1058 # It does on nearly every system. The single exception (so far) is
1059 # BeOS which has all the math functions in the normal runtime library
1060 # and doesn't have a separate math library.
1068 AC_TRY_LINK([#include <math.h>], $ac_seq_body, ,
1069 [ac_seq_save_LIBS="$LIBS"
1071 AC_TRY_LINK([#include <math.h>], $ac_seq_body, SEQ_LIBM=-lm)
1072 LIBS="$ac_seq_save_LIBS"
1078 jm_FUNC_UNLINK_BUSY_TEXT
1080 # These tests are for df.
1081 jm_LIST_MOUNTED_FILESYSTEMS([list_mounted_fs=yes], [list_mounted_fs=no])
1083 jm_FILE_SYSTEM_USAGE([space=yes], [space=no])
1084 if test $list_mounted_fs = yes && test $space = yes; then
1085 DF_PROG='df$(EXEEXT)'
1087 AC_LIBOBJ(mountlist)
1089 AC_REQUIRE([jm_AC_DOS])
1090 AC_REQUIRE([AC_FUNC_CANONICALIZE_FILE_NAME])
1092 # If any of these functions don't exist (e.g. DJGPP 2.03),
1093 # use the corresponding stub.
1094 AC_CHECK_FUNC([fchdir], , [AC_LIBOBJ(fchdir-stub)])
1095 AC_CHECK_FUNC([fchown], , [AC_LIBOBJ(fchown-stub)])
1096 AC_CHECK_FUNC([lstat], , [AC_LIBOBJ(lstat-stub)])
1097 AC_CHECK_FUNC([readlink], , [AC_LIBOBJ(readlink-stub)])
1101 # These tests must be run before any use of AC_CHECK_TYPE,
1102 # because that macro compiles code that tests e.g., HAVE_UNISTD_H.
1103 # See the definition of ac_includes_default in `configure'.
1104 AC_DEFUN([jm_CHECK_ALL_HEADERS],
1147 # This macro must be invoked before any tests that run the compiler.
1148 AC_DEFUN([jm_CHECK_ALL_TYPES],
1150 dnl This test must come as early as possible after the compiler configuration
1151 dnl tests, because the choice of the file model can (in principle) affect
1152 dnl whether functions and headers are available, whether they work, etc.
1153 AC_REQUIRE([AC_SYS_LARGEFILE])
1155 dnl This test must precede tests of compiler characteristics like
1156 dnl that for the inline keyword, since it may change the degree to
1157 dnl which the compiler supports such features.
1158 AC_REQUIRE([AM_C_PROTOTYPES])
1160 dnl Checks for typedefs, structures, and compiler characteristics.
1161 AC_REQUIRE([AC_C_BIGENDIAN])
1162 AC_REQUIRE([AC_C_CONST])
1163 AC_REQUIRE([AC_C_VOLATILE])
1164 AC_REQUIRE([AC_C_INLINE])
1165 AC_REQUIRE([AC_C_LONG_DOUBLE])
1167 AC_REQUIRE([jm_CHECK_ALL_HEADERS])
1168 AC_REQUIRE([AC_HEADER_DIRENT])
1169 AC_REQUIRE([AC_HEADER_STDC])
1171 [struct stat.st_author,
1172 struct stat.st_blksize],,,
1173 [$ac_includes_default
1174 #include <sys/stat.h>
1176 AC_REQUIRE([AC_STRUCT_ST_BLOCKS])
1178 AC_REQUIRE([AC_STRUCT_TM])
1179 AC_REQUIRE([AC_STRUCT_TIMEZONE])
1180 AC_REQUIRE([AC_HEADER_STAT])
1181 AC_REQUIRE([AC_STRUCT_ST_MTIM_NSEC])
1182 AC_REQUIRE([AC_STRUCT_ST_DM_MODE])
1183 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_TIMESPEC])
1185 AC_REQUIRE([AC_TYPE_GETGROUPS])
1186 AC_REQUIRE([AC_TYPE_MODE_T])
1187 AC_REQUIRE([AC_TYPE_OFF_T])
1188 AC_REQUIRE([AC_TYPE_PID_T])
1189 AC_REQUIRE([AC_TYPE_SIGNAL])
1190 AC_REQUIRE([AC_TYPE_SIZE_T])
1191 AC_REQUIRE([AC_TYPE_UID_T])
1192 AC_CHECK_TYPE(ino_t, unsigned long)
1194 dnl This relies on the fact that autoconf 2.14a's implementation of
1195 dnl AC_CHECK_TYPE checks includes unistd.h.
1196 AC_CHECK_TYPE(ssize_t, int)
1197 AC_CHECK_TYPE(major_t, unsigned int)
1198 AC_CHECK_TYPE(minor_t, unsigned int)
1200 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1201 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
1203 AC_REQUIRE([AC_HEADER_MAJOR])
1204 AC_REQUIRE([AC_HEADER_DIRENT])
1208 # isc-posix.m4 serial 2 (gettext-0.11.2)
1209 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
1210 dnl This file is free software, distributed under the terms of the GNU
1211 dnl General Public License. As a special exception to the GNU General
1212 dnl Public License, this file may be distributed as part of a program
1213 dnl that contains a configuration script generated by Autoconf, under
1214 dnl the same distribution terms as the rest of that program.
1216 # This file is not needed with autoconf-2.53 and newer. Remove it in 2005.
1218 # This test replaces the one in autoconf.
1219 # Currently this macro should have the same name as the autoconf macro
1220 # because gettext's gettext.m4 (distributed in the automake package)
1221 # still uses it. Otherwise, the use in gettext.m4 makes autoheader
1222 # give these diagnostics:
1223 # configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX
1224 # configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX
1226 undefine([AC_ISC_POSIX])
1228 AC_DEFUN([AC_ISC_POSIX],
1230 dnl This test replaces the obsolescent AC_ISC_POSIX kludge.
1231 AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"])
1237 dnl Initially derived from code in GNU grep.
1238 dnl Mostly written by Jim Meyering.
1240 dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
1242 AC_DEFUN([jm_INCLUDED_REGEX],
1244 dnl Even packages that don't use regex.c can use this macro.
1245 dnl Of course, for them it doesn't do anything.
1247 # Assume we'll default to using the included regex.c.
1248 ac_use_included_regex=yes
1250 # However, if the system regex support is good enough that it passes the
1251 # the following run test, then default to *not* using the included regex.c.
1252 # If cross compiling, assume the test would fail and use the included
1253 # regex.c. The first failing regular expression is from `Spencer ere
1254 # test #75' in grep-2.3.
1255 AC_CACHE_CHECK([for working re_compile_pattern],
1256 jm_cv_func_working_re_compile_pattern,
1264 static struct re_pattern_buffer regex;
1266 struct re_registers regs;
1267 re_set_syntax (RE_SYNTAX_POSIX_EGREP);
1268 memset (®ex, 0, sizeof (regex));
1269 [s = re_compile_pattern ("a[[:@:>@:]]b\n", 9, ®ex);]
1270 /* This should fail with _Invalid character class name_ error. */
1274 /* This should succeed, but doesn't for e.g. glibc-2.1.3. */
1275 memset (®ex, 0, sizeof (regex));
1276 s = re_compile_pattern ("{1", 2, ®ex);
1281 /* The following example is derived from a problem report
1282 against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>. */
1283 memset (®ex, 0, sizeof (regex));
1284 s = re_compile_pattern ("[[anù]]*n", 7, ®ex);
1288 /* This should match, but doesn't for e.g. glibc-2.2.1. */
1289 if (re_match (®ex, "an", 2, 0, ®s) != 2)
1292 memset (®ex, 0, sizeof (regex));
1293 s = re_compile_pattern ("x", 1, ®ex);
1297 /* The version of regex.c in e.g. GNU libc-2.2.93 didn't
1298 work with a negative RANGE argument. */
1299 if (re_search (®ex, "wxy", 3, 2, -2, ®s) != 1)
1305 jm_cv_func_working_re_compile_pattern=yes,
1306 jm_cv_func_working_re_compile_pattern=no,
1307 dnl When crosscompiling, assume it's broken.
1308 jm_cv_func_working_re_compile_pattern=no))
1309 if test $jm_cv_func_working_re_compile_pattern = yes; then
1310 ac_use_included_regex=no
1313 test -n "$1" || AC_MSG_ERROR([missing argument])
1314 m4_syscmd([test -f $1])
1315 ifelse(m4_sysval, 0,
1317 AC_ARG_WITH(included-regex,
1318 [ --without-included-regex don't compile regex; this is the default on
1319 systems with version 2 of the GNU C library
1320 (use with caution on other system)],
1321 jm_with_regex=$withval,
1322 jm_with_regex=$ac_use_included_regex)
1323 if test "$jm_with_regex" = yes; then
1332 # Prerequisites of lib/regex.c.
1333 AC_DEFUN([jm_PREREQ_REGEX],
1335 dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks it.
1336 dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
1339 dnl Persuade glibc <string.h> to declare mempcpy().
1340 AC_REQUIRE([AC_GNU_SOURCE])
1342 AC_REQUIRE([ACX_C_RESTRICT])
1343 AC_REQUIRE([AC_FUNC_ALLOCA])
1344 AC_REQUIRE([AC_HEADER_STDC])
1345 AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
1346 AC_CHECK_FUNCS_ONCE(isascii mempcpy)
1347 AC_CHECK_FUNCS(btowc)
1351 dnl based on acx_restrict.m4, from the GNU Autoconf Macro Archive at:
1352 dnl http://www.gnu.org/software/ac-archive/htmldoc/acx_restrict.html
1354 # Determine whether the C/C++ compiler supports the "restrict" keyword
1355 # introduced in ANSI C99, or an equivalent. Do nothing if the compiler
1356 # accepts it. Otherwise, if the compiler supports an equivalent (like
1357 # gcc's __restrict__) define "restrict" to be that. Otherwise, define
1358 # "restrict" to be empty.
1360 AC_DEFUN([ACX_C_RESTRICT],
1361 [AC_CACHE_CHECK([for C/C++ restrict keyword], acx_cv_c_restrict,
1362 [acx_cv_c_restrict=no
1363 # Try the official restrict keyword, then gcc's __restrict__.
1364 for acx_kw in restrict __restrict__; do
1365 AC_COMPILE_IFELSE([AC_LANG_SOURCE(
1366 [float * $acx_kw x;])],
1367 [acx_cv_c_restrict=$acx_kw; break])
1370 case $acx_cv_c_restrict in
1372 no) AC_DEFINE(restrict,,
1373 [Define to equivalent of C99 restrict keyword, or to nothing if this
1374 is not supported. Do not define if restrict is supported directly.]) ;;
1375 *) AC_DEFINE_UNQUOTED(restrict, $acx_cv_c_restrict) ;;
1379 # onceonly.m4 serial 2
1380 dnl Copyright (C) 2002, 2003 Free Software Foundation, Inc.
1381 dnl This file is free software, distributed under the terms of the GNU
1382 dnl General Public License. As a special exception to the GNU General
1383 dnl Public License, this file may be distributed as part of a program
1384 dnl that contains a configuration script generated by Autoconf, under
1385 dnl the same distribution terms as the rest of that program.
1387 dnl This file defines some "once only" variants of standard autoconf macros.
1388 dnl AC_CHECK_HEADERS_ONCE like AC_CHECK_HEADERS
1389 dnl AC_CHECK_FUNCS_ONCE like AC_CHECK_FUNCS
1390 dnl AC_CHECK_DECLS_ONCE like AC_CHECK_DECLS
1391 dnl AC_REQUIRE([AC_HEADER_STDC]) like AC_HEADER_STDC
1392 dnl The advantage is that the check for each of the headers/functions/decls
1393 dnl will be put only once into the 'configure' file. It keeps the size of
1394 dnl the 'configure' file down, and avoids redundant output when 'configure'
1396 dnl The drawback is that the checks cannot be conditionalized. If you write
1397 dnl if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
1398 dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
1399 dnl empty, and the check will be inserted before the body of the AC_DEFUNed
1402 dnl Taken from Autoconf 2.50; can be removed once we assume 2.50 or later.
1403 define([m4_quote], [[$*]])
1405 # AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
1406 # AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
1407 AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
1409 AC_FOREACH([gl_HEADER_NAME], [$1], [
1410 AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(defn([gl_HEADER_NAME]),
1412 AC_CHECK_HEADERS(gl_HEADER_NAME)
1414 AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
1419 # AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
1420 # AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
1421 AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
1423 AC_FOREACH([gl_FUNC_NAME], [$1], [
1424 AC_DEFUN([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]), [
1425 AC_CHECK_FUNCS(defn([gl_FUNC_NAME]))
1427 AC_REQUIRE([gl_CHECK_FUNC_]defn([gl_FUNC_NAME]))
1431 # AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
1432 # AC_CHECK_DECLS(DECL1, DECL2, ...).
1433 AC_DEFUN([AC_CHECK_DECLS_ONCE], [
1435 AC_FOREACH([gl_DECL_NAME], [$1], [
1436 AC_DEFUN([gl_CHECK_DECL_]defn([gl_DECL_NAME]), [
1437 AC_CHECK_DECLS(defn([gl_DECL_NAME]))
1439 AC_REQUIRE([gl_CHECK_DECL_]defn([gl_DECL_NAME]))
1445 dnl From Paul Eggert.
1447 # Define HOST_OPERATING_SYSTEM to a name for the host operating system.
1448 AC_DEFUN([UTILS_HOST_OS],
1450 AC_CACHE_CHECK([host operating system],
1451 utils_cv_host_operating_system,
1455 # These operating system names do not use the default heuristic below.
1456 # They are in reverse order, so that more-specific prefixes come first.
1457 winnt*) os='Windows NT';;
1459 sysv*) os='Unix System V';;
1460 superux*) os='SUPER-UX';;
1461 sunos*) os='SunOS';;
1463 sco*) os='SCO Unix';;
1464 riscos*) os='RISC OS';;
1465 riscix*) os='RISCiX';;
1469 plan9*) os='Plan 9';;
1472 openbsd*) os='OpenBSD';;
1473 nsk*) os='NonStop Kernel';;
1474 nonstopux*) os='NonStop-UX';;
1475 netbsd*) os='NetBSD';;
1476 msdosdjgpp*) os='DJGPP';;
1477 mpeix*) os='MPE/iX';;
1479 mingw*) os='MinGW';;
1480 lynxos*) os='LynxOS';;
1481 linux*) os='GNU/Linux';;
1485 freebsd*-gnu*) os='GNU/FreeBSD';;
1486 freebsd*) os='FreeBSD';;
1488 bsdi*) os='BSD/OS';;
1492 atheos*) os='AtheOS';;
1493 amigaos*) os='Amiga OS';;
1496 # The default heuristic takes the initial alphabetic string
1497 # from $host_os, but capitalizes its first letter.
1500 expr "X$host_os" : 'X\([A-Za-z]\)' | tr '[a-z]' '[A-Z]'
1502 expr "X$host_os" : 'X.\([A-Za-z]*\)'
1506 # If $host_os does not start with an alphabetic string, use it unchanged.
1510 utils_cv_host_operating_system=$os]])
1511 AC_DEFINE_UNQUOTED(HOST_OPERATING_SYSTEM,
1512 "$utils_cv_host_operating_system",
1513 [The host operating system.])
1518 # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
1519 # On such systems, arrange to use a wrapper function that removes any
1521 AC_DEFUN([UTILS_FUNC_MKDIR_TRAILING_SLASH],
1523 AC_CACHE_CHECK([whether mkdir fails due to a trailing slash],
1524 utils_cv_func_mkdir_trailing_slash_bug,
1526 # Arrange for deletion of the temporary directory this test might create.
1527 ac_clean_files="$ac_clean_files confdir-slash"
1529 # include <sys/types.h>
1530 # include <sys/stat.h>
1531 # include <stdlib.h>
1534 rmdir ("confdir-slash");
1535 exit (mkdir ("confdir-slash/", 0700));
1538 utils_cv_func_mkdir_trailing_slash_bug=no,
1539 utils_cv_func_mkdir_trailing_slash_bug=yes,
1540 utils_cv_func_mkdir_trailing_slash_bug=yes
1545 if test $utils_cv_func_mkdir_trailing_slash_bug = yes; then
1547 AC_DEFINE(mkdir, rpl_mkdir,
1548 [Define to rpl_mkdir if the replacement function should be used.])
1554 AC_DEFUN([jm_BISON],
1556 # getdate.y works with bison only.
1557 : ${YACC='bison -y'}
1562 dnl based on code from Eleftherios Gkioulekas
1564 AC_DEFUN([jm_ASSERT],
1566 AC_MSG_CHECKING(whether to enable assertions)
1567 AC_ARG_ENABLE(assert,
1568 [ --disable-assert turn off assertions],
1570 AC_DEFINE(NDEBUG,1,[Define to 1 if assertions should be disabled.]) ],
1571 [ AC_MSG_RESULT(yes) ]
1577 dnl From Jim Meyering
1579 dnl Define HAVE_STRUCT_UTIMBUF if `struct utimbuf' is declared --
1580 dnl usually in <utime.h>.
1581 dnl Some systems have utime.h but don't declare the struct anywhere.
1583 AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
1585 AC_CHECK_HEADERS(utime.h)
1586 AC_REQUIRE([AC_HEADER_TIME])
1587 AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
1590 #ifdef TIME_WITH_SYS_TIME
1591 # include <sys/time.h>
1594 # ifdef HAVE_SYS_TIME_H
1595 # include <sys/time.h>
1604 [static struct utimbuf x; x.actime = x.modtime;],
1605 fu_cv_sys_struct_utimbuf=yes,
1606 fu_cv_sys_struct_utimbuf=no)
1609 if test $fu_cv_sys_struct_utimbuf = yes; then
1610 AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
1611 [Define if struct utimbuf is declared -- usually in <utime.h>.
1612 Some systems have utime.h but don't declare the struct anywhere. ])
1618 dnl From Jim Meyering.
1620 dnl Check whether struct dirent has a member named d_type.
1623 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_TYPE],
1624 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1625 AC_CACHE_CHECK([for d_type member in directory struct],
1626 jm_cv_struct_dirent_d_type,
1629 #include <sys/types.h>
1630 #ifdef HAVE_DIRENT_H
1631 # include <dirent.h>
1632 #else /* not HAVE_DIRENT_H */
1633 # define dirent direct
1634 # ifdef HAVE_SYS_NDIR_H
1635 # include <sys/ndir.h>
1636 # endif /* HAVE_SYS_NDIR_H */
1637 # ifdef HAVE_SYS_DIR_H
1638 # include <sys/dir.h>
1639 # endif /* HAVE_SYS_DIR_H */
1642 # endif /* HAVE_NDIR_H */
1643 #endif /* HAVE_DIRENT_H */
1645 [struct dirent dp; dp.d_type = 0;],
1647 jm_cv_struct_dirent_d_type=yes,
1648 jm_cv_struct_dirent_d_type=no)
1651 if test $jm_cv_struct_dirent_d_type = yes; then
1652 AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
1653 [Define if there is a member named d_type in the struct describing
1654 directory headers.])
1661 dnl From Jim Meyering.
1663 dnl Check whether struct dirent has a member named d_ino.
1666 AC_DEFUN([jm_CHECK_TYPE_STRUCT_DIRENT_D_INO],
1667 [AC_REQUIRE([AC_HEADER_DIRENT])dnl
1668 AC_CACHE_CHECK([for d_ino member in directory struct],
1669 jm_cv_struct_dirent_d_ino,
1672 #include <sys/types.h>
1673 #ifdef HAVE_DIRENT_H
1674 # include <dirent.h>
1675 #else /* not HAVE_DIRENT_H */
1676 # define dirent direct
1677 # ifdef HAVE_SYS_NDIR_H
1678 # include <sys/ndir.h>
1679 # endif /* HAVE_SYS_NDIR_H */
1680 # ifdef HAVE_SYS_DIR_H
1681 # include <sys/dir.h>
1682 # endif /* HAVE_SYS_DIR_H */
1685 # endif /* HAVE_NDIR_H */
1686 #endif /* HAVE_DIRENT_H */
1688 [struct dirent dp; dp.d_ino = 0;],
1690 jm_cv_struct_dirent_d_ino=yes,
1691 jm_cv_struct_dirent_d_ino=no)
1694 if test $jm_cv_struct_dirent_d_ino = yes; then
1695 AC_DEFINE(D_INO_IN_DIRENT, 1,
1696 [Define if there is a member named d_ino in the struct describing
1697 directory headers.])
1704 dnl This is just a wrapper function to encapsulate this kludge.
1705 dnl Putting it in a separate file like this helps share it between
1706 dnl different packages.
1707 AC_DEFUN([jm_CHECK_DECLS],
1709 AC_REQUIRE([_jm_DECL_HEADERS])
1710 AC_REQUIRE([AC_HEADER_TIME])
1714 # if !STDC_HEADERS && HAVE_MEMORY_H
1715 # include <memory.h>
1717 # include <string.h>
1720 # include <strings.h>
1724 # include <stdlib.h>
1727 # include <unistd.h>
1730 #include <sys/types.h>
1731 #if TIME_WITH_SYS_TIME
1732 # include <sys/time.h>
1735 # if HAVE_SYS_TIME_H
1736 # include <sys/time.h>
1777 ttyname], , , $headers)
1780 dnl FIXME: when autoconf has support for it.
1781 dnl This is a little helper so we can require these header checks.
1782 AC_DEFUN([_jm_DECL_HEADERS],
1784 AC_REQUIRE([AC_HEADER_STDC])
1785 AC_CHECK_HEADERS(grp.h memory.h pwd.h string.h strings.h stdlib.h \
1786 unistd.h sys/time.h utmp.h utmpx.h)
1791 dnl We use jm_ for non Autoconf macros.
1792 m4_pattern_forbid([^jm_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1793 m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
1795 # These are the prerequisite macros for files in the lib/
1796 # directory of the coreutils package.
1798 AC_DEFUN([jm_PREREQ],
1800 AC_REQUIRE([jm_PREREQ_ADDEXT])
1802 # We don't yet use c-stack.c.
1803 # AC_REQUIRE([jm_PREREQ_C_STACK])
1805 AC_REQUIRE([jm_PREREQ_CANON_HOST])
1806 AC_REQUIRE([jm_PREREQ_DIRNAME])
1807 AC_REQUIRE([jm_PREREQ_ERROR])
1808 AC_REQUIRE([jm_PREREQ_EXCLUDE])
1809 AC_REQUIRE([jm_PREREQ_GETPAGESIZE])
1810 AC_REQUIRE([jm_PREREQ_HARD_LOCALE])
1811 AC_REQUIRE([jm_PREREQ_HASH])
1812 AC_REQUIRE([jm_PREREQ_HUMAN])
1813 AC_REQUIRE([jm_PREREQ_MBSWIDTH])
1814 AC_REQUIRE([jm_PREREQ_MEMCHR])
1815 AC_REQUIRE([jm_PREREQ_PHYSMEM])
1816 AC_REQUIRE([jm_PREREQ_POSIXVER])
1817 AC_REQUIRE([jm_PREREQ_QUOTEARG])
1818 AC_REQUIRE([jm_PREREQ_READUTMP])
1819 AC_REQUIRE([jm_PREREQ_STAT])
1820 AC_REQUIRE([jm_PREREQ_STRNLEN])
1821 AC_REQUIRE([jm_PREREQ_TEMPNAME]) # called by mkstemp
1822 AC_REQUIRE([jm_PREREQ_XGETCWD])
1823 AC_REQUIRE([jm_PREREQ_XREADLINK])
1826 AC_DEFUN([jm_PREREQ_ADDEXT],
1829 AC_REQUIRE([AC_SYS_LONG_FILE_NAMES])
1830 AC_CHECK_FUNCS(pathconf)
1831 AC_CHECK_HEADERS(limits.h string.h unistd.h)
1834 AC_DEFUN([jm_PREREQ_CANON_HOST],
1836 dnl Add any libraries as early as possible.
1837 dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
1838 dnl so we have to add -lnsl to LIBS before checking for that function.
1839 AC_SEARCH_LIBS(gethostbyname, [inet nsl])
1841 dnl These come from -lnsl on Solaris5.5.1.
1842 AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
1844 AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
1845 netinet/in.h arpa/inet.h)
1848 AC_DEFUN([jm_PREREQ_DIRNAME],
1850 AC_REQUIRE([AC_HEADER_STDC])
1851 AC_CHECK_HEADERS(string.h)
1854 AC_DEFUN([jm_PREREQ_EXCLUDE],
1856 AC_REQUIRE([AC_FUNC_FNMATCH_GNU])
1857 AC_REQUIRE([AC_HEADER_STDBOOL])
1860 AC_DEFUN([jm_PREREQ_GETPAGESIZE],
1862 AC_CHECK_FUNCS(getpagesize)
1863 AC_CHECK_HEADERS(OS.h unistd.h)
1866 AC_DEFUN([jm_PREREQ_HARD_LOCALE],
1868 AC_CHECK_HEADERS(locale.h stdlib.h string.h)
1869 AC_CHECK_FUNCS(setlocale)
1870 AC_REQUIRE([AM_C_PROTOTYPES])
1873 AC_DEFUN([jm_PREREQ_HASH],
1875 AC_CHECK_HEADERS(stdlib.h)
1876 AC_REQUIRE([AC_HEADER_STDBOOL])
1877 AC_REQUIRE([jm_CHECK_DECLS])
1880 # If you use human.c, you need the following files:
1881 # inttypes.m4 longlong.m4
1882 AC_DEFUN([jm_PREREQ_HUMAN],
1884 AC_CHECK_HEADERS(locale.h)
1885 AC_CHECK_DECLS([getenv])
1886 AC_CHECK_FUNCS(localeconv)
1887 AC_REQUIRE([AC_HEADER_STDBOOL])
1888 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
1891 AC_DEFUN([jm_PREREQ_MEMCHR],
1893 AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
1896 # Check for the external symbol, _system_configuration,
1897 # a struct with member `physmem'.
1898 AC_DEFUN([gl_SYS__SYSTEM_CONFIGURATION],
1899 [AC_CACHE_CHECK(for external symbol _system_configuration,
1900 gl_cv_var__system_configuration,
1901 [AC_LINK_IFELSE([AC_LANG_PROGRAM(
1902 [[#include <sys/systemcfg.h>
1904 [double x = _system_configuration.physmem;])],
1905 [gl_cv_var__system_configuration=yes],
1906 [gl_cv_var__system_configuration=no])])
1908 if test $gl_cv_var__system_configuration = yes; then
1909 AC_DEFINE(HAVE__SYSTEM_CONFIGURATION, 1,
1910 [Define to 1 if you have the external variable,
1911 _system_configuration with a member named physmem.])
1916 AC_DEFUN([jm_PREREQ_PHYSMEM],
1918 AC_CHECK_HEADERS([unistd.h sys/pstat.h sys/sysmp.h sys/sysinfo.h \
1919 machine/hal_sysinfo.h sys/table.h sys/param.h sys/sysctl.h \
1921 AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic sysmp getsysinfo sysctl table)
1923 AC_REQUIRE([gl_SYS__SYSTEM_CONFIGURATION])
1926 AC_DEFUN([jm_PREREQ_POSIXVER],
1928 AC_CHECK_HEADERS(unistd.h)
1929 AC_CHECK_DECLS([getenv])
1932 AC_DEFUN([jm_PREREQ_QUOTEARG],
1934 AC_CHECK_FUNCS(isascii iswprint)
1935 AC_REQUIRE([jm_FUNC_MBRTOWC])
1936 AC_REQUIRE([jm_FUNC_MEMCMP])
1937 AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
1938 AC_REQUIRE([AC_HEADER_STDC])
1939 AC_REQUIRE([AC_C_BACKSLASH_A])
1940 AC_REQUIRE([AC_TYPE_MBSTATE_T])
1941 AC_REQUIRE([AM_C_PROTOTYPES])
1944 AC_DEFUN([jm_PREREQ_READUTMP],
1946 AC_REQUIRE([AC_HEADER_STDC])
1947 AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
1948 AC_CHECK_FUNCS(utmpname)
1949 AC_CHECK_FUNCS(utmpxname)
1950 AC_REQUIRE([AM_C_PROTOTYPES])
1952 if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
1954 $ac_includes_default
1962 AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
1963 AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
1964 AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
1965 AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
1966 AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
1967 AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
1968 AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
1969 AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
1970 AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
1971 AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
1973 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_exit],,,[$utmp_includes])
1974 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_exit],,,[$utmp_includes])
1975 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_exit],,,[$utmp_includes])
1976 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_exit],,,[$utmp_includes])
1978 AC_CHECK_MEMBERS([struct utmpx.ut_exit.ut_termination],,,[$utmp_includes])
1979 AC_CHECK_MEMBERS([struct utmp.ut_exit.ut_termination],,,[$utmp_includes])
1980 AC_CHECK_MEMBERS([struct utmpx.ut_exit.e_termination],,,[$utmp_includes])
1981 AC_CHECK_MEMBERS([struct utmp.ut_exit.e_termination],,,[$utmp_includes])
1986 AC_DEFUN([jm_PREREQ_STAT],
1988 AC_CHECK_HEADERS(sys/sysmacros.h sys/statvfs.h sys/vfs.h inttypes.h)
1989 AC_CHECK_HEADERS(sys/param.h sys/mount.h)
1990 AC_CHECK_FUNCS(statvfs)
1992 # For `struct statfs' on Ultrix 4.4.
1993 AC_CHECK_HEADERS(netinet/in.h nfs/nfs_clnt.h nfs/vfs.h)
1995 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
1998 $ac_includes_default
1999 #if HAVE_SYS_STATVFS_H
2000 # include <sys/statvfs.h>
2003 # include <sys/vfs.h>
2005 #if !HAVE_SYS_STATVFS_H && !HAVE_SYS_VFS_H
2006 # if HAVE_SYS_MOUNT_H && HAVE_SYS_PARAM_H
2007 /* NetBSD 1.5.2 needs these, for the declaration of struct statfs. */
2008 # include <sys/param.h>
2009 # include <sys/mount.h>
2010 # elif HAVE_NETINET_IN_H && HAVE_NFS_NFS_CLNT_H && HAVE_NFS_VFS_H
2011 /* Ultrix 4.4 needs these for the declaration of struct statfs. */
2012 # include <netinet/in.h>
2013 # include <nfs/nfs_clnt.h>
2014 # include <nfs/vfs.h>
2018 AC_CHECK_MEMBERS([struct statfs.f_basetype],,,[$statxfs_includes])
2019 AC_CHECK_MEMBERS([struct statvfs.f_basetype],,,[$statxfs_includes])
2020 AC_CHECK_MEMBERS([struct statfs.f_fstypename],,,[$statxfs_includes])
2021 AC_CHECK_MEMBERS([struct statfs.f_type],,,[$statxfs_includes])
2022 AC_CHECK_MEMBERS([struct statvfs.f_type],,,[$statxfs_includes])
2023 AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,,[$statxfs_includes])
2024 AC_CHECK_MEMBERS([struct statvfs.f_fsid.__val],,,[$statxfs_includes])
2025 AC_CHECK_MEMBERS([struct statfs.f_namemax],,,[$statxfs_includes])
2026 AC_CHECK_MEMBERS([struct statvfs.f_namemax],,,[$statxfs_includes])
2027 AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
2028 AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
2031 AC_DEFUN([jm_PREREQ_STRNLEN],
2033 AC_REQUIRE([AC_FUNC_STRNLEN])
2034 AC_REQUIRE([AC_HEADER_STDC])
2035 AC_CHECK_HEADERS(memory.h)
2036 AC_CHECK_DECLS([memchr])
2038 # This is necessary because automake-1.6.1 doesn't understand
2039 # that the above use of AC_FUNC_STRNLEN means we may have to use
2041 test $ac_cv_func_strnlen_working = yes \
2042 && AC_LIBOBJ(strnlen)
2045 AC_DEFUN([jm_PREREQ_TEMPNAME],
2047 AC_REQUIRE([AC_HEADER_STDC])
2048 AC_REQUIRE([AC_HEADER_STAT])
2049 AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
2050 AC_CHECK_FUNCS(__secure_getenv gettimeofday)
2051 AC_CHECK_DECLS([getenv])
2052 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
2055 AC_DEFUN([jm_PREREQ_XGETCWD],
2057 AC_REQUIRE([AC_C_PROTOTYPES])
2058 AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
2059 AC_CHECK_FUNCS(getcwd)
2060 AC_REQUIRE([AC_FUNC_GETCWD_NULL])
2063 AC_DEFUN([jm_PREREQ_XREADLINK],
2065 AC_REQUIRE([AC_C_PROTOTYPES])
2066 AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
2071 dnl FIXME: put these prerequisite-only *.m4 files in a separate
2072 dnl directory -- otherwise, they'll conflict with existing files.
2074 dnl These are the prerequisite macros for GNU's error.c file.
2075 AC_DEFUN([jm_PREREQ_ERROR],
2077 AC_CHECK_FUNCS(strerror vprintf doprnt)
2078 AC_CHECK_DECLS([strerror])
2079 AC_CHECK_HEADERS([libintl.h])
2086 dnl autoconf tests required for use of mbswidth.c
2087 dnl From Bruno Haible.
2089 AC_DEFUN([jm_PREREQ_MBSWIDTH],
2091 AC_REQUIRE([AC_HEADER_STDC])
2092 AC_CHECK_HEADERS(limits.h stdlib.h string.h wchar.h wctype.h)
2093 AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
2096 AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
2098 /* AIX 3.2.5 declares wcwidth in <string.h>. */
2100 # include <string.h>
2107 char *p = (char *) wcwidth;
2109 ], ac_cv_have_decl_wcwidth=yes, ac_cv_have_decl_wcwidth=no)])
2110 if test $ac_cv_have_decl_wcwidth = yes; then
2115 AC_DEFINE_UNQUOTED(HAVE_DECL_WCWIDTH, $ac_val,
2116 [Define to 1 if you have the declaration of wcwidth(), and to 0 otherwise.])
2121 # mbrtowc.m4 serial 4 (fileutils-4.1.3)
2122 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
2123 dnl This file is free software, distributed under the terms of the GNU
2124 dnl General Public License. As a special exception to the GNU General
2125 dnl Public License, this file may be distributed as part of a program
2126 dnl that contains a configuration script generated by Autoconf, under
2127 dnl the same distribution terms as the rest of that program.
2129 dnl From Paul Eggert
2131 AC_DEFUN([jm_FUNC_MBRTOWC],
2133 AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
2136 [#include <wchar.h>],
2137 [mbstate_t state; return ! (sizeof state && mbrtowc);],
2138 jm_cv_func_mbrtowc=yes,
2139 jm_cv_func_mbrtowc=no)])
2140 if test $jm_cv_func_mbrtowc = yes; then
2141 AC_DEFINE(HAVE_MBRTOWC, 1,
2142 [Define to 1 if mbrtowc and mbstate_t are properly declared.])
2148 dnl A replacement for autoconf's macro by the same name. This version
2149 dnl uses `ac_lib' rather than `i' for the loop variable, but more importantly
2150 dnl moves the ACTION-IF-FOUND ([$]3) into the inner `if'-block so that it is
2151 dnl run only if one of the listed libraries ends up being used (and not in
2152 dnl the `none required' case.
2153 dnl I hope it's only temporary while we wait for that version to be fixed.
2154 undefine([AC_SEARCH_LIBS])
2156 # AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS,
2157 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
2158 # [OTHER-LIBRARIES])
2159 # --------------------------------------------------------
2160 # Search for a library defining FUNC, if it's not already available.
2161 AC_DEFUN([AC_SEARCH_LIBS],
2163 AC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1],
2165 ac_func_search_save_LIBS=$LIBS
2167 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1='none required'])
2168 if test "$ac_cv_search_$1" = no; then
2169 for ac_lib in $2; do
2170 LIBS="-l$ac_lib $5 $ac_func_search_save_LIBS"
2171 AC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="-l$ac_lib"; break])
2174 LIBS=$ac_func_search_save_LIBS
2177 if test "$ac_cv_search_$1" = no; then :
2180 if test "$ac_cv_search_$1" = 'none required'; then :
2183 LIBS="$ac_cv_search_$1 $LIBS"
2189 # Check for stdbool.h that conforms to C99.
2191 # Copyright (C) 2002 Free Software Foundation, Inc.
2193 # This program is free software; you can redistribute it and/or modify
2194 # it under the terms of the GNU General Public License as published by
2195 # the Free Software Foundation; either version 2, or (at your option)
2196 # any later version.
2198 # This program is distributed in the hope that it will be useful,
2199 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2200 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2201 # GNU General Public License for more details.
2203 # You should have received a copy of the GNU General Public License
2204 # along with this program; if not, write to the Free Software
2205 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2208 AC_DEFUN([AC_HEADER_STDBOOL],
2209 [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
2210 [ac_cv_header_stdbool_h],
2213 #include <stdbool.h>
2215 "error: bool is not defined"
2218 "error: false is not defined"
2221 "error: false is not 0"
2224 "error: false is not defined"
2227 "error: true is not 1"
2229 #ifndef __bool_true_false_are_defined
2230 "error: __bool_true_false_are_defined is not defined"
2233 struct s { _Bool s: 1; _Bool t; } s;
2235 char a[true == 1 ? 1 : -1];
2236 char b[false == 0 ? 1 : -1];
2237 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
2238 char d[(bool) -0.5 == true ? 1 : -1];
2240 char f[(_Bool) -0.0 == false ? 1 : -1];
2242 char h[sizeof (_Bool)];
2245 [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
2246 [ac_cv_header_stdbool_h=yes],
2247 [ac_cv_header_stdbool_h=no])])
2248 if test $ac_cv_header_stdbool_h = yes; then
2249 AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
2253 # Copyright 1996, 1997, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
2255 # This program is free software; you can redistribute it and/or modify
2256 # it under the terms of the GNU General Public License as published by
2257 # the Free Software Foundation; either version 2, or (at your option)
2258 # any later version.
2260 # This program is distributed in the hope that it will be useful,
2261 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2262 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2263 # GNU General Public License for more details.
2265 # You should have received a copy of the GNU General Public License
2266 # along with this program; if not, write to the Free Software
2267 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2272 AC_DEFUN([AM_C_PROTOTYPES],
2273 [AC_REQUIRE([AM_PROG_CC_STDC])
2274 AC_REQUIRE([AC_PROG_CPP])
2275 AC_MSG_CHECKING([for function prototypes])
2276 if test "$am_cv_prog_cc_stdc" != no; then
2278 AC_DEFINE(PROTOTYPES,1,[Define if compiler has function prototypes])
2282 U=_ ANSI2KNR=./ansi2knr
2284 # Ensure some checks needed by ansi2knr itself.
2286 AC_CHECK_HEADERS(string.h)
2288 AC_SUBST(ANSI2KNR)dnl
2291 AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
2294 # Copyright 1996, 1997, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
2296 # This program is free software; you can redistribute it and/or modify
2297 # it under the terms of the GNU General Public License as published by
2298 # the Free Software Foundation; either version 2, or (at your option)
2299 # any later version.
2301 # This program is distributed in the hope that it will be useful,
2302 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2303 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2304 # GNU General Public License for more details.
2306 # You should have received a copy of the GNU General Public License
2307 # along with this program; if not, write to the Free Software
2308 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
2313 # @defmac AC_PROG_CC_STDC
2314 # @maindex PROG_CC_STDC
2316 # If the C compiler in not in ANSI C mode by default, try to add an option
2317 # to output variable @code{CC} to make it so. This macro tries various
2318 # options that select ANSI C on some system or another. It considers the
2319 # compiler to be in ANSI C mode if it handles function prototypes correctly.
2321 # If you use this macro, you should check after calling it whether the C
2322 # compiler has been set to accept ANSI C; if not, the shell variable
2323 # @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source
2324 # code in ANSI C, you can make an un-ANSIfied copy of it by using the
2325 # program @code{ansi2knr}, which comes with Ghostscript.
2328 AC_DEFUN([AM_PROG_CC_STDC],
2329 [AC_REQUIRE([AC_PROG_CC])
2330 AC_BEFORE([$0], [AC_C_INLINE])
2331 AC_BEFORE([$0], [AC_C_CONST])
2332 dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require
2333 dnl a magic option to avoid problems with ANSI preprocessor commands
2335 dnl FIXME: can't do this because then AC_AIX won't work due to a
2336 dnl circular dependency.
2337 dnl AC_BEFORE([$0], [AC_PROG_CPP])
2338 AC_MSG_CHECKING([for ${CC-cc} option to accept ANSI C])
2339 AC_CACHE_VAL(am_cv_prog_cc_stdc,
2340 [am_cv_prog_cc_stdc=no
2342 # Don't try gcc -ansi; that turns off useful extensions and
2343 # breaks some systems' header files.
2344 # AIX -qlanglvl=ansi
2345 # Ultrix and OSF/1 -std1
2346 # HP-UX 10.20 and later -Ae
2347 # HP-UX older versions -Aa -D_HPUX_SOURCE
2348 # SVR4 -Xc -D__EXTENSIONS__
2349 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2351 CC="$ac_save_CC $ac_arg"
2353 [#include <stdarg.h>
2355 #include <sys/types.h>
2356 #include <sys/stat.h>
2357 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
2358 struct buf { int x; };
2359 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2360 static char *e (p, i)
2366 static char *f (char * (*g) (char **, int), char **p, ...)
2371 s = g (p, va_arg (v,int));
2375 int test (int i, double x);
2376 struct s1 {int (*f) (int a);};
2377 struct s2 {int (*f) (double a);};
2378 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2382 return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
2384 [am_cv_prog_cc_stdc="$ac_arg"; break])
2388 if test -z "$am_cv_prog_cc_stdc"; then
2389 AC_MSG_RESULT([none needed])
2391 AC_MSG_RESULT([$am_cv_prog_cc_stdc])
2393 case "x$am_cv_prog_cc_stdc" in
2395 *) CC="$CC $am_cv_prog_cc_stdc" ;;
2399 AU_DEFUN([fp_PROG_CC_STDC], [AM_PROG_CC_STDC])
2403 dnl From Paul Eggert.
2407 # Define intmax_t to long or long long if <inttypes.h> doesn't define.
2409 AC_DEFUN([jm_AC_TYPE_INTMAX_T],
2411 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
2412 AC_CHECK_TYPE(intmax_t, ,
2413 [test $ac_cv_type_long_long = yes \
2414 && ac_type='long long' \
2416 AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
2417 [Define to widest signed type if <inttypes.h> doesn't define.])])
2420 # Define uintmax_t to unsigned long or unsigned long long
2421 # if <inttypes.h> doesn't define.
2423 AC_DEFUN([jm_AC_TYPE_UINTMAX_T],
2425 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
2426 AC_CHECK_TYPE(uintmax_t, ,
2427 [test $ac_cv_type_unsigned_long_long = yes \
2428 && ac_type='unsigned long long' \
2429 || ac_type='unsigned long'
2430 AC_DEFINE_UNQUOTED(uintmax_t, $ac_type,
2431 [Define to widest unsigned type if <inttypes.h> doesn't define.])])
2436 dnl From Paul Eggert.
2438 # Define HAVE_LONG_LONG if 'long long' works.
2440 AC_DEFUN([jm_AC_TYPE_LONG_LONG],
2442 AC_CACHE_CHECK([for long long], ac_cv_type_long_long,
2443 [AC_TRY_LINK([long long ll = 1; int i = 63;],
2444 [long long llmax = (long long) -1;
2445 return ll << i | ll >> i | llmax / ll | llmax % ll;],
2446 ac_cv_type_long_long=yes,
2447 ac_cv_type_long_long=no)])
2448 if test $ac_cv_type_long_long = yes; then
2449 AC_DEFINE(HAVE_LONG_LONG, 1,
2450 [Define if you have the long long type.])
2454 # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
2456 AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
2458 AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
2459 [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
2460 [unsigned long long ullmax = (unsigned long long) -1;
2461 return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
2462 ac_cv_type_unsigned_long_long=yes,
2463 ac_cv_type_unsigned_long_long=no)])
2464 if test $ac_cv_type_unsigned_long_long = yes; then
2465 AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
2466 [Define if you have the unsigned long long type.])
2472 AC_DEFUN([jm_FUNC_MEMCMP],
2473 [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
2474 if test $ac_cv_func_memcmp_working = no; then
2475 AC_DEFINE(memcmp, rpl_memcmp,
2476 [Define to rpl_memcmp if the replacement function should be used.])
2480 # getcwd.m4 - check whether getcwd (NULL, 0) allocates memory for result
2482 # Copyright 2001 Free Software Foundation, Inc.
2484 # This program is free software; you can redistribute it and/or modify
2485 # it under the terms of the GNU General Public License as published by
2486 # the Free Software Foundation; either version 2, or (at your option)
2487 # any later version.
2489 # This program is distributed in the hope that it will be useful,
2490 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2491 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2492 # GNU General Public License for more details.
2494 # You should have received a copy of the GNU General Public License
2495 # along with this program; if not, write to the Free Software Foundation,
2496 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2498 # Written by Paul Eggert.
2500 AC_DEFUN([AC_FUNC_GETCWD_NULL],
2501 [AC_CHECK_HEADERS(stdlib.h unistd.h)
2502 AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
2503 [ac_cv_func_getcwd_null],
2506 # ifdef HAVE_STDLIB_H
2507 # include <stdlib.h>
2509 # ifdef HAVE_UNISTD_H
2510 # include <unistd.h>
2518 if (chdir ("/") != 0)
2522 char *f = getcwd (NULL, 0);
2523 exit (! (f && f[0] == '/' && !f[1]));
2526 [ac_cv_func_getcwd_null=yes],
2527 [ac_cv_func_getcwd_null=no],
2528 [ac_cv_func_getcwd_null=no])])
2529 if test $ac_cv_func_getcwd_null = yes; then
2530 AC_DEFINE(HAVE_GETCWD_NULL, 1,
2531 [Define if getcwd (NULL, 0) allocates memory for result.])
2536 dnl Find out how to get the file descriptor associated with an open DIR*.
2537 dnl From Jim Meyering
2539 AC_DEFUN([UTILS_FUNC_DIRFD],
2541 dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
2542 AC_REQUIRE([AC_PROG_CPP])
2543 AC_REQUIRE([AC_PROG_EGREP])
2548 # include <dirent.h>
2549 #else /* not HAVE_DIRENT_H */
2550 # define dirent direct
2551 # if HAVE_SYS_NDIR_H
2552 # include <sys/ndir.h>
2553 # endif /* HAVE_SYS_NDIR_H */
2555 # include <sys/dir.h>
2556 # endif /* HAVE_SYS_DIR_H */
2559 # endif /* HAVE_NDIR_H */
2560 #endif /* HAVE_DIRENT_H */
2562 AC_CHECK_FUNCS(dirfd)
2563 AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
2565 AC_CACHE_CHECK([whether dirfd is a macro],
2566 jm_cv_func_dirfd_macro,
2567 AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
2569 dirent_header_defines_dirfd
2571 jm_cv_func_dirfd_macro=yes,
2572 jm_cv_func_dirfd_macro=no))
2574 # Use the replacement only if we have no function, macro,
2575 # or declaration with that name.
2576 if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
2578 AC_REPLACE_FUNCS([dirfd])
2580 [how to get the file descriptor associated with an open DIR*],
2581 gl_cv_sys_dir_fd_member_name,
2583 dirfd_save_CFLAGS=$CFLAGS
2584 for ac_expr in d_fd dd_fd; do
2586 CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
2590 [DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;],
2593 CFLAGS=$dirfd_save_CFLAGS
2594 test "$dir_fd_found" = yes && break
2596 test "$dir_fd_found" = yes || ac_expr=no_such_member
2598 gl_cv_sys_dir_fd_member_name=$ac_expr
2601 if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
2602 AC_DEFINE_UNQUOTED(DIR_FD_MEMBER_NAME,
2603 $gl_cv_sys_dir_fd_member_name,
2604 [the name of the file descriptor member of DIR])
2606 AH_VERBATIM(DIR_TO_FD,
2607 [#ifdef DIR_FD_MEMBER_NAME
2608 # define DIR_TO_FD(Dir_p) ((Dir_p)->DIR_FD_MEMBER_NAME)
2610 # define DIR_TO_FD(Dir_p) -1
2617 # acl.m4 - check for access control list (ACL) primitives
2619 # Copyright (C) 2002 Free Software Foundation, Inc.
2621 # This program is free software; you can redistribute it and/or modify
2622 # it under the terms of the GNU General Public License as published by
2623 # the Free Software Foundation; either version 2, or (at your option)
2624 # any later version.
2626 # This program is distributed in the hope that it will be useful,
2627 # but WITHOUT ANY WARRANTY; without even the implied warranty of
2628 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2629 # GNU General Public License for more details.
2631 # You should have received a copy of the GNU General Public License
2632 # along with this program; if not, write to the Free Software Foundation,
2633 # Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
2635 # Written by Paul Eggert.
2637 AC_DEFUN([AC_FUNC_ACL],
2638 [AC_CHECK_HEADERS(sys/acl.h)
2639 AC_CHECK_FUNCS(acl)])
2642 # Use the replacement ftw.c if the one in the C library is inadequate or buggy.
2643 # For now, we always use the code in lib/ because libc doesn't have the FTW_DCH
2644 # or FTW_DCHP that we need. Arrange to use lib/ftw.h. And since that
2645 # implementation uses tsearch.c/tdestroy, add tsearch.o to the list of
2646 # objects and arrange to use lib/search.h if necessary.
2649 AC_DEFUN([AC_FUNC_FTW],
2652 AC_REQUIRE([AC_HEADER_STAT])
2653 AC_REQUIRE([jm_FUNC_LSTAT])
2654 AC_REQUIRE([AC_HEADER_DIRENT])
2655 AC_CHECK_HEADERS(sys/param.h)
2656 AC_CHECK_DECLS([stpcpy])
2658 # In the event that we have to use the replacement ftw.c,
2659 # see if we'll also need the replacement tsearch.c.
2660 AC_CHECK_FUNC([tdestroy], , [need_tdestroy=1])
2662 AC_CACHE_CHECK([for ftw/FTW_CHDIR that informs callback of failed chdir],
2663 ac_cv_func_ftw_working,
2665 # The following test would fail prior to glibc-2.3.2, because `depth'
2666 # would be 2 rather than 4. Of course, now that we require FTW_DCH
2667 # and FTW_DCHP, this test fails even with GNU libc's fixed ftw.
2668 mkdir -p conftest.dir/a/b/c
2669 AC_RUN_IFELSE([AC_LANG_SOURCE([[
2674 static char *_f[] = { "conftest.dir", "conftest.dir/a",
2675 "conftest.dir/a/b", "conftest.dir/a/b/c" };
2676 static char **p = _f;
2680 cb (const char *file, const struct stat *sb, int file_type, struct FTW *info)
2682 if (strcmp (file, *p++) != 0)
2691 /* Require these symbols, too. */
2695 int err = nftw ("conftest.dir", cb, 30, FTW_PHYS | FTW_MOUNT | FTW_CHDIR);
2696 exit ((err == 0 && depth == 4) ? 0 : 1);
2699 [ac_cv_func_ftw_working=yes],
2700 [ac_cv_func_ftw_working=no],
2701 [ac_cv_func_ftw_working=no])])
2703 if test $ac_cv_func_ftw_working = no; then
2705 AC_CONFIG_LINKS([$ac_config_libobj_dir/ftw.h:$ac_config_libobj_dir/ftw_.h])
2706 # Add tsearch.o IFF we have to use the replacement ftw.c.
2707 if test -n "$need_tdestroy"; then
2708 AC_LIBOBJ([tsearch])
2709 # Link search.h to search_.h if we use the replacement tsearch.c.
2711 [$ac_config_libobj_dir/search.h:$ac_config_libobj_dir/search_.h])
2718 dnl From Jim Meyering.
2719 dnl Determine whether lstat has the bug that it succeeds when given the
2720 dnl zero-length file name argument. The lstat from SunOS4.1.4 and the Hurd
2721 dnl (as of 1998-11-01) do this.
2723 dnl If it does, then define HAVE_LSTAT_EMPTY_STRING_BUG and arrange to
2724 dnl compile the wrapper function.
2727 AC_DEFUN([jm_FUNC_LSTAT],
2729 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2730 AC_CACHE_CHECK([whether lstat accepts an empty string],
2731 jm_cv_func_lstat_empty_string_bug,
2733 # include <sys/types.h>
2734 # include <sys/stat.h>
2740 exit (lstat ("", &sbuf) ? 1 : 0);
2743 jm_cv_func_lstat_empty_string_bug=yes,
2744 jm_cv_func_lstat_empty_string_bug=no,
2745 dnl When crosscompiling, assume lstat is broken.
2746 jm_cv_func_lstat_empty_string_bug=yes)
2748 if test $jm_cv_func_lstat_empty_string_bug = yes; then
2750 AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
2751 [Define if lstat has the bug that it succeeds when given the zero-length
2752 file name argument. The lstat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2759 dnl From Jim Meyering.
2760 dnl Provide lchown on systems that lack it.
2762 AC_DEFUN([jm_FUNC_LCHOWN],
2764 AC_REQUIRE([AC_TYPE_UID_T])
2765 AC_REPLACE_FUNCS(lchown)
2770 # When rmdir fails because the specified directory is not empty, it sets
2771 # errno to some value, usually ENOTEMPTY. However, on some AIX systems,
2772 # ENOTEMPTY is mistakenly defined to be EEXIST. To work around this, and
2773 # in general, to avoid depending on the use of any particular symbol, this
2774 # test runs a test to determine the actual numeric value.
2775 AC_DEFUN([fetish_FUNC_RMDIR_NOTEMPTY],
2777 AC_CACHE_CHECK([for rmdir-not-empty errno value],
2778 fetish_cv_func_rmdir_errno_not_empty,
2780 # Arrange for deletion of the temporary directory this test creates.
2781 ac_clean_files="$ac_clean_files confdir2"
2782 mkdir confdir2; : > confdir2/file
2795 s = fopen ("confdir2/errno", "w");
2796 fprintf (s, "%d\n", val);
2800 fetish_cv_func_rmdir_errno_not_empty=`cat confdir2/errno`,
2801 fetish_cv_func_rmdir_errno_not_empty='configure error in rmdir-errno.m4',
2802 fetish_cv_func_rmdir_errno_not_empty=ENOTEMPTY
2807 AC_DEFINE_UNQUOTED([RMDIR_ERRNO_NOT_EMPTY],
2808 $fetish_cv_func_rmdir_errno_not_empty,
2809 [the value to which errno is set when rmdir fails on a nonempty directory])
2814 dnl From Jim Meyering.
2815 dnl Determine whether chown accepts arguments of -1 for uid and gid.
2816 dnl If it doesn't, arrange to use the replacement function.
2819 AC_DEFUN([jm_FUNC_CHOWN],
2820 [AC_REQUIRE([AC_TYPE_UID_T])dnl
2821 test -z "$ac_cv_header_unistd_h" \
2822 && AC_CHECK_HEADERS(unistd.h)
2823 AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
2825 # include <sys/types.h>
2826 # include <sys/stat.h>
2828 # ifdef HAVE_UNISTD_H
2829 # include <unistd.h>
2835 char *f = "conftest.chown";
2836 struct stat before, after;
2838 if (creat (f, 0600) < 0)
2840 if (stat (f, &before) < 0)
2842 if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
2844 if (stat (f, &after) < 0)
2846 exit ((before.st_uid == after.st_uid
2847 && before.st_gid == after.st_gid) ? 0 : 1);
2850 jm_cv_func_working_chown=yes,
2851 jm_cv_func_working_chown=no,
2852 dnl When crosscompiling, assume chown is broken.
2853 jm_cv_func_working_chown=no)
2855 if test $jm_cv_func_working_chown = no; then
2857 AC_DEFINE(chown, rpl_chown,
2858 [Define to rpl_chown if the replacement function should be used.])
2864 dnl From Jim Meyering.
2865 dnl A wrapper around AC_FUNC_MKTIME.
2867 AC_DEFUN([jm_FUNC_MKTIME],
2868 [AC_REQUIRE([AC_FUNC_MKTIME])dnl
2870 dnl mktime.c uses localtime_r if it exists. Check for it.
2871 AC_CHECK_FUNCS(localtime_r)
2873 if test $ac_cv_func_working_mktime = no; then
2874 AC_DEFINE(mktime, rpl_mktime,
2875 [Define to rpl_mktime if the replacement function should be used.])
2881 dnl From Jim Meyering.
2882 dnl Determine whether stat has the bug that it succeeds when given the
2883 dnl zero-length file name argument. The stat from SunOS4.1.4 and the Hurd
2884 dnl (as of 1998-11-01) do this.
2886 dnl If it does, then define HAVE_STAT_EMPTY_STRING_BUG and arrange to
2887 dnl compile the wrapper function.
2890 AC_DEFUN([jm_FUNC_STAT],
2892 AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
2893 AC_CACHE_CHECK([whether stat accepts an empty string],
2894 jm_cv_func_stat_empty_string_bug,
2896 # include <sys/types.h>
2897 # include <sys/stat.h>
2903 exit (stat ("", &sbuf) ? 1 : 0);
2906 jm_cv_func_stat_empty_string_bug=yes,
2907 jm_cv_func_stat_empty_string_bug=no,
2908 dnl When crosscompiling, assume stat is broken.
2909 jm_cv_func_stat_empty_string_bug=yes)
2911 if test $jm_cv_func_stat_empty_string_bug = yes; then
2913 AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
2914 [Define if stat has the bug that it succeeds when given the zero-length
2915 file name argument. The stat from SunOS4.1.4 and the Hurd as of 1998-11-01)
2922 dnl From Jim Meyering.
2923 dnl Check for the nanosleep function.
2924 dnl If not found, use the supplied replacement.
2927 AC_DEFUN([jm_FUNC_NANOSLEEP],
2929 nanosleep_save_libs=$LIBS
2931 # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
2932 # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
2933 AC_SEARCH_LIBS(nanosleep, [rt posix4], [LIB_NANOSLEEP=$ac_cv_search_nanosleep])
2934 AC_SUBST(LIB_NANOSLEEP)
2936 AC_CACHE_CHECK([whether nanosleep works],
2937 jm_cv_func_nanosleep_works,
2939 AC_REQUIRE([AC_HEADER_TIME])
2941 # if TIME_WITH_SYS_TIME
2942 # include <sys/time.h>
2945 # if HAVE_SYS_TIME_H
2946 # include <sys/time.h>
2955 struct timespec ts_sleep, ts_remaining;
2956 ts_sleep.tv_sec = 0;
2957 ts_sleep.tv_nsec = 1;
2958 exit (nanosleep (&ts_sleep, &ts_remaining) == 0 ? 0 : 1);
2961 jm_cv_func_nanosleep_works=yes,
2962 jm_cv_func_nanosleep_works=no,
2963 dnl When crosscompiling, assume the worst.
2964 jm_cv_func_nanosleep_works=no)
2966 if test $jm_cv_func_nanosleep_works = no; then
2967 AC_LIBOBJ(nanosleep)
2968 AC_DEFINE(nanosleep, rpl_nanosleep,
2969 [Define to rpl_nanosleep if the replacement function should be used.])
2972 LIBS=$nanosleep_save_libs
2975 #serial 7 -*- autoconf -*-
2977 dnl From Jim Meyering.
2979 dnl See if the glibc *_unlocked I/O macros are available.
2980 dnl Use only those *_unlocked macros that are declared.
2983 AC_DEFUN([jm_FUNC_GLIBC_UNLOCKED_IO],
2985 [clearerr_unlocked, feof_unlocked, ferror_unlocked,
2986 fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
2987 fread_unlocked, fwrite_unlocked, getc_unlocked,
2988 getchar_unlocked, putc_unlocked, putchar_unlocked])])
2992 dnl Written by Jim Meyering
2994 AC_DEFUN([jm_FUNC_GROUP_MEMBER],
2996 dnl Do this replacement check manually because I want the hyphen
2997 dnl (not the underscore) in the filename.
2998 AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
3004 dnl From Jim Meyering.
3006 dnl Check whether putenv ("FOO") removes FOO from the environment.
3007 dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
3010 AC_DEFUN([jm_FUNC_PUTENV],
3011 [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
3016 /* Put it in env. */
3017 if (putenv ("CONFTEST_putenv=val"))
3020 /* Try to remove it. */
3021 if (putenv ("CONFTEST_putenv"))
3024 /* Make sure it was deleted. */
3025 if (getenv ("CONFTEST_putenv") != 0)
3031 jm_cv_func_svid_putenv=yes,
3032 jm_cv_func_svid_putenv=no,
3033 dnl When crosscompiling, assume putenv is broken.
3034 jm_cv_func_svid_putenv=no)
3036 if test $jm_cv_func_svid_putenv = no; then
3038 AC_DEFINE(putenv, rpl_putenv,
3039 [Define to rpl_putenv if the replacement function should be used.])
3047 AC_MSG_CHECKING(for AFS)
3048 if test -d /afs; then
3049 AC_DEFINE(AFS, 1, [Define if you have the Andrew File System.])
3054 AC_MSG_RESULT($ac_result)
3059 # autoconf tests required for use of xstrtoumax.c
3061 AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
3063 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3064 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3065 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3066 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3067 AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
3068 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3070 AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
3071 jm_cv_func_strtoumax_macro,
3072 AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
3074 inttypes_h_defines_strtoumax
3076 jm_cv_func_strtoumax_macro=yes,
3077 jm_cv_func_strtoumax_macro=no))
3079 if test "$jm_cv_func_strtoumax_macro" != yes; then
3080 AC_REPLACE_FUNCS(strtoumax)
3083 dnl Only the replacement strtoumax invokes strtoul and strtoull,
3084 dnl so we need the replacements only if strtoumax does not exist.
3085 case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
3087 AC_REPLACE_FUNCS(strtoul)
3089 dnl We don't need (and can't compile) the replacement strtoull
3090 dnl unless the type `unsigned long long' exists.
3091 if test "$ac_cv_type_unsigned_long_long" = yes; then
3092 AC_REPLACE_FUNCS(strtoull)
3099 dnl Cloned from xstrtoumax.m4. Keep these files in sync.
3101 # autoconf tests required for use of xstrtoimax.c
3103 AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
3105 AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
3106 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
3107 AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
3108 AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
3109 AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
3110 AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
3112 AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
3113 jm_cv_func_strtoimax_macro,
3114 AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
3116 inttypes_h_defines_strtoimax
3118 jm_cv_func_strtoimax_macro=yes,
3119 jm_cv_func_strtoimax_macro=no))
3121 if test "$jm_cv_func_strtoimax_macro" != yes; then
3122 AC_REPLACE_FUNCS(strtoimax)
3125 dnl Only the replacement strtoimax invokes strtol and strtoll,
3126 dnl so we need the replacements only if strtoimax does not exist.
3127 case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
3129 AC_REPLACE_FUNCS(strtol)
3131 dnl We don't need (and can't compile) the replacement strtoll
3132 dnl unless the type `long long' exists.
3133 if test "$ac_cv_type_long_long" = yes; then
3134 AC_REPLACE_FUNCS(strtoll)
3141 dnl Run a program to determine whether whether link(2) follows symlinks.
3142 dnl Set LINK_FOLLOWS_SYMLINKS accordingly.
3144 AC_DEFUN([jm_AC_FUNC_LINK_FOLLOWS_SYMLINK],
3147 [whether link(2) dereferences a symlink specified with a trailing slash],
3148 jm_ac_cv_func_link_follows_symlink,
3150 dnl poor-man's AC_REQUIRE: FIXME: repair this once autoconf-3 provides
3151 dnl the appropriate framework.
3152 test -z "$ac_cv_header_unistd_h" \
3153 && AC_CHECK_HEADERS(unistd.h)
3155 # Create a regular file.
3156 echo > conftest.file
3159 # include <sys/types.h>
3160 # include <sys/stat.h>
3161 # ifdef HAVE_UNISTD_H
3162 # include <unistd.h>
3165 # define SAME_INODE(Stat_buf_1, Stat_buf_2) \
3166 ((Stat_buf_1).st_ino == (Stat_buf_2).st_ino \
3167 && (Stat_buf_1).st_dev == (Stat_buf_2).st_dev)
3172 const char *file = "conftest.file";
3173 const char *sym = "conftest.sym";
3174 const char *hard = "conftest.hard";
3175 struct stat sb_file, sb_hard;
3177 /* Create a symlink to the regular file. */
3178 if (symlink (file, sym))
3181 /* Create a hard link to that symlink. */
3182 if (link (sym, hard))
3185 if (lstat (hard, &sb_hard))
3187 if (lstat (file, &sb_file))
3190 /* If the dev/inode of hard and file are the same, then
3191 the link call followed the symlink. */
3192 return SAME_INODE (sb_hard, sb_file) ? 0 : 1;
3195 jm_ac_cv_func_link_follows_symlink=yes,
3196 jm_ac_cv_func_link_follows_symlink=no,
3197 jm_ac_cv_func_link_follows_symlink=yes dnl We're cross compiling.
3200 if test $jm_ac_cv_func_link_follows_symlink = yes; then
3201 AC_DEFINE(LINK_FOLLOWS_SYMLINKS, 1,
3202 [Define if `link(2)' dereferences symbolic links.])
3208 dnl This macro is intended to be used solely in this file.
3209 dnl These are the prerequisite macros for GNU's strftime.c replacement.
3210 AC_DEFUN([_jm_STRFTIME_PREREQS],
3212 dnl strftime.c uses localtime_r and the underyling system strftime
3214 AC_CHECK_FUNCS(localtime_r strftime)
3216 AC_CHECK_HEADERS(limits.h)
3217 AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
3219 # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
3222 AC_CHECK_FUNCS(mblen mbrlen)
3224 AC_CHECK_MEMBER([struct tm.tm_gmtoff],
3225 [AC_DEFINE(HAVE_TM_GMTOFF, 1,
3226 [Define if struct tm has the tm_gmtoff member.])],
3228 [#include <time.h>])
3231 dnl From Jim Meyering.
3233 AC_DEFUN([jm_FUNC_GNU_STRFTIME],
3234 [AC_REQUIRE([AC_HEADER_TIME])dnl
3236 _jm_STRFTIME_PREREQS
3238 AC_REQUIRE([AC_C_CONST])dnl
3239 AC_REQUIRE([AC_HEADER_STDC])dnl
3240 AC_CHECK_HEADERS(sys/time.h)
3241 AC_DEFINE([my_strftime], [nstrftime],
3242 [Define to the name of the strftime replacement function.])
3245 AC_DEFUN([jm_FUNC_STRFTIME],
3247 _jm_STRFTIME_PREREQS
3252 dnl From Jim Meyering
3253 dnl Using code from emacs, based on suggestions from Paul Eggert
3254 dnl and Ulrich Drepper.
3256 dnl Find out how to determine the number of pending output bytes on a stream.
3257 dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems,
3258 dnl we have to grub around in the FILE struct.
3260 AC_DEFUN([jm_FUNC_FPENDING],
3262 AC_CHECK_HEADERS(stdio_ext.h)
3263 AC_REPLACE_FUNCS([__fpending])
3265 # if HAVE_STDIO_EXT_H
3266 # include <stdio_ext.h>
3269 AC_CHECK_DECLS([__fpending], , , $fp_headers)
3270 if test $ac_cv_func___fpending = no; then
3272 [how to determine the number of pending output bytes on a stream],
3273 ac_cv_sys_pending_output_n_bytes,
3278 'fp->_IO_write_ptr - fp->_IO_write_base' \
3280 '# traditional Unix' \
3281 'fp->_ptr - fp->_base' \
3284 'fp->_p - fp->_bf._base' \
3287 'fp->__ptr - fp->__base' \
3290 'fp->__bufp - fp->__buffer' \
3292 '# old glibc iostream?' \
3293 'fp->_pptr - fp->_pbase' \
3296 '(*fp)->_ptr - (*fp)->_base' \
3298 '# e.g., DGUX R4.11; the info is not available' \
3302 # Skip each embedded comment.
3303 case "$ac_expr" in '#'*) continue;; esac
3308 [FILE *fp = stdin; (void) ($ac_expr);],
3311 test "$fp_done" = yes && break
3314 ac_cv_sys_pending_output_n_bytes=$ac_expr
3317 AC_DEFINE_UNQUOTED(PENDING_OUTPUT_N_BYTES,
3318 $ac_cv_sys_pending_output_n_bytes,
3319 [the number of pending output bytes on stream `fp'])
3323 # inttypes-pri.m4 serial 1001 (based on gettext-0.11.4's `serial 1')
3324 dnl Copyright (C) 1997-2002 Free Software Foundation, Inc.
3325 dnl This file is free software, distributed under the terms of the GNU
3326 dnl General Public License. As a special exception to the GNU General
3327 dnl Public License, this file may be distributed as part of a program
3328 dnl that contains a configuration script generated by Autoconf, under
3329 dnl the same distribution terms as the rest of that program.
3331 dnl From Bruno Haible.
3333 # Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
3334 # macros to non-string values. This is the case on AIX 4.3.3.
3336 AC_DEFUN([gt_INTTYPES_PRI],
3338 # autoconf-2.52 has a proper check for inttypes.h.
3341 if test $ac_cv_header_inttypes_h = yes; then
3342 AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
3343 gt_cv_inttypes_pri_broken,
3345 AC_TRY_COMPILE([#include <inttypes.h>
3349 ], [], gt_cv_inttypes_pri_broken=no, gt_cv_inttypes_pri_broken=yes)
3352 if test "$gt_cv_inttypes_pri_broken" = yes; then
3353 AC_DEFINE_UNQUOTED(PRI_MACROS_BROKEN, 1,
3354 [Define if <inttypes.h> exists and defines unusable PRI* macros.])
3360 dnl From Jim Meyering.
3361 dnl A wrapper around AC_FUNC_GETGROUPS.
3363 AC_DEFUN([jm_FUNC_GETGROUPS],
3364 [AC_REQUIRE([AC_FUNC_GETGROUPS])dnl
3365 if test $ac_cv_func_getgroups_works = no; then
3366 AC_LIBOBJ(getgroups)
3367 AC_DEFINE(getgroups, rpl_getgroups,
3368 [Define as rpl_getgroups if getgroups doesn't work right.])
3370 test -n "$GETGROUPS_LIB" && LIBS="$GETGROUPS_LIB $LIBS"
3377 AC_DEFUN([jm_SYS_PROC_UPTIME],
3378 [ dnl Require AC_PROG_CC to see if we're cross compiling.
3379 AC_REQUIRE([AC_PROG_CC])
3380 AC_CACHE_CHECK([for /proc/uptime], jm_cv_have_proc_uptime,
3381 [jm_cv_have_proc_uptime=no
3382 test -f /proc/uptime \
3383 && test "$cross_compiling" = no \
3384 && cat < /proc/uptime >/dev/null 2>/dev/null \
3385 && jm_cv_have_proc_uptime=yes])
3386 if test $jm_cv_have_proc_uptime = yes; then
3387 AC_DEFINE(HAVE_PROC_UPTIME, 1,
3388 [ Define if your system has the /proc/uptime special file.])
3394 # See if we need to emulate a missing ftruncate function using fcntl or chsize.
3396 AC_DEFUN([jm_FUNC_FTRUNCATE],
3398 AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
3400 if test "$ftruncate_missing" = yes; then
3401 AC_CHECK_HEADERS([unistd.h])
3402 AC_CHECK_FUNCS([chsize])
3403 AC_LIBOBJ(ftruncate)
3409 dnl From Volker Borchert.
3410 dnl Determine whether rename works for source paths with a trailing slash.
3411 dnl The rename from SunOS 4.1.1_U1 doesn't.
3413 dnl If it doesn't, then define RENAME_TRAILING_SLASH_BUG and arrange
3414 dnl to compile the wrapper function.
3417 AC_DEFUN([vb_FUNC_RENAME],
3419 AC_CACHE_CHECK([whether rename is broken],
3420 vb_cv_func_rename_trailing_slash_bug,
3422 rm -rf conftest.d1 conftest.d2
3423 mkdir conftest.d1 ||
3424 AC_MSG_ERROR([cannot create temporary directory])
3430 exit (rename ("conftest.d1/", "conftest.d2") ? 1 : 0);
3433 vb_cv_func_rename_trailing_slash_bug=no,
3434 vb_cv_func_rename_trailing_slash_bug=yes,
3435 dnl When crosscompiling, assume rename is broken.
3436 vb_cv_func_rename_trailing_slash_bug=yes)
3438 rm -rf conftest.d1 conftest.d2
3440 if test $vb_cv_func_rename_trailing_slash_bug = yes; then
3442 AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
3443 [Define if rename does not work for source paths with a trailing slash,
3444 like the one from SunOS 4.1.1_U1.])
3450 # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has the
3451 # silly limit that it can create no more than 26 files from a given template.
3452 # Other systems lack mkstemp altogether. On either type of system, arrange
3453 # to use the replacement function.
3454 AC_DEFUN([UTILS_FUNC_MKSTEMP],
3456 AC_REPLACE_FUNCS(mkstemp)
3457 if test $ac_cv_func_mkstemp = no; then
3458 utils_cv_func_mkstemp_limitations=yes
3460 AC_CACHE_CHECK([for mkstemp limitations],
3461 utils_cv_func_mkstemp_limitations,
3464 # include <stdlib.h>
3468 for (i = 0; i < 30; i++)
3470 char template[] = "conftestXXXXXX";
3471 int fd = mkstemp (template);
3479 utils_cv_func_mkstemp_limitations=no,
3480 utils_cv_func_mkstemp_limitations=yes,
3481 utils_cv_func_mkstemp_limitations=yes
3487 if test $utils_cv_func_mkstemp_limitations = yes; then
3490 AC_DEFINE(mkstemp, rpl_mkstemp,
3491 [Define to rpl_mkstemp if the replacement function should be used.])
3497 dnl From Jim Meyering.
3499 dnl See if gettimeofday clobbers the static buffer that localtime uses
3500 dnl for it's return value. The gettimeofday function from Mac OS X 10.0.4,
3501 dnl i.e. Darwin 1.3.7 has this problem.
3503 dnl If it does, then arrange to use gettimeofday and localtime only via
3504 dnl the wrapper functions that work around the problem.
3506 AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
3508 AC_REQUIRE([AC_HEADER_TIME])
3509 AC_CHECK_HEADERS(string.h stdlib.h)
3510 AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
3511 jm_cv_func_gettimeofday_clobber,
3515 # include <string.h>
3518 #if TIME_WITH_SYS_TIME
3519 # include <sys/time.h>
3522 # if HAVE_SYS_TIME_H
3523 # include <sys/time.h>
3530 # include <stdlib.h>
3540 lt = localtime (&t);
3542 gettimeofday (&tv, NULL);
3543 if (memcmp (lt, &saved_lt, sizeof (struct tm)) != 0)
3549 jm_cv_func_gettimeofday_clobber=no,
3550 jm_cv_func_gettimeofday_clobber=yes,
3551 dnl When crosscompiling, assume it is broken.
3552 jm_cv_func_gettimeofday_clobber=yes)
3554 if test $jm_cv_func_gettimeofday_clobber = yes; then
3555 AC_LIBOBJ(gettimeofday)
3556 AC_DEFINE(localtime, rpl_localtime,
3557 [Define to rpl_localtime if the replacement function should be used.])
3558 AC_DEFINE(gettimeofday, rpl_gettimeofday,
3559 [Define to rpl_gettimeofday if the replacement function should be used.])
3560 AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
3561 [Define if gettimeofday clobbers localtime's static buffer.])
3567 dnl From Jim Meyering
3568 dnl Replace the utime function on systems that need it.
3572 AC_DEFUN([jm_FUNC_UTIME],
3574 AC_CHECK_HEADERS(utime.h)
3575 AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
3576 AC_REQUIRE([AC_FUNC_UTIME_NULL])
3578 if test $ac_cv_func_utime_null = no; then
3580 AC_REPLACE_FUNCS(utime)
3586 dnl Shamelessly cloned from acspecific.m4's AC_FUNC_UTIME_NULL,
3587 dnl then do case-insensitive s/utime/utimes/.
3589 AC_DEFUN([jm_FUNC_UTIMES_NULL],
3590 [AC_CACHE_CHECK(whether utimes accepts a null argument, ac_cv_func_utimes_null,
3591 [rm -f conftest.data; > conftest.data
3593 /* In case stat has been defined to rpl_stat, undef it here. */
3595 #include <sys/types.h>
3596 #include <sys/stat.h>
3599 exit(!(stat ("conftest.data", &s) == 0
3600 && utimes("conftest.data", (long *)0) == 0
3601 && stat("conftest.data", &t) == 0
3602 && t.st_mtime >= s.st_mtime
3603 && t.st_mtime - s.st_mtime < 120));
3605 ac_cv_func_utimes_null=yes,
3606 ac_cv_func_utimes_null=no,
3607 ac_cv_func_utimes_null=no)
3608 rm -f core core.* *.core])
3610 if test $ac_cv_func_utimes_null = yes; then
3611 AC_DEFINE(HAVE_UTIMES_NULL, 1,
3612 [Define if utimes accepts a null argument])
3619 dnl See if there's a working, system-supplied version of the getline function.
3620 dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
3621 dnl have a function by that name in -linet that doesn't have anything
3622 dnl to do with the function we need.
3623 AC_DEFUN([AM_FUNC_GETLINE],
3625 am_getline_needs_run_time_check=no
3626 AC_CHECK_FUNC(getline,
3627 dnl Found it in some library. Verify that it works.
3628 am_getline_needs_run_time_check=yes,
3629 am_cv_func_working_getline=no)
3630 if test $am_getline_needs_run_time_check = yes; then
3631 AC_CACHE_CHECK([for working getline function], am_cv_func_working_getline,
3632 [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
3635 # include <sys/types.h>
3636 # include <string.h>
3638 { /* Based on a test program from Karl Heuer. */
3642 FILE *in = fopen ("./conftest.data", "r");
3645 len = getline (&line, &siz, in);
3646 exit ((len == 4 && line && strcmp (line, "foo\n") == 0) ? 0 : 1);
3648 ], am_cv_func_working_getline=yes dnl The library version works.
3649 , am_cv_func_working_getline=no dnl The library version does NOT work.
3650 , am_cv_func_working_getline=no dnl We're cross compiling.
3654 if test $am_cv_func_working_getline = no; then
3660 # Determine approximately how many files may be open simultaneously
3661 # in one process. This is approximate, since while running this test,
3662 # the configure script already has a few files open.
3665 AC_DEFUN([UTILS_SYS_OPEN_MAX],
3667 AC_CACHE_CHECK([determine how many files may be open simultaneously],
3668 utils_cv_sys_open_max,
3670 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3677 FILE *result = fopen ("conftest.omax", "w");
3679 /* Impose an arbitrary limit, in case some system has no
3680 effective limit on the number of simultaneously open files. */
3683 FILE *s = fopen ("conftest.op", "w");
3688 fprintf (result, "%d\n", i);
3689 exit (fclose (result) == EOF);
3692 [utils_cv_sys_open_max=`cat conftest.omax`],
3693 [utils_cv_sys_open_max='internal error in open-max.m4'],
3694 [utils_cv_sys_open_max='cross compiling run-test in open-max.m4'])])
3696 AC_DEFINE_UNQUOTED([UTILS_OPEN_MAX],
3697 $utils_cv_sys_open_max,
3698 [the maximum number of simultaneously open files per process])
3702 # Check whether getcwd has the bug that it succeeds for a working directory
3703 # longer than PATH_MAX, yet returns a truncated directory name.
3704 # If so, arrange to compile the wrapper function.
3706 # This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
3707 # I've heard that this is due to a Linux kernel bug, and that it has
3708 # been fixed between 2.4.21-pre3 and 2.4.21-pre4. */
3712 AC_DEFUN([GL_FUNC_GETCWD_PATH_MAX],
3714 AC_CACHE_CHECK([whether getcwd properly handles paths longer than PATH_MAX],
3715 gl_cv_func_getcwd_vs_path_max,
3717 AC_CHECK_DECLS([getcwd])
3718 # Arrange for deletion of the temporary directory this test creates.
3719 ac_clean_files="$ac_clean_files confdir3"
3720 AC_RUN_IFELSE([AC_LANG_SOURCE([[
3725 #include <sys/stat.h>
3726 #include <sys/types.h>
3728 /* Don't get link errors because mkdir is redefined to rpl_mkdir. */
3735 /* The extra casts work around common compiler bugs. */
3736 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
3737 /* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
3738 It is necessary at least when t == time_t. */
3739 #define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
3740 ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) : (t) 0))
3741 #define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
3744 # define INT_MAX TYPE_MAXIMUM (int)
3747 /* The length of this name must be 8. */
3748 #define DIR_NAME "confdir3"
3754 /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
3755 at least not on a local file system. And if we were to start worrying
3756 about remote file systems, we'd have to enable the wrapper function
3757 all of the time, just to be safe. That's not worth the cost. */
3759 #elif INT_MAX - 9 <= PATH_MAX
3760 /* The '9', above, comes from strlen (DIR_NAME) + 1. */
3761 /* FIXME: Assuming there's a system for which this is true,
3762 this should be done in a compile test. */
3765 char buf[PATH_MAX + 20];
3766 char *cwd = getcwd (buf, PATH_MAX);
3769 size_t n_chdirs = 0;
3774 cwd_len = strlen (cwd);
3781 cwd_len += 1 + strlen (DIR_NAME);
3782 /* If mkdir or chdir fails, be pessimistic and consider that
3783 as a failure, too. */
3784 if (mkdir (DIR_NAME, 0700) < 0 || chdir (DIR_NAME) < 0)
3789 if ((c = getcwd (buf, PATH_MAX)) == NULL)
3791 /* This allows any failure to indicate there is no bug.
3792 FIXME: check errno? */
3795 if ((len = strlen (c)) != cwd_len)
3805 /* Leaving behind such a deep directory is not polite.
3806 So clean up here, right away, even though the driving
3807 shell script would also clean up. */
3811 /* Unlink first, in case the chdir failed. */
3813 for (i = 0; i <= n_chdirs; i++)
3815 if (chdir ("..") < 0)
3825 [gl_cv_func_getcwd_vs_path_max=yes],
3826 [gl_cv_func_getcwd_vs_path_max=no],
3827 [gl_cv_func_getcwd_vs_path_max=no])])
3829 if test $gl_cv_func_getcwd_vs_path_max = yes; then
3831 AC_DEFINE(getcwd, rpl_getcwd,
3832 [Define to rpl_getcwd if the wrapper function should be used.])
3838 dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
3839 dnl to test whether a NULL return value really means there are no more files
3840 dnl in the directory.
3842 dnl And the rm from coreutils-5.0 exposes a similar problem when there
3843 dnl are 338 or more files in a directory on a Darwin-6.5 system
3845 dnl Detect the problem by creating a directory containing 500 files (254 not
3846 dnl counting . and .. is the minimum for SunOS, 338 for Darwin) and see
3847 dnl if a loop doing `readdir; unlink' removes all of them.
3849 dnl Define HAVE_WORKING_READDIR if readdir does *not* have this problem.
3851 dnl Written by Jim Meyering.
3853 AC_DEFUN([GL_FUNC_READDIR],
3855 AC_REQUIRE([AC_HEADER_DIRENT])
3856 AC_CHECK_HEADERS(string.h)
3857 AC_CACHE_CHECK([for working readdir], gl_cv_func_working_readdir,
3859 # Arrange for deletion of the temporary directory this test creates, in
3860 # case the test itself fails to delete everything -- as happens on Sunos.
3861 ac_clean_files="$ac_clean_files conf-dir"
3864 [# include <stdio.h>
3865 # include <sys/types.h>
3867 # include <string.h>
3870 # ifdef HAVE_DIRENT_H
3871 # include <dirent.h>
3872 # define NLENGTH(direct) (strlen((direct)->d_name))
3873 # else /* not HAVE_DIRENT_H */
3874 # define dirent direct
3875 # define NLENGTH(direct) ((direct)->d_namlen)
3876 # ifdef HAVE_SYS_NDIR_H
3877 # include <sys/ndir.h>
3878 # endif /* HAVE_SYS_NDIR_H */
3879 # ifdef HAVE_SYS_DIR_H
3880 # include <sys/dir.h>
3881 # endif /* HAVE_SYS_DIR_H */
3884 # endif /* HAVE_NDIR_H */
3885 # endif /* HAVE_DIRENT_H */
3887 # define DOT_OR_DOTDOT(Basename) \
3888 (Basename[0] == '.' && (Basename[1] == '\0' \
3889 || (Basename[1] == '.' && Basename[2] == '\0')))
3891 /* Don't try to use replacement mkdir; it wouldn't resolve at link time. */
3895 create_N_file_dir (const char *dir, size_t n_files)
3899 if (mkdir (dir, 0700))
3904 for (i = 0; i < n_files; i++)
3909 sprintf (file_name, "%03d", i);
3910 out = fopen (file_name, "w");
3913 if (fclose (out) == EOF)
3922 remove_dir (const char *dir)
3929 dirp = opendir (".");
3935 struct dirent *dp = readdir (dirp);
3939 if (DOT_OR_DOTDOT (dp->d_name))
3942 if (unlink (dp->d_name))
3957 const char *dir = "conf-dir";
3958 create_N_file_dir (dir, 500);
3962 gl_cv_func_working_readdir=yes,
3963 gl_cv_func_working_readdir=no,
3964 gl_cv_func_working_readdir=no)])
3966 if test $gl_cv_func_working_readdir = yes; then
3967 AC_DEFINE(HAVE_WORKING_READDIR, 1,
3968 [Define if readdir is found to work properly in some unusual cases. ])
3972 # codeset.m4 serial AM1 (gettext-0.10.40)
3973 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3974 dnl This file is free software, distributed under the terms of the GNU
3975 dnl General Public License. As a special exception to the GNU General
3976 dnl Public License, this file may be distributed as part of a program
3977 dnl that contains a configuration script generated by Autoconf, under
3978 dnl the same distribution terms as the rest of that program.
3980 dnl From Bruno Haible.
3982 AC_DEFUN([AM_LANGINFO_CODESET],
3984 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
3985 [AC_TRY_LINK([#include <langinfo.h>],
3986 [char* cs = nl_langinfo(CODESET);],
3987 am_cv_langinfo_codeset=yes,
3988 am_cv_langinfo_codeset=no)
3990 if test $am_cv_langinfo_codeset = yes; then
3991 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
3992 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
3996 # glibc21.m4 serial 2 (fileutils-4.1.3, gettext-0.10.40)
3997 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
3998 dnl This file is free software, distributed under the terms of the GNU
3999 dnl General Public License. As a special exception to the GNU General
4000 dnl Public License, this file may be distributed as part of a program
4001 dnl that contains a configuration script generated by Autoconf, under
4002 dnl the same distribution terms as the rest of that program.
4004 # Test for the GNU C Library, version 2.1 or newer.
4005 # From Bruno Haible.
4007 AC_DEFUN([jm_GLIBC21],
4009 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
4010 ac_cv_gnu_library_2_1,
4011 [AC_EGREP_CPP([Lucky GNU user],
4013 #include <features.h>
4014 #ifdef __GNU_LIBRARY__
4015 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
4020 ac_cv_gnu_library_2_1=yes,
4021 ac_cv_gnu_library_2_1=no)
4025 GLIBC21="$ac_cv_gnu_library_2_1"
4029 # iconv.m4 serial AM4 (gettext-0.11.3)
4030 dnl Copyright (C) 2000-2002 Free Software Foundation, Inc.
4031 dnl This file is free software, distributed under the terms of the GNU
4032 dnl General Public License. As a special exception to the GNU General
4033 dnl Public License, this file may be distributed as part of a program
4034 dnl that contains a configuration script generated by Autoconf, under
4035 dnl the same distribution terms as the rest of that program.
4037 dnl From Bruno Haible.
4039 AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
4041 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
4042 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4043 AC_REQUIRE([AC_LIB_RPATH])
4045 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4047 AC_LIB_LINKFLAGS_BODY([iconv])
4050 AC_DEFUN([AM_ICONV_LINK],
4052 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
4053 dnl those with the standalone portable GNU libiconv installed).
4055 dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
4057 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
4059 dnl Add $INCICONV to CPPFLAGS before performing the following checks,
4060 dnl because if the user has installed libiconv and not disabled its use
4061 dnl via --without-libiconv-prefix, he wants to use it. The first
4062 dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed.
4063 am_save_CPPFLAGS="$CPPFLAGS"
4064 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
4066 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
4067 am_cv_func_iconv="no, consider installing GNU libiconv"
4069 AC_TRY_LINK([#include <stdlib.h>
4070 #include <iconv.h>],
4071 [iconv_t cd = iconv_open("","");
4072 iconv(cd,NULL,NULL,NULL,NULL);
4074 am_cv_func_iconv=yes)
4075 if test "$am_cv_func_iconv" != yes; then
4076 am_save_LIBS="$LIBS"
4077 LIBS="$LIBS $LIBICONV"
4078 AC_TRY_LINK([#include <stdlib.h>
4079 #include <iconv.h>],
4080 [iconv_t cd = iconv_open("","");
4081 iconv(cd,NULL,NULL,NULL,NULL);
4084 am_cv_func_iconv=yes)
4085 LIBS="$am_save_LIBS"
4088 if test "$am_cv_func_iconv" = yes; then
4089 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
4091 if test "$am_cv_lib_iconv" = yes; then
4092 AC_MSG_CHECKING([how to link with libiconv])
4093 AC_MSG_RESULT([$LIBICONV])
4095 dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
4097 CPPFLAGS="$am_save_CPPFLAGS"
4102 AC_SUBST(LTLIBICONV)
4105 AC_DEFUN([AM_ICONV],
4108 if test "$am_cv_func_iconv" = yes; then
4109 AC_MSG_CHECKING([for iconv declaration])
4110 AC_CACHE_VAL(am_cv_proto_iconv, [
4118 #if defined(__STDC__) || defined(__cplusplus)
4119 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
4123 ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const")
4124 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);"])
4125 am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'`
4126 AC_MSG_RESULT([$]{ac_t:-
4127 }[$]am_cv_proto_iconv)
4128 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
4129 [Define as const if the declaration of iconv() needs const.])
4133 # lib-prefix.m4 serial 1 (gettext-0.11)
4134 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4135 dnl This file is free software, distributed under the terms of the GNU
4136 dnl General Public License. As a special exception to the GNU General
4137 dnl Public License, this file may be distributed as part of a program
4138 dnl that contains a configuration script generated by Autoconf, under
4139 dnl the same distribution terms as the rest of that program.
4141 dnl From Bruno Haible.
4143 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
4144 dnl to access previously installed libraries. The basic assumption is that
4145 dnl a user will want packages to use other packages he previously installed
4146 dnl with the same --prefix option.
4147 dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
4148 dnl libraries, but is otherwise very convenient.
4149 AC_DEFUN([AC_LIB_PREFIX],
4151 AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
4152 AC_REQUIRE([AC_PROG_CC])
4153 AC_REQUIRE([AC_CANONICAL_HOST])
4154 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4155 dnl By default, look in $includedir and $libdir.
4157 AC_LIB_WITH_FINAL_PREFIX([
4158 eval additional_includedir=\"$includedir\"
4159 eval additional_libdir=\"$libdir\"
4161 AC_ARG_WITH([lib-prefix],
4162 [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
4163 --without-lib-prefix don't search for libraries in includedir and libdir],
4165 if test "X$withval" = "Xno"; then
4168 if test "X$withval" = "X"; then
4169 AC_LIB_WITH_FINAL_PREFIX([
4170 eval additional_includedir=\"$includedir\"
4171 eval additional_libdir=\"$libdir\"
4174 additional_includedir="$withval/include"
4175 additional_libdir="$withval/lib"
4179 if test $use_additional = yes; then
4180 dnl Potentially add $additional_includedir to $CPPFLAGS.
4181 dnl But don't add it
4182 dnl 1. if it's the standard /usr/include,
4183 dnl 2. if it's already present in $CPPFLAGS,
4184 dnl 3. if it's /usr/local/include and we are using GCC on Linux,
4185 dnl 4. if it doesn't exist as a directory.
4186 if test "X$additional_includedir" != "X/usr/include"; then
4188 for x in $CPPFLAGS; do
4189 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4190 if test "X$x" = "X-I$additional_includedir"; then
4195 if test -z "$haveit"; then
4196 if test "X$additional_includedir" = "X/usr/local/include"; then
4197 if test -n "$GCC"; then
4199 linux*) haveit=yes;;
4203 if test -z "$haveit"; then
4204 if test -d "$additional_includedir"; then
4205 dnl Really add $additional_includedir to $CPPFLAGS.
4206 CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
4211 dnl Potentially add $additional_libdir to $LDFLAGS.
4212 dnl But don't add it
4213 dnl 1. if it's the standard /usr/lib,
4214 dnl 2. if it's already present in $LDFLAGS,
4215 dnl 3. if it's /usr/local/lib and we are using GCC on Linux,
4216 dnl 4. if it doesn't exist as a directory.
4217 if test "X$additional_libdir" != "X/usr/lib"; then
4219 for x in $LDFLAGS; do
4220 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4221 if test "X$x" = "X-L$additional_libdir"; then
4226 if test -z "$haveit"; then
4227 if test "X$additional_libdir" = "X/usr/local/lib"; then
4228 if test -n "$GCC"; then
4230 linux*) haveit=yes;;
4234 if test -z "$haveit"; then
4235 if test -d "$additional_libdir"; then
4236 dnl Really add $additional_libdir to $LDFLAGS.
4237 LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
4245 dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
4246 dnl acl_final_exec_prefix, containing the values to which $prefix and
4247 dnl $exec_prefix will expand at the end of the configure script.
4248 AC_DEFUN([AC_LIB_PREPARE_PREFIX],
4250 dnl Unfortunately, prefix and exec_prefix get only finally determined
4251 dnl at the end of configure.
4252 if test "X$prefix" = "XNONE"; then
4253 acl_final_prefix="$ac_default_prefix"
4255 acl_final_prefix="$prefix"
4257 if test "X$exec_prefix" = "XNONE"; then
4258 acl_final_exec_prefix='${prefix}'
4260 acl_final_exec_prefix="$exec_prefix"
4262 acl_save_prefix="$prefix"
4263 prefix="$acl_final_prefix"
4264 eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
4265 prefix="$acl_save_prefix"
4268 dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
4269 dnl variables prefix and exec_prefix bound to the values they will have
4270 dnl at the end of the configure script.
4271 AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
4273 acl_save_prefix="$prefix"
4274 prefix="$acl_final_prefix"
4275 acl_save_exec_prefix="$exec_prefix"
4276 exec_prefix="$acl_final_exec_prefix"
4278 exec_prefix="$acl_save_exec_prefix"
4279 prefix="$acl_save_prefix"
4282 # lib-link.m4 serial 3 (gettext-0.11.3)
4283 dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
4284 dnl This file is free software, distributed under the terms of the GNU
4285 dnl General Public License. As a special exception to the GNU General
4286 dnl Public License, this file may be distributed as part of a program
4287 dnl that contains a configuration script generated by Autoconf, under
4288 dnl the same distribution terms as the rest of that program.
4290 dnl From Bruno Haible.
4292 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
4293 dnl the libraries corresponding to explicit and implicit dependencies.
4294 dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
4295 dnl augments the CPPFLAGS variable.
4296 AC_DEFUN([AC_LIB_LINKFLAGS],
4298 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4299 AC_REQUIRE([AC_LIB_RPATH])
4300 define([Name],[translit([$1],[./-], [___])])
4301 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4302 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4303 AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
4304 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4305 ac_cv_lib[]Name[]_libs="$LIB[]NAME"
4306 ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
4307 ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
4309 LIB[]NAME="$ac_cv_lib[]Name[]_libs"
4310 LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
4311 INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
4312 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4314 AC_SUBST([LTLIB]NAME)
4315 dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
4316 dnl results of this search when this library appears as a dependency.
4322 dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
4323 dnl searches for libname and the libraries corresponding to explicit and
4324 dnl implicit dependencies, together with the specified include files and
4325 dnl the ability to compile and link the specified testcode. If found, it
4326 dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
4327 dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
4328 dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
4329 dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
4330 AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
4332 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
4333 AC_REQUIRE([AC_LIB_RPATH])
4334 define([Name],[translit([$1],[./-], [___])])
4335 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4336 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4338 dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
4340 AC_LIB_LINKFLAGS_BODY([$1], [$2])
4342 dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
4343 dnl because if the user has installed lib[]Name and not disabled its use
4344 dnl via --without-lib[]Name-prefix, he wants to use it.
4345 ac_save_CPPFLAGS="$CPPFLAGS"
4346 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
4348 AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
4349 ac_save_LIBS="$LIBS"
4350 LIBS="$LIBS $LIB[]NAME"
4351 AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
4352 LIBS="$ac_save_LIBS"
4354 if test "$ac_cv_lib[]Name" = yes; then
4356 AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
4357 AC_MSG_CHECKING([how to link with lib[]$1])
4358 AC_MSG_RESULT([$LIB[]NAME])
4361 dnl If $LIB[]NAME didn't lead to a usable library, we don't need
4362 dnl $INC[]NAME either.
4363 CPPFLAGS="$ac_save_CPPFLAGS"
4367 AC_SUBST([HAVE_LIB]NAME)
4369 AC_SUBST([LTLIB]NAME)
4374 dnl Determine the platform dependent parameters needed to use rpath:
4375 dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator,
4376 dnl hardcode_direct, hardcode_minus_L,
4377 dnl sys_lib_search_path_spec, sys_lib_dlsearch_path_spec.
4378 AC_DEFUN([AC_LIB_RPATH],
4380 AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS
4381 AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld
4382 AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host
4383 AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
4384 AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
4385 CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
4386 ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
4392 libext="$acl_cv_libext"
4393 shlibext="$acl_cv_shlibext"
4394 hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
4395 hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
4396 hardcode_direct="$acl_cv_hardcode_direct"
4397 hardcode_minus_L="$acl_cv_hardcode_minus_L"
4398 sys_lib_search_path_spec="$acl_cv_sys_lib_search_path_spec"
4399 sys_lib_dlsearch_path_spec="$acl_cv_sys_lib_dlsearch_path_spec"
4400 dnl Determine whether the user wants rpath handling at all.
4401 AC_ARG_ENABLE(rpath,
4402 [ --disable-rpath do not hardcode runtime library paths],
4403 :, enable_rpath=yes)
4406 dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
4407 dnl the libraries corresponding to explicit and implicit dependencies.
4408 dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
4409 AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
4411 define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
4412 [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
4413 dnl By default, look in $includedir and $libdir.
4415 AC_LIB_WITH_FINAL_PREFIX([
4416 eval additional_includedir=\"$includedir\"
4417 eval additional_libdir=\"$libdir\"
4419 AC_ARG_WITH([lib$1-prefix],
4420 [ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib
4421 --without-lib$1-prefix don't search for lib$1 in includedir and libdir],
4423 if test "X$withval" = "Xno"; then
4426 if test "X$withval" = "X"; then
4427 AC_LIB_WITH_FINAL_PREFIX([
4428 eval additional_includedir=\"$includedir\"
4429 eval additional_libdir=\"$libdir\"
4432 additional_includedir="$withval/include"
4433 additional_libdir="$withval/lib"
4437 dnl Search the library and its dependencies in $additional_libdir and
4438 dnl $LDFLAGS. Using breadth-first-seach.
4444 names_already_handled=
4445 names_next_round='$1 $2'
4446 while test -n "$names_next_round"; do
4447 names_this_round="$names_next_round"
4449 for name in $names_this_round; do
4451 for n in $names_already_handled; do
4452 if test "$n" = "$name"; then
4457 if test -z "$already_handled"; then
4458 names_already_handled="$names_already_handled $name"
4459 dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
4460 dnl or AC_LIB_HAVE_LINKFLAGS call.
4461 uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
4462 eval value=\"\$HAVE_LIB$uppername\"
4463 if test -n "$value"; then
4464 if test "$value" = yes; then
4465 eval value=\"\$LIB$uppername\"
4466 test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
4467 eval value=\"\$LTLIB$uppername\"
4468 test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
4470 dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
4471 dnl that this library doesn't exist. So just drop it.
4475 dnl Search the library lib$name in $additional_libdir and $LDFLAGS
4476 dnl and the already constructed $LIBNAME/$LTLIBNAME.
4481 if test $use_additional = yes; then
4482 if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then
4483 found_dir="$additional_libdir"
4484 found_so="$additional_libdir/lib$name.$shlibext"
4485 if test -f "$additional_libdir/lib$name.la"; then
4486 found_la="$additional_libdir/lib$name.la"
4489 if test -f "$additional_libdir/lib$name.$libext"; then
4490 found_dir="$additional_libdir"
4491 found_a="$additional_libdir/lib$name.$libext"
4492 if test -f "$additional_libdir/lib$name.la"; then
4493 found_la="$additional_libdir/lib$name.la"
4498 if test "X$found_dir" = "X"; then
4499 for x in $LDFLAGS $LTLIB[]NAME; do
4500 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4503 dir=`echo "X$x" | sed -e 's/^X-L//'`
4504 if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then
4506 found_so="$dir/lib$name.$shlibext"
4507 if test -f "$dir/lib$name.la"; then
4508 found_la="$dir/lib$name.la"
4511 if test -f "$dir/lib$name.$libext"; then
4513 found_a="$dir/lib$name.$libext"
4514 if test -f "$dir/lib$name.la"; then
4515 found_la="$dir/lib$name.la"
4521 if test "X$found_dir" != "X"; then
4526 if test "X$found_dir" != "X"; then
4527 dnl Found the library.
4528 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
4529 if test "X$found_so" != "X"; then
4530 dnl Linking with a shared library. We attempt to hardcode its
4531 dnl directory into the executable's runpath, unless it's the
4532 dnl standard /usr/lib.
4533 if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then
4534 dnl No hardcoding is needed.
4535 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4537 dnl Use an explicit option to hardcode DIR into the resulting
4539 dnl Potentially add DIR to ltrpathdirs.
4540 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4542 for x in $ltrpathdirs; do
4543 if test "X$x" = "X$found_dir"; then
4548 if test -z "$haveit"; then
4549 ltrpathdirs="$ltrpathdirs $found_dir"
4551 dnl The hardcoding into $LIBNAME is system dependent.
4552 if test "$hardcode_direct" = yes; then
4553 dnl Using DIR/libNAME.so during linking hardcodes DIR into the
4554 dnl resulting binary.
4555 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4557 if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then
4558 dnl Use an explicit option to hardcode DIR into the resulting
4560 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4561 dnl Potentially add DIR to rpathdirs.
4562 dnl The rpathdirs will be appended to $LIBNAME at the end.
4564 for x in $rpathdirs; do
4565 if test "X$x" = "X$found_dir"; then
4570 if test -z "$haveit"; then
4571 rpathdirs="$rpathdirs $found_dir"
4574 dnl Rely on "-L$found_dir".
4575 dnl But don't add it if it's already contained in the LDFLAGS
4576 dnl or the already constructed $LIBNAME
4578 for x in $LDFLAGS $LIB[]NAME; do
4579 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4580 if test "X$x" = "X-L$found_dir"; then
4585 if test -z "$haveit"; then
4586 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
4588 if test "$hardcode_minus_L" != no; then
4589 dnl FIXME: Not sure whether we should use
4590 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4592 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
4594 dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH
4595 dnl here, because this doesn't fit in flags passed to the
4596 dnl compiler. So give up. No hardcoding. This affects only
4597 dnl very old systems.
4598 dnl FIXME: Not sure whether we should use
4599 dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
4601 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4607 if test "X$found_a" != "X"; then
4608 dnl Linking with a static library.
4609 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
4611 dnl We shouldn't come here, but anyway it's good to have a
4613 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
4616 dnl Assume the include files are nearby.
4617 additional_includedir=
4618 case "$found_dir" in
4620 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'`
4621 additional_includedir="$basedir/include"
4624 if test "X$additional_includedir" != "X"; then
4625 dnl Potentially add $additional_includedir to $INCNAME.
4626 dnl But don't add it
4627 dnl 1. if it's the standard /usr/include,
4628 dnl 2. if it's /usr/local/include and we are using GCC on Linux,
4629 dnl 3. if it's already present in $CPPFLAGS or the already
4630 dnl constructed $INCNAME,
4631 dnl 4. if it doesn't exist as a directory.
4632 if test "X$additional_includedir" != "X/usr/include"; then
4634 if test "X$additional_includedir" = "X/usr/local/include"; then
4635 if test -n "$GCC"; then
4637 linux*) haveit=yes;;
4641 if test -z "$haveit"; then
4642 for x in $CPPFLAGS $INC[]NAME; do
4643 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4644 if test "X$x" = "X-I$additional_includedir"; then
4649 if test -z "$haveit"; then
4650 if test -d "$additional_includedir"; then
4651 dnl Really add $additional_includedir to $INCNAME.
4652 INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
4658 dnl Look for dependencies.
4659 if test -n "$found_la"; then
4660 dnl Read the .la file. It defines the variables
4661 dnl dlname, library_names, old_library, dependency_libs, current,
4662 dnl age, revision, installed, dlopen, dlpreopen, libdir.
4663 save_libdir="$libdir"
4665 */* | *\\*) . "$found_la" ;;
4666 *) . "./$found_la" ;;
4668 libdir="$save_libdir"
4669 dnl We use only dependency_libs.
4670 for dep in $dependency_libs; do
4673 additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
4674 dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
4675 dnl But don't add it
4676 dnl 1. if it's the standard /usr/lib,
4677 dnl 2. if it's /usr/local/lib and we are using GCC on Linux,
4678 dnl 3. if it's already present in $LDFLAGS or the already
4679 dnl constructed $LIBNAME,
4680 dnl 4. if it doesn't exist as a directory.
4681 if test "X$additional_libdir" != "X/usr/lib"; then
4683 if test "X$additional_libdir" = "X/usr/local/lib"; then
4684 if test -n "$GCC"; then
4686 linux*) haveit=yes;;
4690 if test -z "$haveit"; then
4692 for x in $LDFLAGS $LIB[]NAME; do
4693 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4694 if test "X$x" = "X-L$additional_libdir"; then
4699 if test -z "$haveit"; then
4700 if test -d "$additional_libdir"; then
4701 dnl Really add $additional_libdir to $LIBNAME.
4702 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
4706 for x in $LDFLAGS $LTLIB[]NAME; do
4707 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4708 if test "X$x" = "X-L$additional_libdir"; then
4713 if test -z "$haveit"; then
4714 if test -d "$additional_libdir"; then
4715 dnl Really add $additional_libdir to $LTLIBNAME.
4716 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
4723 dir=`echo "X$dep" | sed -e 's/^X-R//'`
4724 if test "$enable_rpath" != no; then
4725 dnl Potentially add DIR to rpathdirs.
4726 dnl The rpathdirs will be appended to $LIBNAME at the end.
4728 for x in $rpathdirs; do
4729 if test "X$x" = "X$dir"; then
4734 if test -z "$haveit"; then
4735 rpathdirs="$rpathdirs $dir"
4737 dnl Potentially add DIR to ltrpathdirs.
4738 dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
4740 for x in $ltrpathdirs; do
4741 if test "X$x" = "X$dir"; then
4746 if test -z "$haveit"; then
4747 ltrpathdirs="$ltrpathdirs $dir"
4752 dnl Handle this in the next round.
4753 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
4756 dnl Handle this in the next round. Throw away the .la's
4757 dnl directory; it is already contained in a preceding -L
4759 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
4762 dnl Most likely an immediate library name.
4763 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
4764 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
4770 dnl Didn't find the library; assume it is in the system directories
4771 dnl known to the linker and runtime loader. (All the system
4772 dnl directories known to the linker should also be known to the
4773 dnl runtime loader, otherwise the system is severely misconfigured.)
4774 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
4775 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
4781 if test "X$rpathdirs" != "X"; then
4782 if test -n "$hardcode_libdir_separator"; then
4783 dnl Weird platform: only the last -rpath option counts, the user must
4784 dnl pass all path elements in one option. We can arrange that for a
4785 dnl single library, but not when more than one $LIBNAMEs are used.
4787 for found_dir in $rpathdirs; do
4788 alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir"
4790 dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl.
4791 acl_save_libdir="$libdir"
4793 eval flag=\"$hardcode_libdir_flag_spec\"
4794 libdir="$acl_save_libdir"
4795 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4797 dnl The -rpath options are cumulative.
4798 for found_dir in $rpathdirs; do
4799 acl_save_libdir="$libdir"
4801 eval flag=\"$hardcode_libdir_flag_spec\"
4802 libdir="$acl_save_libdir"
4803 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
4807 if test "X$ltrpathdirs" != "X"; then
4808 dnl When using libtool, the option that works for both libraries and
4809 dnl executables is -R. The -R options are cumulative.
4810 for found_dir in $ltrpathdirs; do
4811 LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
4816 dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
4817 dnl unless already present in VAR.
4818 dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
4819 dnl contains two or three consecutive elements that belong together.
4820 AC_DEFUN([AC_LIB_APPENDTOVAR],
4822 for element in [$2]; do
4825 AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
4826 if test "X$x" = "X$element"; then
4831 if test -z "$haveit"; then
4832 [$1]="${[$1]}${[$1]:+ }$element"
4837 # lib-ld.m4 serial 2
4838 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
4839 dnl This file is free software, distributed under the terms of the GNU
4840 dnl General Public License. As a special exception to the GNU General
4841 dnl Public License, this file may be distributed as part of a program
4842 dnl that contains a configuration script generated by Autoconf, under
4843 dnl the same distribution terms as the rest of that program.
4845 dnl Subroutines of libtool.m4,
4846 dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
4847 dnl with libtool.m4.
4849 dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
4850 AC_DEFUN([AC_LIB_PROG_LD_GNU],
4851 [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
4852 [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
4853 if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
4854 acl_cv_prog_gnu_ld=yes
4856 acl_cv_prog_gnu_ld=no
4858 with_gnu_ld=$acl_cv_prog_gnu_ld
4861 dnl From libtool-1.4. Sets the variable LD.
4862 AC_DEFUN([AC_LIB_PROG_LD],
4863 [AC_ARG_WITH(gnu-ld,
4864 [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]],
4865 test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
4866 AC_REQUIRE([AC_PROG_CC])dnl
4867 AC_REQUIRE([AC_CANONICAL_HOST])dnl
4869 if test "$GCC" = yes; then
4870 # Check if gcc -print-prog-name=ld gives a path.
4871 AC_MSG_CHECKING([for ld used by GCC])
4874 # gcc leaves a trailing carriage return which upsets mingw
4875 ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
4877 ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
4880 # Accept absolute paths.
4881 [[\\/]* | [A-Za-z]:[\\/]*)]
4882 [re_direlt='/[^/][^/]*/\.\./']
4883 # Canonicalize the path of ld
4884 ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
4885 while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
4886 ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
4888 test -z "$LD" && LD="$ac_prog"
4891 # If it fails, then pretend we aren't using GCC.
4895 # If it is relative, then search for the first ld in PATH.
4899 elif test "$with_gnu_ld" = yes; then
4900 AC_MSG_CHECKING([for GNU ld])
4902 AC_MSG_CHECKING([for non-GNU ld])
4904 AC_CACHE_VAL(acl_cv_path_LD,
4905 [if test -z "$LD"; then
4906 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
4907 for ac_dir in $PATH; do
4908 test -z "$ac_dir" && ac_dir=.
4909 if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
4910 acl_cv_path_LD="$ac_dir/$ac_prog"
4911 # Check to see if the program is GNU ld. I'd rather use --version,
4912 # but apparently some GNU ld's only accept -v.
4913 # Break only if it was the GNU/non-GNU ld that we prefer.
4914 if "$acl_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
4915 test "$with_gnu_ld" != no && break
4917 test "$with_gnu_ld" != yes && break
4923 acl_cv_path_LD="$LD" # Let the user override the test with a path.
4925 LD="$acl_cv_path_LD"
4926 if test -n "$LD"; then
4931 test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
4937 dnl From J. David Anglin.
4939 dnl HPUX and other systems can't unlink shared text that is being executed.
4941 AC_DEFUN([jm_FUNC_UNLINK_BUSY_TEXT],
4943 AC_CACHE_CHECK([whether a running program can be unlinked],
4944 jm_cv_func_unlink_busy_text,
4953 exit (unlink (argv[0]));
4956 jm_cv_func_unlink_busy_text=yes,
4957 jm_cv_func_unlink_busy_text=no,
4958 jm_cv_func_unlink_busy_text=no
4963 if test $jm_cv_func_unlink_busy_text = no; then
4964 INSTALL=$ac_install_sh
4970 dnl From Jim Meyering.
4972 dnl This is not pretty. I've just taken the autoconf code and wrapped
4973 dnl it in an AC_DEFUN.
4976 # jm_LIST_MOUNTED_FILESYSTEMS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
4977 AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
4979 AC_CHECK_FUNCS(listmntent getmntinfo)
4980 AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
4981 getfsstat_includes="\
4982 $ac_includes_default
4983 #if HAVE_SYS_PARAM_H
4984 # include <sys/param.h> /* needed by powerpc-apple-darwin1.3.7 */
4986 #if HAVE_SYS_UCRED_H
4987 # include <sys/ucred.h> /* needed by powerpc-apple-darwin1.3.7 */
4989 #if HAVE_SYS_MOUNT_H
4990 # include <sys/mount.h>
4992 #if HAVE_SYS_FS_TYPES_H
4993 # include <sys/fs_types.h> /* needed by powerpc-apple-darwin1.3.7 */
4996 AC_CHECK_MEMBERS([struct fsstat.f_fstypename],,,[$getfsstat_includes])
4998 # Determine how to get the list of mounted filesystems.
5001 # If the getmntent function is available but not in the standard library,
5002 # make sure LIBS contains -lsun (on Irix4) or -lseq (on PTX).
5005 # This test must precede the ones for getmntent because Unicos-9 is
5006 # reported to have the getmntent function, but its support is incompatible
5007 # with other getmntent implementations.
5009 # NOTE: Normally, I wouldn't use a check for system type as I've done for
5010 # `CRAY' below since that goes against the whole autoconf philosophy. But
5011 # I think there is too great a chance that some non-Cray system has a
5012 # function named listmntent to risk the false positive.
5014 if test -z "$ac_list_mounted_fs"; then
5016 AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
5017 AC_CACHE_VAL(fu_cv_sys_mounted_cray_listmntent,
5018 [fu_cv_sys_mounted_cray_listmntent=no
5023 ], [test $ac_cv_func_listmntent = yes \
5024 && fu_cv_sys_mounted_cray_listmntent=yes]
5028 AC_MSG_RESULT($fu_cv_sys_mounted_cray_listmntent)
5029 if test $fu_cv_sys_mounted_cray_listmntent = yes; then
5030 ac_list_mounted_fs=found
5031 AC_DEFINE(MOUNTED_LISTMNTENT, 1,
5032 [Define if there is a function named listmntent that can be used to
5033 list all mounted filesystems. (UNICOS)])
5037 if test -z "$ac_list_mounted_fs"; then
5039 AC_MSG_CHECKING([for mntctl function and struct vmount])
5040 AC_CACHE_VAL(fu_cv_sys_mounted_vmount,
5041 [AC_TRY_CPP([#include <fshelp.h>],
5042 fu_cv_sys_mounted_vmount=yes,
5043 fu_cv_sys_mounted_vmount=no)])
5044 AC_MSG_RESULT($fu_cv_sys_mounted_vmount)
5045 if test $fu_cv_sys_mounted_vmount = yes; then
5046 ac_list_mounted_fs=found
5047 AC_DEFINE(MOUNTED_VMOUNT, 1,
5048 [Define if there is a function named mntctl that can be used to read
5049 the list of mounted filesystems, and there is a system header file
5050 that declares `struct vmount.' (AIX)])
5054 if test $ac_cv_func_getmntent = yes; then
5056 # This system has the getmntent function.
5057 # Determine whether it's the one-argument variant or the two-argument one.
5059 if test -z "$ac_list_mounted_fs"; then
5060 # 4.3BSD, SunOS, HP-UX, Dynix, Irix
5061 AC_MSG_CHECKING([for one-argument getmntent function])
5062 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent1,
5064 /* SunOS 4.1.x /usr/include/mntent.h needs this for FILE */
5068 #if !defined MOUNTED
5069 # if defined _PATH_MOUNTED /* GNU libc */
5070 # define MOUNTED _PATH_MOUNTED
5072 # if defined MNT_MNTTAB /* HP-UX. */
5073 # define MOUNTED MNT_MNTTAB
5075 # if defined MNTTABNAME /* Dynix. */
5076 # define MOUNTED MNTTABNAME
5080 [ struct mntent *mnt = 0; char *table = MOUNTED; ],
5081 fu_cv_sys_mounted_getmntent1=yes,
5082 fu_cv_sys_mounted_getmntent1=no)])
5083 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent1)
5084 if test $fu_cv_sys_mounted_getmntent1 = yes; then
5085 ac_list_mounted_fs=found
5086 AC_DEFINE(MOUNTED_GETMNTENT1, 1,
5087 [Define if there is a function named getmntent for reading the list
5088 of mounted filesystems, and that function takes a single argument.
5089 (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
5093 if test -z "$ac_list_mounted_fs"; then
5095 AC_MSG_CHECKING([for two-argument getmntent function])
5096 AC_CACHE_VAL(fu_cv_sys_mounted_getmntent2,
5097 [AC_EGREP_HEADER(getmntent, sys/mnttab.h,
5098 fu_cv_sys_mounted_getmntent2=yes,
5099 fu_cv_sys_mounted_getmntent2=no)])
5100 AC_MSG_RESULT($fu_cv_sys_mounted_getmntent2)
5101 if test $fu_cv_sys_mounted_getmntent2 = yes; then
5102 ac_list_mounted_fs=found
5103 AC_DEFINE(MOUNTED_GETMNTENT2, 1,
5104 [Define if there is a function named getmntent for reading the list of
5105 mounted filesystems, and that function takes two arguments. (SVR4)])
5111 if test -z "$ac_list_mounted_fs"; then
5112 # DEC Alpha running OSF/1, and Apple Darwin 1.3.
5113 # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
5115 AC_MSG_CHECKING([for getfsstat function])
5116 AC_CACHE_VAL(fu_cv_sys_mounted_getfsstat,
5118 #include <sys/types.h>
5119 #if HAVE_STRUCT_FSSTAT_F_FSTYPENAME
5120 # define FS_TYPE(Ent) ((Ent).f_fstypename)
5122 # define FS_TYPE(Ent) mnt_names[(Ent).f_type]
5124 ]$getfsstat_includes
5126 [struct statfs *stats;
5127 int numsys = getfsstat ((struct statfs *)0, 0L, MNT_WAIT);
5128 char *t = FS_TYPE (*stats); ],
5129 fu_cv_sys_mounted_getfsstat=yes,
5130 fu_cv_sys_mounted_getfsstat=no)])
5131 AC_MSG_RESULT($fu_cv_sys_mounted_getfsstat)
5132 if test $fu_cv_sys_mounted_getfsstat = yes; then
5133 ac_list_mounted_fs=found
5134 AC_DEFINE(MOUNTED_GETFSSTAT, 1,
5135 [Define if there is a function named getfsstat for reading the
5136 list of mounted filesystems. (DEC Alpha running OSF/1)])
5140 if test -z "$ac_list_mounted_fs"; then
5142 AC_MSG_CHECKING([for FIXME existence of three headers])
5143 AC_CACHE_VAL(fu_cv_sys_mounted_fread_fstyp,
5145 #include <sys/statfs.h>
5146 #include <sys/fstyp.h>
5147 #include <mnttab.h>],
5148 fu_cv_sys_mounted_fread_fstyp=yes,
5149 fu_cv_sys_mounted_fread_fstyp=no)])
5150 AC_MSG_RESULT($fu_cv_sys_mounted_fread_fstyp)
5151 if test $fu_cv_sys_mounted_fread_fstyp = yes; then
5152 ac_list_mounted_fs=found
5153 AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
5154 [Define if (like SVR2) there is no specific function for reading the
5155 list of mounted filesystems, and your system has these header files:
5156 <sys/fstyp.h> and <sys/statfs.h>. (SVR3)])
5160 if test -z "$ac_list_mounted_fs"; then
5161 # 4.4BSD and DEC OSF/1.
5162 AC_MSG_CHECKING([for getmntinfo function])
5163 AC_CACHE_VAL(fu_cv_sys_mounted_getmntinfo,
5165 test "$ac_cv_func_getmntinfo" = yes \
5166 && fu_cv_sys_mounted_getmntinfo=yes \
5167 || fu_cv_sys_mounted_getmntinfo=no
5169 AC_MSG_RESULT($fu_cv_sys_mounted_getmntinfo)
5170 if test $fu_cv_sys_mounted_getmntinfo = yes; then
5171 ac_list_mounted_fs=found
5172 AC_DEFINE(MOUNTED_GETMNTINFO, 1,
5173 [Define if there is a function named getmntinfo for reading the
5174 list of mounted filesystems. (4.4BSD, Darwin)])
5178 if test -z "$ac_list_mounted_fs"; then
5180 AC_MSG_CHECKING([for getmnt function])
5181 AC_CACHE_VAL(fu_cv_sys_mounted_getmnt,
5183 #include <sys/fs_types.h>
5184 #include <sys/mount.h>],
5185 fu_cv_sys_mounted_getmnt=yes,
5186 fu_cv_sys_mounted_getmnt=no)])
5187 AC_MSG_RESULT($fu_cv_sys_mounted_getmnt)
5188 if test $fu_cv_sys_mounted_getmnt = yes; then
5189 ac_list_mounted_fs=found
5190 AC_DEFINE(MOUNTED_GETMNT, 1,
5191 [Define if there is a function named getmnt for reading the list of
5192 mounted filesystems. (Ultrix)])
5196 if test -z "$ac_list_mounted_fs"; then
5198 AC_CHECK_FUNCS(next_dev fs_stat_dev)
5199 AC_CHECK_HEADERS(fs_info.h)
5200 AC_MSG_CHECKING([for BEOS mounted file system support functions])
5201 if test $ac_cv_header_fs_info_h = yes \
5202 && test $ac_cv_func_next_dev = yes \
5203 && test $ac_cv_func_fs_stat_dev = yes; then
5208 AC_MSG_RESULT($fu_result)
5209 if test $fu_result = yes; then
5210 ac_list_mounted_fs=found
5211 AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
5212 [Define if there are functions named next_dev and fs_stat_dev for
5213 reading the list of mounted filesystems. (BeOS)])
5217 if test -z "$ac_list_mounted_fs"; then
5219 AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
5220 AC_CACHE_VAL(fu_cv_sys_mounted_fread,
5221 [AC_TRY_CPP([#include <mnttab.h>],
5222 fu_cv_sys_mounted_fread=yes,
5223 fu_cv_sys_mounted_fread=no)])
5224 AC_MSG_RESULT($fu_cv_sys_mounted_fread)
5225 if test $fu_cv_sys_mounted_fread = yes; then
5226 ac_list_mounted_fs=found
5227 AC_DEFINE(MOUNTED_FREAD, 1,
5228 [Define if there is no specific function for reading the list of
5229 mounted filesystems. fread will be used to read /etc/mnttab. (SVR2) ])
5233 if test -z "$ac_list_mounted_fs"; then
5234 AC_MSG_ERROR([could not determine how to read list of mounted filesystems])
5235 # FIXME -- no need to abort building the whole package
5236 # Can't build mountlist.c or anything that needs its functions
5239 AS_IF([test $ac_list_mounted_fs = found], [$1], [$2])
5245 dnl From Jim Meyering.
5247 dnl See if struct statfs has the f_fstypename member.
5248 dnl If so, define HAVE_F_FSTYPENAME_IN_STATFS.
5251 AC_DEFUN([jm_FSTYPENAME],
5253 AC_CACHE_CHECK([for f_fstypename in struct statfs],
5254 fu_cv_sys_f_fstypename_in_statfs,
5258 #include <sys/param.h>
5259 #include <sys/types.h>
5260 #include <sys/mount.h>
5262 [struct statfs s; int i = sizeof s.f_fstypename;],
5263 fu_cv_sys_f_fstypename_in_statfs=yes,
5264 fu_cv_sys_f_fstypename_in_statfs=no
5269 if test $fu_cv_sys_f_fstypename_in_statfs = yes; then
5270 AC_DEFINE(HAVE_F_FSTYPENAME_IN_STATFS, 1,
5271 [Define if struct statfs has the f_fstypename member.])
5278 # From fileutils/configure.in
5280 # Try to determine how a program can obtain filesystem usage information.
5281 # If successful, define the appropriate symbol (see fsusage.c) and
5282 # execute ACTION-IF-FOUND. Otherwise, execute ACTION-IF-NOT-FOUND.
5284 # jm_FILE_SYSTEM_USAGE([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5286 AC_DEFUN([jm_FILE_SYSTEM_USAGE],
5289 echo "checking how to get filesystem space usage..."
5292 # Perform only the link test since it seems there are no variants of the
5293 # statvfs function. This check is more than just AC_CHECK_FUNCS(statvfs)
5294 # because that got a false positive on SCO OSR5. Adding the declaration
5295 # of a `struct statvfs' causes this test to fail (as it should) on such
5296 # systems. That system is reported to work fine with STAT_STATFS4 which
5297 # is what it gets when this test fails.
5298 if test $ac_fsusage_space = no; then
5300 AC_CACHE_CHECK([for statvfs function (SVR4)], fu_cv_sys_stat_statvfs,
5301 [AC_TRY_LINK([#include <sys/types.h>
5303 Do not use statvfs on systems with GNU libc, because that function stats
5304 all preceding entries in /proc/mounts, and that makes df hang if even
5305 one of the corresponding file systems is hard-mounted, but not available.
5307 #include <sys/statvfs.h>],
5308 [struct statvfs fsd; statvfs (0, &fsd);],
5309 fu_cv_sys_stat_statvfs=yes,
5310 fu_cv_sys_stat_statvfs=no)])
5311 if test $fu_cv_sys_stat_statvfs = yes; then
5312 ac_fsusage_space=yes
5313 AC_DEFINE(STAT_STATVFS, 1,
5314 [ Define if there is a function named statvfs. (SVR4)])
5318 if test $ac_fsusage_space = no; then
5319 # DEC Alpha running OSF/1
5320 AC_MSG_CHECKING([for 3-argument statfs function (DEC OSF/1)])
5321 AC_CACHE_VAL(fu_cv_sys_stat_statfs3_osf1,
5323 #include <sys/param.h>
5324 #include <sys/types.h>
5325 #include <sys/mount.h>
5330 exit (statfs (".", &fsd, sizeof (struct statfs)));
5332 fu_cv_sys_stat_statfs3_osf1=yes,
5333 fu_cv_sys_stat_statfs3_osf1=no,
5334 fu_cv_sys_stat_statfs3_osf1=no)])
5335 AC_MSG_RESULT($fu_cv_sys_stat_statfs3_osf1)
5336 if test $fu_cv_sys_stat_statfs3_osf1 = yes; then
5337 ac_fsusage_space=yes
5338 AC_DEFINE(STAT_STATFS3_OSF1, 1,
5339 [ Define if statfs takes 3 args. (DEC Alpha running OSF/1)])
5343 if test $ac_fsusage_space = no; then
5345 AC_MSG_CHECKING([for two-argument statfs with statfs.bsize dnl
5346 member (AIX, 4.3BSD)])
5347 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_bsize,
5349 #ifdef HAVE_SYS_PARAM_H
5350 #include <sys/param.h>
5352 #ifdef HAVE_SYS_MOUNT_H
5353 #include <sys/mount.h>
5355 #ifdef HAVE_SYS_VFS_H
5356 #include <sys/vfs.h>
5362 exit (statfs (".", &fsd));
5364 fu_cv_sys_stat_statfs2_bsize=yes,
5365 fu_cv_sys_stat_statfs2_bsize=no,
5366 fu_cv_sys_stat_statfs2_bsize=no)])
5367 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_bsize)
5368 if test $fu_cv_sys_stat_statfs2_bsize = yes; then
5369 ac_fsusage_space=yes
5370 AC_DEFINE(STAT_STATFS2_BSIZE, 1,
5371 [ Define if statfs takes 2 args and struct statfs has a field named f_bsize.
5372 (4.3BSD, SunOS 4, HP-UX, AIX PS/2)])
5376 if test $ac_fsusage_space = no; then
5378 AC_MSG_CHECKING([for four-argument statfs (AIX-3.2.5, SVR3)])
5379 AC_CACHE_VAL(fu_cv_sys_stat_statfs4,
5380 [AC_TRY_RUN([#include <sys/types.h>
5381 #include <sys/statfs.h>
5385 exit (statfs (".", &fsd, sizeof fsd, 0));
5387 fu_cv_sys_stat_statfs4=yes,
5388 fu_cv_sys_stat_statfs4=no,
5389 fu_cv_sys_stat_statfs4=no)])
5390 AC_MSG_RESULT($fu_cv_sys_stat_statfs4)
5391 if test $fu_cv_sys_stat_statfs4 = yes; then
5392 ac_fsusage_space=yes
5393 AC_DEFINE(STAT_STATFS4, 1,
5394 [ Define if statfs takes 4 args. (SVR3, Dynix, Irix, Dolphin)])
5398 if test $ac_fsusage_space = no; then
5400 AC_MSG_CHECKING([for two-argument statfs with statfs.fsize dnl
5401 member (4.4BSD and NetBSD)])
5402 AC_CACHE_VAL(fu_cv_sys_stat_statfs2_fsize,
5403 [AC_TRY_RUN([#include <sys/types.h>
5404 #ifdef HAVE_SYS_PARAM_H
5405 #include <sys/param.h>
5407 #ifdef HAVE_SYS_MOUNT_H
5408 #include <sys/mount.h>
5414 exit (statfs (".", &fsd));
5416 fu_cv_sys_stat_statfs2_fsize=yes,
5417 fu_cv_sys_stat_statfs2_fsize=no,
5418 fu_cv_sys_stat_statfs2_fsize=no)])
5419 AC_MSG_RESULT($fu_cv_sys_stat_statfs2_fsize)
5420 if test $fu_cv_sys_stat_statfs2_fsize = yes; then
5421 ac_fsusage_space=yes
5422 AC_DEFINE(STAT_STATFS2_FSIZE, 1,
5423 [ Define if statfs takes 2 args and struct statfs has a field named f_fsize.
5428 if test $ac_fsusage_space = no; then
5430 AC_MSG_CHECKING([for two-argument statfs with struct fs_data (Ultrix)])
5431 AC_CACHE_VAL(fu_cv_sys_stat_fs_data,
5432 [AC_TRY_RUN([#include <sys/types.h>
5433 #ifdef HAVE_SYS_PARAM_H
5434 #include <sys/param.h>
5436 #ifdef HAVE_SYS_MOUNT_H
5437 #include <sys/mount.h>
5439 #ifdef HAVE_SYS_FS_TYPES_H
5440 #include <sys/fs_types.h>
5445 /* Ultrix's statfs returns 1 for success,
5446 0 for not mounted, -1 for failure. */
5447 exit (statfs (".", &fsd) != 1);
5449 fu_cv_sys_stat_fs_data=yes,
5450 fu_cv_sys_stat_fs_data=no,
5451 fu_cv_sys_stat_fs_data=no)])
5452 AC_MSG_RESULT($fu_cv_sys_stat_fs_data)
5453 if test $fu_cv_sys_stat_fs_data = yes; then
5454 ac_fsusage_space=yes
5455 AC_DEFINE(STAT_STATFS2_FS_DATA, 1,
5456 [ Define if statfs takes 2 args and the second argument has
5457 type struct fs_data. (Ultrix)])
5461 if test $ac_fsusage_space = no; then
5463 AC_TRY_CPP([#include <sys/filsys.h>
5465 AC_DEFINE(STAT_READ_FILSYS, 1,
5466 [Define if there is no specific function for reading filesystems usage
5467 information and you have the <sys/filsys.h> header file. (SVR2)])
5468 ac_fsusage_space=yes)
5471 AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
5477 # Define some macros required for proper operation of code in lib/*.c
5478 # on MSDOS/Windows systems.
5480 # From Jim Meyering.
5482 AC_DEFUN([jm_AC_DOS],
5484 AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
5487 [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
5488 neither MSDOS nor Windows
5490 [ac_cv_win_or_dos=yes],
5491 [ac_cv_win_or_dos=no])
5494 if test x"$ac_cv_win_or_dos" = xyes; then
5495 ac_fs_accepts_drive_letter_prefix=1
5496 ac_fs_backslash_is_file_name_separator=1
5498 ac_fs_accepts_drive_letter_prefix=0
5499 ac_fs_backslash_is_file_name_separator=0
5502 AH_VERBATIM(FILESYSTEM_PREFIX_LEN,
5503 [#if FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX
5504 # define FILESYSTEM_PREFIX_LEN(Filename) \
5505 ((Filename)[0] && (Filename)[1] == ':' ? 2 : 0)
5507 # define FILESYSTEM_PREFIX_LEN(Filename) 0
5510 AC_DEFINE_UNQUOTED([FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX],
5511 $ac_fs_accepts_drive_letter_prefix,
5512 [Define on systems for which file names may have a so-called
5513 `drive letter' prefix, define this to compute the length of that
5514 prefix, including the colon.])
5516 AH_VERBATIM(ISSLASH,
5517 [#if FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR
5518 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
5520 # define ISSLASH(C) ((C) == '/')
5523 AC_DEFINE_UNQUOTED([FILESYSTEM_BACKSLASH_IS_FILE_NAME_SEPARATOR],
5524 $ac_fs_backslash_is_file_name_separator,
5525 [Define if the backslash character may also serve as a file name
5526 component separator.])
5530 AC_DEFUN([AC_FUNC_CANONICALIZE_FILE_NAME],
5532 AC_REQUIRE([AC_HEADER_STDC])
5533 AC_CHECK_HEADERS(string.h sys/param.h stddef.h)
5534 AC_CHECK_FUNCS(resolvepath)
5535 AC_REQUIRE([AC_HEADER_STAT])
5537 # This would simply be AC_REPLACE_FUNC([canonicalize_file_name])
5538 # if the function name weren't so long. Besides, I would rather
5539 # not have underscores in file names.
5540 AC_CHECK_FUNC([canonicalize_file_name], , [AC_LIBOBJ(canonicalize)])
5545 dnl From Paul Eggert.
5547 # Define ST_MTIM_NSEC to be the nanoseconds member of struct stat's st_mtim,
5550 AC_DEFUN([AC_STRUCT_ST_MTIM_NSEC],
5551 [AC_CACHE_CHECK([for nanoseconds member of struct stat.st_mtim],
5552 ac_cv_struct_st_mtim_nsec,
5553 [ac_save_CPPFLAGS="$CPPFLAGS"
5554 ac_cv_struct_st_mtim_nsec=no
5555 # tv_nsec -- the usual case
5556 # _tv_nsec -- Solaris 2.6, if
5557 # (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
5558 # && !defined __EXTENSIONS__)
5559 # st__tim.tv_nsec -- UnixWare 2.1.2
5560 for ac_val in tv_nsec _tv_nsec st__tim.tv_nsec; do
5561 CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
5562 AC_TRY_COMPILE([#include <sys/types.h>
5563 #include <sys/stat.h>], [struct stat s; s.st_mtim.ST_MTIM_NSEC;],
5564 [ac_cv_struct_st_mtim_nsec=$ac_val; break])
5566 CPPFLAGS="$ac_save_CPPFLAGS"])
5568 if test $ac_cv_struct_st_mtim_nsec != no; then
5569 AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
5570 [Define to be the nanoseconds member of struct stat's st_mtim,
5578 # Define HAVE_ST_DM_MODE if struct stat has an st_dm_mode member.
5580 AC_DEFUN([AC_STRUCT_ST_DM_MODE],
5581 [AC_CACHE_CHECK([for st_dm_mode in struct stat], ac_cv_struct_st_dm_mode,
5582 [AC_TRY_COMPILE([#include <sys/types.h>
5583 #include <sys/stat.h>], [struct stat s; s.st_dm_mode;],
5584 ac_cv_struct_st_dm_mode=yes,
5585 ac_cv_struct_st_dm_mode=no)])
5587 if test $ac_cv_struct_st_dm_mode = yes; then
5588 AC_DEFINE(HAVE_ST_DM_MODE, 1,
5589 [Define if struct stat has an st_dm_mode member. ])
5596 dnl From Jim Meyering
5598 dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
5599 dnl in time.h or sys/time.h.
5601 AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
5603 AC_REQUIRE([AC_HEADER_TIME])
5604 AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
5607 # if TIME_WITH_SYS_TIME
5608 # include <sys/time.h>
5611 # if HAVE_SYS_TIME_H
5612 # include <sys/time.h>
5618 [static struct timespec x; x.tv_sec = x.tv_nsec;],
5619 fu_cv_sys_struct_timespec=yes,
5620 fu_cv_sys_struct_timespec=no)
5623 if test $fu_cv_sys_struct_timespec = yes; then
5624 AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
5625 [Define if struct timespec is declared in <time.h>. ])
5630 dnl From Jim Meyering and Paul Eggert.
5631 AC_DEFUN([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
5632 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5633 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires termios.h],
5634 jm_cv_sys_tiocgwinsz_needs_termios_h,
5635 [jm_cv_sys_tiocgwinsz_needs_termios_h=no
5637 if test $ac_cv_sys_posix_termios = yes; then
5639 [#include <sys/types.h>
5640 # include <termios.h>
5644 ], jm_cv_sys_tiocgwinsz_needs_termios_h=yes)
5649 AC_DEFUN([jm_WINSIZE_IN_PTEM],
5650 [AC_REQUIRE([AC_SYS_POSIX_TERMIOS])
5651 AC_CACHE_CHECK([whether use of struct winsize requires sys/ptem.h],
5652 jm_cv_sys_struct_winsize_needs_sys_ptem_h,
5653 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=yes
5654 if test $ac_cv_sys_posix_termios = yes; then
5655 AC_TRY_COMPILE([#include <termios.h>]
5656 [struct winsize x;],
5657 [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5659 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5660 AC_TRY_COMPILE([#include <sys/ptem.h>],
5661 [struct winsize x;],
5662 [], [jm_cv_sys_struct_winsize_needs_sys_ptem_h=no])
5664 if test $jm_cv_sys_struct_winsize_needs_sys_ptem_h = yes; then
5665 AC_DEFINE([WINSIZE_IN_PTEM], 1,
5666 [Define if sys/ptem.h is required for struct winsize.])
5669 # Determine whether this system has infrastructure for obtaining the boot time.
5671 # GNULIB_BOOT_TIME([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
5672 * ----------------------------------------------------------
5673 AC_DEFUN([GNULIB_BOOT_TIME],
5675 AC_CHECK_FUNCS(sysctl)
5676 AC_CHECK_HEADERS(sys/sysctl.h)
5678 [whether we can get the system boot time],
5679 [gnulib_cv_have_boot_time],
5683 [AC_INCLUDES_DEFAULT
5684 #if HAVE_SYSCTL && HAVE_SYS_SYSCTL_H
5685 # include <sys/param.h> /* needed for OpenBSD 3.0 */
5686 # include <sys/sysctl.h>
5695 #if defined BOOT_TIME || (defined CTL_KERN && defined KERN_BOOTTIME)
5696 /* your system *does* have the infrastructure to determine boot time */
5698 please_tell_us_how_to_determine_boot_time_on_your_system
5701 gnulib_cv_have_boot_time=yes,
5702 gnulib_cv_have_boot_time=no)
5704 AS_IF([test $gnulib_cv_have_boot_time = yes], [$1], [$2])
5709 AC_DEFUN([jm_HEADER_TIOCGWINSZ_NEEDS_SYS_IOCTL],
5710 [AC_REQUIRE([jm_HEADER_TIOCGWINSZ_IN_TERMIOS_H])
5711 AC_CACHE_CHECK([whether use of TIOCGWINSZ requires sys/ioctl.h],
5712 jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h,
5713 [jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=no
5715 if test $jm_cv_sys_tiocgwinsz_needs_termios_h = no; then
5717 [#include <sys/types.h>
5718 # include <sys/ioctl.h>
5722 ], jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h=yes)
5725 if test $jm_cv_sys_tiocgwinsz_needs_sys_ioctl_h = yes; then
5726 AC_DEFINE(GWINSZ_IN_SYS_IOCTL, 1,
5727 [Define if your system defines TIOCGWINSZ in sys/ioctl.h.])
5733 dnl Misc lib-related macros for fileutils, sh-utils, textutils.
5735 AC_DEFUN([jm_LIB_CHECK],
5738 # Check for libypsec.a on Dolphin M88K machines.
5739 AC_CHECK_LIB(ypsec, main)
5741 # m88k running dgux 5.4 needs this
5742 AC_CHECK_LIB(ldgc, main)
5744 # Some programs need to link with -lm. printf does if it uses
5745 # lib/strtod.c which uses pow. And seq uses the math functions,
5746 # floor, modf, rint. And factor uses sqrt. And sleep uses fesetround.
5748 # Save a copy of $LIBS and add $FLOOR_LIBM before these tests
5749 # Check for these math functions used by seq.
5750 ac_su_saved_lib="$LIBS"
5752 AC_CHECK_FUNCS(floor modf rint)
5753 LIBS="$ac_su_saved_lib"
5756 AC_CHECK_FUNCS(sqrt)
5757 if test $ac_cv_func_sqrt = no; then
5758 AC_CHECK_LIB(m, sqrt, [SQRT_LIBM=-lm])
5761 AC_SUBST(FESETROUND_LIBM)
5762 AC_CHECK_FUNCS(fesetround)
5763 if test $ac_cv_func_fesetround = no; then
5764 AC_CHECK_LIB(m, fesetround, [FESETROUND_LIBM=-lm])
5767 # The -lsun library is required for YP support on Irix-4.0.5 systems.
5768 # m88k/svr3 DolphinOS systems using YP need -lypsec for id.
5769 AC_SEARCH_LIBS(yp_match, [sun ypsec])
5771 # SysV needs -lsec, older versions of Linux need -lshadow for
5772 # shadow passwords. UnixWare 7 needs -lgen.
5773 AC_SEARCH_LIBS(getspnam, [shadow sec gen])
5775 AC_CHECK_HEADERS(shadow.h)
5777 # Requirements for su.c.
5779 $ac_includes_default
5781 # include <shadow.h>
5784 AC_CHECK_MEMBERS([struct spwd.sp_pwdp],,,[$shadow_includes])
5785 AC_CHECK_FUNCS(getspnam)
5787 # SCO-ODT-3.0 is reported to need -lufc for crypt.
5788 # NetBSD needs -lcrypt for crypt.
5789 ac_su_saved_lib="$LIBS"
5790 AC_SEARCH_LIBS(crypt, [ufc crypt], [LIB_CRYPT="$ac_cv_search_crypt"])
5791 LIBS="$ac_su_saved_lib"
5795 # gettext.m4 serial 17 (gettext-0.11.5)
5796 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
5797 dnl This file is free software, distributed under the terms of the GNU
5798 dnl General Public License. As a special exception to the GNU General
5799 dnl Public License, this file may be distributed as part of a program
5800 dnl that contains a configuration script generated by Autoconf, under
5801 dnl the same distribution terms as the rest of that program.
5803 dnl This file can can be used in projects which are not available under
5804 dnl the GNU General Public License or the GNU Library General Public
5805 dnl License but which still want to provide support for the GNU gettext
5807 dnl Please note that the actual code of the GNU gettext library is covered
5808 dnl by the GNU Library General Public License, and the rest of the GNU
5809 dnl gettext package package is covered by the GNU General Public License.
5810 dnl They are *not* in the public domain.
5813 dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
5814 dnl Bruno Haible <haible@clisp.cons.org>, 2000-2002.
5816 dnl Macro to add for using GNU gettext.
5818 dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
5819 dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
5820 dnl default (if it is not specified or empty) is 'no-libtool'.
5821 dnl INTLSYMBOL should be 'external' for packages with no intl directory,
5822 dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory.
5823 dnl If INTLSYMBOL is 'use-libtool', then a libtool library
5824 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
5825 dnl depending on --{enable,disable}-{shared,static} and on the presence of
5826 dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
5827 dnl $(top_builddir)/intl/libintl.a will be created.
5828 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
5829 dnl implementations (in libc or libintl) without the ngettext() function
5830 dnl will be ignored. If NEEDSYMBOL is specified and is
5831 dnl 'need-formatstring-macros', then GNU gettext implementations that don't
5832 dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
5833 dnl INTLDIR is used to find the intl libraries. If empty,
5834 dnl the value `$(top_builddir)/intl/' is used.
5836 dnl The result of the configuration is one of three cases:
5837 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
5839 dnl Catalog format: GNU --> install in $(datadir)
5840 dnl Catalog extension: .mo after installation, .gmo in source tree
5841 dnl 2) GNU gettext has been found in the system's C library.
5842 dnl Catalog format: GNU --> install in $(datadir)
5843 dnl Catalog extension: .mo after installation, .gmo in source tree
5844 dnl 3) No internationalization, always use English msgid.
5845 dnl Catalog format: none
5846 dnl Catalog extension: none
5847 dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
5848 dnl The use of .gmo is historical (it was needed to avoid overwriting the
5849 dnl GNU format catalogs when building on a platform with an X/Open gettext),
5850 dnl but we keep it in order not to force irrelevant filename changes on the
5853 AC_DEFUN([AM_GNU_GETTEXT],
5855 dnl Argument checking.
5856 ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
5857 [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
5859 ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
5860 [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
5862 define(gt_included_intl, ifelse([$1], [external], [no], [yes]))
5863 define(gt_libtool_suffix_prefix, ifelse([$1], [use-libtool], [l], []))
5865 AC_REQUIRE([AM_PO_SUBDIRS])dnl
5866 ifelse(gt_included_intl, yes, [
5867 AC_REQUIRE([AM_INTL_SUBDIR])dnl
5870 dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
5871 AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
5872 AC_REQUIRE([AC_LIB_RPATH])
5874 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5875 dnl Ideally we would do this search only after the
5876 dnl if test "$USE_NLS" = "yes"; then
5877 dnl if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5878 dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
5879 dnl the configure script would need to contain the same shell code
5880 dnl again, outside any 'if'. There are two solutions:
5881 dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
5882 dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
5883 dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
5884 dnl documented, we avoid it.
5885 ifelse(gt_included_intl, yes, , [
5886 AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
5889 AC_MSG_CHECKING([whether NLS is requested])
5890 dnl Default is enabled NLS
5892 [ --disable-nls do not use Native Language Support],
5893 USE_NLS=$enableval, USE_NLS=yes)
5894 AC_MSG_RESULT($USE_NLS)
5897 ifelse(gt_included_intl, yes, [
5898 BUILD_INCLUDED_LIBINTL=no
5899 USE_INCLUDED_LIBINTL=no
5905 dnl If we use NLS figure out what method
5906 if test "$USE_NLS" = "yes"; then
5907 gt_use_preinstalled_gnugettext=no
5908 ifelse(gt_included_intl, yes, [
5909 AC_MSG_CHECKING([whether included gettext is requested])
5910 AC_ARG_WITH(included-gettext,
5911 [ --with-included-gettext use the GNU gettext library included here],
5912 nls_cv_force_use_gnu_gettext=$withval,
5913 nls_cv_force_use_gnu_gettext=no)
5914 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
5916 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
5917 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
5919 dnl User does not insist on using GNU NLS library. Figure out what
5920 dnl to use. If GNU gettext is available we use this. Else we have
5921 dnl to fall back to GNU NLS library.
5923 dnl Add a version number to the cache macros.
5924 define([gt_api_version], ifelse([$2], [need-formatstring-macros], 3, ifelse([$2], [need-ngettext], 2, 1)))
5925 define([gt_cv_func_gnugettext_libc], [gt_cv_func_gnugettext]gt_api_version[_libc])
5926 define([gt_cv_func_gnugettext_libintl], [gt_cv_func_gnugettext]gt_api_version[_libintl])
5928 AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc,
5929 [AC_TRY_LINK([#include <libintl.h>
5930 ]ifelse([$2], [need-formatstring-macros],
5931 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5932 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5935 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5937 ], [])[extern int _nl_msg_cat_cntr;
5938 extern int *_nl_domain_bindings;],
5939 [bindtextdomain ("", "");
5940 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_domain_bindings],
5941 gt_cv_func_gnugettext_libc=yes,
5942 gt_cv_func_gnugettext_libc=no)])
5944 if test "$gt_cv_func_gnugettext_libc" != "yes"; then
5945 dnl Sometimes libintl requires libiconv, so first search for libiconv.
5946 ifelse(gt_included_intl, yes, , [
5949 dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
5950 dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
5951 dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
5952 dnl even if libiconv doesn't exist.
5953 AC_LIB_LINKFLAGS_BODY([intl])
5954 AC_CACHE_CHECK([for GNU gettext in libintl],
5955 gt_cv_func_gnugettext_libintl,
5956 [gt_save_CPPFLAGS="$CPPFLAGS"
5957 CPPFLAGS="$CPPFLAGS $INCINTL"
5958 gt_save_LIBS="$LIBS"
5959 LIBS="$LIBS $LIBINTL"
5960 dnl Now see whether libintl exists and does not depend on libiconv.
5961 AC_TRY_LINK([#include <libintl.h>
5962 ]ifelse([$2], [need-formatstring-macros],
5963 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5964 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5967 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5969 ], [])[extern int _nl_msg_cat_cntr;
5974 const char *_nl_expand_alias ();],
5975 [bindtextdomain ("", "");
5976 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5977 gt_cv_func_gnugettext_libintl=yes,
5978 gt_cv_func_gnugettext_libintl=no)
5979 dnl Now see whether libintl exists and depends on libiconv.
5980 if test "$gt_cv_func_gnugettext_libintl" != yes && test -n "$LIBICONV"; then
5981 LIBS="$LIBS $LIBICONV"
5982 AC_TRY_LINK([#include <libintl.h>
5983 ]ifelse([$2], [need-formatstring-macros],
5984 [#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
5985 #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
5988 typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
5990 ], [])[extern int _nl_msg_cat_cntr;
5995 const char *_nl_expand_alias ();],
5996 [bindtextdomain ("", "");
5997 return (int) gettext ("")]ifelse([$2], [need-ngettext], [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr + *_nl_expand_alias (0)],
5998 [LIBINTL="$LIBINTL $LIBICONV"
5999 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
6000 gt_cv_func_gnugettext_libintl=yes
6003 CPPFLAGS="$gt_save_CPPFLAGS"
6004 LIBS="$gt_save_LIBS"])
6007 dnl If an already present or preinstalled GNU gettext() is found,
6008 dnl use it. But if this macro is used in GNU gettext, and GNU
6009 dnl gettext is already preinstalled in libintl, we update this
6010 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
6011 if test "$gt_cv_func_gnugettext_libc" = "yes" \
6012 || { test "$gt_cv_func_gnugettext_libintl" = "yes" \
6013 && test "$PACKAGE" != gettext; }; then
6014 gt_use_preinstalled_gnugettext=yes
6016 dnl Reset the values set by searching for libintl.
6022 ifelse(gt_included_intl, yes, [
6023 if test "$gt_use_preinstalled_gnugettext" != "yes"; then
6024 dnl GNU gettext is not found in the C library.
6025 dnl Fall back on included GNU gettext library.
6026 nls_cv_use_gnu_gettext=yes
6030 if test "$nls_cv_use_gnu_gettext" = "yes"; then
6031 dnl Mark actions used to generate GNU NLS library.
6032 INTLOBJS="\$(GETTOBJS)"
6033 BUILD_INCLUDED_LIBINTL=yes
6034 USE_INCLUDED_LIBINTL=yes
6035 LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV"
6036 LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV"
6037 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
6040 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6041 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6042 dnl Mark actions to use GNU gettext tools.
6047 if test "$gt_use_preinstalled_gnugettext" = "yes" \
6048 || test "$nls_cv_use_gnu_gettext" = "yes"; then
6049 AC_DEFINE(ENABLE_NLS, 1,
6050 [Define to 1 if translation of program messages to the user's native language
6057 if test "$USE_NLS" = "yes"; then
6059 if test "$gt_use_preinstalled_gnugettext" = "yes"; then
6060 if test "$gt_cv_func_gnugettext_libintl" = "yes"; then
6061 AC_MSG_CHECKING([how to link with libintl])
6062 AC_MSG_RESULT([$LIBINTL])
6063 AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
6066 dnl For backward compatibility. Some packages may be using this.
6067 AC_DEFINE(HAVE_GETTEXT, 1,
6068 [Define if the GNU gettext() function is already present or preinstalled.])
6069 AC_DEFINE(HAVE_DCGETTEXT, 1,
6070 [Define if the GNU dcgettext() function is already present or preinstalled.])
6073 dnl We need to process the po/ directory.
6077 ifelse(gt_included_intl, yes, [
6078 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
6079 dnl to 'yes' because some of the testsuite requires it.
6080 if test "$PACKAGE" = gettext; then
6081 BUILD_INCLUDED_LIBINTL=yes
6084 dnl Make all variables we use known to autoconf.
6085 AC_SUBST(BUILD_INCLUDED_LIBINTL)
6086 AC_SUBST(USE_INCLUDED_LIBINTL)
6090 dnl For backward compatibility. Some configure.ins may be using this.
6092 nls_cv_header_libgt=
6094 dnl For backward compatibility. Some Makefiles may be using this.
6096 AC_SUBST(DATADIRNAME)
6098 dnl For backward compatibility. Some Makefiles may be using this.
6100 AC_SUBST(INSTOBJEXT)
6102 dnl For backward compatibility. Some Makefiles may be using this.
6106 dnl Enable libtool support if the surrounding package wishes it.
6107 INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
6108 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
6111 dnl For backward compatibility. Some Makefiles may be using this.
6115 dnl Make all documented variables known to autoconf.
6122 dnl Checks for all prerequisites of the po subdirectory,
6123 dnl except for USE_NLS.
6124 AC_DEFUN([AM_PO_SUBDIRS],
6126 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
6127 AC_REQUIRE([AC_PROG_INSTALL])dnl
6128 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6130 dnl Perform the following tests also if --disable-nls has been given,
6131 dnl because they are needed for "make dist" to work.
6133 dnl Search for GNU msgfmt in the PATH.
6134 dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
6135 dnl The second test excludes FreeBSD msgfmt.
6136 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
6137 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1 &&
6138 (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
6140 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
6142 dnl Search for GNU xgettext 0.11 or newer in the PATH.
6143 dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
6144 dnl The second test excludes FreeBSD xgettext.
6145 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
6146 [$ac_dir/$ac_word --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6147 (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)],
6149 dnl Remove leftover from FreeBSD xgettext call.
6152 dnl Search for GNU msgmerge 0.11 or newer in the PATH.
6153 AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
6154 [$ac_dir/$ac_word --update -q /dev/null /dev/null >/dev/null 2>&1], :)
6156 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6157 dnl Test whether we really found GNU msgfmt.
6158 if test "$GMSGFMT" != ":"; then
6159 dnl If it is no GNU msgfmt we define it as : so that the
6160 dnl Makefiles still can work.
6161 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1 &&
6162 (if $GMSGFMT --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6165 GMSGFMT=`echo "$GMSGFMT" | sed -e 's,^.*/,,'`
6167 [found $GMSGFMT program is not GNU msgfmt; ignore it])
6172 dnl This could go away some day; the PATH_PROG_WITH_TEST already does it.
6173 dnl Test whether we really found GNU xgettext.
6174 if test "$XGETTEXT" != ":"; then
6175 dnl If it is no GNU xgettext we define it as : so that the
6176 dnl Makefiles still can work.
6177 if $XGETTEXT --omit-header --copyright-holder= /dev/null >/dev/null 2>&1 &&
6178 (if $XGETTEXT --omit-header --copyright-holder= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
6182 [found xgettext program is not GNU xgettext; ignore it])
6185 dnl Remove leftover from FreeBSD xgettext call.
6189 AC_OUTPUT_COMMANDS([
6190 for ac_file in $CONFIG_FILES; do
6191 # Support "outfile[:infile[:infile...]]"
6193 *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
6195 # PO directories have a Makefile.in generated from Makefile.in.in.
6196 case "$ac_file" in */Makefile.in)
6197 # Adjust a relative srcdir.
6198 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
6199 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
6200 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
6201 # In autoconf-2.13 it is called $ac_given_srcdir.
6202 # In autoconf-2.50 it is called $srcdir.
6203 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
6204 case "$ac_given_srcdir" in
6205 .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
6206 /*) top_srcdir="$ac_given_srcdir" ;;
6207 *) top_srcdir="$ac_dots$ac_given_srcdir" ;;
6209 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
6210 rm -f "$ac_dir/POTFILES"
6211 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
6212 cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
6213 # ALL_LINGUAS, POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES depend
6214 # on $ac_dir but don't depend on user-specified configuration
6216 if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
6217 # The LINGUAS file contains the set of available languages.
6218 if test -n "$ALL_LINGUAS"; then
6219 test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
6221 ALL_LINGUAS_=`sed -e "/^#/d" "$ac_given_srcdir/$ac_dir/LINGUAS"`
6222 # Hide the ALL_LINGUAS assigment from automake.
6223 eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
6225 case "$ac_given_srcdir" in
6227 *) srcdirpre='$(srcdir)/' ;;
6233 for lang in $ALL_LINGUAS; do
6234 POFILES="$POFILES $srcdirpre$lang.po"
6235 GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
6236 UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
6237 DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
6239 # CATALOGS depends on both $ac_dir and the user's LINGUAS
6240 # environment variable.
6242 if test -n "$ALL_LINGUAS"; then
6243 for presentlang in $ALL_LINGUAS; do
6245 if test "%UNSET%" != "$LINGUAS"; then
6246 desiredlanguages="$LINGUAS"
6248 desiredlanguages="$ALL_LINGUAS"
6250 for desiredlang in $desiredlanguages; do
6251 # Use the presentlang catalog if desiredlang is
6252 # a. equal to presentlang, or
6253 # b. a variant of presentlang (because in this case,
6254 # presentlang can be used as a fallback for messages
6255 # which are not translated in the desiredlang catalog).
6256 case "$desiredlang" in
6257 "$presentlang"*) useit=yes;;
6260 if test $useit = yes; then
6261 INST_LINGUAS="$INST_LINGUAS $presentlang"
6266 if test -n "$INST_LINGUAS"; then
6267 for lang in $INST_LINGUAS; do
6268 CATALOGS="$CATALOGS $lang.gmo"
6271 test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
6272 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"
6273 for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
6274 if test -f "$f"; then
6276 *.orig | *.bak | *~) ;;
6277 *) cat "$f" >> "$ac_dir/Makefile" ;;
6285 [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
6286 # POFILES, GMOFILES, UPDATEPOFILES, DUMMYPOFILES, CATALOGS. But hide it
6288 eval 'ALL_LINGUAS''="$ALL_LINGUAS"'
6289 # Capture the value of LINGUAS because we need it to compute CATALOGS.
6290 LINGUAS="${LINGUAS-%UNSET%}"
6295 dnl Checks for all prerequisites of the intl subdirectory,
6296 dnl except for INTL_LIBTOOL_SUFFIX_PREFIX (and possibly LIBTOOL), INTLOBJS,
6297 dnl USE_INCLUDED_LIBINTL, BUILD_INCLUDED_LIBINTL.
6298 AC_DEFUN([AM_INTL_SUBDIR],
6300 AC_REQUIRE([AC_PROG_INSTALL])dnl
6301 AC_REQUIRE([AM_MKINSTALLDIRS])dnl
6302 AC_REQUIRE([AC_PROG_CC])dnl
6303 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6304 AC_REQUIRE([AC_PROG_RANLIB])dnl
6305 AC_REQUIRE([AC_ISC_POSIX])dnl
6306 AC_REQUIRE([AC_HEADER_STDC])dnl
6307 AC_REQUIRE([AC_C_CONST])dnl
6308 AC_REQUIRE([AC_C_INLINE])dnl
6309 AC_REQUIRE([AC_TYPE_OFF_T])dnl
6310 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
6311 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
6312 AC_REQUIRE([AC_FUNC_MMAP])dnl
6313 AC_REQUIRE([jm_GLIBC21])dnl
6314 AC_REQUIRE([gt_INTDIV0])dnl
6315 AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])dnl
6316 AC_REQUIRE([gt_INTTYPES_PRI])dnl
6318 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
6319 stdlib.h string.h unistd.h sys/param.h])
6320 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getc_unlocked getcwd getegid \
6321 geteuid getgid getuid mempcpy munmap putenv setenv setlocale stpcpy \
6322 strcasecmp strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
6326 if test $ac_cv_header_locale_h = yes; then
6330 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
6331 dnl because plural.y uses bison specific features. It requires at least
6332 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
6334 dnl bison is only needed for the maintainer (who touches plural.y). But in
6335 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
6336 dnl the rule in general Makefile. Now, some people carelessly touch the
6337 dnl files or have a broken "make" program, hence the plural.c rule will
6338 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
6339 dnl present or too old.
6340 AC_CHECK_PROGS([INTLBISON], [bison])
6341 if test -z "$INTLBISON"; then
6344 dnl Found it, now check the version.
6345 AC_MSG_CHECKING([version of bison])
6346 changequote(<<,>>)dnl
6347 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
6348 case $ac_prog_version in
6349 '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
6350 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
6352 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
6353 *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
6355 AC_MSG_RESULT([$ac_prog_version])
6357 if test $ac_verc_fail = yes; then
6363 AC_DEFUN([AM_MKINSTALLDIRS],
6365 dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
6366 dnl find the mkinstalldirs script in another subdir but $(top_srcdir).
6367 dnl Try to locate is.
6369 if test -n "$ac_aux_dir"; then
6370 MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
6372 if test -z "$MKINSTALLDIRS"; then
6373 MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
6375 AC_SUBST(MKINSTALLDIRS)
6379 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
6380 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
6382 # progtest.m4 serial 3
6383 dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
6384 dnl This file is free software, distributed under the terms of the GNU
6385 dnl General Public License. As a special exception to the GNU General
6386 dnl Public License, this file may be distributed as part of a program
6387 dnl that contains a configuration script generated by Autoconf, under
6388 dnl the same distribution terms as the rest of that program.
6390 dnl This file can can be used in projects which are not available under
6391 dnl the GNU General Public License or the GNU Library General Public
6392 dnl License but which still want to provide support for the GNU gettext
6394 dnl Please note that the actual code of the GNU gettext library is covered
6395 dnl by the GNU Library General Public License, and the rest of the GNU
6396 dnl gettext package package is covered by the GNU General Public License.
6397 dnl They are *not* in the public domain.
6400 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
6402 # Search path for a program which passes the given test.
6404 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
6405 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
6406 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
6407 [# Extract the first word of "$2", so it can be a program name with args.
6408 set dummy $2; ac_word=[$]2
6409 AC_MSG_CHECKING([for $ac_word])
6410 AC_CACHE_VAL(ac_cv_path_$1,
6413 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
6416 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
6417 for ac_dir in ifelse([$5], , $PATH, [$5]); do
6418 test -z "$ac_dir" && ac_dir=.
6419 if test -f $ac_dir/$ac_word; then
6421 ac_cv_path_$1="$ac_dir/$ac_word"
6427 dnl If no 4th arg is given, leave the cache variable unset,
6428 dnl so AC_PATH_PROGS will keep looking.
6429 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
6434 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
6435 AC_MSG_RESULT([$]$1)
6442 # intdiv0.m4 serial 1 (gettext-0.11.3)
6443 dnl Copyright (C) 2002 Free Software Foundation, Inc.
6444 dnl This file is free software, distributed under the terms of the GNU
6445 dnl General Public License. As a special exception to the GNU General
6446 dnl Public License, this file may be distributed as part of a program
6447 dnl that contains a configuration script generated by Autoconf, under
6448 dnl the same distribution terms as the rest of that program.
6450 dnl From Bruno Haible.
6452 AC_DEFUN([gt_INTDIV0],
6454 AC_REQUIRE([AC_PROG_CC])dnl
6455 AC_REQUIRE([AC_CANONICAL_HOST])dnl
6457 AC_CACHE_CHECK([whether integer division by zero raises SIGFPE],
6458 gt_cv_int_divbyzero_sigfpe,
6466 sigfpe_handler (int sig)
6468 sigfpe_handler (sig) int sig;
6471 /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */
6472 exit (sig != SIGFPE);
6482 signal (SIGFPE, sigfpe_handler);
6483 /* IRIX and AIX (when "xlc -qcheck" is used) yield signal SIGTRAP. */
6484 #if (defined (__sgi) || defined (_AIX)) && defined (SIGTRAP)
6485 signal (SIGTRAP, sigfpe_handler);
6487 /* Linux/SPARC yields signal SIGILL. */
6488 #if defined (__sparc__) && defined (__linux__)
6489 signal (SIGILL, sigfpe_handler);
6496 ], gt_cv_int_divbyzero_sigfpe=yes, gt_cv_int_divbyzero_sigfpe=no,
6498 # Guess based on the CPU.
6500 alpha* | i[34567]86 | m68k | s390*)
6501 gt_cv_int_divbyzero_sigfpe="guessing yes";;
6503 gt_cv_int_divbyzero_sigfpe="guessing no";;
6507 case "$gt_cv_int_divbyzero_sigfpe" in
6511 AC_DEFINE_UNQUOTED(INTDIV0_RAISES_SIGFPE, $value,
6512 [Define if integer division by zero raises signal SIGFPE.])
6515 # lcmessage.m4 serial 3 (gettext-0.11.3)
6516 dnl Copyright (C) 1995-2002 Free Software Foundation, Inc.
6517 dnl This file is free software, distributed under the terms of the GNU
6518 dnl General Public License. As a special exception to the GNU General
6519 dnl Public License, this file may be distributed as part of a program
6520 dnl that contains a configuration script generated by Autoconf, under
6521 dnl the same distribution terms as the rest of that program.
6523 dnl This file can can be used in projects which are not available under
6524 dnl the GNU General Public License or the GNU Library General Public
6525 dnl License but which still want to provide support for the GNU gettext
6527 dnl Please note that the actual code of the GNU gettext library is covered
6528 dnl by the GNU Library General Public License, and the rest of the GNU
6529 dnl gettext package package is covered by the GNU General Public License.
6530 dnl They are *not* in the public domain.
6533 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
6535 # Check whether LC_MESSAGES is available in <locale.h>.
6537 AC_DEFUN([AM_LC_MESSAGES],
6539 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
6540 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
6541 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
6542 if test $am_cv_val_LC_MESSAGES = yes; then
6543 AC_DEFINE(HAVE_LC_MESSAGES, 1,
6544 [Define if your <locale.h> file defines LC_MESSAGES.])