up patchlevel &c
[p5sagit/p5-mst-13.2.git] / Configure
index 890bfd4..83e41da 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Thu May 13 16:42:40 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Sat May 22 00:54:37 EET DST 1999 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -799,6 +799,7 @@ d_fsetpos64=''
 d_ftell64=''
 d_ftello64=''
 d_tmpfile64=''
+d_stdio_stream_array=''
 stdio_stream_array=''
 sysman=''
 trnl=''
@@ -4363,6 +4364,7 @@ while read cline; do
        name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
        case "\$name" in
        *[/\\\\]\$wanted) echo "\$name"; exit 0;;
+       *[\\\\/]\$wanted) echo "\$name"; exit 0;;
        *) name='';;
        esac;
 done;
@@ -9959,6 +9961,41 @@ esac
 set d_stdiobase
 eval $setvar
 
+$cat >&4 <<EOM
+Checking how to access stdio streams by file descriptor number...
+EOM
+case "$stdio_stream_array" in
+'')    $cat >try.c <<EOCP
+#include <stdio.h>
+int main() {
+  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
+    printf("yes\n");
+}
+EOCP
+       for s in _iob __iob __sF
+       do
+               set try -DSTDIO_STREAM_ARRAY=$s
+               if eval $compile; then
+                       case "`./try$exe_ext`" in
+                       yes)    stdio_stream_array=$s; break ;;
+                       esac
+               fi
+       done
+       $rm -f try.* try$exe_ext
+esac
+case "$stdio_stream_array" in
+'')    $cat >&4 <<EOM
+I can't figure out how to access stdio streams by file descriptor number.
+EOM
+       d_stdio_stream_array="$undef"
+       ;;
+*)     $cat >&4 <<EOM
+You can access stdio streams by file descriptor number by the $stdio_stream_array array.
+EOM
+       d_stdio_stream_array="$define"
+       ;;
+esac
+
 : see if strcoll exists
 set strcoll d_strcoll
 eval $inlibc
@@ -10925,49 +10962,26 @@ $rm -f tebcdic.c tebcdic
 set ebcdic
 eval $setvar
 
-$cat >&4 <<EOM
-Checking how to access stdio streams by file descriptor number...
-EOM
-case "$stdio_stream_array" in
-'')    $cat >try.c <<EOCP
-#include <stdio.h>
-int main() {
-  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
-    printf("yes\n");
-}
-EOCP
-       for s in _iob __iob __sF
-       do
-               set try -DSTDIO_STREAM_ARRAY=$s
-               if eval $compile_ok; then
-                       case "`./try$exe_ext`" in
-                       yes)    stdio_stream_array=$s; break ;;
-                       esac
-               fi
-       done
-       $rm -f try.* try$exe_ext
-esac
-case "$stdio_stream_array" in
-'')    $cat >&4 <<EOM
-I can't figure out how to access stdio streams by file descriptor number.
-EOM
-       ;;
-*)     $cat >&4 <<EOM
-You can access stdio streams by file descriptor number by using $stdio_stream_array.
-EOM
-       ;;
+# SunOS has a <unistd.h> which we generally avoid, but need for this test.
+# For everyone else, we'll trust i_unistd.
+t_unistd=$i_unistd
+case "$osname" in
+sunos) $test -f /usr/include/unistd.h && t_unistd=$define ;;
 esac
-
 $cat >&4 <<EOM
 Checking how to flush all pending stdio output...
 EOM
 $cat >try.c <<EOCP
 #include <stdio.h>
-#$i_unistd I_UNISTD
+#$t_unistd I_UNISTD
 #ifdef I_UNISTD
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #$d_sysconf HAS_SYSCONF
+#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
+#ifdef HAS_STDIO_STREAM_ARRAY
+# define STDIO_STREAM_ARRAY $stdio_stream_array
+#endif
 int main() {
   FILE* p = fopen("try.out", "w");
 #ifdef TRY_FPUTC
@@ -10998,12 +11012,14 @@ int main() {
 #   endif
 #  endif
 # endif
+# ifdef HAS_STDIO_STREAM_ARRAY
     if (open_max > 0) {
       long i;
       for (i = 0; i < open_max; i++)
          fflush(&$stdio_stream_array[i]);
     }  
   }
+# endif
 #endif
   _exit(42);
 }
@@ -11013,7 +11029,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
     output=''
     set try -DTRY_FPUTC
     $rm -f try.out
