add perlcompile.pod (edited content from Nathan Torkington
[p5sagit/p5-mst-13.2.git] / Configure
index 4a9ea70..4b55fa6 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Thu May 13 15:54:16 EET DST 1999 [metaconfig 3.0 PL70]
+# Generated on Mon Aug 30 22:33:03 EET DST 1999 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -278,10 +278,14 @@ d_archlib=''
 installarchlib=''
 archname=''
 myarchname=''
+d_atolf=''
+d_atoll=''
 baserev=''
 bin=''
 binexp=''
 installbin=''
+bincompat5005=''
+d_bincompat5005=''
 byteorder=''
 cc=''
 gccversion=''
@@ -338,6 +342,7 @@ d_endnent=''
 d_endpent=''
 d_endpwent=''
 d_endsent=''
+d_endspent=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
@@ -383,6 +388,8 @@ d_getprotoprotos=''
 d_getpwent=''
 d_getsent=''
 d_getservprotos=''
+d_getspent=''
+d_getspnam=''
 d_getsbyname=''
 d_getsbyport=''
 d_gnulibc=''
@@ -392,6 +399,7 @@ d_inetaton=''
 d_isascii=''
 d_killpg=''
 d_lchown=''
+d_ldbl_dig=''
 d_link=''
 d_locconv=''
 d_lockf=''
@@ -404,6 +412,7 @@ d_madvise=''
 d_mblen=''
 d_mbstowcs=''
 d_mbtowc=''
+d_memchr=''
 d_memcmp=''
 d_memcpy=''
 d_memmove=''
@@ -473,6 +482,7 @@ d_setrgid=''
 d_setruid=''
 d_setsent=''
 d_setsid=''
+d_setspent=''
 d_setvbuf=''
 d_sfio=''
 usesfio=''
@@ -556,13 +566,6 @@ d_waitpid=''
 d_wcstombs=''
 d_wctomb=''
 d_writev=''
-d_dbmclose64=''
-d_dbminit64=''
-d_delete64=''
-d_fetch64=''
-d_firstkey64=''
-d_nextkey64=''
-d_store64=''
 dlext=''
 cccdlflags=''
 ccdlflags=''
@@ -622,6 +625,8 @@ d_pwpasswd=''
 d_pwquota=''
 i_pwd=''
 i_sfio=''
+i_shadow=''
+i_socks=''
 i_stddef=''
 i_stdlib=''
 i_string=''
@@ -663,29 +668,18 @@ i_stdarg=''
 i_varargs=''
 i_varhdr=''
 i_vfork=''
+installprefix=''
+installprefixexp=''
+installstyle=''
 installusrbinperl=''
 intsize=''
 longsize=''
 shortsize=''
-d_dirent64_s=''
-d_flock64_s=''
-d_fstat64=''
-d_ftruncate64=''
-d_ino64_t=''
+d_fpos64_t=''
 d_llseek=''
-d_lockf64=''
-d_lseek64=''
-d_lstat64=''
 d_off64_t=''
-d_offset_t=''
-d_open64=''
-d_opendir64=''
-d_readdir64=''
-d_seekdir64=''
-d_stat64=''
-d_telldir64=''
-d_truncate64=''
 libc=''
+ldlibpthname=''
 libperl=''
 shrpenv=''
 useshrplib=''
@@ -697,6 +691,18 @@ xlibpth=''
 ignore_versioned_solibs=''
 libs=''
 lns=''
+d_PRIEldbl=''
+d_PRIFldbl=''
+d_PRIGldbl=''
+d_PRIeldbl=''
+d_PRIfldbl=''
+d_PRIgldbl=''
+sPRIEldbl=''
+sPRIFldbl=''
+sPRIGldbl=''
+sPRIeldbl=''
+sPRIfldbl=''
+sPRIgldbl=''
 lseeksize=''
 lseektype=''
 make_set_make=''
@@ -757,6 +763,18 @@ privlib=''
 privlibexp=''
 prototype=''
 ptrsize=''
+d_PRIX64=''
+d_PRId64=''
+d_PRIi64=''
+d_PRIo64=''
+d_PRIu64=''
+d_PRIx64=''
+sPRIX64=''
+sPRId64=''
+sPRIi64=''
+sPRIo64=''
+sPRIu64=''
+sPRIx64=''
 drand01=''
 randbits=''
 randfunc=''
@@ -779,6 +797,8 @@ sitearchexp=''
 installsitelib=''
 sitelib=''
 sitelibexp=''
+siteprefix=''
+siteprefixexp=''
 sizetype=''
 so=''
 sharpbang=''
@@ -789,33 +809,35 @@ ssizetype=''
 startperl=''
 startsh=''
 stdchar=''
-d_fgetpos64=''
-d_fopen64=''
-d_freopen64=''
-d_fseek64=''
-d_fseeko64=''
-d_fsetpos64=''
-d_ftell64=''
-d_ftello64=''
-d_tmpfile64=''
+d_stdio_stream_array=''
 stdio_stream_array=''
+d_strtoull=''
 sysman=''
 trnl=''
 uidtype=''
 archname64=''
 use64bits=''
+uselongdouble=''
 usemultiplicity=''
 nm_opt=''
 nm_so_opt=''
 runnm=''
 usenm=''
 useperlio=''
+usesocks=''
 d_oldpthreads=''
 usethreads=''
 incpath=''
 mips=''
 mips_type=''
 usrinc=''
+d_vendorlib=''
+installvendorlib=''
+vendorlib=''
+vendorlibexp=''
+usevendorprefix=''
+vendorprefix=''
+vendorprefixexp=''
 defvoidused=''
 voidflags=''
 CONFIG=''
@@ -943,12 +965,13 @@ useposix=true
 : set useopcode=false in your hint file to disable the Opcode extension.
 useopcode=true
 : set usemultiplicity on the Configure command line to enable multiplicity.
+: set usesocks on the Configure command line to enable socks.
 : set usethreads on the Configure command line to enable threads.
 : List of libraries we want.
 : If anyone needs -lnet, put it in a hint file.
 libswanted='sfio socket inet nsl nm ndbm gdbm dbm db malloc dl'
-libswanted="$libswanted dld ld sun m rt c cposix posix"
-libswanted="$libswanted ndir dir crypt"
+libswanted="$libswanted dld ld sun m c cposix posix"
+libswanted="$libswanted ndir dir crypt sec"
 libswanted="$libswanted ucb bsd BSD PW x"
 : We probably want to search /usr/shlib before most other libraries.
 : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
@@ -1280,7 +1303,12 @@ esac
 : Find the path to the source tree
 case "$src" in
 '') case "$0" in
