This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make getverlist inside Configure strict/warnings safe and correctly sorted
[perl5.git] / Configure
index 5c02255..23364b4 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -16,7 +16,7 @@
 # you should use metaconfig. Perl uses a modified version of this
 # tool, and this, together with the metaconfig units, are available
 # in the git repository:
-#    $ git clone https://github.com/perl5-metaconfig/metaconfig metaconfig
+#    $ git clone https://github.com/Perl/metaconfig metaconfig
 # The original dist package (including metaconfig) is available on github:
 #    $ git clone https://github.com/rmanfredi/dist.git dist-git
 #
@@ -28,7 +28,7 @@
 # Porting/pumpkin.pod.
 
 # Generated using [metaconfig 3.5 PL0]
-# (with additional metaconfig patches by perlbug@perl.org)
+# with additional metaconfig patches from https://github.com/Perl/metaconfig
 
 cat >c1$$ <<EOF
 ARGGGHHHH!!!!!
@@ -382,6 +382,7 @@ asctime_r_proto=''
 d_asctime_r=''
 d_asinh=''
 d_atanh=''
+d_attribute_always_inline=''
 d_attribute_deprecated=''
 d_attribute_format=''
 d_attribute_malloc=''
@@ -657,6 +658,7 @@ d_lstat=''
 d_madvise=''
 d_malloc_good_size=''
 d_malloc_size=''
+d_malloc_usable_size=''
 d_mblen=''
 d_mbrlen=''
 d_mbrtowc=''
@@ -831,6 +833,7 @@ d_scm_rights=''
 d_sin6_scope_id=''
 d_sockaddr_in6=''
 d_sockaddr_sa_len=''
+d_sockaddr_storage=''
 d_socket=''
 d_sockpair=''
 sockethdr=''
@@ -932,6 +935,7 @@ d_voidsig=''
 signal_t=''
 d_wait4=''
 d_waitpid=''
+d_wcrtomb=''
 d_wcscmp=''
 d_wcstombs=''
 d_wcsxfrm=''
@@ -1350,7 +1354,6 @@ useperlio=''
 usequadmath=''
 usesocks=''
 d_oldpthreads=''
-use5005threads=''
 useithreads=''
 usereentrant=''
 usethreads=''
@@ -1534,8 +1537,8 @@ case "$sh" in
 $me:  Fatal Error:  I can't find a Bourne Shell anywhere.
 
 Usually it's in /bin/sh.  How did you even get this far?
-Please contact me (Perl Maintainers) at perlbug@perl.org and
-we'll try to straighten this all out.
+Please report this issue at https://github.com/Perl/perl5/issues
+and we'll try to straighten this all out.
 EOM
        exit 1
        ;;
@@ -2118,7 +2121,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE.
 You have the option of continuing the configuration process, despite the
 distinct possibility that your kit is damaged, by typing 'y'es.  If you
 do, don't blame me if something goes wrong.  I advise you to type 'n'o
-and contact the author (perlbug@perl.org).
+and contact the author (https://github.com/Perl/perl5/issues).
 
 EOM
                echo $n "Continue? [n] $c" >&4
@@ -2398,7 +2401,7 @@ Much effort has been expended to ensure that this shell script will run on any
 Unix system.  If despite that it blows up on yours, your best bet is to edit
 Configure and run it again.  If you can't run Configure for some reason,
 you'll have to generate a config.sh file by hand.  Whatever problems you
-have, let me (perlbug@perl.org) know how I blew it.
+have, let me (https://github.com/Perl/perl5/issues) know how I blew it.
 
 This installation script affects things in two ways:
 
@@ -3367,7 +3370,7 @@ EOM
        (cd $src/hints; ls -C *.sh) | $sed 's/\.sh/   /g' >&4
        dflt=''
        : Half the following guesses are probably wrong... If you have better
-       : tests or hints, please send them to perlbug@perl.org
+       : tests or hints, please send them to https://github.com/Perl/perl5/issues
        : The metaconfig authors would also appreciate a copy...
        $test -f /irix && osname=irix
        $test -f /xenix && osname=sco_xenix
@@ -4169,14 +4172,9 @@ EOSC
 
 : determine root of directory hierarchy where package will be installed.
 case "$prefix" in
-'')
-       dflt=`./loc . /usr/local /usr/local /local /opt /usr`
-       ;;
-*?/)
-       dflt=`echo "$prefix" | sed 's/.$//'`
+'')    dflt=`./loc . /usr/local /usr/local /local /opt /usr`
        ;;
