Skip to content

Commit 0a745ae

Browse files
haargbingos
authored andcommitted
Revert "initialize PERL_CORE object var early and use it consistently"
This reverts commit d46cc0e.
1 parent e179ce9 commit 0a745ae

File tree

4 files changed

+30
-45
lines changed

4 files changed

+30
-45
lines changed

lib/ExtUtils/MM_Unix.pm

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ sub cflags {
225225
# with the warning flags, but NOT the -std=c89 flags (the latter
226226
# would break using any system header files that are strict C99).
227227
my @ccextraflags = qw(ccwarnflags);
228-
if ($self->{PERL_CORE}) {
228+
if ($ENV{PERL_CORE}) {
229229
for my $x (@ccextraflags) {
230230
if (exists $Config{$x}) {
231231
$cflags{$x} = $Config{$x};
@@ -1748,47 +1748,13 @@ sub init_DIRFILESEP {
17481748
}
17491749

17501750

1751-
=item init_CORE
1752-
1753-
Initializes PERL_CORE and PERL_SRC.
1754-
1755-
=cut
1756-
1757-
sub init_CORE {
1758-
my ($self) = @_;
1759-
1760-
# Are we building the core?
1761-
$self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE};
1762-
$self->{PERL_CORE} = 0 unless defined $self->{PERL_CORE};
1763-
1764-
unless ($self->{PERL_SRC}){
1765-
foreach my $dir_count (1..8) { # 8 is the VMS limit for nesting
1766-
my $dir = $self->catdir(($Updir) x $dir_count);
1767-
1768-
if (-f $self->catfile($dir,"config_h.SH") &&
1769-
-f $self->catfile($dir,"perl.h") &&
1770-
-f $self->catfile($dir,"lib","strict.pm")
1771-
) {
1772-
$self->{PERL_SRC} = $dir ;
1773-
last;
1774-
}
1775-
}
1776-
}
1777-
1778-
warn "PERL_CORE is set but I can't find your PERL_SRC!\n"
1779-
if $self->{PERL_CORE} and !$self->{PERL_SRC};
1780-
1781-
return;
1782-
}
1783-
1784-
17851751
=item init_main
17861752
17871753
Initializes AR, AR_STATIC_ARGS, BASEEXT, CONFIG, DISTNAME, DLBASE,
17881754
EXE_EXT, FULLEXT, FULLPERL, FULLPERLRUN, FULLPERLRUNINST, INST_*,
17891755
INSTALL*, INSTALLDIRS, LIB_EXT, LIBPERL_A, MAP_TARGET, NAME,
17901756
OBJ_EXT, PARENT_NAME, PERL, PERL_ARCHLIB, PERL_INC, PERL_LIB,
1791-
PERLRUN, PERLRUNINST, PREFIX, VERSION,
1757+
PERL_SRC, PERLRUN, PERLRUNINST, PREFIX, VERSION,
17921758
VERSION_SYM, XS_VERSION.
17931759
17941760
=cut
@@ -1839,6 +1805,23 @@ sub init_main {
18391805
my $inc_config_dir = dirname($INC{'Config.pm'});
18401806
my $inc_carp_dir = dirname($INC{'Carp.pm'});
18411807

1808+
unless ($self->{PERL_SRC}){
1809+
foreach my $dir_count (1..8) { # 8 is the VMS limit for nesting
1810+
my $dir = $self->catdir(($Updir) x $dir_count);
1811+
1812+
if (-f $self->catfile($dir,"config_h.SH") &&
1813+
-f $self->catfile($dir,"perl.h") &&
1814+
-f $self->catfile($dir,"lib","strict.pm")
1815+
) {
1816+
$self->{PERL_SRC}=$dir ;
1817+
last;
1818+
}
1819+
}
1820+
}
1821+
1822+
warn "PERL_CORE is set but I can't find your PERL_SRC!\n" if
1823+
$self->{PERL_CORE} and !$self->{PERL_SRC};
1824+
18421825
if ($self->{PERL_SRC}){
18431826
$self->{PERL_LIB} ||= $self->catdir("$self->{PERL_SRC}","lib");
18441827

@@ -2177,6 +2160,10 @@ sub init_PERL {
21772160
# * including any initial directory separator preserves the `file_name_is_absolute` property
21782161
$self->{PERL} =~ s/^"(\S(:\\|:)?)/$1"/ if $self->is_make_type('dmake');
21792162

2163+
# Are we building the core?
2164+
$self->{PERL_CORE} = $ENV{PERL_CORE} unless exists $self->{PERL_CORE};
2165+
$self->{PERL_CORE} = 0 unless defined $self->{PERL_CORE};
2166+
21802167
# Make sure perl can find itself before it's installed.
21812168
my $lib_paths = $self->{UNINSTALLED_PERL} || $self->{PERL_CORE}
21822169
? ( $self->{PERL_ARCHLIB} && $self->{PERL_LIB} && $self->{PERL_ARCHLIB} ne $self->{PERL_LIB} ) ?

lib/ExtUtils/MakeMaker.pm

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ our @EXPORT_OK = qw($VERSION &neatvalue &mkbootstrap &mksymlists
4444
# purged.
4545
my $Is_VMS = $^O eq 'VMS';
4646
my $Is_Win32 = $^O eq 'MSWin32';
47+
our $UNDER_CORE = $ENV{PERL_CORE}; # needs to be our
4748

4849
full_setup();
4950

@@ -449,8 +450,6 @@ sub new {
449450
# object. It will be blessed into a temp package later.
450451
bless $self, "MM";
451452

452-
$self->init_CORE;
453-
454453
# Cleanup all the module requirement bits
455454
my %key2cmr;
456455
for my $key (qw(PREREQ_PM BUILD_REQUIRES CONFIGURE_REQUIRES TEST_REQUIRES)) {
@@ -509,7 +508,7 @@ sub new {
509508
}
510509

511510
print "MakeMaker (v$VERSION)\n" if $Verbose;
512-
if (-f "MANIFEST" && ! -f "Makefile" && ! $self->{PERL_CORE}){
511+
if (-f "MANIFEST" && ! -f "Makefile" && ! $UNDER_CORE){
513512
check_manifest();
514513
}
515514

@@ -618,7 +617,7 @@ END
618617
warn sprintf "Warning: prerequisite %s %s not found.\n",
619618
$prereq, $required_version
620619
unless $self->{PREREQ_FATAL}
621-
or $self->{PERL_CORE};
620+
or $UNDER_CORE;
622621

623622
$unsatisfied{$prereq} = 'not installed';
624623
}
@@ -630,7 +629,7 @@ END
630629
warn sprintf "Warning: prerequisite %s %s not found. We have %s.\n",
631630
$prereq, $required_version, ($pr_version || 'unknown version')
632631
unless $self->{PREREQ_FATAL}
633-
or $self->{PERL_CORE};
632+
or $UNDER_CORE;
634633

635634
$unsatisfied{$prereq} = $required_version || 'unknown version' ;
636635
}
@@ -1201,7 +1200,7 @@ sub mv_all_methods {
12011200
sub skipcheck {
12021201
my($self) = shift;
12031202
my($section) = @_;
1204-
return 'skipped' if $section eq 'metafile' && $self->{PERL_CORE};
1203+
return 'skipped' if $section eq 'metafile' && $UNDER_CORE;
12051204
if ($section eq 'dynamic') {
12061205
print "Warning (non-fatal): Target 'dynamic' depends on targets ",
12071206
"in skipped section 'dynamic_bs'\n"

t/prereq.t

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
4646
}
4747
$warnings .= join '', @_;
4848
};
49-
5049
# prerequisite warnings are disabled while building the perl core:
51-
local $ENV{PERL_CORE} = 0;
50+
local $ExtUtils::MakeMaker::UNDER_CORE = 0;
5251

5352
WriteMakefile(
5453
NAME => 'Big::Dummy',

t/vstrings.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ sub capture_make {
7272
$warnings .= join '', @_;
7373
};
7474

75-
local $ENV{PERL_CORE} = 0;
75+
local $ExtUtils::MakeMaker::UNDER_CORE = 0;
7676

7777
WriteMakefile(
7878
NAME => 'VString::Test',

0 commit comments

Comments
 (0)