This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Extend 25579 to cover vc64 too
[perl5.git] / Configure
index 14bba08..8991f1a 100755 (executable)
--- a/Configure
+++ b/Configure
 # comp.sources.misc and is available on CPAN under authors/id/RAM so
 # you may fetch it yourself from your nearest archive site.)
 #
+#
+# Though this script was generated by metaconfig, it is OK to send
+# patches against it. It's up to the Configure pumpkin to backport
+# the patch to the metaunits if it is accepted.
+# 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 $
 #
-# Generated on Thu Apr 17 18:50:57 EET DST 2003 [metaconfig 3.0 PL70]
+# Generated on Mon Sep 12 15:44:06 CEST 2005 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -91,7 +97,7 @@ paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
 paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
 paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
 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 /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/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"
@@ -188,6 +194,7 @@ run=''
 targetarch=''
 to=''
 usecrosscompile=''
+mistrustnm=''
 perllibs=''
 dynamic_ext=''
 extensions=''
@@ -338,7 +345,13 @@ d_aintl=''
 d_alarm=''
 asctime_r_proto=''
 d_asctime_r=''
-d_attribut=''
+d_attribute_format=''
+d_attribute_malloc=''
+d_attribute_nonnull=''
+d_attribute_noreturn=''
+d_attribute_pure=''
+d_attribute_unused=''
+d_attribute_warn_unused_result=''
 d_bcmp=''
 d_bcopy=''
 d_bzero=''
@@ -397,6 +410,7 @@ endpwent_r_proto=''
 d_endsent=''
 d_endservent_r=''
 endservent_r_proto=''
+d_faststdio=''
 d_fchdir=''
 d_fchmod=''
 d_fchown=''
@@ -523,6 +537,7 @@ d_isnanl=''
 d_killpg=''
 d_lchown=''
 d_ldbl_dig=''
+d_libm_lib_version=''
 d_link=''
 d_localtime_r=''
 localtime_r_proto=''
@@ -535,6 +550,8 @@ longlongsize=''
 d_lseekproto=''
 d_lstat=''
 d_madvise=''
+d_malloc_good_size=''
+d_malloc_size=''
 d_mblen=''
 d_mbstowcs=''
 d_mbtowc=''
@@ -563,7 +580,6 @@ d_msgrcv=''
 d_msgsnd=''
 d_msync=''
 d_munmap=''
-d_nanosleep=''
 d_nice=''
 d_nl_langinfo=''
 d_off64_t=''
@@ -579,6 +595,7 @@ procselfexe=''
 d_old_pthread_create_joinable=''
 old_pthread_create_joinable=''
 d_pthread_atfork=''
+d_pthread_attr_setscope=''
 d_pthread_yield=''
 d_sched_yield=''
 sched_yield=''
@@ -661,6 +678,7 @@ d_shmget=''
 d_sigaction=''
 d_sigprocmask=''
 d_sigsetjmp=''
+usesitecustomize=''
 d_sockatmark=''
 d_sockatmarkproto=''
 d_msg_ctrunc=''
@@ -710,6 +728,8 @@ d_syserrlst=''
 d_strerror_r=''
 strerror_r_proto=''
 d_strftime=''
+d_strlcat=''
+d_strlcpy=''
 d_strtod=''
 d_strtol=''
 d_strtold=''
@@ -940,6 +960,7 @@ freetype=''
 mallocobj=''
 mallocsrc=''
 malloctype=''
+usemallocwrap=''
 usemymalloc=''
 installman1dir=''
 man1dir=''
@@ -989,6 +1010,7 @@ perl5=''
 perladmin=''
 perlpath=''
 d_nv_preserves_uv=''
+d_nv_zero_is_allbits_zero=''
 i16size=''
 i16type=''
 i32size=''
@@ -1070,22 +1092,22 @@ sitearchexp=''
 installsitebin=''
 sitebin=''
 sitebinexp=''
-installsitehtml1=''
-sitehtml1=''
-sitehtml1exp=''
-installsitehtml3=''
-sitehtml3=''
-sitehtml3exp=''
+installsitehtml1dir=''
+sitehtml1dir=''
+sitehtml1direxp=''
+installsitehtml3dir=''
+sitehtml3dir=''
+sitehtml3direxp=''
 installsitelib=''
 sitelib=''
 sitelib_stem=''
 sitelibexp=''
-installsiteman1=''
-siteman1=''
-siteman1exp=''
-installsiteman3=''
-siteman3=''
-siteman3exp=''
+installsiteman1dir=''
+siteman1dir=''
+siteman1direxp=''
+installsiteman3dir=''
+siteman3dir=''
+siteman3direxp=''
 siteprefix=''
 siteprefixexp=''
 installsitescript=''
@@ -1114,6 +1136,7 @@ uidtype=''
 archname64=''
 use64bitall=''
 use64bitint=''
+usefaststdio=''
 ccflags_uselargefiles=''
 ldflags_uselargefiles=''
 libswanted_uselargefiles=''
@@ -1126,6 +1149,7 @@ nm_so_opt=''
 runnm=''
 usenm=''
 useperlio=''
+userelocatableinc=''
 usesocks=''
 d_oldpthreads=''
 use5005threads=''
@@ -1143,23 +1167,23 @@ d_vendorbin=''
 installvendorbin=''
 vendorbin=''
 vendorbinexp=''
-installvendorhtml1=''
-vendorhtml1=''
-vendorhtml1exp=''
-installvendorhtml3=''
-vendorhtml3=''
-vendorhtml3exp=''
+installvendorhtml1dir=''
+vendorhtml1dir=''
+vendorhtml1direxp=''
+installvendorhtml3dir=''
+vendorhtml3dir=''
+vendorhtml3direxp=''
 d_vendorlib=''
 installvendorlib=''
 vendorlib=''
 vendorlib_stem=''
 vendorlibexp=''
-installvendorman1=''
-vendorman1=''
-vendorman1exp=''
-installvendorman3=''
-vendorman3=''
-vendorman3exp=''
+installvendorman1dir=''
+vendorman1dir=''
+vendorman1direxp=''
+installvendorman3dir=''
+vendorman3dir=''
+vendorman3direxp=''
 usevendorprefix=''
 vendorprefix=''
 vendorprefixexp=''
@@ -1170,8 +1194,6 @@ vendorscriptexp=''
 versiononly=''
 defvoidused=''
 voidflags=''
-pm_apiversion=''
-xs_apiversion=''
 yacc=''
 yaccflags=''
 CONFIG=''
@@ -1206,6 +1228,17 @@ elif test -d c:/. -o -n "$is_os2" ; then
 fi
 
 i_whoami=''
+ccname=''
+ccversion=''
+perllibs=''
+: set useposix=false in your hint file to disable the POSIX extension.
+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.
+: Extra object files, if any, needed on this platform.
+archobjs=''
+archname=''
 : Possible local include directories to search.
 : Set locincpth to "" in a hint file to defeat local include searches.
 locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
@@ -1214,12 +1247,6 @@ locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
 : no include file wanted by default
 inclwanted=''
 
-siteman1=''
-siteman3=''
-sitescript=''
-: Trailing extension.  Override this in a hint file, if needed.
-: Extra object files, if any, needed on this platform.
-archobjs=''
 groupstype=''
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
@@ -1243,31 +1270,24 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
-: full support for void wanted by default
-defvoidused=15
-
-ccname=''
-ccversion=''
-perllibs=''
-: set useposix=false in your hint file to disable the POSIX extension.
-useposix=true
-: set useopcode=false in your hint file to disable the Opcode extension.
-useopcode=true
+siteman1dir=''
+siteman3dir=''
+sitescript=''
 archname64=''
 ccflags_uselargefiles=''
 ldflags_uselargefiles=''
 libswanted_uselargefiles=''
 : set usemultiplicity on the Configure command line to enable multiplicity.
 : set usesocks on the Configure command line to enable socks.
-archname=''
 : set usethreads on the Configure command line to enable threads.
 usereentrant='undef'
+: full support for void wanted by default
+defvoidused=15
+
 : List of libraries we want.
-: If anyone needs -lnet, put it in a hint file.
-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 util rt posix4"
+: If anyone needs extra -lxxx, put those in a hint file.
+libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
+libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
 : 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 ! !'`
@@ -2875,37 +2895,37 @@ ABYZ)
        up='[:upper:]'
        low='[:lower:]'
        ;;
-*)     # There is a discontinuity in EBCDIC between 'I' and 'J'
-        # (0xc9 and 0xd1), therefore that is a nice testing point.
-        if test "X$up" = X -o "X$low" = X; then
-           case "`echo IJ | $tr '[I-J]' '[i-j]' 2>/dev/null`" in
-           ij) up='[A-Z]'
-               low='[a-z]'
+*)     # There is a discontinuity in EBCDIC between 'R' and 'S'
+       # (0xd9 and 0xe2), therefore that is a nice testing point.
+       if test "X$up" = X -o "X$low" = X; then
+           case "`echo RS | $tr '[R-S]' '[r-s]' 2>/dev/null`" in
+           rs) up='[A-Z]'
+               low='[a-z]'
                ;;
            esac
-        fi
+       fi
        if test "X$up" = X -o "X$low" = X; then
-           case "`echo IJ | $tr I-J i-j 2>/dev/null`" in
-           ij) up='A-Z'
+           case "`echo RS | $tr R-S r-s 2>/dev/null`" in
+           rs) up='A-Z'
                low='a-z'
                ;;
            esac
-        fi
+       fi
        if test "X$up" = X -o "X$low" = X; then
-           case "`echo IJ | od -x 2>/dev/null`" in
-           *C9D1*|*c9d1*)
+           case "`echo RS | od -x 2>/dev/null`" in
+           *D9E2*|*d9e2*)
                echo "Hey, this might be EBCDIC." >&4
                if test "X$up" = X -o "X$low" = X; then
-                   case "`echo IJ | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
-                   ij) up='[A-IJ-RS-Z]'
-                       low='[a-ij-rs-z]'
+                   case "`echo RS | $tr '[A-IJ-RS-Z]' '[a-ij-rs-z]' 2>/dev/null`" in
+                   rs) up='[A-IJ-RS-Z]'
+                       low='[a-ij-rs-z]'
                        ;;
                    esac
                fi
                if test "X$up" = X -o "X$low" = X; then
-                   case "`echo IJ | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
-                   ij) up='A-IJ-RS-Z'
-                       low='a-ij-rs-z'
+                   case "`echo RS | $tr A-IJ-RS-Z a-ij-rs-z 2>/dev/null`" in
+                   rs) up='A-IJ-RS-Z'
+                       low='a-ij-rs-z'
                        ;;
                    esac
                fi
@@ -2913,8 +2933,8 @@ ABYZ)
            esac
        fi
 esac
-case "`echo IJ | $tr \"$up\" \"$low\" 2>/dev/null`" in
-ij)
+case "`echo RS | $tr \"$up\" \"$low\" 2>/dev/null`" in
+rs)
     echo "Using $up and $low to convert case." >&4
     ;;
 *)
@@ -3080,7 +3100,9 @@ EOM
                aix) osname=aix
                        tmp=`( (oslevel) 2>/dev/null || echo "not found") 2>&1`
                        case "$tmp" in
-                       'not found') osvers="$4"."$3" ;;
+                       # oslevel can fail with:
+                       # oslevel: Unable to acquire lock.
+                       *not\ found) osvers="$4"."$3" ;;
                        '<3240'|'<>3240') osvers=3.2.0 ;;
                        '=3240'|'>3240'|'<3250'|'<>3250') osvers=3.2.4 ;;
                        '=3250'|'>3250') osvers=3.2.5 ;;
@@ -3102,7 +3124,7 @@ EOM
                domainos) osname=apollo
                        osvers="$3"
                        ;;
-               dgux) osname=dgux 
+               dgux)   osname=dgux 
                        osvers="$3"
                        ;;
                dynixptx*) osname=dynixptx
@@ -3110,23 +3132,25 @@ EOM
                        ;;
                freebsd) osname=freebsd 
                        osvers="$3" ;;
-               genix) osname=genix ;;
-               hp*) osname=hpux 
+               genix)  osname=genix ;;
+               gnu)    osname=gnu
+                       osvers="$3" ;;
+               hp*)    osname=hpux 
                        osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
                        ;;
-               irix*) osname=irix
+               irix*)  osname=irix
                        case "$3" in
                        4*) osvers=4 ;;
                        5*) osvers=5 ;;
                        *)      osvers="$3" ;;
                        esac
                        ;;
