Zero entries were skipped, fix from Adrian Goalby
[p5sagit/p5-mst-13.2.git] / Configure
index 7df66f1..dbeaef3 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 Tue Feb 29 05:06:33 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sat Aug  5 00:21:09 EET DST 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -288,7 +288,6 @@ bincompat5005=''
 d_bincompat5005=''
 byteorder=''
 cc=''
-gccversion=''
 ccflags=''
 cppflags=''
 ldflags=''
@@ -343,7 +342,6 @@ d_endnent=''
 d_endpent=''
 d_endpwent=''
 d_endsent=''
-d_endspent=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
@@ -355,6 +353,7 @@ d_flexfnam=''
 d_flock=''
 d_fork=''
 d_fpos64_t=''
+d_frexpl=''
 d_fs_data_s=''
 d_fseeko=''
 d_fsetpos=''
@@ -364,6 +363,7 @@ d_ftime=''
 d_gettimeod=''
 d_Gconvert=''
 d_getcwd=''
+d_getespwnam=''
 d_getfsstat=''
 d_getgrent=''
 d_getgrps=''
@@ -392,10 +392,10 @@ d_getprior=''
 d_getpbyname=''
 d_getpbynumber=''
 d_getprotoprotos=''
+d_getprpwnam=''
 d_getpwent=''
 d_getsent=''
 d_getservprotos=''
-d_getspent=''
 d_getspnam=''
 d_getsbyname=''
 d_getsbyport=''
@@ -406,6 +406,8 @@ d_iconv=''
 d_inetaton=''
 d_int64_t=''
 d_isascii=''
+d_isnan=''
+d_isnanl=''
 d_killpg=''
 d_lchown=''
 d_ldbl_dig=''
@@ -435,6 +437,7 @@ d_mkstemps=''
 d_mktime=''
 d_mmap=''
 mmaptype=''
+d_modfl=''
 d_mprotect=''
 d_msg=''
 d_msgctl=''
@@ -457,6 +460,7 @@ old_pthread_create_joinable=''
 d_pthread_yield=''
 d_sched_yield=''
 sched_yield=''
+d_qgcvt=''
 d_readdir=''
 d_rewinddir=''
 d_seekdir=''
@@ -486,6 +490,7 @@ d_setpgrp2=''
 d_bsdsetpgrp=''
 d_setpgrp=''
 d_setprior=''
+d_setproctitle=''
 d_setpwent=''
 d_setregid=''
 d_setresgid=''
@@ -495,7 +500,6 @@ d_setrgid=''
 d_setruid=''
 d_setsent=''
 d_setsid=''
-d_setspent=''
 d_setvbuf=''
 d_sfio=''
 usesfio=''
@@ -593,6 +597,8 @@ fflushNULL=''
 fflushall=''
 fpossize=''
 fpostype=''
+gccosandvers=''
+gccversion=''
 gidformat=''
 gidsign=''
 gidsize=''
@@ -617,7 +623,9 @@ i_gdbm=''
 d_grpasswd=''
 i_grp=''
 i_iconv=''
+i_ieeefp=''
 i_inttypes=''
+i_libutil=''
 i_limits=''
 i_locale=''
 i_machcthr=''
@@ -632,6 +640,7 @@ i_netinettcp=''
 i_niin=''
 i_sysin=''
 i_poll=''
+i_prot=''
 i_pthread=''
 d_pwage=''
 d_pwchange=''
@@ -649,6 +658,7 @@ i_stddef=''
 i_stdlib=''
 i_string=''
 strings=''
+i_sunmath=''
 i_sysaccess=''
 i_sysdir=''
 i_sysfile=''
@@ -772,6 +782,8 @@ hostcat=''
 passcat=''
 orderlib=''
 ranlib=''
+d_perl_otherlibdirs=''
+otherlibdirs=''
 package=''
 spackage=''
 pager=''
@@ -787,6 +799,7 @@ perl5=''
 perladmin=''
 perlpath=''
 d_nv_preserves_uv=''
+d_nv_preserves_uv_bits=''
 i16size=''
 i16type=''
 i32size=''
@@ -861,9 +874,11 @@ sitebin=''
 sitebinexp=''
 installsitelib=''
 sitelib=''
+sitelib_stem=''
 sitelibexp=''
 siteprefix=''
 siteprefixexp=''
+sizesize=''
 sizetype=''
 so=''
 socksizetype=''
@@ -886,6 +901,9 @@ uidtype=''
 archname64=''
 use64bitall=''
 use64bitint=''
+ccflags_uselargefiles=''
+ldflags_uselargefiles=''
+libswanted_uselargefiles=''
 uselargefiles=''
 uselongdouble=''
 usemorebits=''
@@ -903,6 +921,10 @@ usethreads=''
 incpath=''
 mips_type=''
 usrinc=''
+d_vendorarch=''
+installvendorarch=''
+vendorarch=''
+vendorarchexp=''
 d_vendorbin=''
 installvendorbin=''
 vendorbin=''
@@ -910,6 +932,7 @@ vendorbinexp=''
 d_vendorlib=''
 installvendorlib=''
 vendorlib=''
+vendorlib_stem=''
 vendorlibexp=''
 usevendorprefix=''
 vendorprefix=''
@@ -974,6 +997,9 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
+ccflags_uselargefiles=''
+ldflags_uselargefiles=''
+libswanted_uselargefiles=''
 : set usemultiplicity on the Configure command line to enable multiplicity.
 : set usesocks on the Configure command line to enable socks.
 : set usethreads on the Configure command line to enable threads.
@@ -985,7 +1011,7 @@ defvoidused=15
 libswanted='sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl'
 libswanted="$libswanted dld ld sun m c cposix posix"
 libswanted="$libswanted ndir dir crypt sec"
-libswanted="$libswanted ucb bsd BSD PW x iconv"
+libswanted="$libswanted ucb bsd BSD PW x iconv util"
 : We probably want to search /usr/shlib before most other libraries.
 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
 glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
@@ -1327,10 +1353,15 @@ esac
 case "$fastread$alldone" in
 yescont|yesexit) ;;
 *)
-       if test ! -t 0; then
-               echo "Say 'sh Configure', not 'sh <Configure'"
-               exit 1
-       fi
+       case "$extractsh" in
+       true) ;;
+       *)
+               if test ! -t 0; then
+                       echo "Say 'sh Configure', not 'sh <Configure'"
+                       exit 1
+               fi
+               ;;
+       esac
        ;;
 esac
 
@@ -2010,6 +2041,62 @@ FOO
        ;;
 esac
 
+cat <<EOS >checkcc
+$startsh
+EOS
+cat <<'EOSC' >>checkcc
+case "$cc" in
+'') ;;
+*)  $rm -f try try.*
+    $cat >try.c <<EOM
+int main(int argc, char *argv[]) {
+  return 0;
+}
+EOM
+    if $cc -o try try.c; then
+       :
+    else
+        echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
+        despair=yes
+        trygcc=yes
+        case "$cc" in
+        *gcc*) trygcc=no ;;
+        esac
+        case "`$cc -v -c try.c 2>&1`" in
+        *gcc*) trygcc=no ;;
+        esac
+        if $test X"$trygcc" = Xyes; then
+            if gcc -o try -c try.c; then
+                echo " "
+                echo "You seem to have a working gcc, though." >&4
+                rp="Would you like to use it?"
+                dflt=y
+                if $test -f myread; then
+                    . ./myread
+                else
+                    if $test -f UU/myread; then
+                        . ./UU/myread
+                    else
+                        echo "Cannot find myread, sorry.  Aborting." >&2
+                        exit 1
+                    fi
+                fi  
+                case "$ans" in
+                [yY]*) cc=gcc; ccflags=''; despair=no ;;
+                esac
+            fi
+        fi
+        if $test X"$despair" = Xyes; then
+            echo "You need to find a working C compiler." >&4
+            echo "I cannot continue any further, aborting." >&4
+            exit 1
+        fi
+    fi
+    $rm -f try try.*
+    ;;
+esac
+EOSC
+
 : determine whether symbolic links are supported
 echo " "
 $touch blurfl
@@ -2142,6 +2229,7 @@ if test -f config.sh; then
                ;;
        esac
 fi
+. ./UU/checkcc
 if test ! -f config.sh; then
        $cat <<EOM
 
@@ -2326,7 +2414,11 @@ EOM
                osf1|mls+)      case "$5" in
                                alpha)
                                        osname=dec_osf
