This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge branch 'dirnames' into blead
[perl5.git] / Configure
index 485a410..854ed8f 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -14,7 +14,7 @@
 # Note: this Configure script was generated automatically. Rather than
 # working with this copy of Configure, you may wish to get metaconfig.
 # The dist package (which contains metaconfig) is available via SVN:
-#     svn co https://svn.sourceforge.net/svnroot/dist/trunk/dist
+#     svn co https://svn.code.sf.net/p/dist/code/trunk/dist
 #
 # Though this script was generated by metaconfig from metaunits, it is
 # OK to send patches against Configure itself. It's up to the Configure
@@ -28,9 +28,7 @@
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
-#
-# Generated on Fri Dec 10 12:04:58 CET 2010 [metaconfig 3.5 PL0]
+# Generated on Tue Sep 17 10:34:33 CEST 2013 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -101,7 +99,7 @@ if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
                is_os2=yes
        elif test -n "$DJGPP"; then
                case "X${MACHTYPE:-nonesuchmach}" in
-               *cygwin) ;;
+               *cygwin|*msys) ;;
                *) p_=\; ;;
                esac
        fi
@@ -334,6 +332,7 @@ d_archlib=''
 installarchlib=''
 archname=''
 myarchname=''
+useversionedarchname=''
 d_atolf=''
 d_atoll=''
 baserev=''
@@ -567,6 +566,7 @@ d_inetntop=''
 d_inetpton=''
 d_int64_t=''
 d_isascii=''
+d_isblank=''
 d_isfinite=''
 d_isinf=''
 d_isnan=''
@@ -724,6 +724,10 @@ d_snprintf=''
 d_vsnprintf=''
 d_sockatmark=''
 d_sockatmarkproto=''
+d_ip_mreq=''
+d_ip_mreq_source=''
+d_ipv6_mreq=''
+d_ipv6_mreq_source=''
 d_msg_ctrunc=''
 d_msg_dontroute=''
 d_msg_oob=''
@@ -731,6 +735,8 @@ d_msg_peek=''
 d_msg_proxy=''
 d_oldsock=''
 d_scm_rights=''
+d_sin6_scope_id=''
+d_sockaddr_in6=''
 d_sockaddr_sa_len=''
 d_socket=''
 d_sockpair=''
@@ -841,9 +847,11 @@ cccdlflags=''
 ccdlflags=''
 dlsrc=''
 ld=''
+ld_can_script=''
 lddlflags=''
 usedl=''
 doublesize=''
+bootstrap_charset=''
 ebcdic=''
 fflushNULL=''
 fflushall=''
@@ -879,7 +887,6 @@ i_rpcsvcdbm=''
 d_dirnamlen=''
 direntrytype=''
 i_dirent=''
-i_dld=''
 i_dlfcn=''
 i_fcntl=''
 i_float=''
@@ -927,6 +934,7 @@ i_pwd=''
 i_sfio=''
 i_shadow=''
 i_socks=''
+i_stdbool=''
 i_stddef=''
 i_stdlib=''
 i_string=''
@@ -1195,6 +1203,8 @@ shsharp=''
 spitshell=''
 src=''
 ssizetype=''
+st_ino_sign=''
+st_ino_size=''
 startperl=''
 startsh=''
 stdchar=''
@@ -1216,6 +1226,7 @@ use64bitint=''
 dtrace=''
 usedtrace=''
 usefaststdio=''
+usekernprocpathname=''
 ccflags_uselargefiles=''
 ldflags_uselargefiles=''
 libswanted_uselargefiles=''
@@ -1227,6 +1238,7 @@ nm_opt=''
 nm_so_opt=''
 runnm=''
 usenm=''
+usensgetexecutablepath=''
 useperlio=''
 usesocks=''
 d_oldpthreads=''
@@ -1271,8 +1283,6 @@ installvendorscript=''
 vendorscript=''
 vendorscriptexp=''
 versiononly=''
-defvoidused=''
-voidflags=''
 yacc=''
 yaccflags=''
 CONFIG=''
@@ -1302,6 +1312,9 @@ elif test -f "/system/gnu_library/bin/ar.pm"; then
 elif test -n "$DJGPP"; then
 : DOS DJGPP
     _exe=".exe"
+elif test -f /kern/cookiejar; then
+: MiNT
+    _exe=""
 elif test -d c:/. -o -n "$is_os2" ; then
 : OS/2 or cygwin
     _exe=".exe"
@@ -1309,6 +1322,9 @@ 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.
@@ -1320,13 +1336,8 @@ inclwanted=''
 
 : Enable -DEBUGGING and -DDEBUGGING from the command line
 EBUGGING=''
-DEBUGGING=old
+DEBUGGING=''
 
-: set usethreads on the Configure command line to enable threads.
-usereentrant='undef'
-: 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'
@@ -1350,9 +1361,8 @@ plibpth=''
 libswanted=''
 : some systems want to use only the non-versioned libso:s
 ignore_versioned_solibs=''
-: full support for void wanted by default
-defvoidused=15
-
+: set usethreads on the Configure command line to enable threads.
+usereentrant='undef'
 ccname=''
 ccversion=''
 perllibs=''
@@ -1368,7 +1378,7 @@ libswanted_uselargefiles=''
 : set usesocks on the Configure command line to enable socks.
 : 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"
+libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl ld sun"
 libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
 : We probably want to search /usr/shlib before most other libraries.
 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
@@ -1412,10 +1422,10 @@ esac
 
 case "$sh" in
 '')    cat >&2 <<EOM
-$me:  Fatal Error:  I can't find a Bourne Shell anywhere.  
+$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 
+Please contact me (Perl Maintainers) at perlbug@perl.org and
 we'll try to straighten this all out.
 EOM
        exit 1
@@ -2254,7 +2264,7 @@ in the default answer, as if the default line was a set of arguments given to a
 script shell.  This means you may also use $* to repeat the whole default line,
 so you do not have to re-type everything to add something to the default.
 
-Everytime there is a substitution, you will have to confirm.  If there is an
+Every time there is a substitution, you will have to confirm.  If there is an
 error (e.g. an unmatched backtick), the default answer will remain unchanged
 and you will be prompted again.
 
@@ -2700,7 +2710,7 @@ case "$lns" in
                                ;;
                        *)      issymlink='' ;;
                        esac
-               fi              
+               fi
        fi
        if $test "X$issymlink" = X; then
                if $test -L sym 2>/dev/null; then
@@ -3089,9 +3099,13 @@ case "$config_sh" in
 '')
 myuname=`$uname -a 2>/dev/null`
 $test -z "$myuname" && myuname=`hostname 2>/dev/null`
+# Downcase everything to avoid ambiguity.
+# Remove slashes and single quotes so we can use parts of this in
+# directory and file names.
+# Remove newlines so myuname is sane to use elsewhere.
 # tr '[A-Z]' '[a-z]' would not work in EBCDIC
 # because the A-Z/a-z are not consecutive.
