This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Allow s{GM,LOCAL)TIME_{min,max} to be set from CLI, Policy.sh and hints
[perl5.git] / Configure
index ef0d847..0b8eb7e 100755 (executable)
--- a/Configure
+++ b/Configure
 # Yes, you may rip this off to use in other distribution packages. This
 # script belongs to the public domain and cannot be copyrighted.
 #
-# (Note: this Configure script was generated automatically. Rather than
+# Note: this Configure script was generated automatically. Rather than
 # working with this copy of Configure, you may wish to get metaconfig.
-# The dist-3.0 package (which contains metaconfig) was posted in
-# comp.sources.misc and is available on CPAN under authors/id/RAM so
-# you may fetch it yourself from your nearest archive site.)
+# The dist package (which contains metaconfig) is available via SVN:
+#     svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
 #
 #
 # Though this script was generated by metaconfig, it is OK to send
@@ -24,9 +23,9 @@
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
+# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
 #
-# Generated on Tue Aug 21 15:53:52 CEST 2007 [metaconfig 3.0 PL70]
+# Generated on Mon Sep 29 18:14:44 CEST 2008 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -88,9 +87,9 @@ esac
 
 : Proper separator for the PATH environment variable
 p_=:
-: On OS/2 this directory should exist if this is not floppy only system :-]
+: On OS/2 this directory should exist if this is not floppy only system ":-]"
 if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
-    if test -n "$OS2_SHELL"; then
+       if test -n "$OS2_SHELL"; then
                p_=\;
                PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
                OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
@@ -145,9 +144,9 @@ if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then
 fi
 if test -f /osf_boot -a -f /usr/sbin/setld; then
        if test X`/usr/bin/uname -s` = XOSF1; then
-               avoidksh="to avoid Digital UNIX' ksh"
-               newsh=/bin/sh
-               unset BIN_SH # if this is 'xpg4' sh will start up ksh
+               avoidksh="to avoid Digital UNIX' ksh"
+               newsh=/bin/sh
+               unset BIN_SH
        fi
 fi
 case "$inksh/$needksh" in
@@ -183,16 +182,17 @@ true)
 esac
 test -x "${newsh}" || unset newsh
 
-: if needed set CDPATH to a harmless value that is not chatty
+: if needed, set CDPATH to a harmless value that is not chatty
 : avoid bash 2.02 problems with empty CDPATH.
 case "$CDPATH" in
 '')    ;;
 *)     case "$SHELL" in
-       *bash*) CDPATH='.' ;;
-       *)              CDPATH='' ;;
+       *bash*) CDPATH='.' ;;
+       *) CDPATH='' ;;
        esac
        ;;
 esac
+
 : Configure runs within the UU subdirectory
 test -d UU || mkdir UU
 cd UU && rm -f ./*
@@ -221,7 +221,6 @@ d_bsd=''
 d_eunice=''
 d_xenix=''
 eunicefix=''
-Mcc=''
 ar=''
 awk=''
 bash=''
@@ -778,6 +777,7 @@ d_tcsetpgrp=''
 d_telldirproto=''
 d_time=''
 timetype=''
+d_timegm=''
 clocktype=''
 d_times=''
 d_tmpnam_r=''
@@ -840,6 +840,7 @@ html3dir=''
 html3direxp=''
 installhtml3dir=''
 i_arpainet=''
+i_assert=''
 i_crypt=''
 db_hashtype=''
 db_prefixtype=''
@@ -869,9 +870,13 @@ i_limits=''
 i_locale=''
 i_machcthr=''
 i_malloc=''
+i_mallocmalloc=''
 i_math=''
 i_memory=''
 i_mntent=''
+d_ndbm=''
+i_gdbm_ndbm=''
+i_gdbmndbm=''
 i_ndbm=''
 i_netdb=''
 i_neterrno=''
@@ -912,6 +917,7 @@ i_sysmode=''
 i_sysmount=''
 i_sysndir=''
 i_sysparam=''
+i_syspoll=''
 i_sysresrc=''
 i_syssecrt=''
 i_sysselct=''
@@ -1057,6 +1063,7 @@ i8size=''
 i8type=''
 ivsize=''
 ivtype=''
+nv_overflows_integers_at=''
 nv_preserves_uv_bits=''
 nvsize=''
 nvtype=''
@@ -1165,6 +1172,10 @@ stdchar=''
 d_stdio_stream_array=''
 stdio_stream_array=''
 sysman=''
+sGMTIME_max=''
+sGMTIME_min=''
+sLOCALTIME_max=''
+sLOCALTIME_min=''
 trnl=''
 uidformat=''
 uidsign=''
@@ -1173,6 +1184,8 @@ uidtype=''
 archname64=''
 use64bitall=''
 use64bitint=''
+dtrace=''
+usedtrace=''
 usefaststdio=''
 ccflags_uselargefiles=''
 ldflags_uselargefiles=''
@@ -1234,6 +1247,7 @@ yacc=''
 yaccflags=''
 CONFIG=''
 
+: Detect odd OSs
 define='define'
 undef='undef'
 smallmach='pdp11 i8086 z8000 i80286 iAPX286'
@@ -1263,12 +1277,12 @@ elif test -d c:/. -o -n "$is_os2" ; then
     _exe=".exe"
 fi
 
+groupstype=''
 i_whoami=''
 : Trailing extension.  Override this in a hint file, if needed.
 : Extra object files, if any, needed on this platform.
 archobjs=''
 archname=''
-groupstype=''
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
@@ -1292,9 +1306,6 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
-siteman1dir=''
-siteman3dir=''
-sitescript=''
 : set usethreads on the Configure command line to enable threads.
 usereentrant='undef'
 : full support for void wanted by default
@@ -1402,14 +1413,14 @@ if `$sh -c '#' >/dev/null 2>&1`; then
        echo "#!$xcat" >sharp
        $eunicefix sharp
        chmod +x sharp
-       ./sharp > today
+       ./sharp > today 2>/dev/null
        if test -s today; then
                sharpbang='#!'
        else
                echo "#! $xcat" > sharp
                $eunicefix sharp
                chmod +x sharp
-               ./sharp > today
+               ./sharp > today 2>/dev/null
                if test -s today; then
                        sharpbang='#! '
                else
@@ -1452,11 +1463,10 @@ else
 fi
 rm -f sharp
 
-
 : Save command line options in file UU/cmdline.opt for later use in
 : generating config.sh.
 cat > cmdline.opt <<EOSH
-# Configure command line arguments.
+: Configure command line arguments.
 config_arg0='$0'
 config_args='$*'
 config_argc=$#
@@ -1468,7 +1478,6 @@ 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
@@ -1477,8 +1486,6 @@ EOC
        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
@@ -1610,7 +1617,7 @@ while test $# -gt 0; do
                  case "$zzz" in
                  *:*) zzz='' ;;
                  *)   xxx=append
-                      zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'` 
+                      zzz=" "`echo "$yyy"|sed 's!^[^=]*=!!'`
                       yyy=`echo "$yyy"|sed 's!=.*!!'` ;;
                  esac
                  ;;
@@ -1624,7 +1631,7 @@ while test $# -gt 0; do
                  *)   xxx=`echo "$yyy"|sed 's!:.*!!'`
                       yyy=`echo "$yyy"|sed 's!^[^:]*:!!'` ;;
                  esac
-                 ;;       
+                 ;;
             esac
            case "$xxx" in
            append)
@@ -1649,7 +1656,7 @@ while test $# -gt 0; do
            esac
            shift
            ;;
-       -V) echo "$me generated by metaconfig 3.0 PL70." >&2
+       -V) echo "$me generated by metaconfig 3.5 PL0." >&2
            exit 0;;
        --) break;;
        -*) echo "$me: unknown option $1" >&2; shift; error=true;;
@@ -1733,7 +1740,7 @@ touch optdef.sh
 touch posthint.sh
 
 : set package name
-package=perl5
+package='perl5'
 first=`echo $package | sed -e 's/^\(.\).*/\1/'`
 last=`echo $package | sed -e 's/^.\(.*\)/\1/'`
 case "`echo AbyZ | tr '[:lower:]' '[:upper:]' 2>/dev/null`" in
@@ -1779,11 +1786,11 @@ case "$src" in
 '')    src=/
        rsrc=/
        ;;