-*)
-       dflt="$prefix"
+*)     dflt="$prefix"
        ;;
 esac
 $cat <<EOM
@@ -4195,16 +4193,25 @@ rp='Installation prefix to use?'
 . ./getfile
 oldprefix=''
 case "$prefix" in
-'') ;;
-*)
-       case "$ans" in
+'')    ;;
+*)     case "$ans" in
        "$prefix") ;;
        *) oldprefix="$prefix";;
        esac
        ;;
 esac
-prefix="$ans"
-prefixexp="$ansexp"
+
+case "$ans" in
+*?/)   prefix=`echo "$ans" | sed 's/.$//'`
+       ;;
+*)     prefix="$ans"
+esac
+
+case "$ansexp" in
+*?/)   prefixexp=`echo "$ansexp" | sed 's/.$//'`
+       ;;
+*)     prefixexp="$ansexp"
+esac
 
 : allow them to override the AFS root
 case "$afsroot" in
@@ -4383,9 +4390,9 @@ fi
 : Do we want threads support and if so, what type
 case "$usethreads" in
 $define|true|[yY]*)     dflt='y';;
-*)     # Catch case where user specified ithreads or 5005threads but
+*)     # Catch case where user specified ithreads but
        # forgot -Dusethreads (A.D. 4/2002)
-       case "$useithreads$use5005threads" in
+       case "$useithreads" in
        *$define*)      dflt='y';;
        *)              dflt='n';;
        esac
@@ -4410,74 +4417,7 @@ esac
 set usethreads
 eval $setvar
 
-if $test $patchlevel -lt 9; then
-    case "$usethreads" in
-    $define)
-       : Default to ithreads unless overridden on command line or with
-       : old config.sh
-       dflt='y'
-       case "$use5005threads" in
-               $define|true|[yY]*)
-                       echo "5.005 threads are no longer supported"
-                       exit 1
-               ;;
-       esac
-       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
-       : Now set use5005threads to the opposite value.
-       case "$useithreads" in
-       $define) val="$undef" ;;
-       *) val="$define" ;;
-       esac
-       set use5005threads
-       eval $setvar
-       ;;
-    *)
-       useithreads="$undef"
-       use5005threads="$undef"
-       ;;
-    esac
-
-    case "$useithreads$use5005threads" in
-    "$define$define")
-       $cat >&4 <<EOM
-
-You cannot have both the ithreads and the 5.005 threads enabled
-at the same time.  Disabling the 5.005 threads since they are
-much less stable than the ithreads.
-
-EOM
-       use5005threads="$undef"
-       ;;
-    esac
-
-else
-: perl-5.9.x and later
-
-    if test X"$usethreads" = "X$define"; then
-       case "$use5005threads" in
-           $define|true|[yY]*)
-               $cat >&4 <<EOM
-
-5.005 threads has been removed for 5.10.  Perl will be built using ithreads.
-
-EOM
-           ;;
-       esac
-    fi
-
-    use5005threads="$undef"
-    useithreads="$usethreads"
-fi
+useithreads="$usethreads"
 
 case "$d_oldpthreads" in
 '')    : Configure tests would be welcome here.  For now, assume undef.
@@ -4696,7 +4636,7 @@ else
 fi
 $rm -f try try.*
 case "$gccversion" in
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
+1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
 esac
 case "$gccversion" in
 '') gccosandvers='' ;;
@@ -4736,7 +4676,7 @@ esac
 # gcc 3.* complain about adding -Idirectories that they already know about,
 # so we will take those off from locincpth.
 case "$gccversion" in
-3*)
+3.*)
     echo "main(){}">try.c
     for incdir in $locincpth; do
        warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
@@ -5462,13 +5402,13 @@ fi
 case "$hint" in
 default|recommended)
        case "$gccversion" in
