automake-patches
[Top][All Lists]
Advanced

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

Re: Dependency tracking of pre processed Assembler files


From: Ralf Wildenhues
Subject: Re: Dependency tracking of pre processed Assembler files
Date: Wed, 11 Oct 2006 21:42:18 +0200
User-agent: Mutt/1.5.13 (2006-08-11)

[ moving from automake to -patches, and reordering; this is
  http://lists.gnu.org/archive/html/automake/2006-10/msg00031.html ]

* Ralf Corsepius wrote on Wed, Oct 11, 2006 at 11:09:30AM CEST:
> > http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=automake&pr=492
> Thanks - This seems to be fixed.

Erm, no, I don't think PR 492 is fixed.

> On Wed, 2006-10-11 at 09:55 +0200, Ralf Wildenhues wrote:
> > * Ralf Corsepius wrote on Wed, Oct 11, 2006 at 08:52:42AM CEST:
> > > OK, I just was about to try automake-CVS + autoconf-2.60 and now am
> > > facing an issue with a package using subdir-objects and *_SOURCES
> > > containing *.S + *.c:
[...]
> > > /opt/gnu/share/automake-1.9c/am/depend2.am: am__fastdepCCAS does not
> > > appear in AM_CONDITIONAL

> > Forgot to add AM_PROG_AS?
> 
> Yes, but ... with a simple testcase, I get this warning:
[...]
> With my real world test case, I don't get this warning. Probably
> because I am AC_SUBST'ing CCAS and CCASCOMPILE.

Thanks for reporting this.  Actually, two bugs here:
- there is no test for *.S,
- above warning is suboptimal because there is too little help
  (the other warnings you posted had help, but were only present
  in the test case).

Further note a small buglet in m4/as.m4:
- without no-dependencies, we should not compute depmode.

OK to apply these two patches to fix them?  Or should I rather add
a test case exposure to every possible warning?

Ralf, is the warning good enough in your real world test case now?

Implementation notes:

The cond_stack_if change should probably eventually be factored
similarly to Automake::Variables::require_variables and moved to
the Automake::Conditions package...

With the conditions handled here, there is no need for differentiating
between Automake- and Autoconf-provided macros: AM_INIT_AUTOMAKE munges
with the latter of the macros, so aclocal needs to be called in any
case.  And in case the user forgot AM_INIT_AUTOMAKE, we already output
a better error message anyway.  (Furthermore, Autoconf may not use
AM_CONDITIONAL anyway.)

Cheers, and thanks,
Ralf

2006-10-11  Ralf Wildenhues  <address@hidden>

        * m4/as.m4 (AM_PROG_AS): If `no-dependencies', do not invoke
        _AM_DEPENDENCIES.

        * automake.in (%_macro_for_cond): New variable.
        (cond_stack_if): Use it for better error message about
        missing dependency tracking conditionals.
        * tests/asm2.test: New test, modeled after asm.test.
        * tests/Makefile.am: Adjust.
        Report by Ralf Corsepius.

Index: m4/as.m4
===================================================================
RCS file: /cvs/automake/automake/m4/as.m4,v
retrieving revision 1.10
diff -u -r1.10 as.m4
--- m4/as.m4    9 Jan 2005 14:46:21 -0000       1.10
+++ m4/as.m4    11 Oct 2006 19:28:09 -0000
@@ -1,12 +1,12 @@
 # Figure out how to run the assembler.                      -*- Autoconf -*-
 
-# Copyright (C) 2001, 2003, 2004, 2005  Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2004, 2005, 2006  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.
 
-# serial 4
+# serial 5
 
 # AM_PROG_AS
 # ----------
@@ -17,5 +17,5 @@
 test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
 AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
 AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
-_AM_DEPENDENCIES([CCAS])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
 ])
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1632
diff -u -r1.1632 automake.in
--- automake.in 10 Oct 2006 21:34:11 -0000      1.1632
+++ automake.in 11 Oct 2006 19:28:03 -0000
@@ -5722,6 +5722,19 @@
 }
 
 
+my %_am_macro_for_cond =
+  (
+  AMDEP => "one of the compiler tests\n"
+           . "    AC_PROG_CC, AC_PROG_CXX, AC_PROG_CXX, AC_PROG_OBJC,\n"
+          . "    AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC",
+  am__fastdepCC => 'AC_PROG_CC',
+  am__fastdepCCAS => 'AM_PROG_AS',
+  am__fastdepCXX => 'AC_PROG_CXX',
+  am__fastdepGCJ => 'AM_PROG_GCJ',
+  am__fastdepOBJC => 'AC_PROG_OBJC',
+  am__fastdepUPC => 'AM_PROG_UPC'
+  );
+
 # $COND
 # cond_stack_if ($NEGATE, $COND, $WHERE)
 # --------------------------------------
@@ -5729,8 +5742,22 @@
 {
   my ($negate, $cond, $where) = @_;
 
-  error $where, "$cond does not appear in AM_CONDITIONAL"
-    if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/;
+  if (! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/)
+    {
+      my $text = "$cond does not appear in AM_CONDITIONAL";
+      my $scope = US_LOCAL;
+      if (exists $_am_macro_for_cond{$cond})
+        {
+         my $mac = $_am_macro_for_cond{$cond};
+         $text .= "\n  The usual way to define `$cond' is to add ";
+         $text .= ($mac =~ / /) ? $mac : "`$mac'";
+         $text .= "\n  to `$configure_ac' and run `aclocal' and `autoconf' 
again.";
+         # These warnings appear in Automake files (depend2.am),
+         # so there is no need to display them more than once:
+         $scope = US_GLOBAL;
+       }
+      error $where, $text, uniq_scope => $scope;
+    }
 
   push (@cond_stack, make_conditional_string ($negate, $cond));
 
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.609
diff -u -r1.609 Makefile.am
--- tests/Makefile.am   30 Aug 2006 20:35:56 -0000      1.609
+++ tests/Makefile.am   11 Oct 2006 19:28:09 -0000
@@ -55,6 +55,7 @@
 ar.test \
 ar2.test \
 asm.test \
