This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Incorporate new single-statement macros
[perl5.git] / Configure
index e873dfe..34c39ce 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 Fri Dec  8 11:19:33 EST 1995 [metaconfig 3.0 PL58]
+# Generated on Wed Feb 21 14:26:18 EST 1996 [metaconfig 3.0 PL60]
 
 cat >/tmp/c1$$ <<EOF
 ARGGGHHHH!!!!!
@@ -120,6 +120,7 @@ extensions=''
 known_extensions=''
 static_ext=''
 useposix=''
+usesafe=''
 d_bsd=''
 d_eunice=''
 d_xenix=''
@@ -361,6 +362,11 @@ shmattype=''
 d_shmctl=''
 d_shmdt=''
 d_shmget=''
+d_sigsetjmp=''
+d_sigaction=''
+d_sigintrp=''
+d_sigvec=''
+d_sigvectr=''
 d_oldsock=''
 d_socket=''
 d_sockpair=''
@@ -533,6 +539,7 @@ orderlib=''
 ranlib=''
 package=''
 spackage=''
+pager=''
 patchlevel=''
 perladmin=''
 perlpath=''
@@ -564,9 +571,11 @@ ssizetype=''
 startperl=''
 startsh=''
 stdchar=''
+subversion=''
 sysman=''
 uidtype=''
 nm_opt=''
+nm_so_opt=''
 runnm=''
 usenm=''
 incpath=''
@@ -662,7 +671,9 @@ i_whoami=''
 libswanted=''
 : set useposix=false in your hint file to disable the POSIX extension.
 useposix=true
-: Define several unixisms.  These can be overridden in hint files.
+: set usesafe=false in your hint if you want to skip the Safe extension.
+usesafe=true
+: Define several unixisms.  These can be used in hint files.
 exe_ext='' 
 : Extra object files, if any, needed on this platform.
 archobjs=''
@@ -864,7 +875,7 @@ while test $# -gt 0; do
                esac
                shift
                ;;
-       -V) echo "$me generated by metaconfig 3.0 PL58." >&2
+       -V) echo "$me generated by metaconfig 3.0 PL60." >&2
                exit 0;;
        --) break;;
        -*) echo "$me: unknown option $1" >&2; shift; error=true;;
@@ -1002,7 +1013,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 (lwall@netlabs.com).
+and contact the author (doughera@lafcol.lafayette.edu).
 
 EOM
                echo $n "Continue? [n] $c" >&4
@@ -1080,10 +1091,10 @@ while expr "X\$ans" : "X!" >/dev/null; do
                        case "\$1" in
                        -d)
                                fastread=yes
-                               echo "(OK, I'll run with -d after this question.)"
+                               echo "(OK, I'll run with -d after this question.)" >&4
                                ;;
                        -*)
-                               echo "*** Sorry, \$1 not supported yet."
+                               echo "*** Sorry, \$1 not supported yet." >&4
                                ;;
                        esac
                        $myecho
@@ -1199,7 +1210,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 (lwall@netlabs.com) know how I blew it.
+have, let me (doughera@lafcol.lafayette.edu) know how I blew it.
 
 This installation script affects things in two ways:
 
@@ -1354,9 +1365,13 @@ cpp
 csh
 date
 egrep
+less
 line
+more
 nroff
 perl
+pg
+sendmail
 test
 uname
 "
@@ -1539,7 +1554,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 lwall@netlabs.com
+       : tests or hints, please send them to doughera@lafcol.lafayette.edu
        : The metaconfig authors would also appreciate a copy...
        $test -f /irix && osname=irix
        $test -f /xenix && osname=sco_xenix
@@ -2292,10 +2307,12 @@ echo " "
 echo "Getting the current patchlevel..." >&4
 if $test -r ../patchlevel.h;then
        patchlevel=`awk '/PATCHLEVEL/ {print $3}' < ../patchlevel.h`
+       subversion=`awk '/SUBVERSION/ {print $3}' < ../patchlevel.h`
 else
        patchlevel=0
+       subversion=0
 fi
-echo "(You have $package $baserev PL$patchlevel.)"
+echo "(You have $package $baserev PL$patchlevel sub$subversion.)"
 
 : set the prefixup variable, to restore leading tilda escape
 prefixup='case "$prefixexp" in
@@ -2314,7 +2331,8 @@ case "$archlib" in
                set dflt
                eval $prefixup
                ;;
-       *)      version=`echo $baserev $patchlevel | $awk '{print $1 + $2/1000.0}'`
+       *)      version=`echo $baserev $patchlevel $subversion | \
+                   $awk '{print $1 + $2/1000.0 + $3/100000.0}'`
                dflt="$privlib/$archname/$version"
                ;;
        esac
@@ -2360,6 +2378,216 @@ else
        d_archlib="$define"
 fi
 
+: set up the script used to warn in case of inconsistency
+cat <<'EOSC' >whoa
+dflt=y
+echo " "
+echo "*** WHOA THERE!!! ***" >&4
+echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
+rp="    Keep the $hint value?"
+. ./myread
+case "$ans" in
+y) td=$was; tu=$was;;
+esac
+EOSC
+
+: function used to set $1 to $val
+setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
+case "$val$was" in
+$define$undef) . ./whoa; eval "$var=\$td";;
+$undef$define) . ./whoa; eval "$var=\$tu";;
+*) eval "$var=$val";;
+esac'
+
+: make some quick guesses about what we are up against
+echo " "
+$echo $n "Hmm...  $c"
+echo exit 1 >bsd
+echo exit 1 >usg
+echo exit 1 >v7
+echo exit 1 >osf1
+echo exit 1 >eunice
+echo exit 1 >xenix
+echo exit 1 >venix
+d_bsd="$undef"
+$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
+if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
+then
+       echo "Looks kind of like an OSF/1 system, but we'll see..."
+       echo exit 0 >osf1
+elif test `echo abc | tr a-z A-Z` = Abc ; then
+       xxx=`./loc addbib blurfl $pth`
+       if $test -f $xxx; then
+       echo "Looks kind of like a USG system with BSD features, but we'll see..."
+               echo exit 0 >bsd
+               echo exit 0 >usg
+       else
+               if $contains SIGTSTP foo >/dev/null 2>&1 ; then
+                       echo "Looks kind of like an extended USG system, but we'll see..."
+               else
+                       echo "Looks kind of like a USG system, but we'll see..."
+               fi
+               echo exit 0 >usg
+       fi
+elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
+       echo "Looks kind of like a BSD system, but we'll see..."
+       d_bsd="$define"
+       echo exit 0 >bsd
+else
+       echo "Looks kind of like a Version 7 system, but we'll see..."
+       echo exit 0 >v7
+fi
+case "$eunicefix" in
+*unixtovms*)
+       $cat <<'EOI'
+There is, however, a strange, musty smell in the air that reminds me of
+something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
+EOI
+       echo exit 0 >eunice
+       d_eunice="$define"
+: it so happens the Eunice I know will not run shell scripts in Unix format
+       ;;
+*)
+       echo " "
+       echo "Congratulations.  You aren't running Eunice."
+       d_eunice="$undef"
+       ;;
+esac
+if test -f /xenix; then
+       echo "Actually, this looks more like a XENIX system..."
+       echo exit 0 >xenix
+       d_xenix="$define"
+else
+       echo " "
+       echo "It's not Xenix..."
+       d_xenix="$undef"
+fi
+chmod +x xenix
+$eunicefix xenix
+if test -f /venix; then
+       echo "Actually, this looks more like a VENIX system..."
+       echo exit 0 >venix
+else
+       echo " "
+       if ./xenix; then
+               : null
+       else
+               echo "Nor is it Venix..."
+       fi
+fi
+chmod +x bsd usg v7 osf1 eunice xenix venix
+$eunicefix bsd usg v7 osf1 eunice xenix venix
+$rm -f foo
+
+: see if setuid scripts can be secure
+$cat <<EOM
+
+Some kernels have a bug that prevents setuid #! scripts from being
+secure.  Some sites have disabled setuid #! scripts because of this.
+
+First let's decide if your kernel supports secure setuid #! scripts.
+(If setuid #! scripts would be secure but have been disabled anyway,
+don't say that they are secure if asked.)
+
+EOM
+
+val="$undef"
+if $test -d /dev/fd; then
+       echo "#!$ls" >reflect
+       chmod +x,u+s reflect
+       ./reflect >flect 2>&1
+       if $contains "/dev/fd" flect >/dev/null; then
+               echo "Congratulations, your kernel has secure setuid scripts!" >&4
+               val="$define"
+       else
+               $cat <<EOM
+If you are not sure if they are secure, I can check but I'll need a
+username and password different from the one you are using right now.
+If you don't have such a username or don't want me to test, simply
+enter 'none'.
+
+EOM
+               rp='Other username to test security of setuid scripts with?'
+               dflt='none'
+               . ./myread
+               case "$ans" in
+               n|none)
+                       case "$d_suidsafe" in
+                       '')     echo "I'll assume setuid scripts are *not* secure." >&4
+                               dflt=n;;
+                       "$undef")
+                               echo "Well, the $hint value is *not* secure." >&4
+                               dflt=n;;
+                       *)      echo "Well, the $hint value *is* secure." >&4
+                               dflt=y;;
+                       esac
+                       ;;
+               *)
+                       $rm -f reflect flect
+                       echo "#!$ls" >reflect
+                       chmod +x,u+s reflect
+                       echo >flect
+                       chmod a+w flect
+                       echo '"su" will (probably) prompt you for '"$ans's password."
+                       su $ans -c './reflect >flect'
+                       if $contains "/dev/fd" flect >/dev/null; then
+                               echo "Okay, it looks like setuid scripts are secure." >&4
+                               dflt=y
+                       else
+                               echo "I don't think setuid scripts are secure." >&4
+                               dflt=n
+                       fi
+                       ;;
+               esac
+               rp='Does your kernel have *secure* setuid scripts?'
+               . ./myread
+               case "$ans" in
+               [yY]*)  val="$define";;
+               *)      val="$undef";;
+               esac
+       fi
+else
+       echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
+       val="$undef"
+fi
+set d_suidsafe
+eval $setvar
+
+$rm -f reflect flect
+
+: now see if they want to do setuid emulation
+echo " "
+val="$undef"
+case "$d_suidsafe" in
+"$define")
+       val="$undef"
+       echo "No need to emulate SUID scripts since they are secure here." >& 4
+       ;;
+*)
+       $cat <<EOM
+Some systems have disabled setuid scripts, especially systems where
+setuid scripts cannot be secure.  On systems where setuid scripts have
+been disabled, the setuid/setgid bits on scripts are currently
+useless.  It is possible for $package to detect those bits and emulate
+setuid/setgid in a secure fashion.  This emulation will only work if
+setuid scripts have been disabled in your kernel.
+
+EOM
+       case "$d_dosuid" in
+       "$define") dflt=y ;;
+       *) dflt=n ;;
+       esac
+       rp="Do you want to do setuid/setgid emulation?"
+       . ./myread
+       case "$ans" in
+       [yY]*)  val="$define";;
+       *)      val="$undef";;
+       esac
+       ;;
+esac
+set d_dosuid
+eval $setvar
+
 : determine where site specific libraries go.
 set sitelib sitelib
 eval $prefixit