-myuname=`echo $myuname | $sed -e 's/^[^=]*=//' -e "s,['/],,g" | \
+myuname=`echo $myuname | $sed -e "s,['/],,g" | \
        ./tr '[A-Z]' '[a-z]' | $tr $trnl ' '`
 newmyuname="$myuname"
 dflt=n
@@ -3238,6 +3252,9 @@ EOM
                        *) osvers=$tmp;;
                        esac
                        ;;
+               bitrig) osname=bitrig
+                       osvers="$3"
+                       ;;
                bsd386) osname=bsd386
                        osvers=`$uname -r`
                        ;;
@@ -3976,7 +3993,7 @@ else
 fi
 
 : determine installation prefix for where package is to be installed.
-if $afs; then 
+if $afs; then
 $cat <<EOM
 
 Since you are running AFS, I need to distinguish the directory in which
@@ -4072,77 +4089,6 @@ $undef$define) . ./whoa; eval "$var=\$tu";;
 *) eval "$var=$val";;
 esac'
 
-: Check is we will use socks
-case "$usesocks" in
-$define|true|[yY]*)    dflt='y';;
-*) dflt='n';;
-esac
-cat <<EOM
-
-Perl can be built to use the SOCKS proxy protocol library.  To do so,
-Configure must be run with -Dusesocks.  If you use SOCKS you also need
-to use the PerlIO abstraction layer, this will be implicitly selected.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
-rp='Build Perl for SOCKS?'
-. ./myread
-case "$ans" in
-y|Y)   val="$define" ;;
-*)      val="$undef" ;;
-esac
-set usesocks
-eval $setvar
-
-case "$usesocks" in
-$define|true|[yY]*) useperlio="$define";;
-esac
-
-: Check if we want perlio
-case "$useperlio" in
-$define|true|[yY]*|'') dflt='y';;
-*) dflt='n';;
-esac
-cat <<EOM
-
-Previous version of $package used the standard IO mechanisms as
-defined in <stdio.h>.  Versions 5.003_02 and later of $package allow
-alternate IO mechanisms via the PerlIO abstraction layer, but the
-stdio mechanism is still available if needed.  The abstraction layer
-can use AT&T's sfio (if you already have sfio installed) or regular stdio.
-Using PerlIO with sfio may cause problems with some extension modules.
-
-If this doesn't make any sense to you, just accept the default '$dflt'.
-EOM
-rp='Use the PerlIO abstraction layer?'
-. ./myread
-case "$ans" in
-y|Y)
-       val="$define"
-       ;;
-*)
-       echo "Ok, doing things the stdio way."
-       val="$undef"
-       ;;
-esac
-set useperlio
-eval $setvar
-
-case "$usesocks" in
-$define|true|[yY]*)
-       case "$useperlio" in
-       $define|true|[yY]*) ;;
-       *)      cat >&4 <<EOM
-
-You are using the SOCKS proxy protocol library which means that you
-should also use the PerlIO layer.  You may be headed for trouble.
-
-EOM
-               ;;
-       esac
-       ;;
-esac
-
 : get the patchlevel
 echo " "
 echo "Getting the current patchlevel..." >&4
@@ -4202,25 +4148,18 @@ $define|true|[yY]*)     dflt='y';;
 *)     # Catch case where user specified ithreads or 5005threads but
        # forgot -Dusethreads (A.D. 4/2002)
        case "$useithreads$use5005threads" in
-       *$define*)
-               case "$useperlio" in
-               "$define")      dflt='y' ;;
-               *)              dflt='n' ;;
-               esac
-               ;;
-       *)      dflt='n';;
+       *$define*)      dflt='y';;
+       *)              dflt='n';;
        esac
        ;;
 esac
 cat <<EOM
 
-Perl can be built to take advantage of threads on some systems.
+Perl can be built to offer a form of threading support on some systems
 To do so, Configure can be run with -Dusethreads.
 
 Note that Perl built with threading support runs slightly slower
-and uses more memory than plain Perl. The current implementation
-is believed to be stable, but it is fairly new, and so should be
-treated with caution.
+and uses slightly more memory than plain Perl.
 
 If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
@@ -4236,22 +4175,14 @@ eval $setvar
 if $test $patchlevel -lt 9; then
     case "$usethreads" in
     $define)
-       $cat <<EOM
-
-Since release 5.6, Perl has had two different threading implementations,
-the newer interpreter-based version (ithreads) with one interpreter per
-thread, and the older 5.005 version (5005threads).
-The 5005threads version is effectively unmaintained and will probably be
-removed in Perl 5.10, so there should be no need to build a Perl using it
-unless needed for backwards compatibility with some existing 5.005threads
-code.
-
-EOM
        : Default to ithreads unless overridden on command line or with
        : old config.sh
        dflt='y'
        case "$use5005threads" in
-               $define|true|[yY]*) dflt='n';;
+               $define|true|[yY]*)
+                       echo "5.005 threads are no longer supported"
+                       exit 1
+               ;;
        esac
        case "$useithreads" in
                $undef|false|[nN]*) dflt='n';;
@@ -4310,16 +4241,6 @@ EOM
     useithreads="$usethreads"
 fi
 
-if test X"$usethreads" = "X$define" -a "X$useperlio" = "Xundef"; then
-       cat >&4 <<EOF
-***
-*** To build with ithreads you must also use the PerlIO layer.
-*** Cannot continue, aborting.
-***
-EOF
-       exit 1
-fi
-
 case "$d_oldpthreads" in
 '')    : Configure tests would be welcome here.  For now, assume undef.
        val="$undef" ;;
@@ -4895,6 +4816,28 @@ case "$firstmakefile" in
 '') firstmakefile='makefile';;
 esac
 
+: Check is we will use socks
+case "$usesocks" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+cat <<EOM
+
+Perl can be built to use the SOCKS proxy protocol library.  To do so,
+Configure must be run with -Dusesocks.  If you use SOCKS you also need
+to use the PerlIO abstraction layer, this will be implicitly selected.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+rp='Build Perl for SOCKS?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define" ;;
+*)      val="$undef" ;;
+esac
+set usesocks
+eval $setvar
+
 : Check for uselongdouble support
 case "$ccflags" in
 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
@@ -5310,10 +5253,10 @@ case "$ldflags" in
 esac
 # See note above about -fstack-protector
 case "$ccflags" in
-*-fstack-protector*) 
+*-fstack-protector*)
        case "$dflt" in
        *-fstack-protector*) ;; # Don't add it again
-       *) dflt="$dflt -fstack-protector" ;; 
+       *) dflt="$dflt -fstack-protector" ;;
        esac
        ;;
 esac
@@ -5913,6 +5856,59 @@ if $test -f use64bitint.cbu; then
 fi
 case "$use64bitint" in
 "$define"|true|[yY]*)
+       : This test was common to all the OpenBSD forks, and seems harmless for
+       : other platforms:
+       echo " "
+       echo "Checking if your C library has broken 64-bit functions..." >&4
+       cat >try.c <<EOCP
+#include <stdio.h>
+typedef $uquadtype myULL;
+int main (void)
+{
+    struct {
+       double d;
+       myULL  u;
+    } *p, test[] = {
+       {4294967303.15, 4294967303ULL},
+       {4294967294.2,  4294967294ULL},
+       {4294967295.7,  4294967295ULL},
+       {0.0, 0ULL}
+    };
+    for (p = test; p->u; p++) {
+       myULL x = (myULL)p->d;
+       if (x != p->u) {
+           printf("buggy\n");
+           return 0;
+       }
+    }
+    printf("ok\n");
+    return 0;
+}
+EOCP
+       set try
+       if eval $compile_ok; then
+           libcquad=`./try`
+           echo "Your C library's 64-bit functions are $libcquad."
+       else
+           echo "(I can't seem to compile the test program.)"
+           echo "Assuming that your C library's 64-bit functions are ok."
+           libcquad="ok"
+       fi
+       $rm_try
+
+       case "$libcquad" in
+           buggy*)
+               cat >&4 <<EOM
+
+*** You have a C library with broken 64-bit functions.
+*** 64-bit support does not work reliably in this configuration.
+*** Please rerun Configure without -Duse64bitint and/or -Dusemorebits.
+*** Cannot continue, aborting.
+
+EOM
+               exit 1
+               ;;
+       esac
        case "$longsize" in
        4) case "$archname64" in
           '') archname64=64int ;;
@@ -6070,6 +6066,32 @@ esac
 rp='What is your architecture name'
 . ./myread
 archname="$ans"
+
+: optionally add API version to the architecture for versioned archlibs
+case "$useversionedarchname" in
+$define|true|[yY]*) dflt='y';;
+*)                  dflt='n';;
+esac
+rp='Add the Perl API version to your archname?'
+. ./myread
+case "$ans" in
+y|Y)   useversionedarchname="$define" ;;
+*)      useversionedarchname="$undef" ;;
+esac
+case "$useversionedarchname" in
+$define)
+        case "$archname" in
+        *-$api_versionstring)
+                echo "...and architecture name already has -$api_versionstring" >&4
+                ;;
+        *)
+                archname="$archname-$api_versionstring"
+                echo "...setting architecture name to $archname." >&4
+                ;;
+        esac
+        ;;
+esac
+
 case "$usethreads" in
 $define)
        echo "Threads selected." >&4
@@ -6136,21 +6158,6 @@ $define)
        esac
        ;;
 esac
-case "$useperlio" in
-$define)
-       echo "Perlio selected." >&4
-       ;;
-*)
-       echo "Perlio not selected, using stdio." >&4
-       case "$archname" in
-        *-stdio*) echo "...and architecture name already has -stdio." >&4
-                ;;
-        *)      archname="$archname-stdio"
-                echo "...setting architecture name to $archname." >&4
-                ;;
-        esac
-       ;;
-esac
 if $test -f archname.cbu; then
        echo "Your platform has some specific hints for architecture name, using them..."
        . ./archname.cbu
@@ -6658,112 +6665,11 @@ $rm_try
 set i_malloc
 eval $setvar
 
-: check for void type
-echo " "
-echo "Checking to see how well your C compiler groks the void type..." >&4
-case "$voidflags" in
-'')
-       $cat >try.c <<EOCP
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-#if TRY & 1
-void sub() {
-#else
-sub() {
-#endif
-       extern void moo();      /* function returning void */
-       void (*goo)();          /* ptr to func returning void */
-#if TRY & 8
-       void *hue;              /* generic ptr */
-#endif
-#if TRY & 2
-       void (*foo[10])();
-#endif
-
-#if TRY & 4
-       if(goo == moo) {
-               exit(0);
-       }
-#endif
-       exit(0);
-}
-int main() { sub(); }
-EOCP
-       if $cc $ccflags -c -DTRY=$defvoidused try.c >.out 2>&1 ; then
-               voidflags=$defvoidused
-       echo "Good.  It appears to support void to the level $package wants.">&4
-               if $contains warning .out >/dev/null 2>&1; then
-                       echo "However, you might get some warnings that look like this:"
-                       $cat .out
-               fi
-       else
-echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
-               if $cc $ccflags -c -DTRY=1 try.c >/dev/null 2>&1; then
-                       echo "It supports 1..."
-                       if $cc $ccflags -c -DTRY=3 try.c >/dev/null 2>&1; then
-                               echo "It also supports 2..."
-                               if $cc $ccflags -c -DTRY=7 try.c >/dev/null 2>&1; then
-                                       voidflags=7
-                                       echo "And it supports 4 but not 8 definitely."
-                               else
-                                       echo "It doesn't support 4..."
-                                       if $cc $ccflags -c -DTRY=11 try.c >/dev/null 2>&1; then
-                                               voidflags=11
-                                               echo "But it supports 8."
-                                       else
-                                               voidflags=3
-                                               echo "Neither does it support 8."
-                                       fi
-                               fi
-                       else
-                               echo "It does not support 2..."
-                               if $cc $ccflags -c -DTRY=13 try.c >/dev/null 2>&1; then
-                                       voidflags=13
-                                       echo "But it supports 4 and 8."
-                               else
-                                       if $cc $ccflags -c -DTRY=5 try.c >/dev/null 2>&1; then
-                                               voidflags=5
-                                               echo "And it supports 4 but has not heard about 8."
-                                       else
-                                               echo "However it supports 8 but not 4."
-                                       fi
-                               fi
-                       fi
-               else
-                       echo "There is no support at all for void."
-                       voidflags=0
-               fi
-       fi
-esac
-case "$voidflags" in
-"$defvoidused") ;;
-*)     $cat >&4 <<'EOM'
-  Support flag bits are:
-    1: basic void declarations.
-    2: arrays of pointers to functions returning void.
-    4: operations between pointers to and addresses of void functions.
-    8: generic void pointers.
-EOM
-       dflt="$voidflags";
-       rp="Your void support flags add up to what?"
-       . ./myread
-       voidflags="$ans"
-       ;;
-esac
-$rm_try
-
 : check for length of pointer
 echo " "
 case "$ptrsize" in
 '')
        echo "Checking to see how big your pointers are..." >&4
-       if test "$voidflags" -gt 7; then
-               echo '#define VOID_PTR char *' > try.c
-       else
-               echo '#define VOID_PTR void *' > try.c
-       fi
        $cat >>try.c <<EOCP
 #include <stdio.h>
 #$i_stdlib I_STDLIB
@@ -6772,7 +6678,7 @@ case "$ptrsize" in
 #endif
 int main()
 {
-    printf("%d\n", (int)sizeof(VOID_PTR));
+    printf("%d\n", (int)sizeof(void *));
     exit(0);
 }
 EOCP
@@ -6848,6 +6754,7 @@ case "$usemymalloc" in
        4) dflt='y' ;;
        *) dflt='n' ;;
        esac
+       if test "$useithreads" = "$define"; then dflt='n'; fi
        ;;
 esac
 rp="Do you wish to attempt to use the malloc that comes with $package?"
@@ -6983,7 +6890,7 @@ case "$ans" in
 [yY]*) fn=d~+
        rp='Installation prefix to use for vendor-supplied add-ons?'
        case "$vendorprefix" in
-       '') dflt='' ;;
+       '') dflt="$prefix" ;;
        *)  dflt=$vendorprefix ;;
        esac
        . ./getfile
@@ -7075,9 +6982,9 @@ $cat <<EOM
 
 Lastly, you can have perl look in other directories for extensions and
 modules in addition to those already specified.
-These directories will be searched after 
-       $sitearch 
-       $sitelib 
+These directories will be searched after
+       $sitearch
+       $sitelib
 EOM
 test X"$vendorlib" != "X" && echo '    ' $vendorlib
 test X"$vendorarch" != "X" && echo '   ' $vendorarch
@@ -7095,7 +7002,7 @@ EOM
 rp='Colon-separated list of additional directories for perl to search?'
 . ./myread
 case "$ans" in
-' '|''|none)   otherlibdirs=' ' ;;     
+' '|''|none)   otherlibdirs=' ' ;;
 *)     otherlibdirs="$ans" ;;
 esac
 case "$otherlibdirs" in
@@ -7432,11 +7339,11 @@ case "$usenm" in
                ;;
        esac
        case "$dflt" in
-       '') 
+       '')
                if $test "$osname" = aix -a "X$PASE" != "Xdefine" -a ! -f /lib/syscalls.exp; then
                        echo " "
                        echo "Whoops!  This is an AIX system without /lib/syscalls.exp!" >&4
-                       echo "'nm' won't be sufficient on this sytem." >&4
+                       echo "'nm' won't be sufficient on this system." >&4
                        dflt=n
                fi
                ;;
@@ -7799,10 +7706,6 @@ esac
 esac
 $rm -f libnames libpath
 
-: see if dld is available
-set dld.h i_dld
-eval $inhdr
-
 : Check if we are using C++
 echo " "
 echo "Checking for C++..." >&4
@@ -7937,9 +7840,6 @@ $undef|n|false)
        case "$d_dlopen" in
            $define) dflt='y' ;;
        esac
-       case "$i_dld" in
-           $define) dflt='y' ;;
-       esac
        : Does a dl_xxx.xs file exist for this operating system
        $test -f $rsrc/$dldir/dl_${osname}.xs && dflt='y'
        ;;
@@ -7956,8 +7856,6 @@ y*) usedl="$define"
                        dflt="$dldir/dl_${osname}.xs"
                elif $test "$d_dlopen" = "$define" ; then
                        dflt="$dldir/dl_dlopen.xs"
-               elif $test "$i_dld" = "$define" ; then
-                       dflt="$dldir/dl_dld.xs"
                else
                        dflt=''
                fi
@@ -8016,8 +7914,9 @@ Some systems use ld to create libraries that can be dynamically loaded,
 while other systems (such as those using ELF) use $cc.
 
 EOM
-       case "$ld" in
-       '')     $cat >try.c <<EOM
+
+: Determine if this is ELF
+       $cat >try.c <<EOM
 /* Test for whether ELF binaries are produced */
 #include <fcntl.h>
 #$i_stdlib I_STDLIB
@@ -8034,22 +7933,26 @@ int main() {
        if(i == -1)
                exit(1); /* fail */
        if(read(i,b,4)==4 && b[0]==127 && b[1]=='E' && b[2]=='L' && b[3]=='F')
-               exit(0); /* succeed (yes, it's ELF) */
+               exit(0); /* succeed (yes, it is ELF) */
        else
                exit(1); /* fail */
 }
 EOM
-               if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+       if $cc $ccflags $ldflags try.c >/dev/null 2>&1 && $run ./a.out; then
+               bin_ELF="$define"
+       fi
+       $rm_try
+
+       case "$ld" in
+       '')     if $test $bin_ELF = "$define"; then
                        cat <<EOM
 You appear to have ELF support.  I'll use $cc to build dynamic libraries.
 EOM
                        dflt="$cc"
-                       bin_ELF="$define"
                else
                        echo "I'll use ld to build dynamic libraries."
                        dflt='ld'
                fi
-               $rm_try
                ;;
        *)      dflt="$ld"
                ;;
@@ -8070,7 +7973,6 @@ use no flags, say "none".
 EOM
     case "$lddlflags" in
     '') case "$osname" in
-                       beos) dflt='-nostart' ;;
                        haiku) dflt='-shared' ;;
                        hpux) dflt='-b';
                              case "$gccversion" in
@@ -8079,7 +7981,21 @@ EOM
                              ;;
                        linux|irix*|gnu*)  dflt="-shared $optimize" ;;
                        next)  dflt='none' ;;
-                       solaris) dflt='-G' ;;
+                       solaris) # See [perl #66604].
+                               # On Solaris 11, gcc -m64 on amd64 
+                               # appears not to understand -G.  gcc versions at
+                               # least as old as 3.4.3 support -shared, so just
+                               # use that with Solaris 11 and later, but keep
+                               # the old behavior for older Solaris versions.
+                               case "$gccversion" in
+                                       '') dflt='-G' ;;
+                                       *)      case "$osvers" in
+                                                       2.?|2.10) dflt='-G' ;;
+                                                       *) dflt='-shared' ;;
+                                               esac
+                                               ;;
+                               esac
+                               ;;
                        sunos) dflt='-assert nodefinitions' ;;
                        svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
                *)     dflt='none' ;;
@@ -8156,6 +8072,34 @@ EOM
     ;;
 esac
 
+ld_can_script="$undef"
+case "$bin_ELF$usedl" in
+$define$define)
+    # Abuse try.h and a.out names for neat cleanup
+    $cat >try.c <<EOM
+void foo() {}
+void bar() {}
+EOM
+    $cat >try.h <<EOM
+LIBTEST_42 {
+ global:
+  foo;
+ local: *;
+ };
+EOM
+    if $cc $cccdlflags $ccdlflags $ccflags \
+           $ldflags $lddlflags -o a.out try.c \
+           -Wl,--version-script=try.h >/dev/null 2>&1 \
+       &&  $test -s a.out ; then
+       echo "ld supports scripting" >&4
+       ld_can_script="$define"
+    else
+       echo "ld does not support scripting" >&4
+    fi
+    $rm_try
+    ;;
+esac
+
 : Do we want a shared libperl?
 also=''
 case "$usedl" in
@@ -8165,7 +8109,7 @@ $undef)
        ;;
 *)     case "$useshrplib" in
        '')     case "$osname" in
-               svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|haiku|cygwin*)
+               svr4*|nonstopux|dgux|dynixptx|esix|powerux|haiku|cygwin*)
                        dflt=y
                        also='Building a shared libperl is required for dynamic loading to work on your system.'
                        ;;
@@ -8327,7 +8271,7 @@ if "$useshrplib"; then
        solaris)
                xxx="-R $shrpdir"
                ;;
-       freebsd|netbsd|openbsd|interix|dragonfly)
+       freebsd|mirbsd|netbsd|openbsd|interix|dragonfly|bitrig)
                xxx="-Wl,-R$shrpdir"
                ;;
        bsdos|linux|irix*|dec_osf|gnu*)
@@ -8336,9 +8280,6 @@ if "$useshrplib"; then
        next)
                # next doesn't like the default...
                ;;
-       beos)
-               # beos doesn't like the default, either.
-               ;;
        haiku)
                # Haiku doesn't like the default, either.
                ;;
@@ -8390,7 +8331,7 @@ esac
 : determine where manual pages are on this system
 echo " "
 case "$sysman" in
-'') 
+'')
        syspath='/usr/share/man/man1 /usr/man/man1'
        syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
        syspath="$syspath /usr/man/u_man/man1"
@@ -8873,9 +8814,19 @@ your organization...
 EOM
 cont=x
 while test "$cont"; do
+       case "$MAILDOMAIN" in
+       '')
+               if $test -s /etc/mailname; then
+                       maildomain=`$cat /etc/mailname`
+               else
+                       maildomain="$myhostname$mydomain"
+               fi
+               ;;
+       *)  maildomain="$MAILDOMAIN";;
+       esac
        case "$cf_email" in
-       '') dflt="$cf_by@$myhostname$mydomain";;
-       *) dflt="$cf_email";;
+       '') dflt="$cf_by@$maildomain";;
+       *)  dflt="$cf_email";;
        esac
        rp='What is your e-mail address?'
        . ./myread
@@ -9411,6 +9362,9 @@ EOCP
        ;;
 esac
 
+: Check if we want perlio
+useperlio="$define"
+
 : Set the vendorbin variables
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
@@ -9898,7 +9852,7 @@ done
 
 case "$d_longdbl$uselongdouble" in
 "$define$define")
-    : again, add prefered functions to our list first
+    : again, add preferred functions to our list first
     xxx_ld_list=""
     for xxx_convert in $gconvert_ld_preference; do
         case $xxx_convert in
@@ -10059,7 +10013,7 @@ eval $inlibc
 set pthread.h i_pthread
 eval $inhdr
 
-: define a fucntion to check prototypes
+: define a function to check prototypes
 $cat > protochk <<EOSH
 $startsh
 cc="$cc"
@@ -10830,7 +10784,7 @@ else
        valstd="$undef"
 fi
 
-: see if varags is available
+: see if varargs is available
 echo " "
 if $test `./findhdr varargs.h`; then
        echo "<varargs.h> found." >&4
@@ -10882,6 +10836,7 @@ chmod +x varargs
 : now check which varargs header should be included
 echo " "
 i_varhdr=''
+val=''
 case "$valstd" in
 "$define")
        if `./varargs I_STDARG`; then
@@ -10898,6 +10853,15 @@ case "$valstd" in
 esac
 case "$val" in
 '')
+       echo " "
+       echo "*** WHOA THERE!!! ***" >&4
+       echo "    Your C compiler \"$cc\" doesn't seem to support stdarg or varargs!" >&4
+       case "$knowitall" in
+       '')
+       echo "    I'm giving up; maybe you can try again with a different compiler?" >&4
+               exit 1
+               ;;
+       esac
 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
@@ -11369,24 +11333,132 @@ set d_sockaddr_sa_len; 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]'`
-       $cat >try.c <<EOF
+echo "Checking the availability struct sockaddr_in6 ..." >&4
+$cat >try.c <<EOF
 #include <sys/types.h>
 #include <sys/socket.h>
+#include <netinet/in.h>
 int main() {
-    int i = $ENUM;
+struct sockaddr_in6 sin6;
+return (sin6.sin6_family);
 }
 EOF
-       val="$undef"
-       set try; if eval $compile; then
-               val="$define"
-       fi
-       set d_${enum}; eval $setvar
-       $rm_try
-done
-
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sockaddr_in6; eval $setvar
+$rm_try
+
+echo " "
+echo "Checking the availability sin6_scope_id in struct sockaddr_in6 ..." >&4
+$cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct sockaddr_in6 sin6;
+return (sin6.sin6_scope_id);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+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>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ip_mreq mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+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>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ip_mreq_source mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+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>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ipv6_mreq mreq;
+return (mreq.ipv6mr_interface);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+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>
+#include <sys/socket.h>
+#include <netinet/in.h>
+int main() {
+struct ipv6_mreq_source mreq;
+return (mreq.imr_multiaddr.s_addr);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+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]'`
+       $cat >try.c <<EOF
+#include <sys/types.h>
+#include <sys/socket.h>
+int main() {
+    int i = $ENUM;
+}
+EOF
+       val="$undef"
+       set try; if eval $compile; then
+               val="$define"
+       fi
+       set d_${enum}; eval $setvar
+       $rm_try
+done
+
 : see if this is a sys/uio.h system
 set sys/uio.h i_sysuio
 eval $inhdr
