This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
A little better comments.
[perl5.git] / Configure
index 7ba331a..c69d35a 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 Fri Jun  8 18:06:31 EET DST 2001 [metaconfig 3.0 PL70]
+# Generated on Sun Dec 30 19:31:52 EET 2001 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -65,7 +65,10 @@ if test -d c:/. ; then
                PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
                OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
        elif test -n "$DJGPP"; then
-               p_=\;
+               case "X${MACHTYPE:-nonesuchmach}" in
+               *cygwin) ;;
+               *) p_=\; ;;
+               esac
        fi
 fi
 
@@ -78,6 +81,7 @@ paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
 paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
 paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
 paths="$paths /sbin /usr/sbin /usr/libexec"
+paths="$paths /system/gnu_library/bin"
 
 for p in $paths
 do
@@ -138,6 +142,7 @@ EOM
 esac
 case "$changesh" in
 true)
+       export newsh
        echo "(Feeding myself to $newsh $reason.)"
        case "$0" in
        Configure|*/Configure) exec $newsh $0 "$@";;
@@ -160,11 +165,17 @@ esac
 test -d UU || mkdir UU
 cd UU && rm -f ./*
 
+
 ccname=''
 ccversion=''
 ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
+from=''
+run=''
+targetarch=''
+to=''
+usecrosscompile=''
 perllibs=''
 dynamic_ext=''
 extensions=''
@@ -173,6 +184,7 @@ nonxs_ext=''
 static_ext=''
 useopcode=''
 useposix=''
+extras=''
 d_bsd=''
 d_eunice=''
 d_xenix=''
@@ -200,6 +212,7 @@ emacs=''
 expr=''
 find=''
 flex=''
+gmake=''
 grep=''
 gzip=''
 inews=''
@@ -308,7 +321,6 @@ cpplast=''
 cppminus=''
 cpprun=''
 cppstdin=''
-crosscompile=''
 d__fwalk=''
 d_access=''
 d_accessx=''
@@ -323,6 +335,7 @@ d_castneg=''
 d_chown=''
 d_chroot=''
 d_chsize=''
+d_class=''
 d_closedir=''
 d_void_closedir=''
 d_cmsghdr_s=''
@@ -335,6 +348,7 @@ d_cuserid=''
 d_dbl_dig=''
 d_dbminitproto=''
 d_difftime=''
+d_dirfd=''
 d_dlerror=''
 d_dlopen=''
 d_dlsymun=''
@@ -349,6 +363,7 @@ d_endnent=''
 d_endpent=''
 d_endpwent=''
 d_endsent=''
+d_fchdir=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
@@ -357,10 +372,16 @@ d_fd_macros=''
 d_fd_set=''
 d_fds_bits=''
 d_fgetpos=''
+d_finite=''
+d_finitel=''
 d_flexfnam=''
 d_flock=''
 d_flockproto=''
 d_fork=''
+d_fp_class=''
+d_fpclass=''
+d_fpclassify=''
+d_fpclassl=''
 d_fpos64_t=''
 d_frexpl=''
 d_fs_data_s=''
@@ -414,10 +435,11 @@ d_getsbyport=''
 d_gnulibc=''
 d_hasmntopt=''
 d_htonl=''
-d_iconv=''
 d_inetaton=''
 d_int64_t=''
 d_isascii=''
+d_isfinite=''
+d_isinf=''
 d_isnan=''
 d_isnanl=''
 d_killpg=''
@@ -461,6 +483,7 @@ d_msgsnd=''
 d_msync=''
 d_munmap=''
 d_nice=''
+d_nl_langinfo=''
 d_off64_t=''
 d_open3=''
 d_fpathconf=''
@@ -469,8 +492,11 @@ d_pause=''
 d_pipe=''
 d_poll=''
 d_portable=''
+d_procselfexe=''
+procselfexe=''
 d_old_pthread_create_joinable=''
 old_pthread_create_joinable=''
+d_pthread_atfork=''
 d_pthread_yield=''
 d_sched_yield=''
 sched_yield=''
@@ -481,7 +507,6 @@ d_seekdir=''
 d_telldir=''
 d_readlink=''
 d_readv=''
-d_realpath=''
 d_recvmsg=''
 d_rename=''
 d_rmdir=''
@@ -605,6 +630,7 @@ d_umask=''
 d_semctl_semid_ds=''
 d_semctl_semun=''
 d_union_semun=''
+d_unordered=''
 d_usleep=''
 d_usleepproto=''
 d_ustat=''
@@ -658,12 +684,14 @@ i_dld=''
 i_dlfcn=''
 i_fcntl=''
 i_float=''
+i_fp=''
+i_fp_class=''
 i_gdbm=''
 d_grpasswd=''
 i_grp=''
-i_iconv=''
 i_ieeefp=''
 i_inttypes=''
+i_langinfo=''
 i_libutil=''
 i_limits=''
 i_locale=''
@@ -833,6 +861,7 @@ perl_patchlevel=''
 revision=''
 subversion=''
 version=''
+version_patchlevel_string=''
 perl5=''
 perladmin=''
 perlpath=''
@@ -963,6 +992,7 @@ usesocks=''
 d_oldpthreads=''
 use5005threads=''
 useithreads=''
+usereentrant=''
 usethreads=''
 incpath=''
 mips_type=''
@@ -1006,6 +1036,10 @@ if test -f /etc/unixtovms.exe; then
        eunicefix=/etc/unixtovms.exe
 fi
 
+if test -f "/system/gnu_library/bin/ar.pm"; then
+     _exe=".pm"
+fi
+
 i_whoami=''
 ccname=''
 ccversion=''
@@ -1015,7 +1049,6 @@ useposix=true
 : set useopcode=false in your hint file to disable the Opcode extension.
 useopcode=true
 : Trailing extension.  Override this in a hint file, if needed.
-_exe=''
 : Extra object files, if any, needed on this platform.
 archobjs=''
 archname=''
@@ -1028,6 +1061,7 @@ locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
 inclwanted=''
 
 groupstype=''
+libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
 : Possible local library directories to search.
@@ -1056,6 +1090,7 @@ 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.
+usereentrant='undef'
 : full support for void wanted by default
 defvoidused=15
 
@@ -1064,7 +1099,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 util"
+libswanted="$libswanted ucb bsd BSD PW x 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 ! !'`
@@ -1093,6 +1128,9 @@ case "$sh" in
                        if test -f "$xxx"; then
                                sh="$xxx";
                                break
+                       elif test "X$_exe" != X -a -f "$xxx$_exe"; then
+                               sh="$xxx";
+                               break
                        elif test -f "$xxx.exe"; then
                                sh="$xxx";
                                break
@@ -1103,7 +1141,7 @@ case "$sh" in
 esac
 
 case "$sh" in
-'')    cat <<EOM >&2
+'')    cat >&2 <<EOM
 $me:  Fatal Error:  I can't find a Bourne Shell anywhere.  
 
 Usually it's in /bin/sh.  How did you even get this far?
@@ -1119,18 +1157,30 @@ if `$sh -c '#' >/dev/null 2>&1`; then
        shsharp=true
        spitshell=cat
        xcat=/bin/cat
-       test -f $xcat || xcat=/usr/bin/cat
-       echo "#!$xcat" >try
-       $eunicefix try
-       chmod +x try
-       ./try > today
+       test -f $xcat$_exe || xcat=/usr/bin/cat
+       if test ! -f $xcat$_exe; then
+               for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
+                       if test -f $p/cat$_exe; then
+                               xcat=$p/cat
+                               break
+                       fi
+               done
+               if test ! -f $xcat$_exe; then
+                       echo "Can't find cat anywhere!"
+                       exit 1
+               fi
+       fi
+       echo "#!$xcat" >sharp
+       $eunicefix sharp
+       chmod +x sharp
+       ./sharp > today
        if test -s today; then
                sharpbang='#!'
        else
-               echo "#! $xcat" > try
-               $eunicefix try
-               chmod +x try
-               ./try > today
+               echo "#! $xcat" > sharp
+               $eunicefix sharp
+               chmod +x sharp
+               ./sharp > today
                if test -s today; then
                        sharpbang='#! '
                else
@@ -1150,28 +1200,28 @@ else
        echo "I presume that if # doesn't work, #! won't work either!"
        sharpbang=': use '
 fi
-rm -f try today
+rm -f sharp today
 
 : figure out how to guarantee sh startup
 case "$startsh" in
 '') startsh=${sharpbang}${sh} ;;
 *)
 esac
-cat >try <<EOSS
+cat >sharp <<EOSS
 $startsh
 set abc
 test "$?abc" != 1
 EOSS
 
-chmod +x try
-$eunicefix try
-if ./try; then
+chmod +x sharp
+$eunicefix sharp
+if ./sharp; then
        : echo "Yup, it does."
 else
        echo "Hmm... '$startsh' does not guarantee sh startup..."
        echo "You may have to fix up the shell scripts to make sure $sh runs them."
 fi
-rm -f try
+rm -f sharp
 
 
 : Save command line options in file UU/cmdline.opt for later use in
@@ -1183,12 +1233,24 @@ config_args='$*'
 config_argc=$#
 EOSH
 argn=1
+args_exp=''
+args_sep=''
 for arg in "$@"; do
        cat >>cmdline.opt <<EOSH
 config_arg$argn='$arg'
 EOSH
+       # Extreme backslashitis: replace each ' by '"'"'
+       cat <<EOC | sed -e "s/'/'"'"'"'"'"'"'/g" > cmdl.opt
+$arg
+EOC
+       arg_exp=`cat cmdl.opt`
+       args_exp="$args_exp$args_sep'$arg_exp'"
        argn=`expr $argn + 1`
+       args_sep=' '
 done
+# args_exp is good for restarting self: eval "set X $args_exp"; shift; $0 "$@"
+# used by ./hints/os2.sh
+rm -f cmdl.opt
 
 : produce awk script to parse command line options
 cat >options.awk <<'EOF'
@@ -1970,6 +2032,9 @@ for dir in \$*; do
        if test -f \$thisthing; then
                echo \$thisthing
                exit 0
+       elif test "X$_exe" != X -a -f \$thisthing$_exe; then
+               echo \$thisthing
+               exit 0
        elif test -f \$dir/\$thing.exe; then
                if test -n "$DJGPP"; then
                        echo \$dir/\$thing.exe
@@ -1990,13 +2055,13 @@ $eunicefix loc
 loclist="
 awk
 cat
+chmod
 comm
 cp
 echo
 expr
 grep
 ls
-make
 mkdir
 rm
 sed
@@ -2014,9 +2079,11 @@ cpp
 csh
 date
 egrep
+gmake
 gzip
 less
 ln
+make
 more
 nm
 nroff
@@ -2041,7 +2108,7 @@ for file in $loclist; do
        '') xxx=`./loc $file $file $pth`;;
        *) xxx=`./loc $xxx $xxx $pth`;;
        esac
-       eval $file=$xxx
+       eval $file=$xxx$_exe
        eval _$file=$xxx
        case "$xxx" in
        /*)
@@ -2093,12 +2160,37 @@ case "$egrep" in
 egrep)
        echo "Substituting grep for egrep."
        egrep=$grep
+       _egrep=$grep
        ;;
 esac
 case "$ln" in
 ln)
        echo "Substituting cp for ln."
        ln=$cp
+       _ln=$cp
+       ;;
+esac
+case "$make" in
+make)  
+       case "$gmake" in
+       gmake)
+       echo "I can't find make or gmake, and my life depends on it." >&4
+       echo "Go find a public domain implementation or fix your PATH setting!" >&4
+       exit 1
+       ;;
+       esac
+       ;;
+esac   
+case "$gmake" in
+gmake) ;;
+*)     # We can't have osname yet.
+       if test -f "/system/gnu_library/bin/ar.pm"; then # Stratus VOS
+               # Assume that gmake, if found, is definitely GNU make
+               # and prefer it over the system make.
+               echo "Substituting gmake for make."
+               make=$gmake
+               _make=$gmake
+       fi
        ;;
 esac
 case "$test" in
@@ -2223,20 +2315,43 @@ case "$lns" in
        echo "Checking how to test for symbolic links..." >&4
        $lns blurfl sym
        if $test "X$issymlink" = X; then
-               sh -c "PATH= test -h sym" >/dev/null 2>&1
+               case "$newsh" in
+               '') sh     -c "PATH= test -h sym" >/dev/null 2>&1 ;;
+               *)  $newsh -c "PATH= test -h sym" >/dev/null 2>&1 ;;
+               esac
                if test $? = 0; then
                        issymlink="test -h"
-               fi              
-       fi
-       if $test "X$issymlink" = X; then
-               if  $test -h >/dev/null 2>&1; then
-                       issymlink="$test -h"
-                       echo "Your builtin 'test -h' may be broken, I'm using external '$test -h'." >&4
+               else
+                       echo "Your builtin 'test -h' may be broken." >&4
+                       case "$test" in
+                       /*)     ;;
+                       *)      pth=`echo $PATH | sed -e "s/$p_/ /g"`
+                               for p in $pth
+                               do
+                                       if test -f "$p/$test"; then
+                                               test="$p/$test"
+                                               break
+                                       fi
+                               done
+                               ;;
+                       esac
+                       case "$test" in
+                       /*)
+                               echo "Trying external '$test -h'." >&4
+                               issymlink="$test -h"
+                               if $test ! -h sym >/dev/null 2>&1; then
+                                       echo "External '$test -h' is broken, too." >&4
+                                       issymlink=''
+                               fi
+                               ;;
+                       *)      issymlink='' ;;
+                       esac
                fi              
        fi
        if $test "X$issymlink" = X; then
                if $test -L sym 2>/dev/null; then
                        issymlink="$test -L"
+                       echo "The builtin '$test -L' worked." >&4
                fi
        fi
        if $test "X$issymlink" != X; then
@@ -2289,8 +2404,8 @@ $define|true|[yY]*)
                                fi
                        done
                        # Sanity check 2.
-                       if test ! -f t/base/commonsense.t; then
-                               echo "Failed to create the symlinks.  Aborting." >&4
+                       if test ! -f t/base/lex.t; then
+                               echo "Failed to create the symlinks (t/base/lex.t missing).  Aborting." >&4
                                exit 1
                        fi
                        cd UU
@@ -2303,6 +2418,250 @@ $define|true|[yY]*)
        ;;
 esac
 
+
+case "$usecrosscompile" in
+$define|true|[yY]*)
+       $echo "Cross-compiling..."
+        croak=''
+       case "$cc" in
+       *-*-gcc) # A cross-compiling gcc, probably.
+           targetarch=`$echo $cc|$sed 's/-gcc$//'`
+           ar=$targetarch-ar
+           # leave out ld, choosing it is more complex
+           nm=$targetarch-nm
+           ranlib=$targetarch-ranlib
+           $echo 'extern int foo;' > try.c
+           set X `$cc -v -E try.c 2>&1 | $awk '/^#include </,/^End of search /'|$grep '/include'`
+           shift
+            if $test $# -gt 0; then
+               incpth="$incpth $*"
+               incpth="`$echo $incpth|$sed 's/^ //'`"
+                echo "Guessing incpth '$incpth'." >&4
+                for i in $*; do
+                   j="`$echo $i|$sed 's,/include$,/lib,'`"
+                   if $test -d $j; then
+                       libpth="$libpth $j"
+                   fi
+                done   
+               libpth="`$echo $libpth|$sed 's/^ //'`"
+                echo "Guessing libpth '$libpth'." >&4
+           fi
+           $rm -f try.c
+           ;;
+       esac
+       case "$targetarch" in
+       '') echo "Targetarch not defined." >&4; croak=y ;;
+        *)  echo "Using targetarch $targetarch." >&4 ;;
+       esac
+       case "$incpth" in
+       '') echo "Incpth not defined." >&4; croak=y ;;
+        *)  echo "Using incpth '$incpth'." >&4 ;;
+       esac
+       case "$libpth" in
+       '') echo "Libpth not defined." >&4; croak=y ;;
+        *)  echo "Using libpth '$libpth'." >&4 ;;
+       esac
+       case "$usrinc" in
+       '') for i in $incpth; do
+               if $test -f $i/errno.h -a -f $i/stdio.h -a -f $i/time.h; then
+                   usrinc=$i
+                   echo "Guessing usrinc $usrinc." >&4
+                   break
+               fi
+           done
+           case "$usrinc" in
+           '') echo "Usrinc not defined." >&4; croak=y ;;
+           esac
+            ;;
+        *)  echo "Using usrinc $usrinc." >&4 ;;
+       esac
+       case "$targethost" in
+       '') echo "Targethost not defined." >&4; croak=y ;;
+        *)  echo "Using targethost $targethost." >&4
+       esac
+       locincpth=' '
+       loclibpth=' '
+       case "$croak" in
+       y) echo "Cannot continue, aborting." >&4; exit 1 ;;
+       esac
+       case "$src" in
+       /*) run=$src/Cross/run
+           targetmkdir=$src/Cross/mkdir
+           to=$src/Cross/to
+           from=$src/Cross/from
+           ;;
+       *)  pwd=`$test -f ../Configure & cd ..; pwd`
+           run=$pwd/Cross/run
+           targetmkdir=$pwd/Cross/mkdir
+           to=$pwd/Cross/to
+           from=$pwd/Cross/from
+           ;;
+       esac
+       case "$targetrun" in
+       '') targetrun=ssh ;;
+       esac
+       case "$targetto" in
+       '') targetto=scp ;;
+       esac
+       case "$targetfrom" in
+       '') targetfrom=scp ;;
+       esac
+       run=$run-$targetrun
+       to=$to-$targetto
+       from=$from-$targetfrom
+       case "$targetdir" in
+       '')  targetdir=/tmp
+             echo "Guessing targetdir $targetdir." >&4
+             ;;
+       esac
+       case "$targetuser" in
+       '')  targetuser=root
+             echo "Guessing targetuser $targetuser." >&4
+             ;;
+       esac
+       case "$targetfrom" in
+       scp)    q=-q ;;
+       *)      q='' ;;
+       esac
+       case "$targetrun" in
+       ssh|rsh)
+           cat >$run <<EOF
+#!/bin/sh
+case "\$1" in
+-cwd)
+  shift
+  cwd=\$1
+  shift
+  ;;
+esac
+case "\$cwd" in
+'') cwd=$targetdir ;;
+esac
+exe=\$1
+shift
+if $test ! -f \$exe.xok; then
+  $to \$exe
+  $touch \$exe.xok
+fi
+$targetrun -l $targetuser $targethost "cd \$cwd && ./\$exe \$@"
+EOF
+           ;;
+       *)  echo "Unknown targetrun '$targetrun'" >&4
+           exit 1
+           ;;
+       esac
+       case "$targetmkdir" in
+       */Cross/mkdir)
+           cat >$targetmkdir <<EOF
+#!/bin/sh
+$targetrun -l $targetuser $targethost "mkdir -p \$@"
+EOF
+           $chmod a+rx $targetmkdir
+           ;;
+       *)  echo "Unknown targetmkdir '$targetmkdir'" >&4
+           exit 1
+           ;;
+       esac
+       case "$targetto" in
+       scp|rcp)
+           cat >$to <<EOF
+#!/bin/sh
+for f in \$@
+do
+  case "\$f" in
+  /*)
+    $targetmkdir \`dirname \$f\`
+    $targetto $q \$f $targetuser@$targethost:\$f            || exit 1
+    ;;
+  *)
+    $targetmkdir $targetdir/\`dirname \$f\`
+    $targetto $q \$f $targetuser@$targethost:$targetdir/\$f || exit 1
+    ;;
+  esac
+done
+exit 0
+EOF
+           ;;
+       cp) cat >$to <<EOF
+#!/bin/sh
+for f in \$@
+do
+  case "\$f" in
+  /*)
+    $mkdir -p $targetdir/\`dirname \$f\`
+    $cp \$f $targetdir/\$f || exit 1
+    ;;
+  *)
+    $targetmkdir $targetdir/\`dirname \$f\`
+    $cp \$f $targetdir/\$f || exit 1
+    ;;
+  esac
+done
+exit 0
+EOF
+           ;;
+       *)  echo "Unknown targetto '$targetto'" >&4
+           exit 1
+           ;;
+       esac
+       case "$targetfrom" in
+       scp|rcp)
+         cat >$from <<EOF
+#!/bin/sh
+for f in \$@
+do
+  $rm -f \$f
+  $targetfrom $q $targetuser@$targethost:$targetdir/\$f . || exit 1
+done
+exit 0
+EOF
+           ;;
+       cp) cat >$from <<EOF
+#!/bin/sh
+for f in \$@
+do
+  $rm -f \$f
+  cp $targetdir/\$f . || exit 1
+done
+exit 0
+EOF
+           ;;
+       *)  echo "Unknown targetfrom '$targetfrom'" >&4
+           exit 1
+           ;;
+       esac
+       if $test ! -f $run; then
+           echo "Target 'run' script '$run' not found." >&4
+       else
+           $chmod a+rx $run
+       fi
+       if $test ! -f $to; then
+           echo "Target 'to' script '$to' not found." >&4
+       else
+           $chmod a+rx $to
+       fi
+       if $test ! -f $from; then
+           echo "Target 'from' script '$from' not found." >&4
+       else
+           $chmod a+rx $from
+       fi
+       if $test ! -f $run -o ! -f $to -o ! -f $from; then
+           exit 1
+       fi
+       cat >&4 <<EOF
+Using '$run' for remote execution,
+and '$from' and '$to'
+for remote file transfer.
+EOF
+       ;;
+*)     run=''
+       to=:
+       from=:
+       usecrosscompile='undef'
+       targetarch=''
+       ;;
+esac
+
 : see whether [:lower:] and [:upper:] are supported character classes
 echo " "
 case "`echo AbyZ | $tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
@@ -2453,6 +2812,7 @@ EOM
        $test -d /usr/apollo/bin && osname=apollo
        $test -f /etc/saf/_sactab && osname=svr4
        $test -d /usr/include/minix && osname=minix
+       $test -f /system/gnu_library/bin/ar.pm && osname=vos
        if $test -d /MachTen -o -d /MachTen_Folder; then
                osname=machten
                if $test -x /sbin/version; then
@@ -2625,9 +2985,11 @@ EOM
                unixware) osname=svr5
                        osvers="$4"
                        ;;
-               uts) osname=uts
+               uts)    osname=uts
                        osvers="$3"
                        ;;
+               vos) osvers="$3"
+                       ;;
                $2) case "$osname" in
                        *isc*) ;;
                        *freebsd*) ;;
@@ -2697,6 +3059,14 @@ EOM
                fi
        fi
        
+        case "$targetarch" in
+        '') ;;
+        *)  hostarch=$osname
+            osname=`echo $targetarch|sed 's,^[^-]*-,,'`
+            osvers=''
+            ;;
+        esac
+
        : Now look for a hint file osname_osvers, unless one has been
        : specified already.
        case "$hintfile" in
@@ -2771,7 +3141,7 @@ EOM
                elif $test -f $src/hints/$file.sh; then
                        . $src/hints/$file.sh
                        $cat $src/hints/$file.sh >> UU/config.sh
-               elif $test X$tans = X -o X$tans = Xnone ; then
+               elif $test X"$tans" = X -o X"$tans" = Xnone ; then
                        : nothing
                else
                        : Give one chance to correct a possible typo.
@@ -2945,8 +3315,9 @@ experimental.  This arrangement exists to help developers work out
 which one is better.
 
 If you're a casual user, you probably don't want interpreter-threads
-at this time.  There doesn't yet exist a way to create threads from
-within Perl in this model, i.e., "use Thread;" will NOT work.
+at this time.  But if you do, the 'threads' module allows their use,
+and the 'Thread' module offers an interface to both 5005threads and
+ithreads (whichever has been configured).
 EOM
        : Default to ithreads unless overridden on command line or with
        : old config.sh
@@ -3048,6 +3419,17 @@ esac
 set usemultiplicity
 eval $setvar
 
+
+case "$usemorebits" in
+"$define"|true|[yY]*)
+       use64bitint="$define"
+       uselongdouble="$define"
+       usemorebits="$define"
+       ;;
+*)     usemorebits="$undef"
+       ;;
+esac
+
 : make some quick guesses about what we are up against
 echo " "
 $echo $n "Hmm...  $c"
@@ -3160,7 +3542,7 @@ fi
 
 echo " "
 echo "Checking for GNU cc in disguise and/or its version number..." >&4
-$cat >gccvers.c <<EOM
+$cat >try.c <<EOM
 #include <stdio.h>
 int main() {
 #ifdef __GNUC__
@@ -3173,8 +3555,8 @@ int main() {
        exit(0);
 }
 EOM
-if $cc -o gccvers $ccflags $ldflags gccvers.c; then
-       gccversion=`./gccvers`
+if $cc -o try $ccflags $ldflags try.c; then
+       gccversion=`$run ./try`
        case "$gccversion" in
        '') echo "You are not using GNU cc." ;;
        *)  echo "You are using GNU cc $gccversion."
@@ -3192,7 +3574,7 @@ else
                ;;
        esac
 fi
-$rm -f gccvers*
+$rm -f try try.*
 case "$gccversion" in
 1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
 esac
@@ -3231,226 +3613,70 @@ case "$ccname" in
 '') ccname="$cc" ;;
 esac
 
-case "$gccversion" in
-'') ;;
-*)  case "$ccflags" in
-    *-Wall*) ;;
-    *) ccflags="$ccflags -Wall" ;;
-    esac
-    ;;
+
+: decide how portable to be.  Allow command line overrides.
+case "$d_portable" in
+"$undef") ;;
+*)     d_portable="$define" ;;
 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
+: set up shell script to do ~ expansion
+cat >filexp <<EOSS
+$startsh
+: expand filename
+case "\$1" in
+ ~/*|~)
+       echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
+       ;;
+ ~*)
+       if $test -f /bin/csh; then
+               /bin/csh -f -c "glob \$1"
+               failed=\$?
+               echo ""
+               exit \$failed
        else
-               echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+               name=\`$expr x\$1 : '..\([^/]*\)'\`
+               dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
+               if $test ! -d "\$dir"; then
+                       me=\`basename \$0\`
+                       echo "\$me: can't locate home directory for: \$name" >&2
+                       exit 1
+               fi
+               case "\$1" in
+               */*)
+                       echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
+                       ;;
+               *)
+                       echo \$dir
+                       ;;
+               esac
        fi
