This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Make the stdio test program of 7427 less noisy while being
[perl5.git] / Configure
index 43b8061..c07cf35 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 Aug 31 07:18:29 EET DST 2000 [metaconfig 3.0 PL70]
+# Generated on Tue Nov  7 00:26:20 EET 2000 [metaconfig 3.0 PL70]
 # (with additional metaconfig patches by perlbug@perl.org)
 
 cat >/tmp/c1$$ <<EOF
@@ -160,9 +160,12 @@ esac
 test -d UU || mkdir UU
 cd UU && rm -f ./*
 
+ccname=''
+ccversion=''
 ccsymbols=''
 cppccsymbols=''
 cppsymbols=''
+perllibs=''
 dynamic_ext=''
 extensions=''
 known_extensions=''
@@ -345,6 +348,7 @@ d_endsent=''
 d_fchmod=''
 d_fchown=''
 d_fcntl=''
+d_fcntl_can_lock=''
 d_fd_macros=''
 d_fd_set=''
 d_fds_bits=''
@@ -533,6 +537,8 @@ d_fstatvfs=''
 d_statvfs=''
 d_stdio_cnt_lval=''
 d_stdio_ptr_lval=''
+d_stdio_ptr_lval_nochange_cnt=''
+d_stdio_ptr_lval_sets_cnt=''
 d_stdiobase=''
 d_stdstdio=''
 stdio_base=''
@@ -598,7 +604,6 @@ fflushNULL=''
 fflushall=''
 fpossize=''
 fpostype=''
-ccname=''
 gccosandvers=''
 gccversion=''
 gidformat=''
@@ -729,16 +734,16 @@ libsfiles=''
 libsfound=''
 libspath=''
 lns=''
-d_PRIEldbl=''
-d_PRIFldbl=''
-d_PRIGldbl=''
+d_PRIEUldbl=''
+d_PRIFUldbl=''
+d_PRIGUldbl=''
 d_PRIeldbl=''
 d_PRIfldbl=''
 d_PRIgldbl=''
 d_SCNfldbl=''
-sPRIEldbl=''
-sPRIFldbl=''
-sPRIGldbl=''
+sPRIEUldbl=''
+sPRIFUldbl=''
+sPRIGUldbl=''
 sPRIeldbl=''
 sPRIfldbl=''
 sPRIgldbl=''
@@ -760,12 +765,6 @@ installman3dir=''
 man3dir=''
 man3direxp=''
 man3ext=''
-huge=''
-large=''
-medium=''
-models=''
-small=''
-split=''
 modetype=''
 multiarch=''
 mydomain=''
@@ -827,13 +826,13 @@ u8type=''
 uvsize=''
 uvtype=''
 ivdformat=''
-nvEformat=''
-nvFformat=''
-nvGformat=''
+nvEUformat=''
+nvFUformat=''
+nvGUformat=''
 nveformat=''
 nvfformat=''
 nvgformat=''
-uvXformat=''
+uvXUformat=''
 uvoformat=''
 uvuformat=''
 uvxformat=''
@@ -845,13 +844,13 @@ privlib=''
 privlibexp=''
 prototype=''
 ptrsize=''
-d_PRIX64=''
+d_PRIXU64=''
 d_PRId64=''
 d_PRIi64=''
 d_PRIo64=''
 d_PRIu64=''
 d_PRIx64=''
-sPRIX64=''
+sPRIXU64=''
 sPRId64=''
 sPRIi64=''
 sPRIo64=''
@@ -948,6 +947,7 @@ vendorlibexp=''
 usevendorprefix=''
 vendorprefix=''
 vendorprefixexp=''
+versiononly=''
 defvoidused=''
 voidflags=''
 pm_apiversion=''
@@ -969,6 +969,9 @@ if test -f /etc/unixtovms.exe; then
 fi
 
 i_whoami=''
+ccname=''
+ccversion=''
+perllibs=''
 : set useposix=false in your hint file to disable the POSIX extension.
 useposix=true
 : set useopcode=false in your hint file to disable the Opcode extension.
@@ -994,8 +997,7 @@ 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="/usr/lib/large /lib /usr/lib $xlibpth"
-glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
+glibpth="/lib /usr/lib $xlibpth"
 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"
@@ -1782,7 +1784,7 @@ $define|true|[yY]*) ;;
     This is an UNSTABLE DEVELOPMENT release.
     The version of this $package distribution is $xversion, that is, odd,
     (as opposed to even) and that signifies a development release.
-    If you want a maintenance release, you want an even-numbered version.)
+    If you want a maintenance release, you want an even-numbered version.
 
     Do ***NOT*** install this into production use.
     Data corruption and crashes are possible.
@@ -2100,7 +2102,7 @@ int main(int argc, char *argv[]) {
   return 0;
 }
 EOM
-    if $cc -o try try.c; then
+    if $cc -o try $ccflags try.c; then
        :
     else
         echo "Uh-oh, the C compiler '$cc' doesn't seem to be working." >&4
@@ -2134,8 +2136,12 @@ EOM
             fi
         fi
         if $test X"$despair" = Xyes; then
-            echo "You need to find a working C compiler." >&4
-            echo "I cannot continue any further, aborting." >&4
+           $cat >&4 <<EOM
+You need to find a working C compiler.
+Either (purchase and) install the C compiler supplied by your OS vendor,
+or for a free C compiler try http://gcc.gnu.org/
+I cannot continue any further, aborting.
+EOM
             exit 1
         fi
     fi
@@ -2258,7 +2264,10 @@ if test -f config.sh; then
        rp="I see a config.sh file.  Shall I use it to set the defaults?"
        . UU/myread
        case "$ans" in
-       n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
+       n*|N*) echo "OK, I'll ignore it."
+               mv config.sh config.sh.old
+               myuname="$newmyuname"
+               ;;
        *)  echo "Fetching default answers from your old config.sh file..." >&4
                tmp_n="$n"
                tmp_c="$c"
@@ -2423,6 +2432,7 @@ EOM
                        esac
                        ;;
                next*) osname=next ;;
+               nonstop-ux) osname=nonstopux ;;
                POSIX-BC | posix-bc ) osname=posix-bc
                        osvers="$3"
                        ;;
@@ -2668,7 +2678,6 @@ cd UU
        ;;
 esac
 test "$override" && . ./optdef.sh
-myuname="$newmyuname"
 
 : Restore computed paths
 for file in $loclist $trylist; do
@@ -2885,174 +2894,6 @@ esac
 set usemultiplicity
 eval $setvar
 
-: 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
-if $test -d "$sysman"; then
-       echo "System manual is in $sysman." >&4
-else
-       echo "Could not find manual pages in source form." >&4
-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
-       case "$cc" in
-       '') modelcc="$cc" ;;
-       *) modelcc="cc" ;;
-       esac
-       ( $modelcc -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
-
 : make some quick guesses about what we are up against
 echo " "
 $echo $n "Hmm...  $c"
@@ -3070,7 +2911,7 @@ 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
+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..."
@@ -3109,12 +2950,15 @@ EOI
        ;;
 esac
 : Detect OS2.  The p_ variable is set above in the Head.U unit.
+: Note that this also -- wrongly -- detects e.g. dos-djgpp, which also uses
+: semicolon as a patch separator
 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!
+(Or you may be running DOS with DJGPP.)
 EOI
        echo exit 0 >os2
        ;;
@@ -3145,51 +2989,13 @@ 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
+case "$cc" in
+'') dflt=cc;;
+*) dflt="$cc";;
+esac
+rp="Use which C compiler?"
+. ./myread
+cc="$ans"
 : 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.
@@ -3213,7 +3019,7 @@ int main() {
        exit(0);
 }
 EOM
-if $cc $ldflags -o gccvers gccvers.c; then
+if $cc -o gccvers $ldflags gccvers.c; then
        gccversion=`./gccvers`
        case "$gccversion" in
        '') echo "You are not using GNU cc." ;;
@@ -3485,7 +3291,7 @@ esac
 
 case "$fn" in
 *\(*)
-       expr $fn : '.*(\(.*\)).*' | tr ',' $trnl >getfile.ok
+       expr $fn : '.*(\(.*\)).*' | $tr ',' $trnl >getfile.ok
        fn=`echo $fn | sed 's/(.*)//'`
        ;;
 esac
@@ -4051,8 +3857,8 @@ for thisincl in $inclwanted; do
        if $test -d $thisincl; then
                if $test x$thisincl != x$usrinc; then
                        case "$dflt" in
-                       *$thisincl*);;
-                       *) dflt="$dflt -I$thisincl";;
+                        *" -I$thisincl "*);;
+                        *) dflt="$dflt -I$thisincl ";;
                        esac
                fi
        fi
@@ -4088,6 +3894,7 @@ esac
 case "$dflt" in
 ''|' ') dflt=none;;
 esac
+
 $cat <<EOH
 
 Your C compiler may want other flags.  For this question you should include
@@ -4220,7 +4027,7 @@ $cat > try.c <<'EOF'
 #include <stdio.h>
 int main() { printf("Ok\n"); exit(0); }
 EOF
-set X $cc $optimize $ccflags -o try $ldflags try.c $libs
+set X $cc -o try $optimize $ccflags $ldflags try.c $libs
 shift
 $cat >try.msg <<'EOM'
 I've tried to compile and run the following simple program:
@@ -4239,7 +4046,7 @@ and I got the following output:
 
 EOM
 dflt=y
-if sh -c "$cc $optimize $ccflags -o try $ldflags try.c $libs" >>try.msg 2>&1; then
+if sh -c "$cc -o try $optimize $ccflags $ldflags try.c $libs" >>try.msg 2>&1; then
        if sh -c './try' >>try.msg 2>&1; then
                xxx=`./try`
                case "$xxx" in
@@ -4351,12 +4158,12 @@ esac'
 compile='
 mc_file=$1;
 shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs > /dev/null 2>&1;'
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs > /dev/null 2>&1;'
 : define a shorthand compile call for compilations that should be ok.
 compile_ok='
 mc_file=$1;
 shift;
-$cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
+$cc -o ${mc_file} $optimize $ccflags $ldflags $* ${mc_file}.c $libs;'
 
 : check for lengths of integral types
 echo " "
@@ -4937,7 +4744,7 @@ unknown)
                                s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
                                G
                                s/\n/ /' | \
-                        sort | $sed -e 's/^.* //'`
+                        $sort | $sed -e 's/^.* //'`
                eval set \$$#
        done
        $test -r $1 || set /usr/ccs/lib/libc.$so
@@ -4997,7 +4804,7 @@ compiler, or your machine supports multiple models), you can override it here.
 EOM
 else
        dflt=''
-       echo $libpth | tr ' ' $trnl | sort | uniq > libpath
+       echo $libpth | $tr ' ' $trnl | $sort | $uniq > libpath
        cat >&4 <<EOM
 I can't seem to find your C library.  I've looked in the following places:
 
@@ -5015,7 +4822,7 @@ rp='Where is your C library?'
 libc="$ans"
 
 echo " "
-echo $libc $libnames | tr ' ' $trnl | sort | uniq > libnames
+echo $libc $libnames | $tr ' ' $trnl | $sort | $uniq > libnames
 set X `cat libnames`
 shift
 xxx=files
@@ -5178,7 +4985,7 @@ yes)
                fi;;
        *)
                echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
-               if $cc $optimize $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
+               if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
                then tval=true;
                else tval=false;
                fi;
@@ -5280,6 +5087,82 @@ EOM
        ;;
 esac
 
+: check for length of double
+echo " "
+case "$doublesize" in
+'')
+       echo "Checking to see how big your double precision numbers are..." >&4
+       $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+    printf("%d\n", (int)sizeof(double));
+    exit(0);
+}
+EOCP
+       set try
+       if eval $compile_ok; then
+               doublesize=`./try`
+               echo "Your double is $doublesize bytes long."
+       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 "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 "You have long double."
+else
+       val="$undef"
+       echo "You do not have long double."
+fi
+$rm try.*
+set d_longdbl
+eval $setvar
+
+: check for length of long double
+case "${d_longdbl}${longdblsize}" in
+$define)
+       echo " "
+       echo "Checking to see how big your long doubles are..." >&4
+       $cat >try.c <<'EOCP'
+#include <stdio.h>
+int main()
+{
+       printf("%d\n", sizeof(long double));
+}
+EOCP
+       set try
+       set try
+       if eval $compile; then
+               longdblsize=`./try$exe_ext`
+               echo "Your long doubles are $longdblsize bytes long."
+       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.* try
+
 : determine the architecture name
 echo " "
 if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
@@ -5338,13 +5221,14 @@ case "$use64bitint$use64bitall" in
 *"$define"*)
        case "$archname64" in
        '')
+               echo "This architecture is naturally 64-bit, not changing architecture name." >&4
                ;;
        *)
                case "$use64bitint" in
                "$define") echo "64 bit integers selected." >&4 ;;
                esac
                case "$use64bitall" in
-               "$define") echo "64 bit memory model selected." >&4 ;;
+               "$define") echo "Maximal 64 bitness selected." >&4 ;;
                esac
                case "$archname" in
                *-$archname64*) echo "...and architecture name already has $archname64." >&4
@@ -5359,13 +5243,20 @@ esac
 case "$uselongdouble" in
 $define)
        echo "Long doubles selected." >&4
-       case "$archname" in
-        *-ld*) echo "...and architecture name already has -ld." >&4
-                ;;
-        *)      archname="$archname-ld"
-                echo "...setting architecture name to $archname." >&4
-                ;;
-        esac
+       case "$longdblsize" in
+       $doublesize)
+               "...but long doubles are equal to doubles, not changing architecture name." >&4
+               ;;
+       *)
+               case "$archname" in
+               *-ld*) echo "...and architecture name already has -ld." >&4
+                       ;;
+               *)      archname="$archname-ld"
+                       echo "...setting architecture name to $archname." >&4
+                       ;;
+               esac
+               ;;
+       esac
        ;;
 esac
 
@@ -6490,13 +6381,13 @@ EOM
                        hpux)   dflt='+z' ;;
                        next)   dflt='none' ;;
                        irix*)  dflt='-KPIC' ;;
-                       svr4*|esix*|solaris) dflt='-KPIC' ;;
+                       svr4*|esix*|solaris|nonstopux) dflt='-KPIC' ;;
                        sunos)  dflt='-pic' ;;
                        *)      dflt='none' ;;
                    esac
                        ;;
                *)  case "$osname" in
-                       svr4*|esix*|solaris) dflt='-fPIC' ;;
+                       svr4*|esix*|solaris|nonstopux) dflt='-fPIC' ;;
                        *)      dflt='-fpic' ;;
                    esac ;;
            esac ;;
@@ -6572,7 +6463,7 @@ EOM
                        next)  dflt='none' ;;
                        solaris) dflt='-G' ;;
                        sunos) dflt='-assert nodefinitions' ;;
-                       svr4*|esix*) dflt="-G $ldflags" ;;
+                       svr4*|esix*|nonstopux) dflt="-G $ldflags" ;;
                *)     dflt='none' ;;
                        esac
                        ;;
@@ -6647,7 +6538,7 @@ $undef)
        ;;
 *)     case "$useshrplib" in
        '')     case "$osname" in
-               svr4*|dgux|dynixptx|esix|powerux|beos|cygwin*)
+               svr4*|nonstopux|dgux|dynixptx|esix|powerux|beos|cygwin*)
                        dflt=y
                        also='Building a shared libperl is required for dynamic loading to work on your system.'
                        ;;
@@ -6852,6 +6743,24 @@ case "$ldlibpthname" in
 none)  ldlibpthname='' ;;
 esac
 
+: 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
+if $test -d "$sysman"; then
+       echo "System manual is in $sysman." >&4
+else
+       echo "Could not find manual pages in source form." >&4
+fi
+
 : determine where manual pages go
 set man1dir man1dir none
 eval $prefixit
@@ -7218,18 +7127,23 @@ case "$myhostname" in
                                        /[       ]$myhostname[  . ]/p" > hosts
                }
                tmp_re="[       . ]"
-               $test x`$awk "/[0-9].*[  ]$myhostname$tmp_re/ { sum++ }
+               if $test -f hosts; then
+                       $test x`$awk "/[0-9].*[  ]$myhostname$tmp_re/ { sum++ }
                             END { print sum }" hosts` = x1 || tmp_re="[         ]"
-               dflt=.`$awk "/[0-9].*[   ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
-                       hosts | $sort | $uniq | \
-                       $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
-               case `$echo X$dflt` in
-               X*\ *)  echo "(Several hosts in /etc/hosts matched hostname)"
+                       dflt=.`$awk "/[0-9].*[   ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
+                               hosts | $sort | $uniq | \
+                               $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
+                       case `$echo X$dflt` in
+                       X*\ *)  echo "(Several hosts in the database matched hostname)"
+                               dflt=.
+                               ;;
+                       X.) echo "(You do not have fully-qualified names in the hosts database)"
+                               ;;
+                       esac
+               else
+                       echo "(I cannot locate a hosts database anywhere)"
                        dflt=.
-                       ;;
-               X.) echo "(You do not have fully-qualified names in /etc/hosts)"
-                       ;;
-               esac
+               fi
                case "$dflt" in
                .)
                        tans=`./loc resolv.conf X /etc /usr/etc`
@@ -7357,6 +7271,25 @@ rp='Perl administrator e-mail address'
 . ./myread
 perladmin="$ans"
 
+: determine whether to only install version-specific parts.
+echo " "
+$cat <<EOM
+Do you want to install only the version-specific parts of the perl
+distribution?  Usually you do *not* want to do this.
+EOM
+case "$versiononly" in
+"$define"|[Yy]*|true) dflt='y' ;;
+*) dflt='n';
+esac
+rp="Do you want to install only the version-specific parts of perl?"
+. ./myread
+case "$ans" in
+[yY]*) val="$define";;
+*)     val="$undef" ;;
+esac
+set versiononly
+eval $setvar
+
 : figure out how to guarantee perl startup
 case "$startperl" in
 '')
@@ -7371,7 +7304,10 @@ want to share those scripts and perl is not in a standard place
 a shell by starting the script with a single ':' character.
 
 EOH
-               dflt="$binexp/perl"
+               case "$versiononly" in
+               "$define")      dflt="$binexp/perl$version";;  
+               *)              dflt="$binexp/perl";;
+               esac
                rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
                . ./myread
                case "$ans" in
@@ -7540,82 +7476,6 @@ fi
 set qgcvt d_qgcvt
 eval $inlibc
 
-: check for length of double
-echo " "
-case "$doublesize" in
-'')
-       echo "Checking to see how big your double precision numbers are..." >&4
-       $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-    printf("%d\n", (int)sizeof(double));
-    exit(0);
-}
-EOCP
-       set try
-       if eval $compile_ok; then
-               doublesize=`./try`
-               echo "Your double is $doublesize bytes long."
-       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 "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 "You have long double."
-else
-       val="$undef"
-       echo "You do not have long double."
-fi
-$rm try.*
-set d_longdbl
-eval $setvar
-
-: check for length of long double
-case "${d_longdbl}${longdblsize}" in
-$define)
-       echo " "
-       echo "Checking to see how big your long doubles are..." >&4
-       $cat >try.c <<'EOCP'
-#include <stdio.h>
-int main()
-{
-       printf("%d\n", sizeof(long double));
-}
-EOCP
-       set try
-       set try
-       if eval $compile; then
-               longdblsize=`./try$exe_ext`
-               echo "Your long doubles are $longdblsize bytes long."
-       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.* try
-
 echo " "
 
 if $test X"$d_longdbl" = X"$define"; then
@@ -7637,7 +7497,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"f"'; sPRIgldbl='"g"'; sPRIeldbl='"e"';
-                       sPRIFldbl='"F"'; sPRIGldbl='"G"'; sPRIEldbl='"E"';
+                       sPRIFUldbl='"F"'; sPRIGUldbl='"G"'; sPRIEUldbl='"E"';
                        echo "We will use %f."
                        ;;
                esac
@@ -7659,7 +7519,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"llf"'; sPRIgldbl='"llg"'; sPRIeldbl='"lle"';
-                       sPRIFldbl='"llF"'; sPRIGldbl='"llG"'; sPRIEldbl='"llE"';
+                       sPRIFUldbl='"llF"'; sPRIGUldbl='"llG"'; sPRIEUldbl='"llE"';
                        echo "We will use %llf."
                        ;;
                esac
@@ -7681,7 +7541,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"Lf"'; sPRIgldbl='"Lg"'; sPRIeldbl='"Le"';
-                       sPRIFldbl='"LF"'; sPRIGldbl='"LG"'; sPRIEldbl='"LE"';
+                       sPRIFUldbl='"LF"'; sPRIGUldbl='"LG"'; sPRIEUldbl='"LE"';
                        echo "We will use %Lf."
                        ;;
                esac
@@ -7703,7 +7563,7 @@ EOCP
                case "$yyy" in
                123.456)
                        sPRIfldbl='"lf"'; sPRIgldbl='"lg"'; sPRIeldbl='"le"';
-                       sPRIFldbl='"lF"'; sPRIGldbl='"lG"'; sPRIEldbl='"lE"';
+                       sPRIFUldbl='"lF"'; sPRIGUldbl='"lG"'; sPRIEUldbl='"lE"';
                        echo "We will use %lf."
                        ;;
                esac
@@ -7722,11 +7582,11 @@ fi # d_longdbl
 
 case "$sPRIfldbl" in
 '')    d_PRIfldbl="$undef"; d_PRIgldbl="$undef"; d_PRIeldbl="$undef"; 
-       d_PRIFldbl="$undef"; d_PRIGldbl="$undef"; d_PRIEldbl="$undef"; 
+       d_PRIFUldbl="$undef"; d_PRIGUldbl="$undef"; d_PRIEUldbl="$undef"; 
        d_SCNfldbl="$undef";
        ;;
 *)     d_PRIfldbl="$define"; d_PRIgldbl="$define"; d_PRIeldbl="$define"; 
-       d_PRIFldbl="$define"; d_PRIGldbl="$define"; d_PRIEldbl="$define"; 
+       d_PRIFUldbl="$define"; d_PRIGUldbl="$define"; d_PRIEUldbl="$define"; 
        d_SCNfldbl="$define";
        ;;
 esac
@@ -7839,17 +7699,22 @@ int main()
        Gconvert((DOUBLETYPE)-100000.0, 8, 0, buf); 
        checkit("-100000", buf);
 
+       Gconvert((DOUBLETYPE)123.456, 8, 0, buf); 
+       checkit("123.456", buf);
+
        exit(0);
 }
 EOP
 case "$d_Gconvert" in
 gconvert*) xxx_list='gconvert gcvt sprintf' ;;
 gcvt*) xxx_list='gcvt gconvert sprintf' ;;
-*) xxx_list='sprintf gconvert gcvt' ;;
+sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+*) xxx_list='gconvert gcvt sprintf' ;;
 esac
 
 case "$d_longdbl$uselongdouble$d_PRIgldbl" in
 "$define$define$define")
+    # for long doubles prefer first qgcvt, then sprintf
     xxx_list="`echo $xxx_list|sed s/sprintf//`" 
     xxx_list="sprintf $xxx_list"
     case "$d_qgcvt" in
@@ -7918,15 +7783,15 @@ int main() {
 EOCP
        : check sys/file.h first, no particular reason here
        if $test `./findhdr sys/file.h` && \
-               $cc $cppflags -DI_SYS_FILE -o access access.c >/dev/null 2>&1 ; then
+               $cc -o access $cppflags -DI_SYS_FILE access.c >/dev/null 2>&1 ; then
                h_sysfile=true;
                echo "<sys/file.h> defines the *_OK access constants." >&4
        elif $test `./findhdr fcntl.h` && \
-               $cc $cppflags -DI_FCNTL -o access access.c >/dev/null 2>&1 ; then
+               $cc -o access $cppflags -DI_FCNTL access.c >/dev/null 2>&1 ; then
                h_fcntl=true;
                echo "<fcntl.h> defines the *_OK access constants." >&4
        elif $test `./findhdr unistd.h` && \
-               $cc $cppflags -DI_UNISTD -o access access.c >/dev/null 2>&1 ; then
+               $cc -o access $cppflags -DI_UNISTD access.c >/dev/null 2>&1 ; then
                echo "<unistd.h> defines the *_OK access constants." >&4
        else
                echo "I can't find the four *_OK access constants--I'll use mine." >&4
@@ -8016,10 +7881,10 @@ int main()
        exit(1);
 }
 EOP
-       if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+       if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
                echo "You have to use getpgrp(pid) instead of getpgrp()." >&4
                val="$define"
-       elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+       elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
                echo "You have to use getpgrp() instead of getpgrp(pid)." >&4
                val="$undef"
        else
@@ -8078,10 +7943,10 @@ int main()
        exit(1);
 }
 EOP
-       if $cc -DTRY_BSD_PGRP $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+       if $cc -o set -DTRY_BSD_PGRP $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
                echo 'You have to use setpgrp(pid,pgrp) instead of setpgrp().' >&4
                val="$define"
-       elif $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1 && ./set; then
+       elif $cc -o set $ccflags $ldflags set.c $libs >/dev/null 2>&1 && ./set; then
                echo 'You have to use setpgrp() instead of setpgrp(pid,pgrp).' >&4
                val="$undef"
        else
@@ -8633,8 +8498,8 @@ EOM
        : Call the object file tmp-dyna.o in case dlext=o.
        if $cc $ccflags $cccdlflags -c dyna.c > /dev/null 2>&1 && 
                mv dyna${_o} tmp-dyna${_o} > /dev/null 2>&1 && 
-               $ld $lddlflags -o dyna.$dlext tmp-dyna${_o} > /dev/null 2>&1 && 
-               $cc $ccflags -o fred $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
+               $ld -o dyna.$dlext $lddlflags tmp-dyna${_o} > /dev/null 2>&1 && 
+               $cc -o fred $ccflags $ldflags $cccdlflags $ccdlflags fred.c $libs > /dev/null 2>&1; then
                xxx=`./fred`
                case $xxx in
                1)      echo "Test program failed using dlopen." >&4
@@ -8986,6 +8851,54 @@ eval $inlibc
 set fcntl d_fcntl
 eval $inlibc
 
+echo " "
+: See if fcntl-based locking works.
+$cat >try.c <<'EOCP'
+#include <stdlib.h>
+#include <unistd.h>
+#include <fcntl.h>
+int main() {
+#if defined(F_SETLK) && defined(F_SETLKW)
+     struct flock flock;
+     int retval, fd;
+     fd = open("try.c", O_RDONLY);
+     flock.l_type = F_RDLCK;
+     flock.l_whence = SEEK_SET;
+     flock.l_start = flock.l_len = 0;
+     retval = fcntl(fd, F_SETLK, &flock);
+     close(fd);
+     (retval < 0 ? exit(2) : exit(0));
+#else
+     exit(2);
+#endif
+}
+EOCP
+echo "Checking if fcntl-based file locking works... "
+case "$d_fcntl" in
+"$define")
+       set try
+       if eval $compile_ok; then
+               if ./try; then
+                       echo "Yes, it seems to work."
+                       val="$define"
+               else
+                       echo "Nope, it didn't work."
+                       val="$undef"
+               fi
+       else
+               echo "I'm unable to compile the test program, so I'll assume not."
+               val="$undef"
+       fi
+       ;;
+*) val="$undef";
+       echo "Nope, since you don't even have fcntl()."
+       ;;
+esac
+set d_fcntl_can_lock
+eval $setvar
+$rm -f try*
+
+
 hasfield='varname=$1; struct=$2; field=$3; shift; shift; shift;
 while $test $# -ge 2; do
        case "$1" in
@@ -10423,7 +10336,6 @@ EOP
 esac
 
 
-
 : check for off64_t
 echo " "
 echo "Checking to see if you have off64_t..." >&4
@@ -11623,6 +11535,93 @@ esac
 set d_stdio_cnt_lval
 eval $setvar
 
+
+: test whether setting _ptr sets _cnt as a side effect
+d_stdio_ptr_lval_sets_cnt="$undef"
+d_stdio_ptr_lval_nochange_cnt="$undef"
+case "$d_stdio_ptr_lval$d_stdstdio" in
+$define$define)
+       echo "Checking to see what happens if we set the stdio ptr..." >&4
+$cat >try.c <<EOP
+#include <stdio.h>
+/* Can we scream? */
+/* Eat dust sed :-) */
+/* In the buffer space, no one can hear you scream. */
+#define FILE_ptr(fp)   ((fp)->_ptr)
+#define FILE_cnt(fp)   ((fp)->_cnt)
+#include <sys/types.h>
+int main() {
+       FILE *fp = fopen("try.c", "r");
+       int c;
+       char *ptr;
+       size_t cnt;
+       if (!fp) {
+           puts("Fail even to read");
+           exit(1);
+       }
+       c = getc(fp); /* Read away the first # */
+       if (c == EOF) {
+           puts("Fail even to read");
+           exit(1);
+       }
+       if (!(
+               18 <= FILE_cnt(fp) &&
+               strncmp(FILE_ptr(fp), "include <stdio.h>\n", 18) == 0
+       )) {
+               puts("Fail even to read");
+               exit (1);
+       }
+       ptr = (char*) FILE_ptr(fp);
+       cnt = (size_t)FILE_cnt(fp);
+
+       FILE_ptr(fp) += 42;
+
+       if ((char*)FILE_ptr(fp) != (ptr + 42)) {
+               printf("Fail ptr check %p != %p", FILE_ptr(fp), (ptr + 42));
+               exit (1);
+       }
+       if (FILE_cnt(fp) <= 20) {
+               printf ("Fail (<20 chars to test)");
+               exit (1);
+       }
+       if (strncmp(FILE_ptr(fp), "Eat dust sed :-) */\n", 20) != 0) {
+               puts("Fail compare");
+               exit (1);
+       }
+       if (cnt == FILE_cnt(fp)) {
+               puts("Pass_unchanged");
+               exit (0);
+       }       
+       if (FILE_cnt(fp) == (cnt - 42)) {
+               puts("Pass_changed");
+               exit (0);
+       }
+       printf("Fail count was %d now %d\n", cnt, FILE_cnt(fp));
+       return 1;
+
+}
+EOP
+       set try
+       if eval $compile; then
+               case `./try$exe_ext` in
+               Pass_changed)
+                       echo "Increasing ptr in your stdio decreases cnt by the same amount.  Good." >&4
+                       d_stdio_ptr_lval_sets_cnt="$define" ;;
+               Pass_unchanged)
+                       echo "Increasing ptr in your stdio leaves cnt unchanged.  Good." >&4
+                       d_stdio_ptr_lval_nochange_cnt="$define" ;;
+               Fail*)
+                       echo "Increasing ptr in your stdio didn't do exactly what I expected.  We'll not be doing that then." >&4 ;;
+               *)
+                       echo "It appears attempting to set ptr in your stdio is a bad plan." >&4 ;;
+       esac
+       else
+               echo "It seems we can't set ptr in your stdio.  Nevermind." >&4
+       fi
+       $rm -f try.c try
+       ;;
+esac
+
 : see if _base is also standard
 val="$undef"
 case "$d_stdstdio" in
