[Orca-checkins] rev 184 - in trunk/orca: . packages packages/Time-HiRes-1.41

blair at orcaware.com blair at orcaware.com
Fri Jan 3 18:13:38 PST 2003


Author: blair
Date: 2003-01-03 18:13:16 -0800 (Fri, 03 Jan 2003)
New Revision: 184

Added:
   trunk/orca/packages/Time-HiRes-1.41/
Removed:
   trunk/orca/packages/Time-HiRes-1.39/
Modified:
   trunk/orca/configure.in
   trunk/orca/packages/Time-HiRes-1.41/Changes
   trunk/orca/packages/Time-HiRes-1.41/HiRes.pm
   trunk/orca/packages/Time-HiRes-1.41/Makefile.PL
Log:
Upgrade Time::HiRes from 1.39 to 1.41.

* configure.in:
  Bump Time::HiRes' version number to 1.41.

* packages/Time-HiRes-1.41:
  Renamed from packages/Time-HiRes-1.39.  Directory contents updated
  from Time-HiRes-1.41.tar.gz.


Modified: trunk/orca/configure.in
==============================================================================
--- trunk/orca/configure.in	(original)
+++ trunk/orca/configure.in	2003-01-03 18:13:35.000000000 -0800
@@ -39,8 +39,8 @@
 RRDTOOL_VER=1.000401
 STORABLE_DIR=Storable-2.06
 STORABLE_VER=2.06
-TIME_HIRES_DIR=Time-HiRes-1.39
-TIME_HIRES_VER=1.39
+TIME_HIRES_DIR=Time-HiRes-1.41
+TIME_HIRES_VER=1.41
 
 AC_SUBST(COMPRESS_ZLIB_DIR)
 AC_SUBST(DATA_DUMPER_DIR)

Copied: Time-HiRes-1.41 (from rev 183, trunk/orca/packages/Time-HiRes-1.39)

Modified: trunk/orca/packages/Time-HiRes-1.41/HiRes.pm
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.39/HiRes.pm	(original)
+++ trunk/orca/packages/Time-HiRes-1.41/HiRes.pm	2003-01-03 18:13:35.000000000 -0800
@@ -15,7 +15,7 @@
 		 d_usleep d_ualarm d_gettimeofday d_getitimer d_setitimer
 		 d_nanosleep);
 	
-$VERSION = '1.39';
+$VERSION = '1.41';
 $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 

Modified: trunk/orca/packages/Time-HiRes-1.41/Makefile.PL
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.39/Makefile.PL	(original)
+++ trunk/orca/packages/Time-HiRes-1.41/Makefile.PL	2003-01-03 18:13:35.000000000 -0800
@@ -7,10 +7,18 @@
 
 use Config;
 use ExtUtils::MakeMaker;
-
-# Perls 5.002 and 5.003 did not have File::Spec, fake what we need.
+use strict;
 
 my $VERBOSE = $ENV{VERBOSE};
+my $DEFINE;
+my $LIBS;
+my $XSOPT;
+
+unless($ENV{PERL_CORE}) { # This trick from Encode/Makefile.PL.
+    $ENV{PERL_CORE} = 1 if ($^X =~ m{\bminiperl[^/\\\]>:]*$}o);
+}
+
+# Perls 5.002 and 5.003 did not have File::Spec, fake what we need.
 
 sub my_dirsep {
     $^O eq 'VMS' ? '.' :
@@ -22,7 +30,7 @@
 sub my_catdir {
     shift;
     my $catdir = join(my_dirsep, @_);
-    $^O eq 'VMS' ? "[$dirsep]" : $dirsep;
+    $^O eq 'VMS' ? "[$catdir]" : $catdir;
 }
 
 sub my_updir {
@@ -38,6 +46,10 @@
     }
 }
 
