Simon Josefsson wrote: > Here is a starting point for a new memmem-simple module. What do you > think? > ... > diff --git a/m4/memmem.m4 b/m4/memmem.m4 > index 9767354..10d6f5a 100644 > --- a/m4/memmem.m4 > +++ b/m4/memmem.m4 > @@ -1,4 +1,4 @@ > -# memmem.m4 serial 7 > +# memmem.m4 serial 8 > dnl Copyright (C) 2002, 2003, 2004, 2007, 2008 Free Software Foundation, Inc. > dnl This file is free software; the Free Software Foundation > dnl gives unlimited permission to copy and/or distribute it, > @@ -14,7 +14,7 @@ AC_DEFUN([gl_FUNC_MEMMEM], > AC_CHECK_DECLS_ONCE(memmem) > if test $ac_cv_have_decl_memmem = no; then > HAVE_DECL_MEMMEM=0 > - else > + else if "$gl_cv_memmem_simple" != "yes"; then > AC_CACHE_CHECK([whether memmem works in linear time], > [gl_cv_func_memmem_works], > [AC_RUN_IFELSE([AC_LANG_PROGRAM([ > @@ -49,5 +49,11 @@ AC_DEFUN([gl_FUNC_MEMMEM], > gl_PREREQ_MEMMEM > ]) > > +AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE], > +[ > + gl_cv_memmem_simple=yes > + gl_FUNC_MEMMEM > +]) > +
This is not right. We want gl_FUNC_MEMMEM_SIMPLE gl_FUNC_MEMMEM to be equivalent to gl_FUNC_MEMMEM (since if one part of the code needs the simple requirements and another part of the code needs the strong requirements, the code altogether needs the strong requirements). Just setting a shell variable does not achieve this. Eric's patch is right, though. Bruno