[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Sat Feb 27 18:19:00 UTC 2016


The branch master has been updated
       via  b23238f9aa95bcc31a369d3b24616f4f99691052 (commit)
      from  150a4790cb01d003b2eb9b86c9906efc4353e6d9 (commit)


- Log -----------------------------------------------------------------
commit b23238f9aa95bcc31a369d3b24616f4f99691052
Author: Richard Levitte <levitte at openssl.org>
Date:   Sat Feb 27 19:12:14 2016 +0100

    Keep a cache of files that already have a recipe, in common.tmpl
    
    We don't want recipes for the same files generated more than once
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

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

Summary of changes:
 Configurations/common.tmpl | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index f8f37ae..7e452dd 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -1,6 +1,7 @@
 {- # -*- Mode: perl -*-
 
-     my $a;
+     # A cache of objects for which a recipe has already been generated
+     my %cache;
 
  # resolvedepends and reducedepends work in tandem to make sure
  # there are no duplicate dependencies and that they are in the
@@ -35,6 +36,7 @@
  # object files as well as dependency files.
  sub doobj {
      my $obj = shift;
+     return "" if $cache{$obj};
      (my $obj_no_o = $obj) =~ s|\.o$||;
      my $bin = shift;
      my %opts = @_;
@@ -46,6 +48,7 @@
                                    @{$unified_info{includes}->{$obj}} ],
                          %opts);
      }
+     $cache{$obj} = 1;
  }
 
  # dolib is responsible for building libraries.  It will call
@@ -54,6 +57,7 @@
  # built.
  sub dolib {
      my $lib = shift;
+     return "" if $cache{$lib};
      unless ($disabled{shared}) {
          my %ordinals =
              $unified_info{ordinals}->{$lib}
@@ -69,6 +73,7 @@
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$lib}} ]);
      map { doobj($_, $lib, intent => "lib") } @{$unified_info{sources}->{$lib}};
+     $cache{$lib} = 1;
  }
 
  # doengine is responsible for building engines.  It will call
@@ -76,31 +81,37 @@
  # are built.
  sub doengine {
      my $lib = shift;
+     return "" if $cache{$lib};
      $OUT .= obj2dso(lib => $lib,
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$lib}} ],
                      deps => [ resolvedepends($lib) ]);
      map { doobj($_, $lib, intent => "dso") } @{$unified_info{sources}->{$lib}};
+     $cache{$lib} = 1;
  }
 
  # dobin is responsible for building programs.  It will call obj2bin,
  # and also makes sure all object files for the library are built.
  sub dobin {
      my $bin = shift;
+     return "" if $cache{$bin};
      my $deps = [ reducedepends(resolvedepends($bin)) ];
      $OUT .= obj2bin(bin => $bin,
                      objs => [ map { (my $x = $_) =~ s|\.o$||; $x }
                                @{$unified_info{sources}->{$bin}} ],
                      deps => $deps);
      map { doobj($_, $bin, intent => "bin") } @{$unified_info{sources}->{$bin}};
+     $cache{$bin} = 1;
  }
 
  # dobin is responsible for building scripts from templates.  It will
  # call in2script.
  sub doscript {
      my $script = shift;
+     return "" if $cache{$script};
      $OUT .= in2script(script => $script,
                        sources => $unified_info{sources}->{$script});
+     $cache{$script} = 1;
  }
 
  # Build all known libraries, engines, programs and scripts.


More information about the openssl-commits mailing list