aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2012-03-19 18:35:55 +0100
committerThomas White <taw@physics.org>2012-03-27 16:46:55 +0200
commita0cdc586ccd5216a640c908ea162a7a452feafc6 (patch)
tree5203e4dcd530ea2376d40f11e4a0aabd12c56a0f
parentd35bef6fae06e96d98699a91946ac7700e3993bc (diff)
Update GNUlib stuff
-rw-r--r--build-aux/arg-nonnull.h4
-rw-r--r--build-aux/c++defs.h4
-rw-r--r--build-aux/warn-on-use.h4
-rw-r--r--lib/Makefile.am21
-rw-r--r--lib/dummy.c2
-rw-r--r--lib/memchr.c172
-rw-r--r--lib/memchr.valgrind14
-rw-r--r--lib/stddef.in.h2
-rw-r--r--lib/string.in.h26
-rw-r--r--lib/strndup.c4
-rw-r--r--lib/strnlen.c2
-rw-r--r--m4/00gnulib.m42
-rw-r--r--m4/extensions.m42
-rw-r--r--m4/gnulib-cache.m42
-rw-r--r--m4/gnulib-common.m425
-rw-r--r--m4/gnulib-comp.m435
-rw-r--r--m4/gnulib-tool.m42
-rw-r--r--m4/include_next.m499
-rw-r--r--m4/lib-ignore.m42
-rw-r--r--m4/memchr.m488
-rw-r--r--m4/mmap-anon.m455
-rw-r--r--m4/onceonly.m42
-rw-r--r--m4/stddef_h.m410
-rw-r--r--m4/string_h.m47
-rw-r--r--m4/strndup.m42
-rw-r--r--m4/strnlen.m42
-rw-r--r--m4/warn-on-use.m42
-rw-r--r--m4/wchar_t.m42
28 files changed, 150 insertions, 444 deletions
diff --git a/build-aux/arg-nonnull.h b/build-aux/arg-nonnull.h
index 7e3e2db8..6c2f1e82 100644
--- a/build-aux/arg-nonnull.h
+++ b/build-aux/arg-nonnull.h
@@ -1,5 +1,5 @@
/* A C macro for declaring that specific arguments must not be NULL.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 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
@@ -9,7 +9,7 @@
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
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/build-aux/c++defs.h b/build-aux/c++defs.h
index 0c2fad7a..b6821a64 100644
--- a/build-aux/c++defs.h
+++ b/build-aux/c++defs.h
@@ -1,5 +1,5 @@
/* C++ compatible function declaration macros.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 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
@@ -9,7 +9,7 @@
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
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/build-aux/warn-on-use.h b/build-aux/warn-on-use.h
index 171e5991..2cdeec3e 100644
--- a/build-aux/warn-on-use.h
+++ b/build-aux/warn-on-use.h
@@ -1,5 +1,5 @@
/* A C macro for emitting warnings if a function is used.
- Copyright (C) 2010 Free Software Foundation, Inc.
+ Copyright (C) 2010-2011 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
@@ -9,7 +9,7 @@
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
- Lesser General Public License for more details.
+ General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 1a70d02a..835dc32b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -84,22 +84,14 @@ EXTRA_DIST += $(top_srcdir)/build-aux/c++defs.h
## end gnulib module c++defs
-## begin gnulib module memchr
-
-
-EXTRA_DIST += memchr.c memchr.valgrind
-
-EXTRA_libgnu_a_SOURCES += memchr.c
-
-## end gnulib module memchr
-
## begin gnulib module stddef
BUILT_SOURCES += $(STDDEF_H)
# We need the following in order to create <stddef.h> when the system
# doesn't have one that works with the given compiler.
-stddef.h: stddef.in.h
+if GL_GENERATE_STDDEF_H
+stddef.h: stddef.in.h $(top_builddir)/config.status
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -111,6 +103,10 @@ stddef.h: stddef.in.h
< $(srcdir)/stddef.in.h; \
} > $@-t && \
mv $@-t $@
+else
+stddef.h: $(top_builddir)/config.status
+ rm -f $@
+endif
MOSTLYCLEANFILES += stddef.h stddef.h-t
EXTRA_DIST += stddef.in.h
@@ -123,7 +119,7 @@ BUILT_SOURCES += string.h
# We need the following in order to create <string.h> when the system
# doesn't have one that works with the given compiler.
-string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
$(AM_V_GEN)rm -f $@-t $@ && \
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
sed -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
@@ -189,6 +185,7 @@ string.h: string.in.h $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+ -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
diff --git a/lib/dummy.c b/lib/dummy.c
index 0f9a2779..c958ea05 100644
--- a/lib/dummy.c
+++ b/lib/dummy.c
@@ -1,5 +1,5 @@
/* A dummy file, to prevent empty libraries from breaking builds.
- Copyright (C) 2004, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2004, 2007, 2009-2011 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
diff --git a/lib/memchr.c b/lib/memchr.c
deleted file mode 100644
index 6c2b2d6c..00000000
--- a/lib/memchr.c
+++ /dev/null
@@ -1,172 +0,0 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2010
- Free Software Foundation, Inc.
-
- Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
- with help from Dan Sahlin (dan@sics.se) and
- commentary by Jim Blandy (jimb@ai.mit.edu);
- adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
- and implemented by Roland McGrath (roland@ai.mit.edu).
-
-NOTE: The canonical source of this file is maintained with the GNU C Library.
-Bugs can be reported to bug-glibc@prep.ai.mit.edu.
-
-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 3 of the License, or 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, see <http://www.gnu.org/licenses/>. */
-
-#ifndef _LIBC
-# include <config.h>
-#endif
-
-#include <string.h>
-
-#include <stddef.h>
-
-#if defined _LIBC
-# include <memcopy.h>
-#else
-# define reg_char char
-#endif
-
-#include <limits.h>
-
-#if HAVE_BP_SYM_H || defined _LIBC
-# include <bp-sym.h>
-#else
-# define BP_SYM(sym) sym
-#endif
-
-#undef __memchr
-#ifdef _LIBC
-# undef memchr
-#endif
-
-#ifndef weak_alias
-# define __memchr memchr
-#endif
-
-/* Search no more than N bytes of S for C. */
-void *
-__memchr (void const *s, int c_in, size_t n)
-{
- /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
- long instead of a 64-bit uintmax_t tends to give better
- performance. On 64-bit hardware, unsigned long is generally 64
- bits already. Change this typedef to experiment with
- performance. */
- typedef unsigned long int longword;
-
- const unsigned char *char_ptr;
- const longword *longword_ptr;
- longword repeated_one;
- longword repeated_c;
- unsigned reg_char c;
-
- c = (unsigned char) c_in;
-
- /* Handle the first few bytes by reading one byte at a time.
- Do this until CHAR_PTR is aligned on a longword boundary. */
- for (char_ptr = (const unsigned char *) s;
- n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
- --n, ++char_ptr)
- if (*char_ptr == c)
- return (void *) char_ptr;
-
- longword_ptr = (const longword *) char_ptr;
-
- /* All these elucidatory comments refer to 4-byte longwords,
- but the theory applies equally well to any size longwords. */
-
- /* Compute auxiliary longword values:
- repeated_one is a value which has a 1 in every byte.
- repeated_c has c in every byte. */
- repeated_one = 0x01010101;
- repeated_c = c | (c << 8);
- repeated_c |= repeated_c << 16;
- if (0xffffffffU < (longword) -1)
- {
- repeated_one |= repeated_one << 31 << 1;
- repeated_c |= repeated_c << 31 << 1;
- if (8 < sizeof (longword))
- {
- size_t i;
-
- for (i = 64; i < sizeof (longword) * 8; i *= 2)
- {
- repeated_one |= repeated_one << i;
- repeated_c |= repeated_c << i;
- }
- }
- }
-
- /* Instead of the traditional loop which tests each byte, we will test a
- longword at a time. The tricky part is testing if *any of the four*
- bytes in the longword in question are equal to c. We first use an xor
- with repeated_c. This reduces the task to testing whether *any of the
- four* bytes in longword1 is zero.
-
- We compute tmp =
- ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
- That is, we perform the following operations:
- 1. Subtract repeated_one.
- 2. & ~longword1.
- 3. & a mask consisting of 0x80 in every byte.
- Consider what happens in each byte:
- - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
- and step 3 transforms it into 0x80. A carry can also be propagated
- to more significant bytes.
- - If a byte of longword1 is nonzero, let its lowest 1 bit be at
- position k (0 <= k <= 7); so the lowest k bits are 0. After step 1,
- the byte ends in a single bit of value 0 and k bits of value 1.
- After step 2, the result is just k bits of value 1: 2^k - 1. After
- step 3, the result is 0. And no carry is produced.
- So, if longword1 has only non-zero bytes, tmp is zero.
- Whereas if longword1 has a zero byte, call j the position of the least
- significant zero byte. Then the result has a zero at positions 0, ...,
- j-1 and a 0x80 at position j. We cannot predict the result at the more
- significant bytes (positions j+1..3), but it does not matter since we
- already have a non-zero bit at position 8*j+7.
-
- So, the test whether any byte in longword1 is zero is equivalent to
- testing whether tmp is nonzero. */
-
- while (n >= sizeof (longword))
- {
- longword longword1 = *longword_ptr ^ repeated_c;
-
- if ((((longword1 - repeated_one) & ~longword1)
- & (repeated_one << 7)) != 0)
- break;
- longword_ptr++;
- n -= sizeof (longword);
- }
-
- char_ptr = (const unsigned char *) longword_ptr;
-
- /* At this point, we know that either n < sizeof (longword), or one of the
- sizeof (longword) bytes starting at char_ptr is == c. On little-endian
- machines, we could determine the first such byte without any further
- memory accesses, just by looking at the tmp result from the last loop
- iteration. But this does not work on big-endian machines. Choose code
- that works in both cases. */
-
- for (; n > 0; --n, ++char_ptr)
- {
- if (*char_ptr == c)
- return (void *) char_ptr;
- }
-
- return NULL;
-}
-#ifdef weak_alias
-weak_alias (__memchr, BP_SYM (memchr))
-#endif
diff --git a/lib/memchr.valgrind b/lib/memchr.valgrind
deleted file mode 100644
index 60f247e1..00000000
--- a/lib/memchr.valgrind
+++ /dev/null
@@ -1,14 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in memchr().
-# POSIX states that when the character is found, memchr must not read extra
-# bytes in an overestimated length (for example, where memchr is used to
-# implement strnlen). However, we use a safe word read to provide a speedup.
-{
- memchr-value4
- Memcheck:Value4
- fun:rpl_memchr
-}
-{
- memchr-value8
- Memcheck:Value8
- fun:rpl_memchr
-}
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 6642d49e..62a91a7a 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -1,6 +1,6 @@
/* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
- Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2009-2011 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
diff --git a/lib/string.in.h b/lib/string.in.h
index b0c2ba1e..76d26ed3 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2010 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2011 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
@@ -37,13 +37,8 @@
# include <wchar.h>
#endif
-#ifndef __attribute__
-/* This feature is available in gcc versions 2.5 and later. */
-# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
-# define __attribute__(Spec) /* empty */
-# endif
-#endif
-/* The attribute __pure__ was added in gcc 2.96. */
+/* The __attribute__ feature is available in gcc versions 2.5 and later.
+ The attribute __pure__ was added in gcc 2.96. */
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
#else
@@ -282,17 +277,28 @@ _GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
/* Find the first occurrence of C in S or the final NUL byte. */
#if @GNULIB_STRCHRNUL@
-# if ! @HAVE_STRCHRNUL@
+# if @REPLACE_STRCHRNUL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define strchrnul rpl_strchrnul
+# endif
+_GL_FUNCDECL_RPL (strchrnul, char *, (const char *__s, int __c_in)
+ _GL_ATTRIBUTE_PURE
+ _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strchrnul, char *,
+ (const char *str, int ch));
+# else
+# if ! @HAVE_STRCHRNUL@
_GL_FUNCDECL_SYS (strchrnul, char *, (char const *__s, int __c_in)
_GL_ATTRIBUTE_PURE
_GL_ARG_NONNULL ((1)));
-# endif
+# endif
/* On some systems, this function is defined as an overloaded function:
extern "C++" { const char * std::strchrnul (const char *, int); }
extern "C++" { char * std::strchrnul (char *, int); } */
_GL_CXXALIAS_SYS_CAST2 (strchrnul,
char *, (char const *__s, int __c_in),
char const *, (char const *__s, int __c_in));
+# endif
# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
&& (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
_GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in));
diff --git a/lib/strndup.c b/lib/strndup.c
index 3de3dbc5..4a3bece4 100644
--- a/lib/strndup.c
+++ b/lib/strndup.c
@@ -1,7 +1,7 @@
/* A replacement function, for systems that lack strndup.
- Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2005, 2006, 2007, 2009,
- 2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2011 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
diff --git a/lib/strnlen.c b/lib/strnlen.c
index f1ec356d..3cefa978 100644
--- a/lib/strnlen.c
+++ b/lib/strnlen.c
@@ -1,5 +1,5 @@
/* Find the length of STRING, but scan at most MAXLEN characters.
- Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2005-2007, 2009-2011 Free Software Foundation, Inc.
Written by Simon Josefsson.
This program is free software; you can redistribute it and/or modify
diff --git a/m4/00gnulib.m4 b/m4/00gnulib.m4
index 301469b3..7feed466 100644
--- a/m4/00gnulib.m4
+++ b/m4/00gnulib.m4
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 2
-dnl Copyright (C) 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2011 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.
diff --git a/m4/extensions.m4 b/m4/extensions.m4
index 7d9458a8..1330503f 100644
--- a/m4/extensions.m4
+++ b/m4/extensions.m4
@@ -1,7 +1,7 @@
# serial 9 -*- Autoconf -*-
# Enable extensions on systems that normally disable them.
-# Copyright (C) 2003, 2006-2010 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2011 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.
diff --git a/m4/gnulib-cache.m4 b/m4/gnulib-cache.m4
index e09ed2cb..c93243e0 100644
--- a/m4/gnulib-cache.m4
+++ b/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index d0c8b662..c4d7a20e 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,5 +1,5 @@
-# gnulib-common.m4 serial 21
-dnl Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 24
+dnl Copyright (C) 2007-2011 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.
@@ -102,6 +102,27 @@ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS],
[Define to 1 when the gnulib module $1 should be tested.])
])
+# gl_ASSERT_NO_GNULIB_POSIXCHECK
+# asserts that there will never be a need to #define GNULIB_POSIXCHECK.
+# and thereby enables an optimization of configure and config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_POSIXCHECK],
+[
+ dnl Override gl_WARN_ON_USE_PREPARE.
+ dnl But hide this definition from 'aclocal'.
+ AC_DEFUN([gl_W][ARN_ON_USE_PREPARE], [])
+])
+
+# gl_ASSERT_NO_GNULIB_TESTS
+# asserts that there will be no gnulib tests in the scope of the configure.ac
+# and thereby enables an optimization of config.h.
+# Used by Emacs.
+AC_DEFUN([gl_ASSERT_NO_GNULIB_TESTS],
+[
+ dnl Override gl_MODULE_INDICATOR_FOR_TESTS.
+ AC_DEFUN([gl_MODULE_INDICATOR_FOR_TESTS], [])
+])
+
# Test whether <features.h> exists.
# Set HAVE_FEATURES_H.
AC_DEFUN([gl_FEATURES_H],
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 4b97830a..8c573e37 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -1,5 +1,5 @@
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+# Copyright (C) 2002-2011 Free Software Foundation, Inc.
#
# This file is free software, distributed under the terms of the GNU
# General Public License. As a special exception to the GNU General
@@ -32,7 +32,6 @@ AC_DEFUN([gl_EARLY],
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
# Code from module include_next:
# Code from module lib-ignore:
- # Code from module memchr:
# Code from module stddef:
# Code from module string:
# Code from module strndup:
@@ -56,27 +55,13 @@ AC_DEFUN([gl_INIT],
m4_pushdef([gl_LIBSOURCES_DIR], [])
gl_COMMON
gl_source_base='lib'
- # Code from module arg-nonnull:
- # Code from module c++defs:
- # Code from module extensions:
- # Code from module include_next:
- # Code from module lib-ignore:
- gl_IGNORE_UNUSED_LIBRARIES
- # Code from module memchr:
- gl_FUNC_MEMCHR
- gl_STRING_MODULE_INDICATOR([memchr])
- # Code from module stddef:
- gl_STDDEF_H
- # Code from module string:
- gl_HEADER_STRING_H
- # Code from module strndup:
- gl_FUNC_STRNDUP
- gl_STRING_MODULE_INDICATOR([strndup])
- # Code from module strnlen:
- gl_FUNC_STRNLEN
- gl_STRING_MODULE_INDICATOR([strnlen])
- # Code from module warn-on-use:
- # Code from module dummy:
+gl_IGNORE_UNUSED_LIBRARIES
+gl_STDDEF_H
+gl_HEADER_STRING_H
+gl_FUNC_STRNDUP
+gl_STRING_MODULE_INDICATOR([strndup])
+gl_FUNC_STRNLEN
+gl_STRING_MODULE_INDICATOR([strnlen])
# End of code from modules
m4_ifval(gl_LIBSOURCES_LIST, [
m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
@@ -221,8 +206,6 @@ AC_DEFUN([gl_FILE_LIST], [
build-aux/c++defs.h
build-aux/warn-on-use.h
lib/dummy.c
- lib/memchr.c
- lib/memchr.valgrind
lib/stddef.in.h
lib/string.in.h
lib/strndup.c
@@ -232,8 +215,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/gnulib-common.m4
m4/include_next.m4
m4/lib-ignore.m4
- m4/memchr.m4
- m4/mmap-anon.m4
m4/onceonly.m4
m4/stddef_h.m4
m4/string_h.m4
diff --git a/m4/gnulib-tool.m4 b/m4/gnulib-tool.m4
index 69e7733b..ed41e9d4 100644
--- a/m4/gnulib-tool.m4
+++ b/m4/gnulib-tool.m4
@@ -1,5 +1,5 @@
# gnulib-tool.m4 serial 2
-dnl Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2005, 2009-2011 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.
diff --git a/m4/include_next.m4 b/m4/include_next.m4
index e37eb056..b3c78491 100644
--- a/m4/include_next.m4
+++ b/m4/include_next.m4
@@ -1,5 +1,5 @@
-# include_next.m4 serial 16
-dnl Copyright (C) 2006-2010 Free Software Foundation, Inc.
+# include_next.m4 serial 18
+dnl Copyright (C) 2006-2011 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.
@@ -147,11 +147,33 @@ choke me
# Note: This macro assumes that the header file is not empty after
# preprocessing, i.e. it does not only define preprocessor macros but also
# provides some type/enum definitions or function/variable declarations.
+#
+# This macro also checks whether each header exists, by invoking
+# AC_CHECK_HEADERS_ONCE or AC_CHECK_HEADERS on each argument.
AC_DEFUN([gl_CHECK_NEXT_HEADERS],
[
+ gl_NEXT_HEADERS_INTERNAL([$1], [check])
+])
+
+# gl_NEXT_HEADERS(HEADER1 HEADER2 ...)
+# ------------------------------------
+# Like gl_CHECK_NEXT_HEADERS, except do not check whether the headers exist.
+# This is suitable for headers like <stddef.h> that are standardized by C89
+# and therefore can be assumed to exist.
+AC_DEFUN([gl_NEXT_HEADERS],
+[
+ gl_NEXT_HEADERS_INTERNAL([$1], [assume])
+])
+
+# The guts of gl_CHECK_NEXT_HEADERS and gl_NEXT_HEADERS.
+AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
+[
AC_REQUIRE([gl_INCLUDE_NEXT])
AC_REQUIRE([AC_CANONICAL_HOST])
- AC_CHECK_HEADERS_ONCE([$1])
+
+ m4_if([$2], [check],
+ [AC_CHECK_HEADERS_ONCE([$1])
+ ])
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
@@ -162,39 +184,44 @@ AC_DEFUN([gl_CHECK_NEXT_HEADERS],
AC_CACHE_CHECK(
[absolute name of <]m4_defn([gl_HEADER_NAME])[>],
m4_defn([gl_next_header]),
- [AS_VAR_PUSHDEF([gl_header_exists],
- [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
- if test AS_VAR_GET(gl_header_exists) = yes; then
- AC_LANG_CONFTEST(
- [AC_LANG_SOURCE(
- [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
- )])
- dnl AIX "xlc -E" and "cc -E" omit #line directives for header files
- dnl that contain only a #include of other header files and no
- dnl non-comment tokens of their own. This leads to a failure to
- dnl detect the absolute name of <dirent.h>, <signal.h>, <poll.h>
- dnl and others. The workaround is to force preservation of comments
- dnl through option -C. This ensures all necessary #line directives
- dnl are present. GCC supports option -C as well.
- case "$host_os" in
- aix*) gl_absname_cpp="$ac_cpp -C" ;;
- *) gl_absname_cpp="$ac_cpp" ;;
- esac
- dnl eval is necessary to expand gl_absname_cpp.
- dnl Ultrix and Pyramid sh refuse to redirect output of eval,
- dnl so use subshell.
- AS_VAR_SET([gl_next_header],
- ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
- sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
- s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
- s#^/[^/]#//&#
- p
- q
- }'`'"'])
- else
- AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
- fi
- AS_VAR_POPDEF([gl_header_exists])])
+ [m4_if([$2], [check],
+ [AS_VAR_PUSHDEF([gl_header_exists],
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
+ if test AS_VAR_GET(gl_header_exists) = yes; then
+ AS_VAR_POPDEF([gl_header_exists])
+ ])
+ AC_LANG_CONFTEST(
+ [AC_LANG_SOURCE(
+ [[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]]
+ )])
+ dnl AIX "xlc -E" and "cc -E" omit #line directives for header
+ dnl files that contain only a #include of other header files and
+ dnl no non-comment tokens of their own. This leads to a failure
+ dnl to detect the absolute name of <dirent.h>, <signal.h>,
+ dnl <poll.h> and others. The workaround is to force preservation
+ dnl of comments through option -C. This ensures all necessary
+ dnl #line directives are present. GCC supports option -C as well.
+ case "$host_os" in
+ aix*) gl_absname_cpp="$ac_cpp -C" ;;
+ *) gl_absname_cpp="$ac_cpp" ;;
+ esac
+ dnl eval is necessary to expand gl_absname_cpp.
+ dnl Ultrix and Pyramid sh refuse to redirect output of eval,
+ dnl so use subshell.
+ AS_VAR_SET([gl_next_header],
+ ['"'`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+ sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+ s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
+ s#^/[^/]#//&#
+ p
+ q
+ }'`'"'])
+ m4_if([$2], [check],
+ [else
+ AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
+ fi
+ ])
+ ])
fi
AC_SUBST(
AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/lib-ignore.m4 b/m4/lib-ignore.m4
index a67b002c..1fdfdc07 100644
--- a/m4/lib-ignore.m4
+++ b/m4/lib-ignore.m4
@@ -1,6 +1,6 @@
# If possible, ignore libraries that are not depended on.
-dnl Copyright (C) 2006, 2009-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2011 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.
diff --git a/m4/memchr.m4 b/m4/memchr.m4
deleted file mode 100644
index 46db9fb6..00000000
--- a/m4/memchr.m4
+++ /dev/null
@@ -1,88 +0,0 @@
-# memchr.m4 serial 10
-dnl Copyright (C) 2002-2004, 2009-2010 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.
-
-AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
-[
- dnl Check for prerequisites for memory fence checks.
- gl_FUNC_MMAP_ANON
- AC_CHECK_HEADERS_ONCE([sys/mman.h])
- AC_CHECK_FUNCS_ONCE([mprotect])
-
- dnl These days, we assume memchr is present. But just in case...
- AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- AC_CHECK_FUNCS_ONCE([memchr])
- if test $ac_cv_func_memchr = yes; then
- # Detect platform-specific bugs in some versions of glibc:
- # memchr should not dereference anything with length 0
- # http://bugzilla.redhat.com/499689
- # memchr should not dereference overestimated length after a match
- # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
- # http://sourceware.org/bugzilla/show_bug.cgi?id=10162
- # Assume that memchr works on platforms that lack mprotect.
- AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
- [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <string.h>
-#if HAVE_SYS_MMAN_H
-# include <fcntl.h>
-# include <unistd.h>
-# include <sys/types.h>
-# include <sys/mman.h>
-# ifndef MAP_FILE
-# define MAP_FILE 0
-# endif
-#endif
-]], [[
- int result = 0;
- char *fence = NULL;
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
-# if HAVE_MAP_ANONYMOUS
- const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
- const int fd = -1;
-# else /* !HAVE_MAP_ANONYMOUS */
- const int flags = MAP_FILE | MAP_PRIVATE;
- int fd = open ("/dev/zero", O_RDONLY, 0666);
- if (fd >= 0)
-# endif
- {
- int pagesize = getpagesize ();
- char *two_pages =
- (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
- flags, fd, 0);
- if (two_pages != (char *)(-1)
- && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
- fence = two_pages + pagesize;
- }
-#endif
- if (fence)
- {
- if (memchr (fence, 0, 0))
- result |= 1;
- strcpy (fence - 9, "12345678");
- if (memchr (fence - 9, 0, 79) != fence - 1)
- result |= 2;
- if (memchr (fence - 1, 0, 3) != fence - 1)
- result |= 4;
- }
- return result;
-]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
- [dnl Be pessimistic for now.
- gl_cv_func_memchr_works="guessing no"])])
- if test "$gl_cv_func_memchr_works" != yes; then
- REPLACE_MEMCHR=1
- fi
- else
- HAVE_MEMCHR=0
- fi
- if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
- AC_LIBOBJ([memchr])
- gl_PREREQ_MEMCHR
- fi
-])
-
-# Prerequisites of lib/memchr.c.
-AC_DEFUN([gl_PREREQ_MEMCHR], [
- AC_CHECK_HEADERS([bp-sym.h])
-])
diff --git a/m4/mmap-anon.m4 b/m4/mmap-anon.m4
deleted file mode 100644
index e20fc3c6..00000000
--- a/m4/mmap-anon.m4
+++ /dev/null
@@ -1,55 +0,0 @@
-# mmap-anon.m4 serial 9
-dnl Copyright (C) 2005, 2007, 2009-2010 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.
-
-# Detect how mmap can be used to create anonymous (not file-backed) memory
-# mappings.
-# - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
-# and MAP_ANON exist and have the same value.
-# - On HP-UX, only MAP_ANONYMOUS exists.
-# - On MacOS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
-# - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
-# used.
-
-AC_DEFUN([gl_FUNC_MMAP_ANON],
-[
- dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
- AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-
- # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
- # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
- # irrelevant for anonymous mappings.
- AC_CHECK_FUNC([mmap], [gl_have_mmap=yes], [gl_have_mmap=no])
-
- # Try to allow MAP_ANONYMOUS.
- gl_have_mmap_anonymous=no
- if test $gl_have_mmap = yes; then
- AC_MSG_CHECKING([for MAP_ANONYMOUS])
- AC_EGREP_CPP([I cant identify this map.], [
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
- I cant identify this map.
-#endif
-],
- [gl_have_mmap_anonymous=yes])
- if test $gl_have_mmap_anonymous != yes; then
- AC_EGREP_CPP([I cant identify this map.], [
-#include <sys/mman.h>
-#ifdef MAP_ANON
- I cant identify this map.
-#endif
-],
- [AC_DEFINE([MAP_ANONYMOUS], [MAP_ANON],
- [Define to a substitute value for mmap()'s MAP_ANONYMOUS flag.])
- gl_have_mmap_anonymous=yes])
- fi
- AC_MSG_RESULT([$gl_have_mmap_anonymous])
- if test $gl_have_mmap_anonymous = yes; then
- AC_DEFINE([HAVE_MAP_ANONYMOUS], [1],
- [Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
- config.h and <sys/mman.h>.])
- fi
- fi
-])
diff --git a/m4/onceonly.m4 b/m4/onceonly.m4
index 6a9c87b7..223071a2 100644
--- a/m4/onceonly.m4
+++ b/m4/onceonly.m4
@@ -1,5 +1,5 @@
# onceonly.m4 serial 7
-dnl Copyright (C) 2002-2003, 2005-2006, 2008-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2006, 2008-2011 Free Software Foundation,
dnl 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/stddef_h.m4 b/m4/stddef_h.m4
index c3ae5694..1ae23443 100644
--- a/m4/stddef_h.m4
+++ b/m4/stddef_h.m4
@@ -1,6 +1,6 @@
dnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 2
-dnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+# stddef_h.m4 serial 4
+dnl Copyright (C) 2009-2011 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.
@@ -9,6 +9,7 @@ AC_DEFUN([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
AC_REQUIRE([gt_TYPE_WCHAR_T])
+ STDDEF_H=
if test $gt_cv_c_wchar_t = no; then
HAVE_WCHAR_T=0
STDDEF_H=stddef.h
@@ -24,8 +25,10 @@ AC_DEFUN([gl_STDDEF_H],
REPLACE_NULL=1
STDDEF_H=stddef.h
fi
+ AC_SUBST([STDDEF_H])
+ AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
if test -n "$STDDEF_H"; then
- gl_CHECK_NEXT_HEADERS([stddef.h])
+ gl_NEXT_HEADERS([stddef.h])
fi
])
@@ -41,5 +44,4 @@ AC_DEFUN([gl_STDDEF_H_DEFAULTS],
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
- STDDEF_H=''; AC_SUBST([STDDEF_H])
])
diff --git a/m4/string_h.m4 b/m4/string_h.m4
index 5844b2d6..df8c4035 100644
--- a/m4/string_h.m4
+++ b/m4/string_h.m4
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007-2010 Free Software Foundation, Inc.
+# Copyright (C) 2007-2011 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.
-# serial 18
+# serial 20
# Written by Paul Eggert.
@@ -20,7 +20,7 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
[
AC_REQUIRE([AC_C_RESTRICT])
AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
- gl_CHECK_NEXT_HEADERS([string.h])
+ gl_NEXT_HEADERS([string.h])
dnl Check for declarations of anything we want to poison if the
dnl corresponding gnulib module is not in use, and which is not
@@ -104,6 +104,7 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
REPLACE_STRCASESTR=0; AC_SUBST([REPLACE_STRCASESTR])
+ REPLACE_STRCHRNUL=0; AC_SUBST([REPLACE_STRCHRNUL])
REPLACE_STRERROR=0; AC_SUBST([REPLACE_STRERROR])
REPLACE_STRERROR_R=0; AC_SUBST([REPLACE_STRERROR_R])
REPLACE_STRNCAT=0; AC_SUBST([REPLACE_STRNCAT])
diff --git a/m4/strndup.m4 b/m4/strndup.m4
index b3567d89..d8f00cab 100644
--- a/m4/strndup.m4
+++ b/m4/strndup.m4
@@ -1,5 +1,5 @@
# strndup.m4 serial 18
-dnl Copyright (C) 2002-2003, 2005-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2005-2011 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.
diff --git a/m4/strnlen.m4 b/m4/strnlen.m4
index 52bb838f..a1c59ac6 100644
--- a/m4/strnlen.m4
+++ b/m4/strnlen.m4
@@ -1,5 +1,5 @@
# strnlen.m4 serial 12
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2010 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2011 Free Software Foundation,
dnl Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
diff --git a/m4/warn-on-use.m4 b/m4/warn-on-use.m4
index 42daae87..e0d0f276 100644
--- a/m4/warn-on-use.m4
+++ b/m4/warn-on-use.m4
@@ -1,5 +1,5 @@
# warn-on-use.m4 serial 2
-dnl Copyright (C) 2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2011 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.
diff --git a/m4/wchar_t.m4 b/m4/wchar_t.m4
index a133e6ad..d2c03c42 100644
--- a/m4/wchar_t.m4
+++ b/m4/wchar_t.m4
@@ -1,5 +1,5 @@
# wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2010 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2011 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.