X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=sidebyside;f=Configurations%2Fcommon.tmpl;h=bf440d9d88b1ee642282854490c32d2e15f22619;hb=7f73eafe2f5014ce1f915702c19ee7274e6b8c2d;hp=94e49319a94d8310c9424e112e23004e7ca1976f;hpb=9dfc868025721873952f7765e59ae9fee45a276a;p=oweals%2Fopenssl.git diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index 94e49319a9..bf440d9d88 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -78,12 +78,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 +109,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,14 +121,15 @@ } # 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}, + my $obj2shlib = defined &obj2shlib ? \&obj2shlib : \&libobj2shlib; + $OUT .= $obj2shlib->(shlib => $unified_info{sharednames}->{$lib}, lib => $lib, objs => $unified_info{shared_sources}->{$lib}, deps => [ reducedepends(resolvedepends($lib)) ], @@ -158,7 +164,13 @@ deps => [ resolvedepends($lib) ], installed => is_installed($lib)); foreach (@{$unified_info{shared_sources}->{$lib}}) { - doobj($_, $lib, intent => "dso", installed => is_installed($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)); + } else { + dogenerate($_, undef, $lib, intent => "dso"); + } } $cache{$lib} = 1; } @@ -202,47 +214,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($_); }