"d_gethbyname" misspelled in Configure
[p5sagit/p5-mst-13.2.git] / Configure
index 9211439..62249dd 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 Tue Dec 17 14:33:33 EST 1996 [metaconfig 3.0 PL60]
+# Generated on Sat Feb  1 00:26:40 EST 1997 [metaconfig 3.0 PL60]
 
 cat >/tmp/c1$$ <<EOF
 ARGGGHHHH!!!!!
@@ -63,6 +63,9 @@ if test -d c:/. -a -n "$OS2_SHELL"; then
        PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
        OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
 fi
+if test -d c:/. -a -n "$DJDIR"; then
+        p_=\;
+fi
 
 : Proper PATH setting
 paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
@@ -85,31 +88,52 @@ done
 PATH=.$p_$PATH
 export PATH
 
+: This should not matter in scripts, but apparently it does, sometimes
+case "$CDPATH" in
+'')    ;;
+*)     CDPATH='' ;;
+esac
+
 : Sanity checks
 if test ! -t 0; then
        echo "Say 'sh $me', not 'sh <$me'"
        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
+               unset ENV
+        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
@@ -188,6 +212,7 @@ tr=''
 troff=''
 uname=''
 uniq=''
+usethreads=''
 uuname=''
 vi=''
 zcat=''
@@ -290,9 +315,22 @@ d_ftime=''
 d_gettimeod=''
 d_Gconvert=''
 d_getgrps=''
+d_setgrps=''
 d_gethent=''
+d_gethbyaddr=''
+netdb_host_type=''
+netdb_hlen_type=''
+d_gethbyname=''
+netdb_name_type=''
+d_getnbyaddr=''
+d_getnbyname=''
+netdb_net_type=''
 aphostname=''
 d_gethname=''
+d_getpbyname=''
+d_getpbynumber=''
+d_getsbyname=''
+d_getsbyport=''
 d_phostname=''
 d_uname=''
 d_getlogin=''
@@ -390,7 +428,6 @@ d_stdstdio=''
 stdio_base=''
 stdio_bufsiz=''
 stdio_cnt=''
-stdio_filbuf=''
 stdio_ptr=''
 d_index=''
 d_strchr=''
@@ -438,6 +475,8 @@ usedl=''
 fpostype=''
 gidtype=''
 groupstype=''
+d_sched_yield=''
+d_pthread_yield=''
 h_fcntl=''
 h_sysfile=''
 db_hashtype=''
@@ -460,9 +499,11 @@ i_malloc=''
 i_math=''
 i_memory=''
 i_ndbm=''
+i_netdb=''
 i_neterrno=''
 i_niin=''
 i_sysin=''
+d_pthreads_created_joinable=''
 d_pwage=''
 d_pwchange=''
 d_pwclass=''
@@ -506,6 +547,8 @@ i_varargs=''
 i_varhdr=''
 i_vfork=''
 intsize=''
+longsize=''
+shortsize=''
 libc=''
 libperl=''
 shrpenv=''
@@ -716,7 +759,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="/shlib /usr/shlib /lib/pa1.1 /usr/lib/large"
+glibpth="/shlib /usr/shlib /usr/lib/pa1.1 /usr/lib/large"
 glibpth="$glibpth /lib /usr/lib $xlibpth"
 glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
 glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
@@ -778,7 +821,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 (Chip Salzenberg) at chip@atlantic.net and 
+Please contact me (Chip Salzenberg) at chip@perl.com and 
 we'll try to straigten this all out.
 EOM
        exit 1
@@ -1150,7 +1193,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 (chip@atlantic.net).
+and contact the author (chip@perl.com).
 
 EOM
                echo $n "Continue? [n] $c" >&4
@@ -1219,7 +1262,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
@@ -1341,7 +1384,7 @@ If you are in a hurry, you may run 'Configure -d'.  This will bypass nearly all
 the questions and use the computed defaults (or the previous answers if there
 was already a config.sh file). Type 'Configure -h' for a list of options.
 You may also start interactively and then answer '& -d' at any prompt to turn
-on the non-interactive behaviour for the remaining of the execution.
+on the non-interactive behavior for the remainder of the execution.
 
 EOH
        . ./myread
@@ -1351,7 +1394,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 (chip@atlantic.net) know how I blew it.
+have, let me (chip@perl.com) know how I blew it.
 
 This installation script affects things in two ways:
 
@@ -1641,7 +1684,7 @@ 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 chip@atlantic.net
+       : 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
@@ -1681,7 +1724,6 @@ EOM
                        esac;;
                [23]100) osname=mips ;;
                next*) osname=next ;;
-               news*) osname=news ;;
                i386*)
                        if $test -f /etc/kconfig; then
                                osname=isc