@@ -11846,7 +11918,7 @@ $cat >dirfd.c <<EOM
 #endif
 #endif
 #endif
-#endif 
+#endif
 int main() {
        DIR *dirp = opendir(".");
        if (dirfd(dirp) >= 0)
@@ -12349,7 +12421,7 @@ $define)
        $rm -f $$.h
        ;;
 *)
-       val="$undef"; 
+       val="$undef";
        set d_pwquota; eval $setvar
        set d_pwage; eval $setvar
        set d_pwchange; eval $setvar
@@ -14983,6 +15055,30 @@ set d_isascii
 eval $setvar
 $rm -f isascii*
 
+: Look for isblank
+echo " "
+$cat >isblank.c <<'EOCP'
+#include <stdio.h>
+#include <ctype.h>
+int main() {
+       int c = ' ';
+       if (isblank(c))
+               return 0 ;
+       else
+               return 1 ;
+}
+EOCP
+if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
+       echo "isblank() found." >&4
+       val="$define"
+else
+       echo "isblank() NOT found." >&4
+       val="$undef"
+fi
+set d_isblank
+eval $setvar
+$rm -f isblank*
+
 : see if isfinite exists
 set isfinite d_isfinite
 eval $inlibc
@@ -15608,7 +15704,7 @@ int main() {
 #endif
 #ifdef INT16
    int16_t i =  INT16_MAX;
-  uint16_t i = UINT16_MAX;
+  uint16_t u = UINT16_MAX;
   printf("int16_t\n");
 #endif
 #ifdef INT32
@@ -16101,23 +16197,24 @@ echo " "
 procselfexe=''
 val="$undef"
 case "$d_readlink" in
-"$define")
-       if $issymlink /proc/self/exe ; then
-               $ls -l /proc/self/exe > reflect
+    "$define")
+       : 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
+           shift; shift
+           if $issymlink $try; then
+               $ls -l $try > reflect
                if $contains /`basename $ls` reflect >/dev/null 2>&1; then
-                       echo "You have Linux-like /proc/self/exe."
-                       procselfexe='"/proc/self/exe"'
-                       val="$define"
-               fi
-       fi
-       if $issymlink /proc/curproc/file ; then
-               $ls -l /proc/curproc/file > reflect
-               if $contains /`basename $ls` reflect >/dev/null 2>&1; then
-                       echo "You have BSD-like /proc/curproc/file."
-                       procselfexe='"/proc/curproc/file"'
-                       val="$define"
+                   echo "You have $type-like $try."
+                   procselfexe='"'$try'"'
+                   val="$define"
+                   : This will break out of the loop
+                   set X; shift
                fi
-       fi
+           fi
+       done
        ;;
 esac
 $rm -f reflect
@@ -17347,17 +17444,10 @@ $define)
        *) dflt='n';;
        esac
        echo "$package can use the sfio library, but it is experimental."
-       case "$useperlio" in
-       "$undef")
-           echo "For sfio also the PerlIO abstraction layer is needed."
-           echo "Earlier you said you wouldn't want that."
-           ;;
-       esac
        rp="You seem to have sfio available, do you want to try using it?"
        . ./myread
        case "$ans" in
-       y|Y)    echo "Ok, turning on both sfio and PerlIO, then."
-               useperlio="$define"
+       y|Y)    echo "Ok, turning on sfio then."
                val="$define"
                ;;
        *)      echo "Ok, avoiding sfio this time.  I'll use stdio instead."
@@ -17502,7 +17592,7 @@ EOP
        if eval $compile_ok; then
                val="$define"
        else
-               echo "But you don't seem to have a useable struct sigaction." >&4
+               echo "But you don't seem to have a usable struct sigaction." >&4
                val="$undef"
        fi
 else
@@ -17937,7 +18027,7 @@ EOCP
 # Respect a hint (or previous) value for perl_static_inline, if there is one.
 case "$perl_static_inline" in
 '')    # Check the various possibilities, and break out on success.
-       # For gcc, prefer __inline__, which will still permit 
+       # For gcc, prefer __inline__, which will still permit
        # cflags.SH to add in -ansi.
        case "$gccversion" in
                '') xxx="inline __inline__ __inline _inline";;
@@ -18067,11 +18157,11 @@ if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
                echo 'strerror() found.' >&4
                d_strerror="$define"
                d_strerrm='strerror(e)'
-               if set sys_errlist val -a d_syserrlst; eval $csym; $val; then   
-                       echo "(You also have sys_errlist[], so we could roll our own strerror.)" 
+               if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
+                       echo "(You also have sys_errlist[], so we could roll our own strerror.)"
                        d_syserrlst="$define"
                else
-                       echo "(Since you don't have sys_errlist[], sterror() is welcome.)"
+                       echo "(Since you don't have sys_errlist[], strerror() is welcome.)"
                        d_syserrlst="$undef"
                fi
     elif xxx=`./findhdr string.h`; test "$xxx" || xxx=`./findhdr strings.h`; \
@@ -18079,7 +18169,7 @@ if test "X$d_strerror" = X -o "X$d_syserrlst" = X; then
                echo 'strerror() found in string header.' >&4
                d_strerror="$define"
                d_strerrm='strerror(e)'
-               if set sys_errlist val -a d_syserrlst; eval $csym; $val; then   
+               if set sys_errlist val -a d_syserrlst; eval $csym; $val; then
                        echo "(Most probably, strerror() uses sys_errlist[] for descriptions.)"
                                d_syserrlst="$define"
                else
@@ -18617,7 +18707,7 @@ eval $setvar
 
 : Check if is a multiplatform env
 case "$osname" in
-next|rhapsody|darwin) multiarch="$define" ;;
+next|darwin) multiarch="$define" ;;
 esac
 case "$multiarch" in
 ''|[nN]*) multiarch="$undef" ;;
@@ -18706,7 +18796,7 @@ EOM
        ;;
 esac
 
-: Checking 32bit aligndness
+: Checking 32bit alignedness
 $cat <<EOM
 
 Checking to see whether you can access character data unalignedly...
@@ -18927,11 +19017,10 @@ Revision='$Revision'
 
 : check for alignment requirements
 echo " "
-case "$usecrosscompile$multiarch" in
+case "$usecrosscompile" in
 *$define*)
        $cat <<EOM
-You seem to be either cross-compiling or doing a multiarchitecture build,
-skipping the memory alignment check.
+You seem to be cross-compiling.  Skipping the memory alignment check.
 
 EOM
        case "$alignbytes" in
@@ -18969,6 +19058,17 @@ EOCP
                        dflt='8'
                        echo "(I can't seem to compile the test program...)"
                fi
+               case "$multiarch" in
+               *$define*)
+                       : The usual safe value is 8, but Darwin with -Duselongdouble
+                       : needs 16.  Hence, we will take 8 as a minimum, but allow
+                       : Configure to pick a larger value if needed.
+                       if $test "$dflt" -lt 8; then
+                           dflt='8'
+                               echo "Setting alignment to 8 for multiarch support.">&4
+                       fi
+                       ;;
+               esac
                ;;
        *) dflt="$alignbytes"
                ;;
@@ -18984,7 +19084,40 @@ esac
 : set the base revision
 baserev=5.0
 
-: length of character in bytes. Is always 1, otherwise it isnt C
+: Determine if this is an EBCDIC system
+echo " "
+echo "Determining whether or not we are on an EBCDIC system..." >&4
+$cat >try.c <<'EOM'
+int main()
+{
+  if ('M'==0xd4) return 0;
+  return 1;
+}
+EOM
+
+case "$BOOTSTRAP_CHARSET" in
+    Y|y|define) bootstrap_charset=$define      ;;
+    *)         bootstrap_charset=$undef        ;;
+esac
+
+val=$undef
+set try
+if eval $compile_ok; then
+       if $run ./try; then
+               echo "You seem to speak EBCDIC." >&4
+               val="$define"
+       else
+               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
+       fi
+else
+       echo "I'm unable to compile the test program." >&4
+       echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
+fi
+$rm_try
+set ebcdic
+eval $setvar
+
+: length of character in bytes. Is always 1, otherwise it is not C
 : This used to be a test using sizeof
 charsize=1
 
@@ -19253,26 +19386,7 @@ esac
 
 : How can we generate normalized random numbers ?
 echo " "
-echo "Looking for a random number function..." >&4
-case "$randfunc" in
-'')
-       if set drand48 val -f; eval $csym; $val; then
-               dflt="drand48"
-               echo "Good, found drand48()." >&4
-       elif set random val -f; eval $csym; $val; then
-               dflt="random"
-               echo "OK, found random()." >&4
-       else
-               dflt="rand"
-               echo "Yick, looks like I have to use rand()." >&4
-       fi
-       echo " "
-       ;;
-*)
-       dflt="$randfunc"
-       ;;
-esac
-cont=true
+echo "Using our internal random number implementation..." >&4
 
 case "$ccflags" in
 *-Dmy_rand=*|*-Dmy_srand=*)
@@ -19283,131 +19397,11 @@ case "$ccflags" in
        ;;
 esac
 
