bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] avoid new AC_REQUIRE expanded-before-required warnings


From: Jim Meyering
Subject: Re: [PATCH] avoid new AC_REQUIRE expanded-before-required warnings
Date: Mon, 16 Nov 2009 19:30:42 +0100

Eric Blake wrote:
> Jim Meyering <jim <at> meyering.net> writes:
>
>> Hoping to use the latest gnulib in coreutils, I sync'd, committed (without
>> pushing yet, of course), and tried to bootstrap.  Running autoconf
>> produced warnings like this:
>>
>> configure.ac:45: warning: AC_REQUIRE: `gl_FUNC_CHOWN' was expanded before it
> was required
>
> The other fix is to use AC_DEFUN_ONCE in chown.m4, rather than tweaking
> configure.ac sections of modules files.

Ah ha!
I knew there'd be a better way to solve that.
I've gone ahead and used AC_DEFUN_ONCE for both.
Is there any reason to use AC_DEFUN, in general?

Thanks!
Here's the patch I'm testing:

>From 69637233ce151566c1a861bce77e1ca32305638e Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Mon, 16 Nov 2009 19:26:35 +0100
Subject: [PATCH] better AC_REQUIRE expanded-before-required-warning avoidance

* m4/chown.m4 (gl_FUNC_CHOWN, gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Define
with AC_DEFUN_ONCE, rather than AC_DEFUN, to avoid AC_REQUIRE warnings.
Suggested by Eric Blake.  This change also reverts commit 1b712ba8,
which is no longer needed.
---
 ChangeLog          |    8 ++++++++
 m4/chown.m4        |    6 +++---
 modules/chown      |    2 +-
 modules/euidaccess |    2 +-
 modules/faccessat  |    2 +-
 5 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index de93143..259f983 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2009-11-16  Jim Meyering  <address@hidden>
+
+       better AC_REQUIRE expanded-before-required-warning avoidance
+       * m4/chown.m4 (gl_FUNC_CHOWN, gl_FUNC_CHOWN_FOLLOWS_SYMLINK): Define
+       with AC_DEFUN_ONCE, rather than AC_DEFUN, to avoid AC_REQUIRE warnings.
+       Suggested by Eric Blake.  This change also reverts commit 1b712ba8,
+       which is no longer needed.
+
 2009-11-16  Eric Blake  <address@hidden>

        test-freading: clean up temporary file
diff --git a/m4/chown.m4 b/m4/chown.m4
index 983dde8..5bedfa1 100644
--- a/m4/chown.m4
+++ b/m4/chown.m4
@@ -1,4 +1,4 @@
-# serial 20
+# serial 21
 # Determine whether we need the chown wrapper.

 dnl Copyright (C) 1997-2001, 2003-2005, 2007, 2009
@@ -14,7 +14,7 @@ dnl with or without modifications, as long as this notice is 
preserved.

 # From Jim Meyering.

-AC_DEFUN([gl_FUNC_CHOWN],
+AC_DEFUN_ONCE([gl_FUNC_CHOWN],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_TYPE_UID_T])
@@ -63,7 +63,7 @@ AC_DEFUN([gl_FUNC_CHOWN],
 ])

 # Determine whether chown follows symlinks (it should).
-AC_DEFUN([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
+AC_DEFUN_ONCE([gl_FUNC_CHOWN_FOLLOWS_SYMLINK],
 [
   AC_CACHE_CHECK(
     [whether chown dereferences symlinks],
diff --git a/modules/chown b/modules/chown
index 57331c3..88d0cd4 100644
--- a/modules/chown
+++ b/modules/chown
@@ -13,7 +13,7 @@ stat
 sys_stat

 configure.ac:
-AC_REQUIRE([gl_FUNC_CHOWN])
+gl_FUNC_CHOWN
 gl_UNISTD_MODULE_INDICATOR([chown])

 Makefile.am:
diff --git a/modules/euidaccess b/modules/euidaccess
index c313da3..bf329c6 100644
--- a/modules/euidaccess
+++ b/modules/euidaccess
@@ -13,7 +13,7 @@ stat
 sys_stat

 configure.ac:
-AC_REQUIRE([gl_FUNC_EUIDACCESS])
+gl_FUNC_EUIDACCESS
 gl_UNISTD_MODULE_INDICATOR([euidaccess])

 Makefile.am:
diff --git a/modules/faccessat b/modules/faccessat
index 57f9497..92d8185 100644
--- a/modules/faccessat
+++ b/modules/faccessat
@@ -13,7 +13,7 @@ openat
 unistd

 configure.ac:
-AC_REQUIRE([gl_FUNC_FACCESSAT])
+gl_FUNC_FACCESSAT
 gl_MODULE_INDICATOR([faccessat])
 gl_UNISTD_MODULE_INDICATOR([faccessat])

--
1.6.5.2.386.g2a326




reply via email to

[Prev in Thread] Current Thread [Next in Thread]