@@ -1707,6 +1749,9 @@ EOM
                        *) osvers=$tmp;;
                        esac
                        ;;
+               *dc.osx) osname=dcosx
+                       osvers="$3"
+                       ;;
                dnix) osname=dnix
                        osvers="$3"
                        ;;
@@ -1739,16 +1784,25 @@ EOM
                        ;;
                linux) osname=linux
                        case "$3" in
-                       1*) osvers=1 ;;
                        *)      osvers="$3" ;;
                        esac
                        ;;
                netbsd*) osname=netbsd 
                        osvers="$3"
                        ;;
+               news-os) osvers="$3"
+                       case "$3" in
+                       4*) osname=newsos4 ;;
+                       *) osname=newsos ;;
+                       esac
+                       ;;
                bsd386) osname=bsd386
                        osvers=`$uname -r`
                        ;;
+               powerux | power_ux | powermax_os | powermaxos | \
+               powerunix | power_unix) osname=powerux
+                       osvers="$3"
+                       ;;
                next*) osname=next ;;
                solaris) osname=solaris
                        case "$3" in
@@ -1778,7 +1832,7 @@ EOM
                osf1|mls+)      case "$5" in
                                alpha)
                                        osname=dec_osf
-                                       osvers=`echo "$3" | sed 's/^[vt]//'`
+                                       osvers=`echo "$3" | sed 's/^[xvt]//'`
                                        ;;
                        hp*)    osname=hp_osf1  ;;
                        mips)   osname=mips_osf1 ;;
@@ -1846,16 +1900,20 @@ EOM
                        ;;
                esac
        else
-               if test -f /vmunix -a -f news_os.sh; then
+               if test -f /vmunix -a -f newsos4.sh; then
                        (what /vmunix | ../UU/tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
                        if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
-                               osname=news_os
+                               osname=newsos4
                        fi
                        $rm -f ../UU/kernel.what
                elif test -d c:/.; then
                        set X $myuname
                        osname=os2
                        osvers="$5"
+                       if test -n "$DJDIR"; then
+                               osname=dos
+                               osvers=djgpp
+                       fi
                fi
        fi
        
@@ -2017,7 +2075,7 @@ esac
 
 
 : who configured the system
-cf_time=`$date 2>&1`
+cf_time=`LC_ALL=C; export LC_ALL; $date 2>&1`
 cf_by=`(logname) 2>/dev/null`
 case "$cf_by" in "")
        cf_by=`(whoami) 2>/dev/null`
@@ -2054,7 +2112,19 @@ case "$archname" in
 esac
 rp='What is your architecture name'
 . ./myread
-archname="$ans"
+case "$usethreads" in
+$define)  echo "Threads selected." >&4
+          case "$ans" in
+          *-thread) echo "...and architecture name already ends in -thread." >&4
+                    archname="$ans"
+                    ;;
+          *)        archname="$ans-thread"
+                    echo "...setting architecture name to $archname." >&4
+                    ;;
+          esac
+          ;;
+*)        archname="$ans" ;;
+esac
 myarchname="$tarch"
 
 : is AFS running?
@@ -2434,7 +2504,7 @@ else
 fi
 
 : set the base revision
-baserev=5
+baserev=5.0
 
 : get the patchlevel
 echo " "
@@ -2466,23 +2536,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
-               ;;
-       *)      if test 0 -eq "$subversion"; then
-                       version=`echo $baserev $patchlevel | \
-                                $awk '{ printf "%d.%03d\n",$1,$2 }'`
-               else
-                       version=`echo $baserev $patchlevel $subversion | \
-                                $awk '{ printf "%d.%03d%02d\n",$1,$2,$3 }'`
-               fi
-               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
 
@@ -2501,9 +2575,10 @@ archlibexp="$ansexp"
 if $afs; then
        $cat <<EOM
 
-Since you are running AFS, I need to distinguish the directory in which
-private files reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
+Since you are running AFS, I need to distinguish the directory in
+which architecture-dependent library files reside from the directory
+in which they are installed (and from which they are presumably copied
+to the former directory by occult means).
 
 EOM
        case "$installarchlib" in
@@ -2547,32 +2622,8 @@ $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
+: bincompat3 is no more even possible starting with 5.005
+d_bincompat3=$undef
 
 : make some quick guesses about what we are up against
 echo " "
@@ -2802,9 +2853,10 @@ sitelibexp="$ansexp"
 if $afs; then
        $cat <<EOM
 
-Since you are running AFS, I need to distinguish the directory in which
-private files reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
+Since you are running AFS, I need to distinguish the directory in
+which site-specific files reside from the directory in which they are
+installed (and from which they are presumably copied to the former
+directory by occult means).
 
 EOM
        case "$installsitelib" in