+# Avoid 'used only once' warnings.
+my $nop1 = *File::Spec::catdir;
+my $nop2 = *File::Spec::updir;
+
 # if you have 5.004_03 (and some slightly older versions?), xsubpp
 # tries to generate line numbers in the C code generated from the .xs.
 # unfortunately, it is a little buggy around #ifdef'd code.
@@ -50,8 +62,7 @@
     my $TMPDIR =
 	(grep(defined $_ && -d $_ && -w _,
 	      ((defined $ENV{'TMPDIR'} ? $ENV{'TMPDIR'} : undef),
-	       qw(/var/tmp /usr/tmp /tmp))))[0]
-		   unless defined $TMPDIR;
+	       qw(/var/tmp /usr/tmp /tmp))))[0];
     $TMPDIR || die "Cannot find writable temporary directory.\n";
 }
 
@@ -59,7 +70,7 @@
     my ($c, %args) = @_;
 
     my ($ok) = 0;
-    my ($tmp) = (($^O eq 'VMS') ? "sys\$scratch:tmp$$" : TMPDIR . '/' . "tmp$$");
+    my ($tmp) = (($^O eq 'VMS') ? "sys\$scratch:tmp$$" : TMPDIR() . '/' . "tmp$$");
     local(*TMPC);
 
     my $obj_ext = $Config{obj_ext} || ".o";
@@ -69,18 +80,21 @@
 	print TMPC $c;
 	close(TMPC);
 
-	$cccmd = $args{cccmd};
+	my $cccmd = $args{cccmd};
 
 	my $errornull;
 
 	my $COREincdir;
+
 	if ($ENV{PERL_CORE}) {
 	    my $updir = File::Spec->updir;
 	    $COREincdir = File::Spec->catdir(($updir) x 3);
 	} else {
 	    $COREincdir = File::Spec->catdir($Config{'archlibexp'}, 'CORE');
 	}
+
 	my $ccflags = $Config{'ccflags'} . ' ' . "-I$COREincdir";
+
 	if ($^O eq 'VMS') {
 	    if ($ENV{PERL_CORE}) {
 		# Fragile if the extensions change hierachy within
@@ -89,7 +103,7 @@
 	    } else {
 		my $perl_core = $Config{'installarchlib'};
 		$perl_core =~ s/\]$/.CORE]/;
-                $cccmd = "$Config{'cc'} /include=(perl_root:[000000],$perl_core) $tmp.c"; 
+                $cccmd = "$Config{'cc'} /include=(perl_root:[000000],$perl_core) $tmp.c";
 	    }
         }
 
@@ -99,18 +113,19 @@
 	    $errornull = '';
 	}
 
-	$cccmd = "$Config{'cc'} -o $tmp $ccflags $tmp.c @$LIBS $errornull"
+        $cccmd = "$Config{'cc'} -o $tmp $ccflags $tmp.c @$LIBS $errornull"
 	    unless defined $cccmd;
+
 	if ($^O eq 'VMS') {
 	    open( CMDFILE, ">$tmp.com" );
 	    print CMDFILE "\$ SET MESSAGE/NOFACILITY/NOSEVERITY/NOIDENT/NOTEXT\n";
 	    print CMDFILE "\$ $cccmd\n";
-	    print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n";  # escalate
+	    print CMDFILE "\$ IF \$SEVERITY .NE. 1 THEN EXIT 44\n"; # escalate
 	    close CMDFILE;
 	    system("\@ $tmp.com");
 	    $ok = $?==0;
 	    for ("$tmp.c", "$tmp$obj_ext", "$tmp.com", "$tmp$Config{exe_ext}") { 
-		1 while unlink $_; 
+		1 while unlink $_;
 	    }
         }
         else
