summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure2496
1 files changed, 1477 insertions, 1019 deletions
diff --git a/Configure b/Configure
index 53649d5769..b9a1be8e04 100755
--- a/Configure
+++ b/Configure
@@ -18,9 +18,9 @@
# archive site. Check with Archie if you don't know where that can be.)
#
-# $Id: Head.U,v 3.0.1.7 1995/03/21 08:46:15 ram Exp $
+# $Id: Head.U,v 3.0.1.8 1995/07/25 13:40:02 ram Exp $
#
-# Generated on Thu Jun 22 10:38:35 EDT 1995 [metaconfig 3.0 PL55]
+# Generated on Thu Oct 19 10:47:09 EDT 1995 [metaconfig 3.0 PL58]
cat >/tmp/c1$$ <<EOF
ARGGGHHHH!!!!!
@@ -55,6 +55,14 @@ case "$0" in
;;
esac
+: Proper PATH separator
+p_=:
+: On OS/2 this directory should exist if this is not floppy only system :-]
+if test -d c:/.; then
+ p_=\;
+ PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
+ OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
+fi
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
@@ -68,13 +76,13 @@ paths="$paths /sbin /usr/sbin /usr/libexec"
for p in $paths
do
- case ":$PATH:" in
- *:$p:*) ;;
- *) test -d $p && PATH=$PATH:$p ;;
+ case "$p_$PATH$p_" in
+ *$p_$p$p_*) ;;
+ *) test -d $p && PATH=$PATH$p_$p ;;
esac
done
-PATH=.:$PATH
+PATH=.$p_$PATH
export PATH
: Sanity checks
@@ -105,7 +113,7 @@ fi
: Configure runs within the UU subdirectory
test -d UU || mkdir UU
-cd UU && rm -f *
+cd UU && rm -f ./*
dynamic_ext=''
extensions=''
@@ -217,7 +225,9 @@ ccflags=''
cppflags=''
ldflags=''
lkflags=''
+locincpth=''
optimize=''
+cf_email=''
cf_by=''
cf_time=''
contains=''
@@ -305,6 +315,7 @@ d_fpathconf=''
d_pathconf=''
d_pause=''
d_pipe=''
+d_poll=''
d_portable=''
d_readdir=''
d_rewinddir=''
@@ -408,6 +419,7 @@ db_hashtype=''
db_prefixtype=''
i_db=''
i_dbm=''
+i_rpcsvcdbm=''
d_dirnamlen=''
direntrytype=''
i_dirent=''
@@ -466,6 +478,7 @@ intsize=''
libc=''
glibpth=''
libpth=''
+loclibpth=''
plibpth=''
xlibpth=''
libs=''
@@ -497,6 +510,10 @@ myhostname=''
phostname=''
c=''
n=''
+d_eofnblk=''
+eagain=''
+o_nonblock=''
+rd_nodata=''
groupcat=''
hostcat=''
passcat=''
@@ -505,6 +522,7 @@ ranlib=''
package=''
spackage=''
patchlevel=''
+perladmin=''
prefix=''
prefixexp=''
installprivlib=''
@@ -517,6 +535,8 @@ scriptdir=''
scriptdirexp=''
selecttype=''
sig_name=''
+sig_max=''
+sig_num=''
d_sitelib=''
installsitelib=''
sitelib=''
@@ -623,29 +643,37 @@ al="$al xenix z8000"
groupstype=''
i_whoami=''
+: default library list
+libswanted=''
+: set useposix=false in your hint file to disable the POSIX extension.
+useposix=true
+: Possible local include directories to search.
+locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
+:
+: no include file wanted by default
+inclwanted=''
+
: change the next line if compiling for Xenix/286 on Xenix/386
xlibpth='/usr/lib/386 /lib/386'
+: Possible local library directories to search.
+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="/lib/pa1.1 /usr/lib/large /lib /usr/lib $xlibpth"
-glibpth="$glibpth /lib/large /usr/lib/small /lib/small"
-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib /usr/shlib"
+glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib"
+glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small"
+glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib"
: Private path used by Configure to find libraries. Its value
: is prepended to libpth. This variable takes care of special
: machines, like the mips. Usually, it should be empty.
plibpth=''
-: default library list
-libswanted=''
: full support for void wanted by default
defvoidused=15
-: set useposix=false in your hint file to disable the POSIX extension.
-useposix=true
-: no include file wanted by default
-inclwanted=''
-
: List of libraries we want.
libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl'
libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt"
@@ -656,9 +684,6 @@ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
glibpth="/usr/shlib $glibpth"
: Do not use vfork unless overridden by a hint file.
usevfork=false
-: We might as well always be portable. It makes no difference for
-: perl5, and makes people happy.
-d_portable=define
: script used to extract .SH files with variable substitutions
cat >extract <<'EOS'
@@ -818,7 +843,7 @@ while test $# -gt 0; do
esac
shift
;;
- -V) echo "$me generated by metaconfig 3.0 PL55." >&2
+ -V) echo "$me generated by metaconfig 3.0 PL58." >&2
exit 0;;
--) break;;
-*) echo "$me: unknown option $1" >&2; shift; error=true;;
@@ -1297,6 +1322,7 @@ mkdir
rm
sed
sort
+tail
touch
tr
uniq
@@ -1314,7 +1340,7 @@ perl
test
uname
"
-pth=`echo $PATH | sed -e 's/:/ /g'`
+pth=`echo $PATH | sed -e "s/$p_/ /g"`
pth="$pth /lib /usr/lib"
for file in $loclist; do
xxx=`./loc $file $file $pth`
@@ -1324,6 +1350,9 @@ for file in $loclist; do
/*)
echo $file is in $xxx.
;;
+ ?:[\\/]*)
+ echo $file is in $xxx.
+ ;;
*)
echo "I don't know where $file is. I hope it's in everyone's PATH."
;;
@@ -1340,6 +1369,9 @@ for file in $trylist; do
/*)
echo $file is in $xxx.
;;
+ ?:[\\/]*)
+ echo $file is in $xxx.
+ ;;
*)
echo "I don't see $file out there, $say."
say=either
@@ -1679,6 +1711,10 @@ EOM
osname=news_os
fi
$rm -f ../UU/kernel.what
+ elif test -d c:/.; then
+ set X $myuname
+ osname=os2
+ osvers="$5"
fi
fi
@@ -2142,29 +2178,10 @@ case "$gccversion" in
1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
esac
-: decide how portable to be
+: decide how portable to be. Allow command line overrides.
case "$d_portable" in
-"$define") dflt=y;;
-*) dflt=n;;
-esac
-$cat <<'EOH'
-
-I can set things up so that your shell scripts and binaries are more portable,
-at what may be a noticable cost in performance. In particular, if you
-ask to be portable, the following happens:
-
- 1) Shell scripts will rely on the PATH variable rather than using
- the paths derived above.
- 2) ~username interpretations will be done at run time rather than
- by Configure.
-
-EOH
-rp="Do you expect to run these scripts and binaries on multiple machines?"
-. ./myread
-case "$ans" in
- y*) d_portable="$define"
- ;;
- *) d_portable="$undef" ;;
+"$undef") ;;
+*) d_portable="$define" ;;
esac
: set up shell script to do ~ expansion
@@ -2433,9 +2450,11 @@ EOCP
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
@@ -2445,10 +2464,15 @@ case "$usrinc" in
'') ;;
*) dflt="$usrinc";;
esac
-fn=d/
-rp='Where are the include files you want to use?'
-. ./getfile
-usrinc="$ans"
+case "$xxx_prompt" in
+y) fn=d/
+ rp='Where are the include files you want to use?'
+ . ./getfile
+ usrinc="$ans"
+ ;;
+*) usrinc="$dflt"
+ ;;
+esac
: see how we invoke the C preprocessor
echo " "
@@ -2588,6 +2612,908 @@ case "$cppstdin" in
esac
$rm -f testcpp.c testcpp.out
+: Set private lib path
+case "$plibpth" in
+'') if ./mips; then
+ plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
+ fi;;
+esac
+case "$libpth" in
+' ') dlist='';;
+'') dlist="$loclibpth $plibpth $glibpth";;
+*) dlist="$libpth";;
+esac
+
+: Now check and see which directories actually exist, avoiding duplicates
+libpth=''
+for xxx in $dlist
+do
+ if $test -d $xxx; then
+ case " $libpth " in
+ *" $xxx "*) ;;
+ *) libpth="$libpth $xxx";;
+ esac
+ fi
+done
+$cat <<'EOM'
+
+Some systems have incompatible or broken versions of libraries. Among
+the directories listed in the question below, please remove any you
+know not to be holding relevant libraries, and add any that are needed.
+Say "none" for none.
+
+EOM
+case "$libpth" in
+'') dflt='none';;
+*)
+ set X $libpth
+ shift
+ dflt=${1+"$@"}
+ ;;
+esac
+rp="Directories to use for library searches?"
+. ./myread
+case "$ans" in
+none) libpth=' ';;
+*) libpth="$ans";;
+esac
+
+: determine root of directory hierarchy where package will be installed.
+case "$prefix" in
+'')
+ dflt=`./loc . /usr/local /usr/local /local /opt /usr`
+ ;;
+*)
+ dflt="$prefix"
+ ;;
+esac
+$cat <<EOM
+
+By default, $package will be installed in $dflt/bin, manual
+pages under $dflt/man, etc..., i.e. with $dflt as prefix for
+all installation directories. Typically set to /usr/local, but you
+may choose /usr if you wish to install $package among your system
+binaries. If you wish to have binaries under /bin but manual pages
+under /usr/local/man, that's ok: you will be prompted separately
+for each of the installation directories, the prefix being only used
+to set the defaults.
+
+EOM
+fn=d~
+rp='Installation prefix to use?'
+. ./getfile
+oldprefix=''
+case "$prefix" in
+'') ;;
+*)
+ case "$ans" in
+ "$prefix") ;;
+ *) oldprefix="$prefix";;
+ esac
+ ;;
+esac
+prefix="$ans"
+prefixexp="$ansexp"
+
+: set the prefixit variable, to compute a suitable default value
+prefixit='case "$3" in
+""|none)
+ case "$oldprefix" in
+ "") eval "$1=\"\$$2\"";;
+ *)
+ case "$3" in
+ "") eval "$1=";;
+ none)
+ eval "tp=\"\$$2\"";
+ case "$tp" in
+ ""|" ") eval "$1=\"\$$2\"";;
+ *) eval "$1=";;
+ esac;;
+ esac;;
+ esac;;
+*)
+ eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
+ case "$tp" in
+ --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
+ /*-$oldprefix/*|\~*-$oldprefix/*)
+ eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
+ *) eval "$1=\"\$$2\"";;
+ esac;;
+esac'
+
+: is AFS running?
+echo " "
+if test -d /afs; then
+ echo "AFS may be running... I'll be extra cautious then..." >&4
+ afs=true
+else
+ echo "AFS does not seem to be running..." >&4
+ afs=false
+fi
+
+: determine where public executables go
+echo " "
+set dflt bin bin
+eval $prefixit
+fn=d~
+rp='Pathname where the public executables will reside?'
+. ./getfile
+if $test "X$ansexp" != "X$binexp"; then
+ installbin=''
+fi
+bin="$ans"
+binexp="$ansexp"
+if $afs; then
+ $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+executables 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 "$installbin" in
+ '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installbin";;
+ esac
+ fn=de~
+ rp='Where will public executables be installed?'
+ . ./getfile
+ installbin="$ans"
+else
+ installbin="$binexp"
+fi
+
+: set the prefixup variable, to restore leading tilda escape
+prefixup='case "$prefixexp" in
+"$prefix") ;;
+*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
+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 where private executables go
+set dflt privlib lib/$package
+eval $prefixit
+$cat <<EOM
+
+There are some auxiliary files for $package that need to be put into a
+private library directory that is accessible by everyone.
+
+EOM
+fn=d~+
+rp='Pathname where the private library files will reside?'
+. ./getfile
+if $test "X$privlibexp" != "X$ansexp"; then
+ installprivlib=''
+fi
+privlib="$ans"
+privlibexp="$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).
+
+EOM
+ case "$installprivlib" in
+ '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installprivlib";;
+ esac
+ fn=de~
+ rp='Where will private files be installed?'
+ . ./getfile
+ installprivlib="$ans"
+else
+ installprivlib="$privlibexp"
+fi
+
+: determine the architecture name
+echo " "
+if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
+ tarch=`arch`"-$osname"
+elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
+ if uname -m > tmparch 2>&1 ; then
+ tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
+ else
+ tarch="$osname"
+ fi
+ $rm -f tmparch
+else
+ tarch="$osname"
+fi
+case "$myarchname" in
+''|"$tarch") ;;
+*)
+ echo "(Your architecture name used to be $myarchname.)"
+ archname=''
+ ;;
+esac
+case "$archname" in
+'') dflt="$tarch";;
+*) dflt="$archname";;
+esac
+rp='What is your architecture name'
+. ./myread
+archname="$ans"
+myarchname="$tarch"
+
+: determine where public architecture dependent libraries go
+set archlib archlib
+eval $prefixit
+case "$archlib" in
+'')
+ case "$privlib" in
+ '')
+ dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
+ set dflt
+ eval $prefixup
+ ;;
+ *) dflt="$privlib/$archname";;
+ esac
+ ;;
+*) dflt="$archlib";;
+esac
+cat <<EOM
+
+$spackage contains architecture-dependent library files. If you are
+sharing libraries in a heterogeneous environment, you might store
+these files in a separate location. Otherwise, you can just include
+them with the rest of the public library files.
+
+EOM
+fn=d~
+rp='Where do you want to put the public architecture-dependent libraries?'
+. ./getfile
+archlib="$ans"
+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).
+
+EOM
+ case "$installarchlib" in
+ '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installarchlib";;
+ esac
+ fn=de~
+ rp='Where will architecture-dependent library files be installed?'
+ . ./getfile
+ installarchlib="$ans"
+else
+ installarchlib="$archlibexp"
+fi
+if $test X"$archlib" = X"$privlib"; then
+ d_archlib="$undef"
+else
+ d_archlib="$define"
+fi
+
+: determine whether the user wants to include a site-specific library
+: in addition to privlib.
+$cat <<EOM
+
+Some sites may wish to specify a local directory for $package
+to search by default in addition to $privlib.
+If you don't want to use such an additional directory, answer 'none'.
+
+EOM
+case "$sitelib" in
+'') dflt=none ;;
+*) dflt="$sitelib" ;;
+esac
+fn=d~+n
+rp='Local directory for additional library files?'
+. ./getfile
+if $test "X$sitelibexp" != "X$ansexp"; then
+ installsitelib=''
+fi
+sitelib="$ans"
+sitelibexp="$ansexp"
+if $afs; then
+ case "$sitelib" in
+ '') installsitelib="$sitelibexp"
+ ;;
+ *) $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).
+
+EOM
+ case "$installsitelib" in
+ '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installsitelib";;
+ esac
+ fn=de~
+ rp='Where will additional local files be installed?'
+ . ./getfile
+ installsitelib="$ans"
+ ;;
+ esac
+else
+ installsitelib="$sitelibexp"
+fi
+
+case "$sitelibexp" in
+'') d_sitelib=undef ;;
+*) d_sitelib=define ;;
+esac
+
+: determine where manual pages go
+set man1dir man1dir none
+eval $prefixit
+$cat <<EOM
+
+$spackage has manual pages available in source form.
+EOM
+case "$nroff" in
+nroff)
+ echo "However, you don't have nroff, so they're probably useless to you."
+ case "$man1dir" in
+ '') man1dir="none";;
+ esac;;
+esac
+echo "If you don't want the manual sources installed, answer 'none'."
+case "$man1dir" in
+'')
+ lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
+ lookpath="$lookpath $prefixexp/man/l_man/man1"
+ lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
+ lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
+ lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+ lookpath="$lookpath /usr/man/man.L"
+ man1dir=`./loc . $prefixexp/man/man1 $lookpath`
+ if $test -d "$man1dir"; then
+ dflt="$man1dir"
+ else
+ dflt="$sysman"
+ fi
+ set dflt
+ eval $prefixup
+ ;;
+' ') dflt=none;;
+*) dflt="$man1dir"
+ ;;
+esac
+echo " "
+fn=dn~
+rp="Where do the main $spackage manual pages (source) go?"
+. ./getfile
+if test "X$man1direxp" != "X$ansexp"; then
+ installman1dir=''
+fi
+man1dir="$ans"
+man1direxp="$ansexp"
+case "$man1dir" in
+'') man1dir=' '
+ installman1dir='';;
+esac
+if $afs; then
+ $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+manual pages 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 "$installman1dir" in
+ '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installman1dir";;
+ esac
+ fn=de~
+ rp='Where will man pages be installed?'
+ . ./getfile
+ installman1dir="$ans"
+else
+ installman1dir="$man1direxp"
+fi
+
+: What suffix to use on installed man pages
+
+case "$man1dir" in
+' ')
+ man1ext='0'
+ ;;
+*)
+ 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;;
+ esac
+ . ./myread
+ man1ext="$ans"
+ ;;
+esac
+
+: 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'
+
+: see if we can have long filenames
+echo " "
+rmlist="$rmlist /tmp/cf$$"
+$test -d /tmp/cf$$ || mkdir /tmp/cf$$
+first=123456789abcdef
+second=/tmp/cf$$/$first
+$rm -f $first $second
+if (echo hi >$first) 2>/dev/null; then
+ if $test -f 123456789abcde; then
+ echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
+ val="$undef"
+ else
+ if (echo hi >$second) 2>/dev/null; then
+ if $test -f /tmp/cf$$/123456789abcde; then
+ $cat <<'EOM'
+That's peculiar... You can have filenames longer than 14 characters, but only
+on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
+I shall consider your system cannot support long filenames at all.
+EOM
+ val="$undef"
+ else
+ echo 'You can have filenames longer than 14 characters.' >&4
+ val="$define"
+ fi
+ else
+ $cat <<'EOM'
+How confusing! Some of your filesystems are sane enough to allow filenames
+longer than 14 characters but some others like /tmp can't even think about them.
+So, for now on, I shall assume your kernel does not allow them at all.
+EOM
+ val="$undef"
+ fi
+ fi
+else
+ $cat <<'EOM'
+You can't have filenames longer than 14 chars. You can't even think about them!
+EOM
+ val="$undef"
+fi
+set d_flexfnam
+eval $setvar
+$rm -rf /tmp/cf$$ 123456789abcde*
+
+: determine where library module manual pages go
+set man3dir man3dir none
+eval $prefixit
+$cat <<EOM
+
+$spackage has manual pages for many of the library modules.
+EOM
+
+case "$nroff" in
+nroff)
+ $cat <<'EOM'
+However, you don't have nroff, so they're probably useless to you.
+You can use the supplied perldoc script instead.
+EOM
+ case "$man3dir" in
+ '') man3dir="none";;
+ esac;;
+esac
+
+case "$d_flexfnam" in
+undef)
+ $cat <<'EOM'
+However, your system can't handle the long file names like File::Basename.3.
+You can use the supplied perldoc script instead.
+EOM
+ case "$man3dir" in
+ '') man3dir="none";;
+ esac;;
+esac
+
+echo "If you don't want the manual sources installed, answer 'none'."
+case "$man3dir" in
+'') dflt="$privlib/man/man3" ;;
+' ') dflt=none;;
+*) dflt="$man3dir" ;;
+esac
+echo " "
+
+fn=dn~
+rp="Where do the $spackage library man pages (source) go?"
+. ./getfile
+if test "X$man3direxp" != "X$ansexp"; then
+ installman3dir=''
+fi
+
+man3dir="$ans"
+man3direxp="$ansexp"
+case "$man3dir" in
+'') man3dir=' '
+ installman3dir='';;
+esac
+if $afs; then
+ $cat <<EOM
+
+Since you are running AFS, I need to distinguish the directory in which
+manual pages 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 "$installman3dir" in
+ '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
+ *) dflt="$installman3dir";;
+ esac
+ fn=de~
+ rp='Where will man pages be installed?'
+ . ./getfile
+ installman3dir="$ans"
+else
+ installman3dir="$man3direxp"
+fi
+
+: What suffix to use on installed man pages
+
+case "$man3dir" in
+' ')
+ man3ext='0'
+ ;;
+*)
+ 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
+
+: 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
+ '')
+ $hostcat >hosts
+ dflt=.`$awk "/[0-9].*$myhostname/ {for(i=2; i<=NF;i++) print \\\$i}" \
+ hosts | $sort | $uniq | \
+ $sed -n -e "s/$myhostname\.\([a-zA-Z_.]\)/\1/p"`
+ case "$dflt" in
+ .) echo "(You do not have fully-qualified names in /etc/hosts)"
+ tans=`./loc resolv.conf X /etc /usr/etc`
+ if $test -f "$tans"; then
+ echo "(Attempting domain name extraction from $tans)"
+ dflt=.`egrep '^domain' $tans | $sed 's/domain[ ]*\(.*\)/\1/' \
+ | ./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 optimize, if desired, or use for debug flag also
case "$optimize" in
' ') dflt='none';;
@@ -2631,9 +3557,8 @@ case "$ccflags" in
esac
case "$mips_type" in
-*BSD*) ;;
-'') ;;
-*) inclwanted="$inclwanted $usrinc/bsd";;
+*BSD*|'') inclwanted="$locincpth $usrinc";;
+*) inclwanted="$locincpth $inclwanted $usrinc/bsd";;
esac
for thisincl in $inclwanted; do
if $test -d $thisincl; then
@@ -2750,6 +3675,7 @@ EOM
esac
: flags used in final linking phase
+
case "$ldflags" in
'') if ./venix; then
dflt='-i -z'
@@ -2759,13 +3685,40 @@ case "$ldflags" in
case "$ccflags" in
*-posix*) dflt="$dflt -posix" ;;
esac
- case "$dflt" in
- '') dflt='none' ;;
- esac
;;
*) dflt="$ldflags";;
esac
-echo " "
+
+: Try to guess additional flags to pick up local libraries.
+for thislibdir in $libpth; do
+ case " $loclibpth " in
+ *" $thislibdir "*)
+ case "$dflt " in
+ "-L$thislibdir ") ;;
+ *) dflt="$dflt -L$thislibdir" ;;
+ esac
+ ;;
+ esac
+done
+
+case "$dflt" in
+'') dflt='none' ;;
+esac
+
+$cat <<EOH
+
+Your C linker may need flags. For this question you should
+include -L/whatever and any other flags used by the C linker, but you
+should NOT include libraries like -lwhatever.
+
+Make sure you include the appropriate -L/path flags if your C linker
+does not normally search all of the directories you specified above,
+namely
+ $libpth
+To use no flags, specify the word "none".
+
+EOH
+
rp="Any additional ld flags (NOT including libraries)?"
. ./myread
case "$ans" in
@@ -2777,7 +3730,7 @@ rmlist="$rmlist pdp11"
: coherency check
echo " "
echo "Checking your choice of C compiler and flags for coherency..." >&4
-set X $cc $optimize $ccflags try.c -o try $ldflags
+set X $cc $optimize $ccflags $ldflags try.c -o try
shift
$cat >try.msg <<EOM
I've tried to compile and run a simple program with:
@@ -2828,52 +3781,6 @@ n) echo "OK, that should do.";;
esac
$rm -f try try.* core
-: Set private lib path
-case "$plibpth" in
-'') if ./mips; then
- plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
- fi;;
-esac
-case "$libpth" in
-' ') dlist='';;
-'') dlist="$plibpth $glibpth";;
-*) dlist="$libpth";;
-esac
-
-: Now check and see which directories actually exist, avoiding duplicates
-libpth=''
-for xxx in $dlist
-do
- if $test -d $xxx; then
- case " $libpth " in
- *" $xxx "*) ;;
- *) libpth="$libpth $xxx";;
- esac
- fi
-done
-$cat <<'EOM'
-
-Some systems have incompatible or broken versions of libraries. Among
-the directories listed in the question below, please remove any you
-know not to be holding relevant libraries, and add any that are needed.
-Say "none" for none.
-
-EOM
-case "$libpth" in
-'') dflt='none';;
-*)
- set X $libpth
- shift
- dflt=${1+"$@"}
- ;;
-esac
-rp="Directories to use for library searches?"
-. ./myread
-case "$ans" in
-none) libpth=' ';;
-*) libpth="$ans";;
-esac
-
: compute shared library extension
case "$so" in
'')
@@ -2926,6 +3833,12 @@ for thislib in $libswanted; do
*"-l$thislib "*);;
*) dflt="$dflt -l$thislib";;
esac
+ elif xxx=`./loc $thislib.a X $libpth`; $test -f "$xxx"; then
+ echo "Found -l$thislib."
+ case " $dflt " in
+ *"-l$thislib "*);;
+ *) dflt="$dflt -l$thislib";;
+ esac
elif xxx=`./loc lib${thislib}_s.a X $libpth`; $test -f "$xxx"; then
echo "Found -l${thislib}_s."
case " $dflt " in
@@ -3218,6 +4131,10 @@ elif com="$sed -n -e '/Def. Text/s/.* \([^ ]*\)\$/\1/p'";\
eval $xscan;\
$contains '^fprintf$' libc.list >/dev/null 2>&1; then
eval $xrun
+elif com="$sed -n -e 's/^[-0-9a-f ]*_\(.*\)=.*/\1/p'";\
+ eval $xscan;\
+ $contains '^fprintf$' libc.list >/dev/null 2>&1; then
+ eval $xrun
else
nm -p $* 2>/dev/null >libc.tmp
$grep fprintf libc.tmp > libc.ptf
@@ -3268,7 +4185,7 @@ $rm -f libnames libpath
csym='tlook=$1;
case "$3" in
-v) tf=libc.tmp; tc=""; tdc="";;
--a) tf=libc.tmp; tc="[0]"; tdc=[];;
+-a) tf=libc.tmp; tc="[0]"; tdc="[]";;
*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
esac;
tx=yes;
@@ -3286,7 +4203,7 @@ yes)
fi;;
*)
echo "main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
- if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
+ if $cc $ccflags $ldflags -o t t.c $libs >/dev/null 2>&1;
then tval=true;
else tval=false;
fi;
@@ -3300,19 +4217,6 @@ yes)
esac;
eval "$2=$tval"'
-: 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
-
: define an is-in-libc? function
inlibc='echo " "; td=$define; tu=$undef;
sym=$1; var=$2; eval "was=\$$2";
@@ -3340,67 +4244,62 @@ yes)
esac;;
esac'
-: see if gconvert exists
-: On some SVR4 systems, gconvert is present but can not be used
-: because it requires some other unavailable functions.
-: Therefore, do not use the nm extraction, but use a real compile
-: and link test instead.
-xxx_runnm="$runnm"
-runnm=false
-set gconvert d_gconvert
-eval $inlibc
-runnm="$xxx_runnm"
-
-case "$d_gconvert" in
-$define)
- echo "We'll use it to convert floats into a string then." >&4
- d_Gconvert="gconvert((x),(n),(t),(b))"
- ;;
-*)
- : Maybe we can emulate it with gcvt.
- set gcvt d_gcvt
- eval $inlibc
-
- case "$d_gcvt" in
- $define)
- : Test whether gcvt drops a trailing decimal point
- $cat >try.c <<'EOP'
+: Check how to convert floats to strings.
+echo " "
+echo "Checking for an efficient way to convert floats to strings."
+$cat >try.c <<'EOP'
+#ifdef TRY_gconvert
+#define Gconvert(x,n,t,b) gconvert((x),(n),(t),(b))
+#endif
+#ifdef TRY_gcvt
+#define Gconvert(x,n,t,b) gcvt((x),(n),(b))
+#endif
+#ifdef TRY_sprintf
+#define Gconvert(x,n,t,b) sprintf((b),"%.*g",(n),(x))
+#endif
main() {
char buf[64];
- gcvt(1.0, 8, buf);
+ Gconvert(1.0, 8, 0, buf);
if (buf[0] != '1' || buf[1] != '\0')
exit(1);
- gcvt(0.0, 8, buf);
+ Gconvert(0.0, 8, 0, buf);
if (buf[0] != '0' || buf[1] != '\0')
exit(1);
- gcvt(-1.0, 8, buf);
+ Gconvert(-1.0, 8, 0, buf);
if (buf[0] != '-' || buf[1] != '1' || buf[2] != '\0')
exit(1);
exit(0);
}
EOP
- if $cc $ccflags $ldflags -o try try.c $libs > /dev/null 2>&1; then
- if ./try; then
- echo "Good, your gcvt() drops a trailing decimal point."
- echo "We'll use it to convert floats into a string." >&4
- d_Gconvert="gcvt((x),(n),(b))"
- else
- echo "But your gcvt() keeps a trailing decimal point".
- d_Gconvert=''
- fi
+case "$d_Gconvert" in
+gconvert*) xxx_list='gconvert gcvt sprintf' ;;
+gcvt*) xxx_list='gcvt gconvert sprintf' ;;
+sprintf*) xxx_list='sprintf gconvert gcvt' ;;
+*) xxx_list='gconvert gcvt sprintf' ;;
+esac
+
+for xxx_convert in $xxx_list; do
+ echo "Trying $xxx_convert"
+ $rm -f try try.o
+ if $cc $ccflags -DTRY_$xxx_convert $ldflags -o try \
+ try.c $libs > /dev/null 2>&1 ; then
+ echo "$xxx_convert" found. >&4
+ if ./try; then
+ echo "Good, $xxx_convert drops a trailing decimal point."
+ echo "I'll use $xxx_convert to convert floats into a string." >&4
+ break;
else
- echo "Hmm. I can't compile the gcvt test program."
- d_Gconvert=''
+ echo "But $xxx_convert keeps a trailing decimal point".
fi
- $rm -f try.c try
- ;;
- esac
- case "$d_Gconvert" in
- '')
- echo "I'll use sprintf instead to convert floats into a string." >&4
- d_Gconvert='sprintf((b),"%.*g",(n),(x))'
- ;;
- esac
+ else
+ echo "$xxx_convert NOT found." >&4
+ fi
+done
+
+case "$xxx_convert" in
+gconvert) d_Gconvert='gconvert((x),(n),(t),(b))' ;;
+gcvt) d_Gconvert='gcvt((x),(n),(b))' ;;
+*) d_Gconvert='sprintf((b),"%.*g",(n),(x))' ;;
esac
: Initialize h_fcntl
@@ -3515,215 +4414,6 @@ $rm -f access*
set alarm d_alarm
eval $inlibc
-: determine the architecture name
-echo " "
-if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
- tarch=`arch`"-$osname"
-elif xxx=`./loc uname blurfl $pth`; $test -f "$xxx" ; then
- if uname -m > tmparch 2>&1 ; then
- tarch=`$sed -e 's/ /_/g' -e 's/$/'"-$osname/" tmparch`
- else
- tarch="$osname"
- fi
- $rm -f tmparch
-else
- tarch="$osname"
-fi
-case "$myarchname" in
-''|"$tarch") ;;
-*)
- echo "(Your architecture name used to be $myarchname.)"
- archname=''
- ;;
-esac
-case "$archname" in
-'') dflt="$tarch";;
-*) dflt="$archname";;
-esac
-rp='What is your architecture name'
-. ./myread
-archname="$ans"
-myarchname="$tarch"
-
-: is AFS running?
-echo " "
-if test -d /afs; then
- echo "AFS may be running... I'll be extra cautious then..." >&4
- afs=true
-else
- echo "AFS does not seem to be running..." >&4
- afs=false
-fi
-
-: determine root of directory hierarchy where package will be installed.
-case "$prefix" in
-'')
- dflt=`./loc . /usr/local /usr/local /local /opt /usr`
- ;;
-*)
- dflt="$prefix"
- ;;
-esac
-$cat <<EOM
-
-By default, $package will be installed in $dflt/bin, manual
-pages under $dflt/man, etc..., i.e. with $dflt as prefix for
-all installation directories. Typically set to /usr/local, but you
-may choose /usr if you wish to install $package among your system
-binaries. If you wish to have binaries under /bin but manual pages
-under /usr/local/man, that's ok: you will be prompted separately
-for each of the installation directories, the prefix being only used
-to set the defaults.
-
-EOM
-fn=d~
-rp='Installation prefix to use?'
-. ./getfile
-oldprefix=''
-case "$prefix" in
-'') ;;
-*)
- case "$ans" in
- "$prefix") ;;
- *) oldprefix="$prefix";;
- esac
- ;;
-esac
-prefix="$ans"
-prefixexp="$ansexp"
-
-: set the prefixit variable, to compute a suitable default value
-prefixit='case "$3" in
-""|none)
- case "$oldprefix" in
- "") eval "$1=\"\$$2\"";;
- *)
- case "$3" in
- "") eval "$1=";;
- none)
- eval "tp=\"\$$2\"";
- case "$tp" in
- ""|" ") eval "$1=\"\$$2\"";;
- *) eval "$1=";;
- esac;;
- esac;;
- esac;;
-*)
- eval "tp=\"$oldprefix-\$$2-\""; eval "tp=\"$tp\"";
- case "$tp" in
- --|/*--|\~*--) eval "$1=\"$prefix/$3\"";;
- /*-$oldprefix/*|\~*-$oldprefix/*)
- eval "$1=\`echo \$$2 | sed \"s,^$oldprefix,$prefix,\"\`";;
- *) eval "$1=\"\$$2\"";;
- esac;;
-esac'
-
-: determine where private executables go
-set dflt privlib lib/$package
-eval $prefixit
-$cat <<EOM
-
-There are some auxiliary files for $package that need to be put into a
-private library directory that is accessible by everyone.
-
-EOM
-fn=d~+
-rp='Pathname where the private library files will reside?'
-. ./getfile
-if $test "X$privlibexp" != "X$ansexp"; then
- installprivlib=''
-fi
-privlib="$ans"
-privlibexp="$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).
-
-EOM
- case "$installprivlib" in
- '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installprivlib";;
- esac
- fn=de~
- rp='Where will private files be installed?'
- . ./getfile
- installprivlib="$ans"
-else
- installprivlib="$privlibexp"
-fi
-
-: set the prefixup variable, to restore leading tilda escape
-prefixup='case "$prefixexp" in
-"$prefix") ;;
-*) eval "$1=\`echo \$$1 | sed \"s,^$prefixexp,$prefix,\"\`";;
-esac'
-
-: determine where public architecture dependent libraries go
-set archlib archlib
-eval $prefixit
-case "$archlib" in
-'')
- case "$privlib" in
- '')
- dflt=`./loc . "." $prefixexp/lib /usr/local/lib /usr/lib /lib`
- set dflt
- eval $prefixup
- ;;
- *) dflt="$privlib/$archname";;
- esac
- ;;
-*) dflt="$archlib";;
-esac
-cat <<EOM
-
-$spackage contains architecture-dependent library files. If you are
-sharing libraries in a heterogeneous environment, you might store
-these files in a separate location. Otherwise, you can just include
-them with the rest of the public library files.
-
-EOM
-fn=d~
-rp='Where do you want to put the public architecture-dependent libraries?'
-. ./getfile
-archlib="$ans"
-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).
-
-EOM
- case "$installarchlib" in
- '') dflt=`echo $archlibexp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installarchlib";;
- esac
- fn=de~
- rp='Where will architecture-dependent library files be installed?'
- . ./getfile
- installarchlib="$ans"
-else
- installarchlib="$archlibexp"
-fi
-if $test X"$archlib" = X"$privlib"; then
- d_archlib="$undef"
-else
- d_archlib="$define"
-fi
-
-: 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'
-
: Look for GNU-cc style attribute checking
echo " "
echo "Checking whether your compiler can handle __attribute__ ..." >&4
@@ -3775,7 +4465,7 @@ main()
exit(0);
}
EOP
- if $cc $ccflags -o set set.c $ldflags $libs >/dev/null 2>&1; then
+ if $cc $ccflags $ldflags -o set set.c $libs >/dev/null 2>&1; then
./set 2>/dev/null
case $? in
0) echo "You have to use setpgrp() instead of setpgrp(pid, pgrp)." >&4
@@ -3814,22 +4504,21 @@ case "$intsize" in
main()
{
printf("%d\n", sizeof(int));
+ exit(0);
}
EOCP
- if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
- dflt=`./try`
+ if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
+ intsize=`./try`
+ echo "Your integers are $intsize bytes long."
else
dflt='4'
echo "(I can't seem to compile the test program. Guessing...)"
+ rp="What is the size of an integer (in bytes)?"
+ . ./myread
+ intsize="$ans"
fi
;;
-*)
- dflt="$intsize"
- ;;
esac
-rp="What is the size of an integer (in bytes)?"
-. ./myread
-intsize="$ans"
$rm -f try.c try
: see if signal is declared as pointer to function returning int or void
@@ -4253,9 +4942,6 @@ eval $setvar
$rm -f try.c
: see if dlerror exists
-: On NetBSD and FreeBSD, dlerror might be available, but it is in
-: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
-: use the nm extraction, but use a real compile and link test instead.
xxx_runnm="$runnm"
runnm=false
set dlerror d_dlerror
@@ -4267,9 +4953,6 @@ set dld.h i_dld
eval $inhdr
: see if dlopen exists
-: On NetBSD and FreeBSD, dlopen is available, but it is in
-: /usr/lib/crt0.o, not in any of the libraries. Therefore, do not
-: use the nm extraction, but use a real compile and link test instead.
xxx_runnm="$runnm"
runnm=false
set dlopen d_dlopen
@@ -4420,6 +5103,23 @@ EOM
;;
*) dflt="$lddlflags" ;;
esac
+
+: Try to guess additional flags to pick up local libraries.
+for thisflag in $ldflags; do
+ case "$thisflag" in
+ -L*)
+ case " $dflt " in
+ *" $thisflag "*) ;;
+ *) dflt="$dflt $thisflag" ;;
+ esac
+ ;;
+ esac
+done
+
+case "$dflt" in
+'') dflt='none' ;;
+esac
+
rp="Any special flags to pass to $ld to create a dynamically loaded library?"
. ./myread
case "$ans" in
@@ -4720,6 +5420,225 @@ eval $setvar
set dup2 d_dup2
eval $inlibc
+: Locate the flags for 'open()'
+echo " "
+$cat >open3.c <<'EOCP'
+#include <sys/types.h>
+#ifdef I_FCNTL
+#include <fcntl.h>
+#endif
+#ifdef I_SYS_FILE
+#include <sys/file.h>
+#endif
+main() {
+ if(O_RDONLY);
+#ifdef O_TRUNC
+ exit(0);
+#else
+ exit(1);
+#endif
+}
+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
+ h_sysfile=true;
+ echo "<sys/file.h> defines the O_* constants..." >&4
+ if ./open3; then
+ echo "and you have the 3 argument form of open()." >&4
+ val="$define"
+ else
+ echo "but not the 3 argument form of open(). Oh, well." >&4
+ val="$undef"
+ fi
+elif $test `./findhdr fcntl.h` && \
+ $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
+ h_fcntl=true;
+ echo "<fcntl.h> defines the O_* constants..." >&4
+ if ./open3; then
+ echo "and you have the 3 argument form of open()." >&4
+ val="$define"
+ else
+ echo "but not the 3 argument form of open(). Oh, well." >&4
+ val="$undef"
+ fi
+else
+ val="$undef"
+ echo "I can't find the O_* constant definitions! You got problems." >&4
+fi
+set d_open3
+eval $setvar
+$rm -f open3*
+
+: check for non-blocking I/O stuff
+case "$h_sysfile" in
+true) echo "#include <sys/file.h>" > head.c;;
+*)
+ case "$h_fcntl" in
+ true) echo "#include <fcntl.h>" > head.c;;
+ *) echo "#include <sys/fcntl.h>" > head.c;;
+ esac
+ ;;
+esac
+echo " "
+echo "Figuring out the flag used by open() for non-blocking I/O..." >&4
+case "$o_nonblock" in
+'')
+ $cat head.c > try.c
+ $cat >>try.c <<'EOCP'
+main() {
+#ifdef O_NONBLOCK
+ printf("O_NONBLOCK\n");
+ exit(0);
+#endif
+#ifdef O_NDELAY
+ printf("O_NDELAY\n");
+ exit(0);
+#endif
+#ifdef FNDELAY
+ printf("FNDELAY\n");
+ exit(0);
+#endif
+ exit(0);
+}
+EOCP
+ if $cc $ccflags $ldflags try.c -o try >/dev/null 2>&1; then
+ o_nonblock=`./try`
+ case "$o_nonblock" in
+ '') echo "I can't figure it out, assuming O_NONBLOCK will do.";;
+ *) echo "Seems like we can use $o_nonblock.";;
+ esac
+ else
+ echo "(I can't compile the test program; pray O_NONBLOCK is right!)"
+ fi
+ ;;
+*) echo "Using $hint value $o_nonblock.";;
+esac
+$rm -f try try.* .out core
+
+echo " "
+echo "Let's see what value errno gets from read() on a $o_nonblock file..." >&4
+case "$eagain" in
+'')
+ $cat head.c > try.c
+ $cat >>try.c <<EOCP
+#include <errno.h>
+#include <sys/types.h>
+#include <signal.h>
+extern int errno;
+$signal_t blech(x) int x; { exit(3); }
+main()
+{
+ int pd[2];
+ int pu[2];
+ char buf[1];
+ char string[100];
+
+ pipe(pd); /* Down: child -> parent */
+ pipe(pu); /* Up: parent -> child */
+ if (0 != fork()) {
+ int ret;
+ close(pd[1]); /* Parent reads from pd[0] */
+ close(pu[0]); /* Parent writes (blocking) to pu[1] */
+ if (-1 == fcntl(pd[0], F_SETFL, $o_nonblock))
+ exit(1);
+ signal(SIGALRM, blech);
+ alarm(5);
+ if ((ret = read(pd[0], buf, 1)) > 0) /* Nothing to read! */
+ exit(2);
+ sprintf(string, "%d\n", ret);
+ write(2, string, strlen(string));
+ alarm(0);
+#ifdef EAGAIN
+ if (errno == EAGAIN) {
+ printf("EAGAIN\n");
+ goto ok;
+ }
+#endif
+#ifdef EWOULDBLOCK
+ if (errno == EWOULDBLOCK)
+ printf("EWOULDBLOCK\n");
+#endif
+ ok:
+ write(pu[1], buf, 1); /* Unblocks child, tell it to close our pipe */
+ sleep(2); /* Give it time to close our pipe */
+ alarm(5);
+ ret = read(pd[0], buf, 1); /* Should read EOF */
+ alarm(0);
+ sprintf(string, "%d\n", ret);
+ write(3, string, strlen(string));
+ exit(0);
+ }
+
+ close(pd[0]); /* We write to pd[1] */
+ close(pu[1]); /* We read from pu[0] */
+ read(pu[0], buf, 1); /* Wait for parent to signal us we may continue */
+ close(pd[1]); /* Pipe pd is now fully closed! */
+ exit(0); /* Bye bye, thank you for playing! */
+}
+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
+ chmod +x mtry
+ ./mtry >/dev/null 2>&1
+ case $? in
+ 0) eagain=`$cat try.out`;;
+ 1) echo "Could not perform non-blocking setting!";;
+ 2) echo "I did a successful read() for something that was not there!";;
+ 3) echo "Hmm... non-blocking I/O does not seem to be working!";;
+ *) echo "Something terribly wrong happened during testing.";;
+ esac
+ rd_nodata=`$cat try.ret`
+ echo "A read() system call with no data present returns $rd_nodata."
+ case "$rd_nodata" in
+ 0|-1) ;;
+ *)
+ echo "(That's peculiar, fixing that to be -1.)"
+ rd_nodata=-1
+ ;;
+ esac
+ case "$eagain" in
+ '')
+ echo "Forcing errno EAGAIN on read() with no data available."
+ eagain=EAGAIN
+ ;;
+ *)
+ echo "Your read() sets errno to $eagain when no data is available."
+ ;;
+ esac
+ status=`$cat try.err`
+ case "$status" in
+ 0) echo "And it correctly returns 0 to signal EOF.";;
+ -1) echo "But it also returns -1 to signal EOF, so be careful!";;
+ *) echo "However, your read() returns '$status' on EOF??";;
+ esac
+ val="$define"
+ if test "$status" -eq "$rd_nodata"; then
+ echo "WARNING: you can't distinguish between EOF and no data!"
+ val="$undef"
+ fi
+ else
+ echo "I can't compile the test program--assuming errno EAGAIN will do."
+ eagain=EAGAIN
+ fi
+ set d_eofnblk
+ eval $setvar
+ ;;
+*)
+ echo "Using $hint value $eagain."
+ echo "Your read() returns $rd_nodata when no data is present."
+ case "$d_eofnblk" in
+ "$define") echo "And you can see EOF because read() returns 0.";;
+ "$undef") echo "But you can't see EOF status from read() returned value.";;
+ *)
+ echo "(Assuming you can't see EOF status from read anyway.)"
+ d_eofnblk=$undef
+ ;;
+ esac
+ ;;
+esac
+$rm -f try try.* .out core head.c mtry
+
: see if fchmod exists
set fchmod d_fchmod
eval $inlibc
@@ -4736,49 +5655,6 @@ eval $inlibc
set fgetpos d_fgetpos
eval $inlibc
-: see if we can have long filenames
-echo " "
-rmlist="$rmlist /tmp/cf$$"
-$test -d /tmp/cf$$ || mkdir /tmp/cf$$
-first=123456789abcdef
-second=/tmp/cf$$/$first
-$rm -f $first $second
-if (echo hi >$first) 2>/dev/null; then
- if $test -f 123456789abcde; then
- echo 'You cannot have filenames longer than 14 characters. Sigh.' >&4
- val="$undef"
- else
- if (echo hi >$second) 2>/dev/null; then
- if $test -f /tmp/cf$$/123456789abcde; then
- $cat <<'EOM'
-That's peculiar... You can have filenames longer than 14 characters, but only
-on some of the filesystems. Maybe you are using NFS. Anyway, to avoid problems
-I shall consider your system cannot support long filenames at all.
-EOM
- val="$undef"
- else
- echo 'You can have filenames longer than 14 characters.' >&4
- val="$define"
- fi
- else
- $cat <<'EOM'
-How confusing! Some of your filesystems are sane enough to allow filenames
-longer than 14 characters but some others like /tmp can't even think about them.
-So, for now on, I shall assume your kernel does not allow them at all.
-EOM
- val="$undef"
- fi
- fi
-else
- $cat <<'EOM'
-You can't have filenames longer than 14 chars. You can't even think about them!
-EOM
- val="$undef"
-fi
-set d_flexfnam
-eval $setvar
-$rm -rf /tmp/cf$$ 123456789abcde*
-
: see if flock exists
set flock d_flock
eval $inlibc
@@ -5122,56 +5998,6 @@ $rm -f malloc.[co]
set nice d_nice
eval $inlibc
-: Locate the flags for 'open()'
-echo " "
-$cat >open3.c <<'EOCP'
-#include <sys/types.h>
-#ifdef I_FCNTL
-#include <fcntl.h>
-#endif
-#ifdef I_SYS_FILE
-#include <sys/file.h>
-#endif
-main() {
- if(O_RDONLY);
-#ifdef O_TRUNC
- exit(0);
-#else
- exit(1);
-#endif
-}
-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
- h_sysfile=true;
- echo "<sys/file.h> defines the O_* constants..." >&4
- if ./open3; then
- echo "and you have the 3 argument form of open()." >&4
- val="$define"
- else
- echo "but not the 3 argument form of open(). Oh, well." >&4
- val="$undef"
- fi
-elif $test `./findhdr fcntl.h` && \
- $cc "-DI_FCNTL" open3.c -o open3 >/dev/null 2>&1 ; then
- h_fcntl=true;
- echo "<fcntl.h> defines the O_* constants..." >&4
- if ./open3; then
- echo "and you have the 3 argument form of open()." >&4
- val="$define"
- else
- echo "but not the 3 argument form of open(). Oh, well." >&4
- val="$undef"
- fi
-else
- val="$undef"
- echo "I can't find the O_* constant definitions! You got problems." >&4
-fi
-set d_open3
-eval $setvar
-$rm -f open3*
-
: see if pause exists
set pause d_pause
eval $inlibc
@@ -5180,6 +6006,10 @@ eval $inlibc
set pipe d_pipe
eval $inlibc
+: see if poll exists
+set poll d_poll
+eval $inlibc
+
: see if this is a pwd.h system
set pwd.h i_pwd
eval $inhdr
@@ -5304,7 +6134,7 @@ for (align = 7; align >= 0; align--) {
exit(0);
}
EOCP
- if $cc foo.c -o safebcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
+ if $cc $ccflags $ldflags foo.c -o safebcpy $libs >/dev/null 2>&1; then
if ./safebcpy 2>/dev/null; then
echo "Yes, it can."
val="$define"
@@ -5352,7 +6182,7 @@ for (align = 7; align >= 0; align--) {
exit(0);
}
EOCP
- if $cc foo.c -o safemcpy $ccflags $ldflags $libs >/dev/null 2>&1 ; then
+ if $cc $ccflags $ldflags foo.c -o safemcpy $libs >/dev/null 2>&1; then
if ./safemcpy 2>/dev/null; then
echo "Yes, it can."
val="$define"
@@ -5515,57 +6345,6 @@ fi
set d_shm
eval $setvar
-: determine whether the user wants to include a site-specific library
-: in addition to privlib.
-$cat <<EOM
-
-Some sites may wish to specify a local directory for $package
-to search by default in addition to $privlib.
-If you don't want to use such an additional directory, answer 'none'.
-
-EOM
-case "$sitelib" in
-'') dflt=none ;;
-*) dflt="$sitelib" ;;
-esac
-fn=d~+n
-rp='Local directory for additional library files?'
-. ./getfile
-if $test "X$sitelibexp" != "X$ansexp"; then
- installsitelib=''
-fi
-sitelib="$ans"
-sitelibexp="$ansexp"
-if $afs; then
- case "$sitelib" in
- '') installsitelib="$sitelibexp"
- ;;
- *) $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).
-
-EOM
- case "$installsitelib" in
- '') dflt=`echo $sitelibexp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installsitelib";;
- esac
- fn=de~
- rp='Where will additional local files be installed?'
- . ./getfile
- installsitelib="$ans"
- ;;
- esac
-else
- installsitelib="$sitelibexp"
-fi
-
-case "$sitelibexp" in
-'') d_sitelib=undef ;;
-*) d_sitelib=define ;;
-esac
-
socketlib=''
sockethdr=''
: see whether socket exists
@@ -5645,15 +6424,13 @@ if $contains '_IO_fpos_t' `./findhdr stdio.h` >/dev/null 2>&1 ; then
'') stdio_ptr='((fp)->_IO_read_ptr)'
ptr_lval=$define
;;
- *) ptr_lval=$d_stdio_ptr_lval
- ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
esac
case "$stdio_cnt" in
'') stdio_cnt='((fp)->_IO_read_end - (fp)->_IO_read_ptr)'
cnt_lval=$undef
;;
- *) cnt_lval=$d_stdio_cnt_lval
- ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
esac
case "$stdio_base" in
'') stdio_base='((fp)->_IO_read_base)';;
@@ -5666,15 +6443,13 @@ else
'') stdio_ptr='((fp)->_ptr)'
ptr_lval=$define
;;
- *) ptr_lval=$d_stdio_ptr_lval
- ;;
+ *) ptr_lval=$d_stdio_ptr_lval;;
esac
case "$stdio_cnt" in
'') stdio_cnt='((fp)->_cnt)'
cnt_lval=$define
;;
- *) cnt_lval=$d_stdio_cnt_lval
- ;;
+ *) cnt_lval=$d_stdio_cnt_lval;;
esac
case "$stdio_base" in
'') stdio_base='((fp)->_base)';;
@@ -5715,8 +6490,7 @@ $rm -f try.c try
set d_stdstdio
eval $setvar
-: Can _ptr be used as an lvalue. Only makes sense if we
-: have a known stdio implementation.
+: Can _ptr be used as an lvalue?
case "$d_stdstdio$ptr_lval" in
$define$define) val=$define ;;
*) val=$undef ;;
@@ -5724,9 +6498,7 @@ esac
set d_stdio_ptr_lval
eval $setvar
-
-: Can _cnt be used as an lvalue. Only makes sense if we
-: have a known stdio implementation.
+: Can _cnt be used as an lvalue?
case "$d_stdstdio$cnt_lval" in
$define$define) val=$define ;;
*) val=$undef ;;
@@ -5734,7 +6506,6 @@ esac
set d_stdio_cnt_lval
eval $setvar
-
: see if _base is also standard
val="$undef"
case "$d_stdstdio" in
@@ -5877,12 +6648,12 @@ case "$varval" in
done;
$cppstdin $cppflags $cppminus < temp.c >temp.E 2>/dev/null;
if $contains $type temp.E >/dev/null 2>&1; then
- eval "$var=$type";
+ eval "$var=\$type";
else
- eval "$var=$def";
+ eval "$var=\$def";
fi;
$rm -f temp.?;;
-*) eval "$var=$varval";;
+*) eval "$var=\$varval";;
esac'
: see if this is a sys/times.h system
@@ -5931,156 +6702,6 @@ eval $setvar
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
-
-: 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
-
-: 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 how we will look up host name
echo " "
if false; then
@@ -6299,38 +6920,6 @@ rp="Doubles must be aligned on a how-many-byte boundary?"
alignbytes="$ans"
$rm -f try.c try
-: determine where public executables go
-echo " "
-set dflt bin bin
-eval $prefixit
-fn=d~
-rp='Pathname where the public executables will reside?'
-. ./getfile
-if $test "X$ansexp" != "X$binexp"; then
- installbin=''
-fi
-bin="$ans"
-binexp="$ansexp"
-if $afs; then
- $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-executables 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 "$installbin" in
- '') dflt=`echo $binexp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installbin";;
- esac
- fn=de~
- rp='Where will public executables be installed?'
- . ./getfile
- installbin="$ans"
-else
- installbin="$binexp"
-fi
-
: check for ordering of bytes in a long
case "$byteorder" in
'')
@@ -6360,13 +6949,20 @@ main()
for (i = 0; i < sizeof(long); i++)
printf("%c", u.c[i]+'0');
printf("\n");
+ exit(0);
}
EOCP
- if $cc $ccflags try.c -o try >/dev/null 2>&1 ; then
+ xxx_prompt=y
+ if $cc $ccflags try.c -o try >/dev/null 2>&1 && ./try > /dev/null; then
dflt=`./try`
case "$dflt" in
- ????|????????) echo "(The test program ran ok.)";;
- *) echo "(The test program didn't run right for some reason.)";;
+ [1-4][1-4][1-4][1-4]|12345678|87654321)
+ echo "(The test program ran ok.)"
+ echo "byteorder=$dflt"
+ xxx_prompt=n
+ ;;
+ ????|????????) echo "(The test program ran ok.)" ;;
+ *) echo "(The test program didn't run right for some reason.)" ;;
esac
else
dflt='4321'
@@ -6374,15 +6970,17 @@ EOCP
(I can't seem to compile the test program. Guessing big-endian...)
EOM
fi
- ;;
-*)
- echo " "
- dflt="$byteorder"
+ case "$xxx_prompt" in
+ y)
+ rp="What is the order of bytes in a long?"
+ . ./myread
+ byteorder="$ans"
+ ;;
+ *) byteorder=$dflt
+ ;;
+ esac
;;
esac
-rp="What is the order of bytes in a long?"
-. ./myread
-byteorder="$ans"
$rm -f try.c try
: how do we catenate cpp tokens here?
@@ -6580,31 +7178,47 @@ echo "Hmm, your compiler has some difficulty with void. Checking further..." >&4
fi
fi
esac
-dflt="$voidflags";
-rp="Your void support flags add up to what?"
-. ./myread
-voidflags="$ans"
+: Only prompt user if voidflags is not 15. If voidflags is 15, then
+: we presume all is well.
+case "$voidflags" in
+15) ;;
+*) dflt="$voidflags";
+ rp="Your void support flags add up to what?"
+ . ./myread
+ voidflags="$ans"
+ ;;
+esac
$rm -f try.* .out
: see if dbm.h is available
-set dbm.h t_dbm
-eval $inhdr
-case "$t_dbm" in
+: see if dbmclose exists
+set dbmclose d_dbmclose
+eval $inlibc
+
+case "$d_dbmclose" in
$define)
- : see if dbmclose exists
- set dbmclose d_dbmclose
- eval $inlibc
- case "$d_dbmclose" in
- $undef)
- t_dbm="$undef"
- echo "We won't be including <dbm.h>"
+ set dbm.h i_dbm
+ eval $inhdr
+ case "$i_dbm" in
+ $define)
+ val="$undef"
+ set i_rpcsvcdbm
+ eval $setvar
+ ;;
+ *) set rpcsvc/dbm.h i_rpcsvcdbm
+ eval $inhdr
;;
esac
;;
+*) echo "We won't be including <dbm.h>"
+ val="$undef"
+ set i_dbm
+ eval $setvar
+ val="$undef"
+ set i_rpcsvcdbm
+ eval $setvar
+ ;;
esac
-val="$t_dbm"
-set i_dbm
-eval $setvar
: see if ndbm.h is available
set ndbm.h t_ndbm
@@ -6692,8 +7306,8 @@ for xxx in $known_extensions ; do
$define) avail_ext="$avail_ext $xxx" ;;
esac
;;
- ODBM_File) case "$i_dbm" in
- $define) avail_ext="$avail_ext $xxx" ;;
+ ODBM_File) case "${i_dbm}${i_rpcsvcdbm}" in
+ *"${define}"*) avail_ext="$avail_ext $xxx" ;;
esac
;;
POSIX) case "$useposix" in
@@ -6855,170 +7469,6 @@ rp="What type is lseek's offset on this system declared as?"
. ./myread
lseektype="$ans"
-: determine where manual pages go
-set man1dir man1dir none
-eval $prefixit
-$cat <<EOM
-
-$spackage has manual pages available in source form.
-EOM
-case "$nroff" in
-nroff)
- echo "However, you don't have nroff, so they're probably useless to you."
- case "$man1dir" in
- '') man1dir="none";;
- esac;;
-esac
-echo "If you don't want the manual sources installed, answer 'none'."
-case "$man1dir" in
-'')
- lookpath="$prefixexp/man/man1 $prefixexp/man/u_man/man1"
- lookpath="$lookpath $prefixexp/man/l_man/man1"
- lookpath="$lookpath /usr/local/man/man1 /opt/man/man1 /usr/man/manl"
- lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
- lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
- lookpath="$lookpath /usr/man/man.L"
- man1dir=`./loc . $prefixexp/man/man1 $lookpath`
- if $test -d "$man1dir"; then
- dflt="$man1dir"
- else
- dflt="$sysman"
- fi
- set dflt
- eval $prefixup
- ;;
-' ') dflt=none;;
-*) dflt="$man1dir"
- ;;
-esac
-echo " "
-fn=dn~
-rp="Where do the main $spackage manual pages (source) go?"
-. ./getfile
-if test "X$man1direxp" != "X$ansexp"; then
- installman1dir=''
-fi
-man1dir="$ans"
-man1direxp="$ansexp"
-case "$man1dir" in
-'') man1dir=' '
- installman1dir='';;
-esac
-if $afs; then
- $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-manual pages 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 "$installman1dir" in
- '') dflt=`echo $man1direxp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installman1dir";;
- esac
- fn=de~
- rp='Where will man pages be installed?'
- . ./getfile
- installman1dir="$ans"
-else
- installman1dir="$man1direxp"
-fi
-
-case "$man1dir" in
-' ') man1ext='0';;
-*l) man1ext=l;;
-*n) man1ext=n;;
-*o) man1ext=l;;
-*p) man1ext=n;;
-*C) man1ext=C;;
-*L) man1ext=L;;
-*L1) man1ext=L1;;
-*) man1ext=1;;
-esac
-
-: determine where library module manual pages go
-set man3dir man3dir none
-eval $prefixit
-$cat <<EOM
-
-$spackage has manual pages for many of the library modules.
-EOM
-
-case "$nroff" in
-nroff)
- $cat <<'EOM'
-However, you don't have nroff, so they're probably useless to you.
-You can use the supplied perldoc script instead.
-EOM
- case "$man3dir" in
- '') man3dir="none";;
- esac;;
-esac
-
-case "$d_flexfnam" in
-undef)
- $cat <<'EOM'
-However, your system can't handle the long file names like File::Basename.3.
-You can use the supplied perldoc script instead.
-EOM
- case "$man3dir" in
- '') man3dir="none";;
- esac;;
-esac
-
-echo "If you don't want the manual sources installed, answer 'none'."
-case "$man3dir" in
-'') dflt="$privlib/man/man3" ;;
-' ') dflt=none;;
-*) dflt="$man3dir" ;;
-esac
-echo " "
-
-fn=dn~
-rp="Where do the $spackage library man pages (source) go?"
-. ./getfile
-if test "X$man3direxp" != "X$ansexp"; then
- installman3dir=''
-fi
-
-man3dir="$ans"
-man3direxp="$ansexp"
-case "$man3dir" in
-'') man3dir=' '
- installman3dir='';;
-esac
-if $afs; then
- $cat <<EOM
-
-Since you are running AFS, I need to distinguish the directory in which
-manual pages 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 "$installman3dir" in
- '') dflt=`echo $man3direxp | sed 's#^/afs/#/afs/.#'`;;
- *) dflt="$installman3dir";;
- esac
- fn=de~
- rp='Where will man pages be installed?'
- . ./getfile
- installman3dir="$ans"
-else
- installman3dir="$man3direxp"
-fi
-
-case "$man3dir" in
-' ') man3ext='0';;
-*l) man3ext=l;;
-*n) man3ext=n;;
-*o) man3ext=l;;
-*p) man3ext=n;;
-*C) man3ext=C;;
-*L) man3ext=L;;
-*L3) man3ext=L3;;
-*) man3ext=3;;
-esac
-
: see what type is used for mode_t
set mode_t modetype int stdio.h sys/types.h
eval $typedef
@@ -7140,59 +7590,6 @@ else
fi
$rm -f foo* bar*
-: 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
-
: see if sys/select.h has to be included
set sys/select.h i_sysselct
eval $inhdr
@@ -7419,51 +7816,85 @@ EOCP
fi
$rm -f try.[co]
;;
-*) selecttype = 'int *'
+*) selecttype='int *'
;;
esac
-: generate list of signal names
-echo " "
-case "$sig_name" in
-'')
- echo "Generating a list of signal names..." >&4
- xxx=`./findhdr signal.h`" "`./findhdr sys/signal.h`
- xxx="$xxx "`./findhdr linux/signal.h`
- set X `cat $xxx 2>&1 | $awk '
-$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $3 ~ /^[1-9][0-9]*$/ {
- sig[$3] = substr($2,4,20)
- if (max < $3 && $3 < 60) {
- max = $3
- }
+: Trace out the files included by signal.h, then look for SIGxxx names.
+: Remove SIGARRAYSIZE used by HPUX.
+xxx=`echo '#include <signal.h>' |
+ $cppstdin $cppminus $cppflags 2>/dev/null |
+ $grep '^[ ]*#.*include' |
+ $awk "{print \\$$fieldn}" | $sed 's!"!!g' | $sort | $uniq`
+: Check this list of files to be sure we have parsed the cpp output ok.
+: This will also avoid potentially non-existent files, such
+: as ../foo/bar.h
+xxxfiles=''
+for xx in $xxx /dev/null ; do
+ $test -f "$xx" && xxxfiles="$xxxfiles $xx"
+done
+: If we have found no files, at least try signal.h
+case "$xxxfiles" in
+'') xxxfiles=`./findhdr signal.h` ;;
+esac
+xxx=`awk '
+$1 ~ /^#define$/ && $2 ~ /^SIG[A-Z0-9]*$/ && $2 !~ /SIGARRAYSIZE/ {
+ print substr($2, 4, 20)
+}
+$1 == "#" && $2 ~ /^define$/ && $3 ~ /^SIG[A-Z0-9]*$/ && $3 !~ /SIGARRAYSIZE/ {
+ print substr($3, 4, 20)
+}' $xxxfiles`
+: Append some common names just in case the awk scan failed.
+xxx="$xxx ABRT ALRM BUS CHLD CLD CONT DIL EMT FPE HUP ILL INT IO IOT KILL"
+xxx="$xxx LOST PHONE PIPE POLL PROF PWR QUIT SEGV STKFLT STOP SYS TERM TRAP"
+xxx="$xxx TSTP TTIN TTOU URG USR1 USR2 USR3 USR4 VTALRM"
+xxx="$xxx WINCH WIND WINDOW XCPU XFSZ"
+: generate a few handy files for later
+echo $xxx | $tr ' ' '\012' | $awk '
+BEGIN {
+ printf "#include <signal.h>\n";
+ printf "main() {\n";
+}
+{
+ printf "#ifdef SIG"; printf $1; printf "\n"
+ printf "printf(\""; printf $1; printf " %%d\\n\",SIG";
+ printf $1; printf ");\n"
+ printf "#endif\n"
}
-
END {
- for (i = 1; i <= max; i++) {
- if (sig[i] == "")
- printf "%d", i
- else
- printf "%s", sig[i]
- if (i < max)
- printf " "
- }
- printf "\n"
+ printf "}\n";
}
-'`
+' >signal.c
+$cat >signal.cmd <<EOS
+$startsh
+$test -s signal.lst && exit 0
+if $cc $ccflags signal.c -o signal $ldflags >/dev/null 2>&1; then
+ ./signal | $sort -n +1 | $uniq >signal.lst
+else
+ echo "(I can't seem be able to compile the test program -- Guessing)"
+ echo 'kill -l' >signal
+ set X \`csh -f <signal\`
+ $rm -f signal
shift
- case $# in
- 0)
- echo 'kill -l' >/tmp/foo$$
- set X `csh -f </tmp/foo$$`
- $rm -f /tmp/foo$$
- shift
- case $# in
- 0)set HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM
- ;;
- esac
- ;;
+ case \$# in
+ 0) set HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM;;
esac
- sig_name="ZERO $*"
+ echo \$@ | $tr ' ' '\012' | \
+ $awk '{ printf $1; printf " %d\n", ++s; }' >signal.lst
+fi
+$rm -f signal.c signal signal.o
+EOS
+chmod a+x signal.cmd
+$eunicefix signal.cmd
+
+: generate list of signal names
+echo " "
+case "$sig_name" in
+'')
+ echo "Generating a list of signal names..." >&4
+ ./signal.cmd
+ sig_name=`$awk '{printf "%s ", $1}' signal.lst`
+ sig_name="ZERO $sig_name"
;;
esac
echo "The following signals are available:"
@@ -7471,7 +7902,7 @@ echo " "
echo $sig_name | $awk \
'BEGIN { linelen = 0 }
{
- for (i = 1; i < NF; i++) {
+ for (i = 1; i <= NF; i++) {
name = "SIG" $i " "
linelen = linelen + length(name)
if (linelen > 70) {
@@ -7480,8 +7911,23 @@ echo $sig_name | $awk \
}
printf "%s", name
}
+ printf "\n"
}'
+
+: generate list of signal numbers
echo " "
+case "$sig_num" in
+'')
+ echo "Generating a list of signal numbers..." >&4
+ ./signal.cmd
+ sig_num=`$awk '{printf "%d ", $2}' signal.lst`
+ sig_num="0 $sig_num"
+ ;;
+esac
+case "$sig_max" in
+'') sig_max=`$tail -1 signal.lst | $awk '{print $2}'` ;;
+esac
+echo "The maximum signal number defined is $sig_max."
: see what type is used for size_t
set size_t sizetype 'unsigned int' stdio.h sys/types.h
@@ -7583,7 +8029,7 @@ val=''
set sys/file.h val
eval $inhdr
-: do we need to #include <sys/file.h> ?
+: do we need to include sys/file.h ?
case "$val" in
"$define")
echo " "
@@ -8104,6 +8550,7 @@ cccdlflags='$cccdlflags'
ccdlflags='$ccdlflags'
ccflags='$ccflags'
cf_by='$cf_by'
+cf_email='$cf_email'
cf_time='$cf_time'
chgrp='$chgrp'
chmod='$chmod'
@@ -8152,6 +8599,7 @@ d_dlopen='$d_dlopen'
d_dlsymun='$d_dlsymun'
d_dosuid='$d_dosuid'
d_dup2='$d_dup2'
+d_eofnblk='$d_eofnblk'
d_eunice='$d_eunice'
d_fchmod='$d_fchmod'
d_fchown='$d_fchown'
@@ -8204,6 +8652,7 @@ d_pathconf='$d_pathconf'
d_pause='$d_pause'
d_phostname='$d_phostname'
d_pipe='$d_pipe'
+d_poll='$d_poll'
d_portable='$d_portable'
d_pwage='$d_pwage'
d_pwchange='$d_pwchange'
@@ -8295,6 +8744,7 @@ direntrytype='$direntrytype'
dlext='$dlext'
dlsrc='$dlsrc'
dynamic_ext='$dynamic_ext'
+eagain='$eagain'
echo='$echo'
egrep='$egrep'
emacs='$emacs'
@@ -8337,6 +8787,7 @@ i_ndbm='$i_ndbm'
i_neterrno='$i_neterrno'
i_niin='$i_niin'
i_pwd='$i_pwd'
+i_rpcsvcdbm='$i_rpcsvcdbm'
i_sgtty='$i_sgtty'
i_stdarg='$i_stdarg'
i_stddef='$i_stddef'
@@ -8390,6 +8841,8 @@ lint='$lint'
lkflags='$lkflags'
ln='$ln'
lns='$lns'
+locincpth='$locincpth'
+loclibpth='$loclibpth'
lp='$lp'
lpr='$lpr'
ls='$ls'
@@ -8421,6 +8874,7 @@ myuname='$myuname'
n='$n'
nm_opt='$nm_opt'
nroff='$nroff'
+o_nonblock='$o_nonblock'
optimize='$optimize'
orderlib='$orderlib'
osname='$osname'
@@ -8429,6 +8883,7 @@ package='$package'
passcat='$passcat'
patchlevel='$patchlevel'
perl='$perl'
+perladmin='$perladmin'
pg='$pg'
phostname='$phostname'
plibpth='$plibpth'
@@ -8441,6 +8896,7 @@ privlibexp='$privlibexp'
prototype='$prototype'
randbits='$randbits'
ranlib='$ranlib'
+rd_nodata='$rd_nodata'
rm='$rm'
rmail='$rmail'
runnm='$runnm'
@@ -8455,7 +8911,9 @@ sharpbang='$sharpbang'
shmattype='$shmattype'
shrpdir='$shrpdir'
shsharp='$shsharp'
+sig_max='$sig_max'
sig_name='$sig_name'
+sig_num='$sig_num'
signal_t='$signal_t'
sitelib='$sitelib'
sitelibexp='$sitelibexp'