[win32] s/PerlENV/PerlEnv/ just to be consistent
[p5sagit/p5-mst-13.2.git] / Configure
index a813f96..6dcb640 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -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,6 +88,12 @@ 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'"
@@ -112,6 +121,7 @@ EOM
 especially on older exotic systems.  If yours does, try the Bourne 
 shell instead.)
 EOM
+               unset ENV
         fi
     fi
 else
@@ -202,6 +212,7 @@ tr=''
 troff=''
 uname=''
 uniq=''
+usethreads=''
 uuname=''
 vi=''
 zcat=''
@@ -306,6 +317,11 @@ d_Gconvert=''
 d_getgrps=''
 d_setgrps=''
 d_gethent=''
+d_gethbadd=''
+gethbadd_addr_type=''
+gethbadd_alen_type=''
+d_getnbadd=''
+getnbadd_net_type=''
 aphostname=''
 d_gethname=''
 d_phostname=''
@@ -452,6 +468,8 @@ usedl=''
 fpostype=''
 gidtype=''
 groupstype=''
+d_sched_yield=''
+d_pthread_yield=''
 h_fcntl=''
 h_sysfile=''
 db_hashtype=''
@@ -474,9 +492,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=''
@@ -732,7 +752,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"
@@ -794,7 +814,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
@@ -1166,7 +1186,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
@@ -1357,7 +1377,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
@@ -1367,7 +1387,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:
 
@@ -1657,7 +1677,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
@@ -1697,7 +1717,6 @@ EOM
                        esac;;
                [23]100) osname=mips ;;
                next*) osname=next ;;
-               news*) osname=news ;;
                i386*)
                        if $test -f /etc/kconfig; then
                                osname=isc
@@ -1758,16 +1777,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
@@ -1797,7 +1825,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 ;;
@@ -1865,16 +1893,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
        
@@ -2036,7 +2068,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`
@@ -2073,7 +2105,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?
@@ -2524,9 +2568,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
@@ -2570,32 +2615,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 " "
@@ -2825,9 +2846,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
@@ -2835,7 +2857,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
@@ -2868,9 +2890,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
@@ -2878,7 +2901,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
@@ -2991,8 +3014,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`
@@ -3694,7 +3717,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 && \
@@ -3794,17 +3817,17 @@ if sh -c "$cc $optimize $ccflags -o try try.c $ldflags $libs" >>try.msg 2>&1; th
                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.)"
@@ -4564,30 +4587,30 @@ $undef)
 *)     case "$useshrplib" in
        '')     case "$osname" in
                svr4*|dgux|dynixptx|esix|powerux)
-                       dflt='yes'
+                       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
@@ -4695,8 +4718,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
@@ -4726,6 +4749,9 @@ xxx=''
 tmp_shrpenv=''
 if "$useshrplib"; then
     case "$osname" in 
+       aix)
+               # We'll set it in Makefile.SH...
+               ;;
        solaris|netbsd)
                xxx="-R $shrpdir"
                ;;
@@ -4735,6 +4761,9 @@ if "$useshrplib"; then
        linux|irix*|dec_osf)
                xxx="-Wl,-rpath,$shrpdir"
                ;;
+       next)
+               # next doesn't like the default...
+               ;;
        *)
                tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
                ;;
@@ -5334,7 +5363,7 @@ EOH
                case "$ans" in
                none)   startperl=": # use perl";;
                *)      startperl="#!$ans"
-                       if $test 33 -lt `echo "$ans" | wc -c`; then
+                       if $test 30 -lt `echo "$ans" | wc -c`; then
                                $cat >&4 <<EOM
 
 WARNING:  Some systems limit the #! command to 32 characters.
@@ -6094,12 +6123,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
@@ -6353,7 +6385,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
@@ -6364,7 +6396,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
@@ -6591,6 +6623,10 @@ eval $inlibc
 set fsetpos d_fsetpos
 eval $inlibc
 
+: see if gethostbyaddr exists
+set gethostbyaddr d_gethbadd
+eval $inlibc
+
 : see if gethostent exists
 set gethostent d_gethent
 eval $inlibc
@@ -6599,6 +6635,10 @@ eval $inlibc
 set getlogin d_getlogin
 eval $inlibc
 
+: see if getnetbyaddr exists
+set getnetbyaddr d_getnbadd
+eval $inlibc
+
 : see if getpgid exists
 set getpgid d_getpgid
 eval $inlibc
@@ -8240,7 +8280,7 @@ eval $inhdr
 
 case "$i_db" in
 $define)
-       : Check db version.  We can not use version 2.
+       : Check db version.
        echo " "
        echo "Checking Berkeley DB version ..." >&4
        $cat >try.c <<EOCP
@@ -8253,20 +8293,44 @@ $define)
 #include <db.h>
 main()
 {
-#ifdef DB_VERSION_MAJOR
-    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(1);
-#else
+#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.  (Perl supports up to version 1.86).' >&4
+               echo 'Looks OK.' >&4
        else
-               echo "I can't use your Berkeley DB.  I'll disable it." >&4
+               echo "I can't use Berkeley DB with your <db.h>.  I'll disable Berkeley DB." >&4
                i_db=$undef
                case " $libs " in
                *"-ldb "*)