-       1*) dflt="$dflt -fpcc-struct-return" ;;
+       1.*) dflt="$dflt -fpcc-struct-return" ;;
        esac
        case "$optimize:$DEBUGGING" in
        *-g*:old) dflt="$dflt -DDEBUGGING";;
        esac
        case "$gccversion" in
-       2*) if $test -d /etc/conf/kconfig.d &&
+       2.*) if $test -d /etc/conf/kconfig.d &&
                        $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
                then
                        # Interactive Systems (ISC) POSIX mode.
@@ -5477,7 +5417,7 @@ default|recommended)
                ;;
        esac
        case "$gccversion" in
-       1*) ;;
+       1.*) ;;
        2.[0-8]*) ;;
        ?*)     set strict-aliasing -fno-strict-aliasing
                eval $checkccflag
@@ -5595,7 +5535,7 @@ case "$cppflags" in
     ;;
 esac
 case "$gccversion" in
-1*) cppflags="$cppflags -D__GNUC__"
+1.*) cppflags="$cppflags -D__GNUC__"
 esac
 case "$mips_type" in
 '');;
@@ -5781,7 +5721,7 @@ compile='
 mc_file=$1;
 shift;
 case "$usedevel" in $define|true|[yY]*) if $test ! -f "${mc_file}.c"; then
-echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to perlbug@perl.org" >&4;
+echo "Internal Configure script bug - compiler test file ${mc_file}.c is missing. Please report this to https://github.com/Perl/perl5/issues" >&4;
 exit 1;
 fi;
 esac;
@@ -7256,7 +7196,7 @@ prefixit='case "$3" in
                none)
                        eval "tp=\"\$$2\"";
                        case "$tp" in
-                       ""|" ") eval "$1=\"\$$2\"";;
+                       ""|" "|none) eval "$1=\"\$$2\"";;
                        *) eval "$1=";;
                        esac;;
                esac;;
@@ -7615,37 +7555,39 @@ sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"`
 
 : Determine list of previous versions to include in @INC
 $cat > getverlist <<EOPL
-#!$perl5 -w
+#!$perl5
+use strict;
+use warnings;
 use File::Basename;
-\$api_versionstring = "$api_versionstring";
-\$version = "$version";
-\$stem = "$sitelib_stem";
-\$archname = "$archname";
+my \$api_versionstring = "$api_versionstring";
+my \$version = "$version";
+my \$stem = "$sitelib_stem";
+my \$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=();
+# The list found is stored twice for each entry: the original name, and
+# the binary broken down version into pack "s>s>s>", so sorting is easy
+# and unambiguous.  This will work for all versions that have a maximum
+# of three digit per group 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
+
+my @inc_version_list;
+my @candidates;
 # XXX Redo to do opendir/readdir?
 if (-d $stem) {
     chdir($stem);
     ;@candidates = map {
-       [ $_, pack "sss", split m/[._]/, "$_.0.0" ] } glob("5.*");
+       [ $_, pack "s>s>s>", split m/[._]/, "$_.0.0" ] } glob("5.*");
     ;@candidates = sort { $a->[1] cmp $b->[1]} @candidates;
 }
 else {
     ;@candidates = ();
 }
 
-($pversion, $aversion, $vsn5005) = map {
-    pack "sss", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
-foreach $d (@candidates) {
+my ($pversion, $aversion, $vsn5005) = map {
+    pack "s>s>s>", split m/[._]/, "$_.0.0" } $version, $api_versionstring, "5.005";
+foreach my $d (@candidates) {
     if ($d->[1] lt $pversion) {
        if ($d->[1] ge $aversion) {
            unshift(@inc_version_list, grep { -d } $d->[0]."/$archname", $d->[0]);
@@ -8550,7 +8492,7 @@ EOM
        if $test "X$sysroot" != X; then
            case "$gccversion" in
                '') ;;
-               *)  dflt="$dflt --sysroot $sysroot" ;;
+               *)  dflt="$dflt --sysroot=$sysroot" ;;
            esac
        fi
 
@@ -8777,7 +8719,7 @@ case "$shrpdir" in
 *)     $cat >&4 <<EOM
 WARNING:  Use of the shrpdir variable for the installation location of
 the shared $libperl is not supported.  It was never documented and
-will not work in this version.  Let me (perlbug@perl.org)
+will not work in this version.  Let me (https://github.com/Perl/perl5/issues)
 know of any problems this may cause.
 
 EOM
@@ -9611,16 +9553,12 @@ prefixvar=sitescript
 set backtrace d_backtrace
 eval $inlibc
 
-: add flags if using c backtrace
+: Check if C backtrace is actually supported.
 case "$usecbacktrace" in
   "") usecbacktrace=$undef ;;
   [yY]*|true|$define)
     case "$d_backtrace" in
       [yY]*|true|$define)
