in reply to Re: Help building Devel::Caller
in thread Help building Devel::Caller

bart,
Very interesting though this workaround is just that - a workaround. I would be interested in knowing who the right people are to get a real fix for this. The alternative I found for Devel::Caller was just to bypass Module::Build though I have confirmed your workaround also works.

Cheers - L~R

Replies are listed 'Best First'.
Re^3: Help building Devel::Caller
by bart (Canon) on Aug 02, 2006 at 17:55 UTC
    Despite your skeptiscism, after some more digging together with Intrepid who enjoys messing with build problems, I appear to have found the exact spot of the problem. You see, here is the line in Config Config_heavy.pl for ActivePerl5.8.8:
    lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -libpath:"C +:\Perl\lib\CORE" -machine:x86'

    And here is what is made of in in ActivePerl::Config:

    _override("lddlflags", "-mdll");
    which lists the option for the dynamic libraries, i.e. the DLLs made out of the XS modules.

    Do you see anything missing? Well, actually, a lot is missing, but most importantly, the command line switch to include the library search directory "C:\Perl\lib\CORE" is not there any more.

    So, with a bit of cleanup, i.e. poring the library path out of _orig_config instead of hardcoding it, I guess I have the most acceptable patch.

    update I've made a more politically correct patch, which gets the (MSVC style) -libpath: parameter switches out of the original lddlflags setting, and replaces each with the gcc style -L switch for MinGW. I've tested it and it seems to work, even with quotes and backslashes in place.

    _override("lddlflags", join " ", "-mdll", map "-L$_", map /^-libpath:(.+)/, _orig_conf("lddlflags") =~ /(?=\S)(?>[^"\s]+|"[^"]*")+/g);

    update The code has been updated (from a simple split " ") so it can properly handle spaces embedded between quotes.

      bart,
      It does not suprise me that there is a problem with ActiveState's customization as it isn't the first time I have encountered such a problem. The thing that has me puzzled is why this only appears to affect ActiveState with MinGW with Module::Build. Trying other configurations have worked just fine for me.

      Update: I suppose it is because ExtUtils::MakeMaker specifies an absolute path to perl58.lib and MSVC++ doesn't use the customize configuration.

      Cheers - L~R

        Hi L~R,

        I think bart is correct in pointing the finger of accusation at 'lddlflags'. On my MinGW-built perl:

        D:\>perl -V:lddlflags
        lddlflags='-mdll -s -L"D:\perl58_M\5.8.8\lib\CORE" -L"D:\MinGW\lib"';

        On ActiveState build 817:

        E:\>perl -V:lddlflags
        Set up gcc environment - 3.4.4 (mingw special)
        lddlflags='-mdll';

        Presumably this affects only M::B because M::B is the only module that needs to have the lddlflags specify the path to perl58.lib ... at least it's the only module you've come across where this has been the case. ActiveState should fix the lddlflags value to include the perl/lib/CORE searchpath when MinGW is involved.

        I don't think the MinGW/ActivePerl interface is quite as seamless as the hype would have you believe. Last time I tried, neither PAR nor Inline::CPP would build. If you want to use MinGW with ActivePerl, I think you'll get more milage with ExtUtils::FakeConfig - which does set lddlflags (and others) appropriately, though I think there were a couple of entries in Config_m.pm (created by EU::FC) that needed amendment - I can provide details of that if requested. The drawback to EU::FC is that sometimes (eg building Inline::CPP or building PDL) you need to set the environment variable perl5opt to MConfig_m. Other times you may need that variable unset.

        According to http://ppm.activestate.com/BuildStatus/5.8-windows/windows-5.8/Devel-Caller-0.11.txt the ppm for Devel-Caller-0.11 did not build because the pre-requisite Module::Build is not installed.

        Oh ... and I now gather that failing tests marked as 'TODO' are allowed to fail ... didn't realise that when I first posted :-)

        Cheers,
        Rob