-                                       osvers=`echo "$3" | sed 's/^[xvt]//'`
+                                       osvers=`sizer -v | awk '{print $3}' |  tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
+                                       case "$osvers" in
+                                       [1-9].[0-9]*) ;;
+                                       *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
+                                       esac
                                        ;;
                        hp*)    osname=hp_osf1  ;;
                        mips)   osname=mips_osf1 ;;
@@ -2776,7 +2868,11 @@ int main() {
 #endif
 }
 EOP
-       ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
+       case "$cc" in
+       '') modelcc="$cc" ;;
+       *) modelcc="cc" ;;
+       esac
+       ( $modelcc -o pdp11 pdp11.c ) >/dev/null 2>&1
        if $test -f pdp11 && ./pdp11 2>/dev/null; then
                dflt='unsplit split'
        else
@@ -3053,6 +3149,8 @@ fi
 if $test -f cc.cbu; then
     . ./cc.cbu
 fi
+. ./checkcc
+
 echo " "
 echo "Checking for GNU cc in disguise and/or its version number..." >&4
 $cat >gccvers.c <<EOM
@@ -3090,6 +3188,188 @@ $rm -f gccvers*
 case "$gccversion" in
 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
 esac
+case "$gccversion" in
+'') gccosandvers='' ;;
+*) gccshortvers=`echo "$gccversion"|sed 's/ .*//'`
+   gccosandvers=`$cc -v 2>&1|grep '/specs$'|sed "s!.*/[^-/]*-[^-/]*-\([^-/]*\)/$gccshortvers/specs!\1!"`
+   gccshortvers=''
+   case "$gccosandvers" in
+   $osname) gccosandvers='' ;; # linux gccs seem to have no linux osvers, grr
+   $osname$osvers) ;; # looking good
+   $osname*) cat <<EOM >&4
+
+*** WHOA THERE!!! ***
+
+    Your gcc has not been compiled for the exact release of
+    your operating system ($gccosandvers versus $osname$osvers).
+
+    In general it is a good idea to keep gcc synchronized with
+    the operating system because otherwise serious problems
+    may ensue when trying to compile software, like Perl.
+
+    I'm trying to be optimistic here, though, and will continue.
+    If later during the configuration and build icky compilation
+    problems appear (headerfile conflicts being the most common
+    manifestation), I suggest reinstalling the gcc to match
+    your operating system release.
+
+EOM
+      ;;
+   *) gccosandvers='' ;; # failed to parse, better be silent
+   esac
+   ;;
+esac
+
+
+
+
+: see how we invoke the C preprocessor
+echo " "
+echo "Now, how can we feed standard input to your C preprocessor..." >&4
+cat <<'EOT' >testcpp.c
+#define ABC abc
+#define XYZ xyz
+ABC.XYZ
+EOT
+cd ..
+if test ! -f cppstdin; then
+       if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
+               # AIX cc -E doesn't show the absolute headerfile
+               # locations but we'll cheat by using the -M flag.
+               echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
+       else
+               echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+       fi
+else
+       echo "Keeping your $hint cppstdin wrapper."
+fi
+chmod 755 cppstdin
+wrapper=`pwd`/cppstdin
+ok='false'
+cd UU
+
+if $test "X$cppstdin" != "X" && \
+       $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+then
+       echo "You used to use $cppstdin $cppminus so we'll use that again."
+       case "$cpprun" in
+       '') echo "But let's see if we can live without a wrapper..." ;;
+       *)
+               if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
+                       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+               then
+                       echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
+                       ok='true'
+               else
+                       echo "(However, $cpprun $cpplast does not work, let's see...)"
+               fi
+               ;;
+       esac
+else
+       case "$cppstdin" in
+       '') ;;
+       *)
+               echo "Good old $cppstdin $cppminus does not seem to be of any help..."
+               ;;
+       esac
+fi
+
+if $ok; then
+       : nothing
+elif echo 'Maybe "'"$cc"' -E" will work...'; \
+       $cc -E <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "Yup, it does."
+       x_cpp="$cc -E"
+       x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
+       $cc -E - <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "Yup, it does."
+       x_cpp="$cc -E"
+       x_minus='-';
+elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
+       $cc -P <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "Yipee, that works!"
+       x_cpp="$cc -P"
+       x_minus='';
+elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
+       $cc -P - <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "At long last!"
+       x_cpp="$cc -P"
+       x_minus='-';
+elif echo 'No such luck, maybe "'$cpp'" will work...'; \
+       $cpp <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "It works!"
+       x_cpp="$cpp"
+       x_minus='';
+elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
+       $cpp - <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       echo "Hooray, it works!  I was beginning to wonder."
+       x_cpp="$cpp"
+       x_minus='-';
+elif echo 'Uh-uh.  Time to get fancy.  Trying a wrapper...'; \
+       $wrapper <testcpp.c >testcpp.out 2>&1; \
+       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+       x_cpp="$wrapper"
+       x_minus=''
+       echo "Eureka!"
+else
+       dflt=''
+       rp="No dice.  I can't find a C preprocessor.  Name one:"
+       . ./myread
+       x_cpp="$ans"
+       x_minus=''
+       $x_cpp <testcpp.c >testcpp.out 2>&1
+       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
+               echo "OK, that will do." >&4
+       else
+echo "Sorry, I can't get that to work.  Go find one and rerun Configure." >&4
+               exit 1
+       fi
+fi
+
+case "$ok" in
+false)
+       cppstdin="$x_cpp"
+       cppminus="$x_minus"
+       cpprun="$x_cpp"
+       cpplast="$x_minus"
+       set X $x_cpp
+       shift
+       case "$1" in
+       "$cpp")
+               echo "Perhaps can we force $cc -E using a wrapper..."
+               if $wrapper <testcpp.c >testcpp.out 2>&1; \
+                       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
+               then
+                       echo "Yup, we can."
+                       cppstdin="$wrapper"
+                       cppminus='';
+               else
+                       echo "Nope, we'll have to live without it..."
+               fi
+               ;;
+       esac
+       case "$cpprun" in
+       "$wrapper")
+               cpprun=''
+               cpplast=''
+               ;;
+       esac
+       ;;
+esac
+
+case "$cppstdin" in
+"$wrapper"|'cppstdin') ;;
+*) $rm -f $wrapper;;
+esac
+$rm -f testcpp.c testcpp.out
 
 : decide how portable to be.  Allow command line overrides.
 case "$d_portable" in
@@ -3256,6 +3536,7 @@ while test "$type"; do
                true)
                        case "$ansexp" in
                        /*) value="$ansexp" ;;
+                       [a-zA-Z]:/*) value="$ansexp" ;;
                        *)
                                redo=true
                                case "$already" in
@@ -3302,13 +3583,15 @@ while test "$type"; do
                        Directory)
                                for fp in $gfpth; do
                                        if test "X$fp" = X.; then
-                                           pf="$ansexp"
+                                           dir="$ans"
+                                           direxp="$ansexp"
                                        else    
-                                           pf="$fp/$ansexp"
+                                           dir="$fp/$ansexp"
+                                           direxp="$fp/$ansexp"
                                        fi
-                                       if test -d "$pf"; then
+                                       if test -d "$direxp"; then
                                                type=''
-                                               value="$pf"
+                                               value="$dir"
                                                break
                                        fi
                                done
@@ -3381,7 +3664,7 @@ if $test -f /bin/mips && /bin/mips; then
 /bsd43
 #endif
 EOCP
-       if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
+       if cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
                dflt='/bsd43/usr/include'
                incpath='/bsd43'
                mips_type='BSD 4.3'
@@ -3414,165 +3697,17 @@ y)     fn=d/
        ;;
 esac
 
-: see how we invoke the C preprocessor
-echo " "
-echo "Now, how can we feed standard input to your C preprocessor..." >&4
-cat <<'EOT' >testcpp.c
-#define ABC abc
-#define XYZ xyz
-ABC.XYZ
-EOT
-cd ..
-if test ! -f cppstdin; then
-       if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
-               # AIX cc -E doesn't show the absolute headerfile
-               # locations but we'll cheat by using the -M flag.
-               echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
-       else
-               echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
-       fi
-else
-       echo "Keeping your $hint cppstdin wrapper."
-fi
-chmod 755 cppstdin
-wrapper=`pwd`/cppstdin
-ok='false'
-cd UU
-
-if $test "X$cppstdin" != "X" && \
-       $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
-then
-       echo "You used to use $cppstdin $cppminus so we'll use that again."
-       case "$cpprun" in
-       '') echo "But let's see if we can live without a wrapper..." ;;
-       *)
-               if $cpprun $cpplast <testcpp.c >testcpp.out 2>&1 && \
-                       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
-               then
-                       echo "(And we'll use $cpprun $cpplast to preprocess directly.)"
-                       ok='true'
-               else
-                       echo "(However, $cpprun $cpplast does not work, let's see...)"
-               fi
-               ;;
-       esac
-else
-       case "$cppstdin" in
-       '') ;;
-       *)
-               echo "Good old $cppstdin $cppminus does not seem to be of any help..."
-               ;;
-       esac
-fi
-
-if $ok; then
-       : nothing
-elif echo 'Maybe "'"$cc"' -E" will work...'; \
-       $cc -E <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "Yup, it does."
-       x_cpp="$cc -E"
-       x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
-       $cc -E - <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "Yup, it does."
-       x_cpp="$cc -E"
-       x_minus='-';
-elif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
-       $cc -P <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "Yipee, that works!"
-       x_cpp="$cc -P"
-       x_minus='';
-elif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
-       $cc -P - <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "At long last!"
-       x_cpp="$cc -P"
-       x_minus='-';
-elif echo 'No such luck, maybe "'$cpp'" will work...'; \
-       $cpp <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "It works!"
-       x_cpp="$cpp"
-       x_minus='';
-elif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
-       $cpp - <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       echo "Hooray, it works!  I was beginning to wonder."
-       x_cpp="$cpp"
-       x_minus='-';
-elif echo 'Uh-uh.  Time to get fancy.  Trying a wrapper...'; \
-       $wrapper <testcpp.c >testcpp.out 2>&1; \
-       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-       x_cpp="$wrapper"
-       x_minus=''
-       echo "Eureka!"
-else
-       dflt=''
-       rp="No dice.  I can't find a C preprocessor.  Name one:"
-       . ./myread
-       x_cpp="$ans"
-       x_minus=''
-       $x_cpp <testcpp.c >testcpp.out 2>&1
-       if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
-               echo "OK, that will do." >&4
-       else
-echo "Sorry, I can't get that to work.  Go find one and rerun Configure." >&4
-               exit 1
-       fi
-fi
-
-case "$ok" in
-false)
-       cppstdin="$x_cpp"
-       cppminus="$x_minus"
-       cpprun="$x_cpp"
-       cpplast="$x_minus"
-       set X $x_cpp
-       shift
-       case "$1" in
-       "$cpp")
-               echo "Perhaps can we force $cc -E using a wrapper..."
-               if $wrapper <testcpp.c >testcpp.out 2>&1; \
-                       $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1
-               then
-                       echo "Yup, we can."
-                       cppstdin="$wrapper"
-                       cppminus='';
-               else
-                       echo "Nope, we'll have to live without it..."
-               fi
-               ;;
-       esac
-       case "$cpprun" in
-       "$wrapper")
-               cpprun=''
-               cpplast=''
-               ;;
-       esac
-       ;;
-esac
-
-case "$cppstdin" in
-"$wrapper"|'cppstdin') ;;
-*) $rm -f $wrapper;;
-esac
-$rm -f testcpp.c testcpp.out
-
-: Set private lib path
-case "$plibpth" in
-'') if ./mips; then
-               plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
-       fi;;
-esac
-case "$libpth" in
-' ') dlist='';;
-'') dlist="$loclibpth $plibpth $glibpth";;
-*) dlist="$libpth";;
-esac
+: Set private lib path
+case "$plibpth" in
+'') if ./mips; then
+               plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
+       fi;;
+esac
+case "$libpth" in
+' ') dlist='';;
+'') dlist="$loclibpth $plibpth $glibpth";;
+*) dlist="$libpth";;
+esac
 
 : Now check and see which directories actually exist, avoiding duplicates
 libpth=''
@@ -3703,9 +3838,7 @@ case "$libswanted" in
 '') libswanted='c_s';;
 esac
 case "$usesocks" in
-$define)
-       libswanted="$libswanted socks5 socks5_sh"
-       ;;
+"$define") libswanted="$libswanted socks5 socks5_sh" ;;
 esac
 libsfound=''
 libsfiles=''
@@ -4337,9 +4470,9 @@ case "$uselargefiles" in
 : Look for a hint-file generated 'call-back-unit'.  If the
 : user has specified that a large files perl is to be built,
 : we may need to set or change some other defaults.
-       if $test -f uselfs.cbu; then
+       if $test -f uselargefiles.cbu; then
                echo "Your platform has some specific hints for large file builds, using them..."
-               . ./uselfs.cbu
+               . ./uselargefiles.cbu
                echo " "
                echo "Rechecking to see how big your file offsets are..." >&4
                $cat >try.c <<EOCP
@@ -4413,7 +4546,6 @@ case "$usemorebits" in
 esac
 
 
-# Backward compatibility (uselonglong is deprecated).
 case "$uselonglong" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -4423,7 +4555,6 @@ EOM
        use64bitint="$define"
        ;;
 esac                          
-# Backward compatibility (use64bits is deprecated).
 case "$use64bits" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -4433,7 +4564,6 @@ EOM
        use64bitint="$define"
        ;;
 esac                          
-# Thinko compatibilities.
 case "$use64bitints" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -4443,6 +4573,24 @@ EOM
        use64bitint="$define"
        ;;
 esac                          
+case "$use64bitsint" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** There is no Configure -Duse64bitsint, using -Duse64bitint instead.
+EOM
+       use64bitint="$define"
+       ;;
+esac                          
+case "$uselonglongs" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** There is no Configure -Duselonglongs, using -Duse64bitint instead.
+EOM
+       use64bitint="$define"
+       ;;
+esac                          
 case "$use64bitsall" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -4490,18 +4638,14 @@ esac
 set use64bitint
 eval $setvar
 
-case "$use64bitint" in
-"$define")     case "$longsize" in
-               8) dflt='y' ;;
-               *) dflt='n' ;;
-               esac
-               ;;
-*)     case "$use64bitall" in
-       "$define"|true|[yY]*) dflt='y' ;;
-       *) dflt='n' ;;
-       esac
-       ;;
-esac 
+case "$use64bitall" in
+"$define"|true|[yY]*) dflt='y' ;;
+*) case "$longsize" in
+   8) dflt='y' ;;
+   *) dflt='n' ;;
+   esac
+   ;;
+esac   
 cat <<EOM
 
 You may also choose to try maximal 64-bitness.  It means using as much
@@ -4543,11 +4687,7 @@ case "$use64bitint" in
                . ./use64bitint.cbu
        fi
        case "$longsize" in
-       4) case "$ccflags" in
-          *-DUSE_64_BIT_INT*) ;;
-          *) ccflags="$ccflags -DUSE_64_BIT_INT";;
-          esac
-          case "$archname64" in
+       4) case "$archname64" in
           '') archname64=64int ;;
           esac
           ;;
@@ -4565,11 +4705,7 @@ case "$use64bitall" in
                . ./use64bitall.cbu
        fi
        case "$longsize" in
-       4) case "$ccflags" in
-          *-DUSE_64_BIT_ALL*) ;;
-          *) ccflags="$ccflags -DUSE_64_BIT_ALL";;
-          esac
-          case "$archname64" in
+       4) case "$archname64" in
           ''|64int) archname64=64all ;;
           esac
           ;;
@@ -4814,7 +4950,7 @@ case "$installstyle" in
                *) dflt='lib/perl5' ;;
        esac
        ;;
-*)     dflt='lib/perl5' ;;
+*)     dflt="$installstyle" ;;
 esac
 : Probably not worth prompting for this since we prompt for all
 : the directories individually, and the prompt would be too long and
@@ -4904,9 +5040,9 @@ case "$usethreads$usemultiplicity" in
        ;;
 *)     $cat <<EOM
 
-Perl 5.006 can be compiled for binary compatibility with 5.005.
-If you decide to do so, you will be able to continue using most
-of the extensions that were compiled for Perl 5.005.
+This version of Perl can be compiled for binary compatibility with 5.005.
+If you decide to do so, you will be able to continue using most of the
+extensions that were compiled for Perl 5.005.
 
 EOM
        case "$bincompat5005$d_bincompat5005" in
@@ -5230,6 +5366,108 @@ echo "Your system uses $freetype free(), it would seem." >&4
 $rm -f malloc.[co]
 $cat <<EOM
 
+After $package is installed, you may wish to install various
+add-on modules and utilities.  Typically, these add-ons will
+be installed under $prefix with the rest
+of this package.  However, you may wish to install such add-ons
+elsewhere under a different prefix.
+
+If you do not wish to put everything under a single prefix, that's
+ok.  You will be prompted for the individual locations; this siteprefix
+is only used to suggest the defaults.
+
+The default should be fine for most people.
+
+EOM
+fn=d~+
+rp='Installation prefix to use for add-on modules and utilities?'
+: XXX Here might be another good place for an installstyle setting.
+case "$siteprefix" in
+'') dflt=$prefix ;;
+*)  dflt=$siteprefix ;;
+esac
+. ./getfile
+: XXX Prefixit unit does not yet support siteprefix and vendorprefix
+oldsiteprefix=''
+case "$siteprefix" in
+'') ;;
+*)     case "$ans" in
+       "$prefix") ;;
+       *) oldsiteprefix="$prefix";;
+       esac
+       ;;
+esac
+siteprefix="$ans"
+siteprefixexp="$ansexp"
+
+: determine where site specific libraries go.
+: Usual default is /usr/local/lib/perl5/site_perl/$version
+: The default "style" setting is made in installstyle.U
+: XXX No longer works with Prefixit stuff.
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$sitelib" in
+'') case "$installstyle" in
+       *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
+       *)       dflt=$siteprefix/lib/site_$prog/$version ;;
+       esac
+       ;;
+*)     dflt="$sitelib"
+       ;;
+esac
+$cat <<EOM
+
+The installation process will create a directory for
+site-specific extensions and modules.  Most users find it convenient
+to place all site-specific files in this directory rather than in the
+main distribution directory.
+
+EOM
+fn=d~+
+rp='Pathname for the site-specific library files?'
+. ./getfile
+sitelib="$ans"
+sitelibexp="$ansexp"
+sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
+else
+       installsitelib="$sitelibexp"
+fi
+
+: determine where site specific architecture-dependent libraries go.
+: sitelib  default is /usr/local/lib/perl5/site_perl/$version
+: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
+: sitelib may have an optional trailing /share.
+case "$sitearch" in
+'')    dflt=`echo $sitelib | $sed 's,/share$,,'`
+       dflt="$dflt/$archname"
+       ;;
+*)     dflt="$sitearch"
+       ;;
+esac
+set sitearch sitearch none
+eval $prefixit
+$cat <<EOM
+
+The installation process will also create a directory for
+architecture-dependent site-specific extensions and modules.
+
+EOM
+fn=d~+
+rp='Pathname for the site-specific architecture-dependent library files?'
+. ./getfile
+sitearch="$ans"
+sitearchexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
+else
+       installsitearch="$sitearchexp"
+fi
+
+$cat <<EOM
+
 The installation process will also create a directory for
 vendor-supplied add-ons.  Vendors who supply perl with their system
 may find it convenient to place all vendor-supplied files in this
@@ -5310,6 +5548,7 @@ case "$vendorprefix" in
        vendorlibexp="$ansexp"
        ;;
 esac
+vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
        installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
@@ -5317,6 +5556,71 @@ else
        installvendorlib="$vendorlibexp"
 fi
 
+case "$vendorprefix" in
+'')    d_vendorarch="$undef"
+       vendorarch=''
+       vendorarchexp=''
+       ;;
+*)     d_vendorarch="$define"
+       : determine where vendor-supplied architecture-dependent libraries go.
+       : vendorlib  default is /usr/local/lib/perl5/vendor_perl/$version
+       : vendorarch default is /usr/local/lib/perl5/vendor_perl/$version/$archname
+       : vendorlib may have an optional trailing /share.
+       case "$vendorarch" in
+       '')     dflt=`echo $vendorlib | $sed 's,/share$,,'`
+               dflt="$dflt/$archname"
+               ;;
+       *)      dflt="$vendorarch" ;;
+       esac
+       fn=d~+
+       rp='Pathname for vendor-supplied architecture-dependent files?'
+       . ./getfile
+       vendorarch="$ans"
+       vendorarchexp="$ansexp"
+       ;;
+esac
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installvendorarch=`echo $vendorarchexp | sed "s#^$prefix#$installprefix#"`
+else
+       installvendorarch="$vendorarchexp"
+fi
+
+: Final catch-all directories to search
+$cat <<EOM
+
+Lastly, you can have perl look in other directories for extensions and
+modules in addition to those already specified.
+These directories will be searched after 
+       $sitearch 
+       $sitelib 
+EOM
+test X"$vendorlib" != "X" && echo '    ' $vendorlib
+test X"$vendorarch" != "X" && echo '   ' $vendorarch
+echo ' '
+case "$otherlibdirs" in
+''|' ') dflt='none' ;;
+*)     dflt="$otherlibdirs" ;;
+esac
+$cat <<EOM
+Enter a colon-separated set of extra paths to include in perl's @INC
+search path, or enter 'none' for no extra paths.
+
+EOM
+
+rp='Colon-separated list of additional directories for perl to search?'
+. ./myread
+case "$ans" in
+' '|''|none)   otherlibdirs=' ' ;;     
+*)     otherlibdirs="$ans" ;;
+esac
+case "$otherlibdirs" in
+' ') val=$undef ;;
+*)     val=$define ;;
+esac
+set d_perl_otherlibdirs
+eval $setvar
+
 : Cruising for prototypes
 echo " "
 echo "Checking out function prototypes..." >&4
@@ -5378,111 +5682,40 @@ else
        installbin="$binexp"
 fi
 
-: Find perl5.005 or later.
-echo "Looking for a previously installed perl5.005 or later... "
-case "$perl5" in
-'')    for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
-               : Check if this perl is recent and can load a simple module
-               if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
-                       perl5=$tdir/perl
-                       break;
-               elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
-                       perl5=$tdir/perl
-                       break;
-               fi
-       done
-       ;;
-*)     perl5="$perl5"
-       ;;
-esac
-case "$perl5" in
-'')    echo "None found.  That's ok.";;
-*)     echo "Using $perl5." ;;
-esac
-
-$cat <<EOM
-
-After $package is installed, you may wish to install various
-add-on modules and utilities.  Typically, these add-ons will
-be installed under $prefix with the rest
-of this package.  However, you may wish to install such add-ons
-elsewhere under a different prefix.
-
-If you do not wish to put everything under a single prefix, that's
-ok.  You will be prompted for the individual locations; this siteprefix
-is only used to suggest the defaults.
-
-The default should be fine for most people.
-
-EOM
-fn=d~+
-rp='Installation prefix to use for add-on modules and utilities?'
-: XXX Here might be another good place for an installstyle setting.
-case "$siteprefix" in
-'') dflt=$prefix ;;
-*)  dflt=$siteprefix ;;
-esac
-. ./getfile
-: XXX Prefixit unit does not yet support siteprefix and vendorprefix
-oldsiteprefix=''
-case "$siteprefix" in
-'') ;;
-*)     case "$ans" in
-       "$prefix") ;;
-       *) oldsiteprefix="$prefix";;
-       esac
-       ;;
-esac
-siteprefix="$ans"
-siteprefixexp="$ansexp"
-
-: determine where site specific libraries go.
-: Usual default is /usr/local/lib/perl5/site_perl/$version
-: The default "style" setting is made in installstyle.U
-: XXX No longer works with Prefixit stuff.
-prog=`echo $package | $sed 's/-*[0-9.]*$//'`
-case "$sitelib" in
-'') case "$installstyle" in
-       *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
-       *)       dflt=$siteprefix/lib/site_$prog/$version ;;
-       esac
-       ;;
-*)     dflt="$sitelib"
-       ;;
-esac
-$cat <<EOM
-
-The installation process will create a directory for
-site-specific extensions and modules.  Most users find it convenient
-to place all site-specific files in this directory rather than in the
-main distribution directory.
-
-EOM
-fn=d~+
-rp='Pathname for the site-specific library files?'
-. ./getfile
-sitelib="$ans"
-sitelibexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
-       installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
-else
-       installsitelib="$sitelibexp"
-fi
-
+: Find perl5.005 or later.
+echo "Looking for a previously installed perl5.005 or later... "
+case "$perl5" in
+'')    for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
+               : Check if this perl is recent and can load a simple module
+               if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+                       perl5=$tdir/perl
+                       break;
+               elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+                       perl5=$tdir/perl
+                       break;
+               fi
+       done
+       ;;
+*)     perl5="$perl5"
+       ;;
+esac
+case "$perl5" in
+'')    echo "None found.  That's ok.";;
+*)     echo "Using $perl5." ;;
+esac
+
 : Determine list of previous versions to include in @INC
 $cat > getverlist <<EOPL
 #!$perl5 -w
 use File::Basename;
 \$api_versionstring = "$api_versionstring";
 \$version = "$version";
-\$sitelib = "$sitelib";
+\$stem = "$sitelib_stem";
 \$archname = "$archname";
 EOPL
        $cat >> getverlist <<'EOPL'
 # Can't have leading @ because metaconfig interprets it as a command!
 ;@inc_version_list=();
-$stem=dirname($sitelib);
 # XXX Redo to do opendir/readdir? 
 if (-d $stem) {
     chdir($stem);
@@ -5501,10 +5734,10 @@ else {
 foreach $d (@candidates) {
     if ($d lt $version) {
        if ($d ge $api_versionstring) {
-           unshift(@inc_version_list, "$d/$archname", $d);
+           unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
        }
        elsif ($d ge "5.005") {
-           unshift(@inc_version_list, $d);
+           unshift(@inc_version_list, grep { -d } $d);
        }
     }
     else {
@@ -5569,7 +5802,7 @@ $rm -f getverlist
 echo " "
 if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
        $cat <<EOM
-Many scripts expect to perl to be installed as /usr/bin/perl.
+Many scripts expect perl to be installed as /usr/bin/perl.
 I can install the perl you are about to compile also as /usr/bin/perl
 (in addition to $installbin/perl).
 EOM
@@ -6199,8 +6432,9 @@ EOM
     case "$lddlflags" in
     '') case "$osname" in
                        beos) dflt='-nostart' ;;
-                       hpux) case "$gccversion" in
-                             '') dflt='-b +vnocompatwarnings' ;;
+                       hpux) dflt='-b';
+                             case "$gccversion" in
+                             '') dflt="$dflt +vnocompatwarnings" ;;
                              esac
                              ;;        
                        linux|irix*)    dflt='-shared' ;;
@@ -6573,46 +6807,26 @@ esac
 
 : see if we can have long filenames
 echo " "
-rmlist="$rmlist /tmp/cf$$"
-$test -d /tmp/cf$$ || mkdir /tmp/cf$$
 first=123456789abcdef
-second=/tmp/cf$$/$first
-$rm -f $first $second
+$rm -f $first
 if (echo hi >$first) 2>/dev/null; then
        if $test -f 123456789abcde; then
                echo 'You cannot have filenames longer than 14 characters.  Sigh.' >&4
                val="$undef"
        else
-               if (echo hi >$second) 2>/dev/null; then
-                       if $test -f /tmp/cf$$/123456789abcde; then
-                               $cat <<'EOM'
-That's peculiar... You can have filenames longer than 14 characters, but only
-on some of the filesystems.  Maybe you are using NFS.  Anyway, to avoid problems
-I shall consider your system cannot support long filenames at all.
-EOM
-                               val="$undef"
-                       else
-                               echo 'You can have filenames longer than 14 characters.' >&4
-                               val="$define"
-                       fi
-               else
-                       $cat <<'EOM'
-How confusing! Some of your filesystems are sane enough to allow filenames
-longer than 14 characters but some others like /tmp can't even think about them.
-So, for now on, I shall assume your kernel does not allow them at all.
-EOM
-                       val="$undef"
-               fi
+               echo 'You can have filenames longer than 14 characters.'>&4
+               val="$define"
        fi
 else
        $cat <<'EOM'
-You can't have filenames longer than 14 chars.  You can't even think about them!
+You can't have filenames longer than 14 chars.
+You can't even think about them!
 EOM
        val="$undef"
 fi 
 set d_flexfnam
 eval $setvar
-$rm -rf /tmp/cf$$ 123456789abcde*
+$rm -rf 123456789abcde*
 
 : determine where library module manual pages go
 set man3dir man3dir none
@@ -6645,7 +6859,7 @@ esac
 echo "If you don't want the manual sources installed, answer 'none'."
 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
 case "$man3dir" in
-'')    dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
+'')    dflt=`echo "$man1dir" | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
        if $test -d "$privlib/man/man3"; then
                cat <<EOM >&4
 
@@ -6663,16 +6877,18 @@ EOM
                esac
     fi
        ;;
-' ') dflt=none;;
 *)     dflt="$man3dir" ;;
 esac
+case "$dflt" in
+' ') dflt=none ;;
+esac
 echo " "
 fn=dn+~
 rp="Where do the $package library man pages (source) go?"
 . ./getfile
 man3dir="$ans"
 man3direxp="$ansexp"
-case "$man1dir" in
+case "$man3dir" in
 '')    man3dir=' '
        installman3dir='';;
 esac
@@ -7117,37 +7333,6 @@ else
        installscript="$scriptdirexp"
 fi
 
-: determine where site specific architecture-dependent libraries go.
-: sitelib  default is /usr/local/lib/perl5/site_perl/$version
-: sitearch default is /usr/local/lib/perl5/site_perl/$version/$archname
-: sitelib may have an optional trailing /share.
-case "$sitearch" in
-'')    dflt=`echo $sitelib | $sed 's,/share$,,'`
-       dflt="$dflt/$archname"
-       ;;
-*)     dflt="$sitearch"
-       ;;
-esac
-set sitearch sitearch none
-eval $prefixit
-$cat <<EOM
-
-The installation process will also create a directory for
-architecture-dependent site-specific extensions and modules.
-
-EOM
-fn=d~+
-rp='Pathname for the site-specific architecture-dependent library files?'
-. ./getfile
-sitearch="$ans"
-sitearchexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
-       installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
-else
-       installsitearch="$sitearchexp"
-fi
-
 : determine where add-on public executables go
 case "$sitebin" in
 '')    dflt=$siteprefix/bin ;;
@@ -7217,9 +7402,10 @@ case "$uselongdouble:$d_sqrtl" in
 $define:$undef)
                $cat <<EOM >&4
 
-You requested the use of long doubles but you do not seem to have
-the mathematic functions for long doubles.  I'm disabling the use
-of long doubles.
+*** You requested the use of long doubles but you do not seem to have
+*** the mathematic functions for long doubles.  I'm disabling the use
+*** of long doubles.
+
 EOM
        uselongdouble=$undef
        ;;
@@ -7280,6 +7466,10 @@ else
        installvendorbin="$vendorbinexp"
 fi
 
+: see if qgcvt exists
+set qgcvt d_qgcvt
+eval $inlibc
+
 : check for length of double
 echo " "
 case "$doublesize" in
@@ -7356,118 +7546,6 @@ EOCP
 esac
 $rm -f try.* try
 
-: Check how to convert floats to strings.
-if test "X$d_Gconvert" = X; then
-       echo " "
-       echo "Checking for an efficient way to convert floats to strings."
-       $cat >try.c <<EOP
-#ifdef TRY_gconvert
-#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
-#endif
-#ifdef TRY_gcvt
-#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
-#endif
-#ifdef TRY_qgcvt
-#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
-char *myname = "qgcvt";
-#define DOUBLETYPE long double
-#endif
-#ifdef TRY_sprintf
-#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-char *myname = "sprintf";
-#endif
-
-#ifndef DOUBLETYPE
-#define DOUBLETYPE double
-#endif
-
-#include <stdio.h>
-
-#define I_STDLIB $i_stdlib
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-
-int
-checkit(expect, got)
-char *expect;
-char *got;
-{
-    if (strcmp(expect, got)) {
-               printf("%s oddity:  Expected %s, got %s\n",
-                       myname, expect, got);
-               exit(1);
-       }
-}
-
-int main()
-{ 
-       char buf[64]; 
-       buf[63] = '\0';
-
-       /* This must be 1st test on (which?) platform */
-       /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
-       Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
-       checkit("0.1", buf);
-
-       Gconvert((DOUBLETYPE)1.0, 8, 0, buf); 
-       checkit("1", buf);
-
-       Gconvert((DOUBLETYPE)0.0, 8, 0, buf); 
-       checkit("0", buf);
-
-       Gconvert((DOUBLETYPE)-1.0, 8, 0, buf); 
-       checkit("-1", buf);
-
-       /* Some Linux gcvt's give 1.e+5 here. */
-       Gconvert((DOUBLETYPE)100000.0, 8, 0, buf); 
-       checkit("100000", buf);
-       
-       /* Some Linux gcvt's give -1.e+5 here. */
-       Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); 
-       checkit("-100000", buf);
-
-       exit(0);
-}
-EOP
-       case "$d_Gconvert" in
-       gconvert*) xxx_list='gconvert gcvt sprintf' ;;
-       gcvt*) xxx_list='gcvt gconvert sprintf' ;;
-       sprintf*) xxx_list='sprintf gconvert gcvt' ;;
-       *) xxx_list='gconvert gcvt sprintf' ;;
-       esac
-
-        case "$d_longdbl$uselongdouble" in
-        definedefine) xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
-       esac
-
-       for xxx_convert in $xxx_list; do
-               echo "Trying $xxx_convert..."
-               $rm -f try try$_o
-               set try -DTRY_$xxx_convert
-               if eval $compile; then
-                       echo "$xxx_convert() found." >&4
-                       if ./try; then
-                               echo "I'll use $xxx_convert to convert floats into a string." >&4
-                               break;
-                       else
-                               echo "...But $xxx_convert didn't work as I expected."
-                       fi
-               else
-                       echo "$xxx_convert NOT found." >&4
-               fi
-       done
-               
-       case "$xxx_convert" in
-       gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
-       gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
-       qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
-       *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
-       esac
-fi
-
 echo " "
 
 if $test X"$d_longdbl" = X"$define"; then