@@ -2446,27 +2674,6 @@ else
        installsitearch="$sitearchexp"
 fi
 
-: set up the script used to warn in case of inconsistency
-cat <<'EOSC' >whoa
-dflt=y
-echo " "
-echo "*** WHOA THERE!!! ***" >&4
-echo "    The $hint value for \$$var on this machine was \"$was\"!" >&4
-rp="    Keep the $hint value?"
-. ./myread
-case "$ans" in
-y) td=$was; tu=$was;;
-esac
-EOSC
-
-: function used to set $1 to $val
-setvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
-case "$val$was" in
-$define$undef) . ./whoa; eval "$var=\$td";;
-$undef$define) . ./whoa; eval "$var=\$tu";;
-*) eval "$var=$val";;
-esac'
-
 : determine where old public architecture dependent libraries might be
 case "$oldarchlib" in
 '')    case "$privlib" in
@@ -2483,7 +2690,7 @@ if $test ! -d "$dflt/auto"; then
 fi
 cat <<EOM
 
-In 5.001, Perl stored architecutre-dependent library files in a library
+In 5.001, Perl stored architecture-dependent library files in a library
 with a name such as $privlib/$archname, 
 and this directory contained files from the standard extensions and 
 files from any additional extensions you might have added.  Starting 
@@ -2542,6 +2749,24 @@ else
        installbin="$binexp"
 fi
 
+: determine where manual pages are on this system
+echo " "
+case "$sysman" in
+'') 
+       syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
+       syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
+       syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+       syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+       syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+       sysman=`./loc . /usr/man/man1 $syspath`
+       ;;
+esac
+if $test -d "$sysman"; then
+       echo "System manual is in $sysman." >&4
+else
+       echo "Could not find manual pages in source form." >&4
+fi
+
 : determine where manual pages go
 set man1dir man1dir none
 eval $prefixit
@@ -2558,33 +2783,28 @@ nroff)
 esac
 echo "If you don't want the manual sources installed, answer 'none'."
 case "$man1dir" in
+' ') dflt=none
+       ;;
 '')
        lookpath="$prefixexp/man/man1 $prefixexp/man/l_man/man1"
        lookpath="$lookpath $prefixexp/man/p_man/man1"
        lookpath="$lookpath $prefixexp/man/u_man/man1"
+       lookpath="$lookpath $prefixexp/man/man.1"
        : If prefix contains 'perl' then we want to keep the man pages
        : under the prefix directory.  Otherwise, look in a variety of
        : other possible places.  This is debatable, but probably a
-       : good compromise.
-       case "$prefix" in
-       *perl*) ;;
-       *)      lookpath="$lookpath /usr/local/man/man1"
-               lookpath="$lookpath /opt/local/man/man1"
-               lookpath="$lookpath /usr/local/man/man.1"
-               lookpath="$lookpath /opt/local/man/man.1"
-               lookpath="$lookpath /usr/man/local/man1"
-               lookpath="$lookpath /usr/man/l_man/man1"
-               lookpath="$lookpath /usr/man/p_man/man1"
-               lookpath="$lookpath /usr/man/u_man/man1"
-               lookpath="$lookpath /usr/man/man.L"
-               lookpath="$lookpath /usr/man/man.l"
-               ;;
+       : good compromise.  Well, apparently not.
+       : Experience has shown people expect man1dir to be under prefix,
+       : so we now always put it there.  Users who want other behavior
+       : can answer interactively or use a command line option.
+       : Does user have System V-style man paths.
+       case "$sysman" in
+       */?_man*)       dflt=`./loc . $prefixexp/l_man/man1 $lookpath` ;;
+       *)      dflt=`./loc . $prefixexp/man/man1 $lookpath` ;;
        esac
-       dflt=`./loc . $prefixexp/man/man1 $lookpath`
        set dflt
        eval $prefixup
        ;;
-' ') dflt=none;;
 *)  dflt="$man1dir"
        ;;
 esac
@@ -2629,18 +2849,22 @@ case "$man1dir" in
        ;;
 *)
        rp="What suffix should be used for the main $spackage man pages?"
-       case "$man1dir" in
-       *1)  dflt=1 ;;
-       *1p) dflt=1p ;;
-       *1pm) dflt=1pm ;;
-       *l) dflt=l;;
-       *n) dflt=n;;
-       *o) dflt=o;;
-       *p) dflt=p;;
-       *C) dflt=C;;
-       *L) dflt=L;;
-       *L1) dflt=L1;;
-       *) dflt=1;;
+       case "$man1ext" in
+       '')     case "$man1dir" in
+               *1)  dflt=1 ;;
+               *1p) dflt=1p ;;
+               *1pm) dflt=1pm ;;
+               *l) dflt=l;;
+               *n) dflt=n;;
+               *o) dflt=o;;
+               *p) dflt=p;;
+               *C) dflt=C;;
+               *L) dflt=L;;
+               *L1) dflt=L1;;
+               *) dflt=1;;
+               esac
+               ;;
+       *)      dflt="$man1ext";;
        esac
        . ./myread
        man1ext="$ans"
@@ -2728,7 +2952,8 @@ echo "If you don't want the manual sources installed, answer 'none'."
 : However, something like /opt/perl/man/man3 is fine.
 case "$man3dir" in
 '')    case "$prefix" in 
-       *perl*) dflt=`echo $man1dir | $sed 's/man1/man3/g'` ;;
+       *perl*) dflt=`echo $man1dir | 
+                       $sed -e 's/man1/man3/g' -e 's/man\.1/man\.3/g'` ;;
        *)      dflt="$privlib/man/man3" ;;
        esac
        ;;