+asm2.test \
 autohdr.test \
 autohdr2.test \
 autohdr3.test \
--- /dev/null   2006-10-09 01:10:44.864355000 +0200
+++ tests/asm2.test     2006-10-11 21:27:40.000000000 +0200
@@ -0,0 +1,138 @@
+#! /bin/sh
+# Copyright (C) 2001, 2002, 2003, 2006  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+# Test of basic preprocessed assembly functionality; cf. asm.test.
+
+. ./defs || exit 1
+
+set -e
+
+cat > Makefile.am << 'END'
+noinst_PROGRAMS = maude
+maude_SOURCES = maude.S
+END
+
+: > maude.s
+
+# Should fail because we need CC and CCAS.
+echo 1
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_SUBST(CCASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep AM_PROG_AS stderr
+
+# On fast machines the autom4te.cache created during the above run of
+# $AUTOMAKE is likely to have the same time stamp as the configure.in
+# created below; thus causing traces for the old configure.in to be
+# used.  We could do `$sleep', but it's faster to erase the
+# directory.  (Erase autom4te*.cache, not autom4te.cache, because some
+# bogus installations of Autoconf use a versioned cache.)
+rm -rf autom4te*.cache
+
+# We still need CCAS.
+echo 2
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AC_PROG_CC
+AC_SUBST(CCASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep CCAS stderr
+grep AM_PROG_AS stderr
+
+rm -rf autom4te*.cache
+
+# We need CCASFLAGS.
+echo 3
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+CCAS='$(CC)'
+AC_SUBST(CCAS)
+AC_PROG_CC
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep CCASFLAGS stderr
+grep AM_PROG_AS stderr
+
+rm -rf autom4te*.cache
+
+# We need dependency tracking.
+echo 4
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+CCAS='$(CC)'
+AC_SUBST(CCAS)
+AC_PROG_CC
+AC_SUBST(CCASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+AUTOMAKE_fails
+grep AM_PROG_AS stderr
+
+rm -rf autom4te*.cache
+
+# We have every needed, expect a success.
+echo 5
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+CCAS='$(CC)'
+AC_SUBST(CCAS)
+AC_PROG_CC
+_AM_DEPENDENCIES(CCAS)
+AC_SUBST(CCASFLAGS)
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+rm -rf autom4te*.cache
+
+# We have every needed, expect a success.
+echo 6
+cat > configure.in << 'END'
+AC_INIT
+AM_INIT_AUTOMAKE(nonesuch, nonesuch)
+AM_PROG_AS
+AC_OUTPUT(Makefile)
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+exit 0




reply via email to

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