-/*) rsrc="$src";;
-*) rsrc="../$src";;
+/*)    rsrc="$src";;
+*)     rsrc="../$src";;
 esac
 if test -f $rsrc/Configure && \
-       $contains "^package=$package$" $rsrc/Configure >/dev/null 2>&1
+       $contains "^package='$package'\$" $rsrc/Configure >/dev/null 2>&1
 then
    : found it, so we are ok.
 else
@@ -1937,11 +1944,13 @@ rm -f .echotmp
 echo " "
 if test -f "$rsrc/MANIFEST"; then
        echo "First let's make sure your kit is complete.  Checking..." >&4
-       awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | (split -l 50 2>/dev/null || split -50)
+       awk '$1 !~ /PACK[A-Z]+/ {print $1}' "$rsrc/MANIFEST" | \
+               (split -l 50 2>/dev/null || split -50)
        rm -f missing
        tmppwd=`pwd`
        for filelist in x??; do
-               (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` >/dev/null 2>>"$tmppwd/missing")
+               (cd "$rsrc"; ls `cat "$tmppwd/$filelist"` \
+                       >/dev/null 2>>"$tmppwd/missing")
        done
        if test -s missing; then
                cat missing >&4
@@ -1975,8 +1984,8 @@ else
 fi
 rm -f missing x??
 
-echo " "
 : Find the appropriate value for a newline for tr
+echo " "
 if test -n "$DJGPP"; then
        trnl='\012'
 fi
@@ -2120,6 +2129,7 @@ persist across sessions for $package.
 You may safely delete it if you wish.
 EOF
 
+: See if we are using a devel version and want that
 xversion=`awk '/define[        ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
 case "$usedevel" in
 $define|true|[yY]*) ;;
@@ -2280,14 +2290,13 @@ for dir in \$*; do
                exit 0
        elif test "X$_exe" != X -a -f \$thisthing$_exe; then
                echo \$thisthing
-               exit 0
+               exit 0
        elif test -f \$dir/\$thing.exe; then
                if test -n "$DJGPP"; then
                        echo \$dir/\$thing.exe
                elif test "$eunicefix" != ":"; then
                        : on Eunice apparently
                        echo \$dir/\$thing
-                       exit 0
                fi
                exit 0
        fi
@@ -2318,7 +2327,6 @@ tr
 uniq
 "
 trylist="
-Mcc
 ar
 bison
 byacc
@@ -2418,7 +2426,7 @@ ln)
        ;;
 esac
 case "$make" in
-make)  
+make)
        case "$gmake" in
        gmake)
        echo "I can't find make or gmake, and my life depends on it." >&4
@@ -2427,7 +2435,7 @@ make)
        ;;
        esac
        ;;
-esac   
+esac
 case "$gmake" in
 gmake) ;;
 *)     # We can't have osname yet.
@@ -2483,6 +2491,20 @@ FOO
        ;;
 esac
 
+# This question was auctioned at YAPC::Europe-2007 in Vienna
+# I never promised you could answer it. I only auctioned the question.
+cat <<FOO
+The following message is sponsored by
+
+  Dresden.pm<--The stars should be here.
+
+Dear Perl user, system administrator or package
+maintainer, the Perl community sends greetings to
+you. Do you (emblematical) greet back [Y/n]? n
+
+FOO
+
+: Check what type of C compiler we use
 cat <<EOS >trygcc
 $startsh
 EOS
@@ -2656,7 +2678,7 @@ case "$lns" in
 esac
 echo " "
 
-
+: Make symlinks util
 case "$mksymlinks" in
 $define|true|[yY]*)
        case "$src" in
@@ -2708,7 +2730,7 @@ $define|true|[yY]*)
        ;;
 esac
 
-
+: Check for Cross-Compilation
 case "$usecrosscompile" in
 $define|true|[yY]*)
        $echo "Cross-compiling..."
@@ -3577,10 +3599,10 @@ 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=\$?
@@ -3887,6 +3909,7 @@ esac
 prefix="$ans"
 prefixexp="$ansexp"
 
+: allow them to override the AFS root
 case "$afsroot" in
 '')    afsroot=/afs ;;
 *)     afsroot=$afsroot ;;
@@ -3897,7 +3920,7 @@ echo " "
 case "$afs" in
 $define|true)  afs=true ;;
 $undef|false)  afs=false ;;
-*)     if test -d $afsroot; then
+*)     if $test -d $afsroot; then
                afs=true
        else
                afs=false
@@ -3999,7 +4022,7 @@ y) td=$was; tu=$was;;
 esac
 EOSC
 
-: function used to set $1 to $val
+: function used to set '$1' to '$val'
 setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
 case "$val$was" in
 $define$undef) . ./whoa; eval "$var=\$td";;
@@ -4007,6 +4030,7 @@ $undef$define) . ./whoa; eval "$var=\$tu";;
 *) eval "$var=$val";;
 esac'
 
+: Check is we will use socks
 case "$usesocks" in
 $define|true|[yY]*)    dflt='y';;
 *) dflt='n';;
@@ -4022,7 +4046,7 @@ EOM
 rp='Build Perl for SOCKS?'
 . ./myread
 case "$ans" in
-y|Y)   val="$define" ;;     
+y|Y)   val="$define" ;;
 *)      val="$undef" ;;
 esac
 set usesocks
@@ -4032,6 +4056,7 @@ case "$usesocks" in
 $define|true|[yY]*) useperlio="$define";;
 esac
 
+: Check if we want perlio
 case "$useperlio" in
 $define|true|[yY]*|'') dflt='y';;
 *) dflt='n';;
@@ -4050,16 +4075,16 @@ EOM
 rp='Use the PerlIO abstraction layer?'
 . ./myread
 case "$ans" in
-y|Y) 
+y|Y)
        val="$define"
        ;;
-*)      
+*)
        echo "Ok, doing things the stdio way."
        val="$undef"
        ;;
 esac
 set useperlio
-eval $setvar 
+eval $setvar
 
 case "$usesocks" in
 $define|true|[yY]*)
@@ -4076,7 +4101,6 @@ EOM
        ;;
 esac
 
-       
 : get the patchlevel
 echo " "
 echo "Getting the current patchlevel..." >&4
@@ -4133,12 +4157,13 @@ if test "${api_revision}${api_version}${api_subversion}" = "550"; then
        api_versionstring='5.005'
 fi
 
+: Do we want threads support and if so, what type
 case "$usethreads" in
 $define|true|[yY]*)     dflt='y';;
 *)     # Catch case where user specified ithreads or 5005threads but
        # forgot -Dusethreads (A.D. 4/2002)
        case "$useithreads$use5005threads" in
-       *$define*)      
+       *$define*)
                case "$useperlio" in
                "$define")      dflt='y' ;;
                *)              dflt='n' ;;
@@ -4282,6 +4307,7 @@ EOM
     esac
 fi
 
+: Check if multiplicity is required
 cat <<EOM
 
 Perl can be built so that multiple Perl interpreters can coexist
@@ -4312,7 +4338,7 @@ esac
 set usemultiplicity
 eval $setvar
 
-
+: Check if morebits is requested
 case "$usemorebits" in
 "$define"|true|[yY]*)
        use64bitint="$define"
@@ -4323,6 +4349,23 @@ case "$usemorebits" in
        ;;
 esac
 
+: Determine the C compiler to be used
+echo " "
+case "$cc" in
+'') dflt=cc;;
+*) dflt="$cc";;
+esac
+rp="Use which C compiler?"
+. ./myread
+cc="$ans"
+
+: See whether they have no cc but they do have gcc
+. ./trygcc
+if $test -f cc.cbu; then
+    . ./cc.cbu
+fi
+. ./checkcc
+
 : make some quick guesses about what we are up against
 echo " "
 $echo $n "Hmm...  $c"
@@ -4418,24 +4461,7 @@ chmod +x bsd usg v7 osf1 eunice xenix venix os2
 $eunicefix bsd usg v7 osf1 eunice xenix venix os2
 $rm -f foo
 
-case "$cc" in
-'') dflt=cc;;
-*) dflt="$cc";;
-esac
-rp="Use which C compiler?"
-. ./myread
-cc="$ans"
-
-: See if they have not cc but they do have gcc
-. ./trygcc
-: Look for a hint-file generated 'call-back-unit'.  Now that the
-: user has specified the compiler, we may need to set or change some
-: other defaults.
-if $test -f cc.cbu; then
-    . ./cc.cbu
-fi
-. ./checkcc
-
+: Check if we are using GNU gcc and what its version is
 echo " "
 echo "Checking for GNU cc in disguise and/or its version number..." >&4
 $cat >try.c <<EOM
@@ -4830,6 +4856,7 @@ case "$firstmakefile" in
 '') firstmakefile='makefile';;
 esac
 
+: Check for uselongdouble support
 case "$ccflags" in
 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
 esac
@@ -4906,7 +4933,7 @@ for thislib in $libswanted; do
                xxx=$thisdir/lib$thislib.$so
                $test -f "$xxx" && eval $libscheck
                $test -f "$xxx" && libstyle=shared
-           fi  
+           fi
            if test ! -f "$xxx"; then
                xxx=$thisdir/lib$thislib$_a
                $test -f "$xxx" && eval $libscheck
@@ -4948,7 +4975,7 @@ for thislib in $libswanted; do
                   ;;
                esac
                break
-           fi  
+           fi
        done
        if $test ! -f "$xxx"; then
            echo "No -l$thislib."
@@ -5032,6 +5059,32 @@ case "$DEBUGGING" in
 both|$define) dflt='-DDEBUGGING'
 esac
 
+: argument order is deliberate, as the flag will start with - which set could
+: think is an option
+checkccflag='check=$1; flag=$2; callback=$3;
+echo " ";
+echo "Checking if your compiler accepts $flag" 2>&1;
+echo "int main(void) { return 0; }" > gcctest.c;
+if $cc -O2 $flag -o gcctest gcctest.c 2>gcctest.out && ./gcctest; then
+    echo "Yes, it does." 2>&1;
+    if $test -s gcctest.out ; then
+        echo "But your platform does not like it:";
+        cat gcctest.out;
+    else
+       case "$ccflags" in
+       *$check*)
+           echo "Leaving current flags $ccflags alone." 2>&1
+           ;;
+       *) dflt="$dflt $flag";
+           eval $callback
+           ;;
+       esac
+    fi
+else
+    echo "Nope, it does not, but that is ok." 2>&1;
+fi
+'
+
 : We will not override a previous value, but we might want to
 : augment a hint file
 case "$hint" in
@@ -5043,7 +5096,7 @@ default|recommended)
        *-g*:old) dflt="$dflt -DDEBUGGING";;
        esac
        case "$gccversion" in
-       2*) if test -d /etc/conf/kconfig.d &&
+       2*) if $test -d /etc/conf/kconfig.d &&
                        $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
                then
                        # Interactive Systems (ISC) POSIX mode.
@@ -5054,40 +5107,28 @@ default|recommended)
        case "$gccversion" in
        1*) ;;
        2.[0-8]*) ;;
-       ?*)     echo " "
-               echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
-               echo 'int main(void) { return 0; }' > gcctest.c
-               if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
-                       echo "Yes, it does." 2>&1
-                       case "$ccflags" in
-                       *strict-aliasing*)
-                               echo "Leaving current flags $ccflags alone." 2>&1
-                               ;;
-                       *) dflt="$dflt -fno-strict-aliasing" ;;
-                       esac
-               else
-                       echo "Nope, it doesn't, but that's ok." 2>&1
-               fi
+       ?*)     set strict-aliasing -fno-strict-aliasing
+               eval $checkccflag
                ;;
        esac
        # For gcc, adding -pipe speeds up compilations for some, but apparently
        # some assemblers can't read from stdin.  (It also slows down compilations
        # in other cases, but those are apparently rarer these days.)  AD 5/2004.
        case "$gccversion" in
-       ?*)     echo " "
-               echo "Checking if your compiler accepts -pipe" 2>&1
-               echo 'int main(void) { return 0; }' > gcctest.c
-               if $cc -pipe -o gcctest gcctest.c; then
-                       echo "Yes, it does." 2>&1
-                       case "$ccflags" in
-                       *-pipe*)
-                               echo "Leaving current flags $ccflags alone." 2>&1
-                               ;;
-                       *) dflt="$dflt -pipe" ;;
-                       esac
-               else
-                       echo "Nope, it doesn't, but that's ok." 2>&1
-               fi
+       ?*)     set pipe -pipe
+               eval $checkccflag
+               ;;
+       esac
+
+       # on x86_64 (at least) we require an extra library (libssp) in the
+       # link command line. This library is not named, so I infer that it is
+       # an implementation detail that may change. Hence the safest approach
+       # is to add the flag to the flags passed to the compiler at link time,
+       # as that way the compiler can do the right implementation dependant
+       # thing. (NWC)
+       case "$gccversion" in
+       ?*)     set stack-protector -fstack-protector
+               eval $checkccflag
                ;;
        esac
        ;;
@@ -5228,6 +5269,15 @@ case "$ldflags" in
        ;;
 *) dflt="$ldflags";;
 esac
+# See note above about -fstack-protector
+case "$ccflags" in
+*-fstack-protector*) 
+       case "$dflt" in
+       *-fstack-protector*) ;; # Don't add it again
+       *) dflt="$dflt -fstack-protector" ;; 
+       esac
+       ;;
+esac
 
 : Try to guess additional flags to pick up local libraries.
 for thislibdir in $libpth; do
@@ -5294,7 +5344,7 @@ 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 "$run ./try" >>try.msg 2>&1; then
+       if $sh -c "$run ./try " >>try.msg 2>&1; then
                xxx=`$run ./try`
                case "$xxx" in
                "Ok") dflt=n ;;
@@ -5343,12 +5393,17 @@ y)
        ;;
 n) echo "OK, that should do.";;
 esac
-$rm_try
+$rm_try gcctest gcctest.out
 
 : define a shorthand compile call
 compile='
 mc_file=$1;
 shift;
+case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
+echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
+exit 1;
+fi;
+esac;
 $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='
@@ -5613,7 +5668,7 @@ $rm_try
 set d_int64_t
 eval $setvar
 
-
+: Check if 64bit ints have a quad type
 echo " "
 echo "Checking which 64-bit integer type we could use..." >&4
 
@@ -5672,7 +5727,7 @@ case "$quadtype" in
        ;;
 esac
 
-
+: Do we want 64bit support
 case "$uselonglong" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5681,7 +5736,7 @@ case "$uselonglong" in
 EOM
        use64bitint="$define"
        ;;
-esac                          
+esac
 case "$use64bits" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5690,7 +5745,7 @@ case "$use64bits" in
 EOM
        use64bitint="$define"
        ;;
-esac                          
+esac
 case "$use64bitints" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5699,7 +5754,7 @@ case "$use64bitints" in
 EOM
        use64bitint="$define"
        ;;
-esac                          
+esac
 case "$use64bitsint" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5708,7 +5763,7 @@ case "$use64bitsint" in
 EOM
        use64bitint="$define"
        ;;
-esac                          
+esac
 case "$uselonglongs" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5717,7 +5772,7 @@ case "$uselonglongs" in
 EOM
        use64bitint="$define"
        ;;
-esac                          
+esac
 case "$use64bitsall" in
 "$define"|true|[yY]*)
        cat <<EOM >&4
@@ -5726,7 +5781,7 @@ case "$use64bitsall" in
 EOM
        use64bitall="$define"
        ;;
-esac                          
+esac
 
 case "$ccflags" in
 *-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
@@ -5777,7 +5832,7 @@ case "$use64bitall" in
    *) dflt='n' ;;
    esac
    ;;
-esac   
+esac
 cat <<EOM
 
 You may also choose to try maximal 64-bitness.  It means using as much
@@ -6349,6 +6404,7 @@ case "$perl5" in
 *)     echo "Using $perl5." ;;
 esac
 
+: Set the siteprefix variables
 $cat <<EOM
 
 After $package is installed, you may wish to install various
@@ -6517,6 +6573,10 @@ case "$inc_version_list" in
 esac
 $rm -f getverlist
 
+: see if malloc/malloc.h has to be included
+set malloc/malloc.h i_mallocmalloc
+eval $inhdr
+
 : see if this is a malloc.h system
 : we want a real compile instead of Inhdr because some systems have a
 : malloc.h that just gives a compile error saying to use stdlib.h instead
@@ -6524,6 +6584,11 @@ echo " "
 $cat >try.c <<EOCP
 #include <stdlib.h>
 #include <malloc.h>
+#$i_mallocmalloc I_MALLOCMALLOC
+#ifdef I_MALLOCMALLOC
+# include <malloc/malloc.h>
+#endif
+
 int main () { return 0; }
 EOCP
 set try
@@ -6830,6 +6895,7 @@ else
        d_sitearch="$define"
 fi
 
+: Set the vendorprefix variables
 $cat <<EOM
 
 The installation process will also create a directory for
@@ -6886,6 +6952,7 @@ case "$ans" in
        ;;
 esac
 
+: Set the vendorlib variables
 case "$vendorprefix" in
 '')    d_vendorlib="$undef"
        vendorlib=''
@@ -6916,6 +6983,7 @@ vendorlib_stem=`echo "$vendorlibexp" | sed "s,/$version$,,"`
 prefixvar=vendorlib
 . ./installprefix
 
+: Set the vendorarch variables
 case "$vendorprefix" in
 '')    d_vendorarch="$undef"
        vendorarch=''
@@ -6999,6 +7067,7 @@ set prototype
 eval $setvar
 $rm -f prototype*
 
+: Check if ansi2knr is required
 case "$prototype" in
 "$define") ;;
 *)     ansi2knr='ansi2knr'
@@ -7022,6 +7091,89 @@ EOM
        ;;
 esac
 
+: DTrace support
+dflt_dtrace='/usr/sbin/dtrace'
+cat <<EOM
+
+Perl can be built to support DTrace on platforms that support it.
+DTrace is a diagnosis and performance analysis tool from Sun.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+
+while $test 1 ; do
+       case "$usedtrace" in
+       $define|true|[yY]*)
+               dflt='y'
+               ;;
+       ?*)
+               dflt='y'
+               dflt_dtrace=$usedtrace
+               ;;
+       *)
+               dflt='n'
+               ;;
+       esac
+
+       rp='Support DTrace if available?'
+       . ./myread
+       case "$ans" in
+       y|Y)    val="$define" ;;
+       *)      val="$undef" ;;
+       esac
+       set usedtrace
+       eval $setvar
+
+       test "X$usedtrace" != "X$define" && break
+
+       echo " "
+       rp='Where is the dtrace executable?'
+       dflt=$dflt_dtrace
+       . ./getfile
+       val="$ans"
+       set dtrace
+       eval $setvar
+
+       if $test -f $dtrace
+       then
+               if $dtrace -h -s ../perldtrace.d \
+                       -o perldtrace.tmp >/dev/null 2>&1 \
+                       && rm -f perldtrace.tmp
+               then
+                       echo " "
+                       echo "Good: your $dtrace knows about the -h flag."
+               else
+                       cat >&2 <<EOM
+
+*** $me:  Fatal Error:  $dtrace doesn't support -h flag
+***
+*** Your installed dtrace doesn't support the -h switch to compile a D
+*** program into a C header. Can't continue.
+
+EOM
+                       exit 1
+               fi
+               break;
+       fi
+
+       case "$fastread" in
+       yes)
+               cat >&2 <<EOM
+
+*** $me:  Fatal Error:  $dtrace not found.
+*** Can't continue.
+
+EOM
+               exit 1
+               ;;
+       *)
+               echo "*** $dtrace was not found."
+               echo " "
+               ;;
+       esac
+done
+
+: See if we want extra modules installed
 echo " "
 case "$extras" in
 '') dflt='n';;
@@ -7163,6 +7315,7 @@ fi
 set installusrbinperl
 eval $setvar
 
+: Check if we are using the GNU C library
 echo " "
 echo "Checking for GNU C Library..." >&4
 cat >try.c <<'EOCP'
@@ -7296,6 +7449,7 @@ case "$nm_so_opt" in
        ;;
 esac
 
+: Figure out where the libc is located
 case "$runnm" in
 true)
 : get list of predefined functions in a handy place
@@ -7525,31 +7679,31 @@ else
                echo " "
                echo "$nm didn't seem to work right. Trying $ar instead..." >&4
                com=''
-               if $ar t $libc > libc.tmp && $contains '^fprintf$' libc.tmp >/dev/null 2>&1; then
+               if $ar t $libc > libc.tmp && \
+                       $contains '^fprintf$' libc.tmp >/dev/null 2>&1
+               then
                        for thisname in $libnames $libc; do
                                $ar t $thisname >>libc.tmp
                        done
                        $sed -e "s/\\$_o\$//" < libc.tmp > libc.list
                        echo "Ok." >&4
                elif test "X$osname" = "Xos2" && $ar tv $libc > libc.tmp; then
-                       # Repeat libc to extract forwarders to DLL entries too
                        for thisname in $libnames $libc; do
                                $ar tv $thisname >>libc.tmp
-                               # Revision 50 of EMX has bug in $ar.
-                               # it will not extract forwarders to DLL entries
-                               # Use emximp which will extract exactly them.
                                emximp -o tmp.imp $thisname \
                                    2>/dev/null && \
                                    $sed -e 's/^\([_a-zA-Z0-9]*\) .*$/\1/p' \
                                    < tmp.imp >>libc.tmp
-                               $rm tmp.imp
+                               $rm -f tmp.imp
                        done
                        $sed -e "s/\\$_o\$//" -e 's/^ \+//' < libc.tmp > libc.list
                        echo "Ok." >&4
                else
                        echo "$ar didn't seem to work right." >&4
                        echo "Maybe this is a Cray...trying bld instead..." >&4
-                       if bld t $libc | $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list
+                       if  bld t $libc | \
+                               $sed -e 's/.*\///' -e "s/\\$_o:.*\$//" > libc.list &&
+                               $test -s libc.list
                        then
                                for thisname in $libnames; do
                                        bld t $libnames | \
@@ -7574,7 +7728,8 @@ define)
 *)  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
@@ -7586,7 +7741,7 @@ $rm -f libnames libpath
 set dld.h i_dld
 eval $inhdr
 
-
+: Check if we are using C++
 echo " "
 echo "Checking for C++..." >&4
 $cat >try.c <<'EOCP'
@@ -7887,6 +8042,16 @@ EOM
        ''|' ') dflt='none' ;;
        esac
 
+       case "$ldflags" in
+       *-fstack-protector*)
+           case "$dflt" in
+                       *-fstack-protector*) ;; # Don't add it again
+                       *) dflt="$dflt -fstack-protector" ;; 
+               esac
+               ;;
+       esac
+
+
     rp="Any special flags to pass to $ld to create a dynamically loaded library?"
     . ./myread
     case "$ans" in
@@ -7925,6 +8090,7 @@ EOM
     ;;
 esac
 
+: Do we want a shared libperl?
 also=''
 case "$usedl" in
 $undef)
@@ -7987,9 +8153,9 @@ true)
                # a version-specific architecture-dependent library, the version
                # number isn't really that important, except for making cc/ld happy.
                #
-               # A name such as libperl.so.3.1
+               # A name such as libperl.so.10.1
                majmin="libperl.$so.$patchlevel.$subversion"
-               # A name such as libperl.so.301
+               # A name such as libperl.so.100
                majonly=`echo $patchlevel $subversion |
                        $awk '{printf "%d%02d", $1, $2}'`
                majonly=libperl.$so.$majonly
@@ -8003,8 +8169,12 @@ true)
                linux*|gnu*)  # ld won't link with a bare -lperl otherwise.
                        dflt=libperl.$so
                        ;;
-               cygwin*) # ld links against an importlib
-                       dflt=libperl$lib_ext
+               cygwin*) # ld links now against the dll directly
+                       majmin="cygperl5_${patchlevel}_${subversion}.${so}"
+                       majonly=`echo $patchlevel $subversion |
+                               $awk '{printf "%03d%03d", $1, $2}'`
+                       majonly=cygperl5.$majonly.$so
+                       dflt=$majmin
                        ;;
                *)      # Try to guess based on whether libc has major.minor.
                        case "$libc" in
@@ -8077,7 +8247,7 @@ shrpdir=$archlibexp/CORE
 xxx=''
 tmp_shrpenv=''
 if "$useshrplib"; then
-    case "$osname" in 
+    case "$osname" in
        aix)
                # We'll set it in Makefile.SH...
                ;;
@@ -8100,13 +8270,16 @@ if "$useshrplib"; then
                # hpux doesn't like the default, either.
                tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
                ;;
+       cygwin)
+               # cygwin needs only ldlibpth
+               ;;
        *)
                tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
                ;;
        esac
        case "$xxx" in
        '') ;;
-       *)      
+       *)
                # Only add $xxx if it isn't already in ccdlflags.
                case " $ccdlflags " in
                *" $xxx "*)     ;;
@@ -8114,7 +8287,7 @@ if "$useshrplib"; then
                        cat <<EOM >&4
 
 Adding $xxx to the flags
-passed to $ld so that the perl executable will find the 
+passed to $ld so that the perl executable will find the
 installed shared $libperl.
 
 EOM
@@ -8254,7 +8427,7 @@ You can't have filenames longer than 14 chars.
 You can't even think about them!
 EOM
        val="$undef"
-fi 
+fi
 set d_flexfnam
 eval $setvar
 $rm -rf 123456789abcde*
@@ -8539,11 +8712,11 @@ case "$myhostname" in
                                echo "(Attempting domain name extraction from $tans)"
                                dflt=.`$sed -n -e 's/   / /g' \
                                  -e 's/^search  *\([^ ]*\).*/\1/p' $tans \
-                                 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
+                                 -e 1q 2>/dev/null`
                                case "$dflt" in
                                .) dflt=.`$sed -n -e 's/        / /g' \
                                     -e 's/^domain  *\([^ ]*\).*/\1/p' $tans \
