automake-commit
[Top][All Lists]
Advanced

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

[Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11b-46-


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, master, updated. v1.11b-46-g64b18e0
Date: Sat, 21 Apr 2012 08:38:51 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=64b18e07df13c9cc96232cc77e03f7d31a0b5046

The branch, master has been updated
       via  64b18e07df13c9cc96232cc77e03f7d31a0b5046 (commit)
       via  f1895f943d9f58e05fbb3f6ba1d3c5e53733a6a9 (commit)
       via  99217a1b31b9a0c78c9f0182bd024ddf0be03030 (commit)
      from  89ba2a738c9eb543d499cc6dabe3341cbb21857a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 64b18e07df13c9cc96232cc77e03f7d31a0b5046
Author: Stefano Lattarini <address@hidden>
Date:   Fri Apr 20 10:05:51 2012 +0200

    refactor: processing of input makefile rules
    
    This is a pure refactoring, with no intended functional or semantic
    changes.  It breaks up an overly-long function in three smaller
    sub-functions.  This change will very especially useful for the work
    on Automake-NG.
    
    * lib/Automake/Rule.pm (define): Move quite a lot of code out, into ...
    (_rule_defn_with_exeext_awareness, _maybe_warn_about_duplicated_target,
    _conditionals_for_rule): ... these new subroutines.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit f1895f943d9f58e05fbb3f6ba1d3c5e53733a6a9
Author: Stefano Lattarini <address@hidden>
Date:   Mon Apr 16 14:59:53 2012 +0200

    automake: refactor pre-processing of makefile fragments
    
    This change will provide the automake script with a new function that
    reads in a Makefile fragment *without* performing Automake ad-hoc parsing,
    but only the pre-processing step, i.e., removal of '##' comments and
    substitution of tokens like '%SUBDIRS%', '%?LIBTOOL%' or '?GENENRIC?'.
    
    This will very likely be useful for the work on Automake-NG.
    
    This is a pure refactoring, with no intended functional or semantic
    changes.
    
    * automake.in (preprocess_file): New function, extracted ...
    (make_paragraphs): ... from here.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 99217a1b31b9a0c78c9f0182bd024ddf0be03030
Author: Stefano Lattarini <address@hidden>
Date:   Fri Apr 20 19:29:14 2012 +0200

    docs: remove obsolete references to Autoconf 2.13
    
    Autoconf 2.13 is definitely obsolete today, so giving hints or caveats
    about it in the Automake documentation is not only obsolescent, but
    also counter-productive, as it suggests that autoconf 2.13 is still
    relevant.
    
    * doc/automake.texi: Adjust.  Related rewordings.  Since we are at it,
    prefer using a more modern autoconf version number (2.68 instead of 2.57)
    in an example showing how to correctly use 'AC_PREREQ' in third-party
    .m4 files.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 automake.in          |   41 ++++---
 doc/automake.texi    |   34 ++---
 lib/Automake/Rule.pm |  364 ++++++++++++++++++++++++++-----------------------
 3 files changed, 229 insertions(+), 210 deletions(-)

diff --git a/automake.in b/automake.in
index 38e09dc..43a7ba6 100644
--- a/automake.in
+++ b/automake.in
@@ -6938,13 +6938,13 @@ sub transform ($$)
     }
 }
 
-
-# @PARAGRAPHS
-# &make_paragraphs ($MAKEFILE, [%TRANSFORM])
-# ------------------------------------------
-# Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
-# paragraphs.
-sub make_paragraphs ($%)
+# $TEXT
+# preprocess_file ($MAKEFILE, [%TRANSFORM])
+# -----------------------------------------
+# Load a $MAKEFILE, apply the %TRANSFORM, and return the result.
+# No extra parsing of post-processing is done (i.e., recognition of
+# rules declaration or of make variables definitions).
+sub preprocess_file ($%)
 {
   my ($file, %transform) = @_;
 
@@ -6977,13 +6977,9 @@ sub make_paragraphs ($%)
 
                 'LIBTOOL'      => !! var ('LIBTOOL'),
                 'NONLIBTOOL'   => 1,
-                'FIRST'        => ! $transformed_files{$file},
                %transform);
 
