bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gnulib] autoconf macros for each module


From: Bruno Haible
Subject: [Bug-gnulib] autoconf macros for each module
Date: Tue, 31 Dec 2002 14:34:22 +0100 (CET)

Hi,

I've added this patch. It gives an independent .m4 file for each module. This
is part of "make is easy to use gnulib modules in other packages". I'll
explain in a separate mail what this means for existing packages (esp. Jim).


2002-12-24  Bruno Haible  <address@hidden>

        General infrasructure.
        * README: Rewritten.
        * onceonly.m4: New file.
        * onceonly_2_57.m4: New file.

        Module atexit.
        * atexit.m4: New file.

        Module strtod.
        * strtod.m4: New file.

        Module strtol.
        * strtol.m4: New file.

        Module strtoul.
        * strtoul.m4: New file.

        Module memchr.
        * memchr.m4: New file.

        Module memcmp.
        * memcmp.m4 (gl_PREREQ_MEMCMP): New macro.
        (jm_FUNC_MEMCMP): Invoke it.

        Module memcpy.
        * memcpy.m4: New file.

        Module memmove.
        * memmove.m4: New file.

        Module memset.
        * memset.m4: New file.

        Module strcspn.
        * strcspn.m4: New file.

        Module strpbrk.
        * strpbrk.m4: New file.

        Module strstr.
        * strstr.m4: New file.

        Module strerror.
        * strerror.m4: New file.

        Module mktime.
        * mktime.m4: Renamed from jm-mktime.m4.
        (gl_PREREQ_MKTIME): New macro.
        (gl_FUNC_MKTIME): Renamed from jm_FUNC_MKTIME. Invoke gl_PREREQ_MKTIME.

        Module malloc.
        * malloc.m4 (gl_PREREQ_MALLOC): New macro.
        (jm_FUNC_MALLOC): Use AC_FUNC_MALLOC. Invoke gl_PREREQ_MALLOC.
        Don't define HAVE_DONE_WORKING_MALLOC_CHECK, since nothing uses it.

        Module realloc.
        * realloc.m4 (gl_PREREQ_REALLOC): New macro.
        (jm_FUNC_REALLOC): Use AC_FUNC_REALLOC. Invoke gl_PREREQ_REALLOC.
        Don't define HAVE_DONE_WORKING_REALLOC_CHECK, since nothing uses it.

        Module strftime.
        * tm_gmtoff.m4: New file, extracted from strftime.m4.
        * strftime.m4 (_jm_STRFTIME_PREREQS): Use AC_FUNC_STRFTIME.
        Don't test for bcopy (we are not emacs). Invoke AC_TYPE_MBSTATE_T and
        gl_TM_GMTOFF.
        (_jm_STRFTIME_PREREQS, jm_FUNC_GNU_STRFTIME): Use onceonly macros.

        Module xalloc.
        * xalloc.m4: New file.

        Module alloca.
        * alloca.m4: New file.

        Module putenv.
        * putenv.m4 (gl_PREREQ_PUTENV): New macro.
        (jm_FUNC_PUTENV): Invoke it.

        Module setenv.
        * setenv.m4 (gt_FUNC_SETENV): New macro.
        (gt_CHECK_VAR_DECL): Fix quoting error that led to infinite loop in m4
        when invoked twice.
        (gt_PREREQ_SETENV, gt_PREREQ_UNSETENV): New macros, replacing old
        gt_FUNC_SETENV.

        Module memrchr.
        * memrchr.m4: New file.

        Module stpcpy.
        * stpcpy.m4: New file.

        Module strcase.
        * strcase.m4: New file.

        Module strdup.
        * strdup.m4: New file.

        Module strnlen.
        * strnlen.m4: New file.

        Module strndup.
        * strndup.m4: New file.

        Module xstrtod.
        * xstrtod.m4: New file.

        Module xstrtol.
        * xstrtol.m4: New file.

        Module getdate.
        * getdate.m4: New file.

        Module unlocked-io.
        * unlocked-io.m4: Renamed from jm-glibc-io.m4.
        (jm_FUNC_GLIBC_UNLOCKED_IO): Invoke AC_GNU_SOURCE. Use onceonly macros.
        * jm-glibc-io.m4n: Remove file.

        Module long-options.
        * long-options.m4: New file.

        Module md5.
        * md5.m4: New file.

        Module sha.
        * sha.m4: New file.

        Module getstr.
        * getstr.m4: New file.

        Module getline.
        * getline.m4 (gl_PREREQ_GETLINE): New macro.
        (AM_FUNC_GETLINE): Invoke AC_GNU_SOURCE. Use <stdlib.h>, not
        <sys/types.h>, for size_t. Use the function name gnu_getline, not
        simply getline. Infoke gl_PREREQ_GETLINE.

        Module obstack.
        * obstack.m4: New file.

        Module hash.
        * hash.m4: New file.

        Module readtokens.
        * readtokens.m4: New file.

        Module strverscmp.
        * strverscmp.m4: New file.

        Module stdbool.
        * stdbool.m4 (AC_HEADER_STDBOOL): Add test for _Bool. Needed for OSF/1.

        Module strtoll.
        * strtoll.m4: New file.

        Module strtoull.
        * strtoull.m4: New file.

        Module strtoimax.
        * strtoimax.m4: New file.

        Module strtoumax.
        * strtoumax.m4: New file.

        Module xstrtoimax.
        * xstrtoimax.m4 (jm_XSTRTOIMAX): Renamed from jm_AC_PREREQ_XSTRTOIMAX.
        Moved the strtol prerequisites to strtol.m4.
        Moved the strtoll prerequisites to strtoll.m4.
        Moved the strtoimax prerequisites to strtoimax.m4.

        Module xstrtoumax.
        * xstrtoumax.m4 (jm_XSTRTOUMAX): Renamed from jm_AC_PREREQ_XSTRTOUMAX.
        Moved the strtoul prerequisites to strtoul.m4.
        Moved the strtoull prerequisites to strtoull.m4.
        Moved the strtoumax prerequisites to strtoumax.m4.

        Module chown.
        * chown.m4 (gl_PREREQ_CHOWN): New macro.
        (jm_FUNC_CHOWN): Use AC_FUNC_CHOWN. Invoke gl_PREREQ_CHOWN.

        Module dup2.
        * dup2.m4: New file.

        Module ftruncate.
        * ftruncate.m4 (gl_PREREQ_FTRUNCATE): New macro.
        (jm_FUNC_FTRUNCATE): Use AC_REPLACE_FUNCS. Invoke gl_PREREQ_FTRUNCATE.

        Module getgroups.
        * getgroups.m4 (gl_PREREQ_GETGROUPS): New macro.
        (jm_FUNC_GETGROUPS): Use AC_FUNC_GETGROUPS. Invoke gl_PREREQ_GETGROUPS.

        Module gettimeofday.
        * gettimeofday.m4 (gl_PREREQ_GETTIMEOFDAY): New macro.
        (AC_FUNC_GETTIMEOFDAY_CLOBBER): Use onceonly macros. Invoke
        gl_PREREQ_GETTIMEOFDAY.

        Module mkdir.
        * mkdir-slash.m4 (gl_PREREQ_MKDIR): New macro.
        (UTILS_FUNC_MKDIR_TRAILING_SLASH): Invoke gl_PREREQ_MKDIR.

        Module mkstemp.
        * mkstemp.m4 (gl_PREREQ_MKSTEMP): New macro.
        (jm_PREREQ_TEMPNAME): New macro, from prereq.m4. Also invoke
        jm_AC_TYPE_UINTMAX_T.
        (UTILS_FUNC_MKSTEMP): Invoke gl_PREREQ_MKSTEMP and jm_PREREQ_TEMPNAME.

        Module stat.
        * stat.m4 (gl_PREREQ_STAT): New macro.
        (jm_FUNC_STAT): Use AC_FUNC_STAT. Invoke gl_PREREQ_STAT.

        Module lstat.
        * lstat.m4 (gl_PREREQ_LSTAT): New macro.
        (jm_FUNC_LSTAT): Use AC_FUNC_LSTAT. Invoke gl_PREREQ_LSTAT.

        Module timespec.
        * timespec.m4 (gl_TIMESPEC): New macro.
        (jm_CHECK_TYPE_STRUCT_TIMESPEC): Add check for <sys/time.h>.
        * st_mtim.m4: Indentation.

        Module nanosleep.
        * nanosleep.m4 (gl_PREREQ_NANOSLEEP): New macro.
        (jm_FUNC_NANOSLEEP): Add check for <sys/time.h>. Invoke
        gl_PREREQ_NANOSLEEP.

        Module regex.
        * regex.m4 (jm_PREREQ_REGEX): New macro.
        (jm_INCLUDED_REGEX): Invoke jm_PREREQ_REGEX.
        (gl_REGEX): New macro.

        Module rename.
        * rename.m4 (gl_PREREQ_RENAME): New macro.
        (vb_FUNC_RENAME): Invoke gl_PREREQ_RENAME.

        Module rmdir.
        * rmdir.m4: New file.

        Module utime.
        * utimbuf.m4 (jm_CHECK_TYPE_STRUCT_UTIMBUF): Use onceonly macros.
        * utime.m4 (gl_PREREQ_UTIME): New macro.
        (jm_FUNC_UTIME): Invoke gl_PREREQ_UTIME.

        Module dirname.
        * dirname.m4: New file.

        Module getopt.
        * getopt.m4: New file.

        Module unistd-safer.
        * unistd-safer.m4: New file.

        Module fnmatch.
        * fnmatch.m4 (_AC_FUNC_FNMATCH_IF): Include <stdlib.h>, for exit()
        declaration.
        (gl_PREREQ_FNMATCH_EXTRA): New macro.
        (gl_FUNC_FNMATCH_POSIX): New macro.
        (gl_FUNC_FNMATCH_GNU): Renamed from AC_FUNC_FNMATCH_GNU. Invoke
        gl_PREREQ_FNMATCH_EXTRA. Use the function name gnu_fnmatch, not
        simply fnmatch.

        Module exclude.
        * exclude.m4: New file.

        Module human.
        * human.m4: New file.

        Module acl.
        * acl.m4: Nop.

        Module backupfile.
        * backupfile.m4: New file.
        * d-ino.m4: Indentation.

        Module fsusage.
        * fsusage.m4 (gl_FSUSAGE): New macro.
        (jm_STATFS_TRUNCATES): New macro, from coreutils-4.5.4/configure.ac.
        (gl_PREREQ_FSUSAGE_EXTRA): New macro.

        Module dirfd.
        * dirfd.m4 (UTILS_FUNC_DIRFD): Invoke some AC_EGREP_CPP requirements.

        Module euidaccess.
        * euidaccess.m4: New file.

        Module file-type.
        * file-type.m4: New file.

        Module fileblocks.
        * fileblocks.m4: New file.

        Module filemode.
        * filemode.m4: New file.

        Module isdir.
        * isdir.m4: New file.

        Module lchown.
        * lchown.m4 (gl_PREREQ_LCHOWN): New macro.
        (jm_FUNC_LCHOWN): Invoke gl_PREREQ_LCHOWN.

        Module makepath.
        * makepath.m4: New file.

        Module modechange.
        * modechange.m4: New file.

        Module mountlist.
        * mountlist.m4: New file.
        * ls-mntd-fs.m4 (jm_LIST_MOUNTED_FILESYSTEMS): Use onceonly macros.
        Indentation.

        Module path-concat.
        * path-concat.m4: New file.

        Module pathmax.
        * pathmax.m4: New file.

        Module same.
        * same.m4: New file.

        Module save-cwd.
        * save-cwd.m4: New file.

        Module savedir.
        * savedir.m4: New file.

        Module xgetcwd.
        * xgetcwd.m4: New file.
        * getcwd.m4 (AC_FUNC_GETCWD_NULL): Use onceonly macros.

        Module xreadlink.
        * xreadlink.m4: New file.

        Module safe-read.
        * safe-read.m4: New file.

        Module safe-write.
        * safe-write.m4: New file.

        Module closeout.
        * closeout.m4: New file.

        Module stdio-safer.
        * stdio-safer.m4: New file.

        Module getpass.
        * getpass.m4: New file.

        Module getugroups.
        * getugroups.m4: New file.

        Module group-member.
        * group-member.m4 (gl_PREREQ_GROUP_MEMBER): New macro.
        (jm_FUNC_GROUP_MEMBER): Invoke AC_GNU_SOURCE, gl_PREREQ_GROUP_MEMBER.

        Module idcache.
        * idcache.m4: New file.

        Module userspec.
        * userspec.m4: New file.

        Module gettime.
        * clock_time.m4: New file.
        * gettime.m4: New file.

        Module settime.
        * settime.m4: New file.

        Module posixtm.
        * posixtm.m4: New file.

        Module gethostname.
        * gethostname.m4: New file.

        Module canon-host.
        * canon-host.m4: New file.

        Module gettext.
        * codeset.m4: New file, from gettext-0.11.5.
        * gettext.m4: New file, from gettext-0.11.5.
        * glibc21.m4: New file, from gettext-0.11.5.
        * iconv.m4: New file, from gettext-0.11.5.
        * intdiv0.m4: New file, from gettext-0.11.5.
        * inttypes-pri.m4: New file, from gettext-0.11.5.
        * inttypes.m4: New file, from gettext-0.11.5.
        * inttypes_h.m4: New file, from gettext-0.11.5 with modifications.
        * isc-posix.m4: New file, from gettext-0.11.5.
        * lcmessage.m4: New file, from gettext-0.11.5.
        * lib-ld.m4: New file, from gettext-0.11.5.
        * lib-link.m4: New file, from gettext-0.11.5.
        * lib-prefix.m4: New file, from gettext-0.11.5.
        * progtest.m4: New file, from gettext-0.11.5.
        * stdint_h.m4: New file, from gettext-0.11.5 with modifications.
        * uintmax_t.m4: New file, from gettext-0.11.5 with modifications.
        * ulonglong.m4: New file, from gettext-0.11.5 with modifications.

        Module localcharset.
        * localcharset.m4: New file.

        Module hard-locale.
        * hard-locale.m4: New file.

        Module mbswidth.
        * mbswidth.m4 (gl_MBSWIDTH): Renamed from jm_PREREQ_MBSWIDTH. Use
        onceonly macros.
        * mbrtowc.m4: Add comment.

        Module memcasecmp.
        * memcasecmp.m4: New file.

        Module memcoll.
        * memcoll.m4: New file.

        Module unicodeio.
        * unicodeio.m4: New file.

        Module rpmatch.
        * rpmatch.m4: New file.

        Module yesno.
        * yesno.m4: New file.

        Module exitfail.
        * exitfail.m4: New file.

        Module c-stack.
        * c-stack.m4 (gl_C_STACK): New macro.
        (jm_PREREQ_C_STACK): Check for <sys/time.h>. Use onceonly macros.

        Module error.
        * error.m4 (gl_ERROR): New macro.
        (jm_PREREQ_ERROR): Use onceonly macros.

        Module fatal.
        * fatal.m4: New file.

        Module getloadavg.
        * getloadavg.m4 (AC_FUNC_GETLOADAVG): Use onceonly macros.
        (gl_FUNC_GETLOADAVG, gl_PREREQ_GETLOADAVG): New macros.

        Module getpagesize.
        * getpagesize.m4: New file.

        Module getusershell.
        * getusershell.m4: New file.

        Module physmem.
        * physmem.m4: New file.

        Module posixver.
        * posixver.m4: New file.

        Module quotearg.
        * quotearg.m4: New file.

        Module quote.
        * quote.m4: New file.

        Module readutmp.
        * readutmp.m4: New file, based on jm_PREREQ_READUTMP from prereq.m4.

        Module sig2str.
        * sig2str.m4: New file.

        Other.
        * longlong.m4 (jm_AC_TYPE_UNSIGNED_LONG_LONG): Remove, moved to
        ulonglong.m4.
        * intmax_t.m4: New file.
        * d-type.m4: Indentation.
        * jm-macros.m4: Update.
        * prereq.m4 (jm_PREREQ): Update.
        (jm_PREREQ_ADDEXT): Remove, obsoleted by backupfile.m4.
        (jm_PREREQ_CANON_HOST): Remove, obsoleted by canon-host.m4.
        (jm_PREREQ_DIRNAME): Remove, obsoleted by dirname.m4.
        (jm_PREREQ_EXCLUDE): Remove, obsoleted by exclude.m4.
        (jm_PREREQ_GETPAGESIZE): Remove, obsoleted by getpagesize.m4.
        (jm_PREREQ_HARD_LOCALE): Remove, obsoleted by hard-locale.m4.
        (jm_PREREQ_HASH): Remove, obsoleted by hash.m4.
        (jm_PREREQ_HUMAN): Remove, obsoleted by human.m4.
        (jm_PREREQ_MEMCHR): Remove, obsoleted by memchr.m4.
        (jm_PREREQ_PHYSMEM): Remove, obsoleted by physmem.m4.
        (jm_PREREQ_POSIXVER): Remove, obsoleted by posixver.m4.
        (jm_PREREQ_QUOTEARG): Remove, obsoleted by quotearg.m4.
        (jm_PREREQ_READUTMP): Remove, obsoleted by readutmp.m4.
        (jm_PREREQ_REGEX): Remove, obsoleted by regex.m4.
        (jm_PREREQ_STRNLEN): Remove, obsoleted by strnlen.m4.
        (jm_PREREQ_TEMPNAME): Remove, obsoleted by mkstemp.m4.
        (jm_PREREQ_XGETCWD): Remove, obsoleted by xgetcwd.m4.
        (jm_PREREQ_XREADLINK): Remove, obsoleted by xreadlink.m4.
        * readdir.m4 (jm_FUNC_READDIR): Use onceonly macros.

