This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Update metaconfig related information
[perl5.git] / Configure
index f5f78f4..bc2c9e9 100755 (executable)
--- a/Configure
+++ b/Configure
 # called "metaconfig". Rather than working with this copy of Configure,
 # you may wish to get metaconfig. Perl uses a modified version of this
 # tool, available in the "dist" folder in the checkout of the git repo
-#    $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
+#    $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
 # The original dist package (including metaconfig) is available via SVN:
-#    $ svn co https://svn.code.sf.net/p/dist/code/trunk/dist
+#    $ git clone https://github.com/rmanfredi/dist.git dist-git
 #
 # Though this script was generated by metaconfig from metaunits, it is
 # OK to send patches against Configure itself. It's up to the Configure
 # pumpkin to backport the patch to the metaunits if it is accepted.
 # For more information on patching Configure, see pod/perlhack.pod
 #
-# The metaunits are also available from the public git repository:
-#     http://perl5.git.perl.org/metaconfig.git/ or
-#     $ git clone git://perl5.git.perl.org/metaconfig.git metaconfig
+# The metaunits are also available from the public github repository:
+#     https://github.com/perl5-metaconfig/metaconfig/tree/master/U
 #
 # See Porting/pumpkin.pod for more information on metaconfig.
 
@@ -475,6 +474,7 @@ d_fcntl_can_lock=''
 d_fd_macros=''
 d_fd_set=''
 d_fds_bits=''
+d_fdclose=''
 d_fdim=''
 d_fegetround=''
 d_fgetpos=''
@@ -496,17 +496,26 @@ d_fpclassl=''
 d_fpgetround=''
 d_fpos64_t=''
 d_frexpl=''
+d_fs_data_s=''
+d_fchmodat=''
+d_linkat=''
+d_openat=''
+d_renameat=''
+d_unlinkat=''
 d_fseeko=''
 d_fsetpos=''
+d_fstatfs=''
 d_fsync=''
 d_ftello=''
 d_ftime=''
 d_gettimeod=''
 d_futimes=''
+d_gai_strerror=''
 d_Gconvert=''
 d_getaddrinfo=''
 d_getcwd=''
 d_getespwnam=''
+d_getfsstat=''
 d_getgrent=''
 d_getgrent_r=''
 getgrent_r_proto=''
@@ -533,6 +542,8 @@ d_getitimer=''
 d_getlogin=''
 d_getlogin_r=''
 getlogin_r_proto=''
+d_getmnt=''
+d_getmntent=''
 d_getnameinfo=''
 d_getnbyaddr=''
 d_getnbyname=''
@@ -586,6 +597,7 @@ d_gmtime_r=''
 gmtime_r_proto=''
 d_gnulibc=''
 gnulibc_version=''
+d_hasmntopt=''
 d_htonl=''
 d_hypot=''
 d_ilogb=''
@@ -627,6 +639,11 @@ d_log1p=''
 d_log2=''
 d_logb=''
 d_ldexpl=''
+d_long_double_style_ieee=''
+d_long_double_style_ieee_doubledouble=''
+d_long_double_style_ieee_extended=''
+d_long_double_style_ieee_std=''
+d_long_double_style_vax=''
 d_longdbl=''
 longdblkind=''
 longdblsize=''
@@ -647,7 +664,9 @@ d_mbtowc=''
 d_memchr=''
 d_memcmp=''
 d_memcpy=''
+d_memmem=''
 d_memmove=''
+d_memrchr=''
 d_memset=''
 d_mkdir=''
 d_mkdtemp=''
@@ -658,7 +677,6 @@ d_mktime=''
 d_mmap=''
 mmaptype=''
 d_modfl=''
-d_modfl_pow32_bug=''
 d_modflproto=''
 d_mprotect=''
 d_msg=''
@@ -671,6 +689,12 @@ d_msync=''
 d_munmap=''
 d_nan=''
 d_nearbyint=''
+d_duplocale=''
+d_freelocale=''
+d_newlocale=''
+d_querylocale=''
+d_uselocale=''
+i_xlocale=''
 d_nextafter=''
 d_nexttoward=''
 d_nice=''
@@ -778,6 +802,14 @@ d_shmctl=''
 d_shmdt=''
 d_shmget=''
 d_sigaction=''
+d_siginfo_si_addr=''
+d_siginfo_si_band=''
+d_siginfo_si_errno=''
+d_siginfo_si_fd=''
+d_siginfo_si_pid=''
+d_siginfo_si_status=''
+d_siginfo_si_uid=''
+d_siginfo_si_value=''
 d_signbit=''
 d_sigprocmask=''
 d_sigsetjmp=''
@@ -816,8 +848,12 @@ d_sresgproto=''
 d_sresuproto=''
 d_stat=''
 d_statblks=''
+d_statfs_f_flags=''
+d_statfs_s=''
 d_static_inline=''
 perl_static_inline=''
+d_fstatvfs=''
+d_statvfs=''
 d_stdio_cnt_lval=''
 d_stdio_ptr_lval=''
 d_stdio_ptr_lval_nochange_cnt=''
@@ -837,6 +873,7 @@ d_strerrm=''
 d_strerror=''
 d_sysernlst=''
 d_syserrlst=''
+d_strerror_l=''
 d_strerror_r=''
 strerror_r_proto=''
 d_strftime=''
@@ -889,6 +926,7 @@ d_unordered=''
 d_unsetenv=''
 d_usleep=''
 d_usleepproto=''
+d_ustat=''
 d_pseudofork=''
 d_vfork=''
 usevfork=''
@@ -904,6 +942,7 @@ d_wcstombs=''
 d_wcsxfrm=''
 d_wctomb=''
 d_writev=''
+default_inc_excludes_dot=''
 dlext=''
 bin_ELF=''
 cccdlflags=''
@@ -914,6 +953,8 @@ ld_can_script=''
 lddlflags=''
 usedl=''
 doublesize=''
+dtraceobject=''
+dtracexnolibs=''
 ebcdic=''
 fflushNULL=''
 fflushall=''
@@ -971,6 +1012,7 @@ i_malloc=''
 i_mallocmalloc=''
 i_math=''
 i_memory=''
+i_mntent=''
 d_gdbm_ndbm_h_uses_prototypes=''
 d_gdbmndbm_h_uses_prototypes=''
 d_ndbm=''
@@ -1016,6 +1058,7 @@ i_syssockio=''
 i_syslog=''
 i_sysmman=''
 i_sysmode=''
+i_sysmount=''
 i_sysndir=''
 i_sysparam=''
 i_syspoll=''
@@ -1023,11 +1066,14 @@ i_sysresrc=''
 i_syssecrt=''
 i_sysselct=''
 i_sysstat=''
+i_sysstatfs=''
+i_sysstatvfs=''
 i_systimes=''
 i_systypes=''
 i_sysuio=''
 i_sysun=''
 i_sysutsname=''
+i_sysvfs=''
 i_syswait=''
 i_sgtty=''
 i_termio=''
@@ -1039,6 +1085,7 @@ i_systimek=''
 i_time=''
 timeincl=''
 i_unistd=''
+i_ustat=''
 i_utime=''
 i_values=''
 i_stdarg=''
@@ -1085,6 +1132,14 @@ d_PRIeldbl=''
 d_PRIfldbl=''
 d_PRIgldbl=''
 d_SCNfldbl=''
+d_double_has_inf=''
+d_double_has_nan=''
+d_double_has_negative_zero=''
+d_double_has_subnormals=''
+d_double_style_cray=''
+d_double_style_ibm=''
+d_double_style_ieee=''
+d_double_style_vax=''
 doublekind=''
 sPRIEUldbl=''
 sPRIFUldbl=''
@@ -1391,10 +1446,6 @@ fi
 
 groupstype=''
 i_whoami=''
-: Trailing extension.  Override this in a hint file, if needed.
-: Extra object files, if any, needed on this platform.
-archobjs=''
-archname=''
 : 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"
@@ -1407,6 +1458,9 @@ inclwanted=''
 EBUGGING=''
 DEBUGGING=''
 
