[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AM_PROG_CC_C_O assumption
From: |
Alexandre Duret-Lutz |
Subject: |
Re: AM_PROG_CC_C_O assumption |
Date: |
Fri, 10 Mar 2006 11:51:12 +0100 |
User-agent: |
Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux) |
Hi Ralf,
>>> "RW" == Ralf Wildenhues <address@hidden> writes:
RW> CVS Automake assumes that, as soon as per-target compile flags are used,
RW> AM_PROG_CC_C_O is necessary.
Not exactly : it assumes that AM_PROG_CC_C_O is necessary as
soon as -c and -o are used. Automake has always used -c -o for
per-target compile flags as well as for subdir-objects, however
previous versions of Automake forgot to require AM_PROG_CC_C_O
in the former case (but did in the letter).
RW> Strictly speaking, this assumption is
RW> correct: automake can't tell that there won't be a clash in object file
RW> names. And the user shouldn't be able to know, since the mapping of
RW> source file names to object file names is an undocumented internal.
RW> However, in practice there are many Makefile.am's out there that use
RW> target_CFLAGS and such, and will definitely never have name conflicts
This means we don't have to rename the objects file in all
cases. I agree, but it's seem too hard to tell. Since
currently Automake always uses -c -o in this case, the presence
or absence of conflicts isn't a justification against or for
AM_PROG_CC_C_O.
RW> and/or never possibly be used by a losing compiler.
Definitely.
RW> And as such I think it is too harsh to have Automake fail
RW> hard in this case; giving a warning would be sufficient
RW> IMVHO.
OK, let's turn in into a portability warning. And since
portability warnings have been waiting to be turned on for three
years now, let's do that too. I'm installing the following two
patches.
RW> For example, the modular Xorg tree would need hundreds of changes to get
RW> working, most of them actually in Makefile.am's that build only one
RW> object. A failure due to Automake upgrade will be perceived as an
RW> Automake regression. (Nevertheless, I intend to bring this issue to
RW> their attention, after hearing your opinion about it.)
I'm not sure why the changes need to be in Makefile.ams. Why not add
AM_PROG_CC_C_O to configure.ac?
2006-03-10 Alexandre Duret-Lutz <address@hidden>
* lib/Automake/ChannelDefs.pm: Make -Wportability the default in
gnu and gnits modes.
* doc/automake.texi (Invoking Automake): Adjust.
Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.301
diff -u -r1.301 NEWS
--- NEWS 29 Jan 2006 17:35:12 -0000 1.301
+++ NEWS 10 Mar 2006 10:23:17 -0000
@@ -93,6 +93,10 @@
that have been declared as programs in the same Makefile.
This is mostly useful when some check_PROGRAMS are listed in TESTS.
+ - `-Wportability' has finally been turned on by default for `gnu' and
+ `gnits' strictness. This means automake will complain about %-rules
+ or $(GNU Make functions) unless you switch to `foreign' strictness or
+ use `-Wno-portability'.
New in 1.9:
Index: doc/automake.texi
===================================================================
RCS file: /cvs/automake/automake/doc/automake.texi,v
retrieving revision 1.130
diff -u -r1.130 automake.texi
--- doc/automake.texi 21 Feb 2006 20:29:25 -0000 1.130
+++ doc/automake.texi 10 Mar 2006 10:23:20 -0000
@@ -1253,12 +1253,8 @@
variables.
The categories output by default are @samp{syntax} and
address@hidden Additionally, @samp{gnu} is enabled in @option{--gnu} and
address@hidden strictness.
-
address@hidden warnings are currently disabled by default, but they
-will be enabled in @option{--gnu} and @option{--gnits} strictness in a
-future release.
address@hidden Additionally, @samp{gnu} and @samp{portability}
+are enabled in @option{--gnu} and @option{--gnits} strictness.
@vindex WARNINGS
The environment variable @env{WARNINGS} can contain a comma separated
Index: lib/Automake/ChannelDefs.pm
===================================================================
RCS file: /cvs/automake/automake/lib/Automake/ChannelDefs.pm,v
retrieving revision 1.3
diff -u -r1.3 ChannelDefs.pm
--- lib/Automake/ChannelDefs.pm 14 May 2005 20:28:51 -0000 1.3
+++ lib/Automake/ChannelDefs.pm 10 Mar 2006 10:23:20 -0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2006 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -324,29 +324,12 @@
{
my ($name) = @_;
- # FIXME: 'portability' warnings are currently disabled by default.
- # Eventually we want to turn them on in GNU and GNITS modes, but
- # we don't do this yet in Automake 1.7 to help the 1.6/1.7 transition.
- #
- # Indeed there would be only two ways to get rid of these new warnings:
- # 1. adjusting Makefile.am
- # This is not always easy (or wanted). Consider %-rules or
- # $(function args) variables.
- # 2. using -Wno-portability
- # This means there is no way to have the same Makefile.am
- # working both with Automake 1.6 and 1.7 (since 1.6 does not
- # understand -Wno-portability).
- #
- # In Automake 1.8 (or whatever it is called) we can turn these
- # warnings on, since -Wno-portability will not be an issue for
- # the 1.7/1.8 transition.
-
if ($name eq 'gnu')
{
setup_channel 'error-gnu', silent => 0;
setup_channel 'error-gnu/warn', silent => 0, type => 'error';
setup_channel 'error-gnits', silent => 1;
- # setup_channel 'portability', silent => 0;
+ setup_channel 'portability', silent => 0;
setup_channel 'gnu', silent => 0;
}
elsif ($name eq 'gnits')
@@ -354,7 +337,7 @@
setup_channel 'error-gnu', silent => 0;
setup_channel 'error-gnu/warn', silent => 0, type => 'error';
setup_channel 'error-gnits', silent => 0;
- # setup_channel 'portability', silent => 0;
+ setup_channel 'portability', silent => 0;
setup_channel 'gnu', silent => 0;
}
elsif ($name eq 'foreign')
@@ -362,7 +345,7 @@
setup_channel 'error-gnu', silent => 1;
setup_channel 'error-gnu/warn', silent => 0, type => 'warning';
setup_channel 'error-gnits', silent => 1;
- # setup_channel 'portability', silent => 1;
+ setup_channel 'portability', silent => 1;
setup_channel 'gnu', silent => 1;
}
else
2006-03-10 Alexandre Duret-Lutz <address@hidden>
* automake.in (lang_c_rewrite): Make the AM_PROG_CC_C_O requirement
a 'portability' warning, so that people can ignore it. Suggested
by Ralf Wildenhues.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1616
diff -u -r1.1616 automake.in
--- automake.in 29 Jan 2006 17:35:12 -0000 1.1616
+++ automake.in 10 Mar 2006 10:23:18 -0000
@@ -5242,7 +5242,8 @@
# libtool is always able to put the object at the proper place,
# so we do not have to require AM_PROG_CC_C_O when building .lo files.
- err_var ($var, "compiling `$base.c' in subdir requires "
+ msg_var ('portabiliy', $var,
+ "compiling `$base.c' in subdir requires "
. "`AM_PROG_CC_C_O' in `$configure_ac'",
uniq_scope => US_GLOBAL,
uniq_part => 'AM_PROG_CC_C_O subdir')
@@ -5265,7 +5266,8 @@
&& ! option 'subdir-objects'
&& $nonansi_obj ne '.lo')
{
- err_var ($var, "compiling `$base.c' with per-target flags requires "
+ msg_var ('portability',
+ $var, "compiling `$base.c' with per-target flags requires "
. "`AM_PROG_CC_C_O' in `$configure_ac'",
uniq_scope => US_GLOBAL,
uniq_part => 'AM_PROG_CC_C_O per-target')
--
Alexandre Duret-Lutz
Shared books are happy books. http://www.bookcrossing.com/friend/gadl