Re: Detecting building under the core

[email protected] ("Yitzchak Scott-Thoennes")
Newsgroups perl.perl5.porters,perl.makemaker
Message-ID <[email protected]>
On Sun, December 23, 2007 9:56 am, Nicholas Clark wrote:
> As far as I can tell, when the core is building extentions, it invokes
> the Makefile.PL with PERL_CORE=1 on the command line, and from this
> MakeMaker
> sets PERL_CORE=1 inside the Makefile. In turn, MakeMaker contains rules to
>  extract files from .PL files.
>
> However, it seems that the information about "building under the core"
> isn't passed through in any way. Am I right? If so, what's the cleanest
> way to pass into a .PL file that we're running in a build under the core
> source directory?

Looking for prior art, I see ext/IO_Compress_Base/Makefile.PL
just checks $ENV{PERL_CORE}.  Oh, wait, it uses
ext/IO_Compress_Base/private/MakeUtil.pm, which does:

unless($ENV{PERL_CORE}) {
    $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV;
}

Presumably, then, MakeMaker leaves @ARGV intact and queryable.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.