SA Bugzilla – Bug 2808
Makefile.PL problems block make under Win32
Last modified: 2004-03-11 05:38:57 UTC
SA does not make under Win32 using MakeMaker 6.05 or later with ActivePerl 5.6.1 or 5.8.1 and nmake, with a whole slew of errors all starting from the -DPREFIX= in the expansion of PM_FILTER being messed up. Note that if you use the MakeMaker 5.45 that comes with ActivePerl 5.6.1 you don't get all the errors from nmake, but looking at the result shows that 5.45 never defines PM_FILTER so the reference to it produces no error message but also has no effect. The bug results from PREPROCESS and I_PREFIX being defined in the postamble, which appears in the generated Makefile after the first use of PM_FILTER, which uses those two variables in its definition. I am attaching a patch that moves the definition of PREPROCESS and the set of variables that includes I_PREFIX to the constants section so they are defined by the time PM_FILTER is first used. This should be looked over by someone who better understands all the Makefile.PL complications. I am concerned that I can't explain why the existing Makefile.PL seems to work ok on other platforms that use GNU make even though it seems that PREPROCESS and I_PREFIX are being used in PM_FILTER before they are defined.
Created attachment 1605 [details] *OBSOLETE* patch against CVS Makefile.PL to define variables earlier
Here's why Makefile.PL works with GNU make and not with Windows nmake: Create a test Makefile containing testtarg: @echo foo1 $(FOO1) foo1 FOO1 = "This is foo1 text" Using GNU make, make testtarg outputs foo1 This is foo1 text foo1 Using nmake, nmake testtarg outputs foo1 foo1 To be portable to nmake, the definition of a variable has to come earlier in the makefile than the first target that refers to it.
The problem with building under ActivePerl 5.6.1 is the following: Support for older versions of MakeMaker that do not define PM_FILTER was dropped from Makefile.PL in the revision 1.118 checkin. That had been documented as being MakeMaker versions less than 5.45, and the MakeMaker version 5.45 that was included with perl 5.6.0. The doc had said that MakeMaker 5.45 shipped with perl 5.6.1 did support PM_FILTER. The doc missed another version that does not have PM_FILTER: MakeMaker 5.45 that comes with perl 5.6.1, or at least ActivePerl 5.6.1 which is the only 5.6.1 I have handy, only supports PM_FILTER on Unix, not in the Win32 portion of the code. So Makefile.PL revision 1.118 by removing support for non-PM_FILTER versions of MakeMaker broke building under the as-shipped version 5.6.1 of ActivePerl. The workaround is installing a newer ExtUtils::MakeMaker plus implementing the patch for this bug report.
I'll look at that stuff. (God, I *hate* EU::MM and Makefile-compatibility in general).
*** Bug 2854 has been marked as a duplicate of this bug. ***
Looks good to me. +1 Malte, any feedback?
Comment on attachment 1605 [details] *OBSOLETE* patch against CVS Makefile.PL to define variables earlier This patch is obsoleted by the patch I submitted for bug #2862
*** This bug has been marked as a duplicate of 2862 ***
*** Bug 2955 has been marked as a duplicate of this bug. ***