-    if eval $compile_ok; then
+    if eval $compile; then
            ./try$exe_ext 2>/dev/null
            if $test ! -s try.out -a "X$?" = X42; then
                output=-DTRY_FPUTC
@@ -11023,7 +11039,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
     '')
            set try -DTRY_FPRINTF
            $rm -f try.out
-           if eval $compile_ok; then
+           if eval $compile; then
                    ./try$exe_ext 2>/dev/null
                    if $test ! -s try.out -a "X$?" = X42; then
                        output=-DTRY_FPRINTF
 case "$fflushNULL" in
 '')    set try -DTRY_FFLUSH_NULL $output
        $rm -f try.out
-       if eval $compile_ok; then
+       if eval $compile; then
                ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
+               code="$?"
+               if $test -s try.out -a "X$code" = X42; then
                        fflushNULL="`$cat try.out`"
+               else
+                       if $test "X$code" != X42; then
+                               $cat >&4 <<EOM
+(If this test failed, don't worry, we'll try another method shortly.)
+EOM
+                       fi
                fi
        fi
        $rm -f core try.core core.try.*
        case "$fflushNULL" in
-       x)      cat >&4 <<EOM
+       x)      $cat >&4 <<EOM
 Your fflush(NULL) works okay.
 EOM
-               fflushNULL=define
+               fflushNULL="$define"
                ;;
-       '')     cat >&4 <<EOM
+       '')     $cat >&4 <<EOM
 Your fflush(NULL) isn't working (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
-       *)      cat >&4 <<EOM
+       *)      $cat >&4 <<EOM
 Cannot figure out whether your fflush(NULL) works or not.
 I'm assuming it doesn't (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
        esac
        ;;
 $define|true|[yY]*)
-       fflushNULL=define
+       fflushNULL="$define"
        ;;
 *)
-       fflushNULL=undef
+       fflushNULL="$undef"
        ;;
 esac
-: check for fflush all behaviour
-case "$fflushall" in
-'')    set try -DTRY_FFLUSH_ALL $output
-       $rm -f try.out
-       if eval $compile_ok; then
-               ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
-                       fflushall="`$cat try.out`"
-               fi
-       fi
-       $rm -f core try.core core.try.*
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+       : check for fflush all behaviour
        case "$fflushall" in
-       x)      cat >&4 <<EOM
-Flushing explicitly all the stdio streams works.
+       '')     set try -DTRY_FFLUSH_ALL $output
+               $rm -f try.out
+               if eval $compile; then
+               $cat >&4 <<EOM
+(Now testing the other method--but note that also this may fail.)
 EOM
-               fflushall=define
-               ;;
-       '')     cat >&4 <<EOM
-Flushing explicitly all the stdio streams doesn't work.
+                       ./try$exe_ext 2>/dev/null
+                       if $test -s try.out -a "X$?" = X42; then
+                               fflushall="`$cat try.out`"
+                       fi
+               fi
+               $rm -f core try.core core.try.*
+               case "$fflushall" in
+               x)      $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
 EOM
-               fflushall=undef
-               ;;
-       *)      cat >&4 <<EOM
-Cannot figure out whether flushing stdio stream explicitly works or not.
+                       fflushall="$define"
+                       ;;
+               '')     $cat >&4 <<EOM
+Sigh. Flushing explicitly all the stdio streams doesn't work.
+EOM
+                       fflushall="$undef"
+                       ;;
+               *)      $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
 I'm assuming it doesn't.
 EOM
-               fflushall=undef
+                       fflushall="$undef"
+                       ;;
+               esac
+               ;;
+       "$define"|true|[yY]*)
+               fflushall="$define"
+               ;;
+       *)
+               fflushall="$undef"
                ;;
        esac
        ;;
-$define|true|[yY]*)
-       fflushall=define
-       ;;
-*)
-       fflushall=undef
+*)     fflushall="$undef"      
        ;;
 esac
 case "$fflushNULL$fflushall" in
 undefundef)
-       cat <<EOM
+       $cat <<EOM
 I cannot figure out how to flush pending stdio output.
 EOM
        ;;
@@ -13139,6 +13172,7 @@ d_statfsflags='$d_statfsflags'
 d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
+d_stdio_stream_array='$d_stdio_stream_array'
 d_stdiobase='$d_stdiobase'
 d_stdstdio='$d_stdstdio'
 d_store64='$d_store64'