X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=Configurations%2Fcommon.tmpl;h=a15971ef98ff2c8d9f338f3e80aed22822e233b6;hp=ad67591e9d54d41e5d696842ea25aa038958d7df;hb=da7e31e0c7be390d37b84c6200afd802def700c5;hpb=609e4be88e63e489c32438b3b0872fd891829301 diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index ad67591e9d..a15971ef98 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -52,18 +52,6 @@ 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. @@ -78,12 +66,15 @@ if ref $unified_info{generate}->{$src} eq ""; my $script = $unified_info{generate}->{$src}->[0]; $OUT .= generatesrc(src => $src, + product => $bin, generator => $unified_info{generate}->{$src}, generator_incs => $unified_info{includes}->{$script}, generator_deps => $unified_info{depends}->{$script}, deps => $unified_info{depends}->{$src}, incs => [ @{$unified_info{includes}->{$obj}}, @{$unified_info{includes}->{$bin}} ], + defs => [ @{$unified_info{defines}->{$obj}}, + @{$unified_info{defines}->{$bin}} ], %opts); foreach (@{$unified_info{depends}->{$src}}) { dogenerate($_, $obj, $bin, %opts); @@ -106,6 +97,8 @@ deps => $unified_info{depends}->{$obj}, incs => [ @{$unified_info{includes}->{$obj}}, @{$unified_info{includes}->{$bin}} ], + defs => [ @{$unified_info{defines}->{$obj}}, + @{$unified_info{defines}->{$bin}} ], %opts); foreach ((@{$unified_info{sources}->{$obj}}, @{$unified_info{depends}->{$obj}})) { @@ -116,34 +109,36 @@ } # dolib is responsible for building libraries. It will call - # libobj2shlib is shared libraries are produced, and obj2lib in all + # obj2shlib is shared libraries are produced, and obj2lib in all # cases. It also makes sure all object files for the library are # built. sub dolib { my $lib = shift; return "" if $cache{$lib}; unless ($disabled{shared} || $lib =~ /\.a$/) { - $OUT .= libobj2shlib(shlib => $unified_info{sharednames}->{$lib}, - lib => $lib, - objs => [ @{$unified_info{shared_sources}->{$lib}}, - @{$unified_info{sources}->{$lib}} ], - deps => [ reducedepends(resolvedepends($lib)) ], - installed => is_installed($lib)); + my $obj2shlib = defined &obj2shlib ? \&obj2shlib : \&libobj2shlib; + $OUT .= $obj2shlib->(lib => $lib, + attrs => $unified_info{attributes}->{$lib}, + objs => $unified_info{shared_sources}->{$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}->{$_}) { - doobj($_, $lib, intent => "lib", installed => is_installed($lib)); + doobj($_, $lib, intent => "shlib", + attrs => $unified_info{attributes}->{$lib}); } else { dogenerate($_, undef, undef, intent => "lib"); } } } $OUT .= obj2lib(lib => $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; } @@ -155,13 +150,18 @@ my $lib = shift; return "" if $cache{$lib}; $OUT .= obj2dso(lib => $lib, - objs => [ @{$unified_info{sources}->{$lib}}, - @{$unified_info{shared_sources}->{$lib}} ], - deps => [ resolvedepends($lib) ], - installed => is_installed($lib)); - foreach ((@{$unified_info{sources}->{$lib}}, - @{$unified_info{shared_sources}->{$lib}})) { - doobj($_, $lib, intent => "dso", installed => is_installed($lib)); + attrs => $unified_info{attributes}->{$lib}, + objs => $unified_info{shared_sources}->{$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}->{$_}) { + doobj($_, $lib, intent => "dso", + attrs => $unified_info{attributes}->{$lib}); + } else { + dogenerate($_, undef, $lib, intent => "dso"); + } } $cache{$lib} = 1; } @@ -173,11 +173,12 @@ return "" if $cache{$bin}; my $deps = [ reducedepends(resolvedepends($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}}) { - doobj($_, $bin, intent => "bin", installed => is_installed($bin)); + doobj($_, $bin, intent => "bin", + attrs => $unified_info{attributes}->{$bin}); } $cache{$bin} = 1; } @@ -188,8 +189,8 @@ my $script = shift; return "" if $cache{$script}; $OUT .= in2script(script => $script, - sources => $unified_info{sources}->{$script}, - installed => is_installed($script)); + attrs => $unified_info{attributes}->{$script}, + sources => $unified_info{sources}->{$script}); $cache{$script} = 1; } @@ -205,47 +206,6 @@ # Start with populating the cache with all the overrides %cache = map { $_ => 1 } @{$unified_info{overrides}}; - # For convenience collect information regarding directories where - # files are generated, those generated files and the end product - # they end up in where applicable. Then, add build rules for those - # directories - if (exists &generatedir) { - my %loopinfo = ( "dso" => [ @{$unified_info{engines}} ], - "lib" => [ @{$unified_info{libraries}} ], - "bin" => [ @{$unified_info{programs}} ], - "script" => [ @{$unified_info{scripts}} ] ); - foreach my $type (keys %loopinfo) { - foreach my $product (@{$loopinfo{$type}}) { - my %dirs = (); - my $pd = dirname($product); - - # We already have a "test" target, and the current directory - # is just silly to make a target for - $dirs{$pd} = 1 unless $pd eq "test" || $pd eq "."; - - foreach (@{$unified_info{sources}->{$product}}) { - my $d = dirname($_); - - # We don't want to create targets for source directories - # when building out of source - next if ($config{sourcedir} ne $config{builddir} - && $d =~ m|^\Q$config{sourcedir}\E|); - # We already have a "test" target, and the current directory - # is just silly to make a target for - next if $d eq "test" || $d eq "."; - - $dirs{$d} = 1; - push @{$unified_info{dirinfo}->{$d}->{deps}}, $_ - if $d ne $pd; - } - foreach (keys %dirs) { - push @{$unified_info{dirinfo}->{$_}->{products}->{$type}}, - $product; - } - } - } - } - # Build mandatory generated headers foreach (@{$unified_info{depends}->{""}}) { dogenerate($_); } @@ -257,8 +217,4 @@ foreach (@{$unified_info{scripts}}) { doscript($_); } foreach (sort keys %{$unified_info{dirinfo}}) { dodir($_); } - - # Finally, should there be any applicable BEGINRAW/ENDRAW sections, - # they are added here. - $OUT .= $_."\n" foreach @{$unified_info{rawlines}}; -}