From fc6a6a10309704e10c4493d5ee5f834a3307ffa3 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Fri, 4 Oct 2002 21:22:47 +0000 Subject: [PATCH] Add version info to Win32 DLLs. We might want to edit the strings a bit... Maybe add to 0.9.7 too? --- CHANGES | 3 +++ Configure | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ util/mk1mf.pl | 21 ++++++++++++++++ util/pl/VC-32.pl | 1 + 4 files changed, 89 insertions(+) diff --git a/CHANGES b/CHANGES index 54fb8daecd..6bf38c2142 100644 --- a/CHANGES +++ b/CHANGES @@ -4,6 +4,9 @@ Changes between 0.9.7 and 0.9.8 [xx XXX 2002] + *) Add version info to Win32 DLLs. + [Peter 'Luna' Runestig" ] + *) Add new 'medium level' PKCS#12 API. Certificates and keys can be added using this API to created arbitrary PKCS#12 files while avoiding the low level API. diff --git a/Configure b/Configure index 2566a3fbe4..83a9d94f5a 100755 --- a/Configure +++ b/Configure @@ -1156,6 +1156,7 @@ if ($rmd160_obj =~ /\.o$/) $cflags =~ s/([\\\"])/\\\1/g; my $version = "unknown"; +my $version_num = "unknown"; my $major = "unknown"; my $minor = "unknown"; my $shlib_version_number = "unknown"; @@ -1167,6 +1168,7 @@ open(IN,') { $version=$1 if /OPENSSL.VERSION.TEXT.*OpenSSL (\S+) /; + $version_num=$1 if /OPENSSL.VERSION.NUMBER.*0x(\S+)/; $shlib_version_number=$1 if /SHLIB_VERSION_NUMBER *"([^"]+)"/; $shlib_version_history=$1 if /SHLIB_VERSION_HISTORY *"([^"]*)"/; } @@ -1499,6 +1501,68 @@ EOF } } +# create the ms/version32.rc file if needed +if ($IsWindows) { + my ($v1, $v2, $v3, $v4); + if ($version_num =~ /(^[0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})/i) { + $v1=hex $1; + $v2=hex $2; + $v3=hex $3; + $v4=hex $4; + } + open (OUT,">ms/version32.rc") || die "Can't open ms/version32.rc"; + print OUT < + +LANGUAGE 0x09,0x01 + +1 VERSIONINFO + FILEVERSION $v1,$v2,$v3,$v4 + PRODUCTVERSION $v1,$v2,$v3,$v4 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x01L +#else + FILEFLAGS 0x00L +#endif + FILEOS VOS__WINDOWS32 + FILETYPE VFT_DLL + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + // Required: + VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0" + VALUE "FileDescription", "OpenSSL Shared Library\\0" + VALUE "FileVersion", "$version\\0" +#if defined(CRYPTO) + VALUE "InternalName", "libeay32\\0" + VALUE "OriginalFilename", "libeay32.dll\\0" +#elif defined(SSL) + VALUE "InternalName", "ssleay32\\0" + VALUE "OriginalFilename", "ssleay32.dll\\0" +#endif + VALUE "ProductName", "The OpenSSL Toolkit\\0" + VALUE "ProductVersion", "$version\\0" + // Optional: + //VALUE "Comments", "\\0" + VALUE "LegalCopyright", "Copyright © 1998-2002 The OpenSSL Project. Copyright © 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0" + //VALUE "LegalTrademarks", "\\0" + //VALUE "PrivateBuild", "\\0" + //VALUE "SpecialBuild", "\\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 0x4b0 + END +END +EOF + close(OUT); + } + print <