-        case " $ccflags " in
-         *" -DUSE_C_BACKTRACE "*) ;; # Already there.
-         *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
-         esac
         ;;
       *)
         echo "This system does not support backtrace" >&4
@@ -10382,15 +10320,15 @@ esac
 $cat >>try.c <<EOP
 #ifdef TRY_gconvert
 #define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
+const char *myname = "gconvert";
 #endif
 #ifdef TRY_gcvt
 #define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
+const char *myname = "gcvt";
 #endif
 #ifdef TRY_qgcvt
 #define Gconvert(x,n,t,b) qgcvt((x),(n),(b))
-char *myname = "qgcvt";
+const char *myname = "qgcvt";
 #define DOUBLETYPE long double
 #endif
 #ifdef TRY_sprintf
@@ -10403,7 +10341,7 @@ char *myname = "qgcvt";
 #else
 #define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
 #endif
-char *myname = "sprintf";
+const char *myname = "sprintf";
 #endif
 
 #ifndef DOUBLETYPE
@@ -10422,7 +10360,7 @@ char *myname = "sprintf";
 #endif
 #include <string.h>
 
-int checkit(char *expect, char *got)
+void checkit(const char *expect, char *got)
 {
     if (strcmp(expect, got)) {
                printf("%s oddity:  Expected %s, got %s\n",
@@ -10571,6 +10509,7 @@ for xxx_convert in $xxx_list; do
                fi
        else
                echo "$xxx_convert NOT found." >&4
+               xxx_convert=''
        fi
 done
 
@@ -11248,6 +11187,34 @@ set d_attribute_warn_unused_result
 eval $setvar
 $rm -f attrib*
 
+: Look for GCC-style attribute always_inline
+case "$d_attribute_always_inline" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+       if $contains 'warning' attrib.out >/dev/null 2>&1; then
+               echo "Your C compiler doesn't support __attribute__((always_inline))."
+               val="$undef"
+       else
+               echo "Your C compiler supports __attribute__((always_inline))."
+               val="$define"
+       fi
+else
+       echo "Your C compiler doesn't seem to understand __attribute__ at all."
+       val="$undef"
+fi
+;;
+*) val="$d_attribute_always_inline" ;;
+esac
+set d_attribute_always_inline
+eval $setvar
+$rm -f attrib*
+
 : see if getpgrp exists
 set getpgrp d_getpgrp
 eval $inlibc
@@ -11257,6 +11224,7 @@ case "$d_getpgrp" in
        echo " "
        echo "Checking to see which flavor of getpgrp is in use..."
        $cat >try.c <<EOP
+#include <stdio.h>
 #$i_unistd I_UNISTD
 #include <sys/types.h>
 #ifdef I_UNISTD
@@ -11323,6 +11291,7 @@ case "$d_setpgrp" in
        echo " "
        echo "Checking to see which flavor of setpgrp is in use..."
        $cat >try.c <<EOP
+#include <stdio.h>
 #$i_unistd I_UNISTD
 #include <sys/types.h>
 #ifdef I_UNISTD
@@ -11905,7 +11874,6 @@ set socketpair d_sockpair
 eval $inlibc
 
 
-echo " "
 echo "Checking the availability sa_len in the sock struct ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -11922,7 +11890,6 @@ fi
 set d_sockaddr_sa_len; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability struct sockaddr_in6 ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
 set d_sockaddr_in6; eval $setvar
 $rm_try
 
-echo " "
+echo "Checking the availability struct sockaddr_storage ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct sockaddr_storage sastor;
+return (sastor.ss_family);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+    val="$define"
+fi
+set d_sockaddr_storage; eval $setvar
+$rm_try
+
 echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -11958,7 +11941,6 @@ fi
 set d_sin6_scope_id; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability struct ip_mreq ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -11976,7 +11958,6 @@ fi
 set d_ip_mreq; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability struct ip_mreq_source ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -11994,7 +11975,6 @@ fi
 set d_ip_mreq_source; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability struct ipv6_mreq ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -12012,7 +11992,6 @@ fi
 set d_ipv6_mreq; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability struct ipv6_mreq_source ..." >&4
 $cat >try.c <<EOF
 #include <sys/types.h>
@@ -12030,7 +12009,6 @@ fi
 set d_ipv6_mreq_source; eval $setvar
 $rm_try
 
-echo " "
 echo "Checking the availability of certain socket constants..." >&4
 for ENUM in MSG_CTRUNC MSG_DONTROUTE MSG_OOB MSG_PEEK MSG_PROXY SCM_RIGHTS; do
     enum=`$echo $ENUM|./tr '[A-Z]' '[a-z]'`
@@ -14083,9 +14061,11 @@ echo " "
 echo "Checking if you have a working futimes()" >&4
 $cat >try.c <<EOCP
 #include <stdio.h>
+#include <stdlib.h>
 #include <sys/time.h>
 #include <errno.h>
 #include <fcntl.h>
+#include <stdlib.h>
 
 int main ()
 {
@@ -15778,7 +15758,7 @@ eval $inlibc
 echo "Checking to see if you have isless..." >&4
 $cat >try.c <<EOCP
 #include <math.h>
-int main() { return isless(0.0); }
+int main() { return isless(2.0, 1.0); }
 EOCP
 set try
 if eval $compile; then
@@ -15871,27 +15851,24 @@ esac
 
 : see if lchown exists
 echo " "
-$cat > try.c <<'EOCP'
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char lchown(); below.  */
-#include <assert.h>
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char lchown();
-int main() {
-    /*  The GNU C library defines this for functions which it implements
-        to always fail with ENOSYS.  Some functions are actually named
-       something starting with __ and the normal name is an alias.  */
-#if defined (__stub_lchown) || defined (__stub___lchown)
-choke me
-#else
-lchown();
+$cat > try.c <<EOCP
+#include <pwd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#$i_unistd     I_UNISTD
+#ifdef I_UNISTD
+#  include <unistd.h>
 #endif
-; return 0; }
+int main(int argc, char *argv[])
+{
+   if (lchown("./try.c", -1, getgid()) == -1) {
+       exit(EXIT_FAILURE);
+   }
+   exit(EXIT_SUCCESS);
+}
 EOCP
 set try
-if eval $compile; then
+if eval $compile && ./try; then
     $echo "lchown() found." >&4
     val="$define"
 else
@@ -15900,6 +15877,7 @@ else
 fi
 set d_lchown
 eval $setvar
+$rm_try
 
 : See if number of significant digits in a double precision number is known
 echo " "
@@ -16144,6 +16122,10 @@ eval $inlibc
 set malloc_good_size d_malloc_good_size
 eval $inlibc
 
+: see if malloc_usable_size exists
+set malloc_usable_size d_malloc_usable_size
+eval $inlibc
+
 : see if mblen exists
 set mblen d_mblen
 eval $inlibc
@@ -19070,9 +19052,9 @@ EOM
 #define strtoll _strtoll
 #endif
 #include <stdio.h>
-extern long long int strtoll(char *s, char **, int);
+#include <stdlib.h>
 static int bad = 0;
-int check(char *s, long long ell, int een) {
+void check(const char *s, long long ell, int een) {
        long long gll;
        errno = 0;
        gll = strtoll(s, 0, 10);
@@ -19125,11 +19107,11 @@ case "$d_strtoul" in
 Checking whether your strtoul() works okay...
 EOM
        $cat >try.c <<'EOCP'
+#include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
-extern unsigned long int strtoul(char *s, char **, int);
 static int bad = 0;
-void check(char *s, unsigned long eul, int een) {
+void check(const char *s, unsigned long eul, int een) {
        unsigned long gul;
        errno = 0;
        gul = strtoul(s, 0, 10);
@@ -19205,14 +19187,14 @@ case "$d_longlong-$d_strtoull" in
 Checking whether your strtoull() works okay...
 EOM
        $cat >try.c <<'EOCP'
+#include <stdlib.h>
 #include <errno.h>
 #ifdef __hpux
 #define strtoull __strtoull
 #endif
 #include <stdio.h>
-extern unsigned long long int strtoull(char *s, char **, int);
 static int bad = 0;
-int check(char *s, long long eull, int een) {
+void check(const char *s, long long eull, int een) {
        long long gull;
        errno = 0;
        gull = strtoull(s, 0, 10);
@@ -19262,11 +19244,11 @@ case "$d_strtouq" in
 Checking whether your strtouq() works okay...
 EOM
        $cat >try.c <<'EOCP'
+#include <stdlib.h>
 #include <errno.h>
 #include <stdio.h>
-extern unsigned long long int strtouq(char *s, char **, int);
 static int bad = 0;
-void check(char *s, unsigned long long eull, int een) {
+void check(const char *s, unsigned long long eull, int een) {
        unsigned long long gull;
        errno = 0;
        gull = strtouq(s, 0, 10);
@@ -19887,6 +19869,10 @@ eval $inlibc
 set waitpid d_waitpid
 eval $inlibc
 
+: see if wcrtomb exists
+set wcrtomb d_wcrtomb
+eval $inlibc
+
 : look for wcscmp
 echo " "
 $cat >try.c <<'EOCP'
@@ -23184,7 +23170,7 @@ fi
 
 : add -D_FORTIFY_SOURCE if feasible and not already there
 case "$gccversion" in
-[456789].*)    case "$optimize$ccflags" in
+[456789].*|[1-9][0-9]*)        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
@@ -23579,14 +23565,6 @@ for xxx in $xs_extensions ; do
                        ;;
                esac
                ;;
-       Thread|thread)
-                case "$usethreads" in
-                true|$define|y)
-                        case "$use5005threads" in
-                        $define|true|[yY]*) avail_ext="$avail_ext $xxx" ;;
-                        esac
-               esac
-               ;;
        threads|threads/shared)
                # threads and threads::shared are special cases.
                # To stop people from asking "Perl 5.8.0 was supposed
@@ -24037,6 +24015,7 @@ d_asinh='$d_asinh'
 d_atanh='$d_atanh'
 d_atolf='$d_atolf'
 d_atoll='$d_atoll'
+d_attribute_always_inline='$d_attribute_always_inline'
 d_attribute_deprecated='$d_attribute_deprecated'
 d_attribute_format='$d_attribute_format'
 d_attribute_malloc='$d_attribute_malloc'
@@ -24294,6 +24273,7 @@ d_lstat='$d_lstat'
 d_madvise='$d_madvise'
 d_malloc_good_size='$d_malloc_good_size'
 d_malloc_size='$d_malloc_size'
+d_malloc_usable_size='$d_malloc_usable_size'
 d_mblen='$d_mblen'
 d_mbrlen='$d_mbrlen'
 d_mbrtowc='$d_mbrtowc'
@@ -24461,6 +24441,7 @@ d_sitearch='$d_sitearch'
 d_snprintf='$d_snprintf'
 d_sockaddr_in6='$d_sockaddr_in6'
 d_sockaddr_sa_len='$d_sockaddr_sa_len'
+d_sockaddr_storage='$d_sockaddr_storage'
 d_sockatmark='$d_sockatmark'
 d_sockatmarkproto='$d_sockatmarkproto'
 d_socket='$d_socket'
@@ -24553,6 +24534,7 @@ d_voidtty='$d_voidtty'
 d_vsnprintf='$d_vsnprintf'
 d_wait4='$d_wait4'
 d_waitpid='$d_waitpid'
+d_wcrtomb='$d_wcrtomb'
 d_wcscmp='$d_wcscmp'
 d_wcstombs='$d_wcstombs'
 d_wcsxfrm='$d_wcsxfrm'
@@ -25054,7 +25036,6 @@ uidtype='$uidtype'
 uname='$uname'
 uniq='$uniq'
 uquadtype='$uquadtype'
-use5005threads='$use5005threads'
 use64bitall='$use64bitall'
 use64bitint='$use64bitint'
 usecbacktrace='$usecbacktrace'