This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Eliminate Alpha warnings
[perl5.git] / Configure
index a7d224c..0dbe17c 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $
 #
-# Generated on Thu Oct 10 15:08:34 EDT 1996 [metaconfig 3.0 PL60]
+# Generated on Sat Feb  1 00:26:40 EST 1997 [metaconfig 3.0 PL60]
 
 cat >/tmp/c1$$ <<EOF
 ARGGGHHHH!!!!!
@@ -91,25 +91,39 @@ if test ! -t 0; then
        exit 1
 fi
 
-: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
-if test -f /hp-ux -a -f /bin/ksh; then
-       if (PATH=.; alias -x) >/dev/null 2>&1; then
-               : already under /bin/ksh
-       else
+: Test and see if we are running under ksh, either blatantly or in disguise.
+if (PATH=.; alias -x) >/dev/null 2>&1; then
+    : running under ksh.  Is this a good thing?
+    if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname ; then
+        if test X`/usr/bin/uname -v` = X4 ; then
+            : on AIX 4, /bin/sh is really ksh, and it causes us problems.
+            : Avoid it
                cat <<'EOM'
-(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
+(Feeding myself to /usr/bin/bsh to avoid AIX 4's /bin/sh.)
 EOM
                unset ENV
-               exec /bin/ksh $0 "$@"
+            exec /usr/bin/bsh $0 "$@"
        fi
-else
+    else
+        if test ! -f /hp-ux ; then
        : Warn them if they use ksh on other systems
-       (PATH=.; alias -x) >/dev/null 2>&1 && \
                cat <<EOM
 (I see you are using the Korn shell.  Some ksh's blow up on $me,
 especially on older exotic systems.  If yours does, try the Bourne 
 shell instead.)
 EOM
+        fi
+    fi
+else
+    : Not running under ksh.  Maybe we should be?
+    : On HP-UX, large Configure scripts may exercise a bug in /bin/sh
+    if test -f /hp-ux -a -f /bin/ksh; then
+        cat <<'EOM'
+(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
+EOM
+        unset ENV
+        exec /bin/ksh $0 "$@"
+    fi
 fi
 
 : Configure runs within the UU subdirectory
@@ -227,6 +241,8 @@ baserev=''
 bin=''
 binexp=''
 installbin=''
+bincompat3=''
+d_bincompat3=''
 byteorder=''
 cc=''
 gccversion=''
@@ -284,8 +300,11 @@ d_flexfnam=''
 d_flock=''
 d_fork=''
 d_fsetpos=''
+d_ftime=''
+d_gettimeod=''
 d_Gconvert=''
 d_getgrps=''
+d_setgrps=''
 d_gethent=''
 aphostname=''
 d_gethname=''
@@ -300,6 +319,7 @@ d_getppid=''
 d_getprior=''
 d_gnulibc=''
 d_htonl=''
+d_inetaton=''
 d_isascii=''
 d_killpg=''
 d_link=''
@@ -338,6 +358,7 @@ d_rename=''
 d_rmdir=''
 d_safebcpy=''
 d_safemcpy=''
+d_sanemcmp=''
 d_select=''
 d_sem=''
 d_semctl=''
@@ -384,7 +405,6 @@ d_stdstdio=''
 stdio_base=''
 stdio_bufsiz=''
 stdio_cnt=''
-stdio_filbuf=''
 stdio_ptr=''
 d_index=''
 d_strchr=''
@@ -500,6 +520,8 @@ i_varargs=''
 i_varhdr=''
 i_vfork=''
 intsize=''
+longsize=''
+shortsize=''
 libc=''
 libperl=''
 shrpenv=''
@@ -772,7 +794,7 @@ case "$sh" in
 '')    cat <<EOM >&2
 $me:  Fatal Error:  I can't find a Bourne Shell anywhere.  
 Usually it's in /bin/sh.  How did you even get this far?
-Please contact me (Andy Dougherty) at doughera@lafcol.lafayette.edu and 
+Please contact me (Chip Salzenberg) at chip@perl.com and 
 we'll try to straigten this all out.
 EOM
        exit 1
@@ -848,11 +870,11 @@ cat >>extract <<'EOS'
 CONFIG=true
 echo "Doing variable substitutions on .SH files..."
 if test -f MANIFEST; then
-       shlist=`awk '!/^old_/ {print $1}' <MANIFEST | grep '\.SH$'`
+       shlist=`awk '{print $1}' <MANIFEST | grep '\.SH'`
        : Pick up possible extension manifests.
        for dir in ext/* ; do
                if test -f $dir/MANIFEST; then
-                       xxx=`awk '!/^old_/ {print $1}' < $dir/MANIFEST | 
+                       xxx=`awk '{print $1}' < $dir/MANIFEST | 
                                sed -n "/\.SH$/ s@^@$dir/@p"`
                        shlist="$shlist $xxx"
                fi
@@ -860,7 +882,7 @@ if test -f MANIFEST; then
        set x $shlist
 else
        echo "(Looking for .SH files under the current directory.)"
-       set x `find . -name "*.SH" -print | grep -v '/old_'`
+       set x `find . -name "*.SH" -print`
 fi
 shift
 case $# in
@@ -952,7 +974,11 @@ silent=''
 extractsh=''
 override=''
 knowitall=''
+
 rm -f optdef.sh
+cat >optdef.sh <<EOS
+$startsh
+EOS
 
 : option parsing
 while test $# -gt 0; do
@@ -1140,7 +1166,7 @@ THIS PACKAGE SEEMS TO BE INCOMPLETE.
 You have the option of continuing the configuration process, despite the
 distinct possibility that your kit is damaged, by typing 'y'es.  If you
 do, don't blame me if something goes wrong.  I advise you to type 'n'o
-and contact the author (doughera@lafcol.lafayette.edu).
+and contact the author (chip@perl.com).
 
 EOM
                echo $n "Continue? [n] $c" >&4
@@ -1186,6 +1212,7 @@ esac"
 
 : now set up to do reads with possible shell escape and default assignment
 cat <<EOSC >myread
+$startsh
 xxxm=\$dflt
 $myecho
 ans='!'
@@ -1208,7 +1235,7 @@ while expr "X\$ans" : "X!" >/dev/null; do
        read answ
        set x \$xxxm
        shift
-       aok=''; eval "ans=\"\$answ\"" && aok=y
+       aok=''; eval ans="\\"\$answ\\"" && aok=y
        case  "\$answ" in
        "\$ans")
                case "\$ans" in
@@ -1340,7 +1367,7 @@ Much effort has been expended to ensure that this shell script will run on any
 Unix system.  If despite that it blows up on yours, your best bet is to edit
 Configure and run it again.  If you can't run Configure for some reason,
 you'll have to generate a config.sh file by hand.  Whatever problems you
-have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
+have, let me (chip@perl.com) know how I blew it.
 
 This installation script affects things in two ways:
 
@@ -1630,13 +1657,15 @@ EOM
        cd hints; ls -C *.sh | $sed 's/\.sh/   /g' >&4
        dflt=''
        : Half the following guesses are probably wrong... If you have better
-       : tests or hints, please send them to doughera@lafcol.lafayette.edu
+       : tests or hints, please send them to chip@perl.com
        : The metaconfig authors would also appreciate a copy...
        $test -f /irix && osname=irix
        $test -f /xenix && osname=sco_xenix
        $test -f /dynix && osname=dynix
        $test -f /dnix && osname=dnix
-       $test -f /unicos && osname=unicos && osvers=`$uname -r`
+       $test -f /lynx.os && osname=lynxos
+       $test -f /unicos && osname=unicos && osvers=`$uname -r`
+       $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
        $test -f /bin/mips && /bin/mips && osname=mips
        $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
                $sed -e 's/://' -e 's/\./_/'` && osname=next && osvers=$4
@@ -1694,6 +1723,9 @@ EOM
                        *) osvers=$tmp;;
                        esac
                        ;;
+               *dc.osx) osname=dcosx
+                       osvers="$3"
+                       ;;
                dnix) osname=dnix
                        osvers="$3"
                        ;;
@@ -1762,7 +1794,7 @@ EOM
                ultrix) osname=ultrix
                        osvers="$3"
                        ;;
-               osf1)   case "$5" in
+               osf1|mls+)      case "$5" in
                                alpha)
                                        osname=dec_osf
                                        osvers=`echo "$3" | sed 's/^[vt]//'`
@@ -1780,7 +1812,7 @@ EOM
                $2) case "$osname" in
                        *isc*) ;;
                        *freebsd*) ;;
-                       svr*)
+                       svr*)
                                : svr4.x or possibly later
                                case "svr$3" in 
                                ${osname}*)
@@ -2019,7 +2051,8 @@ if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
        tarch=`arch`"-$osname"
 elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
        if uname -m > tmparch 2>&1 ; then
-               tarch=`$sed -e 's/ /_/g' -e 's/_*$//' -e 's/$/'"-$osname/" tmparch`
+               tarch=`$sed -e 's/ *$//' -e 's/ /_/g' \
+                       -e 's/$/'"-$osname/" tmparch`
        else
                tarch="$osname"
        fi
@@ -2108,7 +2141,10 @@ chmod +x filexp
 $eunicefix filexp
 
 : now set up to get a file name
-cat <<'EOSC' >getfile
+cat <<EOS >getfile
+$startsh
+EOS
+cat <<'EOSC' >>getfile
 tilde=''
 fullpath=''
 already=''
@@ -2429,7 +2465,14 @@ else
        patchlevel=0
        subversion=0
 fi
-echo "(You have $package $baserev patchlevel $patchlevel subversion $subversion.)"
+$echo $n "(You have $package" $c
+case "$package" in
+"*$baserev")   ;;
+*)             $echo $n " $baserev" $c ;;
+esac
+$echo $n " patchlevel $patchlevel" $c
+test 0 -eq "$subversion" || $echo $n " subversion $subversion" $c
+echo ".)"
 
 : set the prefixup variable, to restore leading tilda escape
 prefixup='case "$prefixexp" in
@@ -2442,19 +2485,27 @@ set archlib archlib
 eval $prefixit
 case "$archlib" in
 '')
-       case "$privlib" in
-       '')     dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
-               set dflt
-               eval $prefixup
-               ;;
-       *)      version=`LC_ALL=C;export LC_ALL;\
-                       echo $baserev $patchlevel $subversion | \
-                       $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
-               dflt="$privlib/$archname/$version"
-               ;;
-       esac
+    case "$privlib" in
+    '')        dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
+       set dflt
+       eval $prefixup
+       ;;
+    *) if test 0 -eq "$subversion"; then
+           version=`LC_ALL=C; export LC_ALL; \
+                    echo $baserev $patchlevel | \
+                    $awk '{ printf "%.3f\n", $1 + $2/1000.0 }'`
+       else
+           version=`LC_ALL=C; export LC_ALL; \
+                    echo $baserev $patchlevel $subversion | \
+                    $awk '{ printf "%.5f\n", $1 + $2/1000.0 + $3/100000.0 }'`
+       fi
+       dflt="$privlib/$archname/$version"
        ;;
-*) dflt="$archlib";;
+    esac
+    ;;
+*)
+    dflt="$archlib"
+    ;;
 esac
 cat <<EOM
 
@@ -2496,7 +2547,10 @@ else
 fi
 
 : set up the script used to warn in case of inconsistency
-cat <<'EOSC' >whoa
+cat <<EOS >whoa
+$startsh
+EOS
+cat <<'EOSC' >>whoa
 dflt=y
 echo " "
 echo "*** WHOA THERE!!! ***" >&4
@@ -2516,6 +2570,33 @@ $undef$define) . ./whoa; eval "$var=\$tu";;
 *) eval "$var=$val";;
 esac'
 
+$cat <<EOM
+
+Perl 5.004 can be compiled for binary compatibility with 5.003.
+If you decide to do so, you will be able to continue using any
+extensions that were compiled for Perl 5.003.  However, binary
+compatibility forces Perl to expose some of its internal symbols
+in the same way that 5.003 did.  So you may have symbol conflicts
+if you embed a binary-compatible Perl in other programs.
+
+EOM
+case "$d_bincompat3" in
+"$undef") dflt=n ;;
+*) dflt=y ;;
+esac
+rp='Binary compatibility with Perl 5.003?'
+. ./myread
+case "$ans" in
+y*) val="$define" ;;
+*)  val="$undef" ;;
+esac
+set d_bincompat3
+eval $setvar
+case "$d_bincompat3" in
+"$define") bincompat3=y ;;
+*) bincompat3=n ;;
+esac
+
 : make some quick guesses about what we are up against
 echo " "
 $echo $n "Hmm...  $c"
@@ -3212,6 +3293,25 @@ none) libpth=' ';;
 *) libpth="$ans";;
 esac
 
+: Define several unixisms. Hints files or command line options
+: can be used to override them.
+case "$ar" in
+'') ar='ar';;
+esac
+case "$lib_ext" in
+'') lib_ext='.a';;
+esac
+case "$obj_ext" in
+'') obj_ext='.o';;
+esac
+case "$path_sep" in
+'') path_sep=':';;
+esac
+: Which makefile gets called first.  This is used by make depend.
+case "$firstmakefile" in
+'') firstmakefile='makefile';;
+esac
+
 : compute shared library extension
 case "$so" in
 '')
@@ -3234,11 +3334,6 @@ rp='What is the file extension used for shared libraries?'
 . ./myread
 so="$ans"
 
-: If no lib_ext yet, assume '.a'.
-case "$lib_ext" in
-'') lib_ext='.a';;
-esac
-
 : Looking for optional libraries
 echo " "
 echo "Checking for optional libraries..." >&4
@@ -3263,25 +3358,25 @@ for thislib in $libswanted; do
                *"-l$thislib "*);;
                *) dflt="$dflt -l$thislib";;
                esac
-       elif xxx=`./loc lib$thislib${lib_ext} X $libpth`; $test -f "$xxx"; then
+       elif xxx=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$xxx"; then
                echo "Found -l$thislib."
                case " $dflt " in
                *"-l$thislib "*);;
                *) dflt="$dflt -l$thislib";;
                esac
-       elif xxx=`./loc $thislib${lib_ext} X $libpth`; $test -f "$xxx"; then
+       elif xxx=`./loc $thislib$lib_ext X $libpth`; $test -f "$xxx"; then
                echo "Found -l$thislib."
                case " $dflt " in
                *"-l$thislib "*);;
                *) dflt="$dflt -l$thislib";;
                esac
-       elif xxx=`./loc lib${thislib}_s${lib_ext} X $libpth`; $test -f "$xxx"; then
+       elif xxx=`./loc lib${thislib}_s$lib_ext X $libpth`; $test -f "$xxx"; then
                echo "Found -l${thislib}_s."
                case " $dflt " in
                *"-l$thislib "*);;
                *) dflt="$dflt -l${thislib}_s";;
                esac
-       elif xxx=`./loc Slib$thislib${lib_ext} X $xlibpth`; $test -f "$xxx"; then
+       elif xxx=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$xxx"; then
                echo "Found -l$thislib."
                case " $dflt " in
                *"-l$thislib "*);;
@@ -3463,7 +3558,7 @@ $rm -f testcpp.c testcpp.out
 
 : determine optimize, if desired, or use for debug flag also
 case "$optimize" in
-' ') dflt='none';;
+' '|$undef) dflt='none';;
 '') dflt='-O';;
 *) dflt="$optimize";;
 esac
@@ -3539,8 +3634,6 @@ if ./osf1; then
 else
        set signal.h LANGUAGE_C; eval $inctest
 fi
-set signal.h NO_PROTOTYPE; eval $inctest
-set signal.h _NO_PROTO; eval $inctest
 
 case "$hint" in
 none|recommended) dflt="$ccflags $dflt" ;;
@@ -3679,8 +3772,8 @@ rmlist="$rmlist pdp11"
 
 : coherency check
 echo " "
-echo "Checking your choice of C compiler and flags for coherency..." >&4
-set X $cc $optimize $ccflags $ldflags try.c -o try
+echo "Checking your choice of C compiler, libs, and flags for coherency..." >&4
+set X $cc $optimize $ccflags $ldflags -o try try.c $libs
 shift
 $cat >try.msg <<EOM
 I've tried to compile and run a simple program with:
@@ -3696,7 +3789,7 @@ $cat > try.c <<'EOF'
 main() { exit(0); }
 EOF
 dflt=y
-if sh -c "$cc $optimize $ccflags try.c -o try $ldflags" >>try.msg 2>&1; then
+if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; then
        if sh -c './try' >>try.msg 2>&1; then
                dflt=n
        else
@@ -3802,11 +3895,13 @@ esac
 : nm options which may be necessary
 case "$nm_opt" in
 '') if $test -f /mach_boot; then
-               nm_opt=''
+               nm_opt=''       # Mach
        elif $test -d /usr/ccs/lib; then
-               nm_opt='-p'
+               nm_opt='-p'     # Solaris (and SunOS?)
        elif $test -f /dgux; then
-               nm_opt='-p'
+               nm_opt='-p'     # DG-UX
+       elif $test -f /lib64/rld; then
+               nm_opt='-p'     # 64-bit Irix
        else
                nm_opt=''
        fi;;
@@ -3832,7 +3927,7 @@ echo " "
 case "$libc" in
 '') libc=unknown
        case "$libs" in
-       *-lc_s*) libc=`./loc libc_s${lib_ext} $libc $libpth`
+       *-lc_s*) libc=`./loc libc_s$lib_ext $libc $libpth`
        esac
        ;;
 esac
@@ -3850,15 +3945,15 @@ case "$libs" in
                        :
                elif try=`./loc lib$thislib.$so X $libpth`; $test -f "$try"; then
                        :
-               elif try=`./loc lib$thislib${lib_ext} X $libpth`; $test -f "$try"; then
+               elif try=`./loc lib$thislib$lib_ext X $libpth`; $test -f "$try"; then
                        :
-               elif try=`./loc $thislib${lib_ext} X $libpth`; $test -f "$try"; then
+               elif try=`./loc $thislib$lib_ext X $libpth`; $test -f "$try"; then
                        :
                elif try=`./loc lib$thislib X $libpth`; $test -f "$try"; then
                        :
                elif try=`./loc $thislib X $libpth`; $test -f "$try"; then
                        :
-               elif try=`./loc Slib$thislib${lib_ext} X $xlibpth`; $test -f "$try"; then
+               elif try=`./loc Slib$thislib$lib_ext X $xlibpth`; $test -f "$try"; then
                        :
                else
                        try=''
@@ -3889,7 +3984,7 @@ unknown)
                eval set \$$#
        done
        $test -r $1 || set /usr/ccs/lib/libc.$so
-       $test -r $1 || set /lib/libsys_s.a
+       $test -r $1 || set /lib/libsys_s$lib_ext
        ;;
 *)
        set blurfl
@@ -3908,25 +4003,25 @@ elif $test -r /lib/libc && $test -r /lib/clib; then
        fi
 elif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
        echo "Your C library seems to be in $libc, as you said before."
-elif $test -r $incpath/usr/lib/libc${lib_ext}; then
-       libc=$incpath/usr/lib/libc${lib_ext};
+elif $test -r $incpath/usr/lib/libc$lib_ext; then
+       libc=$incpath/usr/lib/libc$lib_ext;
        echo "Your C library seems to be in $libc.  That's fine."
-elif $test -r /lib/libc${lib_ext}; then
-       libc=/lib/libc${lib_ext};
+elif $test -r /lib/libc$lib_ext; then
+       libc=/lib/libc$lib_ext;
        echo "Your C library seems to be in $libc.  You're normal."
 else
-       if tans=`./loc libc${lib_ext} blurfl/dyick $libpth`; $test -r "$tans"; then
+       if tans=`./loc libc$lib_ext blurfl/dyick $libpth`; $test -r "$tans"; then
                :
        elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
                libnames="$libnames "`./loc clib blurfl/dyick $libpth`
        elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
                :
-       elif tans=`./loc Slibc${lib_ext} blurfl/dyick $xlibpth`; $test -r "$tans"; then
+       elif tans=`./loc Slibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then
                :
-       elif tans=`./loc Mlibc${lib_ext} blurfl/dyick $xlibpth`; $test -r "$tans"; then
+       elif tans=`./loc Mlibc$lib_ext blurfl/dyick $xlibpth`; $test -r "$tans"; then
                :
        else
-               tans=`./loc Llibc${lib_ext} blurfl/dyick $xlibpth`
+               tans=`./loc Llibc$lib_ext blurfl/dyick $xlibpth`
        fi
        if $test -r "$tans"; then
                echo "Your C library seems to be in $tans, of all places."
@@ -4026,6 +4121,10 @@ elif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
                eval $xrun
+elif com="$sed -n -e 's/^.*|Proc .*|Text *| *//p'";\
+       eval $xscan;\
+       $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+               eval $xrun
 elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
@@ -4034,6 +4133,10 @@ elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
        eval $xscan;\
        $contains '^fprintf$' libc.list >/dev/null 2>&1; then
                eval $xrun
+elif com="$sed -n -e 's/.*\.text n\ \ \ \.//p'";\
+       eval $xscan;\
+       $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+               eval $xrun
 else
        nm -p $* 2>/dev/null >libc.tmp
        $grep fprintf libc.tmp > libc.ptf
@@ -4080,22 +4183,6 @@ fi
 esac
 $rm -f libnames libpath
 
-: Define several unixisms. Hints files or command line options
-: can be used to override them.
-case "$ar" in
-'') ar='ar';;
-esac
-case "$obj_ext" in
-'') obj_ext='.o';;
-esac
-case "$path_sep" in
-'') path_sep=':';;
-esac
-: Which makefile gets called first.  This is used by make depend.
-case "$firstmakefile" in
-'') firstmakefile='makefile';;
-esac
-
 : determine filename position in cpp output
 echo " "
 echo "Computing filename position in cpp output for #include directives..." >&4