@@ -7548,36 +7626,189 @@ int main() {
   long double d = 123.456;
   printf("%.3lf\n", d);
 }
-EOCP
-       set try
-       if eval $compile; then
-               yyy=`./try$exe_ext`
-               case "$yyy" in
-               123.456)
-                       sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
-                       sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
-                       echo "We will use %lf."
-                       ;;
-               esac
-       fi
-fi
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               123.456)
+                       sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
+                       sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
+                       echo "We will use %lf."
+                       ;;
+               esac
+       fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+       echo "Cannot figure out how to print long doubles." >&4
+fi
+
+$rm -f try try.*
+
+fi # d_longdbl
+
+case "$sPRIfldbl" in
+'')    d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; 
+       d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; 
+       ;;
+*)     d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; 
+       d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; 
+       ;;
+esac
+
+: Check how to convert floats to strings.
+if test "X$d_Gconvert" = X; then
+       echo " "
+       echo "Checking for an efficient way to convert floats to strings."
+       echo " " > try.c
+       case "$uselongdouble" in
+       "$define") echo "#define USE_LONG_DOUBLE" >>try.c ;;
+       esac
+       case "$d_longdbl" in
+       "$define") echo "#define HAS_LONG_DOUBLE" >>try.c ;;
+       esac
+       case "$d_PRIgldbl" in
+       "$define") echo "#define HAS_PRIgldbl"    >>try.c ;;
+       esac
+       $cat >>try.c <<EOP
+#ifdef TRY_gconvert
+#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
+char *myname = "gconvert";
+#endif
+#ifdef TRY_gcvt
+#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+char *myname = "gcvt";
+#endif
+#ifdef TRY_qgcvt
+#define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
+char *myname = "qgcvt";
+#define DOUBLETYPE long double
+#endif
+#ifdef TRY_sprintf
+#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(HAS_PRIgldbl)
+#define Gconvert(x,n,t,b) sprintf((b),"%.*"$sPRIgldbl,(n),(x))
+#else
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
+#endif
+char *myname = "sprintf";
+#endif
+
+#ifndef DOUBLETYPE
+#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE)
+#define DOUBLETYPE long double
+#else
+#define DOUBLETYPE double
+#endif
+#endif
+
+#include <stdio.h>
+
+#define I_STDLIB $i_stdlib
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+
+int
+checkit(expect, got)
+char *expect;
+char *got;
+{
+    if (strcmp(expect, got)) {
+               printf("%s oddity:  Expected %s, got %s\n",
+                       myname, expect, got);
+               exit(1);
+       }
+}
 
-if $test X"$sPRIfldbl" = X; then
-       echo "Cannot figure out how to print long doubles." >&4
-fi
+int main()
+{ 
+       char buf[64]; 
+       buf[63] = '\0';
 
-$rm -f try try.*
+       /* This must be 1st test on (which?) platform */
+       /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
+       Gconvert((DOUBLETYPE)0.1, 8, 0, buf);
+       checkit("0.1", buf);
 
-fi # d_longdbl
+       Gconvert((DOUBLETYPE)1.0, 8, 0, buf); 
+       checkit("1", buf);
 
-case "$sPRIfldbl" in
-'')    d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; 
-       d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; 
-       ;;
-*)     d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; 
-       d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; 
-       ;;
-esac
+       Gconvert((DOUBLETYPE)1.1, 8, 0, buf); 
+       checkit("1.1", buf);
+
+       Gconvert((DOUBLETYPE)1.01, 8, 0, buf); 
+       checkit("1.01", buf);
+
+       Gconvert((DOUBLETYPE)1.001, 8, 0, buf); 
+       checkit("1.001", buf);
+
+       Gconvert((DOUBLETYPE)1.0001, 8, 0, buf); 
+       checkit("1.0001", buf);
+
+       Gconvert((DOUBLETYPE)1.00001, 8, 0, buf); 
+       checkit("1.00001", buf);
+
+       Gconvert((DOUBLETYPE)1.000001, 8, 0, buf); 
+       checkit("1.000001", buf);
+
+       Gconvert((DOUBLETYPE)0.0, 8, 0, buf); 
+       checkit("0", buf);
+
+       Gconvert((DOUBLETYPE)-1.0, 8, 0, buf); 
+       checkit("-1", buf);
+
+       /* Some Linux gcvt's give 1.e+5 here. */
+       Gconvert((DOUBLETYPE)100000.0, 8, 0, buf); 
+       checkit("100000", buf);
+       
+       /* Some Linux gcvt's give -1.e+5 here. */
+       Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); 
+       checkit("-100000", buf);
+
+       exit(0);
+}
+EOP
+       case "$d_Gconvert" in
+       gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+       gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+       sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+       *) xxx_list='gconvert gcvt sprintf' ;;
+       esac
+
+        case "$d_longdbl$uselongdouble$d_qgcvt" in
+        "$define$define$define") xxx_list="`echo $xxx_list|sed 's/gcvt/qgcvt gcvt/'`" ;;
+       esac
+
+       for xxx_convert in $xxx_list; do
+               echo "Trying $xxx_convert..."
+               $rm -f try try$_o
+               set try -DTRY_$xxx_convert
+               if eval $compile; then
+                       echo "$xxx_convert() found." >&4
+                       if ./try; then
+                               echo "I'll use $xxx_convert to convert floats into a string." >&4
+                               break;
+                       else
+                               echo "...But $xxx_convert didn't work as I expected."
+                       fi
+               else
+                       echo "$xxx_convert NOT found." >&4
+               fi
+       done
+               
+       case "$xxx_convert" in
+       gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+       gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+       qgcvt) d_Gconvert='qgcvt((x),(n),(b))' ;;
+       *) case "$uselongdouble$d_longdbl$d_PRIgldbl" in
+          "$define$define$define")
+             d_Gconvert="sprintf((b),\"%.*$sPRIgldbl\",(n),(x))" ;;
+          *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+          esac
+          ;;  
+       esac
+fi
 
 : Initialize h_fcntl
 h_fcntl=false
