New upstream version 2.3.4
This commit is contained in:
parent
e7bdd1c6c6
commit
de72f6f588
556 changed files with 90432 additions and 53391 deletions
|
@ -1,5 +1,5 @@
|
|||
# strstr.m4 serial 16
|
||||
dnl Copyright (C) 2008-2013 Free Software Foundation, Inc.
|
||||
# strstr.m4 serial 24
|
||||
dnl Copyright (C) 2008-2023 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.
|
||||
|
@ -7,30 +7,40 @@ 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_STRING_H_DEFAULTS])
|
||||
AC_REQUIRE([gl_FUNC_MEMCHR])
|
||||
if test "$gl_cv_func_memchr_works" != yes; then
|
||||
if test $REPLACE_MEMCHR = 1; then
|
||||
REPLACE_STRSTR=1
|
||||
else
|
||||
dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
|
||||
dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
|
||||
dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637.
|
||||
AC_CACHE_CHECK([whether strstr works],
|
||||
[gl_cv_func_strstr_works_always],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#include <string.h> /* for strstr */
|
||||
[AC_RUN_IFELSE(
|
||||
[AC_LANG_PROGRAM([[
|
||||
#include <string.h> /* for __GNU_LIBRARY__, strstr */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <features.h>
|
||||
#if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
|
||||
Unlucky user
|
||||
#endif
|
||||
#endif
|
||||
#define P "_EF_BF_BD"
|
||||
#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
|
||||
#define NEEDLE P P P P P
|
||||
]], [[return !!strstr (HAYSTACK, NEEDLE);
|
||||
]])],
|
||||
[gl_cv_func_strstr_works_always=yes],
|
||||
[gl_cv_func_strstr_works_always=no],
|
||||
[dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not
|
||||
dnl affected, since it uses different source code for strstr than
|
||||
dnl glibc.
|
||||
dnl Assume that it works on all other platforms, even if it is not
|
||||
dnl linear.
|
||||
AC_EGREP_CPP([Lucky user],
|
||||
[
|
||||
]],
|
||||
[[return !!strstr (HAYSTACK, NEEDLE);
|
||||
]])],
|
||||
[gl_cv_func_strstr_works_always=yes],
|
||||
[gl_cv_func_strstr_works_always=no],
|
||||
[dnl glibc 2.12 and cygwin 1.7.7 have a known bug. uClibc is not
|
||||
dnl affected, since it uses different source code for strstr than
|
||||
dnl glibc.
|
||||
dnl Assume that it works on all other platforms, even if it is not
|
||||
dnl linear.
|
||||
AC_EGREP_CPP([Lucky user],
|
||||
[
|
||||
#include <string.h> /* for __GNU_LIBRARY__ */
|
||||
#ifdef __GNU_LIBRARY__
|
||||
#include <features.h>
|
||||
#if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
|
||||
|
@ -45,10 +55,10 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
|
|||
#else
|
||||
Lucky user
|
||||
#endif
|
||||
],
|
||||
[gl_cv_func_strstr_works_always="guessing yes"],
|
||||
[gl_cv_func_strstr_works_always="guessing no"])
|
||||
])
|
||||
],
|
||||
[gl_cv_func_strstr_works_always="guessing yes"],
|
||||
[gl_cv_func_strstr_works_always="$gl_cross_guess_normal"])
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_strstr_works_always" in
|
||||
*yes) ;;
|
||||
|
@ -67,11 +77,17 @@ AC_DEFUN([gl_FUNC_STRSTR],
|
|||
AC_CACHE_CHECK([whether strstr works in linear time],
|
||||
[gl_cv_func_strstr_linear],
|
||||
[AC_RUN_IFELSE([AC_LANG_PROGRAM([[
|
||||
#ifdef __MVS__
|
||||
/* z/OS does not deliver signals while strstr() is running (thanks to
|
||||
restrictions on its LE runtime), which prevents us from limiting the
|
||||
running time of this test. */
|
||||
# error "This test does not work properly on z/OS"
|
||||
#endif
|
||||
#include <signal.h> /* for signal */
|
||||
#include <string.h> /* for strstr */
|
||||
#include <stdlib.h> /* for malloc */
|
||||
#include <unistd.h> /* for alarm */
|
||||
static void quit (int sig) { exit (sig + 128); }
|
||||
static void quit (int sig) { _exit (sig + 128); }
|
||||
]], [[
|
||||
int result = 0;
|
||||
size_t m = 1000000;
|
||||
|
@ -93,6 +109,9 @@ static void quit (int sig) { exit (sig + 128); }
|
|||
if (!strstr (haystack, needle))
|
||||
result |= 1;
|
||||
}
|
||||
/* Free allocated memory, in case some sanitizer is watching. */
|
||||
free (haystack);
|
||||
free (needle);
|
||||
return result;
|
||||
]])],
|
||||
[gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
|
||||
|
@ -117,7 +136,7 @@ static void quit (int sig) { exit (sig + 128); }
|
|||
#endif
|
||||
],
|
||||
[gl_cv_func_strstr_linear="guessing yes"],
|
||||
[gl_cv_func_strstr_linear="guessing no"])
|
||||
[gl_cv_func_strstr_linear="$gl_cross_guess_normal"])
|
||||
])
|
||||
])
|
||||
case "$gl_cv_func_strstr_linear" in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue