Re: posix::strftime (core dumped)
authorAndy Dougherty <doughera@lafayette.edu>
Thu, 5 Feb 1998 13:55:23 +0000 (08:55 -0500)
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>
Fri, 6 Feb 1998 17:24:57 +0000 (17:24 +0000)
p4raw-id: //depot/perl@481

MANIFEST
ext/POSIX/hints/linux.pl [new file with mode: 0644]
ext/POSIX/hints/sunos_4.pl [new file with mode: 0644]
hints/linux.sh
hints/sunos_4_1.sh
t/lib/posix.t

index 36fe3b8..68708c1 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -181,7 +181,9 @@ ext/POSIX/Makefile.PL               POSIX extension makefile writer
 ext/POSIX/POSIX.pm             POSIX extension Perl module
 ext/POSIX/POSIX.pod            POSIX extension documentation
 ext/POSIX/POSIX.xs             POSIX extension external subroutines
+ext/POSIX/hints/linux.pl       Hint for POSIX for named architecture
 ext/POSIX/hints/next_3.pl      Hint for POSIX for named architecture
+ext/POSIX/hints/sunos_4.pl     Hint for POSIX for named architecture
 ext/POSIX/typemap              POSIX extension interface types
 ext/SDBM_File/Makefile.PL      SDBM extension makefile writer
 ext/SDBM_File/SDBM_File.pm     SDBM extension Perl module
diff --git a/ext/POSIX/hints/linux.pl b/ext/POSIX/hints/linux.pl
new file mode 100644 (file)
index 0000000..7994f24
--- /dev/null
@@ -0,0 +1,5 @@
+# libc6, aka glibc2, seems to need STRUCT_TM_HASZONE defined.
+# Thanks to Bart Schuller <schuller@Lunatech.com>
+# See Message-ID: <19971009002636.50729@tanglefoot>
+#  XXX A Configure test is needed.
+$self->{CCFLAGS} = $Config{ccflags} . ' -DSTRUCT_TM_HASZONE' ;
diff --git a/ext/POSIX/hints/sunos_4.pl b/ext/POSIX/hints/sunos_4.pl
new file mode 100644 (file)
index 0000000..59b45bc
--- /dev/null
@@ -0,0 +1,6 @@
+# SunOS 4.1.3 has two extra fields in struct tm.  This works around
+# the problem.  Other BSD platforms may have similar problems.
+# This state of affairs also persists in glibc2, found
+# on linux systems running libc6.
+#  XXX A Configure test is needed.
+$self->{CCFLAGS} = $Config{ccflags} . ' -DSTRUCT_TM_HASZONE' ;
index af7d0a8..8ff7f5d 100644 (file)
@@ -29,14 +29,6 @@ esac
 # gcc-2.6.3 defines _G_HAVE_BOOL to 1, but doesn't actually supply bool.
 ccflags="-Dbool=char -DHAS_BOOL $ccflags"
 
-# libc6, aka glibc2, seems to need STRUCT_TM_HASZONE defined.
-# Thanks to Bart Schuller <schuller@Lunatech.com>
-# See Message-ID: <19971009002636.50729@tanglefoot>
-# This is currently commented out for maintenance releases
-# but should probably be uncommented for 5.005 or after
-# more widespread testing.
-#POSIX_cflags='ccflags="$ccflags -DSTRUCT_TM_HASZONE"'
-
 # BSD compatability library no longer needed
 set `echo X "$libswanted "| sed -e 's/ bsd / /'`
 shift
index 07cd89f..9f342d1 100644 (file)
@@ -37,10 +37,6 @@ d_tzname and i_unistd.  Keep the recommended values.  See
 hints/sunos_4_1.sh for more information.
 EOM
 
-# SunOS 4.1.3 has two extra fields in struct tm.  This works around
-# the problem.  Other BSD platforms may have similar problems.
-POSIX_cflags='ccflags="$ccflags -DSTRUCT_TM_HASZONE"'
-
 # The correct setting of groupstype depends on which version of the C
 # library is used.  If you are in the 'System V environment'
 # (i.e. you have /usr/5bin ahead of /usr/bin in your PATH), and
index 6ae88c0..d63e695 100755 (executable)
@@ -10,11 +10,11 @@ BEGIN {
     }
 }
 
-use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read write);
+use POSIX qw(fcntl_h signal_h limits_h _exit getcwd open read strftime write);
 use strict subs;
 
 $| = 1;
-print "1..17\n";
+print "1..18\n";
 
 $testfd = open("TEST", O_RDONLY, 0) and print "ok 1\n";
 read($testfd, $buffer, 9) if $testfd > 2;
@@ -80,6 +80,12 @@ if ($Config{d_strtoul}) {
 # Pick up whether we're really able to dynamically load everything.
 print &POSIX::acos(1.0) == 0.0 ? "ok 17\n" : "not ok 17\n";
 
+# This can coredump if struct tm has a timezone field and we
+# didn't detect it.  If this fails, try adding
+# -DSTRUCT_TM_HASZONE to your cflags when compiling ext/POSIX/POSIX.c.
+# See ext/POSIX/hints/sunos_4.pl and ext/POSIX/hints/linux.pl 
+print POSIX::strftime("ok 18 # %H:%M, on %D\n", localtime());
+
 $| = 0;
 print '@#!*$@(!@#$';
 _exit(0);