-while $test "$cont"; do
-       rp="Use which function to generate random numbers?"
-       . ./myread
-       if $test "$ans" = "$dflt"; then
-               : null
-       else
-               randbits=''
-       fi
-       randfunc="$ans"
-       if set $ans val -f; eval $csym; $val; then
-               cont=''
-       else
-               dflt=y
-               rp="I cannot find function $ans. Use that name anyway?"
-               . ./myread
-               dflt=rand
-               case "$ans" in
-                       [yY]*) cont='';;
-               esac
-       fi
-       case "$cont" in
-       '')
-               case "$randfunc" in
-               drand48)
-                       drand01="drand48()"
-                       seedfunc="srand48"
-                       randbits=48
-                       randseedtype=long
-                       ;;
-               rand|random)
-                       case "$randbits" in
-                       '')
-echo "Checking to see how many bits your $randfunc() function produces..." >&4
-                               $cat >try.c <<EOCP
-#$i_unistd I_UNISTD
-#$i_stdlib I_STDLIB
-#include <stdio.h>
-#ifdef I_UNISTD
-#  include <unistd.h>
-#endif
-#ifdef I_STDLIB
-#  include <stdlib.h>
-#endif
-int main()
-{
-       register int i;
-       register unsigned long tmp;
-       register unsigned long max = 0L;
-
-       for (i = 1000; i; i--) {
-               tmp = (unsigned long) $randfunc();
-               if (tmp > max) max = tmp;
-       }
-       for (i = 0; max; i++)
-               max /= 2;
-       printf("%d\n",i);
-}
-EOCP
-                               set try
-                               if eval $compile_ok; then
-                                       dflt=`try`
-                               else
-                                       dflt='?'
-                                       echo "(I can't seem to compile the test program...)"
-                               fi
-                               ;;
-                       *)
-                               dflt="$randbits"
-                               ;;
-                       esac
-                       rp="How many bits does your $randfunc() function produce?"
-                       . ./myread
-                       randbits="$ans"
-                       $rm_try
-                       drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
-                       seedfunc="s$randfunc"
-                       randseedtype=unsigned
-                       ;;
-               *)
-                       dflt="31"
-                       rp="How many bits does your $randfunc() function produce?"
-                       . ./myread
-                       randbits="$ans"
-                       seedfunc="s$randfunc"
-                       drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
-                       if set $seedfunc val -f; eval $csym; $val; then
-                               echo "(Using $seedfunc() to seed random generator)"
-                       else
-                               echo "(Warning: no $seedfunc() to seed random generator)"
-                               seedfunc=rand
-                       fi
-                       randseedtype=unsigned
-                       ;;
-               esac
-               ;;
-       esac
-done
-
-: Determine if this is an EBCDIC system
-echo " "
-echo "Determining whether or not we are on an EBCDIC system..." >&4
-$cat >try.c <<'EOM'
-int main()
-{
-  if ('M'==0xd4) return 0;
-  return 1;
-}
-EOM
-
-val=$undef
-set try
-if eval $compile_ok; then
-       if $run ./try; then
-               echo "You seem to speak EBCDIC." >&4
-               val="$define"
-       else
-               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF-8." >&4
-       fi
-else
-       echo "I'm unable to compile the test program." >&4
-       echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
-fi
-$rm_try
-set ebcdic
-eval $setvar
+randfunc=Perl_drand48
+drand01="Perl_drand48()"
+seedfunc="Perl_drand48_init"
+randbits=48
+randseedtype=U32
 
 : Check how to flush
 echo " "
@@ -19512,7 +19506,7 @@ if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
        ;;
     esac
 fi
-: check for fflush NULL behaviour
+: check for fflush NULL behavior
 case "$fflushNULL" in
 '')    set try -DTRY_FFLUSH_NULL $output
        if eval $compile; then
@@ -20210,6 +20204,7 @@ EOCP
        $rm_try
        ;;
 *)     echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
+       need_va_copy="$undef"
        ;;
 esac
 
@@ -20367,9 +20362,9 @@ case "$pager" in
        esac
        ;;
 *)     dflt="$pager"
-       fn="f/($pager)"
        ;;
 esac
+fn="f/($dflt)"
 echo " "
 rp='What pager is used on your system?'
 . ./getfile
@@ -21183,6 +21178,74 @@ EOM
 fi
 $rm_try
 
+: Check the size of st_ino
+$echo " "
+$echo "Checking the size of st_ino..." >&4
+$cat > try.c <<EOCP
+#include <sys/stat.h>
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+int main() {
+    struct stat st;
+    printf("%d\n", (int)sizeof(st.st_ino));
+    exit(0);
+}
+EOCP
+set try
+if eval $compile_ok; then
+       val=`$run ./try`
+       case "$val" in
+       '')     st_ino_size=4
+               $echo "(I can't execute the test program--guessing $st_ino_size.)" >&4
+               ;;
+       *)      st_ino_size=$val
+               $echo "Your st_ino is $st_ino_size bytes long."
+               ;;
+       esac
+else
+       st_ino_size=4
+       $echo "(I can't compile the test program--guessing $st_ino_size.)" >&4
+fi
+$rm_try
+
+: Check if st_ino is signed
+$echo " "
+$echo "Checking the sign of st_ino..." >&4
+$cat > try.c <<EOCP
+#include <sys/stat.h>
+#include <stdio.h>
+int main() {
+       struct stat foo;
+        foo.st_ino = -1;
+       if (foo.st_ino < 0)
+               printf("-1\n");
+       else
+               printf("1\n");
+}
+EOCP
+set try
+if eval $compile; then
+       val=`$run ./try`
+       case "$val" in
+       '')     st_ino_sign=1
+               $echo "(I can't execute the test program--guessing unsigned.)" >&4
+               ;;
+       *)      st_ino_sign=$val
+               case "$st_ino_sign" in
+                1) $echo "Your st_ino is unsigned." ;;
+               -1) $echo "Your st_ino is signed."   ;;
+               esac
+               ;;
+       esac
+else
+       st_ino_sign=1
+       $echo "(I can't compile the test program--guessing unsigned.)" >&4
+fi
+$rm_try
+
 : see what type of char stdio uses.
 echo " "
 echo '#include <stdio.h>' | $cppstdin $cppminus > stdioh
@@ -21331,6 +21394,221 @@ case "$uidsign" in
        ;;
 esac
 
+: Determine if we can use sysctl with KERN_PROC_PATHNAME to find executing program
+echo " "
+echo "Determining whether we can use sysctl with KERN_PROC_PATHNAME to find executing program..." >&4
+$cat >try.c <<'EOM'
+/* Intentionally a long probe as I'd like to sanity check that the exact
+   approach is going to work, as thinking it will work, but only having it
+   part working at runtime is worse than not having it.  */
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/param.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+int
+main(int argc, char **argv) {
+    char *buffer;
+    char *argv_leaf = strrchr(argv[0], '/');
+    char *buffer_leaf;
+    size_t size = 0;
+    int mib[4];
+
+    mib[0] = CTL_KERN;
+    mib[1] = KERN_PROC;
+    mib[2] = KERN_PROC_PATHNAME;
+    mib[3] = -1;
+
+    if (!argv_leaf) {
+       fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
+       return 1;
+    }
+
+    if (sysctl(mib, 4, NULL, &size, NULL, 0)) {
+       perror("sysctl");
+       return 2;
+    }
+
+    if (size < strlen(argv_leaf) + 1) {
+       fprintf(stderr, "size %lu is too short for a path\n",
+               (unsigned long) size);
+       return 3;
+    }
+
+    if (size > MAXPATHLEN * MAXPATHLEN) {
+       fprintf(stderr, "size %lu is too long for a path\n",
+               (unsigned long) size);
+       return 4;
+    }
+
+    buffer = malloc(size);
+    if (!buffer) {
+       perror("malloc");
+       return 5;
+    }
+
+    if (sysctl(mib, 4, buffer, &size, NULL, 0)) {
+       perror("sysctl");
+       return 6;
+    }
+
+    if (strlen(buffer) + 1 != size) {
+       fprintf(stderr, "size != strlen(buffer) + 1 (%lu != %lu)\n",
+               (unsigned long)size, (unsigned long)strlen(buffer) + 1);
+        return 7;
+    }
+
+
+    if (*buffer != '/') {
+       fprintf(stderr, "Not an absolute path: '%s'\n", buffer);
+       return 8;
+    }
+
+    if (strstr(buffer, "/./")) {
+       fprintf(stderr, "Contains /./: '%s'\n", buffer);
+       return 9;
+    }
+
+    if (strstr(buffer, "/../")) {
+       fprintf(stderr, "Contains /../: '%s'\n", buffer);
+       return 10;
+    }
+
+    buffer_leaf = strrchr(buffer, '/');
+    if (strcmp(buffer_leaf, argv_leaf) != 0) {
+       fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], buffer);
+       return 11;
+    }
+
+    free(buffer);
+
+    return 0;
+}
+EOM
+
+val=$undef
+set try
+if eval $compile; then
+       if $run ./try; then
+               echo "You can use sysctl with KERN_PROC_PATHNAME to find the executing program." >&4
+               val="$define"
+       else
+               echo "Nope, sysctl with KERN_PROC_PATHNAME doesn't work here." >&4
+               val="$undef"
+       fi
+else
+       echo "I'm unable to compile the test program." >&4
+       echo "I'll assume no sysctl with KERN_PROC_PATHNAME here." >&4
+       val="$undef"
+fi
+$rm_try
+set usekernprocpathname
+eval $setvar
+
+: Determine if we can use _NSGetExecutablePath to find executing program
+echo " "
+echo "Determining whether we can use _NSGetExecutablePath to find executing program..." >&4
+$cat >try.c <<'EOM'
+/* Intentionally a long probe as I'd like to sanity check that the exact
+   approach is going to work, as thinking it will work, but only having it
+   part working at runtime is worse than not having it.  */
+#include <mach-o/dyld.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/param.h>
+#include <string.h>
+
+int
+main(int argc, char **argv) {
+    char buf[1];
+    uint32_t size = sizeof(buf);
+    int result;
+    char *buffer;
+    char *tidied;
+    char *argv_leaf = strrchr(argv[0], '/');
+    char *tidied_leaf;
+
+    if (!argv_leaf) {
+       fprintf(stderr, "Can't locate / in '%s'\n", argv[0]);
+       return 1;
+    }
+
+    _NSGetExecutablePath(buf, &size);
+    if (size > MAXPATHLEN * MAXPATHLEN) {
+       fprintf(stderr, "_NSGetExecutablePath size %u is too long for a path\n",
+               (unsigned int) size);
+       return 2;
+    }
+
+    buffer = malloc(size);
+    if (!buffer) {
+       perror("malloc");
+       return 3;
+    }
+
+    result = _NSGetExecutablePath(buffer, &size);
+    if (result != 0) {
+       fprintf(stderr, "_NSGetExecutablePath returned %i for a size of %u\n",
+               result, (unsigned int) size);
+       return 4;
+    }
+
+    tidied = realpath(buffer, NULL);
+    if (!tidied) {
+       perror("realpath");
+       return 5;
+    }
+
+    free(buffer);
+
+    if (*tidied != '/') {
+       fprintf(stderr, "Not an absolute path: '%s'\n", tidied);
+       return 6;
+    }
+
+    if (strstr(tidied, "/./")) {
+       fprintf(stderr, "Contains /./: '%s'\n", tidied);
+       return 7;
+    }
+
+    if (strstr(tidied, "/../")) {
+       fprintf(stderr, "Contains /../: '%s'\n", tidied);
+       return 8;
+    }
+
+    tidied_leaf = strrchr(tidied, '/');
+    if (strcmp(tidied_leaf, argv_leaf) != 0) {
+       fprintf(stderr, "Leafnames differ: '%s' vs '%s'\n", argv[0], tidied);
+       return 9;
+    }
+
+    free(tidied);
+
+    return 0;
+}
+EOM
+
+val=$undef
+set try
+if eval $compile; then
+       if $run ./try; then
+               echo "You can use _NSGetExecutablePath to find the executing program." >&4
+               val="$define"
+       else
+               echo "Nope, _NSGetExecutablePath doesn't work here." >&4
+       fi
+else
+       echo "I'm unable to compile the test program." >&4
+       echo "I'll assume no _NSGetExecutablePath here." >&4
+fi
+$rm_try
+set usensgetexecutablepath
+eval $setvar
+
 : Check if site customization support was requested
 case "$usesitecustomize" in
     $define|true|[Yy]*)
@@ -21381,7 +21659,7 @@ case "$yacc" in
        *-y*) ;;
        *)
                yacc="$yacc -y"
-               echo "(Adding -y option to bison to get yacc-compatible behaviour.)"
+               echo "(Adding -y option to bison to get yacc-compatible behavior.)"
                ;;
        esac
        ;;
@@ -21615,15 +21893,16 @@ $cc -o try -Dcpp_stuff=$cpp_stuff $optimize \$ccflags $ldflags try.c $libs && $r
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
-./Cppsym < Cppsym.know > Cppsym.true
-: Add in any linux cpp "predefined macros":
+./Cppsym < Cppsym.know | $sort | $uniq > Cppsym.true
+: Add in any Linux cpp "predefined macros":
 case "$osname::$gccversion" in
   *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
     tHdrH=_tmpHdr
     rm -f $tHdrH'.h' $tHdrH
     touch $tHdrH'.h'
+    # Filter out macro arguments, such as Linux's __INT8_C(c)
     if $cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
-       sed 's/#define[\ \  ]*//;s/[\ \     ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
+       sed -e 's/#define[\ \  ]*//;s/[\ \     ].*$//' -e 's/(.*//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
        if [ -s $tHdrH'_cppsym.real' ]; then
          cat $tHdrH'_cppsym.real' Cppsym.know | sort | uniq | ./Cppsym | sort | uniq > Cppsym.true
        fi
@@ -21760,6 +22039,35 @@ set i_termio; eval $setvar
 val=$val2; set i_sgtty; eval $setvar
 val=$val3; set i_termios; eval $setvar
 
+: see if stdbool is available
+: we want a real compile instead of Inhdr because some Solaris systems
+: have stdbool.h, but it can only be used if the compiler indicates it
+: is sufficiently c99-compliant.
+echo " "
+$cat >try.c <<EOCP
+#include <stdio.h>
+#include <stdbool.h>
+int func(bool x)
+{
+    return x ? 1 : 0;
+}
+int main(int argc, char **argv)
+{
+    return func(0);
+}
+EOCP
+set try
+if eval $compile; then
+       echo "<stdbool.h> found." >&4
+       val="$define"
+else
+       echo "<stdbool.h> NOT found." >&4
+       val="$undef"
+fi
+$rm_try
+set i_stdbool
+eval $setvar
+
 : see if stddef is available
 set stddef.h i_stddef
 eval $inhdr
@@ -21867,10 +22175,10 @@ esac
 : Check extensions
 echo " "
 echo "Looking for extensions..." >&4
-: If we are using the old config.sh, known_extensions may contain
-: old or inaccurate or duplicate values.
-known_extensions=''
+: If we are using the old config.sh, nonxs_extensions and xs_extensions may
+: contain old or inaccurate or duplicate values.
 nonxs_extensions=''
+xs_extensions=''
 : We do not use find because it might not be available.
 : We do not just use MANIFEST because the user may have dropped
 : some additional extensions into the source tree and expect them
@@ -21886,32 +22194,38 @@ find_extensions='
            DynaLoader|dynaload) ;;
            *)
            this_ext=`echo $xxx | $sed -e s/-/\\\//g`;
-           leaf=`echo $xxx | $sed -e s/.*-//`;
-           if $test -d File; then
-               if $test -f $xxx/$leaf.xs -o -f $xxx/$leaf.c; then
-                   known_extensions="$known_extensions $1$this_ext";
-               elif $test -f $xxx/Makefile.PL; then
-                   nonxs_extensions="$nonxs_extensions $1$this_ext";
-               else
-                   if $test -d $xxx -a $# -lt 10; then
-                       set $1$xxx/ $*;
-                       cd "$xxx";
-                       eval $find_extensions;
-                       cd ..;
-                       shift;
-                   fi;
-               fi;
-           else
-               $ls -1 $xxx > $$.tmp;
-               if   $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $contains "\.c$"  $$.tmp > /dev/null 2>&1; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $test -d $xxx; then
-                   nonxs_extensions="$nonxs_extensions $this_ext";
-               fi;
-               $rm -f $$.tmp;
-           fi
+            case "$this_ext" in
+                Scalar/List/Utils) this_ext="List/Util";;
+                PathTools)         this_ext="Cwd";;
+            esac;
+           echo " $xs_extensions $nonxs_extensions" > $$.tmp;
+           if $contains " $this_ext " $$.tmp; then
+               echo >&4;
+               echo "Duplicate directories detected for extension $xxx" >&4;
+               echo "Configure cannot correctly recover from this - shall I abort?" >&4;
+               case "$knowitall" in
+               "") dflt=y;;
+               *) dflt=n;;
+               esac;
+               . ../UU/myread;
+               case "$ans" in
+               n*|N*) ;;
+               *) echo >&4;
+                   echo "Ok.  Stopping Configure." >&4;
+                   echo "Please remove the duplicate directory (e.g. using git clean) and then re-run Configure" >&4;
+                   exit 1;;
+               esac;
+               echo "Ok.  You will need to correct config.sh before running make." >&4;
+           fi;
+           $ls -1 $xxx > $$.tmp;
+           if   $contains "\.xs$" $$.tmp > /dev/null 2>&1; then
+               xs_extensions="$xs_extensions $this_ext";
+           elif $contains "\.c$"  $$.tmp > /dev/null 2>&1; then
+               xs_extensions="$xs_extensions $this_ext";
+           elif $test -d $xxx; then
+               nonxs_extensions="$nonxs_extensions $this_ext";
+           fi;
+           $rm -f $$.tmp;
            ;;
        esac;
     done'
