cosimo/perl5-win32-api — pull request #10 by sschuberth (2013-09-26 12:54:34+00:00)
Title: Work-in-progress support for building on MSYS

This is work-in-progress which is *not* ready to be merged yet. I just like to discuss this because my Perl probably is not good enough to do what I want correctly. The version of `ExtUtils::MM_Win32` that currently ships with MSYS is quite old, and it does have none of the `cflags`, `test` or `distdir` functions, resulting in the following error:

ERROR from evaluation of perl5-win32-api/Callback/Makefile.PL: Can't locate object method "cflags" via package "ExtUtils::MM_Win32" at ./Makefile.PL line 25.

So we need to test for these functions at runtime and do something reasonable if they don't exist. At first I thought `cflags` etc. would be methods, not functions, so according to [this article](http://www.perlmonks.org/?node_id=709693) I tried to use `can` as in `if ($self->SUPER::can('cflags'))`, but that passed although `cflags` is not available. That's why I'm using `defined` as in `if (defined(&SUPER::cflags))` now, but I have a feeling that this now does not work correctly in the case that `cflags` *does* exist. For testing, I checked for `dynamic_lib`, which exists in my version of `ExtUtils::MM_Win32`, but still the condition failed.

Any hint how to do that check properly, which reasonable defaults for the returned variables?