X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=m4%2Fmemchr.m4;h=f6dc3e712b909174215c06f728eaabed276a7bfb;hb=0f5629a2fc2a536cfedd8d29e66c36995d8d3211;hp=46db9fb65403d3f24ef267b552b74f46b711a3f1;hpb=1f8c872f267bc608644d6de67aa5fab6285a8533;p=gnulib.git diff --git a/m4/memchr.m4 b/m4/memchr.m4 index 46db9fb65..f6dc3e712 100644 --- a/m4/memchr.m4 +++ b/m4/memchr.m4 @@ -1,5 +1,5 @@ -# memchr.m4 serial 10 -dnl Copyright (C) 2002-2004, 2009-2010 Free Software Foundation, Inc. +# memchr.m4 serial 12 +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, dnl with or without modifications, as long as this notice is preserved. @@ -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,12 +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]) - gl_PREREQ_MEMCHR fi ])