Skip to content

Commit

Permalink
it is $Config{exe_ext} not $Config{EXE_EXT} on linux this isn"t notic…
Browse files Browse the repository at this point in the history
…ed, on win32 is
  • Loading branch information
U-CORP\konovv authored and rurban committed Oct 21, 2018
1 parent 28eeb2c commit 4d774d6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use strict;
use ExtUtils::MakeMaker;
use Config;
use File::Spec;
Expand Down Expand Up @@ -171,7 +172,7 @@ elsif ($] > 5.015005 and $] < 5.019004) {

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

Expand Down Expand Up @@ -265,17 +266,18 @@ sub try_compile {
}
print PROG $testc;
close PROG;
@candidate = ();
$devnull = $^O eq 'MSWin32' ? "> NUL" : ">/dev/null 2>&1";
my @candidate = ();
my $devnull = $^O eq 'MSWin32' ? "> NUL" : ">/dev/null 2>&1";
my $cmd = "$Config{cc} $Config{ccflags} test.c";
push @candidate, "$cmd -o test$Config{EXE_EXT} $libs $devnull";
push @candidate, "$cmd -otest$Config{EXE_EXT} $libs $devnull";
push @candidate, "$cmd -o test$Config{exe_ext} $libs $devnull";
push @candidate, "$cmd -otest$Config{exe_ext} $libs $devnull";
my $rc=0;
while (my $cmd1 = shift (@candidate)) {
system ($cmd1);
unlink "test.c", "test$Config{EXE_EXT}";
$? == 0 && return 1;
if ($? == 0) {$rc=1;last}
}
return 0;
unlink "test.c", "test$Config{exe_ext}";
return $rc;
}

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

sub depend {
Expand Down Expand Up @@ -463,7 +465,7 @@ TAGS : $asmdata
$result .= "\ntest :: subdirs-test_\$(LINKTYPE)\n\n";
}
}
if ($Config{make} eq 'mingw32-make') { # mingw32 make different to msys make
if ($Config::Config{make} eq 'mingw32-make') { # mingw32 make different to msys make
$result .= "\n.PHONY : \$(CONFIGDEP)\n\n";
}
$result;
Expand Down

0 comments on commit 4d774d6

Please sign in to comment.