mkdef.pl: Add cmd-line flag to differentiate shared libs and DSO.
authorDaniel Fiala <daniel@openssl.org>
Tue, 10 May 2022 12:39:19 +0000 (14:39 +0200)
committerTomas Mraz <tomas@openssl.org>
Fri, 13 May 2022 08:39:16 +0000 (10:39 +0200)
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)

Configurations/descrip.mms.tmpl
Configurations/unix-Makefile.tmpl
Configurations/windows-makefile.tmpl
util/mkdef.pl

index c202bd44319f675eb9384b39ada9e4a200261441..eb00587528efa67cdd3c6a97ec41469542f5dceb 100644 (file)
@@ -981,7 +981,7 @@ EOF
               ? '' : ' --case-insensitive';
           return <<"EOF";
 $target : $gen0 $deps $mkdef
-       \$(PERL) $mkdef$ord_ver --ordinals $gen0 --name $ord_name "--OS" "VMS"$case_insensitive > $target
+       \$(PERL) $mkdef$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name "--OS" "VMS"$case_insensitive > $target
 EOF
       } elsif (platform->isasm($args{src})) {
           #
index 35f03d69ec28657896b510d15d7957144baa56a4..5b8340dfaab19cb20eaf586c085092b1ffc3ab70 100644 (file)
@@ -1549,7 +1549,7 @@ EOF
           my $ord_name = $args{generator}->[1] || $args{product};
           return <<"EOF";
 $target: $gen0 $deps \$(SRCDIR)/util/mkdef.pl
-       \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $gen0  --name $ord_name --OS $mkdef_os > $target
+       \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --type $args{intent} --ordinals $gen0  --name $ord_name --OS $mkdef_os > $target
 EOF
       } elsif (platform->isasm($args{src})) {
           #
index a195bd596f77160420a667151aac90045df368de..5d874455f332168c9419899396aa0f844fb290de 100644 (file)
@@ -744,7 +744,7 @@ EOF
               $args{generator}->[1] || platform->dsoname($args{product});
           return <<"EOF";
 $target: $gen0 $deps $mkdef
-       "\$(PERL)" "$mkdef"$ord_ver --ordinals $gen0 --name $ord_name --OS windows > $target
+       "\$(PERL)" "$mkdef"$ord_ver --type $args{intent} --ordinals $gen0 --name $ord_name --OS windows > $target
 EOF
       } elsif (platform->isasm($args{src})) {
           #
index a1c76f7c972e9603150a79718f7c97185d8f2089..c84fb3348d30be7d6f63439cc63ccd1d8d2b90e9 100755 (executable)
@@ -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,