mkrc.pl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. $cversion =~ s|\.|,|g;
  16. my $filename = $ARGV[0];
  17. my $description = "OpenSSL library";
  18. my $vft = "VFT_DLL";
  19. if ( $filename =~ /openssl/i ) {
  20. $description = "OpenSSL application";
  21. $vft = "VFT_APP";
  22. }
  23. my $YEAR = [gmtime($ENV{SOURCE_DATE_EPOCH} || time())]->[5] + 1900;
  24. print <<___;
  25. #include <winver.h>
  26. LANGUAGE 0x09,0x01
  27. 1 VERSIONINFO
  28. FILEVERSION $cversion
  29. PRODUCTVERSION $cversion
  30. FILEFLAGSMASK 0x3fL
  31. #ifdef _DEBUG
  32. FILEFLAGS 0x01L
  33. #else
  34. FILEFLAGS 0x00L
  35. #endif
  36. FILEOS VOS__WINDOWS32
  37. FILETYPE $vft
  38. FILESUBTYPE 0x0L
  39. BEGIN
  40. BLOCK "StringFileInfo"
  41. BEGIN
  42. BLOCK "040904b0"
  43. BEGIN
  44. // Required:
  45. VALUE "CompanyName", "The OpenSSL Project, https://www.openssl.org/\\0"
  46. VALUE "FileDescription", "$description\\0"
  47. VALUE "FileVersion", "$version\\0"
  48. VALUE "InternalName", "$filename\\0"
  49. VALUE "OriginalFilename", "$filename\\0"
  50. VALUE "ProductName", "The OpenSSL Toolkit\\0"
  51. VALUE "ProductVersion", "$version\\0"
  52. // Optional:
  53. //VALUE "Comments", "\\0"
  54. VALUE "LegalCopyright", "Copyright 1998-$YEAR The OpenSSL Authors. All rights reserved.\\0"
  55. //VALUE "LegalTrademarks", "\\0"
  56. //VALUE "PrivateBuild", "\\0"
  57. //VALUE "SpecialBuild", "\\0"
  58. END
  59. END
  60. BLOCK "VarFileInfo"
  61. BEGIN
  62. VALUE "Translation", 0x409, 0x4b0
  63. END
  64. END
  65. ___