@@ -11787,6 +11786,9 @@ EOM
 #ifdef __hpux
 #define strtoll __strtoll
 #endif
+#ifdef __EMX__
+#define strtoll _strtoll
+#endif
 #include <stdio.h>
 extern long long int strtoll(char *s, char **, int); 
 static int bad = 0;
@@ -11813,7 +11815,8 @@ int main() {
 EOCP
        set try
        if eval $compile; then
-               case "`./try`" in
+               yyy=`./try`
+               case "$yyy" in
                ok) echo "Your strtoll() seems to be working okay." ;;
                *) cat <<EOM >&4
 Your strtoll() doesn't seem to be working okay.
@@ -11821,6 +11824,9 @@ EOM
                   d_strtoll="$undef"
                   ;;
                esac
+       else
+               echo "(I can't seem to compile the test program--assuming it doesn't)"
+               d_strtoll="$undef"
        fi
        ;;
 esac
@@ -12709,14 +12715,14 @@ val=$undef
 set tebcdic
 if eval $compile_ok; then
        if ./tebcdic; then
-               echo "You have EBCDIC." >&4
+               echo "You seem to speak EBCDIC." >&4
                val="$define"
        else
-               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin." >&4
+               echo "Nope, no EBCDIC, probably ASCII or some ISO Latin. Or UTF8." >&4
        fi
 else
        echo "I'm unable to compile the test program." >&4