+: Trailing extension.  Override this in a hint file, if needed.
+: Extra object files, if any, needed on this platform.
+archobjs=''
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
@@ -1430,8 +1484,6 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
-: set usethreads on the Configure command line to enable threads.
-usereentrant='undef'
 ccname=''
 ccversion=''
 perllibs=''
@@ -1445,9 +1497,12 @@ 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'
 : List of libraries we want.
 : If anyone needs extra -lxxx, put those in a hint file.
-libswanted="cl pthread socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld"
+libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld"
 libswanted="$libswanted sun 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.
@@ -1662,7 +1717,6 @@ alldone=''
 error=''
 silent=''
 extractsh=''
-override=''
 knowitall=''
 rm -f optdef.sh posthint.sh
 cat >optdef.sh <<EOS
@@ -1692,7 +1746,7 @@ while test $# -gt 0; do
        -s) shift; silent=true; realsilent=true;;
        -E) shift; alldone=exit;;
        -K) shift; knowitall=true;;
-       -O) shift; override=true;;
+       -O) shift;;
        -S) shift; silent=true; extractsh=true;;
        -D)
                shift
@@ -1801,7 +1855,7 @@ Usage: $me [-dehrsEKOSV] [-f config.sh] [-D symbol] [-D symbol=value]
          -Dprefix=/opt/perl5      choose your destination
   -E : stop at the end of questions, after having produced config.sh.
   -K : do not use unless you know what you are doing.
-  -O : let -D and -U override definitions from loaded configuration file.
+  -O : ignored for backward compatibility
   -S : perform variable substitutions on all .SH files (can mix with -f)
   -U : undefine symbol:
          -U symbol    symbol gets the value 'undef'
@@ -1848,7 +1902,7 @@ esac
 
 : run the defines and the undefines, if any, but leave the file out there...
 touch optdef.sh
-grep -q '\\' optdef.sh
+grep '\\' optdef.sh >/dev/null 2>&1
 if test $? = 0; then
     echo "Configure does not support \\ in -D arguments"
     exit 1
@@ -2023,7 +2077,7 @@ true)
        echo "Fetching answers from $config_sh..."
        cd ..
        . $config_sh
-       test "$override" && . ./optdef.sh
+       . UU/optdef.sh
        echo " "
        . UU/extract
        rm -rf UU
@@ -2103,22 +2157,21 @@ fi
 rm -f missing x??
 
 : Find the appropriate value for a newline for tr
-echo " "
 if test -n "$DJGPP"; then
        trnl='\012'
 fi
 if test X"$trnl" = X; then
-       case "`echo foo|tr '\n' x 2>/dev/null`" in
+       case "`echo foo | tr '\n' x 2>/dev/null`" in
        foox) trnl='\n' ;;
        esac
 fi
 if test X"$trnl" = X; then
-       case "`echo foo|tr '\012' x 2>/dev/null`" in
+       case "`echo foo | tr '\012' x 2>/dev/null`" in
        foox) trnl='\012' ;;
        esac
 fi
 if test X"$trnl" = X; then
-       case "`echo foo|tr '\r\n' xy 2>/dev/null`" in
+       case "`echo foo | tr '\r\n' xy 2>/dev/null`" in
        fooxy) trnl='\n\r' ;;
        esac
 fi
@@ -2848,7 +2901,6 @@ case "$lns" in
 *)     echo "No symbolic links, so not testing for their testing..." >&4
        ;;
 esac
-echo " "
 
 : Make symlinks util
 case "$mksymlinks" in
@@ -2943,7 +2995,7 @@ $define|true|[yY]*)
        *)  echo "Using targetarch $targetarch." >&4 ;;
        esac
        case "$targethost" in
-       '') echo "Targethost not defined." >&4; croak=y ;;
+       '') echo "Targethost not defined." >&4; croak=n ;;
        *)  echo "Using targethost $targethost." >&4
        esac
        locincpth=' '
@@ -3776,7 +3828,7 @@ cd UU
        hint=previous
        ;;
 esac
-test "$override" && . ./optdef.sh
+. ./optdef.sh
 
 : Restore computed paths
 for file in $loclist $trylist; do
@@ -5209,6 +5261,20 @@ case "$usequadmath" in
 *)                    usequadmath="$undef"  ;;
 esac
 
+: Fail if both uselongdouble and usequadmath are requested
+case "$usequadmath:$uselongdouble" in
+define:define)
+       $cat <<EOM >&4
+
+*** You requested the use of the quadmath library and use
+*** of long doubles.
+***
+*** Please select one or the other.
+EOM
+       exit 1
+       ;;
+esac
+
 : Looking for optional libraries
 echo " "
 echo "Checking for optional libraries..." >&4
@@ -5533,7 +5599,12 @@ esac
 : the following weeds options from ccflags that are of no interest to cpp
 case "$cppflags" in
 '') cppflags="$ccflags" ;;
-*)  cppflags="$cppflags $ccflags" ;;
+*)  set X $ccflags; shift
+    case " $cppflags " in
+    *" $1 "*) ;;  # Try to avoid doubling the cppflags.
+    *) cppflags="$cppflags $ccflags" ;;
+    esac
+    ;;
 esac
 case "$gccversion" in
 1*) cppflags="$cppflags -D__GNUC__"
@@ -6763,13 +6834,13 @@ yes)
                if $contains $tlook $tf >/dev/null 2>&1; then
                        tval=true;
                elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
-                       echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
+                       echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) 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_try;
                fi;
        else
-               echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main() { if(p() && p() != (void *)main) return(0); else return(1); }"> try.c;
+               echo "$extern_C void *$1$tdc; void *(*(p()))$tdc { return &$1; } int main(int argc, char **argv) { if(p() && p() != (void *)argv[0]) return(0); else return(1); }"> try.c;
                $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
                $rm_try;
        fi;
@@ -6935,17 +7006,26 @@ int main() {
   }
 #endif
 /* For alignment 32-bit platforms have the 80 bits in 12 bytes,
- * while 64-bits platforms have it in 16 bytes. */
+ * while 64-bits platforms have it in 16 bytes.  The trailing bytes
+ * cannot be trusted. */
 #if LDBL_MANT_DIG == 64 && (LONGDBLSIZE == 16 || LONGDBLSIZE == 12)
-  if (b[0] == 0xCD && b[9] == 0xBF && b[10] == 0x00) {
+  if (b[0] == 0xCD && b[9] == 0xBF) {
     /* x86 80-bit little-endian, sizeof 12 (ILP32, Solaris x86)
      * or 16 (LP64, Linux and OS X), 4 or 6 bytes of padding.
      * Also known as "extended precision". */
     printf("3\n");
     exit(0);
   }
-  if (b[0] == 0xBF && b[9] == 0xCD && b[10] == 0x00) {
-    /* is there ever big-endian 80-bit, really? */
+  if (b[0] == 0xBF && b[9] == 0xCD) {
+    /* Is there ever big-endian 80-bit, really?
+     *
+     * The Motorola 68881 had another "extended precision" format:
+     * sign:1 exp:15 zero:16 integer:1 mantissa:63
+     * for total of 96 bits of bytes.  The zero bits were unused.
+     * See "M68000 FAMILY PROGRAMMER’S REFERENCE MANUAL" for more details.
+     * If it ever becomes relevant, this format should be allocated
+     * a new doublekind code since it's quite different from the Intel x87.
+     */
     printf("4\n");
     exit(0);
   }
@@ -6954,17 +7034,45 @@ int main() {
   /* software "double double", the 106 is 53+53.
    * but irix thinks it is 107. */
   if (b[0] == 0x9A && b[7] == 0x3C && b[8] == 0x9A && b[15] == 0xBF) {
-    /* double double 128-bit little-endian,
+    /* double double 128-bit fully little-endian,
+     * little-endian doubles in little-endian order,
      * 9a 99 99 99 99 99 59 3c 9a 99 99 99 99 99 b9 bf */
     printf("5\n");
     exit(0);
   }
   if (b[0] == 0xBF && b[7] == 0x9A && b[8] == 0x3C && b[15] == 0x9A) {
-    /* double double 128-bit big-endian, e.g. PPC/Power and MIPS:
+    /* double double 128-bit fully big-endian,
+     * big-endian doubles in big-endian order,
+     * e.g. PPC/Power and MIPS:
      * bf b9 99 99 99 99 99 9a 3c 59 99 99 99 99 99 9a */
     printf("6\n");
     exit(0);
   }
+  if (b[0] == 0x9A && b[7] == 0xBF && b[8] == 0x9A && b[15] == 0x3C) {
+    /* double double 128-bit mixed endian.
+     * little-endian doubles in big-endian order,
+     * e.g. ppc64el,
+     * 9a 99 99 99 99 99 b9 bf 9a 99 99 99 99 99 59 3c */
+    printf("7\n");
+    exit(0);
+  }
+  if (b[0] == 0x3C && b[7] == 0x9A && b[8] == 0xBF && b[15] == 0x9A) {
+    /* double double 128-bit mixed endian,
+     * big-endian doubles in little-endian order,
+     * 3c 59 99 99 99 99 99 9a bf b9 99 99 99 99 99 9a */
+    printf("8\n");
+    exit(0);
+  }
+#endif
+/* We are largely making this up because it may well be
+ * that the VAX format H was never made available to C,
+ * only to Fortran. */
+#if LONGDBLSIZE == 16 && defined(__vax__)
+  if (b[0] == 0xFD && b[15] == 0x99) {
+    /* VAX format H, PDP-11 mixed endian. */
+    printf("9\n");
+    exit(0);
+  }
 #endif
   printf("-1\n"); /* unknown */
   exit(0);
@@ -6985,10 +7093,33 @@ case "$longdblkind" in
 2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
 3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
 4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
-5) echo "You have 128-bit little-endian double-double long doubles." >& 4 ;;
-6) echo "You have 128-bit big-endian double-double long doubles." >& 4 ;;
+5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
+6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
+7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
+8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
+9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
 *) echo "Cannot figure out your long double." >&4 ;;
 esac