@@ -8405,10 +8636,6 @@ eval $inlibc
 set endservent d_endsent
 eval $inlibc
 
-: see if endspent exists
-set endspent d_endspent
-eval $inlibc
-
 : Locate the flags for 'open()'
 echo " "
 $cat >open3.c <<'EOCP'
@@ -8547,7 +8774,8 @@ extern int errno;
 #ifdef I_UNISTD
 #include <unistd.h>
 #endif
-#ifdef $i_string
+#$i_string I_STRING
+#ifdef I_STRING
 #include <string.h>
 #else
 #include <strings.h>
@@ -8987,6 +9215,10 @@ $rm -f try.* try
 set d_fpos64_t
 eval $setvar
 
+: see if frexpl exists
+set frexpl d_frexpl
+eval $inlibc
+
 hasstruct='varname=$1; struct=$2; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -9064,6 +9296,10 @@ esac
 set getcwd d_getcwd
 eval $inlibc
 
+: see if getespwnam exists
+set getespwnam d_getespwnam
+eval $inlibc
+
 
 : see if getfsstat exists
 set getfsstat d_getfsstat
@@ -9242,6 +9478,10 @@ echo " "
 set d_getprotoprotos getprotoent $i_netdb netdb.h
 eval $hasproto
 
+: see if getprpwnam exists
+set getprpwnam d_getprpwnam
+eval $inlibc
+
 : see if getpwent exists
 set getpwent d_getpwent
 eval $inlibc
@@ -9264,10 +9504,6 @@ echo " "
 set d_getservprotos getservent $i_netdb netdb.h
 eval $hasproto
 
-: see if getspent exists
-set getspent d_getspent
-eval $inlibc
-
 : see if getspnam exists
 set getspnam d_getspnam
 eval $inlibc
@@ -9477,6 +9713,14 @@ set d_isascii
 eval $setvar
 $rm -f isascii*
 
+: see if isnan exists
+set isnan d_isnan
+eval $inlibc
+
+: see if isnanl exists
+set isnanl d_isnanl
+eval $inlibc
+
 : see if killpg exists
 set killpg d_killpg
 eval $inlibc
@@ -9559,7 +9803,7 @@ echo 'int main() { long long x = 7; return 0; }' > try.c
 set try
 if eval $compile; then
        val="$define"
-       echo "You have have long long."
+       echo "You have long long."
 else
        val="$undef"
        echo "You do not have long long."
@@ -9696,6 +9940,10 @@ esac
 
 
 
+: see if modfl exists
+set modfl d_modfl
+eval $inlibc
+
 : see if mprotect exists
 set mprotect d_mprotect
 eval $inlibc
@@ -10065,6 +10313,39 @@ esac
 
 $rm -f try.* try
 
+case "$d_nv_preserves_uv" in
+"$define") d_nv_preserves_uv_bits=`expr $uvsize \* 8` ;;
+*)     $echo "Checking how many bits of your UVs your NVs can preserve..." >&4
+       $cat <<EOP >try.c
+#include <stdio.h>
+int main() {
+    $uvtype u = 0;
+    int     n = 8 * $uvsize;
+    int     i;
+    for (i = 0; i < n; i++) {
+      u = u << 1 | ($uvtype)1;
+      if (($uvtype)($nvtype)u != u)
+        break;
+    }
+    printf("%d\n", i);
+    exit(0);
+}
+EOP
+       set try
+       if eval $compile; then
+               d_nv_preserves_uv_bits="`./try$exe_ext`"
+       fi
+       case "$d_nv_preserves_uv_bits" in
+       [1-9]*) $echo "Your NVs can preserve $d_nv_preserves_uv_bits bits of your UVs."  2>&1 ;;
+       *)      $echo "Can't figure out how many bits your NVs preserve." 2>&1
+               d_nv_preserves_uv_bits="$undef"
+               ;;
+       esac
+       $rm -f try.* try
+       ;;
+esac
+
+
 
 : check for off64_t
 echo " "
@@ -10859,6 +11140,10 @@ eval $inlibc
 set setpriority d_setprior
 eval $inlibc
 
+: see if setproctitle exists
+set setproctitle d_setproctitle
+eval $inlibc
+
 : see if setpwent exists
 set setpwent d_setpwent
 eval $inlibc
@@ -10891,10 +11176,6 @@ eval $inlibc
 set setsid d_setsid
 eval $inlibc
 
-: see if setspent exists
-set setspent d_setspent
-eval $inlibc
-
 : see if setvbuf exists
 set setvbuf d_setvbuf
 eval $inlibc
@@ -11405,6 +11686,54 @@ eval $inlibc
 set strtoll d_strtoll
 eval $inlibc
 
+case "$d_longlong-$d_strtoll" in
+"$define-$define")
+       $cat <<EOM
+Checking whether your strtoll() works okay...
+EOM
+       $cat >try.c <<'EOCP'
+#include <errno.h>
+#ifdef __hpux
+#define strtoll __strtoll
+#endif
+#include <stdio.h>
+extern long long int strtoll(char *s, char **, int); 
+static int bad = 0;
+int check(char *s, long long ell, int een) {
+       long long gll;
+       errno = 0;
+       gll = strtoll(s, 0, 10);
+       if (!((gll == ell) && (errno == een)))
+               bad++;
+}
+int main() {
+       check(" 1",                                      1LL, 0);
+       check(" 0",                                      0LL, 0);
+       check("-1",                                     -1LL, 0);
+       check("-9223372036854775808", -9223372036854775808LL, 0);
+       check("-9223372036854775808", -9223372036854775808LL, 0);
+       check(" 9223372036854775807",  9223372036854775807LL, 0);
+       check("-9223372036854775808", -9223372036854775808LL, 0);
+       check(" 9223372036854775808",  9223372036854775807LL, ERANGE);
+       check("-9223372036854775809", -9223372036854775808LL, ERANGE);
+       if (!bad)
+               printf("ok\n");
+}
+EOCP
+       set try
+       if eval $compile; then
+               case "`./try`" in
+               ok) echo "Your strtoll() seems to be working okay." ;;
+               *) cat <<EOM >&4
+Your strtoll() doesn't seem to be working okay.
+EOM
+                  d_strtoll="$undef"
+                  ;;
+               esac
+       fi
+       ;;
+esac
+
 : see if strtoul exists
 set strtoul d_strtoul
 eval $inlibc
@@ -11413,6 +11742,49 @@ eval $inlibc
 set strtoull d_strtoull
 eval $inlibc
 
+case "$d_longlong-$d_strtoull" in
+"$define-$define")
+       $cat <<EOM
+Checking whether your strtoull() works okay...
+EOM
+       $cat >try.c <<'EOCP'
+#include <errno.h>
+#ifdef __hpux
+#define strtoull __strtoull
+#endif
+#include <stdio.h>
+extern unsigned long long int strtoull(char *s, char **, int); 
+static int bad = 0;
+int check(char *s, long long eull, int een) {
+       long long gull;
+       errno = 0;
+       gull = strtoull(s, 0, 10);
+       if (!((gull == eull) && (errno == een)))
+               bad++;
+}
+int main() {
+       check(" 1",                                       1LL, 0);
+       check(" 0",                                       0LL, 0);
+       check("18446744073709551615", 18446744073709551615ULL, 0);
+       check("18446744073709551616", 18446744073709551615ULL, ERANGE);
+       if (!bad)
+               printf("ok\n");
+}
+EOCP
+       set try
+       if eval $compile; then
+               case "`./try`" in
+               ok) echo "Your strtoull() seems to be working okay." ;;
+               *) cat <<EOM >&4
+Your strtoull() doesn't seem to be working okay.
+EOM
+                  d_strtoull="$undef"
+                  ;;
+               esac
+       fi
+       ;;
+esac
+
 : see if strtouq exists
 set strtouq d_strtouq
 eval $inlibc
@@ -12373,9 +12745,52 @@ EOM
        $rm -f core try.core core.try.*
        case "$fflushNULL" in
        x)      $cat >&4 <<EOM
