summaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-05-24 14:06:00 +0200
committerRichard Levitte <levitte@openssl.org>2021-05-26 15:11:01 +0200
commita2405c5f2019707d1a4306f152faa9ccda5f4cd5 (patch)
tree528689875f29e32f651bc95a07ff9153bc50b405 /Configurations
parentbfd6b619b6ccba8aee6b1d9ea1af21f0e03567dc (diff)
Rework how providers/fipsmodule.cnf is produced
First of all, we have concluded that we can calculate the integrity checksum with a simple perl script. Second, having the production of providers/fipsmodule.cnf as a dependency for run_tests wasn't quite right. What we really want is to generate it as soon as a new providers/fips.so is produced. That required a small bit of fiddling with how diverse dependencies are made. Fixes #15166 Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15436)
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/descrip.mms.tmpl24
-rw-r--r--Configurations/unix-Makefile.tmpl21
-rw-r--r--Configurations/windows-makefile.tmpl26
3 files changed, 47 insertions, 24 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 4188e29020..3e389215e1 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -269,15 +269,23 @@ SHLIB_TARGET={- $target{shared_target} -}
LIBS={- join(", ", map { "-\n\t".$_.".OLB" } @libs) -}
SHLIBS={- join(", ", map { "-\n\t".$_.".EXE" } @shlibs) -}
-FIPSMODULENAME={- # We do some extra checking here, as there should be only one
- use File::Basename;
- my @fipsmodules =
- grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
- && $unified_info{attributes}->{modules}->{$_}->{fips} }
- @{$unified_info{modules}};
- die "More that one FIPS module" if scalar @fipsmodules > 1;
+MODULES={- join(", ", map { "-\n\t".$_.".EXE" }
+ # Drop all modules that are dependencies, they will
+ # be processed through their dependents
+ grep { my $x = $_;
+ !grep { grep { $_ eq $x } @$_ }
+ values %{$unified_info{depends}} }
+ @{$unified_info{modules}}) -}
+FIPSMODULE={- # We do some extra checking here, as there should be only one
+ use File::Basename;
+ our @fipsmodules =
+ grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+ && $unified_info{attributes}->{modules}->{$_}->{fips} }
+ @{$unified_info{modules}};
+ die "More that one FIPS module" if scalar @fipsmodules > 1;
+ join(" ", map { platform->dso($_) } @fipsmodules) -}
+FIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1;
join(", ", map { basename(platform->dso($_)) } @fipsmodules) -}
-MODULES={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{modules}}) -}
PROGRAMS={- join(", ", map { "-\n\t".$_.".EXE" } @{$unified_info{programs}}) -}
SCRIPTS={- join(", ", map { "-\n\t".$_ } @{$unified_info{scripts}}) -}
{- output_off() if $disabled{makedepend}; "" -}
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
index 5a5d44ce15..00bd2d7c55 100644
--- a/Configurations/unix-Makefile.tmpl
+++ b/Configurations/unix-Makefile.tmpl
@@ -90,14 +90,21 @@ SHLIB_INFO={- join(" \\\n" . ' ' x 11,
MODULES={- join(" \\\n" . ' ' x 8,
fill_lines(" ", $COLUMNS - 8,
map { platform->dso($_) }
+ # Drop all modules that are dependencies, they will
+ # be processed through their dependents
+ grep { my $x = $_;
+ !grep { grep { $_ eq $x } @$_ }
+ values %{$unified_info{depends}} }
@{$unified_info{modules}})) -}
-FIPSMODULENAME={- # We do some extra checking here, as there should be only one
- use File::Basename;
- my @fipsmodules =
- grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
- && $unified_info{attributes}->{modules}->{$_}->{fips} }
- @{$unified_info{modules}};
- die "More that one FIPS module" if scalar @fipsmodules > 1;
+FIPSMODULE={- # We do some extra checking here, as there should be only one
+ use File::Basename;
+ our @fipsmodules =
+ grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+ && $unified_info{attributes}->{modules}->{$_}->{fips} }
+ @{$unified_info{modules}};
+ die "More that one FIPS module" if scalar @fipsmodules > 1;
+ join(" ", map { platform->dso($_) } @fipsmodules) -}
+FIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1;
join(" ", map { basename(platform->dso($_)) } @fipsmodules) -}
PROGRAMS={- join(" \\\n" . ' ' x 9,
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index b36592d383..984693d817 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -49,17 +49,25 @@ SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
LIBS={- join(" ", map { ( platform->sharedlib_import($_), platform->staticlib($_) ) } @{$unified_info{libraries}}) -}
SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
SHLIBPDBS={- join(" ", map { platform->sharedlibpdb($_) // () } @{$unified_info{libraries}}) -}
-MODULES={- our @MODULES = map { platform->dso($_) } @{$unified_info{modules}};
+MODULES={- our @MODULES = map { platform->dso($_) }
+ # Drop all modules that are dependencies, they will
+ # be processed through their dependents
+ grep { my $x = $_;
+ !grep { grep { $_ eq $x } @$_ }
+ values %{$unified_info{depends}} }
+ @{$unified_info{modules}};
join(" ", @MODULES) -}
MODULEPDBS={- join(" ", map { platform->dsopdb($_) } @{$unified_info{modules}}) -}
-FIPSMODULENAME={- # We do some extra checking here, as there should be only one
- use File::Basename;
- my @fipsmodules =
- grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
- && $unified_info{attributes}->{modules}->{$_}->{fips} }
- @{$unified_info{modules}};
- die "More that one FIPS module" if scalar @fipsmodules > 1;
- join(" ", map { basename(platform->dso($_)) } @fipsmodules) -}
+FIPSMODULE={- # We do some extra checking here, as there should be only one
+ use File::Basename;
+ our @fipsmodules =
+ grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
+ && $unified_info{attributes}->{modules}->{$_}->{fips} }
+ @{$unified_info{modules}};
+ die "More that one FIPS module" if scalar @fipsmodules > 1;
+ join(" ", map { basename(platform->dso($_)) } @fipsmodules) -}
+FIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1;
+ join(", ", map { basename(platform->dso($_)) } @fipsmodules) -}
PROGRAMS={- our @PROGRAMS = map { platform->bin($_) } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
SCRIPTS={- our @SCRIPTS = @{$unified_info{scripts}}; join(" ", @SCRIPTS) -}