-else
-       echo "Keeping your $hint cppstdin wrapper."
-fi
-chmod 755 cppstdin
-wrapper=`pwd`/cppstdin
-ok='false'
-cd UU
+       ;;
+*)
+       echo \$1
+       ;;
+esac
+EOSS
+chmod +x filexp
+$eunicefix filexp
 
-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
-"$undef") ;;
-*)     d_portable="$define" ;;
-esac
-
-: set up shell script to do ~ expansion
-cat >filexp <<EOSS
-$startsh
-: expand filename
-case "\$1" in
- ~/*|~)
-       echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
-       ;;
- ~*)
-       if $test -f /bin/csh; then
-               /bin/csh -f -c "glob \$1"
-               failed=\$?
-               echo ""
-               exit \$failed
-       else
-               name=\`$expr x\$1 : '..\([^/]*\)'\`
-               dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
-               if $test ! -d "\$dir"; then
-                       me=\`basename \$0\`
-                       echo "\$me: can't locate home directory for: \$name" >&2
-                       exit 1
-               fi
-               case "\$1" in
-               */*)
-                       echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
-                       ;;
-               *)
-                       echo \$dir
-                       ;;
-               esac
-       fi
-       ;;
-*)
-       echo \$1
-       ;;
-esac
-EOSS
-chmod +x filexp
-$eunicefix filexp
-
-: now set up to get a file name
-cat <<EOS >getfile
-$startsh
-EOS
-cat <<'EOSC' >>getfile
-tilde=''
-fullpath=''
-already=''
-skip=''
-none_ok=''
-exp_file=''
-nopath_ok=''
-orig_rp="$rp"
-orig_dflt="$dflt"
-case "$gfpth" in
-'') gfpth='.' ;;
-esac
+: now set up to get a file name
+cat <<EOS >getfile
+$startsh
+EOS
+cat <<'EOSC' >>getfile
+tilde=''
+fullpath=''
+already=''
+skip=''
+none_ok=''
+exp_file=''
+nopath_ok=''
+orig_rp="$rp"
+orig_dflt="$dflt"
+case "$gfpth" in
+'') gfpth='.' ;;
+esac
 
 case "$fn" in
 *\(*)
@@ -3714,85 +3940,233 @@ y)     fn=d/
        ;;
 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=''
-for xxx in $dlist
-do
-    if $test -d $xxx; then
-               case " $libpth " in
-               *" $xxx "*) ;;
-               *) libpth="$libpth $xxx";;
-               esac
-    fi
-done
-$cat <<'EOM'
-
-Some systems have incompatible or broken versions of libraries.  Among
-the directories listed in the question below, please remove any you
-know not to be holding relevant libraries, and add any that are needed.
-Say "none" for none.
-
-EOM
-case "$libpth" in
-'') dflt='none';;
-*)
-       set X $libpth
-       shift
-       dflt=${1+"$@"}
-       ;;
-esac
-rp="Directories to use for library searches?"
-. ./myread
-case "$ans" in
-none) libpth=' ';;
-*) libpth="$ans";;
-esac
-
-: compute shared library extension
-case "$so" in
-'')
-       if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
-               dflt='sl'
+: 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
-               dflt='so'
+               echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
        fi
-       ;;
-*) dflt="$so";;
-esac
-$cat <<EOM
-
-On some systems, shared libraries may be available.  Answer 'none' if
-you want to suppress searching of shared libraries for the remainder
-of this configuration.
-
-EOM
-rp='What is the file extension used for shared libraries?'
-. ./myread
-so="$ans"
+else
+       echo "Keeping your $hint cppstdin wrapper."
+fi
+chmod 755 cppstdin
+wrapper=`pwd`/cppstdin
+ok='false'
+cd UU
 
-: Define several unixisms.
-: Hints files or command line option can be used to override them.
-: The convoluted testing is in case hints files set either the old
-: or the new name.
-case "$_exe" in
-'')    case "$exe_ext" in
-    '')        ;;
-       *)      _exe="$exe_ext" ;;
+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
-       ;;
-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
+
+: Now check and see which directories actually exist, avoiding duplicates
+libpth=''
+for xxx in $dlist
+do
+    if $test -d $xxx; then
+               case " $libpth " in
+               *" $xxx "*) ;;
+               *) libpth="$libpth $xxx";;
+               esac
+    fi
+done
+$cat <<'EOM'
+
+Some systems have incompatible or broken versions of libraries.  Among
+the directories listed in the question below, please remove any you
+know not to be holding relevant libraries, and add any that are needed.
+Say "none" for none.
+
+EOM
+case "$libpth" in
+'') dflt='none';;
+*)
+       set X $libpth
+       shift
+       dflt=${1+"$@"}
+       ;;
+esac
+rp="Directories to use for library searches?"
+. ./myread
+case "$ans" in
+none) libpth=' ';;
+*) libpth="$ans";;
+esac
+
+: compute shared library extension
+case "$so" in
+'')
+       if xxx=`./loc libc.sl X $libpth`; $test -f "$xxx"; then
+               dflt='sl'
+       else
+               dflt='so'
+       fi
+       ;;
+*) dflt="$so";;
+esac
+$cat <<EOM
+
+On some systems, shared libraries may be available.  Answer 'none' if
+you want to suppress searching of shared libraries for the remainder
+of this configuration.
+
+EOM
+rp='What is the file extension used for shared libraries?'
+. ./myread
+so="$ans"
+
+: Define several unixisms.
+: Hints files or command line option can be used to override them.
+: The convoluted testing is in case hints files set either the old
+: or the new name.
+case "$_exe" in
+'')    case "$exe_ext" in
+       '')     ;;
+       *)      _exe="$exe_ext" ;;
+       esac
+       ;;
+esac
 case "$_a" in
 '')    case "$lib_ext" in
     '')        _a='.a';;
@@ -4211,15 +4585,15 @@ $cat >> try.msg <<EOM
 I used the command:
 
        $*
-       ./try
+       $run ./try
 
 and I got the following output:
 
 EOM
 dflt=y
 if $sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
-       if $sh -c './try' >>try.msg 2>&1; then
-               xxx=`./try`
+       if $sh -c "$run ./try" >>try.msg 2>&1; then
+               xxx=`$run ./try`
                case "$xxx" in
                "Ok") dflt=n ;;
                *)      echo 'The program compiled OK, but produced no output.' >> try.msg
        *) dflt=n;;
        esac
        echo " "
-       . ./myread
-       case "$ans" in
-       n*|N*) ;;
-       *)      echo "Ok.  Stopping Configure." >&4
-               exit 1
-               ;;
-       esac
-       ;;
-n) echo "OK, that should do.";;
-esac
-$rm -f try try.* core
-
-: define an is-a-typedef? function
-typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
-       $rm -f temp.c;
-       for inc in $inclist; do
-               echo "#include <$inc>" >>temp.c;
-       done;
-       echo "#ifdef $type" >> temp.c;
-       echo "printf(\"We have $type\");" >> temp.c;
-       echo "#endif" >> temp.c;
-       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
-       if $contains $type temp.E >/dev/null 2>&1; then
-               eval "$var=\$type";
-       else
-               eval "$var=\$def";
-       fi;
-       $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: define an is-a-typedef? function that prompts if the type is not available.
-typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
-       $rm -f temp.c;
-       for inc in $inclist; do
-               echo "#include <$inc>" >>temp.c;
-       done;
-       echo "#ifdef $type" >> temp.c;
-       echo "printf(\"We have $type\");" >> temp.c;
-       echo "#endif" >> temp.c;
-       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
-       echo " " ;
-       echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
-       if $contains $type temp.E >/dev/null 2>&1; then
-               echo "$type found." >&4;
-               eval "$var=\$type";
-       else
-               echo "$type NOT found." >&4;
-               dflt="$def";
-               . ./myread ;
-               eval "$var=\$ans";
-       fi;
-       $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: define a shorthand compile call
-compile='
-mc_file=$1;
-shift;
-$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
-: define a shorthand compile call for compilations that should be ok.
-compile_ok='
-mc_file=$1;
-shift;
-$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
-
-: check for lengths of integral types
-echo " "
-case "$intsize" in
-'')
-       echo "Checking to see how big your integers are..." >&4
-       $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("intsize=%d;\n", (int)sizeof(int));
-       printf("longsize=%d;\n", (int)sizeof(long));
-       printf("shortsize=%d;\n", (int)sizeof(short));
-       exit(0);
-}
-EOCP
-       set intsize
-       if eval $compile_ok && ./intsize > /dev/null; then
-               eval `./intsize`
-               echo "Your integers are $intsize bytes long."
-               echo "Your long integers are $longsize bytes long."
-               echo "Your short integers are $shortsize bytes long."
-       else
-               $cat >&4 <<EOM
-!
-Help! I can't compile and run the intsize test program: please enlighten me!
-(This is probably a misconfiguration in your system or libraries, and
-you really ought to fix it.  Still, I'll try anyway.)
-!
-EOM
-               dflt=4
-               rp="What is the size of an integer (in bytes)?"
-               . ./myread
-               intsize="$ans"
-               dflt=$intsize
-               rp="What is the size of a long integer (in bytes)?"
-               . ./myread
-               longsize="$ans"
-               dflt=2
-               rp="What is the size of a short integer (in bytes)?"
-               . ./myread
-               shortsize="$ans"
-       fi
-       ;;
-esac
-$rm -f intsize intsize.*
-
-: see what type lseek is declared as in the kernel
-rp="What is the type used for lseek's offset on this system?"
-set off_t lseektype long stdio.h sys/types.h
-eval $typedef_ask
-
-echo " "
-echo "Checking to see how big your file offsets are..." >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
-    printf("%d\n", (int)sizeof($lseektype));
-    return(0); 
-}
-EOCP
-set try
-if eval $compile_ok; then
-       lseeksize=`./try`
-       echo "Your file offsets are $lseeksize bytes long."
-else
-       dflt=$longsize
-       echo " "
-       echo "(I can't seem to compile the test program.  Guessing...)"
-       rp="What is the size of your file offsets (in bytes)?"
-       . ./myread
-       lseeksize="$ans"
-fi
-$rm -f try.c try
-
-: see what type file positions are declared as in the library
-rp="What is the type for file position used by fsetpos()?"
-set fpos_t fpostype long stdio.h sys/types.h
-eval $typedef_ask
-
-echo " "
-case "$fpostype" in
-*_t) zzz="$fpostype"   ;;
-*)   zzz="fpos_t"      ;;
-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($fpostype));
-    exit(0);
-}
-EOCP
-set try
-if eval $compile_ok; then
-       yyy=`./try`
-       case "$yyy" in
-       '')     fpossize=4
-               echo "(I can't execute the test program--guessing $fpossize.)" >&4
-               ;;
-       *)      fpossize=$yyy
-               echo "Your $zzz is $fpossize bytes long."
-               ;;
-       esac
-else
-       dflt="$longsize"
-       echo " " >&4
-       echo "(I can't compile the test program.  Guessing...)" >&4
-       rp="What is the size of your file positions (in bytes)?"
-       . ./myread
-       fpossize="$ans"
-fi
-
-
-
-# Backward compatibility (uselfs is deprecated).
-case "$uselfs" in
-"$define"|true|[yY]*)
-       cat <<EOM >&4
-
-*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
-EOM
-       uselargefiles="$define"
-       ;;
-esac                          
-
-case "$lseeksize:$fpossize" in
-8:8) cat <<EOM
-
-You can have files larger than 2 gigabytes.
-EOM
-   val="$define" ;;
-*)    case "$uselargefiles" in
-   "$undef"|false|[nN]*) dflt='n' ;;
-   *)  dflt='y' ;;
-   esac
-   cat <<EOM
-
-Perl can be built to understand large files (files larger than 2 gigabytes)
-on some systems.  To do so, Configure can be run with -Duselargefiles.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
-   rp='Try to understand large files, if available?'
-   . ./myread
-   case "$ans" in
-   y|Y)        val="$define" ;;
-   *)          val="$undef"  ;;
-   esac
-   ;;
-esac
-set uselargefiles
-eval $setvar
-case "$uselargefiles" in
-"$define")
-: 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 uselargefiles.cbu; then
-               echo "Your platform has some specific hints for large file builds, using them..."
-               . ./uselargefiles.cbu
-               echo " "
-               echo "Rechecking to see how big your file offsets are..." >&4
-               $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main()
-{
-    printf("%d\n", (int)sizeof($lseektype));
-    return(0); 
-}
-EOCP
-               set try
-               if eval $compile_ok; then
-                       lseeksize=`./try`
-                       $echo "Your file offsets are now $lseeksize bytes long."
-               else
-                       dflt="$lseeksize"
-                       echo " "
-                       echo "(I can't seem to compile the test program.  Guessing...)"
-                       rp="What is the size of your file offsets (in bytes)?"
-                       . ./myread
-                       lseeksize="$ans"
-               fi
-               case "$fpostype" in
-               *_t) zzz="$fpostype"    ;;
-               *)   zzz="fpos_t"       ;;
-               esac
-               $echo $n "Rechecking the size of $zzz...$c" >&4 
-               $cat > try.c <<EOCP
-#include <sys/types.h>
-#include <stdio.h>
-int main() {
-    printf("%d\n", (int)sizeof($fpostype));
-    exit(0);
-}
-EOCP
-               set try
-               if eval $compile_ok; then
-                       yyy=`./try`
-                       dflt="$lseeksize"
-                       case "$yyy" in
-                       '')     echo " "
-                               echo "(I can't execute the test program--guessing $fpossize.)" >&4
-                               ;;
-                       *)      fpossize=$yyy
-                               echo " $fpossize bytes." >&4
-                               ;;
-                       esac
-               else
-                       dflt="$fpossize"
-                       echo " "
-                       echo "(I can't compile the test program.  Guessing...)" >&4
-                       rp="What is the size of your file positions (in bytes)?"
-                       . ./myread
-                       fpossize="$ans"
-               fi
-               $rm -f try.c try
-       fi
+       . ./myread
+       case "$ans" in
+       n*|N*) ;;
+       *)      echo "Ok.  Stopping Configure." >&4
+               exit 1
+               ;;
+       esac
        ;;
+n) echo "OK, that should do.";;
 esac
+$rm -f try try.* core
 
+: define a shorthand compile call
+compile='
+mc_file=$1;
+shift;
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
+: define a shorthand compile call for compilations that should be ok.
+compile_ok='
+mc_file=$1;
+shift;
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
 
-case "$usemorebits" in
-"$define"|true|[yY]*)
-       use64bitint="$define"
-       uselongdouble="$define"
-       usemorebits="$define"
-       ;;
-*)     usemorebits="$undef"
+: check for lengths of integral types
+echo " "
+case "$intsize" in
+'')
+       echo "Checking to see how big your integers are..." >&4
+       $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+       printf("intsize=%d;\n", (int)sizeof(int));
+       printf("longsize=%d;\n", (int)sizeof(long));
+       printf("shortsize=%d;\n", (int)sizeof(short));
+       exit(0);
+}
+EOCP
+       set try
+       if eval $compile_ok && $run ./try > /dev/null; then
+               eval `$run ./try`
+               echo "Your integers are $intsize bytes long."
+               echo "Your long integers are $longsize bytes long."
+               echo "Your short integers are $shortsize bytes long."
+       else
+               $cat >&4 <<EOM
+!
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it.  Still, I'll try anyway.)
+!
+EOM
+               dflt=4
+               rp="What is the size of an integer (in bytes)?"
+               . ./myread
+               intsize="$ans"
+               dflt=$intsize
+               rp="What is the size of a long integer (in bytes)?"
+               . ./myread
+               longsize="$ans"
+               dflt=2
+               rp="What is the size of a short integer (in bytes)?"
+               . ./myread
+               shortsize="$ans"
+       fi
        ;;
 esac
+$rm -f try try.*
 
 : check for void type
 echo " "
@@ -4683,7 +4812,7 @@ int main()
 EOCP
        set try
        if eval $compile_ok; then
-               ptrsize=`./try`
+               ptrsize=`$run ./try`
                echo "Your pointers are $ptrsize bytes long."
        else
                dflt='4'
@@ -4727,7 +4856,7 @@ int main()
 EOCP
        set try
        if eval $compile_ok; then
-               longlongsize=`./try$exe_ext`
+               longlongsize=`$run ./try`
                echo "Your long longs are $longlongsize bytes long."
        else
                dflt='8'
@@ -4747,6 +4876,10 @@ $rm -f try.* try
 : determine filename position in cpp output
 echo " "
 echo "Computing filename position in cpp output for #include directives..." >&4
+case "$osname" in
+vos) testaccess=-e ;;
+*)   testaccess=-r ;;
+esac
 echo '#include <stdio.h>' > foo.c
 $cat >fieldn <<EOF
 $startsh
@@ -4756,7 +4889,7 @@ while read cline; do
        pos=1
        set \$cline
        while $test \$# -gt 0; do
