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 74fa150fcf6f971eff452a7800d7f62c75f823ff..55d5524d5f823af2ca61a89c6b486cea9bb08a60 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
index dae71a968cc564f43208dacc40223862b91dbc99..e912205cd033acd3cfb99d56a81f783313086095 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 8dea8932aecbcfd4dbc8cac8049c0a4dad61a2b7..63bd3efce10abff6ab4421650eb9df1c6bdfb2c7 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 c84755d6475650cf9f86545daf6291250906779a..d4ae332a264a5c7aa2764f2d1e919ed8308a4fa5 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: