This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Remove Configure code that supported the old-style nested layout for ext/
[perl5.git] / Configure
index a4c3397..dbccc28 100755 (executable)
--- a/Configure
+++ b/Configure
 # 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
+# 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
 #
-# Though this script was generated by metaconfig, it is OK to send
-# patches against it. It's up to the Configure pumpkin to backport
-# the patch to the metaunits if it is accepted.
 # See Porting/pumpkin.pod for more information on metaconfig.
 #
 
-# $Id: Head.U 6 2006-08-25 22:21:46Z rmanfredi $
-#
-# Generated on Mon Oct 19 16:23:09 CEST 2009 [metaconfig 3.5 PL0]
+# Generated on Mon May 27 09:27:16 CEST 2013 [metaconfig 3.5 PL0]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >c1$$ <<EOF
@@ -53,7 +56,7 @@ true || exec sh $0 $argv:q
 rm -f c1$$ c2$$
 
 if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
-       cat >&4 <<EOF
+       cat <<EOF
 ***
 *** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
 *** Configure that well.  (Plan 9 is close to UNIX but not close enough.)
@@ -65,7 +68,7 @@ EOF
 fi
 
 if test ! -c /dev/null ; then
-       cat >&4 <<EOF
+       cat <<EOF
 ***
 *** I'm sorry, but /dev/null appears to be a file rather than a device.
 *** Please consult your operating sytem's notes for making a device
@@ -96,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
@@ -329,6 +332,7 @@ d_archlib=''
 installarchlib=''
 archname=''
 myarchname=''
+useversionedarchname=''
 d_atolf=''
 d_atoll=''
 baserev=''
@@ -348,6 +352,8 @@ optimize=''
 cf_email=''
 cf_by=''
 cf_time=''
+charbits=''
+charsize=''
 contains=''
 cpp_stuff=''
 cpplast=''
@@ -560,6 +566,7 @@ d_inetntop=''
 d_inetpton=''
 d_int64_t=''
 d_isascii=''
+d_isblank=''
 d_isfinite=''
 d_isinf=''
 d_isnan=''
@@ -621,6 +628,8 @@ d_pause=''
 d_pipe=''
 d_poll=''
 d_portable=''
+d_prctl=''
+d_prctl_set_name=''
 d_procselfexe=''
 procselfexe=''
 d_old_pthread_create_joinable=''
@@ -715,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=''
@@ -722,6 +735,9 @@ 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=''
 sockethdr=''
@@ -739,6 +755,8 @@ d_sresuproto=''
 d_statblks=''
 d_statfs_f_flags=''
 d_statfs_s=''
+d_static_inline=''
+perl_static_inline=''
 d_fstatvfs=''
 d_statvfs=''
 d_stdio_cnt_lval=''
@@ -829,9 +847,11 @@ cccdlflags=''
 ccdlflags=''
 dlsrc=''
 ld=''
+ld_can_script=''
 lddlflags=''
 usedl=''
 doublesize=''
+bootstrap_charset=''
 ebcdic=''
 fflushNULL=''
 fflushall=''
@@ -915,6 +935,7 @@ i_pwd=''
 i_sfio=''
 i_shadow=''
 i_socks=''
+i_stdbool=''
 i_stddef=''
 i_stdlib=''
 i_string=''
@@ -1183,6 +1204,8 @@ shsharp=''
 spitshell=''
 src=''
 ssizetype=''
+st_ino_sign=''
+st_ino_size=''
 startperl=''
 startsh=''
 stdchar=''
@@ -1204,6 +1227,7 @@ use64bitint=''
 dtrace=''
 usedtrace=''
 usefaststdio=''
+usekernprocpathname=''
 ccflags_uselargefiles=''
 ldflags_uselargefiles=''
 libswanted_uselargefiles=''
@@ -1215,6 +1239,7 @@ nm_opt=''
 nm_so_opt=''
 runnm=''
 usenm=''
+usensgetexecutablepath=''
 useperlio=''
 usesocks=''
 d_oldpthreads=''
@@ -1225,6 +1250,7 @@ usethreads=''
 incpath=''
 mips_type=''
 usrinc=''
+vaproto=''
 d_vendorarch=''
 installvendorarch=''
 vendorarch=''
@@ -1300,6 +1326,18 @@ i_whoami=''
 : Extra object files, if any, needed on this platform.
 archobjs=''
 archname=''