@@ -2812,7 +2864,7 @@ EOM
        *) dflt="$installsitelib";;
        esac
        fn=de~
-       rp='Where will private files be installed?'
+       rp='Where will site-specific files be installed?'
        . ./getfile
        installsitelib="$ans"
 else
@@ -2845,9 +2897,10 @@ sitearchexp="$ansexp"
 if $afs; then
        $cat <<EOM
 
-Since you are running AFS, I need to distinguish the directory in which
-private files reside from the directory in which they are installed (and from
-which they are presumably copied to the former directory by occult means).
+Since you are running AFS, I need to distinguish the directory in
+which site-specific architecture-dependent library files reside from
+the directory in which they are installed (and from which they are
+presumably copied to the former directory by occult means).
 
 EOM
        case "$installsitearch" in
@@ -2855,7 +2908,7 @@ EOM
        *) dflt="$installsitearch";;
        esac
        fn=de~
-       rp='Where will private files be installed?'
+       rp='Where will site-specific architecture-dependent files be installed?'
        . ./getfile
        installsitearch="$ans"
 else
@@ -2968,8 +3021,8 @@ main() {
 #endif
 }
 EOP
-       cc -o pdp11 pdp11.c >/dev/null 2>&1
-       if ./pdp11 2>/dev/null; then
+       (cc -o pdp11 pdp11.c) >/dev/null 2>&1
+       if $test -f pdp11 && ./pdp11 2>/dev/null; then
                dflt='unsplit split'
        else
                tans=`./loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
@@ -3535,7 +3588,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
@@ -3611,7 +3664,6 @@ if ./osf1; then
 else
        set signal.h LANGUAGE_C; eval $inctest
 fi
-set signal.h _NO_PROTO; eval $inctest
 
 case "$hint" in
 none|recommended) dflt="$ccflags $dflt" ;;
@@ -3672,7 +3724,7 @@ EOM
                -*) ftry="$flag";;
                *) ftry="$previous $flag";;
                esac
-               if $cppstdin -DLFRULB=bar $ftry $cppminus <cpp.c \
+               if $cppstdin -DLFRULB=bar $cppflags $ftry $cppminus <cpp.c \
                        >cpp1.out 2>/dev/null && \
                        $cpprun -DLFRULB=bar $ftry $cpplast <cpp.c \
                        >cpp2.out 2>/dev/null && \
@@ -3750,8 +3802,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:
@@ -3767,22 +3819,22 @@ $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
                echo "The program compiled OK, but exited with status $?." >>try.msg
-               rp="You have a problem.  Shall I abort Configure"
+               rp="You have a problem.  Shall I abort Configure (and explain the problem)"
                dflt=y
        fi
 else
        echo "I can't compile the test program." >>try.msg
-       rp="You have a BIG problem.  Shall I abort Configure"
+       rp="You have a BIG problem.  Shall I abort Configure (and explain the problem)"
        dflt=y
 fi
 case "$dflt" in
 y)
-       $cat try.msg
+       $cat try.msg >&4
        case "$knowitall" in
        '')
                echo "(The supplied flags might be incorrect with this C compiler.)"
@@ -3873,11 +3925,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;;
@@ -4097,6 +4151,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
@@ -4105,6 +4163,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
@@ -4381,12 +4443,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
@@ -4524,31 +4593,31 @@ $undef)
        ;;
 *)     case "$useshrplib" in
        '')     case "$osname" in
-               svr4|dgux|dynixptx|esix|powerux)
-                       dflt='yes'
+               svr4*|dgux|dynixptx|esix|powerux)
+                       dflt=y
                        also='Building a shared libperl is required for dynamic loading to work on your system.'
                        ;;
                next*)
                        case "$osvers" in
-                       4*)     dflt='yes'
+                       4*)     dflt=y
                                also='Building a shared libperl is needed for MAB support.'
                                ;;
-                       *)      dflt='no'
+                       *)      dflt=n
                                ;;
                        esac
                        ;;
                sunos)
-                       dflt='no'
+                       dflt=n
                        also='Building a shared libperl will definitely not work on SunOS 4.'
                        ;;
-               *)      dflt='no'
+               *)      dflt=n
                        ;;
                esac
                ;;
        $define|true|[Yy]*)
-               dflt='yes'
+               dflt=y
                ;;
-       *)      dflt='no'
+       *)      dflt=n
                ;;
        esac
        $cat << EOM
@@ -4656,8 +4725,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 (chip@atlantic.net)
-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
@@ -4687,29 +4756,41 @@ xxx=''
 tmp_shrpenv=''
 if "$useshrplib"; then
     case "$osname" in 
+       aix)
+               # We'll set it in Makefile.SH...
+               ;;
        solaris|netbsd)
                xxx="-R $shrpdir"
                ;;
        freebsd)
-               xxx="-Wl,-R,$shrpdir"
+               xxx="-Wl,-R$shrpdir"
                ;;
-       linux|irix*)
+       linux|irix*|dec_osf)
                xxx="-Wl,-rpath,$shrpdir"
                ;;
+       next)
+               # next doesn't like the default...
+               ;;
        *)
                tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
                ;;
        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
@@ -5154,7 +5235,7 @@ case "$myhostname" in
                                .) dflt=.`$sed -n -e 's/        / /g' \
                                     -e 's/^domain  *\([^ ]*\).*/\1/p' $tans \
                                     | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
-                                       ;;
+                                       ;;
                                esac
                        fi
                        ;;
@@ -5287,8 +5368,17 @@ EOH
                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";;
+               none)   startperl=": # use perl";;
+               *)      startperl="#!$ans"
+                       if $test 30 -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"
@@ -5381,13 +5471,13 @@ fi
 
 cat <<EOM
 
-Previous version of $package used the standard IO mechanisms as defined in
-<stdio.h>.  Versions 5.003_02 and later of perl allow alternate IO
+Previous version of $package used the standard IO mechanisms as defined
+in <stdio.h>.  Versions 5.003_02 and later of perl allow alternate IO
 mechanisms via a "PerlIO" abstraction, but the stdio mechanism is still
-the default and is the only supported mechanism.  This abstraction
-layer can use AT&T's sfio (if you already have sfio installed) or
-fall back on standard IO.  This PerlIO abstraction layer is
-experimental and may cause problems with some extension modules.
+the default.  This abstraction layer can use AT&T's sfio (if you already
+have sfio installed) or regular stdio.  Using PerlIO with sfio may cause
+problems with some extension modules.  Using PerlIO with stdio is safe,
+but it is slower than plain stdio and therefore is not the default.
 
 If this doesn't make any sense to you, just accept the default 'n'.
 EOM
@@ -5716,32 +5806,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 " "
@@ -6015,12 +6130,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
@@ -6274,7 +6392,7 @@ main() {
 EOCP
 : check sys/file.h first to get FREAD on Sun
 if $test `./findhdr sys/file.h` && \
-               $cc $cppflags "-DI_SYS_FILE" open3.c -o open3 >/dev/null 2>&1 ; then
+        $cc $ccflags "-DI_SYS_FILE" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
        h_sysfile=true;
        echo "<sys/file.h> defines the O_* constants..." >&4
        if ./open3; then
@@ -6285,7 +6403,7 @@ if $test `./findhdr sys/file.h` && \
                val="$undef"
        fi
 elif $test `./findhdr fcntl.h` && \
-               $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
+        $cc $ccflags "-DI_FCNTL" -o open3 $ldflags open3.c $libs >/dev/null 2>&1 ; then
        h_fcntl=true;
        echo "<fcntl.h> defines the O_* constants..." >&4
        if ./open3; then
@@ -6414,9 +6532,7 @@ main()
 }
 EOCP
        if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
-               cat <<EOS >mtry
-$startsh
-EOS
+               echo "$startsh" >mtry
                echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
                chmod +x mtry
                ./mtry >/dev/null 2>&1
@@ -6514,6 +6630,14 @@ eval $inlibc
 set fsetpos d_fsetpos
 eval $inlibc
 
+: see if gethostbyaddr exists
+set gethostbyaddr d_gethbyaddr
+eval $inlibc
+
+: see if gethostbyname exists
+set gethostbyname d_gethbyname
+eval $inlibc
+
 : see if gethostent exists
 set gethostent d_gethent
 eval $inlibc
@@ -6522,6 +6646,14 @@ eval $inlibc
 set getlogin d_getlogin
 eval $inlibc
 
+: see if getnetbyaddr exists
+set getnetbyaddr d_getnbyaddr
+eval $inlibc
+
+: see if getnetbyname exists
+set getnetbyname d_getnbyname
+eval $inlibc
+
 : see if getpgid exists
 set getpgid d_getpgid
 eval $inlibc
@@ -6538,6 +6670,22 @@ eval $inlibc
 set getpriority d_getprior
 eval $inlibc
 
+: see if getprotobyname exists
+set getprotobyname d_getpbyname
+eval $inlibc
+
+: see if getprotobynumber exists
+set getprotobynumber d_getpbynumber
+eval $inlibc
+
+: see if getservbyname exists
+set getservbyname d_getsbyname
+eval $inlibc
+
+: see if getservbyport exists
+set getservbyport d_getsbyport
+eval $inlibc
+
 : see if gettimeofday or ftime exists
 set gettimeofday d_gettimeod
 eval $inlibc