-       echo "I'll assume ASCII or some ISO Latin." >&4
+       echo "I'll assume ASCII or some ISO Latin. Or UTF8." >&4
 fi
 $rm -f tebcdic.c tebcdic
 set ebcdic
@@ -13124,7 +13130,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64='"d"'; sPRIi64='"i"'; sPRIu64='"u"';
-                       sPRIo64='"o"'; sPRIx64='"x"'; sPRIX64='"X"';
+                       sPRIo64='"o"'; sPRIx64='"x"'; sPRIXU64='"X"';
                        echo "We will use %d."
                        ;;
                esac
@@ -13146,7 +13152,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64='"ld"'; sPRIi64='"li"'; sPRIu64='"lu"';
-                       sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIX64='"lX"';
+                       sPRIo64='"lo"'; sPRIx64='"lx"'; sPRIXU64='"lX"';
                        echo "We will use %ld."
                        ;;
                esac
@@ -13169,7 +13175,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64=PRId64; sPRIi64=PRIi64; sPRIu64=PRIu64;
-                       sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIX64=PRIX64;
+                       sPRIo64=PRIo64; sPRIx64=PRIx64; sPRIXU64=PRIXU64;
                        echo "We will use the C9X style."
                        ;;
                esac
@@ -13181,7 +13187,7 @@ if $test X"$sPRId64" = X -a X"$quadtype" = X"long long"; then
 #include <sys/types.h>
 #include <stdio.h>
 int main() {
-  long long q = 12345678901LL; /* AIX cc requires the LL prefix. */
+  long long q = 12345678901LL; /* AIX cc requires the LL suffix. */
   printf("%lld\n", q);
 }
 EOCP
