This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make the don't-use-nm symbol table probes work under C++.
[perl5.git] / Configure
index 2dd947e..b317e44 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -26,7 +26,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Mon Apr 17 14:14:39 CEST 2006 [metaconfig 3.0 PL70]
+# Generated on Fri Mar  9 20:00:14 CET 2007 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -65,6 +65,18 @@ EOF
        exit 1
 fi
 
+if test ! -c /dev/null ; then
+       cat >&4 <<EOF
+***
+*** I'm sorry, but /dev/null appears to be a file rather than a device.
+*** Please consult your operating sytem's notes for making a device
+*** in /dev.
+*** Cannot continue, aborting.
+***
+EOF
+       exit 1
+fi
+
 : compute my invocation name
 me=$0
 case "$0" in
@@ -354,11 +366,13 @@ d_attribute_noreturn=''
 d_attribute_pure=''
 d_attribute_unused=''
 d_attribute_warn_unused_result=''
+d_printf_format_null=''
 d_bcmp=''
 d_bcopy=''
 d_builtin_choose_expr=''
 d_builtin_expect=''
 d_bzero=''
+d_c99_variadic_macros=''
 d_casti32=''
 castflags=''
 d_castneg=''
@@ -372,12 +386,14 @@ d_void_closedir=''
 d_cmsghdr_s=''
 d_const=''
 d_copysignl=''
+d_cplusplus=''
 cryptlib=''
 d_crypt=''
 crypt_r_proto=''
 d_crypt_r=''
 d_csh=''
 full_csh=''
+d_ctermid=''
 ctermid_r_proto=''
 d_ctermid_r=''
 ctime_r_proto=''
@@ -386,6 +402,7 @@ d_cuserid=''
 d_dbl_dig=''
 d_dbminitproto=''
 d_difftime=''
+d_dir_dd_fd=''
 d_dirfd=''
 d_dlerror=''
 d_dlopen=''
@@ -546,6 +563,7 @@ d_ldbl_dig=''
 d_libm_lib_version=''
 d_link=''
 d_localtime_r=''
+d_localtime_r_needs_tzset=''
 localtime_r_proto=''
 d_locconv=''
 d_lockf=''
@@ -682,6 +700,7 @@ d_shmctl=''
 d_shmdt=''
 d_shmget=''
 d_sigaction=''
+d_signbit=''
 d_sigprocmask=''
 d_sigsetjmp=''
 usesitecustomize=''
@@ -777,6 +796,7 @@ d_unsetenv=''
 d_usleep=''
 d_usleepproto=''
 d_ustat=''
+d_pseudofork=''
 d_vfork=''
 usevfork=''
 d_voidsig=''
@@ -1243,29 +1263,10 @@ 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"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
-:
-: no include file wanted by default
-inclwanted=''
-
-: Enable -DEBUGGING and -DDEBUGGING from the command line
-EBUGGING=''
-DEBUGGING=old
-
 groupstype=''
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
@@ -1279,6 +1280,7 @@ glibpth="/lib /usr/lib $xlibpth"
 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
 test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
 test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
 
 : Private path used by Configure to find libraries.  Its value
 : is prepended to libpth. This variable takes care of special
@@ -1292,17 +1294,36 @@ ignore_versioned_solibs=''
 siteman1dir=''
 siteman3dir=''
 sitescript=''
+: set usethreads on the Configure command line to enable threads.
+usereentrant='undef'
+: full support for void wanted by default
+defvoidused=15
+
+: 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"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
+: Enable -DEBUGGING and -DDEBUGGING from the command line
+EBUGGING=''
+DEBUGGING=old
+
+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
 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.
-: 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 extra -lxxx, put those in a hint file.
 libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
@@ -3384,8 +3405,13 @@ EOM
        $cat <<EOM
 
 You may give one or more space-separated answers, or "none" if appropriate.
-A well-behaved OS will have no hints, so answering "none" or just "Policy"
-is a good thing.  DO NOT give a wrong version or a wrong OS.
+If you have a handcrafted Policy.sh file or a Policy.sh file generated by a
+previous run of Configure, you may specify it as well as or instead of
+OS-specific hints.  If hints are provided for your OS, you should use them:
+although Perl can probably be built without hints on many platforms, using
+hints often improve performance and may enable features that Configure can't
+set up on its own. If there are no hints that match your OS, specify "none";
+DO NOT give a wrong version or a wrong OS.
 
 EOM
 
@@ -3926,9 +3952,21 @@ $startsh
 EOS
 cat <<'EOSC' >>whoa
 dflt=y
-echo " "
-echo "*** WHOA THERE!!! ***" >&4
-echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
+case "$hint" in
+    recommended)
+       case "$hintfile" in
+       '')     echo "The $hint value for \$$var on this machine was \"$was\"!" >&4
+               ;;
+       *)      echo "Hmm.  Based on the hints in hints/$hintfile.sh, " >&4
+               echo "the $hint value for \$$var on this machine was \"$was\"!" >&4
+               ;;
+       esac
+       ;;
+    *) echo " "
+       echo "*** WHOA THERE!!! ***" >&4
+       echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
+       ;;
+esac
 rp="    Keep the $hint value?"
 . ./myread
 case "$ans" in
@@ -4014,6 +4052,62 @@ EOM
 esac
 
        
