Build: change remaining $unified_info{install} checks to use attributes
authorRichard Levitte <levitte@openssl.org>
Tue, 22 Jan 2019 14:46:54 +0000 (15:46 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 22 Jan 2019 15:12:47 +0000 (16:12 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8063)

Configurations/common.tmpl
Configurations/descrip.mms.tmpl
Configurations/platform/Unix.pm
Configurations/platform/VMS.pm
Configurations/platform/Windows.pm

index 132852c..53384c7 100644 (file)
      map { $replace{$_} // $_; } @newlist;
  }
 
      map { $replace{$_} // $_; } @newlist;
  }
 
- # is_installed checks if a given file will be installed (i.e. they are
- # not defined _NO_INST in build.info)
- sub is_installed {
-     my $product = shift;
-     if (grep { $product eq $_ }
-         map { (@{$unified_info{install}->{$_}}) }
-         keys %{$unified_info{install}}) {
-         return 1;
-     }
-     return 0;
- }
-
  # dogenerate is responsible for producing all the recipes that build
  # generated source files.  It recurses in case a dependency is also a
  # generated source file.
  # dogenerate is responsible for producing all the recipes that build
  # generated source files.  It recurses in case a dependency is also a
  # generated source file.
          $OUT .= $obj2shlib->(lib => $lib,
                               attrs => $unified_info{attributes}->{$lib},
                               objs => $unified_info{shared_sources}->{$lib},
          $OUT .= $obj2shlib->(lib => $lib,
                               attrs => $unified_info{attributes}->{$lib},
                               objs => $unified_info{shared_sources}->{$lib},
-                              deps => [ reducedepends(resolvedepends($lib)) ],
-                              installed => is_installed($lib));
+                              deps => [ reducedepends(resolvedepends($lib)) ]);
          foreach ((@{$unified_info{shared_sources}->{$lib}},
                    @{$unified_info{sources}->{$lib}})) {
              # If this is somehow a compiled object, take care of it that way
              # Otherwise, it might simply be generated
              if (defined $unified_info{sources}->{$_}) {
          foreach ((@{$unified_info{shared_sources}->{$lib}},
                    @{$unified_info{sources}->{$lib}})) {
              # If this is somehow a compiled object, take care of it that way
              # Otherwise, it might simply be generated
              if (defined $unified_info{sources}->{$_}) {
-                 doobj($_, $lib, intent => "shlib", installed => is_installed($lib));
+                 doobj($_, $lib, intent => "shlib",
+                       attrs => $unified_info{attributes}->{$lib});
              } else {
                  dogenerate($_, undef, undef, intent => "lib");
              }
              } else {
                  dogenerate($_, undef, undef, intent => "lib");
              }
                      attrs => $unified_info{attributes}->{$lib},
                      objs => [ @{$unified_info{sources}->{$lib}} ]);
      foreach (@{$unified_info{sources}->{$lib}}) {
                      attrs => $unified_info{attributes}->{$lib},
                      objs => [ @{$unified_info{sources}->{$lib}} ]);
      foreach (@{$unified_info{sources}->{$lib}}) {
-         doobj($_, $lib, intent => "lib", installed => is_installed($lib));
+         doobj($_, $lib, intent => "lib",
+               attrs => $unified_info{attributes}->{$lib});
      }
      $cache{$lib} = 1;
  }
      }
      $cache{$lib} = 1;
  }
      $OUT .= obj2dso(lib => $lib,
                      attrs => $unified_info{attributes}->{$lib},
                      objs => $unified_info{shared_sources}->{$lib},
      $OUT .= obj2dso(lib => $lib,
                      attrs => $unified_info{attributes}->{$lib},
                      objs => $unified_info{shared_sources}->{$lib},
-                     deps => [ resolvedepends($lib) ],
-                     installed => is_installed($lib));
+                     deps => [ resolvedepends($lib) ]);
      foreach (@{$unified_info{shared_sources}->{$lib}}) {
          # If this is somehow a compiled object, take care of it that way
          # Otherwise, it might simply be generated
          if (defined $unified_info{sources}->{$_}) {
      foreach (@{$unified_info{shared_sources}->{$lib}}) {
          # If this is somehow a compiled object, take care of it that way
          # Otherwise, it might simply be generated
          if (defined $unified_info{sources}->{$_}) {
-             doobj($_, $lib, intent => "dso", installed => is_installed($lib));
+             doobj($_, $lib, intent => "dso",
+                   attrs => $unified_info{attributes}->{$lib});
          } else {
              dogenerate($_, undef, $lib, intent => "dso");
          }
          } else {
              dogenerate($_, undef, $lib, intent => "dso");
          }
      $OUT .= obj2bin(bin => $bin,
                      attrs => $unified_info{attributes}->{$bin},
                      objs => [ @{$unified_info{sources}->{$bin}} ],
      $OUT .= obj2bin(bin => $bin,
                      attrs => $unified_info{attributes}->{$bin},
                      objs => [ @{$unified_info{sources}->{$bin}} ],
-                     deps => $deps,
-                     installed => is_installed($bin));
+                     deps => $deps);
      foreach (@{$unified_info{sources}->{$bin}}) {
      foreach (@{$unified_info{sources}->{$bin}}) {
-         doobj($_, $bin, intent => "bin", installed => is_installed($bin));
+         doobj($_, $bin, intent => "bin",
+               attrs => $unified_info{attributes}->{$bin});
      }
      $cache{$bin} = 1;
  }
      }
      $cache{$bin} = 1;
  }
      return "" if $cache{$script};
      $OUT .= in2script(script => $script,
                        attrs => $unified_info{attributes}->{$script},
      return "" if $cache{$script};
      $OUT .= in2script(script => $script,
                        attrs => $unified_info{attributes}->{$script},
-                       sources => $unified_info{sources}->{$script},
-                       installed => is_installed($script));
+                       sources => $unified_info{sources}->{$script});
      $cache{$script} = 1;
  }
 
      $cache{$script} = 1;
  }
 
