bug-gnulib
[Top][All Lists]
Advanced

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

Re: expand-before-require bug


From: Bruno Haible
Subject: Re: expand-before-require bug
Date: Sun, 25 Jan 2009 13:17:06 +0100
User-agent: KMail/1.9.9

Eric Blake wrote:
> * gnulib-tool (func_dest_tmpfilename, func_create_testdir): Using
> obsolete AC_GNU_SOURCE causes out-of-order expansion; avoid it,
> and rely solely on gl_USE_SYSTEM_EXTENSIONS.

This patch introduces
  "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS"
warnings in gettext, with autoconf 2.63. (gettext uses AC_GNU_SOURCE
in a couple of places, and even though the macro is marked obsolete,
it's not invalid to use it.) As explained in
<http://news.gmane.org/gmane.comp.sysutils.autoconf.bugs/cutoff=6480>,
the bug is that AC_GNU_SOURCE invokes rather than requires
AC_USE_SYSTEM_EXTENSIONS.

I'm adding this workaround. In case that it introduces warnings with
the current autoconf HEAD, the fix will be to fix AC_GNU_SOURCE in the
first place.


2009-01-25  Bruno Haible  <address@hidden>

        Make it possible again to use AC_GNU_SOURCE together with gnulib.
        * m4/extensions.m4 (gl_USE_SYSTEM_EXTENSIONS): Require AC_GNU_SOURCE
        before requiring AC_USE_SYSTEM_EXTENSIONS.

--- m4/extensions.m4.orig       2009-01-25 13:14:54.000000000 +0100
+++ m4/extensions.m4    2009-01-25 13:04:12.000000000 +0100
@@ -1,7 +1,7 @@
-# serial 6  -*- Autoconf -*-
+# serial 7  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2009 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -91,4 +91,14 @@
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
 AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
-  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
+[
+  dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
+  dnl gnulib does not need it. But if it gets required by third-party macros
+  dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
+  dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+  dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
+  dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
+  AC_REQUIRE([AC_GNU_SOURCE])
+
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])




reply via email to

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