@@ -2778,128 +3003,27 @@ case "$man3dir" in
        ;;
 *)
        rp="What suffix should be used for the $spackage library man pages?"
-       case "$man3dir" in
-       *3)  dflt=3 ;;
-       *3p) dflt=3p ;;
-       *3pm) dflt=3pm ;;
-       *l) dflt=l;;
-       *n) dflt=n;;
-       *o) dflt=o;;
-       *p) dflt=p;;
-       *C) dflt=C;;
-       *L) dflt=L;;
-       *L3) dflt=L3;;
-       *) dflt=3;;
-       esac
-       . ./myread
-       man3ext="$ans"
-       ;;
-esac
-
-: determine where public executable scripts go
-set scriptdir scriptdir
-eval $prefixit
-case "$scriptdir" in
-'')
-       dflt="$bin"
-       : guess some guesses
-       $test -d /usr/share/scripts && dflt=/usr/share/scripts
-       $test -d /usr/share/bin && dflt=/usr/share/bin
-       $test -d /usr/local/script && dflt=/usr/local/script
-       $test -d $prefixexp/script && dflt=$prefixexp/script
-       set dflt
-       eval $prefixup
-       ;;
-*)  dflt="$scriptdir"
-       ;;
-esac
-$cat <<EOM
-Some installations have a separate directory just for executable scripts so
-that they can mount it across multiple architectures but keep the scripts in
-one spot.  You might, for example, have a subdirectory of /usr/share for this.
-Or you might just lump your scripts in with all your other executables.
-EOM
-fn=d~
-rp='Where do you keep publicly executable scripts?'
-. ./getfile
-if $test "X$ansexp" != "X$scriptdirexp"; then
-       installscript=''
-fi
-scriptdir="$ans"
-scriptdirexp="$ansexp"
-if $afs; then
-       $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-scripts 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 "$installscript" in
-       '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
-       *) dflt="$installscript";;
-       esac
-       fn=de~
-       rp='Where will public scripts be installed?'
-       . ./getfile
-       installscript="$ans"
-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";;
+       case "$man3ext" in
+       '')     case "$man3dir" in
+               *3)  dflt=3 ;;
+               *3p) dflt=3p ;;
+               *3pm) dflt=3pm ;;
+               *l) dflt=l;;
+               *n) dflt=n;;
+               *o) dflt=o;;
+               *p) dflt=p;;
+               *C) dflt=C;;
+               *L) dflt=L;;
+               *L3) dflt=L3;;
+               *) dflt=3;;
                esac
                ;;
-       *) startperl=": # use perl"
-               ;;
+       *)      dflt="$man3ext";;
        esac
+       . ./myread
+       man3ext="$ans"
        ;;
 esac
-echo "I'll use $startperl to start perl scripts."
-
-: determine where manual pages are on this system
-echo " "
-case "$sysman" in
-'') 
-       syspath='/usr/man/man1 /usr/man/mann /usr/man/manl /usr/man/local/man1'
-       syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
-       syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
-       syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
-       syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
-       sysman=`./loc . /usr/man/man1 $syspath`
-       ;;
-esac
-if $test -d "$sysman"; then
-       echo "System manual is in $sysman." >&4
-else
-       echo "Could not find manual pages in source form." >&4
-fi
 
 : see what memory models we can support
 case "$models" in
@@ -3044,86 +3168,6 @@ none)
        ;;
 esac
 
-: make some quick guesses about what we are up against
-echo " "
-$echo $n "Hmm...  $c"
-echo exit 1 >bsd
-echo exit 1 >usg
-echo exit 1 >v7
-echo exit 1 >osf1
-echo exit 1 >eunice
-echo exit 1 >xenix
-echo exit 1 >venix
-d_bsd="$undef"
-$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
-if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
-then
-       echo "Looks kind of like an OSF/1 system, but we'll see..."
-       echo exit 0 >osf1
-elif test `echo abc | tr a-z A-Z` = Abc ; then
-       xxx=`./loc addbib blurfl $pth`
-       if $test -f $xxx; then
-       echo "Looks kind of like a USG system with BSD features, but we'll see..."
-               echo exit 0 >bsd
-               echo exit 0 >usg
-       else
-               if $contains SIGTSTP foo >/dev/null 2>&1 ; then
-                       echo "Looks kind of like an extended USG system, but we'll see..."
-               else
-                       echo "Looks kind of like a USG system, but we'll see..."
-               fi
-               echo exit 0 >usg
-       fi
-elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
-       echo "Looks kind of like a BSD system, but we'll see..."
-       d_bsd="$define"
-       echo exit 0 >bsd
-else
-       echo "Looks kind of like a Version 7 system, but we'll see..."
-       echo exit 0 >v7
-fi
-case "$eunicefix" in
-*unixtovms*)
-       $cat <<'EOI'
-There is, however, a strange, musty smell in the air that reminds me of
-something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
-EOI
-       echo exit 0 >eunice
-       d_eunice="$define"
-: it so happens the Eunice I know will not run shell scripts in Unix format
-       ;;
-*)
-       echo " "
-       echo "Congratulations.  You aren't running Eunice."
-       d_eunice="$undef"
-       ;;
-esac
-if test -f /xenix; then
-       echo "Actually, this looks more like a XENIX system..."
-       echo exit 0 >xenix
-       d_xenix="$define"
-else
-       echo " "
-       echo "It's not Xenix..."
-       d_xenix="$undef"
-fi
-chmod +x xenix
-$eunicefix xenix
-if test -f /venix; then
-       echo "Actually, this looks more like a VENIX system..."
-       echo exit 0 >venix
-else
-       echo " "
-       if ./xenix; then
-               : null
-       else
-               echo "Nor is it Venix..."
-       fi
-fi
-chmod +x bsd usg v7 osf1 eunice xenix venix
-$eunicefix bsd usg v7 osf1 eunice xenix venix
-$rm -f foo
-
 : see if we need a special compiler
 echo " "
 if ./usg; then
@@ -3154,100 +3198,472 @@ memory model to use!) If you have the Gnu C compiler, you might wish to use
 that instead.
 
 EOM