@@ -128,7 +143,7 @@
 sub has_gettimeofday {
     # confusing but true (if condition true ==> -DHAS_GETTIMEOFDAY already)
     return 0 if $Config{'d_gettimeod'} eq 'define';
-    return 1 if try_compile_and_link(<<EOM); 
+    return 1 if try_compile_and_link(<<EOM);
 #include "EXTERN.h" 
 #include "perl.h" 
 #include "XSUB.h" 
@@ -157,7 +172,7 @@
 }
 
 sub has_x {
-    my ($x, %args) = @_; 
+    my ($x, %args) = @_;
 
     return 1 if
     try_compile_and_link(<<EOM, %args);
@@ -206,24 +221,27 @@
 
     my @goodlibs;
 
-    select(STDOUT); $| = 1;
+    select(STDOUT);
+    $| = 1;
 
     print "Checking for libraries...\n";
     my $lib;
     for $lib (@$LIBS) {
-	print "Checking for $lib...\n";
+	print "Checking for $lib... ";
 	$LIBS = [ $lib ];
 	if ($Config{libs} =~ /\b$lib\b/ || has_x("time(0)")) {
 	    push @goodlibs, $lib;
+	    print "found.\n";
+	} else {
+	    print "NOT found.\n";
 	}
     }
-    @$LIBS = @goodlibs;
+    $LIBS = [ @goodlibs ];
     print @$LIBS ?
 	  "You have extra libraries: @$LIBS.\n" :
           "You have no applicable extra libraries.\n";
-    print "\n";
 
-    print "Looking for gettimeofday()...\n";
+    print "Looking for gettimeofday()... ";
     my $has_gettimeofday;
     if ($Config{'d_gettimeod'}) {
 	$has_gettimeofday++;
@@ -233,7 +251,7 @@
     }
 
     if ($has_gettimeofday) {
-	print "You have gettimeofday().\n\n";
+	print "found.\n";
     } else {
 	die <<EOD
 Your operating system does not seem to have the gettimeofday() function.
@@ -248,7 +266,7 @@
 EOD
     }
 
-    print "Looking for setitimer()...\n";
+    print "Looking for setitimer()... ";
     my $has_setitimer;
     if ($Config{d_setitimer}) {
         $has_setitimer++;
@@ -258,12 +276,12 @@
     }
 
     if ($has_setitimer) {
-        print "You have setitimer().\n\n";
+        print "found.\n";
     } else {
-	print "No setitimer().\n\n";
+	print "NOT found.\n";
     }
 
-    print "Looking for getitimer()...\n";
+    print "Looking for getitimer()... ";
     my $has_getitimer;
     if ($Config{d_getitimer}) {
         $has_getitimer++;
@@ -273,19 +291,19 @@
     }
 
     if ($has_getitimer) {
-        print "You have getitimer().\n\n";
+        print "found.\n";
     } else {
-	print "No getitimer().\n\n";
+	print "NOT found.\n";
     }
 
     if ($has_setitimer && $has_getitimer) {
-	print "You have interval timers (both setitimer and setitimer).\n\n";
+	print "You have interval timers (both setitimer and setitimer).\n";
     } else {
-	print "You do not have interval timers.\n\n";
+	print "You do not have interval timers.\n";
     }
 
-    print "Looking for ualarm()...\n";
-    my $has_ualarm; 
+    print "Looking for ualarm()... ";
+    my $has_ualarm;
     if ($Config{d_ualarm}) {
         $has_ualarm++;
     } elsif (has_x ("ualarm (0, 0)")) {
@@ -294,17 +312,16 @@
     }
 
     if ($has_ualarm) {
-        print "You have ualarm().\n\n";
+        print "found.\n";
     } else {
-	print "Whoops! No ualarm()!\n";
-	if ($setitimer) {
-	    print "You have setitimer(); we can make a Time::HiRes::ualarm()\n\n";
-	} else {
-	     print "We'll manage.\n\n";
+	print "NOT found.\n";
+	if ($has_setitimer) {
+	    print "But you have setitimer().\n";
+	    print "We can make a Time::HiRes::ualarm().\n";
 	}
     }
 
-    print "Looking for usleep()...\n";
+    print "Looking for usleep()... ";
     my $has_usleep;
     if ($Config{d_usleep}) {
 	$has_usleep++;
@@ -314,17 +331,20 @@
     }
 
     if ($has_usleep) {
-	print "You have usleep().\n\n";
+	print "found.\n";
     } else {
-	print "Whoops! No usleep()! Let's see if you have select().\n";
+	print "NOT found.\n";
+        print "Let's see if you have select()... ";
         if ($Config{'d_select'} eq 'define') {
-	    print "You have select(); we can make a Time::HiRes::usleep()\n\n";
+	    print "found.\n";
+	    print "We can make a Time::HiRes::usleep().\n";
 	} else {
-	    print "No select(); you won't have a Time::HiRes::usleep()\n\n";
+	    print "NOT found.\n";
+	    print "You won't have a Time::HiRes::usleep().\n";
 	}
     }
 
-    print "Looking for nanosleep()...\n";
+    print "Looking for nanosleep()... ";
     my $has_nanosleep;
     if ($Config{d_nanosleep}) {
 	$has_nanosleep++;
@@ -334,9 +354,11 @@
     }
 
     if ($has_nanosleep) {
-	print "You have nanosleep().  You can mix subsecond sleeps with signals.\n\n";
+	print "found.\n";
+        print "You can mix subsecond sleeps with signals.\n";
     } else {
-	print "Whoops! No nanosleep()!  You cannot mix subsecond sleeps with signals.\n";
+	print "NOT found.\n";
+        print "You cannot mix subsecond sleeps with signals.\n";
     }
 
     if ($DEFINE) {
@@ -349,7 +371,7 @@
 }
 
 sub doMakefile {
-    @makefileopts = ();
+    my @makefileopts = ();
 
     if ($] >= 5.005) {
 	push (@makefileopts,
@@ -380,11 +402,7 @@
 }
 
 sub main {
-    print <<EOM;
-
-Configuring Time::HiRes...
-
-EOM
+    print "Configuring Time::HiRes...\n";
 
     if ($^O =~ /Win32/i) {
       $DEFINE = '-DSELECT_IS_BROKEN';
@@ -392,16 +410,11 @@
     } else {
       unixinit();
     }
-    configure;
     doMakefile;
     my $make = $Config{'make'} || "make";
     unless ($ENV{PERL_CORE}) {
 	print  <<EOM;
-
-Done configuring.
-
 Now you may issue '$make'.  Do not forget also '$make test'.
-
 EOM
     }
 }

Modified: trunk/orca/packages/Time-HiRes-1.41/Changes
==============================================================================
--- trunk/orca/packages/Time-HiRes-1.39/Changes	(original)
+++ trunk/orca/packages/Time-HiRes-1.41/Changes	2003-01-03 18:13:35.000000000 -0800
@@ -1,5 +1,23 @@
 Revision history for Perl extension Time::HiRes.
 
+1.41
+	- At some point the ability to figure our the correct incdir
+	  for EXTERN.h (either a core perl build, or an installed perl)
+	  had broken (which lead into all test compiles failing with
+	  a core perl build, but thanks to the robustness of Makefile.PL
+	  nothing of was visible).  The brokenness seemed to be caused
+	  by $ENV{PERL_CORE} not being on for core builds?  Now stole
+	  a trick from the Encode that sets $ENV{PERL_CORE} right, and
+	  both styles of build should work again.
+
+1.40
+	- Nick Clark noticed that the my_catdir() emulation function
+	  was broken (which means that we didn't really work for Perls
+	  5.002 and 5.003)
+	- inspired by fixing the above made the whole Makefile.PL -w
+	  and strict clean
+	- tightened up the Makefile.PL output, less whitespace
+
 1.39
 	- fix from Craig Berry for better building in VMS with PERL_CORE
 



More information about the Orca-checkins mailing list