@@ -21928,27 +22242,18 @@ cd "$rsrc/ext"
 set X
 shift
 eval $find_extensions
-if $test -d File-Glob; then
-    : All ext/ flattened
-else
-    # Special case:  Add in modules that nest beyond the first level.
-    # Currently threads/shared and Hash/Util/FieldHash, since they are
-    # not picked up by the recursive find above (and adding in general
-    # recursive finding breaks SDBM_File/sdbm).
-    # A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
-    known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
-fi
-set X $known_extensions
+set X $xs_extensions
 shift
-known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
+xs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
 set X $nonxs_extensions
 shift
 nonxs_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
 cd "$tdir"
+known_extensions=`echo $nonxs_extensions $xs_extensions  | tr ' ' $trnl | $sort | tr $trnl ' '`
 
 : Now see which are supported on this system.
 avail_ext=''
-for xxx in $known_extensions ; do
+for xxx in $xs_extensions ; do
        case "$xxx" in
        DB_File|db_file)
                case "$i_db" in
@@ -22015,12 +22320,7 @@ for xxx in $known_extensions ; do
                ;;
        Socket|socket)
                case "$d_socket" in
-               true|$define|y)
-                   case "$osname" in
-                   beos) ;; # not unless BONE
-                   *) avail_ext="$avail_ext $xxx" ;;
-                   esac
-                   ;;
+               true|$define|y) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
        Sys/Syslog|sys/syslog)
@@ -22083,7 +22383,7 @@ avail_ext="$*"
 case "$onlyextensions" in
 '') ;;
 *)  keepextensions=''
-    echo "You have requested that only certains extensions be included..." >&4
+    echo "You have requested that only certain extensions be included..." >&4
     for i in $onlyextensions; do
         case " $avail_ext " in
         *" $i "*)
@@ -22118,6 +22418,8 @@ esac
 nonxs_ext=''
 for xxx in $nonxs_extensions ; do
        case "$xxx" in
+       VMS*)
+               ;;
        *)      nonxs_ext="$nonxs_ext $xxx"
                ;;
        esac
@@ -22256,6 +22558,7 @@ case " $static_ext " in
        cd "$rsrc/cpan"
        for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
                static_ext="$static_ext Encode/$xxx"
+               known_extensions="$known_extensions Encode/$xxx"
        done
        cd "$tdir"
        ;;
@@ -22291,7 +22594,7 @@ sunos*X4*)
     ;;
 *) case "$usedl" in
     $define|true|[yY]*)
-           set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` 
+           set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -lgdbm_compat @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'`
            shift
            perllibs="$*"
            ;;
@@ -22416,6 +22719,7 @@ bin='$bin'
 bin_ELF='$bin_ELF'
 binexp='$binexp'
 bison='$bison'
+bootstrap_charset='$bootstrap_charset'
 byacc='$byacc'
 byteorder='$byteorder'
 c='$c'
@@ -22653,7 +22957,12 @@ d_inetaton='$d_inetaton'
 d_inetntop='$d_inetntop'
 d_inetpton='$d_inetpton'
 d_int64_t='$d_int64_t'
+d_ip_mreq='$d_ip_mreq'
+d_ip_mreq_source='$d_ip_mreq_source'
+d_ipv6_mreq='$d_ipv6_mreq'
+d_ipv6_mreq_source='$d_ipv6_mreq_source'
 d_isascii='$d_isascii'
+d_isblank='$d_isblank'
 d_isfinite='$d_isfinite'
 d_isinf='$d_isinf'
 d_isnan='$d_isnan'
@@ -22814,8 +23123,10 @@ d_sigaction='$d_sigaction'
 d_signbit='$d_signbit'
 d_sigprocmask='$d_sigprocmask'
 d_sigsetjmp='$d_sigsetjmp'
+d_sin6_scope_id='$d_sin6_scope_id'
 d_sitearch='$d_sitearch'
 d_snprintf='$d_snprintf'
+d_sockaddr_in6='$d_sockaddr_in6'
 d_sockaddr_sa_len='$d_sockaddr_sa_len'
 d_sockatmark='$d_sockatmark'
 d_sockatmarkproto='$d_sockatmarkproto'
@@ -22913,7 +23224,6 @@ db_prefixtype='$db_prefixtype'
 db_version_major='$db_version_major'
 db_version_minor='$db_version_minor'
 db_version_patch='$db_version_patch'
-defvoidused='$defvoidused'
 direntrytype='$direntrytype'
 dlext='$dlext'
 dlsrc='$dlsrc'
@@ -23009,7 +23319,6 @@ i_crypt='$i_crypt'
 i_db='$i_db'
 i_dbm='$i_dbm'
 i_dirent='$i_dirent'
-i_dld='$i_dld'
 i_dlfcn='$i_dlfcn'
 i_fcntl='$i_fcntl'
 i_float='$i_float'
@@ -23046,6 +23355,7 @@ i_sgtty='$i_sgtty'
 i_shadow='$i_shadow'
 i_socks='$i_socks'
 i_stdarg='$i_stdarg'
+i_stdbool='$i_stdbool'
 i_stddef='$i_stddef'
 i_stdlib='$i_stdlib'
 i_string='$i_string'
@@ -23131,6 +23441,7 @@ ivtype='$ivtype'
 known_extensions='$known_extensions'
 ksh='$ksh'
 ld='$ld'
+ld_can_script='$ld_can_script'
 lddlflags='$lddlflags'
 ldflags='$ldflags'
 ldflags_uselargefiles='$ldflags_uselargefiles'
@@ -23342,6 +23653,8 @@ srand48_r_proto='$srand48_r_proto'
 srandom_r_proto='$srandom_r_proto'
 src='$src'
 ssizetype='$ssizetype'
+st_ino_sign='$st_ino_sign'
+st_ino_size='$st_ino_size'
 startperl='$startperl'
 startsh='$startsh'
 static_ext='$static_ext'
@@ -23396,6 +23709,7 @@ usedl='$usedl'
 usedtrace='$usedtrace'
 usefaststdio='$usefaststdio'
 useithreads='$useithreads'
+usekernprocpathname='$usekernprocpathname'
 uselargefiles='$uselargefiles'
 uselongdouble='$uselongdouble'
 usemallocwrap='$usemallocwrap'
@@ -23403,6 +23717,7 @@ usemorebits='$usemorebits'
 usemultiplicity='$usemultiplicity'
 usemymalloc='$usemymalloc'
 usenm='$usenm'
+usensgetexecutablepath='$usensgetexecutablepath'
 useopcode='$useopcode'
 useperlio='$useperlio'
 useposix='$useposix'
@@ -23414,6 +23729,7 @@ usesitecustomize='$usesitecustomize'
 usesocks='$usesocks'
 usethreads='$usethreads'
 usevendorprefix='$usevendorprefix'
+useversionedarchname='$useversionedarchname'
 usevfork='$usevfork'
 usrinc='$usrinc'
 uuname='$uuname'
@@ -23447,7 +23763,6 @@ version='$version'
 version_patchlevel_string='$version_patchlevel_string'
 versiononly='$versiononly'
 vi='$vi'
-voidflags='$voidflags'
 xlibpth='$xlibpth'
 yacc='$yacc'
 yaccflags='$yaccflags'
@@ -23467,16 +23782,16 @@ if $test -f UU/config.sh; then
        $sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' \
                config.sh config.sh UU/oldconfig.sh |\
                $sort | $uniq -u >UU/oldsyms
-       set X `cat UU/oldsyms`
+       set X `$cat UU/oldsyms`
        shift
        case $# in
        0) ;;
        *)
-               cat <<EOM
+               $cat <<EOM
 Hmm...You had some extra variables I don't know about...I'll try to keep 'em...
 EOM
                echo ": Variables propagated from previous config.sh file." >>config.sh
-               for sym in `cat UU/oldsyms`; do
+               for sym in `$cat UU/oldsyms`; do
                        echo "    Propagating $hint variable "'$'"$sym..."
                        eval 'tmp="$'"${sym}"'"'
                        echo "$tmp" | \