@@ -7044,7 +7192,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"
@@ -7122,7 +7271,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"
@@ -7182,7 +7332,8 @@ if ((a < b) && memcmp(&a, &b, 1) < 0)
 exit(0);
 }
 EOCP
-       if $cc $ccflags $ldflags foo.c -o sanemcmp $libs >/dev/null 2>&1; then
+       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"
@@ -7313,6 +7464,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
        ;;
@@ -7631,47 +7787,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"
@@ -8088,7 +8203,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"
@@ -8195,6 +8310,75 @@ set db.h i_db
 eval $inhdr
 
 case "$i_db" in
+$define)
+       : Check db version.
+       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 */
+    int Major, Minor, Patch ;
+    (void)db_version(&Major, &Minor, &Patch) ;
+    printf("You have Berkeley DB Version 2 or greater\n");
+
+    printf("db.h is from Berkeley DB Version %d.%d.%d\n",
+               DB_VERSION_MAJOR, DB_VERSION_MINOR, DB_VERSION_PATCH);
+    printf("libdb is from Berkeley DB Version %d.%d.%d\n",
+               Major, Minor, Patch) ;
+
+    /* check that db.h & libdb are compatible */
+    if (DB_VERSION_MAJOR != Major || DB_VERSION_MINOR != Minor || DB_VERSION_PATCH != Patch) {
+       printf("db.h and libdb are incompatible\n") ;
+        exit(3);       
+    }
+
+    printf("db.h and libdb are compatible\n") ;
+    /* needs to be >= 2.05 */
+    if (DB_VERSION_MAJOR == 2 && DB_VERSION_MINOR == 0 && DB_VERSION_PATCH < 5) {
+       printf("but Perl needs Berkeley DB 2.0.5 or greater\n") ;
+        exit(2);       
+    }
+
+    exit(0);
+#else
+#if defined(_DB_H_) && defined(BTREEMAGIC) && defined(HASHMAGIC)
+    printf("You have Berkeley DB Version 1\n");
+    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.' >&4
+       else
+               echo "I can't use Berkeley DB with your <db.h>.  I'll disable Berkeley DB." >&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 " "
@@ -8206,6 +8390,8 @@ define)
 #endif
 #include <sys/types.h>
 #include <db.h>
+
+#ifndef DB_VERSION_MAJOR
 u_int32_t hash_cb (ptr, size)
 const void *ptr;
 size_t size;
@@ -8216,6 +8402,7 @@ main()
 {
        info.hash = hash_cb;
 }
+#endif
 EOCP
        if $cc $ccflags -c try.c >try.out 2>&1 ; then
                if $contains warning try.out >>/dev/null 2>&1 ; then
@@ -8224,13 +8411,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
 
@@ -8246,6 +8435,8 @@ define)
 #endif
 #include <sys/types.h>
 #include <db.h>
+
+#ifndef DB_VERSION_MAJOR
 size_t prefix_cb (key1, key2)
 const DBT *key1;
 const DBT *key2;
@@ -8256,6 +8447,7 @@ main()
 {
        info.prefix = prefix_cb;
 }
+#endif
 EOCP
        if $cc $ccflags -c try.c  >try.out 2>&1 ; then
                if $contains warning try.out >>/dev/null 2>&1 ; then
@@ -8264,13 +8456,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
 
@@ -8405,20 +8599,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"
        ;;
@@ -8552,9 +8750,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='?'
@@ -8568,7 +8767,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 " "
@@ -8976,7 +9175,7 @@ EOP
 $cat >signal_cmd <<EOS
 $startsh
 $test -s signal.lst && exit 0
-if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
+if $cc $ccflags $ldflags signal.c -o signal >/dev/null 2>&1; then
        ./signal | $sort -n +1 | $uniq | $awk -f signal.awk >signal.lst
 else
        echo "(I can't seem be able to compile the test program -- Guessing)"
@@ -8988,7 +9187,7 @@ else
        0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
        esac
        echo \$@ | $tr ' ' '\012' | \
-               $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
+               $awk '{ printf \$1; printf " %d\n", ++s; }' >signal.lst
 fi
 $rm -f signal.c signal signal.o
 EOS
@@ -9062,23 +9261,240 @@ main()
 }
 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 if this is a netdb.h system