-               if $test -r \`echo \$1 | $tr -d '"'\`; then
+               if $test $testaccess \`echo \$1 | $tr -d '"'\`; then
                        echo "\$pos"
                        exit 0
                fi
@@ -4777,6 +4910,10 @@ case $fieldn in
 esac
 echo "Your cpp writes the filename in the $pos field of the line."
 
+case "$osname" in
+vos) cppfilter="tr '\\\\>' '/' |" ;; # path component separator is >
+*)   cppfilter='' ;;
+esac
 : locate header file
 $cat >findhdr <<EOF
 $startsh
@@ -4792,7 +4929,7 @@ done
 awkprg='{ print \$$fieldn }'
 echo "#include <\$wanted>" > foo\$\$.c
 $cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
-$grep "^[      ]*#.*\$wanted" | \
+$cppfilter $grep "^[   ]*#.*\$wanted" | \
 while read cline; do
        name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
        case "\$name" in
@@ -5150,7 +5287,7 @@ esac
 
 echo " "
 echo "Checking for GNU C Library..." >&4
-cat >gnulibc.c <<EOM
+cat >try.c <<EOM
 #include <stdio.h>
 int main()
 {
@@ -5161,15 +5298,15 @@ int main()
 #endif
 }
 EOM
-set gnulibc
-if eval $compile_ok && ./gnulibc; then
+set try
+if eval $compile_ok && $run ./try; then
        val="$define"
        echo "You are using the GNU C Library"
 else
        val="$undef"
        echo "You are not using the GNU C Library"
 fi
-$rm -f gnulibc*
+$rm -f try try.*
 set d_gnulibc
 eval $setvar
 
@@ -5275,7 +5412,6 @@ case "$libc" in
        esac
        ;;
 esac
-libnames='';
 case "$libs" in
 '') ;;
 *)  for thislib in $libs; do
@@ -5537,7 +5673,7 @@ nm_extract="$com"
 if $test -f /lib/syscalls.exp; then
        echo " "
        echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
-       $sed -n 's/^\([^        ]*\)[   ]*syscall[0-9]*$/\1/p' /lib/syscalls.exp >>libc.list
+       $sed -n 's/^\([^        ]*\)[   ]*syscall[0-9]*[        ]*$/\1/p' /lib/syscalls.exp >>libc.list
 fi
 ;;
 esac
@@ -5682,7 +5818,7 @@ int main()
 EOCP
        set try
        if eval $compile_ok; then
-               doublesize=`./try`
+               doublesize=`$run ./try`
                echo "Your double is $doublesize bytes long."
        else
                dflt='8'
@@ -5726,7 +5862,7 @@ EOCP
        set try
        set try
        if eval $compile; then
-               longdblsize=`./try$exe_ext`
+               longdblsize=`$run ./try`
                echo "Your long doubles are $longdblsize bytes long."
        else
                dflt='8'
@@ -5810,6 +5946,10 @@ case "$myarchname" in
        archname=''
        ;;
 esac
+case "$targetarch" in
+'') ;;
+*)  archname=`echo $targetarch|sed 's,^[^-]*-,,'` ;;
+esac
 myarchname="$tarch"
 case "$archname" in
 '') dflt="$tarch";;
@@ -5870,7 +6010,7 @@ $define)
        echo "Long doubles selected." >&4
        case "$longdblsize" in
        $doublesize)
-               "...but long doubles are equal to doubles, not changing architecture name." >&4
+               echo "...but long doubles are equal to doubles, not changing architecture name." >&4
                ;;
        *)
                case "$archname" in
@@ -6018,7 +6158,6 @@ prefixit='case "$3" in
        esac;;
 esac'
 
-
 : get the patchlevel
 echo " "
 echo "Getting the current patchlevel..." >&4
@@ -6045,11 +6184,15 @@ if $test -r $rsrc/.patch ; then
                perl_patchlevel=`cat $rsrc/.patch`
        fi
 fi
+: Define a handy string here to avoid duplication in myconfig.SH and configpm.
+version_patchlevel_string="version $patchlevel subversion $subversion"
 case "$perl_patchlevel" in
-0)  ;;
-'') $echo "(You have $package version $patchlevel subversion $subversion.)" ;;
-*)  $echo "(You have $package version $patchlevel subversion $subversion patchlevel $perl_patchlevel.)" ;;
+0|'') ;;
+*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
 esac
+
+$echo "(You have $package $version_patchlevel_string.)"
+
 case "$osname" in
 dos|vms)
        : XXX Should be a Configure test for double-dots in filenames.
@@ -6282,7 +6425,7 @@ val="$undef"
 case "$d_suidsafe" in
 "$define")
        val="$undef"
-       echo "No need to emulate SUID scripts since they are secure here." >& 4
+       echo "No need to emulate SUID scripts since they are secure here." >&4
        ;;
 *)
        $cat <<EOM
@@ -6716,6 +6859,58 @@ else
        installbin="$binexp"
 fi
 
+echo " "
+case "$extras" in
+'') dflt='n';;
+*) dflt='y';;
+esac
+cat <<EOM
+Perl can be built with extra modules or bundles of modules which
+will be fetched from the CPAN and installed alongside Perl.
+
+Notice that you will need access to the CPAN; either via the Internet,
+or a local copy, for example a CD-ROM or a local CPAN mirror.  (You will
+be asked later to configure the CPAN.pm module which will in turn do
+the installation of the rest of the extra modules or bundles.)
+
+Notice also that if the modules require any external software such as
+libraries and headers (the libz library and the zlib.h header for the
+Compress::Zlib module, for example) you MUST have any such software
+already installed, this configuration process will NOT install such
+things for you.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Install any extra modules (y or n)?'
+. ./myread
+case "$ans" in
+y|Y)
+       cat <<EOM
+
+Please list any extra modules or bundles to be installed from CPAN,
+with spaces between the names.  The names can be in any format the
+'install' command of CPAN.pm will understand.  (Answer 'none',
+without the quotes, to install no extra modules or bundles.)
+EOM
+       rp='Extras?'
+       dflt="$extras"
+       . ./myread
+       extras="$ans"
+esac
+case "$extras" in
+''|'none')
+       val=''
+       $rm -f ../extras.lst
+       ;;
+*)     echo "(Saving the list of extras for later...)"
+       echo "$extras" > ../extras.lst
+       val="'$extras'"
+       ;;
+esac
+set extras
+eval $setvar
+echo " "
+
 : Find perl5.005 or later.
 echo "Looking for a previously installed perl5.005 or later... "
 case "$perl5" in
@@ -6948,6 +7143,7 @@ EOM
                    esac
                        ;;
                *)  case "$osname" in
+                       darwin) dflt='none' ;;
                        svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
                        *)      dflt='-fpic' ;;
                    esac ;;
@@ -6984,7 +7180,7 @@ int main() {
                exit(1); /* fail */
 }
 EOM
-               if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && ./a.out; then
+               if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
                        cat <<EOM
 You appear to have ELF support.  I'll use $cc to build dynamic libraries.
 EOM
@@ -7038,7 +7234,7 @@ EOM
        esac
        for thisflag in $ldflags; do
                case "$thisflag" in
-               -L*|-R*)
+               -L*|-R*|-Wl,-R*)
                        case " $dflt " in
                        *" $thisflag "*) ;;
                        *) dflt="$dflt $thisflag" ;;
@@ -7247,10 +7443,10 @@ if "$useshrplib"; then
        aix)
                # We'll set it in Makefile.SH...
                ;;
-       solaris|netbsd)
+       solaris)
                xxx="-R $shrpdir"
                ;;
-       freebsd)
+       freebsd|netbsd)
                xxx="-Wl,-R$shrpdir"
                ;;
        linux|irix*|dec_osf)
@@ -7308,8 +7504,9 @@ esac
 echo " "
 case "$sysman" in
 '') 
-       syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
-       syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
+       syspath='/usr/share/man/man1 /usr/man/man1'
+       syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+       syspath="$syspath /usr/man/u_man/man1"
        syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
        syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
        syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
@@ -7341,7 +7538,8 @@ case "$man1dir" in
 ' ') dflt=none
        ;;
 '')
-       lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
+       lookpath="$prefixexp/share/man/man1"
+       lookpath="$lookpath $prefixexp/man/man1 $prefixexp/man/l_man/man1"
        lookpath="$lookpath $prefixexp/man/p_man/man1"
        lookpath="$lookpath $prefixexp/man/u_man/man1"
        lookpath="$lookpath $prefixexp/man/man.1"
@@ -7531,7 +7729,7 @@ case "$man3dir" in
 esac
 
 : see if we have to deal with yellow pages, now NIS.
-if $test -d /usr/etc/yp || $test -d /etc/yp; then
+if $test -d /usr/etc/yp || $test -d /etc/yp || $test -d /usr/lib/yp; then
        if $test -f /usr/etc/nibindd; then
                echo " "
                echo "I'm fairly confident you're on a NeXT."
@@ -7900,7 +8098,10 @@ echo "I'll use $startperl to start perl scripts."
 : figure best path for perl in scripts
 case "$perlpath" in
 '')
-       perlpath="$binexp/perl"
+       case "$versiononly" in
+       "$define")      perlpath="$binexp/perl$version";;
+       *)              perlpath="$binexp/perl";;
+       esac
        case "$startperl" in
        *!*) ;;
        *)
@@ -7966,22 +8167,256 @@ else
        installscript="$scriptdirexp"
 fi
 
-: determine where add-on public executables go
-case "$sitebin" in
-'')    dflt=$siteprefix/bin ;;
-*)     dflt=$sitebin ;;
+: determine where add-on public executables go
+case "$sitebin" in
+'')    dflt=$siteprefix/bin ;;
+*)     dflt=$sitebin ;;
+esac
+fn=d~
+rp='Pathname where the add-on public executables should be installed?'
+. ./getfile
+sitebin="$ans"
+sitebinexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
+else
+       installsitebin="$sitebinexp"
+fi
+
+: define an is-a-typedef? function
+typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+       $rm -f temp.c;
+       for inc in $inclist; do
+               echo "#include <$inc>" >>temp.c;
+       done;
+       echo "#ifdef $type" >> temp.c;
+       echo "printf(\"We have $type\");" >> temp.c;
+       echo "#endif" >> temp.c;
+       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+       if $contains $type temp.E >/dev/null 2>&1; then
+               eval "$var=\$type";
+       else
+               eval "$var=\$def";
+       fi;
+       $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
+
+: define an is-a-typedef? function that prompts if the type is not available.
+typedef_ask='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+       $rm -f temp.c;
+       for inc in $inclist; do
+               echo "#include <$inc>" >>temp.c;
+       done;
+       echo "#ifdef $type" >> temp.c;
+       echo "printf(\"We have $type\");" >> temp.c;
+       echo "#endif" >> temp.c;
+       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+       echo " " ;
+       echo "$rp" | $sed -e "s/What is/Looking for/" -e "s/?/./";
+       if $contains $type temp.E >/dev/null 2>&1; then
+               echo "$type found." >&4;
+               eval "$var=\$type";
+       else
+               echo "$type NOT found." >&4;
+               dflt="$def";
+               . ./myread ;
+               eval "$var=\$ans";
+       fi;
+       $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
+
+: see what type lseek is declared as in the kernel
+rp="What is the type used for lseek's offset on this system?"
+set off_t lseektype long stdio.h sys/types.h
+eval $typedef_ask
+
+echo " "
+echo "Checking to see how big your file offsets are..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+    printf("%d\n", (int)sizeof($lseektype));
+    return(0); 
+}
+EOCP
+set try
+if eval $compile_ok; then
+       lseeksize=`$run ./try`
+       echo "Your file offsets are $lseeksize bytes long."
+else
+       dflt=$longsize
+       echo " "
+       echo "(I can't seem to compile the test program.  Guessing...)"
+       rp="What is the size of your file offsets (in bytes)?"
+       . ./myread
+       lseeksize="$ans"
+fi
+$rm -f try.c try
+
+: see what type file positions are declared as in the library
+rp="What is the type for file position used by fsetpos()?"
+set fpos_t fpostype long stdio.h sys/types.h
+eval $typedef_ask
+
+echo " "
+case "$fpostype" in
+*_t) zzz="$fpostype"   ;;
+*)   zzz="fpos_t"      ;;
+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($fpostype));
+    exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+       yyy=`$run ./try`
+       case "$yyy" in
+       '')     fpossize=4
+               echo "(I can't execute the test program--guessing $fpossize.)" >&4
+               ;;
+       *)      fpossize=$yyy
+               echo "Your $zzz is $fpossize bytes long."
+               ;;
+       esac
+else
+       dflt="$longsize"
+       echo " " >&4
+       echo "(I can't compile the test program.  Guessing...)" >&4
+       rp="What is the size of your file positions (in bytes)?"
+       . ./myread
+       fpossize="$ans"
+fi
+
+
+
+# Backward compatibility (uselfs is deprecated).
+case "$uselfs" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
+EOM
+       uselargefiles="$define"
+       ;;
+esac                          
+
+case "$lseeksize:$fpossize" in
+8:8) cat <<EOM
+
+You can have files larger than 2 gigabytes.
+EOM
+   val="$define" ;;
+*)    case "$uselargefiles" in
+   "$undef"|false|[nN]*) dflt='n' ;;
+   *)  dflt='y' ;;
+   esac
+   cat <<EOM
+
+Perl can be built to understand large files (files larger than 2 gigabytes)
+on some systems.  To do so, Configure can be run with -Duselargefiles.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+   rp='Try to understand large files, if available?'
+   . ./myread
+   case "$ans" in
+   y|Y)        val="$define" ;;
+   *)          val="$undef"  ;;
+   esac
+   ;;
+esac
+set uselargefiles
+eval $setvar
+case "$uselargefiles" in
+"$define")
+: 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 uselargefiles.cbu; then
+               echo "Your platform has some specific hints for large file builds, using them..."
+               . ./uselargefiles.cbu
+               echo " "
+               echo "Rechecking to see how big your file offsets are..." >&4
+               $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main()
+{
+    printf("%d\n", (int)sizeof($lseektype));
+    return(0); 
+}
+EOCP
+               set try
+               if eval $compile_ok; then
+                       lseeksize=`$run ./try`
+                       $echo "Your file offsets are now $lseeksize bytes long."
+               else
+                       dflt="$lseeksize"
+                       echo " "
+                       echo "(I can't seem to compile the test program.  Guessing...)"
+                       rp="What is the size of your file offsets (in bytes)?"
+                       . ./myread
+                       lseeksize="$ans"
+               fi
+               case "$fpostype" in
+               *_t) zzz="$fpostype"    ;;
+               *)   zzz="fpos_t"       ;;
+               esac
+               $echo $n "Rechecking the size of $zzz...$c" >&4 
+               $cat > try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+    printf("%d\n", (int)sizeof($fpostype));
+    exit(0);
+}
+EOCP
+               set try
+               if eval $compile_ok; then
+                       yyy=`$run ./try`
+                       dflt="$lseeksize"
+                       case "$yyy" in
+                       '')     echo " "
+                               echo "(I can't execute the test program--guessing $fpossize.)" >&4
+                               ;;
+                       *)      fpossize=$yyy
+                               echo " $fpossize bytes." >&4
+                               ;;
+                       esac
+               else
+                       dflt="$fpossize"
+                       echo " "
+                       echo "(I can't compile the test program.  Guessing...)" >&4
+                       rp="What is the size of your file positions (in bytes)?"
+                       . ./myread
+                       fpossize="$ans"
+               fi
+               $rm -f try.c try
+       fi
+       ;;
 esac
-fn=d~
-rp='Pathname where the add-on public executables should be installed?'
-. ./getfile
-sitebin="$ans"
-sitebinexp="$ansexp"
-: Change installation prefix, if necessary.
-if $test X"$prefix" != X"$installprefix"; then
-       installsitebin=`echo $sitebinexp | sed "s#^$prefix#$installprefix#"`
-else
-       installsitebin="$sitebinexp"
-fi
 
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
@@ -8029,7 +8464,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                123.456)
                        sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
@@ -8051,7 +8486,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                123.456)
                        sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
@@ -8073,7 +8508,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                123.456)
                        sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
@@ -8095,7 +8530,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                123.456)
                        sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
@@ -8238,6 +8673,13 @@ int main()
        Gconvert((DOUBLETYPE)123.456, 8, 0, buf); 
        checkit("123.456", buf);
 
+        /* Testing of 1e+129 in bigintpm.t must not get extra '.' here. */
+        Gconvert((DOUBLETYPE)1e30, 8, 0, buf);
+        if (strlen(buf) > 5)
+            checkit("1e+030", buf); /* for Microsoft */
+        else
+            checkit("1e+30", buf);
+
        exit(0);
 }
 EOP
@@ -8265,7 +8707,7 @@ for xxx_convert in $xxx_list; do
        set try -DTRY_$xxx_convert
        if eval $compile; then
                echo "$xxx_convert() found." >&4
-               if ./try; then
+               if $run ./try; then
                        echo "I'll use $xxx_convert to convert floats into a string." >&4
                        break;
                else
@@ -8399,7 +8841,7 @@ case "$d_getpgrp" in
 "$define")
        echo " "
        echo "Checking to see which flavor of getpgrp is in use..."
-       $cat >set.c <<EOP
+       $cat >try.c <<EOP
 #$i_unistd I_UNISTD
 #include <sys/types.h>
 #ifdef I_UNISTD
@@ -8421,10 +8863,10 @@ int main()
        exit(1);
 }
 EOP
-       if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
+       if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
                echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
                val="$define"
-       elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
+       elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
                echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
                val="$undef"
        else
@@ -8451,7 +8893,7 @@ EOP
 esac
 set d_bsdgetpgrp
 eval $setvar
-$rm -f set set.c
+$rm -f try try.*
 
 : see if setpgrp exists
 set setpgrp d_setpgrp
@@ -8461,7 +8903,7 @@ case "$d_setpgrp" in
 "$define")
        echo " "
        echo "Checking to see which flavor of setpgrp is in use..."
-       $cat >set.c <<EOP
+       $cat >try.c <<EOP
 #$i_unistd I_UNISTD
 #include <sys/types.h>
 #ifdef I_UNISTD
@@ -8483,10 +8925,10 @@ int main()
        exit(1);
 }
 EOP
-       if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
+       if $cc -o try -DTRY_BSD_PGRP $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
                echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
                val="$define"
-       elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
+       elif $cc -o try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
                echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
                val="$undef"
        else
@@ -8513,7 +8955,7 @@ EOP
 esac
 set d_bsdsetpgrp
 eval $setvar
-$rm -f set set.c
+$rm -f try try.*
 : see if bzero exists
 set bzero d_bzero
 eval $inlibc
@@ -8603,7 +9045,7 @@ int main()
 EOCP
 set try
 if eval $compile_ok; then
-       ./try
+       $run ./try
        yyy=$?
 else
        echo "(I can't seem to compile the test program--assuming it can't)"
@@ -8699,7 +9141,7 @@ int main()
 EOCP
 set try
 if eval $compile_ok; then
-       ./try
+       $run ./try
        castflags=$?
 else
        echo "(I can't seem to compile the test program--assuming it can't)"
@@ -8722,7 +9164,7 @@ echo " "
 if set vprintf val -f d_vprintf; eval $csym; $val; then
        echo 'vprintf() found.' >&4
        val="$define"
-       $cat >vprintf.c <<'EOF'
+       $cat >try.c <<'EOF'
 #include <varargs.h>
 
 int main() { xxx("foo"); }
@@ -8737,8 +9179,8 @@ va_dcl
        exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
 }
 EOF
-       set vprintf
-       if eval $compile && ./vprintf; then
+       set try
+       if eval $compile && $run ./try; then
                echo "Your vsprintf() returns (int)." >&4
                val2="$undef"
        else
@@ -8750,6 +9192,7 @@ else
                val="$undef"
                val2="$undef"
 fi
+$rm -f try try.*
 set d_vprintf
 eval $setvar
 val=$val2
@@ -8768,6 +9211,10 @@ eval $inlibc
 set chsize d_chsize
 eval $inlibc
 
+: see if class exists
+set class d_class
+eval $inlibc
+
 hasstruct='varname=$1; struct=$2; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -8847,7 +9294,7 @@ else
                                                        sockethdr="-I/usr/netinclude"
                                                        ;;
                                                esac
-                                               echo "Found Berkeley sockets interface in lib$net." >& 
+                                               echo "Found Berkeley sockets interface in lib$net." >&4 
                                                if $contains setsockopt libc.list >/dev/null 2>&1; then
                                                        d_oldsock="$undef"
                                                else
@@ -8873,7 +9320,7 @@ eval $inlibc
 
 
 echo " "
-echo "Checking the availability of certain socket constants..." >& 4
+echo "Checking the availability of certain socket constants..." >&4
 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
        enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
        $cat >try.c <<EOF
@@ -8929,36 +9376,42 @@ eval $setvar
 
 : see if crypt exists
 echo " "
-if set crypt val -f d_crypt; eval $csym; $val; then
-       echo 'crypt() found.' >&4
-       val="$define"
-       cryptlib=''
-else
-       cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               cryptlib=`./loc libcrypt$_a "" $libpth`
-       else
-               cryptlib=-lcrypt
-       fi
-       if $test -z "$cryptlib"; then
-               echo 'crypt() NOT found.' >&4
-               val="$undef"
-       else
+set crypt d_crypt
+eval $inlibc
+case "$d_crypt" in
+$define) cryptlib='' ;;
+*)     if set crypt val -f d_crypt; eval $csym; $val; then
+               echo 'crypt() found.' >&4
                val="$define"
+               cryptlib=''
+       else
+               cryptlib=`./loc Slibcrypt$_a "" $xlibpth`
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc Mlibcrypt$_a "" $xlibpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc Llibcrypt$_a "" $xlibpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       cryptlib=`./loc libcrypt$_a "" $libpth`
+               else
+                       cryptlib=-lcrypt
+               fi
+               if $test -z "$cryptlib"; then
+                       echo 'crypt() NOT found.' >&4
+                       val="$undef"
+               else
+                       val="$define"
+               fi
        fi
-fi
-set d_crypt
-eval $setvar
+       set d_crypt
+       eval $setvar
+       ;;
+esac
 
 : get csh whereabouts
 case "$csh" in
@@ -9137,6 +9590,63 @@ set d_dirnamlen
 eval $setvar
 $rm -f try.c
 
+: see if this is an sysdir system
+set sys/dir.h i_sysdir
+eval $inhdr
+
+: see if this is an sysndir system
+set sys/ndir.h i_sysndir
+eval $inhdr
+
+: Look for dirfd
+echo " "
+$cat >dirfd.c <<EOM
+#include <stdio.h>
+#$i_dirent I_DIRENT            /**/
+#$i_sysdir I_SYS_DIR           /**/
+#$i_sysndir I_SYS_NDIR         /**/
+#$i_systypes I_SYS_TYPES       /**/
+#if defined(I_SYS_TYPES)
+#include <sys/types.h>
+#endif
+#if defined(I_DIRENT)
+#include <dirent.h>
+#if defined(NeXT) && defined(I_SYS_DIR) /* NeXT needs dirent + sys/dir.h */
+#include <sys/dir.h>
+#endif
+#else
+#ifdef I_SYS_NDIR
+#include <sys/ndir.h>
+#else
+#ifdef I_SYS_DIR
+#ifdef hp9000s500
+#include <ndir.h>      /* may be wrong in the future */
+#else
+#include <sys/dir.h>
+#endif
+#endif
+#endif
+#endif 
+int main() {
+       DIR *dirp = opendir(".");
+       if (dirfd(dirp) >= 0)
+               exit(0);
+       else
+               exit(1);
+}
+EOM
+set dirfd
+if eval $compile; then
+       val="$define"
+fi
+case "$val" in
+$define)       echo "dirfd() found." >&4       ;;
+*)             echo "dirfd() NOT found." >&4   ;;
+esac
+set d_dirfd
+eval $setvar
+$rm -f dirfd*
+
 : see if dlerror exists
 xxx_runnm="$runnm"
 runnm=false
@@ -9186,7 +9696,7 @@ $cat >fred.c<<EOM
 #include <stdio.h>
 #$i_dlfcn I_DLFCN
 #ifdef I_DLFCN
-#include <dlfcn.h>      /* the dynamic linker include file for Sunos/Solaris */
+#include <dlfcn.h>      /* the dynamic linker include file for SunOS/Solaris */
 #else
 #include <sys/types.h>
 #include <nlist.h>
@@ -9231,8 +9741,8 @@ EOM
        if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && 
                mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && 
                $ld -o dyna.$dlext $ldflags $lddlflags tmp-dyna${_o} > /dev/null 2>&1 && 
-               $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
-               xxx=`./fred`
+               $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1 && $to dyna.$dlext; then
+               xxx=`$run ./fred`
                case $xxx in
                1)      echo "Test program failed using dlopen." >&4
                        echo "Perhaps you should not use dynamic loading." >&4;;
@@ -9249,7 +9759,7 @@ EOM
        ;;
 esac
                
-$rm -f fred fred.? dyna.$dlext dyna.? tmp-dyna.?
+$rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
 
 set d_dlsymun
 eval $setvar
@@ -9293,7 +9803,7 @@ eval $inlibc
 
 : Locate the flags for 'open()'
 echo " "
-$cat >open3.c <<'EOCP'
+$cat >try.c <<'EOCP'
 #include <sys/types.h>
 #ifdef I_FCNTL
 #include <fcntl.h>
@@ -9312,10 +9822,10 @@ int main() {
 EOCP
 : check sys/file.h first to get FREAD on Sun
 if $test `./findhdr sys/file.h` && \
-               set open3 -DI_SYS_FILE && eval $compile; then
+               set try -DI_SYS_FILE && eval $compile; then
        h_sysfile=true;
        echo "<sys/file.h> defines the O_* constants..." >&4
-       if ./open3; then
+       if $run ./try; then
                echo "and you have the 3 argument form of open()." >&4
                val="$define"
        else
@@ -9323,45 +9833,98 @@ if $test `./findhdr sys/file.h` && \
                val="$undef"
        fi
 elif $test `./findhdr fcntl.h` && \
-               set open3 -DI_FCNTL && eval $compile; then
+               set try -DI_FCNTL && eval $compile; then
        h_fcntl=true;
        echo "<fcntl.h> defines the O_* constants..." >&4
-       if ./open3; then
+       if $run ./try; then
                echo "and you have the 3 argument form of open()." >&4
                val="$define"
        else
-               echo "but not the 3 argument form of open().  Oh, well." >&4
+               echo "but not the 3 argument form of open().  Oh, well." >&4
+               val="$undef"
+       fi
+else
+       val="$undef"
+       echo "I can't find the O_* constant definitions!  You got problems." >&4
+fi
+set d_open3
+eval $setvar
+$rm -f try try.*
+
+: see which of string.h or strings.h is needed
+echo " "
+strings=`./findhdr string.h`
+if $test "$strings" && $test -r "$strings"; then
+       echo "Using <string.h> instead of <strings.h>." >&4
+       val="$define"
+else
+       val="$undef"
+       strings=`./findhdr strings.h`
+       if $test "$strings" && $test -r "$strings"; then
+               echo "Using <strings.h> instead of <string.h>." >&4
+       else
+               echo "No string header found -- You'll surely have problems." >&4
+       fi
+fi
+set i_string
+eval $setvar
+case "$i_string" in
+"$undef") strings=`./findhdr strings.h`;;
+*)       strings=`./findhdr string.h`;;
+esac
+
+: see if this is a sys/file.h system
+val=''
+set sys/file.h val
+eval $inhdr
+
+: do we need to include sys/file.h ?
+case "$val" in
+"$define")
+       echo " "
+       if $h_sysfile; then
+               val="$define"
+               echo "We'll be including <sys/file.h>." >&4
+       else
+               val="$undef"
+               echo "We won't be including <sys/file.h>." >&4
+       fi
+       ;;
+*)
+       h_sysfile=false
+       ;;
+esac
+set i_sysfile
+eval $setvar
+
+: see if fcntl.h is there
+val=''
+set fcntl.h val
+eval $inhdr
+
+: see if we can include fcntl.h
+case "$val" in
+"$define")
+       echo " "
+       if $h_fcntl; then
+               val="$define"
+               echo "We'll be including <fcntl.h>." >&4
+       else
                val="$undef"
+               if $h_sysfile; then
+       echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
+               else
+                       echo "We won't be including <fcntl.h>." >&4
+               fi
        fi
-else
-       val="$undef"
-       echo "I can't find the O_* constant definitions!  You got problems." >&4
-fi
-set d_open3
-eval $setvar
-$rm -f open3*
-
-: see which of string.h or strings.h is needed
-echo " "
-strings=`./findhdr string.h`
-if $test "$strings" && $test -r "$strings"; then
-       echo "Using <string.h> instead of <strings.h>." >&4
-       val="$define"
-else
+       ;;
+*)
+       h_fcntl=false
        val="$undef"
-       strings=`./findhdr strings.h`
-       if $test "$strings" && $test -r "$strings"; then
-               echo "Using <strings.h> instead of <string.h>." >&4
-       else
-               echo "No string header found -- You'll surely have problems." >&4
-       fi
-fi
-set i_string
-eval $setvar
-case "$i_string" in
-"$undef") strings=`./findhdr strings.h`;;
-*)       strings=`./findhdr string.h`;;
+       ;;
 esac
+set i_fcntl
+eval $setvar
 
 : check for non-blocking I/O stuff
 case "$h_sysfile" in
@@ -9378,8 +9941,13 @@ echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
 case "$o_nonblock" in
 '')
        $cat head.c > try.c
-       $cat >>try.c <<'EOCP'
+       $cat >>try.c <<EOCP
 #include <stdio.h>
+#include <stdlib.h>
+#$i_fcntl I_FCNTL
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
 int main() {
 #ifdef O_NONBLOCK
        printf("O_NONBLOCK\n");
@@ -9398,7 +9966,7 @@ int main() {
 EOCP
        set try
        if eval $compile_ok; then
-               o_nonblock=`./try`
+               o_nonblock=`$run ./try`
                case "$o_nonblock" in
                '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
                *) echo "Seems like we can use $o_nonblock.";;
@@ -9421,6 +9989,11 @@ case "$eagain" in
 #include <sys/types.h>
 #include <signal.h>
 #include <stdio.h> 
+#include <stdlib.h> 
+#$i_fcntl I_FCNTL
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
 #define MY_O_NONBLOCK $o_nonblock
 #ifndef errno  /* XXX need better Configure test */
 extern int errno;
@@ -9481,7 +10054,7 @@ int main()
                ret = read(pd[0], buf, 1);      /* Should read EOF */
                alarm(0);
                sprintf(string, "%d\n", ret);
-               write(3, string, strlen(string));
+               write(4, string, strlen(string));
                exit(0);
        }
 
@@ -9495,7 +10068,7 @@ EOCP
        set try
        if eval $compile_ok; then
                echo "$startsh" >mtry
-               echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
+               echo "$run ./try >try.out 2>try.ret 4>try.err || exit 4" >>mtry
                chmod +x mtry
                ./mtry >/dev/null 2>&1
                case $? in
@@ -9557,6 +10130,10 @@ EOCP
 esac
 $rm -f try try.* .out core head.c mtry
 
+: see if fchdir exists
+set fchdir d_fchdir
+eval $inlibc
+
 : see if fchmod exists
 set fchmod d_fchmod
 eval $inlibc
@@ -9571,10 +10148,12 @@ eval $inlibc
 
 echo " "
 : See if fcntl-based locking works.
-$cat >try.c <<'EOCP'
+$cat >try.c <<EOCP
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
+#include <signal.h>
+$signal_t blech(x) int x; { exit(3); }
 int main() {
 #if defined(F_SETLK) && defined(F_SETLKW)
      struct flock flock;
@@ -9583,6 +10162,8 @@ int main() {
      flock.l_type = F_RDLCK;
      flock.l_whence = SEEK_SET;
      flock.l_start = flock.l_len = 0;
+     signal(SIGALRM, blech);
+     alarm(10);
      retval = fcntl(fd, F_SETLK, &flock);
      close(fd);
      (retval < 0 ? exit(2) : exit(0));
@@ -9596,12 +10177,24 @@ case "$d_fcntl" in
 "$define")
        set try
        if eval $compile_ok; then
-               if ./try; then
+               if $run ./try; then
                        echo "Yes, it seems to work."
                        val="$define"
                else
                        echo "Nope, it didn't work."
                        val="$undef"
+                       case "$?" in
+                       3) $cat >&4 <<EOM
+***
+*** I had to forcibly timeout from fcntl(..., F_SETLK, ...).
+*** This is (almost) impossible.
+*** If your NFS lock daemons are not feeling well, something like
+*** this may happen, please investigate.  Cannot continue, aborting.
+***
+EOM
+                               exit 1
+                               ;;
+                       esac
                fi
        else
                echo "I'm unable to compile the test program, so I'll assume not."
@@ -9710,7 +10303,7 @@ $cat <<EOM
 
 Checking to see how well your C compiler handles fd_set and friends ...
 EOM
-$cat >fd_set.c <<EOCP
+$cat >try.c <<EOCP
 #$i_systime I_SYS_TIME
 #$i_sysselct I_SYS_SELECT
 #$d_socket HAS_SOCKET
@@ -9738,12 +10331,12 @@ int main() {
 #endif
 }
 EOCP
-set fd_set -DTRYBITS
+set try -DTRYBITS
 if eval $compile; then
        d_fds_bits="$define"
        d_fd_set="$define"
        echo "Well, your system knows about the normal fd_set typedef..." >&4
-       if ./fd_set; then
+       if $run ./try; then
                echo "and you have the normal fd_set macros (just as I'd expect)." >&4
                d_fd_macros="$define"
        else
@@ -9756,12 +10349,12 @@ else
        $cat <<'EOM'
 Hmm, your compiler has some difficulty with fd_set.  Checking further...
 EOM
-       set fd_set
+       set try
        if eval $compile; then
                d_fds_bits="$undef"
                d_fd_set="$define"
                echo "Well, your system has some sort of fd_set available..." >&4
-               if ./fd_set; then
+               if $run ./try; then
                        echo "and you have the normal fd_set macros." >&4
                        d_fd_macros="$define"
                else
@@ -9777,39 +10370,23 @@ EOM
                d_fd_macros="$undef"
        fi
 fi
-$rm -f fd_set*
+$rm -f try try.*
 
 : see if fgetpos exists
 set fgetpos d_fgetpos
 eval $inlibc
 
-: see if flock exists
-set flock d_flock
+: see if finite exists
+set finite d_finite
 eval $inlibc
 
-: see if this is a sys/file.h system
-val=''
-set sys/file.h val
-eval $inhdr
+: see if finitel exists
+set finitel d_finitel
+eval $inlibc
 
-: do we need to include sys/file.h ?
-case "$val" in
-"$define")
-       echo " "
-       if $h_sysfile; then
-               val="$define"
-               echo "We'll be including <sys/file.h>." >&4
-       else
-               val="$undef"
-               echo "We won't be including <sys/file.h>." >&4
-       fi
-       ;;
-*)
-       h_sysfile=false
-       ;;
-esac
-set i_sysfile
-eval $setvar
+: see if flock exists
+set flock d_flock
+eval $inlibc
 
 : see if prototype for flock is available
 echo " "
@@ -9820,6 +10397,10 @@ eval $hasproto
 set fork d_fork
 eval $inlibc
 
+: see if fp_class exists
+set fp_class d_fp_class
+eval $inlibc
+
 : see if pathconf exists
 set pathconf d_pathconf
 eval $inlibc
@@ -9828,6 +10409,18 @@ eval $inlibc
 set fpathconf d_fpathconf
 eval $inlibc
 
+: see if fpclass exists
+set fpclass d_fpclass
+eval $inlibc
+
+: see if fpclassify exists
+set fpclassify d_fpclassify
+eval $inlibc
+
+: see if fpclassl exists
+set fpclassl d_fpclassl
+eval $inlibc
+
 
 : check for fpos64_t
 echo " "
@@ -10228,10 +10821,6 @@ esac
 set d_htonl
 eval $setvar
 
-: see if iconv exists
-set iconv d_iconv
-eval $inlibc
-
 : index or strchr
 echo " "
 if set index val -f; eval $csym; $val; then
@@ -10294,6 +10883,14 @@ set d_isascii
 eval $setvar
 $rm -f isascii*
 
+: see if isfinite exists
+set isfinite d_isfinite
+eval $inlibc
+
+: see if isinf exists
+set isinf d_isinf
+eval $inlibc
+
 : see if isnan exists
 set isnan d_isnan
 eval $inlibc
@@ -10504,7 +11101,7 @@ EOCP
        esac
        set try
        if eval $compile; then
-               foo=`./try`
+               foo=`$run ./try`
                case "$foo" in
                *" 4294967303.150000 1.150000 4294967302.000000")
                        echo >&4 "Your modfl() is broken for large values."
@@ -10527,7 +11124,7 @@ EOCP
                d_modfl="$undef"
        fi
        case "$osname:$gccversion" in
-       aix:)   $ccflags="saveccflags" ;; # restore
+       aix:)   ccflags="$saveccflags" ;; # restore
        esac
        ;;
 esac
@@ -10611,6 +11208,14 @@ eval $inlibc
 set nice d_nice
 eval $inlibc
 
+: see if this is a langinfo.h system
+set langinfo.h i_langinfo
+eval $inhdr
+
+: see if nl_langinfo exists
+set nl_langinfo d_nl_langinfo
+eval $inlibc
+
 : check for length of character
 echo " "
 case "$charsize" in
@@ -10626,7 +11231,7 @@ int main()
 EOCP
        set try
        if eval $compile_ok; then
-               dflt=`./try`
+               dflt=`$run ./try`
        else
                dflt='1'
                echo "(I can't seem to compile the test program.  Guessing...)"
@@ -10742,7 +11347,7 @@ esac
 case "$i8type" in
 '')    set try -DINT8
        if eval $compile; then
-               case "`./try$exe_ext`" in
+               case "`$run ./try`" in
                int8_t) i8type=int8_t
                        u8type=uint8_t
                        i8size=1
@@ -10775,7 +11380,7 @@ esac
 case "$i16type" in
 '')    set try -DINT16
        if eval $compile; then
-               case "`./try$exe_ext`" in
+               case "`$run ./try`" in
                int16_t)
                        i16type=int16_t
                        u16type=uint16_t
@@ -10817,7 +11422,7 @@ esac
 case "$i32type" in
 '')    set try -DINT32
        if eval $compile; then
-               case "`./try$exe_ext`" in
+               case "`$run ./try`" in
                int32_t)
                        i32type=int32_t
                        u32type=uint32_t
@@ -10896,7 +11501,7 @@ set try
 
 d_nv_preserves_uv="$undef"
 if eval $compile; then
-       d_nv_preserves_uv_bits="`./try$exe_ext`"
+       d_nv_preserves_uv_bits="`$run ./try`"
 fi
 case "$d_nv_preserves_uv_bits" in
 \-[1-9]*)      
@@ -11011,6 +11616,41 @@ eval $inlibc
 set poll d_poll
 eval $inlibc
 
+: see if readlink exists
+set readlink d_readlink
+eval $inlibc
+
+echo " "
+procselfexe=''
+val="$undef"
+case "$d_readlink" in
+"$define")
+       if $issymlink /proc/self/exe ; then
+               $ls -l /proc/self/exe > reflect
+               if $contains /`basename $ls` reflect >/dev/null 2>&1; then
+                       echo "You have Linux-like /proc/self/exe."
+                       procselfexe='"/proc/self/exe"'
+                       val="$define"
+               fi
+       fi
+       if $issymlink /proc/curproc/file ; then
+               $ls -l /proc/curproc/file > reflect
+               if $contains /`basename $ls` reflect >/dev/null 2>&1; then
+                       echo "You have BSD-like /proc/curproc/file."
+                       procselfexe='"/proc/curproc/file"'
+                       val="$define"
+               fi
+       fi
+       ;;
+esac
+$rm -f reflect
+set d_procselfexe
+eval $setvar
+
+: see if pthread_atfork exists
+set pthread_atfork d_pthread_atfork
+eval $inlibc
+
 
 : see whether the various POSIXish _yields exist
 $cat >try.c <<EOP
@@ -11181,18 +11821,10 @@ eval $inlibc
 set rewinddir d_rewinddir
 eval $inlibc
 
-: see if readlink exists
-set readlink d_readlink
-eval $inlibc
-
 : see if readv exists
 set readv d_readv
 eval $inlibc
 
-: see if realpath exists
-set realpath d_realpath
-eval $inlibc
-
 : see if recvmsg exists
 set recvmsg d_recvmsg
 eval $inlibc
@@ -11230,12 +11862,14 @@ set i_memory
 eval $setvar
 
 : can bcopy handle overlapping blocks?
+echo " "
 val="$undef"
-case "$d_bcopy" in
-"$define")
-       echo " "
-       echo "Checking to see if your bcopy() can do overlapping copies..." >&4
-       $cat >try.c <<EOCP
+case "$d_memmove" in
+"$define") echo "I'll use memmove() instead of bcopy() for overlapping copies." ;;
+*)     case "$d_bcopy" in
+       "$define")
+               echo "Checking to see if bcopy() can do overlapping copies..." >&4
+               $cat >try.c <<EOCP
 #$i_memory I_MEMORY
 #$i_stdlib I_STDLIB
 #$i_string I_STRING
@@ -11265,6 +11899,8 @@ int len;
 int off;
 int align;
 
+/* Copy "abcde..." string to char abc[] so that gcc doesn't
+   try to store the string in read-only memory. */
 bcopy("abcdefghijklmnopqrstuvwxyz0123456789", abc, 36);
 
 for (align = 7; align >= 0; align--) {
@@ -11282,36 +11918,34 @@ for (align = 7; align >= 0; align--) {
 exit(0);
 }
 EOCP
-       set try
-       if eval $compile_ok; then
-               if ./try 2>/dev/null; then
-                       echo "Yes, it can."
-                       val="$define"
+               set try
+               if eval $compile_ok; then
+                       if ./try 2>/dev/null; then
+                               echo "Yes, it can."
+                               val="$define"
+                       else
+                               echo "It can't, sorry."
+                       fi
                else
-                       echo "It can't, sorry."
-                       case "$d_memmove" in
-                       "$define") echo "But that's Ok since you have memmove()." ;;
-                       esac
+                       echo "(I can't compile the test program, so we'll assume not...)"
                fi
-       else
-               echo "(I can't compile the test program, so we'll assume not...)"
-               case "$d_memmove" in
-               "$define") echo "But that's Ok since you have memmove()." ;;
-               esac
-       fi
+               ;;
+       esac
+       $rm -f try.* try core
        ;;
 esac
-$rm -f try.* try core
 set d_safebcpy
 eval $setvar
 
 : can memcpy handle overlapping blocks?
+echo " "
 val="$undef"
-case "$d_memcpy" in
-"$define")
-       echo " "
-       echo "Checking to see if your memcpy() can do overlapping copies..." >&4
-       $cat >try.c <<EOCP
+case "$d_memmove" in
+"$define") echo "I'll use memmove() instead of memcpy() for overlapping copies." ;;
+*)     case "$d_memcpy" in
+       "$define")
+               echo "Checking to see if memcpy() can do overlapping copies..." >&4
+               $cat >try.c <<EOCP
 #$i_memory I_MEMORY
 #$i_stdlib I_STDLIB
 #$i_string I_STRING
@@ -11360,26 +11994,22 @@ for (align = 7; align >= 0; align--) {
 exit(0);
 }
 EOCP
-       set try
-       if eval $compile_ok; then
-               if ./try 2>/dev/null; then
-                       echo "Yes, it can."
-                       val="$define"
+               set try
+               if eval $compile_ok; then
+                       if ./try 2>/dev/null; then
+                               echo "Yes, it can."
+                               val="$define"
+                       else
+                               echo "It can't, sorry."
+                       fi
                else
-                       echo "It can't, sorry."
-                       case "$d_memmove" in
-                       "$define") echo "But that's Ok since you have memmove()." ;;
-                       esac
+                       echo "(I can't compile the test program, so we'll assume not...)"
                fi
-       else
-               echo "(I can't compile the test program, so we'll assume not...)"
-               case "$d_memmove" in
-               "$define") echo "But that's Ok since you have memmove()." ;;
-               esac
-       fi
+               ;;
+       esac
+       $rm -f try.* try core
        ;;
 esac
-$rm -f try.* try core
 set d_safemcpy
 eval $setvar
 
@@ -11422,7 +12052,7 @@ exit(0);
 EOCP
        set try
        if eval $compile_ok; then
-               if ./try 2>/dev/null; then
+               if $run ./try 2>/dev/null; then
                        echo "Yes, it can."
                        val="$define"
                else
@@ -11591,7 +12221,7 @@ END
     val="$undef"
     set try
     if eval $compile; then
-       xxx=`./try`
+       xxx=`$run ./try`
         case "$xxx" in
         semun) val="$define" ;;
         esac
@@ -11649,7 +12279,7 @@ END
     val="$undef"
     set try
     if eval $compile; then
-        xxx=`./try`
+        xxx=`$run ./try`
         case "$xxx" in
         semid_ds) val="$define" ;;
         esac
@@ -11831,10 +12461,15 @@ esac
 case "$d_sfio" in
 $define) ;;
 *)     : Remove sfio from list of libraries to use
-       set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
-       shift
-       libs="$*"
-       echo "libs = $libs" >&4
+       case "$libs" in
+       *-lsfio*)
+               echo "Removing unneeded -lsfio from library list" >&4
+               set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
+               shift
+               libs="$*"
+               echo "libs = $libs" >&4
+               ;;
+       esac
 ;;
 esac
 
@@ -11974,7 +12609,7 @@ int main()
 EOP
        set try
        if eval $compile; then
-               if ./try >/dev/null 2>&1; then
+               if $run ./try >/dev/null 2>&1; then
                        echo "POSIX sigsetjmp found." >&4
                        val="$define"
                else
@@ -12157,8 +12792,8 @@ int main() {
 EOP
 val="$undef"
 set try
-if eval $compile; then
-       if ./try; then
+if eval $compile && $to try.c; then
+       if $run ./try; then
                echo "Your stdio acts pretty std."
                val="$define"
        else
@@ -12254,8 +12889,8 @@ int main() {
 }
 EOP
        set try
-       if eval $compile; then
-               case `./try$exe_ext` in
+       if eval $compile && $to try.c; then
+               case `$run ./try` in
                Pass_changed)
                        echo "Increasing ptr in your stdio decreases cnt by the same amount.  Good." >&4
                        d_stdio_ptr_lval_sets_cnt="$define" ;;
@@ -12294,8 +12929,8 @@ int main() {
 }
 EOP
        set try
-       if eval $compile; then
-               if ./try; then
+       if eval $compile && $to try.c; then
+               if $run ./try; then
                        echo "And its _base field acts std."
                        val="$define"
                else
@@ -12325,7 +12960,7 @@ EOCP
        do
                set try -DSTDIO_STREAM_ARRAY=$s
                if eval $compile; then
-                       case "`./try$exe_ext`" in
+                       case "`$run ./try`" in
                        yes)    stdio_stream_array=$s; break ;;
                        esac
                fi
@@ -12471,7 +13106,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try`
+               yyy=`$run ./try`
                case "$yyy" in
                ok) echo "Your strtoll() seems to be working okay." ;;
                *) cat <<EOM >&4