diff -r -c3 gnulib-cvs/m4/README gnulib/m4/README
*** gnulib-cvs/m4/README        Sat Jul  6 09:38:46 2002
--- gnulib/m4/README    Sun Dec 22 23:47:44 2002
***************
*** 1,18 ****
! Many of the files in this directory are shared between the diffutils,
! fileutils, sh-utils, and textutils packages -- and others, so if you
  change them, try to ensure that you don't break those packages.
! Unfortunately, that's hard.
  
- One way to do that is to put the modified .m4 file in each of the packages,
- run `make dist' to create a .tar.gz file, then build that package on as
- many different types of systems as possible.  Then repeat, but using the
- original version of the .m4 file.  Run configure like this each time
- `./configure --cache=config.cache' and be sure to save the following files
- from each run: config.cache config.status config.out config.h*.
- Then compare the two versions of each of those files and be prepared to
- explain any differences.
- 
- These files are used by a program called aclocal (part of the GNU automake
- package).  aclocal uses these files to create aclocal.m4 which is in turn
- used by autoconf to create the configure script at the top level in
- this distribution.
--- 1,85 ----
! Many of the files in this directory are shared between the coreutils,
! diffutils, tar and gettext packages -- and others, so if you
  change them, try to ensure that you don't break those packages.
! That's hard without a systematic approach, but here is a set of conventions
! that makes it easy.
! 
! - The lib/ sources are split into modules.  Usually the module of a
!   lib/foo.h and lib/foo.c is called "foo" - not unexpected, hey! -, but
!   in more ambiguous cases you can look up the module a file belongs to
!   by doing "grep lib/foo.c modules/*".
! 
! - For every module there is an autoconf macro file, usually called
!   m4/foo.m4 according to the module name.  When you modify lib/foo.h or
!   lib/foo.c, remember to modify m4/foo.m4 as well!
!   What if you don't find m4/foo.m4? This probably means that the module
!   doesn't need autoconf support up to now (again, take a look in modules/*).
!   So you might need to create one.
! 
! - A module which defines a replacement function (i.e. a function which is
!   compiled only on systems which lack it or where it exists but doesn't
!   work satisfactorily) has a .m4 file with typically the following structure:
! 
!   AC_DEFUN([gl_FUNC_FOO],
!   [
!     AC_REPLACE_FUNCS(foo)
!     if test $ac_cv_func_foo = no; then
!       gl_PREREQ_FOO
!     fi
!   ])
! 
!   # Prerequisites of lib/foo.c.
!   AC_DEFUN([gl_PREREQ_FOO], [
!     dnl Many AC_CHECK_* invocations.
!   ])
! 
! - A module which is compiled on all platforms can define multiple functions
!   and be spread across multiple source files (although each time you do
!   this you should consider splitting the module, if the source files could
!   be independent). The .m4 file has typically the following structure:
! 
!   AC_DEFUN([gl_FOO],
!   [
!     dnl Prerequisites of lib/foo.c.
!     dnl Many AC_CHECK_* invocations.
! 
!     dnl Prerequisites of lib/foobar.c.
!     dnl Many AC_CHECK_* invocations.
!   ])
! 
! - When a module FOO depends on a module BAR, you do *not* generally need
!   to write
! 
!   AC_DEFUN([gl_FOO],
!   [
!     AC_REQUIRE([gl_BAR])
!     ...
!   ])
! 
!   because the maintainers might want to use locally modified / renamed copies
!   of the module BAR.
! 
! - If the autoconf tests for the modules FOO and BAR have some checks in
!   common, still list them separately. Autoconf has two mechanisms for
!   avoiding that a configure file runs the same test twice: AC_REQUIRE
!   and AC_CACHE_CHECK. Trying to omit the checks leads to maintenance
!   problems: If FOO depends on BAR, and you omit a check from FOO's .m4 file,
!   later on, when someone modifies bar.c and removes the check from bar.m4,
!   he will not remember that foo.c needs the check as well.
! 
! - Now, how can you find the prerequisites of lib/foo.c? Try this:
!     "grep '#.*if' lib/foo.c | grep -v endif"
!   and for each HAVE_* macro search in the autoconf documentation what could
!   be the autoconf macro that provides it. This is only an approximation; in
!   general you should look at all preprocessor directives in lib/foo.c.
! 
! - After ANY modifications of an m4 file, you should increment its serial
!   number (in the first line). Also, if this first line features a particular
!   release, _remove_ this release stamp. Example: Change
! 
!     # setenv.m4 serial 2 (gettext-0.11.1)
! 
!   into
! 
!     # setenv.m4 serial 3
  
diff -r -c3 gnulib-cvs/m4/memcmp.m4 gnulib/m4/memcmp.m4
*** gnulib-cvs/m4/memcmp.m4     Mon Sep 17 23:44:03 2001
--- gnulib/m4/memcmp.m4 Mon Dec 23 15:09:45 2002
***************
*** 1,9 ****
! #serial 7
  
  AC_DEFUN([jm_FUNC_MEMCMP],
! [AC_REQUIRE([AC_FUNC_MEMCMP])dnl
!  if test $ac_cv_func_memcmp_working = no; then
!    AC_DEFINE(memcmp, rpl_memcmp,
!      [Define to rpl_memcmp if the replacement function should be used.])
!  fi
  ])
--- 1,22 ----
! # memcmp.m4 serial 8
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
  
  AC_DEFUN([jm_FUNC_MEMCMP],
! [
!   AC_REQUIRE([AC_FUNC_MEMCMP])
!   if test $ac_cv_func_memcmp_working = no; then
!     AC_DEFINE(memcmp, rpl_memcmp,
!       [Define to rpl_memcmp if the replacement function should be used.])
!     gl_PREREQ_MEMCMP
!   fi
! ])
! 
! # Prerequisites of lib/memcmp.c.
! AC_DEFUN([gl_PREREQ_MEMCMP], [
!   AC_CHECK_HEADERS_ONCE(string.h)
  ])
diff -r -c3 gnulib-cvs/m4/malloc.m4 gnulib/m4/malloc.m4
*** gnulib-cvs/m4/malloc.m4     Tue Apr  9 19:55:23 2002
--- gnulib/m4/malloc.m4 Sat Dec 21 16:08:26 2002
***************
*** 1,35 ****
! #serial 6
  
  dnl From Jim Meyering.
  dnl Determine whether malloc accepts 0 as its argument.
  dnl If it doesn't, arrange to use the replacement function.
- dnl
  
  AC_DEFUN([jm_FUNC_MALLOC],
  [
!  dnl xmalloc.c requires that this symbol be defined so it doesn't
!  dnl mistakenly use a broken malloc -- as it might if this test were omitted.
!  AC_DEFINE(HAVE_DONE_WORKING_MALLOC_CHECK, 1,
!            [Define if the malloc check has been performed. ])
! 
!  AC_CACHE_CHECK([whether malloc(0) returns a non-NULL pointer],
!                 jm_cv_func_working_malloc,
!   [AC_TRY_RUN([
!     char *malloc ();
!     int
!     main ()
!     {
!       exit (malloc (0) ? 0 : 1);
!     }
!         ],
!        jm_cv_func_working_malloc=yes,
!        jm_cv_func_working_malloc=no,
!        dnl When crosscompiling, assume malloc(0) returns NULL.
!        jm_cv_func_working_malloc=no)
!   ])
!   if test $jm_cv_func_working_malloc = no; then
!     AC_LIBOBJ(malloc)
!     AC_DEFINE(malloc, rpl_malloc,
!       [Define to rpl_malloc if the replacement function should be used.])
    fi
  ])
--- 1,25 ----
! # malloc.m4 serial 7
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
  
  dnl From Jim Meyering.
  dnl Determine whether malloc accepts 0 as its argument.
  dnl If it doesn't, arrange to use the replacement function.
  
  AC_DEFUN([jm_FUNC_MALLOC],
  [
!   AC_REQUIRE([AC_FUNC_MALLOC])
!   dnl autoconf < 2.57 used the symbol ac_cv_func_malloc_works.
!   if test X"$ac_cv_func_malloc_0_nonnull" = Xno || test 
X"$ac_cv_func_malloc_works" = Xno; then
!     gl_PREREQ_MALLOC
    fi
  ])
+ 
+ # Prerequisites of lib/malloc.c.
+ AC_DEFUN([gl_PREREQ_MALLOC], [
+   :
+ ])
diff -r -c3 gnulib-cvs/m4/realloc.m4 gnulib/m4/realloc.m4
*** gnulib-cvs/m4/realloc.m4    Tue Apr  9 19:55:36 2002
--- gnulib/m4/realloc.m4        Mon Dec 23 21:35:13 2002
***************
*** 1,35 ****
! #serial 6
  
  dnl From Jim Meyering.
  dnl Determine whether realloc works when both arguments are 0.
  dnl If it doesn't, arrange to use the replacement function.
- dnl
  
  AC_DEFUN([jm_FUNC_REALLOC],
  [
!  dnl xmalloc.c requires that this symbol be defined so it doesn't
!  dnl mistakenly use a broken realloc -- as it might if this test were omitted.
!  AC_DEFINE(HAVE_DONE_WORKING_REALLOC_CHECK, 1,
!            [Define if the realloc check has been performed. ])
! 
!  AC_CACHE_CHECK([whether realloc(0,0) returns a non-NULL pointer],
!                 jm_cv_func_working_realloc,
!   [AC_TRY_RUN([
!     char *realloc ();
!     int
!     main ()
!     {
!       exit (realloc (0, 0) ? 0 : 1);
!     }
!         ],
!        jm_cv_func_working_realloc=yes,
!        jm_cv_func_working_realloc=no,
!        dnl When crosscompiling, assume realloc(0,0) returns NULL.
!        jm_cv_func_working_realloc=no)
!   ])
!   if test $jm_cv_func_working_realloc = no; then
!     AC_LIBOBJ(realloc)
!     AC_DEFINE(realloc, rpl_realloc,
!       [Define to rpl_realloc if the replacement function should be used.])
    fi
  ])
--- 1,25 ----
! # realloc.m4 serial 7
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
  
  dnl From Jim Meyering.
  dnl Determine whether realloc works when both arguments are 0.
  dnl If it doesn't, arrange to use the replacement function.
  
  AC_DEFUN([jm_FUNC_REALLOC],
  [
!   AC_REQUIRE([AC_FUNC_REALLOC])
!   dnl autoconf < 2.57 used the symbol ac_cv_func_realloc_works.
!   if test X"$ac_cv_func_realloc_0_nonnull" = Xno || test 
X"$ac_cv_func_realloc_works" = Xno; then
!     gl_PREREQ_REALLOC
    fi
  ])