+set netdb.h i_netdb
+eval $inhdr
+
+: check for type of arguments to gethostbyaddr.  This will only really
+: work if the system supports prototypes and provides one for
+: gethostbyaddr.  The netdb_host_type and netdb_hlen_type get defined.
+case "$d_gethbyaddr" in
+$define)
+        if test "X$netdb_host_type" = X -o "X$netdb_hlen_type" = X; then
+           $cat <<EOM
+
+Checking to see what type of arguments are expected by gethostbyaddr().
+EOM
+       $cat >try.c <<EOCP
+#include <sys/types.h>
+#$i_niin I_NIIN
+#$i_netdb I_NETDB
+#$i_unistd I_UNISTD
+#$d_socket HAS_SOCKET
+#$d_socket HAS_SOCKET
+#ifdef HAS_SOCKET
+#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
+#endif
+#ifdef I_NIIN
+#include <netinet/in.h>
+#endif
+#ifdef I_NETDB
+#include <netdb.h>
+#endif
+#ifdef I_UNISTD
+#include <unistd.h>
+#endif
+#define Size_t $sizetype
+main()
+{
+        Netdb_alen_t   alen = sizeof(struct in_addr);
+       Netdb_addr_t    addr = (Netdb_addr_t)malloc(alen);
+       struct hostent* hent;
+
+       extern struct hostent *gethostbyaddr(Netdb_addr_t, Netdb_alen_t, int);
+
+       /* We do not execute this so the arguments matter not. */
+       hent = gethostbyaddr(addr, alen, AF_INET);
+
+       exit(0);
+}
+EOCP
+           for xxx in in_addr_t "const void *" "const char *" "void *" "char *"; do
+                   for yyy in Size_t long int; do
+                           if $cc $ccflags -c -DNetdb_addr_t="$xxx" -DNetdb_alen_t="$yyy" try.c >/dev/null 2>&1 ; then
+                               netdb_host_type="$xxx"
+                               netdb_hlen_type="$yyy"
+                               $cat >&4 <<EOM
+Your system accepts $xxx for the 1st argument to gethostbyaddr.
+and the 2nd argument to gethostbyaddr can be $yyy.
+EOM
+                               break
+                           fi
+                   done
+                   test "X$netdb_host_type" != X && break
+           done
+           if test "X$netdb_host_type" = X; then
+                   rp='What is the type for the 1st argument to gethostbyaddr?'
+                   dflt="void *"
+                   . ./myread
+                   netdb_host_type="$ans"
+
+                   # Remove the "const" if needed.
+                   netdb_host_type=`echo "$netdb_host_type" | sed 's/^const //'`
+
+                   rp='What is the type for the 2nd argument to gethostbyaddr ?'
+                   dflt="Size_t"
+                   . ./myread
+                   netdb_hlen_type="$ans"
+           fi
+           $rm -f try.[co]
+        else
+           $cat >&4 <<EOM
+Your system accepts $netdb_host_type for the 1st argument to gethostbyaddr.
+and the 2nd argument to gethostbyaddr can be $netdb_hlen_type.
+EOM
+       fi
+       ;;
+*)     netdb_host_type='void *'
+       netdb_hlen_type='Size_t'
+       ;;
+esac
+
+: check for type of arguments to gethostbyname.  This will only really
+: work if the system supports prototypes and provides one for
+: gethostbyname.  The netdb_name_type gets defined.
+case "$d_gethbyname" in
+$define)
+        if test "X$netdb_name_type" = X; then
+            $cat <<EOM
+
+Checking to see what type of arguments are expected by gethostbyname().
+EOM
+        $cat >try.c <<EOCP
+#$i_niin I_NIIN
+#$i_netdb I_NETDB
+#$d_socket HAS_SOCKET
+#$d_socket HAS_SOCKET
+#include <sys/types.h>
+#ifdef HAS_SOCKET
+#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
+#endif
+#ifdef I_NIIN
+#include <netinet/in.h>
+#endif
+#ifdef I_NETDB
+#include <netdb.h>
+#endif
+main()
+{
+        char*  host = "localhost";
+        struct hostent*  hent;
+
+        extern struct hostent *gethostbyname(Netdb_name_t);
+
+        /* We do not execute this so the arguments matter not. */
+        hent = gethostbyname(host);
+
+        exit(0);
+}
+EOCP
+            for xxx in "const char *" "char *"; do
+                    if $cc $ccflags -c -DNetdb_name_t="$xxx" try.c >/dev/null 2>&1 ; then
+                        netdb_name_type="$xxx"
+                        echo "Your system accepts $xxx for the 1st argument to gethostbyname." >&4
+                        break
+                    fi
+            done
+            if test "X$netdb_name_type" = X; then
+                    rp='What is the type for the 1st argument to gethostbyname?'
+                    dflt="char *"
+                    . ./myread
+                    netdb_name_type="$ans"
+            fi
+            $rm -f try.[co]
+        else
+            echo "Your system accepts $netdb_name_type for the 1st argument to gethostbyname." >&4
+        fi
+        ;;
+*)      netdb_name_type='char *'
+        ;;
+esac
+
+: check for type of arguments to getnetbyaddr.  This will only really
+: work if the system supports prototypes and provides one for
+: getnetbyaddr.  The netdb_net_type gets defined.
+case "$d_getnbyaddr" in
+$define)
+        if test "X$netdb_net_type" = X; then
+            $cat <<EOM
+
+Checking to see what type of arguments are expected by getnetbyaddr().
+EOM
+        $cat >try.c <<EOCP
+#$i_niin I_NIIN
+#$i_netdb I_NETDB
+#$d_socket HAS_SOCKET
+#$d_socket HAS_SOCKET
+#include <sys/types.h>
+#ifdef HAS_SOCKET
+#include <sys/socket.h> /* Might include <sys/bsdtypes.h> */
+#endif
+#ifdef I_NIIN
+#include <netinet/in.h>
+#endif
+#ifdef I_NETDB
+#include <netdb.h>
+#endif
+main()
+{
+        Netdb_net_t  net;
+        struct netent*  nent;
+
+        extern struct netent *getnetbyaddr(Netdb_net_t, int);
+
+        /* We do not execute this so the arguments matter not. */
+        nent = getnetbyaddr(net, 2);
+
+        exit(0);
+}
+EOCP
+            for xxx in in_addr_t "unsigned long" long "unsigned int" int; do
+                    if $cc $ccflags -c -DNetdb_net_t="$xxx" try.c >/dev/null 2>&1 ; then
+                        netdb_net_type="$xxx"
+                        echo "Your system accepts $xxx for the 1st argument to getnetbyaddr." >&4
+                        break
+                    fi
+            done
+            if test "X$netdb_net_type" = X; then
+                    rp='What is the type for the 1st argument to getnetbyaddr?'
+                    dflt="long"
+                    . ./myread
+                    netdb_net_type="$ans"
+            fi
+            $rm -f try.[co]
+        else
+            echo "Your system accepts $netdb_net_type for the 1st argument to getnetbyaddr." >&4
+        fi
+        ;;
+*)      netdb_net_type='long'
+        ;;
+esac
 
 : see what type of char stdio uses.
 echo " "
@@ -9621,6 +10037,89 @@ val="$t_gdbm"
 set i_gdbm
 eval $setvar
 
+: test whether pthreads are created in joinable -- aka undetached -- state
+if test "X$usethreads" != X; then
+    if test "X$d_pthreads_created_joinable" = X; then
+       echo >&4 "Checking whether pthreads are created joinable."
+       $cat >try.c <<EOCP
+#include <pthread.h>
+#include <stdio.h>
+int main() {
+    pthread_attr_t attr;
+    int detachstate;
+    printf("%s\n",
+       pthread_attr_init(&attr) == 0 &&
+        pthread_attr_getdetachstate(&attr, &detachstate) == 0 &&
+        detachstate == PTHREAD_CREATE_DETACHED ?
+        "detached" : "joinable");
+    exit(0);
+}
+EOCP
+       if $cc $ccflags $ldflags -o try try.c $libs >/dev/null 2>&1; then
+           yyy=`./try`
+           case "$yyy" in
+           detached)
+               echo "Nope, they aren't."
+               ;;
+           *)
+               echo "Yup, they are."
+               ;;
+           esac
+       else
+           echo "(I can't execute the test program--assuming they are.)"
+           yyy=joinable
+       fi
+       case "$yyy" in
+       detached)
+           val="$undef"
+           ;;
+       *)
+           val="$define"
+           ;;
+       esac
+       set d_pthreads_created_joinable
+       eval $setvar
+       $rm -f try try.*
+    fi
+else
+    d_pthreads_created_joinable="$undef"
+fi
+
+: see whether the various POSIXish _yields exist within given cccmd
+$cat >try.c <<EOP
+#include <pthread.h>
+main() {
+       YIELD();
+       exit(0);
+}
+EOP
+: see if pthread_yield exists within given cccmd,
+: if we do not usethreads this may well end up undef.
+if $cc $ccflags -DYIELD=pthread_yield $ldflags -o try try.c $libs > /dev/null 2>&1; then
+    val="$define"
+    echo 'pthread_yield() found.' >&4
+else
+    val="$undef"
+    echo 'pthread_yield() NOT found.' >&4
+fi
+set d_pthread_yield
+eval $setvar
+
+: see if sched_yield exists within given cccmd,
+: if we do not usethreads this may well end up undef.
+if $cc $ccflags -DYIELD=sched_yield $ldflags -o try try.c $libs > /dev/null 2>&1; then
+    val="$define"
+    echo 'sched_yield() found.' >&4
+else
+    val="$undef"
+    echo 'sched_yield() NOT found.' >&4
+fi
+set d_sched_yield
+eval $setvar
+
+: common to both the pthread_yield and sched_yield tests
+rm -f try try.*
+
 echo " "
 echo "Looking for extensions..." >&4
 cd ../ext