@@ -12556,7 +13191,7 @@ EOCP
 EOCP
        set try
        if eval $compile; then
-               case "`./try`" in
+               case "`$run ./try`" in
                ok) echo "Your strtoul() seems to be working okay." ;;
                *) cat <<EOM >&4
 Your strtoul() doesn't seem to be working okay.
@@ -12610,7 +13245,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               case "`./try`" in
+               case "`$run ./try`" in
                ok) echo "Your strtoull() seems to be working okay." ;;
                *) cat <<EOM >&4
 Your strtoull() doesn't seem to be working okay.
@@ -12662,7 +13297,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               case "`./try`" in
+               case "`$run ./try`" in
                ok) echo "Your strtouq() seems to be working okay." ;;
                *) cat <<EOM >&4
 Your strtouq() doesn't seem to be working okay.
 set d_tzname
 eval $setvar
 
-case "$crosscompile" in
-''|[nN]*) crosscompile="$undef" ;;
-esac
-
 case "$osname" in
 next|rhapsody|darwin) multiarch="$define" ;;
 esac
@@ -12763,14 +13394,14 @@ esac
 
 : check for ordering of bytes in a long
 echo " "
-case "$crosscompile$multiarch" in
+case "$usecrosscompile$multiarch" in
 *$define*)
        $cat <<EOM
 You seem to be either cross-compiling or doing a multiarchitecture build,
 skipping the byteorder check.
 
 EOM
