Windows.pm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package platform::Windows;
  2. use strict;
  3. use warnings;
  4. use Carp;
  5. use vars qw(@ISA);
  6. require platform::BASE;
  7. @ISA = qw(platform::BASE);
  8. # Assume someone set @INC right before loading this module
  9. use configdata;
  10. sub binext { '.exe' }
  11. sub dsoext { '.dll' }
  12. sub shlibext { '.dll' }
  13. sub libext { '.lib' }
  14. sub defext { '.def' }
  15. sub objext { '.obj' }
  16. sub depext { '.d' }
  17. sub asmext { '.asm' }
  18. # Other extra that aren't defined in platform::BASE
  19. sub resext { '.res' }
  20. sub shlibextimport { '.lib' }
  21. sub shlibvariant { $target{shlib_variant} || '' }
  22. sub staticname {
  23. # Non-installed libraries are *always* static, and their names remain
  24. # the same, except for the mandatory extension
  25. my $in_libname = platform::BASE->staticname($_[1]);
  26. return $in_libname
  27. if $unified_info{attributes}->{libraries}->{$_[1]}->{noinst};
  28. # To make sure not to clash with an import library, we make the static
  29. # variant of our installed libraries get '_static' added to their names.
  30. return platform::BASE->staticname($_[1])
  31. . ($disabled{shared} ? '' : '_static');
  32. }
  33. # To mark forward compatibility, we include the OpenSSL major release version
  34. # number in the installed shared library names.
  35. (my $sover_filename = $config{shlib_version}) =~ s|\.|_|g;
  36. sub shlib_version_as_filename {
  37. return $sover_filename
  38. }
  39. sub sharedname {
  40. return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
  41. "-",
  42. $_[0]->shlib_version_as_filename(),
  43. ($_[0]->shlibvariant() // ''));
  44. }
  45. sub sharedname_import {
  46. return platform::BASE::__isshared($_[1]) ? $_[1] : undef;
  47. }
  48. sub sharedlib_import {
  49. return platform::BASE::__concat($_[0]->sharedname_import($_[1]),
  50. $_[0]->shlibextimport());
  51. }
  52. 1;