+d_long_double_style_ieee=$undef
+d_long_double_style_ieee_std=$undef
+d_long_double_style_ieee_extended=$undef
+d_long_double_style_ieee_doubledouble=$undef
+d_long_double_style_vax=$undef
+case "$longdblkind" in
+1|2|3|4|5|6|7|8) d_long_double_style_ieee=$define ;;
+esac
+case "$longdblkind" in
+1|2) d_long_double_style_ieee_std=$define ;;
+esac
+case "$longdblkind" in
+3|4) d_long_double_style_ieee_extended=$define ;;
+esac
+case "$longdblkind" in
+5|6|7|8) d_long_double_style_ieee_doubledouble=$define ;;
+esac
+case "$longdblkind" in
+9) d_long_double_style_vax=$define ;;
+esac
 $rm_try
 
 : determine the architecture name
@@ -7121,7 +7252,7 @@ case "$usequadmath" in
 $define)
        echo "quadmath selected." >&4
        case "$archname" in
-       *-ld*) echo "...and architecture name already has -quadmath." >&4
+       *-quadmath*) echo "...and architecture name already has -quadmath." >&4
                ;;
        *)      archname="$archname-quadmath"
                echo "...setting architecture name to $archname." >&4
@@ -9315,17 +9446,20 @@ rp='Perl administrator e-mail address'
 . ./myread
 perladmin="$ans"
 
-: determine whether to only install version-specific parts.
+: determine whether to use a version number suffix for installed binaries
 echo " "
 $cat <<EOM
-Do you want to install only the version-specific parts of the perl
-distribution?  Usually you do *not* want to do this.
+Do you want to use a version number suffix for installed binaries? This
+will install 'perl$version' instead of 'perl', and likewise for other
+binaries like 'perldoc' and 'cpan'. This allows many versions of perl
+to be installed side-by-side. Unless you are a developer, you probably
+do *not* want to do this.
 EOM
 case "$versiononly" in
 "$define"|[Yy]*|true) dflt='y' ;;
 *) dflt='n';
 esac
-rp="Do you want to install only the version-specific parts of perl?"
+rp="Do you want to use a version number suffix for installed binaries?"
 . ./myread
 case "$ans" in
 [yY]*) val="$define";;
@@ -10061,6 +10195,16 @@ int main() {
     printf("2\n");
     exit(0);
   }
+  if (b[0] == 0xCC && b[3] == 0xCC) {
+    /* VAX format F, 32-bit PDP-style mixed endian. */
+    printf("9\n");
+    exit(0);
+  }
+  if (b[0] == 0xC0 && b[3] == 0x9A) {
+    /* IBM single 32-bit */
+    printf("12\n");
+    exit(0);
+  }
 #endif
 #if DOUBLESIZE == 8
   if (b[0] == 0x9A && b[7] == 0xBF) {
@@ -10087,6 +10231,26 @@ int main() {
     printf("8\n");
     exit(0);
   }
+  if (b[0] == 0xCC && b[7] == 0xCC) {
+   /* VAX format D, 64-bit PDP-style mixed endian. */
+    printf("10\n");
+    exit(0);
+  }
+  if (b[0] == 0xD9 && b[7] == 0x99) {
+   /* VAX format G, 64-bit PDP-style mixed endian. */
+    printf("11\n");
+    exit(0);
+  }
+  if (b[0] == 0xC0 && b[7] == 0x9A) {
+    /* IBM double 64-bit */
+    printf("13\n");
+    exit(0);
+  }
+  if (b[0] == 0xBF && b[7] == 0xCD) {
+    /* CRAY single 64-bit */
+    printf("14\n");
+    exit(0);
+  }
 #endif
 #if DOUBLESIZE == 16
   if (b[0] == 0x9A && b[15] == 0xBF) {
@@ -10100,7 +10264,7 @@ int main() {
     exit(0);
   }
 #endif
-  /* Then there are old mainframe/miniframe formats like VAX, IBM, and CRAY.
+  /* Then there are old mainframe/miniframe formats like IBM and CRAY.
    * Whether those environments can still build Perl is debatable. */
   printf("-1\n"); /* unknown */
   exit(0);
@@ -10121,7 +10285,37 @@ case "$doublekind" in
 6) echo "You have IEEE 754 128-bit big endian doubles." >&4 ;;
 7) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit LEs in BE)." >&4 ;;
 8) echo "You have IEEE 754 64-bit mixed endian doubles (32-bit BEs in LE)." >&4 ;;
-*) echo "Cannot figure out your double.  You VAX, or something?" >&4 ;;
+9) echo "You have VAX format F 32-bit PDP-style mixed endian doubles." >&4 ;;
+10) echo "You have VAX format D 64-bit PDP-style mixed endian doubles." >&4 ;;
+11) echo "You have VAX format G 64-bit PDP-style mixed endian doubles." >&4 ;;
+12) echo "You have IBM short 32-bit doubles." >&4 ;;
+13) echo "You have IBM long 64-bit doubles." >&4 ;;
+14) echo "You have Cray single 64-bit doubles." >&4 ;;
+*) echo "Cannot figure out your double.  You Cyber, or something?" >&4 ;;
+esac
+d_double_style_ieee=$undef
+d_double_style_vax=$undef
+d_double_style_ibm=$undef
+d_double_style_cray=$undef
+case "$doublekind" in
+1|2|3|4|5|6|7|8) d_double_style_ieee=$define ;;
+9|10|11) d_double_style_vax=$define ;;
+12|13) d_double_style_ibm=$define ;;
+14) d_double_style_cray=$define ;;
+esac
+case "$d_double_style_ieee" in
+$define)
+    d_double_has_inf=$define
+    d_double_has_nan=$define
+    d_double_has_negative_zero=$define
+    d_double_has_subnormals=$define
+    ;;
+*)
+    d_double_has_inf=$undef
+    d_double_has_nan=$undef
+    d_double_has_negative_zero=$undef
+    d_double_has_subnormals=$undef
+    ;;
 esac
 $rm_try
 
@@ -13311,7 +13505,7 @@ echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
 case "$eagain" in
 '')
        case "$d_fork:$d_pipe:$d_alarm" in
-       define:define)
+       define:define:define)
        $cat head.c > try.c
        $cat >>try.c <<EOCP
 #include <errno.h>
@@ -13789,6 +13983,22 @@ eval $inlibc
 set fchmod d_fchmod
 eval $inlibc
 
+: check for openat, unlinkat, renameat, linkat, fchmodat
+set openat d_openat
+eval $inlibc
+
+set unlinkat d_unlinkat
+eval $inlibc
+
+set renameat d_renameat
+eval $inlibc
+
+set linkat d_linkat
+eval $inlibc
+
+set fchmodat d_fchmodat
+eval $inlibc
+
 : see if fchown exists
 set fchown d_fchown
 eval $inlibc
@@ -13941,6 +14151,10 @@ EOM
 fi
 $rm_try
 
+: see if fdclose exists
+set fdclose d_fdclose
+eval $inlibc
+
 : see if fdim exists
 set fdim d_fdim
 eval $inlibc
@@ -14061,6 +14275,30 @@ $rm_try
 set d_fpos64_t
 eval $setvar
 
+: see if this is an xlocale.h system
+set xlocale.h i_xlocale
+eval $inhdr
+
+: see if newlocale exists
+set newlocale d_newlocale
+eval $inlibc
+
+: see if freelocale exists
+set freelocale d_freelocale
+eval $inlibc
+
+: see if uselocale exists
+set uselocale d_uselocale
+eval $inlibc
+
+: see if duplocale exists
+set duplocale d_duplocale
+eval $inlibc
+
+: see if querylocale exists
+set querylocale d_querylocale
+eval $inlibc
+
 : see if frexpl exists
 set frexpl d_frexpl
 eval $inlibc
@@ -14069,6 +14307,20 @@ eval $inlibc
 set sys/param.h i_sysparam
 eval $inhdr
 
+: see if this is a sys/mount.h system
+set sys/mount.h i_sysmount
+eval $inhdr
+
+: Check for fs_data_s
+echo " "
+echo "Checking to see if your system supports struct fs_data..." >&4
+set d_fs_data_s fs_data $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h
+eval $hasstruct
+case "$d_fs_data_s" in
+"$define")      echo "Yes, it does."   ;;
+*)              echo "No, it doesn't." ;;
+esac
+
 : see if fseeko exists
 set fseeko d_fseeko
 eval $inlibc
@@ -14080,6 +14332,19 @@ esac
 set fsetpos d_fsetpos
 eval $inlibc
 
+: see if fstatfs exists
+set fstatfs d_fstatfs
+eval $inlibc
+
+: see if statvfs exists
+set statvfs d_statvfs
+eval $inlibc
+
+: see if fstatvfs exists
+set fstatvfs d_fstatvfs
+eval $inlibc
+
+
 : see if fsync exists
 set fsync d_fsync
 eval $inlibc
@@ -14126,6 +14391,34 @@ else
 fi
 $rm_try
 
+: look for gai_strerror
+echo " "
+$cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
+int main ()
+{
+    return (gai_strerror (0) ? 0 : 1);
+    }
+EOCP
+set try
+val="$undef"
+if eval $compile; then
+    `$run ./try`
+    case "$?" in
+       0)  echo "A working gai_strerror() found." >&4
+           val="$define" ;;
+       *)  echo "gai_strerror() found, but it doesn't work" >&4
+           ;;
+       esac
+else
+    echo "gai_strerror() NOT found." >&4
+    fi
+set d_gai_strerror
+eval $setvar
+$rm_try
+
 : see if ndbm.h is available
 set ndbm.h i_ndbm
 eval $inhdr
@@ -14192,6 +14485,10 @@ eval $inlibc
 set getespwnam d_getespwnam
 eval $inlibc
 
+: see if getfsstat exists
+set getfsstat d_getfsstat
+eval $inlibc
+
 : see if getgrent exists
 set getgrent d_getgrent
 eval $inlibc
@@ -14721,6 +15018,14 @@ case "$d_getlogin_r" in
        ;;
 esac
 
+: see if getmnt exists
+set getmnt d_getmnt
+eval $inlibc
+
+: see if getmntent exists
+set getmntent d_getmntent
+eval $inlibc
+
 : see if getnameinfo exists
 set getnameinfo d_getnameinfo
 eval $inlibc
@@ -15577,6 +15882,10 @@ case "$d_gmtime_r" in
        ;;
 esac
 
+: see if hasmntopt exists
+set hasmntopt d_hasmntopt
+eval $inlibc
+
 : see if this is a netinet/in.h or sys/in.h system
 set netinet/in.h i_niin sys/in.h i_sysin
 eval $inhdr
@@ -16198,10 +16507,18 @@ eval $inlibc
 set memcpy d_memcpy
 eval $inlibc
 
+: see if memmem exists
+set memmem d_memmem
+eval $inlibc
+
 : see if memmove exists
 set memmove d_memmove
 eval $inlibc
 
+: see if memrchr exists
+set memrchr d_memrchr
+eval $inlibc
+
 : see if memset exists
 set memset d_memset
 eval $inlibc
@@ -16278,69 +16595,6 @@ echo " "
 set d_modflproto modfl $i_math math.h
 eval $hasproto
 
-d_modfl_pow32_bug="$undef"
-
-case "$d_longdbl$d_modfl" in
-$define$define)
-       $cat <<EOM
-Checking to see whether your modfl() is okay for large values...
-EOM
-$cat >try.c <<EOCP
-#include <math.h>
-#include <stdio.h>
-EOCP
-if $test "X$d_modflproto" != "X$define"; then
-       $cat >>try.c <<EOCP
-/* Sigh. many current glibcs provide the function, but do not prototype it. */
-long double modfl (long double, long double *);
-EOCP
-fi
-$cat >>try.c <<EOCP
-int main() {
-    long double nv = 4294967303.15;
-    long double v, w;
-    v = modfl(nv, &w);
-#ifdef __GLIBC__
-    printf("glibc");
-#endif
-    printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
-    return 0;
-}
-EOCP
-       case "$osname:$gccversion" in
-       aix:)   saveccflags="$ccflags"
-               ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
-       esac
-       set try
-       if eval $compile; then
-               foo=`$run ./try`
-               case "$foo" in
-               *" 4294967303.150000 1.150000 4294967302.000000")
-                       echo >&4 "Your modfl() is broken for large values."
-                       d_modfl_pow32_bug="$define"
-                       case "$foo" in
-                       glibc)  echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
-                       ;;
-                       esac
-                       ;;
-               *" 4294967303.150000 0.150000 4294967303.000000")
-                       echo >&4 "Your modfl() seems okay for large values."
-                       ;;
-               *)      echo >&4 "I don't understand your modfl() at all."
-                       d_modfl="$undef"
-                       ;;
-               esac
-               $rm_try
-       else
-               echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
-               d_modfl="$undef"
-       fi
-       case "$osname:$gccversion" in
-       aix:)   ccflags="$saveccflags" ;; # restore
-       esac
-       ;;
-esac
-
 if $test "$uselongdouble" = "$define"; then
     message=""
     if $test "$d_sqrtl" != "$define"; then
@@ -16884,8 +17138,9 @@ $volatile int bletched = 0;
 $signal_t blech(int s) { bletched = 1; }
 #endif
 
