This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rhapsody/Darwin patches from Wilfredo Sanchez.
[perl5.git] / Configure
index b059359..76c189d 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 Fri Feb  4 20:55:50 EET 2000 [metaconfig 3.0 PL70]
+# Generated on Sat Feb 26 05:10:12 EET 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.com)
 
 cat >/tmp/c1$$ <<EOF
@@ -354,6 +354,7 @@ d_fgetpos=''
 d_flexfnam=''
 d_flock=''
 d_fork=''
+d_fpos64_t=''
 d_fs_data_s=''
 d_fseeko=''
 d_fsetpos=''
@@ -362,6 +363,8 @@ d_ftello=''
 d_ftime=''
 d_gettimeod=''
 d_Gconvert=''
+d_getcwd=''
+d_getfsstat=''
 d_getgrent=''
 d_getgrps=''
 d_gethbyaddr=''
@@ -401,7 +404,7 @@ d_hasmntopt=''
 d_htonl=''
 d_iconv=''
 d_inetaton=''
-d_int64t=''
+d_int64_t=''
 d_isascii=''
 d_killpg=''
 d_lchown=''
@@ -413,6 +416,7 @@ d_longdbl=''
 longdblsize=''
 d_longlong=''
 longlongsize=''
+d_lseekproto=''
 d_lstat=''
 d_mblen=''
 d_mbstowcs=''
@@ -423,14 +427,23 @@ d_memcpy=''
 d_memmove=''
 d_memset=''
 d_mkdir=''
+d_mkdtemp=''
 d_mkfifo=''
+d_mkstemp=''
+d_mkstemps=''
 d_mktime=''
+d_mmap=''
+mmaptype=''
+d_mprotect=''
 d_msg=''
 d_msgctl=''
 d_msgget=''
 d_msgrcv=''
 d_msgsnd=''
+d_msync=''
+d_munmap=''
 d_nice=''
+d_off64_t=''
 d_open3=''
 d_fpathconf=''
 d_pathconf=''
@@ -505,6 +518,7 @@ d_socket=''
 d_sockpair=''
 sockethdr=''
 socketlib=''
+d_socklen_t=''
 d_sqrtl=''
 d_statblks=''
 d_statfs_f_flags=''
@@ -642,6 +656,9 @@ i_bsdioctl=''
 i_sysfilio=''
 i_sysioctl=''
 i_syssockio=''
+i_syslog=''
+i_sysmman=''
+i_sysmode=''
 i_sysmount=''
 i_sysndir=''
 i_sysparam=''
@@ -655,6 +672,7 @@ i_systimes=''
 i_systypes=''
 i_sysuio=''
 i_sysun=''
+i_sysutsname=''
 i_sysvfs=''
 i_syswait=''
 i_sgtty=''
@@ -681,8 +699,6 @@ installusrbinperl=''
 intsize=''
 longsize=''
 shortsize=''
-d_fpos64_t=''
-d_off64_t=''
 libc=''
 ldlibpthname=''
 libperl=''
@@ -698,6 +714,7 @@ libs=''
 libsdirs=''
 libsfiles=''
 libsfound=''
+libspath=''
 lns=''
 d_PRIEldbl=''
 d_PRIFldbl=''
@@ -762,8 +779,10 @@ api_subversion=''
 api_version=''
 api_versionstring=''
 patchlevel=''
+revision=''
 subversion=''
 version=''
+perl5=''
 perladmin=''
 perlpath=''
 d_nv_preserves_uv=''
@@ -846,6 +865,7 @@ siteprefix=''
 siteprefixexp=''
 sizetype=''
 so=''
+socksizetype=''
 sharpbang=''
 shsharp=''
 spitshell=''
@@ -863,10 +883,10 @@ uidsign=''
 uidsize=''
 uidtype=''
 archname64=''
-use64bits=''
+use64bitall=''
+use64bitint=''
 uselargefiles=''
 uselongdouble=''
-uselonglong=''
 usemorebits=''
 usemultiplicity=''
 nm_opt=''
@@ -895,6 +915,8 @@ vendorprefix=''
 vendorprefixexp=''
 defvoidused=''
 voidflags=''
+pm_apiversion=''
+xs_apiversion=''
 CONFIG=''
 
 define='define'
@@ -931,16 +953,16 @@ inclwanted=''
 groupstype=''
 : change the next line if compiling for Xenix/286 on Xenix/386
 xlibpth='/usr/lib/386 /lib/386'
-
 : Possible local library directories to search.
 loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
 loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
 
 : general looking path for locating libraries
-glibpth="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
-glibpth="$glibpth /lib /usr/lib $xlibpth"
+glibpth="/usr/lib/large /lib /usr/lib $xlibpth"
 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
 
 : Private path used by Configure to find libraries.  Its value
 : is prepended to libpth. This variable takes care of special
@@ -1253,6 +1275,7 @@ while test $# -gt 0; do
                echo "$yyy=$zzz"                >> posthint.sh ;;
             *)  echo "$me: unknown -A command '$xxx', ignoring -A $1" >&2 ;;
            esac
+           shift
            ;;
        -V) echo "$me generated by metaconfig 3.0 PL70." >&2
            exit 0;;
@@ -1862,7 +1885,6 @@ ln
 more
 nm
 nroff
-perl
 pg
 test
 uname
@@ -2388,12 +2410,12 @@ EOM
        : specified already.
        case "$hintfile" in
        ''|' ')
-               file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
+               file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
                : Also try without trailing minor version numbers.
-               xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
-               xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
-               xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
-               xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
+               xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
+               xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
+               xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
+               xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
                case "$file" in
                '') dflt=none ;;
                *)  case "$osvers" in
@@ -2596,21 +2618,23 @@ $undef$define) . ./whoa; eval "$var=\$tu";;
 *) eval "$var=$val";;
 esac'
 
+case "$usethreads" in
+$define|true|[yY]*)     dflt='y';;
+*) dflt='n';;
+esac
 cat <<EOM
 
-Perl can be built to take advantage of threads, on some systems.
-To do so, Configure must be run with -Dusethreads.
+Perl can be built to take advantage of threads on some systems.
+To do so, Configure can be run with -Dusethreads.
 
 Note that threading is a highly experimental feature, and
 some known race conditions still remain.  If you choose to try
 it, be very sure to not actually deploy it for production
 purposes.  README.threads has more details, and is required
 reading if you enable threads.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
-case "$usethreads" in
-$define|true|[yY]*)     dflt='y';;
-*) dflt='n';;
-esac
 rp='Build a threading Perl?'
 . ./myread
 case "$ans" in
@@ -2629,6 +2653,10 @@ the 5.005 version (5005threads) and an interpreter-based version
 (ithreads) that has one interpreter per thread.  Both are very 
 experimental.  This arrangement exists to help developers work out
 which one is better.
+
+If you're a casual user, you probably don't want interpreter-threads
+at this time.  There doesn't yet exist a way to create threads from
+within Perl in this model, i.e., "use Thread;" will NOT work.
 EOM
        : Default to ithreads unless overridden on command line or with
        : old config.sh
@@ -2700,12 +2728,12 @@ This multiple interpreter support is required for interpreter-based threads.
 EOM
        val="$define"
        ;;
-*)
-       echo 'Normally you do not need this and you should answer no.'
-       case "$usemultiplicity" in
+*)     case "$usemultiplicity" in
        $define|true|[yY]*)     dflt='y';;
        *) dflt='n';;
        esac
+       echo " "
+       echo "If this doesn't make any sense to you, just accept the default '$dflt'."
        rp='Build Perl for multiplicity?'
        . ./myread
        case "$ans" in
@@ -3039,7 +3067,7 @@ int main() {
        exit(0);
 }
 EOM
-if $cc -o gccvers gccvers.c; then
+if $cc $ldflags -o gccvers gccvers.c; then
        gccversion=`./gccvers`
        case "$gccversion" in
        '') echo "You are not using GNU cc." ;;
@@ -3643,18 +3671,17 @@ case "$firstmakefile" in
 '') firstmakefile='makefile';;
 esac
 
+case "$usesocks" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
+esac
 cat <<EOM
 
 Perl can be built to use the SOCKS proxy protocol library.  To do so,
 Configure must be run with -Dusesocks.
 
-Normally you do not need this and you should answer no.
-
+If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
-case "$usesocks" in
-$define|true|[yY]*)    dflt='y';;
-*) dflt='n';;
-esac
 rp='Build Perl for SOCKS?'
 . ./myread
 case "$ans" in
@@ -3679,51 +3706,70 @@ $define)
        libswanted="$libswanted socks5 socks5_sh"
        ;;
 esac
+libsfound=''
+libsfiles=''
+libsdirs=''
+libspath=''
+for thisdir in $libpth $xlibpth; do
+  test -d $thisdir && libspath="$libspath $thisdir"
+done
 for thislib in $libswanted; do
-       
-       libname="$thislib"
-       if xxx=`./loc lib$thislib.$so.[0-9]'*' X $libpth`; $test -f "$xxx"; then
-               if $test "X$ignore_versioned_solibs" = "X"; then
-                       xxx=/ignored$xxx
-               else
-                       libstyle=shared
-               fi
-       elif xxx=`./loc lib$thislib.$so X $libpth` ; $test -f "$xxx"; then
-               libstyle=shared
-       elif xxx=`./loc lib$thislib$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-       elif xxx=`./loc $thislib$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-       elif xxx=`./loc lib${thislib}_s$_a X $libpth`; $test -f "$xxx"; then
-               libstyle=static
-               libname=${thislib}_s
-       elif xxx=`./loc Slib$thislib$_a X $xlibpth`; $test -f "$xxx"; then
-               libstyle="static"
-       fi
-       if $test -f "$xxx"; then
-               eval $libscheck
-       fi
-       if $test -f "$xxx"; then
+       for thisdir in $libspath; do
+           xxx=''
+           if $test ! -f "$xxx" -a "X$ignore_versioned_solibs" = "X"; then
+               xxx=`ls $thisdir/lib$thislib.$so.[0-9] 2>/dev/null|tail -1`
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=shared
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib$thislib.$so
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=shared
+           fi  
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/lib${thislib}_s$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if test ! -f "$xxx"; then
+               xxx=$thisdir/Slib$thislib$_a
+               $test -f "$xxx" && eval $libscheck
+               $test -f "$xxx" && libstyle=static
+           fi
+           if $test -f "$xxx"; then
                case "$libstyle" in
-               shared) echo "Found -l$libname (shared)." ;;
-               static) echo "Found -l$libname." ;;
-               *)      echo "Found -l$libname ($libstyle)." ;;
+               shared) echo "Found -l$thislib (shared)." ;;
+               static) echo "Found -l$thislib." ;;
+               *)      echo "Found -l$thislib ($libstyle)." ;;
                esac
                case " $dflt " in
                *"-l$thislib "*);;
-               *) dflt="$dflt -l$libname"
+               *) dflt="$dflt -l$thislib"
                    libsfound="$libsfound $xxx"
                    yyy=`basename $xxx`
                    libsfiles="$libsfiles $yyy"
-                   yyy=`echo $xxx|sed "s@/$yyy\\$@@"`
+                   yyy=`echo $xxx|$sed -e "s%/$yyy\\$%%"`
                    case " $libsdirs " in
                    *" $yyy "*) ;;
                    *) libsdirs="$libsdirs $yyy" ;;
                    esac
                   ;;
                esac
-       else
-               echo "No -l$thislib."
+               break
+           fi  
+       done
+       if $test ! -f "$xxx"; then
+           echo "No -l$thislib."
        fi
 done
 set X $dflt
@@ -4181,7 +4227,7 @@ set off_t lseektype long stdio.h sys/types.h
 eval $typedef_ask
 
 echo " "
-$echo $n "Checking to see how big your file offsets are...$c" >&4
+echo "Checking to see how big your file offsets are..." >&4
 $cat >try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -4194,7 +4240,7 @@ EOCP
 set try
 if eval $compile_ok; then
        lseeksize=`./try`
-       $echo " $lseeksize bytes." >&4
+       echo "Your file offsets are $lseeksize bytes long."
 else
        dflt=$longsize
        echo " "
@@ -4215,7 +4261,7 @@ case "$fpostype" in
 *_t) zzz="$fpostype"   ;;
 *)   zzz="fpos_t"      ;;
 esac
-$echo $n "Checking the size of $zzz...$c" >&4 
+echo "Checking the size of $zzz..." >&4 
 cat > try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -4229,16 +4275,15 @@ if eval $compile_ok; then
        yyy=`./try`
        case "$yyy" in
        '')     fpossize=4
-               echo " "
                echo "(I can't execute the test program--guessing $fpossize.)" >&4
                ;;
        *)      fpossize=$yyy
-               echo " $fpossize bytes."
+               echo "Your $zzz is $fpossize bytes long."
                ;;
        esac
 else
        dflt="$longsize"
-       echo " "
+       echo " " >&4
        echo "(I can't compile the test program.  Guessing...)" >&4
        rp="What is the size of your file positions (in bytes)?"
        . ./myread
@@ -4247,23 +4292,35 @@ fi
 
 
 
+# Backward compatibility (uselfs is deprecated).
+case "$uselfs" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** Configure -Duselfs is deprecated, using -Duselargefiles instead.
+
+EOM
+       uselargefiles="$define"
+       ;;
+esac                          
+
 case "$lseeksize:$fpossize" in
 8:8) cat <<EOM
 
 You can have files larger than 2 gigabytes.
 EOM
    val="$define" ;;
-*) cat <<EOM
+*)    case "$uselargefiles" in
+   "$undef"|false|[nN]*) dflt='n' ;;
+   *)  dflt='y' ;;
+   esac
+   cat <<EOM
 
 Perl can be built to understand large files (files larger than 2 gigabytes)
-on some systems.  To do so, Configure must be run with -Duselargefiles.
+on some systems.  To do so, Configure can be run with -Duselargefiles.
 
-If this doesn't make any sense to you, just accept the default 'y'.
+If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
-   case "$uselargefiles" in
-   "$undef"|false|[nN]*) dflt='n' ;;
-   *)  dflt='y' ;;
-   esac
    rp='Try to understand large files, if available?'
    . ./myread
    case "$ans" in
