diff --git a/Configure b/Configure index b773d2a5119..1e2596a5ab3 100755 --- a/Configure +++ b/Configure @@ -3023,11 +3023,11 @@ do case "\$f" in /*) $targetmkdir \`dirname \$f\` - $targetto -P $targetport $q \$f $targetuser@$targethost:\$f || exit 1 + $targetto -P $targetport -r $q \$f $targetuser@$targethost:\$f || exit 1 ;; *) $targetmkdir $targetdir/\`dirname \$f\` - $targetto -P $targetport $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1 + $targetto -P $targetport -r $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1 ;; esac done diff --git a/Makefile.SH b/Makefile.SH index b89c9182078..ac7755cb75e 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -1514,9 +1514,63 @@ test_prep test-prep: test_prep_pre \$(MINIPERL_EXE) \$(unidatafiles) \$(PERL_EXE $to lib $to TestInit.pm $to win32/FindExt.pm - $to regen/keywords.pl - $to pod/perldiag.pod + $to regen + $to pod $to MANIFEST + $to Porting + $to cpan/*/t + $to dist/*/t + $to ext/*/t + $to cpan/Term-Cap/test.pl + $to cpan/Pod-Usage + $to cpan/Pod-Parser + $to cpan/IO-Compress/examples + $to cpan/HTTP-Tiny/lib + $to cpan/Filter-Util-Call/filter-util.pl + $to cpan/File-CheckTree/lib + $to cpan/Digest-MD5/README + $to cpan/Digest-MD5/MD5.xs + $to cpan/Digest-SHA/src + $to cpan/Test-Simple/examples + $to cpan/Pod-Parser/lib + $to cpan/Test-Harness/MANIFEST + $to cpan/Test-Harness/MANIFEST.CUMMULATIVE + $to cpan/List-Util/blib + $to ext/IPC-Open3/Makefile + $to ext/Tie-Memoize/lib + $to ext/POSIX/POSIX.xs + $to ext/POSIX/Makefile.PL + $to dist/IO/Makefile.PL +# --- These two are needed by ExtUtils::MM_Unix to verify PERL_CORE + $to config_h.SH + $to perl.h + $to cflags +# --- For Module::Build + $to cpan/Module-Build/lib + $to *.h +# --- For t/porting/perlfunc.t + $to ext/Pod-Functions +# --- For t/porting/pod_rules.t + $to Makefile.SH + $to cpan/perlfaq + $to cpan/Pod-Perldoc/lib/perldoc.pod + $to dist/ExtUtils-ParseXS/lib/perlxs.pod + $to dist/ExtUtils-ParseXS/lib/perlxstut.pod + $to dist/ExtUtils-ParseXS/lib/perlxstypemap.pod + $to win32/Makefile + $to win32/makefile.mk + $to win32/pod.mak + $to vms/descrip_mms.template +# --- For t/porting/regen.t + $to keywords.c + $to regen.pl + $to regen_perly.pl + $to perly.tab + $to perly.act + $to perly.y + $to uconfig.sh +# --- For t/x2p/s2p.t + $to x2p cd t && (rm -f \$(PERL_EXE); \$(LNS) ../\$(PERL_EXE) \$(PERL_EXE)) && cd .. $to t/\$(PERL_EXE) @@ -1541,7 +1595,7 @@ test check: test_prep *) $spitshell >>$Makefile <_error(loc("Could not open '%1' for writing: %2", $self->_gunzip_to, $! )); - my $cmd = [ $self->bin_gzip, '-cdf', $self->archive ]; + my $cmd = [ $self->bin_gzip, '-c', '-d', '-f', $self->archive ]; my $buffer; unless( scalar run( command => $cmd, diff --git a/cpan/CPAN/lib/CPAN/Tarzip.pm b/cpan/CPAN/lib/CPAN/Tarzip.pm index 708a5794f34..a818fc1b555 100644 --- a/cpan/CPAN/lib/CPAN/Tarzip.pm +++ b/cpan/CPAN/lib/CPAN/Tarzip.pm @@ -103,7 +103,7 @@ sub gunzip { return 1; } else { my $command = CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG}); - system(qq{$command -dc "$read" > "$write"})==0; + system(qq{$command -d -c "$read" > "$write"})==0; } } @@ -188,7 +188,7 @@ sub TIEHANDLE { $class->debug("via Compress::Zlib"); } else { my $gzip = CPAN::HandleConfig->safe_quote($self->{UNGZIPPRG}); - my $pipe = "$gzip -dc $file |"; + my $pipe = "$gzip -d -c $file |"; my $fh = FileHandle->new($pipe) or $CPAN::Frontend->mydie("Could not pipe[$pipe]: $!"); binmode $fh; $self->{FH} = $fh; @@ -322,7 +322,7 @@ Can't continue cutting file '$file'. my $tarcommand = CPAN::HandleConfig->safe_quote($exttar); if ($is_compressed) { my $command = CPAN::HandleConfig->safe_quote($extgzip); - $system = qq{$command -dc }. + $system = qq{$command -d -c }. qq{< "$file" | $tarcommand x${tar_verb}f -}; } else { $system = qq{$tarcommand x${tar_verb}f "$file"}; diff --git a/cpan/CPANPLUS/t/04_CPANPLUS-Module.t b/cpan/CPANPLUS/t/04_CPANPLUS-Module.t index 1014e62bdab..96bfb8d032e 100644 --- a/cpan/CPANPLUS/t/04_CPANPLUS-Module.t +++ b/cpan/CPANPLUS/t/04_CPANPLUS-Module.t @@ -16,6 +16,7 @@ use Test::More 'no_plan'; use Data::Dumper; use File::Spec; use File::Path (); +use IPC::Cmd qw(can_run); my $Conf = gimme_conf(); my $CB = CPANPLUS::Backend->new( $Conf ); @@ -305,9 +306,12 @@ isa_ok( $Auth->parent, 'CPANPLUS::Backend' ); " Object" ); ### skiptests to make sure we don't get any test header mismatches - my $rv = $bundle->create( prereq_target => 'create', skiptest => 1 ); - ok( $rv, " Tested prereqs" ); - + SKIP: { + skip "make isn't available, not testing ->create", 1 + if !can_run('make'); + my $rv = $bundle->create( prereq_target => 'create', skiptest => 1 ); + ok( $rv, " Tested prereqs" ); + } } ### test module from perl core ### diff --git a/cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t b/cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t index 5bba1371597..1ef8323ec00 100644 --- a/cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t +++ b/cpan/CPANPLUS/t/20_CPANPLUS-Dist-MM.t @@ -12,12 +12,17 @@ use CPANPLUS::Dist; use CPANPLUS::Dist::MM; use CPANPLUS::Internals::Constants; -use Test::More 'no_plan'; +use Test::More; use Cwd; use Config; use Data::Dumper; use File::Basename (); use File::Spec (); +use IPC::Cmd (); + +if ( !IPC::Cmd::can_run('make') ) { + plan skip_all => "make is not available, can't test CPANPLUS::Dist::MM"; +} my $conf = gimme_conf(); my $cb = CPANPLUS::Backend->new( $conf ); @@ -419,6 +424,7 @@ sub _custom_makefile_pl_sub { } } +done_testing; # Local variables: # c-indentation-style: bsd diff --git a/cpan/DB_File/t/db-btree.t b/cpan/DB_File/t/db-btree.t index fb89a408556..2ca293a4866 100644 --- a/cpan/DB_File/t/db-btree.t +++ b/cpan/DB_File/t/db-btree.t @@ -5,7 +5,7 @@ use strict; use Config; BEGIN { - if(-d "lib" && -f "TEST") { + if((-d "lib" && -f "TEST") || $ENV{PERL_CORE}) { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; diff --git a/cpan/DB_File/t/db-hash.t b/cpan/DB_File/t/db-hash.t index f4c8f957b02..c7df80e1899 100644 --- a/cpan/DB_File/t/db-hash.t +++ b/cpan/DB_File/t/db-hash.t @@ -3,9 +3,9 @@ use warnings; use strict; use Config; - + BEGIN { - if(-d "lib" && -f "TEST") { + if((-d "lib" && -f "TEST") || $ENV{PERL_CORE}) { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; diff --git a/cpan/DB_File/t/db-recno.t b/cpan/DB_File/t/db-recno.t index bd198dcf2ff..ab78232fb1a 100644 --- a/cpan/DB_File/t/db-recno.t +++ b/cpan/DB_File/t/db-recno.t @@ -4,7 +4,7 @@ use strict; use Config; BEGIN { - if(-d "lib" && -f "TEST") { + if((-d "lib" && -f "TEST") || $ENV{PERL_CORE}) { if ($Config{'extensions'} !~ /\bDB_File\b/ ) { print "1..0 # Skip: DB_File was not built\n"; exit 0; diff --git a/cpan/ExtUtils-Constant/t/Constant.t b/cpan/ExtUtils-Constant/t/Constant.t index 5cc6f498db1..b777c3f8cf0 100644 --- a/cpan/ExtUtils-Constant/t/Constant.t +++ b/cpan/ExtUtils-Constant/t/Constant.t @@ -13,6 +13,8 @@ use ExtUtils::Constant qw (C_constant autoload); use File::Spec; use Cwd; +use IPC::Cmd qw(can_run); + my $do_utf_tests = $] > 5.006; my $better_than_56 = $] > 5.007; # For debugging set this to 1. @@ -38,6 +40,11 @@ my $make = $Config{make}; $make = $ENV{MAKE} if exists $ENV{MAKE}; if ($^O eq 'MSWin32' && $make eq 'nmake') { $make .= " -nologo"; } +if ( $Config{usecrosscompile} && !can_run($make) ) { + print "1..0 # Cross-compiling and $make isn't available, skupping\n"; + exit 0; +} + # VMS may be using something other than MMS/MMK my $mms_or_mmk = 0; my $vms_lc = 0; diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm index b46bebfcd63..b752a5235d8 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm @@ -15,7 +15,7 @@ use ExtUtils::MakeMaker qw($Verbose neatvalue); # If we make $VERSION an our variable parse_version() breaks use vars qw($VERSION); -$VERSION = '6.66'; +$VERSION = '6.67'; $VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval] require ExtUtils::MM_Any; @@ -959,6 +959,14 @@ MAKE $(CHMOD) $(PERM_RWX) $@ MAKE + if ( $Config::Config{d_libname_unique} ) { + push @m, <<'MAKE'; +# --- d_libname_unique is true, so library names should be "unique" + $(MV) $(INST_DYNAMIC) $(INST_ARCHAUTODIR)/Perl_$(NAME_SYM).$(DLEXT) + -$(MV) $(INST_BOOT) $(INST_ARCHAUTODIR)/Perl_$(NAME_SYM).bs +MAKE + } + return join('',@m); } diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm index f271ef79282..f482d97dca8 100644 --- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm +++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm @@ -18,7 +18,7 @@ our @Overridable; my @Prepend_parent; my %Recognized_Att_Keys; -our $VERSION = '6.66'; +our $VERSION = '6.67'; $VERSION = eval $VERSION; ## no critic [BuiltinFunctions::ProhibitStringyEval] # Emulate something resembling CVS $Revision$ diff --git a/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t b/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t index d2f605e4682..241645b54cd 100644 --- a/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t +++ b/cpan/ExtUtils-MakeMaker/t/INSTALL_BASE.t @@ -40,7 +40,9 @@ ok( grep(/^Writing $makefile for Big::Dummy/, @mpl_out) == 1, 'Makefile.PL output looks right'); +SKIP: { my $make = make_run(); +skip "make is not available", 14 if !$make; run("$make"); # this is necessary due to a dmake bug. my $install_out = run("$make install"); is( $?, 0, ' make install exited normally' ) || diag $install_out; @@ -72,3 +74,4 @@ is( $?, 0, 'realclean' ) || diag($realclean_out); open(STDERR, ">&SAVERR") or die $!; close SAVERR; +} \ No newline at end of file diff --git a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t index 2d227906929..27d8cbd0f69 100644 --- a/cpan/ExtUtils-MakeMaker/t/PL_FILES.t +++ b/cpan/ExtUtils-MakeMaker/t/PL_FILES.t @@ -28,9 +28,12 @@ ok chdir('PL_FILES-Module'); run(qq{$perl Makefile.PL}); cmp_ok( $?, '==', 0 ); +SKIP: { + skip "make is not available", 5 if !$make; my $make_out = run("$make"); is( $?, 0 ) || diag $make_out; foreach my $file (qw(single.out 1.out 2.out blib/lib/PL/Bar.pm)) { ok( -e $file, "$file was created" ); } +} \ No newline at end of file diff --git a/cpan/ExtUtils-MakeMaker/t/basic.t b/cpan/ExtUtils-MakeMaker/t/basic.t index 1410465a9f4..de612544151 100644 --- a/cpan/ExtUtils-MakeMaker/t/basic.t +++ b/cpan/ExtUtils-MakeMaker/t/basic.t @@ -11,8 +11,20 @@ use strict; use Config; use ExtUtils::MakeMaker; -use Test::More tests => 171; +use Test::More; use MakeMaker::Test::Utils; + +my $make; +BEGIN { + $make = make_run(); + if ( !make ) { + plan skip_all => "make isn't available"; + } + else { + plan tests => 171; + } +} + use MakeMaker::Test::Setup::BFD; use File::Find; use File::Spec; @@ -61,8 +73,6 @@ cmp_ok( $Touch_Time, '<=', $mtime, ' its been touched' ); END { unlink makefile_name(), makefile_backup() } -my $make = make_run(); - { # Supress 'make manifest' noise local $ENV{PERL_MM_MANIFEST_VERBOSE} = 0; diff --git a/cpan/ExtUtils-MakeMaker/t/echo.t b/cpan/ExtUtils-MakeMaker/t/echo.t index 04fcc4322d3..eaa8c009176 100644 --- a/cpan/ExtUtils-MakeMaker/t/echo.t +++ b/cpan/ExtUtils-MakeMaker/t/echo.t @@ -30,6 +30,8 @@ $mm->init_tools; # need ECHO # Run Perl with the currently installing MakeMaker $mm->{$_} .= q[ "-I$(INST_ARCHLIB)" "-I$(INST_LIB)"] for qw( PERLRUN FULLPERLRUN ABSPERLRUN ); +plan skip_all => "make isn't available" if !$make; + #------------------- Testing functions sub test_for_echo { diff --git a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm index 9a6ab60e35c..c39c594d0aa 100644 --- a/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm +++ b/cpan/ExtUtils-MakeMaker/t/lib/MakeMaker/Test/Utils.pm @@ -211,6 +211,7 @@ sub make { my $make = $Config{make}; $make = $ENV{MAKE} if exists $ENV{MAKE}; + return if !can_run($make); return $make; } @@ -224,6 +225,7 @@ Returns the make to run as with make() plus any necessary switches. sub make_run { my $make = make; + return if !$make; $make .= ' -nologo' if $make eq 'nmake'; return $make; @@ -411,6 +413,46 @@ sub slurp { return $text; } + +=item can_run + + $exec = can_run($exec); + +Returns the executable, possibly with a full path attached, if it can be +run. Basically IPC::Cmd::can_run. + +=cut + +sub can_run { + my $command = shift; + + # a lot of VMS executables have a symbol defined + # check those first + if ( $^O eq 'VMS' ) { + require VMS::DCLsym; + my $syms = VMS::DCLsym->new; + return $command if scalar $syms->getsym( uc $command ); + } + + my @possibles; + + if( File::Spec->file_name_is_absolute($command) ) { + return MM->maybe_command($command); + + } else { + for my $dir ( + File::Spec->path, + File::Spec->curdir + ) { + next if ! $dir || ! -d $dir; + my $abs = File::Spec->catfile( $^O eq 'MSWin32' ? Win32::GetShortPathName( $dir ) : $dir, $command); + push @possibles, $abs if $abs = MM->maybe_command($abs); + } + } + + return shift @possibles; +} + =back =head1 AUTHOR diff --git a/cpan/ExtUtils-MakeMaker/t/min_perl_version.t b/cpan/ExtUtils-MakeMaker/t/min_perl_version.t index 5d2ac45e860..97c2a1cde8d 100644 --- a/cpan/ExtUtils-MakeMaker/t/min_perl_version.t +++ b/cpan/ExtUtils-MakeMaker/t/min_perl_version.t @@ -152,10 +152,11 @@ note "generated files verification"; { } -note "ppd output"; { +note "ppd output"; SKIP: { + skip "make isn't available", 3 if !$make; my $ppd_file = 'Min-PerlVers.ppd'; my @make_out = run(qq{$make ppd}); - END { unlink $ppd_file } + END { unlink $ppd_file if $ppd_file } cmp_ok( $?, '==', 0, 'Make ppd exiting normally' ) || diag(@make_out); @@ -167,9 +168,10 @@ note "ppd output"; { } -note "META.yml output"; { +note "META.yml output"; SKIP: { my $distdir = 'Min-PerlVers-0.05'; $distdir =~ s{\.}{_}g if $Is_VMS; + skip "make isn't available", 4 if !$make; my $meta_yml = "$distdir/META.yml"; my $meta_json = "$distdir/META.json"; diff --git a/cpan/ExtUtils-MakeMaker/t/miniperl.t b/cpan/ExtUtils-MakeMaker/t/miniperl.t index 9a4def20288..f03fd44e49b 100644 --- a/cpan/ExtUtils-MakeMaker/t/miniperl.t +++ b/cpan/ExtUtils-MakeMaker/t/miniperl.t @@ -54,5 +54,8 @@ my $make = make_run(); # Run make once { run_ok(qq{$perl Makefile.PL}); - run_ok($make); + SKIP: { + skip "make isn't available", 1 if !$make; + run_ok($make); + } } diff --git a/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t b/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t index 66ef879e4ef..21799830c0d 100644 --- a/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t +++ b/cpan/ExtUtils-MakeMaker/t/pm_to_blib.t @@ -5,18 +5,21 @@ use strict; use lib 't/lib'; -use Test::More 'no_plan'; +use Test::More; use ExtUtils::MakeMaker; use MakeMaker::Test::Utils; +my $make; +BEGIN { + $make = make_run(); + plan skip_all => "make isn't available" if !$make; +} use MakeMaker::Test::Setup::BFD; my $perl = which_perl(); my $makefile = makefile_name(); -my $make = make_run(); - # Setup our test environment { @@ -68,3 +71,5 @@ my $make = make_run(); ok( -e "blib/lib/Big/Dummy.pm", "blib copied pm file" ); } + +done_testing; \ No newline at end of file diff --git a/cpan/ExtUtils-MakeMaker/t/recurs.t b/cpan/ExtUtils-MakeMaker/t/recurs.t index 746a09a2194..a7872bf913b 100644 --- a/cpan/ExtUtils-MakeMaker/t/recurs.t +++ b/cpan/ExtUtils-MakeMaker/t/recurs.t @@ -9,8 +9,16 @@ BEGIN { use strict; use Config; -use Test::More tests => 26; +use Test::More; use MakeMaker::Test::Utils; +BEGIN { + if ( !make_run() ) { + plan skip_all => "make isn't available"; + } + else { + plan tests => 26; + } +} use MakeMaker::Test::Setup::Recurs; # 'make disttest' sets a bunch of environment variables which interfere diff --git a/cpan/ExtUtils-MakeMaker/t/several_authors.t b/cpan/ExtUtils-MakeMaker/t/several_authors.t index bf6cdcb906e..9cd060f3870 100644 --- a/cpan/ExtUtils-MakeMaker/t/several_authors.t +++ b/cpan/ExtUtils-MakeMaker/t/several_authors.t @@ -89,8 +89,9 @@ note "generated files verification"; { } -note "ppd output"; { +note "ppd output"; SKIP: { my $ppd_file = 'Multiple-Authors.ppd'; + skip "make isn't available", 3 if !$make; my @make_out = run(qq{$make ppd}); END { unlink $ppd_file } @@ -104,9 +105,10 @@ note "ppd output"; { } -note "META.yml output"; { +note "META.yml output"; SKIP: { my $distdir = 'Multiple-Authors-0.05'; $distdir =~ s{\.}{_}g if $Is_VMS; + skip "make isn't available", 5 if !$make; my $meta_yml = "$distdir/META.yml"; my $meta_json = "$distdir/META.json"; diff --git a/cpan/IO-Compress/t/050interop-gzip.t b/cpan/IO-Compress/t/050interop-gzip.t index 27c1d7db8c8..459a4cf8f6a 100644 --- a/cpan/IO-Compress/t/050interop-gzip.t +++ b/cpan/IO-Compress/t/050interop-gzip.t @@ -48,7 +48,7 @@ sub readWithGzip my $lex = new LexFile my $outfile; - my $comp = "$GZIP -dc" ; + my $comp = "$GZIP " . ($^O eq 'linux-androideabi' ? "-d -c" : "-dc"); if ( system("$comp $file >$outfile") == 0 ) { diff --git a/cpan/IO-Zlib/Zlib.pm b/cpan/IO-Zlib/Zlib.pm index 55534b4f374..32f523cdd2d 100644 --- a/cpan/IO-Zlib/Zlib.pm +++ b/cpan/IO-Zlib/Zlib.pm @@ -155,7 +155,7 @@ Not yet supported. If the external F is used, the following Cs are used: - open(FH, "gzip -dc $filename |") # for read opens + open(FH, "gzip -d -c $filename |") # for read opens open(FH, " | gzip > $filename") # for write opens You can modify the 'commands' for example to hardwire @@ -307,7 +307,7 @@ use Symbol; use Tie::Handle; # These might use some $^O logic. -my $gzip_read_open = "gzip -dc %s |"; +my $gzip_read_open = "gzip -d -c %s |"; my $gzip_write_open = "| gzip > %s"; my $gzip_external; diff --git a/cpan/Module-Build/t/lib/MBTest.pm b/cpan/Module-Build/t/lib/MBTest.pm index 0df382fc6aa..8b4c700f155 100644 --- a/cpan/Module-Build/t/lib/MBTest.pm +++ b/cpan/Module-Build/t/lib/MBTest.pm @@ -198,6 +198,7 @@ sub find_in_path { } sub check_compiler { + return if $Config{usecrosscompile} && !-e $Config{cc}; return (1,1) if $ENV{PERL_CORE}; local $SIG{__WARN__} = sub {}; diff --git a/cpan/Perl-OSType/lib/Perl/OSType.pm b/cpan/Perl-OSType/lib/Perl/OSType.pm index a79426d56c2..a49dd2e8237 100644 --- a/cpan/Perl-OSType/lib/Perl/OSType.pm +++ b/cpan/Perl-OSType/lib/Perl/OSType.pm @@ -50,6 +50,7 @@ my %OSTYPES = qw( gnukfreebsd Unix nto Unix qnx Unix + linux-androideabi Unix dos Windows MSWin32 Windows diff --git a/cpan/Socket/Socket.pm b/cpan/Socket/Socket.pm index 270e4ed14d6..008cc88e413 100644 --- a/cpan/Socket/Socket.pm +++ b/cpan/Socket/Socket.pm @@ -992,7 +992,7 @@ sub fake_getaddrinfo my @ports; # Actually ARRAYrefs of [ socktype, protocol, port ] my $protname = ""; if( $protocol ) { - $protname = getprotobynumber( $protocol ); + $protname = eval { getprotobynumber( $protocol ) }; } if( $service ne "" and $service !~ m/^\d+$/ ) { @@ -1023,7 +1023,7 @@ sub fake_getaddrinfo $port = 0; } - push @ports, [ $this_socktype, scalar getprotobyname( $this_protname ) || 0, $port ]; + push @ports, [ $this_socktype, eval { scalar getprotobyname( $this_protname ) } || 0, $port ]; } my @ret; diff --git a/cpan/Sys-Syslog/Syslog.pm b/cpan/Sys-Syslog/Syslog.pm index deae4f3d6a0..3990f5cd6be 100644 --- a/cpan/Sys-Syslog/Syslog.pm +++ b/cpan/Sys-Syslog/Syslog.pm @@ -3,6 +3,7 @@ use strict; use warnings; use warnings::register; use Carp; +use Config; use Exporter (); use Fcntl qw< O_WRONLY >; use File::Basename; @@ -435,10 +436,15 @@ sub syslog { $whoami .= "[$$]" if $options{pid}; $sum = $numpri + $numfac; - my $oldlocale = setlocale(LC_TIME); - setlocale(LC_TIME, 'C'); + my $oldlocale; + if ( $Config::Config{d_setlocale} ) { + $oldlocale = setlocale(LC_TIME); + setlocale(LC_TIME, 'C'); + } my $timestamp = strftime "%b %d %H:%M:%S", localtime; - setlocale(LC_TIME, $oldlocale); + if ( $Config::Config{d_setlocale} ) { + setlocale(LC_TIME, $oldlocale); + } # construct the stream that will be transmitted $buf = "<$sum>$timestamp $whoami: $message"; @@ -624,7 +630,10 @@ sub connect_log { sub connect_tcp { my ($errs) = @_; - my $proto = getprotobyname('tcp'); + my $proto; + if ( $Config{d_getpbyname} ) { + $proto = getprotobyname('tcp'); + } if (!defined $proto) { push @$errs, "getprotobyname failed for tcp"; return 0; @@ -672,7 +681,10 @@ sub connect_tcp { sub connect_udp { my ($errs) = @_; - my $proto = getprotobyname('udp'); + my $proto; + if ( $Config{d_getpbyname} ) { + $proto = getprotobyname('udp'); + } if (!defined $proto) { push @$errs, "getprotobyname failed for udp"; return 0; diff --git a/cpan/Win32/t/CodePage.t b/cpan/Win32/t/CodePage.t index 75741cc9749..ba3617a496f 100644 --- a/cpan/Win32/t/CodePage.t +++ b/cpan/Win32/t/CodePage.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 8; diff --git a/cpan/Win32/t/CreateFile.t b/cpan/Win32/t/CreateFile.t index ee1bf46daf9..5e40199c054 100644 --- a/cpan/Win32/t/CreateFile.t +++ b/cpan/Win32/t/CreateFile.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; my $path = "testing-$$"; diff --git a/cpan/Win32/t/ExpandEnvironmentStrings.t b/cpan/Win32/t/ExpandEnvironmentStrings.t index b57b47cddd7..dac59ccea1b 100644 --- a/cpan/Win32/t/ExpandEnvironmentStrings.t +++ b/cpan/Win32/t/ExpandEnvironmentStrings.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 1; diff --git a/cpan/Win32/t/GetCurrentThreadId.t b/cpan/Win32/t/GetCurrentThreadId.t index ce98f3e5626..09791bd7eb0 100644 --- a/cpan/Win32/t/GetCurrentThreadId.t +++ b/cpan/Win32/t/GetCurrentThreadId.t @@ -1,6 +1,12 @@ use strict; use Config qw(%Config); use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; my $fork_emulation = $Config{ccflags} =~ /PERL_IMPLICIT_SYS/; diff --git a/cpan/Win32/t/GetFileVersion.t b/cpan/Win32/t/GetFileVersion.t index b9e51f821d9..3ed0cd62649 100644 --- a/cpan/Win32/t/GetFileVersion.t +++ b/cpan/Win32/t/GetFileVersion.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; unless (defined &Win32::BuildNumber) { diff --git a/cpan/Win32/t/GetFolderPath.t b/cpan/Win32/t/GetFolderPath.t index c010c25aa88..3d3ed6c9735 100644 --- a/cpan/Win32/t/GetFolderPath.t +++ b/cpan/Win32/t/GetFolderPath.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 1; diff --git a/cpan/Win32/t/GetFullPathName.t b/cpan/Win32/t/GetFullPathName.t index ec716d15d24..6ea11a650f9 100644 --- a/cpan/Win32/t/GetFullPathName.t +++ b/cpan/Win32/t/GetFullPathName.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 16; diff --git a/cpan/Win32/t/GetLongPathName.t b/cpan/Win32/t/GetLongPathName.t index 5019a2ba258..135f9b01d3a 100644 --- a/cpan/Win32/t/GetLongPathName.t +++ b/cpan/Win32/t/GetLongPathName.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; my @paths = qw( diff --git a/cpan/Win32/t/GetOSName.t b/cpan/Win32/t/GetOSName.t index 07fed88f400..bb8a72773c7 100644 --- a/cpan/Win32/t/GetOSName.t +++ b/cpan/Win32/t/GetOSName.t @@ -1,5 +1,10 @@ use strict; use Test::More; +BEGIN { + if ( $^O ne 'MSWin32' ) { + plan skip_all => "Not running on Windows"; + } +} use Win32; # The "description" value is extracted from the $pretty field: diff --git a/cpan/Win32/t/GetOSVersion.t b/cpan/Win32/t/GetOSVersion.t index cb3f36490ba..2af9b5dad7c 100644 --- a/cpan/Win32/t/GetOSVersion.t +++ b/cpan/Win32/t/GetOSVersion.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 1; diff --git a/cpan/Win32/t/GetShortPathName.t b/cpan/Win32/t/GetShortPathName.t index 455385418c5..510b03d87db 100644 --- a/cpan/Win32/t/GetShortPathName.t +++ b/cpan/Win32/t/GetShortPathName.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; my $path = "Long Path $$"; diff --git a/cpan/Win32/t/GuidGen.t b/cpan/Win32/t/GuidGen.t index 7011e2f1492..d1a5c0f4cb8 100644 --- a/cpan/Win32/t/GuidGen.t +++ b/cpan/Win32/t/GuidGen.t @@ -1,5 +1,11 @@ use strict; use Test; +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; plan tests => 3; diff --git a/cpan/Win32/t/Names.t b/cpan/Win32/t/Names.t index e28e4a46af3..4dca9f4c16e 100644 --- a/cpan/Win32/t/Names.t +++ b/cpan/Win32/t/Names.t @@ -5,6 +5,12 @@ BEGIN { print "1..0 # Skip: Test requires Test::More module\n"; exit 0; } +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} use Win32; my $tests = 14; diff --git a/cpan/Win32/t/Unicode.t b/cpan/Win32/t/Unicode.t index 2d03fd6dcd2..1640b29c9bd 100644 --- a/cpan/Win32/t/Unicode.t +++ b/cpan/Win32/t/Unicode.t @@ -3,6 +3,14 @@ use Test; use Config qw(%Config); use Cwd qw(cwd); use Encode qw(); + +BEGIN { + if ( $^O ne 'MSWin32' ) { + print "1..0 # Skip: Not running on Windows\n"; + exit 0; + } +} + use Win32; BEGIN { diff --git a/cpan/autodie/t/open.t b/cpan/autodie/t/open.t index 67f6f0cf55c..1d7eabd623e 100644 --- a/cpan/autodie/t/open.t +++ b/cpan/autodie/t/open.t @@ -53,12 +53,16 @@ unlike($@, qr/at \S+ line \d+\s+at \S+ line \d+/, "...but not too mentions"); # Sniff to see if we can run 'true' on this system. Changes we can't # on non-Unix systems. +my @true = $^O eq 'linux-androideabi' + ? ('sh', '-c', 'true $@', '--') + : 'true'; + eval { use autodie; die "Windows and VMS do not support multi-arg pipe" if $^O eq "MSWin32" or $^O eq 'VMS'; - open(my $fh, '-|', "true"); + open(my $fh, '-|', @true); }; SKIP: { @@ -68,10 +72,10 @@ SKIP: { use autodie; my $fh; - open $fh, "-|", "true"; - open $fh, "-|", "true", "foo"; - open $fh, "-|", "true", "foo", "bar"; - open $fh, "-|", "true", "foo", "bar", "baz"; + open $fh, "-|", @true; + open $fh, "-|", @true, "foo"; + open $fh, "-|", @true, "foo", "bar"; + open $fh, "-|", @true, "foo", "bar", "baz"; }; is $@, '', "multi arg piped open does not fail"; diff --git a/cpan/libnet/Net/Domain.pm b/cpan/libnet/Net/Domain.pm index 330909da49d..79b8d0eb870 100644 --- a/cpan/libnet/Net/Domain.pm +++ b/cpan/libnet/Net/Domain.pm @@ -169,7 +169,7 @@ sub _hostdomain { } chop($dom = `domainname 2>/dev/null`) - unless (defined $dom || $^O =~ /^(?:cygwin|MSWin32)/); + unless (defined $dom || $^O =~ /^(?:cygwin|MSWin32|linux-androideabi)/); if (defined $dom) { my @h = (); diff --git a/dist/Cwd/lib/File/Spec/Unix.pm b/dist/Cwd/lib/File/Spec/Unix.pm index a1a91b42607..5cfd8d66eeb 100644 --- a/dist/Cwd/lib/File/Spec/Unix.pm +++ b/dist/Cwd/lib/File/Spec/Unix.pm @@ -162,6 +162,9 @@ sub _tmpdir { } $tmpdir = $self->curdir unless defined $tmpdir; $tmpdir = defined $tmpdir && $self->canonpath($tmpdir); + if ( $tmpdir eq '.' ) { + $tmpdir = defined $tmpdir && $self->rel2abs($tmpdir); + } return $tmpdir; } diff --git a/dist/Cwd/t/tmpdir.t b/dist/Cwd/t/tmpdir.t index 6f7f318180c..91c5d4cb6b2 100644 --- a/dist/Cwd/t/tmpdir.t +++ b/dist/Cwd/t/tmpdir.t @@ -1,5 +1,5 @@ use strict; -use Test::More tests => 5; +use Test::More tests => 6; # Grab all of the plain routines from File::Spec use File::Spec; @@ -29,3 +29,8 @@ SKIP: { File::Spec::Win32->tmpdir; is(scalar keys %ENV, $num_keys, "Win32->tmpdir() shouldn't change the contents of %ENV"); + +ok( + File::Spec->file_name_is_absolute(File::Spec->tmpdir()), + "tmpdir() always returns an absolute path" +); diff --git a/dist/ExtUtils-Install/t/InstallWithMM.t b/dist/ExtUtils-Install/t/InstallWithMM.t index 4b2c439d886..5fb6cb01085 100644 --- a/dist/ExtUtils-Install/t/InstallWithMM.t +++ b/dist/ExtUtils-Install/t/InstallWithMM.t @@ -10,15 +10,25 @@ use strict; use Config; use ExtUtils::MakeMaker; -use Test::More tests => 15; +use Test::More; use MakeMaker::Test::Utils; + +my $make; +BEGIN { + $make = make_run(); + if (!$make) { + plan skip_all => "make isn't available"; + } + else { + plan tests => 15; + } +} + use MakeMaker::Test::Setup::BFD; use File::Find; use File::Spec; use File::Path; -my $make = make_run(); - # Environment variables which interfere with our testing. delete @ENV{qw(PREFIX LIB MAKEFLAGS)}; diff --git a/dist/ExtUtils-Install/t/lib/MakeMaker/Test/Utils.pm b/dist/ExtUtils-Install/t/lib/MakeMaker/Test/Utils.pm index 453a8ed3bf1..f80a6cd6e39 100644 --- a/dist/ExtUtils-Install/t/lib/MakeMaker/Test/Utils.pm +++ b/dist/ExtUtils-Install/t/lib/MakeMaker/Test/Utils.pm @@ -4,6 +4,8 @@ use File::Spec; use strict; use Config; +use IPC::Cmd qw(can_run); + require Exporter; our @ISA = qw(Exporter); @@ -210,6 +212,7 @@ sub make { my $make = $Config{make}; $make = $ENV{MAKE} if exists $ENV{MAKE}; + return if !can_run($make); return $make; } @@ -223,6 +226,7 @@ Returns the make to run as with make() plus any necessary switches. sub make_run { my $make = make; + return if !$make; $make .= ' -nologo' if $make eq 'nmake'; return $make; diff --git a/dist/IO/lib/IO/Socket/INET.pm b/dist/IO/lib/IO/Socket/INET.pm index 5af70303d29..b94223c298e 100644 --- a/dist/IO/lib/IO/Socket/INET.pm +++ b/dist/IO/lib/IO/Socket/INET.pm @@ -50,7 +50,7 @@ sub _get_proto_number { return undef unless defined $name; return $proto_number{$name} if exists $proto_number{$name}; - my @proto = getprotobyname($name); + my @proto = eval { getprotobyname($name) }; return undef unless @proto; _cache_proto(@proto); @@ -62,7 +62,7 @@ sub _get_proto_name { return undef unless defined $num; return $proto_name{$num} if exists $proto_name{$num}; - my @proto = getprotobynumber($num); + my @proto = eval { getprotobynumber($num) }; return undef unless @proto; _cache_proto(@proto); diff --git a/dist/IO/t/io_pipe.t b/dist/IO/t/io_pipe.t index b7897bb2dfe..85a11d58c8b 100644 --- a/dist/IO/t/io_pipe.t +++ b/dist/IO/t/io_pipe.t @@ -108,7 +108,11 @@ if ($is_win32) { $stdout = bless \*STDOUT, "IO::Handle"; $stdout->fdopen($pipe,"w"); print STDOUT "not ok 7\n"; - exec 'echo', 'not ok 8'; + my @echo = 'echo'; + if ( $^O eq 'linux-androideabi' ) { + @echo = ('sh', '-c', q{echo $@}, '--'); + } + exec @echo, 'not ok 8'; } else { diff --git a/dist/IO/t/io_xs.t b/dist/IO/t/io_xs.t index b73144794fe..4819ba02713 100644 --- a/dist/IO/t/io_xs.t +++ b/dist/IO/t/io_xs.t @@ -15,10 +15,14 @@ BEGIN { } } -use Test::More tests => 5; +use Test::More; use IO::File; use IO::Seekable; +local $ENV{TMPDIR} = '.' if($^O eq 'linux-androideabi'); + +plan(tests => 5); + $x = new_tmpfile IO::File; ok($x, "new_tmpfile"); print $x "ok 2\n"; diff --git a/dist/Net-Ping/lib/Net/Ping.pm b/dist/Net-Ping/lib/Net/Ping.pm index 1523af91dd3..bfbb7c1a549 100644 --- a/dist/Net-Ping/lib/Net/Ping.pm +++ b/dist/Net-Ping/lib/Net/Ping.pm @@ -135,7 +135,7 @@ sub new $self->{"seq"} = 0; # For counting packets if ($self->{"proto"} eq "udp") # Open a socket { - $self->{"proto_num"} = (getprotobyname('udp'))[2] || + $self->{"proto_num"} = eval { (getprotobyname('udp'))[2] } || croak("Can't udp protocol by name"); $self->{"port_num"} = (getservbyname('echo', 'udp'))[2] || croak("Can't get udp echo port by name"); @@ -155,7 +155,7 @@ sub new elsif ($self->{"proto"} eq "icmp") { croak("icmp ping requires root privilege") if ($> and $^O ne 'VMS' and $^O ne 'cygwin'); - $self->{"proto_num"} = (getprotobyname('icmp'))[2] || + $self->{"proto_num"} = eval { (getprotobyname('icmp'))[2] } || croak("Can't get icmp protocol by name"); $self->{"pid"} = $$ & 0xffff; # Save lower 16 bits of pid $self->{"fh"} = FileHandle->new(); @@ -176,7 +176,7 @@ sub new } elsif ($self->{"proto"} eq "tcp" || $self->{"proto"} eq "stream") { - $self->{"proto_num"} = (getprotobyname('tcp'))[2] || + $self->{"proto_num"} = eval { (getprotobyname('tcp'))[2] } || croak("Can't get tcp protocol by name"); $self->{"port_num"} = (getservbyname('echo', 'tcp'))[2] || croak("Can't get tcp echo port by name"); @@ -184,7 +184,7 @@ sub new } elsif ($self->{"proto"} eq "syn") { - $self->{"proto_num"} = (getprotobyname('tcp'))[2] || + $self->{"proto_num"} = eval { (getprotobyname('tcp'))[2] } || croak("Can't get tcp protocol by name"); $self->{"port_num"} = (getservbyname('echo', 'tcp'))[2] || croak("Can't get tcp echo port by name"); diff --git a/dist/Net-Ping/t/110_icmp_inst.t b/dist/Net-Ping/t/110_icmp_inst.t index b36d32fa43f..deddd8f8415 100644 --- a/dist/Net-Ping/t/110_icmp_inst.t +++ b/dist/Net-Ping/t/110_icmp_inst.t @@ -2,12 +2,17 @@ # Root access is required to actually perform icmp testing. use strict; +use Config; BEGIN { unless (eval "require Socket") { print "1..0 \# Skip: no Socket\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/dist/Net-Ping/t/120_udp_inst.t b/dist/Net-Ping/t/120_udp_inst.t index ca10543a696..d86dd003a69 100644 --- a/dist/Net-Ping/t/120_udp_inst.t +++ b/dist/Net-Ping/t/120_udp_inst.t @@ -2,6 +2,7 @@ # I do not know of any servers that support udp echo anymore. use strict; +use Config; BEGIN { unless (eval "require Socket") { @@ -12,6 +13,10 @@ BEGIN { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/dist/Net-Ping/t/130_tcp_inst.t b/dist/Net-Ping/t/130_tcp_inst.t index 2810c8f1d40..21f01817539 100644 --- a/dist/Net-Ping/t/130_tcp_inst.t +++ b/dist/Net-Ping/t/130_tcp_inst.t @@ -1,6 +1,7 @@ # Test to make sure object can be instantiated for tcp protocol. use strict; +use Config; BEGIN { unless (eval "require Socket") { @@ -11,6 +12,10 @@ BEGIN { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/dist/Net-Ping/t/140_stream_inst.t b/dist/Net-Ping/t/140_stream_inst.t index cb1ba5f4863..860402ea036 100644 --- a/dist/Net-Ping/t/140_stream_inst.t +++ b/dist/Net-Ping/t/140_stream_inst.t @@ -1,6 +1,7 @@ # Test to make sure object can be instantiated for stream protocol. use strict; +use Config; BEGIN { unless (eval "require Socket") { @@ -11,6 +12,10 @@ BEGIN { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/dist/Net-Ping/t/150_syn_inst.t b/dist/Net-Ping/t/150_syn_inst.t index d32bc852dfb..2012c96ae3c 100644 --- a/dist/Net-Ping/t/150_syn_inst.t +++ b/dist/Net-Ping/t/150_syn_inst.t @@ -1,6 +1,7 @@ # Test to make sure object can be instantiated for syn protocol. use strict; +use Config; BEGIN { unless (eval "require Socket") { @@ -11,6 +12,10 @@ BEGIN { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } diff --git a/dist/Net-Ping/t/450_service.t b/dist/Net-Ping/t/450_service.t index 6c1d938c2f1..c16b30d4369 100644 --- a/dist/Net-Ping/t/450_service.t +++ b/dist/Net-Ping/t/450_service.t @@ -1,5 +1,7 @@ # Testing service_check method using tcp and syn protocols. +use Config; + BEGIN { unless (eval "require IO::Socket") { print "1..0 \# Skip: no IO::Socket\n"; @@ -9,6 +11,10 @@ BEGIN { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use strict; diff --git a/dist/Net-Ping/t/500_ping_icmp.t b/dist/Net-Ping/t/500_ping_icmp.t index 3050cc3b5f0..62855ff54f0 100644 --- a/dist/Net-Ping/t/500_ping_icmp.t +++ b/dist/Net-Ping/t/500_ping_icmp.t @@ -2,12 +2,17 @@ # Root access is required. use strict; +use Config; BEGIN { unless (eval "require Socket") { print "1..0 \# Skip: no Socket\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/dist/Net-Ping/t/510_ping_udp.t b/dist/Net-Ping/t/510_ping_udp.t index cb0ca1b8b8b..aa48e9008b9 100644 --- a/dist/Net-Ping/t/510_ping_udp.t +++ b/dist/Net-Ping/t/510_ping_udp.t @@ -1,6 +1,7 @@ # Test to perform udp protocol testing. use strict; +use Config; sub isWindowsVista { return unless $^O eq 'MSWin32' or $^O eq "cygwin"; @@ -19,6 +20,7 @@ BEGIN {use_ok('Net::Ping')}; SKIP: { skip "No udp echo port", 1 unless getservbyname('echo', 'udp'); skip "udp ping blocked by Window's default settings", 1 if isWindowsVista(); + skip "No getprotobyname", 1 unless $Config{d_getpbyname}; my $p = new Net::Ping "udp"; is($p->ping("127.0.0.1"), 1); } diff --git a/dist/Net-Ping/t/520_icmp_ttl.t b/dist/Net-Ping/t/520_icmp_ttl.t index f553c634245..75c8c49586e 100644 --- a/dist/Net-Ping/t/520_icmp_ttl.t +++ b/dist/Net-Ping/t/520_icmp_ttl.t @@ -1,11 +1,17 @@ # Test to perform icmp protocol testing. # Root access is required. +use Config; + BEGIN { unless (eval "require Socket") { print "1..0 \# Skip: no Socket\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More qw(no_plan); diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL index fb5707c29a4..1d07312bf3c 100644 --- a/dist/XSLoader/XSLoader_pm.PL +++ b/dist/XSLoader/XSLoader_pm.PL @@ -8,7 +8,7 @@ print OUT <<'EOT'; package XSLoader; -$VERSION = "0.16"; +$VERSION = "0.17"; #use strict; @@ -88,10 +88,17 @@ EOT my $dl_dlext = quotemeta($Config::Config{'dlext'}); -print OUT <<"EOT"; +if ( $Config::Config{d_libname_unique} ) { + print OUT <<"EOT"; + my \$module_sym = join("_", \@modparts); + my \$file = "\$modlibname/auto/\$modpname/Perl_\$module_sym.$dl_dlext"; +EOT +} +else { + print OUT <<"EOT"; my \$file = "\$modlibname/auto/\$modpname/\$modfname.$dl_dlext"; EOT - +} print OUT <<'EOT'; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; diff --git a/doio.c b/doio.c index c24aaaf7fc8..184f8a9ff78 100644 --- a/doio.c +++ b/doio.c @@ -1442,8 +1442,10 @@ bool Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report) { dVAR; +#ifndef USE_SHELL_ALWAYS const char **a; char *s; +#endif char *buf; char *cmd; /* Make a copy so we can change it */ diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 562ba2d9834..a897677f322 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -85,7 +85,7 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - $VERSION = '1.18'; + $VERSION = '1.19'; } use Config; @@ -314,7 +314,14 @@ sub bootstrap { next unless -d $dir; # skip over uninteresting directories # check for common cases to avoid autoload of dl_findfile - my $try = "$dir/$modfname.$dl_dlext"; + my $try; + if ( $Config::Config{d_libname_unique} ) { + my $modsym = join("_", @modparts); + $try = "$dir/Perl_$modsym.$dl_dlext"; + } + else { + $try = "$dir/$modfname.$dl_dlext"; + } last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try); # no luck here, save dir for possible later dl_findfile search diff --git a/ext/File-Glob/t/basic.t b/ext/File-Glob/t/basic.t index 78710753f9c..8481e2624c3 100644 --- a/ext/File-Glob/t/basic.t +++ b/ext/File-Glob/t/basic.t @@ -158,6 +158,7 @@ is_deeply(\@a, ['a', 'b']); # and RCS files. Filter them out, and .pm files too, and patch temp files. @a = grep !/(,v$|~$|\.(pm|ori?g|rej)$)/, @a; @a = (grep !/test.pl/, @a) if $^O eq 'VMS'; +@a = (grep !/\.stdout$/, @a) if $^O eq 'linux-androideabi'; map { $_ =~ s/test\.?/TEST/i } @a if $^O eq 'VMS'; print "# @a\n"; diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t index 7b85b825e24..20a81291724 100644 --- a/ext/IPC-Open3/t/IPC-Open3.t +++ b/ext/IPC-Open3/t/IPC-Open3.t @@ -150,6 +150,8 @@ $TB->current_test($test); { local $::TODO = "$^O returns a pid and doesn't throw an exception" if $^O eq 'MSWin32'; + local $::TODO = "perls compiled with -DUSE_SHELL_ALWAYS return a pid and " + . "spew warnings on STDERR" if $Config{d_useshellcmds}; $pid = eval { open3 'WRITE', 'READ', 'ERROR', '/non/existent/program'; }; isnt($@, '', 'open3 of a non existent program fails with an exception in the parent') diff --git a/ext/POSIX/t/sysconf.t b/ext/POSIX/t/sysconf.t index ad1e482dc44..1cf0ced8289 100644 --- a/ext/POSIX/t/sysconf.t +++ b/ext/POSIX/t/sysconf.t @@ -86,8 +86,11 @@ SKIP: { 2 * @path_consts; for my $constant (@path_consts) { - _check_and_report(sub { fpathconf($fd, shift) }, $constant, + SKIP: { + skip "pathconf($constant) hangs on Android", 2 if $constant eq '_PC_LINK_MAX' && $^O eq 'linux-androideabi'; + _check_and_report(sub { fpathconf($fd, shift) }, $constant, "calling fpathconf($fd, $constant)"); + } } POSIX::close($fd); @@ -95,8 +98,11 @@ SKIP: { # testing pathconf() on a non-terminal file for my $constant (@path_consts) { + SKIP: { + skip "pathconf($constant) hangs on Android", 2 if $constant eq '_PC_LINK_MAX' && $^O eq 'linux-androideabi'; _check_and_report(sub { pathconf($testdir, shift) }, $constant, "calling pathconf('$testdir', $constant)"); + } } SKIP: { diff --git a/ext/POSIX/t/time.t b/ext/POSIX/t/time.t index 90b54caa47c..d986daa22ba 100644 --- a/ext/POSIX/t/time.t +++ b/ext/POSIX/t/time.t @@ -47,7 +47,10 @@ is(asctime(POSIX::localtime(12345678)), ctime(12345678), "asctime() and ctime() at 12345678"); # Careful! strftime() is locale sensitive. Let's take care of that -my $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!"; +my $orig_loc; +if ( $Config{d_setlocale} ) { + $orig_loc = setlocale(LC_TIME, "C") || die "Cannot setlocale() to C: $!"; +} my $jan_16 = 15 * 86400; is(ctime($jan_16), strftime("%a %b %d %H:%M:%S %Y\n", CORE::localtime($jan_16)), "get ctime() equal to strftime()"); @@ -68,7 +71,9 @@ is(ord strftime($ss, POSIX::localtime(time)), 223, 'Format string has correct character'); unlike($ss, qr/\w/, 'Still not internally UTF-8 encoded'); -setlocale(LC_TIME, $orig_loc) || die "Cannot setlocale() back to orig: $!"; +if ( $Config{d_setlocale} ) { + setlocale(LC_TIME, $orig_loc) || die "Cannot setlocale() back to orig: $!"; +} # clock() seems to have different definitions of what it does between POSIX # and BSD. Cygwin, Win32, and Linux lean the BSD way. So, the tests just diff --git a/ext/VMS-DCLsym/t/vms_dclsym.t b/ext/VMS-DCLsym/t/vms_dclsym.t index 9124bacfdab..2877df8033d 100644 --- a/ext/VMS-DCLsym/t/vms_dclsym.t +++ b/ext/VMS-DCLsym/t/vms_dclsym.t @@ -1,3 +1,9 @@ +BEGIN { + if ( $^O ne 'VMS' ) { + print "1..0 # Skip: Not running on VMS\n"; + exit 0; + } +} print "1..30\n"; require VMS::DCLsym or die "not ok 1\n"; diff --git a/ext/VMS-Stdio/t/vms_stdio.t b/ext/VMS-Stdio/t/vms_stdio.t index 64fe3a35731..d3efb192562 100644 --- a/ext/VMS-Stdio/t/vms_stdio.t +++ b/ext/VMS-Stdio/t/vms_stdio.t @@ -1,4 +1,10 @@ # Tests for VMS::Stdio v2.2 +BEGIN { + if ( $^O ne 'VMS' ) { + print "1..0 # Skip: Not running on VMS\n"; + exit 0; + } +} use VMS::Stdio; import VMS::Stdio qw(&flush &getname &rewind &sync &tmpnam); diff --git a/hints/linux-androideabi.sh b/hints/linux-androideabi.sh index de445369ec0..d222babf59a 100644 --- a/hints/linux-androideabi.sh +++ b/hints/linux-androideabi.sh @@ -3,9 +3,26 @@ # Install the perl and its libraries anywhere: userelocatableinc='define' +# The Android linker has some unusual behavior: No matter what +# path is passed in to dlopen(), it'll only use the path's +# basename when trying to find a cached library. +# Unfortunately, this is quite problematic for us, since for example, +# Hash::Util and List::Util both end up creating a Util.so -- +# So if you load List::Util and then Hash::Util, the dlopen() for +# the latter will return the handle for the former. +# See the implementation for details: +# https://code.google.com/p/android-source-browsing/source/browse/linker/linker.c?repo=platform--bionic&r=9ec0f03a0d0b17bbb94ac0b9fef6add28a133c3a#1231 +# What d_libname_unique does is inform MakeMaker that, rather than +# creating Hash/Util/Util.so, it needs to make Hash/Util/Perl_Hash_Util.so +d_libname_unique='define' + # On Android the shell is /system/bin/sh: targetsh='/system/bin/sh' +# On some devices drand48 isn't functional +randfunc='random' +randbits='31' + # Down with locales! # https://github.com/android/platform_bionic/blob/master/libc/CAVEATS d_locconv='undef' @@ -15,7 +32,102 @@ i_locale='undef' # Default to USE_SHELL_ALWAYS d_useshellcmds='define' -d_libname_unique='define' + +# https://code.google.com/p/android-source-browsing/source/browse/libc/netbsd/net/getservent_r.c?repo=platform--bionic&r=ca6fe7bebe3cc6ed7e2db5a3ede2de0fcddf411d#95 +d_getservent_r='undef' + +# Bionic defines several stubs that just warn and return NULL +# https://gitorious.org/0xdroid/bionic/blobs/70b2ef0ec89a9c9d4c2d4bcab728a0e72bafb18e/libc/bionic/stubs.c +# https://android.googlesource.com/platform/bionic/+/master/libc/bionic/stubs.cpp + +# If they warn with 'FIX' or 'Android', assume they are the stubs +# we want to avoid. + +# These are all stubs as well, but the core doesn't use them: +# getusershell setusershell endusershell + +# This script UU/archname.cbu will get 'called-back' by Configure. +cat > UU/archname.cbu <<'EOCBU' +# egrep pattern to detect a stub warning on Android. +# Right now we're checking for: +# Android 2.x: FIX ME! implement FUNC +# Android 4.x: FUNC is not implemented on Android +android_stub='FIX|Android' + +cat > try.c << 'EOM' +#include +int main() { (void) getnetbyname("foo"); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getnbyname="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getnetbyaddr((uint32_t)1, AF_INET); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getnbyaddr="$undef" +fi + +cat > try.c << 'EOM' +#include +#include +#include +int main() { (void) getmntent(stdout); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getmntent="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getprotobyname("foo"); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getpbyname="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) getprotobynumber(1); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_getpbynumber="$undef" +fi + +cat > try.c << 'EOM' +#include +#include +int main() { endpwent(); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_endpwent="$undef" +fi + +cat > try.c << 'EOM' +#include +int main() { (void) ttyname(STDIN_FILENO); return(0); } +EOM +$cc $ccflags try.c -o try +android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` +if test "X$android_warn" != X; then + d_ttyname="$undef" +fi + +EOCBU case "$src" in /*) run=$src/Cross/run @@ -75,7 +187,7 @@ $from output.stdout $from output.stderr result=\`cat output.stdout\` result_err=\`cat output.stderr\` -rm output.stdout +rm output.stdout output.stderr result=\`echo "\$result" | sed -e 's|\r||g'\` result_err=\`echo "\$result_err" | sed -e 's|\r||g'\` foo=\`echo \$foo | sed -e 's|\r||g'\` diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index 7a83c98f767..bda7426c30a 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -11,14 +11,20 @@ chdir 't'; use Config; use ExtUtils::Embed; use File::Spec; +use IPC::Cmd qw(can_run); open(my $fh,">embed_test.c") || die "Cannot open embed_test.c:$!"; print $fh ; close($fh); $| = 1; -print "1..9\n"; my $cc = $Config{'cc'}; +if ( $Config{usecrosscompile} && !can_run($cc) ) { + print "1..0 # SKIP Cross-compiling and the target doesn't have $cc"; + exit; +} + +print "1..9\n"; my $cl = ($^O eq 'MSWin32' && $cc eq 'cl'); my $skip_exe = $^O eq 'os2' && $Config{ldflags} =~ /(?= 0) { f = PerlIO_fdopen(fd, "w+"); if (f) diff --git a/pod/perlport.pod b/pod/perlport.pod index cdde52db3cb..83ce50248c2 100644 --- a/pod/perlport.pod +++ b/pod/perlport.pod @@ -1566,6 +1566,9 @@ Access permissions are mapped onto VOS access-control list changes. (VOS) The actual permissions set depend on the value of the C in the SYSTEM environment settings. (Cygwin) +Setting the exec bit on some locations (generally /sdcard) will return true +but not actually set the bit. (Android) + =item chown Not implemented. (Win32, S, S) @@ -1583,6 +1586,8 @@ Not implemented. (Win32, VMS, S, S, VOS) May not be available if library or source was not provided when building perl. (Win32) +Not implemented. (Android) + =item dbmclose Not implemented. (VMS, S, VOS) @@ -1606,6 +1611,9 @@ Does not automatically flush output handles on some platforms. Not supported. (Symbian OS) +Won't return if the executable does not exist on Perls compiled with +-DUSE_SHELL_ALWAYS. + =item exit Emulates Unix exit() (which considers C to indicate an error) by @@ -1674,7 +1682,7 @@ Not implemented. (Win32, VMS, S) =item getnetbyname -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getpwuid @@ -1688,19 +1696,21 @@ Not implemented. (Win32, VMS, S) =item getnetbyaddr -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getprotobynumber +Not implemented. (Android) + =item getservbyport =item getpwent -Not implemented. (Win32) +Not implemented. (Android, Win32) =item getgrent -Not implemented. (Win32, VMS) +Not implemented. (Android, Win32, VMS) =item gethostbyname @@ -1713,19 +1723,23 @@ Not implemented. (Win32) =item getnetent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getprotoent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item getservent Not implemented. (Win32, S) +=item seekdir + +Not implemented. (Android) + =item sethostent -Not implemented. (Win32, S, S) +Not implemented. (Android, Win32, S, S) =item setnetent @@ -1733,7 +1747,7 @@ Not implemented. (Win32, S, S) =item setprotoent -Not implemented. (Win32, S, S) +Not implemented. (Android, Win32, S, S) =item setservent @@ -1743,21 +1757,23 @@ Not implemented. (S, Win32, S) Not implemented. (Win32) +Either not implemented or a no-op. (Android) + =item endgrent -Not implemented. (S, VMS, Win32) +Not implemented. (Android, S, VMS, Win32) =item endhostent -Not implemented. (Win32) +Not implemented. (Android, Win32) =item endnetent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item endprotoent -Not implemented. (Win32, S) +Not implemented. (Android, Win32, S) =item endservent @@ -1845,7 +1861,7 @@ Return values (especially for device and inode) may be bogus. (Win32) =item msgrcv -Not implemented. (Win32, VMS, S, S, VOS) +Not implemented. (Android, Win32, VMS, S, S, VOS) =item open @@ -1854,6 +1870,13 @@ open to C<|-> and C<-|> are unsupported. (Win32, S) Opening a process does not automatically flush output handles on some platforms. (SunOS, Solaris, HP-UX) +While you may use open with undef as the filename to create a temporary +file, this is unreliable, as a system may not have a /tmp directory or +equivalent, and have no $ENV{TMPDIR} set. Consider using File::Temp +instead. Alternatively, you could explicitly set $ENV{TMPDIR} before +calling open. If neither TMPDIR nor /tmp exist, the current directory +is used. (Android) + =item readlink Not implemented. (Win32, VMS, S) @@ -1882,11 +1905,11 @@ Note that the C