index c63f4bd..acb5997 100644 (file)
@@ -877,16 +877,16 @@ EOF
       }
 
       my $cflags;
       }
 
       my $cflags;
-      if ($args{installed}) {
-          $cflags = { shlib => '$(LIB_CFLAGS)',
-                      lib => '$(LIB_CFLAGS)',
-                      dso => '$(DSO_CFLAGS)',
-                      bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
-      } else {
+      if ($args{attrs}->{noinst}) {
           $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)',
                       lib => '$(NO_INST_LIB_CFLAGS)',
                       dso => '$(NO_INST_DSO_CFLAGS)',
                       bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
           $cflags = { shlib => '$(NO_INST_LIB_CFLAGS)',
                       lib => '$(NO_INST_LIB_CFLAGS)',
                       dso => '$(NO_INST_DSO_CFLAGS)',
                       bin => '$(NO_INST_BIN_CFLAGS)' } -> {$args{intent}};
+      } else {
+          $cflags = { shlib => '$(LIB_CFLAGS)',
+                      lib => '$(LIB_CFLAGS)',
+                      dso => '$(DSO_CFLAGS)',
+                      bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
       }
       $cflags .= { shlib => '$(LIB_CPPFLAGS)',
                   lib => '$(LIB_CPPFLAGS)',
       }
       $cflags .= { shlib => '$(LIB_CPPFLAGS)',
                   lib => '$(LIB_CPPFLAGS)',
index 7f69cac..ca8d6bb 100644 (file)
@@ -44,9 +44,7 @@ sub staticname {
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
-    return $in_libname
-        unless ( grep { platform::BASE->staticname($_) eq $in_libname }
-                 @{$unified_info{install}->{libraries}} );
+    return $in_libname if $unified_info{attributes}->{$_[1]}->{noinst};
 
     # We currently return the same name anyway...  but we might choose to
     # append '_static' or '_a' some time in the future.
 
     # We currently return the same name anyway...  but we might choose to
     # append '_static' or '_a' some time in the future.
index 03e57e3..7aeb20b 100644 (file)
@@ -39,9 +39,7 @@ sub staticname {
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
-    return $in_libname
-        unless ( grep { platform::BASE->staticname($_) eq $in_libname }
-                 @{$unified_info{install}->{libraries}} );
+    return $in_libname if $unified_info{attributes}->{$_[1]}->{noinst};
 
     return platform::BASE::__concat($_[0]->osslprefix(),
                                     platform::BASE->staticname($_[1]),
 
     return platform::BASE::__concat($_[0]->osslprefix(),
                                     platform::BASE->staticname($_[1]),
index 3e13f6e..d1932a9 100644 (file)
@@ -30,9 +30,7 @@ sub staticname {
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
     # Non-installed libraries are *always* static, and their names remain
     # the same, except for the mandatory extension
     my $in_libname = platform::BASE->staticname($_[1]);
-    return $in_libname
-        unless ( grep { platform::BASE->staticname($_) eq $in_libname }
-                 @{$unified_info{install}->{libraries}} );
+    return $in_libname if $unified_info{attributes}->{$_[1]}->{noinst};
 
     # To make sure not to clash with an import library, we make the static
     # variant of our installed libraries get '_static' added to their names.
 
     # To make sure not to clash with an import library, we make the static
     # variant of our installed libraries get '_static' added to their names.