-       byteorder='0xffff'
+       byteorder='ffff'
        ;;
 *)
        case "$byteorder" in
@@ -12807,7 +13438,7 @@ EOCP
                xxx_prompt=y
                set try
                if eval $compile && ./try > /dev/null; then
-                       dflt=`./try`
+                       dflt=`$run ./try`
                        case "$dflt" in
                        [1-4][1-4][1-4][1-4]|12345678|87654321)
                                echo "(The test program ran ok.)"
@@ -12846,7 +13477,12 @@ EOM
 $cat >try.c <<EOCP
 #include <stdio.h>
 #define U32 $u32type
-#define BYTEORDER $byteorder
+#define BYTEORDER 0x$byteorder
+#define U8 $u8type
+#include <signal.h>
+#ifdef SIGBUS
+$signal_t bletch(s) int s; { exit(4); }
+#endif
 int main() {
 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
     U8 buf[] = "\0\0\0\1\0\0\0\0";
@@ -12860,6 +13496,10 @@ int main() {
 
     fflush(stdout);
 
+#ifdef SIGBUS
+    signal(SIGBUS, bletch);
+#endif
+
     for (i = 0; i < 4; i++) {
        up = (U32*)(buf + i);
        if (! ((*up == 1 << (8*i)) ||   /* big-endian */
@@ -12892,8 +13532,8 @@ int main() {
 EOCP
 set try
 if eval $compile_ok; then
-       echo "(This test may dump core.)" >&4
-       ./try >&2 >/dev/null
+       echo "(Testing for character data alignment may crash the test.  That's okay.)" >&4
+       $run ./try 2>&1 >/dev/null
        case "$?" in
        0)      cat >&4 <<EOM
 You can access character data pretty unalignedly.
@@ -12906,7 +13546,6 @@ EOM
                d_u32align="$define"
                ;;
        esac
-       $rm -f core core.try.* try.core
 else
        rp='Can you access character data at unaligned addresses?'
        dflt='n'
@@ -12916,6 +13555,7 @@ else
        *)      d_u32align="$define" ;;
        esac
 fi
+$rm -f core core.try.* try.core
 
 : see if ualarm exists
 set ualarm d_ualarm
@@ -12925,6 +13565,10 @@ eval $inlibc
 set umask d_umask
 eval $inlibc
 
+: see if unordered exists
+set unordered d_unordered
+eval $inlibc
+
 : see if usleep exists
 set usleep d_usleep
 eval $inlibc
@@ -12984,14 +13628,6 @@ $define) usevfork='true';;
 *) usevfork='false';;
 esac
 
-: see if this is an sysdir system
-set sys/dir.h i_sysdir
-eval $inhdr
-
-: see if this is an sysndir system
-set sys/ndir.h i_sysndir
-eval $inhdr
-
 : see if closedir exists
 set closedir d_closedir
 eval $inlibc
@@ -13000,7 +13636,7 @@ case "$d_closedir" in
 "$define")
        echo " "
        echo "Checking whether closedir() returns a status..." >&4
-       cat > closedir.c <<EOM
+       cat > try.c <<EOM
 #$i_dirent I_DIRENT            /**/
 #$i_sysdir I_SYS_DIR           /**/
 #$i_sysndir I_SYS_NDIR         /**/
@@ -13029,9 +13665,9 @@ case "$d_closedir" in
 #endif 
 int main() { return closedir(opendir(".")); }
 EOM
-       set closedir
+       set try
        if eval $compile_ok; then
-               if ./closedir > /dev/null 2>&1 ; then
+               if $run ./try > /dev/null 2>&1 ; then
                        echo "Yes, it does."
                        val="$undef"
                else
@@ -13049,7 +13685,7 @@ EOM
 esac
 set d_void_closedir
 eval $setvar
-$rm -f closedir*
+$rm -f try try.*
 : see if there is a wait4
 set wait4 d_wait4
 eval $inlibc
@@ -13079,7 +13715,7 @@ Revision='$Revision'
 
 : check for alignment requirements
 echo " "
-case "$crosscompile$multiarch" in
+case "$usecrosscompile$multiarch" in
 *$define*)
        $cat <<EOM
 You seem to be either cross-compiling or doing a multiarchitecture build,
