My confusion comes from phrases like "In a C environment" and "in a (MinGW-built) Perl environment".
An example:
Case 1 - what I (sloppily) meant by a "C environment":
gcc -o gmp.exe gmp.c -IC:/incs -LC:/libs -lgmp
Case 2 - what I (sloppily) meant by a "Perl environment"
perl Makefile.PL INC="-IC:/incs" LIBS="-LC:/libs -lgmp"
In the first case, I'm just building a test executable that needs the GMP library. It builds and runs fine.
In case 2, I'm trying to build Math::GMP - but that fails because "No library found for -lgmp". MakeMaker decrees that "-lgmp" means either "gmp.a" or "libgmp.a" - and in this particular instance, the import library that was built is named "libgmp.dll.a".
I had this half-baked idea that it would be nice if "-lgmp" worked the same in Case 2 as it did in Case 1 - and wondered if anyone had investigated the possibility. Hence my initial post in this thread. (MSVC compilers don't support the '-L' and '-l' conventions ... I probably should have omitted any consideration of those compilers.)
I've since been poking about a little, and I've just about decided that it's more trouble than it's worth. Far easier just to rename libgmp.dll.a to libgmp.a (and to do the same for other libraries, as necessary).
About the best that could be done to resolve the problem you are seeking to address, would be for the EU::MM to generate code in the makefile.pl it creates to cause it to go looking for each of the various suffixes when generating the makefile, and hardcode which ever it finds into the makefileAnd wouldn't that be fun. I guess we could start by re-setting
$Config{lib_ext} = ['.a', '.ddl.a', '.dll'] :-)
Though, as regards MinGW (but not MSVC), there should be no need to do any such hardcoding at all - unless it was decided to include '.lib' into the list of sought extensions, as I originally hinted. If '.lib' is not included then MakeMaker could just stick with the '-lfoo' stuff. There would be no need to convert to fully qualified file names, as is currently the case. And the libraries would be found at link time, irrespective of whether their names terminated with '.a', '.dll.a' or '.dll'.
Hmmm ... I wonder how much work that involves. I think that's the way it already works on nix systems, so it might not be as much work as one expects. That it would entail a major split with the way Makefiles are written for the MSVC compiler is less than enticing, but it's the thought of "what else gets broken" that's the major deterrent :-)
Cheers,
Rob