-       rp="What command will force resolution on this system?"
-       . ./myread
-       cc="$ans"
-else
-       case "$cc" in
-       '') dflt=cc;;
-       *) dflt="$cc";;
-       esac
-       rp="Use which C compiler?"
-       . ./myread
-       cc="$ans"
+       rp="What command will force resolution on this system?"
+       . ./myread
+       cc="$ans"
+else
+       case "$cc" in
+       '') dflt=cc;;
+       *) dflt="$cc";;
+       esac
+       rp="Use which C compiler?"
+       . ./myread
+       cc="$ans"
+fi
+echo " "
+echo "Checking for GNU cc in disguise and/or its version number..." >&4
+$cat >gccvers.c <<EOM
+#include <stdio.h>
+int main() {
+#ifdef __GNUC__
+#ifdef __VERSION__
+       printf("%s\n", __VERSION__);
+#else
+       printf("%s\n", "1");
+#endif
+#endif
+       exit(0);
+}
+EOM
+if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
+       gccversion=`./gccvers`
+       case "$gccversion" in
+       '') echo "You are not using GNU cc." ;;
+       *)  echo "You are using GNU cc $gccversion." ;;
+       esac
+else
+       echo " "
+       echo "*** WHOA THERE!!! ***" >&4
+       echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
+       case "$knowitall" in
+       '')
+       echo "    You'd better start hunting for one and let me know about it." >&4
+               exit 1
+               ;;
+       esac
+fi
+$rm -f gccvers*
+case "$gccversion" in
+1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
+esac
+
+: What should the include directory be ?
+echo " "
+$echo $n "Hmm...  $c"
+dflt='/usr/include'
+incpath=''
+mips_type=''
+if $test -f /bin/mips && /bin/mips; then
+       echo "Looks like a MIPS system..."
+       $cat >usr.c <<'EOCP'
+#ifdef SYSTYPE_BSD43
+/bsd43
+#endif
+EOCP
+       if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
+               dflt='/bsd43/usr/include'
+               incpath='/bsd43'
+               mips_type='BSD 4.3'
+       else
+               mips_type='System V'
+       fi
+       $rm -f usr.c usr.out
+       echo "and you're compiling with the $mips_type compiler and libraries."
+       xxx_prompt=y
+       echo "exit 0" >mips
+else
+       echo "Doesn't look like a MIPS system."
+       xxx_prompt=n
+       echo "exit 1" >mips
+fi
+chmod +x mips
+$eunicefix mips
+echo " "
+case "$usrinc" in
+'') ;;
+*) dflt="$usrinc";;
+esac
+case "$xxx_prompt" in
+y)     fn=d/
+       rp='Where are the include files you want to use?'
+       . ./getfile
+       usrinc="$ans"
+       ;;
+*)     usrinc="$dflt"
+       ;;
+esac
+
+: see if we have to deal with yellow pages, now NIS.
+if $test -d /usr/etc/yp || $test -d /etc/yp; then
+       if $test -f /usr/etc/nibindd; then
+               echo " "
+               echo "I'm fairly confident you're on a NeXT."
+               echo " "
+               rp='Do you get the hosts file via NetInfo?'
+               dflt=y
+               case "$hostcat" in
+               nidump*) ;;
+               '') ;;
+               *) dflt=n;;
+               esac
+               . ./myread
+               case "$ans" in
+               y*) hostcat='nidump hosts .';;
+               *)      case "$hostcat" in
+                       nidump*) hostcat='';;
+                       esac
+                       ;;
+               esac
+       fi
+       case "$hostcat" in
+       nidump*) ;;
+       *)
+               case "$hostcat" in
+               *ypcat*) dflt=y;;
+               '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
+                               dflt=y
+                       else
+                               dflt=n
+                       fi;;
+               *) dflt=n;;
+               esac
+               echo " "
+               rp='Are you getting the hosts file via yellow pages?'
+               . ./myread
+               case "$ans" in
+               y*) hostcat='ypcat hosts';;
+               *) hostcat='cat /etc/hosts';;
+               esac
+               ;;
+       esac
+fi
+
+: now get the host name
+echo " "
+echo "Figuring out host name..." >&4
+case "$myhostname" in
+'') cont=true
+       echo 'Maybe "hostname" will work...'
+       if tans=`sh -c hostname 2>&1` ; then
+               myhostname=$tans
+               phostname=hostname
+               cont=''
+       fi
+       ;;
+*) cont='';;
+esac
+if $test "$cont"; then
+       if ./xenix; then
+               echo 'Oh, dear.  Maybe "/etc/systemid" is the key...'
+               if tans=`cat /etc/systemid 2>&1` ; then
+                       myhostname=$tans
+                       phostname='cat /etc/systemid'
+                       echo "Whadyaknow.  Xenix always was a bit strange..."
+                       cont=''
+               fi
+       elif $test -r /etc/systemid; then
+               echo "(What is a non-Xenix system doing with /etc/systemid?)"
+       fi
+fi
+if $test "$cont"; then
+       echo 'No, maybe "uuname -l" will work...'
+       if tans=`sh -c 'uuname -l' 2>&1` ; then
+               myhostname=$tans
+               phostname='uuname -l'
+       else
+               echo 'Strange.  Maybe "uname -n" will work...'
+               if tans=`sh -c 'uname -n' 2>&1` ; then
+                       myhostname=$tans
+                       phostname='uname -n'
+               else
+                       echo 'Oh well, maybe I can mine it out of whoami.h...'
+                       if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
+                               myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
+                               phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
+                       else
+                               case "$myhostname" in
+                               '') echo "Does this machine have an identity crisis or something?"
+                                       phostname='';;
+                               *)
+                                       echo "Well, you said $myhostname before..."
+                                       phostname='echo $myhostname';;
+                               esac
+                       fi
+               fi
+       fi
+fi
+: you do not want to know about this
+set $myhostname
+myhostname=$1
+
+: verify guess
+if $test "$myhostname" ; then
+       dflt=y
+       rp='Your host name appears to be "'$myhostname'".'" Right?"
+       . ./myread
+       case "$ans" in
+       y*) ;;
+       *) myhostname='';;
+       esac
+fi
+
+: bad guess or no guess
+while $test "X$myhostname" = X ; do
+       dflt=''
+       rp="Please type the (one word) name of your host:"
+       . ./myread
+       myhostname="$ans"
+done
+
+: translate upper to lower if necessary
+case "$myhostname" in
+*[A-Z]*)
+       echo "(Normalizing case in your host name)"
+       myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
+       ;;
+esac
+
+case "$myhostname" in
+*.*)
+       dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
+       myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
+       echo "(Trimming domain name from host name--host name is now $myhostname)"
+       ;;
+*) case "$mydomain" in
+       '')
+               {
+                       : If we use NIS, try ypmatch.
+                       : Is there some reason why this was not done before?
+                       test "X$hostcat" = "Xypcat hosts" &&
+                       ypmatch "$myhostname" hosts 2>/dev/null |\
+                               $sed -e 's/[     ]*#.*//; s/$/ /' > hosts && \
+                       $test -s hosts
+               } || {
+                       : Extract only the relevant hosts, reducing file size,
+                       : remove comments, insert trailing space for later use.
+                       $hostcat | $sed -n -e "s/[       ]*#.*//; s/\$/ /
+                                       /[       ]$myhostname[  . ]/p" > hosts
+               }
+               tmp_re="[       . ]"
+               $test x`$awk "/[0-9].*[  ]$myhostname$tmp_re/ { sum++ }
+                            END { print sum }" hosts` = x1 || tmp_re="[         ]"
+               dflt=.`$awk "/[0-9].*[   ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
+                       hosts | $sort | $uniq | \
+                       $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
+               case `$echo X$dflt` in
+               X*\ *)  echo "(Several hosts in /etc/hosts matched hostname)"
+                       dflt=.
+                       ;;
+               .) echo "(You do not have fully-qualified names in /etc/hosts)"
+                       ;;
+               esac
+               case "$dflt" in
+               .)
+                       tans=`./loc resolv.conf X /etc /usr/etc`
+                       if $test -f "$tans"; then
+                               echo "(Attempting domain name extraction from $tans)"
+                               : Why was there an Egrep here, when Sed works?
+                               dflt=.`$sed -n -e 's/^domain[   ]*\(.*\)/\1/p' $tans \
+                                       | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
+                       fi
+                       ;;
+               esac
+               case "$dflt" in
+               .) echo "(No help from resolv.conf either -- attempting clever guess)"
+                       dflt=.`sh -c domainname 2>/dev/null`
+                       case "$dflt" in
+                       '') dflt='.';;
+                       .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
+                       esac
+                       ;;
+               esac
+               case "$dflt" in
+               .) echo "(Lost all hope -- silly guess then)"
+                       dflt='.uucp'
+                       ;;
+               esac
+               $rm -f hosts
+               ;;
+       *) dflt="$mydomain";;
+       esac;;
+esac
+echo " "
+rp="What is your domain name?"
+. ./myread
+tans="$ans"
+case "$ans" in
+'') ;;
+.*) ;;
+*) tans=".$tans";;
+esac
+mydomain="$tans"
+
+: translate upper to lower if necessary
+case "$mydomain" in
+*[A-Z]*)
+       echo "(Normalizing case in your domain name)"
+       mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
+       ;;
+esac
+
+: a little sanity check here
+case "$phostname" in
+'') ;;
+*)
+       case `$phostname | ./tr '[A-Z]' '[a-z]'` in
+       $myhostname$mydomain|$myhostname) ;;
+       *)
+               case "$phostname" in
+               sed*)
+                       echo "(That doesn't agree with your whoami.h file, by the way.)"
+                       ;;
+               *)
+                       echo "(That doesn't agree with your $phostname command, by the way.)"
+                       ;;
+               esac
+       ;;
+       esac
+       ;;
+esac
+
+$cat <<EOM
+
+I need to get your e-mail address in Internet format if possible, i.e.
+something like user@host.domain. Please answer accurately since I have
+no easy means to double check it. The default value provided below
+is most probably close to the reality but may not be valid from outside
+your organization...
+
+EOM
+cont=x
+while test "$cont"; do
+       case "$cf_email" in
+       '') dflt="$cf_by@$myhostname$mydomain";;
+       *) dflt="$cf_email";;
+       esac
+       rp='What is your e-mail address?'
+       . ./myread
+       cf_email="$ans"
+       case "$cf_email" in
+       *@*.*) cont='' ;;
+       *)
+               rp='Address does not look like an Internet one.  Use it anyway?'
+               case "$fastread" in
+               yes) dflt=y ;;
+               *) dflt=n ;;
+               esac
+               . ./myread
+               case "$ans" in
+               y*) cont='' ;;
+               *) echo " " ;;
+               esac
+               ;;
+       esac
+done
+
+$cat <<EOM
+
+If you or somebody else will be maintaining perl at your site, please
+fill in the correct e-mail address here so that they may be contacted
+if necessary. Currently, the "perlbug" program included with perl
+will send mail to this address in addition to perlbug@perl.com. You may
+enter "none" for no administrator.
+
+EOM
+case "$perladmin" in
+'') dflt="$cf_email";;
+*) dflt="$perladmin";;
+esac
+rp='Perl administrator e-mail address'
+. ./myread
+perladmin="$ans"
+
+: determine where public executable scripts go
+set scriptdir scriptdir
+eval $prefixit
+case "$scriptdir" in
+'')
+       dflt="$bin"
+       : guess some guesses
+       $test -d /usr/share/scripts && dflt=/usr/share/scripts
+       $test -d /usr/share/bin && dflt=/usr/share/bin
+       $test -d /usr/local/script && dflt=/usr/local/script
+       $test -d $prefixexp/script && dflt=$prefixexp/script
+       set dflt
+       eval $prefixup
+       ;;
+*)  dflt="$scriptdir"
+       ;;
+esac
+$cat <<EOM
+Some installations have a separate directory just for executable scripts so
+that they can mount it across multiple architectures but keep the scripts in
+one spot.  You might, for example, have a subdirectory of /usr/share for this.
+Or you might just lump your scripts in with all your other executables.
+EOM
+fn=d~
+rp='Where do you keep publicly executable scripts?'
+. ./getfile
+if $test "X$ansexp" != "X$scriptdirexp"; then
+       installscript=''
 fi
-echo " "
-echo "Checking for GNU cc in disguise and/or its version number..." >&4
-$cat >gccvers.c <<EOM
-#include <stdio.h>
-int main() {
-#ifdef __GNUC__
-#ifdef __VERSION__
-       printf("%s\n", __VERSION__);
-#else
-       printf("%s\n", "1");
-#endif
-#endif
-       exit(0);
-}
+scriptdir="$ans"
+scriptdirexp="$ansexp"
+if $afs; then
+       $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+scripts reside from the directory in which they are installed (and from
+which they are presumably copied to the former directory by occult means).
+
 EOM
-if $cc -o gccvers gccvers.c >/dev/null 2>&1; then
-       gccversion=`./gccvers`
-       case "$gccversion" in
-       '') echo "You are not using GNU cc." ;;
-       *)  echo "You are using GNU cc $gccversion." ;;
+       case "$installscript" in
+       '') dflt=`echo $scriptdirexp | sed 's#^/afs/#/afs/.#'`;;
+       *) dflt="$installscript";;
        esac
+       fn=de~
+       rp='Where will public scripts be installed?'
+       . ./getfile
+       installscript="$ans"
 else
-       echo " "
-       echo "*** WHOA THERE!!! ***" >&4
-       echo "    Your C compiler \"$cc\" doesn't seem to be working!" >&4
-       case "$knowitall" in
-       '')
-       echo "    You'd better start hunting for one and let me know about it." >&4
-               exit 1
-               ;;
-       esac
+       installscript="$scriptdirexp"
 fi
-$rm -f gccvers*
-case "$gccversion" in
-1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
-esac
 
-: What should the include directory be ?
-echo " "
-$echo $n "Hmm...  $c"
-dflt='/usr/include'
-incpath=''
-mips_type=''
-if $test -f /bin/mips && /bin/mips; then
-       echo "Looks like a MIPS system..."
-       $cat >usr.c <<'EOCP'
-#ifdef SYSTYPE_BSD43
-/bsd43
-#endif
-EOCP
-       if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
-               dflt='/bsd43/usr/include'
-               incpath='/bsd43'
-               mips_type='BSD 4.3'
-       else
-               mips_type='System V'
-       fi
-       $rm -f usr.c usr.out
-       echo "and you're compiling with the $mips_type compiler and libraries."
-       xxx_prompt=y
-       echo "exit 0" >mips
-else
-       echo "Doesn't look like a MIPS system."
-       xxx_prompt=n
-       echo "exit 1" >mips
-fi
-chmod +x mips
-$eunicefix mips
-echo " "
-case "$usrinc" in
-'') ;;
-*) dflt="$usrinc";;
+: determine perl absolute location
+case "$perlpath" in
+'')    perlpath=$binexp/perl ;;
 esac
-case "$xxx_prompt" in
-y)     fn=d/
-       rp='Where are the include files you want to use?'
-       . ./getfile
-       usrinc="$ans"
-       ;;
-*)     usrinc="$dflt"
+
+: 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."
 
 : see how we invoke the C preprocessor
 echo " "
@@ -3861,6 +4277,19 @@ case "$nm_opt" in
        fi;;
 esac
 
+: nm options which may be necessary for shared libraries but illegal
+: for archive libraries.  Thank you, Linux.
+case "$nm_so_opt" in
+'')    case "$myuname" in
+       *linux*)
+               if nm --help | $grep 'dynamic' > /dev/null 2>&1; then
+                       nm_so_opt='--dynamic'
+               fi
+               ;;
+       esac
+       ;;
+esac
+
 case "$runnm" in
 true)
 : get list of predefined functions in a handy place
@@ -3907,22 +4336,24 @@ esac
 xxx=normal
 case "$libc" in
 unknown)
-       set /usr/ccs/lib/libc.$so
-       $test -r $1 || set /usr/lib/libc.$so
-       $test -r $1 || set /usr/shlib/libc.$so
-       $test -r $1 || \
-               set `echo blurfl; echo /usr/lib/libc.$so.[0-9]* | \
-               tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
-                       h
-                       s/[0-9][0-9]*/0000&/g
-                       s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
-                       G
-                       s/\n/ /' | \
-                sort | $sed -e 's/^.* //'`
-       eval set \$$#
-       $test -r $1 || set /lib/libc.$so
-       $test -r $1 || set /lib/libsys_s.a
-       ;;
+       set /lib/libc.$so
+       for xxx in $libpth; do
+               $test -r $1 || set $xxx/libc.$so
+               : The messy sed command sorts on library version numbers.
+               $test -r $1 || \
+                       set `echo blurfl; echo $xxx/libc.$so.[0-9]* | \
+                               tr ' ' '\012' | egrep -v '\.[A-Za-z]*$' | $sed -e '
+                               h
+                               s/[0-9][0-9]*/0000&/g
+                               s/0*\([0-9][0-9][0-9][0-9][0-9]\)/\1/g
+                               G
+                               s/\n/ /' | \
+                       sort | $sed -e 's/^.* //'`
+               eval set \$$#
+       done
+       $test -r $1 || set /usr/ccs/lib/libc.$so
+       $test -r $1 || set /lib/libsys_s.a
+       ;;
 *)
        set blurfl
        ;;
@@ -4006,7 +4437,16 @@ $sed 's/^/       /' libnames >&4
 echo " "
 $echo $n "This may take a while...$c" >&4
 
-nm $nm_opt $* 2>/dev/null >libc.tmp
+: Linux may need the special Dynamic option to nm for shared libraries.
+: In general, this is stored in the nm_so_opt variable.
+: Unfortunately, that option may be fatal on non-shared libraries.
+for nm_libs_ext in $*; do
+    case $nm_libs_ext in
+       *$so*)  nm $nm_so_opt $nm_opt $nm_libs_ext 2>/dev/null ;;
+       *)              nm $nm_opt $nm_libs_ext 2>/dev/null ;;
+       esac
+done > libc.tmp
+
 $echo $n ".$c"
 $grep fprintf libc.tmp > libc.ptf
 xscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
@@ -5209,133 +5649,24 @@ EOM
                $ld $lddlflags -o dyna.$dlext dyna.o > /dev/null 2>&1 && 
                $cc $ccflags $ldflags $cccdlflags $ccdlflags fred.c -o fred $libs > /dev/null 2>&1; then
                xxx=`./fred`