@@ -4326,12 +4413,19 @@ EOM
                '') case "$osname" in
                        hpux)   dflt='+z' ;;
                        next)   dflt='none' ;;
-                       solaris|svr4*|esix*) dflt='-Kpic' ;;
-                       irix*)  dflt='-KPIC' ;;
+                       svr4*|esix*)    dflt='-Kpic' ;;
+                       irix*)  dflt='-KPIC' ;;
+                       solaris) case "$ccflags" in
+                               *-DDEBUGGING*)  dflt='-KPIC' ;;
+                               *)              dflt='-Kpic' ;;
+                               esac ;;
                        sunos)  dflt='-pic' ;;
                        *)      dflt='none' ;;
                    esac ;;
-               *)      dflt='-fpic' ;;
+               *)  case "$osname/$ccflags" in
+                       solaris/*-DDEBUGGING*)  dflt='-fPIC' ;;
+                       *)                      dflt='-fpic' ;;
+                   esac ;;
            esac ;;
     *) dflt="$cccdlflags" ;;
     esac
@@ -4469,7 +4563,7 @@ $undef)
        ;;
 *)     case "$useshrplib" in
        '')     case "$osname" in
-               svr4|dgux|dynixptx|esix|powerux)
+               svr4*|dgux|dynixptx|esix|powerux)
                        dflt='yes'
                        also='Building a shared libperl is required for dynamic loading to work on your system.'
                        ;;
@@ -4601,8 +4695,8 @@ case "$shrpdir" in
 *)     $cat >&4 <<EOM
 WARNING:  Use of the shrpdir variable for the installation location of
 the shared $libperl is not supported.  It was never documented and
-will not work in this version.  Let me (doughera@lafcol.lafayette.edu)
-know of any problems this may cause.
+will not work in this version.  Let me (chip@perl.com) know of any
+problems this may cause.
 
 EOM
        case "$shrpdir" in
@@ -4635,7 +4729,10 @@ if "$useshrplib"; then
        solaris|netbsd)
                xxx="-R $shrpdir"
                ;;
-       linux|irix*)
+       freebsd)
+               xxx="-Wl,-R$shrpdir"
+               ;;
+       linux|irix*|dec_osf)
                xxx="-Wl,-rpath,$shrpdir"
                ;;
        *)
@@ -4644,14 +4741,20 @@ if "$useshrplib"; then
        esac
        case "$xxx" in
        '') ;;
-       *)      ccdlflags="$ccdlflags $xxx"
-               cat <<EOM >&4
+       *)      
+               # Only add $xxx if it isn't already in ccdlflags.
+               case " $ccdlflags " in
+               *" $xxx "*)     ;;
+               *)      ccdlflags="$ccdlflags $xxx"
+                       cat <<EOM >&4
 
 Adding $xxx to the flags
 passed to $ld so that the perl executable will find the 
 installed shared $libperl.
 
 EOM
+                       ;;
+               esac
                ;;
        esac
 fi
@@ -5089,12 +5192,14 @@ case "$myhostname" in
                                echo "(Attempting domain name extraction from $tans)"
                                : Why was there an Egrep here, when Sed works?
                                : Look for either a search or a domain directive.
-                               dflt=.`$sed -n -e 's/^search[   ]*\(.*\)/\1/p' $tans \
-                                       | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
+                               dflt=.`$sed -n -e 's/   / /g' \
+                                 -e 's/^search  *\([^ ]*\).*/\1/p' $tans \
+                                 | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
                                case "$dflt" in
