memmem*: Move AC_LIBOBJ invocations to module description.
authorBruno Haible <bruno@clisp.org>
Sat, 21 May 2011 13:18:46 +0000 (15:18 +0200)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Jun 2011 22:06:29 +0000 (00:06 +0200)
* m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Call AC_CHECK_FUNCS instead of
AC_REPLACE_FUNCS. Set HAVE_MEMMEM. Move AC_LIBOBJ invocations from
here...
(gl_FUNC_MEMMEM): ... and here...
* modules/memmem-simple (configure.ac): ... to here.
* modules/memmem (configure.ac): ... and here.

ChangeLog
m4/memmem.m4
modules/memmem
modules/memmem-simple

index 74fa150..55d5524 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2011-05-21  Bruno Haible  <bruno@clisp.org>
 
+       memmem*: Move AC_LIBOBJ invocations to module description.
+       * m4/memmem.m4 (gl_FUNC_MEMMEM_SIMPLE): Call AC_CHECK_FUNCS instead of
+       AC_REPLACE_FUNCS. Set HAVE_MEMMEM. Move AC_LIBOBJ invocations from
+       here...
+       (gl_FUNC_MEMMEM): ... and here...
+       * modules/memmem-simple (configure.ac): ... to here.
+       * modules/memmem (configure.ac): ... and here.
+
+2011-05-21  Bruno Haible  <bruno@clisp.org>
+
        memcpy: Move AC_LIBOBJ invocations to module description.
        * m4/memcpy.m4 (gl_FUNC_MEMCPY): Call AC_CHECK_FUNCS instead of
        AC_REPLACE_FUNCS. Move AC_LIBOBJ and gl_PREREQ_MEMCPY invocations from
index dae71a9..e912205 100644 (file)
@@ -1,4 +1,4 @@
-# memmem.m4 serial 22
+# memmem.m4 serial 23
 dnl Copyright (C) 2002-2004, 2007-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,7 +11,12 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS([memmem])
+  AC_CHECK_FUNCS([memmem])
+  if test $ac_cv_func_memmem = yes; then
+    HAVE_MEMMEM=1
+  else
+    HAVE_MEMMEM=0
+  fi
   AC_CHECK_DECLS_ONCE([memmem])
   if test $ac_cv_have_decl_memmem = no; then
     HAVE_DECL_MEMMEM=0
@@ -68,7 +73,6 @@ AC_DEFUN([gl_FUNC_MEMMEM_SIMPLE],
       ])
     if test "$gl_cv_func_memmem_works_always" != yes; then
       REPLACE_MEMMEM=1
-      AC_LIBOBJ([memmem])
     fi
   fi
   gl_PREREQ_MEMMEM
@@ -133,7 +137,6 @@ static void quit (int sig) { exit (sig + 128); }
       ])
     if test "$gl_cv_func_memmem_works_fast" != yes; then
       REPLACE_MEMMEM=1
-      AC_LIBOBJ([memmem])
     fi
   fi
 ]) # gl_FUNC_MEMMEM
index 8dea893..63bd3ef 100644 (file)
@@ -8,6 +8,9 @@ memmem-simple
 
 configure.ac:
 gl_FUNC_MEMMEM
+if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  AC_LIBOBJ([memmem])
+fi
 
 Makefile.am:
 
index c84755d..d4ae332 100644 (file)
@@ -15,6 +15,9 @@ memcmp
 
 configure.ac:
 gl_FUNC_MEMMEM_SIMPLE
+if test $HAVE_MEMMEM = 0 || test $REPLACE_MEMMEM = 1; then
+  AC_LIBOBJ([memmem])
+fi
 gl_STRING_MODULE_INDICATOR([memmem])
 
 Makefile.am: