diff options
Diffstat (limited to 'gl/m4/memchr.m4')
-rw-r--r-- | gl/m4/memchr.m4 | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gl/m4/memchr.m4 b/gl/m4/memchr.m4 index 3c2b313916..a544e2b4e7 100644 --- a/gl/m4/memchr.m4 +++ b/gl/m4/memchr.m4 @@ -1,4 +1,4 @@ -# memchr.m4 serial 10 +# memchr.m4 serial 11 dnl Copyright (C) 2002-2004, 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, @@ -11,10 +11,16 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], 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 + m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [ + dnl These days, we assume memchr is present. But if support for old + dnl platforms is desired: + AC_CHECK_FUNCS_ONCE([memchr]) + if test $ac_cv_func_memchr = no; then + HAVE_MEMCHR=0 + fi + ]) + if test $HAVE_MEMCHR = 1; then # Detect platform-specific bugs in some versions of glibc: # memchr should not dereference anything with length 0 # http://bugzilla.redhat.com/499689 @@ -73,8 +79,6 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR], 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]) |