diff options
author | Eric Blake <ebb9@byu.net> | 2009-06-16 06:14:05 -0600 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-06-17 07:24:16 -0600 |
commit | e3e47d1710f6154c54b65c5d9dd5d56516a893d6 (patch) | |
tree | 545d55fbd549ae6aa3a4bbec53bcf8cd80dd38cc /m4/strcasestr.m4 | |
parent | ea5142f7369225f5aef66f89f9b9d1421c6dceff (diff) | |
download | gnulib-e3e47d1710f6154c54b65c5d9dd5d56516a893d6.tar.gz |
strstr, strcasestr: replace on platforms with broken memchr
* modules/strstr: Split into...
* modules/strstr-simple: ...new module that does not care about
performance, but does care about glibc bug.
* m4/strstr.m4 (gl_FUNC_STRSTR): Split...
(gl_FUNC_STRSTR_SIMPLE): ...into new macro, which replaces strstr
if platform memchr is broken, per Debian bug 521737.
* m4/strcasestr.m4 (gl_FUNC_STRCASESTR_SIMPLE): React to broken
memchr.
* m4/memchr.m4 (gl_FUNC_MEMCHR): Only expand once.
* doc/posix-functions/strstr.texi (strstr): Document the fix.
* doc/glibc-functions/strcasestr.texi (strcasestr): Likewise.
* modules/mountlist (Depends-on): Add strstr-simple.
* modules/gen-uni-tables (Depends-on): Likewise.
* modules/argz (Depends-on): Add strstr.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'm4/strcasestr.m4')
-rw-r--r-- | m4/strcasestr.m4 | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/m4/strcasestr.m4 b/m4/strcasestr.m4 index e1e5390542..d641958ee0 100644 --- a/m4/strcasestr.m4 +++ b/m4/strcasestr.m4 @@ -1,20 +1,25 @@ -# strcasestr.m4 serial 12 -dnl Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc. +# strcasestr.m4 serial 13 +dnl Copyright (C) 2005, 2007, 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 strcasestr is present. +dnl Check that strcasestr is present and works. AC_DEFUN([gl_FUNC_STRCASESTR_SIMPLE], [ dnl Persuade glibc <string.h> to declare strcasestr(). AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS]) AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS]) + AC_REQUIRE([gl_FUNC_MEMCHR]) AC_REPLACE_FUNCS([strcasestr]) if test $ac_cv_func_strcasestr = no; then HAVE_STRCASESTR=0 gl_PREREQ_STRCASESTR + elif test "$gl_cv_func_memchr_works" != yes; then + REPLACE_STRCASESTR=1 + AC_LIBOBJ([strcasestr]) + gl_PREREQ_STRCASESTR fi ]) # gl_FUNC_STRCASESTR_SIMPLE |