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

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.

Replies are listed 'Best First'.
Re^4: Help building Devel::Caller
by Limbic~Region (Chancellor) on Aug 02, 2006 at 18:05 UTC
    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
        Rob,
        Well, the ActiveState and MinGW integration is a work in progress. I emailed Jan Dubois yesterday after bart and Intrepid tracked down the bug and a patch to ActivePerl has already been made and will be reflected in build 818. Here is the patch Jan applied:
        @@ -112,12 +112,16 @@ _override("_o", ".o"); _override("obj_ext", ".o"); _override("optimize", "-O2"); - _override("lddlflags", "-mdll"); _override("i64type", "long long"); _override("u64type", "unsigned long long"); _override("quadtype", "long long"); _override("uquadtype", "unsigned long long"); _override("d_casti32", "define"); + + # Extract all library paths from lddlflags + my @libpaths = map "-L$_", map /^-libpath:(.+)/, + _orig_conf("lddlflags") =~ /(?=\S)(?>[^"\s]+|"[^"]*")+/ +g; + _override("lddlflags", join(" ", "-mdll", @libpaths)); } } elsif ($^O eq 'darwin') {

        So with responsiveness like that, I have hopes for ActivePerl and MinGW. I am frustrated by the fact that I can't remember what other customization I have had problems with in the past and just fixed my local copy - I should have emailed that too.

        Cheers - L~R