-int checkit($nvtype d, char *where) {
-    unsigned char *p = (char *)&d;
+int checkit($nvtype d, const char *where) {
+    void *v = &d;
+    unsigned char *p = (unsigned char *)v;
     unsigned char *end = p + sizeof(d);
     int fail = 0;
 
@@ -16895,7 +17150,7 @@ int checkit($nvtype d, char *where) {
     if (!fail)
        return 0;
 
-    p = (char *)&d;
+    p = (unsigned char *)v;
     printf("No - %s: 0x", where);
     while (p < end)
        printf ("%02X", *p++);
@@ -17100,16 +17355,21 @@ EOM
 set readlink d_readlink
 eval $inlibc
 
-: Check if exe is symlink to abs path of executing program
+: Check if there is a /proc symlink to the abs path of
+: the executing program.  We will honor hints of d_procselfexe=$undef
+: or procselfexe being non-empty, otherwise will try to determine both
+: if we have readlink.
+: AmigaOS will attempt to mount proc: aka /proc, if /proc/... is
+: referenced, and AmigaOS does not have a proc filesystem anyway.
 echo " "
-procselfexe=''
 val="$undef"
-case "$d_procselfexe" in
-'')
-case "$d_readlink" in
-    "$define")
-       : NetBSD first as /proc/self is a symlink to /proc/curproc, and it feels
-       : more tidy to avoid an extra level of symlink
+if $test "X$d_procselfexe" = Xundef; then
+       procselfexe=''
+elif $test "X$procselfexe" != X -a "X$procselfexe" != 'X '; then
+       val="$define"
+elif $test "X$d_readlink" = Xdefine; then
+        : NetBSD first as /proc/self is a symlink to /proc/curproc,
+        : and it feels more tidy to avoid an extra level of symlink
        set NetBSD /proc/curproc/exe Linux /proc/self/exe FreeBSD /proc/curproc/file Solaris /proc/self/path/a.out
        while test $# -gt 0; do
            type=$1; try=$2
@@ -17125,13 +17385,10 @@ case "$d_readlink" in
                fi
            fi
        done
-       ;;
-esac
+fi
 $rm -f reflect
 set d_procselfexe
 eval $setvar
-;;
-esac
 
 : backward compatibility for d_hvfork
 if test X$d_hvfork != X; then
 set d_sigaction; eval $setvar
 $rm_try
 
+: see what type pids are declared as in the kernel
+rp="What is the type of process ids on this system?"
+set pid_t pidtype int stdio.h sys/types.h
+eval $typedef_ask
+
+: see what type uids are declared as in the kernel
+echo " "
+echo "Looking for the type for user ids returned by getuid()."
+set uid_t uidtype xxx stdio.h sys/types.h
+eval $typedef
+case "$uidtype" in
+xxx)
+       xxx=`./findhdr sys/user.h`
+       set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
+       case $1 in
+       unsigned) dflt="$1 $2" ;;
+       *) dflt="$1" ;;
+       esac
+       ;;
+*) dflt="$uidtype";;
+esac
+case "$uidtype" in
+uid_t) echo "uid_t found." ;;
+*)     rp="What is the type for user ids returned by getuid()?"
+       . ./myread
+       uidtype="$ans"
+       ;;
+esac
+
+: Define hasfield_t macro for Configure internal use
+hasfield_t='varname=$1; struct=$2; type=$3; field=$4; shift; shift; shift; shift;
+while $test $# -ge 2; do
+    case "$1" in
+       $define) echo "#include <$2>";;
+    esac ;
+    shift 2;
+done > try.c;
+echo "int main () { $struct foo; $type bar = foo.$field; }" >> try.c;
+set try;
+if eval $compile; then
+       val="$define";
+else
+       val="$undef";
+fi;
+set $varname;
+eval $setvar;
+$rm_try'
+
+: see what siginfo fields we have
+case "$d_sigaction" in
+"$define")
+       echo "Checking if your siginfo_t has si_errno field...">&4
+       set d_siginfo_si_errno siginfo_t int si_errno $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_pid field...">&4
+       set d_siginfo_si_pid siginfo_t $pidtype si_pid $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_uid field...">&4
+       set d_siginfo_si_uid siginfo_t $uidtype si_uid $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_addr field...">&4
+       set d_siginfo_si_addr siginfo_t "void *" si_addr $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_status field...">&4
+       set d_siginfo_si_status siginfo_t int si_status $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_band field...">&4
+       set d_siginfo_si_band siginfo_t long si_band $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_value field...">&4
+       set d_siginfo_si_value siginfo_t "union sigval" si_value $d_sigaction signal.h
+       eval $hasfield_t;
+
+       echo "Checking if your siginfo_t has si_fd field...">&4
+       set d_siginfo_si_fd siginfo_t int si_fd $d_sigaction signal.h
+       eval $hasfield_t;
+
+       ;;
+*)
+       d_siginfo_si_errno="$undef"
+       d_siginfo_si_pid="$undef"
+       d_siginfo_si_uid="$undef"
+       d_siginfo_si_addr="$undef"
+       d_siginfo_si_status="$undef"
+       d_siginfo_si_band="$undef"
+       d_siginfo_si_value="$undef"
+       d_siginfo_si_fd="$undef"
+       ;;
+esac
+
 : see if this is a sunmath.h system
 set sunmath.h i_sunmath
 eval $inhdr
@@ -18533,7 +18886,7 @@ $cat >try.c <<EOCP
 int main(int argc, char **argv)
 {
     NV x = 0.0;
-    NV y = -0.0;
+    NV y = -1.0;
     if ((signbit(x) == 0) && (signbit(y) != 0))
        return 0;
     else
@@ -18859,6 +19212,43 @@ echo "Checking to see if your struct stat has st_blocks field..." >&4
 set d_statblks stat st_blocks $i_sysstat sys/stat.h
 eval $hasfield
 
+: see if this is a sys/vfs.h system
+set sys/vfs.h i_sysvfs
+eval $inhdr
+
+: see if this is a sys/statfs.h system
+set sys/statfs.h i_sysstatfs
+eval $inhdr
+
+: Check for statfs_s
+echo " "
+echo "Checking to see if your system supports struct statfs..." >&4
+set d_statfs_s statfs $i_systypes sys/types.h $i_sysparam sys/param.h $i_sysmount sys/mount.h $i_sysvfs sys/vfs.h $i_sysstatfs sys/statfs.h
+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 what flavor, if any, of static inline is supported
 echo " "
 echo "Checking to see if your system supports static inline..."
@@ -19068,6 +19458,10 @@ if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
     fi
 fi
 
+: see if strerror_l exists
+set strerror_l d_strerror_l
+eval $inlibc
+
 : see if strerror_r exists
 set strerror_r d_strerror_r
 eval $inlibc
@@ -19812,6 +20206,10 @@ echo " "
 set d_usleepproto usleep $i_unistd unistd.h
 eval $hasproto
 
+: see if ustat exists
+set ustat d_ustat
+eval $inlibc
+
 : see if closedir exists
 set closedir d_closedir
 eval $inlibc
@@ -19949,20 +20347,11 @@ eval $inlibc
 echo " "
 case "$alignbytes" in
     '') echo "Checking alignment constraints..." >&4
-       if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
-           $cat >try.c <<'EOCP'
-typedef long double NV;
-EOCP
-       else
-           $cat >try.c <<'EOCP'
-typedef double NV;
-EOCP
-       fi
-       $cat >>try.c <<'EOCP'
+       $cat >try.c <<EOCP
 #include <stdio.h>
 struct foobar {
     char foo;
-    NV bar;
+    $nvtype bar;
 } try_algn;
 int main()
 {
@@ -20263,19 +20652,52 @@ EOCP
        ;;
 esac
 
+: Include . in @INC
+$cat <<EOM
+
+Historically Perl has provided a final fallback of the current working
+directory '.' when searching for a library. This, however, can lead to
+problems when a Perl program which loads optional modules is called from
+a shared directory. This can lead to executing unexpected code.
+
+EOM
+
+# When changing to exclude by default:
+case "$default_inc_excludes_dot" in
+    $undef|false|[nN]*) dflt="n" ;;
+    *)                  dflt="y" ;;
+esac
+# To turn exclude off by default:
+#case "$default_inc_excludes_dot" in
+#    $define|true|[yY]*) dflt="y" ;;
+#    *)                  dflt="n" ;;
+#esac
+
+rp='Exclude '.' from @INC by default? '
+. ./myread
+case "$ans" in
+    [nN]|undef) default_inc_excludes_dot="$undef"  ;;
+    *)          default_inc_excludes_dot="$define" ;;
+esac
+
 : Check what kind of inf/nan your system has
 $echo "Checking the kind of infinities and nans you have..." >&4
+$echo "(The following tests may crash.  That's okay.)" >&4
 $cat >try.c <<EOP
 #define DOUBLESIZE $doublesize
 #$d_longdbl HAS_LONG_DOUBLE
 #ifdef HAS_LONG_DOUBLE
