From: Richard Levitte Date: Sun, 31 Mar 2019 13:17:58 +0000 (+0200) Subject: Configuration / build: make it possible to disable building of modules X-Git-Tag: openssl-3.0.0-alpha1~2252 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=34786bdee0b2af74a84a32ca32bb1c2c256e6014 Configuration / build: make it possible to disable building of modules While we're at it, sort out inconsistencies with the build of modules: - not building shared libraries means not building dynamic engines. However, other modules may still be built. - not having DSO functionality doesn't mean not to build modules (even though we can't use them from apps linked with libraries that are built this way). Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/8623) --- diff --git a/Configure b/Configure index aaf251de80..62f4af5fa7 100755 --- a/Configure +++ b/Configure @@ -377,6 +377,7 @@ my @disablables = ( "md2", "md4", "mdc2", + "module", "msan", "multiblock", "nextprotoneg", @@ -493,9 +494,23 @@ my @disable_cascades = ( "crypto-mdebug" => [ "crypto-mdebug-backtrace" ], - # Without position independent code, there can be no shared libraries or DSOs - "pic" => [ "shared" ], + # If no modules, then no dynamic engines either + "module" => [ "dynamic-engine" ], + + # Without shared libraries, dynamic engines aren't possible. + # This is due to them having to link with libcrypto and register features + # using the ENGINE functionality, and since that relies on global tables, + # those *have* to be exacty the same as the ones accessed from the app, + # which cannot be guaranteed if shared libraries aren't present. + # (note that even with shared libraries, both the app and dynamic engines + # must be linked with the same library) "shared" => [ "dynamic-engine" ], + # Other modules don't necessarily have to link with libcrypto, so shared + # libraries do not have to be a condition to produce those. + + # Without position independent code, there can be no shared libraries + # or modules. + "pic" => [ "shared", "module" ], "engine" => [ grep /eng$/, @disablables ], "hw" => [ "padlockeng" ], @@ -1206,7 +1221,7 @@ foreach my $what (sort keys %disabled) { $config{options} .= " no-$what"; - if (!grep { $what eq $_ } ( 'buildtest-c++', 'threads', 'shared', + if (!grep { $what eq $_ } ( 'buildtest-c++', 'threads', 'shared', 'module', 'pic', 'dynamic-engine', 'makedepend', 'zlib-dynamic', 'zlib', 'sse2' )) { (my $WHAT = uc $what) =~ s|-|_|g; @@ -1312,9 +1327,8 @@ if ($target{shared_target} eq "") { $no_shared_warn = 1 if (!$disabled{shared} || !$disabled{"dynamic-engine"}); - $disabled{shared} = "no-shared-target"; $disabled{pic} = $disabled{shared} = $disabled{"dynamic-engine"} = - "no-shared-target"; + $disabled{module} = "no-shared-target"; } if ($disabled{"dynamic-engine"}) { diff --git a/test/build.info b/test/build.info index 13d6630877..04b356bd7d 100644 --- a/test/build.info +++ b/test/build.info @@ -603,7 +603,7 @@ IF[{- !$disabled{tests} -}] SOURCE[provider_test]=provider_test.c p_test.c INCLUDE[provider_test]=../include ../apps/include DEPEND[provider_test]=../libcrypto.a libtestutil.a - IF[{- !$disabled{shared} -}] + IF[{- !$disabled{module} -}] MODULES{noinst}=p_test SOURCE[p_test]=p_test.c INCLUDE[p_test]=../include