summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MANIFEST2
-rw-r--r--ext/POSIX/hints/linux.pl5
-rw-r--r--ext/POSIX/hints/sunos_4.pl6
-rw-r--r--hints/linux.sh8
-rw-r--r--hints/sunos_4_1.sh4
-rwxr-xr-xt/lib/posix.t10
6 files changed, 21 insertions, 14 deletions
diff --git a/MANIFEST b/MANIFEST
index 36fe3b8467..68708c132a 100644
--- 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
index 0000000000..7994f24023
--- /dev/null
+++ b/ext/POSIX/hints/linux.pl
@@ -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
index 0000000000..59b45bc4f2
--- /dev/null
+++ b/ext/POSIX/hints/sunos_4.pl
@@ -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' ;
diff --git a/hints/linux.sh b/hints/linux.sh
index af7d0a835e..8ff7f5d747 100644
--- a/hints/linux.sh
+++ b/hints/linux.sh
@@ -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
diff --git a/hints/sunos_4_1.sh b/hints/sunos_4_1.sh
index 07cd89fc7b..9f342d100b 100644
--- a/hints/sunos_4_1.sh
+++ b/hints/sunos_4_1.sh
@@ -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
diff --git a/t/lib/posix.t b/t/lib/posix.t
index 6ae88c0dd2..d63e695f02 100755
--- a/t/lib/posix.t
+++ b/t/lib/posix.t
@@ -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);