From 0ef1ce49eeed417c143a8c1bf77ce0d843306e3d Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Thu, 17 Mar 2016 22:29:20 +0100 Subject: Remove generation of ms/version32.rc from Configure, use util/mkrc.pl utils/mkrc.pl was added a while ago as a better generator for the Windows DLL resource file. Finalize the change by removing the ms/version32.rc generator from Configure and adding resource file support using mkrc.pl in Configurations/windows-makefile.pl Reviewed-by: Andy Polyakov --- Configurations/10-main.conf | 2 ++ Configurations/windows-makefile.tmpl | 9 +++++- Configure | 60 ------------------------------------ 3 files changed, 10 insertions(+), 61 deletions(-) diff --git a/Configurations/10-main.conf b/Configurations/10-main.conf index 87160968ca..5b64803810 100644 --- a/Configurations/10-main.conf +++ b/Configurations/10-main.conf @@ -1222,6 +1222,8 @@ sub vc_wince_info { cc => "cl", cflags => "-W3 -wd4090 -Gs0 -GF -Gy -nologo -DOPENSSL_SYS_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE", coutflag => "/Fo", + rc => "rc", + rcoutflag => "/fo", lib_cflags => sub { join(" ", ($disabled{shared} ? "/Zl" : ()), "/Zi /Fdlib") }, diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index e4faa95d1f..89c9e49c1f 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -97,6 +97,8 @@ ENGINESDIR={- use File::Spec::Functions; CC={- $target{cc} -} CFLAGS={- join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}})) -} {- join(" ", quotify_l("-DENGINESDIR=\"$enginesdir\"", "-DOPENSSLDIR=\"$openssldir\"")) -} {- $target{cflags} -} {- $config{cflags} -} COUTFLAG={- $target{coutflag} || "/Fo" -} +RC={- $target{rc} || "rc" -} +RCOUTFLAG={- $target{rcoutflag} || "/fo" -} LD={- $target{ld} || "link" -} LDFLAGS={- $target{lflags} -} LDOUTFLAG={- $target{loutflag} || "/out:" -} @@ -343,15 +345,20 @@ EOF my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir}, "util", "mkdef.pl")), rel2abs($config{builddir})); + my $mkrc_pl = abs2rel(rel2abs(catfile($config{sourcedir}, + "util", "mkrc.pl")), + rel2abs($config{builddir})); my $target = shlib_import($lib); return <<"EOF" $target: $deps $ordinalsfile $mkdef_pl \$(PERL) $mkdef_pl "$mkdef_key" 32 > $shlib.def \$(PERL) -i.tmp -pe "s|^LIBRARY\\s+${mkdef_key}32|LIBRARY $shlib|;" $shlib.def DEL $shlib.def.tmp + \$(PERL) $mkrc_pl $shlib$shlibext > $shlib.rc + \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\ /implib:$target \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< -$objs$linklibs \$(EX_LIBS) +$objs $shlib.res$linklibs \$(EX_LIBS) << DEL /F apps\\$shlib$shlibext DEL /F test\\$shlib$shlibext diff --git a/Configure b/Configure index 255c2cc768..67c401369c 100755 --- a/Configure +++ b/Configure @@ -1874,66 +1874,6 @@ my %builders = ( my $platform = shift; # The only reason we do this is to have something to build MINFO from build_Makefile(); - - # create the ms/version32.rc file if needed - my ($v1, $v2, $v3, $v4); - if ($config{version_num} =~ /^0x([0-9a-f]{1})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{1})L$/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 - -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", "$config{version}\\0" -#if defined(CRYPTO) - VALUE "InternalName", "libcrypto32\\0" - VALUE "OriginalFilename", "libcrypto32.dll\\0" -#elif defined(SSL) - VALUE "InternalName", "libssl32\\0" - VALUE "OriginalFilename", "libssl32.dll\\0" -#endif - VALUE "ProductName", "The OpenSSL Toolkit\\0" - VALUE "ProductVersion", "$config{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 "LegalTrademarks", "\\0" - //VALUE "PrivateBuild", "\\0" - //VALUE "SpecialBuild", "\\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 0x4b0 - END -END -EOF - close(OUT); }, ); -- cgit v1.2.3