-Your fflush(NULL) works okay.
+Your fflush(NULL) works okay for output streams.
+Let's see if it clobbers input pipes...
+EOM
+# As of mid-March 2000 all versions of Solaris appear to have a stdio
+# bug that improperly flushes the input end of pipes.  So we avoid the
+# autoflush on fork/system/exec support for now. :-(
+$cat >tryp.c <<EOCP
+#include <stdio.h>
+int
+main(int argc, char **argv)
+{
+    char buf[1024];
+    int i;
+    char *bp = buf;
+    while (1) {
+        while ((i = getc(stdin)) != -1
+               && (*bp++ = i) != '\n'
+               && bp < &buf[1024])
+       /* DO NOTHING */ ;
+        *bp = '\0';
+        fprintf(stdout, "%s", buf);
+        fflush(NULL);
+        if (i == -1)
+           return 0;
+        bp = buf;
+    }
+}
+EOCP
+                fflushNULL="$define"
+                set tryp
+                if eval $compile; then
+                    $rm -f tryp.out
+                    $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+                    if cmp tryp.c tryp.out >/dev/null 2>&1; then
+                       $cat >&4 <<EOM
+fflush(NULL) seems to behave okay with input streams.
+EOM
+                       fflushNULL="$define"
+                    else
+                       $cat >&4 <<EOM
+Ouch, fflush(NULL) clobbers input pipes!  We will not use it.
 EOM
-               fflushNULL="$define"
+                        fflushNULL="$undef"
+                    fi
+                fi
+               $rm -f core tryp.c tryp.core core.tryp.*
                ;;
        '')     $cat >&4 <<EOM
 Your fflush(NULL) isn't working (contrary to ANSI C).
@@ -12397,57 +12812,100 @@ $define|true|[yY]*)
        fflushNULL="$undef"
        ;;
 esac
-: check explicit looping only if NULL did not work
+: check explicit looping only if NULL did not work, and if the pipe
+: bug does not show up on an explicit flush too
 case "$fflushNULL" in
 "$undef")
-       : check for fflush all behaviour
-       case "$fflushall" in
-       '')     set try -DTRY_FFLUSH_ALL $output
-               if eval $compile; then
-                       $cat >&4 <<EOM
-(Now testing the other method--but note that also this may fail.)
+       $cat >tryp.c <<EOCP
+#include <stdio.h>
+int
+main(int argc, char **argv)
+{
+    char buf[1024];
+    int i;
+    char *bp = buf;
+    while (1) {
+       while ((i = getc(stdin)) != -1
+              && (*bp++ = i) != '\n'
+              && bp < &buf[1024])
+       /* DO NOTHING */ ;
+       *bp = '\0';
+       fprintf(stdout, "%s", buf);
+       fflush(stdin);
+       if (i == -1)
+           return 0;
+       bp = buf;
+    }
+}
+EOCP
+       set tryp
+       if eval $compile; then
+           $rm -f tryp.out
+           $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+           if cmp tryp.c tryp.out >/dev/null 2>&1; then
+              $cat >&4 <<EOM
+Good, at least fflush(stdin) seems to behave okay when stdin is a pipe.
 EOM
-                       $rm -f try.out
-                       ./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.*
+               : now check for fflushall behaviour
                case "$fflushall" in
-               x)      $cat >&4 <<EOM
+               '')     set try -DTRY_FFLUSH_ALL $output
+                       if eval $compile; then
+                               $cat >&4 <<EOM
+(Now testing the other method--but note that this also may fail.)
+EOM
+                               $rm -f try.out
+                               ./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="$define"
-                       ;;
-               '')     $cat >&4 <<EOM
+                               fflushall="$define"
+                               ;;
+                       '')     $cat >&4 <<EOM
 Sigh. Flushing explicitly all the stdio streams doesn't work.
 EOM
-                       fflushall="$undef"
-                       ;;
-               *)      $cat >&4 <<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"
+                               ;;
+                       esac
+                       ;;
+               "$define"|true|[yY]*)
+                       fflushall="$define"
+                       ;;
+               *)
                        fflushall="$undef"
                        ;;
                esac
-               ;;
-       "$define"|true|[yY]*)
-               fflushall="$define"
-               ;;
-       *)
+           else
+               $cat >&4 <<EOM
+All is futile.  Even fflush(stdin) clobbers input pipes!
+EOM
                fflushall="$undef"
-               ;;
-       esac
+           fi
+       else
+           fflushall="$undef"
+       fi
+       $rm -f core tryp.c tryp.core core.tryp.*
        ;;
-*)     fflushall="$undef"      
+*)     fflushall="$undef"
        ;;
 esac
+
 case "$fflushNULL$fflushall" in
 undefundef)
        $cat <<EOM
-I cannot figure out how to flush pending stdio output.
+OK, I give up.  I cannot figure out how to flush pending stdio output.
+We won't be flushing handles at all before fork/exec/popen.
 EOM
        ;;
 esac
@@ -13539,6 +13997,37 @@ echo $sig_name | $awk \
 }'
 $rm -f signal signal.c signal.awk signal.lst signal_cmd 
 
+echo " "
+case "$sizetype" in
+*_t) zzz="$sizetype"   ;;
+*)   zzz="filesize"    ;;
+esac
+echo "Checking the size of $zzz..." >&4 
+cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+    printf("%d\n", (int)sizeof($sizetype));
+    exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+       yyy=`./try`
+       case "$yyy" in
+       '')     sizesize=4
+               echo "(I can't execute the test program--guessing $sizesize.)" >&4
+               ;;
+       *)      sizesize=$yyy
+               echo "Your $zzz size is $sizesize bytes."
+               ;;
+       esac
+else
+       sizesize=4
+       echo "(I can't compile the test program--guessing $sizesize.)" >&4
+fi
+
+
 : check for socklen_t
 echo " "
 echo "Checking to see if you have socklen_t..." >&4
@@ -13558,7 +14047,7 @@ else
        val="$undef"
        echo "You do not have socklen_t."
        case "$sizetype" in
-       size_t) echo "(You do have size_t, that might work.)" ;;
+       size_t) echo "(You do have size_t, that might work. Some people are happy with just an int.)" ;;
        esac
 fi
 $rm -f try try.*
@@ -13577,7 +14066,7 @@ EOM
        case "$d_socklen_t" in
        "$define") yyy="$yyy socklen_t"
        esac
-       yyy="$yyy $sizetype int long"
+       yyy="$yyy $sizetype int long unsigned"
        for xxx in $yyy; do
                case "$socksizetype" in
                '')     try="extern int accept(int, struct sockaddr *, $xxx *);"
@@ -13590,15 +14079,15 @@ EOM
        done
 : In case none of those worked, prompt the user.
        case "$socksizetype" in
-       '')     rp='What is the type for the last argument to accept()?'
+       '')     rp='What is the type for socket address structure sizes?'
                dflt='int'
                . ./myread
                socksizetype=$ans
                ;;
        esac
        ;;
-*)     : no sockets, so pick relatively harmless defaults
-       socksizetype='char *'
+*)     : no sockets, so pick relatively harmless default
+       socksizetype='int'
        ;;
 esac
 
@@ -13888,6 +14377,14 @@ eval $setvar
 set iconv.h i_iconv
 eval $inhdr
 
+: see if this is a ieeefp.h system
+set ieeefp.h i_ieeefp
+eval $inhdr
+
+: see if this is a libutil.h system
+set libutil.h i_libutil
+eval $inhdr
+
 : see if locale.h is available
 set locale.h i_locale
 eval $inhdr
@@ -13967,6 +14464,10 @@ eval $inhdr
 set poll.h i_poll
 eval $inhdr
 
+: see if this is a prot.h system
+set prot.h i_prot
+eval $inhdr
+
 echo " "
 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4 
 $cat <<'EOSH' > Cppsym.know
@@ -14035,8 +14536,9 @@ $osname
 EOSH
 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
-$cat Cppsym.a Cppsym.b | $tr ' ' $trnl | sort | uniq > Cppsym.know
-$rm -f Cppsym.a Cppsym.b
+$cat Cppsym.know > Cppsym.c
+$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
+$rm -f Cppsym.a Cppsym.b Cppsym.c
 cat <<EOSH > Cppsym
 $startsh
 if $test \$# -gt 0; then
@@ -14075,6 +14577,7 @@ cat <<EOSH >> Cppsym.try
 ccflags="$ccflags"
 case "$osname-$gccversion" in
 irix-) ccflags="\$ccflags -woff 1178" ;;
+os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
 esac
 $cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
 EOSH
@@ -14130,7 +14633,7 @@ if $test -z ccsym.raw; then
 else
        if $test -s ccsym.com; then
                echo "Your C compiler and pre-processor define these symbols:"
-               $sed -e 's/\(.*\)=.*/\1/' ccsym.com
+               $sed -e 's/\(..*\)=.*/\1/' ccsym.com
                also='also '
                symbols='ones'
                cppccsymbols=`$cat ccsym.com`
@@ -14140,7 +14643,7 @@ else
        if $test -s ccsym.cpp; then
                $test "$also" && echo " "
                echo "Your C pre-processor ${also}defines the following symbols:"
-               $sed -e 's/\(.*\)=.*/\1/' ccsym.cpp
+               $sed -e 's/\(..*\)=.*/\1/' ccsym.cpp
                also='further '
                cppsymbols=`$cat ccsym.cpp`
                cppsymbols=`echo $cppsymbols`
@@ -14149,14 +14652,14 @@ else
        if $test -s ccsym.own; then
                $test "$also" && echo " "
                echo "Your C compiler ${also}defines the following cpp symbols:"
-               $sed -e 's/\(.*\)=1/\1/' ccsym.own
-               $sed -e 's/\(.*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
+               $sed -e 's/\(..*\)=1/\1/' ccsym.own
+               $sed -e 's/\(..*\)=.*/\1/' ccsym.own | $uniq >>Cppsym.true
                ccsymbols=`$cat ccsym.own`
                ccsymbols=`echo $ccsymbols`
                $test "$silent" || sleep 1
        fi
 fi