+ 
+ # Prerequisites of lib/realloc.c.
+ AC_DEFUN([gl_PREREQ_REALLOC], [
+   :
+ ])
diff -r -c3 gnulib-cvs/m4/strftime.m4 gnulib/m4/strftime.m4
*** gnulib-cvs/m4/strftime.m4   Wed Dec 18 14:43:39 2002
--- gnulib/m4/strftime.m4       Mon Dec 23 15:11:32 2002
***************
*** 1,25 ****
! #serial 18
  
  dnl This macro is intended to be used solely in this file.
  dnl These are the prerequisite macros for GNU's strftime.c replacement.
  AC_DEFUN([_jm_STRFTIME_PREREQS],
  [
   dnl strftime.c uses the underyling system strftime if it exists.
!  AC_CHECK_FUNCS(strftime)
  
!  AC_CHECK_HEADERS(limits.h)
!  AC_CHECK_FUNCS(bcopy tzset mempcpy memcpy memset)
  
   # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
   AC_STRUCT_TIMEZONE
  
   AC_CHECK_FUNCS(mblen mbrlen)
  
!  AC_CHECK_MEMBER([struct tm.tm_gmtoff],
!                  [AC_DEFINE(HAVE_TM_GMTOFF, 1,
!                             [Define if struct tm has the tm_gmtoff member.])],
!                  ,
!                  [#include <time.h>])
  ])
  
  dnl From Jim Meyering.
--- 1,22 ----
! #serial 19
  
  dnl This macro is intended to be used solely in this file.
  dnl These are the prerequisite macros for GNU's strftime.c replacement.
  AC_DEFUN([_jm_STRFTIME_PREREQS],
  [
   dnl strftime.c uses the underyling system strftime if it exists.
!  AC_FUNC_STRFTIME
  
!  AC_CHECK_HEADERS_ONCE(limits.h)
!  AC_CHECK_FUNCS_ONCE(memcpy mempcpy)
!  AC_CHECK_FUNCS(tzset memset)
  
   # This defines (or not) HAVE_TZNAME and HAVE_TM_ZONE.
   AC_STRUCT_TIMEZONE
  
   AC_CHECK_FUNCS(mblen mbrlen)
  
!  AC_REQUIRE([gl_TM_GMTOFF])
  ])
  
  dnl From Jim Meyering.
***************
*** 31,37 ****
  
   AC_REQUIRE([AC_C_CONST])dnl
   AC_REQUIRE([AC_HEADER_STDC])dnl
!  AC_CHECK_HEADERS(sys/time.h)
   AC_DEFINE([my_strftime], [nstrftime],
     [Define to the name of the strftime replacement function.])
  ])
--- 28,34 ----
  
   AC_REQUIRE([AC_C_CONST])dnl
   AC_REQUIRE([AC_HEADER_STDC])dnl
!  AC_CHECK_HEADERS_ONCE(sys/time.h)
   AC_DEFINE([my_strftime], [nstrftime],
     [Define to the name of the strftime replacement function.])
  ])
diff -r -c3 gnulib-cvs/m4/putenv.m4 gnulib/m4/putenv.m4
*** gnulib-cvs/m4/putenv.m4     Mon Sep 17 23:44:03 2001
--- gnulib/m4/putenv.m4 Mon Dec 23 14:51:13 2002
***************
*** 1,10 ****
! #serial 5
  
  dnl From Jim Meyering.
  dnl
  dnl Check whether putenv ("FOO") removes FOO from the environment.
  dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