@@ -13191,7 +13197,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64='"lld"'; sPRIi64='"lli"'; sPRIu64='"llu"';
-                       sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIX64='"llX"';
+                       sPRIo64='"llo"'; sPRIx64='"llx"'; sPRIXU64='"llX"';
                        echo "We will use the %lld style."
                        ;;
                esac
@@ -13213,7 +13219,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64='"Ld"'; sPRIi64='"Li"'; sPRIu64='"Lu"';
-                       sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIX64='"LX"';
+                       sPRIo64='"Lo"'; sPRIx64='"Lx"'; sPRIXU64='"LX"';
                        echo "We will use %Ld."
                        ;;
                esac
@@ -13235,7 +13241,7 @@ EOCP
                case "$yyy" in
                12345678901)
                        sPRId64='"qd"'; sPRIi64='"qi"'; sPRIu64='"qu"';
-                       sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIX64='"qX"';
+                       sPRIo64='"qo"'; sPRIx64='"qx"'; sPRIXU64='"qX"';
                        echo "We will use %qd."
                        ;;
                esac
 
 case "$sPRId64" in
 '')    d_PRId64="$undef"; d_PRIi64="$undef"; d_PRIu64="$undef"; 
-       d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIX64="$undef"; 
+       d_PRIo64="$undef"; d_PRIx64="$undef"; d_PRIXU64="$undef"; 
        ;;
 *)     d_PRId64="$define"; d_PRIi64="$define"; d_PRIu64="$define"; 