-#define LONGDBLSIZE $longdblsize
-#define LONGDBLKIND $longdblkind
+#define LONG_DOUBLESIZE $longdblsize
+#define LONG_DOUBLEKIND $longdblkind
 #endif
 #$i_math I_MATH
+#$i_string I_STRING
 #ifdef I_MATH
 #include <math.h>
 #endif
+#ifdef I_STRING
+#  include <string.h>
+#endif
 #include <stdio.h>
 /* Note that whether the sign bit is on or off
  * for NaN depends on the CPU/FPU, and possibly
@@ -20286,8 +20708,14 @@ $cat >try.c <<EOP
  * 0x7f, 0xf4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
  * (respectively) as opposed to the more usual
  * 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ *
+ * Pre-IEEE-754 floating point format do not even have inf/nan support
+ * at all.  They might have a "max" value (DBL_MAX), which may be deadly
+ * to even mention, causing immediate SIGFPE or equivalent: this is
+ * the case with VAX floating point, for example.
  */
-static void bytes(unsigned char *p, unsigned int n) {
+static void bytes(void *v, unsigned int n) {
+  unsigned char *p = (unsigned char *)v;
   int i;
   for (i = 0; i < n; i++) {
     printf("0x%02x%s", p[i], i < n - 1 ? ", " : "\n");
@@ -20302,16 +20730,15 @@ int main(int argc, char *argv[]) {
 #ifdef HAS_LONG_DOUBLE
    long double ldinf = (long double)exp(1e9);
    long double ldnan = (long double)sqrt(-1.0);
-#endif
-  if (argc == 2) {
-    switch (argv[1][0]) {
-    case '1': bytes(&dinf, sizeof(dinf)); break;
-    case '2': bytes(&dnan, sizeof(dnan)); break;
-#ifdef HAS_LONG_DOUBLE
 # if LONG_DOUBLEKIND == 3 || LONG_DOUBLEKIND == 4
 /* the 80-bit long doubles might have garbage in their excess bytes */
     memset((char *)&ldinf + 10, '\0', LONG_DOUBLESIZE - 10);
+    memset((char *)&ldnan + 10, '\0', LONG_DOUBLESIZE - 10);
 # endif
+  if (argc == 2) {
+    switch (argv[1][0]) {
+    case '1': bytes(&dinf, sizeof(dinf)); break;
+    case '2': bytes(&dnan, sizeof(dnan)); break;
     case '3': bytes(&ldinf, sizeof(ldinf)); break;
     case '4': bytes(&ldnan, sizeof(ldnan)); break;
 #endif
@@ -20365,6 +20792,10 @@ else
        doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00'
        doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00'
        ;;
+    9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
+       doubleinfbytes=$undef
+       doublenanbytes=$undef
+       ;;
     *) # No idea.
        doubleinfbytes=$undef
        doublenanbytes=$undef
@@ -20411,20 +20842,45 @@ else
        ;;
        esac
        ;;
-    5) # 128-bit LE "double double"
+    5) # 128-bit LE-LE "double double"
        longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'
        longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'
        ;;
-    6) # 128-bit BE "double double"
+    6) # 128-bit BE-BE "double double"
        longdblinfbytes='0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
        longdblnanbytes='0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
        ;;
+    7) # 128-bit LE-BE "double double"
+       longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+       longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+       ;;
+    8) # 128-bit BE-LE "double double"
+       longdblinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+       longdblnanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0xf8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00'
+       ;;
+    9|10|11|12|13|14) # VAX/Cray/IBM floating point formats, no inf/nan.
+       longdblinfbytes=$undef
+       longdblnanbytes=$undef
+       ;;
     *) # No idea.
        longdblinfbytes=$undef
        longdblnanbytes=$undef
        ;;
     esac
 fi
+# In case the program crashed the values are empty, turn them undef.
+case "$doubleinfbytes" in
+'') doubleinfbytes=$undef ;;
+esac
+case "$doublenanbytes" in
+'') doublenanbytes=$undef ;;
+esac
+case "$longdblinfbytes" in
+'') longdblinfbytes=$undef ;;
+esac
+case "$longdblnanbytes" in
+'') longdblnanbytes=$undef ;;
+esac
 $rm_try
 
 : Check the length of the double mantissa
@@ -20477,7 +20933,7 @@ $cat >try.c <<EOP
  * and the top bit must have been one since 387, zero is plain invalid.
  * For normal fp values, the LDBL_MANT_DIG is fine, though. */
 #  define BITS LDBL_MANT_DIG
-# elif ($longdblkind == 5 || $longdblkind == 6) /* double double */
+# elif ($longdblkind == 5 || $longdblkind == 6 || $longdblkind == 7 || $longdblkind == 8) /* double double */
 /* LDBL_MANT_DIG of 106 (twice 53) would be logical, but for some
  * reason e.g. Irix thinks 107.  But in any case, we want only
  * the number of real bits, the implicit bits are of no interest.  */
@@ -20537,6 +20993,61 @@ seedfunc="Perl_drand48_init"
 randbits=48
 randseedtype=U32
 
+: Probe whether dtrace builds an object, as newer Illumos requires an input
+: object file that uses at least one of the probes defined in the .d file
+case "$usedtrace" in
+$define)
+    case "$dtracexnolibs" in
+    $define|true|[yY]*)
+        dtracexnolibs=$define
+       $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h
+       ;;
+    ' '|'')
+        if $dtrace -h -xnolibs -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
+            dtracexnolibs=$define
+            echo "Your dtrace accepts -xnolibs"
+       elif $dtrace -h -s ../perldtrace.d -o perldtrace.h 2>&1 ; then
+            dtracexnolibs=$undef
+            echo "Your dtrace doesn't accept -xnolibs"
+       else
+             echo "Your dtrace doesn't work at all, try building without dtrace support" >&4
+            exit 1
+       fi
+       ;;
+    *)
+        dtracexnolibs=$undef
+       $dtrace -h -s ../perldtrace.d -o perldtrace.h
+       ;;
+    esac
+    case $dtracexnolibs in
+    $define) xnolibs=-xnolibs ;;
+    *) xnolibs= ;;
+    esac
+
+    case "$dtraceobject" in
+    $define|true|[yY]*)
+        dtraceobject=$define
+        ;;
+    ' '|'')
+        $cat >try.c <<EOM
+#include "perldtrace.h"
+int main(void) {
+    PERL_LOADED_FILE("dummy");
+    return 0;
+}
+EOM
+        dtraceobject=$undef
+        if $cc -c -o try.o $optimize $ccflags try.c \
+                    && $dtrace -G $xnolibs -s ../perldtrace.d try.o >/dev/null 2>&1; then
+                dtraceobject=$define
+            echo "Your dtrace builds an object file"
+        fi
+        ;;
+    *) dtraceobject=$undef ;;
+    esac
+    $rm_try perldtrace.o perldtrace.h
+esac
+
 : Determine if this is an EBCDIC system
 echo " "
 echo "Determining whether or not we are on an EBCDIC system..." >&4
@@ -21520,11 +22031,6 @@ rp='What pager is used on your system?'
 . ./getfile
 pager="$ans"
 
-: see what type pids are declared as in the kernel
-rp="What is the type of process ids on this system?"
-set pid_t pidtype int stdio.h sys/types.h
-eval $typedef_ask
-
 : see if ar generates random libraries by itself
 echo " "
 echo "Checking how to generate random libraries on your machine..." >&4
@@ -22129,8 +22635,12 @@ $rm -f signal.c signal$_exe signal$_o signal.nsg signal.ls1
 EOS
 chmod a+x signal_cmd
 $eunicefix signal_cmd
+;;
+esac
 
 : generate list of signal names
+case "$sig_num_init" in
+'')
 echo " "
 case "$sig_name_init" in
 '') doinit=yes ;;
@@ -22412,30 +22922,6 @@ else
 fi
 $rm -f stdioh
 