@@ -4283,7 +4340,7 @@ case "$uselargefiles" in
                echo "Your platform has some specific hints for large file builds, using them..."
                . ./uselfs.cbu
                echo " "
-               $echo $n "Rechecking to see how big your file offsets are...$c" >&4
+               echo "Rechecking to see how big your file offsets are..." >&4
                $cat >try.c <<EOCP
 #include <sys/types.h>
 #include <stdio.h>
@@ -4296,7 +4353,7 @@ EOCP
                set try
                if eval $compile_ok; then
                        lseeksize=`./try`
-                       $echo " $lseeksize bytes." >&4
+                       $echo "Your file offsets are now $lseeksize bytes long."
                else
                        dflt="$lseeksize"
                        echo " "
@@ -4327,7 +4384,7 @@ EOCP
                                echo "(I can't execute the test program--guessing $fpossize.)" >&4
                                ;;
                        *)      fpossize=$yyy
-                               echo " $fpossize bytes."
+                               echo " $fpossize bytes." >&4
                                ;;
                        esac
                else
@@ -4346,7 +4403,7 @@ esac
 
 case "$usemorebits" in
 "$define"|true|[yY]*)
-       use64bits="$define"
+       use64bitint="$define"
        uselongdouble="$define"
        usemorebits="$define"
        ;;
@@ -4355,70 +4412,152 @@ case "$usemorebits" in
 esac
 
 
-case "$intsize:$longsize" in
-8:*|*:8) cat <<EOM
+# Backward compatibility (uselonglong is deprecated).
+case "$uselonglong" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** Configure -Duselonglong is deprecated, using -Duse64bitint instead.
 
-You have natively 64-bit integers.
 EOM
-   val="$define" ;;
-*) cat <<EOM
+       use64bitint="$define"
+       ;;
+esac                          
+# Backward compatibility (use64bits is deprecated).
+case "$use64bits" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** Configure -Duse64bits is deprecated, using -Duse64bitint instead.
+
+EOM
+       use64bitint="$define"
+       ;;
+esac                          
+# Thinko compatibility
+case "$use64bitints" in
+"$define"|true|[yY]*)
+       cat <<EOM >&4
+
+*** There is no Configure -Duse64bitints, using -Duse64bitint instead.
+
+EOM
+       use64bitint="$define"
+       ;;
+esac                          
+
+case "$ccflags" in
+*-DUSE_LONG_LONG*|*-DUSE_64_BIT_INT*|*-DUSE_64_BIT_ALL*) use64bitint="$define";;
+esac
+case "$use64bitall" in
+"$define"|true|[yY]*) use64bitint="$define" ;;
+esac
+
+case "$longsize" in
+8) cat <<EOM
+
+You have natively 64-bit long integers.
+EOM
+   val="$define"
+   ;;
+*) case "$use64bitint" in
+   "$define"|true|[yY]*) dflt='y';;
+   *) dflt='n';;
+   esac
+   cat <<EOM
 
 Perl can be built to take advantage of 64-bit integer types
-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.
-EOM
-  case "$use64bits" in
-  $define|true|[yY]*)  dflt='y';;
-  *) dflt='n';;
-  esac
-  rp='Try to use 64-bit integers, if available?'
-  . ./myread
-  case "$ans" in
-  y|Y) val="$define" ;;
-  *)   val="$undef"  ;;
-  esac
-  ;;
-esac
-set use64bits
-eval $setvar
+on some systems.  To do so, Configure can be run with -Duse64bitint.
+Choosing this option will most probably introduce binary incompatibilities.
 
-case "$archname64" in
-'') archname64='' ;;   # not a typo
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+   rp='Try to use 64-bit integers, if available?'
+   . ./myread
+   case "$ans" in
+   [yY]*) val="$define" ;;
+   *)     val="$undef"  ;;
+   esac
+   ;;
 esac
+set use64bitint
+eval $setvar
 
-case "$use64bits" in
+case "$use64bitall" in
+"$define"|true|[yY]*) val="$define" ;;
+*)     case "$use64bitint" in
+       "$define")      case "$longsize" in
+                       4)      dflt='n'
+                               cat <<EOM
+
+Since you chose 64-bitness you may want to try maximal 64-bitness.
+What you have chosen is minimal 64-bitness which means just enough
+to get 64-bit integers.  The maximal means using as much 64-bitness
+as is possible on the platform.  This in turn means even more binary
+incompatibilities.  On the other hand, your platform may not have
+any more maximal 64-bitness than what you already have chosen.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
+                               rp='Try to use full 64-bit support, if available?'
+                               . ./myread
+                               case "$ans" in
+                               [yY]*) val="$define" ;;
+                               *)     val="$undef"  ;;
+                               esac
+                               ;;
+                       8) val="$define" ;;
+                       *) val="$undef" ;;
+                       esac
+                       ;;
+       *)      val="$undef" ;;
+       esac
+       ;;
+esac 
+set use64bitall
+eval $setvar
+
+case "$use64bitint" 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
+       if $test -f use64bitint.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.)
-EOM
-                case "$intsize:$longsize" in
-8:*|*:8) cat <<EOM
-(This is probably okay, as your system is a natively 64-bit system.)
-EOM
-                  ;;
-                esac
-               case "$gccversion" in
-               '')     ;;
-               *)      case "$ccflags" in
-                       *-DUSE_LONG_LONG*) ;;
-                       *) $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
-                       ;;
-               esac
+               . ./use64bitint.cbu
+       fi
+       case "$longsize" in
+       4) case "$ccflags" in
+          *-DUSE_64_BIT_INT*) ;;
+          *) ccflags="$ccflags -DUSE_64_BIT_INT";;
+          esac
+          case "$archname64" in
+          '') archname64=64int ;;
+          esac
+          ;;
+       esac
+       ;;
+esac
+
+case "$use64bitall" in
+"$define"|true|[yY]*)
+: Look for a hint-file generated 'call-back-unit'.  If the
+: user has specified that a full 64-bit perl is to be built,
+: we may need to set or change some other defaults.
+       if $test -f use64bitall.cbu; then
+               echo "Your platform has some specific hints for full 64-bit builds, using them..."
+               . ./use64bitall.cbu
        fi
+       case "$longsize" in
+       4) case "$ccflags" in
+          *-DUSE_64_BIT_ALL*) ;;
+          *) ccflags="$ccflags -DUSE_64_BIT_ALL";;
+          esac
+          case "$archname64" in
+          ''|64) archname64=64all ;;
+          esac
+          ;;
+       esac
        ;;
 esac
 
@@ -4476,7 +4615,7 @@ $define)
         esac
        ;;
 esac
-case "$use64bits" in
+case "$use64bitint" in
 $define)
        case "$archname64" in
        '')
@@ -4606,44 +4745,39 @@ prefixit='case "$3" in
        esac;;
 esac'
 
-: set the base revision
-baserev=5.0
-
 
 : get the patchlevel
 echo " "
 echo "Getting the current patchlevel..." >&4
 if $test -r $rsrc/patchlevel.h;then
+       revision=`awk '/define[         ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
        patchlevel=`awk '/define[       ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
        subversion=`awk '/define[       ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
        api_revision=`awk '/define[     ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
        api_version=`awk '/define[      ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
        api_subversion=`awk '/define[   ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
 else
