in reply to How to avoid having to remove PERL_DL_NONLAZY=1 from Makefile?

PERL_DL_NONLAZY is set by the methods test_via_harness and test_via_script of ExtUtils::MM_Unix; I'd override those methods; perldoc ExtUtils::MM_Unix has a brief mumble on this.

Update: typo fixed.

the lowliest monk

Replies are listed 'Best First'.
Re^2: How to avoid having to remove PERL_DL_NONLAZY=1 from Makefile?
by diotalevi (Canon) on Mar 31, 2005 at 20:01 UTC

    So how do I override those methods? I tried calling $self->SUPER::test_via_harness( @_ ) and the object I've received isn't ISA ExtUtils anything.

    Writing Makefile for Data::Postponed Can't locate object method "test_via_harness" via package "main" at Ma +kefile.PL line 25. # Looks like your test died before it could output anything. sub MY::test_via_harness { my $self = shift; local $_ = $self->SUPER::test_via_harness( @_ ); s/PERL_DL_NONLAZY=1//g; return $_; }

      Try this:

      use ExtUtils::MakeMaker; package MY; sub test_via_harness { my($self, $perl, $tests) = @_; local $_ = $self->SUPER::test_via_harness($perl, $tests); s/PERL_DL_NONLAZY=1//g; return $_; } sub test_via_script { my($self, $perl, $tests) = @_; local $_ = $self->SUPER::test_via_script($perl, $tests); s/PERL_DL_NONLAZY=1//g; return $_; } package main; # rest of your Makefile.PL

      the lowliest monk

        I chatted with people about this. Apparently $self is blessed into PACK001 which is not ISA anything useful. The proper thing to do is call directly into the MM class (not ExtUtils::MM though). The following code is what actually works. I'm getting a taste of why ExtUtils::MakeMaker is being killed. Yuck. I hope it dies a quick death.

        sub MY::test_via_harness { local $_ = shift()->MM::test_via_harness( @_ ); s/\bPERL_DL_NONLAZY=1 +//g; return $_; } sub MY::test_via_script { local $_ = shift()->MM::test_via_script( @_ ); s/\bPERL_DL_NON_LAZY=1 +//g; return $_; }