-               linux) osname=linux
+               linux)  osname=linux
                        case "$3" in
                        *)      osvers="$3" ;;
                        esac
                        ;;
-               MiNT) osname=mint
+               MiNT)   osname=mint
                        ;;
                netbsd*) osname=netbsd
                        osvers="$3"
@@ -3193,7 +3217,8 @@ EOM
                        mips)   osname=mips_osf1 ;;
                        esac
                        ;;
-               unixware) osname=svr5
+               # UnixWare 7.1.2 is known as Open UNIX 8
+               openunix|unixware) osname=svr5
                        osvers="$4"
                        ;;
                uts)    osname=uts
@@ -3456,12 +3481,15 @@ esac
 
 : who configured the system
 cf_time=`LC_ALL=C; LANGUAGE=C; export LC_ALL; export LANGUAGE; $date 2>&1`
-cf_by=`(logname) 2>/dev/null`
 case "$cf_by" in
 "")
-       cf_by=`(whoami) 2>/dev/null`
+       cf_by=`(logname) 2>/dev/null`
        case "$cf_by" in
-       "") cf_by=unknown ;;
+       "")
+               cf_by=`(whoami) 2>/dev/null`
+               case "$cf_by" in
+               "") cf_by=unknown ;;
+               esac ;;
        esac ;;
 esac
 
@@ -3671,22 +3699,22 @@ set d_oldpthreads
 eval $setvar
 
 
-case "$usethreads" in
-"$define"|true|[yY]*)
 : Look for a hint-file generated 'call-back-unit'.  If the
 : user has specified that a threading perl is to be built,
 : we may need to set or change some other defaults.
-       if $test -f usethreads.cbu; then
-               echo "Your platform has some specific hints for threaded builds, using them..."
-               . ./usethreads.cbu
-       else
+if $test -f usethreads.cbu; then
+    echo "Your platform has some specific hints regarding threaded builds, using them..."
+    . ./usethreads.cbu
+else
+    case "$usethreads" in
+       "$define"|true|[yY]*)
                $cat <<EOM
-(Your platform doesn't have any specific hints for threaded builds.
+(Your platform does not have any specific hints for threaded builds.
  Assuming POSIX threads, then.)
 EOM
-       fi
        ;;
-esac
+    esac
+fi
 
 cat <<EOM
 
@@ -4544,21 +4572,21 @@ case "$uselongdouble" in
 true|[yY]*) uselongdouble="$define" ;;
 esac
 
-case "$uselongdouble" in
-$define)
 : Look for a hint-file generated 'call-back-unit'.  If the
 : user has specified that long doubles should be used,
 : we may need to set or change some other defaults.
-       if $test -f uselongdouble.cbu; then
-               echo "Your platform has some specific hints for long doubles, using them..."
-               . ./uselongdouble.cbu
-       else
+if $test -f uselongdouble.cbu; then
+    echo "Your platform has some specific hints regarding long doubles, using them..."
+    . ./uselongdouble.cbu
+else
+    case "$uselongdouble" in
+       $define)
                $cat <<EOM
-(Your platform doesn't have any specific hints for long doubles.)
+(Your platform does not have any specific hints for long doubles.)
 EOM
-       fi
        ;;
-esac
+    esac
+fi
 
 : Looking for optional libraries
 echo " "
@@ -4702,6 +4730,7 @@ default|recommended)
        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.
                        dflt="$dflt -posix"
                fi
                ;;
@@ -4715,7 +4744,7 @@ default|recommended)
                if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
                        echo "Yes, it does." 2>&1
                        case "$ccflags" in
-                       *strict-aliasing*) 
+                       *strict-aliasing*)
                                echo "Leaving current flags $ccflags alone." 2>&1
                                ;;
                        *) dflt="$dflt -fno-strict-aliasing" ;;
@@ -4725,6 +4754,40 @@ default|recommended)
                fi
                ;;
        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
+
+               echo "Checking if your compiler accepts -Wdeclaration-after-statement" 2>&1
+               echo 'int main(void) { return 0; }' > gcctest.c
+               if $cc -Wdeclaration-after-statement -o gcctest gcctest.c; then
+                       echo "Yes, it does." 2>&1
+                       case "$ccflags" in
+                       *-Wdeclaration-after-statement*)
+                               echo "Leaving current flags $ccflags alone." 2>&1
+                               ;;
+                       *) dflt="$dflt -Wdeclaration-after-statement" ;;
+                       esac
+               else
+                       echo "Nope, it doesn't, but that's ok." 2>&1
+               fi
+               ;;
+       esac
        ;;
 esac
 
@@ -4736,8 +4799,8 @@ for thisincl in $inclwanted; do
        if $test -d $thisincl; then
                if $test x$thisincl != x$usrinc; then
                        case "$dflt" in
-                        *" -I$thisincl "*);;
-                        *) dflt="$dflt -I$thisincl ";;
+                       *" -I$thisincl "*);;
+                       *) dflt="$dflt -I$thisincl ";;
                        esac
                fi
        fi
@@ -4868,7 +4931,7 @@ esac
 for thislibdir in $libpth; do
        case " $loclibpth " in
        *" $thislibdir "*)
-               case "$dflt " in 
+               case "$dflt " in
                *"-L$thislibdir "*) ;;
                *)  dflt="$dflt -L$thislibdir" ;;
                esac
@@ -5445,15 +5508,15 @@ EOM
        ;;
 esac
 
-case "$use64bitint" in
-"$define"|true|[yY]*)
 : Look for a hint-file generated 'call-back-unit'.  If the
 : user has specified that a 64-bit perl is to be built,
 : we may need to set or change some other defaults.
-       if $test -f use64bitint.cbu; then
-               echo "Your platform has some specific hints for 64-bit integers, using them..."
-               . ./use64bitint.cbu
-       fi
+if $test -f use64bitint.cbu; then
+       echo "Your platform has some specific hints regarding 64-bit integers, using them..."
+       . ./use64bitint.cbu
+fi
+case "$use64bitint" in
+"$define"|true|[yY]*)
        case "$longsize" in
        4) case "$archname64" in
           '') archname64=64int ;;
@@ -5463,15 +5526,15 @@ case "$use64bitint" in
        ;;
 esac
 
-case "$use64bitall" in
-"$define"|true|[yY]*)
 : Look for a hint-file generated 'call-back-unit'.  If the
 : user has specified that a maximally 64-bit perl is to be built,
 : we may need to set or change some other defaults.
-       if $test -f use64bitall.cbu; then
-               echo "Your platform has some specific hints for 64-bit builds, using them..."
-               . ./use64bitall.cbu
-       fi
+if $test -f use64bitall.cbu; then
+       echo "Your platform has some specific hints regarding 64-bit builds, using them..."
+       . ./use64bitall.cbu
+fi
+case "$use64bitall" in
+"$define"|true|[yY]*)
        case "$longsize" in
        4) case "$archname64" in
           ''|64int) archname64=64all ;;
@@ -5481,6 +5544,20 @@ case "$use64bitall" in
        ;;
 esac
 
+case "$d_quad:$use64bitint" in
+$undef:$define)
+       cat >&4 <<EOF
+
+*** You have chosen to use 64-bit integers,
+*** but none can be found.
+*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
+*** Cannot continue, aborting.
+
+EOF
+       exit 1
+       ;;
+esac
+
 : check for length of double
 echo " "
 case "$doublesize" in
@@ -5555,7 +5632,9 @@ EOCP
                longdblsize="$ans"
        fi
        if $test "X$doublesize" = "X$longdblsize"; then
-               echo "(That isn't any different from an ordinary double.)"
+               echo "That isn't any different from an ordinary double."
+               echo "I'll keep your setting anyway, but you may see some"
+               echo "harmless compilation warnings."
        fi      
        ;;
 esac
@@ -5676,6 +5755,10 @@ $define)
         esac
        ;;
 esac
+if $test -f archname.cbu; then
+       echo "Your platform has some specific hints for architecture name, using them..."
+       . ./archname.cbu
+fi
 
 : determine root of directory hierarchy where package will be installed.
 case "$prefix" in
@@ -6211,27 +6294,50 @@ case "$use64bitall" in
        case "$ptrsize" in
        4)      cat <<EOM >&4
 
-*** You have chosen a maximally 64-bit build, but your pointers
-*** are only 4 bytes wide, disabling maximal 64-bitness.
-
+*** You have chosen a maximally 64-bit build,
+*** but your pointers are only 4 bytes wide.
+*** Please rerun Configure without -Duse64bitall.
 EOM
-               use64bitall="$undef"
-               case "$use64bitint" in
-               "$define"|true|[yY]*) ;;
-               *)      cat <<EOM >&4
-
-*** Downgrading from maximal 64-bitness to using 64-bit integers.
-
+               case "$d_quad" in
+               define)
+                       cat <<EOM >&4
+*** Since you have quads, you could possibly try with -Duse64bitint.
 EOM
-                       use64bitint="$define"
                        ;;
                esac
+               cat <<EOM >&4
+*** Cannot continue, aborting.
+
+EOM
+
+               exit 1
                ;;
        esac
        ;;
 esac
 
 
+: determine whether to use malloc wrapping
+echo " "
+case "$usemallocwrap" in
+[yY]*|true|$define)    dflt='y' ;;
+[nN]*|false|$undef)    dflt='n' ;;
+*)     case "$usedevel" in
+       [yY]*|true|$define)     dflt='y' ;;
+       *) dflt='n' ;;
+       esac
+       ;;
+esac
+rp="Do you wish to wrap malloc calls to protect against potential overflows?"
+. ./myread
+usemallocwrap="$ans"
+case "$ans" in
+y*|true)
+       usemallocwrap="$define" ;;
+*)
+       usemallocwrap="$undef" ;;
+esac
+
 : determine which malloc to compile in
 echo " "
 case "$usemymalloc" in
@@ -6849,7 +6955,7 @@ EOM
 rp='List of earlier versions to include in @INC?'
 . ./myread
 case "$ans" in
-[Nn]one|''|' ') inc_version_list=' ' ;;
+[Nn]one|''|' '|$undef) inc_version_list=' ' ;;
 *) inc_version_list="$ans" ;;
 esac
 case "$inc_version_list" in
@@ -7030,7 +7136,7 @@ esac
 : for archive libraries.  Thank you, Linux.
 case "$nm_so_opt" in
 '')    case "$myuname" in
-       *linux*)
+       *linux*|gnu*)
                if $nm --help | $grep 'dynamic' > /dev/null 2>&1; then
                        nm_so_opt='--dynamic'
                fi
@@ -7199,7 +7305,7 @@ $grep fprintf libc.tmp > libc.ptf
 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
 xxx='[ADTSIW]'
-if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx  *_[_.]*//p' -e 's/^.* $xxx  *//p'";\
+if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx  *//p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
                eval $xrun
@@ -7332,9 +7438,9 @@ eval $inhdr
 : is a C symbol defined?
 csym='tlook=$1;
 case "$3" in
--v) tf=libc.tmp; tc=""; tdc="";;
--a) tf=libc.tmp; tc="[0]"; tdc="[]";;
-*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
+-v) tf=libc.tmp; tdc="";;
+-a) tf=libc.tmp; tdc="[]";;
+*) tlook="^$1\$"; tf=libc.list; tdc="()";;
 esac;
 tx=yes;
 case "$reuseval-$4" in
@@ -7343,25 +7449,28 @@ true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
 esac;
 case "$tx" in
 yes)
-       case "$runnm" in
-       true)
-               if $contains $tlook $tf >/dev/null 2>&1;
-               then tval=true;
-               else tval=false;
-               fi;;
-       *)
-               echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
-               if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
-               then tval=true;
-               else tval=false;
+       tval=false;
+       if $test "$runnm" = true; then
+               if $contains $tlook $tf >/dev/null 2>&1; then
+                       tval=true;
+               elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
+                       echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+                       $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
+                       $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
+                       $rm -f try$_exe try.c core core.* try.core;
                fi;
-               $rm -f t t.c;;
-       esac;;
+       else
+               echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+               $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
+               $rm -f try$_exe try.c;
+       fi;
+       ;;
 *)
        case "$tval" in
        $define) tval=true;;
        *) tval=false;;
-       esac;;
+       esac;
+       ;;
 esac;
 eval "$2=$tval"'
 
@@ -7549,7 +7658,7 @@ EOM
                              '') dflt="$dflt +vnocompatwarnings" ;;
                              esac
                              ;;        
-                       linux|irix*)    dflt='-shared' ;;
+                       linux|irix*|gnu*)       dflt='-shared' ;;
                        next)  dflt='none' ;;
                        solaris) dflt='-G' ;;
                        sunos) dflt='-assert nodefinitions' ;;
@@ -7596,11 +7705,9 @@ say "none".
 EOM
     case "$ccdlflags" in
     '') case "$osname" in
-               hpux)   dflt='-Wl,-E' ;;
-               linux)  dflt='-rdynamic' ;;
-               next)   dflt='none' ;;
-               sunos)  dflt='none' ;;
-               *)      dflt='none' ;;
+           linux|hpux|gnu*)    dflt='-Wl,-E' ;;
+           next|sunos) dflt='none' ;;
+           *)          dflt='none' ;;
            esac ;;
     ' ')  dflt='none' ;;
     *)  dflt="$ccdlflags" ;;
@@ -7659,7 +7766,7 @@ any other libraries needed on this system (such as -lm, etc.).  Since
 your system supports dynamic loading, it is probably possible to build
 a shared libperl.$so.  If you will have more than one executable linked
 to libperl.$so, this will significantly reduce the size of each
-executable, but it may have a noticeable affect on performance.  The
+executable, but it may have a noticeable effect on performance.  The
 default is probably sensible for your system.
 $also
 
@@ -7695,7 +7802,7 @@ true)
                        dflt=libperl.5.$so
                        # XXX How handle the --version stuff for MAB?
                        ;;
-               linux*)  # ld won't link with a bare -lperl otherwise.
+               linux*|gnu*)  # ld won't link with a bare -lperl otherwise.
                        dflt=libperl.$so
                        ;;
                cygwin*) # ld links against an importlib
@@ -7779,10 +7886,10 @@ if "$useshrplib"; then
        solaris)
                xxx="-R $shrpdir"
                ;;
-       freebsd|netbsd|openbsd)
+       freebsd|netbsd|openbsd|interix)
                xxx="-Wl,-R$shrpdir"
                ;;
-       bsdos|linux|irix*|dec_osf)
+       bsdos|linux|irix*|dec_osf|gnu*)
                xxx="-Wl,-rpath,$shrpdir"
                ;;
        next)
@@ -8527,11 +8634,11 @@ else
 fi
 
 : determine where add-on html pages go
-: There is no standard location, so try to copy the previously-selected 
+: There is no standard location, so try to copy the previously-selected
 : directory structure for the core html pages.
-case "$sitehtml1" in
-'')    dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*)     dflt=$sitehtml1 ;;
+case "$sitehtml1dir" in
+'')    dflt=`echo "$html1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
+*)     dflt=$sitehtml1dir ;;
 esac
 case "$dflt" in
 ''|' ') dflt=none ;;
@@ -8539,23 +8646,21 @@ esac
 fn=dn+~
 rp='Pathname where the site-specific html pages should be installed?'
 . ./getfile
-sitehtml1="$ans"
-sitehtml1exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$sitehtml1" = "X" && sitehtml1=' '
+sitehtml1dir="$ans"
+sitehtml1direxp="$ansexp"
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installsitehtml1=`echo "$sitehtml1exp" | $sed "s#^$prefix#$installprefix#"`
+       installsitehtml1dir=`echo $sitehtml1direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installsitehtml1="$sitehtml1exp"
+       installsitehtml1dir="$sitehtml1direxp"
 fi
 
 : determine where add-on library html pages go
 : There is no standard location, so try to copy the previously-selected
 : directory structure for the core html pages.
-case "$sitehtml3" in
-'')    dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*)     dflt=$sitehtml3 ;;
+case "$sitehtml3dir" in
+'')    dflt=`echo "$html3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
+*)     dflt=$sitehtml3dir ;;
 esac
 case "$dflt" in
 ''|' ') dflt=none ;;
@@ -8563,21 +8668,19 @@ esac
 fn=dn+~
 rp='Pathname where the site-specific library html pages should be installed?'
 . ./getfile
-sitehtml3="$ans"
-sitehtml3exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$sitehtml3" = "X" && sitehtml3=' '
+sitehtml3dir="$ans"
+sitehtml3direxp="$ansexp"
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installsitehtml3=`echo "$sitehtml3exp" | $sed "s#^$prefix#$installprefix#"`
+       installsitehtml3dir=`echo $sitehtml3direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installsitehtml3="$sitehtml3exp"
+       installsitehtml3dir="$sitehtml3direxp"
 fi
 
 : determine where add-on manual pages go
-case "$siteman1" in
-'')    dflt=`echo "$man1dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*)     dflt=$siteman1 ;;
+case "$siteman1dir" in
+'')    dflt=`echo $man1dir | $sed "s#^$prefix#$siteprefix#"` ;;
+*)     dflt=$siteman1dir ;;
 esac
 case "$dflt" in
 ''|' ') dflt=none ;;
@@ -8585,21 +8688,19 @@ esac
 fn=dn+~
 rp='Pathname where the site-specific manual pages should be installed?'
 . ./getfile
-siteman1="$ans"
-siteman1exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$siteman1" = "X" && siteman1=' '
+siteman1dir="$ans"
+siteman1direxp="$ansexp"
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installsiteman1=`echo "$siteman1exp" | $sed "s#^$prefix#$installprefix#"`
+       installsiteman1dir=`echo $siteman1direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installsiteman1="$siteman1exp"
+       installsiteman1dir="$siteman1direxp"
 fi
 
 : determine where add-on library man pages go
-case "$siteman3" in
-'')    dflt=`echo "$man3dir" | $sed "s#^$prefix#$siteprefix#"` ;;
-*)     dflt=$siteman3 ;;
+case "$siteman3dir" in
+'')    dflt=`echo $man3dir | $sed "s#^$prefix#$siteprefix#"` ;;
+*)     dflt=$siteman3dir ;;
 esac
 case "$dflt" in
 ''|' ') dflt=none ;;
@@ -8607,15 +8708,13 @@ esac
 fn=dn+~
 rp='Pathname where the site-specific library manual pages should be installed?'
 . ./getfile
-siteman3="$ans"
-siteman3exp="$ansexp"
-: Use ' ' for none so value is preserved next time through Configure
-$test X"$siteman3" = "X" && siteman3=' '
+siteman3dir="$ans"
+siteman3direxp="$ansexp"
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installsiteman3=`echo "$siteman3exp" | $sed "s#^$prefix#$installprefix#"`
+       installsiteman3dir=`echo $siteman3direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installsiteman3="$siteman3exp"
+       installsiteman3dir="$siteman3direxp"
 fi
 
 : determine where add-on public executable scripts go
@@ -8636,6 +8735,36 @@ else
        installsitescript="$sitescriptexp"
 fi
 
+case "$usefaststdio" in
+$define|true|[yY]*|'')
+       xversion=`awk '/define[         ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+       case "$xversion" in
+       [68])   dflt='y' ;;
+       *)      dflt='n' ;;
+       esac
+       ;;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Perl can be built to use 'fast stdio', which means using the stdio
+library but also directly manipulating the stdio buffers to enable
+faster I/O.  Using stdio is better for backward compatibility (especially
+for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
+interface has been preferred instead of stdio.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Use the "fast stdio" if available?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define" ;;     
+*)      val="$undef" ;;
+esac
+set usefaststdio
+eval $setvar
+
+
 : define an is-a-typedef? function
 typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
 case "$inclist" in
@@ -8803,14 +8932,16 @@ EOM
 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 regarding large file builds, using them..."
+       . ./uselargefiles.cbu
+fi
+case "$uselargefiles" in
+"$define")
        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
@@ -8876,6 +9007,11 @@ EOCP
        ;;
 esac
 
+# probably will refer to
+#   $archlib $privlib $sitearch $sitelib $vendorarch $vendorlib
+need_relocation=0
+userelocatableinc=undef
+
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
        vendorbin=''
@@ -8902,16 +9038,16 @@ else
 fi
 
 case "$vendorprefix" in
-'')    vendorhtml1=''
-       vendorhtml1exp=''
+'')    vendorhtml1dir=''
+       vendorhtml1direxp=''
        ;;
 *)     : determine where vendor-supplied html pages go.
        : There is no standard location, so try to copy the previously-selected
        : directory structure for the core html pages.
        : XXX Better default suggestions would be welcome.
-       case "$vendorhtml1" in
+       case "$vendorhtml1dir" in
        '')     dflt=`echo "$html1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
-       *)      dflt=$vendorhtml1 ;;
+       *)      dflt=$vendorhtml1dir ;;
        esac
        case "$dflt" in
        ''|' ') dflt=none ;;
@@ -8919,30 +9055,30 @@ case "$vendorprefix" in
        fn=dn+~
        rp='Pathname for the vendor-supplied html pages?'
        . ./getfile
-       vendorhtml1="$ans"
-       vendorhtml1exp="$ansexp"
+       vendorhtml1dir="$ans"
+       vendorhtml1direxp="$ansexp"
        ;;
 esac
 : Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorhtml1" = "X" && vendorhtml1=' '
+$test X"$vendorhtml1dir" = "X" && vendorhtml1dir=' '
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installvendorhtml1=`echo $vendorhtml1exp | $sed "s#^$prefix#$installprefix#"`
+       installvendorhtml1dir=`echo $vendorhtml1direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installvendorhtml1="$vendorhtml1exp"
+       installvendorhtml1dir="$vendorhtml1direxp"
 fi
 
 case "$vendorprefix" in
-'')    vendorhtml3=''
-       vendorhtml3exp=''
+'')    vendorhtml3dir=''
+       vendorhtml3direxp=''
        ;;
 *)     : determine where vendor-supplied module html pages go.
        : There is no standard location, so try to copy the previously-selected
        : directory structure for the core html pages.
        : XXX Better default suggestions would be welcome.
-       case "$vendorhtml3" in
+       case "$vendorhtml3dir" in
        '')     dflt=`echo "$html3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
-       *)      dflt=$vendorhtml3 ;;
+       *)      dflt=$vendorhtml3dir ;;
        esac
        case "$dflt" in
        ''|' ') dflt=none ;;
@@ -8950,27 +9086,27 @@ case "$vendorprefix" in
        fn=dn+~
        rp='Pathname for the vendor-supplied html pages?'
        . ./getfile
-       vendorhtml3="$ans"
-       vendorhtml3exp="$ansexp"
+       vendorhtml3dir="$ans"
+       vendorhtml3direxp="$ansexp"
        ;;
 esac
 : Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorhtml3" = "X" && vendorhtml3=' '
+$test X"$vendorhtml3dir" = "X" && vendorhtml3dir=' '
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installvendorhtml3=`echo $vendorhtml3exp | $sed "s#^$prefix#$installprefix#"`
+       installvendorhtml3dir=`echo $vendorhtml3direxp | $sed "s#^$prefix#$installprefix#"`
 else
-       installvendorhtml3="$vendorhtml3exp"
+       installvendorhtml3dir="$vendorhtml3direxp"
 fi
 
 case "$vendorprefix" in
-'')    vendorman1=''
-       vendorman1exp=''
+'')    vendorman1dir=''
+       vendorman1direxp=''
        ;;
 *)     : determine where vendor-supplied manual pages go.
-       case "$vendorman1" in
+       case "$vendorman1dir" in
        '') dflt=`echo "$man1dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
-       *)      dflt=$vendorman1 ;;
+       *)      dflt=$vendorman1dir ;;
        esac
        case "$dflt" in
        ''|' ') dflt=none ;;
@@ -8978,27 +9114,27 @@ case "$vendorprefix" in
        fn=nd~+
        rp='Pathname for the vendor-supplied manual section 1 pages?'
        . ./getfile
-       vendorman1="$ans"
-       vendorman1exp="$ansexp"
+       vendorman1dir="$ans"
+       vendorman1direxp="$ansexp"
        ;;
 esac
 : Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorman1" = "X" && vendorman1=' '
+$test X"$vendorman1dir" = "X" && vendorman1dir=' '
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installvendorman1=`echo "$vendorman1exp" | $sed "s#^$prefix#$installprefix#"`
+       installvendorman1dir=`echo "$vendorman1direxp" | $sed "s#^$prefix#$installprefix#"`
 else
-       installvendorman1="$vendorman1exp"
+       installvendorman1dir="$vendorman1direxp"
 fi
 
 case "$vendorprefix" in
-'')    vendorman3=''
-       vendorman3exp=''
+'')    vendorman3dir=''
+       vendorman3direxp=''
        ;;
 *)     : determine where vendor-supplied module manual pages go.
-       case "$vendorman3" in
+       case "$vendorman3dir" in
        '') dflt=`echo "$man3dir" | $sed "s#^$prefix#$vendorprefix#"` ;;
-       *)      dflt=$vendorman3 ;;
+       *)      dflt=$vendorman3dir ;;
        esac
        case "$dflt" in
        ''|' ') dflt=none ;;
@@ -9006,17 +9142,17 @@ case "$vendorprefix" in
        fn=nd~+
        rp='Pathname for the vendor-supplied manual section 3 pages?'
        . ./getfile
-       vendorman3="$ans"
-       vendorman3exp="$ansexp"
+       vendorman3dir="$ans"
+       vendorman3direxp="$ansexp"
        ;;
 esac
 : Use ' ' for none so value is preserved next time through Configure
-$test X"$vendorman3" = "X" && vendorman3=' '
+$test X"$vendorman3dir" = "X" && vendorman3dir=' '
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installvendorman3=`echo "$vendorman3exp" | $sed "s#^$prefix#$installprefix#"`
+       installvendorman3dir=`echo "$vendorman3direxp" | $sed "s#^$prefix#$installprefix#"`
 else
-       installvendorman3="$vendorman3exp"
+       installvendorman3dir="$vendorman3direxp"
 fi
 
 case "$vendorprefix" in
@@ -9757,114 +9893,287 @@ eval $inlibc
 set atoll d_atoll
 eval $inlibc
 
-: Look for GNU-cc style attribute checking
+: Look for GCC-style attribute format
+case "$d_attribute_format" in
+'')
 echo " "
-echo "Checking whether your compiler can handle __attribute__ ..." >&4
+echo "Checking whether your compiler can handle __attribute__((format)) ..." >&4
 $cat >attrib.c <<'EOCP'
 #include <stdio.h>
-void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
+void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
 EOCP
 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
        if $contains 'warning' attrib.out >/dev/null 2>&1; then
-               echo "Your C compiler doesn't fully support __attribute__."
+               echo "Your C compiler doesn't support __attribute__((format))."
                val="$undef"
        else
-               echo "Your C compiler supports __attribute__."
+               echo "Your C compiler supports __attribute__((format))."
                val="$define"
        fi
 else
        echo "Your C compiler doesn't seem to understand __attribute__ at all."
        val="$undef"
 fi
-set d_attribut
+;;
+*) val="$d_attribute_format" ;;
+esac
+set d_attribute_format
 eval $setvar
 $rm -f attrib*
 
-: see if bcmp exists
-set bcmp d_bcmp
-eval $inlibc
-
-: see if bcopy exists
-set bcopy d_bcopy
-eval $inlibc
-
-: see if this is a unistd.h system
-set unistd.h i_unistd
-eval $inhdr
-
-: see if getpgrp exists
-set getpgrp d_getpgrp
-eval $inlibc
-
-case "$d_getpgrp" in
-"$define")
-       echo " "
-       echo "Checking to see which flavor of getpgrp is in use..."
-       $cat >try.c <<EOP
-#$i_unistd I_UNISTD
-#include <sys/types.h>
-#ifdef I_UNISTD
-#  include <unistd.h>
-#endif
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-int main()
-{
-       if (getuid() == 0) {
-               printf("(I see you are running Configure as super-user...)\n");
-               setuid(1);
-       }
-#ifdef TRY_BSD_PGRP
-       if (getpgrp(1) == 0)
-               exit(0);
-#else
-       if (getpgrp() > 0)
-               exit(0);
-#endif
-       exit(1);
-}
-EOP
-       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 try $ccflags $ldflags try.c $libs >/dev/null 2>&1 && $run ./try; then
-               echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
+: Look for GCC-style attribute malloc
+case "$d_attribute_malloc" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((malloc)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((malloc))."
                val="$undef"
        else
-               echo "I can't seem to compile and run the test program."
-               if ./usg; then
-                       xxx="a USG one, i.e. you use getpgrp()."
-               else
-                       # SVR4 systems can appear rather BSD-ish.
-                       case "$i_unistd" in
-                       $undef)
-                               xxx="a BSD one, i.e. you use getpgrp(pid)."
-                               val="$define"
-                               ;;
-                       $define)
-                               xxx="probably a USG one, i.e. you use getpgrp()."
-                               val="$undef"
-                               ;;
-                       esac
-               fi
-               echo "Assuming your getpgrp is $xxx" >&4
+               echo "Your C compiler supports __attribute__((malloc))."
+               val="$define"
        fi
-       ;;
-*) val="$undef";;
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_malloc" ;;
 esac
-set d_bsdgetpgrp
+set d_attribute_malloc
 eval $setvar
-$rm -f try try.*
-
-: see if setpgrp exists
-set setpgrp d_setpgrp
-eval $inlibc
+$rm -f attrib*
 
-case "$d_setpgrp" in
-"$define")
-       echo " "
+: Look for GCC-style attribute nonnull
+case "$d_attribute_nonnull" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((nonnull(1))) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((nonnull))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((nonnull))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_nonnull" ;;
+esac
+set d_attribute_nonnull
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute noreturn
+case "$d_attribute_noreturn" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((noreturn)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+void fall_over_dead( void ) __attribute__((noreturn));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((noreturn))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((noreturn))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_noreturn" ;;
+esac
+set d_attribute_noreturn
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute pure
+case "$d_attribute_pure" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((pure)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int square( int n ) __attribute__((pure));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((pure))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((pure))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_pure" ;;
+esac
+set d_attribute_pure
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute unused
+case "$d_attribute_unused" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((unused)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int do_something( int dummy __attribute__((unused)), int n );
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((unused))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((unused))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_unused" ;;
+esac
+set d_attribute_unused
+eval $setvar
+$rm -f attrib*
+
+: Look for GCC-style attribute warn_unused_result
+case "$d_attribute_warn_unused_result" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((warn_unused_result)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((warn_unused_result))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_warn_unused_result" ;;
+esac
+set d_attribute_warn_unused_result
+eval $setvar
+$rm -f attrib*
+
+: see if bcmp exists
+set bcmp d_bcmp
+eval $inlibc
+
+: see if bcopy exists
+set bcopy d_bcopy
+eval $inlibc
+
+: see if this is a unistd.h system
+set unistd.h i_unistd
+eval $inhdr
+
+: see if getpgrp exists
+set getpgrp d_getpgrp
+eval $inlibc
+
+case "$d_getpgrp" in
+"$define")
+       echo " "
+       echo "Checking to see which flavor of getpgrp is in use..."
+       $cat >try.c <<EOP
+#$i_unistd I_UNISTD
+#include <sys/types.h>
+#ifdef I_UNISTD
+#  include <unistd.h>
+#endif
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main()
+{
+       if (getuid() == 0) {
+               printf("(I see you are running Configure as super-user...)\n");
+               setuid(1);
+       }
+#ifdef TRY_BSD_PGRP
+       if (getpgrp(1) == 0)
+               exit(0);
+#else
+       if (getpgrp() > 0)
+               exit(0);
+#endif
+       exit(1);
+}
+EOP
+       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 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
+               echo "I can't seem to compile and run the test program."
+               if ./usg; then
+                       xxx="a USG one, i.e. you use getpgrp()."
+               else
+                       # SVR4 systems can appear rather BSD-ish.
+                       case "$i_unistd" in
+                       $undef)
+                               xxx="a BSD one, i.e. you use getpgrp(pid)."
+                               val="$define"
+                               ;;
+                       $define)
+                               xxx="probably a USG one, i.e. you use getpgrp()."
+                               val="$undef"
+                               ;;
+                       esac
+               fi
+               echo "Assuming your getpgrp is $xxx" >&4
+       fi
+       ;;
+*) val="$undef";;
+esac
+set d_bsdgetpgrp
+eval $setvar
+$rm -f try try.*
+
+: see if setpgrp exists
+set setpgrp d_setpgrp
+eval $inlibc
+
+case "$d_setpgrp" in
+"$define")
+       echo " "
        echo "Checking to see which flavor of setpgrp is in use..."
        $cat >try.c <<EOP
 #$i_unistd I_UNISTD
@@ -10005,7 +10314,7 @@ int main()
        i32  = ($xxx) g;
 
        /* x86 processors will probably give 0x8000 0000, which is a
-       sign change.  We don't want that.  We want to mimic SPARC
+          sign change.  We don't want that.  We want to mimic SPARC
           behavior here, which is to preserve the sign and give
           back 0x7fff ffff.
        */
@@ -10724,6 +11033,7 @@ int main() {
                exit(1);
 }
 EOM
+val=$undef
 set dirfd
 if eval $compile; then
        val="$define"
@@ -11661,16 +11971,301 @@ EOCP
 esac
 $rm -f try try.* .out core head.c mtry
 
-: see if fchdir exists
-set fchdir d_fchdir
-eval $inlibc
+: see if _ptr and _cnt from stdio act std
+echo " "
 
-: see if fchmod exists
-set fchmod d_fchmod
-eval $inlibc
+if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+       echo "(Looks like you have stdio.h from BSD.)"
+       case "$stdio_ptr" in
+       '') stdio_ptr='((fp)->_p)'
+               ptr_lval=$define
+               ;;
+       *)      ptr_lval=$d_stdio_ptr_lval;;
+       esac
+       case "$stdio_cnt" in
+       '') stdio_cnt='((fp)->_r)'
+               cnt_lval=$define
+               ;;
+       *)      cnt_lval=$d_stdio_cnt_lval;;
+       esac
+       case "$stdio_base" in
+       '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
+       esac
+       case "$stdio_bufsiz" in
+       '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
+       esac
+elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
+       echo "(Looks like you have stdio.h from Linux.)"
+       case "$stdio_ptr" in
+       '') stdio_ptr='((fp)->_IO_read_ptr)'
+               ptr_lval=$define
+               ;;
+       *)      ptr_lval=$d_stdio_ptr_lval;;
+       esac
+       case "$stdio_cnt" in
+       '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
+               cnt_lval=$undef
+               ;;
+       *)      cnt_lval=$d_stdio_cnt_lval;;
+       esac
+       case "$stdio_base" in
+       '') stdio_base='((fp)->_IO_read_base)';;
+       esac
+       case "$stdio_bufsiz" in
+       '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
+       esac
+else
+       case "$stdio_ptr" in
+       '') stdio_ptr='((fp)->_ptr)'
+               ptr_lval=$define
+               ;;
+       *)      ptr_lval=$d_stdio_ptr_lval;;
+       esac
+       case "$stdio_cnt" in
+       '') stdio_cnt='((fp)->_cnt)'
+               cnt_lval=$define
+               ;;
+       *)      cnt_lval=$d_stdio_cnt_lval;;
+       esac
+       case "$stdio_base" in
+       '') stdio_base='((fp)->_base)';;
+       esac
+       case "$stdio_bufsiz" in
+       '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
+       esac
+fi
 
-: see if fchown exists
-set fchown d_fchown
+: test whether _ptr and _cnt really work
+echo "Checking how std your stdio is..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#define FILE_ptr(fp)   $stdio_ptr
+#define FILE_cnt(fp)   $stdio_cnt
+int main() {
+       FILE *fp = fopen("try.c", "r");
+       char c = getc(fp);
+       if (
+               18 <= FILE_cnt(fp) &&
+               strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+       )
+               exit(0);
+       exit(1);
+}
+EOP
+val="$undef"
+set try
+if eval $compile && $to try.c; then
+       if $run ./try; then
+               echo "Your stdio acts pretty std."
+               val="$define"
+       else
+               echo "Your stdio isn't very std."
+       fi
+else
+       echo "Your stdio doesn't appear very std."
+fi
+$rm -f try.c try
+
+# glibc 2.2.90 and above apparently change stdio streams so Perl's
+# direct buffer manipulation no longer works.  The Configure tests
+# should be changed to correctly detect this, but until then,
+# the following check should at least let perl compile and run.
+# (This quick fix should be updated before 5.8.1.)
+# To be defensive, reject all unknown versions, and all versions  > 2.2.9.
+# A. Dougherty, June 3, 2002.
+case "$d_gnulibc" in
+$define)
+       case "$gnulibc_version" in
+       2.[01]*)  ;;
+       2.2) ;;
+       2.2.[0-9]) ;;
+       *)  echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
+               val="$undef"
+               ;;
+       esac
+       ;;
+esac
+set d_stdstdio
+eval $setvar
+
+: Can _ptr be used as an lvalue?
+case "$d_stdstdio$ptr_lval" in
+$define$define) val=$define ;;
+*) val=$undef ;;
+esac
+set d_stdio_ptr_lval
+eval $setvar
+
+: Can _cnt be used as an lvalue?
+case "$d_stdstdio$cnt_lval" in
+$define$define) val=$define ;;
+*) val=$undef ;;
+esac
+set d_stdio_cnt_lval
+eval $setvar
+
+
+: test whether setting _ptr sets _cnt as a side effect
+d_stdio_ptr_lval_sets_cnt="$undef"
+d_stdio_ptr_lval_nochange_cnt="$undef"
+case "$d_stdio_ptr_lval$d_stdstdio" in
+$define$define)
+       echo "Checking to see what happens if we set the stdio ptr..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+/* Can we scream? */
+/* Eat dust sed :-) */
+/* In the buffer space, no one can hear you scream. */
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#define FILE_ptr(fp)   $stdio_ptr
+#define FILE_cnt(fp)   $stdio_cnt
+#include <sys/types.h>
+int main() {
+       FILE *fp = fopen("try.c", "r");
+       int c;
+       char *ptr;
+       size_t cnt;
+       if (!fp) {
+           puts("Fail even to read");
+           exit(1);
+       }
+       c = getc(fp); /* Read away the first # */
+       if (c == EOF) {
+           puts("Fail even to read");
+           exit(1);
+       }
+       if (!(
+               18 <= FILE_cnt(fp) &&
+               strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+       )) {
+               puts("Fail even to read");
+               exit (1);
+       }
+       ptr = (char*) FILE_ptr(fp);
+       cnt = (size_t)FILE_cnt(fp);
+
+       FILE_ptr(fp) += 42;
+
+       if ((char*)FILE_ptr(fp) != (ptr + 42)) {
+               printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
+               exit (1);
+       }
+       if (FILE_cnt(fp) <= 20) {
+               printf ("Fail (<20 chars to test)");
+               exit (1);
+       }
+       if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
+               puts("Fail compare");
+               exit (1);
+       }
+       if (cnt == FILE_cnt(fp)) {
+               puts("Pass_unchanged");
+               exit (0);
+       }       
+       if (FILE_cnt(fp) == (cnt - 42)) {
+               puts("Pass_changed");
+               exit (0);
+       }
+       printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
+       return 1;
+
+}
+EOP
+       set try
+       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" ;;
+               Pass_unchanged)
+                       echo "Increasing ptr in your stdio leaves cnt unchanged.  Good." >&4
+                       d_stdio_ptr_lval_nochange_cnt="$define" ;;
+               Fail*)
+                       echo "Increasing ptr in your stdio didn't do exactly what I expected.  We'll not be doing that then." >&4 ;;
+               *)
+                       echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
+       esac
+       else
+               echo "It seems we can't set ptr in your stdio.  Nevermind." >&4
+       fi
+       $rm -f try.c try
+       ;;
+esac
+
+: see if _base is also standard
+val="$undef"
+case "$d_stdstdio" in
+$define)
+       $cat >try.c <<EOP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#define FILE_base(fp)  $stdio_base
+#define FILE_bufsiz(fp)        $stdio_bufsiz
+int main() {
+       FILE *fp = fopen("try.c", "r");
+       char c = getc(fp);
+       if (
+               19 <= FILE_bufsiz(fp) &&
+               strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
+       )
+               exit(0);
+       exit(1);
+}
+EOP
+       set try
+       if eval $compile && $to try.c; then
+               if $run ./try; then
+                       echo "And its _base field acts std."
+                       val="$define"
+               else
+                       echo "But its _base field isn't std."
+               fi
+       else
+               echo "However, it seems to be lacking the _base field."
+       fi
+       $rm -f try.c try
+       ;;
+esac
+set d_stdiobase
+eval $setvar
+
+: see if fast_stdio exists
+val="$undef"
+case "$d_stdstdio:$d_stdio_ptr_lval" in
+"$define:$define")
+       case "$d_stdio_cnt_lval$d_stdio_ptr_lval_sets_cnt" in
+       *$define*)
+               echo "You seem to have 'fast stdio' to directly manipulate the stdio buffers." >& 4
+               val="$define"
+               ;;
+       esac
+       ;;
+esac
+set d_faststdio
+eval $setvar
+
+
+
+: see if fchdir exists
+set fchdir d_fchdir
+eval $inlibc
+
+: see if fchmod exists
+set fchmod d_fchmod
+eval $inlibc
+
+: see if fchown exists
+set fchown d_fchown
 eval $inlibc
 
 : see if this is an fcntl system
@@ -13552,6 +14147,38 @@ $rm -f ldbl_dig.?
 set d_ldbl_dig
 eval $setvar
 
+: see if this is a math.h system
+set math.h i_math
+eval $inhdr
+
+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
+#include <unistd.h>
+#include <math.h>
+int main (int argc, char *argv[])
+{
+    printf ("%d\n", _LIB_VERSION);
+    return (0);
+    } /* main */
+EOCP
+       set try
+       if eval $compile; then
+           foo=`$run ./try`
+           echo "Yes, it does ($foo)" >&4
+           d_libm_lib_version="$define"
+       else
+           echo "No, it does not (probably harmless)\n" >&4
+           fi
+       $rm -f try.* try core core.try.*
+       ;;
+
+    esac
+
 : see if link exists
 set link d_link
 eval $inlibc
@@ -13622,6 +14249,14 @@ eval $inlibc
 set madvise d_madvise
 eval $inlibc
 
+: see if malloc_size exists
+set malloc_size d_malloc_size
+eval $inlibc
+
+: see if malloc_size_good exists
+set malloc_good_size d_malloc_good_size
+eval $inlibc
+
 : see if mblen exists
 set mblen d_mblen
 eval $inlibc
@@ -13709,13 +14344,17 @@ esac
 set sqrtl d_sqrtl
 eval $inlibc
 
+: see if scalbnl exists
+set scalbnl d_scalbnl
+eval $inlibc
+
 : see if modfl exists
 set modfl d_modfl
 eval $inlibc
 
 : see if prototype for modfl is available
 echo " "
-set d_modflproto modfl math.h
+set d_modflproto modfl $i_math math.h
 eval $hasproto
 
 d_modfl_pow32_bug="$undef"
@@ -13782,37 +14421,37 @@ EOCP
 esac
 
 if $test "$uselongdouble" = "$define"; then
-    message=none
-    case "$d_sqrtl:$d_modfl" in
-    $define:$define)
-       : You have both
-       ;;
-    $define:$undef)
+    message=""
+    if $test "$d_sqrtl" != "$define"; then
+       message="$message sqrtl"
+    fi
+    if $test "$d_modfl" != "$define"; then
        if $test "$d_aintl:$d_copysignl" = "$define:$define"; then
            echo "You have both aintl and copysignl, so I can emulate modfl."
        else
-           message="I could not find modfl."
+           message="$message modfl"
        fi
-       ;;
-    $undef:$define)
-       message="I could not find sqrtl."
-       ;;
-    $undef:$undef)
-       message="I found neither sqrtl nor modfl."
-       ;;
-    esac
+    fi
+    if $test "$d_frexpl" != "$define"; then
+       if $test "$d_ilogbl:$d_scalbnl" = "$define:$define"; then
+           echo "You have both ilogbl and scalbnl, so I can emulate frexpl."
+       else
+           message="$message frexpl"
+       fi
+    fi
 
-    if $test "$message" != none; then
+    if $test "$message" != ""; then
        $cat <<EOM >&4
 
 *** You requested the use of long doubles but you do not seem to have
-*** the mathematic functions for long doubles.
-*** ($message)
-*** I'm disabling the use of long doubles.
+*** the following mathematical functions needed for long double support:
+***    $message
+*** Please rerun Configure without -Duselongdouble and/or -Dusemorebits.
+*** Cannot continue, aborting.
 
 EOM
 
-       uselongdouble=$undef
+       exit 1
     fi
 fi
 
@@ -13891,10 +14530,6 @@ eval $inlibc
 set munmap d_munmap
 eval $inlibc
 
-: see if nanosleep exists
-set nanosleep d_nanosleep
-eval $inlibc
-
 : see if nice exists
 set nice d_nice
 eval $inlibc
@@ -14216,6 +14851,128 @@ esac
 
 $rm -f try.* 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
+       volatile=volatile
+fi
+$cat <<EOP >try.c
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#$i_string I_STRING
+#ifdef I_STRING
+#  include <string.h>
+#else
+#  include <strings.h>
+#endif
+#include <sys/types.h>
+#include <signal.h>
+#ifdef SIGFPE
+$volatile int bletched = 0;
+$signal_t blech(s) int s; { bletched = 1; }
+#endif
+
+int checkit($nvtype d, char *where) {
+    unsigned char *p = (char *)&d;
+    unsigned char *end = p + sizeof(d);
+    int fail = 0;
+
+    while (p < end)
+       fail += *p++;
+
+    if (!fail)
+       return 0;
+
+    p = (char *)&d;
+    printf("No - %s: 0x", where);
+    while (p < end)
+       printf ("%02X", *p++);
+    printf("\n");
+    return 1;
+}
+
+int main(int argc, char **argv) {
+    $nvtype d = 0.0;
+    int fail = 0;
+    fail += checkit(d, "0.0");
+
+    /* The compiler shouldn't be assuming that bletched is 0  */
+    d = bletched;
+
+    fail += checkit(d, "bleched");
+
+#ifdef SIGFPE
+    signal(SIGFPE, blech);
+#endif
+
+    /* Paranoia - the compiler should have no way of knowing that ANSI says
+       that argv[argc] will always be NULL.  Actually, if it did assume this it
+       would be buggy, as this is C and main() can be called from elsewhere in
+       the program.  */
+    d = argv[argc] ? 1 : 0;
+
+    if (d) {
+       printf("Odd argv[argc]=%p, d=%g\n", argv[argc], d);
+    }
+
+    fail += checkit(d, "ternary");
+
+    memset(&d, sizeof(d), argv[argc] ? 1 : 0);
+
+    if (d != 0.0) {
+       printf("No - memset doesn't give 0.0\n");
+       /* This might just blow up:  */
+       printf("(gives %g)\n", d);
+       return 1;
+    }
+    
+#ifdef SIGFPE
+    if (bletched) {
+       printf("No - something bleched\n");
+       return 1;
+    }
+#endif
+    if (fail) {
+      printf("No - %d fail(s)\n", fail);
+      return 1;
+    }
+    printf("Yes\n");
+    return 0;
+}
+EOP
+set try
+
+d_nv_zero_is_allbits_zero="$undef"
+if eval $compile; then
+    xxx="`$run ./try`"
+    case "$?" in
+       0)
+           case "$xxx" in
+               Yes)  cat >&4 <<EOM
+0.0 is represented as all bits zero in memory
+EOM
+                   d_nv_zero_is_allbits_zero="$define"
+                   ;;
+               *)  cat >&4 <<EOM
+0.0 is not represented as all bits zero in memory
+EOM
+                   d_nv_zero_is_allbits_zero="$undef"
+                   ;;
+           esac
+           ;;
+       *)  cat >&4 <<EOM
+0.0 is not represented as all bits zero in memory
+EOM
+           d_nv_zero_is_allbits_zero="$undef"
+           ;;
+    esac
+fi
+
+$rm -f try.* try
+
 
 : check for off64_t
 echo " "
@@ -14367,6 +15124,10 @@ esac
 set d_pthread_atfork
 eval $setvar
 
+: see if pthread_attr_setscope exists
+set pthread_attr_setscope d_pthread_attr_setscope
+eval $inlibc
+
 
 : see whether the various POSIXish _yields exist
 $cat >try.c <<EOP
@@ -14839,10 +15600,6 @@ echo " "
 set d_sbrkproto sbrk $i_unistd unistd.h
 eval $hasproto
 
-: see if scalbnl exists
-set scalbnl d_scalbnl
-eval $inlibc
-
 : see if select exists
 set select d_select
 eval $inlibc
@@ -14909,14 +15666,13 @@ else
     echo "You do not have union semun in <sys/sem.h>." >&4
     val="$undef"
 fi
-$rm -f try try.c try.h
+$rm -f try try.c
 set d_union_semun
 eval $setvar
 
 : see how to do semctl IPC_STAT
 case "$d_sem" in
 $define)
-    : see whether semctl IPC_STAT can use union semun
     echo " "
     $cat > try.h <<END
 #ifndef S_IRUSR
@@ -14942,8 +15698,11 @@ $define)
 #   define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)
 #endif
 END
-
-    $cat > try.c <<END
+    : see whether semctl IPC_STAT can use union semun
+    val="$undef"
+    case "$d_semctl_semun" in
+    '')
+      $cat > try.c <<END
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -14989,15 +15748,16 @@ int main() {
   return 0;
 }
 END
-    val="$undef"
-    set try
-    if eval $compile; then
-       xxx=`$run ./try`
-        case "$xxx" in
-        semun) val="$define" ;;
-        esac
-    fi
-    $rm -f try try.c
+      set try
+      if eval $compile; then
+         xxx=`$run ./try`
+          case "$xxx" in
+          semun) val="$define" ;;
+          esac
+      fi
+      $rm -f try try.c
+      ;;
+    esac
     set d_semctl_semun
     eval $setvar
     case "$d_semctl_semun" in
@@ -15011,7 +15771,10 @@ END
     esac
 
     : see whether semctl IPC_STAT can use struct semid_ds pointer
-    $cat > try.c <<'END'
+    val="$undef"
+    case "$d_semctl_semid_ds" in
+    '')
+      $cat > try.c <<'END'
 #include <sys/types.h>
 #include <sys/ipc.h>
 #include <sys/sem.h>
@@ -15047,15 +15810,16 @@ int main() {
     return 0;
 }
 END
-    val="$undef"
-    set try
-    if eval $compile; then
-        xxx=`$run ./try`
-        case "$xxx" in
-        semid_ds) val="$define" ;;
-        esac
-    fi
-    $rm -f try try.c
+      set try
+      if eval $compile; then
+          xxx=`$run ./try`
+          case "$xxx" in
+          semid_ds) val="$define" ;;
+          esac
+      fi
+      $rm -f try try.c
+      ;;
+    esac
     set d_semctl_semid_ds
     eval $setvar
     case "$d_semctl_semid_ds" in
        else
                echo "But you don't seem to have a useable struct sigaction." >&4
                val="$undef"
-       fi
-else
-       echo 'sigaction NOT found.' >&4
-       val="$undef"
-fi
-set d_sigaction; eval $setvar
-$rm -f try try$_o try.c
-
-: see if sigprocmask exists
-set sigprocmask d_sigprocmask
-eval $inlibc
-
-: see if sigsetjmp exists
-echo " "
-case "$d_sigsetjmp" in
-'')
-       $cat >try.c <<EOP
-#include <setjmp.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-sigjmp_buf env;
-int set = 1;
-int main()
-{
-       if (sigsetjmp(env,1))
-               exit(set);
-       set = 0;
-       siglongjmp(env, 1);
-       exit(1);
-}
-EOP
-       set try
-       if eval $compile; then
-               if $run ./try >/dev/null 2>&1; then
-                       echo "POSIX sigsetjmp found." >&4
-                       val="$define"
-               else
-                       $cat >&4 <<EOM
-Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
-I'll ignore them.
-EOM
-                       val="$undef"
-               fi
-       else
-               echo "sigsetjmp not found." >&4
-               val="$undef"
-       fi
-       ;;
-*) val="$d_sigsetjmp"
-       case "$d_sigsetjmp" in
-       $define) echo "POSIX sigsetjmp found." >&4;;
-       $undef) echo "sigsetjmp not found." >&4;;
-       esac
-       ;;
-esac
-set d_sigsetjmp
-eval $setvar
-$rm -f try.c try
-
-: see if sockatmark exists
-set sockatmark d_sockatmark
-eval $inlibc
-
-: see if prototype for sockatmark is available
-echo " "
-set d_sockatmarkproto sockatmark $d_socket sys/socket.h
-eval $hasproto
-
-: see if socks5_init exists
-set socks5_init d_socks5_init
-eval $inlibc
-
-: see if srand48_r exists
-set srand48_r d_srand48_r
-eval $inlibc
-case "$d_srand48_r" in
-"$define")
-       hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
-       case "$d_srand48_r_proto:$usethreads" in
-       ":define")      d_srand48_r_proto=define
-               set d_srand48_r_proto srand48_r $hdrs
-               eval $hasproto ;;
-       *)      ;;
-       esac
-       case "$d_srand48_r_proto" in
-       define)
-       case "$srand48_r_proto" in
-       ''|0) try='int srand48_r(long, struct drand48_data*);'
-       ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
-       esac
-       case "$srand48_r_proto" in
-       ''|0)   d_srand48_r=undef
-               srand48_r_proto=0
-               echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
-       * )     case "$srand48_r_proto" in
-               REENTRANT_PROTO*) ;;
-               *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
-               esac
-               echo "Prototype: $try" ;;
-       esac
-       ;;
-       *)      case "$usethreads" in
-               define) echo "srand48_r has no prototype, not using it." >&4 ;;
-               esac
-               d_srand48_r=undef
-               srand48_r_proto=0
-               ;;
-       esac
-       ;;
-*)     srand48_r_proto=0
-       ;;
-esac
-
-: see if srandom_r exists
-set srandom_r d_srandom_r
-eval $inlibc
-case "$d_srandom_r" in
-"$define")
-       hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
-       case "$d_srandom_r_proto:$usethreads" in
-       ":define")      d_srandom_r_proto=define
-               set d_srandom_r_proto srandom_r $hdrs
-               eval $hasproto ;;
-       *)      ;;
-       esac
-       case "$d_srandom_r_proto" in
-       define)
-       case "$srandom_r_proto" in
-       ''|0) try='int srandom_r(unsigned int, struct random_data*);'
-       ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
-       esac
-       case "$srandom_r_proto" in
-       ''|0)   d_srandom_r=undef
-               srandom_r_proto=0
-               echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
-       * )     case "$srandom_r_proto" in
-               REENTRANT_PROTO*) ;;
-               *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
-               esac
-               echo "Prototype: $try" ;;
-       esac
-       ;;
-       *)      case "$usethreads" in
-               define) echo "srandom_r has no prototype, not using it." >&4 ;;
-               esac
-               d_srandom_r=undef
-               srandom_r_proto=0
-               ;;
-       esac
-       ;;
-*)     srandom_r_proto=0
-       ;;
-esac
-
-: see if prototype for setresgid is available
-echo " "
-set d_sresgproto setresgid $i_unistd unistd.h
-eval $hasproto
-
-: see if prototype for setresuid is available
-echo " "
-set d_sresuproto setresuid $i_unistd unistd.h
-eval $hasproto
-
-: see if sys/stat.h is available
-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
-
-
-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
-eval $hasstruct
-case "$d_statfs_s" in
-"$define")      echo "Yes, it does."   ;;
-*)              echo "No, it doesn't." ;;
-esac
-
-
-
-: see if struct statfs knows about f_flags
-case "$d_statfs_s" in
-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
-       eval $hasfield
-       ;;
-*)     val="$undef"
-       set d_statfs_f_flags
-       eval $setvar
-       ;;
-esac
-case "$d_statfs_f_flags" in
-"$define")      echo "Yes, it does."   ;;
-*)              echo "No, it doesn't." ;;
-esac
-
-: see if _ptr and _cnt from stdio act std
-echo " "
-
-if $contains '_lbfsize' `./findhdr stdio.h` >/dev/null 2>&1 ; then
-       echo "(Looks like you have stdio.h from BSD.)"
-       case "$stdio_ptr" in
-       '') stdio_ptr='((fp)->_p)'
-               ptr_lval=$define
-               ;;
-       *)      ptr_lval=$d_stdio_ptr_lval;;
-       esac
-       case "$stdio_cnt" in
-       '') stdio_cnt='((fp)->_r)'
-               cnt_lval=$define
-               ;;
-       *)      cnt_lval=$d_stdio_cnt_lval;;
-       esac
-       case "$stdio_base" in
-       '') stdio_base='((fp)->_ub._base ? (fp)->_ub._base : (fp)->_bf._base)';;
-       esac
-       case "$stdio_bufsiz" in
-       '') stdio_bufsiz='((fp)->_ub._base ? (fp)->_ub._size : (fp)->_bf._size)';;
-       esac
-elif $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
-       echo "(Looks like you have stdio.h from Linux.)"
-       case "$stdio_ptr" in
-       '') stdio_ptr='((fp)->_IO_read_ptr)'
-               ptr_lval=$define
-               ;;
-       *)      ptr_lval=$d_stdio_ptr_lval;;
-       esac
-       case "$stdio_cnt" in
-       '') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
-               cnt_lval=$undef
-               ;;
-       *)      cnt_lval=$d_stdio_cnt_lval;;
-       esac
-       case "$stdio_base" in
-       '') stdio_base='((fp)->_IO_read_base)';;
-       esac
-       case "$stdio_bufsiz" in
-       '') stdio_bufsiz='((fp)->_IO_read_end - (fp)->_IO_read_base)';;
-       esac
-else
-       case "$stdio_ptr" in
-       '') stdio_ptr='((fp)->_ptr)'
-               ptr_lval=$define
-               ;;
-       *)      ptr_lval=$d_stdio_ptr_lval;;
-       esac
-       case "$stdio_cnt" in
-       '') stdio_cnt='((fp)->_cnt)'
-               cnt_lval=$define
-               ;;
-       *)      cnt_lval=$d_stdio_cnt_lval;;
-       esac
-       case "$stdio_base" in
-       '') stdio_base='((fp)->_base)';;
-       esac
-       case "$stdio_bufsiz" in
-       '') stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)';;
-       esac
-fi
-
-: test whether _ptr and _cnt really work
-echo "Checking how std your stdio is..." >&4
-$cat >try.c <<EOP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define FILE_ptr(fp)   $stdio_ptr
-#define FILE_cnt(fp)   $stdio_cnt
-int main() {
-       FILE *fp = fopen("try.c", "r");
-       char c = getc(fp);
-       if (
-               18 <= FILE_cnt(fp) &&
-               strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
-       )
-               exit(0);
-       exit(1);
-}
-EOP
-val="$undef"
-set try
-if eval $compile && $to try.c; then
-       if $run ./try; then
-               echo "Your stdio acts pretty std."
-               val="$define"
-       else
-               echo "Your stdio isn't very std."
-       fi
-else
-       echo "Your stdio doesn't appear very std."
-fi
-$rm -f try.c try
-
-# glibc 2.2.90 and above apparently change stdio streams so Perl's
-# direct buffer manipulation no longer works.  The Configure tests
-# should be changed to correctly detect this, but until then,
-# the following check should at least let perl compile and run.
-# (This quick fix should be updated before 5.8.1.)
-# To be defensive, reject all unknown versions, and all versions  > 2.2.9.
-# A. Dougherty, June 3, 2002.
-case "$d_gnulibc" in
-$define)
-       case "$gnulibc_version" in
-       2.[01]*)  ;;
-       2.2) ;;
-       2.2.[0-9]) ;;
-       *)  echo "But I will not snoop inside glibc $gnulibc_version stdio buffers."
-               val="$undef"
-               ;;
-       esac
-       ;;
-esac
-set d_stdstdio
-eval $setvar
-
-: Can _ptr be used as an lvalue?
-case "$d_stdstdio$ptr_lval" in
-$define$define) val=$define ;;
-*) val=$undef ;;
-esac
-set d_stdio_ptr_lval
-eval $setvar
-
-: Can _cnt be used as an lvalue?
-case "$d_stdstdio$cnt_lval" in
-$define$define) val=$define ;;
-*) val=$undef ;;
-esac
-set d_stdio_cnt_lval
-eval $setvar
-
-
-: test whether setting _ptr sets _cnt as a side effect
-d_stdio_ptr_lval_sets_cnt="$undef"
-d_stdio_ptr_lval_nochange_cnt="$undef"
-case "$d_stdio_ptr_lval$d_stdstdio" in
-$define$define)
-       echo "Checking to see what happens if we set the stdio ptr..." >&4
-$cat >try.c <<EOP
-#include <stdio.h>
-/* Can we scream? */
-/* Eat dust sed :-) */
-/* In the buffer space, no one can hear you scream. */
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#define FILE_ptr(fp)   $stdio_ptr
-#define FILE_cnt(fp)   $stdio_cnt
-#include <sys/types.h>
-int main() {
-       FILE *fp = fopen("try.c", "r");
-       int c;
-       char *ptr;
-       size_t cnt;
-       if (!fp) {
-           puts("Fail even to read");
-           exit(1);
-       }
-       c = getc(fp); /* Read away the first # */
-       if (c == EOF) {
-           puts("Fail even to read");
-           exit(1);
-       }
-       if (!(
-               18 <= FILE_cnt(fp) &&
-               strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
-       )) {
-               puts("Fail even to read");
-               exit (1);
-       }
-       ptr = (char*) FILE_ptr(fp);
-       cnt = (size_t)FILE_cnt(fp);
-
-       FILE_ptr(fp) += 42;
-
-       if ((char*)FILE_ptr(fp) != (ptr + 42)) {
-               printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
-               exit (1);
-       }
-       if (FILE_cnt(fp) <= 20) {
-               printf ("Fail (<20 chars to test)");
-               exit (1);
-       }
-       if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
-               puts("Fail compare");
-               exit (1);
-       }
-       if (cnt == FILE_cnt(fp)) {
-               puts("Pass_unchanged");
-               exit (0);
-       }       
-       if (FILE_cnt(fp) == (cnt - 42)) {
-               puts("Pass_changed");
-               exit (0);
-       }
-       printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
-       return 1;
-
-}
-EOP
-       set try
-       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" ;;
-               Pass_unchanged)
-                       echo "Increasing ptr in your stdio leaves cnt unchanged.  Good." >&4
-                       d_stdio_ptr_lval_nochange_cnt="$define" ;;
-               Fail*)
-                       echo "Increasing ptr in your stdio didn't do exactly what I expected.  We'll not be doing that then." >&4 ;;
-               *)
-                       echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
-       esac
-       else
-               echo "It seems we can't set ptr in your stdio.  Nevermind." >&4
-       fi
-       $rm -f try.c try
-       ;;
-esac
+       fi
+else
+       echo 'sigaction NOT found.' >&4
+       val="$undef"
+fi
+set d_sigaction; eval $setvar
+$rm -f try try$_o try.c
 
-: see if _base is also standard
-val="$undef"
-case "$d_stdstdio" in
-$define)
+: see if sigprocmask exists
+set sigprocmask d_sigprocmask
+eval $inlibc
+
+: see if sigsetjmp exists
+echo " "
+case "$d_sigsetjmp" in
+'')
        $cat >try.c <<EOP
-#include <stdio.h>
+#include <setjmp.h>
 #$i_stdlib I_STDLIB
 #ifdef I_STDLIB
 #include <stdlib.h>
 #endif
-#define FILE_base(fp)  $stdio_base
-#define FILE_bufsiz(fp)        $stdio_bufsiz
-int main() {
-       FILE *fp = fopen("try.c", "r");
-       char c = getc(fp);
-       if (
-               19 <= FILE_bufsiz(fp) &&
-               strncmp(FILE_base(fp), "#include <stdio.h>\n", 19) == 0
-       )
-               exit(0);
+sigjmp_buf env;
+int set = 1;
+int main()
+{
+       if (sigsetjmp(env,1))
+               exit(set);
+       set = 0;
+       siglongjmp(env, 1);
        exit(1);
 }
 EOP
        set try
-       if eval $compile && $to try.c; then
-               if $run ./try; then
-                       echo "And its _base field acts std."
+       if eval $compile; then
+               if $run ./try >/dev/null 2>&1; then
+                       echo "POSIX sigsetjmp found." >&4
                        val="$define"
                else
-                       echo "But its _base field isn't std."
+                       $cat >&4 <<EOM
+Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
+I'll ignore them.
+EOM
+                       val="$undef"
                fi
        else
-               echo "However, it seems to be lacking the _base field."
+               echo "sigsetjmp not found." >&4
+               val="$undef"
        fi
-       $rm -f try.c try
+       ;;
+*) val="$d_sigsetjmp"
+       case "$d_sigsetjmp" in
+       $define) echo "POSIX sigsetjmp found." >&4;;
+       $undef) echo "sigsetjmp not found." >&4;;
+       esac
        ;;
 esac
-set d_stdiobase
+set d_sigsetjmp
 eval $setvar
+$rm -f try.c try
+
+: see if sockatmark exists
+set sockatmark d_sockatmark
+eval $inlibc
+
+: see if prototype for sockatmark is available
+echo " "
+set d_sockatmarkproto sockatmark $d_socket sys/socket.h
+eval $hasproto
+
+: see if socks5_init exists
+set socks5_init d_socks5_init
+eval $inlibc
+
+: see if srand48_r exists
+set srand48_r d_srand48_r
+eval $inlibc
+case "$d_srand48_r" in
+"$define")
+       hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
+       case "$d_srand48_r_proto:$usethreads" in
+       ":define")      d_srand48_r_proto=define
+               set d_srand48_r_proto srand48_r $hdrs
+               eval $hasproto ;;
+       *)      ;;
+       esac
+       case "$d_srand48_r_proto" in
+       define)
+       case "$srand48_r_proto" in
+       ''|0) try='int srand48_r(long, struct drand48_data*);'
+       ./protochk "extern $try" $hdrs && srand48_r_proto=I_LS ;;
+       esac
+       case "$srand48_r_proto" in
+       ''|0)   d_srand48_r=undef
+               srand48_r_proto=0
+               echo "Disabling srand48_r, cannot determine prototype." >&4 ;;
+       * )     case "$srand48_r_proto" in
+               REENTRANT_PROTO*) ;;
+               *) srand48_r_proto="REENTRANT_PROTO_$srand48_r_proto" ;;
+               esac
+               echo "Prototype: $try" ;;
+       esac
+       ;;
+       *)      case "$usethreads" in
+               define) echo "srand48_r has no prototype, not using it." >&4 ;;
+               esac
+               d_srand48_r=undef
+               srand48_r_proto=0
+               ;;
+       esac
+       ;;
+*)     srand48_r_proto=0
+       ;;
+esac
+
+: see if srandom_r exists
+set srandom_r d_srandom_r
+eval $inlibc
+case "$d_srandom_r" in
+"$define")
+       hdrs="$i_systypes sys/types.h define stdio.h $i_stdlib stdlib.h"
+       case "$d_srandom_r_proto:$usethreads" in
+       ":define")      d_srandom_r_proto=define
+               set d_srandom_r_proto srandom_r $hdrs
+               eval $hasproto ;;
+       *)      ;;
+       esac
+       case "$d_srandom_r_proto" in
+       define)
+       case "$srandom_r_proto" in
+       ''|0) try='int srandom_r(unsigned int, struct random_data*);'
+       ./protochk "extern $try" $hdrs && srandom_r_proto=I_TS ;;
+       esac
+       case "$srandom_r_proto" in
+       ''|0)   d_srandom_r=undef
+               srandom_r_proto=0
+               echo "Disabling srandom_r, cannot determine prototype." >&4 ;;
+       * )     case "$srandom_r_proto" in
+               REENTRANT_PROTO*) ;;
+               *) srandom_r_proto="REENTRANT_PROTO_$srandom_r_proto" ;;
+               esac
+               echo "Prototype: $try" ;;
+       esac
+       ;;
+       *)      case "$usethreads" in
+               define) echo "srandom_r has no prototype, not using it." >&4 ;;
+               esac
+               d_srandom_r=undef
+               srandom_r_proto=0
+               ;;
+       esac
+       ;;
+*)     srandom_r_proto=0
+       ;;
+esac
+
+: see if prototype for setresgid is available
+echo " "
+set d_sresgproto setresgid $i_unistd unistd.h
+eval $hasproto
+
+: see if prototype for setresuid is available
+echo " "
+set d_sresuproto setresuid $i_unistd unistd.h
+eval $hasproto
+
+: see if sys/stat.h is available
+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
+
+
+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
+eval $hasstruct
+case "$d_statfs_s" in
+"$define")      echo "Yes, it does."   ;;
+*)              echo "No, it doesn't." ;;
+esac
+
+
+
+: see if struct statfs knows about f_flags
+case "$d_statfs_s" in
+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
+       eval $hasfield
+       ;;
+*)     val="$undef"
+       set d_statfs_f_flags
+       eval $setvar
+       ;;
+esac
+case "$d_statfs_f_flags" in
+"$define")      echo "Yes, it does."   ;;
+*)              echo "No, it doesn't." ;;
+esac
 
 $cat >&4 <<EOM
 Checking how to access stdio streams by file descriptor number...
@@ -16308,6 +16804,14 @@ esac
 set strftime d_strftime
 eval $inlibc
 
+: see if strlcat exists
+set strlcat d_strlcat
+eval $inlibc
+
+: see if strlcpy exists
+set strlcpy d_strlcpy
+eval $inlibc
+
 : see if strtod exists
 set strtod d_strtod
 eval $inlibc
@@ -16880,10 +17384,10 @@ int main() {
     buf[1] = 0;
     buf[2] = 0;
     buf[3] = 1;
+    buf[4] = 0;
     buf[5] = 0;
     buf[6] = 0;
-    buf[7] = 0;
-    buf[8] = 1;
+    buf[7] = 1;
 
     for (i = 0; i < 4; i++) {
        up = (U32*)(buf + i);
@@ -17159,9 +17663,9 @@ esac
 : set the base revision
 baserev=5.0
 
-: how do we catenate cpp tokens here?
+: how do we concatenate cpp tokens here?
 echo " "
-echo "Checking to see how your cpp does stuff like catenate tokens..." >&4
+echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
 $cat >cpp_stuff.c <<'EOCP'
 #define RCAT(a,b)a/**/b
 #define ACAT(a,b)a ## b
@@ -17180,8 +17684,8 @@ elif $contains 'Reiser' cpp_stuff.out >/dev/null 2>&1; then
        cpp_stuff=1
 else
        $cat >&4 <<EOM
-Hmm, I don't seem to be able to catenate tokens with your cpp.  You're going
-to have to edit the values of CAT[2-5] in config.h...
+Hmm, I don't seem to be able to concatenate tokens with your cpp.
+You're going to have to edit the values of CAT[2-5] in config.h...
 EOM
        cpp_stuff="/* Help! How do we handle cpp_stuff? */*/"
 fi
@@ -18568,12 +19072,6 @@ rp="What is the type of process ids on this system?"
 set pid_t pidtype int stdio.h sys/types.h
 eval $typedef_ask
 
-: Find earliest binary compatible site_perl subdirectory perl can use.
-xs_apiversion=$version # The current site_perl version.
-: Find earliest pure perl site_perl subdirectory perl can use.
-: The versioned directories started at 5.005.
-pm_apiversion='5.005'
-
 : see if ar generates random libraries by itself
 echo " "
 echo "Checking how to generate random libraries on your machine..." >&4
@@ -18594,7 +19092,9 @@ if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
        $run ./foobar >/dev/null 2>&1; then
        echo "$ar appears to generate random libraries itself."
        orderlib=false
-       ranlib=":"
+       if [ "X$ranlib" = "X" ]; then
+           ranlib=":"
+       fi
 elif $ar ts bar$_a >/dev/null 2>&1 &&
        $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
        $run ./foobar >/dev/null 2>&1; then
@@ -18849,6 +19349,12 @@ int main() {
 #endif
 
 #ifndef NSIG
+#  ifdef _SIG_MAX
+#    define NSIG (_SIG_MAX+1)
+#  endif
+#endif
+
+#ifndef NSIG
 #  ifdef MAXSIG
 #    define NSIG (MAXSIG+1)
 #  endif
@@ -18862,7 +19368,7 @@ int main() {
 
 #ifndef NSIG
 #  ifdef SIGARRAYSIZE
-#    define NSIG (SIGARRAYSIZE+1) /* Not sure of the +1 */
+#    define NSIG SIGARRAYSIZE /* Assume ary[SIGARRAYSIZE] */
 #  endif
 #endif
 
@@ -19347,6 +19853,16 @@ case "$uidsign" in
        ;;
 esac
 
+
+case "$usesitecustomize" in
+    $define|true|[Yy]*)
+       usesitecustomize="$define"
+       ;;
+    *)
+       usesitecustomize="$undef"
+       ;;
+    esac
+
 : determine compiler compiler
 case "$yacc" in
 '')
 
 
 
-: see if this is a math.h system
-set math.h i_math
-eval $inhdr
-
 : see if this is a mntent.h system
 set mntent.h i_mntent
 eval $inhdr
@@ -19495,13 +20007,13 @@ $echo "Guessing which symbols your C compiler and preprocessor define..." >&4
 $cat <<'EOSH' > Cppsym.know
 a29k ABI64 aegis AES_SOURCE AIX AIX32 AIX370
 AIX41 AIX42 AIX43 AIX_SOURCE aixpc ALL_SOURCE
-alliant alpha am29000 AM29000 AMD64 amiga AMIGAOS AMIX
+alliant alpha am29000 AM29000 AMD64 amd64 amiga AMIGAOS AMIX
 ansi ANSI_C_SOURCE apollo ardent ARM32 atarist att386 att3b
 BeOS BIG_ENDIAN BIT_MSF bsd BSD bsd43 bsd4_2 bsd4_3 BSD4_3 bsd4_4
 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
+CYGWIN DECC DGUX DGUX_SOURCE DJGPP dmert DOLPHIN DPX2 DSO
 Dynix DynixPTX ELF encore EPI EXTENSIONS FAVOR_BSD
 FILE_OFFSET_BITS FreeBSD GCC_NEW_VARARGS gcos gcx gimpel
 GLIBC GLIBC_MINOR
@@ -19553,7 +20065,7 @@ 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
+Utek UTek UTS UWIN uxpm uxps vax venix VMESA vms x86_64 xenix Xenix286
 XOPEN_SOURCE XOPEN_SOURCE_EXTENDED XPG2 XPG2_EXTENDED
 XPG3 XPG3_EXTENDED XPG4 XPG4_EXTENDED
 z8000
@@ -20048,6 +20560,39 @@ set X $avail_ext
 shift
 avail_ext="$*"
 
+case "$onlyextensions" in
+'') ;;
+*)  keepextensions=''
+    echo "You have requested that only certains extensions be included..." >&4
+    for i in $onlyextensions; do
+        case " $avail_ext " in
+        *" $i "*)
+            echo "Keeping extension $i."
+            keepextensions="$keepextensions $i"
+            ;;
+        *) echo "Ignoring extension $i." ;;
+        esac
+    done
+    avail_ext="$keepextensions"
+    ;;
+esac
+
+case "$noextensions" in
+'') ;;
+*)  keepextensions=''
+    echo "You have requested that certain extensions be ignored..." >&4
+    for i in $avail_ext; do
+        case " $noextensions " in
+        *" $i "*) echo "Ignoring extension $i." ;;
+        *) echo "Keeping extension $i.";
+           keepextensions="$keepextensions $i"
+           ;;
+        esac
+    done
+    avail_ext="$keepextensions"
+    ;;
+esac
+
 : Now see which nonxs extensions are supported on this system.
 : For now assume all are.
 nonxs_ext=''
@@ -20200,6 +20745,23 @@ set X $dynamic_ext $static_ext $nonxs_ext
 shift
 extensions="$*"
 
+# Sanity check:  We require an extension suitable for use with
+# AnyDBM_File, as well as Fcntl and IO.  (Failure to have these
+# should show up as failures in the test suite, but it's helpful to
+# catch them now.) The 'extensions' list is normally sorted
+# alphabetically, so we need to accept either
+#    DB_File ... Fcntl ... IO  ....
+# or something like
+#    Fcntl ... NDBM_File ... IO  ....
+case " $extensions"  in
+*"_File "*" Fcntl "*" IO "*) ;; # DB_File
+*" Fcntl "*"_File "*" IO "*) ;; # GDBM_File
+*" Fcntl "*" IO "*"_File "*) ;; # NDBM_File
+*) echo "WARNING: Extensions DB_File or *DBM_File, Fcntl, and IO not configured." >&4
+   echo "WARNING: The Perl you are building will be quite crippled." >& 4
+   ;;
+esac
+
 : Remove libraries needed only for extensions
 : The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
 : The exception is SunOS 4.x, which needs them.
@@ -20391,7 +20953,13 @@ d_archlib='$d_archlib'
 d_asctime_r='$d_asctime_r'
 d_atolf='$d_atolf'
 d_atoll='$d_atoll'
-d_attribut='$d_attribut'
+d_attribute_format='$d_attribute_format'
+d_attribute_malloc='$d_attribute_malloc'
+d_attribute_nonnull='$d_attribute_nonnull'
+d_attribute_noreturn='$d_attribute_noreturn'
+d_attribute_pure='$d_attribute_pure'
+d_attribute_unused='$d_attribute_unused'
+d_attribute_warn_unused_result='$d_attribute_warn_unused_result'
 d_bcmp='$d_bcmp'
 d_bcopy='$d_bcopy'
 d_bsd='$d_bsd'
@@ -20442,6 +21010,7 @@ d_endsent='$d_endsent'
 d_endservent_r='$d_endservent_r'
 d_eofnblk='$d_eofnblk'
 d_eunice='$d_eunice'
+d_faststdio='$d_faststdio'
 d_fchdir='$d_fchdir'
 d_fchmod='$d_fchmod'
 d_fchown='$d_fchown'
@@ -20545,6 +21114,7 @@ d_isnanl='$d_isnanl'
 d_killpg='$d_killpg'
 d_lchown='$d_lchown'
 d_ldbl_dig='$d_ldbl_dig'
+d_libm_lib_version='$d_libm_lib_version'
 d_link='$d_link'
 d_localtime_r='$d_localtime_r'
 d_locconv='$d_locconv'
@@ -20554,6 +21124,8 @@ d_longlong='$d_longlong'
 d_lseekproto='$d_lseekproto'
 d_lstat='$d_lstat'
 d_madvise='$d_madvise'
+d_malloc_good_size='$d_malloc_good_size'
+d_malloc_size='$d_malloc_size'
 d_mblen='$d_mblen'
 d_mbstowcs='$d_mbstowcs'
 d_mbtowc='$d_mbtowc'
@@ -20587,10 +21159,10 @@ d_msgsnd='$d_msgsnd'
 d_msync='$d_msync'
 d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
-d_nanosleep='$d_nanosleep'
 d_nice='$d_nice'
 d_nl_langinfo='$d_nl_langinfo'
 d_nv_preserves_uv='$d_nv_preserves_uv'
+d_nv_zero_is_allbits_zero='$d_nv_zero_is_allbits_zero'
 d_off64_t='$d_off64_t'
 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
 d_oldpthreads='$d_oldpthreads'
@@ -20605,6 +21177,7 @@ d_poll='$d_poll'
 d_portable='$d_portable'
 d_procselfexe='$d_procselfexe'
 d_pthread_atfork='$d_pthread_atfork'
+d_pthread_attr_setscope='$d_pthread_attr_setscope'
 d_pthread_yield='$d_pthread_yield'
 d_pwage='$d_pwage'
 d_pwchange='$d_pwchange'
@@ -20713,6 +21286,8 @@ d_strerrm='$d_strerrm'
 d_strerror='$d_strerror'
 d_strerror_r='$d_strerror_r'
 d_strftime='$d_strftime'
+d_strlcat='$d_strlcat'
+d_strlcpy='$d_strlcpy'
 d_strtod='$d_strtod'
 d_strtol='$d_strtol'
 d_strtold='$d_strtold'
@@ -20959,21 +21534,21 @@ installprivlib='$installprivlib'
 installscript='$installscript'
 installsitearch='$installsitearch'
 installsitebin='$installsitebin'
-installsitehtml1='$installsitehtml1'
-installsitehtml3='$installsitehtml3'
+installsitehtml1dir='$installsitehtml1dir'
+installsitehtml3dir='$installsitehtml3dir'
 installsitelib='$installsitelib'
-installsiteman1='$installsiteman1'
-installsiteman3='$installsiteman3'
+installsiteman1dir='$installsiteman1dir'
+installsiteman3dir='$installsiteman3dir'
 installsitescript='$installsitescript'
 installstyle='$installstyle'
 installusrbinperl='$installusrbinperl'
 installvendorarch='$installvendorarch'
 installvendorbin='$installvendorbin'
-installvendorhtml1='$installvendorhtml1'
-installvendorhtml3='$installvendorhtml3'
+installvendorhtml1dir='$installvendorhtml1dir'
+installvendorhtml3dir='$installvendorhtml3dir'
 installvendorlib='$installvendorlib'
-installvendorman1='$installvendorman1'
-installvendorman3='$installvendorman3'
+installvendorman1dir='$installvendorman1dir'
+installvendorman3dir='$installvendorman3dir'
 installvendorscript='$installvendorscript'
 intsize='$intsize'
 issymlink='$issymlink'
@@ -21029,6 +21604,7 @@ man3dir='$man3dir'
 man3direxp='$man3direxp'
 man3ext='$man3ext'
 mips_type='$mips_type'
+mistrustnm='$mistrustnm'
 mkdir='$mkdir'
 mmaptype='$mmaptype'
 modetype='$modetype'
@@ -21082,7 +21658,6 @@ pg='$pg'
 phostname='$phostname'
 pidtype='$pidtype'
 plibpth='$plibpth'
-pm_apiversion='$pm_apiversion'
 pmake='$pmake'
 pr='$pr'
 prefix='$prefix'
@@ -21153,17 +21728,17 @@ sitearch='$sitearch'
 sitearchexp='$sitearchexp'
 sitebin='$sitebin'
 sitebinexp='$sitebinexp'
-sitehtml1='$sitehtml1'
-sitehtml1exp='$sitehtml1exp'
-sitehtml3='$sitehtml3'
-sitehtml3exp='$sitehtml3exp'
+sitehtml1dir='$sitehtml1dir'
+sitehtml1direxp='$sitehtml1direxp'
+sitehtml3dir='$sitehtml3dir'
+sitehtml3direxp='$sitehtml3direxp'
 sitelib='$sitelib'
 sitelib_stem='$sitelib_stem'
 sitelibexp='$sitelibexp'
-siteman1='$siteman1'
-siteman1exp='$siteman1exp'
-siteman3='$siteman3'
-siteman3exp='$siteman3exp'
+siteman1dir='$siteman1dir'
+siteman1direxp='$siteman1direxp'
+siteman3dir='$siteman3dir'
+siteman3direxp='$siteman3direxp'
 siteprefix='$siteprefix'
 siteprefixexp='$siteprefixexp'
 sitescript='$sitescript'
@@ -21233,9 +21808,11 @@ use64bitall='$use64bitall'
 use64bitint='$use64bitint'
 usecrosscompile='$usecrosscompile'
 usedl='$usedl'
+usefaststdio='$usefaststdio'
 useithreads='$useithreads'
 uselargefiles='$uselargefiles'
 uselongdouble='$uselongdouble'
+usemallocwrap='$usemallocwrap'
 usemorebits='$usemorebits'
 usemultiplicity='$usemultiplicity'
 usemymalloc='$usemymalloc'
@@ -21244,8 +21821,10 @@ useopcode='$useopcode'
 useperlio='$useperlio'
 useposix='$useposix'
 usereentrant='$usereentrant'
+userelocatableinc='$userelocatableinc'
 usesfio='$usesfio'
 useshrplib='$useshrplib'
+usesitecustomize='$usesitecustomize'
 usesocks='$usesocks'
 usethreads='$usethreads'
 usevendorprefix='$usevendorprefix'
@@ -21262,17 +21841,17 @@ vendorarch='$vendorarch'
 vendorarchexp='$vendorarchexp'
 vendorbin='$vendorbin'
 vendorbinexp='$vendorbinexp'
-vendorhtml1='$vendorhtml1'
-vendorhtml1exp='$vendorhtml1exp'
-vendorhtml3='$vendorhtml3'
-vendorhtml3exp='$vendorhtml3exp'
+vendorhtml1dir='$vendorhtml1dir'
+vendorhtml1direxp='$vendorhtml1direxp'
+vendorhtml3dir='$vendorhtml3dir'
+vendorhtml3direxp='$vendorhtml3direxp'
 vendorlib='$vendorlib'
 vendorlib_stem='$vendorlib_stem'
 vendorlibexp='$vendorlibexp'
-vendorman1='$vendorman1'
-vendorman1exp='$vendorman1exp'
-vendorman3='$vendorman3'
-vendorman3exp='$vendorman3exp'
+vendorman1dir='$vendorman1dir'
+vendorman1direxp='$vendorman1direxp'
+vendorman3dir='$vendorman3dir'
+vendorman3direxp='$vendorman3direxp'
 vendorprefix='$vendorprefix'
 vendorprefixexp='$vendorprefixexp'
 vendorscript='$vendorscript'
@@ -21283,7 +21862,6 @@ versiononly='$versiononly'
 vi='$vi'
 voidflags='$voidflags'
 xlibpth='$xlibpth'
-xs_apiversion='$xs_apiversion'
 yacc='$yacc'
 yaccflags='$yaccflags'
 zcat='$zcat'