-  $transformed_files{$file} = 1;
-  $_ = $am_file_cache{$file};
-
-  if (! defined $_)
+  if (! defined ($_ = $am_file_cache{$file}))
     {
       verb "reading $file";
       # Swallow the whole file.
@@ -6993,11 +6989,10 @@ sub make_paragraphs ($%)
       $_ = $fc_file->getline;
       $/ = $saved_dollar_slash;
       $fc_file->close;
-
       # Remove ##-comments.
       # Besides we don't need more than two consecutive new-lines.
       s/(?:$IGNORE_PATTERN|(?<=\n\n)\n+)//gom;
-
+      # Remember the contents of the just-read file.
       $am_file_cache{$file} = $_;
     }
 
@@ -7011,8 +7006,22 @@ sub make_paragraphs ($%)
   # ####### and do not remove the latter.)
   s/^[ \t]*(?:##%)+.*\n//gm;
 
-  # Split at unescaped new lines.
-  my @lines = split (/(?<!\\)\n/, $_);
+  return $_;
+}
+
+
+# @PARAGRAPHS
+# &make_paragraphs ($MAKEFILE, [%TRANSFORM])
+# ------------------------------------------
+# Load a $MAKEFILE, apply the %TRANSFORM, and return it as a list of
+# paragraphs.
+sub make_paragraphs ($%)
+{
+  my ($file, %transform) = @_;
+  $transform{FIRST} = !$transformed_files{$file};
+  $transformed_files{$file} = 1;
+
+  my @lines = split /(?<!\\)\n/, preprocess_file ($file, %transform);
   my @res;
 
   while (defined ($_ = shift @lines))
diff --git a/doc/automake.texi b/doc/automake.texi
index b309684..c21a5b7 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -430,11 +430,7 @@ should generally be one @file{Makefile.am} per directory 
of a project.
 Automake does constrain a project in certain ways; for instance, it
 assumes that the project uses Autoconf (@pxref{Top, , Introduction,
 autoconf, The Autoconf Manual}), and enforces certain restrictions on
-the @file{configure.ac} address@hidden Autoconf versions used
address@hidden  Autoconf 2.50 and greater promotes
address@hidden over @file{configure.in}.  The rest of this
-documentation will refer to @file{configure.ac}, but Automake also
-supports @file{configure.in} for backward compatibility.}.
+the @file{configure.ac} contents.
 
 @cindex Automake requirements
 @cindex Requirements, Automake