-    */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
+    */*) src=`echo $0 | sed -e 's%/[^/][^/]*$%%'`
+         case "$src" in
+        /*)    ;;
+         *)    src=`cd ../$src && pwd` ;;
+        esac
+         ;;
     *)   src='.';;
     esac;;
 esac
@@ -2101,7 +2129,7 @@ EOM
                                osvers=$tmp
                        elif $test -f /etc/kconfig; then
                                osname=isc
-                               if test "$lns" = "ln -s"; then
+                               if test "$lns" = "$ln -s"; then
                                        osvers=4
                                elif $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
                                        osvers=3
@@ -2354,7 +2382,7 @@ EOM
 
 You may give one or more space-separated answers, or "none" if appropriate.
 A well-behaved OS will have no hints, so answering "none" or just "Policy"
-is a good thing.  DO NOT give a wrong version.
+is a good thing.  DO NOT give a wrong version or a wrong OS.
 
 EOM
 
@@ -2542,24 +2570,16 @@ case "$usethreads" in
 : user has specified that a threading perl is to be built,
 : we may need to set or change some other defaults.
        if $test -f usethreads.cbu; then
+               echo "Your platform has some specific hints for threaded builds, using them..."
                . ./usethreads.cbu
-       fi
-       case "$osname" in
-       aix|dec_osf|dos_djgpp|freebsd|hpux|irix|linux|next|openbsd|os2|solaris|vmesa)
-               # Known thread-capable platforms.
-               ;;
-       *)
-               cat >&4 <<EOM
-$osname is not known to support threads.
-Please let perlbug@perl.com know how to do that.
-
-Cannot continue, aborting.
+       else
+               $cat <<EOM
+(Your platform doesn't have any specific hints for threaded builds.
+ Assuming POSIX threads, then.)
 EOM
-               exit 1
-       ;;
-       esac # $osname
+       fi
     ;;
-esac # $usethreads
+esac
 
 cat <<EOM
 
@@ -2583,79 +2603,424 @@ esac
 set usemultiplicity
 eval $setvar 
 
-cat <<EOM
-
-Perl can be built to take advantage of explicit 64-bit interfaces,
-on some systems.  To do so, Configure must be run with -Duse64bits.
-
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-case "$use64bits" in
-$define|true|[yY]*)    dflt='y';;
-*) dflt='n';;
-esac
-rp='Try to use explicit 64-bit interfaces, if available?'
-. ./myread
-case "$ans" in
-y|Y) 
-       val="$define"
-       ;;     
-*)      
-       val="$undef"
+: determine where manual pages are on this system
+echo " "
+case "$sysman" in
+'') 
+       syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
+       syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
+       syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+       syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+       syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+       sysman=`./loc . /usr/man/man1 $syspath`
        ;;
 esac
-set use64bits
-eval $setvar
+if $test -d "$sysman"; then
+       echo "System manual is in $sysman." >&4
+else
+       echo "Could not find manual pages in source form." >&4
+fi
 
-case "$archname64" in
-'') archname64='' ;;   # not a typo
+: see what memory models we can support
+case "$models" in
+'')
+       $cat >pdp11.c <<'EOP'
+int main() {
+#ifdef pdp11
+       exit(0);
+#else
+       exit(1);
+#endif
+}
+EOP
+       ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
+       if $test -f pdp11 && ./pdp11 2>/dev/null; then
+               dflt='unsplit split'
+       else
+               tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
+               case "$tans" in
+               X) dflt='none';;
+               *) if $test -d /lib/small || $test -d /usr/lib/small; then
+                               dflt='small'
+                       else
+                               dflt=''
+                       fi
+                       if $test -d /lib/medium || $test -d /usr/lib/medium; then
+                               dflt="$dflt medium"
+                       fi
+                       if $test -d /lib/large || $test -d /usr/lib/large; then
+                               dflt="$dflt large"
+                       fi
+                       if $test -d /lib/huge || $test -d /usr/lib/huge; then
+                               dflt="$dflt huge"
+                       fi
+               esac
+       fi;;
+*) dflt="$models";;
 esac
+$cat <<EOM
+Some systems have different model sizes.  On most systems they are called
+small, medium, large, and huge.  On the PDP11 they are called unsplit and
+split.  If your system doesn't support different memory models, say "none".
+If you wish to force everything to one memory model, say "none" here and
+put the appropriate flags later when it asks you for other cc and ld flags.
+Venix systems may wish to put "none" and let the compiler figure things out.
+(In the following question multiple model names should be space separated.)
 
-case "$use64bits" in
-"$define"|true|[yY]*)
-: Look for a hint-file generated 'call-back-unit'.  If the
-: user has specified that a threading perl is to be built,
-: we may need to set or change some other defaults.
-       if $test -f use64bits.cbu; then
-               . ./use64bits.cbu
-       fi
-       case "$osname" in
-       dec_osf|hpux|irix|solaris|unicos)
-               # Known 64-bit capable platforms.
-               ;;
-       *)
-               cat >&4 <<EOM
-$osname is not known to support 64-bit interfaces.
-Please let perlbug@perl.com know how to do that.
+The default for most systems is "none".
 
-Cannot continue, aborting.
 EOM
-               exit 1
-               ;;
+rp="Which memory models are supported?"
+. ./myread
+models="$ans"
+
+case "$models" in
+none)
+       small=''
+       medium=''
+       large=''
+       huge=''
+       unsplit=''
+       split=''
+       ;;
+*split)
+       case "$split" in
+       '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
+                        $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
+                       dflt='-i'
+               else
+                       dflt='none'
+               fi;;
+       *) dflt="$split";;
        esac
+       rp="What flag indicates separate I and D space?"
+       . ./myread
+       tans="$ans"
+       case "$tans" in
+       none) tans='';;
+       esac
+       split="$tans"
+       unsplit='';;
+*large*|*small*|*medium*|*huge*)
+       case "$models" in
+       *large*)
+               case "$large" in
+               '') dflt='-Ml';;
+               *) dflt="$large";;
+               esac
+       rp="What flag indicates large model?"
+       . ./myread
+       tans="$ans"
+       case "$tans" in
+       none) tans='';
+       esac
+       large="$tans";;
+       *) large='';;
+       esac
+       case "$models" in
+       *huge*) case "$huge" in
+               '') dflt='-Mh';;
+               *) dflt="$huge";;
+               esac
+               rp="What flag indicates huge model?"
+               . ./myread
+               tans="$ans"
+               case "$tans" in
+               none) tans='';
+               esac
+               huge="$tans";;
+       *) huge="$large";;
+       esac
+       case "$models" in
+       *medium*) case "$medium" in
+               '') dflt='-Mm';;
+               *) dflt="$medium";;
+               esac
+               rp="What flag indicates medium model?"
+               . ./myread
+               tans="$ans"
+               case "$tans" in
+               none) tans='';
+               esac
+               medium="$tans";;
+       *) medium="$large";;
+       esac
+       case "$models" in
+       *small*) case "$small" in
+               '') dflt='none';;
+               *) dflt="$small";;
+               esac
+               rp="What flag indicates small model?"
+               . ./myread
+               tans="$ans"
+               case "$tans" in
+               none) tans='';
+               esac
+               small="$tans";;
+       *) small='';;
+       esac
+       ;;
+*)
+       echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
        ;;
 esac
+$rm -f pdp11.* pdp11
 
-: determine the architecture name
+: make some quick guesses about what we are up against
 echo " "
-if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
-       tarch=`arch`"-$osname"
-elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
-       if uname -m > tmparch 2>&1 ; then
-               tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
-                       -e 's/$/'"-$osname/" tmparch`
+$echo $n "Hmm...  $c"
+echo exit 1 >bsd
+echo exit 1 >usg
+echo exit 1 >v7
+echo exit 1 >osf1
+echo exit 1 >eunice
+echo exit 1 >xenix
+echo exit 1 >venix
+echo exit 1 >os2
+d_bsd="$undef"
+$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
+if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
+then
+       echo "Looks kind of like an OSF/1 system, but we'll see..."
+       echo exit 0 >osf1
+elif test `echo abc | tr a-z A-Z` = Abc ; then
+       xxx=`./loc addbib blurfl $pth`
+       if $test -f $xxx; then
+       echo "Looks kind of like a USG system with BSD features, but we'll see..."
+               echo exit 0 >bsd
+               echo exit 0 >usg
        else
-               tarch="$osname"
+               if $contains SIGTSTP foo >/dev/null 2>&1 ; then
+                       echo "Looks kind of like an extended USG system, but we'll see..."
+               else
+                       echo "Looks kind of like a USG system, but we'll see..."
+               fi
+               echo exit 0 >usg
        fi
-       $rm -f tmparch
+elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
+       echo "Looks kind of like a BSD system, but we'll see..."
+       d_bsd="$define"
+       echo exit 0 >bsd
 else
-       tarch="$osname"
+       echo "Looks kind of like a Version 7 system, but we'll see..."
+       echo exit 0 >v7
 fi
-case "$myarchname" in
-''|"$tarch") ;;
-*)
-       echo "(Your architecture name used to be $myarchname.)"
-       archname=''
+case "$eunicefix" in
+*unixtovms*)
+       $cat <<'EOI'
+There is, however, a strange, musty smell in the air that reminds me of
+something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
+EOI
+       echo exit 0 >eunice
+       d_eunice="$define"
+: it so happens the Eunice I know will not run shell scripts in Unix format
+       ;;
+*)
+       echo " "
+       echo "Congratulations.  You aren't running Eunice."
+       d_eunice="$undef"
+       ;;
+esac
+: Detect OS2.  The p_ variable is set above in the Head.U unit.
+case "$p_" in
+:) ;;
+*)
+       $cat <<'EOI'
+I have the feeling something is not exactly right, however...don't tell me...
+lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
+EOI
+       echo exit 0 >os2
+       ;;
+esac
+if test -f /xenix; then
+       echo "Actually, this looks more like a XENIX system..."
+       echo exit 0 >xenix
+       d_xenix="$define"
+else
+       echo " "
+       echo "It's not Xenix..."
+       d_xenix="$undef"
+fi
+chmod +x xenix
+$eunicefix xenix
+if test -f /venix; then
+       echo "Actually, this looks more like a VENIX system..."
+       echo exit 0 >venix
+else
+       echo " "
+       if ./xenix; then
+               : null
+       else
+               echo "Nor is it Venix..."
+       fi
+fi
+chmod +x bsd usg v7 osf1 eunice xenix venix os2
+$eunicefix bsd usg v7 osf1 eunice xenix venix os2
+$rm -f foo
+
+: see if we need a special compiler
+echo " "
+if ./usg; then
+       case "$cc" in
+       '') case "$Mcc" in
+               /*) dflt='Mcc';;
+               *) case "$large" in
+                       -M*) dflt='cc';;
+                       *)      if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
+                                       if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
+                                               dflt='cc'
+                                       else
+                                               dflt='cc -M'
+                                       fi
+                               else
+                                       dflt='cc'
+                               fi;;
+                       esac;;
+               esac;;
+       *)  dflt="$cc";;
+       esac
+       case "$dflt" in
+       *M*)    $cat <<'EOM'
+On some older systems the default C compiler will not resolve multiple global
+references that happen to have the same name.  On some such systems the "Mcc"
+command may be used to force these to be resolved.  On other systems a "cc -M"
+command is required.  (Note that the -M flag on other systems indicates a
+memory model to use!) If you have the Gnu C compiler, you might wish to use
+that instead.
+
+EOM
+       ;;
+       esac
+       rp="Use which C compiler?"
+       . ./myread
+       cc="$ans"
+else
+       case "$cc" in
+       '') dflt=cc;;
+       *) dflt="$cc";;
+       esac
+       rp="Use which C compiler?"
+       . ./myread
+       cc="$ans"
+fi
+: Look for a hint-file generated 'call-back-unit'.  Now that the
+: user has specified the compiler, we may need to set or change some
+: other defaults.
+if $test -f cc.cbu; then
+    . ./cc.cbu
+fi
+echo " "
+echo "Checking for GNU cc in disguise and/or its version number..." >&4
+$cat >gccvers.c <<EOM
+#include <stdio.h>
+int main() {
+#ifdef __GNUC__
+#ifdef __VERSION__
+       printf("%s\n", __VERSION__);
+#else
+       printf("%s\n", "1");
+#endif
+#endif
+       exit(0);
+}
+EOM
+if $cc -o gccvers gccvers.c; then
+       gccversion=`./gccvers`
+       case "$gccversion" in
+       '') echo "You are not using GNU cc." ;;
+       *)  echo "You are using GNU cc $gccversion." ;;
+       esac
+else
+       echo " "
+       echo "*** WHOA THERE!!! ***" >&4
+       echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
+       case "$knowitall" in
+       '')
+       echo "    You'd better start hunting for one and let me know about it." >&4
+               exit 1
+               ;;
+       esac
+fi
+$rm -f gccvers*
+case "$gccversion" in
+1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
+esac
+
+cat <<EOM
+
+Perl can be built to take advantage of explicit 64-bit interfaces,
+on some systems.  To do so, Configure must be run with -Duse64bits.
+
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$use64bits" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+rp='Try to use explicit 64-bit interfaces, if available?'
+. ./myread
+case "$ans" in
+y|Y) 
+       val="$define"
+       ;;     
+*)      
+       val="$undef"
+       ;;
+esac
+set use64bits
+eval $setvar
+
+case "$archname64" in
+'') archname64='' ;;   # not a typo
+esac
+
+case "$use64bits" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'.  If the
+: user has specified that a 64 bit perl is to be built,
+: we may need to set or change some other defaults.
+       if $test -f use64bits.cbu; then
+               echo "Your platform has some specific hints for 64-bit builds, using them..."
+               . ./use64bits.cbu
+       else
+               $cat <<EOM
+(Your platform doesn't have any specific hints for 64-bit builds.
+ This is probably okay, especially if your system is a true 64-bit system.)
+EOM
+               case "$gccversion" in
+               '')     ;;
+               *)      $cat <<EOM
+But since you seem to be using gcc,
+I will now add -DUSE_LONG_LONG to the compilation flags.
+EOM
+                       ccflags="$ccflags -DUSE_LONG_LONG"
+                       ;;
+               esac
+       fi
+       ;;
+esac
+
+: determine the architecture name
+echo " "
+if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
+       tarch=`arch`"-$osname"
+elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
+       if uname -m > tmparch 2>&1 ; then
+               tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
+                       -e 's/$/'"-$osname/" tmparch`
+       else
+               tarch="$osname"
+       fi
+       $rm -f tmparch
+else
+       tarch="$osname"
+fi
+case "$myarchname" in
+''|"$tarch") ;;
+*)
+       echo "(Your architecture name used to be $myarchname.)"
+       archname=''
        ;;
 esac
 myarchname="$tarch"
@@ -2708,24 +3073,6 @@ $define)
        esac
 esac
 
-: is AFS running?
-echo " "
-case "$afs" in
-$define|true)  afs=true ;;
-$undef|false)  afs=false ;;
-*)     if test -d /afs; then
-               afs=true
-       else
-               afs=false
-       fi
-       ;;
-esac
-if $afs; then
-       echo "AFS may be running... I'll be extra cautious then..." >&4
-else
-       echo "AFS does not seem to be running..." >&4
-fi
-
 : decide how portable to be.  Allow command line overrides.
 case "$d_portable" in
 "$undef") ;;
@@ -2786,6 +3133,9 @@ exp_file=''
 nopath_ok=''
 orig_rp="$rp"
 orig_dflt="$dflt"
+case "$gfpth" in
+'') gfpth='.' ;;
+esac
 
 case "$fn" in
 *\(*)
@@ -2912,18 +3262,38 @@ while test "$type"; do
                '')
                        case "$type" in
                        File)
-                               if test -f "$ansexp"; then
-                                       type=''
-                               elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
-                               then
-                                       echo "($value is not a plain file, but that's ok.)"
-                                       type=''
-                               fi
+                               for fp in $gfpth; do
+                                       if test "X$fp" = X.; then
+                                           pf="$ansexp"
+                                       else    
+                                           pf="$fp/$ansexp"
+                                       fi
+                                       if test -f "$pf"; then
+                                               type=''
+                                       elif test -r "$pf" || (test -h "$pf") >/dev/null 2>&1
+                                       then
+                                               echo "($value is not a plain file, but that's ok.)"
+                                               type=''
+                                       fi
+                                       if test X"$type" = X; then
+                                           value="$pf"
+                                           break
+                                       fi
+                               done
                                ;;
                        Directory)
-                               if test -d "$ansexp"; then
-                                       type=''
-                               fi
+                               for fp in $gfpth; do
+                                       if test "X$fp" = X.; then
+                                           pf="$ansexp"
+                                       else    
+                                           pf="$fp/$ansexp"
+                                       fi
+                                       if test -d "$pf"; then
+                                               type=''
+                                               value="$pf"
+                                               break
+                                       fi
+                               done
                                ;;
                        Locate)
                                if test -d "$ansexp"; then
@@ -2977,6 +3347,7 @@ ans="$value"
 rp="$orig_rp"
 dflt="$orig_dflt"
 rm -f getfile.ok
+test "X$gfpthkeep" != Xy && gfpth=""
 EOSC
 
 : determine root of directory hierarchy where package will be installed.
@@ -2990,14 +3361,13 @@ case "$prefix" in
 esac
 $cat <<EOM
 
-By default, $package will be installed in $dflt/bin, manual
-pages under $dflt/man, etc..., i.e. with $dflt as prefix for
-all installation directories. Typically set to /usr/local, but you
-may choose /usr if you wish to install $package among your system
-binaries. If you wish to have binaries under /bin but manual pages
-under /usr/local/man, that's ok: you will be prompted separately
-for each of the installation directories, the prefix being only used
-to set the defaults.
+By default, $package will be installed in $dflt/bin, manual pages
+under $dflt/man, etc..., i.e. with $dflt as prefix for all
+installation directories. Typically this is something like /usr/local.
+If you wish to have binaries under /usr/bin but other parts of the
+installation under /usr/local, that's ok: you will be prompted
+separately for each of the installation directories, the prefix being
+only used to set the defaults.
 
 EOM
 fn=d~
@@ -3016,30 +3386,81 @@ esac
 prefix="$ans"
 prefixexp="$ansexp"
 
-: set the prefixit variable, to compute a suitable default value
-prefixit='case "$3" in
-""|none)
-       case "$oldprefix" in
-       "") eval "$1=\"\$$2\"";;
-       *)
-               case "$3" in
-               "") eval "$1=";;
-               none)
-                       eval "tp=\"\$$2\"";
-                       case "$tp" in
-                       ""|" ") eval "$1=\"\$$2\"";;
-                       *) eval "$1=";;
-                       esac;;
-               esac;;
-       esac;;
-*)
-       eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
-       case "$tp" in
-       --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
-       /*-$oldprefix/*|\~*-$oldprefix/*)
-               eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
-       *) eval "$1=\"\$$2\"";;
-       esac;;
+: is AFS running?
+echo " "
+case "$afs" in
+$define|true)  afs=true ;;
+$undef|false)  afs=false ;;
+*)     if test -d /afs; then
+               afs=true
+       else
+               afs=false
+       fi
+       ;;
+esac
+if $afs; then
+       echo "AFS may be running... I'll be extra cautious then..." >&4
+else
+       echo "AFS does not seem to be running..." >&4
+fi
+
+: determine installation prefix for where package is to be installed.
+if $afs; then 
+$cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+files will reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
+
+EOM
+       case "$installprefix" in
+       '') dflt=`echo $prefix | sed 's#^/afs/#/afs/.#'`;;
+       *) dflt="$installprefix";;
+       esac
+else
+$cat <<EOM
+
+In some special cases, particularly when building $package for distribution,
+it is convenient to distinguish between the directory in which files should 
+be installed from the directory ($prefix) in which they 
+will eventually reside.  For most users, these two directories are the same.
+
+EOM
+       case "$installprefix" in
+       '') dflt=$prefix ;;
+       *) dflt=$installprefix;;
+       esac
+fi
+fn=d~
+rp='What installation prefix should I use for installing files?'
+. ./getfile
+installprefix="$ans"
+installprefixexp="$ansexp"
+
+: set the prefixit variable, to compute a suitable default value
+prefixit='case "$3" in
+""|none)
+       case "$oldprefix" in
+       "") eval "$1=\"\$$2\"";;
+       *)
+               case "$3" in
+               "") eval "$1=";;
+               none)
+                       eval "tp=\"\$$2\"";
+                       case "$tp" in
+                       ""|" ") eval "$1=\"\$$2\"";;
+                       *) eval "$1=";;
+                       esac;;
+               esac;;
+       esac;;
+*)
+       eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
+       case "$tp" in
+       --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
+       /*-$oldprefix/*|\~*-$oldprefix/*)
+               eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
+       *) eval "$1=\"\$$2\"";;
+       esac;;
 esac'
 
 : set the base revision
@@ -3083,13 +3504,30 @@ else
        apiversion="$version"
 fi
 
+: determine installation style
+: For now, try to deduce it from prefix unless it is already set.
+: Reproduce behavior of 5.005 and earlier, maybe drop that in 5.7.
+case "$installstyle" in
+'')    case "$prefix" in
+               *perl*) dflt='lib';;
+               *) dflt='lib/perl5' ;;
+       esac
+       ;;
+*)     dflt='lib/perl5' ;;
+esac
+: Probably not worth prompting for this since we prompt for all
+: the directories individually, and the prompt would be too long and
+: confusing anyway.
+installstyle=$dflt
+
 : determine where private library files go
 : Usual default is /usr/local/lib/perl5/$version.
 : Also allow things like /opt/perl/lib/$version, since 
 : /opt/perl/lib/perl5... would be redundant.
-case "$prefix" in
-*perl*) set dflt privlib lib/$version ;;
-*)      set dflt privlib lib/$package/$version ;;
+: The default "style" setting is made in installstyle.U
+case "$installstyle" in
+*lib/perl5*) set dflt privlib lib/$package/$version ;;
+*)      set dflt privlib lib/$version ;;
 esac
 eval $prefixit
 $cat <<EOM
@@ -3101,27 +3539,11 @@ EOM
 fn=d~+
 rp='Pathname where the private library files will reside?'
 . ./getfile
-if $test "X$privlibexp" != "X$ansexp"; then
-       installprivlib=''
-fi
 privlib="$ans"
 privlibexp="$ansexp"
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-private files reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
-
-EOM
-       case "$installprivlib" in
-       '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installprivlib";;
-       esac
-       fn=de~
-       rp='Where will private files be installed?'
-       . ./getfile
-       installprivlib="$ans"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installprivlib=`echo $privlibexp | sed "s#^$prefix#$installprefix#"`
 else
        installprivlib="$privlibexp"
 fi
@@ -3146,7 +3568,7 @@ case "$archlib" in
 *)     dflt="$archlib"
     ;;
 esac
-cat <<EOM
+$cat <<EOM
 
 $spackage contains architecture-dependent library files.  If you are
 sharing libraries in a heterogeneous environment, you might store
@@ -3159,124 +3581,56 @@ rp='Where do you want to put the public architecture-dependent libraries?'
 . ./getfile
 archlib="$ans"
 archlibexp="$ansexp"
-
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in
-which architecture-dependent library files reside from the directory
-in which they are installed (and from which they are presumably copied
-to the former directory by occult means).
-
-EOM
-       case "$installarchlib" in
-       '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installarchlib";;
-       esac
-       fn=de~
-       rp='Where will architecture-dependent library files be installed?'
-       . ./getfile
-       installarchlib="$ans"
-else
-       installarchlib="$archlibexp"
-fi
 if $test X"$archlib" = X"$privlib"; then
        d_archlib="$undef"
 else
        d_archlib="$define"
 fi
-
-: make some quick guesses about what we are up against
-echo " "
-$echo $n "Hmm...  $c"
-echo exit 1 >bsd
-echo exit 1 >usg
-echo exit 1 >v7
-echo exit 1 >osf1
-echo exit 1 >eunice
-echo exit 1 >xenix
-echo exit 1 >venix
-echo exit 1 >os2
-d_bsd="$undef"
-$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
-if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
-then
-       echo "Looks kind of like an OSF/1 system, but we'll see..."
-       echo exit 0 >osf1
-elif test `echo abc | tr a-z A-Z` = Abc ; then
-       xxx=`./loc addbib blurfl $pth`
-       if $test -f $xxx; then
-       echo "Looks kind of like a USG system with BSD features, but we'll see..."
-               echo exit 0 >bsd
-               echo exit 0 >usg
-       else
-               if $contains SIGTSTP foo >/dev/null 2>&1 ; then
-                       echo "Looks kind of like an extended USG system, but we'll see..."
-               else
-                       echo "Looks kind of like a USG system, but we'll see..."
-               fi
-               echo exit 0 >usg
-       fi
-elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
-       echo "Looks kind of like a BSD system, but we'll see..."
-       d_bsd="$define"
-       echo exit 0 >bsd
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installarchlib=`echo $archlibexp | sed "s#^$prefix#$installprefix#"`
 else
-       echo "Looks kind of like a Version 7 system, but we'll see..."
-       echo exit 0 >v7
+       installarchlib="$archlibexp"
 fi
-case "$eunicefix" in
-*unixtovms*)
-       $cat <<'EOI'
-There is, however, a strange, musty smell in the air that reminds me of
-something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
-EOI
-       echo exit 0 >eunice
-       d_eunice="$define"
-: it so happens the Eunice I know will not run shell scripts in Unix format
-       ;;
-*)
-       echo " "
-       echo "Congratulations.  You aren't running Eunice."
-       d_eunice="$undef"
+
+
+: Binary compatibility with 5.005 is not possible for builds
+: with advanced features
+case "$usethreads$usemultiplicity" in
+*define*)
+       bincompat5005="$undef"
+       d_bincompat5005="$undef"
        ;;
-esac
-: Detect OS2.  The p_ variable is set above in the Head.U unit.
-case "$p_" in
-:) ;;
-*)
-       $cat <<'EOI'
-I have the feeling something is not exactly right, however...don't tell me...
-lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
-EOI
-       echo exit 0 >os2
+*)     $cat <<EOM
+
+Perl 5.006 can be compiled for binary compatibility with 5.005.
+If you decide to do so, you will be able to continue using most
+of the extensions that were compiled for Perl 5.005.
+
+EOM
+       case "$bincompat5005$d_bincompat5005" in
+       *"$undef"*) dflt=n ;;
+       *) dflt=y ;;
+       esac
+       rp='Binary compatibility with Perl 5.005?'
+       . ./myread
+       case "$ans" in
+       y*) val="$define" ;;
+       *)  val="$undef" ;;
+       esac
+       set d_bincompat5005
+       eval $setvar
+       case "$d_bincompat5005" in
+       "$define")
+               bincompat5005="$define"
+               ;;
+       *)      bincompat5005="$undef"
+               d_bincompat5005="$undef"
+               ;;
+       esac
        ;;
 esac
-if test -f /xenix; then
-       echo "Actually, this looks more like a XENIX system..."
-       echo exit 0 >xenix
-       d_xenix="$define"
-else
-       echo " "
-       echo "It's not Xenix..."
-       d_xenix="$undef"
-fi
-chmod +x xenix
-$eunicefix xenix
-if test -f /venix; then
-       echo "Actually, this looks more like a VENIX system..."
-       echo exit 0 >venix
-else
-       echo " "
-       if ./xenix; then
-               : null
-       else
-               echo "Nor is it Venix..."
-       fi
-fi
-chmod +x bsd usg v7 osf1 eunice xenix venix os2
-$eunicefix bsd usg v7 osf1 eunice xenix venix os2
-$rm -f foo
+
 
 : see if setuid scripts can be secure
 $cat <<EOM
@@ -3388,303 +3742,51 @@ esac
 set d_dosuid
 eval $setvar
 
-: determine where manual pages are on this system
+: What should the include directory be ?
 echo " "
-case "$sysman" in
-'') 
-       syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
-       syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
-       syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
-       syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
-       syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
-       sysman=`./loc . /usr/man/man1 $syspath`
-       ;;
-esac
-if $test -d "$sysman"; then
-       echo "System manual is in $sysman." >&4
+$echo $n "Hmm...  $c"
+dflt='/usr/include'
+incpath=''
+mips_type=''
+if $test -f /bin/mips && /bin/mips; then
+       echo "Looks like a MIPS system..."
+       $cat >usr.c <<'EOCP'
+#ifdef SYSTYPE_BSD43
+/bsd43
+#endif
+EOCP
+       if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
+               dflt='/bsd43/usr/include'
+               incpath='/bsd43'
+               mips_type='BSD 4.3'
+       else
+               mips_type='System V'
+       fi
+       $rm -f usr.c usr.out
+       echo "and you're compiling with the $mips_type compiler and libraries."
+       xxx_prompt=y
+       echo "exit 0" >mips
 else
-       echo "Could not find manual pages in source form." >&4
+       echo "Doesn't look like a MIPS system."
+       xxx_prompt=n
+       echo "exit 1" >mips
 fi
-
-: see what memory models we can support
-case "$models" in
-'')
-       $cat >pdp11.c <<'EOP'
-int main() {
-#ifdef pdp11
-       exit(0);
-#else
-       exit(1);
-#endif
-}
-EOP
-       ( cc -o pdp11 pdp11.c ) >/dev/null 2>&1
-       if $test -f pdp11 && ./pdp11 2>/dev/null; then
-               dflt='unsplit split'
-       else
-               tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
-               case "$tans" in
-               X) dflt='none';;
-               *) if $test -d /lib/small || $test -d /usr/lib/small; then
-                               dflt='small'
-                       else
-                               dflt=''
-                       fi
-                       if $test -d /lib/medium || $test -d /usr/lib/medium; then
-                               dflt="$dflt medium"
-                       fi
-                       if $test -d /lib/large || $test -d /usr/lib/large; then
-                               dflt="$dflt large"
-                       fi
-                       if $test -d /lib/huge || $test -d /usr/lib/huge; then
-                               dflt="$dflt huge"
-                       fi
-               esac
-       fi;;
-*) dflt="$models";;
-esac
-$cat <<EOM
-Some systems have different model sizes.  On most systems they are called
-small, medium, large, and huge.  On the PDP11 they are called unsplit and
-split.  If your system doesn't support different memory models, say "none".
-If you wish to force everything to one memory model, say "none" here and
-put the appropriate flags later when it asks you for other cc and ld flags.
-Venix systems may wish to put "none" and let the compiler figure things out.
-(In the following question multiple model names should be space separated.)
-
-The default for most systems is "none".
-
-EOM
-rp="Which memory models are supported?"
-. ./myread
-models="$ans"
-
-case "$models" in
-none)
-       small=''
-       medium=''
-       large=''
-       huge=''
-       unsplit=''
-       split=''
-       ;;
-*split)
-       case "$split" in
-       '') if $contains '\-i' $sysman/ld.1 >/dev/null 2>&1 || \
-                        $contains '\-i' $sysman/cc.1 >/dev/null 2>&1; then
-                       dflt='-i'
-               else
-                       dflt='none'
-               fi;;
-       *) dflt="$split";;
-       esac
-       rp="What flag indicates separate I and D space?"
-       . ./myread
-       tans="$ans"
-       case "$tans" in
-       none) tans='';;
-       esac
-       split="$tans"
-       unsplit='';;
-*large*|*small*|*medium*|*huge*)
-       case "$models" in
-       *large*)
-               case "$large" in
-               '') dflt='-Ml';;
-               *) dflt="$large";;
-               esac
-       rp="What flag indicates large model?"
-       . ./myread
-       tans="$ans"
-       case "$tans" in
-       none) tans='';
-       esac
-       large="$tans";;
-       *) large='';;
-       esac
-       case "$models" in
-       *huge*) case "$huge" in
-               '') dflt='-Mh';;
-               *) dflt="$huge";;
-               esac
-               rp="What flag indicates huge model?"
-               . ./myread
-               tans="$ans"
-               case "$tans" in
-               none) tans='';
-               esac
-               huge="$tans";;
-       *) huge="$large";;
-       esac
-       case "$models" in
-       *medium*) case "$medium" in
-               '') dflt='-Mm';;
-               *) dflt="$medium";;
-               esac
-               rp="What flag indicates medium model?"
-               . ./myread
-               tans="$ans"
-               case "$tans" in
-               none) tans='';
-               esac
-               medium="$tans";;
-       *) medium="$large";;
-       esac
-       case "$models" in
-       *small*) case "$small" in
-               '') dflt='none';;
-               *) dflt="$small";;
-               esac
-               rp="What flag indicates small model?"
-               . ./myread
-               tans="$ans"
-               case "$tans" in
-               none) tans='';
-               esac
-               small="$tans";;
-       *) small='';;
-       esac
-       ;;
-*)
-       echo "Unrecognized memory models--you may have to edit Makefile.SH" >&4
-       ;;
-esac
-$rm -f pdp11.* pdp11
-
-: see if we need a special compiler
-echo " "
-if ./usg; then
-       case "$cc" in
-       '') case "$Mcc" in
-               /*) dflt='Mcc';;
-               *) case "$large" in
-                       -M*) dflt='cc';;
-                       *)      if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
-                                       if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
-                                               dflt='cc'
-                                       else
-                                               dflt='cc -M'
-                                       fi
-                               else
-                                       dflt='cc'
-                               fi;;
-                       esac;;
-               esac;;
-       *)  dflt="$cc";;
-       esac
-       case "$dflt" in
-       *M*)    $cat <<'EOM'
-On some older systems the default C compiler will not resolve multiple global
-references that happen to have the same name.  On some such systems the "Mcc"
-command may be used to force these to be resolved.  On other systems a "cc -M"
-command is required.  (Note that the -M flag on other systems indicates a
-memory model to use!) If you have the Gnu C compiler, you might wish to use
-that instead.
-
-EOM
-       ;;
-       esac
-       rp="Use which C compiler?"
-       . ./myread
-       cc="$ans"
-else
-       case "$cc" in
-       '') dflt=cc;;
-       *) dflt="$cc";;
-       esac
-       rp="Use which C compiler?"
-       . ./myread
-       cc="$ans"
-fi
-: Look for a hint-file generated 'call-back-unit'.  Now that the
-: user has specified the compiler, we may need to set or change some
-: other defaults.
-if $test -f cc.cbu; then
-    . ./cc.cbu
-fi
-echo " "
-echo "Checking for GNU cc in disguise and/or its version number..." >&4
-$cat >gccvers.c <<EOM
-#include <stdio.h>
-int main() {
-#ifdef __GNUC__
-#ifdef __VERSION__
-       printf("%s\n", __VERSION__);
-#else
-       printf("%s\n", "1");
-#endif
-#endif
-       exit(0);
-}
-EOM
-if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
-       gccversion=`./gccvers`
-       case "$gccversion" in
-       '') echo "You are not using GNU cc." ;;
-       *)  echo "You are using GNU cc $gccversion." ;;
-       esac
-else
-       echo " "
-       echo "*** WHOA THERE!!! ***" >&4
-       echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
-       case "$knowitall" in
-       '')
-       echo "    You'd better start hunting for one and let me know about it." >&4
-               exit 1
-               ;;
-       esac
-fi
-$rm -f gccvers*
-case "$gccversion" in
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
-esac
-
-: What should the include directory be ?
-echo " "
-$echo $n "Hmm...  $c"
-dflt='/usr/include'
-incpath=''
-mips_type=''
-if $test -f /bin/mips && /bin/mips; then
-       echo "Looks like a MIPS system..."
-       $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
-       if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
-               dflt='/bsd43/usr/include'
-               incpath='/bsd43'
-               mips_type='BSD 4.3'
-       else
-               mips_type='System V'
-       fi
-       $rm -f usr.c usr.out
-       echo "and you're compiling with the $mips_type compiler and libraries."
-       xxx_prompt=y
-       echo "exit 0" >mips
-else
-       echo "Doesn't look like a MIPS system."
-       xxx_prompt=n
-       echo "exit 1" >mips
-fi
-chmod +x mips
-$eunicefix mips
-case "$usrinc" in
-'') ;;
-*) dflt="$usrinc";;
-esac
-case "$xxx_prompt" in
-y)     fn=d/
-       echo " "
-       rp='Where are the include files you want to use?'
-       . ./getfile
-       usrinc="$ans"
-       ;;
-*)     usrinc="$dflt"
-       ;;
-esac
+chmod +x mips
+$eunicefix mips
+case "$usrinc" in
+'') ;;
+*) dflt="$usrinc";;
+esac
+case "$xxx_prompt" in
+y)     fn=d/
+       echo " "
+       rp='Where are the include files you want to use?'
+       . ./getfile
+       usrinc="$ans"
+       ;;
+*)     usrinc="$dflt"
+       ;;
+esac
 
 : see how we invoke the C preprocessor
 echo " "
@@ -3696,7 +3798,13 @@ ABC.XYZ
 EOT
 cd ..
 if test ! -f cppstdin; then
-       echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+       if test "X$osname" = "Xaix" -a "X$gccversion" = X; then
+               # AIX cc -E doesn't show the absolute headerfile
+               # locations but we'll cheat by using the -M flag.
+               echo 'cat >.$$.c; rm -f .$$.u; '"$cc"' ${1+"$@"} -M -c .$$.c 2>/dev/null; test -s .$$.u && awk '"'"'$2 ~ /\.h$/ { print "# 0 \""$2"\"" }'"'"' .$$.u; rm -f .$$.o .$$.u; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' > cppstdin
+       else
+               echo 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
+       fi
 else
        echo "Keeping your $hint cppstdin wrapper."
 fi
@@ -3938,6 +4046,27 @@ case "$firstmakefile" in
 '') firstmakefile='makefile';;
 esac
 
+cat <<EOM
+
+Perl can be built to use the SOCKS proxy protocol library.  To do so,
+Configure must be run with -Dusesocks.
+
+Normally you do not need this and you should answer no.
+
+EOM
+case "$usesocks" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+rp='Build Perl for SOCKS?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define" ;;     
+*)      val="$undef" ;;
+esac
+set usesocks
+eval $setvar
+
 : Looking for optional libraries
 echo " "
 echo "Checking for optional libraries..." >&4
@@ -3948,6 +4077,11 @@ esac
 case "$libswanted" in
 '') libswanted='c_s';;
 esac
+case "$usesocks" in
+$define)
+       libswanted="$libswanted socks5 socks5_sh"
+       ;;
+esac
 for thislib in $libswanted; do
        
        if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`;
@@ -4003,27 +4137,21 @@ case "$dflt" in
 esac
 
 $cat <<EOM
-Some versions of Unix support shared libraries, which make executables smaller
-but make load time slightly longer.
 
-On some systems, mostly System V Release 3's, the shared library is included
-by putting the option "-lc_s" as the last thing on the cc command line when
-linking.  Other systems use shared libraries by default.  There may be other
-libraries needed to compile $package on your machine as well.  If your system
-needs the "-lc_s" option, include it here.  Include any other special libraries
-here as well.  Say "none" for none.
+In order to compile $package on your machine, a number of libraries
+are usually needed.  Include any other special libraries here as well.
+Say "none" for none.  The default list is almost always right.
 EOM
 
 echo " "
-rp="Any additional libraries?"
+rp="What libraries to use?"
 . ./myread
 case "$ans" in
 none) libs=' ';;
 *) libs="$ans";;
 esac
 
-: determine optimize, if desired, or use for debug flag also
+: determine optimization, if desired, or use for debug flag also
 case "$optimize" in
 ' '|$undef) dflt='none';;
 '') dflt='-O';;
@@ -4031,11 +4159,10 @@ case "$optimize" in
 esac
 $cat <<EOH
 
-Some C compilers have problems with their optimizers.  By default, $package
-compiles with the -O flag to use the optimizer.  Alternately, you might want
-to use the symbolic debugger, which uses the -g flag (on traditional Unix
-systems).  Either flag can be specified here.  To use neither flag, specify
-the word "none".
+By default, $package compiles with the -O flag to use the optimizer.
+Alternately, you might want to use the symbolic debugger, which uses
+the -g flag (on traditional Unix systems).  Either flag can be
+specified here.  To use neither flag, specify the word "none".
 
 EOH
 rp="What optimizer/debugger flag should be used?"
@@ -4049,7 +4176,7 @@ dflt=''
 : We will not override a previous value, but we might want to
 : augment a hint file
 case "$hint" in
-none|recommended)
+default|recommended)
        case "$gccversion" in
        1*) dflt='-fpcc-struct-return' ;;
        esac
@@ -4064,6 +4191,25 @@ none|recommended)
                fi
                ;;
        esac
+       case "$gccversion" in
+       1*) ;;
+       2.[0-8]*) ;;
+       *)      echo " "
+               echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
+               echo 'int main(void) { return 0; }' > gcctest.c
+               if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
+                       echo "Yes, it does." 2>&1
+                       case "$ccflags" in
+                       *strict-aliasing*) 
+                               echo "Leaving current flags $ccflags alone." 2>&1
+                               ;;
+                       *) dflt="$dflt -fno-strict-aliasing" ;;
+                       esac
+               else
+                       echo "Nope, it doesn't, but that's ok." 2>&1
+               fi
+               ;;
+       esac
        ;;
 esac
 
@@ -4098,8 +4244,14 @@ fi'
 
 set signal.h LANGUAGE_C; eval $inctest
 
+case "$usesocks" in
+$define)
+       ccflags="$ccflags -DSOCKS"
+       ;;
+esac
+
 case "$hint" in
-none|recommended) dflt="$ccflags $dflt" ;;
+default|recommended) dflt="$ccflags $dflt" ;;
 *) dflt="$ccflags";;
 esac
 
@@ -4361,14 +4513,22 @@ $grep "^[       ]*#.*\$wanted" | \
 while read cline; do
        name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
        case "\$name" in
-       *[/\\\\]\$wanted) echo "\$name"; exit 0;;
-       *) name='';;
+       *[/\\\\]\$wanted) echo "\$name"; exit 1;;
+       *[\\\\/]\$wanted) echo "\$name"; exit 1;;
+       *) exit 2;;
        esac;
 done;
+#
+# status = 0: grep returned 0 lines, case statement not executed
+# status = 1: headerfile found
+# status = 2: while loop executed, no headerfile found
+#
+status=\$?
 $rm -f foo\$\$.c;
-case "\$name" in
-'') exit 1;;
-esac
+if test \$status -eq 1; then
+       exit 0;
+fi
+exit 1
 EOF
 chmod +x findhdr
 
@@ -4486,6 +4646,83 @@ case "$freetype" in
 esac
 echo "Your system uses $freetype free(), it would seem." >&4
 $rm -f malloc.[co]
+$cat <<EOM
+
+The installation process will also create a directory for
+vendor-supplied add-ons.  Vendors who supply perl with their system
+may find it convenient to place all vendor-supplied files in this
+directory rather than in the main distribution directory.  This will
+ease upgrades between binary-compatible maintenance versions of perl.
+
+Of course you may also use these directories in whatever way you see
+fit.  For example, you might use them to access modules shared over a
+company-wide network.
+
+The default answer should be fine for most people.
+This causes further questions about vendor add-ons to be skipped
+and no vendor-specific directories will be configured for perl.
+
+EOM
+rp='Do you want to configure vendor-specific add-on directories?'
+case "$usevendorprefix" in
+define|true|[yY]*) dflt=y ;;
+*) dflt=n ;;
+esac
+. ./myread
+case "$ans" in
+[yY]*) fn=d~+
+       rp='Installation prefix to use for vendor-supplied add-ons?'
+       case "$vendorprefix" in
+       '') dflt='' ;;
+       *)  dflt=$vendorprefix ;;
+       esac
+       . ./getfile
+       oldvendorprefix=''
+       case "$vendorprefix" in
+       '') ;;
+       *)      case "$ans" in
+               "$prefix") ;;
+               *) oldvendorprefix="$prefix";;
+               esac
+               ;;
+       esac
+       usevendorprefix="$define"
+       vendorprefix="$ans"
+       vendorprefixexp="$ansexp"
+       ;;
+*)     usevendorprefix="$undef"
+       vendorprefix=''
+       vendorprefixexp=''
+       ;;
+esac
+
+case "$vendorprefix" in
+'')    d_vendorlib="$undef"
+       vendorlib=''
+       vendorlibexp=''
+       ;;
+*)     d_vendorlib="$define"
+       : determine where vendor-supplied modules go.
+       : Usual default is /usr/local/lib/perl5/vendor_perl
+       prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+       case "$installstyle" in
+       *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog ;;
+       *)           dflt=$vendorprefix/lib/vendor_$prog ;;
+       esac
+       fn=d~+
+       rp='Pathname for the vendor-supplied library files?'
+       . ./getfile
+       vendorlib="$ans"
+       vendorlibexp="$ansexp"
+       : Change installation prefix, if necessary.
+       if $test X"$prefix" != X"$installprefix"; then
+               installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
+       else
+               installvendorlib="$vendorlibexp"
+       fi
+       ;;
+esac
+
 : Cruising for prototypes
 echo " "
 echo "Checking out function prototypes..." >&4
@@ -4539,22 +4776,10 @@ if $test "X$ansexp" != "X$binexp"; then
 fi
 bin="$ans"
 binexp="$ansexp"
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-executables reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
-
-EOM
-       case "$installbin" in
-       '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installbin";;
-       esac
-       fn=de~
-       rp='Where will public executables be installed?'
-       . ./getfile
-       installbin="$ans"
+: Change installation prefix, if necessary.
+: XXX Bug? -- ignores Configure -Dinstallprefix setting.
+if $test X"$prefix" != X"$installprefix"; then
+       installbin=`echo $binexp | sed "s#^$prefix#$installprefix#"`
 else
        installbin="$binexp"
 fi
@@ -4562,7 +4787,7 @@ fi
 : determine whether to install perl also as /usr/bin/perl
 
 echo " "
-if test -d /usr/bin -a "X$installbin" != X/usr/bin; then
+if $test -d /usr/bin -a "X$installbin" != X/usr/bin; then
        $cat <<EOM
 Many scripts expect to perl to be installed as /usr/bin/perl.
 I can install the perl you are about to compile also as /usr/bin/perl
@@ -5113,8 +5338,7 @@ y*) usedl="$define"
        tdir=`pwd`; cd $rsrc; $ls -C $dldir/dl*.xs; cd $tdir
        rp="Source file to use for dynamic loading"
        fn="fne"
-       # XXX This getfile call will fail the existence check if you try 
-       # building away from $src (this is not supported yet).
+       gfpth="$src"
        . ./getfile
        usedl="$define"
        : emulate basename
@@ -5326,16 +5550,7 @@ EOM
        . ./myread
        case "$ans" in
        true|$define|[Yy]*)
-               useshrplib='true'
-               # Why does next4 have to be so different?
-               case "${osname}${osvers}" in
-               next4*|rhapsody*)
-                       xxx='DYLD_LIBRARY_PATH' ;;
-               os2*)   xxx='' ;; # Nothing special needed.
-               beos*)  xxx='' ;;
-               *)              xxx='LD_LIBRARY_PATH' ;;
-               esac
-               ;;
+               useshrplib='true'  ;;
        *)      useshrplib='false' ;;
        esac
        ;;
@@ -5482,10 +5697,20 @@ EOM
                ;;
        esac
 fi
+# Fix ccdlflags in AIX for building external extensions.
+# (For building Perl itself bare -bE:perl.exp is needed,
+#  Makefile.SH takes care of this.)
+case "$osname" in
+aix) ccdlflags="$ccdlflags -bE:$installarchlib/CORE/perl.exp" ;;
+esac
 # Respect a hint or command-line value.
 case "$shrpenv" in
 '') shrpenv="$tmp_shrpenv" ;;
 esac
+case "$ldlibpthname" in
+'')    ldlibpthname=LD_LIBRARY_PATH ;;
+none)  ldlibpthname='' ;;
+esac
 
 : determine where manual pages go
 set man1dir man1dir none
@@ -5530,25 +5755,13 @@ fi
 man1dir="$ans"
 man1direxp="$ansexp"
 case "$man1dir" in
-'') man1dir=' '
+'')    man1dir=' '
        installman1dir='';;
 esac
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-manual pages reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
 
-EOM
-       case "$installman1dir" in
-       '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installman1dir";;
-       esac
-       fn=de~
-       rp='Where will man pages be installed?'
-       . ./getfile
-       installman1dir="$ans"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installman1dir=`echo $man1direxp | $sed "s#^$prefix#$installprefix#"`
 else
        installman1dir="$man1direxp"
 fi
@@ -5657,52 +5870,46 @@ esac
 echo "If you don't want the manual sources installed, answer 'none'."
 prog=`echo $package | $sed 's/-*[0-9.]*$//'`
 case "$man3dir" in
-'')    case "$prefix" in 
-       *$prog*) dflt=`echo $man1dir | 
-                       $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
-       *)      dflt="$privlib/man/man3" ;;
-       esac
+'')    dflt=`echo $man1dir | $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'`
+       if $test -d "$privlib/man/man3"; then
+               cat <<EOM >&4
+
+WARNING:  Previous versions of perl installed man3 pages into
+$privlib/man/man3.  This version will suggest a 
+new default of $dflt.  
+EOM
+               tdflt=$dflt
+               dflt='n'
+               rp='Do you wish to preserve the old behavior?(y/n)'
+               . ./myread
+               case "$ans" in
+               y*) dflt="$privlib/man/man3" ;;
+               *)  dflt=$tdflt ;;
+               esac
+    fi
        ;;
 ' ') dflt=none;;
 *)     dflt="$man3dir" ;;
 esac
 echo " "
-
 fn=dn+~
 rp="Where do the $package library man pages (source) go?"
 . ./getfile
-if test "X$man3direxp" != "X$ansexp"; then
-       installman3dir=''
-fi
-
 man3dir="$ans"
 man3direxp="$ansexp"
-case "$man3dir" in
-'') man3dir=' '
+case "$man1dir" in
+'')    man3dir=' '
        installman3dir='';;
 esac
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-manual pages reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
 
-EOM
-       case "$installman3dir" in
-       '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installman3dir";;
-       esac
-       fn=de~
-       rp='Where will man pages be installed?'
-       . ./getfile
-       installman3dir="$ans"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installman3dir=`echo $man3direxp | $sed "s#^$prefix#$installprefix#"`
 else
        installman3dir="$man3direxp"
 fi
 
 : What suffix to use on installed man pages
-
 case "$man3dir" in
 ' ')
        man3ext='0'
@@ -6061,305 +6268,820 @@ EOM
        *) startperl=": # use perl"
                ;;
        esac
-       ;;
-esac
-echo "I'll use $startperl to start perl scripts."
+       ;;
+esac
+echo "I'll use $startperl to start perl scripts."
+
+: figure best path for perl in scripts
+case "$perlpath" in
+'')
+       perlpath="$binexp/perl"
+       case "$startperl" in
+       *!*) ;;
+       *)
+               $cat <<EOH
+
+I will use the "eval 'exec'" idiom to start Perl on your system.
+I can use the full path of your Perl binary for this purpose, but
+doing so may cause problems if you want to share those scripts and
+Perl is not always in a standard place ($binexp/perl).
+
+EOH
+               dflt="$binexp/perl"
+               rp="What path shall I use in \"eval 'exec'\"?"
+               . ./myread
+               perlpath="$ans"
+               ;;
+       esac
+       ;;
+esac
+case "$startperl" in
+*!*)   ;;
+*)     echo "I'll use $perlpath in \"eval 'exec'\"" ;;
+esac
+
+: determine where public executable scripts go
+set scriptdir scriptdir
+eval $prefixit
+case "$scriptdir" in
+'')
+       dflt="$bin"
+       : guess some guesses
+       $test -d /usr/share/scripts && dflt=/usr/share/scripts
+       $test -d /usr/share/bin     && dflt=/usr/share/bin
+       $test -d /usr/local/script  && dflt=/usr/local/script
+       $test -d /usr/local/scripts && dflt=/usr/local/scripts
+       $test -d $prefixexp/script  && dflt=$prefixexp/script
+       set dflt
+       eval $prefixup
+       ;;
+*)  dflt="$scriptdir"
+       ;;
+esac
+$cat <<EOM
+Some installations have a separate directory just for executable scripts so
+that they can mount it across multiple architectures but keep the scripts in
+one spot.  You might, for example, have a subdirectory of /usr/share for this.
+Or you might just lump your scripts in with all your other executables.
+EOM
+fn=d~
+rp='Where do you keep publicly executable scripts?'
+. ./getfile
+if $test "X$ansexp" != "X$scriptdirexp"; then
+       installscript=''
+fi
+scriptdir="$ans"
+scriptdirexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installscript=`echo $scriptdirexp | sed "s#^$prefix#$installprefix#"`
+else
+       installscript="$scriptdirexp"
+fi
+
+$cat <<EOM
+
+After $package is installed, you may wish to install various
+add-on modules and utilities.  Typically, these add-ons will
+be installed under $prefix with the rest
+of this package.  However, you may wish to install such add-ons
+elsewhere under a different prefix.
+
+If you do not wish to put everything under a single prefix, that's
+ok.  You will be prompted for the individual locations; this siteprefix
+is only used to suggest the defaults.
+
+The default should be fine for most people.
+
+EOM
+fn=d~+
+rp='Installation prefix to use for add-on modules and utilities?'
+: XXX Here might be another good place for an installstyle setting.
+case "$siteprefix" in
+'') dflt=$prefix ;;
+*)  dflt=$siteprefix ;;
+esac
+. ./getfile
+oldsiteprefix=''
+case "$siteprefix" in
+'') ;;
+*)
+       case "$ans" in
+       "$prefix") ;;
+       *) oldsiteprefix="$prefix";;
+       esac
+       ;;
+esac
+siteprefix="$ans"
+siteprefixexp="$ansexp"
+
+: determine where site specific libraries go.
+: Usual default is /usr/local/lib/perl5/site_perl
+: The default "style" setting is made in installstyle.U
+: XXX No longer works with Prefixit stuff.
+prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+case "$installstyle" in
+*lib/perl5*) dflt=$siteprefix/lib/site_$prog ;;
+*)      dflt=$siteprefix/lib/site_$prog ;;
+esac
+$cat <<EOM
+
+The installation process will create a directory for
+site-specific extensions and modules.  Most users find it convenient
+to place all site-specific files in this directory rather than in the
+main distribution directory.
+
+EOM
+fn=d~+
+rp='Pathname for the site-specific library files?'
+. ./getfile
+sitelib="$ans"
+sitelibexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
+else
+       installsitelib="$sitelibexp"
+fi
+
+: determine where site specific architecture-dependent libraries go.
+: sitelib  default is /usr/local/lib/perl5/site_perl/
+: sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
+: sitelib may have an optional trailing /share.
+tdflt=`echo $sitelib | $sed 's,/share$,,'`
+tdflt="$tdflt/$apiversion/$archname"
+set sitearch sitearch none
+eval $prefixit
+case "$sitearch" in
+'')    dflt="$tdflt" ;;
+*)     dflt="$sitearch" ;;
+esac
+$cat <<EOM
+
+The installation process will also create a directory for
+architecture-dependent site-specific extensions and modules.
+
+EOM
+fn=nd~+
+rp='Pathname for the site-specific architecture-dependent library files?'
+. ./getfile
+sitearch="$ans"
+sitearchexp="$ansexp"
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installsitearch=`echo $sitearchexp | sed "s#^$prefix#$installprefix#"`
+else
+       installsitearch="$sitearchexp"
+fi
+
+cat <<EOM
+
+Perl can be built to take advantage of long doubles which
+(if available) may give more accuracy and range for floating point
+numbers.  To do so, Configure must be run with -Duselongdouble.
+
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$uselongdouble" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+rp='Try to use long doubles if available?'
+. ./myread
+case "$ans" in
+y|Y)   val="$define"   ;;
+*)      val="$undef"   ;;
+esac
+set uselongdouble
+eval $setvar
+
+case "$uselongdouble" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'.  If the
+: user has specified that long doubles should be used,
+: we may need to set or change some other defaults.
+       if $test -f uselongdouble.cbu; then
+               echo "Your platform has some specific hints for long doubles, using them..."
+               . ./uselongdouble.cbu
+       else
+               $cat <<EOM
+(Your platform doesn't have any specific hints for long doubles.)
+EOM
+       fi
+       ;;
+esac
+
+cat <<EOM
+
+Previous version of $package used the standard IO mechanisms as defined
+in <stdio.h>.  Versions 5.003_02 and later of perl allow alternate IO
+mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
+the default.  This 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.  Using PerlIO with stdio is safe,
+but it is slower than plain stdio and therefore is not the default.
+
+If this doesn't make any sense to you, just accept the default 'n'.
+EOM
+case "$useperlio" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
+rp='Use the experimental 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 
+
+: Check how to convert floats to strings.
+if test "X$d_Gconvert" = X; then
+       echo " "
+       echo "Checking for an efficient way to convert floats to strings."
+       $cat >try.c <<'EOP'
+#ifdef TRY_gconvert
+#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
+char *myname = "gconvert";
+#endif
+#ifdef TRY_gcvt
+#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+char *myname = "gcvt";
+#endif
+#ifdef TRY_sprintf
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
+char *myname = "sprintf";
+#endif
+
+#include <stdio.h>
+
+int
+checkit(expect, got)
+char *expect;
+char *got;
+{
+    if (strcmp(expect, got)) {
+               printf("%s oddity:  Expected %s, got %s\n",
+                       myname, expect, got);
+               exit(1);
+       }
+}
+
+int main()
+{ 
+       char buf[64]; 
+       buf[63] = '\0';
+
+       /* This must be 1st test on (which?) platform */
+       /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
+       Gconvert(0.1, 8, 0, buf);
+       checkit("0.1", buf);
+
+       Gconvert(1.0, 8, 0, buf); 
+       checkit("1", buf);
+
+       Gconvert(0.0, 8, 0, buf); 
+       checkit("0", buf);
+
+       Gconvert(-1.0, 8, 0, buf); 
+       checkit("-1", buf);
+
+       /* Some Linux gcvt's give 1.e+5 here. */
+       Gconvert(100000.0, 8, 0, buf); 
+       checkit("100000", buf);
+       
+       /* Some Linux gcvt's give -1.e+5 here. */
+       Gconvert(-100000.0, 8, 0, buf); 
+       checkit("-100000", buf);
+
+       exit(0);
+}
+EOP
+       case "$d_Gconvert" in
+       gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+       gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+       sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+       *) xxx_list='gconvert gcvt sprintf' ;;
+       esac
 