+       revision=0
        patchlevel=0
        subversion=0
        api_revision=0
        api_version=0
        api_subversion=0
 fi
-$echo $n "(You have $package" $c
-case "$package" in
-"*$baserev")   ;;
-*)             $echo $n " $baserev" $c ;;
-esac
+$echo $n "(You have $package revision $revision" $c
 $echo $n " patchlevel $patchlevel" $c
 test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
 echo ".)"
 case "$osname" in
-dos|cygwin|vms|win32)
+dos|vms)
        : XXX Should be a Configure test for double-dots in filenames.
-       version=`echo $baserev $patchlevel $subversion | \
+       version=`echo $revision $patchlevel $subversion | \
                 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
        api_versionstring=`echo $api_revision $api_version $api_subversion | \
                 $awk '{ printf "%d_%d_%d\n", $1, $2, $3 }'`
        ;;
 *)
-       version=`echo $baserev $patchlevel $subversion | \
+       version=`echo $revision $patchlevel $subversion | \
                 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
        api_versionstring=`echo $api_revision $api_version $api_subversion | \
                 $awk '{ printf "%d.%d.%d\n", $1, $2, $3 }'`
@@ -5098,7 +5232,12 @@ EOM
 rp='Do you want to configure vendor-specific add-on directories?'
 case "$usevendorprefix" in
 define|true|[yY]*) dflt=y ;;
-*) dflt=n ;;
+*)     : User may have set vendorprefix directly on Configure command line.
+       case "$vendorprefix" in
+       ''|' ') dflt=n ;;
+       *)      dflt=y ;;
+       esac
+       ;;
 esac
 . ./myread
 case "$ans" in
@@ -5109,6 +5248,7 @@ case "$ans" in
        *)  dflt=$vendorprefix ;;
        esac
        . ./getfile
+       : XXX Prefixit unit does not yet support siteprefix and vendorprefix
        oldvendorprefix=''
        case "$vendorprefix" in
        '') ;;
@@ -5136,24 +5276,30 @@ case "$vendorprefix" in
 *)     d_vendorlib="$define"
        : determine where vendor-supplied modules go.
        : Usual default is /usr/local/lib/perl5/vendor_perl/$version
-       prog=`echo $package | $sed 's/-*[0-9.]*$//'`
-       case "$installstyle" in
-       *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
-       *)           dflt=$vendorprefix/lib/vendor_$prog/$version ;;
+       case "$vendorlib" in
+       '')
+               prog=`echo $package | $sed 's/-*[0-9.]*$//'`
+               case "$installstyle" in
+               *lib/perl5*) dflt=$vendorprefix/lib/$package/vendor_$prog/$version ;;
+               *)           dflt=$vendorprefix/lib/vendor_$prog/$version ;;
+               esac
+               ;;
+       *)      dflt="$vendorlib"
+               ;;
        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
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installvendorlib=`echo $vendorlibexp | $sed "s#^$prefix#$installprefix#"`
+else
+       installvendorlib="$vendorlibexp"
+fi
 
 : Cruising for prototypes
 echo " "
@@ -5216,6 +5362,28 @@ else
        installbin="$binexp"
 fi
 
+: Find perl5.005 or later.
+echo "Looking for a previously installed perl5.005 or later... "
+case "$perl5" in
+'')    for tdir in `echo "$binexp:$PATH" | $sed "s/$path_sep/ /g"`; do
+               : Check if this perl is recent and can load a simple module
+               if $test -x $tdir/perl && $tdir/perl -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+                       perl5=$tdir/perl
+                       break;
+               elif $test -x $tdir/perl5 && $tdir/perl5 -Mless -e 'use 5.005;' >/dev/null 2>&1; then
+                       perl5=$tdir/perl
+                       break;
+               fi
+       done
+       ;;
+*)     perl5="$perl5"
+       ;;
+esac
+case "$perl5" in
+'')    echo "None found.  That's ok.";;
+*)     echo "Using $perl5." ;;
+esac
+
 $cat <<EOM
 
 After $package is installed, you may wish to install various
@@ -5239,11 +5407,11 @@ case "$siteprefix" in
 *)  dflt=$siteprefix ;;
 esac
 . ./getfile
+: XXX Prefixit unit does not yet support siteprefix and vendorprefix
 oldsiteprefix=''
 case "$siteprefix" in
 '') ;;
-*)
-       case "$ans" in
+*)     case "$ans" in
        "$prefix") ;;
        *) oldsiteprefix="$prefix";;
        esac
@@ -5257,9 +5425,14 @@ siteprefixexp="$ansexp"
 : 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/$package/site_$prog/$version ;;
-*)      dflt=$siteprefix/lib/site_$prog/$version ;;
+case "$sitelib" in
+'') case "$installstyle" in
+       *lib/perl5*) dflt=$siteprefix/lib/$package/site_$prog/$version ;;
+       *)       dflt=$siteprefix/lib/site_$prog/$version ;;
+       esac
+       ;;
+*)     dflt="$sitelib"
+       ;;
 esac
 $cat <<EOM
 
@@ -5276,14 +5449,14 @@ sitelib="$ans"
 sitelibexp="$ansexp"
 : Change installation prefix, if necessary.
 if $test X"$prefix" != X"$installprefix"; then
-       installsitelib=`echo $sitelibexp | sed "s#^$prefix#$installprefix#"`
+       installsitelib=`echo $sitelibexp | $sed "s#^$prefix#$installprefix#"`
 else
        installsitelib="$sitelibexp"
 fi
 
 : Determine list of previous versions to include in @INC
 $cat > getverlist <<EOPL
-#!$perl -w
+#!$perl5 -w
 use File::Basename;
 \$api_versionstring = "$api_versionstring";
 \$version = "$version";
@@ -5294,7 +5467,7 @@ EOPL
 # Can't have leading @ because metaconfig interprets it as a command!
 ;@inc_version_list=();
 $stem=dirname($sitelib);
-# Redo to do opendir/readdir? 
+# XXX Redo to do opendir/readdir? 
 if (-d $stem) {
     chdir($stem);
     ;@candidates = glob("5.*");
@@ -5334,8 +5507,8 @@ else {
 EOPL
 chmod +x getverlist
 case "$inc_version_list" in
-'')    if test -x $perl; then
-               dflt=`$perl getverlist`
+'')    if test -x "$perl5"; then
+               dflt=`$perl5 getverlist`
        else
                dflt='none'
        fi
@@ -5343,6 +5516,9 @@ case "$inc_version_list" in
 $undef) dflt='none' ;;
 *)  dflt="$inc_version_list" ;;
 esac
+case "$dflt" in
+''|' ') dflt=none ;;
+esac
 $cat <<'EOM'
 
 In order to ease the process of upgrading, this version of perl 
@@ -5360,14 +5536,14 @@ EOM
 rp='List of earlier versions to include in @INC?'
 . ./myread
 case "$ans" in
-[Nn]one) inc_version_list=' ' ;;
+[Nn]one|''|' ') inc_version_list=' ' ;;
 *) inc_version_list="$ans" ;;
 esac
 case "$inc_version_list" in
 ''|' ') 
