2
0

mkrc.pl 1.8 KB

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