-               case $xxx in
-               1)      echo "Test program failed using dlopen." >&4
-                       echo "Perhaps you should not use dynamic loading." >&4;;
-               2)      echo "Test program failed using dlsym." >&4
-                       echo "Perhaps you should not use dynamic loading." >&4;;
-               3)      echo "dlsym needs a leading underscore" >&4
-                       val="$define" ;;
-               4)      echo "dlsym doesn't need a leading underscore." >&4;;
-               esac
-       else
-               echo "I can't compile and run the test program." >&4
-       fi
-       ;;
-esac
-               
-$rm -f fred fred.? dyna.$dlext dyna.?
-
-set d_dlsymun
-eval $setvar
-
-: see if setuid scripts can be secure
-$cat <<EOM
-
-Some kernels have a bug that prevents setuid #! scripts from being
-secure.  Some sites have disabled setuid #! scripts because of this.
-
-First let's decide if your kernel supports secure setuid #! scripts.
-(If setuid #! scripts would be secure but have been disabled anyway,
-don't say that they are secure if asked.)
-
-EOM
-
-val="$undef"
-if $test -d /dev/fd; then
-       echo "#!$ls" >reflect
-       chmod +x,u+s reflect
-       ./reflect >flect 2>&1
-       if $contains "/dev/fd" flect >/dev/null; then
-               echo "Congratulations, your kernel has secure setuid scripts!" >&4
-               val="$define"
-       else
-               $cat <<EOM
-If you are not sure if they are secure, I can check but I'll need a
-username and password different from the one you are using right now.
-If you don't have such a username or don't want me to test, simply
-enter 'none'.
-
-EOM
-               rp='Other username to test security of setuid scripts with?'
-               dflt='none'
-               . ./myread
-               case "$ans" in
-               n|none)
-                       case "$d_suidsafe" in
-                       '')     echo "I'll assume setuid scripts are *not* secure." >&4
-                               dflt=n;;
-                       "$undef")
-                               echo "Well, the $hint value is *not* secure." >&4
-                               dflt=n;;
-                       *)      echo "Well, the $hint value *is* secure." >&4
-                               dflt=y;;
-                       esac
-                       ;;
-               *)
-                       $rm -f reflect flect
-                       echo "#!$ls" >reflect
-                       chmod +x,u+s reflect
-                       echo >flect
-                       chmod a+w flect
-                       echo '"su" will (probably) prompt you for '"$ans's password."
-                       su $ans -c './reflect >flect'
-                       if $contains "/dev/fd" flect >/dev/null; then
-                               echo "Okay, it looks like setuid scripts are secure." >&4
-                               dflt=y
-                       else
-                               echo "I don't think setuid scripts are secure." >&4
-                               dflt=n
-                       fi
-                       ;;
-               esac
-               rp='Does your kernel have *secure* setuid scripts?'
-               . ./myread
-               case "$ans" in
-               [yY]*)  val="$define";;
-               *)      val="$undef";;
+               case $xxx in
+               1)      echo "Test program failed using dlopen." >&4
+                       echo "Perhaps you should not use dynamic loading." >&4;;
+               2)      echo "Test program failed using dlsym." >&4
+                       echo "Perhaps you should not use dynamic loading." >&4;;
+               3)      echo "dlsym needs a leading underscore" >&4
+                       val="$define" ;;
+               4)      echo "dlsym doesn't need a leading underscore." >&4;;
                esac
+       else
+               echo "I can't compile and run the test program." >&4
        fi
-else
-       echo "I don't think setuid scripts are secure (no /dev/fd directory)." >&4
-       val="$undef"
-fi
-set d_suidsafe
-eval $setvar
-
-$rm -f reflect flect
-
-: now see if they want to do setuid emulation
-echo " "
-val="$undef"
-case "$d_suidsafe" in
-"$define")
-       val="$undef"
-       echo "No need to emulate SUID scripts since they are secure here." >& 4
-       ;;
-*)
-       $cat <<EOM
-Some systems have disabled setuid scripts, especially systems where
-setuid scripts cannot be secure.  On systems where setuid scripts have
-been disabled, the setuid/setgid bits on scripts are currently
-useless.  It is possible for $package to detect those bits and emulate
-setuid/setgid in a secure fashion.  This emulation will only work if
-setuid scripts have been disabled in your kernel.
-
-EOM
-       case "$d_dosuid" in
-       "$define") dflt=y ;;
-       *) dflt=n ;;
-       esac
-       rp="Do you want to do setuid/setgid emulation?"
-       . ./myread
-       case "$ans" in
-       [yY]*)  val="$define";;
-       *)      val="$undef";;
-       esac
        ;;
 esac
-set d_dosuid
+               
+$rm -f fred fred.? dyna.$dlext dyna.?
+
+set d_dlsymun
 eval $setvar
 
 : see if dup2 exists
@@ -5503,7 +5834,8 @@ main()
 }
 EOCP
        if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
-               echo "./try >try.out 2>try.ret 3>try.err || exit 4" >mtry
+               echo "$startsh" >mtry
+               echo "./try >try.out 2>try.ret 3>try.err || exit 4" >>mtry
                chmod +x mtry
                ./mtry >/dev/null 2>&1
                case $? in
@@ -6270,6 +6602,72 @@ fi
 set d_shm
 eval $setvar
 
+: see if sigvector exists -- since sigvec will match the substring
+echo " "
+if set sigvector val -f d_sigvectr; eval $csym; $val; then
+       echo 'sigvector() found--you must be running HP-UX.' >&4
+       val="$define"; set d_sigvectr; eval $setvar
+       val="$define"; set d_sigvec; eval $setvar
+else
+: try the original name
+       d_sigvectr="$undef"
+       if set sigvec val -f d_sigvec; eval $csym; $val; then
+               echo 'sigvec() found.' >&4
+               val="$define"; set d_sigvec; eval $setvar
+       else
+               echo 'sigvec() not found--race conditions with signals may occur.' >&4
+               val="$undef"; set d_sigvec; eval $setvar
+       fi
+fi
+
+: see if we have sigaction
+set sigaction d_sigaction
+eval $inlibc
+
+
+: see if sigsetjmp exists
+echo " "
+case "$d_sigsetjmp" in
+'')
+       $cat >set.c <<EOP
+#include <setjmp.h>
+sigjmp_buf env;
+int set = 1;
+main()
+{
+       if (sigsetjmp(env,1))
+               exit(set);
+       set = 0;
+       siglongjmp(env, 1);
+       exit(1);
+}
+EOP
+       if $cc $ccflags $ldflags set.c -o set $libs >/dev/null 2>&1; then
+               if ./set >/dev/null 2>&1; then
+                       echo "POSIX sigsetjmp found." >&4
+                       val="$define"
+               else
+                       $cat <<EOM
+Uh-Oh! You have POSIX sigsetjmp and siglongjmp, but they do not work properly!!
+EOM
+                       val="$undef"
+               fi
+       else
+               echo "Sigsetjmp not found." >&4
+               val="$undef"
+       fi
+       ;;
+*) val="$d_sigsetjmp"
+       case "$d_sigsetjmp" in
+       $define) echo "POSIX sigsetjmp found." >&4;;
+       $undef) echo "Sigsetjmp not found." >&4;;
+       esac
+       ;;
+esac
+set d_sigsetjmp
+eval $setvar
+$rm -f set.c set
+
 socketlib=''
 sockethdr=''
 : see whether socket exists
@@ -6556,309 +6954,76 @@ set tcgetpgrp d_tcgetpgrp
 eval $inlibc
 
 : see if tcsetpgrp exists