-       inc_version_list_init='""';;
+       inc_version_list_init='0';;
 *)     inc_version_list_init=`echo $inc_version_list |
-               $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/"/'`
+               $sed -e 's/^/"/' -e 's/ /","/g' -e 's/$/",0/'`
        ;;
 esac
 $rm -f getverlist
@@ -5919,7 +6095,7 @@ y*) usedl="$define"
        . ./getfile
        usedl="$define"
        : emulate basename
-       dlsrc=`echo $ans | $sed -e 's@.*/\([^/]*\)$@\1@'`
+       dlsrc=`echo $ans | $sed -e 's%.*/\([^/]*\)$%\1%'`
 
        $cat << EOM
 
@@ -6007,7 +6183,7 @@ EOM
     case "$lddlflags" in
     '') case "$osname" in
                        beos) dflt='-nostart' ;;
-                       hpux)  dflt='-b' ;;
+                       hpux)  dflt='-b +vnocompatwarnings' ;;
                        linux|irix*)    dflt='-shared' ;;
                        next)  dflt='none' ;;
                        solaris) dflt='-G' ;;
@@ -6926,21 +7102,22 @@ fi
 : sitelib  default is /usr/local/lib/perl5/site_perl/$version
 : sitearch default is /usr/local/lib/perl5/site_perl/$version/$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" ;;
+'')    dflt=`echo $sitelib | $sed 's,/share$,,'`
+       dflt="$dflt/$archname"
+       ;;
+*)     dflt="$sitearch"
+       ;;
 esac
+set sitearch sitearch none
+eval $prefixit
 $cat <<EOM
 
 The installation process will also create a directory for
 architecture-dependent site-specific extensions and modules.
 
 EOM
-fn=nd~+
+fn=d~+
 rp='Pathname for the site-specific architecture-dependent library files?'
 . ./getfile
 sitearch="$ans"
@@ -6955,7 +7132,7 @@ fi
 : determine where add-on public executables go
 case "$sitebin" in
 '')    dflt=$siteprefix/bin ;;
-*)     dflt=$sitebin ;;
+*)     dflt=$sitebin ;;
 esac
 fn=d~
 rp='Pathname where the add-on public executables should be installed?'
@@ -6973,14 +7150,6 @@ fi
 set sqrtl d_sqrtl
 eval $inlibc
 
-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.
-
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-
 case "$ccflags" in
 *-DUSE_LONG_DOUBLE*|*-DUSE_MORE_BITS*) uselongdouble="$define" ;;
 esac
@@ -6989,6 +7158,13 @@ case "$uselongdouble" in
 $define|true|[yY]*)    dflt='y';;
 *) dflt='n';;
 esac
+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.
+
+If this doesn't make any sense to you, just accept the default '$dflt'.
+EOM
 rp='Try to use long doubles if available?'
 . ./myread
 case "$ans" in
@@ -7030,50 +7206,10 @@ EOM
        ;;
 esac
 
-cat <<EOM
-
-Perl can be built to take advantage of long longs which
-(if available) may give more range for integer numbers.
-
-If this doesn't make any sense to you, just accept the default 'n'.
-EOM
-
-case "$ccflags" in
-*-DUSE_LONG_LONG*) uselonglong="$define" ;;
-esac
-
-case "$uselonglong" in
-'')    dflt='y';;
-esac
-rp='Try to use long longs if available?'
-. ./myread
-case "$ans" in
-y|Y)   val="$define"   ;;
-*)      val="$undef"   ;;
-esac
-set uselonglong
-eval $setvar
-
-case "$uselonglong" in
-true|[yY]*) uselonglong="$define" ;;
-esac
-
-case "$uselonglong" in
-$define)
-: Look for a hint-file generated 'call-back-unit'.  If the
-: user has specified that long longs should be used,
-: we may need to set or change some other defaults.
-       if $test -f uselonglong.cbu; then
-               echo "Your platform has some specific hints for long longs, using them..."
-               . ./uselonglong.cbu
-       else
-               $cat <<EOM
-(Your platform doesn't have any specific hints for long longs.)
-EOM
-       fi
-       ;;
+case "$useperlio" in
+$define|true|[yY]*)    dflt='y';;
+*) dflt='n';;
 esac
-
 cat <<EOM
 
 Previous version of $package used the standard IO mechanisms as defined
@@ -7084,12 +7220,8 @@ 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'.
+If this doesn't make any sense to you, just accept the default '$dflt'.
 EOM
-case "$useperlio" in
-$define|true|[yY]*)    dflt='y';;
-*) dflt='n';;
-esac
 rp='Use the experimental PerlIO abstraction layer?'
 . ./myread
 case "$ans" in
@@ -7111,26 +7243,29 @@ case "$vendorprefix" in
        ;;
 *)     d_vendorbin="$define"
        : determine where vendor-supplied executables go.
-       dflt=$vendorprefix/bin
+       case "$vendorbin" in
+       '') dflt=$vendorprefix/bin ;;
+       *)      dflt="$vendorbin" ;;
+       esac
        fn=d~+
        rp='Pathname for the vendor-supplied executables directory?'
        . ./getfile
        vendorbin="$ans"
        vendorbinexp="$ansexp"
-       : Change installation prefix, if necessary.
-       if $test X"$prefix" != X"$installprefix"; then
-               installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
-       else
-               installvendorbin="$vendorbinexp"
-       fi
        ;;
 esac
+: Change installation prefix, if necessary.
+if $test X"$prefix" != X"$installprefix"; then
+       installvendorbin=`echo $vendorbinexp | $sed "s#^$prefix#$installprefix#"`
+else
+       installvendorbin="$vendorbinexp"
+fi
 
 : check for length of double
 echo " "
 case "$doublesize" in
 '')
-       $echo $n "Checking to see how big your double precision numbers are...$c" >&4
+       echo "Checking to see how big your double precision numbers are..." >&4
        $cat >try.c <<'EOCP'
 #include <stdio.h>
 int main()
@@ -7142,7 +7277,7 @@ EOCP
        set try
        if eval $compile_ok; then
                doublesize=`./try`
-               $echo " $doublesize bytes." >&4
+               echo "Your double is $doublesize bytes long."
        else
                dflt='8'
                echo "(I can't seem to compile the test program.  Guessing...)"
@@ -7156,15 +7291,15 @@ $rm -f try.c try
 
 : check for long doubles
 echo " "
-$echo $n "Checking to see if your system supports long double..." $c >&4
+echo "Checking to see if you have long double..." >&4
 echo 'int main() { long double x = 7.0; }' > try.c
 set try
 if eval $compile; then
        val="$define"
-       echo " Yes, it does." >&4
+       echo "You have long double."
 else
        val="$undef"
-       echo " No, it doesn't." >&4
+       echo "You do not have long double."
 fi
 $rm try.*
 set d_longdbl
@@ -7174,7 +7309,7 @@ eval $setvar
 case "${d_longdbl}${longdblsize}" in
 $define)
        echo " "
-       $echo $n "Checking to see how big your long doubles are..." $c >&4
+       echo "Checking to see how big your long doubles are..." >&4
        $cat >try.c <<'EOCP'
 #include <stdio.h>
 int main()
@@ -7186,7 +7321,7 @@ EOCP
        set try
        if eval $compile; then
                longdblsize=`./try$exe_ext`
-               $echo " $longdblsize bytes." >&4
+               echo "Your long doubles are $longdblsize bytes long."
        else
                dflt='8'
                echo " "
@@ -8811,43 +8946,20 @@ set fpathconf d_fpathconf
 eval $inlibc
 
 
-: check for off64_t
-echo " "
-echo "Checking to see if your system supports off64_t..." >&4
-$cat >try.c <<EOCP
-#include <sys/types.h>
-#include <unistd.h>
-int main() { off64_t x = 7; }'
-EOCP
-set try
-if eval $compile; then
-       val="$define"
-       echo "Yes, it does."
-else
-       val="$undef"
-       echo "No, it doesn't."
-       case "$lseeksize" in
-       8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
-       esac
-fi
-$rm -f try.* try
-set d_off64_t
-eval $setvar
-
 : check for fpos64_t
 echo " "
-echo "Checking to see if your system supports fpos64_t..." >&4
+echo "Checking to see if you have fpos64_t..." >&4
 $cat >try.c <<EOCP
-#include <sys/stdio.h>
-int main() { fpos64_t x x = 7; }'
+#include <stdio.h>
+int main() { fpos64_t x = 7; }
 EOCP
 set try
 if eval $compile; then
        val="$define"
-       echo "Yes, it does."
+       echo "You have fpos64_t."
 else
        val="$undef"
-       echo "No, it doesn't."
+       echo "You do not have fpos64_t."
        case "$fpossize" in
        8) echo "(Your fpos_t is 64 bits, so you could use that.)" ;;
        esac
@@ -8929,6 +9041,15 @@ case "$longsize" in
 8) echo "(Your long is 64 bits, so you could use ftell.)" ;;
 esac
 
+: see if getcwd exists
+set getcwd d_getcwd
+eval $inlibc
+
+
+: see if getfsstat exists
+set getfsstat d_getfsstat
+eval $inlibc
+
 : see if getgrent exists
 set getgrent d_getgrent
 eval $inlibc
@@ -9267,6 +9388,51 @@ 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
+echo " "
+echo "Checking to see if you have int64_t..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_inttypes I_INTTYPES
+#ifdef I_INTTYPES
+#include <inttypes.h>
+#endif
+int main() { int64_t x = 7; }
+EOCP
+set try
+if eval $compile; then
+       val="$define"
+       echo "You have int64_t."
+else
+       val="$undef"
+       echo "You do not have int64_t."
+fi
+$rm -f try try.*
+set d_int64_t
+eval $setvar
+
 : Look for isascii
 echo " "
 $cat >isascii.c <<'EOCP'
@@ -9369,15 +9535,15 @@ eval $inlibc
 
 : check for long long
 echo " "
-$echo $n "Checking to see if your system supports long long..." $c >&4
+echo "Checking to see if you have long long..." >&4
 echo 'int main() { long long x = 7; return 0; }' > try.c
 set try
 if eval $compile; then
        val="$define"
-       echo " Yes, it does." >&4
+       echo "You have have long long."
 else
        val="$undef"
-       echo " No, it doesn't." >&4
+       echo "You do not have long long."
 fi
 $rm try.*
 set d_longlong
@@ -9387,7 +9553,7 @@ eval $setvar
 case "${d_longlong}${longlongsize}" in
 $define)
        echo " "
-       $echo $n "Checking to see how big your long longs are..." $c >&4
+       echo "Checking to see how big your long longs are..." >&4
        $cat >try.c <<'EOCP'
 #include <stdio.h>
 int main()
@@ -9399,7 +9565,7 @@ EOCP
        set try
        if eval $compile_ok; then
                longlongsize=`./try$exe_ext`
-               $echo " $longlongsize bytes." >&4
+               echo "Your long longs are $longlongsize bytes long."
        else
                dflt='8'
                echo " "
@@ -9415,6 +9581,11 @@ EOCP
 esac
 $rm -f try.* try
 
+: see if prototype for lseek is available
+echo " "
+set d_lseekproto lseek $i_systypes sys/types.h $i_unistd unistd.h
+eval $hasproto
+
 : see if lstat exists
 set lstat d_lstat
 eval $inlibc
@@ -9455,14 +9626,57 @@ eval $inlibc
 set mkdir d_mkdir
 eval $inlibc
 
+: see if mkdtemp exists
+set mkdtemp d_mkdtemp
+eval $inlibc
+
 : see if mkfifo exists
 set mkfifo d_mkfifo
 eval $inlibc
 
+: see if mkstemp exists
+set mkstemp d_mkstemp
+eval $inlibc
+
+: see if mkstemps exists
+set mkstemps d_mkstemps
+eval $inlibc
+
 : see if mktime exists
 set mktime d_mktime
 eval $inlibc
 
+: see if this is a sys/mman.h system
+set sys/mman.h i_sysmman
+eval $inhdr
+
+: see if mmap exists
+set mmap d_mmap
+eval $inlibc
+: see what shmat returns
+: default to something harmless
+mmaptype='void *'
+case "$i_sysmman$d_mmap" in
+"$define$define")
+       $cat >mmap.c <<'END'
+#include <sys/mman.h>
+void *mmap();
+END
+       if $cc $ccflags -c mmap.c >/dev/null 2>&1; then
+               mmaptype='void *'
+       else
+               mmaptype='caddr_t'
+       fi
+       echo "and it returns ($mmaptype)." >&4
+       ;;
+esac
+
+
+
+: see if mprotect exists
+set mprotect d_mprotect
+eval $inlibc
+
 : see if msgctl exists
 set msgctl d_msgctl
 eval $inlibc
@@ -9515,54 +9729,17 @@ fi
 set d_msg
 eval $setvar
 
-: see if nice exists
-set nice d_nice
+: see if msync exists
+set msync d_msync
 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
+: see if munmap exists
+set munmap d_munmap
+eval $inlibc
 
-: check for int64_t
-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
-int main() { int64_t x = 7; }
-EOCP
-set try
-if eval $compile; then
-       val="$define"
-       echo " Yes, it does." >&4
-else
-       val="$undef"
-       echo " No, it doesn't." >&4
-fi
-$rm -f try try.*
-set d_int64t
-eval $setvar
+: see if nice exists
+set nice d_nice
+eval $inlibc
 
 
 echo " "
@@ -9596,7 +9773,7 @@ case "$intsize" in
         eval $setvar
         quadkind=3
         ;;
-      *) case "$d_int64t" in
+      *) case "$d_int64_t" in
          define)
            val=int64_t
            set quadtype
@@ -9615,14 +9792,10 @@ case "$intsize" in
 esac
 
 case "$quadtype" in
-'')    case "$uselonglong:$d_longlong:$longlongsize" in
-       undef:define:8)
-          echo "(You would have 'long long', but you are not using it.)" >&4 ;;
-       *) echo "Alas, no 64-bit integer types in sight." >&4 ;;
-       esac
+'')    echo "Alas, no 64-bit integer types in sight." >&4
        d_quad="$undef"
        ;;
-*)     if test X"$use64bits" = Xdefine -o X"$longsize" = X8; then
+*)     if test X"$use64bitint" = Xdefine -o X"$longsize" = X8; then
            verb="will"
        else
            verb="could"
@@ -9666,7 +9839,7 @@ $rm -f try.c try
 echo " "
 $echo "Choosing the C types to be used for Perl's internal types..." >&4
 
-case "$use64bits:$d_quad:$quadtype" in
+case "$use64bitint:$d_quad:$quadtype" in
 define:define:?*)
        ivtype="$quadtype"
        uvtype="$uquadtype"
@@ -9869,6 +10042,30 @@ esac
 
 $rm -f try.* try
 
+
+: check for off64_t
+echo " "
+echo "Checking to see if you have off64_t..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#include <unistd.h>
+int main() { off64_t x = 7; }
+EOCP
+set try
+if eval $compile; then
+       val="$define"
+       echo "You have off64_t."
+else
+       val="$undef"
+       echo "You do not have off64_t."
+       case "$lseeksize" in
+       8) echo "(Your off_t is 64 bits, so you could use that.)" ;;
+       esac
+fi
+$rm -f try.* try
+set d_off64_t
+eval $setvar
+
 : see if POSIX threads are available
 set pthread.h i_pthread
 eval $inhdr
@@ -11447,7 +11644,7 @@ case "$crosscompile" in
 esac
 
 case "$osname" in
-next|rhapsody) multiarch="$define" ;;
+next|rhapsody|darwin) multiarch="$define" ;;
 esac
 case "$multiarch" in
 ''|[nN]*) multiarch="$undef" ;;
@@ -11469,11 +11666,20 @@ EOM
 *)
        case "$alignbytes" in
        '') echo "Checking alignment constraints..." >&4
-               $cat >try.c <<'EOCP'
+               if $test "X$uselongdouble" = Xdefine -a "X$d_longdbl" = Xdefine; then
+                       $cat >try.c <<'EOCP'
+typedef long double NV;
+EOCP
+               else
+                       $cat >try.c <<'EOCP'
+typedef double NV;
+EOCP
+               fi
+               $cat >>try.c <<'EOCP'
 #include <stdio.h>
 struct foobar {
        char foo;
-       double bar;
+       NV bar;
 } try_algn;
 int main()
 {
@@ -11500,6 +11706,9 @@ EOCP
 esac
 
 
+: set the base revision
+baserev=5.0
+
 : check for ordering of bytes in a long
 echo " "
 case "$crosscompile$multiarch" in
@@ -12276,7 +12485,7 @@ if eval $compile_ok; then
                echo "(I can't execute the test program--guessing $gidsize.)" >&4
                ;;
        *)      gidsize=$yyy
-               echo "Your $zzz size is $gidsize bytes."
+               echo "Your $zzz is $gidsize bytes long."
                ;;
        esac
 else
@@ -12813,11 +13022,20 @@ rp="What is the type of process ids on this system?"
 set pid_t pidtype int stdio.h sys/types.h
 eval $typedef_ask
 
+: Find earliest binary compatible site_perl subdirectory perl can use.
+case "$bincompat5005" in
+"$define") xs_apiversion='5.005' ;;
+*) xs_apiversion=$version ;;   # The current site_perl version.
+esac
+: Find earliest pure perl site_perl subdirectory perl can use.
+: The versioned directories started at 5.005.
+pm_apiversion='5.005'
+
 : check for length of pointer
 echo " "
 case "$ptrsize" in
 '')
-       $echo $n "Checking to see how big your pointers are...$c" >&4
+       echo "Checking to see how big your pointers are..." >&4
        if test "$voidflags" -gt 7; then
                echo '#define VOID_PTR char *' > try.c
        else
@@ -12834,7 +13052,7 @@ EOCP
        set try
        if eval $compile_ok; then
                ptrsize=`./try`
-               $echo " $ptrsize bytes." >&4
+               echo "Your pointers are $ptrsize bytes long."
        else
                dflt='4'
                echo "(I can't seem to compile the test program.  Guessing...)" >&4
@@ -13298,6 +13516,69 @@ echo $sig_name | $awk \
 }'
 $rm -f signal signal.c signal.awk signal.lst signal_cmd 
 
+: check for socklen_t
+echo " "
+echo "Checking to see if you have socklen_t..." >&4
+$cat >try.c <<EOCP
+#include <sys/types.h>
+#$d_socket HAS_SOCKET
+#ifdef HAS_SOCKET
+#include <sys/socket.h>
+#endif
+int main() { socklen_t x = 16; }
+EOCP
+set try
+if eval $compile; then
+       val="$define"
+       echo "You have socklen_t."
+else
+       val="$undef"
+       echo "You do not have socklen_t."
+       case "$sizetype" in
+       size_t) echo "(You do have size_t, that might work.)" ;;
+       esac
+fi
+$rm -f try try.*
+set d_socklen_t
+eval $setvar
+
+: check for type of the size argument to socket calls
+case "$d_socket" in
+"$define")
+       $cat <<EOM
+
+Checking to see what type is the last argument of accept().
+EOM
+       hdrs="$define sys/types.h $d_socket sys/socket.h" 
+       yyy=''
+       case "$d_socklen_t" in
+       "$define") yyy="$yyy socklen_t"
+       esac
+       yyy="$yyy $sizetype int long"
+       for xxx in $yyy; do
+               case "$socksizetype" in
+               '')     try="extern int accept(int, struct sockaddr *, $xxx *);"
+                       if ./protochk "$try" $hdrs; then
+                               echo "Your system accepts '$xxx *' for the last argument of accept()."
+                               socksizetype="$xxx"
+                       fi
+                       ;;
+               esac
+       done
+: In case none of those worked, prompt the user.
+       case "$socksizetype" in
+       '')     rp='What is the type for the last argument to accept()?'
+               dflt='int'
+               . ./myread
+               socksizetype=$ans
+               ;;
+       esac
+       ;;
+*)     : no sockets, so pick relatively harmless defaults
+       socksizetype='char *'
+       ;;
+esac
+
 : see what type is used for signed size_t
 set ssize_t ssizetype int stdio.h sys/types.h
 eval $typedef
@@ -13413,7 +13694,7 @@ if eval $compile_ok; then
                echo "(I can't execute the test program--guessing $uidsize.)" >&4
                ;;
        *)      uidsize=$yyy
-               echo "Your $zzz size is $uidsize bytes."
+               echo "Your $zzz is $uidsize bytes long."
                ;;
        esac
 else
@@ -13774,7 +14055,7 @@ ccflags="$ccflags"
 ldflags="$ldflags"
 libs="$libs"
 exe_ext="$exe_ext"
-$cc $optimize $ccflags $ldflags -o try$exe_ext try.c $libs && ./try$exe_ext
+$cc $optimize $ccflags $ldflags -o try try.c $libs && ./try$exe_ext
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
 set i_sysioctl
 eval $setvar
 
+
+: see if this is a syslog.h system
+set syslog.h i_syslog
+eval $inhdr
+
+
+: see if this is a sys/mode.h system
+set sys/mode.h i_sysmode
+eval $inhdr
+
 : see if sys/resource.h has to be included
 set sys/resource.h i_sysresrc
 eval $inhdr
@@ -14066,6 +14357,11 @@ eval $inhdr
 set sys/un.h i_sysun
 eval $inhdr
 
+
+: see if this is a sys/utsname.h system
+set sys/utsname.h i_sysutsname
+eval $inhdr
+
 : see if this is a syswait system
 set sys/wait.h i_syswait
 eval $inhdr
@@ -14176,12 +14472,30 @@ for xxx in $known_extensions ; do
                ;;
        NDBM_File|ndbm_fil)
                case "$i_ndbm" in
-               $define) avail_ext="$avail_ext $xxx" ;;
+               $define)
+                   case "$osname-$use64bitint" in
+                   hpux-define)
+                       case "$libs" in
+                       *-lndbm*) avail_ext="$avail_ext $xxx" ;;
+                       esac
+                       ;;
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        ODBM_File|odbm_fil) 
                case "${i_dbm}${i_rpcsvcdbm}" in
-               *"${define}"*) avail_ext="$avail_ext $xxx" ;;
+               *"${define}"*)
+                   case "$osname-$use64bitint" in
+                   hpux-define)
+                       case "$libs" in
+                       *-ldbm*) avail_ext="$avail_ext $xxx" ;;
+                       esac
+                       ;;
+                   *) avail_ext="$avail_ext $xxx" ;;
+                   esac
+                   ;;
                esac
                ;;
        POSIX|posix)
@@ -14558,6 +14872,8 @@ d_fstatfs='$d_fstatfs'
 d_fstatvfs='$d_fstatvfs'
 d_ftello='$d_ftello'
 d_ftime='$d_ftime'
+d_getcwd='$d_getcwd'
+d_getfsstat='$d_getfsstat'
 d_getgrent='$d_getgrent'
 d_getgrps='$d_getgrps'
 d_gethbyaddr='$d_gethbyaddr'
@@ -14596,7 +14912,7 @@ d_htonl='$d_htonl'
 d_iconv='$d_iconv'
 d_index='$d_index'
 d_inetaton='$d_inetaton'
-d_int64t='$d_int64t'
+d_int64_t='$d_int64_t'
 d_isascii='$d_isascii'
 d_killpg='$d_killpg'
 d_lchown='$d_lchown'
@@ -14606,6 +14922,7 @@ d_locconv='$d_locconv'
 d_lockf='$d_lockf'
 d_longdbl='$d_longdbl'
 d_longlong='$d_longlong'
+d_lseekproto='$d_lseekproto'
 d_lstat='$d_lstat'
 d_mblen='$d_mblen'
 d_mbstowcs='$d_mbstowcs'
@@ -14616,8 +14933,13 @@ d_memcpy='$d_memcpy'
 d_memmove='$d_memmove'
 d_memset='$d_memset'
 d_mkdir='$d_mkdir'
+d_mkdtemp='$d_mkdtemp'
 d_mkfifo='$d_mkfifo'
+d_mkstemp='$d_mkstemp'
+d_mkstemps='$d_mkstemps'
 d_mktime='$d_mktime'
+d_mmap='$d_mmap'
+d_mprotect='$d_mprotect'
 d_msg='$d_msg'
 d_msg_ctrunc='$d_msg_ctrunc'
 d_msg_dontroute='$d_msg_dontroute'
@@ -14628,6 +14950,8 @@ d_msgctl='$d_msgctl'
 d_msgget='$d_msgget'
 d_msgrcv='$d_msgrcv'
 d_msgsnd='$d_msgsnd'
+d_msync='$d_msync'
+d_munmap='$d_munmap'
 d_mymalloc='$d_mymalloc'
 d_nice='$d_nice'
 d_nv_preserves_uv='$d_nv_preserves_uv'
@@ -14704,6 +15028,7 @@ d_shmget='$d_shmget'
 d_sigaction='$d_sigaction'
 d_sigsetjmp='$d_sigsetjmp'
 d_socket='$d_socket'
+d_socklen_t='$d_socklen_t'
 d_sockpair='$d_sockpair'
 d_sqrtl='$d_sqrtl'
 d_statblks='$d_statblks'
@@ -14856,6 +15181,9 @@ i_sysfile='$i_sysfile'
 i_sysfilio='$i_sysfilio'
 i_sysin='$i_sysin'
 i_sysioctl='$i_sysioctl'
+i_syslog='$i_syslog'
+i_sysmman='$i_sysmman'
+i_sysmode='$i_sysmode'
 i_sysmount='$i_sysmount'
 i_sysndir='$i_sysndir'
 i_sysparam='$i_sysparam'
@@ -14872,6 +15200,7 @@ i_systimes='$i_systimes'
 i_systypes='$i_systypes'
 i_sysuio='$i_sysuio'
 i_sysun='$i_sysun'
+i_sysutsname='$i_sysutsname'
 i_sysvfs='$i_sysvfs'
 i_syswait='$i_syswait'
 i_termio='$i_termio'
@@ -14924,6 +15253,7 @@ libs='$libs'
 libsdirs='$libsdirs'
 libsfiles='$libsfiles'
 libsfound='$libsfound'
+libspath='$libspath'
 libswanted='$libswanted'
 line='$line'
 lint='$lint'
@@ -14956,6 +15286,7 @@ man3ext='$man3ext'
 medium='$medium'
 mips_type='$mips_type'
 mkdir='$mkdir'
+mmaptype='$mmaptype'
 models='$models'
 modetype='$modetype'
 more='$more'
@@ -14989,6 +15320,7 @@ pager='$pager'
 passcat='$passcat'
 patchlevel='$patchlevel'
 path_sep='$path_sep'
+perl5='$perl5'
 perl='$perl'
 perladmin='$perladmin'
 perlpath='$perlpath'
@@ -14996,6 +15328,7 @@ pg='$pg'
 phostname='$phostname'
 pidtype='$pidtype'
 plibpth='$plibpth'
+pm_apiversion='$pm_apiversion'
 pmake='$pmake'
 pr='$pr'
 prefix='$prefix'
@@ -15011,6 +15344,7 @@ randfunc='$randfunc'
 randseedtype='$randseedtype'
 ranlib='$ranlib'
 rd_nodata='$rd_nodata'
+revision='$revision'
 rm='$rm'
 rmail='$rmail'
 runnm='$runnm'
@@ -15062,6 +15396,7 @@ small='$small'
 so='$so'
 sockethdr='$sockethdr'
 socketlib='$socketlib'
+socksizetype='$socksizetype'
 sort='$sort'
 spackage='$spackage'
 spitshell='$spitshell'
@@ -15109,12 +15444,12 @@ uname='$uname'
 uniq='$uniq'
 uquadtype='$uquadtype'
 use5005threads='$use5005threads'
-use64bits='$use64bits'
+use64bitall='$use64bitall'
+use64bitint='$use64bitint'
 usedl='$usedl'
 useithreads='$useithreads'
 uselargefiles='$uselargefiles'
 uselongdouble='$uselongdouble'
-uselonglong='$uselonglong'
 usemorebits='$usemorebits'
 usemultiplicity='$usemultiplicity'
 usemymalloc='$usemymalloc'
@@ -15145,6 +15480,7 @@ version='$version'
 vi='$vi'
 voidflags='$voidflags'
 xlibpth='$xlibpth'
+xs_apiversion='$xs_apiversion'
 zcat='$zcat'
 zip='$zip'
 EOT