diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2002-10-04 21:22:47 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2002-10-04 21:22:47 +0000 |
commit | fc6a6a10309704e10c4493d5ee5f834a3307ffa3 (patch) | |
tree | 6c473ff5cf2197f48398d70c07401c69f96e5ee9 | |
parent | 3d840c827f1190f11780a5bdb05665d341fcec78 (diff) |
Add version info to Win32 DLLs.
We might want to edit the strings a bit...
Maybe add to 0.9.7 too?
-rw-r--r-- | CHANGES | 3 | ||||
-rwxr-xr-x | Configure | 64 | ||||
-rwxr-xr-x | util/mk1mf.pl | 21 | ||||
-rw-r--r-- | util/pl/VC-32.pl | 1 |
4 files changed, 89 insertions, 0 deletions
@@ -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" <peter@runestig.com>] + *) 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. @@ -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,'<crypto/opensslv.h') || die "unable to read opensslv.h:$!\n"; while (<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 <<EOF; +#include <winver.h> + +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 <<EOF; Configured for $target. diff --git a/util/mk1mf.pl b/util/mk1mf.pl index 866629fe25..bdb176d668 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -288,6 +288,7 @@ SRC_D=$src_dir LINK=$link LFLAGS=$lflags +RSC=$rsc BN_ASM_OBJ=$bn_asm_obj BN_ASM_SRC=$bn_asm_src @@ -600,6 +601,18 @@ foreach (values %lib_nam) $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); } +# hack to add version info on MSVC +if (($platform eq "VC-WIN32") || ($platform eq "VC-NT")) { + $rules.= <<"EOF"; +\$(OBJ_D)\\\$(CRYPTO).res: ms\\version32.rc + \$(RSC) /fo"\$(OBJ_D)\\\$(CRYPTO).res" /d CRYPTO ms\\version32.rc + +\$(OBJ_D)\\\$(SSL).res: ms\\version32.rc + \$(RSC) /fo"\$(OBJ_D)\\\$(SSL).res" /d SSL ms\\version32.rc + +EOF +} + $defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep); foreach (split(/\s+/,$test)) { @@ -755,6 +768,14 @@ sub do_defs $Vars{$var}.="$t "; $ret.=$t; } + # hack to add version info on MSVC + if ($shlib && ($platform eq "VC-WIN32") || ($platform eq "VC-NT")) + { + if ($var eq "CRYPTOOBJ") + { $ret.="\$(OBJ_D)\\\$(CRYPTO).res "; } + elsif ($var eq "SSLOBJ") + { $ret.="\$(OBJ_D)\\\$(SSL).res "; } + } chop($ret); $ret.="\n\n"; return($ret); diff --git a/util/pl/VC-32.pl b/util/pl/VC-32.pl index d6e3a11530..334a53f70b 100644 --- a/util/pl/VC-32.pl +++ b/util/pl/VC-32.pl @@ -32,6 +32,7 @@ $ofile="/Fo"; # EXE linking stuff $link="link"; +$rsc="rc"; $efile="/out:"; $exep='.exe'; if ($no_sock) |