X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/c0401c5d0025c7e4550e55b2b006241dadab25cf..18729d3e27f8d8545469c3e23a69b10dc409a88f:/ext/Time/HiRes/Makefile.PL diff --git a/ext/Time/HiRes/Makefile.PL b/ext/Time/HiRes/Makefile.PL index aed03d9..8343307 100644 --- a/ext/Time/HiRes/Makefile.PL +++ b/ext/Time/HiRes/Makefile.PL @@ -14,6 +14,8 @@ my $DEFINE; my $LIBS; my $XSOPT; +my $ld_exeext = ($^O eq 'os2' and $Config{ldflags} =~ /-Zexe\b/) ? '.exe' : ''; + unless($ENV{PERL_CORE}) { $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV; } @@ -48,8 +50,8 @@ sub my_updir { BEGIN { eval { require File::Spec }; if ($@) { - *File::Spec::catdir = \&my_catdir; - *File::Spec::updir = \&my_updir; + *File::Spec::catdir = \&my_catdir; + *File::Spec::updir = \&my_updir; *File::Spec::catfile = \&my_catfile; } } @@ -139,10 +141,11 @@ sub try_compile_and_link { } else { + my $tmp_exe = "$tmp$ld_exeext"; printf "cccmd = $cccmd\n" if $VERBOSE; - system($cccmd); - $ok = -s $tmp && -x _; - unlink("$tmp.c", $tmp); + my $res = system($cccmd); + $ok = defined($res) && $res==0 && -s $tmp_exe && -x _; + unlink("$tmp.c", $tmp_exe); } } @@ -225,8 +228,8 @@ sub unixinit { $LIBS = ['-lc'] if $Config{'osname'} =~ /dynixptx/i; # For nanosleep - push @$LIBS, '-lrt' unless $Config{'osname'} =~ /irix/; - push @$LIBS, '-lposix4' ; + push @$LIBS, '-lrt' unless $Config{'osname'} =~ /^(?:irix|linux)$/; + push @$LIBS, '-lposix4'; my @goodlibs; @@ -367,7 +370,8 @@ EOD print "You can mix subsecond sleeps with signals.\n"; } else { print "NOT found.\n"; - print "You cannot mix subsecond sleeps with signals.\n"; + my $nt = ($^O eq 'os2' ? '' : 'not'); + print "You can$nt mix subsecond sleeps with signals.\n"; } if ($DEFINE) {