#! /usr/bin/env perl
# Copyright 2018 The OpenSSL Project Authors. All Rights Reserved.
#
-# Licensed under the OpenSSL license (the "License"). You may not use
+# 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
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
use lib '.';
use configdata;
+use File::Spec::Functions;
+use lib catdir($config{sourcedir}, 'Configurations');
+use platform;
+
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
$apiv = sprintf "%x%02x%02x", split(/\./, $config{api})
if $config{api};
-my $libname = $unified_info{sharednames}->{$name} // $name;
+my $libname = platform->sharedname($name);
my %OS_data = (
solaris => { writer => \&writer_linux,
_____
if (defined $version) {
- my ($libvmajor, $libvminor, $libvedit, $libvpatch) =
- $version =~ /^(\d+)_(\d+)_(\d+)([a-z]{0,2})(?:-.*)?$/;
- my $libvpatchnum = 0;
- for (split '', $libvpatch // '') {
- $libvpatchnum += ord(lc($_)) - 96;
- # To compensate because the letter 'z' is always followed by
- # another, i.e. doesn't add any value on its own
- $libvpatchnum-- if lc($_) eq 'z';
- }
- my $match1 = $libvmajor * 100 + $libvminor;
- my $match2 = $libvedit * 100 + $libvpatchnum;
+ $version =~ /^(\d+)\.(\d+)\.(\d+)/;
+ my $libvmajor = $1;
+ my $libvminor = $2 * 100 + $3;
print <<"_____";
-GSMATCH=LEQUAL,$match1,$match2
+GSMATCH=LEQUAL,$libvmajor,$libvminor
_____
}
}