Hi Eric, Eric Blake wrote in <http://lists.gnu.org/archive/html/bug-gnulib/2010-05/msg00135.html>: > > I don't see how to test for a new vs. an old definition of AC_DEFUN_ONCE. > > You can use the existence of gnulib's witness macro (in 00gnulib.m4) as > the proof of a working AC_DEFUN_ONCE prior to 2.64: > > m4_version_prereq([2.64],[AC_DEFUN_ONCE], > [m4_ifdef([gl_00GNULIB],[AC_DEFUN_ONCE],[AC_DEFUN])])([AM_ICONV],
Thanks for the tip. I'm applying this: 2010-08-28 Bruno Haible <br...@clisp.org> Prefer using AC_DEFUN_ONCE over AC_DEFUN in projects with gnulib. * m4/iconv.m4 (gl_iconv_AC_DEFUN): Use AC_DEFUN_ONCE if gl_00GNULIB is defined. * m4/libunistring.m4 (gl_libunistring_AC_DEFUN): Likewise. Suggested by Eric Blake. --- m4/iconv.m4.orig Sat Aug 28 10:42:50 2010 +++ m4/iconv.m4 Sat Aug 28 10:36:48 2010 @@ -1,4 +1,4 @@ -# iconv.m4 serial 14 (gettext-0.18.2) +# iconv.m4 serial 15 (gettext-0.18.2) dnl Copyright (C) 2000-2002, 2007-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -217,8 +217,11 @@ m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) gl_iconv_AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK --- m4/libunistring.m4.orig Sat Aug 28 10:42:50 2010 +++ m4/libunistring.m4 Sat Aug 28 10:36:48 2010 @@ -1,4 +1,4 @@ -# libunistring.m4 serial 10 +# libunistring.m4 serial 11 dnl Copyright (C) 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,8 +25,11 @@ m4_version_prereq([2.64], [[AC_DEFUN_ONCE( [$1], [$2])]], - [[AC_DEFUN( - [$1], [$2])]])) + [m4_ifdef([gl_00GNULIB], + [[AC_DEFUN_ONCE( + [$1], [$2])]], + [[AC_DEFUN( + [$1], [$2])]])])) gl_libunistring_AC_DEFUN([gl_LIBUNISTRING], [ AC_BEFORE([$0], [gl_LIBUNISTRING_MODULE])