-: see what type uids are declared as in the kernel
-echo " "
-echo "Looking for the type for user ids returned by getuid()."
-set uid_t uidtype xxx stdio.h sys/types.h
-eval $typedef
-case "$uidtype" in
-xxx)
-       xxx=`./findhdr sys/user.h`
-       set `grep '_ruid;' "$xxx" 2>/dev/null` unsigned short
-       case $1 in
-       unsigned) dflt="$1 $2" ;;
-       *) dflt="$1" ;;
-       esac
-       ;;
-*) dflt="$uidtype";;
-esac
-case "$uidtype" in
-uid_t) echo "uid_t found." ;;
-*)     rp="What is the type for user ids returned by getuid()?"
-       . ./myread
-       uidtype="$ans"
-       ;;
-esac
-
 : Check size of UID
 echo " "
 case "$uidtype" in
@@ -22599,7 +23085,7 @@ main(int argc, char **argv) {
        return 4;
     }
 
-    buffer = malloc(size);
+    buffer = (char *)malloc(size);
     if (!buffer) {
        perror("malloc");
        return 5;
@@ -22698,7 +23184,7 @@ main(int argc, char **argv) {
        return 2;
     }
 
-    buffer = malloc(size);
+    buffer = (char *)malloc(size);
     if (!buffer) {
        perror("malloc");
        return 3;
@@ -22882,6 +23368,10 @@ else
        i_machcthr="$undef"
 fi
 
+: see if this is a mntent.h system
+set mntent.h i_mntent
+eval $inhdr
+
 : see if net/errno.h is available
 val=''
 set net/errno.h val
@@ -23050,7 +23540,7 @@ case "$osname-$gccversion" in
 irix-) ccflags="\$ccflags -woff 1178" ;;
 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
 esac
-$cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $run ./try | $sed 's/ /\\\\ /g'
+$cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs 2>/dev/null && $run ./try | $sed 's/ /\\\\ /g'
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
@@ -23147,7 +23637,7 @@ fi
 
 : add -D_FORTIFY_SOURCE if feasible and not already there
 case "$gccversion" in
-4.*)   case "$optimize$ccflags" in
+[4567].*)      case "$optimize$ccflags" in
        *-O*)   case "$ccflags$cppsymbols" in
                *_FORTIFY_SOURCE=*) # Don't add it again.
                        echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
@@ -23157,11 +23647,11 @@ case "$gccversion" in
                        ;;
                esac
                ;;
-       *)      echo "You have gcc 4.* but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
+       *)      echo "You have gcc 4.* or later but not optimizing, not adding -D_FORTIFY_SOURCE." >&4
                ;;
        esac
        ;;
-*)     echo "You seem not to have gcc 4.*, not adding -D_FORTIFY_SOURCE." >&4
+*)     echo "You seem not to have gcc 4.* or later, not adding -D_FORTIFY_SOURCE." >&4
        ;;
 esac
 
@@ -23322,6 +23812,10 @@ eval $inhdr
 set sys/security.h i_syssecrt
 eval $inhdr
 
+: see if this is a sys/statvfs.h system
+set sys/statvfs.h i_sysstatvfs
+eval $inhdr
+
 : see if this is a sys/un.h system
 set sys/un.h i_sysun
 eval $inhdr
@@ -23334,6 +23828,10 @@ eval $inhdr
 set sys/wait.h i_syswait
 eval $inhdr
 
+: see if this is a ustat.h system
+set ustat.h i_ustat
+eval $inhdr
+
 : see if this is an utime system
 set utime.h i_utime
 eval $inhdr
@@ -24027,9 +24525,18 @@ d_dlerror='$d_dlerror'
 d_dlopen='$d_dlopen'
 d_dlsymun='$d_dlsymun'
 d_dosuid='$d_dosuid'
+d_double_has_inf='$d_double_has_inf'
+d_double_has_nan='$d_double_has_nan'
+d_double_has_negative_zero='$d_double_has_negative_zero'
+d_double_has_subnormals='$d_double_has_subnormals'
+d_double_style_cray='$d_double_style_cray'
+d_double_style_ibm='$d_double_style_ibm'
+d_double_style_ieee='$d_double_style_ieee'
+d_double_style_vax='$d_double_style_vax'
 d_drand48_r='$d_drand48_r'
 d_drand48proto='$d_drand48proto'
 d_dup2='$d_dup2'
+d_duplocale='$d_duplocale'
 d_eaccess='$d_eaccess'
 d_endgrent='$d_endgrent'
 d_endgrent_r='$d_endgrent_r'
@@ -24052,11 +24559,13 @@ d_expm1='$d_expm1'
 d_faststdio='$d_faststdio'
 d_fchdir='$d_fchdir'
 d_fchmod='$d_fchmod'
+d_fchmodat='$d_fchmodat'
 d_fchown='$d_fchown'
 d_fcntl='$d_fcntl'
 d_fcntl_can_lock='$d_fcntl_can_lock'
 d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
+d_fdclose='$d_fdclose'
 d_fdim='$d_fdim'
 d_fds_bits='$d_fds_bits'
 d_fegetround='$d_fegetround'
@@ -24079,19 +24588,24 @@ d_fpclassify='$d_fpclassify'
 d_fpclassl='$d_fpclassl'
 d_fpgetround='$d_fpgetround'
 d_fpos64_t='$d_fpos64_t'
+d_freelocale='$d_freelocale'
 d_frexpl='$d_frexpl'
 d_fs_data_s='$d_fs_data_s'
 d_fseeko='$d_fseeko'
 d_fsetpos='$d_fsetpos'
+d_fstatfs='$d_fstatfs'
+d_fstatvfs='$d_fstatvfs'
 d_fsync='$d_fsync'
 d_ftello='$d_ftello'
 d_ftime='$d_ftime'
 d_futimes='$d_futimes'
+d_gai_strerror='$d_gai_strerror'
 d_gdbm_ndbm_h_uses_prototypes='$d_gdbm_ndbm_h_uses_prototypes'
 d_gdbmndbm_h_uses_prototypes='$d_gdbmndbm_h_uses_prototypes'
 d_getaddrinfo='$d_getaddrinfo'
 d_getcwd='$d_getcwd'
 d_getespwnam='$d_getespwnam'
+d_getfsstat='$d_getfsstat'
 d_getgrent='$d_getgrent'
 d_getgrent_r='$d_getgrent_r'
 d_getgrgid_r='$d_getgrgid_r'
@@ -24108,6 +24622,8 @@ d_gethostprotos='$d_gethostprotos'
 d_getitimer='$d_getitimer'
 d_getlogin='$d_getlogin'
 d_getlogin_r='$d_getlogin_r'
+d_getmnt='$d_getmnt'
+d_getmntent='$d_getmntent'
 d_getnameinfo='$d_getnameinfo'
 d_getnbyaddr='$d_getnbyaddr'
 d_getnbyname='$d_getnbyname'
@@ -24148,6 +24664,7 @@ d_gmtime64='$d_gmtime64'
 d_gmtime_r='$d_gmtime_r'
 d_gnulibc='$d_gnulibc'
 d_grpasswd='$d_grpasswd'
+d_hasmntopt='$d_hasmntopt'
 d_htonl='$d_htonl'
 d_hypot='$d_hypot'
 d_ilogb='$d_ilogb'
@@ -24184,6 +24701,7 @@ d_lgamma_r='$d_lgamma_r'
 d_libm_lib_version='$d_libm_lib_version'
 d_libname_unique='$d_libname_unique'
 d_link='$d_link'
+d_linkat='$d_linkat'
 d_llrint='$d_llrint'
 d_llrintl='$d_llrintl'
 d_llround='$d_llround'
@@ -24196,6 +24714,11 @@ d_lockf='$d_lockf'
 d_log1p='$d_log1p'
 d_log2='$d_log2'
 d_logb='$d_logb'
+d_long_double_style_ieee='$d_long_double_style_ieee'
+d_long_double_style_ieee_doubledouble='$d_long_double_style_ieee_doubledouble'
+d_long_double_style_ieee_extended='$d_long_double_style_ieee_extended'
+d_long_double_style_ieee_std='$d_long_double_style_ieee_std'
+d_long_double_style_vax='$d_long_double_style_vax'
 d_longdbl='$d_longdbl'
 d_longlong='$d_longlong'
 d_lrint='$d_lrint'
