summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-08-05 23:01:03 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-08-05 23:01:03 +0000
commitd86254a25acd878c97af400f8ad1309ac6e307b3 (patch)
treec15293059bff93c15975ced98e23d97c13307d7e /m4
parent71ff7490f9162ef114c2b141b1a1305e6c20c439 (diff)
downloadcoreutils-d86254a25acd878c97af400f8ad1309ac6e307b3.tar.xz
Sync from gnulib.
Diffstat (limited to 'm4')
-rw-r--r--m4/ChangeLog21
-rw-r--r--m4/alloca.m428
-rw-r--r--m4/backupfile.m42
-rw-r--r--m4/calloc.m44
-rw-r--r--m4/dirfd.m410
-rw-r--r--m4/dos.m421
-rw-r--r--m4/host-os.m422
-rw-r--r--m4/intmax_t.m44
-rw-r--r--m4/inttypes_h.m48
-rw-r--r--m4/mbrtowc.m410
-rw-r--r--m4/prereq.m44
-rw-r--r--m4/settime.m47
-rw-r--r--m4/stdint_h.m410
-rw-r--r--m4/strtoimax.m44
-rw-r--r--m4/strtoumax.m44
-rw-r--r--m4/uintmax_t.m44
-rw-r--r--m4/unlocked-io.m42
-rw-r--r--m4/xalloc.m43
18 files changed, 117 insertions, 51 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog
index d1977ab45..47ba2e09c 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,24 @@
+2004-08-05 Paul Eggert <eggert@cs.ucla.edu>
+
+ Merge from gnulib.
+
+ * alloca.m4 (gl_FUNC_ALLOCA): Define HAVE_ALLOCA_H always,
+ for backward compatibility with older code. We need our own
+ alloca.h if _AIX is defined. Define HAVE_ALLOCA if we discover
+ it under some other name, and our alloca.h will define it.
+ * backupfile.m4, calloc.m4, strtoimax.m4, strtoumax.m4:
+ Bump serial number only.
+ * dirfd.m4, intmax_t.m4, inttypes_h.m4, mbrtowc.m4, stdint_h.m4,
+ uintmax_t.m4: Finish renaming jm_ to gl_.
+ * dos.m4 (gl_AC_DOS): Check for _WIN32, __WIN32__, and __MSDOS__.
+ * host-os.m4: s/KNetBSD/kNetBSD/g and s/KFreeBSD/kFreeBSD/g.
+ * prereq.m4 (gl_PREREQ): Add gl_GETTIME, AC_FUNC_CALLOC.
+ * gettime.m4: New file.
+ * settime.m4: Require gl_TIMESPEC; check for settimeofday, stime.
+ * unlocked-io.m4: Remove -*- autoconf -*-.
+ * xalloc.m4: No longer require AC_FUNC_CALLOC, AC_FUNC_MALLOC,
+ AC_FUNC_REALLOC.
+
2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
OpenBSD porting fixes.
diff --git a/m4/alloca.m4 b/m4/alloca.m4
index 793cf0ac0..6fcb205e9 100644
--- a/m4/alloca.m4
+++ b/m4/alloca.m4
@@ -1,5 +1,5 @@
-# alloca.m4 serial 3
-dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+# alloca.m4 serial 4
+dnl Copyright (C) 2002, 2003, 2004 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
@@ -18,15 +18,25 @@ AC_DEFUN([gl_FUNC_ALLOCA],
fi
# Define an additional variable used in the Makefile substitution.
-
- AC_EGREP_CPP([Need own alloca], [
-#if defined __GNUC__ || defined _MSC_VER || !HAVE_ALLOCA_H
- Need own alloca
+ if test $ac_cv_working_alloca_h = yes; then
+ AC_EGREP_CPP([Need own alloca], [
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+ Need own alloca
#endif
- ],
- ALLOCA_H=alloca.h,
- ALLOCA_H=)
+ ],
+ [AC_DEFINE(HAVE_ALLOCA, 1,
+ [Define to 1 if you have `alloca' after including <alloca.h>,
+ a header that may be supplied by this distribution.])
+ ALLOCA_H=alloca.h],
+ [ALLOCA_H=])
+ else
+ ALLOCA_H=alloca.h
+ fi
AC_SUBST([ALLOCA_H])
+
+ AC_DEFINE(HAVE_ALLOCA_H, 1,
+ [Define HAVE_ALLOCA_H for backward compatibility with older code
+ that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
])
# Prerequisites of lib/alloca.c.
diff --git a/m4/backupfile.m4 b/m4/backupfile.m4
index cc35f512e..0793f1f00 100644
--- a/m4/backupfile.m4
+++ b/m4/backupfile.m4
@@ -1,4 +1,4 @@
-# backupfile.m4 serial 4
+# backupfile.m4 serial 5
dnl Copyright (C) 2002, 2003, 2004 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
diff --git a/m4/calloc.m4 b/m4/calloc.m4
index 88861f9d4..5d03ed271 100644
--- a/m4/calloc.m4
+++ b/m4/calloc.m4
@@ -1,6 +1,6 @@
-#serial 1
+#serial 2
-# Determine whether calloc (N, S) works when N*S is zero.
+# Determine whether calloc (N, S) returns non-NULL when N*S is zero.
# If so, define HAVE_CALLOC. Otherwise, define calloc to rpl_calloc
# and arrange to use a calloc wrapper function that does work in that case.
diff --git a/m4/dirfd.m4 b/m4/dirfd.m4
index 5f1a9a81b..f84d63fac 100644
--- a/m4/dirfd.m4
+++ b/m4/dirfd.m4
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
dnl Find out how to get the file descriptor associated with an open DIR*.
dnl From Jim Meyering
@@ -30,17 +30,17 @@ AC_DEFUN([gl_FUNC_DIRFD],
AC_CHECK_DECLS([dirfd], , , $dirfd_headers)
AC_CACHE_CHECK([whether dirfd is a macro],
- jm_cv_func_dirfd_macro,
+ gl_cv_func_dirfd_macro,
[AC_EGREP_CPP([dirent_header_defines_dirfd], [$dirfd_headers
#ifdef dirfd
dirent_header_defines_dirfd
#endif],
- jm_cv_func_dirfd_macro=yes,
- jm_cv_func_dirfd_macro=no)])
+ gl_cv_func_dirfd_macro=yes,
+ gl_cv_func_dirfd_macro=no)])
# Use the replacement only if we have no function, macro,
# or declaration with that name.
- if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$jm_cv_func_dirfd_macro \
+ if test $ac_cv_func_dirfd,$ac_cv_have_decl_dirfd,$gl_cv_func_dirfd_macro \
= no,no,no; then
AC_REPLACE_FUNCS([dirfd])
AC_CACHE_CHECK(
diff --git a/m4/dos.m4 b/m4/dos.m4
index 541de7e0e..90f52c3cf 100644
--- a/m4/dos.m4
+++ b/m4/dos.m4
@@ -1,8 +1,25 @@
-#serial 7
+#serial 8
# Define some macros required for proper operation of code in lib/*.c
# on MSDOS/Windows systems.
+# Copyright (C) 2000, 2001, 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
# From Jim Meyering.
AC_DEFUN([gl_AC_DOS],
@@ -10,7 +27,7 @@ AC_DEFUN([gl_AC_DOS],
AC_CACHE_CHECK([whether system is Windows or MSDOS], [ac_cv_win_or_dos],
[
AC_TRY_COMPILE([],
- [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__
+ [#if !defined _WIN32 && !defined __WIN32__ && !defined __MSDOS__ && !defined __CYGWIN__
neither MSDOS nor Windows
#endif],
[ac_cv_win_or_dos=yes],
diff --git a/m4/host-os.m4 b/m4/host-os.m4
index 52905f4d9..e8fe07214 100644
--- a/m4/host-os.m4
+++ b/m4/host-os.m4
@@ -1,5 +1,23 @@
#serial 4
+# Copyright (C) 2001, 2003, 2004 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+# Written by Paul Eggert.
+
dnl From Paul Eggert.
# Define HOST_OPERATING_SYSTEM to a name for the host operating system.
@@ -32,8 +50,8 @@ AC_DEFUN([gl_HOST_OS],
nonstopux*) os='NonStop-UX';;
netbsd*-gnu*) os='GNU/NetBSD';; # NetBSD kernel+libc, GNU userland
netbsd*) os='NetBSD';;
- knetbsd*-gnu) os='GNU/KNetBSD';; # NetBSD kernel, GNU libc+userland
- kfreebsd*-gnu) os='GNU/KFreeBSD';; # FreeBSD kernel, GNU libc+userland
+ knetbsd*-gnu) os='GNU/kNetBSD';; # NetBSD kernel, GNU libc+userland
+ kfreebsd*-gnu) os='GNU/kFreeBSD';; # FreeBSD kernel, GNU libc+userland
msdosdjgpp*) os='DJGPP';;
mpeix*) os='MPE/iX';;
mint*) os='MiNT';;
diff --git a/m4/intmax_t.m4 b/m4/intmax_t.m4
index 1dc61927d..859db1495 100644
--- a/m4/intmax_t.m4
+++ b/m4/intmax_t.m4
@@ -1,4 +1,4 @@
-# intmax_t.m4 serial 3
+# intmax_t.m4 serial 4
dnl Copyright (C) 1997-2004 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
@@ -19,7 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
dnl only if it defines 'uintmax_t'.
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
test $ac_cv_type_long_long = yes \
&& ac_type='long long' \
diff --git a/m4/inttypes_h.m4 b/m4/inttypes_h.m4
index 954a86c27..79bba8763 100644
--- a/m4/inttypes_h.m4
+++ b/m4/inttypes_h.m4
@@ -13,14 +13,14 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
[
- AC_CACHE_CHECK([for inttypes.h], jm_ac_cv_header_inttypes_h,
+ AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <inttypes.h>],
[uintmax_t i = (uintmax_t) -1;],
- jm_ac_cv_header_inttypes_h=yes,
- jm_ac_cv_header_inttypes_h=no)])
- if test $jm_ac_cv_header_inttypes_h = yes; then
+ gl_cv_header_inttypes_h=yes,
+ gl_cv_header_inttypes_h=no)])
+ if test $gl_cv_header_inttypes_h = yes; then
AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
[Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
diff --git a/m4/mbrtowc.m4 b/m4/mbrtowc.m4
index ac08c1cc9..3d8768ecb 100644
--- a/m4/mbrtowc.m4
+++ b/m4/mbrtowc.m4
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 6
+# mbrtowc.m4 serial 7
dnl Copyright (C) 2001-2002, 2004 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
@@ -14,13 +14,13 @@ dnl AC_FUNC_MBRTOWC, when autoconf 2.57 can be assumed everywhere.
AC_DEFUN([gl_FUNC_MBRTOWC],
[
AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
- jm_cv_func_mbrtowc,
+ gl_cv_func_mbrtowc,
[AC_TRY_LINK(
[#include <wchar.h>],
[mbstate_t state; return ! (sizeof state && mbrtowc);],
- jm_cv_func_mbrtowc=yes,
- jm_cv_func_mbrtowc=no)])
- if test $jm_cv_func_mbrtowc = yes; then
+ gl_cv_func_mbrtowc=yes,
+ gl_cv_func_mbrtowc=no)])
+ if test $gl_cv_func_mbrtowc = yes; then
AC_DEFINE(HAVE_MBRTOWC, 1,
[Define to 1 if mbrtowc and mbstate_t are properly declared.])
fi
diff --git a/m4/prereq.m4 b/m4/prereq.m4
index 787786ff4..79b7586f7 100644
--- a/m4/prereq.m4
+++ b/m4/prereq.m4
@@ -1,4 +1,4 @@
-#serial 43
+#serial 44
dnl We use gl_ for non Autoconf macros.
m4_pattern_forbid([^gl_[ABCDEFGHIJKLMNOPQRSTUVXYZ]])dnl
@@ -70,6 +70,7 @@ AC_DEFUN([gl_PREREQ],
AC_REQUIRE([gl_GETNDELIM2])
AC_REQUIRE([gl_GETOPT])
AC_REQUIRE([gl_GETPAGESIZE])
+ AC_REQUIRE([gl_GETTIME])
AC_REQUIRE([gl_GETUGROUPS])
AC_REQUIRE([gl_HARD_LOCALE])
AC_REQUIRE([gl_HASH])
@@ -115,6 +116,7 @@ AC_DEFUN([gl_PREREQ],
AC_REQUIRE([gl_XSTRTOD])
AC_REQUIRE([gl_XSTRTOL])
AC_REQUIRE([gl_YESNO])
+ AC_REQUIRE([AC_FUNC_CALLOC])
AC_REQUIRE([gl_FUNC_GLIBC_UNLOCKED_IO])
AC_REQUIRE([gl_FUNC_GNU_STRFTIME])
AC_REQUIRE([gl_FUNC_LSTAT])
diff --git a/m4/settime.m4 b/m4/settime.m4
index 3751af564..89c030cd0 100644
--- a/m4/settime.m4
+++ b/m4/settime.m4
@@ -1,5 +1,5 @@
-# settime.m4 serial 1
-dnl Copyright (C) 2002 Free Software Foundation, Inc.
+# settime.m4 serial 2
+dnl Copyright (C) 2002, 2004 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
@@ -9,6 +9,7 @@ dnl the same distribution terms as the rest of that program.
AC_DEFUN([gl_SETTIME],
[
dnl Prerequisites of lib/settime.c.
- # Need clock_settime.
AC_REQUIRE([gl_CLOCK_TIME])
+ AC_REQUIRE([gl_TIMESPEC])
+ AC_CHECK_FUNCS_ONCE(settimeofday stime)
])
diff --git a/m4/stdint_h.m4 b/m4/stdint_h.m4
index e48e210a0..063c4344e 100644
--- a/m4/stdint_h.m4
+++ b/m4/stdint_h.m4
@@ -1,4 +1,4 @@
-# stdint_h.m4 serial 4
+# stdint_h.m4 serial 5
dnl Copyright (C) 1997-2004 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
@@ -13,14 +13,14 @@ dnl From Paul Eggert.
AC_DEFUN([gl_AC_HEADER_STDINT_H],
[
- AC_CACHE_CHECK([for stdint.h], jm_ac_cv_header_stdint_h,
+ AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
[AC_TRY_COMPILE(
[#include <sys/types.h>
#include <stdint.h>],
[uintmax_t i = (uintmax_t) -1;],
- jm_ac_cv_header_stdint_h=yes,
- jm_ac_cv_header_stdint_h=no)])
- if test $jm_ac_cv_header_stdint_h = yes; then
+ gl_cv_header_stdint_h=yes,
+ gl_cv_header_stdint_h=no)])
+ if test $gl_cv_header_stdint_h = yes; then
AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
[Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
and declares uintmax_t. ])
diff --git a/m4/strtoimax.m4 b/m4/strtoimax.m4
index a9607f67e..84e57a876 100644
--- a/m4/strtoimax.m4
+++ b/m4/strtoimax.m4
@@ -1,5 +1,5 @@
-# strtoimax.m4 serial 3
-dnl Copyright (C) 2002-2004 Free Software Foundation, Inc.
+# strtoimax.m4 serial 4
+dnl Copyright (C) 2002, 2003, 2004 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
diff --git a/m4/strtoumax.m4 b/m4/strtoumax.m4
index f63ed5e97..84d42ff16 100644
--- a/m4/strtoumax.m4
+++ b/m4/strtoumax.m4
@@ -1,5 +1,5 @@
-# strtoumax.m4 serial 3
-dnl Copyright (C) 2002-2004 Free Software Foundation, Inc.
+# strtoumax.m4 serial 4
+dnl Copyright (C) 2002, 2003, 2004 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
diff --git a/m4/uintmax_t.m4 b/m4/uintmax_t.m4
index 41e0edf80..a2bc218ce 100644
--- a/m4/uintmax_t.m4
+++ b/m4/uintmax_t.m4
@@ -1,4 +1,4 @@
-# uintmax_t.m4 serial 8
+# uintmax_t.m4 serial 9
dnl Copyright (C) 1997-2004 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
@@ -17,7 +17,7 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
[
AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
AC_REQUIRE([gl_AC_HEADER_STDINT_H])
- if test $jm_ac_cv_header_inttypes_h = no && test $jm_ac_cv_header_stdint_h = no; then
+ if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
AC_REQUIRE([gl_AC_TYPE_UNSIGNED_LONG_LONG])
test $ac_cv_type_unsigned_long_long = yes \
&& ac_type='unsigned long long' \
diff --git a/m4/unlocked-io.m4 b/m4/unlocked-io.m4
index ab16e0ada..cd1c5f4ef 100644
--- a/m4/unlocked-io.m4
+++ b/m4/unlocked-io.m4
@@ -1,4 +1,4 @@
-#serial 9 -*- autoconf -*-
+#serial 9
dnl From Jim Meyering.
dnl
diff --git a/m4/xalloc.m4 b/m4/xalloc.m4
index b2b9abaa1..4d9383509 100644
--- a/m4/xalloc.m4
+++ b/m4/xalloc.m4
@@ -21,9 +21,6 @@ AC_DEFUN([gl_PREREQ_XALLOC], [
# Prerequisites of lib/xmalloc.c.
AC_DEFUN([gl_PREREQ_XMALLOC], [
AC_REQUIRE([AC_C_INLINE])
- AC_REQUIRE([AC_FUNC_CALLOC])
- AC_REQUIRE([AC_FUNC_MALLOC])
- AC_REQUIRE([AC_FUNC_REALLOC])
:
])