xref: /minix3/crypto/external/bsd/openssl/dist/util/mkrc.pl (revision ebfedea0ce5bbe81e252ddf32d732e40fb633fae)
1*ebfedea0SLionel Sambuc#!/bin/env perl
2*ebfedea0SLionel Sambuc#
3*ebfedea0SLionel Sambucopen FD,"crypto/opensslv.h";
4*ebfedea0SLionel Sambucwhile(<FD>) {
5*ebfedea0SLionel Sambuc    if (/OPENSSL_VERSION_NUMBER\s+(0x[0-9a-f]+)/i) {
6*ebfedea0SLionel Sambuc	$ver = hex($1);
7*ebfedea0SLionel Sambuc	$v1 = ($ver>>28);
8*ebfedea0SLionel Sambuc	$v2 = ($ver>>20)&0xff;
9*ebfedea0SLionel Sambuc	$v3 = ($ver>>12)&0xff;
10*ebfedea0SLionel Sambuc	$v4 = ($ver>> 4)&0xff;
11*ebfedea0SLionel Sambuc	$beta = $ver&0xf;
12*ebfedea0SLionel Sambuc	$version = "$v1.$v2.$v3";
13*ebfedea0SLionel Sambuc	if ($beta==0xf)	{ $version .= chr(ord('a')+$v4-1) if ($v4);	}
14*ebfedea0SLionel Sambuc	elsif ($beta==0){ $version .= "-dev";				}
15*ebfedea0SLionel Sambuc	else		{ $version .= "-beta$beta";			}
16*ebfedea0SLionel Sambuc	last;
17*ebfedea0SLionel Sambuc    }
18*ebfedea0SLionel Sambuc}
19*ebfedea0SLionel Sambucclose(FD);
20*ebfedea0SLionel Sambuc
21*ebfedea0SLionel Sambuc$filename = $ARGV[0]; $filename =~ /(.*)\.([^.]+)$/;
22*ebfedea0SLionel Sambuc$basename = $1;
23*ebfedea0SLionel Sambuc$extname  = $2;
24*ebfedea0SLionel Sambuc
25*ebfedea0SLionel Sambucif ($extname =~ /dll/i)	{ $description = "OpenSSL shared library"; }
26*ebfedea0SLionel Sambucelse			{ $description = "OpenSSL application";    }
27*ebfedea0SLionel Sambuc
28*ebfedea0SLionel Sambucprint <<___;
29*ebfedea0SLionel Sambuc#include <winver.h>
30*ebfedea0SLionel Sambuc
31*ebfedea0SLionel SambucLANGUAGE 0x09,0x01
32*ebfedea0SLionel Sambuc
33*ebfedea0SLionel Sambuc1 VERSIONINFO
34*ebfedea0SLionel Sambuc  FILEVERSION $v1,$v2,$v3,$v4
35*ebfedea0SLionel Sambuc  PRODUCTVERSION $v1,$v2,$v3,$v4
36*ebfedea0SLionel Sambuc  FILEFLAGSMASK 0x3fL
37*ebfedea0SLionel Sambuc#ifdef _DEBUG
38*ebfedea0SLionel Sambuc  FILEFLAGS 0x01L
39*ebfedea0SLionel Sambuc#else
40*ebfedea0SLionel Sambuc  FILEFLAGS 0x00L
41*ebfedea0SLionel Sambuc#endif
42*ebfedea0SLionel Sambuc  FILEOS VOS__WINDOWS32
43*ebfedea0SLionel Sambuc  FILETYPE VFT_DLL
44*ebfedea0SLionel Sambuc  FILESUBTYPE 0x0L
45*ebfedea0SLionel SambucBEGIN
46*ebfedea0SLionel Sambuc    BLOCK "StringFileInfo"
47*ebfedea0SLionel Sambuc    BEGIN
48*ebfedea0SLionel Sambuc        BLOCK "040904b0"
49*ebfedea0SLionel Sambuc        BEGIN
50*ebfedea0SLionel Sambuc            // Required:
51*ebfedea0SLionel Sambuc            VALUE "CompanyName", "The OpenSSL Project, http://www.openssl.org/\\0"
52*ebfedea0SLionel Sambuc            VALUE "FileDescription", "$description\\0"
53*ebfedea0SLionel Sambuc            VALUE "FileVersion", "$version\\0"
54*ebfedea0SLionel Sambuc            VALUE "InternalName", "$basename\\0"
55*ebfedea0SLionel Sambuc            VALUE "OriginalFilename", "$filename\\0"
56*ebfedea0SLionel Sambuc            VALUE "ProductName", "The OpenSSL Toolkit\\0"
57*ebfedea0SLionel Sambuc            VALUE "ProductVersion", "$version\\0"
58*ebfedea0SLionel Sambuc            // Optional:
59*ebfedea0SLionel Sambuc            //VALUE "Comments", "\\0"
60*ebfedea0SLionel Sambuc            VALUE "LegalCopyright", "Copyright � 1998-2006 The OpenSSL Project. Copyright � 1995-1998 Eric A. Young, Tim J. Hudson. All rights reserved.\\0"
61*ebfedea0SLionel Sambuc            //VALUE "LegalTrademarks", "\\0"
62*ebfedea0SLionel Sambuc            //VALUE "PrivateBuild", "\\0"
63*ebfedea0SLionel Sambuc            //VALUE "SpecialBuild", "\\0"
64*ebfedea0SLionel Sambuc        END
65*ebfedea0SLionel Sambuc    END
66*ebfedea0SLionel Sambuc    BLOCK "VarFileInfo"
67*ebfedea0SLionel Sambuc    BEGIN
68*ebfedea0SLionel Sambuc        VALUE "Translation", 0x409, 0x4b0
69*ebfedea0SLionel Sambuc    END
70*ebfedea0SLionel SambucEND
71*ebfedea0SLionel Sambuc___
72