-       d_PRIo64="$define"; d_PRIx64="$define"; d_PRIX64="$define"; 
+       d_PRIo64="$define"; d_PRIx64="$define"; d_PRIXU64="$define"; 
        ;;
 esac
 
@@ -13268,21 +13274,21 @@ if $test X"$ivsize" = X8; then
        uvuformat="$sPRIu64"
        uvoformat="$sPRIo64"
        uvxformat="$sPRIx64"
-       uvXformat="$sPRIX64"
+       uvXUformat="$sPRIXU64"
 else
        if $test X"$ivsize" = X"$longsize"; then
                ivdformat='"ld"'
                uvuformat='"lu"'
                uvoformat='"lo"'
                uvxformat='"lx"'
-               uvXformat='"lX"'
+               uvXUformat='"lX"'
        else
                if $test X"$ivsize" = X"$intsize"; then
                        ivdformat='"d"'
                        uvuformat='"u"'
                        uvoformat='"o"'
                        uvxformat='"x"'
-                       uvXformat='"X"'
+                       uvXUformat='"X"'
                else
                        : far out
                        if $test X"$ivsize" = X"$shortsize"; then
@@ -13290,7 +13296,7 @@ else
                                uvuformat='"hu"'
                                uvoformat='"ho"'
                                uvxformat='"hx"'