-: figure best path for perl in scripts
-case "$perlpath" in
-'')
-       perlpath="$binexp/perl"
-       case "$startperl" in
-       *!*) ;;
-       *)
-               $cat <<EOH
+       for xxx_convert in $xxx_list; do
+               echo "Trying $xxx_convert"
+               $rm -f try try$_o
+               set try -DTRY_$xxx_convert
+               if eval $compile; then
+                       echo "$xxx_convert" found. >&4
+                       if ./try; then
+                               echo "I'll use $xxx_convert to convert floats into a string." >&4
+                               break;
+                       else
+                               echo "...But $xxx_convert didn't work as I expected."
+                       fi
+               else
+                       echo "$xxx_convert NOT found." >&4
+               fi
+       done
+               
+       case "$xxx_convert" in
+       gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+       gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+       *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
+       esac
+fi
 
-I will use the "eval 'exec'" idiom to start Perl on your system.
-I can use the full path of your Perl binary for this purpose, but
-doing so may cause problems if you want to share those scripts and
-Perl is not always in a standard place ($binexp/perl).
+: see if inttypes.h is available
+: we want a real compile instead of Inhdr because some systems
+: have an inttypes.h which includes non-existent headers
+echo " "
+$cat >try.c <<EOCP
+#include <inttypes.h>
+int main() {
+       static int32_t foo32 = 0x12345678;
+}
+EOCP
+set try
+if eval $compile; then
+       echo "<inttypes.h> found." >&4
+       val="$define"
+else
+       echo "<inttypes.h> NOT found." >&4
+       val="$undef"
+fi
+$rm -f try.c try
+set i_inttypes
+eval $setvar
 
