home *** CD-ROM | disk | FTP | other *** search
- Subject: v22i061: ELM mail syste, release 2.3, Part02/26
- Newsgroups: comp.sources.unix
- Approved: rsalz@uunet.UU.NET
- X-Checksum-Snefru: aae9f1d0 b687e788 392aac14 6118e224
-
- Submitted-by: Syd Weinstein <syd@dsinc.dsi.com>
- Posting-number: Volume 22, Issue 61
- Archive-name: elm2.3/part02
-
- ---- Cut Here and unpack ----
- #!/bin/sh
- # this is part 2 of a multipart archive
- # do not concatenate these parts, unpack them in order with /bin/sh
- # file Configure continued
- #
- CurArch=2
- if test ! -r s2_seq_.tmp
- then echo "Please unpack part 1 first!"
- exit 1; fi
- ( read Scheck
- if test "$Scheck" != $CurArch
- then echo "Please unpack part $Scheck next!"
- exit 1;
- else exit 0; fi
- ) < s2_seq_.tmp || exit 1
- echo "x - Continuing file Configure"
- sed 's/^X//' << 'SHAR_EOF' >> Configure
- X *large*)
- X case "$large" in
- X '') dflt='-Ml';;
- X *) dflt="$large";;
- X esac
- X rp="What flag indicates large model? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X none) ans='';
- X esac
- X large="$ans"
- X ;;
- X *) large='';;
- X esac
- X case "$models" in
- X *huge*)
- X case "$huge" in
- X '') dflt='-Mh';;
- X *) dflt="$huge";;
- X esac
- X rp="What flag indicates huge model? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X none) ans='';
- X esac
- X huge="$ans"
- X ;;
- X *) huge="$large";;
- X esac
- X case "$models" in
- X *medium*)
- X case "$medium" in
- X '') dflt='-Mm';;
- X *) dflt="$medium";;
- X esac
- X rp="What flag indicates medium model? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X none) ans='';
- X esac
- X medium="$ans"
- X ;;
- X *) medium="$large";;
- X esac
- X case "$models" in
- X *small*)
- X case "$small" in
- X '') dflt='none';;
- X *) dflt="$small";;
- X esac
- X rp="What flag indicates small model? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X none) ans='';
- X esac
- X small="$ans"
- X ;;
- X *) small='';;
- X esac
- X ;;
- X*)
- X echo "Unrecognized memory models--you may have to edit Makefile.SH"
- X ;;
- Xesac
- Xfi
- X
- X: see if we need a special compiler
- Xecho " "
- Xif usg; then
- X case "$cc" in
- X '')
- X case "$Mcc" in
- X /*) dflt='Mcc'
- X ;;
- X *)
- X case "$large" in
- X -M*)
- X dflt='cc'
- X ;;
- X *)
- X if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
- X dflt='cc -M'
- X else
- X dflt='cc'
- X fi
- X ;;
- X esac
- X ;;
- X esac
- X ;;
- X *) dflt="$cc";;
- X esac
- X $cat <<'EOM'
- X
- XOn some systems the default C compiler will not resolve multiple global
- Xreferences that happen to have the same name. On some such systems the
- X"Mcc" command may be used to force these to be resolved. On other systems
- Xa "cc -M" command is required. (Note that the -M flag on other systems
- Xindicates a memory model to use!) If you have the Gnu C compiler, you
- Xmight wish to use that instead. What command will force resolution on
- XEOM
- X $echo $n "this system? [$dflt] $c"
- X rp="Command to resolve multiple refs? [$dflt]"
- X . myread
- X cc="$ans"
- Xelse
- X case "$cc" in
- X '') dflt=cc;;
- X *) dflt="$cc";;
- X esac
- X rp="Use which C compiler? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X cc="$ans"
- Xfi
- Xcase "$cc" in
- Xgcc*) cpp=`loc gcc-cpp $cpp $pth`;;
- Xesac
- X
- X: determine optimize, if desired, or use for debug flag also
- Xcase "$optimize" in
- X' ') dflt="none"
- X ;;
- X'') dflt="-O";
- X ;;
- X*) dflt="$optimize"
- X ;;
- Xesac
- Xcat <<EOH
- X
- XSome C compilers have problems with their optimizers, by default, $package
- Xcompiles with the -O flag to use the optimizer. Alternately, you might
- Xwant to use the symbolic debugger, which uses the -g flag (on traditional
- XUnix systems). Either flag can be specified here. To use neither flag,
- Xspecify the word "none".
- X
- XEOH
- Xrp="What optimizer/debugger flag should be used? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xoptimize="$ans"
- Xcase "$optimize" in
- X'none') optimize=" "
- X ;;
- Xesac
- X
- Xcase "$ccflags" in
- X'') case "$cc" in
- X *gcc*) dflt='-fpcc-struct-return';;
- X *) dflt='';;
- X esac
- X ;;
- X*) dflt="$ccflags";;
- Xesac
- Xfor thisincl in $inclwanted; do
- X if test -d $thisincl; then
- X case "$dflt" in
- X *$thisincl*);;
- X *) dflt="$dflt -I$thisincl";;
- X esac
- X fi
- Xdone
- Xcase "$optimize" in
- X-g*)
- X case "$dflt" in
- X *DEBUG*);;
- X *) dflt="$dflt -DDEBUG";;
- X esac
- X ;;
- Xesac
- Xcase "$dflt" in
- X'') dflt=none;;
- Xesac
- Xif $test -n "$xencf" ; then
- X $echo "Xenix 286 system, using compiler flags $xencf"
- X $echo "do not respecify these flags below."
- X $echo ""
- Xfi
- Xcat <<EOH
- X
- XYour C compiler may want other flags. For this question you should
- Xinclude -I/whatever and -DWHATEVER flags and any other flags used by
- Xthe C compiler, but you should NOT include libraries or ld flags like
- X-lwhatever. To use no flags, specify the word "none".
- X
- XEOH
- Xrp="Any additional cc flags? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xccflags="$ans"
- X
- X: the following weeds options from ccflags that are of no interest to cpp
- Xcppflags="$ccflags"
- Xcase "$cc" in
- X*gcc*) cppflags="$cppflags -D__GNUC__";;
- Xesac
- Xcase "$cppflags" in
- X'');;
- X*) set X $cppflags
- X cppflags=''
- X for flag do
- X case $flag in
- X -D*|-I*) cppflags="$cppflags $flag";;
- X esac
- X done
- X case "$cppflags" in
- X *-*) echo "(C preprocessor flags: $cppflags)";;
- X esac
- X ;;
- Xesac
- X
- Xif $test -n "$xenlf" ; then
- X $echo "Xenix 286 system, using linker flags $xenlf"
- X $echo "do not respecify these flags below"
- X $echo ""
- Xfi
- Xcase "$ldflags" in
- X'') if venix; then
- X dflt='-i -z'
- X else
- X dflt='none'
- X fi
- X ;;
- X*) dflt="$ldflags";;
- Xesac
- Xecho " "
- Xrp="Any additional ld flags (NOT including libraries)? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xldflags="$ans"
- Xrmlist="$rmlist pdp11"
- X
- Xecho " "
- Xecho "Checking for optional libraries..."
- Xcase "$libs" in
- X'') dflt='';;
- X*) dflt="$libs";;
- Xesac
- Xcase "$libswanted" in
- X'') libswanted='c_s';;
- Xesac
- Xfor thislib in $libswanted; do
- X case "$thislib" in
- X dbm) thatlib=ndbm;;
- X *_s) thatlib=NONE;;
- X *) thatlib="${thislib}_s";;
- X *) thatlib=NONE;;
- X esac
- X xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib`
- X if test -f $xxx; then
- X echo "Found -l$thislib."
- X case "$dflt" in
- X *-l$thislib*|*-l$thatlib*);;
- X *) dflt="$dflt -l$thislib";;
- X esac
- X else
- X xxx=`loc lib$thislib.a X $libpth`
- X if test -f $xxx; then
- X echo "Found $xxx."
- X case "$dflt" in
- X *$xxx*);;
- X *) dflt="$dflt $xxx";;
- X esac
- X else
- X xxx=`loc Slib$thislib.a X $xlibpth`
- X if test -f $xxx; then
- X echo "Found -l$thislib."
- X case "$dflt" in
- X *-l$thislib*|*-l$thatlib*);;
- X *) dflt="$dflt -l$thislib";;
- X esac
- X else
- X echo "No -l$thislib."
- X fi
- X fi
- X fi
- Xdone
- Xset X $dflt
- Xshift
- Xdflt="$*"
- Xcase "$dflt" in
- X'') dflt='none';;
- Xesac
- X
- X$cat <<EOM
- X
- XSome versions of Unix support shared libraries, which make
- Xexecutables smaller but make load time slightly longer.
- X
- XOn some systems, mostly newer Unix System V's, the shared library
- Xis included by putting the option "-lc_s" as the last thing on the
- Xcc command line when linking. Other systems use shared libraries
- Xby default. There may be other libraries needed to compile $package
- Xon your machine as well. If your system needs the "-lc_s" option,
- Xinclude it here. Include any other special libraries here as well.
- XSay "none" for none.
- XEOM
- X
- Xecho " "
- Xrp="Any additional libraries? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xnone) ans='';
- Xesac
- Xlibs="$ans"
- X
- X: check for ordering of bytes in a long
- Xcase "$byteorder" in
- X'')
- Xcat <<'EOM'
- X
- XIn the following, larger digits indicate more significance. A big-endian
- Xmachine like a Pyramid or a Motorola 680?0 chip will come out to 4321. A
- Xlittle-endian machine like a Vax or an Intel 80?86 chip would be 1234. Other
- Xmachines may have weird orders like 3412. A Cray will report 87654321. If
- Xthe test program works the default is probably right.
- XI'm now running the test program...
- XEOM
- X $cat >try.c <<'EOCP'
- X#include <stdio.h>
- Xmain()
- X{
- X int i;
- X union {
- X unsigned long l;
- X char c[sizeof(long)];
- X } u;
- X
- X if (sizeof(long) > 4)
- X u.l = 0x0807060504030201;
- X else
- X u.l = 0x04030201;
- X for (i=0; i < sizeof(long); i++)
- X printf("%c",u.c[i]+'0');
- X printf("\n");
- X}
- XEOCP
- X if $cc try.c -o try >/dev/null 2>&1 ; then
- X dflt=`./try`
- X case "$dflt" in
- X ????|????????) echo "(The test program ran ok.)";;
- X *) echo "(The test program didn't run right for some reason.)";;
- X esac
- X else
- X dflt='4321'
- X echo "(I can't seem to compile the test program. Guessing big-endian...)"
- X fi
- X ;;
- X*)
- X echo " "
- X dflt="$byteorder"
- X ;;
- Xesac
- Xrp="What is the order of bytes in a long? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xbyteorder="$ans"
- X$rm -f try.c try
- X
- X: get list of predefined functions in a handy place
- Xecho " "
- Xcase "$libc" in
- X'') libc=unknown;;
- Xesac
- Xcase "$libpth" in
- X'') libpth='/lib /usr/lib /usr/local/lib';;
- Xesac
- Xcase "$libs" in
- X*-lc_s*) libc=`loc libc_s.a $libc $libpth`
- Xesac
- Xlibnames='';
- Xcase "$libs" in
- X'') ;;
- X*) for thislib in $libs; do
- X case "$thislib" in
- X -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
- X try=`loc lib$thislib.a blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc lib$thislib blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc $thislib blurfl/dyick $libpth`
- X if test ! -f $try; then
- X try=`loc Slib$thislib.a blurfl/dyick $xlibpth`
- X if test ! -f $try; then
- X try=''
- X fi
- X fi
- X fi
- X fi
- X libnames="$libnames $try"
- X ;;
- X *) libnames="$libnames $thislib" ;;
- X esac
- X done
- X ;;
- Xesac
- Xset /usr/lib/libc.so.[0-9]*
- Xeval set \$$#
- Xif test -f "$1"; then
- X echo "Your shared C library is in $1."
- X libc="$1"
- Xelif test -f $libc; then
- X echo "Your C library is in $libc, like you said before."
- Xelif test -f /lib/libc.a; then
- X echo "Your C library is in /lib/libc.a. You're normal."
- X libc=/lib/libc.a
- Xelse
- X if test "$uname_os" != DomainOS ; then
- X ans=`loc libc.a blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc libc blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc clib blurfl/dyick $libpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Slibc.a blurfl/dyick $xlibpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Mlibc.a blurfl/dyick $xlibpth`
- X fi
- X if test ! -f "$ans"; then
- X ans=`loc Llibc.a blurfl/dyick $xlibpth`
- X fi
- X if test -f "$ans"; then
- X echo "Your C library is in $ans, of all places."
- X libc=$ans
- X else
- X cat <<EOM
- X
- XI can't seem to find your C library. I've looked in the following places:
- X
- X $libpth
- X
- XNone of these seems to contain your C library. What is the full name
- XEOM
- X dflt=None
- X $echo $n "of your C library? $c"
- X rp='C library full name?'
- X . myread
- X libc="$ans"
- X fi
- Xfi
- Xecho " "
- Xset `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
- X$echo $n "Extracting names from $* for later perusal...$c"
- Xnm $* 2>/dev/null >libc.tmp
- X$sed -n -e 's/^.* [AT] *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
- Xif $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- Xelse
- X $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
- X $contains '^printf$' libc.list >/dev/null 2>&1 || \
- X $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
- X $contains '^printf$' libc.list >/dev/null 2>&1 || \
- X $sed -n -e 's/^_//' \
- X -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
- X if $contains '^printf$' libc.list >/dev/null 2>&1; then
- X echo "done"
- X else
- X echo " "
- X echo "nm didn't seem to work right."
- X echo "Trying ar instead..."
- X if ar t $libc > libc.tmp; then
- X for thisname in $libnames; do
- X ar t $thisname >>libc.tmp
- X done
- X $sed -e 's/\.o$//' < libc.tmp > libc.list
- X echo "Ok."
- X else
- X echo "ar didn't seem to work right."
- X echo "Maybe this is a Cray...trying bld instead..."
- X if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
- X for thisname in $libnames; do
- X bld t $libnames | \
- X $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
- X ar t $thisname >>libc.tmp
- X done
- X echo "Ok."
- X else
- X echo "That didn't work either. Giving up."
- X exit 1
- X fi
- X fi
- X fi
- Xfi
- X
- Xinlibc='echo " ";
- Xif $contains "^$1\$" libc.list >/dev/null 2>&1;
- Xthen echo "$1() found"; eval "$2=$define";
- Xelse echo "$1() not found"; eval "$2=$undef"; fi'
- X
- Xrmlist="$rmlist libc.tmp libc.list"
- X
- X: see if nfs exists
- Xecho " "
- Xdflt=`loc exports xyz /etc /usr/etc`
- Xif $test "$dflt" = xyz; then
- X dflt=`loc nfsd xyz /etc /usr/etc $pth`
- Xfi
- Xif $test "$dflt" = xyz; then
- X echo "System does not support NFS, internal byte order will be used"
- X d_nfs="$undef"
- Xelse
- X echo "System supports NFS, network byte order will be used"
- X d_nfs="$define"
- Xfi
- X
- Xif $test "$d_nfs" = "$define"; then
- X case "$byteorder" in
- X 4321)
- X d_networkorder="$undef";
- X ;;
- X *)
- X d_networkorder="$define";
- X if $contains ntohl libc.list >/dev/null 2>&1; then
- X echo 'ntohl found in libc, no special libraries needed for network byte ordering'
- X else
- X echo 'ntohl not found in libc, be sure to specify the library for network support'
- X echo 'as an optional library'
- X fi
- X ;;
- X esac
- Xelse
- X d_networkorder="$undef";
- Xfi
- X
- X: get calendar mode and default calendar file name
- X$cat <<EOM
- X
- XThere is a neat feature that enables scanning of the message body for
- Xentries to add to the users ".calendar" (or whatever) file. These
- Xentries are then processed by the system program calendar. To use
- Xthis feature it needs to be enabled. The name of the per user calendar
- Xfile used by your systems calendar program is also required.
- XEOM
- X
- Xcase "$d_calendar" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=y;;
- Xesac
- X
- Xrp="Enable calendar feature [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_calendar="$define";;
- X*) d_calendar="$undef";;
- Xesac
- X
- Xcase "$calendar" in
- X '') dflt='calendar';;
- X *) dflt=$calendar;;
- Xesac
- X
- Xif $test "$d_calendar" = "$define"; then
- X echo " "
- X rp="Default calendar file: [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X calendar="$ans"
- Xfi
- X
- X: find out how to find out full name
- Xecho " "
- Xcase "$d_berknames" in
- X"$define")
- X dflt=y;;
- X"$undef")
- X dflt=n;;
- X*)
- X if bsd; then
- X dflt=y
- X elif xenix; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X ;;
- Xesac
- Xecho "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
- X$echo $n "thing after ':' in GCOS field)? [$dflt] $c"
- Xrp="Berkeley/V7 format full name? [$dflt]"
- X. myread
- Xcase "$ans" in
- X y*)
- X d_passnames="$define"
- X d_berknames="$define"
- X d_usgnames="$undef"
- X nametype=bsd
- X ;;
- X *)
- X echo " "
- X case "$d_usgnames" in
- X "$define")
- X dflt=y;;
- X "$undef")
- X dflt=n;;
- X *)
- X if usg; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X ;;
- X esac
- X echo "Does your passwd file keep full names in USG format (name sandwiched"
- X $echo $n "between a '-' and a '(')? [$dflt] $c"
- X rp="USG format full name? [$dflt]"
- X . myread
- X case "$ans" in
- X n*)
- X echo "Full name will be taken from ~/.fullname"
- X d_passnames="$undef"
- X d_berknames="$undef"
- X d_usgnames="$undef"
- X nametype=other
- X ;;
- X *)
- X d_passnames="$define"
- X d_berknames="$undef"
- X d_usgnames="$define"
- X nametype=usg
- X ;;
- X esac
- X ;;
- Xesac
- X
- X: see if we have to deal with yellow pages
- Xif $test -d /usr/etc/yp; then
- X if $test "$passcat" = "ypcat passwd"; then
- X dflt=y
- X elif $contains '^\+:' /etc/passwd; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X rp="Are you getting the passwd file via yellow pages? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) passcat='ypcat passwd';;
- X *) passcat='cat /etc/passwd';;
- X esac
- Xelse
- X passcat='cat /etc/passwd'
- Xfi
- X
- X: see if crypt exists
- Xecho " "
- Xif $contains '^crypt$' libc.list >/dev/null 2>&1; then
- X echo 'crypt() found.'
- X d_crypt="$define"
- X cryptlib=''
- Xelse
- X cryptlib=`loc Slibcrypt.a "" $xlibpth`
- X if $test -z "$cryptlib"; then
- X cryptlib=`loc Mlibcrypt.a "" $xlibpth`
- X else
- X cryptlib=-lcrypt
- X fi
- X if $test -z "$cryptlib"; then
- X cryptlib=`loc Llibcrypt.a "" $xlibpth`
- X else
- X cryptlib=-lcrypt
- X fi
- X if $test -z "$cryptlib"; then
- X cryptlib=`loc libcrypt.a "" $libpth`
- X else
- X cryptlib=-lcrypt
- X fi
- X if $test -z "$cryptlib"; then
- X echo 'crypt() not found.'
- X d_crypt="$undef"
- X else
- X d_crypt="$define"
- X fi
- Xfi
- X
- X: check for cuserid function
- Xecho " "
- Xif $contains '^cuserid$' libc.list >/dev/null 2>&1 ; then
- X echo "cuserid() found."
- X d_cuserid="$undef"
- Xelse
- X echo "No cuserid() found--will use mine."
- X d_cuserid="$define"
- Xfi
- X
- X: now get the host name
- Xecho " "
- Xecho "Figuring out host name..."
- Xecho 'Maybe "hostname" will work...'
- Xif ans=`sh -c hostname 2>&1` ; then
- X hostname=$ans
- X phostname=hostname
- Xelse
- X if xenix; then
- X echo 'Oh, dear. Maybe "/etc/systemid" is the key...'
- X if ans=`cat /etc/systemid 2>&1` ; then
- X hostname=$ans
- X phostname='cat /etc/systemid'
- X echo "Whadyaknow. Xenix always was a bit strange..."
- X else
- X echo 'No, maybe "uuname -l" will work...'
- X if ans=`sh -c 'uuname -l' 2>&1` ; then
- X hostname=$ans
- X phostname='uuname -l'
- X else
- X echo 'Strange. Maybe "uname -n" will work...'
- X if ans=`sh -c 'uname -n' 2>&1` ; then
- X hostname=$ans
- X phostname='uname -n'
- X else
- X echo 'Oh well, maybe I can mine it out of whoami.h...'
- X if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
- X hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
- X phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
- X else
- X case "$hostname" in
- X '') echo "Does this machine have an identity crisis or something?"
- X phostname=''
- X ;;
- X *) echo "Well, you said $hostname before...";;
- X esac
- X fi
- X fi
- X fi
- X fi
- X else
- X if $test -r /etc/systemid ; then
- X echo "What is a non-Xenix system doing with /etc/systemid?"
- X fi
- X echo 'No, maybe "uuname -l" will work...'
- X if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
- X hostname=$ans
- X phostname="$uuname -l"
- X else
- X echo 'Strange. Maybe "uname -n" will work...'
- X if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
- X hostname=$ans
- X phostname="$uname -n"
- X else
- X if ans=`cat /etc/systemid 2>&1` ; then
- X hostname=$ans
- X phostname='cat /etc/systemid'
- X echo "Well, I'll use the systemid file anyway..."
- X else
- X echo 'Oh well, maybe I can mine it out of whoami.h...'
- X if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
- X hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
- X phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
- X else
- X case "$hostname" in
- X '') echo "Does this machine have an identity crisis or something?"
- X phostname=''
- X ;;
- X *) echo "Well, you said $hostname before...";;
- X esac
- X fi
- X fi
- X fi
- X fi
- X fi
- Xfi
- X: you do not want to know about this
- Xset $hostname
- Xhostname=$1
- X
- X: translate upper to lower if necessary
- Xcase "$hostname" in
- X *[A-Z]*)
- X hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
- X echo "(Normalizing case in your host name)"
- X ;;
- Xesac
- X
- X: verify guess
- Xif $test "$hostname" ; then
- X dflt=y
- X echo 'Your host name appears to be "'$hostname'".'
- X $echo $n "Is this correct? [$dflt] $c"
- X rp="Sitename is $hostname? [$dflt]"
- X . myread
- X case "$ans" in
- X y*) ;;
- X *) hostname='' ;;
- X esac
- Xfi
- X
- X: bad guess or no guess
- Xwhile $test "X$hostname" = X ; do
- X dflt=''
- X rp="Please type the (one word) name of your host:"
- X $echo $n "$rp $c"
- X . myread
- X hostname="$ans"
- Xdone
- X
- Xecho " "
- Xcase "$hostname" in
- X*.*)
- X dflt=`$expr "X$hostname" : "X[^.]*\(\..*\)"`
- X hostname=`$expr "X$hostname" : "X\([^.]*\)\."`
- X echo "(Trimming domain name from host name--host name is now $hostname)"
- X ;;
- X*) case "$mydomain" in
- X '') dflt='.UUCP';;
- X *) dflt="$mydomain";;
- X esac
- X ;;
- Xesac
- Xrp="What is your domain name? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- X'') ;;
- X.*) ;;
- X*) ans=".$ans";;
- Xesac
- Xmydomain="$ans"
- X
- X: a little sanity check here
- Xcase "$phostname" in
- X'') ;;
- X*) case `$phostname` in
- X $hostname$mydomain|$hostname) ;;
- X *)
- X case "$phostname" in
- X sed*)
- X echo "(That doesn't agree with your whoami.h file, by the way.)"
- X ;;
- X *)
- X echo "(That doesn't agree with your $phostname command, by the way.)"
- X ;;
- X esac
- X phostname=''
- X ;;
- X esac
- X ;;
- Xesac
- X
- X: decide how portable to be
- Xcase "$d_portable" in
- X"$define") dflt=y;;
- X*) dflt=n;;
- Xesac
- X$cat <<'EOH'
- X
- XI can set things up so that your shell scripts and binaries are more portable,
- Xat what may be a noticable cost in performance. In particular, if you
- Xask to be portable, the following happens:
- X
- X 1) shell scripts will rely on the PATH variable rather than using
- X the paths derived above.
- X 2) ~username interpretations will be done at run time rather than
- X by Configure.
- X 3) the system name will be determined at run time, if at all possible.
- X
- XEOH
- Xrp="Do you expect to run these scripts and binaries on multiple machines? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- X y*) d_portable="$define"
- X for file in $loclist; do
- X eval $file=$file
- X done
- X ;;
- X *) d_portable="$undef" ;;
- Xesac
- X
- X: see if there is a whoami file
- Xecho " "
- Xif $test -r /usr/include/whoami.h ; then
- X d_whoami="$define"
- X echo "whoami.h found."
- Xelse
- X d_whoami="$undef"
- Xfi
- X
- X: see how we will look up host name
- Xecho " "
- Xd_douname="$undef"
- Xd_gethname="$undef"
- Xif $test -z "$d_phostname"; then
- X d_phostname="$undef"
- Xfi
- X
- Xif $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
- X echo "gethostname() found."
- X d_gethname="$define"
- X ans=gethostname
- Xelif xenix; then
- X if $test -n "$uname"; then
- X u_name=`$uname -n`
- X else
- X u_name=
- X fi
- X if $test -n "$line"; then
- X if $test -r /etc/systemid; then
- X s_name=`$line < /etc/systemid`
- X else
- X s_name=
- X fi
- X else
- X s_name=
- X fi
- X if $test -n "$u_name"; then
- X if $test "$u_name" = "$s_name"; then
- X cat <<EOM
- XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
- Xreturns the name compiled into the operating system via configure.
- XElm needs the UUCP name, and currently these two match. However, they
- Xneed not match. Be sure to always keep these two names in sync.
- XSince they match, Elm will not consider that the Xenix uname function
- Xis broken. However, if you are not always able to make them
- Xmatch, answer the compile in hostname question Yes.
- XEOM
- X if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
- X echo "uname() found."
- X d_douname="$define"
- X ans=uname
- X fi
- X else
- X cat <<EOM
- XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
- Xreturns the name compiled into the operating system via configure.
- XYour /etc/systemid file contains $s_name.
- XBut uname returns $u_name.
- XSince Elm needs the UUCP name, and currently these two do not match,
- XElm will assume Xenix uname() is broken.
- XEOM
- X fi
- X else
- X cat <<EOM
- XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
- Xreturns the name compiled into the operating system via configure.
- XElm needs the UUCP name, and currently the compiled in name is undefined.
- XSince mail needs the UUCP name, and these two need not match, Elm will
- Xassume Xenix uname() is broken.
- XEOM
- X fi
- Xelif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
- X echo "uname() found."
- X d_douname="$define"
- X ans=uname
- Xfi
- X
- Xcase "$d_douname$d_gethname" in
- X*define*)
- X case "$d_host_comp" in
- X "$define") dflt=y;;
- X *) dflt=n;;
- X esac
- X cat <<EOM
- X
- XEvery now and then someone has a $ans() that lies about the hostname
- Xbut can't be fixed for political or economic reasons. Would you like to
- XEOM
- X rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_douname="$undef"
- X d_gethname="$undef"
- X d_host_comp="$define"
- X $echo $n "Okay... $c"
- X ;;
- X *)
- X d_host_comp="$undef"
- X ;;
- X esac
- X ;;
- Xesac
- X
- Xcase "$d_douname$d_gethname" in
- X*define*) ;;
- X*)
- X case "$phostname" in
- X '') ;;
- X *)
- X $cat <<EOT
- X
- XThere is no gethostname() or uname() on this system. You have two
- Xpossibilities at this point:
- X
- X1) You can have your host name ($hostname) compiled into $package, which
- X lets $package start up faster, but makes your binaries non-portable, or
- X2) you can have $package use a
- X
- X popen("$phostname","r")
- X
- X which will start slower but be more portable.
- X
- XOption 1 will give you the option of using whoami.h if you have one. If you
- Xwant option 2 but with a different command, you can edit config.sh at the
- Xend of this shell script.
- X
- XEOT
- X case "$d_phostname" in
- X "$define") dflt=n;;
- X "$undef") dflt=y;;
- X '')
- X case "$d_portable" in
- X "$define") dflt=n ;;
- X *) dflt=y ;;
- X esac
- X ;;
- X esac
- X rp="Do you want your host name compiled in? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) d_phostname="$define"
- X d_host_comp="$undef"
- X ;;
- X *) phostname=''
- X d_host_comp="$define"
- X d_phostname="$undef"
- X ;;
- X esac
- X ;;
- X esac
- X case "$phostname" in
- X '')
- X case "$d_whoami" in
- X "$define")
- X dflt=y
- X $cat <<EOM
- X
- XNo hostname function--you can either use the whoami.h file, which has this line:
- X
- X `grep sysname /usr/include/whoami.h`
- X
- Xor you can have the name we came up with earlier ($hostname) hardwired in.
- XEOM
- X rp="Use whoami.h to get hostname? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) d_whoami="$undef";;
- X esac
- X ;;
- X "$undef")
- X echo 'No hostname function and no whoami.h--hardwiring "'$hostname'".'
- X d_host_comp="$define"
- X d_phostname="$undef"
- X ;;
- X esac
- X ;;
- X esac
- X ;;
- Xesac
- X
- X: see if flock exists
- Xecho " "
- Xif $contains flock libc.list >/dev/null 2>&1; then
- X echo 'flock() found.'
- X if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
- X echo 'EWOULDBLOCK found, will use flock type mailbox locking'
- X d_flock="$define"
- X elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
- X echo 'EWOULDBLOCK found, will use flock type mailbox locking'
- X d_flock="$define"
- X else
- X echo 'flock() not found--will use .lock type mailbox locking'
- X d_flock="$undef"
- X fi
- Xelse
- X echo 'flock() not found--will use .lock type mailbox locking'
- X d_flock="$undef"
- X d_flockonly="$undef"
- Xfi
- X
- Xif $test "$d_flock" = "$define"; then
- X case "$d_flockonly" in
- X "$define") dflt=y;;
- X "$undef") dflt=n;;
- X *) dflt=n;;
- X esac
- X $cat <<EOM
- X
- XSome sites wish to use flock style locking only. This allows Elm
- Xto be installed without the setgid bit being set on some systems
- Xthat would otherwise require it.
- X
- XNote: Be sure no other mail utility that needs to lock the mail spool
- Xfile uses .lock type locking before using only flock style locking.
- X
- XEOM
- X rp="Would you like to use flock style mail spool locking only? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_flockonly="$define";;
- X *) d_flockonly="$undef";;
- X esac
- Xfi
- X
- Xif $test -d /usr/spool/locks ; then
- X lock_dir=/usr/spool/locks
- Xelif $test -d /usr/spool/uucp ; then
- X lock_dir=/usr/spool/uucp
- Xelif $test -d /var/spool/locks ; then
- X lock_dir=/var/spool/locks
- Xelif $test -d /var/spool/uucp ; then
- X lock_dir=/var/spool/uucp
- Xelse
- X lock_dir=/tmp
- Xfi
- Xecho " "
- Xecho "Non mailbox locks will use the $lock_dir directory"
- Xecho " "
- X
- X: see if getopt exists
- Xset getopt d_getopt
- Xeval $inlibc
- X
- X: determine pathnames of the domains and pathalias
- Xcase "$pathalias" in
- X'') dflt=`loc paths blurfl/dyick $pth /usr/lib/uucp`
- X if $test "$dflt" = blurfl/dyick; then
- X dflt=`loc nmail.paths /usr/lib/nmail.paths $pth /usr/lib/uucp`
- X fi
- X ;;
- X*) dflt="$pathalias";;
- Xesac
- Xcont=true
- Xwhile $test "$cont" ; do
- X echo " "
- X echo "Give the full path name of the pathalias"
- X rp="data file? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X pathalias="$ans"
- X if $test -f "$ans"; then
- X cont=''
- X else
- X if $test "$fastread" = yes; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X echo "Pathalias data file $ans doesn't exist."
- X rp="Use that name anyway? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X dflt=''
- X case "$ans" in
- X y*) cont='';;
- X esac
- X fi
- Xdone
- X
- Xcase "$domains" in
- X'') dflt=`loc domains /usr/lib/domains $pth /usr/lib/uucp`;;
- X*) dflt="$domains";;
- Xesac
- Xcont=true
- Xwhile $test "$cont" ; do
- X echo " "
- X echo "Where does the uumail-style 'domains'"
- X rp="file live? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X domains="$ans"
- X if $test -f "$ans"; then
- X cont=''
- X else
- X if $test "$fastread" = yes; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X echo "Domains data file $ans doesn't exist."
- X rp="Use that name anyway? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X dflt=''
- X case "$ans" in
- X y*) cont='';;
- X esac
- X fi
- Xdone
- X: is pathalias available as a dbm file
- Xd_havedbm="$undef"
- Xdbm=''
- X
- Xif $test -f "$pathalias.pag" -a -f "$pathalias.dir"; then
- X ans=`loc libdbm.a x $libpth`
- X if $test "$ans" = x; then
- X ans=`loc Slibdbm.a x $libpth`
- X fi
- X if $test "$ans" = x; then
- X dflt=y
- X echo " "
- X rp="You have pathalias as a DBM file, but I cannot find the
- XDBM library. Do you have dbm? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*|t*) d_havedbm="$define"
- X echo " "
- X echo "Then where are the dbm routines kept (specify either -llibname"
- X $echo $n " or full pathname (~name ok))? $c"
- X rp='Specify dbm library:'
- X . myread
- X dbm=`filexp $ans`
- X ;;
- X *) d_havedbm="$undef"
- X dbm=''
- X echo "I will use the non dbm access methods then."
- X ;;
- X esac
- X else
- X echo " "
- X echo "You have pathalias as a DBM file...I'll use that instead."
- X dbm=-ldbm
- X d_havedbm="$define"
- X fi
- Xfi
- X
- X: see if strings.h is in /usr/include or /usr/include/sys
- Xecho " "
- Xstrings=`loc string.h "" /usr/include $includepath`
- Xif $test -z "$strings"; then
- X strings=`loc strings.h "" /usr/include $includepath`
- Xfi
- Xwhile $test -z "$strings"; do
- X echo " "
- X dflt=''
- X rp="What is the full path name of the include file directory? []"
- X $echo $n "$rp $c"
- X . myread
- X includepath=`filexp $ans`
- X if $test -d "$includepath"; then
- X strings=`loc string.h "" /usr/include $includepath`
- X if $test -z "$strings"; then
- X strings=`loc strings.h "" /usr/include $includepath`
- X fi
- X if $test -z "$strings"; then
- X $cat <<EOM
- X
- XInclude file string.h or strings.h not found in $includepath.
- XElm requires string.h on USG type systems or strings.h on BSD type
- Xsystems. Please specify the directory where one of these files can
- Xbe found.
- XEOM
- X fi
- X else
- X echo "Directory $includepath not found"
- X fi
- Xdone
- X
- Xstrings_f=`$expr "$strings" : ".*/\(.*\)"`
- Xif $test "$strings_f" = "string.h"; then
- X d_strings="$undef"
- X echo Using string.h instead of strings.h
- Xelse
- X d_strings="$define"
- X echo Using strings.h instead of string.h
- Xfi
- Xpwdinsys=`loc pwd.h "" /usr/include $includepath`
- Xif $test -z "$pwdinsys"; then
- X d_pwdinsys="$define"
- Xelse
- X d_pwdinsys="$undef"
- Xfi
- X
- X: index or strcpy
- Xecho " "
- Xcase "$d_index" in
- Xn) dflt=n;;
- X*) dflt=y;;
- Xesac
- Xif $contains '^index$' libc.list >/dev/null 2>&1 ; then
- X if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
- X if $contains strchr "$strings" >/dev/null 2>&1 ; then
- X if $contains index "$strings" >/dev/null 2>&1 ; then
- X# has index, strchr, and index and strchr in strings.h
- X echo "Your system has both index() and strchr(). Shall I use"
- X rp="index() rather than strchr()? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X n*) d_index="$define" ;;
- X *) d_index="$undef" ;;
- X esac
- X else
- X# has index, strchr, and strchr in strings.h
- X d_index="$define"
- X echo "strchr() found."
- X fi
- X else
- X# has index, strchr, and no strchr in strings.h
- X d_index="$undef"
- X echo "index() found."
- X fi
- X else
- X# has only index, no strchr, strings.h is a moot point
- X d_index="$undef"
- X echo "index() found."
- X fi
- Xelse
- X if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
- X d_index="$define"
- X echo "strchr() found."
- X else
- X echo "No index() or strchr() found!"
- X d_index="$undef"
- X fi
- Xfi
- X
- X: determine mail delivery agent for Elm to use
- Xcase "$mailer" in
- X'')
- X if $test -f "$sendmail"; then
- X dflt="$sendmail"
- X elif $test -f "$rmail"; then
- X dflt="$rmail"
- X elif $test -f /bin/mail; then
- X dflt=/bin/mail
- X else
- X dflt=$mail
- X fi
- X ;;
- X*) dflt="$mailer";;
- Xesac
- Xcont=true
- Xwhile $test "$cont" ; do
- X echo " "
- X echo "Give the full path name of the program used to deliver mail on your"
- X $echo $n "system: [$dflt] $c"
- X rp="Preferred mail delivery agent: [$dflt]"
- X . myread
- X mailer="$ans"
- X if $test -f "$ans"; then
- X cont=''
- X else
- X if $test "$fastread" = yes; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X echo "Mail delivery agent $ans doesn't exist."
- X rp="Use that name anyway? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X dflt=''
- X case "$ans" in
- X y*) cont='';;
- X esac
- X fi
- Xdone
- Xif $test "$mailer" != "$sendmail"; then
- X sendmail=''
- Xfi
- X
- X: check for internet mailer
- Xcase "$d_internet" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) if $test -f "$sendmail"; then
- X dflt=y
- X elif $test -f "$smail"; then
- X dflt=y
- X else
- X dflt=n
- X fi
- X ;;
- Xesac
- X$cat <<EOM
- X
- XSome newer mailers can deliver mail to addresses of the INTERNET persuasion,
- Xsuch as user@host.UUCP. Other older mailers require the complete path to
- Xthe destination to be specified in the address. Does your mailer understand
- XEOM
- X$echo $n "INTERNET addresses? [$dflt] $c"
- Xrp="Does your mailer understand INTERNET addresses? [$dflt]"
- X. myread
- Xcase "$ans" in
- Xy*) d_internet="$define";;
- X*) d_internet="$undef";;
- Xesac
- X
- Xcase "$d_mboxedit" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=n;;
- Xesac
- X$cat <<EOM
- X
- XA lot of sites that install the Elm Mail System find that the function
- XE)dit mailbox from within Elm is dangerous and confusing. If you choose,
- Xyou can instead disable that function, with the program being slightly
- Xsmaller and presenting an appropriate error message to the user if they
- Xtry to E)dit their mailbox.
- X
- XEOM
- Xrp="Would you like to enable the E)dit Mailbox function? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_mboxedit="$define";;
- X*) d_mboxedit="$undef";;
- Xesac
- X
- X: see if mkdir exists
- Xset mkdir d_mkdir
- Xeval $inlibc
- X
- Xcase "$d_mmdf" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=n;;
- Xesac
- X$cat <<EOM
- X
- XSome systems run MMDF as their Mail Transport Agent. MMDF uses
- Xa different way of delimiting messages in the mailbox files.
- XUsually this is a series of four Control A's. $package needs to know
- Xif this system uses MMDF.
- X
- XEOM
- Xrp="Does this system use MMDF as its MTA? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_mmdf="$define";;
- X*) d_mmdf="$undef";;
- Xesac
- X
- X: ask about newmail running in the background automatically
- Xcase "$d_newauto" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=y;;
- Xesac
- Xecho " "
- Xrp="Should newmail automatically run in the background? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_newauto="$define";;
- X*) d_newauto="$undef";;
- Xesac
- X
- Xcase "$d_notouchadd" in
- X"$define") dflt=n;;
- X"$undef") dflt=y;;
- X*) dflt=y;;
- Xesac
- X$cat <<EOM
- X
- XSome sites are configured so that the low level transport mechanism
- Xis supposed to resolve and rewrite uucp paths, unreachable
- Xdomains/networks, and so on. If your site running either "smail",
- Xa "gateway" configuration of sendmail, or some similar software
- Xthen the low level transport mechanism will resolve the uucp
- Xpaths. In this case it is not necessary to have Elm resolve
- Xthe paths on outbound mail addresses.
- X
- XEOM
- Xecho " "
- Xrp="Should Elm resolve outbound addresses? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_notouchadd="$undef";;
- X*) d_notouchadd="$define";;
- Xesac
- X
- Xcase "$d_pafirst" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=n;;
- Xesac
- Xif $test "$d_notouchadd" = "$undef"; then
- X $cat <<EOM
- X
- XWhen given a machine that you talk to directly, should the 'pathalias'
- Xroute to the machine be used instead?"
- XEOM
- X echo " "
- X rp="Would you like to use pathalias route instead? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_pafirst="$define";;
- X *) d_pafirst="$undef";;
- X esac
- Xelse
- X d_pafirst="$undef"
- Xfi
- X
- Xif $test -f "$sendmail"; then
- X echo "You're running sendmail. Setting noaddfrom, nocheckvalid, usedomain"
- X d_noaddfrom="$define"
- X d_nocheckvalid="$define"
- X d_usedomain="$undef"
- Xelse
- X case "$d_nocheckvalid" in
- X "$define") dflt=n;;
- X "$undef") dflt=y;;
- X *) dflt=y;;
- X esac
- X
- X $cat << EOM
- X
- XSince you're not running sendmail, should I check local user entered
- Xaddresses against the valid mailboxes on this system?
- XEOM
- X
- X echo " "
- X rp="Would you like to check local addresses? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_nocheckvalid="$undef";;
- X *) d_nocheckvalid="$define";;
- X esac
- X
- X if $test "$d_internet" = "$define"; then
- X case "$d_usedomain" in
- X "$define") dflt=y;;
- X "$undef") dflt=n;;
- X *) dflt=y;;
- X esac
- X
- X $cat <<EOM
- X
- XAre you running a machine where you want to have a domain name appended
- Xto the hostname on outbound mail?
- XEOM
- X echo " "
- X rp="Would you like the domain name appended? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_usedomain="$define";;
- X *) d_usedomain="$undef";;
- X esac
- X else
- X d_usedomain="$undef"
- X $cat <<EOM
- X
- XSince your mailer does not understand internet addresses, undefining
- Xusedomain, your domain name will not be appended to the hostname on
- Xoutbound mail.
- X
- XEOM
- X fi
- X
- X case "$d_noaddfrom" in
- X "$define") dflt=y;;
- X "$undef") dflt=n;;
- X *) dflt=n;;
- X esac
- X echo " "
- X rp="Does your mailer add the From: header for you? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X case "$ans" in
- X y*) d_noaddfrom="$define";;
- X *) d_noaddfrom="$undef";;
- X esac
- Xfi
- X
- X: ask about optimizing return addresses
- Xcase "$d_optreturn" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=n;;
- Xesac
- Xecho " "
- Xecho "Should I optimize the return address when you"
- Xrp="'alias current message'? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_optreturn="$define";;
- X*) d_optreturn="$undef";;
- Xesac
- X
- X: check for "kill(pid, 0)"
- Xecho " "
- Xcase "$d_pidcheck" in
- X"$define") ;;
- X"$undef") ;;
- X*)
- X echo "Checking to see if kill(pid, 0) works..."
- X $cat >try.c <<'EOCP'
- Xmain()
- X {
- X int pid, status0, status9;
- X
- X if ((pid = fork()) == 0)
- X {
- X sleep(30);
- X exit(1);
- X }
- X status0 = kill(pid, 0);
- X status9 = kill(pid, 9);
- X exit(status0 == status9);
- X }
- XEOCP
- X if $cc try.c -o try >/dev/null 2>&1 ; then
- X if try >/dev/null 2>&1 ; then
- X echo "Your system does not support kill(pid, 0)..."
- X d_pidcheck="$undef"
- X else
- X d_pidcheck="$define"
- X echo "Your system supports kill(pid, 0)..."
- X fi
- X else
- X echo "Your system does not support kill(pid, 0)..."
- X d_pidcheck="$undef"
- X fi
- X $rm -f try.c try.o try
- X ;;
- Xesac
- X
- X: see if /usr/include/sys/ptem.h exists, making it a possible System V/386
- Xd_ptem="$undef"
- Xif usg ; then
- X echo " "
- X echo "Checking to see if your system has sys/ptem.h..."
- X if $test -f /usr/include/sys/ptem.h ; then
- X echo "Yep, it does..."
- X if "$contains" "struct winsize" /usr/include/sys/ptem.h >/dev/null 2>&1 ; then
- X d_ptem="$define"
- X echo " and it has the needed structure."
- X fi
- X fi
- Xfi
- X
- X: get remove at last flag and number of lock attempts
- X$cat <<EOM
- X
- XThe next pair of questions have to do with what to do when another
- Xprogram has locked a mailbox...
- X
- XFirst, how many times should the Elm check for the removal of the lock
- Xfile before giving up?
- XEOM
- X
- Xcase "$maxattempts" in
- X '') dflt=6;;
- X *) dflt=$maxattempts;;
- Xesac
- Xcont=true
- Xwhile $test "$cont" ; do
- X echo " "
- X rp="Number of lock attempts: [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X maxattempts="$ans"
- X if $test "$maxattempts" -lt 3 -o "$maxattempts" -gt 10 ; then
- X echo "The recommended range is 3-10"
- X odflt=$dflt
- X dflt=n
- X rp="Should I use your answer of $maxattempts lock attempts anyway? [$dflt]"
- X $echo $n "$rp $c"
- X . myread
- X dflt=$odflt
- X case "$ans" in
- X y*) cont='';;
- X esac
- X else
- X cont=''
- X fi
- Xdone
- X
- Xcase "$d_remlock" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=n;;
- Xesac
- Xecho " "
- Xrp="Should it REMOVE the lockfile after $maxattempts checks? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_remlock="$define";;
- X*) d_remlock="$undef";;
- Xesac
- X
- X: see if rename exists
- Xset rename d_rename
- Xeval $inlibc
- X
- X: ask about setgid running of Elm
- Xcase "$d_setgid" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=y;;
- Xesac
- Xecho " "
- Xrp="Am I going to be running as a setgid program? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_setgid="$define";;
- X*) d_setgid="$undef";;
- Xesac
- Xcase "$d_setgid" in
- X"$define") mailermode=2755;;
- X*) mailermode=755;;
- Xesac
- X
- X: see if sigvector exists -- since sigvec will match the substring
- Xecho " "
- Xif $contains sigvector libc.list >/dev/null 2>&1; then
- X echo 'sigvector() found--you must be running HP-UX.'
- X d_sigvectr="$define"
- X d_sigvec="$define"
- Xelse
- X: try the original name
- X d_sigvectr="$undef"
- X if $contains sigvec libc.list >/dev/null 2>&1; then
- X echo 'sigvec() found.'
- X d_sigvec="$define"
- X else
- X echo 'sigvec() not found--race conditions with signals may occur.'
- X d_sigvec="$undef"
- X fi
- Xfi
- X
- X: see if strspn exists
- Xecho " "
- Xif $contains strspn libc.list >/dev/null 2>&1; then
- X echo 'strspn() found.'
- X d_strspn="$define"
- Xelse
- X echo 'strspn() not found--will use our strspn instead.'
- X d_strspn="$undef"
- Xfi
- X
- X: see if strcspn exists
- Xecho " "
- Xif $contains strcspn libc.list >/dev/null 2>&1; then
- X echo 'strcspn() found.'
- X d_strcspn="$define"
- Xelse
- X echo 'strcspn() not found--will use our strcspn instead.'
- X d_strcspn="$undef"
- Xfi
- X
- Xcase "$d_subshell" in
- X"$define") dflt=y;;
- X"$undef") dflt=n;;
- X*) dflt=y;;
- Xesac
- X$cat <<EOM
- X
- XSome sites wish to disable the usage of the shell escape from Elm.
- XIf you choose, you can not allow subshells from withing Elm.
- X
- XNote: This only controls Elms usage of the ! command. Any pager or
- Xeditor could still allow subshells.
- X
- XEOM
- Xrp="Would you like to allow the ! command (subshells)? [$dflt]"
- X$echo $n "$rp $c"
- X. myread
- Xcase "$ans" in
- Xy*) d_subshell="$define";;
- X*) d_subshell="$undef";;
- Xesac
- X
- X: see if tempnam exists
- Xecho " "
- Xif $contains tempnam libc.list >/dev/null 2>&1; then
- X echo 'tempnam() found.'
- X d_tempnam="$define"
- Xelse
- X echo 'tempnam() not found--will use our tempnam instead.'
- X d_tempnam="$undef"
- Xfi
- X
- X: see how we invoke the C preprocessor
- Xecho " "
- Xecho "Now, how can we feed standard input to your C preprocessor..."
- Xcat <<'EOT' >testcpp.c
- X#define ABC abc
- X#define XYZ xyz
- XABC.XYZ
- XEOT
- Xecho 'Maybe "'"$cc"' -E" will work...'
- X$cc -E <testcpp.c >testcpp.out 2>&1
- X: try to force gcc preprocessor if that is the compiler they are using
- Xcase $? in
- X0) cppstdin="$cc -E";;
- X*) case "$cc" in
- X *gcc*)
- X cd ..
- X echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
- X echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
- X chmod 755 cppstdin
- X cppstdin=`pwd`/cppstdin
- X cppminus='';
- X cd UU
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X ;;
- X esac
- X ;;
- Xesac
- Xif $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, it does."
- X cppstdin="$cc -E"
- X cppminus='';
- Xelse
- X echo 'Nope, maybe "'$cpp'" will work...'
- X $cpp <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, it does."
- X cppstdin="$cpp"
- X cppminus='';
- X else
- X echo 'No such luck...maybe "'$cpp' -" will work...'
- X $cpp - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "It works!"
- X cppstdin="$cpp"
- X cppminus='-';
- X else
- X echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
- X $cc -E - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, it works! I was beginning to wonder."
- X cppstdin="$cc -E"
- X cppminus='-';
- X else
- X echo 'Nope...maybe "'"$cc"' -P" will work...'
- X $cc -P <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, that does."
- X cppstdin="$cc -P"
- X cppminus='';
- X else
- X echo 'Nope...maybe "'"$cc"' -P -" will work...'
- X $cc -P - <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Yup, that does."
- X cppstdin="$cc -P"
- X cppminus='-';
- X else
- X echo 'Hmm...perhaps you already told me...'
- X case "$cppstdin" in
- X '') ;;
- X *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
- X esac
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Hooray, you did! I was beginning to wonder."
- X else
- X echo 'Uh-uh. Time to get fancy...'
- X cd ..
- X echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
- X echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
- X chmod 755 cppstdin
- X cppstdin=`pwd`/cppstdin
- X cppminus='';
- X cd UU
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "Eureka!."
- X else
- X dflt=blurfl
- X $echo $n "No dice. I can't find a C preprocessor. Name one: $c"
- X rp='Name a C preprocessor:'
- X . myread
- X cppstdin="$ans"
- X $cppstdin <testcpp.c >testcpp.out 2>&1
- X if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
- X echo "OK, that will do."
- X else
- X echo "Sorry, I can't get that to work. Go find one."
- X exit 1
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- X fi
- Xfi
- Xrm -f testcpp.c testcpp.out
- X
- X: get C preprocessor symbols handy
- Xecho " "
- Xecho $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
- X$cat <<EOSS >Cppsym
- X$startsh
- Xcase "\$1" in
- X-l) list=true
- X shift
- X ;;
- Xesac
- Xunknown=''
- Xcase "\$list\$#" in
- X1|2)
- X for sym do
- X if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
- X exit 0
- X elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
- X :
- X else
- X unknown="\$unknown \$sym"
- X fi
- X done
- X set X \$unknown
- X shift
- X ;;
- Xesac
- Xcase \$# in
- X0) exit 1;;
- Xesac
- Xecho \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
- X#ifdef \1\\
- Xexit 0; _ _ _ _\1\\ \1\\
- X#endif\\
- X/' >/tmp/Cppsym\$\$
- Xecho exit 1 >>/tmp/Cppsym\$\$
- X$cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
- Xcase "\$list" in
- Xtrue) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
- X*)
- X sh /tmp/Cppsym2\$\$
- X status=\$?
- X ;;
- Xesac
- X$rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
- Xexit \$status
- XEOSS
- Xchmod +x Cppsym
- X$eunicefix Cppsym
- Xecho "Your C preprocessor defines the following symbols:"
- XCppsym -l $attrlist >Cppsym.true
- Xcat Cppsym.true
- Xrmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
- X
- X: see if this is a termio system
- X: Prefer POSIX-approved termios.h over all else.
- X:
- Xecho " "
- Xd_termios="$undef"
- Xd_termio="$undef"
- Xif $test -r /usr/include/termios.h ; then
- X set tcsetattr d_termios
- X eval $inlibc
- Xfi
- Xif $test "$d_termios" = "$define" ; then
- X echo "You have POSIX termios.h... good!"
- Xelif Cppsym pyr ; then
- X if $test "`/bin/universe`" = "ucb" ; then
- X if $test -r /usr/include/sgtty.h ; then
- X echo "sgtty.h found."
- X else
- X echo "System is a pyramid, and universe is bsd,"
- X echo "sgtty.h not found--you could have problems."
- X fi
- X else
- X if $test -r /usr/include/termio.h ; then
- X d_termio="$define"
- X echo "termio.h found."
- X else
- X echo "System is a pyramid, and universe is att,"
- X echo "termio.h not found--you could have problems."
- X fi
- X fi
- Xelif bsd ; then
- X if $test -r /usr/include/sgtty.h ; then
- X echo "sgtty.h found."
- X elif $test -r /usr/include/termio.h ; then
- X d_termio="$define"
- X echo "termio.h found."
- X else
- X echo "Neither termio.h nor sgtty.h found--you could have problems."
- SHAR_EOF
- echo "End of part 2"
- echo "File Configure is continued in part 3"
- echo "3" > s2_seq_.tmp
- exit 0
- exit 0 # Just in case...
-