summaryrefslogtreecommitdiff
path: root/util/mkdef.pl
diff options
context:
space:
mode:
authorDaniel Fiala <daniel@openssl.org>2022-05-10 14:39:19 +0200
committerTomas Mraz <tomas@openssl.org>2022-05-13 10:39:16 +0200
commite5f831a065df1d6e4640ef389f8594a5f10c9c8e (patch)
treee54bd5e50690c5eb767d1b2aa1dfb8626ec55ad2 /util/mkdef.pl
parentf505be999f00232702aeb6918e4a1ffa0b9b588b (diff)
downloadopenssl-new-e5f831a065df1d6e4640ef389f8594a5f10c9c8e.tar.gz
mkdef.pl: Add cmd-line flag to differentiate shared libs and DSO.
Fixes openssl#16984. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18284)
Diffstat (limited to 'util/mkdef.pl')
-rwxr-xr-xutil/mkdef.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/util/mkdef.pl b/util/mkdef.pl
index a1c76f7c97..c84fb3348d 100755
--- a/util/mkdef.pl
+++ b/util/mkdef.pl
@@ -29,6 +29,7 @@ my $name = undef; # internal library/module name
my $ordinals_file = undef; # the ordinals file to use
my $version = undef; # the version to use for the library
my $OS = undef; # the operating system family
+my $type = 'lib'; # either lib or dso
my $verbose = 0;
my $ctest = 0;
my $debug = 0;
@@ -40,6 +41,7 @@ GetOptions('name=s' => \$name,
'ordinals=s' => \$ordinals_file,
'version=s' => \$version,
'OS=s' => \$OS,
+ 'type=s' => \$type,
'ctest' => \$ctest,
'verbose' => \$verbose,
# For VMS
@@ -48,6 +50,8 @@ GetOptions('name=s' => \$name,
die "Please supply arguments\n"
unless $name && $ordinals_file && $OS;
+die "--type argument must be equal to 'lib' or 'dso'"
+ if $type ne 'lib' && $type ne 'dso';
# When building a "variant" shared library, with a custom SONAME, also customize
# all the symbol versions. This produces a shared object that can coexist
@@ -101,7 +105,7 @@ die "Please supply arguments\n"
#
(my $SO_VARIANT = uc($target{"shlib_variant"} // '')) =~ s/\W/_/g;
-my $libname = platform->sharedname($name);
+my $libname = $type eq 'lib' ? platform->sharedname($name) : platform->dsoname($name);
my %OS_data = (
solaris => { writer => \&writer_linux,