X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fmkrc.pl;h=6762bc4a5698e085a099c4518381e37e2ba21632;hp=8b74ff8adc5617dd55573105613358d523766702;hb=af7d8d3446d640018bbeb9879ac585025b949832;hpb=1407f856ab790f8028db1ecfb354d64bfb8ca054 diff --git a/util/mkrc.pl b/util/mkrc.pl index 8b74ff8adc..6762bc4a56 100755 --- a/util/mkrc.pl +++ b/util/mkrc.pl @@ -1,37 +1,52 @@ -#!/bin/env perl +#! /usr/bin/env perl +# Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved. # +# Licensed under the OpenSSL license (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 strict; +use warnings; use lib "."; use configdata; use File::Spec::Functions; -my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h"); +my $versionfile = catfile( $config{sourcedir}, "include/openssl/opensslv.h" ); + +my ( $ver, $v1, $v2, $v3, $v4, $beta, $version ); open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n"; -while() { +while () { if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) { - $ver = hex($1); - $v1 = ($ver>>28); - $v2 = ($ver>>20)&0xff; - $v3 = ($ver>>12)&0xff; - $v4 = ($ver>> 4)&0xff; - $beta = $ver&0xf; - $version = "$v1.$v2.$v3"; - if ($beta==0xf) { $version .= chr(ord('a')+$v4-1) if ($v4); } - elsif ($beta==0){ $version .= "-dev"; } - else { $version .= "-beta$beta"; } - last; + $ver = hex($1); + $v1 = ( $ver >> 28 ); + $v2 = ( $ver >> 20 ) & 0xff; + $v3 = ( $ver >> 12 ) & 0xff; + $v4 = ( $ver >> 4 ) & 0xff; + $beta = $ver & 0xf; + $version = "$v1.$v2.$v3"; + if ( $beta == 0xf ) { + $version .= chr( ord('a') + $v4 - 1 ) if ($v4); + } elsif ( $beta == 0 ) { + $version .= "-dev"; + } else { + $version .= "-beta$beta"; + } + last; } } close(FD); -$filename = $ARGV[0]; $filename =~ /(.*)\.([^.]+)$/; -$basename = $1; -$extname = $2; - -if ($extname =~ /dll/i) { $description = "OpenSSL shared library"; } -else { $description = "OpenSSL application"; } +my $filename = $ARGV[0]; +my $description = "OpenSSL library"; +my $vft = "VFT_DLL"; +if ( $filename =~ /openssl/i ) { + $description = "OpenSSL application"; + $vft = "VFT_APP"; +} +my $YEAR = [localtime()]->[5] + 1900; print <<___; #include @@ -47,7 +62,7 @@ LANGUAGE 0x09,0x01 FILEFLAGS 0x00L #endif FILEOS VOS__WINDOWS32 - FILETYPE VFT_DLL + FILETYPE $vft FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" @@ -55,16 +70,16 @@ BEGIN BLOCK "040904b0" BEGIN // Required: - VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0" + VALUE "CompanyName", "The OpenSSL Project, https://www.openssl.org/\\0" VALUE "FileDescription", "$description\\0" VALUE "FileVersion", "$version\\0" - VALUE "InternalName", "$basename\\0" + VALUE "InternalName", "$filename\\0" VALUE "OriginalFilename", "$filename\\0" VALUE "ProductName", "The OpenSSL Toolkit\\0" VALUE "ProductVersion", "$version\\0" // Optional: //VALUE "Comments", "\\0" - VALUE "LegalCopyright", "Copyright © 1998-2015 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" + VALUE "LegalCopyright", "Copyright 1998-$YEAR The OpenSSL Authors. All rights reserved.\\0" //VALUE "LegalTrademarks", "\\0" //VALUE "PrivateBuild", "\\0" //VALUE "SpecialBuild", "\\0"