-set tcsetpgrp d_tcsetpgrp
-eval $inlibc
-
-: define an is-a-typedef? function
-typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
-case "$inclist" in
-"") inclist="sys/types.h";;
-esac;
-eval "varval=\$$var";
-case "$varval" in
-"")
-       $rm -f temp.c;
-       for inc in $inclist; do
-               echo "#include <$inc>" >>temp.c;
-       done;
-       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
-       if $contains $type temp.E >/dev/null 2>&1; then
-               eval "$var=\$type";
-       else
-               eval "$var=\$def";
-       fi;
-       $rm -f temp.?;;
-*) eval "$var=\$varval";;
-esac'
-
-: see if this is a sys/times.h system
-set sys/times.h i_systimes
-eval $inhdr
-
-: see if times exists
-echo " "
-if set times val -f d_times; eval $csym; $val; then
-       echo 'times() found.' >&4
-       d_times="$define"
-       inc=''
-       case "$i_systimes" in
-       "$define") inc='sys/times.h';;
-       esac
-       set clock_t clocktype long stdio.h sys/types.h $inc
-       eval $typedef
-       dflt="$clocktype"
-       echo " "
-       rp="What type is returned by times() on this system?"
-       . ./myread
-       clocktype="$ans"
-else
-       echo 'times() NOT found, hope that will do.' >&4
-       d_times="$undef"
-       clocktype='int'
-fi
-
-: see if truncate exists
-set truncate d_truncate
-eval $inlibc
-
-: see if tzname[] exists
-echo " "
-if set tzname val -a d_tzname; eval $csym; $val; then
-       val="$define"
-       echo 'tzname[] found.' >&4
-else
-       val="$undef"
-       echo 'tzname[] NOT found.' >&4
-fi
-set d_tzname
-eval $setvar
-
-: see if umask exists
-set umask d_umask
-eval $inlibc
-
-: see if we have to deal with yellow pages, now NIS.
-if $test -d /usr/etc/yp || $test -d /etc/yp; then
-       if $test -f /usr/etc/nibindd; then
-               echo " "
-               echo "I'm fairly confident you're on a NeXT."
-               echo " "
-               rp='Do you get the hosts file via NetInfo?'
-               dflt=y
-               case "$hostcat" in
-               nidump*) ;;
-               '') ;;
-               *) dflt=n;;
-               esac
-               . ./myread
-               case "$ans" in
-               y*) hostcat='nidump hosts .';;
-               *)      case "$hostcat" in
-                       nidump*) hostcat='';;
-                       esac
-                       ;;
-               esac
-       fi
-       case "$hostcat" in
-       nidump*) ;;
-       *)
-               case "$hostcat" in
-               *ypcat*) dflt=y;;
-               '') if $contains '^\+' /etc/passwd >/dev/null 2>&1; then
-                               dflt=y
-                       else
-                               dflt=n
-                       fi;;
-               *) dflt=n;;
-               esac
-               echo " "
-               rp='Are you getting the hosts file via yellow pages?'
-               . ./myread
-               case "$ans" in
-               y*) hostcat='ypcat hosts';;
-               *) hostcat='cat /etc/hosts';;
-               esac
-               ;;
-       esac
-fi
-
-: now get the host name
-echo " "
-echo "Figuring out host name..." >&4
-case "$myhostname" in
-'') cont=true
-       echo 'Maybe "hostname" will work...'
-       if tans=`sh -c hostname 2>&1` ; then
-               myhostname=$tans
-               phostname=hostname
-               cont=''
-       fi
-       ;;
-*) cont='';;
-esac
-if $test "$cont"; then
-       if ./xenix; then
-               echo 'Oh, dear.  Maybe "/etc/systemid" is the key...'
-               if tans=`cat /etc/systemid 2>&1` ; then
-                       myhostname=$tans
-                       phostname='cat /etc/systemid'
-                       echo "Whadyaknow.  Xenix always was a bit strange..."
-                       cont=''
-               fi
-       elif $test -r /etc/systemid; then
-               echo "(What is a non-Xenix system doing with /etc/systemid?)"
-       fi
-fi
-if $test "$cont"; then
-       echo 'No, maybe "uuname -l" will work...'
-       if tans=`sh -c 'uuname -l' 2>&1` ; then
-               myhostname=$tans
-               phostname='uuname -l'
-       else
-               echo 'Strange.  Maybe "uname -n" will work...'
-               if tans=`sh -c 'uname -n' 2>&1` ; then
-                       myhostname=$tans
-                       phostname='uname -n'
-               else
-                       echo 'Oh well, maybe I can mine it out of whoami.h...'
-                       if tans=`sh -c $contains' sysname $usrinc/whoami.h' 2>&1` ; then
-                               myhostname=`echo "$tans" | $sed 's/^.*"\(.*\)"/\1/'`
-                               phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' <$usrinc/whoami.h"
-                       else
-                               case "$myhostname" in
-                               '') echo "Does this machine have an identity crisis or something?"
-                                       phostname='';;
-                               *)
-                                       echo "Well, you said $myhostname before..."
-                                       phostname='echo $myhostname';;
-                               esac
-                       fi
-               fi
-       fi
-fi
-: you do not want to know about this
-set $myhostname
-myhostname=$1
+set tcsetpgrp d_tcsetpgrp
+eval $inlibc
 
-: verify guess
-if $test "$myhostname" ; then
-       dflt=y
-       rp='Your host name appears to be "'$myhostname'".'" Right?"
-       . ./myread
-       case "$ans" in
-       y*) ;;
-       *) myhostname='';;
-       esac
-fi
+: define an is-a-typedef? function
+typedef='type=$1; var=$2; def=$3; shift; shift; shift; inclist=$@;
+case "$inclist" in
+"") inclist="sys/types.h";;
+esac;
+eval "varval=\$$var";
+case "$varval" in
+"")
+       $rm -f temp.c;
+       for inc in $inclist; do
+               echo "#include <$inc>" >>temp.c;
+       done;
+       $cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
+       if $contains $type temp.E >/dev/null 2>&1; then
+               eval "$var=\$type";
+       else
+               eval "$var=\$def";
+       fi;
+       $rm -f temp.?;;
+*) eval "$var=\$varval";;
+esac'
 
-: bad guess or no guess
-while $test "X$myhostname" = X ; do
-       dflt=''
-       rp="Please type the (one word) name of your host:"
+: see if this is a sys/times.h system
+set sys/times.h i_systimes
+eval $inhdr
+
+: see if times exists
+echo " "
+if set times val -f d_times; eval $csym; $val; then
+       echo 'times() found.' >&4
+       d_times="$define"
+       inc=''
+       case "$i_systimes" in
+       "$define") inc='sys/times.h';;
+       esac
+       set clock_t clocktype long stdio.h sys/types.h $inc
+       eval $typedef
+       dflt="$clocktype"
+       echo " "
+       rp="What type is returned by times() on this system?"
        . ./myread
-       myhostname="$ans"
-done
+       clocktype="$ans"
+else
+       echo 'times() NOT found, hope that will do.' >&4
+       d_times="$undef"
+       clocktype='int'
+fi
 
-: translate upper to lower if necessary
-case "$myhostname" in
-*[A-Z]*)
-       echo "(Normalizing case in your host name)"
-       myhostname=`echo $myhostname | ./tr '[A-Z]' '[a-z]'`
-       ;;
-esac
+: see if truncate exists
+set truncate d_truncate
+eval $inlibc
 
-case "$myhostname" in
-*.*)
-       dflt=`expr "X$myhostname" : "X[^.]*\(\..*\)"`
-       myhostname=`expr "X$myhostname" : "X\([^.]*\)\."`
-       echo "(Trimming domain name from host name--host name is now $myhostname)"
-       ;;
-*) case "$mydomain" in
-       '')
-               {
-                       : If we use NIS, try ypmatch.
-                       : Is there some reason why this was not done before?
-                       test "X$hostcat" = "Xypcat hosts" &&
-                       ypmatch "$myhostname" hosts 2>/dev/null |\
-                               $sed -e 's/[     ]*#.*//; s/$/ /' > hosts && \
-                       $test -s hosts
-               } || {
-                       : Extract only the relevant hosts, reducing file size,
-                       : remove comments, insert trailing space for later use.
-                       $hostcat | $sed -n -e "s/[       ]*#.*//; s/\$/ /
-                                       /[       ]$myhostname[  . ]/p" > hosts
-               }
-               tmp_re="[       . ]"
-               $test x`$awk "/[0-9].*[  ]$myhostname$tmp_re/ { sum++ }
-                            END { print sum }" hosts` = x1 || tmp_re="[         ]"
-               dflt=.`$awk "/[0-9].*[   ]$myhostname$tmp_re/ {for(i=2; i<=NF;i++) print \\\$i}" \
-                       hosts | $sort | $uniq | \
-                       $sed -n -e "s/$myhostname\.\([-a-zA-Z0-9_.]\)/\1/p"`
-               case `$echo X$dflt` in
-               X*\ *)  echo "(Several hosts in /etc/hosts matched hostname)"
-                       dflt=.
-                       ;;
-               .) echo "(You do not have fully-qualified names in /etc/hosts)"
-                       ;;
-               esac
-               case "$dflt" in
-               .)
-                       tans=`./loc resolv.conf X /etc /usr/etc`
-                       if $test -f "$tans"; then
-                               echo "(Attempting domain name extraction from $tans)"
-                               : Why was there an Egrep here, when Sed works?
-                               dflt=.`$sed -n -e 's/^domain[   ]*\(.*\)/\1/p' $tans \
-                                       | ./tr '[A-Z]' '[a-z]' 2>/dev/null`
-                       fi
-                       ;;
-               esac
-               case "$dflt" in
-               .) echo "(No help from resolv.conf either -- attempting clever guess)"
-                       dflt=.`sh -c domainname 2>/dev/null`
-                       case "$dflt" in
-                       '') dflt='.';;
-                       .nis.*|.yp.*|.main.*) dflt=`echo $dflt | $sed -e 's/^\.[^.]*//'`;;
-                       esac
-                       ;;
-               esac
-               case "$dflt" in
-               .) echo "(Lost all hope -- silly guess then)"
-                       dflt='.uucp'
-                       ;;
-               esac
-               $rm -f hosts
-               ;;
-       *) dflt="$mydomain";;
-       esac;;
-esac
+: see if tzname[] exists
 echo " "
