[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
texinfo/gnulib lib/Makefile.am lib/errno.in.h l...
From: |
Karl Berry |
Subject: |
texinfo/gnulib lib/Makefile.am lib/errno.in.h l... |
Date: |
Thu, 09 Jul 2009 23:06:57 +0000 |
CVSROOT: /sources/texinfo
Module name: texinfo
Changes by: Karl Berry <karl> 09/07/09 23:06:57
Modified files:
gnulib/lib : Makefile.am errno.in.h getopt1.c gettext.h
strerror.c string.in.h unistd.in.h wchar.in.h
gnulib/m4 : errno_h.m4 gnulib-comp.m4 include_next.m4
lib-link.m4 lib-prefix.m4 mbrtowc.m4 memchr.m4
multiarch.m4 size_max.m4 string_h.m4 wchar.m4
Added files:
gnulib/lib : getpagesize.c memchr.valgrind strstr.c
gnulib/m4 : getpagesize.m4 mmap-anon.m4 strstr.m4
Log message:
gnulib update
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/Makefile.am?cvsroot=texinfo&r1=1.39&r2=1.40
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/errno.in.h?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/getopt1.c?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/gettext.h?cvsroot=texinfo&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/strerror.c?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/string.in.h?cvsroot=texinfo&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/unistd.in.h?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/wchar.in.h?cvsroot=texinfo&r1=1.9&r2=1.10
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/getpagesize.c?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/memchr.valgrind?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/lib/strstr.c?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/errno_h.m4?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/gnulib-comp.m4?cvsroot=texinfo&r1=1.36&r2=1.37
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/include_next.m4?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/lib-link.m4?cvsroot=texinfo&r1=1.11&r2=1.12
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/lib-prefix.m4?cvsroot=texinfo&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/mbrtowc.m4?cvsroot=texinfo&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/memchr.m4?cvsroot=texinfo&r1=1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/multiarch.m4?cvsroot=texinfo&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/size_max.m4?cvsroot=texinfo&r1=1.4&r2=1.5
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/string_h.m4?cvsroot=texinfo&r1=1.10&r2=1.11
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/wchar.m4?cvsroot=texinfo&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/getpagesize.m4?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/mmap-anon.m4?cvsroot=texinfo&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/texinfo/gnulib/m4/strstr.m4?cvsroot=texinfo&rev=1.1
Patches:
Index: lib/Makefile.am
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/Makefile.am,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -b -r1.39 -r1.40
--- lib/Makefile.am 21 Mar 2009 14:31:57 -0000 1.39
+++ lib/Makefile.am 9 Jul 2009 23:06:56 -0000 1.40
@@ -92,7 +92,7 @@
# The Automake-defined pkg* macros are appended, in the order
# listed in the Automake 1.10a+ documentation.
configmake.h: Makefile
- rm -f address@hidden $@
+ rm -f address@hidden
{ echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
echo '#define PREFIX "$(prefix)"'; \
echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
@@ -122,7 +122,12 @@
echo '#define PKGLIBDIR "$(pkglibdir)"'; \
echo '#define PKGLIBEXECDIR "$(pkglibexecdir)"'; \
} | sed '/""/d' > address@hidden
- mv address@hidden $@
+ if test -f $@ && cmp address@hidden $@ > /dev/null; then \
+ rm -f address@hidden; \
+ else \
+ rm -f $@; mv address@hidden $@; \
+ fi
+
BUILT_SOURCES += configmake.h
CLEANFILES += configmake.h configmake.h-t
@@ -192,6 +197,15 @@
## end gnulib module getopt
+## begin gnulib module getpagesize
+
+
+EXTRA_DIST += getpagesize.c
+
+EXTRA_libgnu_a_SOURCES += getpagesize.c
+
+## end gnulib module getpagesize
+
## begin gnulib module gettext
# This is for those projects which use "gettextize --intl" to put a source-code
@@ -260,7 +274,8 @@
charset_alias = $(DESTDIR)$(libdir)/charset.alias
charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
-install-exec-local: all-local
+install-exec-local: install-exec-localcharset
+install-exec-localcharset: all-local
if test $(GLIBC21) = no; then \
case '$(host_os)' in \
darwin[56]*) \
@@ -288,7 +303,8 @@
fi ; \
fi
-uninstall-local: all-local
+uninstall-local: uninstall-localcharset
+uninstall-localcharset: all-local
if test -f $(charset_alias); then \
sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
if grep '^# Packages using this file: $$' $(charset_tmp) \
@@ -410,6 +426,15 @@
## end gnulib module mbuiter
+## begin gnulib module memchr
+
+
+EXTRA_DIST += memchr.c memchr.valgrind
+
+EXTRA_libgnu_a_SOURCES += memchr.c
+
+## end gnulib module memchr
+
## begin gnulib module memcpy
@@ -643,6 +668,7 @@
-e 's|@''GNULIB_MBSSPN''@|$(GNULIB_MBSSPN)|g' \
-e 's|@''GNULIB_MBSSEP''@|$(GNULIB_MBSSEP)|g' \
-e 's|@''GNULIB_MBSTOK_R''@|$(GNULIB_MBSTOK_R)|g' \
+ -e 's|@''GNULIB_MEMCHR''@|$(GNULIB_MEMCHR)|g' \
-e 's|@''GNULIB_MEMMEM''@|$(GNULIB_MEMMEM)|g' \
-e 's|@''GNULIB_MEMPCPY''@|$(GNULIB_MEMPCPY)|g' \
-e 's|@''GNULIB_MEMRCHR''@|$(GNULIB_MEMRCHR)|g' \
@@ -679,6 +705,7 @@
-e 's|@''HAVE_DECL_STRERROR''@|$(HAVE_DECL_STRERROR)|g' \
-e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
-e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
+ -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
-e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
-e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
@@ -719,6 +746,15 @@
## end gnulib module strnlen1
+## begin gnulib module strstr-simple
+
+
+EXTRA_DIST += str-two-way.h strstr.c
+
+EXTRA_libgnu_a_SOURCES += strstr.c
+
+## end gnulib module strstr-simple
+
## begin gnulib module sys_stat
BUILT_SOURCES += $(SYS_STAT_H)
@@ -936,6 +972,7 @@
-e 's|@''REPLACE_MBSNRTOWCS''@|$(REPLACE_MBSNRTOWCS)|g' \
-e 's|@''REPLACE_WCRTOMB''@|$(REPLACE_WCRTOMB)|g' \
-e 's|@''REPLACE_WCSRTOMBS''@|$(REPLACE_WCSRTOMBS)|g' \
+ -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
-e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/wchar.in.h; \
Index: lib/errno.in.h
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/errno.in.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- lib/errno.in.h 7 Nov 2008 18:16:25 -0000 1.2
+++ lib/errno.in.h 9 Jul 2009 23:06:56 -0000 1.3
@@ -1,6 +1,6 @@
/* A POSIX-like <errno.h>.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008-2009 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
@@ -145,6 +145,11 @@
# define GNULIB_defined_ENOTSUP 1
# endif
+# ifndef ESTALE
+# define ESTALE 2009
+# define GNULIB_defined_ESTALE 1
+# endif
+
# ifndef ECANCELED
# define ECANCELED 2008
# define GNULIB_defined_ECANCELED 1
Index: lib/getopt1.c
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/getopt1.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- lib/getopt1.c 26 Nov 2007 19:12:40 -0000 1.3
+++ lib/getopt1.c 9 Jul 2009 23:06:56 -0000 1.4
@@ -1,5 +1,5 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
+ Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006,2009
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -91,7 +91,7 @@
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
- static struct option long_options[] =
+ static const struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
Index: lib/gettext.h
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/gettext.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- lib/gettext.h 26 Nov 2007 19:12:40 -0000 1.6
+++ lib/gettext.h 9 Jul 2009 23:06:56 -0000 1.7
@@ -1,5 +1,5 @@
/* Convenience header for conditional use of GNU <libintl.h>.
- Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
+ Copyright (C) 1995-1998, 2000-2002, 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 General Public License as published by
@@ -63,21 +63,30 @@
for invalid uses of the value returned from these functions.
On pre-ANSI systems without 'const', the config.h file is supposed to
contain "#define const". */
+# undef gettext
# define gettext(Msgid) ((const char *) (Msgid))
+# undef dgettext
# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# undef dcgettext
# define dcgettext(Domainname, Msgid, Category) \
((void) (Category), dgettext (Domainname, Msgid))
+# undef ngettext
# define ngettext(Msgid1, Msgid2, N) \
((N) == 1 \
? ((void) (Msgid2), (const char *) (Msgid1)) \
: ((void) (Msgid1), (const char *) (Msgid2)))
+# undef dngettext
# define dngettext(Domainname, Msgid1, Msgid2, N) \
((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# undef dcngettext
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+# undef textdomain
# define textdomain(Domainname) ((const char *) (Domainname))
+# undef bindtextdomain
# define bindtextdomain(Domainname, Dirname) \
((void) (Domainname), (const char *) (Dirname))
+# undef bind_textdomain_codeset
# define bind_textdomain_codeset(Domainname, Codeset) \
((void) (Domainname), (const char *) (Codeset))
Index: lib/strerror.c
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/strerror.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- lib/strerror.c 21 Mar 2009 14:32:00 -0000 1.7
+++ lib/strerror.c 9 Jul 2009 23:06:56 -0000 1.8
@@ -313,7 +313,13 @@
break;
# endif
-# if GNULIB_defined_
+# if GNULIB_defined_ESTALE
+ case ESTALE:
+ msg = "Stale NFS file handle";
+ break;
+# endif
+
+# if GNULIB_defined_ECANCELED
case ECANCELED:
msg = "Operation canceled";
break;
Index: lib/string.in.h
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/string.in.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- lib/string.in.h 7 Nov 2008 18:16:27 -0000 1.5
+++ lib/string.in.h 9 Jul 2009 23:06:56 -0000 1.6
@@ -1,6 +1,6 @@
/* A GNU-like <string.h>.
- Copyright (C) 1995-1996, 2001-2008 Free Software Foundation, Inc.
+ Copyright (C) 1995-1996, 2001-2009 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
@@ -49,6 +49,21 @@
#endif
+/* Return the first instance of C within N bytes of S, or NULL. */
+#if @GNULIB_MEMCHR@
+# if @REPLACE_MEMCHR@
+# define memchr rpl_memchr
+extern void *memchr (void const *__s, int __c, size_t __n)
+ __attribute__ ((__pure__));
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef memchr
+# define memchr(s,c,n) \
+ (GL_LINK_WARNING ("memchr has platform-specific bugs - " \
+ "use gnulib module memchr for portability" ), \
+ memchr (s, c, n))
+#endif
+
/* Return the first occurrence of NEEDLE in HAYSTACK. */
#if @GNULIB_MEMMEM@
# if @REPLACE_MEMMEM@
Index: lib/unistd.in.h
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/unistd.in.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- lib/unistd.in.h 21 Mar 2009 14:32:00 -0000 1.7
+++ lib/unistd.in.h 9 Jul 2009 23:06:56 -0000 1.8
@@ -131,10 +131,6 @@
#if @GNULIB_CLOSE@
-# if @UNISTD_H_HAVE_WINSOCK2_H@
-/* Need a gnulib internal function. */
-# define HAVE__GL_CLOSE_FD_MAYBE_SOCKET 1
-# endif
# if @REPLACE_CLOSE@
/* Automatically included by modules that need a replacement for close. */
# undef close
Index: lib/wchar.in.h
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/lib/wchar.in.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -b -r1.9 -r1.10
--- lib/wchar.in.h 21 Mar 2009 14:32:00 -0000 1.9
+++ lib/wchar.in.h 9 Jul 2009 23:06:56 -0000 1.10
@@ -264,7 +264,11 @@
/* Convert a wide string to a string. */
#if @GNULIB_WCSNRTOMBS@
-# if address@hidden@
+# if @REPLACE_WCSNRTOMBS@
+# undef wcsnrtombs
+# define wcsnrtombs rpl_wcsnrtombs
+# endif
+# if address@hidden@ || @REPLACE_WCSNRTOMBS@
extern size_t wcsnrtombs (char *dest, const wchar_t **srcp, size_t srclen,
size_t len, mbstate_t *ps);
# endif
#elif defined GNULIB_POSIXCHECK
Index: m4/errno_h.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/errno_h.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- m4/errno_h.m4 21 Mar 2009 14:32:15 -0000 1.3
+++ m4/errno_h.m4 9 Jul 2009 23:06:57 -0000 1.4
@@ -1,10 +1,9 @@
-# errno_h.m4 serial 4
+# errno_h.m4 serial 6
dnl Copyright (C) 2004, 2006, 2008, 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 macro must pass through AC_REQUIRE (never directly invoke it).
AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
[
AC_REQUIRE([AC_PROG_CC])
@@ -35,6 +34,9 @@
#if !defined ENOTSUP
booboo
#endif
+#if !defined ESTALE
+booboo
+#endif
#if !defined ECANCELED
booboo
#endif
Index: m4/gnulib-comp.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/gnulib-comp.m4,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -b -r1.36 -r1.37
--- m4/gnulib-comp.m4 21 Mar 2009 14:32:16 -0000 1.36
+++ m4/gnulib-comp.m4 9 Jul 2009 23:06:57 -0000 1.37
@@ -48,13 +48,15 @@
gl_FUNC_ARGZ
gl_ENVIRON
gl_UNISTD_MODULE_INDICATOR([environ])
- AC_REQUIRE([gl_HEADER_ERRNO_H])
+ gl_HEADER_ERRNO_H
gl_ERROR
m4_ifdef([AM_XGETTEXT_OPTION],
[AM_XGETTEXT_OPTION([--flag=error:3:c-format])
AM_XGETTEXT_OPTION([--flag=error_at_line:5:c-format])])
gl_EXITFAIL
gl_GETOPT
+ gl_FUNC_GETPAGESIZE
+ gl_UNISTD_MODULE_INDICATOR([getpagesize])
dnl you must add AM_GNU_GETTEXT([external]) or similar to configure.ac.
AM_GNU_GETTEXT_VERSION([0.17])
AC_SUBST([LIBINTL])
@@ -80,6 +82,8 @@
gl_STRING_MODULE_INDICATOR([mbsstr])
gl_MBSWIDTH
gl_MBITER
+ gl_FUNC_MEMCHR
+ gl_STRING_MODULE_INDICATOR([memchr])
gl_FUNC_MEMCPY
gl_FUNC_MEMMEM
gl_FUNC_MEMMEM_SIMPLE
@@ -89,7 +93,7 @@
gl_STRING_MODULE_INDICATOR([mempcpy])
gl_FUNC_MKSTEMP
gl_STDLIB_MODULE_INDICATOR([mkstemp])
- AC_REQUIRE([gl_MULTIARCH])
+ gl_MULTIARCH
gl_FUNC_SETENV
gl_STDLIB_MODULE_INDICATOR([setenv])
AM_STDBOOL_H
@@ -106,6 +110,9 @@
gl_STRING_MODULE_INDICATOR([strndup])
gl_FUNC_STRNLEN
gl_STRING_MODULE_INDICATOR([strnlen])
+ gl_FUNC_STRSTR
+ gl_FUNC_STRSTR_SIMPLE
+ gl_STRING_MODULE_INDICATOR([strstr])
gl_HEADER_SYS_STAT_H
AC_PROG_MKDIR_P
gl_HEADER_SYS_TIME_H
@@ -266,6 +273,7 @@
lib/getopt.in.h
lib/getopt1.c
lib/getopt_int.h
+ lib/getpagesize.c
lib/gettext.h
lib/gettimeofday.c
lib/intprops.h
@@ -288,6 +296,8 @@
lib/mbswidth.c
lib/mbswidth.h
lib/mbuiter.h
+ lib/memchr.c
+ lib/memchr.valgrind
lib/memcpy.c
lib/memmem.c
lib/memmove.c
@@ -310,6 +320,7 @@
lib/strnlen.c
lib/strnlen1.c
lib/strnlen1.h
+ lib/strstr.c
lib/sys_stat.in.h
lib/sys_time.in.h
lib/tempname.c
@@ -340,6 +351,7 @@
m4/exitfail.m4
m4/extensions.m4
m4/getopt.m4
+ m4/getpagesize.m4
m4/gettext.m4
m4/gettimeofday.m4
m4/glibc2.m4
@@ -373,11 +385,13 @@
m4/mbsinit.m4
m4/mbstate_t.m4
m4/mbswidth.m4
+ m4/memchr.m4
m4/memcpy.m4
m4/memmem.m4
m4/memmove.m4
m4/mempcpy.m4
m4/mkstemp.m4
+ m4/mmap-anon.m4
m4/multiarch.m4
m4/nls.m4
m4/onceonly.m4
@@ -396,6 +410,7 @@
m4/string_h.m4
m4/strndup.m4
m4/strnlen.m4
+ m4/strstr.m4
m4/sys_stat_h.m4
m4/sys_time_h.m4
m4/tempname.m4
Index: m4/include_next.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/include_next.m4,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- m4/include_next.m4 21 Mar 2009 14:32:17 -0000 1.7
+++ m4/include_next.m4 9 Jul 2009 23:06:57 -0000 1.8
@@ -1,4 +1,4 @@
-# include_next.m4 serial 12
+# include_next.m4 serial 14
dnl Copyright (C) 2006-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,
@@ -104,8 +104,14 @@
# For each arg foo.h, if #include_next works, define NEXT_FOO_H to be
# '<foo.h>'; otherwise define it to be
# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
+# Also, if #include_next works as first preprocessing directive in a file,
+# define NEXT_AS_FIRST_DIRECTIVE_FOO_H to be '<foo.h>'; otherwise define it to
+# be
+# '"///usr/include/foo.h"', or whatever other absolute file name is suitable.
# That way, a header file with the following line:
# address@hidden@ @NEXT_FOO_H@
+# or
+# address@hidden@ @NEXT_AS_FIRST_DIRECTIVE_FOO_H@
# behaves (after sed substitution) as if it contained
# #include_next <foo.h>
# even if the compiler does not support include_next.
@@ -123,15 +129,15 @@
m4_foreach_w([gl_HEADER_NAME], [$1],
[AS_VAR_PUSHDEF([gl_next_header],
- [gl_cv_next_]m4_quote(m4_defn([gl_HEADER_NAME])))
+ [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
if test $gl_cv_have_include_next = yes; then
AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
else
AC_CACHE_CHECK(
- [absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
- m4_quote(m4_defn([gl_next_header])),
+ [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
+ m4_defn([gl_next_header]),
[AS_VAR_PUSHDEF([gl_header_exists],
- [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))
+ [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
if test AS_VAR_GET(gl_header_exists) = yes; then
AC_LANG_CONFTEST(
[AC_LANG_SOURCE(
@@ -153,8 +159,8 @@
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_quote(m4_defn([gl_HEADER_NAME]))[#{
- s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#
+ sed -n '\#/]m4_defn([gl_HEADER_NAME])[#{
+ s#.*"\(.*/]m4_defn([gl_HEADER_NAME])[\)".*#\1#
s#^/[^/]#//&#
p
q
@@ -165,7 +171,17 @@
AS_VAR_POPDEF([gl_header_exists])])
fi
AC_SUBST(
- AS_TR_CPP([NEXT_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+ AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
[AS_VAR_GET([gl_next_header])])
+ if test $gl_cv_have_include_next = yes || test $gl_cv_have_include_next =
buggy; then
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include_next'
+ gl_next_as_first_directive='<'gl_HEADER_NAME'>'
+ else
+ # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+ gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
+ fi
+ AC_SUBST(
+ AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
+ [$gl_next_as_first_directive])
AS_VAR_POPDEF([gl_next_header])])
])
Index: m4/lib-link.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/lib-link.m4,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- m4/lib-link.m4 21 Mar 2009 14:32:18 -0000 1.11
+++ m4/lib-link.m4 9 Jul 2009 23:06:57 -0000 1.12
@@ -1,4 +1,4 @@
-# lib-link.m4 serial 18 (gettext-0.18)
+# lib-link.m4 serial 20 (gettext-0.18)
dnl Copyright (C) 2001-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,
@@ -43,12 +43,13 @@
popdef([Name])
])
-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode,
[missing-message])
dnl searches for libname and the libraries corresponding to explicit and
dnl implicit dependencies, together with the specified include files and
-dnl the ability to compile and link the specified testcode. If found, it
-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl the ability to compile and link the specified testcode. The missing-message
+dnl defaults to 'no' and may contain additional hints for the user.
+dnl If found, it sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME}
+dnl and LTLIB${NAME} variables and augments the CPPFLAGS variable, and
dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
@@ -74,12 +75,14 @@
AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
ac_save_LIBS="$LIBS"
LIBS="$LIBS $LIB[]NAME"
- AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+ AC_TRY_LINK([$3], [$4],
+ [ac_cv_lib[]Name=yes],
+ [ac_cv_lib[]Name='m4_if([$5], [], [no], [[$5]])'])
LIBS="$ac_save_LIBS"
])
if test "$ac_cv_lib[]Name" = yes; then
HAVE_LIB[]NAME=yes
- AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+ AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the lib][$1 library.])
AC_MSG_CHECKING([how to link with lib[]$1])
AC_MSG_RESULT([$LIB[]NAME])
else
@@ -207,6 +210,9 @@
LTLIB[]NAME=
INC[]NAME=
LIB[]NAME[]_PREFIX=
+ dnl HAVE_LIB${NAME} is an indicator that LIB${NAME}, LTLIB${NAME} have been
+ dnl computed. So it has to be reset here.
+ HAVE_LIB[]NAME=
rpathdirs=
ltrpathdirs=
names_already_handled=
Index: m4/lib-prefix.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/lib-prefix.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- m4/lib-prefix.m4 27 Sep 2008 13:13:50 -0000 1.2
+++ m4/lib-prefix.m4 9 Jul 2009 23:06:57 -0000 1.3
@@ -1,5 +1,5 @@
-# lib-prefix.m4 serial 6 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 7 (gettext-0.18)
+dnl Copyright (C) 2001-2005, 2008-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.
@@ -206,6 +206,9 @@
if test -d "$searchdir"; then
case "$searchdir" in
*/lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+ */../ | */.. )
+ # Better ignore directories of this form. They are misleading.
+ ;;
*) searchdir=`cd "$searchdir" && pwd`
case "$searchdir" in
*/lib64 ) acl_libdirstem=lib64 ;;
Index: m4/mbrtowc.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/mbrtowc.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- m4/mbrtowc.m4 21 Mar 2009 14:32:20 -0000 1.4
+++ m4/mbrtowc.m4 9 Jul 2009 23:06:57 -0000 1.5
@@ -1,4 +1,4 @@
-# mbrtowc.m4 serial 14
+# mbrtowc.m4 serial 16
dnl Copyright (C) 2001-2002, 2004-2005, 2008, 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,
@@ -127,7 +127,7 @@
}],
[gl_cv_func_mbrtowc_incomplete_state=yes],
[gl_cv_func_mbrtowc_incomplete_state=no],
- [])
+ [:])
fi
])
])
@@ -156,6 +156,7 @@
if test $LOCALE_ZH_CN != none; then
AC_TRY_RUN([
#include <locale.h>
+#include <stdlib.h>
#include <string.h>
#include <wchar.h>
int main ()
@@ -178,7 +179,7 @@
}],
[gl_cv_func_mbrtowc_sanitycheck=yes],
[gl_cv_func_mbrtowc_sanitycheck=no],
- [])
+ [:])
fi
])
])
@@ -225,7 +226,7 @@
return 1;
}
return 0;
-}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [])
+}], [gl_cv_func_mbrtowc_null_arg=yes], [gl_cv_func_mbrtowc_null_arg=no], [:])
fi
])
])
@@ -295,7 +296,7 @@
}],
[gl_cv_func_mbrtowc_retval=yes],
[gl_cv_func_mbrtowc_retval=no],
- [])
+ [:])
fi
])
])
@@ -342,7 +343,7 @@
}],
[gl_cv_func_mbrtowc_nul_retval=yes],
[gl_cv_func_mbrtowc_nul_retval=no],
- [])
+ [:])
fi
])
])
Index: m4/memchr.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/memchr.m4,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- m4/memchr.m4 18 Jun 2006 23:39:43 -0000 1.1
+++ m4/memchr.m4 9 Jul 2009 23:06:57 -0000 1.2
@@ -1,18 +1,86 @@
-# memchr.m4 serial 4
-dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+# memchr.m4 serial 7
+dnl Copyright (C) 2002, 2003, 2004, 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.
-AC_DEFUN([gl_FUNC_MEMCHR],
+AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
[
- AC_REPLACE_FUNCS(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_REPLACE_FUNCS([memchr])
if test $ac_cv_func_memchr = no; then
gl_PREREQ_MEMCHR
+ REPLACE_MEMCHR=1
+ fi
+
+ 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
+]], [[
+ 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))
+ return 1;
+ strcpy (fence - 9, "12345678");
+ if (memchr (fence - 9, 0, 79) != fence - 1)
+ return 2;
+ }
+ return 0;
+]])], [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
+ gl_PREREQ_MEMCHR
+ REPLACE_MEMCHR=1
+ AC_LIBOBJ([memchr])
+ fi
fi
])
# Prerequisites of lib/memchr.c.
AC_DEFUN([gl_PREREQ_MEMCHR], [
- AC_CHECK_HEADERS(bp-sym.h)
+ AC_CHECK_HEADERS([bp-sym.h])
])
Index: m4/multiarch.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/multiarch.m4,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- m4/multiarch.m4 21 Mar 2009 14:32:21 -0000 1.3
+++ m4/multiarch.m4 9 Jul 2009 23:06:57 -0000 1.4
@@ -1,4 +1,4 @@
-# multiarch.m4 serial 4
+# multiarch.m4 serial 5
dnl Copyright (C) 2008, 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,
@@ -19,7 +19,6 @@
# Detect this situation and set the macro AA_APPLE_UNIVERSAL_BUILD at the
# beginning of config.h and set APPLE_UNIVERSAL_BUILD accordingly.
-dnl This macro must pass through AC_REQUIRE (never directly invoke it).
AC_DEFUN_ONCE([gl_MULTIARCH],
[
dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
Index: m4/size_max.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/size_max.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -b -r1.4 -r1.5
--- m4/size_max.m4 12 Jan 2009 13:52:41 -0000 1.4
+++ m4/size_max.m4 9 Jul 2009 23:06:57 -0000 1.5
@@ -1,5 +1,5 @@
-# size_max.m4 serial 7
-dnl Copyright (C) 2003, 2005-2006, 2008 Free Software Foundation, Inc.
+# size_max.m4 serial 9
+dnl Copyright (C) 2003, 2005-2006, 2008-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.
@@ -10,8 +10,7 @@
[
AC_CHECK_HEADERS([stdint.h])
dnl First test whether the system already has SIZE_MAX.
- AC_MSG_CHECKING([for SIZE_MAX])
- AC_CACHE_VAL([gl_cv_size_max], [
+ AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
gl_cv_size_max=
AC_EGREP_CPP([Found it], [
#include <limits.h>
@@ -54,11 +53,19 @@
fi
fi
])
- AC_MSG_RESULT([$gl_cv_size_max])
if test "$gl_cv_size_max" != yes; then
AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
[Define as the maximum value of type 'size_t', if the system doesn't
define it.])
fi
+ dnl Don't redefine SIZE_MAX in config.h if config.h is re-included after
+ dnl <stdint.h>. Remember that the #undef in AH_VERBATIM gets replaced with
+ dnl #define by AC_DEFINE_UNQUOTED.
+ AH_VERBATIM([SIZE_MAX],
+[/* Define as the maximum value of type 'size_t', if the system doesn't define
+ it. */
+#ifndef SIZE_MAX
+# undef SIZE_MAX
+#endif])
])
dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
Index: m4/string_h.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/string_h.m4,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- m4/string_h.m4 27 Sep 2008 13:13:50 -0000 1.10
+++ m4/string_h.m4 9 Jul 2009 23:06:57 -0000 1.11
@@ -1,11 +1,11 @@
# Configure a GNU-like replacement for <string.h>.
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 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.
-# serial 6
+# serial 7
# Written by Paul Eggert.
@@ -32,6 +32,7 @@
AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
[
+ GNULIB_MEMCHR=0; AC_SUBST([GNULIB_MEMCHR])
GNULIB_MEMMEM=0; AC_SUBST([GNULIB_MEMMEM])
GNULIB_MEMPCPY=0; AC_SUBST([GNULIB_MEMPCPY])
GNULIB_MEMRCHR=0; AC_SUBST([GNULIB_MEMRCHR])
@@ -83,6 +84,7 @@
HAVE_DECL_STRERROR=1; AC_SUBST([HAVE_DECL_STRERROR])
HAVE_DECL_STRSIGNAL=1; AC_SUBST([HAVE_DECL_STRSIGNAL])
HAVE_STRVERSCMP=1; AC_SUBST([HAVE_STRVERSCMP])
+ REPLACE_MEMCHR=0; AC_SUBST([REPLACE_MEMCHR])
REPLACE_MEMMEM=0; AC_SUBST([REPLACE_MEMMEM])
REPLACE_STRDUP=0; AC_SUBST([REPLACE_STRDUP])
REPLACE_STRSTR=0; AC_SUBST([REPLACE_STRSTR])
Index: m4/wchar.m4
===================================================================
RCS file: /sources/texinfo/texinfo/gnulib/m4/wchar.m4,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- m4/wchar.m4 29 Dec 2008 14:31:31 -0000 1.7
+++ m4/wchar.m4 9 Jul 2009 23:06:57 -0000 1.8
@@ -1,13 +1,13 @@
dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
-dnl Copyright (C) 2007-2008 Free Software Foundation, Inc.
+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.
dnl Written by Eric Blake.
-# wchar.m4 serial 22
+# wchar.m4 serial 23
AC_DEFUN([gl_WCHAR_H],
[
@@ -91,9 +91,10 @@
REPLACE_MBRTOWC=0; AC_SUBST([REPLACE_MBRTOWC])
REPLACE_MBRLEN=0; AC_SUBST([REPLACE_MBRLEN])
REPLACE_MBSRTOWCS=0; AC_SUBST([REPLACE_MBSRTOWCS])
- REPLACE_MBSNRTOWCS=0;AC_SUBST([REPLACE_MBSNRTOWCS])
+ REPLACE_MBSNRTOWCS=0; AC_SUBST([REPLACE_MBSNRTOWCS])
REPLACE_WCRTOMB=0; AC_SUBST([REPLACE_WCRTOMB])
REPLACE_WCSRTOMBS=0; AC_SUBST([REPLACE_WCSRTOMBS])
+ REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH])
WCHAR_H=''; AC_SUBST([WCHAR_H])
])
Index: lib/getpagesize.c
===================================================================
RCS file: lib/getpagesize.c
diff -N lib/getpagesize.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/getpagesize.c 9 Jul 2009 23:06:56 -0000 1.1
@@ -0,0 +1,39 @@
+/* getpagesize emulation for systems where it cannot be done in a C macro.
+
+ Copyright (C) 2007 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 3 of the License, 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, see <http://www.gnu.org/licenses/>. */
+
+/* Written by Bruno Haible and Martin Lambers. */
+
+#include <config.h>
+
+/* Specification. */
+#include <unistd.h>
+
+/* This implementation is only for native Win32 systems. */
+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+int
+getpagesize (void)
+{
+ SYSTEM_INFO system_info;
+ GetSystemInfo (&system_info);
+ return system_info.dwPageSize;
+}
+
+#endif
Index: lib/memchr.valgrind
===================================================================
RCS file: lib/memchr.valgrind
diff -N lib/memchr.valgrind
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/memchr.valgrind 9 Jul 2009 23:06:56 -0000 1.1
@@ -0,0 +1,14 @@
+# 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
+}
Index: lib/strstr.c
===================================================================
RCS file: lib/strstr.c
diff -N lib/strstr.c
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lib/strstr.c 9 Jul 2009 23:06:56 -0000 1.1
@@ -0,0 +1,83 @@
+/* Copyright (C) 1991,92,93,94,96,97,98,2000,2004,2007,2008 Free Software
+ Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ 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, 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* This particular implementation was written by Eric Blake, 2008. */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Specification of strstr. */
+#include <string.h>
+
+#include <stdbool.h>
+
+#ifndef _LIBC
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+#define RETURN_TYPE char *
+#define AVAILABLE(h, h_l, j, n_l) \
+ (!memchr ((h) + (h_l), '\0', (j) + (n_l) - (h_l)) \
+ && ((h_l) = (j) + (n_l)))
+#include "str-two-way.h"
+
+/* Return the first occurrence of NEEDLE in HAYSTACK. Return HAYSTACK
+ if NEEDLE is empty, otherwise NULL if NEEDLE is not found in
+ HAYSTACK. */
+char *
+strstr (const char *haystack_start, const char *needle_start)
+{
+ const char *haystack = haystack_start;
+ const char *needle = needle_start;
+ size_t needle_len; /* Length of NEEDLE. */
+ size_t haystack_len; /* Known minimum length of HAYSTACK. */
+ bool ok = true; /* True if NEEDLE is prefix of HAYSTACK. */
+
+ /* Determine length of NEEDLE, and in the process, make sure
+ HAYSTACK is at least as long (no point processing all of a long
+ NEEDLE if HAYSTACK is too short). */
+ while (*haystack && *needle)
+ ok &= *haystack++ == *needle++;
+ if (*needle)
+ return NULL;
+ if (ok)
+ return (char *) haystack_start;
+
+ /* Reduce the size of haystack using strchr, since it has a smaller
+ linear coefficient than the Two-Way algorithm. */
+ needle_len = needle - needle_start;
+ haystack = strchr (haystack_start + 1, *needle_start);
+ if (!haystack || __builtin_expect (needle_len == 1, 0))
+ return (char *) haystack;
+ needle -= needle_len;
+ haystack_len = (haystack > haystack_start + needle_len ? 1
+ : needle_len + haystack_start - haystack);
+
+ /* Perform the search. Abstract memory is considered to be an array
+ of 'unsigned char' values, not an array of 'char' values. See
+ ISO C 99 section 6.2.6.1. */
+ if (needle_len < LONG_NEEDLE_THRESHOLD)
+ return two_way_short_needle ((const unsigned char *) haystack,
+ haystack_len,
+ (const unsigned char *) needle, needle_len);
+ return two_way_long_needle ((const unsigned char *) haystack, haystack_len,
+ (const unsigned char *) needle, needle_len);
+}
+
+#undef LONG_NEEDLE_THRESHOLD
Index: m4/getpagesize.m4
===================================================================
RCS file: m4/getpagesize.m4
diff -N m4/getpagesize.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m4/getpagesize.m4 9 Jul 2009 23:06:57 -0000 1.1
@@ -0,0 +1,29 @@
+# getpagesize.m4 serial 7
+dnl Copyright (C) 2002, 2004-2005, 2007 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([gl_FUNC_GETPAGESIZE],
+[
+ AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST])
+ AC_CHECK_FUNCS([getpagesize])
+ if test $ac_cv_func_getpagesize = no; then
+ HAVE_GETPAGESIZE=0
+ AC_CHECK_HEADERS([OS.h])
+ if test $ac_cv_header_OS_h = yes; then
+ HAVE_OS_H=1
+ fi
+ AC_CHECK_HEADERS([sys/param.h])
+ if test $ac_cv_header_sys_param_h = yes; then
+ HAVE_SYS_PARAM_H=1
+ fi
+ fi
+ case "$host_os" in
+ mingw*)
+ REPLACE_GETPAGESIZE=1
+ AC_LIBOBJ([getpagesize])
+ ;;
+ esac
+])
Index: m4/mmap-anon.m4
===================================================================
RCS file: m4/mmap-anon.m4
diff -N m4/mmap-anon.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m4/mmap-anon.m4 9 Jul 2009 23:06:57 -0000 1.1
@@ -0,0 +1,59 @@
+# mmap-anon.m4 serial 8
+dnl Copyright (C) 2005, 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.
+
+# 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 Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+ AC_REQUIRE([AC_PROG_CPP])
+ AC_REQUIRE([AC_PROG_EGREP])
+
+ 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
+])
Index: m4/strstr.m4
===================================================================
RCS file: m4/strstr.m4
diff -N m4/strstr.m4
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ m4/strstr.m4 9 Jul 2009 23:06:57 -0000 1.1
@@ -0,0 +1,77 @@
+# strstr.m4 serial 6
+dnl Copyright (C) 2008, 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 Check that strstr works.
+AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
+[
+ AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+ AC_REQUIRE([gl_FUNC_MEMCHR])
+ if test "$gl_cv_func_memchr_works" != yes; then
+ REPLACE_STRSTR=1
+ AC_LIBOBJ([strstr])
+ fi
+]) # gl_FUNC_STRSTR_SIMPLE
+
+dnl Additionally, check that strstr is efficient.
+AC_DEFUN([gl_FUNC_STRSTR],
+[
+ AC_REQUIRE([gl_FUNC_STRSTR_SIMPLE])
+ if test $REPLACE_STRSTR = 0; then
+ AC_CACHE_CHECK([whether strstr works in linear time],
+ [gl_cv_func_strstr_linear],
+ [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <signal.h> /* for signal */
+#include <string.h> /* for memmem */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+]], [[size_t m = 1000000;
+ char *haystack = (char *) malloc (2 * m + 2);
+ char *needle = (char *) malloc (m + 2);
+ void *result = 0;
+ /* Failure to compile this test due to missing alarm is okay,
+ since all such platforms (mingw) also have quadratic strstr. */
+ signal (SIGALRM, SIG_DFL);
+ alarm (5);
+ /* Check for quadratic performance. */
+ if (haystack && needle)
+ {
+ memset (haystack, 'A', 2 * m);
+ haystack[2 * m] = 'B';
+ haystack[2 * m + 1] = 0;
+ memset (needle, 'A', m);
+ needle[m] = 'B';
+ needle[m + 1] = 0;
+ result = strstr (haystack, needle);
+ }
+ return !result;]])],
+ [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
+ [dnl Only glibc >= 2.9 and cygwin >= 1.7.0 are known to have a
+ dnl strstr that works in linear time.
+ AC_EGREP_CPP([Lucky user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 9) || (__GLIBC__ > 2)
+ Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_MAJOR >= 1007
+ Lucky user
+ #endif
+#endif
+ ],
+ [gl_cv_func_strstr_linear=yes],
+ [gl_cv_func_strstr_linear="guessing no"])
+ ])
+ ])
+ if test "$gl_cv_func_strstr_linear" != yes; then
+ REPLACE_STRSTR=1
+ AC_LIBOBJ([strstr])
+ fi
+ fi
+]) # gl_FUNC_STRSTR
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- texinfo/gnulib lib/Makefile.am lib/errno.in.h l...,
Karl Berry <=