@@ -13116,7 +13752,7 @@ int main()
 EOCP
                set try
                if eval $compile_ok; then
-                       dflt=`./try`
+                       dflt=`$run ./try`
                else
                        dflt='8'
                        echo "(I can't seem to compile the test program...)"
@@ -13234,9 +13870,9 @@ int main(int argc, char *argv[])
 }
 EOCP
        set try
-       if eval $compile_ok && ./try; then
+       if eval $compile_ok && $run ./try; then
                echo 'Looks OK.' >&4
-               set `./try 1`
+               set `$run ./try 1`
                db_version_major=$1
                db_version_minor=$2
                db_version_patch=$3
@@ -13482,7 +14118,7 @@ done
 
 echo " "
 echo "Determining whether or not we are on an EBCDIC system..." >&4
-$cat >tebcdic.c <<'EOM'
+$cat >try.c <<'EOM'
 int main()
 {
   if ('M'==0xd4) return 0;
@@ -13491,19 +14127,19 @@ int main()
 EOM
 
 val=$undef
-set tebcdic
+set try
 if eval $compile_ok; then
-       if ./tebcdic; then
+       if $run ./try; then
                echo "You seem to speak EBCDIC." >&4
                val="$define"
        else
-               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
+               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
        fi
 else
        echo "I'm unable to compile the test program." >&4
        echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
 fi
-$rm -f tebcdic.c tebcdic
+$rm -f try try.*
 set ebcdic
 eval $setvar
 
@@ -13528,7 +14164,9 @@ $cat >>try.c <<EOCP
 # define STDIO_STREAM_ARRAY $stdio_stream_array
 #endif
 int main() {
-  FILE* p = fopen("try.out", "w");
+  FILE* p;
+  unlink("try.out");
+  p = fopen("try.out", "w");
 #ifdef TRY_FPUTC
   fputc('x', p);
 #else
@@ -13577,24 +14215,26 @@ int main() {
 }
 EOCP
 : first we have to find out how _not_ to flush
+$to try.c
 if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
     output=''
     set try -DTRY_FPUTC
     if eval $compile; then
-           $rm -f try.out
-           ./try$exe_ext 2>/dev/null
-           if $test ! -s try.out -a "X$?" = X42; then
+           $run ./try 2>/dev/null
+           code="$?"
+           $from try.out
+           if $test ! -s try.out -a "X$code" = X42; then
                output=-DTRY_FPUTC
            fi
     fi
     case "$output" in
     '')
            set try -DTRY_FPRINTF
-           $rm -f try.out
            if eval $compile; then
-                   $rm -f try.out
-                   ./try$exe_ext 2>/dev/null
-                   if $test ! -s try.out -a "X$?" = X42; then
+                   $run ./try 2>/dev/null
+                   code="$?"
+                   $from try.out
+                   if $test ! -s try.out -a "X$code" = X42; then
                        output=-DTRY_FPRINTF
                    fi
            fi
@@ -13605,9 +14245,9 @@ fi
 case "$fflushNULL" in
 '')    set try -DTRY_FFLUSH_NULL $output
        if eval $compile; then
-               $rm -f try.out
-               ./try$exe_ext 2>/dev/null
+               $run ./try 2>/dev/null
                code="$?"
+               $from try.out
                if $test -s try.out -a "X$code" = X42; then
                        fflushNULL="`$cat try.out`"
                else
@@ -13653,7 +14293,7 @@ EOCP
                 set tryp
                 if eval $compile; then
                     $rm -f tryp.out
-                    $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+                    $cat tryp.c | $run ./tryp 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.
@@ -13717,7 +14357,7 @@ EOCP
        set tryp
        if eval $compile; then
            $rm -f tryp.out
-           $cat tryp.c | ./tryp$exe_ext 2>/dev/null > tryp.out
+           $cat tryp.c | $run ./tryp 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.
@@ -13729,9 +14369,10 @@ EOM
                                $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
+                               $run ./try 2>/dev/null
+                               code=$?
+                               $from try.out
+                               if $test -s try.out -a "X$code" = X42; then
                                        fflushall="`$cat try.out`"
                                fi
                        fi
@@ -13836,7 +14477,7 @@ int main() {
 EOCP
 set try
 if eval $compile_ok; then
-       yyy=`./try`
+       yyy=`$run ./try`
        case "$yyy" in
        '')     gidsize=4
                echo "(I can't execute the test program--guessing $gidsize.)" >&4
@@ -13870,7 +14511,7 @@ int main() {
 EOCP
 set try
 if eval $compile; then
-       yyy=`./try`
+       yyy=`$run ./try`
        case "$yyy" in
        '')     gidsign=1
                echo "(I can't execute the test program--guessing unsigned.)" >&4
@@ -13905,7 +14546,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
@@ -13927,7 +14568,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
@@ -13950,7 +14591,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
@@ -13972,7 +14613,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
@@ -13994,7 +14635,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
@@ -14016,7 +14657,7 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               yyy=`./try$exe_ext`
+               yyy=`$run ./try`
                case "$yyy" in
                12345678901)
                        sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
@@ -14098,7 +14739,7 @@ else
 fi
 
 case "$ivdformat" in
-'') echo "$0: Fatal: failed to find format strings, cannot continue." >& 4
+'') echo "$0: Fatal: failed to find format strings, cannot continue." >&4
     exit 1
     ;;
 esac
@@ -14337,8 +14978,8 @@ main(int ac, char **av)
 }
 EOCP
        set try
-       if eval $compile && ./try 2>&1 >/dev/null; then
-               case "`./try`" in
+       if eval $compile && $run ./try 2>&1 >/dev/null; then
+               case "`$run ./try`" in
                "that's all right, then")
                        okay=yes
                        ;;
@@ -14586,13 +15227,13 @@ $cc $ccflags -c bar2.c >/dev/null 2>&1
 $cc $ccflags -c foo.c >/dev/null 2>&1
 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
 if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
-       ./foobar >/dev/null 2>&1; then
+       $run ./foobar >/dev/null 2>&1; then
        echo "$ar appears to generate random libraries itself."
        orderlib=false
        ranlib=":"
 elif $ar ts bar$_a >/dev/null 2>&1 &&
        $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
-       ./foobar >/dev/null 2>&1; then
+       $run ./foobar >/dev/null 2>&1; then
                echo "a table of contents needs to be added with '$ar ts'."
                orderlib=false
                ranlib="$ar ts"
@@ -14732,7 +15373,7 @@ int main() {
 EOCP
                set try
                if eval $compile_ok; then
-                       selectminbits=`./try`
+                       selectminbits=`$run ./try`
                        case "$selectminbits" in
                        '')     cat >&4 <<EOM
 Cannot figure out on how many bits at a time your select() operates.
@@ -14924,13 +15565,13 @@ $cat >>signal_cmd <<'EOS'
 
 set signal
 if eval $compile_ok; then
-       ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
+       $run ./signal$_exe | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
 else
        echo "(I can't seem be able to compile the whole test program)" >&4
        echo "(I'll try it in little pieces.)" >&4
        set signal -DJUST_NSIG
        if eval $compile_ok; then
-               ./signal$_exe > signal.nsg
+               $run ./signal$_exe > signal.nsg
                $cat signal.nsg
        else
                echo "I can't seem to figure out how many signals you have." >&4
@@ -14951,7 +15592,7 @@ EOCP
                set signal
                if eval $compile; then
                        echo "SIG${xx} found."
-                       ./signal$_exe  >> signal.ls1
+                       $run ./signal$_exe  >> signal.ls1
                else
                        echo "SIG${xx} NOT found."
                fi
@@ -15042,7 +15683,7 @@ int main() {
 EOCP
 set try
 if eval $compile_ok; then
-       yyy=`./try`
+       yyy=`$run ./try`
        case "$yyy" in
        '')     sizesize=4
                echo "(I can't execute the test program--guessing $sizesize.)" >&4
@@ -15136,7 +15777,7 @@ esac
 set ssize_t ssizetype int stdio.h sys/types.h
 eval $typedef
 dflt="$ssizetype"
-$cat > ssize.c <<EOM
+$cat > try.c <<EOM
 #include <stdio.h>
 #include <sys/types.h>
 #define Size_t $sizetype
@@ -15153,9 +15794,9 @@ int main()
 }
 EOM
 echo " "
-set ssize
-if eval $compile_ok && ./ssize > /dev/null; then
-       ssizetype=`./ssize`
+set try
+if eval $compile_ok && $run ./try > /dev/null; then
+       ssizetype=`$run ./try`
        echo "I'll be using $ssizetype for functions returning a byte count." >&4
 else
        $cat >&4 <<EOM
@@ -15171,7 +15812,7 @@ EOM
        . ./myread
        ssizetype="$ans"
 fi
-$rm -f ssize ssize.*
+$rm -f try try.*
 
 : see what type of char stdio uses.
 echo " "