-rp="What is your domain name?"
-. ./myread
-tans="$ans"
-case "$ans" in
-'') ;;
-.*) ;;
-*) tans=".$tans";;
-esac
-mydomain="$tans"
-
-: translate upper to lower if necessary
-case "$mydomain" in
-*[A-Z]*)
-       echo "(Normalizing case in your domain name)"
-       mydomain=`echo $mydomain | ./tr '[A-Z]' '[a-z]'`
-       ;;
-esac
+if set tzname val -a d_tzname; eval $csym; $val; then
+       val="$define"
+       echo 'tzname[] found.' >&4
+else
+       val="$undef"
+       echo 'tzname[] NOT found.' >&4
+fi
+set d_tzname
+eval $setvar
 
-: a little sanity check here
-case "$phostname" in
-'') ;;
-*)
-       case `$phostname | ./tr '[A-Z]' '[a-z]'` in
-       $myhostname$mydomain|$myhostname) ;;
-       *)
-               case "$phostname" in
-               sed*)
-                       echo "(That doesn't agree with your whoami.h file, by the way.)"
-                       ;;
-               *)
-                       echo "(That doesn't agree with your $phostname command, by the way.)"
-                       ;;
-               esac
-       ;;
-       esac
-       ;;
-esac
+: see if umask exists
+set umask d_umask
+eval $inlibc
 
 : see how we will look up host name
 echo " "
@@ -7078,6 +7243,8 @@ rp="Doubles must be aligned on a how-many-byte boundary?"
 alignbytes="$ans"
 $rm -f try.c try
 
+: Define several unixisms. Hints files or command line options
+: can be used to override them.
 case "$ar" in
 '') ar='ar';;
 esac
@@ -7353,11 +7520,11 @@ echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
                fi
        fi
 esac
-: Only prompt user if voidflags is not 15.  If voidflags is 15, then
-: we presume all is well.
+: Only prompt user if support does not match the level we want
 case "$voidflags" in
-15) ;;
-*)     dflt="$voidflags";
+"$defvoidused") ;;
+*)
+       dflt="$voidflags";
        rp="Your void support flags add up to what?"
        . ./myread
        voidflags="$ans"
@@ -7438,6 +7605,31 @@ rp="What type is used for file modes?"
 . ./myread
 modetype="$ans"
 
+: locate the preferred pager for this system
+case "$pager" in
+'')
+       dflt=''
+       case "$pg" in
+       /*) dflt=$pg;;
+       esac
+       case "$more" in
+       /*) dflt=$more;;
+       esac
+       case "$less" in
+       /*) dflt=$less;;
+       esac
+       case "$dflt" in
+       '') dflt=/usr/ucb/more;;
+       esac
+       ;;
+*) dflt="$pager";;
+esac
+echo " "
+fn=f/
+rp='What pager is used on your system?'
+. ./getfile
+pager="$ans"
+
 : Cruising for prototypes
 echo " "
 echo "Checking out function prototypes..." >&4
@@ -7578,7 +7770,7 @@ main()
 }
 EOCP
 flags=''
-s_timezone=''
+for s_timezone in '-DS_TIMEZONE' ''; do
 sysselect=''
 for s_timeval in '-DS_TIMEVAL' ''; do
 for i_systimek in '' '-DSYSTIMEKERNEL'; do
@@ -7601,6 +7793,7 @@ done
 done
 done
 done
+done
 timeincl=''
 echo " "
 case "$flags" in
@@ -8383,6 +8576,7 @@ va_dcl
 }
 EOP
 $cat > varargs <<EOP
+$startsh
 if $cc -c $ccflags -D\$1 varargs.c >/dev/null 2>&1; then
        echo "true"
 else
@@ -8566,6 +8760,10 @@ for xxx in $known_extensions ; do
            true|define|y) avail_ext="$avail_ext $xxx" ;;
            esac
            ;;
+    SAFE) case "$usesafe" in 
+           true|define|y) avail_ext="$avail_ext $xxx" ;;
+           esac
+           ;;
     Socket) case "$d_socket" in 
            $define) avail_ext="$avail_ext $xxx" ;;
            esac
@@ -8657,58 +8855,6 @@ set X $dynamic_ext $static_ext
 shift
 extensions="$*"
 
-$cat <<EOM
-
-I need to get your e-mail address in Internet format if possible, i.e.
-something like user@host.domain. Please answer accurately since I have
-no easy means to double check it. The default value provided below
-is most probably close to the reality but may not be valid from outside
-your organization...
-
-EOM
-cont=x
-while test "$cont"; do
-       case "$cf_email" in
-       '') dflt="$cf_by@$myhostname$mydomain";;
-       *) dflt="$cf_email";;
-       esac
-       rp='What is your e-mail address?'
-       . ./myread
-       cf_email="$ans"
-       case "$cf_email" in
-       *@*.*) cont='' ;;
-       *)
-               rp='Address does not look like an Internet one.  Use it anyway?'
-               case "$fastread" in
-               yes) dflt=y ;;
-               *) dflt=n ;;
-               esac
-               . ./myread
-               case "$ans" in
-               y*) cont='' ;;
-               *) echo " " ;;
-               esac
-               ;;
-       esac
-done
-
-$cat <<EOM
-
-If you or somebody else will be maintaining perl at your site, please
-fill in the correct e-mail address here so that they may be contacted
-if necessary. Currently, the "perlbug" program included with perl
-will send mail to this address in addition to perlbug@perl.com. You may
-enter "none" for no administrator.
-
-EOM
-case "$perladmin" in
-'') dflt="$cf_email";;
-*) dflt="$perladmin";;
-esac
-rp='Perl administrator e-mail address'
-. ./myread
-perladmin="$ans"
-
 : Remove build directory name from cppstdin so it can be used from
 : either the present location or the final installed location.
 echo " "
@@ -8954,6 +9100,11 @@ d_shmctl='$d_shmctl'
 d_shmdt='$d_shmdt'
 d_shmget='$d_shmget'
 d_shrplib='$d_shrplib'
+d_sigaction='$d_sigaction'
+d_sigintrp='$d_sigintrp'
+d_sigsetjmp='$d_sigsetjmp'
+d_sigvec='$d_sigvec'
+d_sigvectr='$d_sigvectr'
 d_socket='$d_socket'
 d_sockpair='$d_sockpair'
 d_statblks='$d_statblks'
@@ -9137,6 +9288,7 @@ myhostname='$myhostname'
 myuname='$myuname'
 n='$n'
 nm_opt='$nm_opt'
+nm_so_opt='$nm_so_opt'
 nroff='$nroff'
 o_nonblock='$o_nonblock'
 obj_ext='$obj_ext'
@@ -9147,6 +9299,7 @@ orderlib='$orderlib'
 osname='$osname'
 osvers='$osvers'
 package='$package'
+pager='$pager'
 passcat='$passcat'
 patchlevel='$patchlevel'
 path_sep='$path_sep'
@@ -9209,6 +9362,7 @@ stdio_cnt='$stdio_cnt'
 stdio_ptr='$stdio_ptr'
 strings='$strings'
 submit='$submit'
+subversion='$subversion'
 sysman='$sysman'
 tail='$tail'
 tar='$tar'
@@ -9226,6 +9380,7 @@ usedl='$usedl'
 usemymalloc='$usemymalloc'
 usenm='$usenm'
 useposix='$useposix'
+usesafe='$usesafe'
 usevfork='$usevfork'
 usrinc='$usrinc'
 uuname='$uuname'