Skip to content

Commit 28a0e3f

Browse files
U-CORP\konovvU-CORP\konovv
authored andcommitted
it is $Config{exe_ext} not $Config{EXE_EXT} on linux this isn"t noticed, on win32 is
1 parent 154964e commit 28a0e3f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

Makefile.PL

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use strict;
12
use ExtUtils::MakeMaker;
23
use Config;
34
use File::Spec;
@@ -171,7 +172,7 @@ elsif ($] > 5.015005 and $] < 5.019004) {
171172

172173
my $perlcc = File::Spec->catfile("script", "perlcc");
173174
if ($CORE and $^O eq 'MSWin32') {
174-
$perldll = $Config{usecperl} ? "cperl*.dll" : "perl*.dll";
175+
my $perldll = $Config{usecperl} ? "cperl*.dll" : "perl*.dll";
175176
system("copy ..\..\$perldll *.*");
176177
}
177178

@@ -265,17 +266,18 @@ sub try_compile {
265266
}
266267
print PROG $testc;
267268
close PROG;
268-
@candidate = ();
269-
$devnull = $^O eq 'MSWin32' ? "> NUL" : ">/dev/null 2>&1";
269+
my @candidate = ();
270+
my $devnull = $^O eq 'MSWin32' ? "> NUL" : ">/dev/null 2>&1";
270271
my $cmd = "$Config{cc} $Config{ccflags} test.c";
271-
push @candidate, "$cmd -o test$Config{EXE_EXT} $libs $devnull";
272-
push @candidate, "$cmd -otest$Config{EXE_EXT} $libs $devnull";
272+
push @candidate, "$cmd -o test$Config{exe_ext} $libs $devnull";
273+
push @candidate, "$cmd -otest$Config{exe_ext} $libs $devnull";
274+
my $rc=0;
273275
while (my $cmd1 = shift (@candidate)) {
274276
system ($cmd1);
275-
unlink "test.c", "test$Config{EXE_EXT}";
276-
$? == 0 && return 1;
277+
if ($? == 0) {$rc=1;last}
277278
}
278-
return 0;
279+
unlink "test.c", "test$Config{exe_ext}";
280+
return $rc;
279281
}
280282

281283
sub check_op_rettype {
@@ -432,7 +434,7 @@ sub ccflags {
432434
# Recommended by http://www.network-theory.co.uk/docs/gccintro/gccintro_32.html
433435
# -ansi -pedantic -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings (-W => -WExtra)
434436
$ccflags .= " -ansi -pedantic -Wall -Wextra -Wconversion -Wshadow -Wcast-qual -Wwrite-strings"
435-
if $Config{cc} =~ /\bgcc/ and $Config{gccversion};
437+
if $Config::Config{cc} =~ /\bgcc/ and $Config::Config{gccversion};
436438
}
437439

438440
sub depend {
@@ -463,7 +465,7 @@ TAGS : $asmdata
463465
$result .= "\ntest :: subdirs-test_\$(LINKTYPE)\n\n";
464466
}
465467
}
466-
if ($Config{make} eq 'mingw32-make') { # mingw32 make different to msys make
468+
if ($Config::Config{make} eq 'mingw32-make') { # mingw32 make different to msys make
467469
$result .= "\n.PHONY : \$(CONFIGDEP)\n\n";
468470
}
469471
$result;

0 commit comments

Comments
 (0)