Convert all unimaginative (ie race condition) temporary file names to
[p5sagit/p5-mst-13.2.git] / Configure
index 56f4af6..869ed19 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -25,7 +25,7 @@
 
 # $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
 #
-# Generated on Mon Jun 16 16:07:02 CEST 2008 [metaconfig 3.5 PL0]
+# Generated on Thu Jul 10 17:14:53 CEST 2008 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -777,6 +777,7 @@ d_tcsetpgrp=''
 d_telldirproto=''
 d_time=''
 timetype=''
+d_timegm=''
 clocktype=''
 d_times=''
 d_tmpnam_r=''
@@ -1171,6 +1172,8 @@ stdchar=''
 d_stdio_stream_array=''
 stdio_stream_array=''
 sysman=''
+sGMTIME_max=''
+sGMTIME_min=''
 trnl=''
 uidformat=''
 uidsign=''
@@ -17459,7 +17462,6 @@ int main(int argc, char **argv) {
 EOP
 set try
 
-d_sprintf_returns_strlen="$undef"
 if eval $compile; then
     xxx="`$run ./try`"
     case "$?" in
@@ -17474,6 +17476,9 @@ EOM
        d_sprintf_returns_strlen="$undef"
         ;;
     esac
+else
+    echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
+    d_sprintf_returns_strlen="$undef"
 fi
 $rm_try
 
@@ -18103,6 +18108,10 @@ if test "X$d_time" = X -o X"$timetype" = X; then
     eval $setvar
 fi
 
+: see if timegm exists
+set timegm d_timegm
+eval $inlibc
+
 : see if this is a sys/times.h system
 set sys/times.h i_systimes
 eval $inhdr
@@ -20001,6 +20010,90 @@ else
 fi
 $rm -f foo* bar*
 
+: see if this is a values.h system
+set values.h i_values
+eval $inhdr
+
+: Check the max offset that gmtime accepts
+echo "Checking max offsets that gmtime () accepts"
+
+case $i_values in
+    define) yyy="#include <values.h>" ;;
+    *)      yyy="" ;;
+    esac
+
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+$yyy
+
+int i;
+struct tm *tmp;
+time_t pt;
+
+void gm_check (time_t t)
+{
+    tmp = gmtime (&t);
+    if (tmp == NULL || tmp->tm_year < -1900)
+       tmp = NULL;
+    else
+       pt = t;
+    } /* gm_check */
+
+int check_max ()
+{
+  tmp = NULL;
+  pt  = 0;
+#ifdef MAXLONG
+  gm_check (MAXLONG);
+#endif
+  if (tmp == NULL || tmp->tm_year < 0) {
+    for (i = 63; i >= 0; i--) {
+      time_t x = pt | ((time_t)1 << i);
+      if (x < 0) continue;
+      gm_check (x);
+      }
+    }
+  printf ("sGMTIME_max=%ld\n", pt);
+  return (0);
+  }
+
+int check_min ()
+{
+  tmp = NULL;
+  pt  = 0;
+#ifdef MINLONG
+  gm_check (MINLONG);
+#endif
+  if (tmp == NULL) {
+    for (i = 36; i >= 0; i--) {
+      time_t x = pt - ((time_t)1 << i);
+      if (x > 0) continue;
+      gm_check (x);
+      }
+    }
+  printf ("sGMTIME_min=%ld\n", pt);
+  return (0);
+  }
+
+int main (int argc, char *argv[])
+{
+  fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
+  check_max ();
+  check_min ();
+  return (0);
+  } /* main */
+EOCP
+set try
+if eval $compile; then
+    yyy=`$run ./try`
+    eval $yyy
+else
+    echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
+    fi
+$rm_try
+
 : check for type of arguments to select.
 case "$selecttype" in
 '') case "$d_select" in
@@ -21263,10 +21356,6 @@ eval $inhdr
 set utime.h i_utime
 eval $inhdr
 
-: see if this is a values.h system
-set values.h i_values
-eval $inhdr
-
 : see if this is a vfork system
 case "$d_vfork" in
 "$define")
@@ -22233,6 +22322,7 @@ d_tcsetpgrp='$d_tcsetpgrp'
 d_telldir='$d_telldir'
 d_telldirproto='$d_telldirproto'
 d_time='$d_time'
+d_timegm='$d_timegm'
 d_times='$d_times'
 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
 d_tm_tm_zone='$d_tm_tm_zone'
@@ -22620,6 +22710,8 @@ rm_try='$rm_try'
 rmail='$rmail'
 run='$run'
 runnm='$runnm'
+sGMTIME_max='$sGMTIME_max'
+sGMTIME_min='$sGMTIME_min'
 sPRIEUldbl='$sPRIEUldbl'
 sPRIFUldbl='$sPRIFUldbl'
 sPRIGUldbl='$sPRIGUldbl'