|
| 1 | +use strict; |
1 | 2 | use ExtUtils::MakeMaker;
|
2 | 3 | use Config;
|
3 | 4 | use File::Spec;
|
@@ -171,7 +172,7 @@ elsif ($] > 5.015005 and $] < 5.019004) {
|
171 | 172 |
|
172 | 173 | my $perlcc = File::Spec->catfile("script", "perlcc");
|
173 | 174 | if ($CORE and $^O eq 'MSWin32') {
|
174 |
| - $perldll = $Config{usecperl} ? "cperl*.dll" : "perl*.dll"; |
| 175 | + my $perldll = $Config{usecperl} ? "cperl*.dll" : "perl*.dll"; |
175 | 176 | system("copy ..\..\$perldll *.*");
|
176 | 177 | }
|
177 | 178 |
|
@@ -265,17 +266,18 @@ sub try_compile {
|
265 | 266 | }
|
266 | 267 | print PROG $testc;
|
267 | 268 | 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"; |
270 | 271 | 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; |
273 | 275 | while (my $cmd1 = shift (@candidate)) {
|
274 | 276 | system ($cmd1);
|
275 |
| - unlink "test.c", "test$Config{EXE_EXT}"; |
276 |
| - $? == 0 && return 1; |
| 277 | + if ($? == 0) {$rc=1;last} |
277 | 278 | }
|
278 |
| - return 0; |
| 279 | + unlink "test.c", "test$Config{exe_ext}"; |
| 280 | + return $rc; |
279 | 281 | }
|
280 | 282 |
|
281 | 283 | sub check_op_rettype {
|
@@ -432,7 +434,7 @@ sub ccflags {
|
432 | 434 | # Recommended by http://www.network-theory.co.uk/docs/gccintro/gccintro_32.html
|
433 | 435 | # -ansi -pedantic -Wall -W -Wconversion -Wshadow -Wcast-qual -Wwrite-strings (-W => -WExtra)
|
434 | 436 | $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}; |
436 | 438 | }
|
437 | 439 |
|
438 | 440 | sub depend {
|
@@ -463,7 +465,7 @@ TAGS : $asmdata
|
463 | 465 | $result .= "\ntest :: subdirs-test_\$(LINKTYPE)\n\n";
|
464 | 466 | }
|
465 | 467 | }
|
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 |
467 | 469 | $result .= "\n.PHONY : \$(CONFIGDEP)\n\n";
|
468 | 470 | }
|
469 | 471 | $result;
|
|
0 commit comments