Improve the definition of STITCHED_CALL in e_rc4_hmac_md5.c
[openssl.git] / util / mkrc.pl
1 #! /usr/bin/env perl
2 # Copyright 2006-2016 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the OpenSSL license (the "License").  You may not use
5 # this file except in compliance with the License.  You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8
9 use lib ".";
10 use configdata;
11 use File::Spec::Functions;
12
13 my $versionfile = catfile($config{sourcedir},"include/openssl/opensslv.h");
14
15 open FD, $versionfile or die "Couldn't open include/openssl/opensslv.h: $!\n";
16 while(<FD>) {
17     if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
18         $ver = hex($1);
19         $v1 = ($ver>>28);
20         $v2 = ($ver>>20)&0xff;
21         $v3 = ($ver>>12)&0xff;
22         $v4 = ($ver>> 4)&0xff;
23         $beta = $ver&0xf;
24         $version = "$v1.$v2.$v3";
25         if ($beta==0xf) { $version .= chr(ord('a')+$v4-1) if ($v4);     }
26         elsif ($beta==0){ $version .= "-dev";                           }
27         else            { $version .= "-beta$beta";                     }
28         last;
29     }
30 }
31 close(FD);
32
33 $filename = $ARGV[0]; $filename =~ /(.*)\.([^.]+)$/;
34 $basename = $1;
35 $extname  = $2;
36
37 if ($extname =~ /dll/i) { $description = "OpenSSL shared library"; }
38 else                    { $description = "OpenSSL application";    }
39
40 print <<___;
41 #include <winver.h>
42
43 LANGUAGE 0x09,0x01
44
45 1 VERSIONINFO
46   FILEVERSION $v1,$v2,$v3,$v4
47   PRODUCTVERSION $v1,$v2,$v3,$v4
48   FILEFLAGSMASK 0x3fL
49 #ifdef _DEBUG
50   FILEFLAGS 0x01L
51 #else
52   FILEFLAGS 0x00L
53 #endif
54   FILEOS VOS__WINDOWS32
55   FILETYPE VFT_DLL
56   FILESUBTYPE 0x0L
57 BEGIN
58     BLOCK "StringFileInfo"
59     BEGIN
60         BLOCK "040904b0"
61         BEGIN
62             // Required:
63             VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
64             VALUE "FileDescription", "$description\\0"
65             VALUE "FileVersion", "$version\\0"
66             VALUE "InternalName", "$basename\\0"
67             VALUE "OriginalFilename", "$filename\\0"
68             VALUE "ProductName", "The OpenSSL Toolkit\\0"
69             VALUE "ProductVersion", "$version\\0"
70             // Optional:
71             //VALUE "Comments", "\\0"
72             VALUE "LegalCopyright", "Copyright 1998-2016 The OpenSSL Authors. All rights reserved.\\0"
73             //VALUE "LegalTrademarks", "\\0"
74             //VALUE "PrivateBuild", "\\0"
75             //VALUE "SpecialBuild", "\\0"
76         END
77     END
78     BLOCK "VarFileInfo"
79     BEGIN
80         VALUE "Translation", 0x409, 0x4b0
81     END
82 END
83 ___