+: get the patchlevel
+echo " "
+echo "Getting the current patchlevel..." >&4
+if $test -r $rsrc/patchlevel.h;then
+       revision=`awk '/define[         ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
+       patchlevel=`awk '/define[       ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+       subversion=`awk '/define[       ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+       api_revision=`awk '/define[     ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
+       api_version=`awk '/define[      ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
+       api_subversion=`awk '/define[   ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+       perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
+else
+       revision=0
+       patchlevel=0
+       subversion=0
+       api_revision=0
+       api_version=0
+       api_subversion=0
+       perl_patchlevel=0
+       $echo "(You do not have patchlevel.h.  Eek.)"
+fi
+if $test -r $rsrc/.patch ; then
+       if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
+               perl_patchlevel=`cat $rsrc/.patch`
+       fi
+fi
+: Define a handy string here to avoid duplication in myconfig.SH and configpm.
+version_patchlevel_string="version $patchlevel subversion $subversion"
+case "$perl_patchlevel" in
+0|'') ;;
+*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
+esac
+
+$echo "(You have $package $version_patchlevel_string.)"
+
+case "$osname" in
+dos|vms)
+       : XXX Should be a Configure test for double-dots in filenames.
+       version=`echo $revision $patchlevel $subversion | \
+                $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+       api_versionstring=`echo $api_revision $api_version $api_subversion | \
+                $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
+       ;;
+*)
+       version=`echo $revision $patchlevel $subversion | \
+                $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
+       api_versionstring=`echo $api_revision $api_version $api_subversion | \
+                $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
+       ;;
+esac
+: Special case the 5.005_xx maintenance series, which used 5.005
+: without any subversion label as a subdirectory in $sitelib
+if test "${api_revision}${api_version}${api_subversion}" = "550"; then
+       api_versionstring='5.005'
+fi
+
 case "$usethreads" in
 $define|true|[yY]*)     dflt='y';;
 *)     # Catch case where user specified ithreads or 5005threads but
@@ -4050,8 +4144,9 @@ esac
 set usethreads
 eval $setvar
 
-case "$usethreads" in
-$define)
+if $test $patchlevel -lt 9; then
+    case "$usethreads" in
+    $define)
        $cat <<EOM
 
 Since release 5.6, Perl has had two different threading implementations,
@@ -4088,14 +4183,14 @@ EOM
        set use5005threads
        eval $setvar
        ;;
-*)
+    *)
        useithreads="$undef"
        use5005threads="$undef"
        ;;
-esac
+    esac
 
-case "$useithreads$use5005threads" in
-"$define$define")
+    case "$useithreads$use5005threads" in
+    "$define$define")
        $cat >&4 <<EOM
 
 You cannot have both the ithreads and the 5.005 threads enabled
@@ -4105,7 +4200,35 @@ much less stable than the ithreads.
 EOM
        use5005threads="$undef"
        ;;
-esac
+    esac
+
+else
+: perl-5.9.x and later
+
+    use5005threads="$undef"
+    case "$usethreads" in
+    $define)
+       : Default to ithreads unless overridden on command line or with
+       : old config.sh
+       dflt='y'
+       case "$useithreads" in
+               $undef|false|[nN]*) dflt='n';;
+       esac
+       rp='Use the newer interpreter-based ithreads?'
+       . ./myread
+       case "$ans" in
+       y|Y)    val="$define" ;;
+       *)      val="$undef" ;;
+       esac
+       set useithreads
+       eval $setvar
+       ;;
+    *)
+       useithreads="$undef"
+       ;;
+    esac
+
+fi
 
 if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
        cat >&4 <<EOF
@@ -4302,7 +4425,7 @@ echo "Checking for GNU cc in disguise and/or its version number..." >&4
 $cat >try.c <<EOM
 #include <stdio.h>
 int main() {
-#ifdef __GNUC__
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
 #ifdef __VERSION__
        printf("%s\n", __VERSION__);
 #else
@@ -4872,7 +4995,7 @@ case "$EBUGGING" in
 esac
 
 case "$DEBUGGING" in
--g|$define)
+-g|both|$define)
     case "$optimize" in
        *-g*) ;;
        *)    optimize="$optimize -g" ;;
@@ -4947,20 +5070,6 @@ default|recommended)
                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
        ;;
@@ -5961,62 +6070,6 @@ prefixit='case "$3" in
        esac;;
 esac'
 
-: get the patchlevel
-echo " "
-echo "Getting the current patchlevel..." >&4
-if $test -r $rsrc/patchlevel.h;then
-       revision=`awk '/define[         ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
-       patchlevel=`awk '/define[       ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
-       subversion=`awk '/define[       ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
-       api_revision=`awk '/define[     ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
-       api_version=`awk '/define[      ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
-       api_subversion=`awk '/define[   ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
-       perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
-else
-       revision=0
-       patchlevel=0
-       subversion=0
-       api_revision=0
-       api_version=0
-       api_subversion=0
-       perl_patchlevel=0
-       $echo "(You do not have patchlevel.h.  Eek.)"
-fi
-if $test -r $rsrc/.patch ; then
-       if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
-               perl_patchlevel=`cat $rsrc/.patch`
-       fi
-fi
-: Define a handy string here to avoid duplication in myconfig.SH and configpm.
-version_patchlevel_string="version $patchlevel subversion $subversion"
-case "$perl_patchlevel" in
-0|'') ;;
-*) version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel" ;;
-esac
-
-$echo "(You have $package $version_patchlevel_string.)"
-
-case "$osname" in
-dos|vms)
-       : XXX Should be a Configure test for double-dots in filenames.
-       version=`echo $revision $patchlevel $subversion | \
-                $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
-       api_versionstring=`echo $api_revision $api_version $api_subversion | \
-                $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
-       ;;
-*)
-       version=`echo $revision $patchlevel $subversion | \
-                $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
-       api_versionstring=`echo $api_revision $api_version $api_subversion | \
-                $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
-       ;;
-esac
-: Special case the 5.005_xx maintenance series, which used 5.005
-: without any subversion label as a subdirectory in $sitelib
-if test "${api_revision}${api_version}${api_subversion}" = "550"; then
-       api_versionstring='5.005'
-fi
-
 : determine installation style
 : For now, try to deduce it from prefix unless it is already set.
 : Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
@@ -6045,6 +6098,8 @@ if $test "X$ansexp" != "X$binexp"; then
 fi
 prefixvar=bin
 : XXX Bug? -- ignores Configure -Dinstallprefix setting.
+: XXX If this is fixed, also fix the "start perl" hunk below, which relies on
+:     this via initialinstalllocation
 . ./setprefixvar
 
 case "$userelocatableinc" in
@@ -6069,10 +6124,10 @@ esac
 set userelocatableinc
 eval $setvar
 
+initialinstalllocation="$binexp"
 : Default prefix is now "up one level from where the binaries are"
 case "$userelocatableinc" in
 $define|true|[yY]*)
-    initialinstalllocation="$binexp"
     bin=".../"
     binexp=".../"
     prefix=".../.."
@@ -6351,30 +6406,34 @@ use File::Basename;
 \$archname = "$archname";
 EOPL
        $cat >> getverlist <<'EOPL'
+# The list found is store twice for each entry: the original name, and
+# the binary broken down version as pack "sss", so sorting is easy and
+# unambiguous. This will work for all versions that have a maximum of
+# three digit groups, separate by '.'s or '_'s. Names are extended with
+# ".0.0" to ensure at least three elements for the pack.
+#                                      -- H.Merijn Brand (m)'06 23-10-2006
+
 # Can't have leading @ because metaconfig interprets it as a command!
 ;@inc_version_list=();
 # XXX Redo to do opendir/readdir?
 if (-d $stem) {
     chdir($stem);
-    ;@candidates = glob("5.*");
+    ;@candidates = map {
+       [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
 }
 else {
     ;@candidates = ();
 }
 
-# XXX ToDo:  These comparisons must be reworked when two-digit
-# subversions come along, so that 5.7.10 compares as greater than
-# 5.7.3!  By that time, hope that 5.6.x is sufficiently
-# widespread that we can use the built-in version vectors rather
-# than reinventing them here.  For 5.6.0, however, we must
-# assume this script will likely be run by 5.005_0x.  --AD 1/2000.
+($pversion, $aversion, $vsn5005) = map {
+    pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
 foreach $d (@candidates) {
-    if ($d lt $version) {
-       if ($d ge $api_versionstring) {
-           unshift(@inc_version_list, grep { -d } "$d/$archname", $d);
+    if ($d->[1] lt $pversion) {
+       if ($d->[1] ge $aversion) {
+           unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
        }
-       elsif ($d ge "5.005") {
-           unshift(@inc_version_list, grep { -d } $d);
+       elsif ($d->[1] ge $vsn5005) {
+           unshift(@inc_version_list, grep { -d } $d->[0]);
        }
     }
     else {
@@ -7099,7 +7158,7 @@ int main(void)
 {
 #ifdef __GLIBC__
 #   ifdef __GLIBC_MINOR__
-#       if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
+#       if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 && !defined(__cplusplus)
 #           include <gnu/libc-version.h>
            printf("%s\n",  gnu_get_libc_version());
 #       else
@@ -7523,18 +7582,21 @@ true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
 esac;
 case "$tx" in
 yes)
+       case "$d_cplusplus" in
+               $define) extern_C=\"C\";;
+       esac;
        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;
+                       echo "extern $extern_C void *$1$tdc; void *(*(p()))$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;
        else
-               echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+               echo "extern $extern_C void *$1$tdc; void *(*(p()))$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;
@@ -7575,12 +7637,53 @@ yes)
        esac;;
 esac'
 
+
+echo " "
+echo "Checking for C++..." >&4
+cat >try.c <<'EOCP'
+#include <stdio.h>
+int main(void)
+{
+#ifdef __cplusplus
+    printf("define\n");
+#else
+    printf("undef\n");
+#endif
+    return 0;
+}
+EOCP
+set try
+if eval $compile_ok && $run ./try >cplusplus$$; then
+       val=`$cat cplusplus$$`
+       echo "You are using a C++ compiler."
+else
+       val="$undef"
+       echo "You are not using a C++ compiler."
+fi
+$rm -f try try.* cplusplus$$
+set d_cplusplus
+eval $setvar
+
 : see if dlopen exists
 xxx_runnm="$runnm"
+xxx_ccflags="$ccflags"
 runnm=false
+: with g++ one needs -shared to get is-in-libc to work for dlopen
+case "$gccversion" in
+'')    ;;
+*)     case "$d_cplusplus" in
+       "$define") ccflags="$ccflags -shared" ;;
+       esac
+       ;;
+esac
 set dlopen d_dlopen
 eval $inlibc
 runnm="$xxx_runnm"
+ccflags="$xxx_ccflags"
+
+: see if this is a unistd.h system
+set unistd.h i_unistd
+eval $inhdr
 
 : determine which dynamic loading, if any, to compile in
 echo " "
@@ -7657,7 +7760,7 @@ EOM
                        ;;
                *)  case "$osname" in
                        darwin) dflt='none' ;;
-                       svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
+                       linux*|svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
                        *)      dflt='-fpic' ;;
                    esac ;;
            esac ;;
@@ -7685,9 +7788,13 @@ EOM
 #ifdef I_STDLIB
 #include <stdlib.h>
 #endif
-int main() {
-       char b[4];
-       int i = open("a.out",O_RDONLY);
+#$i_unistd I_UNISTD
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+int main() {
+       char b[4];
+       int i = open("a.out",O_RDONLY);
        if(i == -1) 
                exit(1); /* fail */
        if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
@@ -7732,7 +7839,7 @@ EOM
                              '') dflt="$dflt +vnocompatwarnings" ;;
                              esac
                              ;;        
-                       linux|irix*|gnu*)       dflt='-shared' ;;
+                       linux|irix*|gnu*)  dflt="-shared $optimize" ;;
                        next)  dflt='none' ;;
                        solaris) dflt='-G' ;;
                        sunos) dflt='-assert nodefinitions' ;;
@@ -8566,6 +8673,9 @@ case "$versiononly" in
 esac
 
 : figure out how to guarantee perl startup
+: XXX Note that this currently takes advantage of the bug that binexp ignores
+:     the Configure -Dinstallprefix setting, which in turn means that under
+:     relocatable @INC, initialinstalllocation is what binexp started as.
 case "$startperl" in
 '')
        case "$sharpbang" in
@@ -8575,13 +8685,13 @@ case "$startperl" in
 I can use the #! construct to start perl on your system. This will
 make startup of perl scripts faster, but may cause problems if you
 want to share those scripts and perl is not in a standard place
-($binexp/perl) on all your platforms. The alternative is to force
-a shell by starting the script with a single ':' character.
+($initialinstalllocation/perl) on all your platforms. The alternative
+is to force a shell by starting the script with a single ':' character.
 
 EOH
                case "$versiononly" in
-               "$define")      dflt="$binexp/perl$version";;  
-               *)              dflt="$binexp/perl";;
+               "$define")      dflt="$initialinstalllocation/perl$version";;
+               *)              dflt="$initialinstalllocation/perl";;
                esac
                rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
                . ./myread
@@ -8610,8 +8720,8 @@ echo "I'll use $startperl to start perl scripts."
 case "$perlpath" in
 '')
        case "$versiononly" in
-       "$define")      perlpath="$binexp/perl$version";;
-       *)              perlpath="$binexp/perl";;
+       "$define")      perlpath="$initialinstalllocation/perl$version";;
+       *)              perlpath="$initialinstalllocation/perl";;
        esac
        case "$startperl" in
        *!*) ;;
@@ -8621,10 +8731,10 @@ case "$perlpath" in
 I will use the "eval 'exec'" idiom to start Perl on your system.
 I can use the full path of your Perl binary for this purpose, but
 doing so may cause problems if you want to share those scripts and
-Perl is not always in a standard place ($binexp/perl).
+Perl is not always in a standard place ($initialinstalllocation/perl).
 
 EOH
-               dflt="$binexp/perl"
+               dflt="$initialinstalllocation/perl"
                rp="What path shall I use in \"eval 'exec'\"?"
                . ./myread
                perlpath="$ans"
@@ -9915,6 +10025,50 @@ set d_attribute_format
 eval $setvar
 $rm -f attrib*
 
+: Look for GCC-style attribute format with null format allowed
+case "$d_printf_format_null" in
+'') case "$d_attribute_format" in
+    $define)
+       echo " "
+       echo "Checking whether your compiler allows __printf__ format to be null ..." >&4
+$cat >attrib.c <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2)));
+int null_printf (char* pat,...) { return (int)pat; }
+int main () { exit(null_printf(NULL)); }
+EOCP
+       if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
+           : run the executable in case it produces a run-time warning
+           if $run ./attrib >>attrib.out 2>&1; then
+               if $contains 'warning' attrib.out >/dev/null 2>&1; then
+                   echo "Your C compiler doesn't allow __printf__ format to be null."
+                   val="$undef"
+               else
+                   echo "Your C compiler allows __printf__ format to be null."
+                   val="$define"
+               fi
+           else
+           echo "Your C compiler executable failed with __printf__ format null."
+           val="$undef"
+       fi
+    else
+       echo "Your C compiler fails with __printf__ format null."
+       val="$undef"
+    fi
+    ;;
+    *)  val="$undef" ;;
+    esac
+;;
+*)  val="$d_printf_format_null" ;;
+esac
+set d_printf_format_null
+eval $setvar
+$rm -f attrib*
+
 : Look for GCC-style attribute malloc
 case "$d_attribute_malloc" in
 '')
@@ -10091,10 +10245,6 @@ eval $inlibc
 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
@@ -10295,6 +10445,146 @@ $rm -f try.* try core core.try.*
 set bzero d_bzero
 eval $inlibc
 
+: see if stdarg is available
+echo " "
+if $test `./findhdr stdarg.h`; then
+       echo "<stdarg.h> found." >&4
+       valstd="$define"
+else
+       echo "<stdarg.h> NOT found." >&4
+       valstd="$undef"
+fi
+
+: see if varags is available
+echo " "
+if $test `./findhdr varargs.h`; then
+       echo "<varargs.h> found." >&4
+else
+       echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
+fi
+
+: set up the varargs testing programs
+$cat > varargs.c <<EOP
+#ifdef I_STDARG
+#include <stdarg.h>
+#endif
+#ifdef I_VARARGS
+#include <varargs.h>
+#endif
+
+#ifdef I_STDARG
+int f(char *p, ...)
+#else
+int f(va_alist)
+va_dcl
+#endif
+{
+       va_list ap;
+#ifndef I_STDARG
+       char *p;
+#endif
+#ifdef I_STDARG
+       va_start(ap,p);
+#else
+       va_start(ap);
+       p = va_arg(ap, char *);
+#endif
+       va_end(ap);
+       return 0;
+}
+EOP
+$cat > varargs <<EOP
+$startsh
+if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
+       echo "true"
+else
+       echo "false"
+fi
+$rm -f varargs$_o
+EOP
+chmod +x varargs
+
+: now check which varargs header should be included
+echo " "
+i_varhdr=''
+case "$valstd" in
+"$define")
+       if `./varargs I_STDARG`; then
+               val='stdarg.h'
+       elif `./varargs I_VARARGS`; then
+               val='varargs.h'
+       fi
+       ;;
+*)
+       if `./varargs I_VARARGS`; then
+               val='varargs.h'
+       fi
+       ;;
+esac
+case "$val" in
+'')
+echo "I could not find the definition for va_dcl... You have problems..." >&4
+       val="$undef"; set i_stdarg; eval $setvar
+       val="$undef"; set i_varargs; eval $setvar
+       ;;
+*) 
+       set i_varhdr
+       eval $setvar
+       case "$i_varhdr" in
+       stdarg.h)
+               val="$define"; set i_stdarg; eval $setvar
+               val="$undef"; set i_varargs; eval $setvar
+               ;;
+       varargs.h)
+               val="$undef"; set i_stdarg; eval $setvar
+               val="$define"; set i_varargs; eval $setvar
+               ;;
+       esac
+       echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
+esac
+$rm -f varargs*
+
+: see if the Compiler supports C99 variadic macros
+case "$i_stdarg$i_stdlib" in
+    "$define$define")
+    echo "You have <stdarg.h> and <stdlib.h>, so checking for C99 variadic macros." >&4
+    $cat >try.c <<EOCP
+#include <stdio.h>
+#include <stdarg.h>
+
+#define foo(buffer, format, ...) sprintf(buffer, format, __VA_ARGS__)
+
+int main() {
+  char buf[20];
+  foo(buf, "%d %g %.*s", 123, 456.0, (int)3, "789fail");
+  puts(buf);
+  return 0;
+}
+EOCP
+    set try
+    if eval $compile && $run ./try 2>&1 >/dev/null; then
+       case "`$run ./try`" in
+           "123 456 789")
+           echo "You have C99 variadic macros." >&4
+           d_c99_variadic_macros="$define"
+           ;;
+           *)
+           echo "You don't have functional C99 variadic macros." >&4
+           d_c99_variadic_macros="$undef"
+           ;;
+       esac
+    else
+       echo "I couldn't compile and run the test program, so I assume that you don't have functional C99 variadic macros." >&4
+       d_c99_variadic_macros="$undef"
+    fi
+    $rm -f try.* try core core.try.*
+    ;;
+    *)
+    echo "You don't have <stdarg.h> and <stdlib.h>, so not checking for C99 variadic macros." >&4
+    d_c99_variadic_macros="$undef"
+    ;;
+esac
+
 : see if signal is declared as pointer to function returning int or void
 echo " "
 xxx=`./findhdr signal.h`
@@ -10355,7 +10645,7 @@ $cat >try.c <<EOCP
 #endif
 #include <sys/types.h>
 #include <signal.h>
-$signal_t blech(s) int s; { exit(3); }
+$signal_t blech(int s) { exit(3); }
 int main()
 {
        $xxx i32;
@@ -10413,11 +10703,11 @@ $cat >try.c <<EOCP
 #endif
 #include <sys/types.h>
 #include <signal.h>
-$signal_t blech(s) int s; { exit(7); }
-$signal_t blech_in_list(s) int s; { exit(4); }
-unsigned long dummy_long(p) unsigned long p; { return p; }
-unsigned int dummy_int(p) unsigned int p; { return p; }
-unsigned short dummy_short(p) unsigned short p; { return p; }
+$signal_t blech(int s) { exit(7); }
+$signal_t blech_in_list(int s) { exit(4); }
+unsigned long dummy_long(unsigned long p) { return p; }
+unsigned int dummy_int(unsigned int p) { return p; }
+unsigned short dummy_short(unsigned short p) { return p; }
 int main()
 {
        double f;
@@ -10690,7 +10980,7 @@ typedef struct spug { int drokk; } spug;
 int main()
 {
        const char *foo;
-       const spug y;
+       const spug y = { 0 };
 }
 EOCP
 if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
@@ -10807,6 +11097,10 @@ case "$full_csh" in
 '') full_csh=$csh ;;
 esac
 
+: see if ctermid exists
+set ctermid d_ctermid
+eval $inlibc
+
 : see if ctermid_r exists
 set ctermid_r d_ctermid_r
 eval $inlibc
@@ -11047,6 +11341,42 @@ set d_dirnamlen
 eval $setvar
 $rm -f try.c
 
+: Look for DIR.dd_fd
+case "$i_dirent" in
+"$define")
+    echo "Checking to see if DIR has a dd_fd member variable" >&4
+    $cat >try.c <<EOCP
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#include <dirent.h>
+
+int main() {
+    DIR dir;
+    dir.dd_fd = 1;
+    return 0;
+}
+EOCP
+    val=$undef
+    set try
+    if eval $compile; then
+        echo "Yes, it does."
+        val="$define"
+    else
+        echo "No, it does not."
+        val="$undef"
+    fi
+    ;;
+*)
+    echo "You don't have a <dirent.h>, so not checking for dd_fd." >&4
+    val="$undef"
+    ;;
+esac
+set d_dir_dd_fd
+eval $setvar
+$rm -f try try.*
+
 : see if this is an sysdir system
 set sys/dir.h i_sysdir
 eval $inhdr
@@ -11912,7 +12242,7 @@ extern int errno;
 #else
 #include <strings.h>
 #endif
-$signal_t blech(x) int x; { exit(3); }
+$signal_t blech(int x) { exit(3); }
 EOCP
        $cat >> try.c <<'EOCP'
 int main()
@@ -12345,7 +12675,7 @@ $cat >try.c <<EOCP
 #include <unistd.h>
 #include <fcntl.h>
 #include <signal.h>
-$signal_t blech(x) int x; { exit(3); }
+$signal_t blech(int x) { exit(3); }
 int main() {
 #if defined(F_SETLK) && defined(F_SETLKW)
      struct flock flock;
@@ -14326,6 +14656,59 @@ case "$d_localtime_r" in
        ;;
 esac
 
+: see if localtime_r calls tzset
+case "$localtime_r_proto" in
+REENTRANT_PROTO*)
+       $cat >try.c <<EOCP
+/*  Does our libc's localtime_r call tzset ?
+ *  return 0 if so, 1 otherwise.
+ */
+#include <sys/types.h>
+#include <unistd.h>
+#include <time.h>
+#include <string.h>
+#include <malloc.h>
+int main()
+{
+    time_t t = time(0L);
+    char w_tz[]="TZ" "=GMT+5",
+        e_tz[]="TZ" "=GMT-5",
+       *tz_e = (char*)malloc(16),
+       *tz_w = (char*)malloc(16);
+    struct tm tm_e, tm_w;
+    memset(&tm_e,'\0',sizeof(struct tm));
+    memset(&tm_w,'\0',sizeof(struct tm));
+    strcpy(tz_e,e_tz);
+    strcpy(tz_w,w_tz);
+
+    putenv(tz_e);
+    localtime_r(&t, &tm_e);
+
+    putenv(tz_w);
+    localtime_r(&t, &tm_w);
+
+    if( memcmp(&tm_e, &tm_w, sizeof(struct tm)) == 0 )
+       return 1;
+    return 0;
+}
+EOCP
+       set try
+       if eval $compile; then
+           if ./try; then
+               d_localtime_r_needs_tzset=undef;
+           else
+               d_localtime_r_needs_tzset=define;
+           fi;
+       else
+           d_localtime_r_needs_tzset=undef;
+       fi;
+     ;;
+  *)
+     d_localtime_r_needs_tzset=undef;
+     ;;
+esac
+$rm -f try try.* core
+
 : see if localeconv exists
 set localeconv d_locconv
 eval $inlibc
@@ -14898,7 +15281,7 @@ $cat <<EOP >try.c
 #include <signal.h>
 #ifdef SIGFPE
 $volatile int bletched = 0;
-$signal_t blech(s) int s; { bletched = 1; }
+$signal_t blech(int s) { bletched = 1; }
 #endif
 int main() {
     $uvtype u = 0;
@@ -14920,10 +15303,9 @@ int main() {
       if (($uvtype)d != (u - 1))
         break;
 #ifdef SIGFPE
-      if (bletched) {
+      if (bletched)
        break;
 #endif
-      }        
     }
     printf("%d\n", ((i == n) ? -n : i));
     exit(0);
@@ -14944,7 +15326,7 @@ case "$nv_preserves_uv_bits" in
 [1-9]*)        $echo "Your NVs can preserve only $nv_preserves_uv_bits bits of your UVs."  2>&1
        d_nv_preserves_uv="$undef" ;;
 *)     $echo "Can't figure out how many bits your NVs preserve." 2>&1
-       nv_preserves_uv_bits="$undef" ;;
+       nv_preserves_uv_bits="0" ;;
 esac
 
 $rm -f try.* try
@@ -14970,7 +15352,7 @@ $cat <<EOP >try.c
 #include <signal.h>
 #ifdef SIGFPE
 $volatile int bletched = 0;
-$signal_t blech(s) int s; { bletched = 1; }
+$signal_t blech(int s) { bletched = 1; }
 #endif
 
 int checkit($nvtype d, char *where) {
@@ -15194,6 +15576,54 @@ $rm -f reflect
 set d_procselfexe
 eval $setvar
 
+: backward compatibility for d_hvfork
+if test X$d_hvfork != X; then
+       d_vfork="$d_hvfork"
+       d_hvfork=''
+fi
+: see if there is a vfork
+val=''
+set vfork val
+eval $inlibc
+
+d_pseudofork=$undef
+
+: Ok, but do we want to use it. vfork is reportedly unreliable in
+: perl on Solaris 2.x, and probably elsewhere.
+case "$val" in
+$define)
+       echo " "
+       case "$usevfork" in
+       false) dflt='n';;
+       *) dflt='y';;
+       esac
+       cat <<'EOM'
+
+Perl can only use a vfork() that doesn't suffer from strict
+restrictions on calling functions or modifying global data in
+the child.  For example, glibc-2.1 contains such a vfork()
+that is unsuitable.  If your system provides a proper fork()
+call, chances are that you do NOT want perl to use vfork().
+
+EOM
+       rp="Do you still want to use vfork()?"
+       . ./myread
+       case "$ans" in
+       y|Y) ;;
+       *)
+               echo "Ok, we won't use vfork()."
+               val="$undef"
+               ;;
+       esac
+       ;;
+esac
+set d_vfork
+eval $setvar
+case "$d_vfork" in
+$define) usevfork='true';;
+*) usevfork='false';;
+esac
+
 : see whether the pthread_atfork exists
 $cat >try.c <<EOP
 #include <pthread.h>
 set d_sigaction; eval $setvar
 $rm -f try try$_o try.c
 
+: see if this is a sunmath.h system
+set sunmath.h i_sunmath
+eval $inhdr
+
+: see if signbit exists
+$echo $n "Checking to see if you have signbit() available to work on $nvtype... $c" >&4
+$cat >try.c <<EOCP
+#$i_math I_MATH
+#$i_sunmath I_SUNMATH
+#ifdef I_MATH
+#  include <math.h>
+#endif
+#ifdef I_SUNMATH  /* Solaris special math library */
+#  include <sunmath.h>
+#endif
+#define NV $nvtype
+int main(int argc, char **argv)
+{
+    NV x = 0.0;
+    NV y = -0.0;
+    if ((signbit(x) == 0) && (signbit(y) != 0))
+       return 0;
+    else
+       return 1;
+}
+EOCP
+val="$undef"
+set try
+if eval $compile; then
+    if $run ./try; then
+        $echo "Yes." >&4
+       val="$define"
+    else
+        $echo "Signbit seems to be available, but doesn't work as I expected."
+        $echo "I won't use it." >&4
+       val="$undef"
+    fi
+else
+    $echo "Nope." >&4
+    dflt="$undef"
+fi
+set d_signbit
+eval $setvar
+$rm -f try.* try
+
 : see if sigprocmask exists
 set sigprocmask d_sigprocmask
 eval $inlibc
@@ -17586,7 +18061,7 @@ case "$d_u32align" in
 #define U8 $u8type
 #include <signal.h>
 #ifdef SIGBUS
-$signal_t bletch(s) int s; { exit(4); }
+$signal_t bletch(int s) { exit(4); }
 #endif
 int main() {
 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
@@ -17702,52 +18177,6 @@ eval $hasproto
 set ustat d_ustat
 eval $inlibc
 
-: backward compatibility for d_hvfork
-if test X$d_hvfork != X; then
-       d_vfork="$d_hvfork"
-       d_hvfork=''
-fi
-: see if there is a vfork
-val=''
-set vfork val
-eval $inlibc
-
-: Ok, but do we want to use it. vfork is reportedly unreliable in 
-: perl on Solaris 2.x, and probably elsewhere.
-case "$val" in
-$define)
-       echo " "
-       case "$usevfork" in
-       false) dflt='n';;
-       *) dflt='y';;
-       esac
-       cat <<'EOM'
-Perl can only use a vfork() that doesn't suffer from strict
-restrictions on calling functions or modifying global data in
-the child.  For example, glibc-2.1 contains such a vfork()
-that is unsuitable.  If your system provides a proper fork()
-call, chances are that you do NOT want perl to use vfork().
-
-EOM
-       rp="Do you still want to use vfork()?"
-       . ./myread
-       case "$ans" in
-       y|Y) ;;
-       *)
-               echo "Ok, we won't use vfork()."
-               val="$undef"
-               ;;
-       esac
-       ;;
-esac
-set d_vfork
-eval $setvar
-case "$d_vfork" in
-$define) usevfork='true';;
-*) usevfork='false';;
-esac
-
 : see if closedir exists
 set closedir d_closedir
 eval $inlibc
@@ -18945,11 +19374,15 @@ EOM
 esac
 
 
-case "$mad" in
-$define|true|[yY]*)    dflt='y' ;;
-*)                     dflt='n' ;;
-esac
-cat <<EOM
+if $test $patchlevel -lt 9; then
+: MAD is not available in 5.8.x or earlier.
+    ans=n;
+else
+    case "$mad" in
+    $define|true|[yY]*)        dflt='y' ;;
+    *)                 dflt='n' ;;
+    esac
+    cat <<EOM
 
 Would you like to build with Misc Attribute Decoration? This is development
 work leading to a Perl 5 to Perl 6 convertor, which imposes a space and speed
@@ -18957,8 +19390,9 @@ overhead on the interpreter.
 
 If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
-rp='Build Perl with MAD?'
-. ./myread
+    rp='Build Perl with MAD?'
+    . ./myread
+fi
 case "$ans" in
 y|Y)   val="$define"
        madlyh='madly.h madly.act madly.tab'
@@ -18997,104 +19431,6 @@ rp="What is the type used for file modes for system calls (e.g. fchmod())?"
 set mode_t modetype int stdio.h sys/types.h
 eval $typedef_ask
 
-: see if stdarg is available
-echo " "
-if $test `./findhdr stdarg.h`; then
-       echo "<stdarg.h> found." >&4
-       valstd="$define"
-else
-       echo "<stdarg.h> NOT found." >&4
-       valstd="$undef"
-fi
-
-: see if varags is available
-echo " "
-if $test `./findhdr varargs.h`; then
-       echo "<varargs.h> found." >&4
-else
-       echo "<varargs.h> NOT found, but that's ok (I hope)." >&4
-fi
-
-: set up the varargs testing programs
-$cat > varargs.c <<EOP
-#ifdef I_STDARG
-#include <stdarg.h>
-#endif
-#ifdef I_VARARGS
-#include <varargs.h>
-#endif
-
-#ifdef I_STDARG
-int f(char *p, ...)
-#else
-int f(va_alist)
-va_dcl
-#endif
-{
-       va_list ap;
-#ifndef I_STDARG
-       char *p;
-#endif
-#ifdef I_STDARG
-       va_start(ap,p);
-#else
-       va_start(ap);
-       p = va_arg(ap, char *);
-#endif
-       va_end(ap);
-}
-EOP
-$cat > varargs <<EOP
-$startsh
-if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
-       echo "true"
-else
-       echo "false"
-fi
-$rm -f varargs$_o
-EOP
-chmod +x varargs
-
-: now check which varargs header should be included
-echo " "
-i_varhdr=''
-case "$valstd" in
-"$define")
-       if `./varargs I_STDARG`; then
-               val='stdarg.h'
-       elif `./varargs I_VARARGS`; then
-               val='varargs.h'
-       fi
-       ;;
-*)
-       if `./varargs I_VARARGS`; then
-               val='varargs.h'
-       fi
-       ;;
-esac
-case "$val" in
-'')
-echo "I could not find the definition for va_dcl... You have problems..." >&4
-       val="$undef"; set i_stdarg; eval $setvar
-       val="$undef"; set i_varargs; eval $setvar
-       ;;
-*) 
-       set i_varhdr
-       eval $setvar
-       case "$i_varhdr" in
-       stdarg.h)
-               val="$define"; set i_stdarg; eval $setvar
-               val="$undef"; set i_varargs; eval $setvar
-               ;;
-       varargs.h)
-               val="$undef"; set i_stdarg; eval $setvar
-               val="$define"; set i_varargs; eval $setvar
-               ;;
-       esac
-       echo "We'll include <$i_varhdr> to get va_dcl definition." >&4;;
-esac
-$rm -f varargs*
-
 : see if we need va_copy
 echo " "
 case "$i_stdarg" in
@@ -19479,7 +19815,7 @@ $selecttype b;
 #define NBYTES (S * 8 > MINBITS ? S : MINBITS/8)
 #define NBITS  (NBYTES * 8)
 int main() {
-    char *s = malloc(NBYTES);
+    char *s = (char *)malloc(NBYTES);
     struct timeval t;
     int i;
     FILE* fp;
@@ -20164,6 +20500,26 @@ eval $inhdr
 set fp_class.h i_fp_class
 eval $inhdr
 
+: see if gdbm.h is available
+set gdbm.h t_gdbm
+eval $inhdr
+case "$t_gdbm" in
+$define)
+       : see if gdbm_open exists
+       set gdbm_open d_gdbm_open
+       eval $inlibc
+       case "$d_gdbm_open" in
+       $undef)
+               t_gdbm="$undef"
+               echo "We won't be including <gdbm.h>"
+               ;;
+       esac
+       ;;
+esac
+val="$t_gdbm"
+set i_gdbm
+eval $setvar
+
 : see if this is a ieeefp.h system
 case "$i_ieeefp" in
 '' ) set ieeefp.h i_ieeefp
@@ -20544,10 +20900,6 @@ val=$val3; set i_termios; eval $setvar
 set stddef.h i_stddef
 eval $inhdr
 
-: see if this is a sunmath.h system
-set sunmath.h i_sunmath
-eval $inhdr
-
 : see if sys/access.h is available
 set sys/access.h i_sysaccess
 eval $inhdr
@@ -20651,26 +21003,6 @@ case "$d_vfork" in
        ;;
 esac
 
-: see if gdbm.h is available
-set gdbm.h t_gdbm
-eval $inhdr
-case "$t_gdbm" in
-$define)
-       : see if gdbm_open exists
-       set gdbm_open d_gdbm_open
-       eval $inlibc
-       case "$d_gdbm_open" in
-       $undef)
-               t_gdbm="$undef"
-               echo "We won't be including <gdbm.h>"
-               ;;
-       esac
-       ;;
-esac
-val="$t_gdbm"
-set i_gdbm
-eval $setvar
-
 echo " "
 echo "Looking for extensions..." >&4
 : If we are using the old config.sh, known_extensions may contain
@@ -20686,24 +21018,24 @@ nonxs_extensions=''
 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
 find_extensions='
     for xxx in *; do
-       case "$xxx" in
-           DynaLoader|dynaload) ;;
-           *)
-           if $test -f $xxx/$xxx.xs; then
-               known_extensions="$known_extensions $1$xxx";
-           elif $test -f $xxx/Makefile.PL; then
-               nonxs_extensions="$nonxs_extensions $1$xxx";
-           else
-               if $test -d $xxx -a $# -lt 10; then
-                   set $1$xxx/ $*;
-                   cd "$xxx";
-                   eval $find_extensions;
-                   cd ..;
-                   shift;
-               fi;
-           fi
-           ;;
-       esac;
+       case "$xxx" in
+           DynaLoader|dynaload) ;;
+           *)
+           if $test -f $xxx/$xxx.xs -o -f $xxx/$xxx.c; then
+               known_extensions="$known_extensions $1$xxx";
+           elif $test -f $xxx/Makefile.PL; then
+               nonxs_extensions="$nonxs_extensions $1$xxx";
+           else
+               if $test -d $xxx -a $# -lt 10; then
+                   set $1$xxx/ $*;
+                   cd "$xxx";
+                   eval $find_extensions;
+                   cd ..;
+                   shift;
+               fi;
+           fi
+           ;;
+       esac;
     done'
 tdir=`pwd`
 cd "$rsrc/ext"
@@ -20714,12 +21046,14 @@ eval $find_extensions
 # recursive find above (and adding in general recursive finding breaks
 # SDBM_File/sdbm).  A.D.  10/25/2001.
 known_extensions="$known_extensions threads/shared"
-set X $nonxs_extensions
-shift
-nonxs_extensions="$*"
 set X $known_extensions
 shift
 known_extensions="$*"
+#  Ditto for IO/Compress/Base and IO/Compress/Zlib
+nonxs_extensions="$nonxs_extensions IO/Compress/Base IO/Compress/Zlib"
+set X $nonxs_extensions
+shift
+nonxs_extensions="$*"
 cd "$tdir"
 
 : Now see which are supported on this system.
@@ -20732,12 +21066,12 @@ for xxx in $known_extensions ; do
                esac
                ;;
        GDBM_File|gdbm_fil)
-               case "$i_gdbm" in 
+               case "$i_gdbm" in
                $define) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
        I18N/Langinfo|i18n_lan)
-               case "$i_langinfo$d_nl_langinfo" in 
+               case "$i_langinfo$d_nl_langinfo" in
                $define$define) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
@@ -20755,7 +21089,7 @@ for xxx in $known_extensions ; do
                    ;;
                esac
                ;;
-       ODBM_File|odbm_fil) 
+       ODBM_File|odbm_fil)
                case "${i_dbm}${i_rpcsvcdbm}" in
                *"${define}"*)
                    case "$osname-$use64bitint" in
@@ -20780,7 +21114,7 @@ for xxx in $known_extensions ; do
                esac
                ;;
        Socket|socket)
-               case "$d_socket" in 
+               case "$d_socket" in
                true|$define|y)
                    case "$osname" in
                    beos) ;; # not unless BONE
@@ -20791,7 +21125,7 @@ for xxx in $known_extensions ; do
                ;;
        Sys/Syslog|sys/syslog)
                : XXX syslog requires socket
-               case "$d_socket" in 
+               case "$d_socket" in
                true|$define|y) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
@@ -20803,6 +21137,11 @@ for xxx in $known_extensions ; do
                         esac
                esac
                ;;
+       Win32*)
+               case "$osname" in
+               cygwin) avail_ext="$avail_ext $xxx" ;;
+               esac
+               ;;
        XS/APItest|xs/apitest)
                # This is just for testing.  Skip it unless we have dynamic loading.
 
@@ -20832,7 +21171,7 @@ for xxx in $known_extensions ; do
                ;;
        IPC/SysV|ipc/sysv)
                : XXX Do we need a useipcsysv variable here
-               case "${d_msg}${d_sem}${d_shm}" in 
+               case "${d_msg}${d_sem}${d_shm}" in
                *"${define}"*) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
@@ -20922,11 +21261,11 @@ EOM
                previous)
                        if test X"$dynamic_ext" != X"$avail_ext"; then
                                $cat <<EOM
-NOTICE:  Your previous config.sh list may be incorrect. 
-The extensions now available to you are 
+NOTICE:  Your previous config.sh list may be incorrect.
+The extensions now available to you are
        ${avail_ext}
 but the default list from your previous config.sh is
-       ${dynamic_ext} 
+       ${dynamic_ext}
 
 EOM
                        fi
@@ -20958,7 +21297,7 @@ EOM
                shift
                dflt="$*"
                ;;
-       *)  dflt="$static_ext" 
+       *)  dflt="$static_ext"
                ;;
        esac
 
@@ -20974,8 +21313,8 @@ EOM
        ;;
 *)
        $cat <<EOM
-A number of extensions are supplied with $package.  Answer "none" 
-to include no extensions. 
+A number of extensions are supplied with $package.  Answer "none"
+to include no extensions.
 Note that DynaLoader is always built and need not be mentioned here.
 
 EOM
@@ -20987,11 +21326,11 @@ EOM
                previous)
                        if test X"$static_ext" != X"$avail_ext"; then
                                $cat <<EOM
-NOTICE:  Your previous config.sh list may be incorrect. 
-The extensions now available to you are 
+NOTICE:  Your previous config.sh list may be incorrect.
+The extensions now available to you are
        ${avail_ext}
 but the default list from your previous config.sh is
-       ${static_ext} 
+       ${static_ext}
 
 EOM
                        fi
@@ -21011,7 +21350,7 @@ EOM
        esac
        ;;
 esac
-#        
+#
 # Encode is a special case.  If we are building Encode as a static
 # extension, we need to explicitly list its subextensions as well.
 # For other nested extensions, this is handled automatically by
@@ -21253,6 +21592,7 @@ d_bsdsetpgrp='$d_bsdsetpgrp'
 d_builtin_choose_expr='$d_builtin_choose_expr'
 d_builtin_expect='$d_builtin_expect'
 d_bzero='$d_bzero'
+d_c99_variadic_macros='$d_c99_variadic_macros'
 d_casti32='$d_casti32'
 d_castneg='$d_castneg'
 d_charvspr='$d_charvspr'
@@ -21265,15 +21605,18 @@ d_closedir='$d_closedir'
 d_cmsghdr_s='$d_cmsghdr_s'
 d_const='$d_const'
 d_copysignl='$d_copysignl'
+d_cplusplus='$d_cplusplus'
 d_crypt='$d_crypt'
 d_crypt_r='$d_crypt_r'
 d_csh='$d_csh'
+d_ctermid='$d_ctermid'
 d_ctermid_r='$d_ctermid_r'
 d_ctime_r='$d_ctime_r'
 d_cuserid='$d_cuserid'
 d_dbl_dig='$d_dbl_dig'
 d_dbminitproto='$d_dbminitproto'
 d_difftime='$d_difftime'
+d_dir_dd_fd='$d_dir_dd_fd'
 d_dirfd='$d_dirfd'
 d_dirnamlen='$d_dirnamlen'
 d_dlerror='$d_dlerror'
@@ -21407,6 +21750,7 @@ 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_localtime_r_needs_tzset='$d_localtime_r_needs_tzset'
 d_locconv='$d_locconv'
 d_lockf='$d_lockf'
 d_longdbl='$d_longdbl'
@@ -21465,7 +21809,9 @@ d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
 d_portable='$d_portable'
+d_printf_format_null='$d_printf_format_null'
 d_procselfexe='$d_procselfexe'
+d_pseudofork='$d_pseudofork'
 d_pthread_atfork='$d_pthread_atfork'
 d_pthread_attr_setscope='$d_pthread_attr_setscope'
 d_pthread_yield='$d_pthread_yield'
@@ -21545,6 +21891,7 @@ d_shmctl='$d_shmctl'
 d_shmdt='$d_shmdt'
 d_shmget='$d_shmget'
 d_sigaction='$d_sigaction'
+d_signbit='$d_signbit'
 d_sigprocmask='$d_sigprocmask'
 d_sigsetjmp='$d_sigsetjmp'
 d_sitearch='$d_sitearch'