-EOH
-               dflt="$binexp/perl"
-               rp="What path shall I use in \"eval 'exec'\"?"
-               . ./myread
-               perlpath="$ans"
-               ;;
-       esac
+: check for int64_t
+case "$use64bits" in
+"$define" )
+       echo " "
+       echo $n "Checking to see if your system supports int64_t...$c" >&4
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int64_t foo() { int64_t x; x = 7; return x; }
+EOCP
+       if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+               val="$define"
+               echo " Yup, it does." >&4
+       else
+               val="$undef"
+               echo " Nope, it doesn't." >&4
+       fi
+       $rm -f try.*
+       ;;
+*)     val="$undef"
        ;;
 esac
-case "$startperl" in
-*!*)   ;;
-*)     echo "I'll use $perlpath in \"eval 'exec'\"" ;;
-esac
+set d_int64t
+eval $setvar
 
-: determine where public executable scripts go
-set scriptdir scriptdir
-eval $prefixit
-case "$scriptdir" in
+
+: check for lengths of integral types
+echo " "
+case "$intsize" in
 '')
-       dflt="$bin"
-       : guess some guesses
-       $test -d /usr/share/scripts && dflt=/usr/share/scripts
-       $test -d /usr/share/bin && dflt=/usr/share/bin
-       $test -d /usr/local/script && dflt=/usr/local/script
-       $test -d $prefixexp/script && dflt=$prefixexp/script
-       set dflt
-       eval $prefixup
-       ;;
-*)  dflt="$scriptdir"
+       echo "Checking to see how big your integers are..." >&4
+       $cat >intsize.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+       printf("intsize=%d;\n", sizeof(int));
+       printf("longsize=%d;\n", sizeof(long));
+       printf("shortsize=%d;\n", sizeof(short));
+       exit(0);
+}
+EOCP
+       set intsize
+       if eval $compile_ok && ./intsize > /dev/null; then
+               eval `./intsize`
+               echo "Your integers are $intsize bytes long."
+               echo "Your long integers are $longsize bytes long."
+               echo "Your short integers are $shortsize bytes long."
+       else
+               $cat >&4 <<EOM
+!
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it.  Still, I'll try anyway.)
+!
+EOM
+               dflt=4
+               rp="What is the size of an integer (in bytes)?"
+               . ./myread
+               intsize="$ans"
+               dflt=$intsize
+               rp="What is the size of a long integer (in bytes)?"
+               . ./myread
+               longsize="$ans"
+               dflt=2
+               rp="What is the size of a short integer (in bytes)?"
+               . ./myread
+               shortsize="$ans"
+       fi
        ;;
 esac