-                               uvXformat='"hX"'
+                               uvXUformat='"hX"'
                        fi
                fi
        fi
@@ -13300,16 +13306,16 @@ if $test X"$uselongdouble" = X"$define" -a X"$d_longdbl" = X"$define" -a X"$d_PR
        nveformat="$sPRIeldbl"
        nvfformat="$sPRIfldbl"
        nvgformat="$sPRIgldbl"
-       nvEformat="$sPRIEldbl"
-       nvFformat="$sPRIFldbl"
-       nvGformat="$sPRIGldbl"
+       nvEUformat="$sPRIEUldbl"
+       nvFUformat="$sPRIFUldbl"
+       nvGUformat="$sPRIGUldbl"
 else
        nveformat='"e"'
        nvfformat='"f"'
        nvgformat='"g"'
-       nvEformat='"E"'
-       nvFformat='"F"'
-       nvGformat='"G"'
+       nvEUformat='"E"'
+       nvFUformat='"F"'
+       nvGUformat='"G"'
 fi
 
 case "$ivdformat" in
@@ -13590,12 +13596,15 @@ case "$pager" in
        dflt=''
        case "$pg" in
        /*) dflt=$pg;;
+       [a-zA-Z]:/*) dflt=$pg;;
        esac
        case "$more" in
        /*) dflt=$more;;
+       [a-zA-Z]:/*) dflt=$more;;
        esac
        case "$less" in
        /*) dflt=$less;;
+       [a-zA-Z]:/*) dflt=$less;;
        esac
        case "$dflt" in
        '') dflt=/usr/ucb/more;;
@@ -13668,13 +13677,13 @@ $cc $ccflags -c bar1.c >/dev/null 2>&1
 $cc $ccflags -c bar2.c >/dev/null 2>&1
 $cc $ccflags -c foo.c >/dev/null 2>&1
 $ar rc bar$_a bar2$_o bar1$_o >/dev/null 2>&1
-if $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
+if $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
        ./foobar >/dev/null 2>&1; then
        echo "$ar appears to generate random libraries itself."
        orderlib=false
        ranlib=":"
 elif $ar ts bar$_a >/dev/null 2>&1 &&
-       $cc $ccflags $ldflags -o foobar foo$_o bar$_a $libs > /dev/null 2>&1 &&
+       $cc -o foobar $ccflags $ldflags foo$_o bar$_a $libs > /dev/null 2>&1 &&
        ./foobar >/dev/null 2>&1; then
                echo "a table of contents needs to be added with '$ar ts'."
                orderlib=false
@@ -14615,7 +14624,7 @@ mert MiNT mips MIPS_FPSET MIPS_ISA MIPS_SIM MIPS_SZINT
 MIPS_SZLONG MIPS_SZPTR MIPSEB MIPSEL MODERN_C motorola
 mpeix MSDOS MTXINU MULTIMAX mvs MVS n16 ncl_el ncl_mr
 NetBSD news1500 news1700 news1800 news1900 news3700
-news700 news800 news900 NeXT NLS ns16000 ns32000
+news700 news800 news900 NeXT NLS nonstopux ns16000 ns32000
 ns32016 ns32332 ns32k nsc32000
 OCS88 OEMVS OpenBSD os OS2 OS390 osf OSF1 OSF_SOURCE
 pa_risc PA_RISC1_1 PA_RISC2_0 PARAGON parisc
@@ -14648,7 +14657,7 @@ EOSH
 ./tr '[a-z]' '[A-Z]' < Cppsym.know > Cppsym.a
 ./tr '[A-Z]' '[a-z]' < Cppsym.know > Cppsym.b
 $cat Cppsym.know > Cppsym.c
-$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | sort | uniq > Cppsym.know
+$cat Cppsym.a Cppsym.b Cppsym.c | $tr ' ' $trnl | $sort | $uniq > Cppsym.know
 $rm -f Cppsym.a Cppsym.b Cppsym.c
 cat <<EOSH > Cppsym
 $startsh
@@ -14690,7 +14699,7 @@ case "$osname-$gccversion" in
 irix-) ccflags="\$ccflags -woff 1178" ;;
 os2-*) ccflags="\$ccflags -Zlinker /PM:VIO" ;;
 esac
-$cc $optimize \$ccflags $ldflags -o try try.c $libs && ./try$exe_ext
+$cc -o try $optimize \$ccflags $ldflags try.c $libs && ./try$exe_ext
 EOSH
 chmod +x Cppsym.try
 $eunicefix Cppsym.try
@@ -15304,6 +15313,25 @@ set X $dynamic_ext $static_ext $nonxs_ext
 shift
 extensions="$*"
 
+: Remove libraries needed only for extensions
+: The appropriate ext/Foo/Makefile.PL will add them back in, if necessary.
+: The exception is SunOS 4.x, which needs them.
+case "${osname}X${osvers}" in
+sunos*X4*)
+    perllibs="$libs"
+    ;;
+*) case "$usedl" in
+    $define|true|[yY]*)
+           set X `echo " $libs " | sed -e 's@ -lndbm @ @' -e 's@ -lgdbm @ @' -e 's@ -ldbm @ @' -e 's@ -ldb @ @'` 
+           shift
+           perllibs="$*"
+           ;;
+    *) perllibs="$libs"
+           ;;
+    esac
+    ;;
+esac
+
 : Remove build directory name from cppstdin so it can be used from
 : either the present location or the final installed location.
 echo " "
@@ -15418,6 +15446,7 @@ ccflags='$ccflags'
 ccflags_uselargefiles='$ccflags_uselargefiles'
 ccname='$ccname'
 ccsymbols='$ccsymbols'
+ccversion='$ccversion'
 cf_by='$cf_by'
 cf_email='$cf_email'
 cf_time='$cf_time'
@@ -15444,10 +15473,10 @@ 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_PRIEUldbl='$d_PRIEUldbl'
+d_PRIFUldbl='$d_PRIFUldbl'
+d_PRIGUldbl='$d_PRIGUldbl'
+d_PRIXU64='$d_PRIXU64'
 d_PRId64='$d_PRId64'
 d_PRIeldbl='$d_PRIeldbl'
 d_PRIfldbl='$d_PRIfldbl'
@@ -15503,6 +15532,7 @@ d_eunice='$d_eunice'
 d_fchmod='$d_fchmod'
 d_fchown='$d_fchown'
 d_fcntl='$d_fcntl'
+d_fcntl_can_lock='$d_fcntl_can_lock'
 d_fd_macros='$d_fd_macros'
 d_fd_set='$d_fd_set'
 d_fds_bits='$d_fds_bits'
@@ -15694,6 +15724,8 @@ d_statfs_s='$d_statfs_s'
 d_statvfs='$d_statvfs'
 d_stdio_cnt_lval='$d_stdio_cnt_lval'
 d_stdio_ptr_lval='$d_stdio_ptr_lval'
+d_stdio_ptr_lval_nochange_cnt='$d_stdio_ptr_lval_nochange_cnt'
+d_stdio_ptr_lval_sets_cnt='$d_stdio_ptr_lval_sets_cnt'
 d_stdio_stream_array='$d_stdio_stream_array'
 d_stdiobase='$d_stdiobase'
 d_stdstdio='$d_stdstdio'
@@ -15788,7 +15820,6 @@ h_fcntl='$h_fcntl'
 h_sysfile='$h_sysfile'
 hint='$hint'
 hostcat='$hostcat'
-huge='$huge'
 i16size='$i16size'
 i16type='$i16type'
 i32size='$i32size'
@@ -15903,7 +15934,6 @@ ivsize='$ivsize'
 ivtype='$ivtype'
 known_extensions='$known_extensions'
 ksh='$ksh'
-large='$large'
 ld='$ld'
 lddlflags='$lddlflags'
 ldflags='$ldflags'
@@ -15949,11 +15979,9 @@ man1ext='$man1ext'
 man3dir='$man3dir'
 man3direxp='$man3direxp'
 man3ext='$man3ext'
-medium='$medium'
 mips_type='$mips_type'
 mkdir='$mkdir'
 mmaptype='$mmaptype'
-models='$models'
 modetype='$modetype'
 more='$more'
 multiarch='$multiarch'
@@ -15972,9 +16000,9 @@ nm_opt='$nm_opt'
 nm_so_opt='$nm_so_opt'
 nonxs_ext='$nonxs_ext'
 nroff='$nroff'
-nvEformat='$nvEformat'
-nvFformat='$nvFformat'
-nvGformat='$nvGformat'
+nvEUformat='$nvEUformat'
+nvFUformat='$nvFUformat'
+nvGUformat='$nvGUformat'
 nveformat='$nveformat'
 nvfformat='$nvfformat'
 nvgformat='$nvgformat'
@@ -15996,6 +16024,7 @@ path_sep='$path_sep'
 perl5='$perl5'
 perl='$perl'
 perladmin='$perladmin'
+perllibs='$perllibs'
 perlpath='$perlpath'
 pg='$pg'
 phostname='$phostname'
@@ -16021,10 +16050,10 @@ revision='$revision'
 rm='$rm'
 rmail='$rmail'
 runnm='$runnm'
-sPRIEldbl='$sPRIEldbl'
-sPRIFldbl='$sPRIFldbl'
-sPRIGldbl='$sPRIGldbl'
-sPRIX64='$sPRIX64'
+sPRIEUldbl='$sPRIEUldbl'
+sPRIFUldbl='$sPRIFUldbl'
+sPRIGUldbl='$sPRIGUldbl'
+sPRIXU64='$sPRIXU64'
 sPRId64='$sPRId64'
 sPRIeldbl='$sPRIeldbl'
 sPRIfldbl='$sPRIfldbl'
@@ -16068,7 +16097,6 @@ sizesize='$sizesize'
 sizetype='$sizetype'
 sleep='$sleep'
 smail='$smail'
-small='$small'
 so='$so'
 sockethdr='$sockethdr'
 socketlib='$socketlib'
@@ -16076,7 +16104,6 @@ socksizetype='$socksizetype'
 sort='$sort'
 spackage='$spackage'
 spitshell='$spitshell'
-split='$split'
 src='$src'
 ssizetype='$ssizetype'
 startperl='$startperl'
@@ -16141,7 +16168,7 @@ usevendorprefix='$usevendorprefix'
 usevfork='$usevfork'
 usrinc='$usrinc'
 uuname='$uuname'
-uvXformat='$uvXformat'
+uvXUformat='$uvXUformat'
 uvoformat='$uvoformat'
 uvsize='$uvsize'
 uvtype='$uvtype'
@@ -16157,6 +16184,7 @@ vendorlibexp='$vendorlibexp'
 vendorprefix='$vendorprefix'
 vendorprefixexp='$vendorprefixexp'
 version='$version'
+versiononly='$versiononly'
 vi='$vi'
 voidflags='$voidflags'
 xlibpth='$xlibpth'
@@ -16175,9 +16203,9 @@ echo "CONFIGDOTSH=true" >>config.sh
 
 : propagate old symbols
 if $test -f UU/config.sh; then
-       <UU/config.sh sort | uniq >UU/oldconfig.sh
+       <UU/config.sh $sort | $uniq >UU/oldconfig.sh
        sed -n 's/^\([a-zA-Z_0-9]*\)=.*/\1/p' config.sh config.sh UU/oldconfig.sh |\
-       sort | uniq -u >UU/oldsyms
+       $sort | $uniq -u >UU/oldsyms
        set X `cat UU/oldsyms`
        shift
        case $# in
@@ -16251,7 +16279,7 @@ EOM
        . UU/myread
        case "$ans" in
        y*)
-               $make depend && echo "Now you must run a $make."
+               $make depend && echo "Now you must run '$make'."
                ;;
        *)
                echo "You must run '$make depend' then '$make'."