@@ -3032,8 +3028,7 @@ This is required if any Objective C source is included.  
@xref{Particular
 Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
 
 @item AC_PROG_F77
-This is required if any Fortran 77 source is included.  This macro is
-distributed with Autoconf version 2.13 and later.  @xref{Particular
+This is required if any Fortran 77 source is included.  @xref{Particular
 Programs, , Particular Program Checks, autoconf, The Autoconf Manual}.
 
 @item AC_F77_LIBRARY_LDFLAGS
@@ -3569,7 +3564,7 @@ For instance,
 
 @example
 # bad style
-AC_PREREQ(2.57)
+AC_PREREQ(2.68)
 AC_DEFUN(AX_FOOBAR,
 [AC_REQUIRE([AX_SOMETHING])dnl
 AX_FOO
@@ -3582,7 +3577,7 @@ should be rewritten as
 
 @example
 AC_DEFUN([AX_FOOBAR],
-[AC_PREREQ([2.57])dnl
+[AC_PREREQ([2.68])dnl
 AC_REQUIRE([AX_SOMETHING])dnl
 AX_FOO
 AX_BAR
@@ -3590,11 +3585,11 @@ AX_BAR
 @end example
 
 Wrapping the @code{AC_PREREQ} call inside the macro ensures that
-Autoconf 2.57 will not be required if @code{AX_FOOBAR} is not actually
+Autoconf 2.68 will not be required if @code{AX_FOOBAR} is not actually
 used.  Most importantly, quoting the first argument of @code{AC_DEFUN}
 allows the macro to be redefined or included twice (otherwise this
 first argument would be expanded during the second definition).  For
-consistency we like to quote even arguments such as @code{2.57} that
+consistency we like to quote even arguments such as @code{2.68} that
 do not require it.
 
 If you have been directed here by the @command{aclocal} diagnostic but
@@ -6594,10 +6589,9 @@ in the appropriate Fortran 77 intrinsic and run-time 
libraries.
 @cindex @code{FLIBS}, defined
 @vindex FLIBS
 These extra Fortran 77 linker flags are supplied in the output variable
address@hidden by the @code{AC_F77_LIBRARY_LDFLAGS} Autoconf macro
-supplied with newer versions of Autoconf (Autoconf version 2.13 and
-later).  @xref{Fortran Compiler, , Fortran Compiler Characteristics,
-autoconf, The Autoconf Manual}.
address@hidden by the @code{AC_F77_LIBRARY_LDFLAGS} Autoconf macro.
address@hidden Compiler, , Fortran Compiler Characteristics, autoconf,
+The Autoconf Manual}.
 @end enumerate
 
 If Automake detects that a program or shared library (as mentioned in
@@ -6959,20 +6953,14 @@ substitutions.  This means that if you are 
conditionally building a
 program using such a substitution, then your @file{configure.ac} must
 take care to add @samp{$(EXEEXT)} when constructing the output variable.
 
-With Autoconf 2.13 and earlier, you must explicitly use @code{AC_EXEEXT}
-to get this support.  With Autoconf 2.50, @code{AC_EXEEXT} is run
-automatically if you configure a compiler (say, through
address@hidden).
-
 Sometimes maintainers like to write an explicit link rule for their
 program.  Without executable extension support, this is easy---you
 simply write a rule whose target is the name of the program.  However,
 when executable extension support is enabled, you must instead add the
 @samp{$(EXEEXT)} suffix.
 
-Unfortunately, due to the change in Autoconf 2.50, this means you must
-always add this extension.  However, this is a problem for maintainers
-who know their package will never run on a platform that has
+This might be a nuisance for maintainers who know their package will
+never run on a platform that has
 executable extensions.  For those maintainers, the @option{no-exeext}
 option (@pxref{Options}) will disable this feature.  This works in a
 fairly ugly way; if @option{no-exeext} is seen, then the presence of a
diff --git a/lib/Automake/Rule.pm b/lib/Automake/Rule.pm
index 3db8c44..3f17daa 100644
--- a/lib/Automake/Rule.pm
+++ b/lib/Automake/Rule.pm
@@ -575,6 +575,178 @@ sub _new ($$)
   return $self;
 }
 
+sub _rule_defn_with_exeext_awareness ($$$)
+{
+  my ($target, $cond, $where) = @_;
+
+  # For now 'foo:' will override 'foo$(EXEEXT):'.  This is temporary,
+  # though, so we emit a warning.
+  (my $noexe = $target) =~ s/\$\(EXEEXT\)$//;
+  my $noexerule = rule $noexe;
+  my $tdef = $noexerule ? $noexerule->def ($cond) : undef;
+
+  if ($noexe ne $target
+      && $tdef
+      && $noexerule->name ne $target)
+    {
+      # The no-exeext option enables this feature.
+      if (! option 'no-exeext')
+       {
+         msg ('obsolete', $tdef->location,
+              "deprecated feature: target '$noexe' overrides "
+              . "'$noexe\$(EXEEXT)'\n"
+              . "change your target to read '$noexe\$(EXEEXT)'",
+              partial => 1);
+         msg ('obsolete', $where, "target '$target' was defined here");
+       }
+    }
+    return $tdef;
+}
+
+sub _maybe_warn_about_duplicated_target ($$$$$$)
+{
+  my ($target, $tdef, $source, $owner, $cond, $where) = @_;
+
+  my $oldowner  = $tdef->owner;
+  # Ok, it's the name target, but the name maybe different because
+  # 'foo$(EXEEXT)' and 'foo' have the same key in our table.
+  my $oldname = $tdef->name;
+
+  # Don't mention true conditions in diagnostics.
+  my $condmsg =
+    $cond == TRUE ? '' : (" in condition '" . $cond->human . "'");
+
+  if ($owner == RULE_USER)
+    {
+      if ($oldowner == RULE_USER)
+        {
+          # Ignore '%'-style pattern rules.  We'd need the
+          # dependencies to detect duplicates, and they are
+          # already diagnosed as unportable by -Wportability.
+          if ($target !~ /^[^%]*%[^%]*$/)
+            {
+              ## FIXME: Presently we can't diagnose duplicate user rules
+              ## because we don't distinguish rules with commands
+              ## from rules that only add dependencies.  E.g.,
+              ##   .PHONY: foo
+              ##   .PHONY: bar
+              ## is legitimate. (This is phony.test.)
+
+              # msg ('syntax', $where,
+              #      "redefinition of '$target'$condmsg ...", partial => 1);
+              # msg_cond_rule ('syntax', $cond, $target,
+              #                "... '$target' previously defined here");
+            }
+        }
+      else
+        {
+          # Since we parse the user Makefile.am before reading
+          # the Automake fragments, this condition should never happen.
+          prog_error ("user target '$target'$condmsg seen after Automake's"
+                      . " definition\nfrom " . $tdef->source);
+        }
+    }
+  else # $owner == RULE_AUTOMAKE
+    {
+      if ($oldowner == RULE_USER)
+        {
+          # -am targets listed in %dependencies support a -local
+          # variant.  If the user tries to override TARGET or
+          # TARGET-am for which there exists a -local variant,
+          # just tell the user to use it.
+          my $hint = 0;
+          my $noam = $target;
+          $noam =~ s/-am$//;
+          if (exists $dependencies{"$noam-am"})
+            {
+              $hint = "consider using $noam-local instead of $target";
+            }
+
+          msg_cond_rule ('override', $cond, $target,
+                         "user target '$target' defined here"
+                         . "$condmsg ...", partial => 1);
+          msg ('override', $where,
+               "... overrides Automake target '$oldname' defined here",
+               partial => $hint);
+          msg_cond_rule ('override', $cond, $target, $hint)
+            if $hint;
+        }
+      else # $oldowner == RULE_AUTOMAKE
+        {
+          # Automake should ignore redefinitions of its own
+          # rules if they came from the same file.  This makes
+          # it easier to process a Makefile fragment several times.
+          # However it's an error if the target is defined in many
+          # files.  E.g., the user might be using bin_PROGRAMS = ctags
+          # which clashes with our 'ctags' rule.
+          # (It would be more accurate if we had a way to compare
+          # the *content* of both rules.  Then $targets_source would
+          # be useless.)
+          my $oldsource = $tdef->source;
+          if (not ($source eq $oldsource && $target eq $oldname))
+            {
+               msg ('syntax',
+                    $where, "redefinition of '$target'$condmsg ...",
+                    partial => 1);
+               msg_cond_rule ('syntax', $cond, $target,
+                              "... '$oldname' previously defined here");
+            }
+        }
+    }
+}
+
+# Return the list of conditionals in which the rule was defined.  In case
+# an ambiguous conditional definition is detected, return the empty list.
+sub _conditionals_for_rule ($$$$)
+{
+  my ($rule, $owner, $cond, $where) = @_;
+  my $target = $rule->name;
+  my @conds;
+  my ($message, $ambig_cond) = $rule->conditions->ambiguous_p ($target, $cond);
+
+  return $cond if !$message; # No ambiguity.
+
+  if ($owner == RULE_USER)
+    {
+      # For user rules, just diagnose the ambiguity.
+      msg 'syntax', $where, "$message ...", partial => 1;
+      msg_cond_rule ('syntax', $ambig_cond, $target,
+                     "... '$target' previously defined here");
+      return ();
+    }
+
+  # FIXME: for Automake rules, we can't diagnose ambiguities yet.
+  # The point is that Automake doesn't propagate conditions
+  # everywhere.  For instance &handle_PROGRAMS doesn't care if
+  # bin_PROGRAMS was defined conditionally or not.
+  # On the following input
+  #   if COND1
+  #   foo:
+  #           ...
+  #   else
+  #   bin_PROGRAMS = foo
+  #   endif
+  # &handle_PROGRAMS will attempt to define a 'foo:' rule
+  # in condition TRUE (which conflicts with COND1).  Fixing
+  # this in &handle_PROGRAMS and siblings seems hard: you'd
+  # have to explain &file_contents what to do with a
+  # condition.  So for now we do our best *here*.  If 'foo:'
+  # was already defined in condition COND1 and we want to define
+  # it in condition TRUE, then define it only in condition !COND1.
+  # (See cond14.test and cond15.test for some test cases.)
+  @conds = $rule->not_always_defined_in_cond ($cond)->conds;
+
+  # No conditions left to define the rule.
+  # Warn, because our workaround is meaningless in this case.
+  if (scalar @conds == 0)
+    {
+      msg 'syntax', $where, "$message ...", partial => 1;
+      msg_cond_rule ('syntax', $ambig_cond, $target,
+                     "... '$target' previously defined here");
+      return ();
+    }
+  return @conds;
+}
 
 =item C<@conds = define ($rulename, $source, $owner, $cond, $where)>
 
@@ -601,186 +773,38 @@ sub define ($$$$$)
   # Don't even think about defining a rule in condition FALSE.
   return () if $cond == FALSE;
 
-  # For now 'foo:' will override 'foo$(EXEEXT):'.  This is temporary,
-  # though, so we emit a warning.
-  (my $noexe = $target) =~ s,\$\(EXEEXT\)$,,;
-  my $noexerule = rule $noexe;
-  my $tdef = $noexerule ? $noexerule->def ($cond) : undef;
-
-  if ($noexe ne $target
-      && $tdef
-      && $noexerule->name ne $target)
-    {
-      # The no-exeext option enables this feature.
-      if (! option 'no-exeext')
-       {
-         msg ('obsolete', $tdef->location,
-              "deprecated feature: target '$noexe' overrides "
-              . "'$noexe\$(EXEEXT)'\n"
-              . "change your target to read '$noexe\$(EXEEXT)'",
-              partial => 1);
-         msg ('obsolete', $where, "target '$target' was defined here");
-       }
-      # Don't 'return ()' now, as this might hide target clashes
-      # detected below.
-    }
-
+  my $tdef = _rule_defn_with_exeext_awareness ($target, $cond, $where);
 
   # A GNU make-style pattern rule has a single "%" in the target name.
   msg ('portability', $where,
        "'%'-style pattern rules are a GNU make extension")
     if $target =~ /^[^%]*%[^%]*$/;
 
-  # Diagnose target redefinitions.
+  # See whether this is a duplicated target declaration.
   if ($tdef)
     {
-      my $oldowner  = $tdef->owner;
-      # Ok, it's the name target, but the name maybe different because
-      # 'foo$(EXEEXT)' and 'foo' have the same key in our table.
-      my $oldname = $tdef->name;
-
-      # Don't mention true conditions in diagnostics.
-      my $condmsg =
-       $cond == TRUE ? '' : " in condition '" . $cond->human . "'";
-
-      if ($owner == RULE_USER)
-       {
-         if ($oldowner == RULE_USER)
-           {
-             # Ignore '%'-style pattern rules.  We'd need the
-             # dependencies to detect duplicates, and they are
-             # already diagnosed as unportable by -Wportability.
-             if ($target !~ /^[^%]*%[^%]*$/)
-               {
-                 ## FIXME: Presently we can't diagnose duplicate user rules
-                 ## because we don't distinguish rules with commands
-                 ## from rules that only add dependencies.  E.g.,
-                 ##   .PHONY: foo
-                 ##   .PHONY: bar
-                 ## is legitimate. (This is phony.test.)
-
-                 # msg ('syntax', $where,
-                 #      "redefinition of '$target'$condmsg ...", partial => 1);
-                 # msg_cond_rule ('syntax', $cond, $target,
-                 #                "... '$target' previously defined here");
-               }
-             # Return so we don't redefine the rule in our tables,
-             # don't check for ambiguous condition, etc.  The rule
-             # will be output anyway because &read_am_file ignore the
-             # return code.
-             return ();
-           }
-         else
-           {
-             # Since we parse the user Makefile.am before reading
-             # the Automake fragments, this condition should never happen.
-             prog_error ("user target '$target'$condmsg seen after Automake's"
-                         . " definition\nfrom " . $tdef->source);
-           }
-       }
-      else # $owner == RULE_AUTOMAKE
-       {
-         if ($oldowner == RULE_USER)
-           {
-             # -am targets listed in %dependencies support a -local
-             # variant.  If the user tries to override TARGET or
-             # TARGET-am for which there exists a -local variant,
-             # just tell the user to use it.
-             my $hint = 0;
-             my $noam = $target;
-             $noam =~ s/-am$//;
-             if (exists $dependencies{"$noam-am"})
-               {
-                 $hint = "consider using $noam-local instead of $target";
-               }
-
-             msg_cond_rule ('override', $cond, $target,
-                            "user target '$target' defined here"
-                            . "$condmsg ...", partial => 1);
-             msg ('override', $where,
-                  "... overrides Automake target '$oldname' defined here",
-                  partial => $hint);
-             msg_cond_rule ('override', $cond, $target, $hint)
-               if $hint;
-
-             # Don't overwrite the user definition of TARGET.
-             return ();
-           }
-         else # $oldowner == RULE_AUTOMAKE
-           {
-             # Automake should ignore redefinitions of its own
-             # rules if they came from the same file.  This makes
-             # it easier to process a Makefile fragment several times.
-             # However it's an error if the target is defined in many
-             # files.  E.g., the user might be using bin_PROGRAMS = ctags
-             # which clashes with our 'ctags' rule.
-             # (It would be more accurate if we had a way to compare
-             # the *content* of both rules.  Then $targets_source would
-             # be useless.)
-             my $oldsource = $tdef->source;
-             return () if $source eq $oldsource && $target eq $oldname;
-
-             msg ('syntax', $where, "redefinition of '$target'$condmsg ...",
-                  partial => 1);
-             msg_cond_rule ('syntax', $cond, $target,
-                            "... '$oldname' previously defined here");
-             return ();
-           }
-       }
-      # Never reached.
-      prog_error ("unreachable place reached");
+      # Diagnose invalid target redefinitions, if any.  Note that some
+      # target redefinitions are valid (e.g., for multiple-targets
+      # pattern rules).
+      _maybe_warn_about_duplicated_target ($target, $tdef, $source,
+                                           $owner, $cond, $where);
+      # Return so we don't redefine the rule in our tables, don't check
+      # for ambiguous condition, etc.  The rule will be output anyway
+      # because '&read_am_file' ignores the return code.
+      return ();
     }
 
-  # Conditions for which the rule should be defined.
-  my @conds = $cond;
-
-  # Check ambiguous conditional definitions.
   my $rule = _crule $target;
-  my ($message, $ambig_cond) = $rule->conditions->ambiguous_p ($target, $cond);
-  if ($message)                        # We have an ambiguity.
-    {
-      if ($owner == RULE_USER)
-       {
-         # For user rules, just diagnose the ambiguity.
-         msg 'syntax', $where, "$message ...", partial => 1;
-         msg_cond_rule ('syntax', $ambig_cond, $target,
-                        "... '$target' previously defined here");
-         return ();
-       }
-      else
-       {
-         # FIXME: for Automake rules, we can't diagnose ambiguities yet.
-         # The point is that Automake doesn't propagate conditions
-         # everywhere.  For instance &handle_PROGRAMS doesn't care if
-         # bin_PROGRAMS was defined conditionally or not.
-         # On the following input
-         #   if COND1
-         #   foo:
-         #           ...
-         #   else
-         #   bin_PROGRAMS = foo
-         #   endif
-         # &handle_PROGRAMS will attempt to define a 'foo:' rule
-         # in condition TRUE (which conflicts with COND1).  Fixing
-         # this in &handle_PROGRAMS and siblings seems hard: you'd
-         # have to explain &file_contents what to do with a
-         # condition.  So for now we do our best *here*.  If 'foo:'
-         # was already defined in condition COND1 and we want to define
-         # it in condition TRUE, then define it only in condition !COND1.
-         # (See cond14.test and cond15.test for some test cases.)
-         @conds = $rule->not_always_defined_in_cond ($cond)->conds;
-
-         # No conditions left to define the rule.
-         # Warn, because our workaround is meaningless in this case.
-         if (scalar @conds == 0)
-           {
-             msg 'syntax', $where, "$message ...", partial => 1;
-             msg_cond_rule ('syntax', $ambig_cond, $target,
-                            "... '$target' previously defined here");
-             return ();
-           }
-       }
-    }
+
+  # Conditions for which the rule should be defined.  Due to some
+  # complications in the automake internals, this aspect is not as
+  # obvious as it might be, and in come cases this list must contain
+  # other entries in addition to '$cond'.  See the comments in
+  # '_conditionals_for_rule' for a rationale.
+  my @conds = _conditionals_for_rule ($rule, $owner, $cond, $where);
+
+  # Stop if we had ambiguous conditional definitions.
+  return unless @conds;
 
   # Finally define this rule.
   for my $c (@conds)
@@ -807,8 +831,6 @@ sub define ($$$$$)
          # declared in SUFFIXES and are not known language
          # extensions).  Automake will complete SUFFIXES from
          # @suffixes automatically (see handle_footer).
-
-
          || ($t =~ /$_SUFFIX_RULE_PATTERN/o && accept_extensions($1)))
        {
          ++$inference_rule_count;


hooks/post-receive
-- 
GNU Automake



reply via email to

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