@@ -24213,7 +24736,9 @@ d_mbtowc='$d_mbtowc'
 d_memchr='$d_memchr'
 d_memcmp='$d_memcmp'
 d_memcpy='$d_memcpy'
+d_memmem='$d_memmem'
 d_memmove='$d_memmove'
+d_memrchr='$d_memrchr'
 d_memset='$d_memset'
 d_mkdir='$d_mkdir'
 d_mkdtemp='$d_mkdtemp'
@@ -24224,7 +24749,6 @@ d_mktime64='$d_mktime64'
 d_mktime='$d_mktime'
 d_mmap='$d_mmap'
 d_modfl='$d_modfl'
-d_modfl_pow32_bug='$d_modfl_pow32_bug'
 d_modflproto='$d_modflproto'
 d_mprotect='$d_mprotect'
 d_msg='$d_msg'
@@ -24245,6 +24769,7 @@ d_nan='$d_nan'
 d_ndbm='$d_ndbm'
 d_ndbm_h_uses_prototypes='$d_ndbm_h_uses_prototypes'
 d_nearbyint='$d_nearbyint'
+d_newlocale='$d_newlocale'
 d_nextafter='$d_nextafter'
 d_nexttoward='$d_nexttoward'
 d_nice='$d_nice'
@@ -24256,6 +24781,7 @@ d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
 d_oldpthreads='$d_oldpthreads'
 d_oldsock='$d_oldsock'
 d_open3='$d_open3'
+d_openat='$d_openat'
 d_pathconf='$d_pathconf'
 d_pause='$d_pause'
 d_perl_otherlibdirs='$d_perl_otherlibdirs'
@@ -24282,6 +24808,7 @@ d_pwpasswd='$d_pwpasswd'
 d_pwquota='$d_pwquota'
 d_qgcvt='$d_qgcvt'
 d_quad='$d_quad'
+d_querylocale='$d_querylocale'
 d_random_r='$d_random_r'
 d_re_comp='$d_re_comp'
 d_readdir64_r='$d_readdir64_r'
@@ -24295,6 +24822,7 @@ d_regcomp='$d_regcomp'
 d_remainder='$d_remainder'
 d_remquo='$d_remquo'
 d_rename='$d_rename'
+d_renameat='$d_renameat'
 d_rewinddir='$d_rewinddir'
 d_rint='$d_rint'
 d_rmdir='$d_rmdir'
@@ -24355,6 +24883,14 @@ d_shmctl='$d_shmctl'
 d_shmdt='$d_shmdt'
 d_shmget='$d_shmget'
 d_sigaction='$d_sigaction'
+d_siginfo_si_addr='$d_siginfo_si_addr'
+d_siginfo_si_band='$d_siginfo_si_band'
+d_siginfo_si_errno='$d_siginfo_si_errno'
+d_siginfo_si_fd='$d_siginfo_si_fd'
+d_siginfo_si_pid='$d_siginfo_si_pid'
+d_siginfo_si_status='$d_siginfo_si_status'
+d_siginfo_si_uid='$d_siginfo_si_uid'
+d_siginfo_si_value='$d_siginfo_si_value'
 d_signbit='$d_signbit'
 d_sigprocmask='$d_sigprocmask'
 d_sigsetjmp='$d_sigsetjmp'
@@ -24377,7 +24913,10 @@ d_sresgproto='$d_sresgproto'
 d_sresuproto='$d_sresuproto'
 d_stat='$d_stat'
 d_statblks='$d_statblks'
+d_statfs_f_flags='$d_statfs_f_flags'
+d_statfs_s='$d_statfs_s'
 d_static_inline='$d_static_inline'
+d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
 d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
@@ -24390,6 +24929,7 @@ d_strcoll='$d_strcoll'
 d_strctcpy='$d_strctcpy'
 d_strerrm='$d_strerrm'
 d_strerror='$d_strerror'
+d_strerror_l='$d_strerror_l'
 d_strerror_r='$d_strerror_r'
 d_strftime='$d_strftime'
 d_strlcat='$d_strlcat'
@@ -24432,10 +24972,13 @@ d_ualarm='$d_ualarm'
 d_umask='$d_umask'
 d_uname='$d_uname'
 d_union_semun='$d_union_semun'
+d_unlinkat='$d_unlinkat'
 d_unordered='$d_unordered'
 d_unsetenv='$d_unsetenv'
+d_uselocale='$d_uselocale'
 d_usleep='$d_usleep'
 d_usleepproto='$d_usleepproto'
+d_ustat='$d_ustat'
 d_vendorarch='$d_vendorarch'
 d_vendorbin='$d_vendorbin'
 d_vendorlib='$d_vendorlib'
@@ -24461,6 +25004,7 @@ db_prefixtype='$db_prefixtype'
 db_version_major='$db_version_major'
 db_version_minor='$db_version_minor'
 db_version_patch='$db_version_patch'
+default_inc_excludes_dot='$default_inc_excludes_dot'
 direntrytype='$direntrytype'
 dlext='$dlext'
 dlsrc='$dlsrc'
@@ -24472,6 +25016,8 @@ doublesize='$doublesize'
 drand01='$drand01'
 drand48_r_proto='$drand48_r_proto'
 dtrace='$dtrace'
+dtraceobject='$dtraceobject'
+dtracexnolibs='$dtracexnolibs'
 dynamic_ext='$dynamic_ext'
 eagain='$eagain'
 ebcdic='$ebcdic'
@@ -24586,6 +25132,7 @@ i_malloc='$i_malloc'
 i_mallocmalloc='$i_mallocmalloc'
 i_math='$i_math'
 i_memory='$i_memory'
+i_mntent='$i_mntent'
 i_ndbm='$i_ndbm'
 i_netdb='$i_netdb'
 i_neterrno='$i_neterrno'
@@ -24616,6 +25163,7 @@ i_sysioctl='$i_sysioctl'
 i_syslog='$i_syslog'
 i_sysmman='$i_sysmman'
 i_sysmode='$i_sysmode'
+i_sysmount='$i_sysmount'
 i_sysndir='$i_sysndir'
 i_sysparam='$i_sysparam'
 i_syspoll='$i_syspoll'
@@ -24624,6 +25172,8 @@ i_syssecrt='$i_syssecrt'
 i_sysselct='$i_sysselct'
 i_syssockio='$i_syssockio'
 i_sysstat='$i_sysstat'
+i_sysstatfs='$i_sysstatfs'
+i_sysstatvfs='$i_sysstatvfs'
 i_systime='$i_systime'
 i_systimek='$i_systimek'
 i_systimes='$i_systimes'
@@ -24631,16 +25181,19 @@ i_systypes='$i_systypes'
 i_sysuio='$i_sysuio'
 i_sysun='$i_sysun'
 i_sysutsname='$i_sysutsname'
+i_sysvfs='$i_sysvfs'
 i_syswait='$i_syswait'
 i_termio='$i_termio'
 i_termios='$i_termios'
 i_time='$i_time'
 i_unistd='$i_unistd'
+i_ustat='$i_ustat'
 i_utime='$i_utime'
 i_values='$i_values'
 i_varargs='$i_varargs'
 i_varhdr='$i_varhdr'
 i_vfork='$i_vfork'
+i_xlocale='$i_xlocale'
 ignore_versioned_solibs='$ignore_versioned_solibs'
 inc_version_list='$inc_version_list'
 inc_version_list_init='$inc_version_list_init'
@@ -25059,8 +25612,7 @@ Id='$Id'
 : Finish up by extracting the .SH files
 case "$alldone" in
 exit)
-       $rm -rf UU
-       echo "Extraction done."
+       echo "Stopping at your request, leaving temporary files around."
        exit 0
        ;;
 cont)
@@ -25135,11 +25687,10 @@ the policy defaults.
 
 EOM
 fi
-if $test -f config.msg; then
+if $test -f UU/config.msg; then
     echo "Hmm.  I also noted the following information while running:"
     echo " "
-    $cat config.msg >&4
-    $rm -f config.msg
+    $cat UU/config.msg >&4
 fi
 $rm -f kit*isdone ark*isdone
 $rm -rf UU