-$rm -f ccsym*
+$rm -f ccsym* Cppsym.*
 
 : see if this is a termio system
 val="$undef"
@@ -14323,6 +14826,10 @@ $rm -f varargs*
 set stddef.h i_stddef
 eval $inhdr
 
+: see if this is a sunmath.h system
+set sunmath.h i_sunmath
+eval $inhdr
+
 : see if sys/access.h is available
 set sys/access.h i_sysaccess
 eval $inhdr
@@ -14534,6 +15041,12 @@ for xxx in $known_extensions ; do
                true|$define|y) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
+       Sys/Syslog|sys/syslog)
+               : XXX syslog requires socket
+               case "$d_socket" in 
+               true|$define|y) avail_ext="$avail_ext $xxx" ;;
+               esac
+               ;;
        Thread|thread)
                case "$usethreads" in 
                true|$define|y) avail_ext="$avail_ext $xxx" ;;
@@ -14791,6 +15304,7 @@ cc='$cc'
 cccdlflags='$cccdlflags'
 ccdlflags='$ccdlflags'
 ccflags='$ccflags'
+ccflags_uselargefiles='$ccflags_uselargefiles'
 ccsymbols='$ccsymbols'
 cf_by='$cf_by'
 cf_email='$cf_email'
@@ -14871,7 +15385,6 @@ d_endnent='$d_endnent'
 d_endpent='$d_endpent'
 d_endpwent='$d_endpwent'
 d_endsent='$d_endsent'
-d_endspent='$d_endspent'
 d_eofnblk='$d_eofnblk'
 d_eunice='$d_eunice'
 d_fchmod='$d_fchmod'
@@ -14886,6 +15399,7 @@ d_flock='$d_flock'
 d_fork='$d_fork'
 d_fpathconf='$d_fpathconf'
 d_fpos64_t='$d_fpos64_t'
+d_frexpl='$d_frexpl'
 d_fs_data_s='$d_fs_data_s'
 d_fseeko='$d_fseeko'
 d_fsetpos='$d_fsetpos'
@@ -14894,6 +15408,7 @@ d_fstatvfs='$d_fstatvfs'
 d_ftello='$d_ftello'
 d_ftime='$d_ftime'
 d_getcwd='$d_getcwd'
+d_getespwnam='$d_getespwnam'
 d_getfsstat='$d_getfsstat'
 d_getgrent='$d_getgrent'
 d_getgrps='$d_getgrps'
@@ -14918,12 +15433,12 @@ d_getpgrp='$d_getpgrp'
 d_getppid='$d_getppid'
 d_getprior='$d_getprior'
 d_getprotoprotos='$d_getprotoprotos'
+d_getprpwnam='$d_getprpwnam'
 d_getpwent='$d_getpwent'
 d_getsbyname='$d_getsbyname'
 d_getsbyport='$d_getsbyport'
 d_getsent='$d_getsent'
 d_getservprotos='$d_getservprotos'
-d_getspent='$d_getspent'
 d_getspnam='$d_getspnam'
 d_gettimeod='$d_gettimeod'
 d_gnulibc='$d_gnulibc'
@@ -14935,6 +15450,8 @@ d_index='$d_index'
 d_inetaton='$d_inetaton'
 d_int64_t='$d_int64_t'
 d_isascii='$d_isascii'
+d_isnan='$d_isnan'
+d_isnanl='$d_isnanl'
 d_killpg='$d_killpg'
 d_lchown='$d_lchown'
 d_ldbl_dig='$d_ldbl_dig'
@@ -14961,6 +15478,7 @@ d_mkstemp='$d_mkstemp'
 d_mkstemps='$d_mkstemps'
 d_mktime='$d_mktime'
 d_mmap='$d_mmap'
+d_modfl='$d_modfl'
 d_mprotect='$d_mprotect'
 d_msg='$d_msg'
 d_msg_ctrunc='$d_msg_ctrunc'
@@ -14977,6 +15495,7 @@ d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
 d_nice='$d_nice'
 d_nv_preserves_uv='$d_nv_preserves_uv'
+d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
 d_off64_t='$d_off64_t'
 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
 d_oldpthreads='$d_oldpthreads'
@@ -14984,6 +15503,7 @@ d_oldsock='$d_oldsock'
 d_open3='$d_open3'
 d_pathconf='$d_pathconf'
 d_pause='$d_pause'
+d_perl_otherlibdirs='$d_perl_otherlibdirs'
 d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
@@ -14997,6 +15517,7 @@ d_pwexpire='$d_pwexpire'
 d_pwgecos='$d_pwgecos'
 d_pwpasswd='$d_pwpasswd'
 d_pwquota='$d_pwquota'
+d_qgcvt='$d_qgcvt'
 d_quad='$d_quad'
 d_readdir='$d_readdir'
 d_readlink='$d_readlink'
@@ -15029,6 +15550,7 @@ d_setpgid='$d_setpgid'
 d_setpgrp2='$d_setpgrp2'
 d_setpgrp='$d_setpgrp'
 d_setprior='$d_setprior'
+d_setproctitle='$d_setproctitle'
 d_setpwent='$d_setpwent'
 d_setregid='$d_setregid'
 d_setresgid='$d_setresgid'
@@ -15038,7 +15560,6 @@ d_setrgid='$d_setrgid'
 d_setruid='$d_setruid'
 d_setsent='$d_setsent'
 d_setsid='$d_setsid'
-d_setspent='$d_setspent'
 d_setvbuf='$d_setvbuf'
 d_sfio='$d_sfio'
 d_shm='$d_shm'
@@ -15094,6 +15615,7 @@ d_umask='$d_umask'
 d_uname='$d_uname'
 d_union_semun='$d_union_semun'
 d_ustat='$d_ustat'
+d_vendorarch='$d_vendorarch'
 d_vendorbin='$d_vendorbin'
 d_vendorlib='$d_vendorlib'
 d_vfork='$d_vfork'
@@ -15137,6 +15659,7 @@ freetype='$freetype'
 full_ar='$full_ar'
 full_csh='$full_csh'
 full_sed='$full_sed'
+gccosandvers='$gccosandvers'
 gccversion='$gccversion'
 gidformat='$gidformat'
 gidsign='$gidsign'
@@ -15172,7 +15695,9 @@ i_float='$i_float'
 i_gdbm='$i_gdbm'
 i_grp='$i_grp'
 i_iconv='$i_iconv'
+i_ieeefp='$i_ieeefp'
 i_inttypes='$i_inttypes'
+i_libutil='$i_libutil'
 i_limits='$i_limits'
 i_locale='$i_locale'
 i_machcthr='$i_machcthr'
@@ -15186,6 +15711,7 @@ i_neterrno='$i_neterrno'
 i_netinettcp='$i_netinettcp'
 i_niin='$i_niin'
 i_poll='$i_poll'
+i_prot='$i_prot'
 i_pthread='$i_pthread'
 i_pwd='$i_pwd'
 i_rpcsvcdbm='$i_rpcsvcdbm'
@@ -15197,6 +15723,7 @@ i_stdarg='$i_stdarg'
 i_stddef='$i_stddef'
 i_stdlib='$i_stdlib'
 i_string='$i_string'
+i_sunmath='$i_sunmath'
 i_sysaccess='$i_sysaccess'
 i_sysdir='$i_sysdir'
 i_sysfile='$i_sysfile'
@@ -15253,6 +15780,7 @@ installsitebin='$installsitebin'
 installsitelib='$installsitelib'
 installstyle='$installstyle'
 installusrbinperl='$installusrbinperl'
+installvendorarch='$installvendorarch'
 installvendorbin='$installvendorbin'
 installvendorlib='$installvendorlib'
 intsize='$intsize'
@@ -15265,6 +15793,7 @@ large='$large'
 ld='$ld'
 lddlflags='$lddlflags'
 ldflags='$ldflags'
+ldflags_uselargefiles='$ldflags_uselargefiles'
 ldlibpthname='$ldlibpthname'
 less='$less'
 lib_ext='$lib_ext'
@@ -15277,6 +15806,7 @@ libsfiles='$libsfiles'
 libsfound='$libsfound'
 libspath='$libspath'
 libswanted='$libswanted'
+libswanted_uselargefiles='$libswanted_uselargefiles'
 line='$line'
 lint='$lint'
 lkflags='$lkflags'
@@ -15337,6 +15867,7 @@ optimize='$optimize'
 orderlib='$orderlib'
 osname='$osname'
 osvers='$osvers'
+otherlibdirs='$otherlibdirs'
 package='$package'
 pager='$pager'
 passcat='$passcat'
@@ -15408,9 +15939,11 @@ sitearchexp='$sitearchexp'
 sitebin='$sitebin'
 sitebinexp='$sitebinexp'
 sitelib='$sitelib'
+sitelib_stem='$sitelib_stem'
 sitelibexp='$sitelibexp'
 siteprefix='$siteprefix'
 siteprefixexp='$siteprefixexp'
+sizesize='$sizesize'
 sizetype='$sizetype'
 sleep='$sleep'
 smail='$smail'
@@ -15492,9 +16025,12 @@ uvsize='$uvsize'
 uvtype='$uvtype'
 uvuformat='$uvuformat'
 uvxformat='$uvxformat'
+vendorarch='$vendorarch'
+vendorarchexp='$vendorarchexp'
 vendorbin='$vendorbin'
 vendorbinexp='$vendorbinexp'
 vendorlib='$vendorlib'
+vendorlib_stem='$vendorlib_stem'
 vendorlibexp='$vendorlibexp'
 vendorprefix='$vendorprefix'
 vendorprefixexp='$vendorprefixexp'