]> sourceware.org Git - automake.git/commitdiff
* automake.in (&file_contents): Maintain $cond_string sync with
authorAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 16:58:43 +0000 (16:58 +0000)
committerAkim Demaille <akim@epita.fr>
Fri, 23 Mar 2001 16:58:43 +0000 (16:58 +0000)
@cond_stack.
Output rules only if not under `FALSE'.
Define variables under $cond_string.
* scripts.am: For the time being if/endif does not work properly
with macros.

ChangeLog
automake.in
lib/am/scripts.am
scripts.am

index e19200e097110e77aa12f3ecd891ca264e5e4572..02ce4b1f6f3f31cdd713c0f23ec8675ae6491c26 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-03-23  Akim Demaille  <akim@epita.fr>
+
+       * automake.in (&file_contents): Maintain $cond_string sync with
+       @cond_stack.
+       Output rules only if not under `FALSE'.
+       Define variables under $cond_string.
+       * scripts.am: For the time being if/endif does not work properly
+       with macros.
+
 2001-03-23  Akim Demaille  <akim@epita.fr>
 
        * automake.in (IF_PATTERN): Unobfuscate the parens.
index a538b490ade31595d9f68e0ef7d9392bacc12de3..b5208a371ff98d82116591c7d3aa9d13c092758c 100755 (executable)
@@ -6740,6 +6740,7 @@ sub file_contents ($%)
     my $comment = '';
     my $separator = '';
     my @cond_stack = ();
+    my $cond_string = '';
     foreach (split (/(?<!\\)\n(?![\t#])/, $contents))
     {
         # Strip leading new lines.  This can happen for comments:
@@ -6775,6 +6776,7 @@ sub file_contents ($%)
                if ! $configure_cond{$cond} && $cond !~ /^TRUE|FALSE$/;
            push (@cond_stack,
                  ($cond =~ /^TRUE|FALSE$/) ? "$cond" : "${cond}_TRUE");
+           $cond_string = conditional_string (@cond_stack);
        }
        elsif (/$ELSE_PATTERN/o)
        {
@@ -6789,6 +6791,7 @@ sub file_contents ($%)
            else
            {
                $cond_stack[$#cond_stack] =~ s/TRUE$/FALSE/;
+               $cond_string = conditional_string (@cond_stack);
            }
        }
        elsif (/$ENDIF_PATTERN/o)
@@ -6800,6 +6803,7 @@ sub file_contents ($%)
            else
            {
                pop @cond_stack;
+               $cond_string = conditional_string (@cond_stack);
            }
        }
 
@@ -6827,7 +6831,10 @@ sub file_contents ($%)
            {
              # FIXME: We are not robust to people defining several targets
              # at once, only some of them being in %dependencies.
-             if (defined $dependencies{$_})
+
+             # Output only if not in FALSE.
+             if (defined $dependencies{$_}
+                 && $cond_string ne "#")
                {
                  &depend ($_, @deps);
                  $actions{$_} .= $actions;
@@ -6836,11 +6843,11 @@ sub file_contents ($%)
                {
                  # Free lance dependency.  Output the rule for all the
                  # targets instead of one by one.
-                 if (!defined $targets{$targets})
+                 if (!defined $targets{$targets}
+                     && $cond_string ne "#")
                    {
                      $result_rules .= "$separator$comment$paragraph\n";
-                     rule_define ($targets, 1,
-                                  conditional_string (@cond_stack), $.);
+                     rule_define ($targets, 1, $cond_string, $.);
                    }
                  $comment = $separator = '';
                  last;
@@ -6854,7 +6861,7 @@ sub file_contents ($%)
              if /\\$/;;
 
            # Accumulating variables must not be output.
-           macro_define ($var, 1, $type, '', $val, $.);
+           macro_define ($var, 1, $type, $cond_string, $val, $.);
 
            # If the user has set some variables we were in charge
            # of (which is detected by the first reading of
index 1df3b9d70c5e23b6fbb93839d5823f47d680b0fb..52b5414a8cdbd1987401bd5903437e8aeab65fd4 100644 (file)
@@ -22,7 +22,8 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+## if doesn't work properly for Automake variables yet.
+?INSTALL?_am_installdirs += $(DESTDIR)$(%NDIR%dir)
 ?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
 ?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
index 1df3b9d70c5e23b6fbb93839d5823f47d680b0fb..52b5414a8cdbd1987401bd5903437e8aeab65fd4 100644 (file)
@@ -22,7 +22,8 @@
 ## ------------ ##
 
 if %?INSTALL%
-_am_installdirs += $(DESTDIR)$(%NDIR%dir)
+## if doesn't work properly for Automake variables yet.
+?INSTALL?_am_installdirs += $(DESTDIR)$(%NDIR%dir)
 ?EXEC?.PHONY install-exec-am: install-%DIR%SCRIPTS
 ?!EXEC?.PHONY install-data-am: install-%DIR%SCRIPTS
 install-%DIR%SCRIPTS: $(%DIR%_SCRIPTS)
This page took 0.052678 seconds and 5 git commands to generate.