+: Possible local include directories to search.
+: Set locincpth to "" in a hint file to defeat local include searches.
+locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
+: Enable -DEBUGGING and -DDEBUGGING from the command line
+EBUGGING=''
+DEBUGGING=''
+
 libnames=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
@@ -1328,18 +1366,6 @@ usereentrant='undef'
 : full support for void wanted by default
 defvoidused=15
 
-: Possible local include directories to search.
-: Set locincpth to "" in a hint file to defeat local include searches.
-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
-:
-: no include file wanted by default
-inclwanted=''
-
-: Enable -DEBUGGING and -DDEBUGGING from the command line
-EBUGGING=''
-DEBUGGING=old
-
 ccname=''
 ccversion=''
 perllibs=''
@@ -1399,10 +1425,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
@@ -2241,7 +2267,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.
 
@@ -2361,6 +2387,7 @@ make
 more
 nm
 nroff
+perl
 pg
 test
 uname
@@ -2437,6 +2464,15 @@ egrep)
        _egrep=$grep
        ;;
 esac
+case "$less" in
+'')    ;;
+*)     if $less -R </dev/null >/dev/null; then
+              echo "Substituting less -R for less."
+              less="$less -R"
+              _less=$less
+       fi
+       ;;
+esac
 case "$ln" in
 ln)
        echo "Substituting cp for ln."
@@ -2677,7 +2713,7 @@ case "$lns" in
                                ;;
                        *)      issymlink='' ;;
                        esac
-               fi              
+               fi
        fi
        if $test "X$issymlink" = X; then
                if $test -L sym 2>/dev/null; then
@@ -3066,9 +3102,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
@@ -3953,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
@@ -4049,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
@@ -4141,11 +4110,6 @@ else
        perl_patchlevel=0
        $echo "(You do not have patchlevel.h.  Eek.)"
 fi
-if $test -r $rsrc/.patch ; then
-       if $test "X$perl_patchlevel" = "X" || $test "`cat $rsrc/.patch`" -gt "$perl_patchlevel" ; then
-               perl_patchlevel=`cat $rsrc/.patch`
-       fi
-fi
 : Define a handy string here to avoid duplication in myconfig.SH and configpm.
 version_patchlevel_string="version $patchlevel subversion $subversion"
 case "$perl_patchlevel" in
@@ -4184,13 +4148,8 @@ $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
@@ -4292,16 +4251,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" ;;
@@ -4877,6 +4826,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" ;;
@@ -5292,10 +5263,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
@@ -6052,6 +6023,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
@@ -6118,21 +6115,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
@@ -6830,6 +6812,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?"
@@ -6965,7 +6948,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
@@ -7057,9 +7040,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
@@ -7077,7 +7060,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
@@ -7135,6 +7118,8 @@ esac
 
 : DTrace support
 dflt_dtrace='/usr/sbin/dtrace'
+$test -x /usr/bin/dtrace && dflt_dtrace='/usr/bin/dtrace'
+
 cat <<EOM
 
 Perl can be built to support DTrace on platforms that support it.
@@ -7412,11 +7397,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
                ;;
@@ -7651,7 +7636,7 @@ $echo $n ".$c"
 $grep fprintf libc.tmp > libc.ptf
 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
 xrun='eval "<libc.tmp $com >libc.list"; echo "done." >&4'
-xxx='[ADTSIW]'
+xxx='[ADTSIWi]'
 if com="$sed -n -e 's/__IO//' -e 's/^.* $xxx  *//p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
@@ -7996,8 +7981,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
@@ -8014,22 +8000,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"
                ;;
@@ -8050,7 +8040,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
@@ -8059,7 +8048,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' ;;
@@ -8136,6 +8139,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
@@ -8145,7 +8176,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.'
                        ;;
@@ -8307,7 +8338,7 @@ if "$useshrplib"; then
        solaris)
                xxx="-R $shrpdir"
                ;;
-       freebsd|netbsd|openbsd|interix|dragonfly)
+       freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
                xxx="-Wl,-R$shrpdir"
                ;;
        bsdos|linux|irix*|dec_osf|gnu*)
@@ -8316,9 +8347,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.
                ;;
@@ -8370,7 +8398,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"
@@ -8853,9 +8881,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
@@ -9391,6 +9429,9 @@ EOCP
        ;;
 esac
 
+: Check if we want perlio
+useperlio="$define"
+
 : Set the vendorbin variables
 case "$vendorprefix" in
 '')    d_vendorbin="$undef"
@@ -9878,7 +9919,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
@@ -10039,7 +10080,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"
@@ -10810,7 +10851,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
@@ -10862,6 +10903,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
@@ -10878,6 +10920,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
@@ -11332,71 +11383,196 @@ eval $inlibc
 
 
 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 sa_len in the sock struct ..." >&4
+$cat >try.c <<EOF
 #include <sys/types.h>
 #include <sys/socket.h>
 int main() {
-    int i = $ENUM;
+struct sockaddr sa;
+return (sa.sa_len);
 }
 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
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sockaddr_sa_len; eval $setvar
+$rm_try
 
-: Check for cmsghdr support
 echo " "
-echo "Checking to see if your system supports struct cmsghdr..." >&4
-set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
-eval $hasstruct
-case "$d_cmsghdr_s" in
-"$define")      echo "Yes, it does."   ;;
-*)              echo "No, it doesn't." ;;
-esac
-
+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() {
+struct sockaddr_in6 sin6;
+return (sin6.sin6_family);
+}
+EOF
+val="$undef"
+set try; if eval $compile; then
+       val="$define"
+fi
+set d_sockaddr_in6; eval $setvar
+$rm_try
 
-: check for const keyword
 echo " "
-echo 'Checking to see if your C compiler knows about "const"...' >&4
-$cat >const.c <<'EOCP'
-typedef struct spug { int drokk; } spug;
-int main()
-{
-       const char *foo;
-       const spug y = { 0 };
+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);
 }
-EOCP
-if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
+EOF
+val="$undef"
+set try; if eval $compile; then
        val="$define"
-       echo "Yup, it does."
-else
-       val="$undef"
-       echo "Nope, it doesn't."
 fi
-set d_const
-eval $setvar
-
-: see if copysignl exists
-set copysignl d_copysignl
-eval $inlibc
+set d_sin6_scope_id; eval $setvar
+$rm_try
 
-: see if crypt exists
 echo " "
-set crypt d_crypt
-eval $inlibc
-case "$d_crypt" in
-$define) cryptlib='' ;;
-*)     if set crypt val -f d_crypt; eval $csym; $val; then
+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
+
+: Check for cmsghdr support
+echo " "
+echo "Checking to see if your system supports struct cmsghdr..." >&4
+set d_cmsghdr_s cmsghdr $i_systypes sys/types.h $d_socket sys/socket.h $i_sysuio sys/uio.h
+eval $hasstruct
+case "$d_cmsghdr_s" in
+"$define")      echo "Yes, it does."   ;;
+*)              echo "No, it doesn't." ;;
+esac
+
+
+: check for const keyword
+echo " "
+echo 'Checking to see if your C compiler knows about "const"...' >&4
+$cat >const.c <<'EOCP'
+typedef struct spug { int drokk; } spug;
+int main()
+{
+       const char *foo;
+       const spug y = { 0 };
+}
+EOCP
+if $cc -c $ccflags const.c >/dev/null 2>&1 ; then
+       val="$define"
+       echo "Yup, it does."
+else
+       val="$undef"
+       echo "Nope, it doesn't."
+fi
+set d_const
+eval $setvar
+
+: see if copysignl exists
+set copysignl d_copysignl
+eval $inlibc
+
+: see if crypt exists
+echo " "
+set crypt d_crypt
+eval $inlibc
+case "$d_crypt" in
+$define) cryptlib='' ;;
+*)     if set crypt val -f d_crypt; eval $csym; $val; then
                echo 'crypt() found.' >&4
                val="$define"
                cryptlib=''
@@ -11809,7 +11985,7 @@ $cat >dirfd.c <<EOM
 #endif
 #endif
 #endif
-#endif 
+#endif
 int main() {
        DIR *dirp = opendir(".");
        if (dirfd(dirp) >= 0)
@@ -12312,7 +12488,7 @@ $define)
        $rm -f $$.h
        ;;
 *)
-       val="$undef"; 
+       val="$undef";
        set d_pwquota; eval $setvar
        set d_pwage; eval $setvar
        set d_pwchange; eval $setvar
@@ -14946,6 +15122,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
@@ -16030,6 +16230,31 @@ eval $inlibc
 set poll d_poll
 eval $inlibc
 
+: see if prctl exists
+set prctl d_prctl
+eval $inlibc
+
+: see if prctl supports PR_SET_NAME
+d_prctl_set_name=$undef
+case $d_prctl in
+    $define)
+       $cat >try.c <<EOM
+#include <sys/prctl.h>
+
+int main (int argc, char *argv[])
+{
+    return (prctl (PR_SET_NAME, "Test"));
+    } /* main */
+EOM
+       set try
+       if eval $compile_ok && $run ./try; then
+           echo "Your prctl (PR_SET_NAME, ...) works"
+           d_prctl_set_name=$define
+           fi
+       $rm_try
+       ;;
+    esac
+
 : see if readlink exists
 set readlink d_readlink
 eval $inlibc
@@ -16039,23 +16264,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
@@ -17285,17 +17511,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."
@@ -17440,7 +17659,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
@@ -17828,6 +18047,112 @@ case "$d_statfs_f_flags" in
 *)              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..."
+$cat > try.c <<'EOCP'
+#include <stdlib.h>
+extern int f_via_a(int x);
+extern int f_via_b(int x);
+int main(int argc, char **argv)
+{
+    int y;
+
+    y = f_via_a(0);
+#ifdef USE_B
+    y = f_via_b(0);
+#endif
+    if (y == 42) {
+        return EXIT_SUCCESS;
+    }
+    else {
+        return EXIT_FAILURE;
+    }
+}
+EOCP
+$cat > a.c <<'EOCP'
+static INLINE int f(int x) {
+    int y;
+    y = x + 42;
+    return y;
+}
+
+int f_via_a(int x)
+{
+    return f(x);
+}
+EOCP
+$cat > b.c <<'EOCP'
+extern int f(int x);
+
+int f_via_b(int x)
+{
+    return f(x);
+}
+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
+       # cflags.SH to add in -ansi.
+       case "$gccversion" in
+               '') xxx="inline __inline__ __inline _inline";;
+               *)  xxx="__inline__ inline __inline _inline";;
+       esac
+       for inline in $xxx; do
+               set try -DINLINE=$inline a.c
+               if eval $compile && $run ./try; then
+                       # Now make sure there is no external linkage of static
+                       # functions
+                       set try -DINLINE=$inline -DUSE_B a.c b.c
+                       if eval $compile && $run ./try; then
+                               $echo "Your compiler supports static $inline, " >&4
+                               $echo "but it also creates an external definition," >&4
+                               $echo "so I won't use it." >&4
+                               val=$undef
+                       else
+                               $echo "Your compiler supports static $inline." >&4
+                               val=$define
+                               perl_static_inline="static $inline";
+                               break;
+                       fi
+               else
+                       $echo "Your compiler does NOT support static $inline." >&4
+                       val="$undef"
+               fi
+       done
+       ;;
+*inline*) # Some variant of inline exists.
+       echo "Keeping your $hint value of $perl_static_inline."
+       val=$define
+       ;;
+static)  # No inline capabilities
+       echo "Keeping your $hint value of $perl_static_inline."
+       val=$undef
+       ;;
+*)  # Unrecognized previous value -- blindly trust the supplied
+       # value and hope it makes sense.  Use old value for
+       # d_static_inline, if there is one.
+       echo "Keeping your $hint value of $perl_static_inline."
+       case "$d_static_inline" in
+               '') val=$define ;;
+               *)  val=$d_static_inline ;;
+       esac
+       ;;
+esac
+# Fallback to plain 'static' if nothing worked.
+case "$perl_static_inline" in
+'')
+       perl_static_inline="static"
+       val=$undef
+       ;;
+esac
+set d_static_inline
+eval $setvar
+$rm -f a.[co] b.[co]
+$rm_try
+
 : Check stream access
 $cat >&4 <<EOM
 Checking how to access stdio streams by file descriptor number...
