2
0

mkrc.pl 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #! /usr/bin/env perl
  2. # Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (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. use strict;
  9. use warnings;
  10. use lib ".";
  11. use configdata;
  12. my $cversion = "$config{version}";
  13. my $version = "$config{full_version}";
  14. # RC syntax for versions uses commas as separators, rather than period,
  15. # and it must have exactly 4 numbers (16-bit integers).
  16. my @vernums = ( split(/\./, $cversion), 0, 0, 0, 0 );
  17. $cversion = join(',', @vernums[0..3]);
  18. my $filename = $ARGV[0];
  19. my $description = "OpenSSL library";
  20. my $vft = "VFT_DLL";
  21. if ( $filename =~ /openssl/i ) {
  22. $description = "OpenSSL application";
  23. $vft = "VFT_APP";
  24. }
  25. my $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
  26. print <<___;
  27. #include <winver.h>
  28. LANGUAGE 0x09,0x01
  29. 1 VERSIONINFO
  30. FILEVERSION $cversion
  31. PRODUCTVERSION $cversion
  32. FILEFLAGSMASK 0x3fL
  33. #ifdef _DEBUG
  34. FILEFLAGS 0x01L
  35. #else
  36. FILEFLAGS 0x00L
  37. #endif
  38. FILEOS VOS__WINDOWS32
  39. FILETYPE $vft
  40. FILESUBTYPE 0x0L
  41. BEGIN
  42. BLOCK "StringFileInfo"
  43. BEGIN
  44. BLOCK "040904b0"
  45. BEGIN
  46. // Required:
  47. VALUE "CompanyName", "The OpenSSL Project, https://www.openssl.org/\\0"
  48. VALUE "FileDescription", "$description\\0"
  49. VALUE "FileVersion", "$version\\0"
  50. VALUE "InternalName", "$filename\\0"
  51. VALUE "OriginalFilename", "$filename\\0"
  52. VALUE "ProductName", "The OpenSSL Toolkit\\0"
  53. VALUE "ProductVersion", "$version\\0"
  54. // Optional:
  55. //VALUE "Comments", "\\0"
  56. VALUE "LegalCopyright", "Copyright 1998-$YEAR The OpenSSL Authors. All rights reserved.\\0"
  57. //VALUE "LegalTrademarks", "\\0"
  58. //VALUE "PrivateBuild", "\\0"
  59. //VALUE "SpecialBuild", "\\0"
  60. END
  61. END
  62. BLOCK "VarFileInfo"
  63. BEGIN
  64. VALUE "Translation", 0x409, 0x4b0
  65. END
  66. END
  67. ___