#! /usr/bin/env perl
-# Copyright 2018-2020 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2018-2024 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
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;
'ordinals=s' => \$ordinals_file,
'version=s' => \$version,
'OS=s' => \$OS,
+ 'type=s' => \$type,
'ctest' => \$ctest,
'verbose' => \$verbose,
# For VMS
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
# 0x0000000000000001 (NEEDED) Shared library: [libcrypto-opt.so.1.1]
# 0x000000000000000e (SONAME) Library soname: [libssl-opt.so.1.1]
#
-# We case-fold the variant tag to upper case and replace all non-alnum
+# We case-fold the variant tag to uppercase and replace all non-alnum
# characters with "_". This yields the following symbol versions:
#
# $ nm libcrypto.so | grep -w A
#
(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,
aix => { writer => \&writer_aix,
sort => sorter_unix(),
platforms => { UNIX => 1 } },
+ "aix-solib" => 'aix', # alias
VMS => { writer => \&writer_VMS,
sort => OpenSSL::Ordinals::by_number(),
platforms => { VMS => 1 } },