autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] autoconf: warn if AC_*_IFELSE lacks complete program


From: Eric Blake
Subject: Re: [PATCH] autoconf: warn if AC_*_IFELSE lacks complete program
Date: Fri, 27 Aug 2010 13:45:36 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100806 Fedora/3.1.2-1.fc13 Mnenhy/0.8.3 Thunderbird/3.1.2

On 08/27/2010 11:48 AM, Eric Blake wrote:
On 08/27/2010 11:44 AM, Ralf Wildenhues wrote:
* Eric Blake wrote on Thu, Aug 26, 2010 at 11:13:02PM CEST:
* lib/autoconf/fortran.m4 (AC_FC_FREEFORM, AC_FC_FIXEDFORM)
(AC_FC_LINE_LENGTH, __AC_FC_NAME_MANGLING): Intentionally bypass
AC_LANG_SOURCE.

Rather than uglifying all Fortran tests (which would need to be done in
a number of third-party macros as well), how about turning off the
warning for Fortran 77 and Fortran, for which Autoconf doesn't provide
pre-processing functionality yet anyway?

Good idea. I think it can be done by making AC_LANG_CONFTEST dispatch to
a language-specific override, then make Fortran override it to skip the
warning. I'll have to work on that...

I've run out of time to test this; it will have to wait until after the weekend on my side of things. But this should do the trick - AC_LANG_CONFTEST is already language-specific, and right now, C, C++, ObjC, and ObjC++ all override it (C explicitly, the other three via AC_LANG_DEFINE inheritance). Therefore, making the default silence the warning has the net effect that the remaining languages, Fortran and Erlang, will never be able to trip the warning, even if the user skipped AC_LANG_PROGRAM during that language.

Of course, the final patch should remove some of the uglification added in the previous round of patches to fortran.m4, and probably some testsuite exposure.

diff --git i/lib/autoconf/lang.m4 w/lib/autoconf/lang.m4
index bd4b68b..304cd91 100644
--- i/lib/autoconf/lang.m4
+++ w/lib/autoconf/lang.m4
@@ -201,9 +201,14 @@ AC_DEFUN([AC_LANG_CONFTEST],
 # AC_LANG_CONFTEST()(BODY)
 # ------------------------
 # Default implementation of AC_LANG_CONFTEST.
+# This version assumes that you can't inline confdefs.h into your
+# language, and as such, it is safe to blindly call
+# AC_LANG_DEFINES_PROVIDED. Language-specific overrides should
+# remove this call if AC_LANG_SOURCE does inline confdefs.h.
 m4_define([AC_LANG_CONFTEST()],
 [cat > conftest.$ac_ext <<_ACEOF
-$1
+AC_LANG_DEFINES_PROVIDED[]$1
 _ACEOF])

 # AC_LANG_DEFINES_PROVIDED

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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