From 8e08af9e7f4ebbb06ebf5280b2be4d33c9d55b6e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 21 May 2011 15:18:46 +0200 Subject: [PATCH] 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. --- ChangeLog | 10 ++++++++++ m4/memmem.m4 | 11 +++++++---- modules/memmem | 3 +++ modules/memmem-simple | 3 +++ 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74fa150fc..55d5524d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2011-05-21 Bruno Haible + 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 + 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 diff --git a/m4/memmem.m4 b/m4/memmem.m4 index dae71a968..e912205cd 100644 --- a/m4/memmem.m4 +++ b/m4/memmem.m4 @@ -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 diff --git a/modules/memmem b/modules/memmem index 8dea8932a..63bd3efce 100644 --- a/modules/memmem +++ b/modules/memmem @@ -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: diff --git a/modules/memmem-simple b/modules/memmem-simple index c84755d64..d4ae332a2 100644 --- a/modules/memmem-simple +++ b/modules/memmem-simple @@ -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: -- 2.11.0