@@ -15245,7 +15886,7 @@ int main() {
 EOCP
 set try
 if eval $compile_ok; then
-       yyy=`./try`
+       yyy=`$run ./try`
        case "$yyy" in
        '')     uidsize=4
                echo "(I can't execute the test program--guessing $uidsize.)" >&4
@@ -15278,7 +15919,7 @@ int main() {
 EOCP
 set try
 if eval $compile; then
-       yyy=`./try`
+       yyy=`$run ./try`
        case "$yyy" in
        '')     uidsign=1
                echo "(I can't execute the test program--guessing unsigned.)" >&4
@@ -15344,11 +15985,11 @@ case "$yacc" in
 esac
 echo " "
 comp='yacc'
-if $test -f "$byacc"; then
+if $test -f "$byacc$_exe"; then
        dflt="$byacc"
        comp="byacc or $comp"
 fi
-if $test -f "$bison"; then
+if $test -f "$bison$_exe"; then
        comp="$comp or bison -y"
 fi
 rp="Which compiler compiler ($comp) shall I use?"
@@ -15366,42 +16007,20 @@ case "$yacc" in
        ;;
 esac
 
-: see if fcntl.h is there
-val=''
-set fcntl.h val
+: see if this is a fp.h system
+set fp.h i_fp
 eval $inhdr
 
-: see if we can include fcntl.h
-case "$val" in
-"$define")
-       echo " "
-       if $h_fcntl; then
-               val="$define"
-               echo "We'll be including <fcntl.h>." >&4
-       else
-               val="$undef"
-               if $h_sysfile; then
-       echo "We don't need to include <fcntl.h> if we include <sys/file.h>." >&4
-               else
-                       echo "We won't be including <fcntl.h>." >&4
-               fi
-       fi
-       ;;
-*)
-       h_fcntl=false
-       val="$undef"
-       ;;
-esac
-set i_fcntl
-eval $setvar
-
-: see if this is a iconv.h system
-set iconv.h i_iconv
+: see if this is a fp_class.h system
+set fp_class.h i_fp_class
 eval $inhdr
 
 : see if this is a ieeefp.h system
-set ieeefp.h i_ieeefp
-eval $inhdr
+case "$i_ieeefp" in
+'' ) set ieeefp.h i_ieeefp
+     eval $inhdr
+     ;;
+esac
 
 : see if this is a libutil.h system
 set libutil.h i_libutil
@@ -15502,9 +16121,10 @@ BSD_4_3 BSD_4_4 BSD_NET2 BSD_TIME BSD_TYPES BSDCOMPAT bsdi
 bull c cadmus clipper CMU COFF COMPILER_VERSION
 concurrent convex cpu cray CRAY CRAYMPP ctix CX_UX
 CYGWIN DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
-Dynix DynixPTX ELF encore EPI EXTENSIONS FILE_OFFSET_BITS
-FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
-GNU_SOURCE GNUC GNUC_MINOR GO32 gould GOULD_PN
+Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
+FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
+GLIBC GLIBC_MINOR
+GNU_SOURCE GNUC GNUC_MINOR GNU_LIBRARY GO32 gould GOULD_PN
 H3050R H3050RX hbullx20 hcx host_mips
 hp200 hp300 hp700 HP700 hp800 hp9000
 hp9000s200 hp9000s300 hp9000s400 hp9000s500
@@ -15547,7 +16167,11 @@ tower tower32 tower32_200 tower32_600 tower32_700
 tower32_800 tower32_850 tss
 u370 u3b u3b2 u3b20 u3b200 u3b20d u3b5
 ultrix UMAXV UnicomPBB UnicomPBD UNICOS UNICOSMK
-unix UNIX95 UNIX99 unixpc unos USGr4 USGr4_2
+unix UNIX95 UNIX99 unixpc unos
+USE_BSD USE_FILE_OFFSET64 USE_GNU USE_ISOC9X USE_LARGEFILE USE_LARGEFILE64
+USE_MISC USE_POSIX USE_POSIX199309 USE_POSIX199506 USE_POSIX2
+USE_REENTRANT USE_SVID USE_UNIX98 USE_XOPEN USE_XOPEN_EXTENDED
+USGr4 USGr4_2
 Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms xenix Xenix286
 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
@@ -15602,7 +16226,7 @@ case "$osname-$gccversion" in
 irix-) ccflags="\$ccflags -woff 1178" ;;
 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
 esac
-$cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
+$cc -o try $optimize \$ccflags $ldflags try.c $libs && $run ./try
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
@@ -15682,7 +16306,6 @@ else
                $test "$silent" || sleep 1
        fi
 fi
-$rm -f ccsym* Cppsym.*
 
 : see if this is a termio system
 val="$undef"
@@ -15913,6 +16536,10 @@ cd $rsrc/ext
 set X
 shift
 eval $find_extensions
+# Special case:  Add in threads/shared since it is not picked up by the
+# recursive find above (and adding in general recursive finding breaks
+# SDBM_File/sdbm).  A.D.  10/25/2001.
+known_extensions="$known_extensions threads/shared"
 set X $nonxs_extensions
 shift
 nonxs_extensions="$*"
@@ -15935,11 +16562,16 @@ for xxx in $known_extensions ; do
                $define) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
+       I18N/Langinfo|i18n_lan)
+               case "$i_langinfo$d_nl_langinfo" in 
+               $define$define) avail_ext="$avail_ext $xxx" ;;
+               esac
+               ;;
        NDBM_File|ndbm_fil)
                case "$i_ndbm" in
                $define)
                    case "$osname-$use64bitint" in
-                   hpux-define)
+                   cygwin-*|hpux-define)
                        case "$libs" in
                        *-lndbm*) avail_ext="$avail_ext $xxx" ;;
                        esac
@@ -15953,7 +16585,7 @@ for xxx in $known_extensions ; do
                case "${i_dbm}${i_rpcsvcdbm}" in
                *"${define}"*)
                    case "$osname-$use64bitint" in
-                   hpux-define)
+                   cygwin-*|hpux-define)
                        case "$libs" in
                        *-ldbm*) avail_ext="$avail_ext $xxx" ;;
                        esac
@@ -15975,7 +16607,12 @@ for xxx in $known_extensions ; do
                ;;
        Socket|socket)
                case "$d_socket" in 
-               true|$define|y) avail_ext="$avail_ext $xxx" ;;
+               true|$define|y)
+                   case "$osname" in
+                   beos) ;; # not unless BONE
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        Sys/Syslog|sys/syslog)
@@ -15985,8 +16622,19 @@ for xxx in $known_extensions ; do
                esac
                ;;
        Thread|thread)
-               case "$usethreads" in 
-               true|$define|y) avail_ext="$avail_ext $xxx" ;;
+                case "$usethreads" in
+                true|$define|y)
+                        case "$useithreads" in
+                        $undef|false|[nN]*) avail_ext="$avail_ext $xxx" ;;
+                        esac
+               esac
+               ;;
+       threads|threads/shared)
+                case "$usethreads" in
+                true|$define|y)
+                        case "$useithreads" in
+                        $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
+                        esac
                esac
                ;;
        IPC/SysV|ipc/sysv)
@@ -16172,6 +16820,12 @@ if test -d ../UU; then
        cd ..
 fi
 
+: configuration may be patched via a 'config.arch' file
+if $test -f config.arch; then
+       echo "I see a config.arch file, loading it."
+       . ./config.arch
+fi
+
 : configuration may be patched via a 'config.over' file
 if $test -f config.over; then
        echo " "
@@ -16287,7 +16941,6 @@ cppminus='$cppminus'
 cpprun='$cpprun'
 cppstdin='$cppstdin'
 cppsymbols='$cppsymbols'
-crosscompile='$crosscompile'
 cryptlib='$cryptlib'
 csh='$csh'
 d_Gconvert='$d_Gconvert'
@@ -16325,6 +16978,7 @@ d_charvspr='$d_charvspr'
 d_chown='$d_chown'
 d_chroot='$d_chroot'
 d_chsize='$d_chsize'
+d_class='$d_class'
 d_closedir='$d_closedir'
 d_cmsghdr_s='$d_cmsghdr_s'
 d_const='$d_const'
@@ -16334,6 +16988,7 @@ d_cuserid='$d_cuserid'
 d_dbl_dig='$d_dbl_dig'
 d_dbminitproto='$d_dbminitproto'
 d_difftime='$d_difftime'
+d_dirfd='$d_dirfd'
 d_dirnamlen='$d_dirnamlen'
 d_dlerror='$d_dlerror'
 d_dlopen='$d_dlopen'
@@ -16350,6 +17005,7 @@ d_endpwent='$d_endpwent'
 d_endsent='$d_endsent'
 d_eofnblk='$d_eofnblk'
 d_eunice='$d_eunice'
+d_fchdir='$d_fchdir'
 d_fchmod='$d_fchmod'
 d_fchown='$d_fchown'
 d_fcntl='$d_fcntl'
@@ -16358,11 +17014,17 @@ d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
 d_fds_bits='$d_fds_bits'
 d_fgetpos='$d_fgetpos'
+d_finite='$d_finite'
+d_finitel='$d_finitel'
 d_flexfnam='$d_flexfnam'
 d_flock='$d_flock'
 d_flockproto='$d_flockproto'
 d_fork='$d_fork'
+d_fp_class='$d_fp_class'
 d_fpathconf='$d_fpathconf'
+d_fpclass='$d_fpclass'
+d_fpclassify='$d_fpclassify'
+d_fpclassl='$d_fpclassl'
 d_fpos64_t='$d_fpos64_t'
 d_frexpl='$d_frexpl'
 d_fs_data_s='$d_fs_data_s'
@@ -16413,11 +17075,12 @@ d_gnulibc='$d_gnulibc'
 d_grpasswd='$d_grpasswd'
 d_hasmntopt='$d_hasmntopt'
 d_htonl='$d_htonl'
-d_iconv='$d_iconv'
 d_index='$d_index'
 d_inetaton='$d_inetaton'
 d_int64_t='$d_int64_t'
 d_isascii='$d_isascii'
+d_isfinite='$d_isfinite'
+d_isinf='$d_isinf'
 d_isnan='$d_isnan'
 d_isnanl='$d_isnanl'
 d_killpg='$d_killpg'
@@ -16464,6 +17127,7 @@ d_msync='$d_msync'
 d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
 d_nice='$d_nice'
+d_nl_langinfo='$d_nl_langinfo'
 d_nv_preserves_uv='$d_nv_preserves_uv'
 d_nv_preserves_uv_bits='$d_nv_preserves_uv_bits'
 d_off64_t='$d_off64_t'
@@ -16478,6 +17142,8 @@ d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
 d_portable='$d_portable'
+d_procselfexe='$d_procselfexe'
+d_pthread_atfork='$d_pthread_atfork'
 d_pthread_yield='$d_pthread_yield'
 d_pwage='$d_pwage'
 d_pwchange='$d_pwchange'
@@ -16492,7 +17158,6 @@ d_quad='$d_quad'
 d_readdir='$d_readdir'
 d_readlink='$d_readlink'
 d_readv='$d_readv'
-d_realpath='$d_realpath'
 d_recvmsg='$d_recvmsg'
 d_rename='$d_rename'
 d_rewinddir='$d_rewinddir'
@@ -16603,6 +17268,7 @@ d_ualarm='$d_ualarm'
 d_umask='$d_umask'
 d_uname='$d_uname'
 d_union_semun='$d_union_semun'
+d_unordered='$d_unordered'
 d_usleep='$d_usleep'
 d_usleepproto='$d_usleepproto'
 d_ustat='$d_ustat'
@@ -16643,6 +17309,7 @@ eunicefix='$eunicefix'
 exe_ext='$exe_ext'
 expr='$expr'
 extensions='$extensions'
+extras='$extras'
 fflushNULL='$fflushNULL'
 fflushall='$fflushall'
 find='$find'
@@ -16651,6 +17318,7 @@ flex='$flex'
 fpossize='$fpossize'
 fpostype='$fpostype'
 freetype='$freetype'
+from='$from'
 full_ar='$full_ar'
 full_csh='$full_csh'
 full_sed='$full_sed'
@@ -16661,6 +17329,7 @@ gidsign='$gidsign'
 gidsize='$gidsize'
 gidtype='$gidtype'
 glibpth='$glibpth'
+gmake='$gmake'
 grep='$grep'
 groupcat='$groupcat'
 groupstype='$groupstype'
@@ -16686,11 +17355,13 @@ i_dld='$i_dld'
 i_dlfcn='$i_dlfcn'
 i_fcntl='$i_fcntl'
 i_float='$i_float'
+i_fp='$i_fp'
+i_fp_class='$i_fp_class'
 i_gdbm='$i_gdbm'
 i_grp='$i_grp'
-i_iconv='$i_iconv'
 i_ieeefp='$i_ieeefp'
 i_inttypes='$i_inttypes'
+i_langinfo='$i_langinfo'
 i_libutil='$i_libutil'
 i_limits='$i_limits'
 i_locale='$i_locale'
@@ -16889,6 +17560,7 @@ prefix='$prefix'
 prefixexp='$prefixexp'
 privlib='$privlib'
 privlibexp='$privlibexp'
+procselfexe='$procselfexe'
 prototype='$prototype'
 ptrsize='$ptrsize'
 quadkind='$quadkind'
@@ -16901,6 +17573,7 @@ rd_nodata='$rd_nodata'
 revision='$revision'
 rm='$rm'
 rmail='$rmail'
+run='$run'
 runnm='$runnm'
 sPRIEUldbl='$sPRIEUldbl'
 sPRIFUldbl='$sPRIFUldbl'
@@ -16975,11 +17648,13 @@ subversion='$subversion'
 sysman='$sysman'
 tail='$tail'
 tar='$tar'
+targetarch='$targetarch'
 tbl='$tbl'
 tee='$tee'
 test='$test'
 timeincl='$timeincl'
 timetype='$timetype'
+to='$to'
 touch='$touch'
 tr='$tr'
 trnl='$trnl'
@@ -17002,6 +17677,7 @@ uquadtype='$uquadtype'
 use5005threads='$use5005threads'
 use64bitall='$use64bitall'
 use64bitint='$use64bitint'
+usecrosscompile='$usecrosscompile'
 usedl='$usedl'
 useithreads='$useithreads'
 uselargefiles='$uselargefiles'
@@ -17013,6 +17689,7 @@ usenm='$usenm'
 useopcode='$useopcode'
 useperlio='$useperlio'
 useposix='$useposix'
+usereentrant='$usereentrant'
 usesfio='$usesfio'
 useshrplib='$useshrplib'
 usesocks='$usesocks'
@@ -17037,6 +17714,7 @@ vendorlibexp='$vendorlibexp'
 vendorprefix='$vendorprefix'
 vendorprefixexp='$vendorprefixexp'
 version='$version'
+version_patchlevel_string='$version_patchlevel_string'
 versiononly='$versiononly'
 vi='$vi'
 voidflags='$voidflags'
@@ -17115,7 +17793,9 @@ esac
 
 echo " "
 exec 1>&4
+pwd=`pwd`
 . ./UU/extract
+cd $pwd
 
 if $contains '^depend:' [Mm]akefile >/dev/null 2>&1; then
        dflt=y