Windows.pm 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 if $unified_info{attributes}->{$_[1]}->{noinst};
  27. # To make sure not to clash with an import library, we make the static
  28. # variant of our installed libraries get '_static' added to their names.
  29. return platform::BASE->staticname($_[1])
  30. . ($disabled{shared} ? '' : '_static');
  31. }
  32. # To mark forward compatibility, we include the OpenSSL major release version
  33. # number in the installed shared library names.
  34. (my $sover_filename = $config{shlib_version}) =~ s|\.|_|g;
  35. sub shlib_version_as_filename {
  36. return $sover_filename
  37. }
  38. sub sharedname {
  39. return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
  40. "-",
  41. $_[0]->shlib_version_as_filename(),
  42. ($_[0]->shlibvariant() // ''));
  43. }
  44. sub sharedname_import {
  45. return platform::BASE::__isshared($_[1]) ? $_[1] : undef;
  46. }
  47. sub sharedlib_import {
  48. return platform::BASE::__concat($_[0]->sharedname_import($_[1]),
  49. $_[0]->shlibextimport());
  50. }
  51. 1;