-$cat <<EOM
-Some installations have a separate directory just for executable scripts so
-that they can mount it across multiple architectures but keep the scripts in
-one spot.  You might, for example, have a subdirectory of /usr/share for this.
-Or you might just lump your scripts in with all your other executables.
-EOM
-fn=d~
-rp='Where do you keep publicly executable scripts?'
-. ./getfile
-if $test "X$ansexp" != "X$scriptdirexp"; then
-       installscript=''
-fi
-scriptdir="$ans"
-scriptdirexp="$ansexp"
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-scripts reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
+$rm -f intsize intsize.*
 
-EOM
-       case "$installscript" in
-       '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installscript";;
-       esac
-       fn=de~
-       rp='Where will public scripts be installed?'
-       . ./getfile
-       installscript="$ans"
+: check for long long
+echo " "
+echo $n "Checking to see if your system supports long long...$c" >&4
+echo 'long long foo() { long long x; x = 7; return x; }' > try.c
+if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+       val="$define"
+       echo " Yup, it does." >&4
 else
-       installscript="$scriptdirexp"
+       val="$undef"
+       echo " Nope, it doesn't." >&4
 fi
+$rm try.*
+set d_longlong
+eval $setvar
 
-: determine where site specific libraries go.
-: Usual default is /usr/local/lib/perl5/site_perl/$apiversion
-prog=`echo $package | $sed 's/-*[0-9.]*$//'`
-case "$prefix" in
-*perl*) set dflt sitelib lib/site_$prog/$apiversion ;;
-*)      set dflt sitelib lib/$package/site_$prog/$apiversion ;;
+: check for length of long long
+case "${d_longlong}${longlongsize}" in
+$define)
+       echo " "
+       $echo $n "Checking to see how big your long longs are...$c" >&4
+       $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+       printf("%d\n", sizeof(long long));
+}
+EOCP
+       set try
+       if eval $compile_ok; then
+               longlongsize=`./try`
+               $echo " $longlongsize bytes." >&4
+       else
+               dflt='8'
+               echo " "
+               echo "(I can't seem to compile the test program.  Guessing...)"
+               rp="What is the size of a long long (in bytes)?"
+               . ./myread
+               longlongsize="$ans"
+       fi
+       if $test "X$longsize" = "X$longlongsize"; then
+               echo "(That isn't any different from an ordinary long.)"
+       fi      
+       ;;
 esac
-eval $prefixit
-$cat <<EOM
+$rm -f try.c try
 
-The installation process will also create a directory for
-site-specific extensions and modules.  Some users find it convenient
-to place all site-specific files in this directory rather than in the
-main distribution directory.
+echo " "
 