-                               .)      dflt=.`$sed -n -e 's/^domain[   ]*\(.*\)/\1/p' $tans \
-                                               | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
-                                       ;;
+                               .) dflt=.`$sed -n -e 's/        / /g' \
+                                    -e 's/^domain  *\([^ ]*\).*/\1/p' $tans \
+                                    | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
+                                       ;;
                                esac
                        fi
                        ;;
@@ -5209,6 +5314,72 @@ rp='Perl administrator e-mail address'
 . ./myread
 perladmin="$ans"
 
+: figure out how to guarantee perl startup
+case "$startperl" in
+'')
+       case "$sharpbang" in
+       *!)
+               $cat <<EOH
+
+I can use the #! construct to start perl on your system. This will
+make startup of perl scripts faster, but may cause problems if you
+want to share those scripts and perl is not in a standard place
+($binexp/perl) on all your platforms. The alternative is to force
+a shell by starting the script with a single ':' character.
+
+EOH
+               dflt="$binexp/perl"
+               rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
+               . ./myread
+               case "$ans" in
+               none)   startperl=": # use perl";;
+               *)      startperl="#!$ans"
+                       if $test 33 -lt `echo "$ans" | wc -c`; then
+                               $cat >&4 <<EOM
+
+WARNING:  Some systems limit the #! command to 32 characters.
+If you experience difficulty running Perl scripts with #!, try
+installing Perl in a directory with a shorter pathname.
+
+EOM
+                       fi ;;
+               esac
+               ;;
+       *) startperl=": # use perl"
+               ;;
+       esac
+       ;;
+esac
+echo "I'll use $startperl to start perl scripts."
+
+: figure best path for perl in scripts
+case "$perlpath" in
+'')
+       perlpath="$binexp/perl"
+       case "$startperl" in
+       *!*) ;;
+       *)
+               $cat <<EOH
+
+I will use the "eval 'exec'" idiom to start Perl on your system.
+I can use the full path of your Perl binary for this purpose, but
+doing so may cause problems if you want to share those scripts and
+Perl is not always in a standard place ($binexp/perl).
+
+EOH
+               dflt="$binexp/perl"
+               rp="What path shall I use in \"eval 'exec'\"?"
+               . ./myread
+               perlpath="$ans"
+               ;;
+       esac
+       ;;
+esac
+case "$startperl" in
+*!*)   ;;
+*)     echo "I'll use $perlpath in \"eval 'exec'\"" ;;
+esac
+
 : determine where public executable scripts go
 set scriptdir scriptdir
 eval $prefixit
@@ -5262,40 +5433,6 @@ else
        installscript="$scriptdirexp"
 fi
 
-: determine perl absolute location
-case "$perlpath" in
-'')    perlpath=$binexp/perl ;;
-esac
-
-: figure out how to guarantee perl startup
-case "$startperl" in
-'')
-       case "$sharpbang" in
-       *!)
-               $cat <<EOH
-
-I can use the #! construct to start perl on your system. This will
-make startup of perl scripts faster, but may cause problems if you
-want to share those scripts and perl is not in a standard place
-($perlpath) on all your platforms. The alternative is to force
-a shell by starting the script with a single ':' character.
-
-EOH
-               dflt=$perlpath
-               rp='What shall I put after the #! to start up perl ("none" to not use #!)?'
-               . ./myread
-               case "$ans" in
-               none) startperl=": # use perl";;
-               *) startperl="#!$ans";;
-               esac
-               ;;
-       *) startperl=": # use perl"
-               ;;
-       esac
-       ;;
-esac
-echo "I'll use $startperl to start perl scripts."
-
 cat <<EOM
 
 Previous version of $package used the standard IO mechanisms as defined in
@@ -5633,32 +5770,57 @@ $rm -f set set.c
 set bzero d_bzero
 eval $inlibc
 
-: check for length of integer
+: check for lengths of integral types
 echo " "
 case "$intsize" in
 '')
        echo "Checking to see how big your integers are..." >&4
-       $cat >try.c <<'EOCP'
+       $cat >intsize.c <<'EOCP'
 #include <stdio.h>
 main()
 {
-       printf("%d\n", sizeof(int));
+       printf("intsize=%d;\n", sizeof(int));
+       printf("longsize=%d;\n", sizeof(long));
+       printf("shortsize=%d;\n", sizeof(short));
+       fflush(stdout);
        exit(0);
 }
 EOCP
-       if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
-               intsize=`./try`
+#      If $libs contains -lsfio, and sfio is mis-configured, then it
+#      sometimes (apparently) runs and exits with a 0 status, but with no
+#      output!.  Thus we check with test -s whether we actually got any 
+#      output.  I think it has to do with sfio's use of _exit vs. exit,
+#      but I don't know for sure.  --Andy Dougherty  1/27/97.
+       if $cc $optimize $ccflags $ldflags -o intsize intsize.c $libs >/dev/null 2>&1 && 
+       ./intsize > intsize.out 2>/dev/null && test -s intsize.out ; then
+               eval `$cat intsize.out`
                echo "Your integers are $intsize bytes long."
+               echo "Your long integers are $longsize bytes long."
+               echo "Your short integers are $shortsize bytes long."
        else
-               dflt='4'
-               echo "(I can't seem to compile the test program.  Guessing...)"
+               $cat >&4 <<EOM
+
+Help! I can't compile and run the intsize test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it.  Still, I'll try anyway.)
+
+EOM
+               dflt=4
                rp="What is the size of an integer (in bytes)?"
                . ./myread
                intsize="$ans"
+               dflt=$intsize
+               rp="What is the size of a long integer (in bytes)?"
+               . ./myread
+               longsize="$ans"
+               dflt=2
+               rp="What is the size of a short integer (in bytes)?"
+               . ./myread
+               shortsize="$ans"
        fi
        ;;
 esac
-$rm -f try.c try
+$rm -f intsize intsize.[co] intsize.out
 
 : see if signal is declared as pointer to function returning int or void
 echo " "
@@ -5904,19 +6066,19 @@ if set crypt val -f d_crypt; eval $csym; $val; then
        val="$define"
        cryptlib=''
 else
-       cryptlib=`./loc Slibcrypt${lib_ext} "" $xlibpth`
+       cryptlib=`./loc Slibcrypt$lib_ext "" $xlibpth`
        if $test -z "$cryptlib"; then
-               cryptlib=`./loc Mlibcrypt${lib_ext} "" $xlibpth`
+               cryptlib=`./loc Mlibcrypt$lib_ext "" $xlibpth`
        else
                cryptlib=-lcrypt
        fi
        if $test -z "$cryptlib"; then
-               cryptlib=`./loc Llibcrypt${lib_ext} "" $xlibpth`
+               cryptlib=`./loc Llibcrypt$lib_ext "" $xlibpth`
        else
                cryptlib=-lcrypt
        fi
        if $test -z "$cryptlib"; then
-               cryptlib=`./loc libcrypt${lib_ext} "" $libpth`
+               cryptlib=`./loc libcrypt$lib_ext "" $libpth`
        else
                cryptlib=-lcrypt
        fi
@@ -5932,12 +6094,15 @@ eval $setvar
 
 : get csh whereabouts
 case "$csh" in
-'csh') val="$undef" ;;
-*) val="$define" ;;
+'csh') val="$undef" ;;
+*)     val="$define" ;;
 esac
 set d_csh
 eval $setvar
-full_csh=$csh
+: Respect a hint or command line value for full_csh.
+case "$full_csh" in
+'') full_csh=$csh ;;
+esac
 
 : see if cuserid exists
 set cuserid d_cuserid
@@ -6119,22 +6284,25 @@ main()
 #endif
     handle = dlopen("./dyna.$dlext", mode) ;
     if (handle == NULL) {
-        printf ("1\n") ;
-           exit(0);
+       printf ("1\n") ;
+       fflush (stdout) ;
+       exit(0);
     }
     symbol = dlsym(handle, "fred") ;
     if (symbol == NULL) {
-               /* try putting a leading underscore */
-        symbol = dlsym(handle, "_fred") ;
-        if (symbol == NULL) {
-            printf ("2\n") ;
-               exit(0);
-               }
-        printf ("3\n") ;
+       /* try putting a leading underscore */
+       symbol = dlsym(handle, "_fred") ;
+       if (symbol == NULL) {
+           printf ("2\n") ;
+           fflush (stdout) ;
+           exit(0);
+       }
+       printf ("3\n") ;
     }
     else
-        printf ("4\n") ;
-       exit(0);
+       printf ("4\n") ;
+    fflush (stdout) ;
+    exit(0);
 }
 EOM
        : Call the object file tmp-dyna.o in case dlext=o.
@@ -6364,7 +6532,7 @@ EOCP
                *) echo "However, your read() returns '$status' on EOF??";;
                esac
                val="$define"
-               if test "$status" -eq "$rd_nodata"; then
+               if test "$status" = "$rd_nodata"; then
                        echo "WARNING: you can't distinguish between EOF and no data!"
                        val="$undef"
                fi
@@ -6450,6 +6618,25 @@ eval $inlibc
 set getpriority d_getprior
 eval $inlibc
 
+: see if gettimeofday or ftime exists
+set gettimeofday d_gettimeod
+eval $inlibc
+case "$d_gettimeod" in
+"$undef")
+       set ftime d_ftime 
+       eval $inlibc
+       ;;
+*)
+       val="$undef"; set d_ftime; eval $setvar
+       ;;
+esac
+case "$d_gettimeod$d_ftime" in
+"$undef$undef")
+       echo " "
+       echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4
+       ;;
+esac
+
 : see if this is a netinet/in.h or sys/in.h system
 set netinet/in.h i_niin sys/in.h i_sysin
 eval $inhdr
@@ -6543,6 +6730,10 @@ set d_strchr; eval $setvar
 val="$vali"
 set d_index; eval $setvar
 
+: check whether inet_aton exists
+set inet_aton d_inetaton
+eval $inlibc
+
 : Look for isascii
 echo " "
 $cat >isascii.c <<'EOCP'
@@ -6933,7 +7124,8 @@ for (align = 7; align >= 0; align--) {
 exit(0);
 }
 EOCP
-       if $cc $ccflags $ldflags foo.c -o safebcpy $libs >/dev/null 2>&1; then
+       if $cc $optimize $ccflags $ldflags foo.c \
+                   -o safebcpy $libs >/dev/null 2>&1; then
                if ./safebcpy 2>/dev/null; then
                        echo "Yes, it can."
                        val="$define"
@@ -7011,7 +7203,8 @@ for (align = 7; align >= 0; align--) {
 exit(0);
 }
 EOCP
-       if $cc $ccflags $ldflags foo.c -o safemcpy $libs >/dev/null 2>&1; then
+       if $cc $optimize $ccflags $ldflags foo.c \
+                   -o safemcpy $libs >/dev/null 2>&1; then
                if ./safemcpy 2>/dev/null; then
                        echo "Yes, it can."
                        val="$define"
@@ -7033,6 +7226,61 @@ $rm -f foo.* safemcpy core
 set d_safemcpy
 eval $setvar
 
+: can memcmp be trusted to compare relative magnitude?
+val="$undef"
+case "$d_memcmp" in
+"$define")
+       echo " "
+       echo "Checking to see if your memcmp() can compare relative magnitude..." >&4
+       $cat >foo.c <<EOCP
+#$i_memory I_MEMORY
+#$i_stdlib I_STDLIB
+#$i_string I_STRING
+#$i_unistd I_UNISTD
+EOCP
+       $cat >>foo.c <<'EOCP'
+#include <stdio.h>
+
+#ifdef I_MEMORY
+#  include <memory.h>
+#endif
+#ifdef I_STDLIB
+#  include <stdlib.h>
+#endif
+#ifdef I_STRING
+#  include <string.h>
+#else
+#  include <strings.h>
+#endif
+#ifdef I_UNISTD
+#  include <unistd.h>  /* Needed for NetBSD */
+#endif
+main()
+{
+char a = -1;
+char b = 0;
+if ((a < b) && memcmp(&a, &b, 1) < 0)
+       exit(1);
+exit(0);
+}
+EOCP
+       if $cc $optimize $ccflags $ldflags foo.c \
+                   -o sanemcmp $libs >/dev/null 2>&1; then
+               if ./sanemcmp 2>/dev/null; then
+                       echo "Yes, it can."
+                       val="$define"
+               else
+                       echo "No, it can't (it uses signed chars)."
+               fi
+       else
+               echo "(I can't compile the test program, so we'll assume not...)"
+       fi
+       ;;
+esac
+$rm -f foo.* sanemcmp core
+set d_sanemcmp
+eval $setvar
+
 : see if select exists
 set select d_select
 eval $inlibc
@@ -7148,6 +7396,11 @@ $define)
        y|Y) ;;
        *)      echo "Ok, avoiding sfio this time.  I'll use stdio instead."
                val="$undef"
+               : Remove sfio from list of libraries to use
+               set `echo X $libs | $sed -e 's/-lsfio / /' -e 's/-lsfio$//'`
+               shift
+               libs="$*"
+               echo "libs = $libs" >&4
                ;;
        esac
        ;;
@@ -7326,10 +7579,10 @@ else
                : we will have to assume that it supports the 4.2 BSD interface
                d_oldsock="$undef"
        else
-               echo "You don't have Berkeley networking in libc${lib_ext}..." >&4
-               if test -f /usr/lib/libnet${lib_ext}; then
-                       ( (nm $nm_opt /usr/lib/libnet${lib_ext} | eval $nm_extract) ||  \
-                       ar t /usr/lib/libnet${lib_ext}) 2>/dev/null >> libc.list
+               echo "You don't have Berkeley networking in libc$lib_ext..." >&4
+               if test -f /usr/lib/libnet$lib_ext; then
+                       ( (nm $nm_opt /usr/lib/libnet$lib_ext | eval $nm_extract) ||  \
+                       ar t /usr/lib/libnet$lib_ext) 2>/dev/null >> libc.list
                        if $contains socket libc.list >/dev/null 2>&1; then
                        echo "...but the Wollongong group seems to have hacked it in." >&4
                                socketlib="-lnet"
@@ -7342,7 +7595,7 @@ else
                                        d_oldsock="$define"
                                fi
                        else
-                               echo "or even in libnet${lib_ext}, which is peculiar." >&4
+                               echo "or even in libnet$lib_ext, which is peculiar." >&4
                                d_socket="$undef"
                                d_oldsock="$undef"
                        fi
@@ -7466,47 +7719,6 @@ esac
 set d_stdio_cnt_lval
 eval $setvar
 
