From aa7c4102aa2a0526a4fbfeaa7cba79b02b45603f Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 27 Jan 2009 10:29:55 +0000 Subject: [PATCH] update from gnulib --- ChangeLog | 4 ++++ gnulib/lib/Makefile.am | 1 + gnulib/lib/stdlib.in.h | 8 +++++++- gnulib/m4/00gnulib.m4 | 30 ++++++++++++++++++++++++++++++ gnulib/m4/extensions.m4 | 20 +++++++++++++++----- gnulib/m4/gnulib-common.m4 | 3 ++- gnulib/m4/gnulib-comp.m4 | 1 + gnulib/m4/stdlib_h.m4 | 17 ++++++++++++++--- 8 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 gnulib/m4/00gnulib.m4 diff --git a/ChangeLog b/ChangeLog index 38c700a78f..15facf3848 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jan 27 10:38:09 +0100 2009 Jim Meyering + + update from gnulib + Mon Jan 26 20:40:35 +0100 2009 Jim Meyering build: avoid format warnings diff --git a/gnulib/lib/Makefile.am b/gnulib/lib/Makefile.am index bf558608eb..1e23d09858 100644 --- a/gnulib/lib/Makefile.am +++ b/gnulib/lib/Makefile.am @@ -686,6 +686,7 @@ stdlib.h: stdlib.in.h sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \ + -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \ -e 's|@''GNULIB_MALLOC_POSIX''@|$(GNULIB_MALLOC_POSIX)|g' \ -e 's|@''GNULIB_REALLOC_POSIX''@|$(GNULIB_REALLOC_POSIX)|g' \ -e 's|@''GNULIB_CALLOC_POSIX''@|$(GNULIB_CALLOC_POSIX)|g' \ diff --git a/gnulib/lib/stdlib.in.h b/gnulib/lib/stdlib.in.h index baf21a4415..4e6dfd3bf9 100644 --- a/gnulib/lib/stdlib.in.h +++ b/gnulib/lib/stdlib.in.h @@ -1,6 +1,6 @@ /* A GNU-like . - Copyright (C) 1995, 2001-2004, 2006-2008 Free Software Foundation, Inc. + Copyright (C) 1995, 2001-2004, 2006-2009 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -41,6 +41,12 @@ # include #endif +/* OSF/1 5.1 declares 'struct random_data' in , which is included + from if _REENTRANT is defined. Include it always. */ +#if @HAVE_RANDOM_H@ +# include +#endif + #if @GNULIB_RANDOM_R@ || !@HAVE_STRUCT_RANDOM_DATA@ # include #endif diff --git a/gnulib/m4/00gnulib.m4 b/gnulib/m4/00gnulib.m4 new file mode 100644 index 0000000000..a6b5e2125e --- /dev/null +++ b/gnulib/m4/00gnulib.m4 @@ -0,0 +1,30 @@ +# 00gnulib.m4 serial 1 +dnl Copyright (C) 2009 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This file must be named something that sorts before all other +dnl gnulib-provided .m4 files. It is needed until such time as we can +dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE semantics. + +# AC_DEFUN_ONCE(NAME, VALUE) +# -------------------------- +# Define NAME to expand to VALUE on the first use (whether by direct +# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses. +# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier. This +# definition is slower than the version in Autoconf 2.64, because it +# can only use interfaces that existed since 2.59; but it achieves the +# same effect. Quoting is necessary to avoid confusing Automake. +m4_version_prereq([2.63.263], [], +[m4_define([AC][_DEFUN_ONCE], + [AC][_DEFUN([$1], + [AC_REQUIRE([_gl_DEFUN_ONCE([$1])], + [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl +[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])]) + +# gl_00GNULIB +# ----------- +# Witness macro that this file has been included. Needed to force +# Automake to include this file prior to all other gnulib .m4 files. +AC_DEFUN([gl_00GNULIB]) diff --git a/gnulib/m4/extensions.m4 b/gnulib/m4/extensions.m4 index 611fcfdbc4..ba6d5e190f 100644 --- a/gnulib/m4/extensions.m4 +++ b/gnulib/m4/extensions.m4 @@ -1,7 +1,7 @@ -# serial 6 -*- Autoconf -*- +# serial 8 -*- Autoconf -*- # Enable extensions on systems that normally disable them. -# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc. +# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -20,7 +20,7 @@ # AC_DEFINE. The goal here is to define all known feature-enabling # macros, then, if reports of conflicts are made, disable macros that # cause problems on some platforms (such as __EXTENSIONS__). -AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS], +AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS], [AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl AC_BEFORE([$0], [AC_RUN_IFELSE])dnl @@ -90,5 +90,15 @@ AC_BEFORE([$0], [AC_RUN_IFELSE])dnl # ------------------------ # Enable extensions on systems that normally disable them, # typically due to standards-conformance issues. -AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS], - [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])]) +AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS], +[ + dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS. + dnl gnulib does not need it. But if it gets required by third-party macros + dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a + dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS". + dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE, + dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck. + AC_REQUIRE([AC_GNU_SOURCE]) + + AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) +]) diff --git a/gnulib/m4/gnulib-common.m4 b/gnulib/m4/gnulib-common.m4 index cfd1b99f82..fff9d0f967 100644 --- a/gnulib/m4/gnulib-common.m4 +++ b/gnulib/m4/gnulib-common.m4 @@ -1,4 +1,4 @@ -# gnulib-common.m4 serial 8 +# gnulib-common.m4 serial 9 dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -8,6 +8,7 @@ dnl with or without modifications, as long as this notice is preserved. # is expanded unconditionally through gnulib-tool magic. AC_DEFUN([gl_COMMON], [ dnl Use AC_REQUIRE here, so that the code is expanded once only. + AC_REQUIRE([gl_00GNULIB]) AC_REQUIRE([gl_COMMON_BODY]) ]) AC_DEFUN([gl_COMMON_BODY], [ diff --git a/gnulib/m4/gnulib-comp.m4 b/gnulib/m4/gnulib-comp.m4 index 3879843122..80281c3c07 100644 --- a/gnulib/m4/gnulib-comp.m4 +++ b/gnulib/m4/gnulib-comp.m4 @@ -408,6 +408,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/w32sock.h lib/wchar.in.h lib/xsize.h + m4/00gnulib.m4 m4/alloca.m4 m4/arpa_inet_h.m4 m4/close.m4 diff --git a/gnulib/m4/stdlib_h.m4 b/gnulib/m4/stdlib_h.m4 index 582db13dff..515befeb7e 100644 --- a/gnulib/m4/stdlib_h.m4 +++ b/gnulib/m4/stdlib_h.m4 @@ -1,5 +1,5 @@ -# stdlib_h.m4 serial 13 -dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc. +# stdlib_h.m4 serial 14 +dnl Copyright (C) 2007-2009 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -8,9 +8,20 @@ AC_DEFUN([gl_STDLIB_H], [ AC_REQUIRE([gl_STDLIB_H_DEFAULTS]) gl_CHECK_NEXT_HEADERS([stdlib.h]) + AC_CHECK_HEADERS([random.h]) + if test $ac_cv_header_random_h = yes; then + HAVE_RANDOM_H=1 + else + HAVE_RANDOM_H=0 + fi + AC_SUBST([HAVE_RANDOM_H]) AC_CHECK_TYPES([struct random_data], [], [HAVE_STRUCT_RANDOM_DATA=0], - [[#include ]]) + [[#include + #if HAVE_RANDOM_H + # include + #endif + ]]) ]) AC_DEFUN([gl_STDLIB_MODULE_INDICATOR], -- 2.47.2