-EOM
-fn=d~+
-rp='Pathname for the site-specific library files?'
-. ./getfile
-if $test "X$sitelibexp" != "X$ansexp"; then
-       installsitelib=''
+if $test X"$intsize" = X8 -o X"$longsize" = X8 -o X"$d_int64t" = X"$define" -o X"$d_longlong" = X"$define"; then
+
+echo "Checking how to print 64-bit integers..." >&4
+
+if $test X"$sPRId64" = X -a X"$intsize" = X8; then
+        quad=int
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  int q = 12345678901;
+  printf("%ld\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
+                       sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
+                       echo "We will use %d."
+                       ;;
+               esac
+       fi
+fi
+
+if $test X"$sPRId64" = X -a X"$longsize" = X8; then
+        quad=long
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  long q = 12345678901;
+  printf("%ld\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
+                       sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
+                       echo "We will use %ld."
+                       ;;
+               esac
+       fi
 fi
-sitelib="$ans"
-sitelibexp="$ansexp"
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in
-which site-specific files reside from the directory in which they are
-installed (and from which they are presumably copied to the former
-directory by occult means).
 
-EOM
-       case "$installsitelib" in
-       '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installsitelib";;
-       esac
-       fn=de~
-       rp='Where will site-specific files be installed?'
-       . ./getfile
-       installsitelib="$ans"
-else
-       installsitelib="$sitelibexp"
+if $test X"$sPRId64" = X -a X"$i_inttypes.h" = X"$define" -a X"$d_int64t" = X"$define"; then
+        quad=int64_t
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <inttypes.h>
+#include <stdio.h>
+int main() {
+  int64_t q = 12345678901;
+  printf("%" PRId64 "\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
+                       sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
+                       echo "We will use the C9X style."
+                       ;;
+               esac
+       fi
 fi
 
-: determine where site specific architecture-dependent libraries go.
-: sitelib  default is /usr/local/lib/perl5/site_perl/$apiversion
-: sitearch default is /usr/local/lib/perl5/site_perl/$apiversion/$archname
-: sitelib may have an optional trailing /share.
-tdflt=`echo $sitelib | $sed 's,/share$,,'`
-tdflt="$tdflt/$archname"
-set sitearch sitearch none
-eval $prefixit
-case "$sitearch" in
-'')    dflt="$tdflt" ;;
-*)     dflt="$sitearch" ;;
-esac
-$cat <<EOM
-
-The installation process will also create a directory for
-architecture-dependent site-specific extensions and modules.
+if $test X"$sPRId64" = X -a X"$d_longlong" = X"$define" -a X"$longlongsize" = X8; then
+        quad="long long"
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
+  printf("%lld\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
+                       sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
+                       echo "We will use the %lld style."
+                       ;;
+               esac
+       fi
+fi
 
-EOM
-fn=nd~+
-rp='Pathname for the site-specific architecture-dependent library files?'
-. ./getfile
-if $test "X$sitearchexp" != "X$ansexp"; then
-       installsitearch=''
+if $test X"$sPRId64" = X -a X"$quad" != X; then
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  $quad q = 12345678901;
+  printf("%Ld\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
+                       sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
+                       echo "We will use %lld."
+                       ;;
+               esac
+       fi
 fi
-sitearch="$ans"
-sitearchexp="$ansexp"
-if $afs; then
-       $cat <<EOM
 
-Since you are running AFS, I need to distinguish the directory in
-which site-specific architecture-dependent library files reside from
-the directory in which they are installed (and from which they are
-presumably copied to the former directory by occult means).
+if $test X"$sPRId64" = X -a X"$quad" != X; then
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  $quad q = 12345678901;
+  printf("%qd\n", q);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               12345678901)
+                       sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
+                       sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
+                       echo "We will use %qd."
+                       ;;
+               esac
+       fi
+fi
 
-EOM
-       case "$installsitearch" in
-       '') dflt=`echo $sitearchexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installsitearch";;
-       esac
-       fn=de~
-       rp='Where will site-specific architecture-dependent files be installed?'
-       . ./getfile
-       installsitearch="$ans"
-else
-       installsitearch="$sitearchexp"
+if $test X"$sPRId64" = X; then
+       echo "Cannot figure out how to print 64-bit integers." >&4
 fi
 
-cat <<EOM
+$rm -f try try.*
 
-Previous version of $package used the standard IO mechanisms as defined
-in <stdio.h>.  Versions 5.003_02 and later of perl allow alternate IO
-mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
-the default.  This 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.  Using PerlIO with stdio is safe,
-but it is slower than plain stdio and therefore is not the default.
+fi # intsize -o longsize -o d_int64t -o d_longlong
 
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-case "$useperlio" in
-$define|true|[yY]*)    dflt='y';;
-*) dflt='n';;
+case "$sPRId64" in
+'')    d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; 
+       d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef"; 
+       ;;
+*)     d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; 
+       d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define"; 
+       ;;
 esac
-rp='Use the experimental PerlIO abstraction layer?'
-. ./myread
-case "$ans" in
-y|Y) 
-       val="$define"
-       ;;     
-*)      
-       echo "Ok, doing things the stdio way"
-       val="$undef"
+
+: check for length of double
+echo " "
+case "$doublesize" in
+'')
+       $echo $n "Checking to see how big your double precision numbers are...$c" >&4
+       $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+       printf("%d\n", sizeof(double));
+}
+EOCP
+       set try
+       if eval $compile_ok; then
+               doublesize=`./try`
+               $echo " $doublesize bytes." >&4
+       else
+               dflt='8'
+               echo "(I can't seem to compile the test program.  Guessing...)"
+               rp="What is the size of a double precision number (in bytes)?"
+               . ./myread
+               doublesize="$ans"
+       fi
        ;;
 esac
-set useperlio
-eval $setvar 
+$rm -f try.c try
 
-: Check how to convert floats to strings.
-if test "X$d_Gconvert" = X; then
-       echo " "
-       echo "Checking for an efficient way to convert floats to strings."
-       $cat >try.c <<'EOP'
-#ifdef TRY_gconvert
-#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
-char *myname = "gconvert";
-#endif
-#ifdef TRY_gcvt
-#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
-char *myname = "gcvt";
-#endif
-#ifdef TRY_sprintf
-#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
-char *myname = "sprintf";
-#endif
+: check for long doubles
+echo " "
+echo $n "Checking to see if your system supports long double...$c" >&4
+echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
+if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+       val="$define"
+       echo " Yup, it does." >&4
+else
+       val="$undef"
+       echo " Nope, it doesn't." >&4
+fi
+$rm try.*
+set d_longdbl
+eval $setvar
 
+: check for length of long double
+case "${d_longdbl}${longdblsize}" in
+$define)
+       echo " "
+       $echo $n "Checking to see how big your long doubles are...$c" >&4
+       $cat >try.c <<'EOCP'
 #include <stdio.h>
-
-int
-checkit(expect, got)
-char *expect;
-char *got;
+int main()
 {
-    if (strcmp(expect, got)) {
-               printf("%s oddity:  Expected %s, got %s\n",
-                       myname, expect, got);
-               exit(1);
-       }
+       printf("%d\n", sizeof(long double));
 }
+EOCP
+       set try
+       if eval $compile; then
+               longdblsize=`./try`
+               $echo " $longdblsize bytes." >&4
+       else
+               dflt='8'
+               echo " "
+               echo "(I can't seem to compile the test program.  Guessing...)" >&4
+               rp="What is the size of a long double (in bytes)?"
+               . ./myread
+               longdblsize="$ans"
+       fi
+       if $test "X$doublesize" = "X$longdblsize"; then
+               echo "(That isn't any different from an ordinary double.)"
+       fi      
+       ;;
+esac
+$rm -f try.c try
 
-int main()
-{ 
-       char buf[64]; 
-       buf[63] = '\0';
+echo " "
 
-       /* This must be 1st test on (which?) platform */
-       /* Alan Burlison <AlanBurlsin@unn.unisys.com> */
-       Gconvert(0.1, 8, 0, buf);
-       checkit("0.1", buf);
+if $test X"$d_longdbl" = X"$define"; then
 
-       Gconvert(1.0, 8, 0, buf); 
-       checkit("1", buf);
+echo "Checking how to print long doubles..." >&4
+
+if $test X"$sPRIfldbl" = X -a X"$doublesize" = X"$longdblsize"; then
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  double d = 123.456;
+  printf("%.3f\n", d);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               123.456)
+                       sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
+                       sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
+                       echo "We will use %f."
+                       ;;
+               esac
+       fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  long double d = 123.456;
+  printf("%.3llf\n", d);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               123.456)
+                       sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
+                       sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
+                       echo "We will use %llf."
+                       ;;
+               esac
+       fi
+fi
+
+if $test X"$sPRIfldbl" = X; then
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  long double d = 123.456;
+  printf("%.3Lf\n", d);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               123.456)
+                       sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
+                       sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
+                       echo "We will use %Lf."
+                       ;;
+               esac
+       fi
+fi
 
-       Gconvert(0.0, 8, 0, buf); 
-       checkit("0", buf);
+if $test X"$sPRIfldbl" = X; then
+       $cat >try.c <<'EOCP'
+#include <sys/types.h>
+#include <stdio.h>
+int main() {
+  long double d = 123.456;
+  printf("%.3lf\n", d);
+}
+EOCP
+       set try
+       if eval $compile; then
+               yyy=`./try$exe_ext`
+               case "$yyy" in
+               123.456)
+                       sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
+                       sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
+                       echo "We will use %lf."
+                       ;;
+               esac
+       fi
+fi
 
-       Gconvert(-1.0, 8, 0, buf); 
-       checkit("-1", buf);
+if $test X"$sPRIfldbl" = X; then
+       echo "Cannot figure out how to print long doubles." >&4
+fi
 
-       /* Some Linux gcvt's give 1.e+5 here. */
-       Gconvert(100000.0, 8, 0, buf); 
-       checkit("100000", buf);
-       
-       /* Some Linux gcvt's give -1.e+5 here. */
-       Gconvert(-100000.0, 8, 0, buf); 
-       checkit("-100000", buf);
+$rm -f try try.*
 
-       exit(0);
-}
-EOP
-       case "$d_Gconvert" in
-       gconvert*) xxx_list='gconvert gcvt sprintf' ;;
-       gcvt*) xxx_list='gcvt gconvert sprintf' ;;
-       sprintf*) xxx_list='sprintf gconvert gcvt' ;;
-       *) xxx_list='gconvert gcvt sprintf' ;;
-       esac
+fi # d_longdbl
 
-       for xxx_convert in $xxx_list; do
-               echo "Trying $xxx_convert"
-               $rm -f try try$_o
-               set try -DTRY_$xxx_convert
-               if eval $compile; then
-                       echo "$xxx_convert" found. >&4
-                       if ./try; then
-                               echo "I'll use $xxx_convert to convert floats into a string." >&4
-                               break;
-                       else
-                               echo "...But $xxx_convert didn't work as I expected."
-                       fi
-               else
-                       echo "$xxx_convert NOT found." >&4
-               fi
-       done
-               
-       case "$xxx_convert" in
-       gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
-       gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
-       *) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
-       esac
-fi
+case "$sPRIfldbl" in
+'')    d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; 
+       d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; 
+       ;;
+*)     d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; 
+       d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; 
+       ;;
+esac
 
 : Initialize h_fcntl
 h_fcntl=false
@@ -6417,6 +7139,14 @@ eval $inlibc
 set alarm d_alarm
 eval $inlibc
 
+: see if atolf exists
+set atolf d_atolf
+eval $inlibc
+
+: see if atoll exists
+set atoll d_atoll
+eval $inlibc
+
 : Look for GNU-cc style attribute checking
 echo " "
 echo "Checking whether your compiler can handle __attribute__ ..." >&4
@@ -6579,52 +7309,6 @@ $rm -f set set.c
 set bzero d_bzero
 eval $inlibc
 
-: check for lengths of integral types
-echo " "
-case "$intsize" in
-'')
-       echo "Checking to see how big your integers are..." >&4
-       $cat >intsize.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("intsize=%d;\n", sizeof(int));
-       printf("longsize=%d;\n", sizeof(long));
-       printf("shortsize=%d;\n", sizeof(short));
-       exit(0);
-}
-EOCP
-       set intsize
-       if eval $compile_ok && ./intsize > /dev/null; then
-               eval `./intsize`
-               echo "Your integers are $intsize bytes long."
-               echo "Your long integers are $longsize bytes long."
-               echo "Your short integers are $shortsize bytes long."
-       else
-               $cat >&4 <<EOM
-!
-Help! I can't compile and run the intsize test program: please enlighten me!
-(This is probably a misconfiguration in your system or libraries, and
-you really ought to fix it.  Still, I'll try anyway.)
-!
-EOM
-               dflt=4
-               rp="What is the size of an integer (in bytes)?"
-               . ./myread
-               intsize="$ans"
-               dflt=$intsize
-               rp="What is the size of a long integer (in bytes)?"
-               . ./myread
-               longsize="$ans"
-               dflt=2
-               rp="What is the size of a short integer (in bytes)?"
-               . ./myread
-               shortsize="$ans"
-       fi
-       ;;
-esac
-$rm -f intsize intsize.*
-
 : see if signal is declared as pointer to function returning int or void
 echo " "
 xxx=`./findhdr signal.h`
@@ -7121,52 +7805,10 @@ $rm -f dbl_dig.?
 set d_dbl_dig
 eval $setvar
 
-
-if $test X"$use64bits" = X"$define"; then
-       : see if dbminit64 exists
-       set dbminit64 d_dbminit64
-       eval $inlibc
-
-       : see if dbmclose64 exists
-       set dbmclose64 d_dbmclose64
-       eval $inlibc
-
-       : see if fetch64 exists
-       set fetch64 d_fetch64
-       eval $inlibc
-
-       : see if store64 exists
-       set store64 d_store64
-       eval $inlibc
-
-       : see if delete64 exists
-       set delete64 d_delete64
-       eval $inlibc
-
-       : see if firstkey64 exists
-       set firstkey64 d_firstkey64
-       eval $inlibc
-
-       : see if nextkey64 exists
-       set nextkey64 d_nextkey64
-       eval $inlibc
-else
-       val="$undef"
-       for xxx in d_dbminit64 d_dbmclose64 d_fetch64 d_store64 d_delete64 d_firstkey64 d_nextkey64
-       do
-               set $xxx
-               eval $setvar
-       done
-fi
-
 : see if difftime exists
 set difftime d_difftime
 eval $inlibc
 
-: see if sys/stat.h is available
-set sys/stat.h i_sysstat
-eval $inhdr
-
 : see if this is a dirent system
 echo " "
 if xinc=`./findhdr dirent.h`; $test "$xinc"; then
@@ -7174,222 +7816,66 @@ if xinc=`./findhdr dirent.h`; $test "$xinc"; then
        echo "<dirent.h> found." >&4
 else
        val="$undef"
-       if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
-               echo "<sys/dir.h> found." >&4
-               echo " "
-       else
-               xinc=`./findhdr sys/ndir.h`
-       fi
-       echo "<dirent.h> NOT found." >&4
-fi
-set i_dirent
-eval $setvar
-
-: Look for type of directory structure.
-echo " "
-$cppstdin $cppflags $cppminus < "$xinc" > try.c
-
-case "$direntrytype" in
-''|' ')
-       case "$i_dirent" in
-       $define) guess1='struct dirent' ;;
-       *) guess1='struct direct'  ;;
-       esac
-       ;;
-*)     guess1="$direntrytype"
-       ;;
-esac
-
-case "$guess1" in
-'struct dirent') guess2='struct direct' ;;
-*) guess2='struct dirent' ;;
-esac
-               
-if $contains "$guess1" try.c >/dev/null 2>&1; then
-       direntrytype="$guess1"
-       echo "Your directory entries are $direntrytype." >&4
-elif $contains "$guess2" try.c >/dev/null 2>&1; then
-       direntrytype="$guess2"
-       echo "Your directory entries seem to be $direntrytype." >&4
-else
-       echo "I don't recognize your system's directory entries." >&4
-       rp="What type is used for directory entries on this system?"
-       dflt="$guess1"
-       . ./myread
-       direntrytype="$ans"
-fi
-$rm -f try.c
-
-
-: see if the directory entry stores field length
-echo " "
-$cppstdin $cppflags $cppminus < "$xinc" > try.c
-if $contains 'd_namlen' try.c >/dev/null 2>&1; then
-       echo "Good, your directory entry keeps length information in d_namlen." >&4
-       val="$define"
-else
-       echo "Your directory entry does not know about the d_namlen field." >&4
-       val="$undef"
-fi
-set d_dirnamlen
-eval $setvar
-$rm -f try.c
-
-
-if $test X"$use64bits" = X"$define"; then
-       : see if fstat64 exists
-       set fstat64 d_fstat64
-       eval $inlibc
-
-       : see if ftruncate64 exists
-       set ftruncate64 d_ftruncate64
-       eval $inlibc
-
-       : see if lockf64 exists
-       set lockf64 d_lockf64
-       eval $inlibc
-
-       : see if llseek exists
-       set llseek d_llseek
-       eval $inlibc
-
-       : see if lseek64 exists
-       set lseek64 d_lseek64
-       eval $inlibc
-
-       : see if lstat64 exists
-       set lstat64 d_lstat64
-       eval $inlibc
-
-       : see if open64 exists
-       set open64 d_open64
-       eval $inlibc
-
-       : see if opendir64 exists
-       set opendir64 d_opendir64
-       eval $inlibc
-
-       : see if readdir64 exists
-       set readdir64 d_readdir64
-       eval $inlibc
-
-       : see if seekdir64 exists
-       set seekdir64 d_seekdir64
-       eval $inlibc
-
-       : see if stat64 exists
-       set stat64 d_stat64
-       eval $inlibc
-
-       : see if telldir64 exists
-       set telldir64 d_telldir64
-       eval $inlibc
-
-       : see if truncate64 exists
-       set truncate64 d_truncate64
-       eval $inlibc
-
-       : check for off64_t
-       echo " "
-       echo $n "Checking to see if your system supports off64_t...$c" >&4
-       $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <unistd.h>
-off64_t foo() { off64_t x; x = 7; return x; }'
-EOCP
-       if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
-               val="$define"
-               echo " Yup, it does." >&4
-       else
-               val="$undef"
-               echo " Nope, it doesn't." >&4
-       fi
-       $rm -f try.*
-       set d_off64_t
-       eval $setvar
-
-       : check for offset_t
-       echo " "
-       echo $n "Checking to see if your system supports offset_t...$c" >&4
-       $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <unistd.h>
-offset_t foo() { offset_t x; x = 7; return x; }'
-EOCP
-       if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
-               val="$define"
-               echo " Yup, it does." >&4
-       else
-               val="$undef"
-               echo " Nope, it doesn't." >&4
-       fi
-       $rm -f try.*
-       set d_offset_t
-       eval $setvar
-
-       : check for ino64_t
-       echo " "
-       echo $n "Checking to see if your system supports ino64_t...$c" >&4
-       val="$undef"
-       case "$i_sysstat" in
-       "$define" )
-               $cat >try.c <<EOCP
-#include <sys/types.h>
-#include <sys/stat.h>
-ino64_t foo() { ino64_t x; x = 7; return x; }'
-EOCP
-               if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
-                       val="$define"
-               fi
-               $rm -f try.*
-               ;;
-       esac
-       if $test "X$val" = X"$define"; then
-               echo " Yup, it does." >&4
+       if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
+               echo "<sys/dir.h> found." >&4
+               echo " "
        else
-               echo " Nope, it doesn't." >&4
+               xinc=`./findhdr sys/ndir.h`
        fi
-       set d_ino64_t
-       eval $setvar
+       echo "<dirent.h> NOT found." >&4
+fi
+set i_dirent
+eval $setvar
 
-       : check for struct flock64
-       echo " "
-       echo "Checking to see if your system supports struct flock64..." >&4
-       if $h_fcntl; then
-               set d_flock64_s flock64 l_len define fcntl.h
-               eval $hasfield
-       else
-               val="$undef"
-               set d_flock64_s
-               eval $setvar
-       fi
-       case "$d_flock64_s" in
-       "$define")      echo "Yup, it does." >&4
-                       ;;
-       *)              echo "Nope, it doesn't." >&4
-                       ;;
-       esac
+: Look for type of directory structure.
+echo " "
+$cppstdin $cppflags $cppminus < "$xinc" > try.c
 
-       : check for struct dirent64
-       echo " "
-       echo "Checking to see if your system supports struct dirent64..." >&4
-       set d_dirent64_s dirent64 d_off $i_dirent dirent.h
-       eval $hasfield
-       case "$d_dirent64_s" in
-       "$define")      echo "Yup, it does." >&4
-                       ;;
-       *)              echo "Nope, it doesn't." >&4
-                       ;;
+case "$direntrytype" in
+''|' ')
+       case "$i_dirent" in
+       $define) guess1='struct dirent' ;;
+       *) guess1='struct direct'  ;;
        esac
+       ;;
+*)     guess1="$direntrytype"
+       ;;
+esac
+
+case "$guess1" in
+'struct dirent') guess2='struct direct' ;;
+*) guess2='struct dirent' ;;
+esac
+               
+if $contains "$guess1" try.c >/dev/null 2>&1; then
+       direntrytype="$guess1"
+       echo "Your directory entries are $direntrytype." >&4
+elif $contains "$guess2" try.c >/dev/null 2>&1; then
+       direntrytype="$guess2"
+       echo "Your directory entries seem to be $direntrytype." >&4
+else
+       echo "I don't recognize your system's directory entries." >&4
+       rp="What type is used for directory entries on this system?"
+       dflt="$guess1"
+       . ./myread
+       direntrytype="$ans"
+fi
+$rm -f try.c
+
 
+: see if the directory entry stores field length
+echo " "
+$cppstdin $cppflags $cppminus < "$xinc" > try.c
+if $contains 'd_namlen' try.c >/dev/null 2>&1; then
+       echo "Good, your directory entry keeps length information in d_namlen." >&4
+       val="$define"
 else
+       echo "Your directory entry does not know about the d_namlen field." >&4
        val="$undef"
-       for xxx in d_fstat64 d_ftruncate64 d_lockf64 d_lseek64 d_lstat64 d_open64 d_opendir64 d_readdir64 d_seekdir64 d_stat64 d_telldir64 d_truncate64 d_off64_t d_offset_t d_ino64_t d_flock64_s d_dirent64_s
-       do
-               set $xxx
-               eval $setvar
-       done
 fi
+set d_dirnamlen
+eval $setvar
+$rm -f try.c
 
 : see if dlerror exists
 xxx_runnm="$runnm"
@@ -7498,6 +7984,7 @@ EOM
                esac
        else
                echo "I can't compile and run the test program." >&4
+                echo "I'm guessing that dlsym doesn't need a leading underscore." >&4
        fi
        ;;
 esac
@@ -7563,6 +8050,10 @@ eval $inlibc
 set endservent d_endsent
 eval $inlibc
 
+: see if endspent exists
+set endspent d_endspent
+eval $inlibc
+
 : Locate the flags for 'open()'
 echo " "
 $cat >open3.c <<'EOCP'
@@ -7968,52 +8459,6 @@ $rm -f fd_set*
 set fgetpos d_fgetpos
 eval $inlibc
 
-
-if $test X"$use64bits" = X"$define"; then
-       : see if fgetpos64 exists
-       set fgetpos64 d_fgetpos64
-       eval $inlibc
-
-       : see if fopen64 exists
-       set freopen64 d_fopen64
-       eval $inlibc
-
-       : see if freopen64 exists
-       set freopen64 d_freopen64
-       eval $inlibc
-
-       : see if fseek64 exists
-       set fseek64 d_fseek64
-       eval $inlibc
-
-       : see if fseeko64 exists
-       set fseeko64 d_fseeko64
-       eval $inlibc
-
-       : see if fsetpos64 exists
-       set fsetpos64 d_fsetpos64
-       eval $inlibc
-
-       : see if ftell64 exists
-       set ftell64 d_ftell64
-       eval $inlibc
-
-       : see if ftello64 exists
-       set ftello64 d_ftello64
-       eval $inlibc
-
-       : see if tmpfile64 exists
-       set tmpfile64 d_tmpfile64
-       eval $inlibc
-else
-       val="$undef"
-       for xxx in d_fgetpos64 d_fopen64 d_freopen64 d_fseek64 d_fseeko64 d_fsetpos64 d_ftell64 d_ftello64 d_tmpfile64
-       do
-               set $xxx
-               eval $setvar
-       done
-fi
-
 : see if flock exists
 set flock d_flock
 eval $inlibc
@@ -8030,6 +8475,48 @@ eval $inlibc
 set fpathconf d_fpathconf
 eval $inlibc
 
+
+: see if llseek exists
+set llseek d_llseek
+eval $inlibc
+
+: check for off64_t
+echo " "
+echo $n "Checking to see if your system supports off64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <unistd.h>
+off64_t foo() { off64_t x; x = 7; return x; }'
+EOCP
+if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+       val="$define"
+       echo " Yup, it does." >&4
+else
+       val="$undef"
+       echo " Nope, it doesn't." >&4
+fi
+$rm -f try.*
+set d_off64_t
+eval $setvar
+
+: check for fpos64_t
+echo " "
+echo $n "Checking to see if your system supports fpos64_t...$c" >&4
+$cat >try.c <<EOCP
+#include <sys/stdio.h>
+fpos64_t foo() { fpos64_t x; x = 7; return x; }'
+EOCP
+if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+       val="$define"
+       echo " Yup, it does." >&4
+else
+       val="$undef"
+       echo " Nope, it doesn't." >&4
+fi
+$rm -f try.*
+set d_fpos64_t
+eval $setvar
+
 : see if fseeko exists
 set fseeko d_fseeko
 eval $inlibc
@@ -8264,6 +8751,14 @@ echo " "
 set d_getservprotos getservent $i_netdb netdb.h
 eval $hasproto
 
+: see if getspent exists
+set getspent d_getspent
+eval $inlibc
+
+: see if getspnam exists
+set getspnam d_getspnam
+eval $inlibc
+
 : see if gettimeofday or ftime exists
 set gettimeofday d_gettimeod
 eval $inlibc
@@ -8417,57 +8912,6 @@ set d_index; eval $setvar
 set inet_aton d_inetaton
 eval $inlibc
 
-: see if inttypes.h is available
-: we want a real compile instead of Inhdr because some systems
-: have an inttypes.h which includes non-existent headers
-echo " "
-$cat >try.c <<EOCP
-#include <inttypes.h>
-int main() {
-       static int32_t foo32 = 0x12345678;
-}
-EOCP
-set try
-if eval $compile; then
-       echo "<inttypes.h> found." >&4
-       val="$define"
-else
-       echo "<inttypes.h> NOT found." >&4
-       val="$undef"
-fi
-$rm -f try.c try
-set i_inttypes
-eval $setvar
-
-: check for int64_t
-case "$use64bits" in
-"$define" )
-       echo " "
-       echo $n "Checking to see if your system supports int64_t...$c" >&4
-       $cat >try.c <<EOCP
-#include <sys/types.h>
-#$i_inttypes I_INTTYPES
-#ifdef I_INTTYPES
-#include <inttypes.h>
-#endif
-int64_t foo() { int64_t x; x = 7; return x; }
-EOCP
-       if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
-               val="$define"
-               echo " Yup, it does." >&4
-       else
-               val="$undef"
-               echo " Nope, it doesn't." >&4
-       fi
-       $rm -f try.*
-       ;;
-*)     val="$undef"
-       ;;
-esac
-set d_int64t
-eval $setvar
-
-
 : Look for isascii
 echo " "
 $cat >isascii.c <<'EOCP'
@@ -8509,156 +8953,64 @@ $cat > try.c <<'EOCP'
 char lchown();
 int main() {
     /*  The GNU C library defines this for functions which it implements
-        to always fail with ENOSYS.  Some functions are actually named
-       something starting with __ and the normal name is an alias.  */
-#if defined (__stub_lchown) || defined (__stub___lchown)
-choke me
-#else
-lchown();
-#endif
-; return 0; }
-EOCP
-set try
-if eval $compile; then
-    $echo "lchown() found." >&4
-    val="$define"
-else
-    $echo "lchown() NOT found." >&4
-    val="$undef"
-fi
-set d_lchown
-eval $setvar
-
-: see if link exists
-set link d_link
-eval $inlibc
-
-: see if localeconv exists
-set localeconv d_locconv
-eval $inlibc
-
-: see if lockf exists
-set lockf d_lockf
-eval $inlibc
-
-: check for length of double
-echo " "
-case "$doublesize" in
-'')
-       $echo $n "Checking to see how big your double precision numbers are...$c" >&4
-       $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("%d\n", sizeof(double));
-}
-EOCP
-       set try
-       if eval $compile_ok; then
-               doublesize=`./try`
-               $echo " $doublesize bytes." >&4
-       else
-               dflt='8'
-               echo "(I can't seem to compile the test program.  Guessing...)"
-               rp="What is the size of a double precision number (in bytes)?"
-               . ./myread
-               doublesize="$ans"
-       fi
-       ;;
-esac
-$rm -f try.c try
-
-: check for long doubles
-echo " "
-echo $n "Checking to see if your system supports long doubles...$c" >&4
-echo 'long double foo() { long double x; x = 7.0; return x; }' > try.c
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
-       val="$define"
-       echo " Yup, it does." >&4
+        to always fail with ENOSYS.  Some functions are actually named
+       something starting with __ and the normal name is an alias.  */
+#if defined (__stub_lchown) || defined (__stub___lchown)
+choke me
+#else
+lchown();
+#endif
+; return 0; }
+EOCP
+set try
+if eval $compile; then
+    $echo "lchown() found." >&4
+    val="$define"
 else
-       val="$undef"
-       echo " Nope, it doesn't." >&4
+    $echo "lchown() NOT found." >&4
+    val="$undef"
 fi
-$rm try.*
-set d_longdbl
+set d_lchown
 eval $setvar
 
-: check for length of long double
-case "${d_longdbl}${longdblsize}" in
-$define)
-       echo " "
-       $echo $n "Checking to see how big your long doubles are...$c" >&4
-       $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("%d\n", sizeof(long double));
-}
-EOCP
-       set try
-       if eval $compile; then
-               longdblsize=`./try`
-               $echo " $longdblsize bytes." >&4
-       else
-               dflt='8'
-               echo " "
-               echo "(I can't seem to compile the test program.  Guessing...)" >&4
-               rp="What is the size of a long double (in bytes)?"
-               . ./myread
-               longdblsize="$ans"
-       fi
-       if $test "X$doublesize" = "X$longdblsize"; then
-               echo "(That isn't any different from an ordinary double.)"
-       fi      
-       ;;
-esac
-$rm -f try.c try
-
-: check for long long
+: See if number of significant digits in a double precision number is known
 echo " "
-echo $n "Checking to see if your system supports long long...$c" >&4
-echo 'long long foo() { long long x; x = 7; return x; }' > try.c
-if $cc $optimize $ccflags -c try.c >/dev/null 2>&1; then
+$cat >ldbl_dig.c <<EOM
+#$i_limits I_LIMITS
+#$i_float I_FLOAT
+#ifdef I_LIMITS
+#include <limits.h>
+#endif
+#ifdef I_FLOAT
+#include <float.h>
+#endif
+#ifdef LDBL_DIG
+printf("Contains LDBL_DIG");
+#endif
+EOM
+$cppstdin $cppflags $cppminus < ldbl_dig.c >ldbl_dig.E 2>/dev/null
+if $contains 'LDBL_DIG' ldbl_dig.E >/dev/null 2>&1; then
+       echo "LDBL_DIG found." >&4
        val="$define"
-       echo " Yup, it does." >&4
 else
+       echo "LDBL_DIG NOT found." >&4
        val="$undef"
-       echo " Nope, it doesn't." >&4
 fi
-$rm try.*
-set d_longlong
+$rm -f ldbl_dig.?
+set d_ldbl_dig
 eval $setvar
 
-: check for length of long long
-case "${d_longlong}${longlongsize}" in
-$define)
-       echo " "
-       $echo $n "Checking to see how big your long longs are...$c" >&4
-       $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("%d\n", sizeof(long long));
-}
-EOCP
-       set try
-       if eval $compile_ok; then
-               longlongsize=`./try`
-               $echo " $longlongsize bytes." >&4
-       else
-               dflt='8'
-               echo " "
-               echo "(I can't seem to compile the test program.  Guessing...)"
-               rp="What is the size of a long long (in bytes)?"
-               . ./myread
-               longlongsize="$ans"
-       fi
-       if $test "X$longsize" = "X$longlongsize"; then
-               echo "(That isn't any different from an ordinary long.)"
-       fi      
-       ;;
-esac
-$rm -f try.c try
+: see if link exists
+set link d_link
+eval $inlibc
+
+: see if localeconv exists
+set localeconv d_locconv
+eval $inlibc
+
+: see if lockf exists
+set lockf d_lockf
+eval $inlibc
 
 : see if lstat exists
 set lstat d_lstat
@@ -8680,6 +9032,10 @@ eval $inlibc
 set mbtowc d_mbtowc
 eval $inlibc
 
+: see if memchr exists
+set memchr d_memchr
+eval $inlibc
+
 : see if memcmp exists
 set memcmp d_memcmp
 eval $inlibc
@@ -9612,6 +9968,10 @@ eval $inlibc
 set setsid d_setsid
 eval $inlibc
 
+: see if setspent exists
+set setspent d_setspent
+eval $inlibc
+
 : see if setvbuf exists
 set setvbuf d_setvbuf
 eval $inlibc
@@ -9822,6 +10182,10 @@ set d_sigsetjmp
 eval $setvar
 $rm -f try.c try
 
+: see if sys/stat.h is available
+set sys/stat.h i_sysstat
+eval $inhdr
+
 : see if stat knows about block sizes
 echo " "
 set d_statblks stat st_blocks $i_sysstat sys/stat.h
@@ -9829,7 +10193,7 @@ eval $hasfield
 
 : see if _ptr and _cnt from stdio act std
 echo " "
-if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
+if $contains '_IO_fpos_t' `./findhdr stdio.h` `./findhdr libio.h` >/dev/null 2>&1 ; then
        echo "(Looks like you have stdio.h from Linux.)"
        case "$stdio_ptr" in
        '') stdio_ptr='((fp)->_IO_read_ptr)'
@@ -9954,6 +10318,41 @@ esac
 set d_stdiobase
 eval $setvar
 
+$cat >&4 <<EOM
+Checking how to access stdio streams by file descriptor number...
+EOM
+case "$stdio_stream_array" in
+'')    $cat >try.c <<EOCP
+#include <stdio.h>
+int main() {
+  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
+    printf("yes\n");
+}
+EOCP
+       for s in _iob __iob __sF
+       do
+               set try -DSTDIO_STREAM_ARRAY=$s
+               if eval $compile; then
+                       case "`./try$exe_ext`" in
+                       yes)    stdio_stream_array=$s; break ;;
+                       esac
+               fi
+       done
+       $rm -f try.* try$exe_ext
+esac
+case "$stdio_stream_array" in
+'')    $cat >&4 <<EOM
+I can't figure out how to access stdio streams by file descriptor number.
+EOM
+       d_stdio_stream_array="$undef"
+       ;;
+*)     $cat >&4 <<EOM
+You can access stdio streams by file descriptor number by the $stdio_stream_array array.
+EOM
+       d_stdio_stream_array="$define"
+       ;;
+esac
+
 : see if strcoll exists
 set strcoll d_strcoll
 eval $inlibc
@@ -10033,6 +10432,10 @@ eval $inlibc
 set strtoul d_strtoul
 eval $inlibc
 
+: see if strtoull exists
+set strtoull d_strtoull
+eval $inlibc
+
 : see if strxfrm exists
 set strxfrm d_strxfrm
 eval $inlibc
@@ -10403,7 +10806,7 @@ You seem to be either cross-compiling or doing a multiarchitecture build,
 skipping the byteorder check.
 
 EOM
-       byteorder=''
+       byteorder='0xffff'
        ;;
 *)
        case "$byteorder" in
@@ -10412,8 +10815,9 @@ EOM
 In the following, larger digits indicate more significance.  A big-endian
 machine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
 little-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
-machines may have weird orders like 3412.  A Cray will report 87654321. If
-the test program works the default is probably right.
+machines may have weird orders like 3412.  A Cray will report 87654321,
+an Alpha will report 12345678. If the test program works the default is
+probably right.
 I'm now running the test program...
 EOM
                $cat >try.c <<'EOCP'
@@ -10910,7 +11314,7 @@ if eval $compile_ok; then
                echo "You have EBCDIC." >&4
                val="$define"
        else
-               echo "Nope, no EBCDIC.  Assuming ASCII or some ISO Latin." >&4
+               echo "Nope, no EBCDIC.  Assuming ASCII or some ISO Latin, or UTF." >&4
        fi
 else
        echo "I'm unable to compile the test program." >&4
@@ -10920,160 +11324,194 @@ $rm -f tebcdic.c tebcdic
 set ebcdic
 eval $setvar
 
-$cat >&4 <<EOM
-Checking how to access stdio streams by file descriptor number...
-EOM
-case "$stdio_stream_array" in
-'')    $cat >try.c <<EOCP
-#include <stdio.h>
-int main() {
-  if (&STDIO_STREAM_ARRAY[fileno(stdin)] == stdin)
-    printf("yes\n");
-}
-EOCP
-       for s in _iob __iob __sF
-       do
-               set try -DSTDIO_STREAM_ARRAY=$s
-               if eval $compile_ok; then
-                       case "`./try$exe_ext`" in
-                       yes)    stdio_stream_array=$s; break ;;
-                       esac
-               fi
-       done
-       $rm -f try.* try$exe_ext
-esac
-case "$stdio_stream_array" in
-'')    $cat >&4 <<EOM
-I can't figure out how to access stdio streams by file descriptor number.
-EOM
-       ;;
-*)     $cat >&4 <<EOM
-You can access stdio streams by file descriptor number by using $stdio_stream_array.
-EOM
-       ;;
-esac
-
+echo " "
 $cat >&4 <<EOM
 Checking how to flush all pending stdio output...
 EOM
-$cat >try.c <<EOCP
+# I only know how to find the first 32 possibly open files on SunOS.
+# See also hints/sunos_4_1.sh and util.c  --AD
+case "$osname" in
+sunos) $echo '#define PERL_FFLUSH_ALL_FOPEN_MAX 32' > try.c ;;
+esac
+$cat >>try.c <<EOCP
 #include <stdio.h>
 #$i_unistd I_UNISTD
 #ifdef I_UNISTD
-#include <unistd.h>
+# include <unistd.h>
 #endif
 #$d_sysconf HAS_SYSCONF
+#$d_stdio_stream_array HAS_STDIO_STREAM_ARRAY
+#ifdef HAS_STDIO_STREAM_ARRAY
+# define STDIO_STREAM_ARRAY $stdio_stream_array
+#endif
 int main() {
   FILE* p = fopen("try.out", "w");
+#ifdef TRY_FPUTC
   fputc('x', p);
+#else
+# ifdef TRY_FPRINTF
+  fprintf(p, "x");
+# endif
+#endif
 #ifdef TRY_FFLUSH_NULL
   fflush(NULL);
 #endif
 #ifdef TRY_FFLUSH_ALL
   {
     long open_max = -1;
-# if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
-    open_max = sysconf(_SC_OPEN_MAX);
+# ifdef PERL_FFLUSH_ALL_FOPEN_MAX
+    open_max = PERL_FFLUSH_ALL_FOPEN_MAX;
 # else
-#  ifdef FOPEN_MAX
-#   open_max = FOPEN_MAX;
+#  if defined(HAS_SYSCONF) && defined(_SC_OPEN_MAX)
+    open_max = sysconf(_SC_OPEN_MAX);
 #  else
-#   ifdef OPEN_MAX
-#   open_max = OPEN_MAX;
+#   ifdef FOPEN_MAX
+    open_max = FOPEN_MAX;
 #   else
-#    ifdef _NFILE
-#   open_max = _NFILE;
+#    ifdef OPEN_MAX
+    open_max = OPEN_MAX;
+#    else
+#     ifdef _NFILE
+    open_max = _NFILE;
+#     endif
 #    endif
 #   endif
 #  endif
-# endif
+# endif 
+# ifdef HAS_STDIO_STREAM_ARRAY
     if (open_max > 0) {
       long i;
       for (i = 0; i < open_max; i++)
-         fflush(&$stdio_stream_array[i]);
+           if (STDIO_STREAM_ARRAY[i]._file >= 0 &&
+               STDIO_STREAM_ARRAY[i]._file < open_max &&
+               STDIO_STREAM_ARRAY[i]._flag)
+               fflush(&STDIO_STREAM_ARRAY[i]);
     }  
   }
+# endif
 #endif
   _exit(42);
 }
 EOCP
+: first we have to find out how _not_ to flush
+if $test "X$fflushNULL" = X -o "X$fflushall" = X; then
+    output=''
+    set try -DTRY_FPUTC
+    if eval $compile; then
+           $rm -f try.out
+           ./try$exe_ext 2>/dev/null
+           if $test ! -s try.out -a "X$?" = X42; then
+               output=-DTRY_FPUTC
+           fi
+    fi
+    case "$output" in
+    '')
+           set try -DTRY_FPRINTF
+           $rm -f try.out
+           if eval $compile; then
+                   $rm -f try.out
+                   ./try$exe_ext 2>/dev/null
+                   if $test ! -s try.out -a "X$?" = X42; then
+                       output=-DTRY_FPRINTF
+                   fi
+           fi
+       ;;
+    esac
+fi
 : check for fflush NULL behaviour
 case "$fflushNULL" in
-'')    set try -DTRY_FFLUSH_NULL
-       $rm -f try.out
-       if eval $compile_ok; then
+'')    set try -DTRY_FFLUSH_NULL $output
+       if eval $compile; then
+               $rm -f try.out
                ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
+               code="$?"
+               if $test -s try.out -a "X$code" = X42; then
                        fflushNULL="`$cat try.out`"
+               else
+                       if $test "X$code" != X42; then
+                               $cat >&4 <<EOM
+(If this test failed, don't worry, we'll try another method shortly.)
+EOM
+                       fi
                fi
-               $rm -f core try.core core.try.*
        fi
+       $rm -f core try.core core.try.*
        case "$fflushNULL" in
-       x)      cat >&4 <<EOM
+       x)      $cat >&4 <<EOM
 Your fflush(NULL) works okay.
 EOM
-               fflushNULL=define
+               fflushNULL="$define"
                ;;
-       '')     cat >&4 <<EOM
+       '')     $cat >&4 <<EOM
 Your fflush(NULL) isn't working (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
-       *)      cat >&4 <<EOM
+       *)      $cat >&4 <<EOM
 Cannot figure out whether your fflush(NULL) works or not.
 I'm assuming it doesn't (contrary to ANSI C).
 EOM
-               fflushNULL=undef
+               fflushNULL="$undef"
                ;;
        esac
        ;;
 $define|true|[yY]*)
-       fflushNULL=define
+       fflushNULL="$define"
        ;;
 *)
-       fflushNULL=undef
+       fflushNULL="$undef"
        ;;
 esac
-: check for fflush all behaviour
-case "$fflushall" in
-'')    set try -DTRY_FFLUSH_ALL
-       $rm -f try.out
-       if eval $compile_ok; then
-               ./try$exe_ext 2>/dev/null
-               if $test -s try.out -a "X$?" = X42; then
-                       fflushall="`$cat try.out`"
+: check explicit looping only if NULL did not work
+case "$fflushNULL" in
+"$undef")
+       : check for fflush all behaviour
+       case "$fflushall" in
+       '')     set try -DTRY_FFLUSH_ALL $output
+               if eval $compile; then
+                       $cat >&4 <<EOM
+(Now testing the other method--but note that also this may fail.)
+EOM
+                       $rm -f try.out
+                       ./try$exe_ext 2>/dev/null
+                       if $test -s try.out -a "X$?" = X42; then
+                               fflushall="`$cat try.out`"
+                       fi
                fi
                $rm -f core try.core core.try.*
-       fi
-       case "$fflushall" in
-       x)      cat >&4 <<EOM
-Flushing explicitly all the stdio streams works.
+               case "$fflushall" in
+               x)      $cat >&4 <<EOM
+Whew. Flushing explicitly all the stdio streams works.
 EOM
-               fflushall=define
-               ;;
-       '')     cat >&4 <<EOM
-Flushing explicitly all the stdio streams doesn't work.
+                       fflushall="$define"
+                       ;;
+               '')     $cat >&4 <<EOM
+Sigh. Flushing explicitly all the stdio streams doesn't work.
 EOM
-               fflushall=undef
-               ;;
-       *)      cat >&4 <<EOM
-Cannot figure out whether flushing stdio stream explicitly works or not.
+                       fflushall="$undef"
+                       ;;
+               *)      $cat >&4 <<EOM
+Cannot figure out whether flushing stdio streams explicitly works or not.
 I'm assuming it doesn't.
 EOM
-               fflushall=undef
+                       fflushall="$undef"
+                       ;;
+               esac
+               ;;
+       "$define"|true|[yY]*)
+               fflushall="$define"
+               ;;
+       *)
+               fflushall="$undef"
                ;;
        esac
        ;;
-$define|true|[yY]*)
-       fflushall=define
-       ;;
-*)
-       fflushall=undef
+*)     fflushall="$undef"      
        ;;
 esac
 case "$fflushNULL$fflushall" in
 undefundef)
-       cat <<EOM
+       $cat <<EOM
 I cannot figure out how to flush pending stdio output.
 EOM
        ;;
@@ -11558,6 +11996,10 @@ EOM
 #ifdef I_SYS_SELECT
 #include <sys/select.h>
 #endif
+#$d_socket HAS_SOCKET
+#ifdef HAS_SOCKET
+#   include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
+#endif
 #include <stdio.h>
 $selecttype b;
 #define S sizeof(*(b))
@@ -12313,6 +12755,14 @@ set i_termio; eval $setvar
 val=$val2; set i_sgtty; eval $setvar
 val=$val3; set i_termios; eval $setvar
 
+: see if this is a shadow.h system
+set shadow.h i_shadow
+eval $inhdr
+
+: see if this is a socks.h system
+set socks.h i_socks
+eval $inhdr
+
 : see if stdarg is available
 echo " "
 if $test `./findhdr stdarg.h`; then
@@ -12501,8 +12951,6 @@ eval $setvar
 
 echo " "
 echo "Looking for extensions..." >&4
-tdir=`pwd`
-cd $rsrc/ext
 : If we are using the old config.sh, known_extensions may contain
 : old or inaccurate or duplicate values.
 known_extensions=''
@@ -12511,30 +12959,35 @@ nonxs_extensions=''
 : We do not just use MANIFEST because the user may have dropped
 : some additional extensions into the source tree and expect them
 : to be built.
-for xxx in * ; do
-       case "$xxx" in
-       DynaLoader|dynaload) ;;
-       *)      if $test -f $xxx/$xxx.xs; then
-                       known_extensions="$known_extensions $xxx"
-               elif $test -f $xxx/Makefile.PL; then
-                       nonxs_extensions="$nonxs_extensions $xxx"
-               else
-                       if $test -d $xxx; then
-                               # Look for nested extensions, eg. Devel/Dprof.
-                               cd $xxx
-                               for yyy in * ; do
-                               if $test -f $yyy/$yyy.xs; then
-                                       known_extensions="$known_extensions $xxx/$yyy"
-                               elif $test -f $yyy/Makefile.PL; then
-                                       nonxs_extensions="$nonxs_extensions $xxx/$yyy"
-                               fi
-                               done
-                               cd ..
-                       fi
-               fi 
-               ;;
-       esac
-done
+
+: Function to recursively find available extensions, ignoring DynaLoader
+: NOTE: recursion limit of 10 to prevent runaway in case of symlink madness
+find_extensions='
+    for xxx in *; do
+       case "$xxx" in
+           DynaLoader|dynaload) ;;
+           *)
+           if $test -f $xxx/$xxx.xs; then
+               known_extensions="$known_extensions $1$xxx";
+           elif $test -f $xxx/Makefile.PL; then
+               nonxs_extensions="$nonxs_extensions $1$xxx";
+           else
+               if $test -d $xxx -a $# -lt 10; then
+                   set $1$xxx/ $*;
+                   cd $xxx;
+                   eval $find_extensions;
+                   cd ..;
+                   shift;
+               fi;
+           fi
+           ;;
+       esac;
+    done'
+tdir=`pwd`
+cd $rsrc/ext
+set X
+shift
+eval $find_extensions
 set X $nonxs_extensions
 shift
 nonxs_extensions="$*"
@@ -12771,9 +13224,8 @@ case "$d_portable" in
        echo " "
        echo "Stripping down executable paths..." >&4
        for file in $loclist $trylist; do
-               if test X$file != Xln -a X$file != Xar -o X$osname != Xos2; then
-                       eval $file="\$file"
-               fi
+               eval temp=\$$file
+               eval $file=`basename $temp`
        done
        ;;
 esac
@@ -12825,6 +13277,7 @@ awk='$awk'
 baserev='$baserev'
 bash='$bash'
 bin='$bin'
+bincompat5005='$bincompat5005'
 binexp='$binexp'
 bison='$bison'
 byacc='$byacc'
@@ -12862,13 +13315,28 @@ crosscompile='$crosscompile'
 cryptlib='$cryptlib'
 csh='$csh'
 d_Gconvert='$d_Gconvert'
+d_PRIEldbl='$d_PRIEldbl'
+d_PRIFldbl='$d_PRIFldbl'
+d_PRIGldbl='$d_PRIGldbl'
+d_PRIX64='$d_PRIX64'
+d_PRId64='$d_PRId64'
+d_PRIeldbl='$d_PRIeldbl'
+d_PRIfldbl='$d_PRIfldbl'
+d_PRIgldbl='$d_PRIgldbl'
+d_PRIi64='$d_PRIi64'
+d_PRIo64='$d_PRIo64'
+d_PRIu64='$d_PRIu64'
+d_PRIx64='$d_PRIx64'
 d_access='$d_access'
 d_accessx='$d_accessx'
 d_alarm='$d_alarm'
 d_archlib='$d_archlib'
+d_atolf='$d_atolf'
+d_atoll='$d_atoll'
 d_attribut='$d_attribut'
 d_bcmp='$d_bcmp'
 d_bcopy='$d_bcopy'
+d_bincompat5005='$d_bincompat5005'
 d_bsd='$d_bsd'
 d_bsdgetpgrp='$d_bsdgetpgrp'
 d_bsdsetpgrp='$d_bsdsetpgrp'
@@ -12886,11 +13354,7 @@ d_crypt='$d_crypt'
 d_csh='$d_csh'
 d_cuserid='$d_cuserid'
 d_dbl_dig='$d_dbl_dig'
-d_dbmclose64='$d_dbmclose64'
-d_dbminit64='$d_dbminit64'
-d_delete64='$d_delete64'
 d_difftime='$d_difftime'
-d_dirent64_s='$d_dirent64_s'
 d_dirnamlen='$d_dirnamlen'
 d_dlerror='$d_dlerror'
 d_dlopen='$d_dlopen'
@@ -12905,6 +13369,7 @@ d_endnent='$d_endnent'
 d_endpent='$d_endpent'
 d_endpwent='$d_endpwent'
 d_endsent='$d_endsent'
+d_endspent='$d_endspent'
 d_eofnblk='$d_eofnblk'
 d_eunice='$d_eunice'
 d_fchmod='$d_fchmod'
@@ -12913,30 +13378,18 @@ d_fcntl='$d_fcntl'
 d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
 d_fds_bits='$d_fds_bits'
-d_fetch64='$d_fetch64'
-d_fgetpos64='$d_fgetpos64'
 d_fgetpos='$d_fgetpos'
-d_firstkey64='$d_firstkey64'
 d_flexfnam='$d_flexfnam'
-d_flock64_s='$d_flock64_s'
 d_flock='$d_flock'
-d_fopen64='$d_fopen64'
 d_fork='$d_fork'
 d_fpathconf='$d_fpathconf'
-d_freopen64='$d_freopen64'
-d_fseek64='$d_fseek64'
-d_fseeko64='$d_fseeko64'
+d_fpos64_t='$d_fpos64_t'
 d_fseeko='$d_fseeko'
-d_fsetpos64='$d_fsetpos64'
 d_fsetpos='$d_fsetpos'
-d_fstat64='$d_fstat64'
 d_fstatfs='$d_fstatfs'
 d_fstatvfs='$d_fstatvfs'
-d_ftell64='$d_ftell64'
-d_ftello64='$d_ftello64'
 d_ftello='$d_ftello'
 d_ftime='$d_ftime'
-d_ftruncate64='$d_ftruncate64'
 d_getgrent='$d_getgrent'
 d_getgrps='$d_getgrps'
 d_gethbyaddr='$d_gethbyaddr'
@@ -12964,6 +13417,8 @@ d_getsbyname='$d_getsbyname'
 d_getsbyport='$d_getsbyport'
 d_getsent='$d_getsent'
 d_getservprotos='$d_getservprotos'
+d_getspent='$d_getspent'
+d_getspnam='$d_getspnam'
 d_gettimeod='$d_gettimeod'
 d_gnulibc='$d_gnulibc'
 d_grpasswd='$d_grpasswd'
@@ -12971,26 +13426,24 @@ d_hasmntopt='$d_hasmntopt'
 d_htonl='$d_htonl'
 d_index='$d_index'
 d_inetaton='$d_inetaton'
-d_ino64_t='$d_ino64_t'
 d_int64t='$d_int64t'
 d_iovec_s='$d_iovec_s'
 d_isascii='$d_isascii'
 d_killpg='$d_killpg'
 d_lchown='$d_lchown'
+d_ldbl_dig='$d_ldbl_dig'
 d_link='$d_link'
 d_llseek='$d_llseek'
 d_locconv='$d_locconv'
-d_lockf64='$d_lockf64'
 d_lockf='$d_lockf'
 d_longdbl='$d_longdbl'
 d_longlong='$d_longlong'
-d_lseek64='$d_lseek64'
-d_lstat64='$d_lstat64'
 d_lstat='$d_lstat'
 d_madvise='$d_madvise'
 d_mblen='$d_mblen'
 d_mbstowcs='$d_mbstowcs'
 d_mbtowc='$d_mbtowc'
+d_memchr='$d_memchr'
 d_memcmp='$d_memcmp'
 d_memcpy='$d_memcpy'
 d_memmove='$d_memmove'
@@ -13014,16 +13467,12 @@ d_msgsnd='$d_msgsnd'
 d_msync='$d_msync'
 d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
-d_nextkey64='$d_nextkey64'
 d_nice='$d_nice'
 d_off64_t='$d_off64_t'
-d_offset_t='$d_offset_t'
 d_old_pthread_create_joinable='$d_old_pthread_create_joinable'
 d_oldpthreads='$d_oldpthreads'
 d_oldsock='$d_oldsock'
 d_open3='$d_open3'
-d_open64='$d_open64'
-d_opendir64='$d_opendir64'
 d_pathconf='$d_pathconf'
 d_pause='$d_pause'
 d_phostname='$d_phostname'
@@ -13039,7 +13488,6 @@ d_pwexpire='$d_pwexpire'
 d_pwgecos='$d_pwgecos'
 d_pwpasswd='$d_pwpasswd'
 d_pwquota='$d_pwquota'
-d_readdir64='$d_readdir64'
 d_readdir='$d_readdir'
 d_readlink='$d_readlink'
 d_readv='$d_readv'
@@ -13052,7 +13500,6 @@ d_safemcpy='$d_safemcpy'
 d_sanemcmp='$d_sanemcmp'
 d_sched_yield='$d_sched_yield'
 d_scm_rights='$d_scm_rights'
-d_seekdir64='$d_seekdir64'
 d_seekdir='$d_seekdir'
 d_select='$d_select'
 d_sem='$d_sem'
@@ -13084,6 +13531,7 @@ d_setrgid='$d_setrgid'
 d_setruid='$d_setruid'
 d_setsent='$d_setsent'
 d_setsid='$d_setsid'
+d_setspent='$d_setspent'
 d_setvbuf='$d_setvbuf'
 d_sfio='$d_sfio'
 d_shm='$d_shm'
@@ -13096,16 +13544,15 @@ d_sigaction='$d_sigaction'
 d_sigsetjmp='$d_sigsetjmp'
 d_socket='$d_socket'
 d_sockpair='$d_sockpair'
-d_stat64='$d_stat64'
 d_statblks='$d_statblks'
 d_statfs='$d_statfs'
 d_statfsflags='$d_statfsflags'
 d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
+d_stdio_stream_array='$d_stdio_stream_array'
 d_stdiobase='$d_stdiobase'
 d_stdstdio='$d_stdstdio'
-d_store64='$d_store64'
 d_strchr='$d_strchr'
 d_strcoll='$d_strcoll'
 d_strctcpy='$d_strctcpy'
@@ -13114,6 +13561,7 @@ d_strerror='$d_strerror'
 d_strtod='$d_strtod'
 d_strtol='$d_strtol'
 d_strtoul='$d_strtoul'
+d_strtoull='$d_strtoull'
 d_strxfrm='$d_strxfrm'
 d_suidsafe='$d_suidsafe'
 d_symlink='$d_symlink'
@@ -13124,18 +13572,16 @@ d_syserrlst='$d_syserrlst'
 d_system='$d_system'
 d_tcgetpgrp='$d_tcgetpgrp'
 d_tcsetpgrp='$d_tcsetpgrp'
-d_telldir64='$d_telldir64'
 d_telldir='$d_telldir'
 d_telldirproto='$d_telldirproto'
 d_time='$d_time'
 d_times='$d_times'
-d_tmpfile64='$d_tmpfile64'
-d_truncate64='$d_truncate64'
 d_truncate='$d_truncate'
 d_tzname='$d_tzname'
 d_umask='$d_umask'
 d_uname='$d_uname'
 d_union_semun='$d_union_semun'
+d_vendorlib='$d_vendorlib'
 d_vfork='$d_vfork'
 d_void_closedir='$d_void_closedir'
 d_voidsig='$d_voidsig'
@@ -13219,6 +13665,8 @@ i_pwd='$i_pwd'
 i_rpcsvcdbm='$i_rpcsvcdbm'
 i_sfio='$i_sfio'
 i_sgtty='$i_sgtty'
+i_shadow='$i_shadow'
+i_socks='$i_socks'
 i_stdarg='$i_stdarg'
 i_stddef='$i_stddef'
 i_stdlib='$i_stdlib'
@@ -13262,11 +13710,15 @@ installarchlib='$installarchlib'
 installbin='$installbin'
 installman1dir='$installman1dir'
 installman3dir='$installman3dir'
+installprefix='$installprefix'
+installprefixexp='$installprefixexp'
 installprivlib='$installprivlib'
 installscript='$installscript'
 installsitearch='$installsitearch'
 installsitelib='$installsitelib'
+installstyle='$installstyle'
 installusrbinperl='$installusrbinperl'
+installvendorlib='$installvendorlib'
 intsize='$intsize'
 known_extensions='$known_extensions'
 ksh='$ksh'
@@ -13274,6 +13726,7 @@ large='$large'
 ld='$ld'
 lddlflags='$lddlflags'
 ldflags='$ldflags'
+ldlibpthname='$ldlibpthname'
 less='$less'
 lib_ext='$lib_ext'
 libc='$libc'
@@ -13368,6 +13821,18 @@ rd_nodata='$rd_nodata'
 rm='$rm'
 rmail='$rmail'
 runnm='$runnm'
+sPRIEldbl='$sPRIEldbl'
+sPRIFldbl='$sPRIFldbl'
+sPRIGldbl='$sPRIGldbl'
+sPRIX64='$sPRIX64'
+sPRId64='$sPRId64'
+sPRIeldbl='$sPRIeldbl'
+sPRIfldbl='$sPRIfldbl'
+sPRIgldbl='$sPRIgldbl'
+sPRIi64='$sPRIi64'
+sPRIo64='$sPRIo64'
+sPRIu64='$sPRIu64'
+sPRIx64='$sPRIx64'
 sched_yield='$sched_yield'
 scriptdir='$scriptdir'
 scriptdirexp='$scriptdirexp'
@@ -13393,6 +13858,8 @@ sitearch='$sitearch'
 sitearchexp='$sitearchexp'
 sitelib='$sitelib'
 sitelibexp='$sitelibexp'
+siteprefix='$siteprefix'
+siteprefixexp='$siteprefixexp'
 sizetype='$sizetype'
 sleep='$sleep'
 smail='$smail'
@@ -13436,6 +13903,7 @@ uname='$uname'
 uniq='$uniq'
 use64bits='$use64bits'
 usedl='$usedl'
+uselongdouble='$uselongdouble'
 usemultiplicity='$usemultiplicity'
 usemymalloc='$usemymalloc'
 usenm='$usenm'
@@ -13444,10 +13912,16 @@ useperlio='$useperlio'
 useposix='$useposix'
 usesfio='$usesfio'
 useshrplib='$useshrplib'
+usesocks='$usesocks'
 usethreads='$usethreads'
+usevendorprefix='$usevendorprefix'
 usevfork='$usevfork'
 usrinc='$usrinc'
 uuname='$uuname'
+vendorlib='$vendorlib'
+vendorlibexp='$vendorlibexp'
+vendorprefix='$vendorprefix'
+vendorprefixexp='$vendorprefixexp'
 version='$version'
 vi='$vi'
 voidflags='$voidflags'