-: How to access the stdio _filbuf or __filbuf function.
-: If this fails, check how the getc macro in stdio.h works.
-case "${d_stdio_ptr_lval}${d_stdio_cnt_lval}" in
-${define}${define})
-       : Try $hint value, if any, then _filbuf, __filbuf, _fill, then punt.
-       : _fill is for os/2.
-       xxx='notok'
-       for filbuf in $stdio_filbuf '_filbuf(fp)' '__filbuf(fp) ' '_fill(fp)' ; do
-               $cat >try.c <<EOP
-#include <stdio.h>
-#define FILE_ptr(fp)   $stdio_ptr
-#define FILE_cnt(fp)   $stdio_cnt
-#define FILE_filbuf(fp)        $filbuf
-main() {
-       FILE *fp = fopen("try.c", "r");
-       int c;
-       c = getc(fp);
-       c = FILE_filbuf(fp);  /* Just looking for linker errors.*/
-       exit(0);
-}
-EOP
-               if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 && ./try; then
-                       echo "Your stdio appears to use $filbuf"
-                       stdio_filbuf="$filbuf"
-                       xxx='ok'
-                       break
-               else
-                       echo "Hmm.  $filbuf doesn't seem to work."
-               fi
-               $rm -f try.c try
-       done
-       case "$xxx" in
-       notok)  echo "I can't figure out how to access _filbuf"
-                       echo "I'll just have to work around it."
-                       d_stdio_ptr_lval="$undef"
-                       d_stdio_cnt_lval="$undef"
-                       ;;
-       esac
-       ;;
-esac
-
 
 : see if _base is also standard
 val="$undef"
@@ -7923,7 +8135,7 @@ EOCP
                dflt=`./try`
        else
                dflt='8'
-               echo"(I can't seem to compile the test program...)"
+               echo "(I can't seem to compile the test program...)"
        fi
        ;;
 *) dflt="$alignbytes"
@@ -8030,6 +8242,55 @@ set db.h i_db
 eval $inhdr
 
 case "$i_db" in
+$define)
+       : Check db version.  We can not use version 2.
+       echo " "
+       echo "Checking Berkeley DB version ..." >&4
+       $cat >try.c <<EOCP
+#$d_const HASCONST
+#ifndef HASCONST
+#define const
+#endif
+#include <sys/types.h>
+#include <stdio.h>
+#include <db.h>
+main()
+{
+#ifdef DB_VERSION_MAJOR        /* DB version >= 2: not yet. */
+    printf("You have Berkeley DB Version %d.%d\n",
+               DB_VERSION_MAJOR, DB_VERSION_MINOR);
+    printf("Perl currently only supports up to version 1.86.\n");
+    exit(2);
+#else
+#if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
+    exit(0);   /* DB version < 2: the coast is clear. */
+#else
+    exit(1);   /* <db.h> not Berkeley DB? */
+#endif
+#endif
+}
+EOCP
+       if $cc $optimize $ccflags $ldflags -o try try.c $libs && ./try; then
+               echo 'Looks OK.  (Perl supports up to version 1.86).' >&4
+       else
+               echo "I can't use your Berkeley DB.  I'll disable it." >&4
+               i_db=$undef
+               case " $libs " in
+               *"-ldb "*)
+                       : Remove db from list of libraries to use
+                       echo "Removing unusable -ldb from library list" >&4
+                       set `echo X $libs | $sed -e 's/-ldb / /' -e 's/-ldb$//'`
+                       shift
+                       libs="$*"
+                       echo "libs = $libs" >&4
+                       ;;
+               esac
+       fi
+       $rm -f try.*
+       ;;
+esac
+
+case "$i_db" in
 define)
        : Check the return type needed for hash 
        echo " "
@@ -8059,13 +8320,15 @@ EOCP
                        db_hashtype='u_int32_t'
                fi
        else
-               echo "I can't seem to compile the test program." >&4
-               db_hashtype=int
+               : XXX Maybe we should just give up here.
+               db_hashtype=u_int32_t
+               echo "Help:  I can't seem to compile the db test program." >&4
+               echo "Something's wrong, but I'll assume you use $db_hashtype." >&4
        fi
        $rm -f try.*
        echo "Your version of Berkeley DB uses $db_hashtype for hash."
        ;;
-*)     db_hashtype=int
+*)     db_hashtype=u_int32_t
        ;;
 esac
 
@@ -8099,13 +8362,15 @@ EOCP
                        db_prefixtype='size_t'
                fi
        else
-               echo "I can't seem to compile the test program." >&4
-               db_prefixtype='int'
+               db_prefixtype='size_t'
+               : XXX Maybe we should just give up here.
+               echo "Help:  I can't seem to compile the db test program." >&4
+               echo "Something's wrong, but I'll assume you use $db_prefixtype." >&4
        fi
        $rm -f try.*
        echo "Your version of Berkeley DB uses $db_prefixtype for prefix."
        ;;
-*)     db_prefixtype='int'
+*)     db_prefixtype='size_t'
        ;;
 esac
 
@@ -8240,20 +8505,24 @@ gidtype="$ans"
 set getgroups d_getgrps
 eval $inlibc
 
-: Find type of 2nd arg to getgroups
+: see if setgroups exists
+set setgroups d_setgrps
+eval $inlibc
+
+: Find type of 2nd arg to 'getgroups()' and 'setgroups()'
 echo " "
-case "$d_getgrps" in
-'define')
+case "$d_getgrps$d_setgrps" in
+*define*)
        case "$groupstype" in
        '') dflt="$gidtype" ;;
        *)  dflt="$groupstype" ;;
        esac
        $cat <<EOM
-What is the type of the second argument to getgroups()?  Usually this
-is the same as group ids, $gidtype, but not always.
+What is the type of the second argument to getgroups() and setgroups()?
+Usually this is the same as group ids, $gidtype, but not always.
 
 EOM
-       rp='What type is the second argument to getgroups()?'
+       rp='What type is the second argument to getgroups() and setgroups()?'
        . ./myread
        groupstype="$ans"
        ;;
@@ -8387,9 +8656,10 @@ main()
        for (i = 0; max; i++)
                max /= 2;
        printf("%d\n",i);
+       fflush(stdout);
 }
 EOCP
-       if $cc try.c -o try >/dev/null 2>&1 ; then
+       if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1 ; then
                dflt=`try`
        else
                dflt='?'
@@ -8403,7 +8673,7 @@ esac
 rp='How many bits does your rand() function produce?'
 . ./myread
 randbits="$ans"
-$rm -f try.c try
+$rm -f try.c try.o try
 
 : see if ar generates random libraries by itself
 echo " "
@@ -8416,14 +8686,14 @@ EOP
 $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${lib_ext} bar2.o bar1.o >/dev/null 2>&1