@@ -8295,6 +8359,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;
@@ -8305,6 +8371,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
@@ -8337,6 +8404,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;
@@ -8347,6 +8416,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
@@ -9074,7 +9144,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)"
@@ -9086,7 +9156,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
@@ -9186,6 +9256,157 @@ EOM
 fi
 $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.
+case "$d_gethbadd" in
+$define)
+        if test "X$gethbadd_addr_type" = X -o "X$gethbadd_alen_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()
+{
+       Gethbadd_addr_t addr;
+        Gethbadd_alen_t        alen;
+       struct hostent* hent;
+
+       extern struct hostent *gethostbyaddr(const Gethbadd_addr_t, Gethbadd_alen_t, int);
+
+       alen = sizeof(struct in_addr);
+       addr = (Gethbadd_addr_t)malloc(alen);
+       /* We do not execute this so the contents of the addr matter not. */
+       hent = gethostbyaddr(addr, alen, AF_INET);
+
+       exit(0);
+}
+EOCP
+           for xxx in "void *" "char *"; do
+                   for yyy in Size_t int; do
+                           if $cc $ccflags -c -DGethbadd_addr_t="$xxx" -DGethbadd_alen_t="$yyy" try.c >/dev/null 2>&1 ; then
+                               gethbadd_addr_type="$xxx"
+                               gethbadd_alen_type="$yyy"
+                               $cat >&4 <<EOM
+Your system uses $xxx for the 1st argument to gethostbyaddr.
+and the 2nd argument to gethostbyaddr is $yyy.
+EOM
+                               break
+                           fi
+                   done
+                   test "X$gethbadd_addr_type" != X && break
+           done
+           if test "X$gethbadd_addr_type" = X; then
+                   rp='What is the type for the 1st argument to gethostbyaddr?'
+                   dflt="void *"
+                   . ./myread
+                   gethbadd_addr_type="$ans"
+
+                   # Remove the "const" if needed.
+                   gethbadd_addr_type=`echo "$gethbadd_addr_type" | sed 's/^const //'`
+
+                   rp='What is the type for the 2nd argument to gethostbyaddr ?'
+                   dflt="Size_t"
+                   . ./myread
+                   gethbadd_alen_type="$ans"
+           fi
+           $rm -f try.[co]
+        else
+           $cat >&4 <<EOM
+Your system uses $gethbadd_addr_type for the 1st argument to gethostbyaddr.
+and the 2nd argument to gethostbyaddr is $gethbadd_alen_type.
+EOM
+       fi
+       ;;
+*)     gethbadd_addr_type='void *'
+       gethbadd_alen_type='Size_t'
+       ;;
+esac
+
+: check for type of arguments to getnetbyaddr.  This will only really
+: work if the system supports prototypes and provides one for
+: getnetbyaddr.
+case "$d_getnbadd" in
+$define)
+        if test "X$getnbadd_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()
+{
+       Getnbadd_net_t  net;
+       struct netent*  nent;
+
+       extern struct netent *getnetbyaddr(Getnbadd_net_t, int);
+
+       /* We do not execute this so the contents of the net matter not. */
+       nent = getnetbyaddr(net, AF_INET);
+
+       exit(0);
+}
+EOCP
+           for xxx in in_addr_t long int; do
+                   if $cc $ccflags -c -DGetnbadd_net_t="$xxx" try.c >/dev/null 2>&1 ; then
+                       getnbadd_net_type="$xxx"
+                       echo "Your system uses $xxx for the 1st argument to getnetbyaddr." >&4
+                       break
+                   fi
+           done
+           if test "X$getnbadd_net_type" = X; then
+                   rp='What is the type for the 1st argument to getnetbyaddr?'
+                   dflt="long"
+                   . ./myread
+                   getnbadd_net_type="$ans"
+           fi
+           $rm -f try.[co]
+       else
+           echo "Your system uses $getnbadd_net_type for the 1st argument to getnetbyaddr." >&4
+       fi
+       ;;
+*)     getnbadd_net_type='long'
+       ;;
+esac
+
 : see what type of char stdio uses.
 echo " "
 if $contains 'unsigned.*char.*_ptr;' `./findhdr stdio.h` >/dev/null 2>&1 ; then
@@ -9727,6 +9948,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
@@ -9764,31 +10068,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
            ;;
@@ -10048,9 +10356,14 @@ d_fsetpos='$d_fsetpos'
 d_ftime='$d_ftime'
 d_getgrps='$d_getgrps'
 d_setgrps='$d_setgrps'
+d_gethbadd='$d_gethbadd'
+gethbadd_addr_type='$gethbadd_addr_type'
+gethbadd_alen_type='$gethbadd_alen_type'
 d_gethent='$d_gethent'
 d_gethname='$d_gethname'
 d_getlogin='$d_getlogin'
+d_getnbadd='$d_getnbadd'
+getnbadd_net_type='$getnbadd_net_type'
 d_getpgid='$d_getpgid'
 d_getpgrp2='$d_getpgrp2'
 d_getpgrp='$d_getpgrp'
@@ -10093,6 +10406,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'
@@ -10107,6 +10422,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'
@@ -10232,6 +10548,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'