@@ -17899,11 +18224,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`; \
@@ -17911,7 +18236,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
@@ -18449,7 +18774,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" ;;
@@ -18538,7 +18863,7 @@ EOM
        ;;
 esac
 
-: Checking 32bit aligndness
+: Checking 32bit alignedness
 $cat <<EOM
 
 Checking to see whether you can access character data unalignedly...
@@ -18559,8 +18884,8 @@ $signal_t bletch(int s) { exit(4); }
 #endif
 int main() {
 #if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
-    U8 buf[8];
-    U32 *up;
+    volatile U8 buf[8];
+    volatile U32 *up;
     int i;
 
     if (sizeof(U32) != 4) {
@@ -18759,11 +19084,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
@@ -18801,6 +19125,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"
                ;;
@@ -18816,6 +19151,89 @@ esac
 : set the base revision
 baserev=5.0
 
+: 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
+
+: Check for the number of bits in a character
+case "$charbits" in
+'')    echo "Checking how long a character is (in bits)..." >&4
+       $cat >try.c <<EOCP
+#include <stdio.h>
+int main ()
+{
+    int n;
+    unsigned char c;
+    for (c = 1, n = 0; c; c <<= 1, n++) ;
+    printf ("%d\n", n);
+    return (0);
+    }
+EOCP
+       set try
+       if eval $compile_ok; then
+               dflt=`$run ./try`
+       else
+               dflt='8'
+               echo "(I can't seem to compile the test program.  Guessing...)"
+       fi
+       ;;
+*)
+       dflt="$charbits"
+       ;;
+esac
+rp="What is the length of a character (in bits)?"
+. ./myread
+charbits="$ans"
+$rm_try
+case "$charbits" in
+8)     ;;
+*)     cat >&4 << EOM
+Your system has an unsigned character size of $charbits bits, which
+is rather unusual (normally it is 8 bits).  Perl likely will not work
+correctly on your system, with subtle bugs in various places.
+EOM
+       rp='Do you really want to continue?'
+       dflt='n'
+       . ./myread
+       case "$ans" in
+               [yY])   echo >&4 "Okay, continuing."    ;;
+               *)      exit 1                          ;;
+       esac
+esac
+
 : how do we concatenate cpp tokens here?
 echo " "
 echo "Checking to see how your cpp does stuff like concatenate tokens..." >&4
@@ -19046,7 +19464,7 @@ case "$randfunc" in
                echo "OK, found random()." >&4
        else
                dflt="rand"
-               echo "Yick, looks like I have to use rand()." >&4
+               echo "Yuck, looks like I have to use rand()." >&4
        fi
        echo " "
        ;;
@@ -19110,9 +19528,9 @@ echo "Checking to see how many bits your $randfunc() function produces..." >&4
 #endif
 int main()
 {
-       register int i;
-       register unsigned long tmp;
-       register unsigned long max = 0L;
+       int i;
+       unsigned long tmp;
+       unsigned long max = 0L;
 
        for (i = 1000; i; i--) {
                tmp = (unsigned long) $randfunc();
@@ -19163,34 +19581,6 @@ EOCP
        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
-
 : Check how to flush
 echo " "
 $cat >&4 <<EOM
@@ -19294,7 +19684,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
@@ -19992,6 +20382,7 @@ EOCP
        $rm_try
        ;;
 *)     echo "You don't have <stdarg.h>, not checking for va_copy()." >&4
+       need_va_copy="$undef"
        ;;
 esac
 
@@ -20149,9 +20540,9 @@ case "$pager" in
        esac
        ;;
 *)     dflt="$pager"
-       fn="f/($pager)"
        ;;
 esac
+fn="f/($dflt)"
 echo " "
 rp='What pager is used on your system?'
 . ./getfile
@@ -20965,6 +21356,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
@@ -21113,6 +21572,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]*)
@@ -21123,6 +21797,21 @@ case "$usesitecustomize" in
        ;;
     esac
 
+: see if prototypes support variable argument declarations
+echo " "
+case "$prototype$i_stdarg" in
+$define$define)
+       echo "It appears we'll be able to prototype varargs functions." >&4
+       val="$define"
+       ;;
+*)
+       echo "Too bad... We won't be using prototyped varargs functions..." >&4
+       val="$undef"
+       ;;
+esac
+set vaproto
+eval $setvar
+
 : determine compiler compiler
 case "$yacc" in
 '')
@@ -21148,7 +21837,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
        ;;
@@ -21382,15 +22071,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*::*.*)
+  *linux*::*.*|*gnukfreebsd*::*.*|gnu::*.*)
     tHdrH=_tmpHdr
     rm -f $tHdrH'.h' $tHdrH
     touch $tHdrH'.h'
-    if cpp -dM $tHdrH'.h' > $tHdrH'_cppsym.h' && [ -s $tHdrH'_cppsym.h' ]; then
-       sed 's/#define[\ \  ]*//;s/[\ \     ].*$//' <$tHdrH'_cppsym.h' >$tHdrH'_cppsym.real'
+    # 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 -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
@@ -21527,6 +22217,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
@@ -21646,43 +22365,41 @@ nonxs_extensions=''
 : Function to recursively find available extensions, ignoring DynaLoader
 : NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
 : In 5.10.1 and later, extensions are stored in directories
-: like File-Glob instead of the older File/Glob/.  In this scheme,
-: IO-Compress does not appear to be an XS extension, but we want
-: to install it as one.  A.D.  8/2009.
+: like File-Glob instead of the older File/Glob/.
 find_extensions='
     for xxx in *; do
        case "$xxx" in
            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 "$this_ext" = "IO/Compress"; then
-                   known_extensions="$known_extensions $this_ext";
-               elif $test -d $xxx; then
-                   nonxs_extensions="$nonxs_extensions $this_ext";
-               fi;
-               $rm -f $$.tmp;
-           fi
+           echo " $known_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
+               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;
            ;;
        esac;
     done'
@@ -21699,16 +22416,6 @@ 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
 shift
 known_extensions=`echo "$*" | tr ' ' $trnl | $sort | tr $trnl ' '`
@@ -21786,12 +22493,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)
@@ -21854,7 +22556,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 "*)
@@ -22024,7 +22726,7 @@ esac
 # the appropriate Makefile.PL.
 case " $static_ext " in
        *" Encode "*) # Add the subextensions of Encode
-       cd "$rsrc/ext"
+       cd "$rsrc/cpan"
        for xxx in `ls Encode/*/Makefile.PL|awk -F/ '{print $2}'`; do
                static_ext="$static_ext Encode/$xxx"
        done
@@ -22062,7 +22764,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="$*"
            ;;
@@ -22187,6 +22889,7 @@ bin='$bin'
 bin_ELF='$bin_ELF'
 binexp='$binexp'
 bison='$bison'
+bootstrap_charset='$bootstrap_charset'
 byacc='$byacc'
 byteorder='$byteorder'
 c='$c'
@@ -22203,6 +22906,8 @@ ccversion='$ccversion'
 cf_by='$cf_by'
 cf_email='$cf_email'
 cf_time='$cf_time'
+charbits='$charbits'
+charsize='$charsize'
 chgrp='$chgrp'
 chmod='$chmod'
 chown='$chown'
@@ -22422,7 +23127,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'
@@ -22496,6 +23206,8 @@ d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
 d_portable='$d_portable'
+d_prctl='$d_prctl'
+d_prctl_set_name='$d_prctl_set_name'
 d_printf_format_null='$d_printf_format_null'
 d_procselfexe='$d_procselfexe'
 d_pseudofork='$d_pseudofork'
@@ -22581,8 +23293,11 @@ 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'
 d_socket='$d_socket'
@@ -22598,6 +23313,7 @@ d_sresuproto='$d_sresuproto'
 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'
@@ -22811,6 +23527,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'
@@ -22896,6 +23613,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'
@@ -22994,6 +23712,7 @@ path_sep='$path_sep'
 perl5='$perl5'
 perl='$perl'
 perl_patchlevel='$perl_patchlevel'
+perl_static_inline='$perl_static_inline'
 perladmin='$perladmin'
 perllibs='$perllibs'
 perlpath='$perlpath'
@@ -23106,6 +23825,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'
@@ -23160,6 +23881,7 @@ usedl='$usedl'
 usedtrace='$usedtrace'
 usefaststdio='$usefaststdio'
 useithreads='$useithreads'
+usekernprocpathname='$usekernprocpathname'
 uselargefiles='$uselargefiles'
 uselongdouble='$uselongdouble'
 usemallocwrap='$usemallocwrap'
@@ -23167,6 +23889,7 @@ usemorebits='$usemorebits'
 usemultiplicity='$usemultiplicity'
 usemymalloc='$usemymalloc'
 usenm='$usenm'
+usensgetexecutablepath='$usensgetexecutablepath'
 useopcode='$useopcode'
 useperlio='$useperlio'
 useposix='$useposix'
@@ -23178,6 +23901,7 @@ usesitecustomize='$usesitecustomize'
 usesocks='$usesocks'
 usethreads='$usethreads'
 usevendorprefix='$usevendorprefix'
+useversionedarchname='$useversionedarchname'
 usevfork='$usevfork'
 usrinc='$usrinc'
 uuname='$uuname'
@@ -23187,6 +23911,7 @@ uvsize='$uvsize'
 uvtype='$uvtype'
 uvuformat='$uvuformat'
 uvxformat='$uvxformat'
+vaproto='$vaproto'
 vendorarch='$vendorarch'
 vendorarchexp='$vendorarchexp'
 vendorbin='$vendorbin'
@@ -23230,16 +23955,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" | \