-if $cc $ccflags $ldflags -o foobar foo.o bar${lib_ext} $libs > /dev/null 2>&1 &&
+ar rc bar$lib_ext bar2.o bar1.o >/dev/null 2>&1
+if $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $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${lib_ext} >/dev/null 2>&1 &&
-       $cc $ccflags $ldflags -o foobar foo.o bar${lib_ext} $libs > /dev/null 2>&1 &&
+elif ar ts bar$lib_ext >/dev/null 2>&1 &&
+       $cc $ccflags $ldflags -o foobar foo.o bar$lib_ext $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
@@ -8892,27 +9162,36 @@ main()
                printf("int\n");
        else 
                printf("long\n");
+       fflush(stdout);
        exit(0);
 }
 EOM
 echo " "
-if $cc $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1  &&
-               ./ssize > /dev/null 2>&1 ; then
-       ssizetype=`./ssize`
+#      If $libs contains -lsfio, and sfio is mis-configured, then it
+#      sometimes (apparently) runs and exits with a 0 status, but with no
+#      output!.  Thus we check with test -s whether we actually got any 
+#      output.  I think it has to do with sfio's use of _exit vs. exit,
+#      but I don't know for sure.  --Andy Dougherty  1/27/97.
+if $cc $optimize $ccflags $ldflags -o ssize ssize.c $libs > /dev/null 2>&1  &&
+               ./ssize > ssize.out 2>/dev/null && test -s ssize.out ; then
+       ssizetype=`$cat ssize.out`
        echo "I'll be using $ssizetype for functions returning a byte count." >&4
 else
-       echo "(I can't compile and run the test program--please enlighten me!)"
-       $cat <<EOM
+       $cat >&4 <<EOM
+
+Help! I can't compile and run the ssize_t test program: please enlighten me!
+(This is probably a misconfiguration in your system or libraries, and
+you really ought to fix it.  Still, I'll try anyway.)
 
 I need a type that is the same size as $sizetype, but is guaranteed to
-be signed.  Common values are int and long.
+be signed.  Common values are ssize_t, int and long.
 
 EOM
        rp="What signed type is the same size as $sizetype?"
        . ./myread
        ssizetype="$ans"
 fi
-$rm -f ssize ssize.[co]
+$rm -f ssize ssize.[co] ssize.out
 
 : see what type of char stdio uses.
 echo " "
@@ -9466,23 +9745,22 @@ known_extensions=''
 : some additional extensions into the source tree and expect them
 : to be built.
 for xxx in * ; do
-       case "$xxx" in
-       DynaLoader) ;;
-       *)
-               if $test -f $xxx/$xxx.xs; then
-                       known_extensions="$known_extensions $xxx"
-               else
-                       if $test -d $xxx; then
-                               cd $xxx
-                               for yyy in * ; do
-                                       if $test -f $yyy/$yyy.xs; then
-                                               known_extensions="$known_extensions $xxx/$yyy"
-                                       fi
-                               done
-                               cd ..
-                       fi
-               fi ;;
-       esac
+    case "$xxx" in
+    DynaLoader) ;;
+    *) if $test -f $xxx/$xxx.xs; then
+           known_extensions="$known_extensions $xxx"
+       else
+           if $test -d $xxx; then
+               cd $xxx
+               for yyy in * ; do
+                   if $test -f $yyy/$yyy.xs; then
+                       known_extensions="$known_extensions $xxx/$yyy"
+                   fi
+               done
+               cd ..
+           fi
+       fi ;;
+    esac
 done
 set X $known_extensions
 shift
@@ -9662,10 +9940,10 @@ echo "Creating config.sh..." >&4
 $spitshell <<EOT >config.sh
 $startsh
 #
-# This file was produced by running the Configure script. It holds all the
-# definitions figured out by Configure. Should you modify one of these values,
-# do not forget to propagate your changes by running "Configure -der". You may
-# instead choose to run each of the .SH files by yourself, or "Configure -S".
+# This file was produced by running the Configure script.  It holds all
+# the definitions figured out by Configure.  Should you modify any of
+# these values, do not forget to propagate your changes by running
+# "Configure -S"; or, equivalently, you may run each .SH file yourself.
 #
 
 # Configuration time: $cf_time
@@ -9695,6 +9973,7 @@ awk='$awk'
 baserev='$baserev'
 bash='$bash'
 bin='$bin'
+bincompat3='$bincompat3'
 binexp='$binexp'
 bison='$bison'
 byacc='$byacc'
@@ -9734,6 +10013,7 @@ d_archlib='$d_archlib'
 d_attribut='$d_attribut'
 d_bcmp='$d_bcmp'
 d_bcopy='$d_bcopy'
+d_bincompat3='$d_bincompat3'
 d_bsd='$d_bsd'
 d_bsdgetpgrp='$d_bsdgetpgrp'
 d_bsdpgrp='$d_bsdpgrp'
@@ -9772,7 +10052,9 @@ d_flock='$d_flock'
 d_fork='$d_fork'
 d_fpathconf='$d_fpathconf'
 d_fsetpos='$d_fsetpos'
+d_ftime='$d_ftime'
 d_getgrps='$d_getgrps'
+d_setgrps='$d_setgrps'
 d_gethent='$d_gethent'
 d_gethname='$d_gethname'
 d_getlogin='$d_getlogin'
@@ -9781,9 +10063,11 @@ d_getpgrp2='$d_getpgrp2'
 d_getpgrp='$d_getpgrp'
 d_getppid='$d_getppid'
 d_getprior='$d_getprior'
+d_gettimeod='$d_gettimeod'
 d_gnulibc='$d_gnulibc'
 d_htonl='$d_htonl'
 d_index='$d_index'
+d_inetaton='$d_inetaton'
 d_isascii='$d_isascii'
 d_killpg='$d_killpg'
 d_link='$d_link'
@@ -9829,6 +10113,7 @@ d_rewinddir='$d_rewinddir'
 d_rmdir='$d_rmdir'
 d_safebcpy='$d_safebcpy'
 d_safemcpy='$d_safemcpy'
+d_sanemcmp='$d_sanemcmp'
 d_seekdir='$d_seekdir'
 d_select='$d_select'
 d_sem='$d_sem'
@@ -10021,6 +10306,7 @@ ln='$ln'
 lns='$lns'
 locincpth='$locincpth'
 loclibpth='$loclibpth'
+longsize='$longsize'
 lp='$lp'
 lpr='$lpr'
 ls='$ls'
@@ -10095,6 +10381,7 @@ sh='$sh'
 shar='$shar'
 sharpbang='$sharpbang'
 shmattype='$shmattype'
+shortsize='$shortsize'
 shrpenv='$shrpenv'
 shsharp='$shsharp'
 sig_name='$sig_name'
@@ -10123,7 +10410,6 @@ stdchar='$stdchar'
 stdio_base='$stdio_base'
 stdio_bufsiz='$stdio_bufsiz'
 stdio_cnt='$stdio_cnt'
-stdio_filbuf='$stdio_filbuf'
 stdio_ptr='$stdio_ptr'
 strings='$strings'
 submit='$submit'