-                                    | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
+                                    -e 1q 2>/dev/null`
                                        ;;
                                esac
                        fi
@@ -8612,6 +8785,7 @@ case "$phostname" in
        ;;
 esac
 
+: determine the e-mail address of the user who is running us
 $cat <<EOM
 
 I need to get your e-mail address in Internet format if possible, i.e.
@@ -8647,6 +8821,7 @@ while test "$cont"; do
        esac
 done
 
+: Ask e-mail of administrator
 $cat <<EOM
 
 If you or somebody else will be maintaining perl at your site, please
@@ -8885,6 +9060,7 @@ rp='Pathname where add-on public executable scripts should be installed?'
 prefixvar=sitescript
 . ./setprefixvar
 
+: Check if faststdio is requested and available
 case "$usefaststdio" in
 $define|true|[yY]*|'')
        xversion=`awk '/define[         ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
@@ -8908,7 +9084,7 @@ EOM
 rp='Use the "fast stdio" if available?'
 . ./myread
 case "$ans" in
-y|Y)   val="$define" ;;     
+y|Y)   val="$define" ;;
 *)      val="$undef" ;;
 esac
 set usefaststdio
@@ -9006,12 +9182,13 @@ rp="What is the type for file position used by fsetpos()?"
 set fpos_t fpostype long stdio.h sys/types.h
 eval $typedef_ask
 
+: Check size for Fpos_t
 echo " "
 case "$fpostype" in
 *_t) zzz="$fpostype"   ;;
 *)   zzz="fpos_t"      ;;
 esac
-echo "Checking the size of $zzz..." >&4 
+echo "Checking the size of $zzz..." >&4
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -9044,6 +9221,7 @@ else
        fpossize="$ans"
 fi
 
+: Check for large file support
 # Backward compatibility (uselfs is deprecated).
 case "$uselfs" in
 "$define"|true|[yY]*)
@@ -9157,6 +9335,7 @@ EOCP
        ;;
 esac
 
+: Set the vendorbin variables
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
        vendorbin=''
@@ -9178,6 +9357,7 @@ esac
 prefixvar=vendorbin
 . ./installprefix
 
+: Set the vendorhtml1dir variables
 case "$vendorprefix" in
 '')    vendorhtml1dir=''
        vendorhtml1direxp=''
@@ -9205,6 +9385,7 @@ $test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
 prefixvar=vendorhtml1dir
 . ./installprefix
 
+: Set the vendorhtml3dir variables
 case "$vendorprefix" in
 '')    vendorhtml3dir=''
        vendorhtml3direxp=''
@@ -9232,6 +9413,7 @@ $test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
 prefixvar=vendorhtml3dir
 . ./installprefix
 
+: Set the vendorman1dir variables
 case "$vendorprefix" in
 '')    vendorman1dir=''
        vendorman1direxp=''
@@ -9256,6 +9438,7 @@ $test X"$vendorman1dir" = "X" && vendorman1dir=' '
 prefixvar=vendorman1dir
 . ./installprefix
 
+: Set the vendorman3dir variables
 case "$vendorprefix" in
 '')    vendorman3dir=''
        vendorman3direxp=''
@@ -9280,6 +9463,7 @@ $test X"$vendorman3dir" = "X" && vendorman3dir=' '
 prefixvar=vendorman3dir
 . ./installprefix
 
+: Set the vendorscript variables
 case "$vendorprefix" in
 '')    d_vendorscript="$undef"
        vendorscript=''
@@ -9312,6 +9496,7 @@ prefixvar=vendorscript
 set qgcvt d_qgcvt
 eval $inlibc
 
+: Check print/scan long double stuff
 echo " "
 
 if $test X"$d_longdbl" = X"$define"; then
@@ -9787,6 +9972,7 @@ EOSH
 chmod +x protochk
 $eunicefix protochk
 
+: Define hasproto macro for Configure internal use
 hasproto='varname=$1; func=$2; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -9814,6 +10000,7 @@ eval $inhdr
 set sys/select.h i_sysselct
 eval $inhdr
 
+: Define hasfield macro for Configure internal use
 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -10418,7 +10605,7 @@ int main(void) {
 
 EOCP
     set try
-    if eval $compile; then
+    if eval $compile && $run ./try; then
        echo "Your C compiler supports __builtin_choose_expr."
        val="$define"
     else
@@ -10438,18 +10625,20 @@ case "$d_builtin_expect" in
 '')
     echo " "
     echo "Checking whether your compiler can handle __builtin_expect ..." >&4
-    $cat >builtin.c <<'EOCP'
+    $cat >try.c <<'EOCP'
 int main(void) {
     int n = 50;
     if ( __builtin_expect(n, 0) ) n = 1;
+    /* Remember shell exit code truth is 0, C truth is non-zero */
+    return !(n == 1);
 }
 EOCP
     set try
-    if eval $compile; then
-       echo "Your C compiler supports __builtin_choose_expr."
+    if eval $compile && $run ./try; then
+       echo "Your C compiler supports __builtin_expect."
        val="$define"
     else
-       echo "Your C compiler doesn't seem to understand __builtin_choose_expr."
+       echo "Your C compiler doesn't seem to understand __builtin_expect."
        val="$undef"
     fi
     ;;
@@ -10546,7 +10735,7 @@ echo "I could not find the definition for va_dcl... You have problems..." >&4
        val="$undef"; set i_stdarg; eval $setvar
        val="$undef"; set i_varargs; eval $setvar
        ;;
-*) 
+*)
        set i_varhdr
        eval $setvar
        case "$i_varhdr" in
@@ -10912,6 +11101,7 @@ eval $inlibc
 set clearenv d_clearenv
 eval $inlibc
 
+: Define hasstruct macro for Configure internal use
 hasstruct='varname=$1; struct=$2; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -10930,9 +11120,9 @@ set $varname;
 eval $setvar;
 $rm_try'
 
+: see whether socket exists
 socketlib=''
 sockethdr=''
-: see whether socket exists
 echo " "
 $echo $n "Hmm... $c" >&4
 if set socket val -f d_socket; eval $csym; $val; then
@@ -11017,7 +11207,7 @@ done
 set sys/uio.h i_sysuio
 eval $inhdr
 
-
+: Check for cmsghdr support
 echo " "
 echo "Checking to see if your system supports struct cmsghdr..." >&4
 set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
@@ -11505,6 +11695,7 @@ runnm="$xxx_runnm"
 set dlfcn.h i_dlfcn
 eval $inhdr
 
+: Check what extension to use for shared libs
 case "$usedl" in
 $define|y|true)
        $cat << EOM
@@ -11589,9 +11780,9 @@ int main()
 }
 EOM
        : Call the object file tmp-dyna.o in case dlext=o.
-       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 && 
+       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 && $to dyna.$dlext; then
                xxx=`$run ./fred`
                case $xxx in
@@ -11609,7 +11800,7 @@ EOM
        fi
        ;;
 esac
-               
+
 $rm -f fred fred.* dyna.$dlext dyna.* tmp-dyna.*
 
 set d_dlsymun
@@ -12134,6 +12325,24 @@ set d_open3
 eval $setvar
 $rm_try
 
+: script used to emit important warnings
+cat >warn <<EOS
+$startsh
+if test \$# -gt 0; then
+       echo "\$@" >msg
+else
+       cat >msg
+fi
+echo "*** WARNING:" >&4
+sed -e 's/^/*** /' <msg >&4
+echo "*** " >&4
+cat msg >>config.msg
+echo " " >>config.msg
+rm -f msg
+EOS
+chmod +x warn
+$eunicefix warn
+
 : see which of string.h or strings.h is needed
 echo " "
 strings=`./findhdr string.h`
@@ -12146,7 +12355,7 @@ else
        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
+               ./warn "No string header found -- You'll surely have problems."
        fi
 fi
 set i_string
@@ -12736,8 +12945,8 @@ eval $inlibc
 set fcntl d_fcntl
 eval $inlibc
 
-echo " "
 : See if fcntl-based locking works.
+echo " "
 $cat >try.c <<EOCP
 #$i_stdlib I_STDLIB
 #ifdef I_STDLIB
@@ -12925,7 +13134,6 @@ eval $inlibc
 set fpclassl d_fpclassl
 eval $inlibc
 
-
 : check for fpos64_t
 echo " "
 echo "Checking to see if you have fpos64_t..." >&4
@@ -12960,7 +13168,7 @@ eval $inhdr
 set sys/mount.h i_sysmount
 eval $inhdr
 
-
+: Check for fs_data_s
 echo " "
 echo "Checking to see if your system supports struct fs_data..." >&4
 set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
@@ -12981,12 +13189,10 @@ esac
 set fsetpos d_fsetpos
 eval $inlibc
 
-
 : see if fstatfs exists
 set fstatfs d_fstatfs
 eval $inlibc
 
-
 : see if statvfs exists
 set statvfs d_statvfs
 eval $inlibc
@@ -13007,8 +13213,8 @@ case "$longsize" in
 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
 esac
 
-d_futimes="$undef"
 : check for a working futimes
+d_futimes="$undef"
 echo " "
 echo "Checking if you have a working futimes()" >&4
 $cat >try.c <<EOCP
@@ -13050,7 +13256,6 @@ eval $inlibc
 set getespwnam d_getespwnam
 eval $inlibc
 
-
 : see if getfsstat exists
 set getfsstat d_getfsstat
 eval $inlibc
@@ -13285,7 +13490,7 @@ case "$d_uname$d_gethname" in
 *define*)
        dflt=n
        cat <<EOM
+
 Every now and then someone has a $call() that lies about the hostname
 but can't be fixed for political or economic reasons.  If you wish, I can
 pretend $call() isn't there and maybe compute hostname at run-time
@@ -13796,6 +14001,7 @@ eval $hasproto
 set getpagesize d_getpagsz
 eval $inlibc
 
+: Optional checks for getprotobyname and getprotobynumber
 
 : see if getprotobyname exists
 set getprotobyname d_getpbyname
@@ -14156,6 +14362,7 @@ case "$d_getpwuid_r" in
        ;;
 esac
 
+: Optional checks for getsbyname and getsbyport
 
 : see if getservbyname exists
 set getservbyname d_getsbyname
@@ -14645,10 +14852,10 @@ eval $setvar
 set math.h i_math
 eval $inhdr
 
+: check to see if math.h defines _LIB_VERSION
 d_libm_lib_version="$undef"
 case $i_math in
     $define)
-       : check to see if math.h defines _LIB_VERSION
        echo " "
        echo "Checking to see if your libm supports _LIB_VERSION..." >&4
        $cat >try.c <<EOCP
@@ -15058,7 +15265,7 @@ fi
 set d_msg
 eval $setvar
 
-
+: Check for msghdr_s
 echo " "
 echo "Checking to see if your system supports struct msghdr..." >&4
 set d_msghdr_s msghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
@@ -15120,7 +15327,7 @@ set d_volatile
 eval $setvar
 $rm_try
 
-
+: Check basic sizes
 echo " "
 $echo "Choosing the C types to be used for Perl's internal types..." >&4
 
@@ -15177,7 +15384,7 @@ int main() {
 }
 EOCP
 
-i8type=char
+i8type="signed char"
 u8type="unsigned char"
 i8size=1
 u8size=1
@@ -15334,6 +15541,89 @@ case "$nv_preserves_uv_bits" in
 esac
 $rm_try
 
+$echo "Checking to find the largest integer value your NVs can hold..." >&4
+: volatile so that the compiler has to store it out to memory.
+if test X"$d_volatile" = X"$define"; then
+       volatile=volatile
+fi
+$cat <<EOP >try.c
+#include <stdio.h>
+
+typedef $nvtype NV;
+
+int
+main() {
+  NV value = 2;
+  int count = 1;
+
+  while(count < 256) {
+    $volatile NV up = value + 1.0;
+    $volatile NV negated = -value;
+    $volatile NV down = negated - 1.0;
+    $volatile NV got_up = up - value;
+    int up_good = got_up == 1.0;
+    int got_down = down - negated;
+    int down_good = got_down == -1.0;
+
+    if (down_good != up_good) {
+      fprintf(stderr,
+             "Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n",
+             up_good, (double) got_up, down_good, (double) got_down,
+             count, (double) value);
+      return 1;
+    }
+    if (!up_good) {
+      while (1) {
+       if (count > 8) {
+         count -= 8;
+         fputs("256.0", stdout);
+       } else {
+         count--;
+         fputs("2.0", stdout);
+       }
+       if (!count) {
+         puts("");
+         return 0;
+       }
+       fputs("*", stdout);
+      }
+    }
+    value *= 2;
+    ++count;
+  }
+  fprintf(stderr, "Cannot overflow integer range, even at 2**%d (%.20f)\n",
+         count, (double) value);
+  return 1;
+}
+EOP
+set try
+
+nv_overflows_integers_at='0'
+if eval $compile; then
+    xxx="`$run ./try`"
+    case "$?" in
+       0)
+           case "$xxx" in
+               2*)  cat >&4 <<EOM
+The largest integer your NVs can preserve is equal to $xxx
+EOM
+                   nv_overflows_integers_at="$xxx"
+                   ;;
+               *)  cat >&4 <<EOM
+Cannot determine the largest integer value your NVs can hold, unexpected output
+'$xxx'
+EOM
+                   ;;
+           esac
+           ;;
+       *)  cat >&4 <<EOM
+Cannot determine the largest integer value your NVs can hold
+EOM
+           ;;
+    esac
+fi
+$rm_try
+
 $echo "Checking whether NV 0.0 is all bits zero in memory..." >&4
 : volatile so that the compiler has to store it out to memory.
 if test X"$d_volatile" = X"$define"; then
@@ -15546,6 +15836,7 @@ eval $inlibc
 set readlink d_readlink
 eval $inlibc
 
+: Check if exe is symlink to abs path of executing program
 echo " "
 procselfexe=''
 val="$undef"
@@ -15653,7 +15944,6 @@ eval $setvar
 set pthread_attr_setscope d_pthread_attr_setscope
 eval $inlibc
 
-
 : see whether the various POSIXish _yields exist
 $cat >try.c <<EOP
 #include <pthread.h>
@@ -16778,7 +17068,6 @@ eval $inlibc
 set sfio.h i_sfio
 eval $inhdr
 
-
 : see if sfio library is available
 case "$i_sfio" in
 $define)
@@ -16928,8 +17217,8 @@ fi
 set d_shm
 eval $setvar
 
-echo " "
 : see if we have sigaction
+echo " "
 if set sigaction val -f d_sigaction; eval $csym; $val; then
        echo 'sigaction() found.' >&4
        $cat > try.c <<EOP
@@ -17182,7 +17471,6 @@ int main(int argc, char **argv) {
 EOP
 set try
 
-d_sprintf_returns_strlen="$undef"
 if eval $compile; then
     xxx="`$run ./try`"
     case "$?" in
@@ -17197,6 +17485,9 @@ EOM
        d_sprintf_returns_strlen="$undef"
         ;;
     esac
+else
+    echo "(I can't seem to compile the test program--assuming it doesn't)" >&4
+    d_sprintf_returns_strlen="$undef"
 fi
 $rm_try
 
@@ -17296,24 +17587,21 @@ eval $hasproto
 set sys/stat.h i_sysstat
 eval $inhdr
 
-
 : see if stat knows about block sizes
 echo " "
 echo "Checking to see if your struct stat has st_blocks field..." >&4
 set d_statblks stat st_blocks $i_sysstat sys/stat.h
 eval $hasfield
 
-
 : see if this is a sys/vfs.h system
 set sys/vfs.h i_sysvfs
 eval $inhdr
 
-
 : see if this is a sys/statfs.h system
 set sys/statfs.h i_sysstatfs
 eval $inhdr
 
-
+: Check for statfs_s
 echo " "
 echo "Checking to see if your system supports struct statfs..." >&4
 set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
@@ -17324,10 +17612,9 @@ case "$d_statfs_s" in
 esac
 
 
-
 : see if struct statfs knows about f_flags
 case "$d_statfs_s" in
-define)        
+define)
        echo " "
        echo "Checking to see if your struct statfs has f_flags field..." >&4
        set d_statfs_f_flags statfs f_flags $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
@@ -17343,6 +17630,7 @@ case "$d_statfs_f_flags" in
 *)              echo "No, it doesn't." ;;
 esac
 
+: Check stream access
 $cat >&4 <<EOM
 Checking how to access stdio streams by file descriptor number...
 EOM
@@ -17536,7 +17824,7 @@ EOM
 #define strtoll _strtoll
 #endif
 #include <stdio.h>
-extern long long int strtoll(char *s, char **, int); 
+extern long long int strtoll(char *s, char **, int);
 static int bad = 0;
 int check(char *s, long long ell, int een) {
        long long gll;
@@ -17593,7 +17881,7 @@ EOM
        $cat >try.c <<'EOCP'
 #include <errno.h>
 #include <stdio.h>
-extern unsigned long int strtoul(char *s, char **, int); 
+extern unsigned long int strtoul(char *s, char **, int);
 static int bad = 0;
 void check(char *s, unsigned long eul, int een) {
        unsigned long gul;
@@ -17676,7 +17964,7 @@ EOM
 #define strtoull __strtoull
 #endif
 #include <stdio.h>
-extern unsigned long long int strtoull(char *s, char **, int); 
+extern unsigned long long int strtoull(char *s, char **, int);
 static int bad = 0;
 int check(char *s, long long eull, int een) {
        long long gull;
@@ -17730,7 +18018,7 @@ EOM
        $cat >try.c <<'EOCP'
 #include <errno.h>
 #include <stdio.h>
-extern unsigned long long int strtouq(char *s, char **, int); 
+extern unsigned long long int strtouq(char *s, char **, int);
 static int bad = 0;
 void check(char *s, unsigned long long eull, int een) {
        unsigned long long gull;
@@ -17829,6 +18117,10 @@ if test "X$d_time" = X -o X"$timetype" = X; then
     eval $setvar
 fi
 
+: see if timegm exists
+set timegm d_timegm
+eval $inlibc
+
 : see if this is a sys/times.h system
 set sys/times.h i_systimes
 eval $inhdr
@@ -17957,6 +18249,7 @@ fi
 set d_tzname
 eval $setvar
 
+: Check if is a multiplatform env
 case "$osname" in
 next|rhapsody|darwin) multiarch="$define" ;;
 esac
@@ -18047,6 +18340,7 @@ EOM
        ;;
 esac
 
+: Checking 32bit aligndness
 $cat <<EOM
 
 Checking to see whether you can access character data unalignedly...
@@ -18671,6 +18965,7 @@ EOCP
        esac
 done
 
+: Determine if this is an EBCDIC system
 echo " "
 echo "Determining whether or not we are on an EBCDIC system..." >&4
 $cat >try.c <<'EOM'
@@ -18698,6 +18993,7 @@ $rm_try
 set ebcdic
 eval $setvar
 
+: Check how to flush
 echo " "
 $cat >&4 <<EOM
 Checking how to flush all pending stdio output...
@@ -18817,7 +19113,7 @@ EOM
                        fi
                fi
        fi
-       $rm_try
+       $rm -f core try.core core.try.*
        case "$fflushNULL" in
        x)      $cat >&4 <<EOM
 Your fflush(NULL) works okay for output streams.
@@ -18985,7 +19281,7 @@ We won't be flushing handles at all before fork/exec/popen.
 EOM
        ;;
 esac
-$rm_try
+$rm_try tryp
 
 : Store the full pathname to the ar program for use in the C program
 : Respect a hint or command line value for full_ar.
@@ -19020,12 +19316,13 @@ gid_t) echo "gid_t found." ;;
        ;;
 esac
 
+: Check the size of GID
 echo " "
 case "$gidtype" in
 *_t) zzz="$gidtype"    ;;
 *)   zzz="gid"         ;;
 esac
-echo "Checking the size of $zzz..." >&4 
+echo "Checking the size of $zzz..." >&4
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -19055,12 +19352,13 @@ else
 fi
 
 
+: Check if GID is signed
 echo " "
 case "$gidtype" in
 *_t) zzz="$gidtype"    ;;
 *)   zzz="gid"         ;;
 esac
-echo "Checking the sign of $zzz..." >&4 
+echo "Checking the sign of $zzz..." >&4
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -19092,6 +19390,7 @@ else
 fi
 
 
+: Check 64bit sizes
 echo " "
 
 if $test X"$quadtype" != X; then
@@ -19247,7 +19546,7 @@ case "$sPRId64" in
        ;;
 esac
 
-
+: Check format strings for internal types
 echo " "
 $echo "Checking the format strings to be used for Perl's internal types..." >&4
 
@@ -19306,6 +19605,7 @@ case "$ivdformat" in
     ;;
 esac
 
+: Check format string for GID
 
 echo " "
 $echo "Checking the format string to be used for gids..." >&4
@@ -19353,7 +19653,6 @@ eval $inlibc
 set setgroups d_setgrps
 eval $inlibc
 
-
 : Find type of 2nd arg to 'getgroups()' and 'setgroups()'
 echo " "
 case "$d_getgrps$d_setgrps" in
@@ -19374,6 +19673,7 @@ EOM
 *)  groupstype="$gidtype";;
 esac
 
+: MAD = Misc Attribute Definition
 
 if $test $patchlevel -lt 9; then
 : MAD is not available in 5.8.x or earlier.
@@ -19407,6 +19707,7 @@ esac
 set mad
 eval $setvar
 
+: check whether make sets MAKE
 echo " "
 echo "Checking if your $make program sets \$(MAKE)..." >&4
 case "$make_set_make" in
@@ -19650,9 +19951,6 @@ case "$pager" in
        esac
        ;;
 *)     dflt="$pager"
-       : Instruct ./getfile to trust the hinted or previous pager value,
-       : even if it does not begin with a slash.  For example, on os2,
-       : pager might be cmd /c more.  See comments in UU/getfile.
        fn="f/($pager)"
        ;;
 esac
@@ -19721,7 +20019,170 @@ else
 fi
 $rm -f foo* bar*
 
-: check for type of arguments to select. 
+: see if this is a values.h system
+set values.h i_values
+eval $inhdr
+
+: Check the max offset that gmtime and localtime accept
+echo "Checking max offsets that gmtime () accepts"
+
+case $i_values in
+    define) yyy="#include <values.h>" ;;
+    *)      yyy="" ;;
+    esac
+
+case "$sGMTIME_min/$sGMTIME_max" in
+    0/0|/)
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+$yyy
+
+int i;
+struct tm *tmp;
+time_t pt;
+
+void gm_check (time_t t)
+{
+    tmp = gmtime (&t);
+    if (tmp == NULL || tmp->tm_year < -1900)
+       tmp = NULL;
+    else
+       pt = t;
+    } /* gm_check */
+
+int check_max ()
+{
+    tmp = NULL;
+    pt  = 0;
+#ifdef MAXLONG
+    gm_check (MAXLONG);
+#endif
+    if (tmp == NULL || tmp->tm_year < 0) {
+       for (i = 63; i >= 0; i--) {
+           time_t x = pt | ((time_t)1 << i);
+           if (x < 0) continue;
+           gm_check (x);
+           }
+       }
+    printf ("sGMTIME_max=%ld\n", pt);
+    return (0);
+  } /* check_max */
+
+int check_min ()
+{
+    tmp = NULL;
+    pt  = 0;
+#ifdef MINLONG
+    gm_check (MINLONG);
+#endif
+    if (tmp == NULL) {
+       for (i = 36; i >= 0; i--) {
+           time_t x = pt - ((time_t)1 << i);
+           if (x > 0) continue;
+           gm_check (x);
+           }
+       }
+    printf ("sGMTIME_min=%ld\n", pt);
+    return (0);
+    } /* check_min */
+
+int main (int argc, char *argv[])
+{
+    fprintf (stderr, "Sizeof time_t = %ld\n", sizeof (time_t));
+    check_max ();
+    check_min ();
+    return (0);
+    } /* main */
+EOCP
+       set try
+       if eval $compile; then
+           eval `$run ./try`
+       else
+           echo "Cannot determine sGMTIME_max and sGMTIME_min." >&4
+           fi
+       $rm_try
+       ;;
+    esac
+
+echo "Checking max offsets that localtime () accepts"
+
+case "$sLOCALTIME_min/$sLOCALTIME_max" in
+    0/0|/)
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+#include <time.h>
+$yyy
+
+int i;
+struct tm *tmp;
+time_t pt;
+
+void local_check (time_t t)
+{
+    tmp = localtime (&t);
+    if (tmp == NULL || tmp->tm_year < -1900)
+       tmp = NULL;
+    else
+       pt = t;
+    } /* local_check */
+
+int check_max ()
+{
+    tmp = NULL;
+    pt  = 0;
+#ifdef MAXLONG
+    local_check (MAXLONG);
+#endif
+    if (tmp == NULL || tmp->tm_year < 0) {
+       for (i = 63; i >= 0; i--) {
+           time_t x = pt | ((time_t)1 << i);
+           if (x < 0) continue;
+           local_check (x);
+           }
+       }
+    printf ("sLOCALTIME_max=%ld\n", pt);
+    return (0);
+  } /* check_max */
+
+int check_min ()
+{
+    tmp = NULL;
+    pt  = 0;
+#ifdef MINLONG
+    local_check (MINLONG);
+#endif
+    if (tmp == NULL) {
+       for (i = 36; i >= 0; i--) {
+           time_t x = pt - ((time_t)1 << i);
+           if (x > 0) continue;
+           local_check (x);
+           }
+       }
+    printf ("sLOCALTIME_min=%ld\n", pt);
+    return (0);
+    } /* check_min */
+
+int main (int argc, char *argv[])
+{
+    check_max ();
+    check_min ();
+    return (0);
+    } /* main */
+EOCP
+       set try
+       if eval $compile; then
+           eval `$run ./try`
+       else
+           echo "Cannot determine sLOCALTIME_max and sLOCALTIME_min." >&4
+           fi
+       $rm_try
+       ;;
+    esac
+
+: check for type of arguments to select.
 case "$selecttype" in
 '') case "$d_select" in
        $define)
@@ -19730,7 +20191,7 @@ case "$selecttype" in
 Checking to see what type of arguments are accepted by select().
 EOM
                hdrs="$define sys/types.h
-                       $i_systime sys/time.h 
+                       $i_systime sys/time.h
                        $i_sysselct sys/select.h
                        $d_socket sys/socket.h"
                : The first arg can be int, unsigned, or size_t
@@ -19879,28 +20340,20 @@ EOM
 esac
 
 : Trace out the files included by signal.h, then look for SIGxxx names.
-: Remove SIGARRAYSIZE used by HPUX.
-: Remove SIGSTKSIZE used by Linux.
-: Remove SIGSTKSZ used by Posix.
-: Remove SIGTYP void lines used by OS2.
-: Some cpps, like os390, dont give the file name anywhere
 if [ "X$fieldn" = X ]; then
        : Just make some guesses.  We check them later.
        xxx='/usr/include/signal.h /usr/include/sys/signal.h'
 else
        xxx=`echo '#include <signal.h>' |
        $cppstdin $cppminus $cppflags 2>/dev/null |
-       $grep '^[       ]*#.*include' | 
-       $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
+       $grep '^[       ]*#.*include' |
+       $awk "{print \\$$fieldn}" | $sed 's!"!!g' |\
+               $sed 's!\\\\\\\\!/!g' | $sort | $uniq`
 fi
-: Check this list of files to be sure we have parsed the cpp output ok.
-: This will also avoid potentially non-existent files, such 
-: as ../foo/bar.h
 xxxfiles=''
 for xx in $xxx /dev/null ; do
        $test -f "$xx" && xxxfiles="$xxxfiles $xx"
 done
-: If we have found no files, at least try signal.h
 case "$xxxfiles" in
 '')    xxxfiles=`./findhdr signal.h` ;;
 esac
@@ -20011,14 +20464,14 @@ $1 ~ /^NSIG$/ { nsig = $2 }
     if (sig_name[$2]) {
        dup_name[ndups] = $1
        dup_num[ndups] = $2
-       ndups++ 
+       ndups++
     }
     else {
        sig_name[$2] = $1
        sig_num[$2] = $2
     }
 }
-END { 
+END {
     if (nsig == 0) {
        nsig = maxsig + 1
     }
@@ -20028,7 +20481,7 @@ END {
            printf("%s %d\n", sig_name[n], sig_num[n])
        }
        else {
-           printf("NUM%d %d\n", n, n) 
+           printf("NUM%d %d\n", n, n)
        }
     }
     for (n = 0; n < ndups; n++) {
@@ -20048,7 +20501,8 @@ $cat >>signal_cmd <<'EOS'
 
 set signal
 if eval $compile_ok; then
-       $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $sort -n +1) | $uniq | $awk -f signal.awk >signal.lst
+       $run ./signal$_exe | ($sort -n -k 2 2>/dev/null || $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
@@ -20148,14 +20602,15 @@ echo $sig_name | $awk \
        printf "\n"
 }'
 sig_size=`echo $sig_name | awk '{print NF}'`
-$rm -f signal signal.c signal.awk signal.lst signal_cmd 
+$rm -f signal signal.c signal.awk signal.lst signal_cmd
 
+: Check size of size
 echo " "
 case "$sizetype" in
 *_t) zzz="$sizetype"   ;;
 *)   zzz="filesize"    ;;
 esac
-echo "Checking the size of $zzz..." >&4 
+echo "Checking the size of $zzz..." >&4
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -20307,8 +20762,7 @@ $rm_try
 
 : see what type of char stdio uses.
 echo " "
-echo '#include <stdio.h>' > stdio.c
-$cppstdin $cppminus < stdio.c > stdioh
+echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
 if $contains 'unsigned.*char.*_ptr;' stdioh >/dev/null 2>&1 ; then
        echo "Your stdio uses unsigned chars." >&4
        stdchar="unsigned char"
@@ -20316,7 +20770,7 @@ else
        echo "Your stdio uses signed chars." >&4
        stdchar="char"
 fi
-$rm -f stdio.* stdioh
+$rm -f stdioh
 
 : see what type uids are declared as in the kernel
 echo " "
@@ -20342,12 +20796,13 @@ uid_t)        echo "uid_t found." ;;
        ;;
 esac
 
+: Check size of UID
 echo " "
 case "$uidtype" in
 *_t) zzz="$uidtype"    ;;
 *)   zzz="uid"         ;;
 esac
-echo "Checking the size of $zzz..." >&4 
+echo "Checking the size of $zzz..." >&4
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -20376,6 +20831,7 @@ else
        echo "(I can't compile the test program--guessing $uidsize.)" >&4
 fi
 
+: Check if UID is signed
 echo " "
 case "$uidtype" in
 *_t) zzz="$uidtype"    ;;
@@ -20413,7 +20869,7 @@ else
 fi
 
 
-
+: Check format string for UID
 echo " "
 $echo "Checking the format string to be used for uids..." >&4
 
@@ -20452,7 +20908,7 @@ case "$uidsign" in
        ;;
 esac
 
-
+: Check if site customization support was requested
 case "$usesitecustomize" in
     $define|true|[Yy]*)
        usesitecustomize="$define"
@@ -20493,6 +20949,10 @@ case "$yacc" in
        ;;
 esac
 
+: see if this is a assert.h system
+set assert.h i_assert
+eval $inhdr
+
 : see if this is a fp.h system
 set fp.h i_fp
 eval $inhdr
@@ -20521,6 +20981,35 @@ val="$t_gdbm"
 set i_gdbm
 eval $setvar
 
+: see if ndbm.h is available
+set ndbm.h i_ndbm
+eval $inhdr
+: Compatibility location for RedHat 7.1
+set gdbm/ndbm.h i_gdbmndbm
+eval $inhdr
+: Compatibility location for Debian 4.0
+set gdbm-ndbm.h i_gdbm_ndbm
+eval $inhdr
+
+if $test "$i_ndbm" = "$define" -o "$i_gdbmndbm" = "$define" -o "$i_gdbm_ndbm" = "$define"; then
+       : see if dbm_open exists
+       set dbm_open d_dbm_open
+       eval $inlibc
+       case "$d_dbm_open" in
+       $undef)
+               i_ndbm="$undef"
+               i_gdbmndbm="$undef"
+               i_gdbm_ndbm="$undef"
+               echo "We won't be including <ndbm.h>"
+           val="$undef"
+               ;;
+       *) val="$define"
+          ;;
+       esac
+fi
+set d_ndbm
+eval $setvar
+
 : see if this is a ieeefp.h system
 case "$i_ieeefp" in
 '' ) set ieeefp.h i_ieeefp
@@ -20540,46 +21029,10 @@ else
        i_machcthr="$undef"
 fi
 
-
-
 : see if this is a mntent.h system
 set mntent.h i_mntent
 eval $inhdr
 
-: see if ndbm.h is available
-set ndbm.h t_ndbm
-eval $inhdr
-
-case "$t_ndbm" in
-$undef)
-    # Some Linux distributions such as RedHat 7.1 put the
-    # ndbm.h header in /usr/include/gdbm/ndbm.h.
-    if $test -f /usr/include/gdbm/ndbm.h; then
-       echo '<gdbm/ndbm.h> found.'
-        ccflags="$ccflags -I/usr/include/gdbm"
-        cppflags="$cppflags -I/usr/include/gdbm"
-        t_ndbm=$define
-    fi
-    ;;
-esac
-
-case "$t_ndbm" in
-$define)
-       : see if dbm_open exists
-       set dbm_open d_dbm_open
-       eval $inlibc
-       case "$d_dbm_open" in
-       $undef)
-               t_ndbm="$undef"
-               echo "We won't be including <ndbm.h>"
-               ;;
-       esac
-       ;;
-esac
-val="$t_ndbm"
-set i_ndbm
-eval $setvar
-
 : see if net/errno.h is available
 val=''
 set net/errno.h val
@@ -20621,6 +21074,7 @@ eval $inhdr
 set prot.h i_prot
 eval $inhdr
 
+: Preprocessor symbols
 echo " "
 $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
 $cat <<'EOSH' > Cppsym.know
@@ -20861,14 +21315,14 @@ case "$val3" in
                                echo "<sgtty.h> found." >&4
                        else
                                echo "System is pyramid with BSD universe."
-                               echo "<sgtty.h> not found--you could have problems." >&4
+                               ./warn "<sgtty.h> not found--you could have problems."
                        fi;;
                *) if $test `./findhdr termio.h`; then
                                val="$define"
                                echo "<termio.h> found." >&4
                        else
                                echo "System is pyramid with USG universe."
-                               echo "<termio.h> not found--you could have problems." >&4
+                               ./warn "<termio.h> not found--you could have problems."
                        fi;;
                esac
        elif ./usg; then
@@ -20879,7 +21333,7 @@ case "$val3" in
                        echo "<sgtty.h> found." >&4
                        val2="$define"
                else
-echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
+                       ./warn "Neither <termio.h> nor <sgtty.h> found--cross fingers!"
                fi
        else
                if $test `./findhdr sgtty.h`; then
@@ -20889,7 +21343,7 @@ echo "Neither <termio.h> nor <sgtty.h> found--you could have problems." >&4
                        echo "<termio.h> found." >&4
                        val="$define"
                else
-echo "Neither <sgtty.h> nor <termio.h> found--you could have problems." >&4
+                       ./warn "Neither <sgtty.h> nor <termio.h> found--cross fingers!"
                fi
        fi;;
 esac
 set i_syssockio
 eval $setvar
 
-
 : see if this is a syslog.h system
 set syslog.h i_syslog
 eval $inhdr
 
-
 : see if this is a sys/mode.h system
 set sys/mode.h i_sysmode
 eval $inhdr
 
+: see if there is a sys/poll.h file
+set sys/poll.h i_syspoll
+eval $inhdr
+
 : see if sys/resource.h has to be included
 set sys/resource.h i_sysresrc
 eval $inhdr
@@ -20972,7 +21428,6 @@ eval $inhdr
 set sys/un.h i_sysun
 eval $inhdr
 
-
 : see if this is a sys/utsname.h system
 set sys/utsname.h i_sysutsname
 eval $inhdr
@@ -20989,10 +21444,6 @@ eval $inhdr
 set utime.h i_utime
 eval $inhdr
 
-: see if this is a values.h system
-set values.h i_values
-eval $inhdr
-
 : see if this is a vfork system
 case "$d_vfork" in
 "$define")
@@ -21004,6 +21455,7 @@ case "$d_vfork" in
        ;;
 esac
 
+: Check extensions
 echo " "
 echo "Looking for extensions..." >&4
 : If we are using the old config.sh, known_extensions may contain
@@ -21043,10 +21495,12 @@ 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"
+# Special case:  Add in modules that nest beyond the first level.
+# Currently threads/shared and Hash/Util/FieldHash, since they are
+# not picked up by the recursive find above (and adding in general
+# recursive finding breaks SDBM_File/sdbm).
+# A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
+known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
 set X $known_extensions
 shift
 known_extensions="$*"
@@ -21398,7 +21852,7 @@ sunos*X4*)
     ;;
 *) case "$usedl" in
     $define|true|[yY]*)
-           set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` 
+           set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` 
            shift
            perllibs="$*"
            ;;
@@ -21431,9 +21885,9 @@ if test -d ../UU; then
        cd ..
 fi
 
-: configuration may be patched via a 'config.arch' file
+: configuration may be unconditionally patched via a 'config.arch' file
 if $test -f config.arch; then
-       echo "I see a config.arch file, loading it."
+       echo "I see a config.arch file, loading it." >&4
        . ./config.arch
 fi
 
@@ -21481,13 +21935,16 @@ $startsh
 # Configured by     : $cf_by
 # Target system     : $myuname
 
+EOT
+$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
+$spitshell <<EOT >>config.sh
+
 Author='$Author'
 Date='$Date'
 Header='$Header'
 Id='$Id'
 Locker='$Locker'
 Log='$Log'
-Mcc='$Mcc'
 RCSfile='$RCSfile'
 Revision='$Revision'
 Source='$Source'
@@ -21795,6 +22252,7 @@ d_msgsnd='$d_msgsnd'
 d_msync='$d_msync'
 d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
+d_ndbm='$d_ndbm'
 d_nice='$d_nice'
 d_nl_langinfo='$d_nl_langinfo'
 d_nv_preserves_uv='$d_nv_preserves_uv'
@@ -21952,6 +22410,7 @@ d_tcsetpgrp='$d_tcsetpgrp'
 d_telldir='$d_telldir'
 d_telldirproto='$d_telldirproto'
 d_time='$d_time'
+d_timegm='$d_timegm'
 d_times='$d_times'
 d_tm_tm_gmtoff='$d_tm_tm_gmtoff'
 d_tm_tm_zone='$d_tm_tm_zone'
@@ -21999,6 +22458,7 @@ dlsrc='$dlsrc'
 doublesize='$doublesize'
 drand01='$drand01'
 drand48_r_proto='$drand48_r_proto'
+dtrace='$dtrace'
 dynamic_ext='$dynamic_ext'
 eagain='$eagain'
 ebcdic='$ebcdic'
@@ -22080,6 +22540,7 @@ i64type='$i64type'
 i8size='$i8size'
 i8type='$i8type'
 i_arpainet='$i_arpainet'
+i_assert='$i_assert'
 i_bsdioctl='$i_bsdioctl'
 i_crypt='$i_crypt'
 i_db='$i_db'
@@ -22092,6 +22553,8 @@ i_float='$i_float'
 i_fp='$i_fp'
 i_fp_class='$i_fp_class'
 i_gdbm='$i_gdbm'
+i_gdbm_ndbm='$i_gdbm_ndbm'
+i_gdbmndbm='$i_gdbmndbm'
 i_grp='$i_grp'
 i_ieeefp='$i_ieeefp'
 i_inttypes='$i_inttypes'
@@ -22101,6 +22564,7 @@ i_limits='$i_limits'
 i_locale='$i_locale'
 i_machcthr='$i_machcthr'
 i_malloc='$i_malloc'
+i_mallocmalloc='$i_mallocmalloc'
 i_math='$i_math'
 i_memory='$i_memory'
 i_mntent='$i_mntent'
@@ -22135,6 +22599,7 @@ i_sysmode='$i_sysmode'
 i_sysmount='$i_sysmount'
 i_sysndir='$i_sysndir'
 i_sysparam='$i_sysparam'
+i_syspoll='$i_syspoll'
 i_sysresrc='$i_sysresrc'
 i_syssecrt='$i_syssecrt'
 i_sysselct='$i_sysselct'
@@ -22278,6 +22743,7 @@ nroff='$nroff'
 nvEUformat='$nvEUformat'
 nvFUformat='$nvFUformat'
 nvGUformat='$nvGUformat'
+nv_overflows_integers_at='$nv_overflows_integers_at'
 nv_preserves_uv_bits='$nv_preserves_uv_bits'
 nveformat='$nveformat'
 nvfformat='$nvfformat'
@@ -22332,6 +22798,10 @@ rm_try='$rm_try'
 rmail='$rmail'
 run='$run'
 runnm='$runnm'
+sGMTIME_max='$sGMTIME_max'
+sGMTIME_min='$sGMTIME_min'
+sLOCALTIME_max='$sLOCALTIME_max'
+sLOCALTIME_min='$sLOCALTIME_min'
 sPRIEUldbl='$sPRIEUldbl'
 sPRIFUldbl='$sPRIFUldbl'
 sPRIGUldbl='$sPRIGUldbl'
@@ -22458,6 +22928,7 @@ use64bitall='$use64bitall'
 use64bitint='$use64bitint'
 usecrosscompile='$usecrosscompile'
 usedl='$usedl'
+usedtrace='$usedtrace'
 usefaststdio='$usefaststdio'
 useithreads='$useithreads'
 uselargefiles='$uselargefiles'
@@ -22530,8 +23001,9 @@ echo "PERL_CONFIG_SH=true" >>config.sh
 : propagate old symbols
 if $test -f UU/config.sh; then
        <UU/config.sh $sort | $uniq >UU/oldconfig.sh
-       sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
-       $sort | $uniq -u >UU/oldsyms
+       $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
+               config.sh config.sh UU/oldconfig.sh |\
+               $sort | $uniq -u >UU/oldsyms
        set X `cat UU/oldsyms`
        shift
        case $# in
@@ -22540,7 +23012,7 @@ if $test -f UU/config.sh; then
                cat <<EOM
 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
 EOM
-               echo "# Variables propagated from previous config.sh file." >>config.sh
+               echo ": Variables propagated from previous config.sh file." >>config.sh
                for sym in `cat UU/oldsyms`; do
                        echo "    Propagating $hint variable "'$'"$sym..."
                        eval 'tmp="$'"${sym}"'"'