mingw.pm 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package platform::mingw;
  2. use strict;
  3. use warnings;
  4. use Carp;
  5. use vars qw(@ISA);
  6. require platform::Unix;
  7. @ISA = qw(platform::Unix);
  8. # Assume someone set @INC right before loading this module
  9. use configdata;
  10. sub binext { '.exe' }
  11. sub objext { '.obj' }
  12. sub libext { '.a' }
  13. sub dsoext { '.dll' }
  14. sub defext { '.def' }
  15. # Other extra that aren't defined in platform::BASE
  16. sub resext { '.res.obj' }
  17. sub shlibext { '.dll' }
  18. sub shlibextimport { $target{shared_import_extension} || '.dll.a' }
  19. sub shlibextsimple { undef }
  20. sub makedepcmd { $disabled{makedepend} ? undef : $config{makedepcmd} }
  21. (my $sover_filename = $config{shlib_version}) =~ s|\.|_|g;
  22. sub shlib_version_as_filename {
  23. return $sover_filename;
  24. }
  25. sub sharedname {
  26. return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
  27. "-",
  28. $_[0]->shlib_version_as_filename(),
  29. ($config{target} eq "mingw64"
  30. ? "-x64" : ""));
  31. }
  32. # With Mingw and other DLL producers, there isn't any "simpler" shared
  33. # library name. However, there is a static import library.
  34. sub sharedlib_simple {
  35. return undef;
  36. }
  37. sub sharedlib_import {
  38. return platform::BASE::__concat(platform::BASE->sharedname($_[1]),
  39. $_[0]->shlibextimport());
  40. }
  41. 1;