Remove generation of ms/version32.rc from Configure, use util/mkrc.pl
authorRichard Levitte <levitte@openssl.org>
Thu, 17 Mar 2016 21:29:20 +0000 (22:29 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 21 Mar 2016 10:00:21 +0000 (11:00 +0100)
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 <appro@openssl.org>
Configurations/10-main.conf
Configurations/windows-makefile.tmpl
Configure

index 87160968ca97c04e7a57f43e104ee960c5139622..5b64803810abe078994bb5682a22bb8ec2425cc2 100644 (file)
@@ -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") },
index e4faa95d1fc628d5dc03b83066f77559dba3e00d..89c9e49c1f8637e4b5821c3d8b694031b25fe375 100644 (file)
@@ -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
index 255c2cc768759b9b1a084ffb26d451ac5dbacfb0..67c401369c83a29f69c175555fa37326b900a24f 100755 (executable)
--- 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 <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", "$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);
     },
     );