- dnl
  
  AC_DEFUN([jm_FUNC_PUTENV],
  [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
--- 1,15 ----
! # putenv.m4 serial 6
! dnl Copyright (C) 2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
  
  dnl From Jim Meyering.
  dnl
  dnl Check whether putenv ("FOO") removes FOO from the environment.
  dnl The putenv in libc on at least SunOS 4.1.4 does *not* do that.
  
  AC_DEFUN([jm_FUNC_PUTENV],
  [AC_CACHE_CHECK([for SVID conformant putenv], jm_cv_func_svid_putenv,
***************
*** 36,40 ****
--- 41,53 ----
      AC_LIBOBJ(putenv)
      AC_DEFINE(putenv, rpl_putenv,
        [Define to rpl_putenv if the replacement function should be used.])
+     gl_PREREQ_PUTENV
    fi
  ])
+ 
+ # Prerequisites of lib/putenv.c.
+ AC_DEFUN([gl_PREREQ_PUTENV], [
+   AC_CHECK_HEADERS_ONCE(string.h unistd.h)
+   AC_CHECK_FUNCS_ONCE(memcpy)
+   AC_CHECK_FUNCS(strchr)
+ ])
diff -r -c3 gnulib-cvs/m4/setenv.m4 gnulib/m4/setenv.m4
*** gnulib-cvs/m4/setenv.m4     Mon Mar  4 19:13:52 2002
--- gnulib/m4/setenv.m4 Mon Dec 23 21:27:12 2002
***************
*** 1,4 ****
! # setenv.m4 serial 2 (gettext-0.11.1)
  dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
--- 1,4 ----
! # setenv.m4 serial 3
  dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
***************
*** 6,16 ****
  dnl that contains a configuration script generated by Autoconf, under
  dnl the same distribution terms as the rest of that program.
  
  # Check if a variable is properly declared.
  # gt_CHECK_VAR_DECL(includes,variable)
  AC_DEFUN([gt_CHECK_VAR_DECL],
  [
!   define(gt_cv_var, [gt_cv_var_]$2[_declaration])
    AC_MSG_CHECKING([if $2 is properly declared])
    AC_CACHE_VAL(gt_cv_var, [
      AC_TRY_COMPILE([$1
--- 6,27 ----
  dnl that contains a configuration script generated by Autoconf, under
  dnl the same distribution terms as the rest of that program.
  
+ AC_DEFUN([gt_FUNC_SETENV],
+ [
+   AC_REPLACE_FUNCS(setenv unsetenv)
+   if test $ac_cv_func_setenv = no; then
+     gl_PREREQ_SETENV
+   fi
+   if test $ac_cv_func_unsetenv = no; then
+     gl_PREREQ_UNSETENV
+   fi
+ ])
+ 
  # Check if a variable is properly declared.
  # gt_CHECK_VAR_DECL(includes,variable)
  AC_DEFUN([gt_CHECK_VAR_DECL],
  [
!   define([gt_cv_var], [gt_cv_var_]$2[_declaration])
    AC_MSG_CHECKING([if $2 is properly declared])
    AC_CACHE_VAL(gt_cv_var, [
      AC_TRY_COMPILE([$1
***************
*** 25,37 ****
    fi
  ])
  
! # Prerequisites of lib/setenv.c
! 
! AC_DEFUN([gt_FUNC_SETENV],
  [
!   AC_REPLACE_FUNCS(setenv unsetenv)
!   AC_CHECK_HEADERS(search.h stdlib.h string.h unistd.h)
    AC_CHECK_FUNCS(tsearch)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
    gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
  ])
--- 36,56 ----
    fi
  ])
  
! # Prerequisites of lib/setenv.c.
! AC_DEFUN([gl_PREREQ_SETENV],
  [
!   AC_REQUIRE([AC_FUNC_ALLOCA])
!   AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
!   AC_CHECK_HEADERS(search.h)
    AC_CHECK_FUNCS(tsearch)
    gt_CHECK_VAR_DECL([#include <errno.h>], errno)
    gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
  ])
+ 
+ # Prerequisites of lib/unsetenv.c.
+ AC_DEFUN([gl_PREREQ_UNSETENV],
+ [
+   AC_CHECK_HEADERS_ONCE(stdlib.h string.h unistd.h)
+   gt_CHECK_VAR_DECL([#include <errno.h>], errno)
+   gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
+ ])
diff -r -c3 gnulib-cvs/m4/getline.m4 gnulib/m4/getline.m4
*** gnulib-cvs/m4/getline.m4    Sat Aug  4 18:56:32 2001
--- gnulib/m4/getline.m4        Sun Dec 22 15:31:00 2002
***************
*** 1,11 ****
! #serial 5
  
  dnl See if there's a working, system-supplied version of the getline function.
  dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
  dnl have a function by that name in -linet that doesn't have anything
  dnl to do with the function we need.
  AC_DEFUN([AM_FUNC_GETLINE],
! [dnl
    am_getline_needs_run_time_check=no
    AC_CHECK_FUNC(getline,
                dnl Found it in some library.  Verify that it works.
--- 1,22 ----
! # getline.m4 serial 7
! dnl Copyright (C) 1998-2002 Free Software Foundation, Inc.
! dnl This file is free software, distributed under the terms of the GNU
! dnl General Public License.  As a special exception to the GNU General
! dnl Public License, this file may be distributed as part of a program
! dnl that contains a configuration script generated by Autoconf, under
! dnl the same distribution terms as the rest of that program.
! 
! AC_PREREQ(2.52)
  
  dnl See if there's a working, system-supplied version of the getline function.
  dnl We can't just do AC_REPLACE_FUNCS(getline) because some systems
  dnl have a function by that name in -linet that doesn't have anything
  dnl to do with the function we need.
  AC_DEFUN([AM_FUNC_GETLINE],
! [
!   dnl Persuade glibc <stdio.h> to declare getline() and getdelim().
!   AC_REQUIRE([AC_GNU_SOURCE])
! 
    am_getline_needs_run_time_check=no
    AC_CHECK_FUNC(getline,
                dnl Found it in some library.  Verify that it works.
***************
*** 16,22 ****
      [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
      AC_TRY_RUN([
  #    include <stdio.h>
! #    include <sys/types.h>
  #    include <string.h>
      int main ()
      { /* Based on a test program from Karl Heuer.  */
--- 27,33 ----
      [echo fooN |tr -d '\012'|tr N '\012' > conftest.data
      AC_TRY_RUN([
  #    include <stdio.h>
! #    include <stdlib.h>
  #    include <string.h>
      int main ()
      { /* Based on a test program from Karl Heuer.  */
***************
*** 36,41 ****
--- 47,64 ----
    fi
  
    if test $am_cv_func_working_getline = no; then
+     dnl We must choose a different name for our function, since on ELF systems
+     dnl a broken getline() in libc.so would override our getline() in
+     dnl libgettextlib.so.
+     AC_DEFINE([getline], [gnu_getline],
+       [Define to a replacement function name for getline().])
      AC_LIBOBJ(getline)
+     gl_PREREQ_GETLINE
    fi
  ])
+ 
+ # Prerequisites of lib/getline.c.
+ AC_DEFUN([gl_PREREQ_GETLINE],
+ [
+   AC_CHECK_FUNCS(getdelim)
+ ])
diff -r -c3 gnulib-cvs/m4/stdbool.m4 gnulib/m4/stdbool.m4
*** gnulib-cvs/m4/stdbool.m4    Sat Jun 22 10:27:18 2002
--- gnulib/m4/stdbool.m4        Sun Dec 22 16:04:43 2002
***************
*** 17,22 ****
--- 17,25 ----
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  # 02111-1307, USA.
  
+ # This file is only needed in autoconf <= 2.54.  Newer versions of autoconf
+ # have this macro built-in.
+ 
  AC_DEFUN([AC_HEADER_STDBOOL],
    [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
       [ac_cv_header_stdbool_h],
***************
*** 57,62 ****
--- 60,66 ----
        [ return !a + !b + !c + !d + !e + !f + !g + !h + !i; ],
        [ac_cv_header_stdbool_h=yes],
        [ac_cv_header_stdbool_h=no])])
+    AC_CHECK_TYPES([_Bool])
     if test $ac_cv_header_stdbool_h = yes; then
       AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
     fi])
diff -r -c3 gnulib-cvs/m4/xstrtoimax.m4 gnulib/m4/xstrtoimax.m4
*** gnulib-cvs/m4/xstrtoimax.m4 Fri Sep 28 21:37:38 2001
--- gnulib/m4/xstrtoimax.m4     Mon Dec 23 15:12:12 2002
***************
*** 1,41 ****
! #serial 2
  dnl Cloned from xstrtoumax.m4.  Keep these files in sync.
  
! # autoconf tests required for use of xstrtoimax.c
! 
! AC_DEFUN([jm_AC_PREREQ_XSTRTOIMAX],
  [
    AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
!   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
!   AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
!   AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
!   AC_CHECK_DECLS([strtol, strtoul, strtoll, strtoimax, strtoumax])
!   AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
! 
!   AC_CACHE_CHECK([whether <inttypes.h> defines strtoimax as a macro],
!     jm_cv_func_strtoimax_macro,
!     AC_EGREP_CPP([inttypes_h_defines_strtoimax], [#include <inttypes.h>
! #ifdef strtoimax
!  inttypes_h_defines_strtoimax
! #endif],
!       jm_cv_func_strtoimax_macro=yes,
!       jm_cv_func_strtoimax_macro=no))
! 
!   if test "$jm_cv_func_strtoimax_macro" != yes; then
!     AC_REPLACE_FUNCS(strtoimax)
!   fi
! 
!   dnl Only the replacement strtoimax invokes strtol and strtoll,
!   dnl so we need the replacements only if strtoimax does not exist.
!   case "$jm_cv_func_strtoimax_macro,$ac_cv_func_strtoimax" in
!     no,no)
!       AC_REPLACE_FUNCS(strtol)
! 
!       dnl We don't need (and can't compile) the replacement strtoll
!       dnl unless the type `long long' exists.
!       if test "$ac_cv_type_long_long" = yes; then
!       AC_REPLACE_FUNCS(strtoll)
!       fi
!       ;;
!   esac
  ])
--- 1,9 ----
! #serial 3
  dnl Cloned from xstrtoumax.m4.  Keep these files in sync.
  
! AC_DEFUN([jm_XSTRTOIMAX],
  [
+   dnl Prerequisites of lib/xstrtoimax.c.
    AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
!   AC_REQUIRE([gl_PREREQ_XSTRTOL])
  ])
diff -r -c3 gnulib-cvs/m4/xstrtoumax.m4 gnulib/m4/xstrtoumax.m4
*** gnulib-cvs/m4/xstrtoumax.m4 Fri Sep 28 21:37:47 2001
--- gnulib/m4/xstrtoumax.m4     Mon Dec 23 15:12:18 2002
***************
*** 1,40 ****
! #serial 4
  
! # autoconf tests required for use of xstrtoumax.c
! 
! AC_DEFUN([jm_AC_PREREQ_XSTRTOUMAX],
  [
!   AC_REQUIRE([jm_AC_TYPE_INTMAX_T])
    AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
!   AC_REQUIRE([jm_AC_TYPE_LONG_LONG])
!   AC_REQUIRE([jm_AC_TYPE_UNSIGNED_LONG_LONG])
!   AC_CHECK_DECLS([strtol, strtoul, strtoull, strtoimax, strtoumax])
!   AC_CHECK_HEADERS(limits.h stdlib.h inttypes.h)
! 
!   AC_CACHE_CHECK([whether <inttypes.h> defines strtoumax as a macro],
!     jm_cv_func_strtoumax_macro,
!     AC_EGREP_CPP([inttypes_h_defines_strtoumax], [#include <inttypes.h>
! #ifdef strtoumax
!  inttypes_h_defines_strtoumax
! #endif],
!       jm_cv_func_strtoumax_macro=yes,
!       jm_cv_func_strtoumax_macro=no))
! 
!   if test "$jm_cv_func_strtoumax_macro" != yes; then
!     AC_REPLACE_FUNCS(strtoumax)
!   fi
! 
!   dnl Only the replacement strtoumax invokes strtoul and strtoull,
!   dnl so we need the replacements only if strtoumax does not exist.
!   case "$jm_cv_func_strtoumax_macro,$ac_cv_func_strtoumax" in
!     no,no)
!       AC_REPLACE_FUNCS(strtoul)
! 
!       dnl We don't need (and can't compile) the replacement strtoull
!       dnl unless the type `unsigned long long' exists.
!       if test "$ac_cv_type_unsigned_long_long" = yes; then
!       AC_REPLACE_FUNCS(strtoull)
!       fi
!       ;;
!   esac
  ])
--- 1,9 ----
! #serial 5
! dnl Cloned from xstrtoimax.m4.  Keep these files in sync.
  
! AC_DEFUN([jm_XSTRTOUMAX],
  [
!   dnl Prerequisites of lib/xstrtoumax.c.
    AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
!   AC_REQUIRE([gl_PREREQ_XSTRTOL])
  ])
diff -r -c3 gnulib-cvs/m4/chown.m4 gnulib/m4/chown.m4
*** gnulib-cvs/m4/chown.m4      Mon Sep 17 23:44:03 2001
--- gnulib/m4/chown.m4  Mon Dec 23 15:06:27 2002
***************
*** 1,4 ****
! #serial 7
  
  dnl From Jim Meyering.
  dnl Determine whether chown accepts arguments of -1 for uid and gid.
--- 1,4 ----
! #serial 8
  
  dnl From Jim Meyering.
  dnl Determine whether chown accepts arguments of -1 for uid and gid.
***************
*** 6,49 ****
  dnl
  
  AC_DEFUN([jm_FUNC_CHOWN],
! [AC_REQUIRE([AC_TYPE_UID_T])dnl
!  test -z "$ac_cv_header_unistd_h" \
!    && AC_CHECK_HEADERS(unistd.h)
!  AC_CACHE_CHECK([for working chown], jm_cv_func_working_chown,
!   [AC_TRY_RUN([
! #   include <sys/types.h>
! #   include <sys/stat.h>
! #   include <fcntl.h>
! #   ifdef HAVE_UNISTD_H
! #    include <unistd.h>
! #   endif
! 
!     int
!     main ()
!     {
!       char *f = "conftest.chown";
!       struct stat before, after;
! 
!       if (creat (f, 0600) < 0)
!         exit (1);
!       if (stat (f, &before) < 0)
!         exit (1);
!       if (chown (f, (uid_t) -1, (gid_t) -1) == -1)
!         exit (1);
!       if (stat (f, &after) < 0)
!         exit (1);
!       exit ((before.st_uid == after.st_uid
!            && before.st_gid == after.st_gid) ? 0 : 1);
!     }
!             ],
!            jm_cv_func_working_chown=yes,
!            jm_cv_func_working_chown=no,
!            dnl When crosscompiling, assume chown is broken.
!            jm_cv_func_working_chown=no)
!   ])
!   if test $jm_cv_func_working_chown = no; then
      AC_LIBOBJ(chown)
      AC_DEFINE(chown, rpl_chown,
        [Define to rpl_chown if the replacement function should be used.])
    fi
  ])
--- 6,24 ----
  dnl
  
  AC_DEFUN([jm_FUNC_CHOWN],
! [
!   AC_REQUIRE([AC_TYPE_UID_T])dnl
!   AC_REQUIRE([AC_FUNC_CHOWN])
!   if test $ac_cv_func_chown_works = no; then
      AC_LIBOBJ(chown)
      AC_DEFINE(chown, rpl_chown,
        [Define to rpl_chown if the replacement function should be used.])
+     gl_PREREQ_CHOWN
    fi
  ])
+ 
+ # Prerequisites of lib/chown.c.
+ AC_DEFUN([gl_PREREQ_CHOWN],
+ [
+   AC_CHECK_HEADERS_ONCE(unistd.h)
+ ])
diff -r -c3 gnulib-cvs/m4/ftruncate.m4 gnulib/m4/ftruncate.m4
*** gnulib-cvs/m4/ftruncate.m4  Sun Aug 12 15:26:00 2001
--- gnulib/m4/ftruncate.m4      Mon Dec 23 15:07:10 2002
***************
*** 1,14 ****
! #serial 4
  
  # See if we need to emulate a missing ftruncate function using fcntl or 
chsize.
  
  AC_DEFUN([jm_FUNC_FTRUNCATE],
  [
!   AC_CHECK_FUNCS(ftruncate, , [ftruncate_missing=yes])
! 
!   if test "$ftruncate_missing" = yes; then
!     AC_CHECK_HEADERS([unistd.h])
!     AC_CHECK_FUNCS([chsize])
!     AC_LIBOBJ(ftruncate)
    fi
  ])
--- 1,18 ----
! #serial 5
  
  # See if we need to emulate a missing ftruncate function using fcntl or 
chsize.
  
  AC_DEFUN([jm_FUNC_FTRUNCATE],
  [
!   AC_REPLACE_FUNCS(ftruncate)
!   if test $ac_cv_func_ftruncate = no; then
!     gl_PREREQ_FTRUNCATE
    fi
  ])
+ 
+ # Prerequisites of lib/ftruncate.c.
+ AC_DEFUN([gl_PREREQ_FTRUNCATE],
+ [
+   AC_CHECK_HEADERS_ONCE(unistd.h)
+   AC_CHECK_FUNCS(chsize)
+ ])
diff -r -c3 gnulib-cvs/m4/getgroups.m4 gnulib/m4/getgroups.m4
*** gnulib-cvs/m4/getgroups.m4  Mon Sep 17 23:44:03 2001
--- gnulib/m4/getgroups.m4      Mon Dec 23 15:07:22 2002
***************
*** 1,4 ****
! #serial 5
  
  dnl From Jim Meyering.
  dnl
--- 1,4 ----
! #serial 6
  
  dnl From Jim Meyering.
  dnl
***************
*** 8,46 ****
  dnl
  
  AC_DEFUN([jm_FUNC_GETGROUPS],
! [AC_REQUIRE([AC_TYPE_GETGROUPS])dnl
!  AC_REQUIRE([AC_TYPE_SIZE_T])dnl
!  AC_CHECK_FUNCS(getgroups)
! 
!  # If we don't yet have getgroups, see if it's in -lbsd.
!  # This is reported to be necessary on an ITOS 3000WS running SEIUX 3.1.
!  if test $ac_cv_func_getgroups = no; then
!    jm_cv_sys_getgroups_saved_lib="$LIBS"
!    AC_CHECK_LIB(bsd, getgroups, [GETGROUPS_LIB=-lbsd])
!    LIBS="$jm_cv_sys_getgroups_saved_lib"
!  fi
! 
!  # Run the program to test the functionality of the system-supplied
!  # getgroups function only if there is such a function.
!  if test $ac_cv_func_getgroups = yes; then
!    AC_CACHE_CHECK([for working getgroups], jm_cv_func_working_getgroups,
!     [AC_TRY_RUN([
!       int
!       main ()
!       {
!       /* On Ultrix 4.3, getgroups (0, 0) always fails.  */
!       exit (getgroups (0, 0) == -1 ? 1 : 0);
!       }
!               ],
!              jm_cv_func_working_getgroups=yes,
!              jm_cv_func_working_getgroups=no,
!              dnl When crosscompiling, assume getgroups is broken.
!              jm_cv_func_working_getgroups=no)
!     ])
!     if test $jm_cv_func_working_getgroups = no; then
!       AC_LIBOBJ(getgroups)
!       AC_DEFINE(getgroups, rpl_getgroups,
!       [Define as rpl_getgroups if getgroups doesn't work right.])
!     fi
    fi
  ])
--- 8,26 ----
  dnl
  
  AC_DEFUN([jm_FUNC_GETGROUPS],
! [
!   AC_REQUIRE([AC_FUNC_GETGROUPS])
!   AC_SUBST([GETGROUPS_LIB])
!   if test $ac_cv_func_getgroups_works = no; then
!     AC_LIBOBJ(getgroups)
!     AC_DEFINE(getgroups, rpl_getgroups,
!       [Define as rpl_getgroups if getgroups doesn't work right.])
!     gl_PREREQ_GETGROUPS
    fi
  ])
+ 
+ # Prerequisites of lib/getgroups.c.
+ AC_DEFUN([gl_PREREQ_GETGROUPS],
+ [
+   AC_REQUIRE([AC_TYPE_GETGROUPS])
+ ])
diff -r -c3 gnulib-cvs/m4/gettimeofday.m4 gnulib/m4/gettimeofday.m4
*** gnulib-cvs/m4/gettimeofday.m4       Mon May 27 18:44:07 2002
--- gnulib/m4/gettimeofday.m4   Mon Dec 23 15:08:11 2002
***************
*** 1,4 ****
! #serial 2
  
  dnl From Jim Meyering.
  dnl
--- 1,4 ----
! #serial 3
  
  dnl From Jim Meyering.
  dnl
***************
*** 12,18 ****
  AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
  [
   AC_REQUIRE([AC_HEADER_TIME])
!  AC_CHECK_HEADERS(string.h stdlib.h)
   AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
    jm_cv_func_gettimeofday_clobber,
    [AC_TRY_RUN([
--- 12,18 ----
  AC_DEFUN([AC_FUNC_GETTIMEOFDAY_CLOBBER],
  [
   AC_REQUIRE([AC_HEADER_TIME])
!  AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
   AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
    jm_cv_func_gettimeofday_clobber,
    [AC_TRY_RUN([
***************
*** 65,69 ****
--- 65,75 ----
        [Define to rpl_gettimeofday if the replacement function should be 
used.])
      AC_DEFINE(GETTIMEOFDAY_CLOBBERS_LOCALTIME_BUFFER, 1,
        [Define if gettimeofday clobbers localtime's static buffer.])
+     gl_PREREQ_GETTIMEOFDAY
    fi
  ])
+ 
+ # Prerequisites of lib/gettimeofday.c.
+ AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
+   AC_REQUIRE([AC_HEADER_TIME])
+ ])
diff -r -c3 gnulib-cvs/m4/mkdir-slash.m4 gnulib/m4/mkdir-slash.m4
*** gnulib-cvs/m4/mkdir-slash.m4        Mon Sep 17 23:44:03 2001
--- gnulib/m4/mkdir-slash.m4    Mon Dec 23 15:09:56 2002
***************
*** 1,4 ****
! #serial 1
  
  # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
  # On such systems, arrange to use a wrapper function that removes any
--- 1,4 ----
! #serial 2
  
  # On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
  # On such systems, arrange to use a wrapper function that removes any
***************
*** 31,35 ****
--- 31,43 ----
      AC_LIBOBJ(mkdir)
      AC_DEFINE(mkdir, rpl_mkdir,
        [Define to rpl_mkdir if the replacement function should be used.])
+     gl_PREREQ_MKDIR
    fi
  ])
+ 
+ # Prerequisites of lib/mkdir.c.
+ AC_DEFUN([gl_PREREQ_MKDIR],
+ [
+   AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
+   AC_CHECK_DECLS_ONCE(free)
+ ])
diff -r -c3 gnulib-cvs/m4/mkstemp.m4 gnulib/m4/mkstemp.m4
*** gnulib-cvs/m4/mkstemp.m4    Tue Nov 20 11:37:24 2001
--- gnulib/m4/mkstemp.m4        Mon Dec 23 15:10:07 2002
***************
*** 1,4 ****
! #serial 1
  
  # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has 
the
  # silly limit that it can create no more than 26 files from a given template.
--- 1,4 ----
! #serial 2
  
  # On some systems (e.g., HPUX-10.20, SunOS4.1.4, solaris2.5.1), mkstemp has 
the
  # silly limit that it can create no more than 26 files from a given template.
***************
*** 42,46 ****
--- 42,65 ----
      AC_LIBOBJ(tempname)
      AC_DEFINE(mkstemp, rpl_mkstemp,
        [Define to rpl_mkstemp if the replacement function should be used.])
+     gl_PREREQ_MKSTEMP
+     jm_PREREQ_TEMPNAME
    fi
  ])
+ 
+ # Prerequisites of lib/mkstemp.c.
+ AC_DEFUN([gl_PREREQ_MKSTEMP],
+ [
+ ])
+ 
+ # Prerequisites of lib/tempname.c.
+ AC_DEFUN([jm_PREREQ_TEMPNAME],
+ [
+   AC_REQUIRE([AC_HEADER_STDC])
+   AC_REQUIRE([AC_HEADER_STAT])
+   AC_CHECK_HEADERS_ONCE(fcntl.h sys/time.h unistd.h)
+   AC_CHECK_HEADERS(stdint.h)
+   AC_CHECK_FUNCS(__secure_getenv gettimeofday)
+   AC_CHECK_DECLS_ONCE(getenv)
+   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
+ ])
diff -r -c3 gnulib-cvs/m4/stat.m4 gnulib/m4/stat.m4
*** gnulib-cvs/m4/stat.m4       Mon Sep 17 23:44:03 2001
--- gnulib/m4/stat.m4   Mon Dec 23 15:11:23 2002
***************
*** 1,4 ****
! #serial 7
  
  dnl From Jim Meyering.
  dnl Determine whether stat has the bug that it succeeds when given the
--- 1,4 ----
! #serial 8
  
  dnl From Jim Meyering.
  dnl Determine whether stat has the bug that it succeeds when given the
***************
*** 11,40 ****
  
  AC_DEFUN([jm_FUNC_STAT],
  [
!  AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
!  AC_CACHE_CHECK([whether stat accepts an empty string],
!   jm_cv_func_stat_empty_string_bug,
!   [AC_TRY_RUN([
! #   include <sys/types.h>
! #   include <sys/stat.h>
! 
!     int
!     main ()
!     {
!       struct stat sbuf;
!       exit (stat ("", &sbuf) ? 1 : 0);
!     }
!         ],
!        jm_cv_func_stat_empty_string_bug=yes,
!        jm_cv_func_stat_empty_string_bug=no,
!        dnl When crosscompiling, assume stat is broken.
!        jm_cv_func_stat_empty_string_bug=yes)
!   ])
!   if test $jm_cv_func_stat_empty_string_bug = yes; then
!     AC_LIBOBJ(stat)
!     AC_DEFINE(HAVE_STAT_EMPTY_STRING_BUG, 1,
! [Define if stat has the bug that it succeeds when given the zero-length
!    file name argument.  The stat from SunOS4.1.4 and the Hurd as of 
1998-11-01)
!    do this. ])
    fi
  ])
--- 11,25 ----
  
  AC_DEFUN([jm_FUNC_STAT],
  [
!   AC_FUNC_STAT
!   dnl Note: AC_FUNC_STAT does AC_LIBOBJ(stat).
!   if test $ac_cv_func_stat_empty_string_bug = yes; then
!     gl_PREREQ_STAT
    fi
  ])
+ 
+ # Prerequisites of lib/stat.c.
+ AC_DEFUN([gl_PREREQ_STAT],
+ [
+   :
+ ])
diff -r -c3 gnulib-cvs/m4/lstat.m4 gnulib/m4/lstat.m4
*** gnulib-cvs/m4/lstat.m4      Mon Sep 17 23:44:03 2001
--- gnulib/m4/lstat.m4  Mon Dec 23 15:09:01 2002
***************
*** 1,4 ****
! #serial 7
  
  dnl From Jim Meyering.
  dnl Determine whether lstat has the bug that it succeeds when given the
--- 1,4 ----
! #serial 8
  
  dnl From Jim Meyering.
  dnl Determine whether lstat has the bug that it succeeds when given the
***************
*** 11,40 ****
  
  AC_DEFUN([jm_FUNC_LSTAT],
  [
!  AC_REQUIRE([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
!  AC_CACHE_CHECK([whether lstat accepts an empty string],
!   jm_cv_func_lstat_empty_string_bug,
!   [AC_TRY_RUN([
! #   include <sys/types.h>
! #   include <sys/stat.h>
! 
!     int
!     main ()
!     {
!       struct stat sbuf;
!       exit (lstat ("", &sbuf) ? 1 : 0);
!     }
!         ],
!        jm_cv_func_lstat_empty_string_bug=yes,
!        jm_cv_func_lstat_empty_string_bug=no,
!        dnl When crosscompiling, assume lstat is broken.
!        jm_cv_func_lstat_empty_string_bug=yes)
!   ])
!   if test $jm_cv_func_lstat_empty_string_bug = yes; then
!     AC_LIBOBJ(lstat)
!     AC_DEFINE(HAVE_LSTAT_EMPTY_STRING_BUG, 1,
! [Define if lstat has the bug that it succeeds when given the zero-length
!    file name argument.  The lstat from SunOS4.1.4 and the Hurd as of 
1998-11-01)
!    do this. ])
    fi
  ])
--- 11,27 ----
  
  AC_DEFUN([jm_FUNC_LSTAT],
  [
!   AC_FUNC_LSTAT
!   dnl Note: AC_FUNC_LSTAT does AC_LIBOBJ(lstat).
!   if test $ac_cv_func_lstat_empty_string_bug = yes; then
!     gl_PREREQ_LSTAT
    fi
  ])
+ 
+ # Prerequisites of lib/lstat.c.
+ AC_DEFUN([gl_PREREQ_LSTAT],
+ [
+   AC_REQUIRE([AC_HEADER_STAT])
+   AC_CHECK_HEADERS_ONCE(stdlib.h)
+   AC_CHECK_DECLS_ONCE(free)
+ ])
diff -r -c3 gnulib-cvs/m4/timespec.m4 gnulib/m4/timespec.m4
*** gnulib-cvs/m4/timespec.m4   Mon Sep 17 23:44:03 2001
--- gnulib/m4/timespec.m4       Tue Dec 24 00:45:45 2002
***************
*** 1,13 ****
! #serial 5
  
  dnl From Jim Meyering
  
  dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
  dnl in time.h or sys/time.h.
  
  AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
  [
    AC_REQUIRE([AC_HEADER_TIME])
    AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
      [AC_TRY_COMPILE(
        [
--- 1,28 ----
! #serial 6
  
  dnl From Jim Meyering
  
+ AC_DEFUN([gl_TIMESPEC],
+ [
+   dnl Prerequisites of lib/timespec.h.
+   AC_REQUIRE([AC_HEADER_TIME])
+   AC_CHECK_HEADERS_ONCE(sys/time.h)
+   jm_CHECK_TYPE_STRUCT_TIMESPEC
+   AC_STRUCT_ST_MTIM_NSEC
+ 
+   dnl Persuade glibc <time.h> to declare nanosleep().
+   AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_CHECK_DECLS(nanosleep, , , [#include <time.h>])
+ ])
+ 
  dnl Define HAVE_STRUCT_TIMESPEC if `struct timespec' is declared
  dnl in time.h or sys/time.h.
  
  AC_DEFUN([jm_CHECK_TYPE_STRUCT_TIMESPEC],
  [
    AC_REQUIRE([AC_HEADER_TIME])
+   AC_CHECK_HEADERS_ONCE(sys/time.h)
    AC_CACHE_CHECK([for struct timespec], fu_cv_sys_struct_timespec,
      [AC_TRY_COMPILE(
        [
diff -r -c3 gnulib-cvs/m4/nanosleep.m4 gnulib/m4/nanosleep.m4
*** gnulib-cvs/m4/nanosleep.m4  Mon Sep 17 23:44:03 2001
--- gnulib/m4/nanosleep.m4      Mon Dec 23 15:10:15 2002
***************
*** 1,4 ****
! #serial 8
  
  dnl From Jim Meyering.
  dnl Check for the nanosleep function.
--- 1,4 ----
! #serial 9
  
  dnl From Jim Meyering.
  dnl Check for the nanosleep function.
***************
*** 18,23 ****
--- 18,24 ----
    jm_cv_func_nanosleep_works,
    [
     AC_REQUIRE([AC_HEADER_TIME])
+    AC_CHECK_HEADERS_ONCE(sys/time.h)
     AC_TRY_RUN([
  #   if TIME_WITH_SYS_TIME
  #    include <sys/time.h>
***************
*** 48,54 ****
--- 49,62 ----
      AC_LIBOBJ(nanosleep)
      AC_DEFINE(nanosleep, rpl_nanosleep,
        [Define to rpl_nanosleep if the replacement function should be used.])
+     gl_PREREQ_NANOSLEEP
    fi
  
   LIBS=$nanosleep_save_libs
  ])
+ 
+ # Prerequisites of lib/nanosleep.c.
+ AC_DEFUN([gl_PREREQ_NANOSLEEP],
+ [
+   AC_CHECK_HEADERS_ONCE(unistd.h)
+ ])
diff -r -c3 gnulib-cvs/m4/regex.m4 gnulib/m4/regex.m4
*** gnulib-cvs/m4/regex.m4      Sun Aug 12 15:26:00 2001
--- gnulib/m4/regex.m4  Mon Dec 23 15:10:52 2002
***************
*** 1,8 ****
! #serial 12
  
  dnl Initially derived from code in GNU grep.
  dnl Mostly written by Jim Meyering.
  
  dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
  dnl
  AC_DEFUN([jm_INCLUDED_REGEX],
--- 1,13 ----
! #serial 13
  
  dnl Initially derived from code in GNU grep.
  dnl Mostly written by Jim Meyering.
  
+ AC_DEFUN([gl_REGEX],
+ [
+   jm_INCLUDED_REGEX([lib/regex.c])
+ ])
+ 
  dnl Usage: jm_INCLUDED_REGEX([lib/regex.c])
  dnl
  AC_DEFUN([jm_INCLUDED_REGEX],
***************
*** 74,81 ****
--- 79,104 ----
                    jm_with_regex=$ac_use_included_regex)
        if test "$jm_with_regex" = yes; then
          AC_LIBOBJ(regex)
+         jm_PREREQ_REGEX
        fi
        ],
      )
    ]
  )
+ 
+ # Prerequisites of lib/regex.c.
+ AC_DEFUN([jm_PREREQ_REGEX],
+ [
+   dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks 
it.
+   dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
+   dnl to get them.
+ 
+   dnl Persuade glibc <string.h> to declare mempcpy().
+   AC_REQUIRE([AC_GNU_SOURCE])
+ 
+   AC_REQUIRE([AC_FUNC_ALLOCA])
+   AC_REQUIRE([AC_HEADER_STDC])
+   AC_CHECK_HEADERS_ONCE(limits.h string.h wchar.h wctype.h)
+   AC_CHECK_FUNCS_ONCE(isascii mempcpy)
+   AC_CHECK_FUNCS(btowc)
+ ])
diff -r -c3 gnulib-cvs/m4/rename.m4 gnulib/m4/rename.m4
*** gnulib-cvs/m4/rename.m4     Mon Sep 17 23:44:03 2001
--- gnulib/m4/rename.m4 Mon Dec 23 15:11:02 2002
***************
*** 1,4 ****
! #serial 3
  
  dnl From Volker Borchert.
  dnl Determine whether rename works for source paths with a trailing slash.
--- 1,4 ----
! #serial 4
  
  dnl From Volker Borchert.
  dnl Determine whether rename works for source paths with a trailing slash.
***************
*** 34,40 ****
    if test $vb_cv_func_rename_trailing_slash_bug = yes; then
      AC_LIBOBJ(rename)
      AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
! [Define if rename does not work for source paths with a trailing slash,
!    like the one from SunOS 4.1.1_U1.])
    fi
  ])
--- 34,48 ----
    if test $vb_cv_func_rename_trailing_slash_bug = yes; then
      AC_LIBOBJ(rename)
      AC_DEFINE(RENAME_TRAILING_SLASH_BUG, 1,
!       [Define if rename does not work for source paths with a trailing slash,
!        like the one from SunOS 4.1.1_U1.])
!     gl_PREREQ_RENAME
    fi
  ])
+ 
+ # Prerequisites of lib/rename.c.
+ AC_DEFUN([gl_PREREQ_RENAME],
+ [
+   AC_CHECK_HEADERS_ONCE(stdlib.h string.h)
+   AC_CHECK_DECLS_ONCE(free)
+ ])
diff -r -c3 gnulib-cvs/m4/utimbuf.m4 gnulib/m4/utimbuf.m4
*** gnulib-cvs/m4/utimbuf.m4    Mon Sep 17 23:44:03 2001
--- gnulib/m4/utimbuf.m4        Mon Dec 23 15:11:50 2002
***************
*** 1,4 ****
! #serial 4
  
  dnl From Jim Meyering
  
--- 1,4 ----
! #serial 5
  
  dnl From Jim Meyering
  
***************
*** 8,14 ****
  
  AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
  [
!   AC_CHECK_HEADERS(utime.h)
    AC_REQUIRE([AC_HEADER_TIME])
    AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
      [AC_TRY_COMPILE(
--- 8,14 ----
  
  AC_DEFUN([jm_CHECK_TYPE_STRUCT_UTIMBUF],
  [
!   AC_CHECK_HEADERS_ONCE(sys/time.h utime.h)
    AC_REQUIRE([AC_HEADER_TIME])
    AC_CACHE_CHECK([for struct utimbuf], fu_cv_sys_struct_utimbuf,
      [AC_TRY_COMPILE(
***************
*** 34,40 ****
  
    if test $fu_cv_sys_struct_utimbuf = yes; then
      AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
! [Define if struct utimbuf is declared -- usually in <utime.h>.
!    Some systems have utime.h but don't declare the struct anywhere. ])
    fi
  ])
--- 34,40 ----
  
    if test $fu_cv_sys_struct_utimbuf = yes; then
      AC_DEFINE(HAVE_STRUCT_UTIMBUF, 1,
!       [Define if struct utimbuf is declared -- usually in <utime.h>.
!        Some systems have utime.h but don't declare the struct anywhere. ])
    fi
  ])
diff -r -c3 gnulib-cvs/m4/utime.m4 gnulib/m4/utime.m4
*** gnulib-cvs/m4/utime.m4      Sun Aug 12 15:26:01 2001
--- gnulib/m4/utime.m4  Mon Dec 23 15:12:04 2002
***************
*** 1,4 ****
! #serial 3
  
  dnl From Jim Meyering
  dnl Replace the utime function on systems that need it.
--- 1,4 ----
! #serial 4
  
  dnl From Jim Meyering
  dnl Replace the utime function on systems that need it.
***************
*** 7,18 ****
  
  AC_DEFUN([jm_FUNC_UTIME],
  [
-   AC_CHECK_HEADERS(utime.h)
-   AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
    AC_REQUIRE([AC_FUNC_UTIME_NULL])
- 
    if test $ac_cv_func_utime_null = no; then
!     jm_FUNC_UTIMES_NULL
!     AC_REPLACE_FUNCS(utime)
    fi
  ])
--- 7,23 ----
  
  AC_DEFUN([jm_FUNC_UTIME],
  [
    AC_REQUIRE([AC_FUNC_UTIME_NULL])
    if test $ac_cv_func_utime_null = no; then
!     AC_LIBOBJ(utime)
!     gl_PREREQ_UTIME
    fi
  ])
+ 
+ # Prerequisites of lib/utime.c.
+ AC_DEFUN([gl_PREREQ_UTIME],
+ [
+   AC_CHECK_HEADERS_ONCE(utime.h)
+   AC_REQUIRE([jm_CHECK_TYPE_STRUCT_UTIMBUF])
+   jm_FUNC_UTIMES_NULL
+ ])
diff -r -c3 gnulib-cvs/m4/fnmatch.m4 gnulib/m4/fnmatch.m4
*** gnulib-cvs/m4/fnmatch.m4    Wed Jun 26 08:16:05 2002
--- gnulib/m4/fnmatch.m4        Mon Dec 23 14:19:11 2002
***************
*** 1,7 ****
  # Check for fnmatch.
  
  # This is a modified version of autoconf's AC_FUNC_FNMATCH.
! # This file should be removed after Autoconf 2.54 is required.
  
  # Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
  
--- 1,7 ----
  # Check for fnmatch.
  
  # This is a modified version of autoconf's AC_FUNC_FNMATCH.
! # This file should be simplified after Autoconf 2.57 is required.
  
  # Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
  
***************
*** 34,40 ****
     # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
     AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
!        [#include <fnmatch.h>
  #        define y(a, b, c) (fnmatch (a, b, c) == 0)
  #        define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
           ],
--- 34,42 ----
     # Thanks to John Oleynick, Franc,ois Pinard, and Paul Eggert for this test.
     AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
!        [
! #        include <stdlib.h>
! #        include <fnmatch.h>
  #        define y(a, b, c) (fnmatch (a, b, c) == 0)
  #        define n(a, b, c) (fnmatch (a, b, c) == FNM_NOMATCH)
           ],
***************
*** 77,87 ****
  ])# _AC_LIBOBJ_FNMATCH
  
  
! # AC_FUNC_FNMATCH_GNU
! # -------------------
! AC_DEFUN([AC_FUNC_FNMATCH_GNU],
! [AC_REQUIRE([AC_GNU_SOURCE])
! _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
!                     [rm -f lib/fnmatch.h],
!                     [_AC_LIBOBJ_FNMATCH])
! ])# AC_FUNC_FNMATCH_GNU
--- 79,122 ----
  ])# _AC_LIBOBJ_FNMATCH
  
  
! # Additional prerequisites of lib/fnmatch.c, not part of _AC_LIBOBJ_FNMATCH.
! AC_DEFUN([gl_PREREQ_FNMATCH_EXTRA],
! [
!   AC_REQUIRE([AC_HEADER_STDC])
!   AC_CHECK_HEADERS_ONCE(string.h strings.h)
! ])
! 
! 
! AC_DEFUN([gl_FUNC_FNMATCH_POSIX],
! [
!   _AC_FUNC_FNMATCH_IF([POSIX], [ac_cv_func_fnmatch_posix],
!                       [rm -f lib/fnmatch.h],
!                       [_AC_LIBOBJ_FNMATCH])
!   if test $ac_cv_func_fnmatch_posix != yes; then
!     gl_PREREQ_FNMATCH_EXTRA
!     dnl We must choose a different name for our function, since on ELF systems
!     dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
!     dnl compiled into a shared library.
!     AC_DEFINE([fnmatch], [posix_fnmatch],
!       [Define to a replacement function name for fnmatch().])
!   fi
! ])
! 
! 
! AC_DEFUN([gl_FUNC_FNMATCH_GNU],
! [
!   dnl Persuade glibc <fnmatch.h> to declare FNM_CASEFOLD etc.
!   AC_REQUIRE([AC_GNU_SOURCE])
! 
!   _AC_FUNC_FNMATCH_IF([GNU], [ac_cv_func_fnmatch_gnu],
!                       [rm -f lib/fnmatch.h],
!                       [_AC_LIBOBJ_FNMATCH])
!   if test $ac_cv_func_fnmatch_gnu != yes; then
!     gl_PREREQ_FNMATCH_EXTRA
!     dnl We must choose a different name for our function, since on ELF systems
!     dnl a broken fnmatch() in libc.so would override our fnmatch() if it is
!     dnl compiled into a shared library.
!     AC_DEFINE([fnmatch], [gnu_fnmatch],
!       [Define to a replacement function name for fnmatch().])
!   fi
! ])
diff -r -c3 gnulib-cvs/m4/acl.m4 gnulib/m4/acl.m4
*** gnulib-cvs/m4/acl.m4        Tue Feb 26 16:21:39 2002
--- gnulib/m4/acl.m4    Sun Dec 22 21:19:30 2002
***************
*** 19,23 ****
  # Written by Paul Eggert.
  
  AC_DEFUN([AC_FUNC_ACL],
!   [AC_CHECK_HEADERS(sys/acl.h)
!    AC_CHECK_FUNCS(acl)])
--- 19,26 ----
  # Written by Paul Eggert.
  
  AC_DEFUN([AC_FUNC_ACL],
! [
!   dnl Prerequisites of lib/acl.c.
!   AC_CHECK_HEADERS(sys/acl.h)
!   AC_CHECK_FUNCS(acl)
! ])
diff -r -c3 gnulib-cvs/m4/d-ino.m4 gnulib/m4/d-ino.m4
*** gnulib-cvs/m4/d-ino.m4      Sun Aug 12 15:26:00 2001
--- gnulib/m4/d-ino.m4  Mon Dec 23 15:06:35 2002
***************
*** 1,4 ****
! #serial 4
  
  dnl From Jim Meyering.
  dnl
--- 1,4 ----
! #serial 5
  
  dnl From Jim Meyering.
  dnl
***************
*** 35,42 ****
     )
     if test $jm_cv_struct_dirent_d_ino = yes; then
       AC_DEFINE(D_INO_IN_DIRENT, 1,
!   [Define if there is a member named d_ino in the struct describing
!    directory headers.])
     fi
    ]
  )
--- 35,42 ----
     )
     if test $jm_cv_struct_dirent_d_ino = yes; then
       AC_DEFINE(D_INO_IN_DIRENT, 1,
!        [Define if there is a member named d_ino in the struct describing
!         directory headers.])
     fi
    ]
  )
diff -r -c3 gnulib-cvs/m4/fsusage.m4 gnulib/m4/fsusage.m4
*** gnulib-cvs/m4/fsusage.m4    Sun Aug 12 15:26:00 2001
--- gnulib/m4/fsusage.m4        Mon Dec 23 15:07:03 2002
***************
*** 1,7 ****
! #serial 8
  
  # From fileutils/configure.in
  
  # Try to determine how a program can obtain filesystem usage information.
  # If successful, define the appropriate symbol (see fsusage.c) and
  # execute ACTION-IF-FOUND.  Otherwise, execute ACTION-IF-NOT-FOUND.
--- 1,18 ----
! #serial 9
  
  # From fileutils/configure.in
  
+ AC_DEFUN([gl_FSUSAGE],
+ [
+   AC_CHECK_HEADERS_ONCE(sys/param.h)
+   AC_CHECK_HEADERS(sys/mount.h sys/vfs.h sys/fs_types.h)
+   jm_FILE_SYSTEM_USAGE([gl_cv_fs_space=yes], [gl_cv_fs_space=no])
+   if test $gl_cv_fs_space = yes; then
+     AC_LIBOBJ(fsusage)
+     gl_PREREQ_FSUSAGE_EXTRA
+   fi
+ ])
+ 
  # Try to determine how a program can obtain filesystem usage information.
  # If successful, define the appropriate symbol (see fsusage.c) and
  # execute ACTION-IF-FOUND.  Otherwise, execute ACTION-IF-NOT-FOUND.
***************
*** 191,193 ****
--- 202,241 ----
  AS_IF([test $ac_fsusage_space = yes], [$1], [$2])
  
  ])
+ 
+ 
+ # Check for SunOS statfs brokenness wrt partitions 2GB and larger.
+ # If <sys/vfs.h> exists and struct statfs has a member named f_spare,
+ # enable the work-around code in fsusage.c.
+ AC_DEFUN([jm_STATFS_TRUNCATES],
+ [
+   AC_MSG_CHECKING([for statfs that truncates block counts])
+   AC_CACHE_VAL(fu_cv_sys_truncating_statfs,
+   [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #if !defined(sun) && !defined(__sun)
+ choke -- this is a workaround for a Sun-specific problem
+ #endif
+ #include <sys/types.h>
+ #include <sys/vfs.h>]],
+     [[struct statfs t; long c = *(t.f_spare);]])],
+     [fu_cv_sys_truncating_statfs=yes],
+     [fu_cv_sys_truncating_statfs=no])])
+   if test $fu_cv_sys_truncating_statfs = yes; then
+     AC_DEFINE(STATFS_TRUNCATES_BLOCK_COUNTS, 1,
+       [Define if the block counts reported by statfs may be truncated to 2GB
+        and the correct values may be stored in the f_spare array.
+        (SunOS 4.1.2, 4.1.3, and 4.1.3_U1 are reported to have this problem.
+        SunOS 4.1.1 seems not to be affected.)])
+   fi
+   AC_MSG_RESULT($fu_cv_sys_truncating_statfs)
+ ])
+ 
+ 
+ # Prerequisites of lib/fsusage.c not done by jm_FILE_SYSTEM_USAGE.
+ AC_DEFUN([gl_PREREQ_FSUSAGE_EXTRA],
+ [
+   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
+   AC_CHECK_HEADERS_ONCE(fcntl.h limits.h)
+   AC_CHECK_HEADERS(dustat.h sys/fs/s5param.h sys/filsys.h sys/statfs.h 
sys/statvfs.h)
+   jm_STATFS_TRUNCATES
+ ])
diff -r -c3 gnulib-cvs/m4/dirfd.m4 gnulib/m4/dirfd.m4
*** gnulib-cvs/m4/dirfd.m4      Fri Apr 12 22:48:29 2002
--- gnulib/m4/dirfd.m4  Mon Dec 23 23:05:53 2002
***************
*** 1,10 ****
! #serial 2
  
  dnl Find out how to get the file descriptor associated with an open DIR*.
  dnl From Jim Meyering
  
  AC_DEFUN([UTILS_FUNC_DIRFD],
  [
    AC_HEADER_DIRENT
    dirfd_headers='
  #if HAVE_DIRENT_H
--- 1,14 ----
! #serial 3
  
  dnl Find out how to get the file descriptor associated with an open DIR*.
  dnl From Jim Meyering
  
  AC_DEFUN([UTILS_FUNC_DIRFD],
  [
+   dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+   AC_REQUIRE([AC_PROG_CPP])
+   AC_REQUIRE([AC_PROG_EGREP])
+ 
    AC_HEADER_DIRENT
    dirfd_headers='
  #if HAVE_DIRENT_H
diff -r -c3 gnulib-cvs/m4/lchown.m4 gnulib/m4/lchown.m4
*** gnulib-cvs/m4/lchown.m4     Sun Aug 12 15:26:00 2001
--- gnulib/m4/lchown.m4 Mon Dec 23 22:53:53 2002
***************
*** 1,4 ****
! #serial 2
  
  dnl From Jim Meyering.
  dnl Provide lchown on systems that lack it.
--- 1,4 ----
! #serial 3
  
  dnl From Jim Meyering.
  dnl Provide lchown on systems that lack it.
***************
*** 7,10 ****
--- 7,20 ----
  [
    AC_REQUIRE([AC_TYPE_UID_T])
    AC_REPLACE_FUNCS(lchown)
+   if test $ac_cv_func_lchown = no; then
+     gl_PREREQ_LCHOWN
+   fi
+ ])
+ 
+ # Prerequisites of lib/lchown.c.
+ AC_DEFUN([gl_PREREQ_LCHOWN],
+ [
+   AC_REQUIRE([AC_HEADER_STAT])
+   :
  ])
diff -r -c3 gnulib-cvs/m4/ls-mntd-fs.m4 gnulib/m4/ls-mntd-fs.m4
*** gnulib-cvs/m4/ls-mntd-fs.m4 Fri Apr 12 22:50:53 2002
--- gnulib/m4/ls-mntd-fs.m4     Mon Dec 23 15:08:52 2002
***************
*** 1,4 ****
! #serial 11
  
  dnl From Jim Meyering.
  dnl
--- 1,4 ----
! #serial 12
  
  dnl From Jim Meyering.
  dnl
***************
*** 10,16 ****
  AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
    [
  AC_CHECK_FUNCS(listmntent getmntinfo)
! AC_CHECK_HEADERS(mntent.h sys/param.h sys/ucred.h sys/mount.h sys/fs_types.h)
      getfsstat_includes="\
  $ac_includes_default
  #if HAVE_SYS_PARAM_H
--- 10,17 ----
  AC_DEFUN([jm_LIST_MOUNTED_FILESYSTEMS],
    [
  AC_CHECK_FUNCS(listmntent getmntinfo)
! AC_CHECK_HEADERS_ONCE(sys/param.h)
! AC_CHECK_HEADERS(mntent.h sys/ucred.h sys/mount.h sys/fs_types.h)
      getfsstat_includes="\
  $ac_includes_default
  #if HAVE_SYS_PARAM_H
***************
*** 63,69 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_LISTMNTENT, 1,
        [Define if there is a function named listmntent that can be used to
!    list all mounted filesystems. (UNICOS)])
    fi
  fi
  
--- 64,70 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_LISTMNTENT, 1,
        [Define if there is a function named listmntent that can be used to
!        list all mounted filesystems. (UNICOS)])
    fi
  fi
  
***************
*** 100,108 ****
      if test $fu_cv_sys_mounted_getmntent1 = yes; then
        ac_list_mounted_fs=found
        AC_DEFINE(MOUNTED_GETMNTENT1, 1,
!   [Define if there is a function named getmntent for reading the list
!    of mounted filesystems, and that function takes a single argument.
!    (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
      fi
    fi
  
--- 101,109 ----
      if test $fu_cv_sys_mounted_getmntent1 = yes; then
        ac_list_mounted_fs=found
        AC_DEFINE(MOUNTED_GETMNTENT1, 1,
!         [Define if there is a function named getmntent for reading the list
!          of mounted filesystems, and that function takes a single argument.
!          (4.3BSD, SunOS, HP-UX, Dynix, Irix)])
      fi
    fi
  
***************
*** 117,124 ****
      if test $fu_cv_sys_mounted_getmntent2 = yes; then
        ac_list_mounted_fs=found
        AC_DEFINE(MOUNTED_GETMNTENT2, 1,
!   [Define if there is a function named getmntent for reading the list of
!    mounted filesystems, and that function takes two arguments.  (SVR4)])
      fi
    fi
  
--- 118,125 ----
      if test $fu_cv_sys_mounted_getmntent2 = yes; then
        ac_list_mounted_fs=found
        AC_DEFINE(MOUNTED_GETMNTENT2, 1,
!         [Define if there is a function named getmntent for reading the list of
!          mounted filesystems, and that function takes two arguments.  (SVR4)])
      fi
    fi
  
***************
*** 149,155 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETFSSTAT, 1,
              [Define if there is a function named getfsstat for reading the
!    list of mounted filesystems.  (DEC Alpha running OSF/1)])
    fi
  fi
  
--- 150,156 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETFSSTAT, 1,
              [Define if there is a function named getfsstat for reading the
!                list of mounted filesystems.  (DEC Alpha running OSF/1)])
    fi
  fi
  
***************
*** 165,172 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_VMOUNT, 1,
        [Define if there is a function named mntctl that can be used to read
!    the list of mounted filesystems, and there is a system header file
!    that declares `struct vmount.'  (AIX)])
    fi
  fi
  
--- 166,173 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_VMOUNT, 1,
        [Define if there is a function named mntctl that can be used to read
!          the list of mounted filesystems, and there is a system header file
!          that declares `struct vmount.'  (AIX)])
    fi
  fi
  
***************
*** 184,192 ****
    if test $fu_cv_sys_mounted_fread_fstyp = yes; then
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
! [Define if (like SVR2) there is no specific function for reading the
!    list of mounted filesystems, and your system has these header files:
!    <sys/fstyp.h> and <sys/statfs.h>.  (SVR3)])
    fi
  fi
  
--- 185,193 ----
    if test $fu_cv_sys_mounted_fread_fstyp = yes; then
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FREAD_FSTYP, 1,
!       [Define if (like SVR2) there is no specific function for reading the
!        list of mounted filesystems, and your system has these header files:
!        <sys/fstyp.h> and <sys/statfs.h>.  (SVR3)])
    fi
  fi
  
***************
*** 204,210 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETMNTINFO, 1,
              [Define if there is a function named getmntinfo for reading the
!    list of mounted filesystems.  (4.4BSD, Darwin)])
    fi
  fi
  
--- 205,211 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETMNTINFO, 1,
              [Define if there is a function named getmntinfo for reading the
!                list of mounted filesystems.  (4.4BSD, Darwin)])
    fi
  fi
  
***************
*** 222,228 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETMNT, 1,
        [Define if there is a function named getmnt for reading the list of
!    mounted filesystems.  (Ultrix)])
    fi
  fi
  
--- 223,229 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_GETMNT, 1,
        [Define if there is a function named getmnt for reading the list of
!        mounted filesystems.  (Ultrix)])
    fi
  fi
  
***************
*** 243,249 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
        [Define if there are functions named next_dev and fs_stat_dev for
!    reading the list of mounted filesystems.  (BeOS)])
    fi
  fi
  
--- 244,250 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FS_STAT_DEV, 1,
        [Define if there are functions named next_dev and fs_stat_dev for
!        reading the list of mounted filesystems.  (BeOS)])
    fi
  fi
  
***************
*** 259,265 ****
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FREAD, 1,
              [Define if there is no specific function for reading the list of
!    mounted filesystems.  fread will be used to read /etc/mnttab.  (SVR2) ])
    fi
  fi
  
--- 260,267 ----
      ac_list_mounted_fs=found
      AC_DEFINE(MOUNTED_FREAD, 1,
              [Define if there is no specific function for reading the list of
!                mounted filesystems.  fread will be used to read /etc/mnttab.
!                (SVR2) ])
    fi
  fi
  
diff -r -c3 gnulib-cvs/m4/getcwd.m4 gnulib/m4/getcwd.m4
*** gnulib-cvs/m4/getcwd.m4     Mon Sep  3 09:44:18 2001
--- gnulib/m4/getcwd.m4 Mon Dec 23 14:32:36 2002
***************
*** 19,25 ****
  # Written by Paul Eggert.
  
  AC_DEFUN([AC_FUNC_GETCWD_NULL],
!   [AC_CHECK_HEADERS(stdlib.h unistd.h)
     AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
       [ac_cv_func_getcwd_null],
       [AC_TRY_RUN(
--- 19,26 ----
  # Written by Paul Eggert.
  
  AC_DEFUN([AC_FUNC_GETCWD_NULL],
!   [
!    AC_CHECK_HEADERS_ONCE(stdlib.h unistd.h)
     AC_CACHE_CHECK([whether getcwd (NULL, 0) allocates memory for result],
       [ac_cv_func_getcwd_null],
       [AC_TRY_RUN(
diff -r -c3 gnulib-cvs/m4/group-member.m4 gnulib/m4/group-member.m4
*** gnulib-cvs/m4/group-member.m4       Sun Aug 12 15:26:00 2001
--- gnulib/m4/group-member.m4   Mon Dec 23 15:08:18 2002
***************
*** 1,11 ****
! #serial 3
  
  dnl Written by Jim Meyering
  
  AC_DEFUN([jm_FUNC_GROUP_MEMBER],
!   [
!     dnl Do this replacement check manually because I want the hyphen
!     dnl (not the underscore) in the filename.
!     AC_CHECK_FUNC(group_member, , [AC_LIBOBJ(group-member)])
!   ]
! )
--- 1,24 ----
! #serial 4
  
  dnl Written by Jim Meyering
  
  AC_DEFUN([jm_FUNC_GROUP_MEMBER],
! [
!   dnl Persuade glibc <unistd.h> to declare group_member().
!   AC_REQUIRE([AC_GNU_SOURCE])
! 
!   dnl Do this replacement check manually because I want the hyphen
!   dnl (not the underscore) in the filename.
!   AC_CHECK_FUNC(group_member, , [
!     AC_LIBOBJ(group-member)
!     gl_PREREQ_GROUP_MEMBER
!   ])
! ])
! 
! # Prerequisites of lib/group-member.c.
! AC_DEFUN([gl_PREREQ_GROUP_MEMBER],
! [
!   AC_REQUIRE([AC_HEADER_STDC])
!   AC_CHECK_HEADERS_ONCE(unistd.h)
!   AC_REQUIRE([AC_FUNC_GETGROUPS])
! ])
diff -r -c3 gnulib-cvs/m4/mbrtowc.m4 gnulib/m4/mbrtowc.m4
*** gnulib-cvs/m4/mbrtowc.m4    Fri Jun 21 17:39:12 2002
--- gnulib/m4/mbrtowc.m4        Mon Dec 23 15:09:23 2002
***************
*** 1,4 ****
! # mbrtowc.m4 serial 4 (fileutils-4.1.3)
  dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
--- 1,4 ----
! # mbrtowc.m4 serial 5
  dnl Copyright (C) 2001-2002 Free Software Foundation, Inc.
  dnl This file is free software, distributed under the terms of the GNU
  dnl General Public License.  As a special exception to the GNU General
***************
*** 8,13 ****
--- 8,16 ----
  
  dnl From Paul Eggert
  
+ dnl This file can be removed, and jm_FUNC_MBRTOWC replaced with
+ dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
+ 
  AC_DEFUN([jm_FUNC_MBRTOWC],
  [
    AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
diff -r -c3 gnulib-cvs/m4/mbswidth.m4 gnulib/m4/mbswidth.m4
*** gnulib-cvs/m4/mbswidth.m4   Wed Dec 18 14:43:35 2002
--- gnulib/m4/mbswidth.m4       Mon Dec 23 15:09:32 2002
***************
*** 1,12 ****
! #serial 8
  
  dnl autoconf tests required for use of mbswidth.c
  dnl From Bruno Haible.
  
! AC_DEFUN([jm_PREREQ_MBSWIDTH],
  [
!   AC_CHECK_HEADERS(wchar.h wctype.h)
!   AC_CHECK_FUNCS(isascii iswcntrl iswprint mbsinit wcwidth)
    jm_FUNC_MBRTOWC
  
    AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
--- 1,13 ----
! #serial 9
  
  dnl autoconf tests required for use of mbswidth.c
  dnl From Bruno Haible.
  
! AC_DEFUN([gl_MBSWIDTH],
  [
!   AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
!   AC_CHECK_FUNCS_ONCE(isascii iswprint mbsinit)
!   AC_CHECK_FUNCS(iswcntrl wcwidth)
    jm_FUNC_MBRTOWC
  
    AC_CACHE_CHECK([whether wcwidth is declared], ac_cv_have_decl_wcwidth,
diff -r -c3 gnulib-cvs/m4/c-stack.m4 gnulib/m4/c-stack.m4
*** gnulib-cvs/m4/c-stack.m4    Sat Jun 22 11:01:22 2002
--- gnulib/m4/c-stack.m4        Mon Dec 23 14:31:35 2002
***************
*** 131,136 ****
     AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
     AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
  
!    AC_CHECK_HEADERS(sys/resource.h ucontext.h unistd.h)
  
     AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
--- 131,143 ----
     AC_CHECK_DECLS([getcontext], , , [#include <ucontext.h>])
     AC_CHECK_DECLS([sigaltstack], , , [#include <signal.h>])
  
!    AC_CHECK_HEADERS_ONCE(sys/time.h unistd.h)
!    AC_CHECK_HEADERS(sys/resource.h ucontext.h)
  
     AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])])
+ 
+ AC_DEFUN([gl_C_STACK],
+ [
+   dnl Prerequisites of lib/c-stack.c.
+   jm_PREREQ_C_STACK
+ ])
diff -r -c3 gnulib-cvs/m4/error.m4 gnulib/m4/error.m4
*** gnulib-cvs/m4/error.m4      Sun Oct 21 09:49:27 2001
--- gnulib/m4/error.m4  Mon Dec 23 15:06:48 2002
***************
*** 1,13 ****
! #serial 4
  
! dnl FIXME: put these prerequisite-only *.m4 files in a separate
! dnl directory -- otherwise, they'll conflict with existing files.
  
! dnl These are the prerequisite macros for GNU's error.c file.
  AC_DEFUN([jm_PREREQ_ERROR],
  [
!   AC_CHECK_FUNCS(strerror vprintf doprnt)
    AC_CHECK_DECLS([strerror])
    AC_FUNC_STRERROR_R
-   AC_HEADER_STDC
  ])
--- 1,20 ----
! #serial 5
  
! AC_DEFUN([gl_ERROR],
! [
!   AC_FUNC_ERROR_AT_LINE
!   dnl Note: AC_FUNC_ERROR_AT_LINE does AC_LIBSOURCES([error.h, error.c]).
!   if test $ac_cv_lib_error_at_line = no; then
!     jm_PREREQ_ERROR
!   fi
! ])
  
! # Prerequisites of lib/error.c.
  AC_DEFUN([jm_PREREQ_ERROR],
  [
!   AC_REQUIRE([AC_HEADER_STDC])
!   AC_CHECK_FUNCS_ONCE(doprnt vprintf)
!   AC_CHECK_FUNCS(strerror)
    AC_CHECK_DECLS([strerror])
    AC_FUNC_STRERROR_R
  ])
diff -r -c3 gnulib-cvs/m4/getloadavg.m4 gnulib/m4/getloadavg.m4
*** gnulib-cvs/m4/getloadavg.m4 Wed Apr 24 09:49:39 2002
--- gnulib/m4/getloadavg.m4     Mon Dec 23 15:08:05 2002
***************
*** 1,4 ****
! #serial 9
  
  # A replacement for autoconf's macro by the same name.  This version
  # accepts an optional argument specifying the name of the $srcdir-relative
--- 1,4 ----
! #serial 10
  
  # A replacement for autoconf's macro by the same name.  This version
  # accepts an optional argument specifying the name of the $srcdir-relative
***************
*** 12,18 ****
  AC_DEFUN([AC_FUNC_GETLOADAVG],
  [ac_have_func=no # yes means we've found a way to get the load average.
  
! AC_CHECK_HEADERS(locale.h unistd.h mach/mach.h fcntl.h)
  AC_CHECK_FUNCS(setlocale)
  
  # By default, expect to find getloadavg.c in $srcdir/.
--- 12,19 ----
  AC_DEFUN([AC_FUNC_GETLOADAVG],
  [ac_have_func=no # yes means we've found a way to get the load average.
  
! AC_CHECK_HEADERS_ONCE(fcntl.h locale.h unistd.h)
! AC_CHECK_HEADERS(mach/mach.h)
  AC_CHECK_FUNCS(setlocale)
  
  # By default, expect to find getloadavg.c in $srcdir/.
***************
*** 106,108 ****
--- 107,125 ----
  
  AC_SUBST(GETLOADAVG_LIBS)dnl
  ])# AC_FUNC_GETLOADAVG
+ 
+ 
+ AC_DEFUN([gl_FUNC_GETLOADAVG],
+ [
+   AC_FUNC_GETLOADAVG([lib])
+   dnl Note AC_FUNC_GETLOADAVG does AC_LIBOBJ(getloadavg).
+   if test $ac_cv_func_getloadavg = no; then
+     gl_PREREQ_GETLOADAVG
+   fi
+ ])
+ 
+ # Prerequisites of lib/getloadavg.c not done by autoconf's AC_FUNC_GETLOADAVG.
+ AC_DEFUN([gl_PREREQ_GETLOADAVG],
+ [
+   AC_CHECK_HEADERS_ONCE(fcntl.h unistd.h)
+ ])
diff -r -c3 gnulib-cvs/m4/d-type.m4 gnulib/m4/d-type.m4
*** gnulib-cvs/m4/d-type.m4     Sat Jun  1 11:37:53 2002
--- gnulib/m4/d-type.m4 Mon Dec 23 15:06:42 2002
***************
*** 1,4 ****
! #serial 5
  
  dnl From Jim Meyering.
  dnl
--- 1,4 ----
! #serial 6
  
  dnl From Jim Meyering.
  dnl
***************
*** 35,42 ****
     )
     if test $jm_cv_struct_dirent_d_type = yes; then
       AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
!   [Define if there is a member named d_type in the struct describing
!    directory headers.])
     fi
    ]
  )
--- 35,42 ----
     )
     if test $jm_cv_struct_dirent_d_type = yes; then
       AC_DEFINE(HAVE_STRUCT_DIRENT_D_TYPE, 1,
!        [Define if there is a member named d_type in the struct describing
!         directory headers.])
     fi
    ]
  )
diff -r -c3 gnulib-cvs/m4/longlong.m4 gnulib/m4/longlong.m4
*** gnulib-cvs/m4/longlong.m4   Sat Aug 18 17:55:38 2001
--- gnulib/m4/longlong.m4       Mon Dec 23 15:08:41 2002
***************
*** 1,4 ****
! #serial 2
  
  dnl From Paul Eggert.
  
--- 1,4 ----
! #serial 3
  
  dnl From Paul Eggert.
  
***************
*** 17,35 ****
        [Define if you have the long long type.])
    fi
  ])
- 
- # Define HAVE_UNSIGNED_LONG_LONG if 'unsigned long long' works.
- 
- AC_DEFUN([jm_AC_TYPE_UNSIGNED_LONG_LONG],
- [
-   AC_CACHE_CHECK([for unsigned long long], ac_cv_type_unsigned_long_long,
-   [AC_TRY_LINK([unsigned long long ull = 1; int i = 63;],
-     [unsigned long long ullmax = (unsigned long long) -1;
-      return ull << i | ull >> i | ullmax / ull | ullmax % ull;],
-     ac_cv_type_unsigned_long_long=yes,
-     ac_cv_type_unsigned_long_long=no)])
-   if test $ac_cv_type_unsigned_long_long = yes; then
-     AC_DEFINE(HAVE_UNSIGNED_LONG_LONG, 1,
-       [Define if you have the unsigned long long type.])
-   fi
- ])
--- 17,19 ----
diff -r -c3 gnulib-cvs/m4/prereq.m4 gnulib/m4/prereq.m4
*** gnulib-cvs/m4/prereq.m4     Sat Jun 22 11:01:10 2002
--- gnulib/m4/prereq.m4 Mon Dec 23 15:10:21 2002
***************
*** 1,169 ****
! #serial 26
  
  dnl These are the prerequisite macros for files in the lib/
  dnl directories of the fileutils, sh-utils, and textutils packages.
  
  AC_DEFUN([jm_PREREQ],
  [
!   jm_PREREQ_ADDEXT
    jm_PREREQ_C_STACK
!   jm_PREREQ_CANON_HOST
!   jm_PREREQ_DIRNAME
    jm_PREREQ_ERROR
!   jm_PREREQ_EXCLUDE
!   jm_PREREQ_GETPAGESIZE
!   jm_PREREQ_HARD_LOCALE
!   jm_PREREQ_HASH
!   jm_PREREQ_HUMAN
!   jm_PREREQ_MBSWIDTH
!   jm_PREREQ_MEMCHR
!   jm_PREREQ_PHYSMEM
!   jm_PREREQ_POSIXVER
!   jm_PREREQ_QUOTEARG
!   jm_PREREQ_READUTMP
!   jm_PREREQ_REGEX
    jm_PREREQ_STAT
!   jm_PREREQ_STRNLEN
!   jm_PREREQ_TEMPNAME # called by mkstemp
!   jm_PREREQ_XGETCWD
!   jm_PREREQ_XREADLINK
! ])
! 
! AC_DEFUN([jm_PREREQ_ADDEXT],
! [
!   dnl For addext.c.
!   AC_SYS_LONG_FILE_NAMES
!   AC_CHECK_FUNCS(pathconf)
!   AC_CHECK_HEADERS(limits.h string.h unistd.h)
! ])
! 
! AC_DEFUN([jm_PREREQ_CANON_HOST],
! [
!   dnl Add any libraries as early as possible.
!   dnl In particular, inet_ntoa needs -lnsl at least on Solaris5.5.1,
!   dnl so we have to add -lnsl to LIBS before checking for that function.
!   AC_SEARCH_LIBS(gethostbyname, [inet nsl])
! 
!   dnl These come from -lnsl on Solaris5.5.1.
!   AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
! 
!   AC_CHECK_FUNCS(gethostbyname gethostbyaddr inet_ntoa)
!   AC_CHECK_HEADERS(unistd.h string.h netdb.h sys/socket.h \
!                    netinet/in.h arpa/inet.h)
! ])
! 
! AC_DEFUN([jm_PREREQ_DIRNAME],
! [
!   AC_HEADER_STDC
!   AC_CHECK_HEADERS(string.h)
! ])
! 
! AC_DEFUN([jm_PREREQ_EXCLUDE],
! [
!   AC_FUNC_FNMATCH_GNU
!   AC_HEADER_STDBOOL
! ])
! 
! AC_DEFUN([jm_PREREQ_GETPAGESIZE],
! [
!   AC_CHECK_FUNCS(getpagesize)
!   AC_CHECK_HEADERS(OS.h unistd.h)
! ])
! 
! AC_DEFUN([jm_PREREQ_HARD_LOCALE],
! [
!   AC_CHECK_HEADERS(locale.h stdlib.h string.h)
!   AC_CHECK_FUNCS(setlocale)
!   AM_C_PROTOTYPES
! ])
! 
! AC_DEFUN([jm_PREREQ_HASH],
! [
!   AC_CHECK_HEADERS(stdlib.h)
!   AC_HEADER_STDBOOL
!   AC_REQUIRE([jm_CHECK_DECLS])
! ])
! 
! # If you use human.c, you need the following files:
! # inttypes.m4 ulonglong.m4
! AC_DEFUN([jm_PREREQ_HUMAN],
! [
!   AC_CHECK_HEADERS(limits.h stdlib.h string.h)
!   AC_CHECK_DECLS([getenv])
!   AC_REQUIRE([jm_AC_TYPE_UINTMAX_T])
! ])
! 
! AC_DEFUN([jm_PREREQ_MEMCHR],
! [
!   AC_CHECK_HEADERS(limits.h stdlib.h bp-sym.h)
! ])
! 
! AC_DEFUN([jm_PREREQ_PHYSMEM],
! [
!   AC_CHECK_HEADERS(sys/pstat.h unistd.h)
!   AC_CHECK_FUNCS(pstat_getstatic pstat_getdynamic)
! ])
! 
! AC_DEFUN([jm_PREREQ_POSIXVER],
! [
!   AC_CHECK_HEADERS(unistd.h)
!   AC_CHECK_DECLS([getenv])
! ])
! 
! AC_DEFUN([jm_PREREQ_QUOTEARG],
! [
!   AC_CHECK_FUNCS(isascii iswprint)
!   jm_FUNC_MBRTOWC
!   AC_CHECK_HEADERS(limits.h stddef.h stdlib.h string.h wchar.h wctype.h)
!   AC_HEADER_STDC
!   AC_C_BACKSLASH_A
!   AC_TYPE_MBSTATE_T
!   AM_C_PROTOTYPES
! ])
! 
! AC_DEFUN([jm_PREREQ_READUTMP],
! [
!   AC_HEADER_STDC
!   AC_CHECK_HEADERS(string.h utmp.h utmpx.h sys/param.h)
!   AC_CHECK_FUNCS(utmpname)
!   AC_CHECK_FUNCS(utmpxname)
!   AM_C_PROTOTYPES
! 
!   if test $ac_cv_header_utmp_h = yes || test $ac_cv_header_utmpx_h = yes; then
!     utmp_includes="\
! $ac_includes_default
! #ifdef HAVE_UTMPX_H
! # include <utmpx.h>
! #endif
! #ifdef HAVE_UTMP_H
! # include <utmp.h>
! #endif
! "
!     AC_CHECK_MEMBERS([struct utmpx.ut_user],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_user],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmpx.ut_name],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_name],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmpx.ut_type],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_type],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmpx.ut_pid],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_pid],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmpx.ut_id],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_id],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmpx.ut_exit],,,[$utmp_includes])
!     AC_CHECK_MEMBERS([struct utmp.ut_exit],,,[$utmp_includes])
!     AC_LIBOBJ(readutmp)
!   fi
! ])
! 
! AC_DEFUN([jm_PREREQ_REGEX],
! [
!   dnl FIXME: Maybe provide a btowc replacement someday: solaris-2.5.1 lacks 
it.
!   dnl FIXME: Check for wctype and iswctype, and and add -lw if necessary
!   dnl to get them.
!   AC_CHECK_FUNCS(bzero bcopy isascii btowc)
!   AC_CHECK_HEADERS(alloca.h libintl.h wctype.h wchar.h)
!   AC_HEADER_STDC
!   AC_FUNC_ALLOCA
  ])
  
  AC_DEFUN([jm_PREREQ_STAT],
--- 1,31 ----
! #serial 27
  
  dnl These are the prerequisite macros for files in the lib/
  dnl directories of the fileutils, sh-utils, and textutils packages.
  
  AC_DEFUN([jm_PREREQ],
  [
!   gl_BACKUPFILE
    jm_PREREQ_C_STACK
!   gl_CANON_HOST
!   gl_DIRNAME
    jm_PREREQ_ERROR
!   gl_EXCLUDE
!   gl_GETPAGESIZE
!   gl_HARD_LOCALE
!   gl_HASH
!   gl_HUMAN
!   gl_MBSWIDTH
!   gl_FUNC_MEMCHR
!   gl_PHYSMEM
!   gl_POSIXVER
!   gl_QUOTEARG
!   gl_READUTMP
!   gl_REGEX
    jm_PREREQ_STAT
!   gl_FUNC_STRNLEN
!   gl_XGETCWD
!   gl_XREADLINK
  ])
  
  AC_DEFUN([jm_PREREQ_STAT],
***************
*** 199,238 ****
    AC_CHECK_MEMBERS([struct statfs.f_namelen],,,[$statxfs_includes])
    AC_CHECK_MEMBERS([struct statvfs.f_namelen],,,[$statxfs_includes])
  ])
- 
- AC_DEFUN([jm_PREREQ_STRNLEN],
- [
-   AC_FUNC_STRNLEN
-   AC_HEADER_STDC
-   AC_CHECK_HEADERS(memory.h)
-   AC_CHECK_DECLS([memchr])
- 
-   # This is necessary because automake-1.6.1 doens't understand
-   # that the above use of AC_FUNC_STRNLEN means we may have to use
-   # lib/strnlen.c.
-   test $ac_cv_func_strnlen_working = yes \
-     && AC_LIBOBJ(strnlen)
- ])
- 
- AC_DEFUN([jm_PREREQ_TEMPNAME],
- [
-   AC_HEADER_STDC
-   AC_HEADER_STAT
-   AC_CHECK_HEADERS(fcntl.h sys/time.h stdint.h unistd.h)
-   AC_CHECK_FUNCS(__secure_getenv gettimeofday)
-   AC_CHECK_DECLS([getenv])
- ])
- 
- AC_DEFUN([jm_PREREQ_XGETCWD],
- [
-   AC_C_PROTOTYPES
-   AC_CHECK_HEADERS(limits.h stdlib.h sys/param.h unistd.h)
-   AC_CHECK_FUNCS(getcwd)
-   AC_FUNC_GETCWD_NULL
- ])
- 
- AC_DEFUN([jm_PREREQ_XREADLINK],
- [
-   AC_C_PROTOTYPES
-   AC_CHECK_HEADERS(limits.h stdlib.h sys/types.h unistd.h)
- ])
--- 61,63 ----
diff -r -c3 gnulib-cvs/m4/readdir.m4 gnulib/m4/readdir.m4
*** gnulib-cvs/m4/readdir.m4    Tue May 28 10:50:53 2002
--- gnulib/m4/readdir.m4        Mon Dec 23 15:10:38 2002
***************
*** 1,4 ****
! #serial 4
  
  dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
  dnl to test whether a NULL return value really means there are no more files
--- 1,4 ----
! #serial 5
  
  dnl SunOS's readdir is broken in such a way that rm.c has to add extra code
  dnl to test whether a NULL return value really means there are no more files
***************
*** 15,21 ****
  AC_DEFUN([jm_FUNC_READDIR],
  [dnl
  AC_REQUIRE([AC_HEADER_DIRENT])
! AC_CHECK_HEADERS(string.h)
  AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
    [dnl
    # Arrange for deletion of the temporary directory this test creates, in
--- 15,21 ----
  AC_DEFUN([jm_FUNC_READDIR],
  [dnl
  AC_REQUIRE([AC_HEADER_DIRENT])
! AC_CHECK_HEADERS_ONCE(string.h)
  AC_CACHE_CHECK([for working readdir], jm_cv_func_working_readdir,
    [dnl
    # Arrange for deletion of the temporary directory this test creates, in
***************
*** 127,132 ****
  
    if test $jm_cv_func_working_readdir = yes; then
      AC_DEFINE(HAVE_WORKING_READDIR, 1,
! [Define if readdir is found to work properly in some unusual cases. ])
    fi
  ])
--- 127,132 ----
  
    if test $jm_cv_func_working_readdir = yes; then
      AC_DEFINE(HAVE_WORKING_READDIR, 1,
!       [Define if readdir is found to work properly in some unusual cases. ])
    fi
  ])
diff -r -c3 gnulib-cvs/m4/st_mtim.m4 gnulib/m4/st_mtim.m4
*** gnulib-cvs/m4/st_mtim.m4    Sun Aug 12 15:26:01 2001
--- gnulib/m4/st_mtim.m4        Mon Dec 23 15:11:14 2002
***************
*** 1,4 ****
! #serial 5
  
  dnl From Paul Eggert.
  
--- 1,4 ----
! #serial 6
  
  dnl From Paul Eggert.
  
***************
*** 26,32 ****
    if test $ac_cv_struct_st_mtim_nsec != no; then
      AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
        [Define to be the nanoseconds member of struct stat's st_mtim,
!    if it exists.])
    fi
   ]
  )
--- 26,32 ----
    if test $ac_cv_struct_st_mtim_nsec != no; then
      AC_DEFINE_UNQUOTED(ST_MTIM_NSEC, $ac_cv_struct_st_mtim_nsec,
        [Define to be the nanoseconds member of struct stat's st_mtim,
!        if it exists.])
    fi
   ]
  )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]