@@ -9658,31 +10157,35 @@ cd ../UU
 avail_ext=''
 for xxx in $known_extensions ; do
     case "$xxx" in
-    DB_File) case "$i_db" in 
+    DB_File|db_file) case "$i_db" in
            $define) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    GDBM_File) case "$i_gdbm" in 
+    GDBM_File|gdbm_fil) case "$i_gdbm" in 
            $define) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    NDBM_File) case "$i_ndbm" in 
+    NDBM_File|ndbm_fil) case "$i_ndbm" in
            $define) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in 
+    ODBM_File|odbm_fil) case "${i_dbm}${i_rpcsvcdbm}" in
            *"${define}"*) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    POSIX) case "$useposix" in 
+    POSIX|posix) case "$useposix" in
            true|define|y) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    Opcode) case "$useopcode" in 
+    Opcode|opcode) case "$useopcode" in
            true|define|y) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
-    Socket) case "$d_socket" in 
+    Socket|socket) case "$d_socket" in 
+           $define) avail_ext="$avail_ext $xxx" ;;
+           esac
+           ;;
+    Thread|thread) case "$usethreads" in 
            $define) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
@@ -9827,10 +10330,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
@@ -9941,14 +10444,27 @@ d_fpathconf='$d_fpathconf'
 d_fsetpos='$d_fsetpos'
 d_ftime='$d_ftime'
 d_getgrps='$d_getgrps'
+d_setgrps='$d_setgrps'
+d_gethbyaddr='$d_gethbyaddr'
+netdb_host_type='$netdb_host_type'
+netdb_hlen_type='$netdb_hlen_type'
+d_gethbyname='$d_gethbyname'
+netdb_name_type='$netdb_name_type'
 d_gethent='$d_gethent'
 d_gethname='$d_gethname'
 d_getlogin='$d_getlogin'
+d_getnbyaddr='$d_getnbyaddr'
+d_getnbyname='$d_getnbyname'
+netdb_net_type='$netdb_net_type'
 d_getpgid='$d_getpgid'
 d_getpgrp2='$d_getpgrp2'
 d_getpgrp='$d_getpgrp'
 d_getppid='$d_getppid'
 d_getprior='$d_getprior'
+d_getpbyname='$d_getpbyname'
+d_getpbynumber='$d_getpbynumber'
+d_getsbyname='$d_getsbyname'
+d_getsbyport='$d_getsbyport'
 d_gettimeod='$d_gettimeod'
 d_gnulibc='$d_gnulibc'
 d_htonl='$d_htonl'
@@ -9986,6 +10502,8 @@ d_phostname='$d_phostname'
 d_pipe='$d_pipe'
 d_poll='$d_poll'
 d_portable='$d_portable'
+d_pthread_yield='$d_pthread_yield'
+d_pthreads_created_joinable='$d_pthreads_created_joinable'
 d_pwage='$d_pwage'
 d_pwchange='$d_pwchange'
 d_pwclass='$d_pwclass'
@@ -10000,6 +10518,7 @@ d_rmdir='$d_rmdir'
 d_safebcpy='$d_safebcpy'
 d_safemcpy='$d_safemcpy'
 d_sanemcmp='$d_sanemcmp'
+d_sched_yield='$d_sched_yield'
 d_seekdir='$d_seekdir'
 d_select='$d_select'
 d_sem='$d_sem'
@@ -10125,6 +10644,7 @@ i_malloc='$i_malloc'
 i_math='$i_math'
 i_memory='$i_memory'
 i_ndbm='$i_ndbm'
+i_netdb='$i_netdb'
 i_neterrno='$i_neterrno'
 i_niin='$i_niin'
 i_pwd='$i_pwd'
@@ -10192,6 +10712,7 @@ ln='$ln'
 lns='$lns'
 locincpth='$locincpth'
 loclibpth='$loclibpth'
+longsize='$longsize'
 lp='$lp'
 lpr='$lpr'
 ls='$ls'
@@ -10266,6 +10787,7 @@ sh='$sh'
 shar='$shar'
 sharpbang='$sharpbang'
 shmattype='$shmattype'
+shortsize='$shortsize'
 shrpenv='$shrpenv'
 shsharp='$shsharp'
 sig_name='$sig_name'
@@ -10294,7 +10816,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'