From 154964e30790686b15145c4e9a046f80469a5c7c Mon Sep 17 00:00:00 2001 From: "U-CORP\\konovv" Date: Sat, 20 Oct 2018 10:31:12 +0000 Subject: [PATCH 1/5] fix "Unquoted string "h" may clash with future reserved word" --- Makefile.PL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.PL b/Makefile.PL index d113af01d..f08128504 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -527,7 +527,7 @@ sub install { my $result = shift->SUPER::install(@_); my $headerpath = main::headerpath(); my $cc_runtime_h = File::Spec->catfile($headerpath, 'cc_runtime.h'); - if ($] > 5.013007 and !-e $cc_runtime.h) { + if ($] > 5.013007 and !-e $cc_runtime_h) { $result =~ s/install :: pure_install doc_install/install :: pure_install doc_install ccinc_install/; $result .= ' ccinc_install :: $(PERL_INC)/cc_runtime.h From 28a0e3fab866e7878bcb6e71145a65bda349dceb Mon Sep 17 00:00:00 2001 From: "U-CORP\\konovv" Date: Sat, 20 Oct 2018 10:53:32 +0000 Subject: [PATCH 2/5] it is $Config{exe_ext} not $Config{EXE_EXT} on linux this isn"t noticed, on win32 is --- Makefile.PL | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Makefile.PL b/Makefile.PL index f08128504..986022c39 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,3 +1,4 @@ +use strict; use ExtUtils::MakeMaker; use Config; use File::Spec; @@ -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 *.*"); } @@ -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 { @@ -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 { @@ -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; From a1f25ac39878064f34ec44b6ab54078e603fbc77 Mon Sep 17 00:00:00 2001 From: "U-CORP\\konovv" Date: Sat, 20 Oct 2018 11:05:21 +0000 Subject: [PATCH 3/5] few more touches so strawberry perl build module OK --- ByteLoader/hints/522_patched.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ByteLoader/hints/522_patched.pl b/ByteLoader/hints/522_patched.pl index ee7637542..9d8ea93bc 100644 --- a/ByteLoader/hints/522_patched.pl +++ b/ByteLoader/hints/522_patched.pl @@ -33,7 +33,7 @@ sub probe_byteloader { require Config; system "$Config::Config{make} linkext"; } - system "$^X -Mblib -MO=-qq,Bytecode,-H,-o$out -e'print q(ok)'"; + system "$^X -Mblib -MO=-qq,Bytecode,-H,-o$out -e\"print q(ok)\""; return "0" unless -s $out; my $ret = `$^X -Mblib $out`; unlink $out; From 6b68b478c7b2ca164f775a3e3f1b5c220b926210 Mon Sep 17 00:00:00 2001 From: konovv Date: Sat, 27 Oct 2018 18:57:01 +0000 Subject: [PATCH 4/5] more correct for !PERL_CORE on windows --- script/cc_harness | 2 +- script/perlcc.PL | 4 ++-- t/TestBC.pm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 script/perlcc.PL diff --git a/script/cc_harness b/script/cc_harness index 94fa7493f..c82f488e7 100755 --- a/script/cc_harness +++ b/script/cc_harness @@ -183,4 +183,4 @@ $ccflags .= $B::C::Config::extra_cflags; my $cccmd = "$Config{cc} $ccflags -I$coredir @ARGV $linkargs"; print "$cccmd\n" unless $quiet; -exec $cccmd; +system($cccmd); diff --git a/script/perlcc.PL b/script/perlcc.PL old mode 100644 new mode 100755 index c39b1e8e7..1079b9970 --- a/script/perlcc.PL +++ b/script/perlcc.PL @@ -659,7 +659,7 @@ sub cc_harness_msvc { # another ldopts bug: ensure Win32CORE gets added. if (index($link, "Win32CORE") < 0) { - my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; + my $archdir = $ENV{PERL_CORE} ? "../.." : "$Config{archlib}/.."; my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.a") { $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.a"; @@ -754,7 +754,7 @@ print OUT <<'!NO!SUBS!'; # another ldopts bug: ensure Win32CORE gets added, before -lperl if (is_winlike()) { if (index($ldopts, "Win32CORE") < 0) { - my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; + my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}/.."; my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.a") { $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.a"; diff --git a/t/TestBC.pm b/t/TestBC.pm index 48c8277e5..8e288023c 100644 --- a/t/TestBC.pm +++ b/t/TestBC.pm @@ -875,7 +875,7 @@ sub run_cc_test { if ($^O =~ /^(cygwin|MSWin32|msys)/) { if (index($command, "Win32CORE") < 0) { - my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; + my $archdir = $ENV{PERL_CORE} ? "../.." : "$Config{archlib}/.."; my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.a") { $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.a"; From 45af12952928e9193c39cce9e09d74db87455b4f Mon Sep 17 00:00:00 2001 From: konovv Date: Sat, 27 Oct 2018 19:41:01 +0000 Subject: [PATCH 5/5] win32 arch correction --- script/cc_harness | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/cc_harness b/script/cc_harness index c82f488e7..0f5e1a977 100755 --- a/script/cc_harness +++ b/script/cc_harness @@ -63,7 +63,7 @@ if (grep(/^-[cES]$/, @ARGV)) { # compile-only with -c -E or -S # another ldopts bug: ensure Win32CORE gets added. if ($^O =~ /^(cygwin|MSWin32|msys)/) { if (index($linkargs, "Win32CORE") < 0) { - my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; + my $archdir = $ENV{PERL_CORE} ? "../.." : "$Config{archlib}/.."; my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.a") { $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.a"; @@ -135,7 +135,7 @@ sub cc_harness_msvc { $link .= " /OPT:NOREF" if $ENV{APPVEYOR} and $^O eq 'MSWin32'; } if (index($link, "Win32CORE") < 0) { - my $archdir = $ENV{PERL_CORE} ? "../.." : $Config{archlib}; + my $archdir = $ENV{PERL_CORE} ? "../.." : "$Config{archlib}/.."; my $win32core = "-L$archdir/lib/auto/Win32CORE -lWin32CORE"; if (-e "$archdir/lib/auto/Win32CORE/Win32CORE.lib") { $win32core = "$archdir/lib/auto/Win32CORE/Win32CORE.lib";