error: avoid expand-before-require warning
authorEric Blake <ebb9@byu.net>
Wed, 21 Jan 2009 17:33:24 +0000 (10:33 -0700)
committerEric Blake <ebb9@byu.net>
Wed, 21 Jan 2009 17:33:24 +0000 (10:33 -0700)
* modules/errno (configure.ac): Require, rather than expand,
gl_HEADER_ERRNO_H.
* m4/errno_h.m4 (gl_HEADER_ERRNO_H_BODY): Merge...
(gl_HEADER_ERRNO_H): ...into this macro, and use AC_DEFUN_ONCE to
enforce that all clients require it.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
m4/errno_h.m4
modules/errno

index 7b7c8bdae6e23e19f4dab19333268fe7250ce5ab..bc8fc9fac618116bf441b630eb66f6e9ba0e6769 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2009-01-21  Eric Blake  <ebb9@byu.net>
 
 2009-01-21  Eric Blake  <ebb9@byu.net>
 
+       error: avoid expand-before-require warning
+       * modules/errno (configure.ac): Require, rather than expand,
+       gl_HEADER_ERRNO_H.
+       * m4/errno_h.m4 (gl_HEADER_ERRNO_H_BODY): Merge...
+       (gl_HEADER_ERRNO_H): ...into this macro, and use AC_DEFUN_ONCE to
+       enforce that all clients require it.
+
        gnulib-tool: avoid warnings from using obsolete AC_GNU_SOURCE
        * gnulib-tool (func_dest_tmpfilename, func_create_testdir): Using
        obsolete AC_GNU_SOURCE causes out-of-order expansion; avoid it,
        gnulib-tool: avoid warnings from using obsolete AC_GNU_SOURCE
        * gnulib-tool (func_dest_tmpfilename, func_create_testdir): Using
        obsolete AC_GNU_SOURCE causes out-of-order expansion; avoid it,
index 0682d1ab63b8912ea1079605f159227de754927c..4d77672cb70e7190bd36a09fe84c272d9c9c0766 100644 (file)
@@ -1,17 +1,11 @@
-# errno_h.m4 serial 3
+# errno_h.m4 serial 4
 dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Copyright (C) 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_HEADER_ERRNO_H],
-[
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
-  AC_REQUIRE([gl_HEADER_ERRNO_H_BODY])
-])
-
-AC_DEFUN([gl_HEADER_ERRNO_H_BODY],
+dnl This macro must pass through AC_REQUIRE (never directly invoke it).
+AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_CACHE_CHECK([for complete errno.h], [gl_cv_header_errno_h_complete], [
index 8806621d5e713b14b68098ad1fe264589f1b2e51..208636dc3809785ce5a33f0c71b3430335c32b1c 100644 (file)
@@ -9,7 +9,7 @@ Depends-on:
 include_next
 
 configure.ac:
 include_next
 
 configure.ac:
-gl_HEADER_ERRNO_H
+AC_REQUIRE([gl_HEADER_ERRNO_H])
 
 Makefile.am:
 BUILT_SOURCES += $(ERRNO_H)
 
 Makefile.am:
 BUILT_SOURCES += $(ERRNO_H)