home *** CD-ROM | disk | FTP | other *** search
/ ftp.uv.es / 2014.11.ftp.uv.es.tar / ftp.uv.es / pub / unix / elm-2.4-pl20.tar.Z / elm-2.4-pl20.tar / Configure < prev    next >
Text File  |  1993-01-12  |  114KB  |  5,023 lines

  1. #! /bin/sh
  2. #
  3. # If these # comments don't work, trim them.  Don't worry about any other
  4. # shell scripts, Configure will trim # comments from them for you.
  5. #
  6. # (If you are trying to port this package to a machine without sh, I would
  7. # suggest you cut out the prototypical config.h from the end of Configure
  8. # and edit it to reflect your system.  Some packages may include samples
  9. # of config.h for certain machines, so you might look for one of those.)
  10. #
  11. # $Header: /home/syd/elm.rel/RCS/Configure,v 5.21 1992/12/24 23:51:02 syd Exp $
  12. #
  13. # Yes, you may rip this off to use in other distribution packages.
  14. # (Note: this Configure script was generated automatically.  Rather than
  15. # working with this copy of Configure, you may wish to get metaconfig.)
  16.  
  17. : sanity checks
  18. PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
  19. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  20.  
  21. if test ! -t 0; then
  22.     echo "Say 'sh Configure', not 'sh <Configure'"
  23.     exit 1
  24. fi
  25.  
  26. (alias) >/dev/null 2>&1 && \
  27.     echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
  28.     echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
  29.  
  30. if test ! -d ../UU; then
  31.     if test ! -d UU; then
  32.     mkdir UU
  33.     fi
  34.     cd UU
  35. fi
  36.  
  37. case "$1" in
  38. -d) shift; fastread='yes';;
  39. esac
  40.  
  41. Log=''
  42. Header=''
  43. bin=''
  44. contains=''
  45. cppstdin=''
  46. cppminus=''
  47. d_getopt=''
  48. d_memcpy=''
  49. d_mkdir=''
  50. d_rename=''
  51. d_symlink=''
  52. d_whoami=''
  53. n=''
  54. c=''
  55. orderlib=''
  56. ranlib=''
  57. package=''
  58. pager=''
  59. prefshell=''
  60. spitshell=''
  61. shsharp=''
  62. sharpbang=''
  63. startsh=''
  64. d_eunice=''
  65. define=''
  66. eunicefix=''
  67. loclist=''
  68. expr=''
  69. sed=''
  70. echo=''
  71. cat=''
  72. rm=''
  73. mv=''
  74. cp=''
  75. tail=''
  76. tr=''
  77. mkdir=''
  78. sort=''
  79. uniq=''
  80. grep=''
  81. trylist=''
  82. test=''
  83. inews=''
  84. ispell=''
  85. egrep=''
  86. more=''
  87. pg=''
  88. Mcc=''
  89. vi=''
  90. mailx=''
  91. mail=''
  92. cpp=''
  93. perl=''
  94. emacs=''
  95. ls=''
  96. rmail=''
  97. sendmail=''
  98. shar=''
  99. smail=''
  100. submit=''
  101. tbl=''
  102. troff=''
  103. nroff=''
  104. uname=''
  105. uuname=''
  106. line=''
  107. chgrp=''
  108. chmod=''
  109. lint=''
  110. sleep=''
  111. pr=''
  112. tar=''
  113. ln=''
  114. lpr=''
  115. lp=''
  116. touch=''
  117. make=''
  118. date=''
  119. csh=''
  120. pmake=''
  121. mips=''
  122. col=''
  123. pack=''
  124. compress=''
  125. execmail=''
  126. libswanted=''
  127. c_date=''
  128. d_altcheck=''
  129. d_ascii=''
  130. d_calendar=''
  131. calendar=''
  132. d_content=''
  133. d_crypt=''
  134. cryptlib=''
  135. d_cuserid=''
  136. d_disphost=''
  137. d_domname=''
  138. d_usegetdom=''
  139. d_errlst=''
  140. d_flock=''
  141. d_dotlock=''
  142. d_fcntlock=''
  143. lock_dir=''
  144. has_flock=''
  145. has_fcntl=''
  146. d_ftruncate=''
  147. d_gethname=''
  148. d_douname=''
  149. d_phostname=''
  150. d_host_comp=''
  151. ign_hname=''
  152. d_havetlib=''
  153. termlib=''
  154. d_index=''
  155. d_internet=''
  156. d_ispell=''
  157. ispell_path=''
  158. ispell_options=''
  159. d_locale=''
  160. d_nl_types=''
  161. d_msgcat=''
  162. d_usenls=''
  163. d_mboxedit=''
  164. d_mime=''
  165. defencoding=''
  166. defcharset=''
  167. defdispcharset=''
  168. d_mmdf=''
  169. d_newauto=''
  170. d_noaddfrom=''
  171. d_usedomain=''
  172. d_nocheckvalid=''
  173. d_noxheader=''
  174. d_pidcheck=''
  175. d_portable=''
  176. d_ptem=''
  177. d_putenv=''
  178. d_remlock=''
  179. maxattempts=''
  180. d_setgid=''
  181. d_savegrpmboxid=''
  182. mailermode=''
  183. d_sigvec=''
  184. d_sigvectr=''
  185. d_sigset=''
  186. d_sighold=''
  187. d_sigprocmask=''
  188. d_sigblock=''
  189. d_sigaction=''
  190. d_strcspn=''
  191. d_strspn=''
  192. d_strpbrk=''
  193. d_strings=''
  194. d_pwdinsys=''
  195. strings=''
  196. includepath=''
  197. d_strstr=''
  198. d_strtok=''
  199. d_subshell=''
  200. d_tempnam=''
  201. tempnamo=''
  202. tempnamc=''
  203. d_termio=''
  204. d_termios=''
  205. d_tz_min=''
  206. d_tzname=''
  207. d_useembed=''
  208. d_utimbuf=''
  209. d_vfork=''
  210. defbatsub=''
  211. defeditor=''
  212. editoropts=''
  213. hostname=''
  214. phostname=''
  215. mydomain=''
  216. autohostname=''
  217. i_memory=''
  218. i_stdlib=''
  219. i_time=''
  220. i_systime=''
  221. d_systimekernel=''
  222. i_utime=''
  223. i_sysutime=''
  224. lib=''
  225. libc=''
  226. linepr=''
  227. maildir=''
  228. mailer=''
  229. mailgrp=''
  230. mansrc=''
  231. catmansrc=''
  232. manext=''
  233. manext_choice=''
  234. catmanext=''
  235. catmanext_choice=''
  236. packed=''
  237. manroff=''
  238. manroffopts=''
  239. suffix=''
  240. packer=''
  241. models=''
  242. split=''
  243. small=''
  244. medium=''
  245. large=''
  246. huge=''
  247. optimize=''
  248. ccflags=''
  249. cppflags=''
  250. ldflags=''
  251. cc=''
  252. libs=''
  253. nametype=''
  254. d_passnames=''
  255. d_berknames=''
  256. d_usgnames=''
  257. passcat=''
  258. rmttape=''
  259. roff=''
  260. roffopts=''
  261. sigtype=''
  262. tmpdir=''
  263. use_pmake=''
  264. xencf=''
  265. xenlf=''
  266. d_xenix=''
  267. d_bsd=''
  268. CONFIG=''
  269. : set package name
  270. package=elm2
  271.  
  272. echo " "
  273. echo "Beginning of configuration questions for $package kit."
  274. : Eunice requires " " instead of "", can you believe it
  275. echo " "
  276.  
  277. define='define'
  278. undef='undef'
  279. : change the next line if compiling for Xenix/286 on Xenix/386
  280. xlibpth='/usr/lib/386 /lib/386 /lib'
  281. libpth='/usr/lib /usr/ccs/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large /usr/lib/small /lib/small'
  282. smallmach='pdp11 i8086 z8000 i80286 iAPX286'
  283. rmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
  284. trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  285.  
  286. : We must find out about Eunice early
  287. eunicefix=':'
  288. if test -f /etc/unixtovms; then
  289.     eunicefix=/etc/unixtovms
  290. fi
  291. if test -f /etc/unixtovms.exe; then
  292.     eunicefix=/etc/unixtovms.exe
  293. fi
  294.  
  295. : Now test for existence of everything in MANIFEST
  296.  
  297. echo "First let's make sure your kit is complete.  Checking..."
  298. awk '$1 !~ /PACKINGLIST/ {print $1}' ../MANIFEST | split -100
  299. rm -f missing
  300. for filelist in x??; do
  301.     (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
  302. done
  303. if test -s missing; then
  304.     cat missing
  305.     kill $$
  306. fi
  307. echo "Looks good..."
  308.  
  309. d_newshome="/usr/NeWS"
  310. defvoidused=7
  311. attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  312. attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
  313. attrlist="$attrlist hpux hp9000s300 hp9000s500 hp9000s800"
  314. attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  315. attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  316. attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386"
  317. attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__ NeXT _AIX ultrix"
  318. pth="/bin /usr/bin /usr/ucb /sbin /usr/sbin /usr/local /usr/local/bin /usr/lbin"
  319. pth="$pth /usr/5bin /vol/local/bin /etc /usr/bsd /usr/lib /usr/ccs/lib /usr/ccs/bin /lib"
  320. pth="$pth /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb"
  321. pth="$pth /usr/convex /usr/mmdf/bin /usr/mmdf/lib /usr/lib/mail"
  322. pth="$pth ${BSDBASE-/bsd}/usr/ucb ${BSDBASE-/bsd}/bin ${BSDBASE-/bsd}/usr/bin"
  323.  
  324. : check for out bin directory
  325. if test ! -d ../bin; then
  326.     echo "Making bin directory"
  327.     mkdir ../bin
  328. else
  329.     echo "Found bin directory"
  330. fi
  331.  
  332. libswanted="intl nls"
  333. attrlist="$attrlist sgi"
  334.  
  335. : some greps do not return status, grrr.
  336. echo "grimblepritz" >grimble
  337. if grep blurfldyick grimble >/dev/null 2>&1 ; then
  338.     contains=contains
  339. elif grep grimblepritz grimble >/dev/null 2>&1 ; then
  340.     contains=grep
  341. else
  342.     contains=contains
  343. fi
  344. rm -f grimble
  345. : the following should work in any shell
  346. case "$contains" in
  347. contains*)
  348.     echo " "
  349.     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  350.     cat >contains <<'EOSS'
  351. grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  352. EOSS
  353. chmod +x contains
  354. esac
  355.  
  356. : see if sh knows # comments
  357. echo " "
  358. echo "Checking your sh to see if it knows about # comments..."
  359. if sh -c '#' >/dev/null 2>&1 ; then
  360.     echo "Your sh handles # comments correctly."
  361.     shsharp=true
  362.     spitshell=cat
  363.     echo " "
  364.     echo "Okay, let's see if #! works on this system..."
  365.     echo "#!/bin/echo hi" > try
  366.     $eunicefix try
  367.     chmod +x try
  368.     ./try > today
  369.     if $contains hi today >/dev/null 2>&1; then
  370.     echo "It does."
  371.     sharpbang='#!'
  372.     else
  373.     echo "#! /bin/echo hi" > try
  374.     $eunicefix try
  375.     chmod +x try
  376.     ./try > today
  377.     if test -s today; then
  378.         echo "It does."
  379.         sharpbang='#! '
  380.     else
  381.         echo "It doesn't."
  382.         sharpbang=': use '
  383.     fi
  384.     fi
  385. else
  386.     echo "Your sh doesn't grok # comments--I will strip them later on."
  387.     shsharp=false
  388.     echo "exec grep -v '^#'" >spitshell
  389.     chmod +x spitshell
  390.     $eunicefix spitshell
  391.     spitshell=`pwd`/spitshell
  392.     echo "I presume that if # doesn't work, #! won't work either!"
  393.     sharpbang=': use '
  394. fi
  395.  
  396. : figure out how to guarantee sh startup
  397. echo " "
  398. echo "Checking out how to guarantee sh startup..."
  399. startsh=$sharpbang'/bin/sh'
  400. echo "Let's see if '$startsh' works..."
  401. cat >try <<EOSS
  402. $startsh
  403. set abc
  404. test "$?abc" != 1
  405. EOSS
  406.  
  407. chmod +x try
  408. $eunicefix try
  409. if ./try; then
  410.     echo "Yup, it does."
  411. else
  412.     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  413. fi
  414. rm -f try today
  415.  
  416. : first determine how to suppress newline on echo command
  417. echo "Checking echo to see how to suppress newlines..."
  418. (echo "hi there\c" ; echo " ") >.echotmp
  419. if $contains c .echotmp >/dev/null 2>&1 ; then
  420.     echo "...using -n."
  421.     n='-n'
  422.     c=''
  423. else
  424.     cat <<'EOM'
  425. ...using \c
  426. EOM
  427.     n=''
  428.     c='\c'
  429. fi
  430. echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
  431. read ans
  432. rm -f .echotmp
  433.  
  434. : now set up to do reads with possible shell escape and default assignment
  435. cat <<EOSC >myread
  436. case "\$fastread" in
  437. yes) ans=''; echo " " ;;
  438. *) ans='!';;
  439. esac
  440. while expr "X\$ans" : "X!" >/dev/null; do
  441.     read ans
  442.     case "\$ans" in
  443.     !)
  444.     sh
  445.     echo " "
  446.     echo $n "\$rp $c"
  447.     ;;
  448.     !*)
  449.     set \`expr "X\$ans" : "X!\(.*\)\$"\`
  450.     sh -c "\$*"
  451.     echo " "
  452.     echo $n "\$rp $c"
  453.     ;;
  454.     esac
  455. done
  456. rp='Your answer:'
  457. case "\$ans" in
  458. '') ans="\$dflt";;
  459. esac
  460. EOSC
  461.  
  462. : general instructions
  463. cat <<EOH
  464.  
  465. This installation shell script will examine your system and ask you questions
  466. to determine how the $package package should be installed.  If you get stuck
  467. on a question, you may use a ! shell escape to start a subshell or execute
  468. a command.  Many of the questions will have default answers in square
  469. brackets--typing carriage return will give you the default.
  470.  
  471. On some of the questions which ask for file or directory names you are
  472. allowed to use the ~name construct to specify the login directory belonging
  473. to "name", even if you don't have a shell which knows about that.  Questions
  474. where this is allowed will be marked "(~name ok)".
  475.  
  476. EOH
  477. rp="[Type carriage return to continue]"
  478. echo $n "$rp $c"
  479. . myread
  480. cat <<EOH
  481.  
  482. Much effort has been expended to ensure that this shell script will run
  483. on any Unix system.  If despite that it blows up on you, your best bet is
  484. to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
  485. know how I blew it.  If you can't run Configure for some reason, you'll have
  486. to generate a config.sh file by hand.
  487.  
  488. This installation script affects things in two ways: 1) it may do direct
  489. variable substitutions on some of the files included in this kit, and
  490. 2) it builds a config.h file for inclusion in C programs.  You may edit
  491. any of these files as the need arises after running this script.
  492.  
  493. If you make a mistake on a question, there is no easy way to back up to it
  494. currently.  The easiest thing to do is to edit config.sh and rerun all the
  495. SH files.  Configure will offer to let you do this before it runs the SH files.
  496.  
  497. EOH
  498. rp="[Type carriage return to continue]"
  499. echo $n "$rp $c"
  500. . myread
  501.  
  502. : get old answers, if there is a config file out there
  503. if test -f ../config.sh; then
  504.     echo " "
  505.     dflt=y
  506.     rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
  507.     echo $n "$rp $c"
  508.     . myread
  509.     case "$ans" in
  510.     n*) echo "OK, I'll ignore it.";;
  511.     *)  echo "Fetching default answers from your old config.sh file..."
  512.     tmp="$n"
  513.     ans="$c"
  514.         . ../config.sh
  515.     n="$tmp"
  516.     c="$ans"
  517.     ;;
  518.     esac
  519. fi
  520.  
  521. : find out where common programs are
  522. echo " "
  523. echo "Locating common programs..."
  524. cat <<EOSC >loc
  525. $startsh
  526. case \$# in
  527. 0) exit 1;;
  528. esac
  529. thing=\$1
  530. shift
  531. dflt=\$1
  532. shift
  533. for dir in \$*; do
  534.     case "\$thing" in
  535.     .)
  536.     if test -d \$dir/\$thing; then
  537.         echo \$dir
  538.         exit 0
  539.     fi
  540.     ;;
  541.     *)
  542.     if test -f \$dir/\$thing; then
  543.         echo \$dir/\$thing
  544.         exit 0
  545.     elif test -f \$dir/\$thing.exe; then
  546.         : on Eunice apparently
  547.         echo \$dir/\$thing
  548.         exit 0
  549.     fi
  550.     ;;
  551.     esac
  552. done
  553. echo \$dflt
  554. exit 1
  555. EOSC
  556. chmod +x loc
  557. $eunicefix loc
  558. loclist="
  559. cat
  560. chgrp
  561. chmod
  562. cp
  563. echo
  564. expr
  565. grep
  566. ln
  567. ls
  568. make
  569. mv
  570. rm
  571. sed
  572. sleep
  573. touch
  574. tr
  575. "
  576. trylist="
  577. Mcc
  578. compress
  579. cpp
  580. date
  581. emacs
  582. execmail
  583. ispell
  584. line
  585. lint
  586. lp
  587. lpr
  588. mailx
  589. mips
  590. more
  591. nroff
  592. pack
  593. pg
  594. pmake
  595. pr
  596. rmail
  597. sendmail
  598. shar
  599. smail
  600. submit
  601. tar
  602. tbl
  603. test
  604. troff
  605. uname
  606. uuname
  607. vi
  608. "
  609. for file in $loclist; do
  610.     xxx=`loc $file $file $pth`
  611.     eval $file=$xxx
  612.     eval _$file=$xxx
  613.     case "$xxx" in
  614.     /*)
  615.     echo $file is in $xxx.
  616.     ;;
  617.     *)
  618.     echo "I don't know where $file is.  I hope it's in everyone's PATH."
  619.     ;;
  620.     esac
  621. done
  622. echo " "
  623. echo "Don't worry if any of the following aren't found..."
  624. ans=offhand
  625. for file in $trylist; do
  626.     xxx=`loc $file $file $pth`
  627.     eval $file=$xxx
  628.     eval _$file=$xxx
  629.     case "$xxx" in
  630.     /*)
  631.     echo $file is in $xxx.
  632.     ;;
  633.     *)
  634.     echo "I don't see $file out there, $ans."
  635.     ans=either
  636.     ;;
  637.     esac
  638. done
  639. case "$egrep" in
  640. egrep)
  641.     echo "Substituting grep for egrep."
  642.     egrep=$grep
  643.     ;;
  644. esac
  645. case "$test" in
  646. test)
  647.     echo "Hopefully test is built into your sh."
  648.     ;;
  649. /bin/test)
  650.     if sh -c "PATH= test true" >/dev/null 2>&1; then
  651.     echo "Using the test built into your sh."
  652.     test=test
  653.     fi
  654.     ;;
  655. *)
  656.     test=test
  657.     ;;
  658. esac
  659. case "$echo" in
  660. echo)
  661.     echo "Hopefully echo is built into your sh."
  662.     ;;
  663. /bin/echo)
  664.     echo " "
  665.     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  666.     $echo $n "hi there$c" >foo1
  667.     echo $n "hi there$c" >foo2
  668.     if cmp foo1 foo2 >/dev/null 2>&1; then
  669.     echo "They are compatible.  In fact, they may be identical."
  670.     else
  671.     case "$n" in
  672.     '-n') n='' c='\c' ans='\c' ;;
  673.     *) n='-n' c='' ans='-n' ;;
  674.     esac
  675.     cat <<FOO
  676. They are not compatible!  You are probably running ksh on a non-USG system.
  677. I'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
  678. have echo built in and we may have to run some Bourne shell scripts.  That
  679. means I'll have to use $ans to suppress newlines now.  Life is ridiculous.
  680.  
  681. FOO
  682.     rp="Your cursor should be here-->"
  683.     $echo $n "$rp$c"
  684.     . myread
  685.     fi
  686.     $rm -f foo1 foo2
  687.     ;;
  688. *)
  689.     : cross your fingers
  690.     echo=echo
  691.     ;;
  692. esac
  693. rmlist="$rmlist loc"
  694.  
  695. : set up shell script to do ~ expansion
  696. cat >filexp <<EOSS
  697. $startsh
  698. : expand filename
  699. case "\$1" in
  700.  ~/*|~)
  701.     echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  702.     ;;
  703.  ~*)
  704.     if $test -f /bin/csh; then
  705.     /bin/csh -f -c "glob \$1"
  706.     echo ""
  707.     else
  708.     name=\`$expr x\$1 : '..\([^/]*\)'\`
  709.     dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  710.     if $test ! -d "\$dir"; then
  711.         me=\`basename \$0\`
  712.         echo "\$me: can't locate home directory for: \$name" >&2
  713.         exit 1
  714.     fi
  715.     case "\$1" in
  716.     */*)
  717.         echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  718.         ;;
  719.     *)
  720.         echo \$dir
  721.         ;;
  722.     esac
  723.     fi
  724.     ;;
  725. *)
  726.     echo \$1
  727.     ;;
  728. esac
  729. EOSS
  730. chmod +x filexp
  731. $eunicefix filexp
  732.  
  733. : determine where public executables go
  734. case "$bin" in
  735. '')
  736.     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  737.     ;;
  738. *)  dflt="$bin"
  739.     ;;
  740. esac
  741. cont=true
  742. while $test "$cont" ; do
  743.     echo " "
  744.     rp="Where do you want to put the public executables? [$dflt]"
  745.     $echo $n "$rp $c"
  746.     . myread
  747.     bin="$ans"
  748.     bin=`filexp $bin`
  749.     if test -d $bin; then
  750.     cont=''
  751.     else
  752.     case "$fastread" in
  753.     yes) dflt=y;;
  754.     *) dflt=n;;
  755.     esac
  756.     rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  757.     $echo $n "$rp $c"
  758.     . myread
  759.     dflt=''
  760.     case "$ans" in
  761.     y*) cont='';;
  762.     esac
  763.     fi
  764. done
  765.  
  766. : see if date exists, if so, init c_date
  767. if $test ! "x$date" = "x" ; then
  768.     c_date=`LANGUAGE= $date`
  769. else
  770.     c_date='date was unavailable at configuration'
  771. fi
  772.  
  773. : get calendar mode and default calendar file name
  774. $cat <<EOM
  775.  
  776. There is a neat feature that enables scanning of the message body for
  777. entries to add to the users ".calendar" (or whatever) file.  These
  778. entries are then processed by the system program calendar.  To use
  779. this feature it needs to be enabled.  The name of the per user calendar
  780. file used by your system's calendar program is also required.
  781. EOM
  782.  
  783. case "$d_calendar" in
  784. "$define") dflt=y;;
  785. "$undef")  dflt=n;;
  786. *)       dflt=y;;
  787. esac
  788.  
  789. rp="Enable calendar feature [$dflt]"
  790. $echo $n "$rp $c"
  791. . myread
  792. case "$ans" in
  793. y*) d_calendar="$define";;
  794. *)  d_calendar="$undef";;
  795. esac
  796.  
  797. case "$calendar" in
  798.     '') dflt='calendar';;
  799.     *)  dflt=$calendar;;
  800. esac
  801.  
  802. if $test "$d_calendar" = "$define"; then
  803.     echo " "
  804.     rp="Default calendar file: [$dflt]"
  805.     $echo $n "$rp $c"
  806.     . myread
  807.     calendar="$ans"
  808. fi
  809.  
  810. : make some quick guesses about what we are up against
  811. echo " "
  812. $echo $n "Hmm...  $c"
  813. if $test -f "$uname"; then
  814.     uname_os=`$uname -s`
  815.     uname_rel=`$uname -r`
  816.     uname_rel=`expr "$uname_rel" : "\(...\).*"`
  817. else
  818.     uname_os=unknown
  819.     uname_rel=unknown
  820. fi
  821. cat /usr/include/signal.h /usr/include/sys/signal.h >foo
  822. if test `echo abc | tr a-z A-Z` = Abc ; then
  823.     echo "Looks kind of like a USG system, but we'll see..."
  824.     echo exit 1 >bsd
  825.     echo exit 0 >usg
  826.     echo exit 1 >v7
  827. elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
  828.     if $test "(" "$uname_os" = "SunOS" -a "$uname_rel" = "4.1" ")" ; then
  829.     echo "Looks like SunOs 4.1, a USG system, but we'll see..."
  830.     echo exit 1 >bsd
  831.     echo exit 0 >usg
  832.     echo exit 1 >v7
  833.     elif $test "$uname_os" = "OSF1" ; then
  834.     echo "Looks like an OSF/1 system, but we'll see.."
  835.     echo exit 1 >bsd
  836.     echo exit 1 >usg
  837.     echo exit 1 >v7
  838.     else
  839.     echo "Looks kind of like a BSD system, but we'll see..."
  840.     echo exit 0 >bsd
  841.     echo exit 1 >usg
  842.     echo exit 1 >v7
  843.     fi
  844. else
  845.     echo "Looks kind of like a version 7 system, but we'll see..."
  846.     echo exit 1 >bsd
  847.     echo exit 1 >usg
  848.     echo exit 0 >v7
  849. fi
  850. case "$eunicefix" in
  851. *unixtovms*)
  852.     cat <<'EOI'
  853. There is, however, a strange, musty smell in the air that reminds me of
  854. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  855. EOI
  856.     echo "exit 0" >eunice
  857.     d_eunice="$define"
  858.     ;;
  859. *)
  860.     echo " "
  861.     echo "Congratulations.  You aren't running Eunice."
  862.     d_eunice="$undef"
  863.     echo "exit 1" >eunice
  864.     ;;
  865. esac
  866. if test -f /xenix; then
  867.     echo "Actually, this looks more like a XENIX system..."
  868.     echo "exit 0" >xenix
  869. else
  870.     echo " "
  871.     echo "It's not Xenix..."
  872.     echo "exit 1" >xenix
  873. fi
  874. chmod +x xenix
  875. $eunicefix xenix
  876. if test -f /venix; then
  877.     echo "Actually, this looks more like a VENIX system..."
  878.     echo "exit 0" >venix
  879. else
  880.     echo " "
  881.     if xenix; then
  882.     : null
  883.     else
  884.     echo "Nor is it Venix..."
  885.     fi
  886.     echo "exit 1" >venix
  887. fi
  888. chmod +x bsd usg v7 eunice venix
  889. $eunicefix bsd usg v7 eunice venix
  890. rm -rf foo
  891. rmlist="$rmlist bsd usg v7 eunice venix xenix"
  892.  
  893. # determine text processor to use, default to troff if found.
  894. case "$roff" in
  895. '')
  896.     if $test -n "$troff"; then
  897.     dflt="$troff"
  898.     else
  899.     dflt=$nroff
  900.     fi
  901.     ;;
  902. *)  dflt="$roff";;
  903. esac
  904. $cat <<EOM
  905.  
  906. The Elm documentation (Reference Guide, Configuration Guide, etc.) is set up
  907. for troff.  If you only have nroff, it can be used, but the documentation will
  908. not be as readable.  If you use an alternate processor for troff/nroff
  909. documents it can be specified here.  Elm expects the text processor to write
  910. to standard out.  You will be given a chance to provide command line options
  911. to this command in the next question.
  912.  
  913. EOM
  914. cont=true
  915. while $test "$cont" ; do
  916.     echo " "
  917.     echo "Give the name of the program used to format the Elm documentation on"
  918.     $echo $n "your system: [$dflt] $c"
  919.     rp="Preferred Elm documentation formatter program: [$dflt]"
  920.     . myread
  921.     roff=$ans;
  922.     if $test -f "$ans"; then
  923.     cont=''
  924.     else
  925.     lookup=`loc "$ans" "" . $pth`
  926.     if $test -f "$lookup"; then
  927.         cont=''
  928.         roff=$lookup
  929.     else
  930.         if $test "$fastread" = yes; then
  931.         dflt=y
  932.         else
  933.         dflt=n
  934.         fi
  935.         echo "Text processor $ans doesn't exist."
  936.         rp="Use that name anyway? [$dflt]"
  937.         $echo $n "$rp $c"
  938.         . myread
  939.         dflt=''
  940.         case "$ans" in
  941.         y*) cont='';;
  942.         esac
  943.     fi
  944.     fi
  945. done
  946.  
  947. # determine text processor flags to use.
  948. $cat <<EOM
  949.  
  950. If this text processor requires any options for proper formatting, specify
  951. them here.  To specify no options, enter the word "none".  Some versions
  952. of troff require the -t option to write to standard out.  This is the
  953. proper place to specify that option.
  954.  
  955. EOM
  956. dflt="$roffopts"
  957. rp="What options should Elm use with $roff: [$dflt]"
  958. $echo $n "$rp $c"
  959. . myread
  960. roffopts=$ans
  961. case "$roffopts" in
  962. 'none') roffopts=''
  963.      ;;
  964. esac
  965.  
  966. : determine where manual pages go
  967. $cat <<EOM
  968.   
  969. $package has manual pages that can be installed in unformatted or formatted form.
  970. Either or both (or neither) of these may be installed. 
  971.  
  972. Please give the location in which to store each type of man page. 
  973. To specify that a particular type is not to be installed, answer "none"
  974. to the question.
  975.  
  976. EOM
  977. case "$mansrc" in
  978. '')
  979.     dflt="/usr/man/mann /usr/man/manl /usr/man/man.L /usr/man/local/man1"
  980.     dflt="$dflt /usr/man/l_man/man1 /usr/local/man/u_man/man1"
  981.     dflt="$dflt /usr/local/man/l_man/man1 /usr/man/man1 /usr/man/u_man/man1"
  982.     dflt="$dflt /usr/share/man/man1 /usr/share/man/manl"
  983.     dflt=`loc . none $dflt`
  984.     ;;
  985. *)  dflt="$mansrc"
  986.     ;;
  987. esac
  988. cont=true
  989. while $test "$cont" ; do
  990.     echo " "
  991.     rp="Where do the unformatted manual pages go? [$dflt]"
  992.     $echo $n "$rp $c"
  993.     . myread
  994.     mansrc=`filexp "$ans"`
  995.     if $test "$mansrc" = none -o -d "$mansrc"; then
  996.     cont=''
  997.     else
  998.     if $test "$fastread" = yes; then
  999.         dflt=y
  1000.     else
  1001.         dflt=n
  1002.     fi
  1003.     rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
  1004.     $echo $n "$rp $c"
  1005.     . myread
  1006.     dflt=''
  1007.     case "$ans" in
  1008.     y*) cont='';;
  1009.     esac
  1010.     fi
  1011. done
  1012.  
  1013. # determine the extension for man pages
  1014. if $test "$mansrc" != none ; then
  1015.     case "$manext" in
  1016.     '')
  1017.     if $test "$manext_choice" = none; then
  1018.         dflt=none
  1019.     else
  1020.         case "$mansrc" in
  1021.         *l) dflt=.l ;;
  1022.         *n) dflt=.n ;;
  1023.         *L) dflt=.L ;;
  1024.         *)  dflt=.1 ;;
  1025.         esac
  1026.     fi
  1027.     ;;
  1028.     .*)    dflt="$manext";;
  1029.     *)  dflt=".$manext";;
  1030.     esac
  1031.  
  1032.     $cat <<EOM
  1033.  
  1034. The installed unformatted manual pages can have various extensions to suit the
  1035. conventions of the host operating system, for example "page.1".
  1036.  
  1037. Note that the period '.' must be included as part of the extension.
  1038.  
  1039. To specify no extension, enter the word "none".
  1040.  
  1041. EOM
  1042.     rp="What extension should be used on installed unformatted man pages: [$dflt]"
  1043.     $echo $n "$rp $c"
  1044.     . myread
  1045.     manext=$ans
  1046.     manext_choice=$ans
  1047.     case "$manext" in
  1048.     'none')
  1049.     manext=''
  1050.     ;;
  1051.     esac
  1052.     fi
  1053.  
  1054. # Now the formatted man pages ala System V
  1055. case "$catmansrc" in
  1056. '')
  1057.     dflt="/usr/man/catn /usr/man/catl /usr/catman/man.L /usr/catman/local/man1"
  1058.     dflt="$dflt /usr/local/catman/u_man/man1 /usr/local/catman/l_man/man1"
  1059.     dflt="$dflt /usr/catman/l_man/man1 /usr/man/cat1 /usr/catman/man1"
  1060.     dflt="$dflt /usr/catman/u_man/man1 /usr/catman/URM/g1"
  1061.     dflt="$dflt /usr/share/man/cat1 /usr/share/man/catl"
  1062.     dflt=`loc . none $dflt`
  1063.     ;;
  1064. *)  dflt="$catmansrc"
  1065.     ;;
  1066. esac
  1067. cont=true
  1068. while $test "$cont" ; do
  1069.     echo " "
  1070.     rp="Where do the formatted manual pages go? [$dflt]"
  1071.     $echo $n "$rp $c"
  1072.     . myread
  1073.     catmansrc=`filexp "$ans"`
  1074.     if $test "$catmansrc" = none -o -d "$catmansrc"; then
  1075.     cont=''
  1076.     else
  1077.     if $test "$fastread" = yes; then
  1078.         dflt=y
  1079.     else
  1080.         dflt=n
  1081.     fi
  1082.     rp="Directory $catmansrc doesn't exist.  Use that name anyway? [$dflt]"
  1083.     $echo $n "$rp $c"
  1084.     . myread
  1085.     dflt=''
  1086.     case "$ans" in
  1087.     y*) cont='';;
  1088.     esac
  1089.     fi
  1090. done
  1091.  
  1092. # if installing formatted manual pages, determine a number of other things.
  1093. if $test "$catmansrc" != none ; then
  1094. #       determine text processor to use, default to nroff if found.
  1095.     case "$manroff" in
  1096.     '')
  1097.     if $test -n "$nroff"; then
  1098.         dflt="$nroff"
  1099.     else
  1100.         dflt=$troff
  1101.     fi
  1102.     ;;
  1103.     *)  dflt="$manroff";;
  1104.     esac
  1105.     $cat <<EOM
  1106.  
  1107. Online manual pages are generally formatted with nroff.  If you use an 
  1108. alternate text processor for on-line manual pages it can be specified here. 
  1109. Elm expects the text processor to write to standard out.
  1110.  
  1111. Note: This does not effect the formatter previously chosen for the Elm
  1112.       Elm documentation (Reference Guide, Configuration Guide, etc.).
  1113.  
  1114. EOM
  1115.     cont=true
  1116.     while $test "$cont" ; do
  1117.     echo " "
  1118.     echo "Give the name of the program used to format on-line manual pages"
  1119.     $echo $n "on your system: [$dflt] $c"
  1120.     rp="Preferred manual page formatter: [$dflt]"
  1121.     . myread
  1122.     manroff=$ans;
  1123.     if $test -f "$ans"; then
  1124.         cont=''
  1125.     else
  1126.         lookup=`loc "$ans" "" . $pth`
  1127.         if $test -f "$lookup"; then
  1128.         cont=''
  1129.         manroff=$lookup
  1130.         else
  1131.         if $test "$fastread" = yes; then
  1132.             dflt=y
  1133.           else
  1134.               dflt=n
  1135.           fi
  1136.         echo "Text processor $ans doesn't exist."
  1137.         rp="Use that name anyway? [$dflt]"
  1138.         $echo $n "$rp $c"
  1139.         . myread
  1140.         dflt=''
  1141.         case "$ans" in
  1142.         y*) cont='';;
  1143.         esac
  1144.         fi
  1145.     fi
  1146.     done
  1147.  
  1148.     # determine text processor flags to use.
  1149.     $cat <<EOM
  1150.  
  1151. If this text processor requires any options for proper formatting, specify
  1152. then here.  To specify no options, enter the word "none".
  1153.  
  1154. EOM
  1155.     dflt="$manroffopts"
  1156.     rp="What options should Elm use with $manroff: [$dflt]"
  1157.     $echo $n "$rp $c"
  1158.     . myread
  1159.     manroffopts=$ans
  1160.     case "$manroffopts" in
  1161.     'none') manroffopts=''
  1162.     ;;
  1163.     esac
  1164.  
  1165.     # determine the extension for catman pages
  1166.     case "$catmanext" in
  1167.     '')
  1168.     if $test "$catmanext_choice" = none; then
  1169.         dflt=none
  1170.     else
  1171.         case "$manext" in
  1172.         .*) dflt=$manext ;;
  1173.         *)
  1174.         if $test "$manext_choice" = none; then
  1175.             dflt=none
  1176.         else
  1177.                 case "$catmansrc" in
  1178.                 *l) dflt=.l ;;
  1179.                 *n) dflt=.n ;;
  1180.                 *L) dflt=.L ;;
  1181.                 *g1) dflt=none ;;
  1182.                 *)  dflt=.1 ;;
  1183.                 esac
  1184.         fi
  1185.         esac
  1186.     fi
  1187.     ;;
  1188.     .*)    dflt="$catmanext";;
  1189.     *)  dflt=".$catmanext";;
  1190.     esac
  1191.  
  1192.     $cat <<EOM
  1193.  
  1194. The installed formatted manual pages can have various extensions to suit the
  1195. conventions of the host operating system, for example "page.1".
  1196.  
  1197. Note that the period '.' must be included as part of the extension.
  1198.  
  1199. To specify no extension, enter the word "none".
  1200.  
  1201. EOM
  1202.     rp="What extension should be used on installed formatted man pages: [$dflt]"
  1203.     $echo $n "$rp $c"
  1204.     . myread
  1205.     catmanext=$ans
  1206.     catmanext_choice=$ans
  1207.     case "$catmanext" in
  1208.     'none')
  1209.     catmanext=''
  1210.     ;;
  1211.     esac
  1212.  
  1213.     if $test -f $pack -o -f $compress ; then
  1214. #    See if the formatted manual pages are to be packed or compressed
  1215.     if $test -f $pack; then
  1216.         $cat <<EOM
  1217.  
  1218. The formatted manual pages may be packed (.z suffix) or compressed (.Z
  1219. suffix) or left unpacked on your system.  The next two questions will deal
  1220. with how you want the formatted manual pages installed.  Answering no to
  1221. both packed and compressed will leave them unpacked.  Only one of packed
  1222. or compressed can be chosen.
  1223.  
  1224. EOM
  1225.         case "$suffix" in
  1226.         .Z) dflt=n;;
  1227.         .z) dflt=y;;
  1228.         *)  if [ "$catmansrc/*.z" != "`$echo $catmansrc/*.z`" ]; then
  1229.             dflt=y
  1230.         else
  1231.             dflt=n
  1232.         fi ;;
  1233.         esac
  1234.         rp="Should the formatted manual pages be packed? [$dflt]"
  1235.         $echo $n "$rp $c"
  1236.         . myread
  1237.         case "$ans" in
  1238.         y*) packed=y
  1239.         suffix=.z
  1240.         packer="$pack -f" ;;
  1241.         *)  packed=n ;;
  1242.         esac
  1243.     fi
  1244.  
  1245.     if $test -f $compress -a "$suffix" != ".z" ; then
  1246.         case "$suffix" in
  1247.         .z) dflt=n;;
  1248.         .Z) dflt=y;;
  1249.         *)  if [ "$catmansrc/*.Z" != "`$echo $catmansrc/*.Z`" ]; then
  1250.             dflt=y
  1251.         else
  1252.             dflt=n
  1253.         fi ;;
  1254.         esac
  1255.         rp="Should the formatted manual pages be compressed? [$dflt]"
  1256.         $echo $n "$rp $c"
  1257.         . myread
  1258.         case "$ans" in
  1259.         y*) packed=y
  1260.         suffix=.Z
  1261.         packer="$compress" ;;
  1262.         *)  packed=n ;;
  1263.         esac
  1264.     fi
  1265.  
  1266.     if $test "$packed" = 'n' ; then
  1267.         suffix=''
  1268.         packer=''
  1269.     fi
  1270.     else
  1271.     packed=''
  1272.     suffix=''
  1273.     packer=''
  1274.     fi
  1275.  
  1276. fi
  1277.  
  1278. : default clear to no extra flags
  1279. xencf=
  1280. xenlf=
  1281. d_xenix="$undef"
  1282. d_bsd="$undef"
  1283. : see if we are xenix 
  1284. if xenix; then
  1285.     d_xenix="$define"
  1286. :    now are we a 286
  1287.     case "`$uname -p`" in
  1288.     i80286) 
  1289.         xencf="-LARGE -Ml2et32"
  1290.         xenlf="-Ml2t32 -F 5600 -SEG 512"
  1291.       esac
  1292. fi
  1293. if bsd; then
  1294.     d_bsd="$define"
  1295. fi
  1296.  
  1297. : find out how to find out full name
  1298. echo " "
  1299. case "$d_berknames" in
  1300. "$define")
  1301.     dflt=y;;
  1302. "$undef")
  1303.     dflt=n;;
  1304. *)
  1305.     if bsd; then
  1306.     dflt=y
  1307.     elif xenix; then
  1308.     dflt=y
  1309.     else
  1310.     dflt=n
  1311.     fi
  1312.     ;;
  1313. esac
  1314. echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  1315. $echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  1316. rp="Berkeley/V7 format full name? [$dflt]"
  1317. . myread
  1318. case "$ans" in
  1319.   y*)
  1320.     d_passnames="$define"
  1321.     d_berknames="$define"
  1322.     d_usgnames="$undef"
  1323.     nametype=bsd
  1324.     ;;
  1325.   *)
  1326.     echo " "
  1327.     case "$d_usgnames" in
  1328.     "$define")
  1329.     dflt=y;;
  1330.     "$undef")
  1331.     dflt=n;;
  1332.     *)
  1333.     if usg; then
  1334.         dflt=y
  1335.     else
  1336.         dflt=n
  1337.     fi
  1338.     ;;
  1339.     esac
  1340.     echo "Does your passwd file keep full names in USG format (name sandwiched"
  1341.     $echo $n "between a '-' and a '(')? [$dflt] $c"
  1342.     rp="USG format full name? [$dflt]"
  1343.     . myread
  1344.     case "$ans" in
  1345.       n*)
  1346.     echo "Full name will be taken from ~/.fullname"
  1347.     d_passnames="$undef"
  1348.     d_berknames="$undef"
  1349.     d_usgnames="$undef"
  1350.     nametype=other
  1351.     ;;
  1352.       *)
  1353.     d_passnames="$define"
  1354.     d_berknames="$undef"
  1355.     d_usgnames="$define"
  1356.     nametype=usg
  1357.     ;;
  1358.     esac
  1359.     ;;
  1360. esac
  1361.  
  1362. : see if we have to deal with yellow pages, if so, put sun
  1363. : library first, as the yp password routines must override
  1364. : the c library ones
  1365. if $test -d /usr/etc/yp || $test -d /etc/yp; then
  1366.     if $test "$passcat" = "ypcat passwd"; then
  1367.     dflt=y
  1368.     elif $contains '^\+:' /etc/passwd; then
  1369.     dflt=y
  1370.     else
  1371.     dflt=n
  1372.     fi
  1373.     rp="Are you getting the passwd file via yellow pages? [$dflt]"
  1374.     $echo $n "$rp $c"
  1375.     . myread
  1376.     case "$ans" in
  1377.     y*) passcat='ypcat passwd'
  1378.     case "$libswanted" in
  1379.     '') libswanted='sun c_s';;
  1380.     *)  libswanted="sun $libswanted";;
  1381.     esac
  1382.     ;;
  1383.     *) passcat='cat /etc/passwd';;
  1384.     esac
  1385. else
  1386.     passcat='cat /etc/passwd'
  1387. fi
  1388.  
  1389. : see what memory models we can support
  1390. case "$models" in
  1391. '')
  1392.     : We may not use Cppsym or we get a circular dependency through cc.
  1393.     : But this should work regardless of which cc we eventually use.
  1394.     cat >pdp11.c <<'EOP'
  1395. main() {
  1396. #ifdef pdp11
  1397.     exit(0);
  1398. #else
  1399.     exit(1);
  1400. #endif
  1401. }
  1402. EOP
  1403.     cc -o pdp11 pdp11.c >/dev/null 2>&1
  1404.     if pdp11 2>/dev/null; then
  1405.     dflt='unsplit split'
  1406.     else
  1407.     ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
  1408.     case "$ans" in
  1409.     X) dflt='none';;
  1410.     *)  if $test -d /lib/small || $test -d /usr/lib/small; then
  1411.         dflt='small'
  1412.         else
  1413.         dflt=''
  1414.         fi
  1415.         if $test -d /lib/medium || $test -d /usr/lib/medium; then
  1416.         dflt="$dflt medium"
  1417.         fi
  1418.         if $test -d /lib/large || $test -d /usr/lib/large; then
  1419.         dflt="$dflt large"
  1420.         fi
  1421.         if $test -d /lib/huge || $test -d /usr/lib/huge; then
  1422.         dflt="$dflt huge"
  1423.         fi
  1424.     esac
  1425.     fi
  1426.     ;;
  1427. *)  dflt="$models" ;;
  1428. esac
  1429. if $test -z "$xencf" ; then
  1430. $cat <<EOM
  1431.  
  1432. Some systems have different model sizes.  On most systems they are called
  1433. small, medium, large, and huge.  On the PDP11 they are called unsplit and
  1434. split.  If your system doesn't support different memory models, say "none".
  1435. If you wish to force everything to one memory model, say "none" here and
  1436. put the appropriate flags later when it asks you for other cc and ld flags.
  1437. Xenix and Venix systems may wish to put "none" and let the compiler figure
  1438. things out.
  1439. (In the following question multiple model names should be space separated.)
  1440.  
  1441. EOM
  1442. rp="Which models are supported? [$dflt]"
  1443. $echo $n "$rp $c"
  1444. . myread
  1445. models="$ans"
  1446.  
  1447. case "$models" in
  1448. none)
  1449.     small=''
  1450.     medium=''
  1451.     large=''
  1452.     huge=''
  1453.     unsplit=''
  1454.     split=''
  1455.     ;;
  1456. *split)
  1457.     case "$split" in
  1458.     '') 
  1459.     if $contains '\-i' $mansrc/man1/ld.1 >/dev/null 2>&1 || \
  1460.        $contains '\-i' $mansrc/man1/cc.1 >/dev/null 2>&1; then
  1461.         dflt='-i'
  1462.     else
  1463.         dflt='none'
  1464.     fi
  1465.     ;;
  1466.     *) dflt="$split";;
  1467.     esac
  1468.     rp="What flag indicates separate I and D space? [$dflt]"
  1469.     $echo $n "$rp $c"
  1470.     . myread
  1471.     case "$ans" in
  1472.     none) ans='';;
  1473.     esac
  1474.     split="$ans"
  1475.     unsplit=''
  1476.     ;;
  1477. *large*|*small*|*medium*|*huge*)
  1478.     case "$models" in
  1479.     *large*)
  1480.     case "$large" in
  1481.     '') dflt='-Ml';;
  1482.     *) dflt="$large";;
  1483.     esac
  1484.     rp="What flag indicates large model? [$dflt]"
  1485.     $echo $n "$rp $c"
  1486.     . myread
  1487.     case "$ans" in
  1488.     none) ans='';
  1489.     esac
  1490.     large="$ans"
  1491.     ;;
  1492.     *) large='';;
  1493.     esac
  1494.     case "$models" in
  1495.     *huge*)
  1496.     case "$huge" in
  1497.     '') dflt='-Mh';;
  1498.     *) dflt="$huge";;
  1499.     esac
  1500.     rp="What flag indicates huge model? [$dflt]"
  1501.     $echo $n "$rp $c"
  1502.     . myread
  1503.     case "$ans" in
  1504.     none) ans='';
  1505.     esac
  1506.     huge="$ans"
  1507.     ;;
  1508.     *) huge="$large";;
  1509.     esac
  1510.     case "$models" in
  1511.     *medium*)
  1512.     case "$medium" in
  1513.     '') dflt='-Mm';;
  1514.     *) dflt="$medium";;
  1515.     esac
  1516.     rp="What flag indicates medium model? [$dflt]"
  1517.     $echo $n "$rp $c"
  1518.     . myread
  1519.     case "$ans" in
  1520.     none) ans='';
  1521.     esac
  1522.     medium="$ans"
  1523.     ;;
  1524.     *) medium="$large";;
  1525.     esac
  1526.     case "$models" in
  1527.     *small*)
  1528.     case "$small" in
  1529.     '') dflt='none';;
  1530.     *) dflt="$small";;
  1531.     esac
  1532.     rp="What flag indicates small model? [$dflt]"
  1533.     $echo $n "$rp $c"
  1534.     . myread
  1535.     case "$ans" in
  1536.     none) ans='';
  1537.     esac
  1538.     small="$ans"
  1539.     ;;
  1540.     *) small='';;
  1541.     esac
  1542.     ;;
  1543. *)
  1544.     echo "Unrecognized memory models--you may have to edit Makefile.SH"
  1545.     ;;
  1546. esac
  1547. fi
  1548.  
  1549. : see if we need a special compiler
  1550. echo " "
  1551. if usg; then
  1552.     case "$cc" in
  1553.     '')
  1554.     case "$Mcc" in
  1555.     /*) dflt='Mcc'
  1556.         ;;
  1557.     *)
  1558.         case "$large" in
  1559.         -M*)
  1560.         dflt='cc'
  1561.         ;;
  1562.         *)
  1563.         if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1564.             dflt='cc -M'
  1565.         else
  1566.             dflt='cc'
  1567.         fi
  1568.         ;;
  1569.         esac
  1570.         ;;
  1571.     esac
  1572.     ;;
  1573.     *)  dflt="$cc";;
  1574.     esac
  1575.     $cat <<'EOM'
  1576.   
  1577. On some systems the default C compiler will not resolve multiple global
  1578. references that happen to have the same name.  On some such systems the
  1579. "Mcc" command may be used to force these to be resolved.  On other systems
  1580. a "cc -M" command is required.  (Note that the -M flag on other systems
  1581. indicates a memory model to use!)  If you have the Gnu C compiler, you
  1582. might wish to use that instead.  What command will force resolution on
  1583. EOM
  1584.     $echo $n "this system? [$dflt] $c"
  1585.     rp="Command to resolve multiple refs? [$dflt]"
  1586.     . myread
  1587.     cc="$ans"
  1588. else
  1589.     case "$cc" in
  1590.     '') dflt=cc;;
  1591.     *) dflt="$cc";;
  1592.     esac
  1593.     rp="Use which C compiler? [$dflt]"
  1594.     $echo $n "$rp $c"
  1595.     . myread
  1596.     cc="$ans"
  1597. fi
  1598. case "$cc" in
  1599. gcc*) cpp=`loc gcc-cpp $cpp $pth`;;
  1600. esac
  1601.  
  1602. : determine optimize, if desired, or use for debug flag also
  1603. case "$optimize" in
  1604. ' ') dflt="none"
  1605.      ;;
  1606. '') dflt="-O";
  1607.     ;;
  1608. *)  dflt="$optimize"
  1609.     ;;
  1610. esac
  1611. cat <<EOH
  1612.  
  1613. Some C compilers have problems with their optimizers, by default, $package
  1614. compiles with the -O flag to use the optimizer.  Alternately, you might
  1615. want to use the symbolic debugger, which uses the -g flag (on traditional
  1616. UNIX systems).  Either flag can be specified here.  To use neither flag,
  1617. specify the word "none".
  1618.   
  1619. EOH
  1620. rp="What optimizer/debugger flag should be used? [$dflt]"
  1621. $echo $n "$rp $c"
  1622. . myread
  1623. optimize="$ans"
  1624. case "$optimize" in
  1625. 'none') optimize=" "
  1626.      ;;
  1627. esac
  1628.  
  1629. case "$ccflags" in
  1630. '') case "$cc" in
  1631.     *gcc*) dflt='-fpcc-struct-return -traditional';;
  1632.     *) dflt='';;
  1633.     esac
  1634.     ;;
  1635. *) dflt="$ccflags";;
  1636. esac
  1637. for thisincl in $inclwanted; do
  1638.     if test -d $thisincl; then
  1639.     case "$dflt" in
  1640.     *$thisincl*);;
  1641.     *) dflt="$dflt -I$thisincl";;
  1642.     esac
  1643.     fi
  1644. done
  1645. case "$optimize" in
  1646. -g*)
  1647.     case "$dflt" in
  1648.     *DEBUG*);;
  1649.     *) dflt="$dflt -DDEBUG";;
  1650.     esac
  1651.     ;;
  1652. esac
  1653. case "$dflt" in
  1654. '') dflt=none;;
  1655. esac
  1656. if $test -n "$xencf" ; then
  1657.     $echo "Xenix 286 system, using compiler flags $xencf"
  1658.     $echo "do not respecify these flags below."
  1659.     $echo ""
  1660. fi
  1661. cat <<EOH
  1662.  
  1663. Your C compiler may want other flags.  For this question you should
  1664. include -I/whatever and -DWHATEVER flags and any other flags used by
  1665. the C compiler, but you should NOT include libraries or ld flags like
  1666. -lwhatever.  To use no flags, specify the word "none".
  1667.   
  1668. EOH
  1669. rp="Any additional cc flags? [$dflt]"
  1670. $echo $n "$rp $c"
  1671. . myread
  1672. case "$ans" in
  1673. none) ans='';
  1674. esac
  1675. ccflags="$ans"
  1676.  
  1677. : the following weeds options from ccflags that are of no interest to cpp
  1678. cppflags="$ccflags"
  1679. case "$cc" in
  1680. *gcc*) cppflags="$cppflags -D__GNUC__";;
  1681. esac
  1682. case "$cppflags" in
  1683. '');;
  1684. *)  set X $cppflags
  1685.     cppflags=''
  1686.     for flag do
  1687.     case $flag in
  1688.     -D*|-I*) cppflags="$cppflags $flag";;
  1689.     esac
  1690.     done
  1691.     case "$cppflags" in
  1692.     *-*)  echo "(C preprocessor flags: $cppflags)";;
  1693.     esac
  1694.     ;;
  1695. esac
  1696.  
  1697. if $test -n "$xenlf" ; then
  1698.     $echo "Xenix 286 system, using linker flags $xenlf"
  1699.     $echo "do not respecify these flags below"
  1700.     $echo ""
  1701. fi
  1702. case "$ldflags" in
  1703. '') if venix; then
  1704.     dflt='-i -z'
  1705.     else
  1706.     dflt='none'
  1707.     fi
  1708.     ;;
  1709. *) dflt="$ldflags";;
  1710. esac
  1711. cat <<EOH
  1712.  
  1713. Your linker/loader may want other flags.  For example, you might
  1714. want to enable support for the symbolic debugger (-g on traditional
  1715. UNIX systems).  For this question you should specify those flags.
  1716. Do NOT specify libraries (-lwhatever) here.  Most systems will not
  1717. need any special flags, in which case specify "none".
  1718.  
  1719. EOH
  1720. rp="Any additional ld flags (NOT including libraries)? [$dflt]"
  1721. $echo $n "$rp $c"
  1722. . myread
  1723. case "$ans" in
  1724. none) ans='';
  1725. esac
  1726. ldflags="$ans"
  1727. rmlist="$rmlist pdp11"
  1728.  
  1729. echo " "
  1730. echo "Checking for optional libraries..."
  1731. case "$libs" in
  1732. '') dflt='';;
  1733. *) dflt="$libs";;
  1734. esac
  1735. case "$libswanted" in
  1736. '') libswanted='c_s';;
  1737. esac
  1738. for thislib in $libswanted; do
  1739.     case "$thislib" in
  1740.     dbm) thatlib=ndbm;;
  1741.     *_s) thatlib=NONE;;
  1742.     *) thatlib="${thislib}_s";;
  1743.     *) thatlib=NONE;;
  1744.     esac
  1745.     xxx=`loc lib$thislib.a X /usr/lib /usr/ccs/lib /usr/local/lib /lib`
  1746.     if test -f $xxx; then
  1747.     echo "Found -l$thislib."
  1748.     case "$dflt" in
  1749.     *-l$thislib*|*-l$thatlib*);;
  1750.     *) dflt="$dflt -l$thislib";;
  1751.     esac
  1752.     else
  1753.     xxx=`loc lib$thislib.a X $libpth`
  1754.     if test -f $xxx; then
  1755.         echo "Found $xxx."
  1756.         case "$dflt" in
  1757.         *$xxx*);;
  1758.         *) dflt="$dflt $xxx";;
  1759.         esac
  1760.     else
  1761.         xxx=`loc Slib$thislib.a X $xlibpth`
  1762.         if test -f $xxx; then
  1763.         echo "Found -l$thislib."
  1764.         case "$dflt" in
  1765.         *-l$thislib*|*-l$thatlib*);;
  1766.         *) dflt="$dflt -l$thislib";;
  1767.         esac
  1768.         else
  1769.         echo "No -l$thislib."
  1770.         fi
  1771.     fi
  1772.     fi
  1773. done
  1774. set X $dflt
  1775. shift
  1776. dflt="$*"
  1777. case "$dflt" in
  1778. '') dflt='none';;
  1779. esac
  1780.  
  1781. $cat <<EOM
  1782.  
  1783. Some versions of UNIX support shared libraries, which make
  1784. executables smaller but make load time slightly longer.
  1785.  
  1786. On some systems, mostly newer UNIX System V's, the shared library
  1787. is included by putting the option "-lc_s" as the last thing on the
  1788. cc command line when linking.  Other systems use shared libraries
  1789. by default.  There may be other libraries needed to compile $package
  1790. on your machine as well.  If your system needs the "-lc_s" option,
  1791. include it here.  Include any other special libraries here as well.
  1792. Say "none" for none.
  1793. EOM
  1794.  
  1795. echo " "
  1796. rp="Any additional libraries? [$dflt]"
  1797. $echo $n "$rp $c"
  1798. . myread
  1799. case "$ans" in
  1800. none) ans='';
  1801. esac
  1802. libs="$ans"
  1803.  
  1804. : check for "existence of altzone"
  1805. echo " "
  1806. case "$d_altcheck" in
  1807. "$define")    ;;
  1808. "$undef")    ;;
  1809. *)
  1810.         echo "Checking to see if altzone exists as a global variable works..."
  1811.         $rm -f try try.o
  1812.         $cat >try.c <<'EOCP'
  1813.  
  1814. main()
  1815.     {
  1816.     long    t;
  1817.     extern    long    altzone;
  1818.  
  1819.     t = altzone;
  1820.  
  1821.     exit(0);
  1822.     }
  1823. EOCP
  1824.         if $cc try.c -o try >/dev/null 2>&1 ; then
  1825.         d_altcheck="$define"
  1826.         echo "Your system supports altzone..."
  1827.         else
  1828.         d_altcheck="$undef"
  1829.         echo "Your system does not support altzone..."
  1830.         fi
  1831.         $rm -f try.c try.o try
  1832.     ;;
  1833. esac
  1834.  
  1835. : check to see if the macros are 8-bit clean, ask the user
  1836. :
  1837. $cat <<EOM
  1838.  
  1839.  
  1840. Not all environments are restricted to the ASCII 7-bit character set.
  1841. For example, the ISO 8859/1 (Latin alphabet no. 1) character set,
  1842. consisting of 8 bits and 191 printable characters, is becoming
  1843. more and more common, especially in non-English speaking countries.
  1844.  
  1845. Unfortunately, not all isprint() functions or macros, which ELM
  1846. uses to determine whether a character is printable or not, will
  1847. handle non-ASCII (8-bit) characters properly.  It is suggested that you
  1848. start with this value configured to handle 8-bit characters correctly
  1849. and if there are problems with Elm aborting while displaying messages
  1850. that use extended character sets to reconfigure Elm to only display
  1851. 7-bit characters.
  1852.  
  1853. EOM
  1854.  
  1855. case "$d_ascii" in
  1856.     "$define")   dflt='n';;
  1857.     *)  dflt='y';;
  1858. esac
  1859.  
  1860. echo "  "
  1861. rp="Should Elm assume that isprint() won't break on non-ASCII characters? [$dflt]"
  1862. $echo $n "$rp $c"
  1863. . myread
  1864. case "$ans" in
  1865.     y*) d_ascii="$undef";;
  1866.     *) d_ascii="$define";;
  1867. esac
  1868.  
  1869.  
  1870. case "$d_content" in
  1871. "$define") dflt=y;;
  1872. "$undef")  dflt=n;;
  1873. *)       dflt=n;;
  1874. esac
  1875.  
  1876. $cat << EOM
  1877.  
  1878. Some modern Mail Transport Agents (mailers) support the Content-Length: header.
  1879. In doing so, they do not wish to have messages escaped to protect 'From ' lines
  1880. in the body of the message, among other strings.  Does the Mail Transport Agent
  1881. in use on this system honor the Content-Length: header?
  1882. EOM
  1883.  
  1884. echo " "
  1885. rp="Honors Content-Length: header? [$dflt]"
  1886. $echo $n "$rp $c"
  1887. . myread
  1888. case "$ans" in
  1889. y*) d_content="$define";;
  1890. *)  d_content="$undef";;
  1891. esac
  1892.  
  1893. : get list of predefined functions in a handy place
  1894. echo " "
  1895. case "$libc" in
  1896. '') if test -d /usr/apollo; then
  1897.     libc=/lib/libc
  1898.     else
  1899.     libc=unknown
  1900.     fi
  1901.     ;;
  1902. '/lib/libc /lib/clib')
  1903.     libc=/lib/libc
  1904.     ;;
  1905. esac
  1906. case "$mips" in
  1907. '') mips=false;;
  1908. 'mips') mips=false;;
  1909. esac
  1910. case "$nm_opts" in
  1911. '') if test -f /mach_boot; then
  1912.     nm_opts=''
  1913.     elif test -d /usr/ccs/lib; then
  1914.     nm_opts='-p'
  1915.     elif "$mips"; then
  1916.     nm_opts='-B'
  1917.     else
  1918.     nm_opts=''
  1919.     fi
  1920.     ;;
  1921. esac
  1922. : on mips, we DO NOT want /lib, and we want inclPath/usr/lib
  1923. case "$libpth" in
  1924. '') if "$mips"; then
  1925.     libpth='$inclPath/usr/lib /usr/local/lib'
  1926.     nm_opts='-B'
  1927.     else
  1928.     libpth='/usr/ccs/lib /lib /usr/lib /usr/ucblib /usr/local/lib'
  1929.     fi
  1930.     ;;
  1931. esac
  1932. case "$libs" in
  1933. *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
  1934. esac
  1935. libnames='';
  1936. case "$libs" in
  1937. '') ;;
  1938. *)  for thislib in $libs; do
  1939.     case "$thislib" in
  1940.     -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
  1941.         try=`./loc lib$thislib.a blurfl/dyick $libpth`
  1942.         if test ! -f $try; then
  1943.         try=`./loc lib$thislib blurfl/dyick $libpth`
  1944.         if test ! -f $try; then
  1945.             try=`./loc $thislib blurfl/dyick $libpth`
  1946.             if test ! -f $try; then
  1947.             try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
  1948.             if test ! -f $try; then
  1949.                 try=''
  1950.             fi
  1951.             fi
  1952.         fi
  1953.         fi
  1954.         libnames="$libnames $try"
  1955.         ;;
  1956.     *) libnames="$libnames $thislib" ;;
  1957.     esac
  1958.     done
  1959.     ;;
  1960. esac
  1961. set /usr/ccs/lib/libc.so
  1962. test -f $1 || set /usr/lib/libc.so
  1963. test -f $1 || set /usr/lib/libc.so.[0-9]*
  1964. test -f $1 || set /lib/libsys_s.a
  1965. eval set \$$#
  1966. if test -f "$1"; then
  1967.     echo "Your shared C library is in $1."
  1968.     libc="$1"
  1969. elif test -f "$libc"; then
  1970.     echo "Your C library is in $libc."
  1971. elif test -f /lib/libc.a; then
  1972.     echo "Your C library is in /lib/libc.a.  You're normal."
  1973.     libc=/lib/libc.a
  1974. else
  1975.     if   ans=`./loc libc.a  blurfl/dyick $libpth`; test -f "$ans"; then
  1976.     :
  1977.     elif ans=`./loc libc    blurfl/dyick $libpth`; test -f "$ans"; then
  1978.         libnames="$libnames "`./loc clib blurfl/dyick $libpth`
  1979.     elif ans=`./loc clib    blurfl/dyick $libpth`; test -f "$ans"; then
  1980.     :
  1981.     elif ans=`./loc Slibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1982.     :
  1983.     elif ans=`./loc Mlibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1984.     :
  1985.     elif ans=`./loc Llibc.a blurfl/dyick $xlibpth`; test -f "$ans"; then
  1986.     :
  1987.     fi
  1988.     if test -f "$ans"; then
  1989.     echo "Your C library is in $ans, of all places."
  1990.     libc=$ans
  1991.     else
  1992.     cat <<EOM
  1993.  
  1994. I can't seem to find your C library.  I've looked in the following places:
  1995.  
  1996.     $libpth
  1997.  
  1998. None of these seems to contain your C library.  What is the full name
  1999. EOM
  2000.     dflt=None
  2001.     $echo $n "of your C library? $c"
  2002.     rp='C library full name?'
  2003.     . myread
  2004.     libc="$ans"
  2005.     fi
  2006. fi
  2007. echo " "
  2008. if test $libc = "/lib/libc"; then
  2009.     libc="$libc /lib/clib"
  2010. fi
  2011. set `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
  2012. $echo $n "Extracting names from $* for later perusal...$c"
  2013. nm $nm_opts $* 2>/dev/null >libc.tmp
  2014. $sed -n -e 's/^.* [ATDS]  *[_.]*//p' -e 's/^.* [ATDS] //p' <libc.tmp >libc.list
  2015. if $contains '^printf$' libc.list >/dev/null 2>&1; then
  2016.     echo done
  2017. elif $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' \
  2018.     <libc.tmp >libc.list; \
  2019.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2020.     echo done
  2021. elif $sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p' <libc.tmp >libc.list; \
  2022.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2023.     echo done
  2024. elif $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list; \
  2025.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2026.     echo done
  2027. elif $sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' \
  2028.         <libc.tmp >libc.list; \
  2029.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2030.     echo done
  2031. elif $grep '|' <libc.tmp | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
  2032.                                    -e 's/^\([^     ]*\).*/\1/p' >libc.list
  2033.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2034.     echo done
  2035. elif $sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p' \
  2036.        <libc.tmp >libc.list; \
  2037.   $contains '^printf$' libc.list >/dev/null 2>&1; then
  2038.     echo done
  2039. else
  2040.     nm -p $* 2>/dev/null >libc.tmp
  2041.     $sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
  2042.     if $contains '^printf$' libc.list >/dev/null 2>&1; then
  2043.     nm_opts='-p'
  2044.     echo "done"
  2045.     else
  2046.     echo " "
  2047.     echo "nm didn't seem to work right."
  2048.     echo "Trying ar instead..."
  2049.     if ar t $libc > libc.tmp; then
  2050.         for thisname in $libnames; do
  2051.         ar t $thisname >>libc.tmp
  2052.         done
  2053.         $sed -e 's/\.o$//' < libc.tmp > libc.list
  2054.         echo "Ok."
  2055.     else
  2056.         echo "ar didn't seem to work right."
  2057.         echo "Maybe this is a Cray...trying bld instead..."
  2058.         if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
  2059.         for thisname in $libnames; do
  2060.             bld t $libnames | \
  2061.             $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
  2062.             ar t $thisname >>libc.tmp
  2063.         done
  2064.         echo "Ok."
  2065.         else
  2066.         echo "That didn't work either.  Giving up."
  2067.         exit 1
  2068.         fi
  2069.     fi
  2070.     fi
  2071. fi
  2072.  
  2073. : old version
  2074.  
  2075. inlibc='echo " ";
  2076. if $contains "^$1\$" libc.list >/dev/null 2>&1;
  2077. then echo "$1() found"; eval "$2=$define";
  2078. else echo "$1() not found"; eval "$2=$undef"; fi'
  2079.  
  2080. : : new version
  2081. : inlibc='echo " "; td=$define; tu=$undef;
  2082. : if $contains "^$1\$" libc.list >/dev/null 2>&1;
  2083. : then echo "$1() found";
  2084. :   eval "case \"\$$2\" in undef) . whoa; esac"; eval "$2=\$td";
  2085. : else echo "$1() not found";
  2086. :   eval "case \"\$$2\" in define) . whoa; esac"; eval "$2=\$tu"; fi'
  2087. : rmlist="$rmlist libc.tmp libc.list"
  2088. : see if crypt exists
  2089. echo " "
  2090. if $contains '^crypt$' libc.list >/dev/null 2>&1; then
  2091.     echo 'crypt() found.'
  2092.     d_crypt="$define"
  2093.     cryptlib=''
  2094. else
  2095.     cryptlib=`loc Slibcrypt.a "" $xlibpth`
  2096.     if $test -z "$cryptlib"; then
  2097.     cryptlib=`loc Mlibcrypt.a "" $xlibpth`
  2098.     else
  2099.     cryptlib=-lcrypt
  2100.     fi
  2101.     if $test -z "$cryptlib"; then
  2102.     cryptlib=`loc Llibcrypt.a "" $xlibpth`
  2103.     else
  2104.     cryptlib=-lcrypt
  2105.     fi
  2106.     if $test -z "$cryptlib"; then
  2107.     cryptlib=`loc libcrypt.a "" $libpth`
  2108.     else
  2109.     cryptlib=-lcrypt
  2110.     fi
  2111. #
  2112. #    now try for international versions?
  2113. #
  2114.     if $test -z "$cryptlib"; then
  2115.     cryptlib=`loc Slibcrypt_i.a "" $libpth`
  2116.     if $test -z "$cryptlib"; then
  2117.         cryptlib=`loc Mlibcrypt_i.a "" $libpth`
  2118.     else
  2119.         cryptlib=-lcrypt_i
  2120.     fi
  2121.     if $test -z "$cryptlib"; then
  2122.         cryptlib=`loc Llibcrypt_i.a "" $libpth`
  2123.     else
  2124.         cryptlib=-lcrypt_i
  2125.     fi
  2126.     if $test -z "$cryptlib"; then
  2127.         cryptlib=`loc libcrypt_i.a "" $libpth`
  2128.     else
  2129.         cryptlib=-lcrypt_i
  2130.     fi
  2131.     fi
  2132.     if $test -z "$cryptlib"; then
  2133.     echo 'crypt() not found.'
  2134.     d_crypt="$undef"
  2135.     else
  2136.     d_crypt="$define"
  2137.     fi
  2138. fi
  2139.  
  2140. : check for cuserid function
  2141. set cuserid d_cuserid
  2142. eval $inlibc
  2143.  
  2144. : determine if the host name should be displayed on the index page
  2145.  
  2146. case "$d_disphost" in
  2147. "$define") dflt=y;;
  2148. "$undef")  dflt=n;;
  2149. *)    dflt=n;;
  2150. esac
  2151. $cat <<EOM
  2152.  
  2153. Elm can either display the hostname on the index page, or just
  2154. the folder name.  If the hostname is displayed, the folder name
  2155. will read hostname:folder.  If not it will just read folder.
  2156.  
  2157. EOM
  2158. rp="Should Elm display the hostname as part of the folder name? [$dflt]"
  2159. $echo $n "$rp $c"
  2160. . myread
  2161. case "$ans" in
  2162. y*) d_disphost="$define";;
  2163. *)  d_disphost="$undef";;
  2164. esac
  2165.  
  2166.  
  2167. echo " "
  2168. if $contains flock libc.list >/dev/null 2>&1; then
  2169.     echo 'flock() found.'
  2170.     if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
  2171.         has_flock="$define"
  2172.         echo 'flock locking available.'
  2173.     elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
  2174.         has_flock="$define"
  2175.         echo 'flock locking available.'
  2176.     else
  2177.     has_flock="$undef"
  2178.         echo 'flock locking not available.'
  2179.     d_flock="$undef"
  2180.     fi
  2181. else
  2182.     has_flock="$undef"
  2183.     d_flock="$undef"
  2184. fi
  2185.  
  2186. if $contains F_SETLK /usr/include/sys/fcntl.h >/dev/null 2>&1; then
  2187.     echo 'F_SETLK found, fcntl locking available'
  2188.     has_fcntl="$define"
  2189. elif $contains F_SETLK /usr/include/sys/fcntlcom.h >/dev/null 2>&1; then
  2190.     echo 'F_SETLK found, fcntl locking available'
  2191.     has_fcntl="$define"
  2192. elif $contains F_SETLK /usr/include/sys/file.h >/dev/null 2>&1; then
  2193.     echo 'F_SETLK found, fcntl locking available'
  2194.     has_fcntl="$define"
  2195. else
  2196.     echo 'F_SETLK not found, fcntl locking not available'
  2197.     has_fcntl="$undef"
  2198.     d_fcntlock="$undef"
  2199. fi
  2200.  
  2201. if $test "$has_flock" = "$define" -o "$has_fcntl" = "$define"; then
  2202.     $cat <<EOM
  2203. Mail Transport Agents (sendmail, etc.) and Mail User Agents (Elm) can
  2204. use a variety of file locking protocols.  Based on your system type,
  2205. usage of a network, and MTA/MUAs in use, you may want to configure more
  2206. than one of the following Mail Locking Protocols.  It is recommended
  2207. that you use as many as are possible on your system to avoid problems.
  2208. All systems can support the dot locking method (.lock files).
  2209.  
  2210. Available locking protocols:
  2211.     dot locking (.lock)
  2212. EOM
  2213.     if $test "$has_flock" = "$define"; then
  2214.     echo '    flock style locking'
  2215.     fi
  2216.  
  2217.     if $test "$has_fcntl" = "$define"; then
  2218.     echo '    fcntl style locking'
  2219.     fi
  2220.  
  2221.     if $test "$has_flock" = "$define" -a "$has_fcntl" = "$define"; then
  2222.     $cat <<EOM
  2223. On some systems, flock style locking and fcntl style locking use the
  2224. same underlying calls so both are not only not necessary, but may
  2225. interfere with each other.  On other systems they are distinct and both
  2226. should be used.  You will have to consult the documentation for your
  2227. operating system to determine in which class your system resides.
  2228.  
  2229. EOM
  2230.     fi
  2231.  
  2232.     case "$d_dotlock" in
  2233.     "$define")    dflt=y;;
  2234.     "$undef")    dflt=n;;
  2235.     *)        dflt=y;;
  2236.     esac
  2237.  
  2238.     rp="Would you like to use dot lock style mail spool locking? [$dflt]"
  2239.     $echo $n "$rp $c"
  2240.     . myread
  2241.     case "$ans" in
  2242.     y*) d_dotlock="$define";;
  2243.     *)  d_dotlock="$undef";;
  2244.     esac
  2245.  
  2246.     if $test "$has_flock" = "$define"; then
  2247.     case "$d_flock" in
  2248.     "$define")    dflt=y;;
  2249.     "$undef")    dflt=n;;
  2250.     *)        dflt=y;;
  2251.     esac
  2252.  
  2253.     rp="Would you like to use flock style mail spool locking? [$dflt]"
  2254.     $echo $n "$rp $c"
  2255.     . myread
  2256.     case "$ans" in
  2257.     y*) d_flock="$define";;
  2258.     *)  d_flock="$undef";;
  2259.     esac
  2260.     fi
  2261.  
  2262.     if $test "$has_fcntl" = "$define"; then
  2263.     case "$d_fcntlock" in
  2264.     "$define")    dflt=y;;
  2265.     "$undef")    dflt=n;;
  2266.     *)        dflt=y;;
  2267.     esac
  2268.  
  2269.     rp="Would you like to use fcntl style mail spool locking? [$dflt]"
  2270.     $echo $n "$rp $c"
  2271.     . myread
  2272.     case "$ans" in
  2273.     y*) d_fcntlock="$define";;
  2274.     *)  d_fcntlock="$undef";;
  2275.     esac
  2276.     fi
  2277. else
  2278.     d_dotlock="$define"
  2279.     echo 'Dot lock style locking will be used'
  2280. fi
  2281.  
  2282. if $test -d /usr/spool/locks ; then
  2283.     lock_dir=/usr/spool/locks
  2284. elif $test -d /usr/spool/uucp ; then
  2285.     lock_dir=/usr/spool/uucp
  2286. elif $test -d /var/spool/locks ; then
  2287.     lock_dir=/var/spool/locks
  2288. elif $test -d /var/spool/uucp ; then
  2289.     lock_dir=/var/spool/uucp
  2290. else
  2291.     lock_dir=/tmp
  2292. fi
  2293. echo " "
  2294. echo "Non-mailbox locks will use the $lock_dir directory"
  2295. echo " "
  2296.  
  2297. : now get the host name
  2298. if $test "$autohostname" != "$undef" -o "$hostname" = "" ; then
  2299.     autohostname="$define"
  2300.     echo " "
  2301.     echo "Figuring out host name..."
  2302.     echo 'Maybe "hostname" will work...'
  2303.     if ans=`sh -c hostname 2>&1` ; then
  2304.     hostname=$ans
  2305.     phostname=hostname
  2306.     else
  2307.     if xenix; then
  2308.         echo 'Oh, dear.  Maybe "/etc/systemid" is the key...'
  2309.         if ans=`cat /etc/systemid 2>&1` ; then
  2310.         hostname=$ans
  2311.         phostname='cat /etc/systemid'
  2312.         echo "Whadyaknow.  Xenix always was a bit strange..."
  2313.         else
  2314.         echo 'No, maybe "uuname -l" will work...'
  2315.         if ans=`sh -c '$uuname -l' 2>&1` ; then
  2316.             hostname=$ans
  2317.             phostname='$uuname -l'
  2318.         else
  2319.             echo 'Strange.  Maybe "uname -n" will work...'
  2320.             if ans=`sh -c '$uname -n' 2>&1` ; then
  2321.             hostname=$ans
  2322.             phostname='$uname -n'
  2323.             else
  2324.             echo 'Oh well, maybe I can mine it out of whoami.h...'
  2325.             if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  2326.                 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  2327.                 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  2328.             else
  2329.                 case "$hostname" in
  2330.                 '') echo "Does this machine have an identity crisis or something?"
  2331.                 phostname=''
  2332.                 ;;
  2333.                 *)  echo "Well, you said $hostname before...";;
  2334.                 esac
  2335.             fi
  2336.             fi
  2337.         fi
  2338.         fi
  2339.     else
  2340.         if $test -r /etc/systemid ; then
  2341.         echo "What is a non-Xenix system doing with /etc/systemid?"
  2342.         fi
  2343.         echo 'No, maybe "uuname -l" will work...'
  2344.         if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
  2345.         hostname=$ans
  2346.         phostname="$uuname -l"
  2347.         else
  2348.         echo 'Strange.  Maybe "uname -n" will work...'
  2349.         if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
  2350.             hostname=$ans
  2351.             phostname="$uname -n"
  2352.         else
  2353.             if ans=`cat /etc/systemid 2>&1` ; then
  2354.             hostname=$ans
  2355.             phostname='cat /etc/systemid'
  2356.             echo "Well, I'll use the systemid file anyway..."
  2357.             else
  2358.             echo 'Oh well, maybe I can mine it out of whoami.h...'
  2359.             if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  2360.                 hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  2361.                 phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  2362.             else
  2363.                 case "$hostname" in
  2364.                 '') echo "Does this machine have an identity crisis or something?"
  2365.                 phostname=''
  2366.                 ;;
  2367.                 *)  echo "Well, you said $hostname before...";;
  2368.                 esac
  2369.             fi
  2370.             fi
  2371.         fi
  2372.         fi
  2373.     fi
  2374.     fi
  2375. else
  2376.     echo "Last time you said the hostname was $hostname"
  2377. fi
  2378. : you do not want to know about this
  2379. set $hostname
  2380. hostname=$1
  2381.  
  2382. : translate upper to lower if necessary
  2383. case "$hostname" in
  2384.     *[A-Z]*)
  2385.     hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
  2386.     echo "(Normalizing case in your host name)"
  2387.     ;;
  2388. esac
  2389.  
  2390. : verify guess
  2391. if $test "$hostname" ; then
  2392.     dflt=y
  2393.     echo 'Your host name appears to be "'$hostname'".'
  2394.     $echo $n "Is this correct? [$dflt] $c"
  2395.     rp="Sitename is $hostname? [$dflt]"
  2396.     . myread
  2397.     case "$ans" in
  2398.       y*)  ;;
  2399.       *)      hostname='' ;;
  2400.     esac
  2401. fi
  2402.  
  2403. : bad guess or no guess
  2404. while $test "X$hostname" = X ; do
  2405.     dflt=''
  2406.     rp="Please type the (one word) name of your host:"
  2407.     $echo $n "$rp $c"
  2408.     . myread
  2409.     hostname="$ans"
  2410.     autohostname="$undef"
  2411. done
  2412.  
  2413. echo " "
  2414. case "$hostname" in
  2415. *.*)
  2416.     dflt=`$expr "X$hostname" : "X[^.]*\(\..*\)"`
  2417.     hostname=`$expr "X$hostname" : "X\([^.]*\)\."`
  2418.     echo "(Trimming domain name from host name--host name is now $hostname)"
  2419.     ;;
  2420. *)  case "$mydomain" in
  2421.     '') dflt='.UUCP';;
  2422.     *) dflt="$mydomain";;
  2423.     esac
  2424.     ;;
  2425. esac
  2426. rp="What is your domain name? [$dflt]"
  2427. $echo $n "$rp $c"
  2428. . myread
  2429. case "$ans" in
  2430. '') ;;
  2431. .*) ;;
  2432. *) ans=".$ans";;
  2433. esac
  2434. mydomain="$ans"
  2435.  
  2436. : a little sanity check here
  2437. case "$phostname" in
  2438. '') ;;
  2439. *)  case `$phostname` in
  2440.     $hostname$mydomain|$hostname) ;;
  2441.     *)
  2442.     case "$phostname" in
  2443.     sed*)
  2444.         echo "(That doesn't agree with your whoami.h file, by the way.)"
  2445.         ;;
  2446.     *)
  2447.         echo "(That doesn't agree with your $phostname command, by the way.)"
  2448.         ;;
  2449.     esac
  2450.     phostname=''
  2451.     ;;
  2452.     esac
  2453.     ;;
  2454. esac
  2455.  
  2456. : decide how portable to be
  2457. case "$d_portable" in
  2458. "$define") dflt=y;;
  2459. "$undef")  dflt=n;;
  2460. *)       dflt=`loc exports xyz /etc /usr/etc`
  2461.        if $test "$dflt" = xyz; then
  2462.         dflt=`loc nfsd xyz /etc /usr/etc /usr/lib/nfs $pth`
  2463.        fi
  2464.        if $test "$dflt" = xyz; then
  2465.            dflt=n
  2466.        else
  2467.            dflt=y
  2468.        fi
  2469.        ;;
  2470. esac
  2471. $cat <<'EOH'
  2472.  
  2473. I can set things up so that your shell scripts and binaries are more portable,
  2474. at what may be a noticeable cost in performance.  In particular, if you
  2475. ask to be portable, the following happens:
  2476.  
  2477.      1) shell scripts will rely on the PATH variable rather than using
  2478.     the paths derived above.
  2479.      2) ~username interpretations will be done at run time rather than
  2480.     by Configure.
  2481.      3) the system name will be determined at run time, if at all possible.
  2482.  
  2483. EOH
  2484. rp="Do you expect to run these scripts and binaries on multiple machines? [$dflt]"
  2485. $echo $n "$rp $c"
  2486. . myread
  2487. case "$ans" in
  2488.     y*) d_portable="$define"
  2489.     for file in $loclist; do
  2490.         eval $file=$file
  2491.     done
  2492.     ;;
  2493.     *)  d_portable="$undef" ;;
  2494. esac
  2495.  
  2496. : see if there is a whoami file
  2497. echo " "
  2498. if $test -r /usr/include/whoami.h ; then
  2499.     d_whoami="$define"
  2500.     echo "whoami.h found."
  2501. else
  2502.     d_whoami="$undef"
  2503. fi
  2504.  
  2505. : see how we will look up host name
  2506. echo " "
  2507. d_douname="$undef"
  2508. d_gethname="$undef"
  2509. if $test -z "$d_phostname"; then
  2510.     d_phostname="$undef"
  2511. fi
  2512.  
  2513. if $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
  2514.     echo "gethostname() found."
  2515.     d_gethname="$define"
  2516.     ans=gethostname
  2517. elif xenix; then
  2518.     if $test -n "$uname"; then
  2519.     u_name=`$uname -n`
  2520.     else
  2521.     u_name=
  2522.     fi
  2523.     if $test -n "$line"; then
  2524.     if $test -r /etc/systemid; then
  2525.         s_name=`$line < /etc/systemid`
  2526.     else
  2527.         s_name=
  2528.     fi
  2529.     else
  2530.     s_name=
  2531.     fi
  2532.     if $test -n "$u_name"; then
  2533.     if $test "$u_name" = "$s_name"; then
  2534.         cat <<EOM
  2535. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2536. returns the name compiled into the operating system via configure.
  2537. Elm needs the UUCP name, and currently these two match.  However, they
  2538. need not match.  Be sure to always keep these two names in sync.
  2539. Since they match, Elm will not consider that the Xenix uname function
  2540. is broken.  However, if you are not always able to make them
  2541. match, answer the compile in hostname question Yes.
  2542. EOM
  2543.         if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  2544.         echo "uname() found."
  2545.         d_douname="$define"
  2546.         ans=uname
  2547.         fi
  2548.     else
  2549.         cat <<EOM
  2550. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2551. returns the name compiled into the operating system via configure.
  2552. Your /etc/systemid file contains $s_name.
  2553. But uname returns $u_name.
  2554. Since Elm needs the UUCP name, and currently these two do not match,
  2555. Elm will assume Xenix uname() is broken.
  2556. EOM
  2557.     fi
  2558.     else
  2559.     cat <<EOM
  2560. On Xenix, UUCP uses the name found in /etc/systemid, while uname()
  2561. returns the name compiled into the operating system via configure.
  2562. Elm needs the UUCP name, and currently the compiled in name is undefined.
  2563. Since mail needs the UUCP name, and these two need not match, Elm will
  2564. assume Xenix uname() is broken.
  2565. EOM
  2566.     fi
  2567. elif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  2568.     echo "uname() found."
  2569.     d_douname="$define"
  2570.     ans=uname
  2571. fi
  2572.  
  2573. case "$d_douname$d_gethname" in
  2574. *define*)
  2575.     case "$ign_hname" in
  2576.     '')    case "$d_host_comp" in
  2577.     "$define") dflt=y;;
  2578.     *)  dflt=n;;
  2579.     esac;;
  2580.     y)  dflt=y;;
  2581.     *)  dflt=n;;
  2582.     esac
  2583.     cat <<EOM
  2584.  
  2585. Every now and then someone has a $ans() that lies about the hostname
  2586. but can't be fixed for political or economic reasons.  Would you like to
  2587. EOM
  2588.     rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
  2589.     $echo $n "$rp $c"
  2590.     . myread
  2591.     case "$ans" in
  2592.     y*) ign_hname=y
  2593.     d_douname="$undef"
  2594.     d_gethname="$undef"
  2595.     d_host_comp="$define"
  2596.     $echo $n "Okay... $c"
  2597.     ;;
  2598.     *)    ign_hname=n
  2599.     d_host_comp="$undef"
  2600.     ;;
  2601.     esac
  2602.     ;;
  2603. esac
  2604.  
  2605. case "$d_douname$d_gethname" in
  2606. *define*) ;;
  2607. *)
  2608.     case "$phostname" in
  2609.       '') ;;
  2610.       *)
  2611.     $cat <<EOT
  2612.  
  2613. There is no gethostname() or uname() on this system.  You have two
  2614. possibilities at this point:
  2615.  
  2616. 1)  You can have your host name ($hostname) compiled into $package, which
  2617.     lets $package start up faster, but makes your binaries non-portable, or
  2618. 2)  you can have $package use a
  2619.     
  2620.     popen("$phostname","r")
  2621.  
  2622.     which will start slower but be more portable.
  2623.  
  2624. Option 1 will give you the option of using whoami.h if you have one.  If you
  2625. want option 2 but with a different command, you can edit config.sh at the
  2626. end of this shell script.
  2627.  
  2628. EOT
  2629.     case "$d_phostname" in
  2630.     "$define") dflt=n;;
  2631.     "$undef")  dflt=y;;
  2632.     '')
  2633.         case "$d_portable" in
  2634.         "$define") dflt=n ;;
  2635.         *)      dflt=y ;;
  2636.         esac
  2637.         ;;
  2638.     esac
  2639.     rp="Do you want your host name compiled in? [$dflt]"
  2640.     $echo $n "$rp $c"
  2641.     . myread
  2642.     case "$ans" in
  2643.       n*) d_phostname="$define"
  2644.           d_host_comp="$undef"
  2645.           ;;
  2646.       *)  phostname=''
  2647.           d_host_comp="$define"
  2648.           d_phostname="$undef"
  2649.           ;;
  2650.     esac
  2651.     ;;
  2652.     esac
  2653.     case "$phostname" in
  2654.       '')
  2655.     case "$d_whoami" in
  2656.       "$define")
  2657.         dflt=y
  2658.         $cat <<EOM
  2659.  
  2660. No hostname function--you can either use the whoami.h file, which has this line:
  2661.  
  2662.     `grep sysname /usr/include/whoami.h`
  2663.  
  2664. or you can have the name we came up with earlier ($hostname) hardwired in.
  2665. EOM
  2666.         rp="Use whoami.h to get hostname? [$dflt]"
  2667.         $echo $n "$rp $c"
  2668.         . myread
  2669.         case "$ans" in
  2670.         n*) d_whoami="$undef";;
  2671.         esac
  2672.         ;;
  2673.       "$undef")
  2674.         echo 'No hostname function and no whoami.h--hardwiring "'$hostname'".'
  2675.         d_host_comp="$define"
  2676.         d_phostname="$undef"
  2677.         ;;
  2678.     esac
  2679.     ;;
  2680.     esac
  2681.     ;;
  2682. esac
  2683.  
  2684. : see if errlst.o is in the lib.
  2685. echo " "
  2686. case "$d_errlst" in
  2687. "$define") dflt=y;;
  2688. "$undef")  dflt=n;;
  2689. *)       if $contains '^errlst$' libc.list >/dev/null 2>&1 ; then
  2690.         echo "errlst object found, will attempt to use systems"
  2691.         echo "sys_nerr and sys_errlist"
  2692.         dflt=y
  2693.         elif $contains '^sys_errlist$' libc.list >/dev/null 2>&1 ; then
  2694.         echo "sys_errlist found, will attempt to use systems"
  2695.         echo "sys_nerr and sys_errlist"
  2696.         dflt=y
  2697.         else
  2698.         echo "neither errlst object nor sys_errlist found, $package will use its own"
  2699.         dflt=n
  2700.         fi;;
  2701. esac
  2702.  
  2703. cat <<EOM
  2704.  
  2705. Elm would like to use the systems definitions of the error messages for system
  2706. errors.  These are usually contained in the global variables sys_errlist[] and
  2707. sys_nerr.  If these do not exist, there is a standard list built into Elm.
  2708.  
  2709. EOM
  2710.  
  2711. rp="Does the system support the sys_errlist[] global variable? [$dflt]"
  2712. $echo $n "$rp $c"
  2713. . myread
  2714. case "$ans" in
  2715.     y*) d_errlst="$define";;
  2716.     *)  d_errlst="$undef" ;;
  2717. esac
  2718.  
  2719. : see if fstruncate exists
  2720. set ftruncate d_ftruncate
  2721. eval $inlibc
  2722. : see if getopt exists
  2723. set getopt d_getopt
  2724. eval $inlibc
  2725.  
  2726. : see if strings.h is in /usr/include or /usr/include/sys
  2727. echo " "
  2728. strings=`loc string.h "" /usr/include $includepath`
  2729. if $test -z "$strings"; then
  2730.     strings=`loc strings.h "" /usr/include $includepath`
  2731. fi
  2732. while $test -z "$strings"; do
  2733.     echo " "
  2734.     dflt=''
  2735.     rp="What is the full path name of the include file directory? []"
  2736.     $echo $n "$rp $c"
  2737.     . myread
  2738.     includepath=`filexp $ans`
  2739.     if $test -d "$includepath"; then
  2740.         strings=`loc string.h "" /usr/include $includepath`
  2741.         if $test -z "$strings"; then
  2742.             strings=`loc strings.h "" /usr/include $includepath`
  2743.         fi
  2744.         if $test -z "$strings"; then
  2745.             $cat <<EOM
  2746.  
  2747. Include file string.h or strings.h not found in $includepath.
  2748. Elm requires string.h on USG type systems or strings.h on BSD type
  2749. systems.  Please specify the directory where one of these files can
  2750. be found.
  2751. EOM
  2752.         fi
  2753.     else
  2754.         echo "Directory $includepath not found"
  2755.     fi
  2756. done
  2757.  
  2758. strings_f=`$expr "$strings" : ".*/\(.*\)"`
  2759. if $test "$strings_f" = "string.h"; then
  2760.     d_strings="$undef"
  2761.     echo "Using string.h instead of strings.h"
  2762. else
  2763.     d_strings="$define"
  2764.     echo "Using strings.h instead of string.h"
  2765. fi
  2766. pwdinsys=`loc pwd.h "" /usr/include $includepath`
  2767. if $test -z "$pwdinsys"; then
  2768.     d_pwdinsys="$define"
  2769. else
  2770.     d_pwdinsys="$undef"
  2771. fi
  2772.  
  2773. : index or strcpy
  2774. echo " "
  2775. case "$d_index" in
  2776. n) dflt=n;;
  2777. *) dflt=y;;
  2778. esac
  2779. if $contains '^index$' libc.list >/dev/null 2>&1 ; then
  2780.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  2781.     if $contains strchr "$strings" >/dev/null 2>&1 ; then
  2782.         if $contains index "$strings" >/dev/null 2>&1 ; then
  2783. #            has index, strchr, and index and strchr in strings.h
  2784.         echo "Your system has both index() and strchr().  Shall I use"
  2785.         rp="index() rather than strchr()? [$dflt]"
  2786.         $echo $n "$rp $c"
  2787.         . myread
  2788.         case "$ans" in
  2789.             n*) d_index="$define" ;;
  2790.             *)  d_index="$undef" ;;
  2791.         esac
  2792.         else
  2793. #            has index, strchr, and strchr in strings.h
  2794.         d_index="$define"
  2795.             echo "strchr() found."
  2796.         fi
  2797.     else
  2798. #            has index, strchr, and no strchr in strings.h
  2799.         d_index="$undef"
  2800.         echo "index() found."
  2801.     fi
  2802.     else
  2803. #            has only index, no strchr, strings.h is a moot point
  2804.     d_index="$undef"
  2805.     echo "index() found."
  2806.     fi
  2807. else
  2808.     if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  2809.     d_index="$define"
  2810.     echo "strchr() found."
  2811.     else
  2812.     echo "No index() or strchr() found!"
  2813.     d_index="$undef"
  2814.     fi
  2815. fi
  2816.  
  2817. case "$d_mmdf" in
  2818. "$define") dflt=y;;
  2819. "$undef")  dflt=n;;
  2820. *)    if $test -f "$submit"; then
  2821.         dflt=y
  2822.     else
  2823.         dflt=n
  2824.     fi
  2825.     ;;
  2826. esac
  2827. $cat <<EOM
  2828.  
  2829. Some systems run MMDF as their Mail Transport Agent.  MMDF uses a
  2830. different way of delimiting messages in the mailbox files.  Other
  2831. systems don't run MMDF but use the MMDF separator in their mailbox
  2832. files.  The MMDF separator is usually a series of four Control A's.
  2833. $package needs to know if this system uses the MMDF style message
  2834. separator in its mailbox files.
  2835.  
  2836. EOM
  2837. rp="Does this system use MMDF style message separator? [$dflt]"
  2838. $echo $n "$rp $c"
  2839. . myread
  2840. case "$ans" in
  2841. y*) d_mmdf="$define";;
  2842. *)  d_mmdf="$undef";;
  2843. esac
  2844.  
  2845. : determine mail delivery agent for Elm to use
  2846. case "$mailer" in
  2847. '')
  2848.     if $test "$d_mmdf" = "$define" -a -f "$execmail"; then
  2849.      dflt="$execmail"
  2850.     elif $test "$d_mmdf" = "$define" -a -f "$submit"; then
  2851.     dflt="$submit"
  2852.     elif $test -f "$sendmail"; then
  2853.     dflt="$sendmail"
  2854.     elif $test -f "$rmail"; then
  2855.     dflt="$rmail"
  2856.     elif $test -f /bin/mail; then
  2857.     dflt=/bin/mail
  2858.     else
  2859.     dflt=$mail
  2860.     fi
  2861.     ;;
  2862. *)  dflt="$mailer";;
  2863. esac
  2864. cont=true
  2865. while $test "$cont" ; do
  2866.     echo " "
  2867.     echo "Give the full path name of the program used to deliver mail on your"
  2868.     $echo $n "system: [$dflt] $c"
  2869.     rp="Preferred mail delivery agent: [$dflt]"
  2870.     . myread
  2871.     mailer="$ans"
  2872.     if $test -f "$ans"; then
  2873.     cont=''
  2874.     else
  2875.     if $test "$fastread" = yes; then
  2876.         dflt=y
  2877.     else
  2878.         dflt=n
  2879.     fi
  2880.     echo "Mail delivery agent $ans doesn't exist."
  2881.     rp="Use that name anyway? [$dflt]"
  2882.     $echo $n "$rp $c"
  2883.     . myread
  2884.     dflt=''
  2885.     case "$ans" in
  2886.     y*) cont='';;
  2887.     esac
  2888.     fi
  2889. done
  2890. if $test "$mailer" != "$sendmail"; then
  2891.     sendmail=''
  2892. fi
  2893. if $test "$mailer" != "$submit"; then
  2894.     submit=''
  2895. fi
  2896. if $test "$mailer" != "$execmail"; then
  2897.     execmail=''
  2898. fi
  2899.  
  2900. : check for internet mailer
  2901. case "$d_internet" in
  2902. "$define")    dflt=y;;
  2903. "$undef")    dflt=n;;
  2904. *)    if $test -f "$sendmail"; then
  2905.         dflt=y
  2906.     elif $test -f "$submit"; then
  2907.         dflt=y
  2908.     elif $test -f "$smail"; then
  2909.         dflt=y
  2910.     else
  2911.         dflt=n
  2912.     fi
  2913.     ;;
  2914. esac
  2915. $cat <<EOM
  2916.  
  2917. Some newer mailers can deliver mail to addresses of the INTERNET
  2918. persuasion, such as user@host.domain.  Other older mailers require the
  2919. complete uucp ! path to the destination to be specified in the address.
  2920. EOM
  2921. rp="Does your mailer understand INTERNET addresses? [$dflt]"
  2922. $echo $n "$rp $c"
  2923. . myread
  2924. case "$ans" in
  2925. y*) d_internet="$define";;
  2926. *)  d_internet="$undef";;
  2927. esac
  2928.  
  2929. : check for ispell spelling checker
  2930. case "$d_ispell" in
  2931. "$define")    dflt=y
  2932.         dflt_path=$ispell_path
  2933.         dflt_options=$ispell_options
  2934.         ;;
  2935. "$undef")    dflt=n
  2936.         dflt_path=
  2937.         dflt_options=
  2938.         ;;
  2939. *)    if $test -n "$ispell" -a "$ispell" != "ispell"; then
  2940.         dflt=y
  2941.         dflt_path=$ispell
  2942.         dflt_options='-x'
  2943.     else
  2944.         dflt=n
  2945.         dflt_path=
  2946.         dflt_options=
  2947.     fi
  2948.     ;;
  2949. esac
  2950. $cat <<EOM
  2951.  
  2952. Elm has the ability to place a call to the GNU ispell spelling checker
  2953. on its post-message-entry/pre-message-send menu.
  2954. EOM
  2955. if $test -n "$dflt_path"; then
  2956.     $echo "Configure has found ispell as $dflt_path"
  2957. else
  2958.     $echo "Configure was unable to find ispell"
  2959. fi
  2960.  
  2961. $echo $n "Should Elm add the ispell option to the pre-send menu? [$dflt] $c"
  2962. rp="Should Elm add the ispell option to the pre-send menu? [$dflt]"
  2963. . myread
  2964. case "$ans" in
  2965. y*) d_ispell="$define";;
  2966. *)  d_ispell="$undef";;
  2967. esac
  2968.  
  2969. case "$d_ispell" in
  2970. "$undef")    ispell_path=
  2971.         ;;
  2972. "$define")    cont=true
  2973.         dflt=$dflt_path
  2974.         while $test "$cont" ; do
  2975.             echo " "
  2976.             echo "Give the name of the ispell program on your"
  2977.             $echo $n "system: [$dflt] $c"
  2978.             rp="Ispell path name: [$dflt]"
  2979.             . myread
  2980.             ispell_path=$ans;
  2981.             if $test -f "$ans"; then
  2982.             cont=''
  2983.             else
  2984.             lookup=`loc "$ans" "" . $pth`
  2985.             if $test -f "$lookup"; then
  2986.                 cont=''
  2987.                 ispell_path=$lookup
  2988.             else
  2989.                 if $test "$fastread" = yes; then
  2990.                 dflt=y
  2991.                 else
  2992.                 dflt=n
  2993.                 fi
  2994.                 echo "spelling program $ans doesn't exist."
  2995.                 rp="Use that name anyway? [$dflt]"
  2996.                 $echo $n "$rp $c"
  2997.                 . myread
  2998.                 dflt=''
  2999.                 case "$ans" in
  3000.                 y*) cont='';;
  3001.                 esac
  3002.             fi
  3003.             fi
  3004.         done
  3005.  
  3006.         dflt=$dflt_options
  3007.         $echo $n "What options should Elm use with $ispell_path: [$dflt] $c"
  3008.         rp="$ispell_path options: [$dflt]"
  3009.         . myread
  3010.         ispell_options=$ans;
  3011.         ;;
  3012. esac
  3013. : see if locale.h is in /usr/include
  3014. echo " "
  3015. dflt=`loc locale.h "" /usr/include $includepath`
  3016. if $test -z "$dflt"; then
  3017.     echo "locale.h not found, $package will not call setlocale"
  3018.     d_locale=$undef
  3019. else
  3020.     echo "locale.h found, $package will call setlocale"
  3021.     d_locale=$define
  3022. fi
  3023.  
  3024. : see if nl_types.h is in /usr/include
  3025. echo " "
  3026. dflt=`loc nl_types.h "" /usr/include $includepath`
  3027. if $test -z "$dflt"; then
  3028.     echo "nl_types.h not found, $package will use its own"
  3029.     d_nl_types=$undef
  3030. else
  3031.     echo "nl_types.h found, $package will include the systems version"
  3032.     d_nl_types=$define
  3033. fi
  3034.  
  3035. : see if catgets is in the libraries
  3036. set catgets d_msgcat
  3037. eval $inlibc
  3038.  
  3039. if $test "$d_msgcat" = "$define"; then
  3040.     echo "Message catalog routines found"
  3041.     cat <<EOM
  3042.  
  3043. The system has the message catalog routines in its library.  These routines
  3044. are new, and on some systems do not function properly. Also, $package expects
  3045. that these routines are X/Open compliant.
  3046.  
  3047. EOM
  3048.  
  3049.     case "$d_usenls" in
  3050.     "$define") dflt=y;;
  3051.     "$undef")  dflt=n;;
  3052.     *)       dflt=n;;
  3053.     esac
  3054.  
  3055.     rp="Should $package use its own routines instead of the systems NLS routines? [$dflt]"
  3056.     $echo $n "$rp $c"
  3057.     . myread
  3058.     case "$ans" in
  3059.         y*) d_usenls="$define"
  3060.         d_nl_types=$undef;;
  3061.         *)  d_usenls="$undef";;
  3062.     esac
  3063. else
  3064.     echo "Message catalog routines not found, $package will use its own"
  3065.     if $test "$d_usenls" = ""; then
  3066.         d_usenls="$define"
  3067.     fi
  3068. fi
  3069.  
  3070. case "$d_mboxedit" in
  3071. "$define") dflt=y;;
  3072. "$undef")  dflt=n;;
  3073. *)    dflt=n;;
  3074. esac
  3075. $cat <<EOM
  3076.  
  3077. A lot of sites that install the Elm Mail System find that the function
  3078. E)dit mailbox from within Elm is dangerous and confusing.  If you choose,
  3079. you can instead disable that function, with the program being slightly
  3080. smaller and presenting an appropriate error message to the user if they
  3081. try to E)dit their mailbox.
  3082.  
  3083. EOM
  3084. rp="Would you like to enable the E)dit Mailbox function? [$dflt]"
  3085. $echo $n "$rp $c"
  3086. . myread
  3087. case "$ans" in
  3088. y*) d_mboxedit="$define";;
  3089. *)  d_mboxedit="$undef";;
  3090. esac
  3091.  
  3092. : see if memcpy exists
  3093. set memcpy d_memcpy
  3094. eval $inlibc
  3095.  
  3096. : determine if MIME should be compiled in
  3097.  
  3098. case "$d_mime" in
  3099. "$define") dflt=y;;
  3100. "$undef")  dflt=n;;
  3101. *)       if $test -f "$metamail"; then
  3102.         $cat <<EOM
  3103.  
  3104. I've found the metamail program out there, I assume you want support for
  3105. MIME (Multipurpose Internet Mail Extension, RFC 1341).
  3106.  
  3107. EOM
  3108.         dflt=y
  3109.        else
  3110.         dflt=n
  3111.        fi;;
  3112.  
  3113. esac
  3114. $cat <<EOM
  3115.  
  3116. MIME allows for sending and receiving of Messages compliant to the
  3117. Multipurpose Internet Mail Extension (RFC 1341). MIME provides a way to
  3118. attach binary, graphic, audio, video, postscript and other files. MIME
  3119. doesn't necessarily need graphics capabilities on your display, but its
  3120. useful.
  3121.  
  3122. If you have installed Nathaniel Borenstein's metamail package for
  3123. displaying MIME messages, elm can make use of it.  If you didn't
  3124. have metamail installed you might want to obtain a copy of it.  The
  3125. most recent version is on thumper.bellcore.com [128.96.41.1], or ask
  3126. the archie servers for the nearest site.
  3127.  
  3128. Compiling elm even with MIME support enabled would not depend on the
  3129. metamail package, but you would not be able to use nearly all of the
  3130. MIME features as long as you don't have metamail installed.  Metamail
  3131. with its companion programs (mmencode) must be installed somewhere in
  3132. the search path, usually /usr/local/bin.
  3133.   
  3134.  
  3135.  
  3136. EOM
  3137.  
  3138. rp="Should support for MIME be compiled in? [$dflt]"
  3139. $echo $n "$rp $c"
  3140. . myread
  3141. case "$ans" in
  3142. y*) d_mime="$define";;
  3143. *)  d_mime="$undef";;
  3144. esac
  3145.  
  3146.  
  3147. case "$defcharset" in
  3148. '') defcharset="US-ASCII";;
  3149. *) defcharset="$defcharset";;
  3150. esac
  3151.  
  3152. case "$defdispcharset" in
  3153. '') defdispcharset="$defcharset";;
  3154. *) defdispcharset="$defdispcharset";;
  3155. esac
  3156.  
  3157. case "$defencoding" in
  3158. '') if $test "$defcharset" = "US-ASCII"; then
  3159.         defencoding="7bit"
  3160.     else
  3161.         defencoding="8bit"
  3162.     fi;;
  3163. *) defencoding="$defencoding";;
  3164. esac
  3165.  
  3166. if $test "$d_mime" = "$define"; then
  3167.     dflt="$defcharset"
  3168. cat <<EOM
  3169.  
  3170. The Default Character Set which should be used on outgoing messages.
  3171. Most sites would use US-ASCII.
  3172.  
  3173. EOM
  3174.     rp="Default Character Set for MIME Content-type text? [$dflt]"
  3175.     $echo $n "$rp $c"
  3176.     . myread
  3177.     defcharset="$ans"
  3178.  
  3179.     dflt="$defdispcharset"
  3180.     $cat <<EOM
  3181.  
  3182. The Character Set which your terminals support. You could set this
  3183. to one of the ISO-8859 charsets, even if you set the default for
  3184. the Text Messages to US-ASCII, as the ISO-8859 charsets could display
  3185. US-ASCII as well. For a X-Windows environment, ISO-8859-1 would be 
  3186. a convenient value.
  3187.  
  3188. EOM
  3189.     rp="Default Character Set which could be displayed [$dflt]"
  3190.     $echo $n "$rp $c"
  3191.     . myread
  3192.     defdispcharset="$ans"
  3193.  
  3194.     dflt="$defencoding"
  3195.     $cat <<EOM
  3196. Default Content-Transfer-Encoding for MIME Content-type text.
  3197. If you are using the default US-ASCII charset, you should use
  3198. 7bit encoding. But if you are using some other national character
  3199. set, 8bit is recommended, unless you are using a 7bit character set.
  3200. For 8bit encoding your transport paths should be 8bit clean, which
  3201. is not true all over the world. base64 or quoted-printable aren't
  3202. yet supported for the default Content-Transfer-Encoding.
  3203.  
  3204. EOM
  3205.     rp="Default Content-Transfer-Encoding for MIME Content-type text? [$dflt]"
  3206.     $echo $n "$rp $c"
  3207.     . myread
  3208.     defencoding="$ans"
  3209. fi
  3210.  
  3211. : see if mkdir exists
  3212. set mkdir d_mkdir
  3213. eval $inlibc
  3214.  
  3215. : ask about newmail running in the background automatically
  3216. case "$d_newauto" in
  3217. "$define")    dflt=y;;
  3218. "$undef")    dflt=n;;
  3219. *)        dflt=y;;
  3220. esac
  3221. $cat <<EOM
  3222.  
  3223. Newmail (Elm's utility to check for incoming mail) can be configured to
  3224. either run as a foreground process or as a process that automatically
  3225. forks and runs in the background.
  3226.  
  3227. EOM
  3228. rp="Should newmail automatically run in the background? [$dflt]"
  3229. $echo $n "$rp $c"
  3230. . myread
  3231. case "$ans" in
  3232. y*) d_newauto="$define";;
  3233. *)  d_newauto="$undef";;
  3234. esac
  3235.  
  3236.  
  3237. if $test -f "$sendmail"; then
  3238.     echo "You're running sendmail.  Setting noaddfrom, nocheckvalid, usedomain"
  3239.     d_noaddfrom="$define"
  3240.     d_nocheckvalid="$define"
  3241.     d_usedomain="$undef"
  3242. elif $test -f "$submit"; then
  3243.     echo "You're running submit with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
  3244.     d_noaddfrom="$undef"
  3245.     d_nocheckvalid="$define"
  3246.     d_usedomain="$define"
  3247. elif $test -f "$execmail" -a "$d_mmdf" = "$define"; then
  3248.     echo "You're running execmail with MMDF.  Setting noaddfrom, nocheckvalid, usedomain"
  3249.     d_noaddfrom="$undef"
  3250.     d_nocheckvalid="$define"
  3251.     d_usedomain="$undef"
  3252. else
  3253.     case "$d_nocheckvalid" in
  3254.     "$define") dflt=n;;
  3255.     "$undef")  dflt=y;;
  3256.     *)       dflt=y;;
  3257.     esac
  3258.  
  3259.     $cat << EOM
  3260.  
  3261. Since you're not running sendmail or submit, should I check local user entered
  3262. addresses against the valid mailboxes on this system?
  3263. EOM
  3264.  
  3265.     echo " "
  3266.     rp="Would you like to check local addresses? [$dflt]"
  3267.     $echo $n "$rp $c"
  3268.     . myread
  3269.     case "$ans" in
  3270.     y*) d_nocheckvalid="$undef";;
  3271.     *)  d_nocheckvalid="$define";;
  3272.     esac
  3273.  
  3274.     if $test "$d_internet" = "$define"; then
  3275.         case "$d_usedomain" in
  3276.         "$define") dflt=y;;
  3277.         "$undef")  dflt=n;;
  3278.         *)       dflt=y;;
  3279.         esac
  3280.  
  3281.         $cat <<EOM
  3282.  
  3283. Are you running a machine where you want to have a domain name appended
  3284. to the hostname on outbound mail?
  3285. EOM
  3286.         echo " "
  3287.         rp="Would you like the domain name appended? [$dflt]"
  3288.         $echo $n "$rp $c"
  3289.         . myread
  3290.         case "$ans" in
  3291.         y*) d_usedomain="$define";;
  3292.         *)  d_usedomain="$undef";;
  3293.         esac
  3294.     else
  3295.         d_usedomain="$undef"
  3296.         $cat <<EOM
  3297.  
  3298. Since your mailer does not understand internet addresses, I'm undefining
  3299. usedomain so your domain name will not be appended to the hostname on
  3300. outbound mail.
  3301.  
  3302. EOM
  3303.     fi
  3304.  
  3305.     case "$d_noaddfrom" in
  3306.     "$define") dflt=y;;
  3307.     "$undef")  dflt=n;;
  3308.     *)       dflt=n;;
  3309.     esac
  3310.     echo " "
  3311.     rp="Does your mailer add the From: header for you? [$dflt]"
  3312.     $echo $n "$rp $c"
  3313.     . myread
  3314.     case "$ans" in
  3315.     y*) d_noaddfrom="$define";;
  3316.     *)  d_noaddfrom="$undef";;
  3317.     esac
  3318. fi
  3319.  
  3320. case "$d_noxheader" in
  3321. "$define") dflt=y;;
  3322. "$undef")  dflt=n;;
  3323. *)    dflt=n;;
  3324. esac
  3325. $cat <<EOM
  3326.  
  3327. Some sites do not like to see the mail header "X-mailer:" in outgoing
  3328. messages.  If you choose, you may disable these headers.  However, it
  3329. is strongly urged to leave these headers in the mail to assist in
  3330. tracking down problems.
  3331.  
  3332. EOM
  3333. rp="Would you like to disable the X-mailer: headers? [$dflt]"
  3334. $echo $n "$rp $c"
  3335. . myread
  3336. case "$ans" in
  3337. y*) d_noxheader="$define";;
  3338. *)  d_noxheader="$undef";;
  3339. esac
  3340.  
  3341. : check for "kill(pid, 0)"
  3342. echo " "
  3343. case "$d_pidcheck" in
  3344. "$define")    ;;
  3345. "$undef")    ;;
  3346. *)
  3347.         echo "Checking to see if kill(pid, 0) works..."
  3348.         $cat >try.c <<'EOCP'
  3349. main()
  3350.     {
  3351.     int    pid, status0, status9;
  3352.  
  3353.     if ((pid = fork()) == 0)
  3354.         {
  3355.         sleep(30);
  3356.         exit(1);
  3357.         }
  3358.     status0 = kill(pid, 0);
  3359.     status9 = kill(pid, 9);
  3360.     exit(status0 == status9);
  3361.     }
  3362. EOCP
  3363.         if $cc try.c -o try >/dev/null 2>&1 ; then
  3364.         if try >/dev/null 2>&1 ; then
  3365.             echo "Your system does not support kill(pid, 0)..."
  3366.             d_pidcheck="$undef"
  3367.         else
  3368.             d_pidcheck="$define"
  3369.             echo "Your system supports kill(pid, 0)..."
  3370.         fi
  3371.         else
  3372.         echo "Your system does not support kill(pid, 0)..."
  3373.         d_pidcheck="$undef"
  3374.         fi
  3375.         $rm -f try.c try.o try
  3376.     ;;
  3377. esac
  3378.  
  3379. : see if /usr/include/sys/ptem.h exists, making it a possible System V/386
  3380. d_ptem="$undef"
  3381. if usg ; then
  3382.     echo " "
  3383.     echo "Checking to see if your system has sys/ptem.h..."
  3384.     if $test -f /usr/include/sys/ptem.h ; then
  3385.         echo "Yep, it does..."
  3386.         if "$contains" "struct winsize" /usr/include/sys/ptem.h >/dev/null 2>&1 ; then
  3387.         d_ptem="$define"
  3388.         echo "  and it has the needed structure."
  3389.     fi
  3390.     fi
  3391. fi
  3392.  
  3393. : see how we invoke the C preprocessor
  3394. echo " "
  3395. echo "Now, how can we feed standard input to your C preprocessor..."
  3396. cat <<'EOT' >testcpp.c
  3397. #define ABC abc
  3398. #define XYZ xyz
  3399. ABC.XYZ
  3400. EOT
  3401. echo 'Maybe "'"$cc"' -E" will work...'
  3402. $cc -E <testcpp.c >testcpp.out 2>&1
  3403. : try to force gcc preprocessor if that is the compiler they are using
  3404. case $? in
  3405. 0) cppstdin="$cc -E";;
  3406. *) case "$cc" in
  3407.     *gcc*)
  3408.     cd ..
  3409.     echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  3410.     echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  3411.     chmod 755 cppstdin
  3412.     cppstdin=`pwd`/cppstdin
  3413.     cppminus='';
  3414.     cd UU
  3415.     $cppstdin <testcpp.c >testcpp.out 2>&1
  3416.     ;;
  3417.     esac
  3418.     ;;
  3419. esac
  3420. if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3421.     echo "Yup, it does."
  3422.     cppstdin="$cc -E"
  3423.     cppminus='';
  3424. else
  3425.     echo 'Nope, maybe "'$cpp'" will work...'
  3426.     $cpp <testcpp.c >testcpp.out 2>&1
  3427.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3428.     echo "Yup, it does."
  3429.     cppstdin="$cpp"
  3430.     cppminus='';
  3431.     else
  3432.     echo 'No such luck...maybe "'$cpp' -" will work...'
  3433.     $cpp - <testcpp.c >testcpp.out 2>&1
  3434.     if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3435.         echo "It works!"
  3436.         cppstdin="$cpp"
  3437.         cppminus='-';
  3438.     else
  3439.         echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
  3440.         $cc -E - <testcpp.c >testcpp.out 2>&1
  3441.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3442.         echo "Hooray, it works!  I was beginning to wonder."
  3443.         cppstdin="$cc -E"
  3444.         cppminus='-';
  3445.         else
  3446.         echo 'Nope...maybe "'"$cc"' -P" will work...'
  3447.         $cc -P <testcpp.c >testcpp.out 2>&1
  3448.         if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3449.             echo "Yup, that does."
  3450.             cppstdin="$cc -P"
  3451.             cppminus='';
  3452.         else
  3453.             echo 'Nope...maybe "'"$cc"' -P -" will work...'
  3454.             $cc -P - <testcpp.c >testcpp.out 2>&1
  3455.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3456.             echo "Yup, that does."
  3457.             cppstdin="$cc -P"
  3458.             cppminus='-';
  3459.             else
  3460.             echo 'Hmm...perhaps you already told me...'
  3461.             case "$cppstdin" in
  3462.             '') ;;
  3463.             *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  3464.             esac
  3465.             if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3466.                 echo "Hooray, you did!  I was beginning to wonder."
  3467.             else
  3468.                 echo 'Uh-uh.  Time to get fancy...'
  3469.                 cd ..
  3470.                 echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  3471.                 echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  3472.                 chmod 755 cppstdin
  3473.                 cppstdin=`pwd`/cppstdin
  3474.                 cppminus='';
  3475.                 cd UU
  3476.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  3477.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3478.                 echo "Eureka!."
  3479.                 else
  3480.                 dflt=blurfl
  3481.                 $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  3482.                 rp='Name a C preprocessor:'
  3483.                 . myread
  3484.                 cppstdin="$ans"
  3485.                 $cppstdin <testcpp.c >testcpp.out 2>&1
  3486.                 if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  3487.                     echo "OK, that will do."
  3488.                 else
  3489.                     echo "Sorry, I can't get that to work.  Go find one."
  3490.                     exit 1
  3491.                 fi
  3492.                 fi
  3493.             fi
  3494.             fi
  3495.         fi
  3496.         fi
  3497.     fi
  3498.     fi
  3499. fi
  3500. rm -f testcpp.c testcpp.out
  3501.  
  3502. : get C preprocessor symbols handy
  3503. echo " "
  3504. echo $attrlist | $tr ' ' '\012' >Cppsym.know
  3505. $cat <<EOSS >Cppsym
  3506. $startsh
  3507. case "\$1" in
  3508. -l) list=true
  3509.     shift
  3510.     ;;
  3511. esac
  3512. unknown=''
  3513. case "\$list\$#" in
  3514. 1|2)
  3515.     for sym do
  3516.     if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  3517.         exit 0
  3518.     elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  3519.         :
  3520.     else
  3521.         unknown="\$unknown \$sym"
  3522.     fi
  3523.     done
  3524.     set X \$unknown
  3525.     shift
  3526.     ;;
  3527. esac
  3528. case \$# in
  3529. 0) exit 1;;
  3530. esac
  3531. echo \$* | $tr ' ' '\012' | $sed -e 's/\(.*\)/\\
  3532. #ifdef \1\\
  3533. exit 0; _ _ _ _\1\\     \1\\
  3534. #endif\\
  3535. /' >/tmp/Cppsym\$\$
  3536. echo exit 1 >>/tmp/Cppsym\$\$
  3537. $cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  3538. case "\$list" in
  3539. true) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  3540. *)
  3541.     sh /tmp/Cppsym2\$\$
  3542.     status=\$?
  3543.     ;;
  3544. esac
  3545. $rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  3546. exit \$status
  3547. EOSS
  3548. chmod +x Cppsym
  3549. $eunicefix Cppsym
  3550. echo "Your C preprocessor defines the following symbols:"
  3551. Cppsym -l $attrlist >Cppsym.true
  3552. cat Cppsym.true
  3553. rmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  3554.  
  3555. : see if there is a putenv
  3556. set putenv d_putenv
  3557. eval $inlibc
  3558.  
  3559. : get remove at last flag and number of lock attempts
  3560. $cat <<EOM
  3561.  
  3562. The next pair of questions have to do with what to do when another
  3563. program has locked a mailbox...
  3564.  
  3565. First, how many times should the Elm check for the removal of the lock
  3566. file before giving up?
  3567. EOM
  3568.  
  3569. case "$maxattempts" in
  3570.     '') dflt=6;;
  3571.     *)  dflt=$maxattempts;;
  3572. esac
  3573. cont=true
  3574. while $test "$cont" ; do
  3575.     echo " "
  3576.     rp="Number of lock attempts: [$dflt]"
  3577.     $echo $n "$rp $c"
  3578.     . myread
  3579.     maxattempts="$ans"
  3580.     if $test "$maxattempts" -lt 3 -o "$maxattempts" -gt 10 ; then
  3581.     echo "The recommended range is 3-10"
  3582.     odflt=$dflt
  3583.     dflt=n
  3584.     rp="Should I use your answer of $maxattempts lock attempts anyway? [$dflt]"
  3585.     $echo $n "$rp $c"
  3586.     . myread
  3587.     dflt=$odflt
  3588.     case "$ans" in
  3589.     y*) cont='';;
  3590.     esac
  3591.     else
  3592.     cont=''
  3593.     fi
  3594. done
  3595.  
  3596. case "$d_remlock" in
  3597. "$define") dflt=y;;
  3598. "$undef")  dflt=n;;
  3599. *)       dflt=n;;
  3600. esac
  3601. echo " "
  3602. rp="Should it REMOVE the lock file after $maxattempts checks? [$dflt]"
  3603. $echo $n "$rp $c"
  3604. . myread
  3605. case "$ans" in
  3606. y*) d_remlock="$define";;
  3607. *)  d_remlock="$undef";;
  3608. esac
  3609.  
  3610. : see if rename exists
  3611. set rename d_rename
  3612. eval $inlibc
  3613.  
  3614. : determine where mail is spooled
  3615. case "$maildir" in
  3616. '')
  3617.     dflt=`loc . /usr/spool/mail /usr/spool/mail /var/mail /usr/mail`
  3618.     ;;
  3619. *)  dflt="$maildir"
  3620.     ;;
  3621. esac
  3622. cont=true
  3623. while $test "$cont" ; do
  3624.     echo " "
  3625.     rp="Where is yet-to-be-read mail spooled? [$dflt]"
  3626.     $echo $n "$rp $c"
  3627.     . myread
  3628.     maildir=`filexp "$ans"`
  3629.     if test -d $maildir; then
  3630.     cont=''
  3631.     else
  3632.     if $test "$fastread" = yes; then
  3633.         dflt=y
  3634.     else
  3635.         dflt=n
  3636.     fi
  3637.     rp="Directory $maildir doesn't exist.  Use that name anyway? [$dflt]"
  3638.     $echo $n "$rp $c"
  3639.     . myread
  3640.     dflt=''
  3641.     case "$ans" in
  3642.     y*) cont='';;
  3643.     esac
  3644.     fi
  3645. done
  3646.  
  3647. : determine the group of the mail directory and what group elm should use
  3648. mailgrp=`$ls -lgd $maildir/.`
  3649. mailgrp=`$expr "$mailgrp" : "[ld][rwxstS-]*[ 0123456789]*\(.*\)"`
  3650. : now mailgrp is either    user group size mon day time/year name
  3651. : or                       group size mon day time/year name
  3652. try1=`$expr "$mailgrp" : "[A-Za-z_0-9]* *\([A-Za-z_0-9]*\).*"`
  3653. try1a=`$expr "$try1" : "\([0-9]*\).*"`
  3654. if $test "$try1" = "$try1a"; then
  3655.     mailgrp=`$expr "$mailgrp" : "\([A-Za-z_0-9]*\).*"`
  3656. else
  3657.     mailgrp="$try1"
  3658. fi
  3659. case "$mailgrp" in
  3660. '')
  3661.     mailgrp=mail
  3662.     ;;
  3663. esac
  3664. echo " "
  3665. echo "Mail group is $mailgrp"
  3666.  
  3667. : ask about setgid running of Elm
  3668. case "$d_setgid" in
  3669. "$define")    dflt=y;;
  3670. "$undef")    dflt=n;;
  3671. *)        dflt=y;;
  3672. esac
  3673. cat <<EOM
  3674.  
  3675. Elm needs to be installed and run as a setgid program only if the mail
  3676. spool directory permissions do not allow world write access.  If your
  3677. mail spool directory has the permissions:
  3678.  
  3679. drwxrwxr-x  3 root     mail          512 Dec 24 17:20 /usr/mail
  3680.  
  3681. then Elm must be setgid to the same group as the mail spool directory
  3682. (in this case group mail).  However, if the spool permissions look
  3683. like:
  3684.  
  3685. drwxrwsrwt  2 root     staff         512 Dec 21 20:14 /usr/spool/mail
  3686.  
  3687. then Elm should not be installedi or run as a setgid program.
  3688.  
  3689. EOM
  3690. rp="Am I going to be running as a setgid program? [$dflt]"
  3691. $echo $n "$rp $c"
  3692. . myread
  3693. case "$ans" in
  3694. y*) d_setgid="$define";;
  3695. *)  d_setgid="$undef";;
  3696. esac
  3697. case "$d_setgid" in
  3698. "$define")
  3699.     mailermode=2755
  3700.     cat <<EOM
  3701.  
  3702. Since Elm is being installed as a setgid program, it must be installed
  3703. by root, or a user able to set the setgid bit.
  3704.  
  3705. To provide better security, Elm can be configured to switch to the
  3706. privileged group of $mailgrp only when necessary to access mail folders.
  3707.  
  3708. Unfortunately, not all machines can switch between the real and effective 
  3709. gid values.  If you are not sure of the capability of your machine, it
  3710. is suggested that you start with Elm configured to switch gid values and
  3711. if, when you run Elm it cannot set the lock for the mailbox, reconfigure
  3712. Elm to not use this feature.
  3713. EOM
  3714.     case "$d_savegrpmboxid" in
  3715.     "$define")    dflt=y;;
  3716.     "$undef")    dflt=n;;
  3717.     *)        dflt=y;;
  3718.     esac
  3719.     echo " "
  3720.     rp="Can your system use setgid() to switch between the real and
  3721. effective gid values? [$dflt]"
  3722.     $echo $n "$rp $c"
  3723.     . myread
  3724.     case "$ans" in
  3725.     y*) d_savegrpmboxid="$define";;
  3726.     *)  d_savegrpmboxid="$undef";;
  3727.     esac
  3728.     ;;
  3729. *)  mailermode=755
  3730.     d_savegrpmboxid="$undef"
  3731.     ;;
  3732. esac
  3733.  
  3734. : see if BSD sigset exists
  3735. echo " "
  3736. set sigset d_sigset
  3737. eval $inlibc
  3738. : See if sigaction exists -- POSIX has highest priority in match
  3739. if $contains sigaction libc.list >/dev/null 2>&1; then
  3740.     echo "sigaction() found."
  3741.     d_sigaction="$define"
  3742.     d_sigset="$undef"
  3743.     d_sigvec="$undef"
  3744.     d_sigvectr="$undef"
  3745. else
  3746.     d_sigaction="$undef"
  3747. : see if sigvector exists -- since sigvec will match the substring
  3748.     if $contains sigvector libc.list >/dev/null 2>&1; then
  3749.         echo 'sigvector() found--you must be running HP-UX.'
  3750.         d_sigvectr="$define"
  3751.         d_sigvec="$define"
  3752.     else
  3753. : try the original name
  3754.         d_sigvectr="$undef"
  3755.         if $contains sigvec libc.list >/dev/null 2>&1; then
  3756.         echo 'sigvec() found.'
  3757.         d_sigvec="$define"
  3758.         else
  3759.         case "$d_sigset" in
  3760.         "$define")
  3761.                echo 'sigvec() not found';;
  3762.         *)
  3763.                echo 'sigvec() not found--race conditions with signals may occur.';;
  3764.         esac
  3765.             d_sigvec="$undef"
  3766.         fi
  3767.     fi
  3768. fi
  3769.  
  3770. : see if sigprocmask exists -- POSIX has highest priority in match
  3771. echo " "
  3772. if $contains sigprocmask libc.list >/dev/null 2>&1; then
  3773.     echo 'sigprocmask() found.'
  3774.     d_sigprocmask="$define"
  3775.     d_sigblock="$undef"
  3776.     d_sighold="$undef"
  3777. else
  3778.     d_sigprocmask="$undef"
  3779. : see if sigblock exists
  3780.     if $contains sigblock libc.list >/dev/null 2>&1; then
  3781.     echo 'sigblock() found.'
  3782.     d_sigblock="$define"
  3783.     d_sighold="$undef"
  3784.     else
  3785. : see if sighold exists
  3786.     d_sigblock="$undef"
  3787.     if $contains sighold libc.list >/dev/null 2>&1; then
  3788.         echo 'sighold() found.'
  3789.         d_sighold="$define"
  3790.     else
  3791.         echo 'No signal masking functions found.'
  3792.         d_sighold="$undef"
  3793.     fi
  3794.     fi
  3795. fi
  3796.  
  3797. : see if strspn exists
  3798. set strspn d_strspn
  3799. eval $inlibc
  3800.  
  3801. : see if strcspn exists
  3802. set strcspn d_strcspn
  3803. eval $inlibc
  3804.  
  3805. : see if strpbrk exists
  3806. set strpbrk d_strpbrk
  3807. eval $inlibc
  3808.  
  3809. : see if there is a strstr
  3810. set strstr d_strstr
  3811. eval $inlibc
  3812.  
  3813. : see if there is a strtok
  3814. set strtok d_strtok
  3815. eval $inlibc
  3816.  
  3817. case "$d_subshell" in
  3818. "$define") dflt=y;;
  3819. "$undef")  dflt=n;;
  3820. *)    dflt=y;;
  3821. esac
  3822. $cat <<EOM
  3823.  
  3824. Some sites wish to disable the usage of the shell escape from Elm.
  3825. If you choose, you can disallow subshells from within Elm.
  3826.  
  3827. Note: This only controls Elm's usage of the ! command.  Any pager or
  3828. editor could still allow subshells.
  3829.  
  3830. EOM
  3831. rp="Would you like to allow the ! command (subshells)? [$dflt]"
  3832. $echo $n "$rp $c"
  3833. . myread
  3834. case "$ans" in
  3835. y*) d_subshell="$define";;
  3836. *)  d_subshell="$undef";;
  3837. esac
  3838.  
  3839. : see if symlink exists
  3840. set symlink d_symlink
  3841. eval $inlibc
  3842.  
  3843. : see if tempnam exists
  3844. set tempnam d_tempnam
  3845. eval $inlibc
  3846.  
  3847. : see if this is a termio system
  3848. : Prefer POSIX-approved termios.h over all else.
  3849. :
  3850. echo " "
  3851. d_termios="$undef"
  3852. d_termio="$undef"
  3853. if $test -r /usr/include/termios.h ; then
  3854.     set tcsetattr d_termios
  3855.     eval $inlibc
  3856. fi
  3857. if $test "$d_termios" = "$define" ; then
  3858.     echo "You have POSIX termios.h... good!"
  3859. elif Cppsym pyr ; then
  3860.     if $test "`/bin/universe`" = "ucb" ; then
  3861.     if $test -r /usr/include/sgtty.h ; then
  3862.         echo "sgtty.h found."
  3863.     else
  3864.         echo "System is a pyramid, and universe is bsd,"
  3865.         echo "sgtty.h not found--you could have problems."
  3866.     fi
  3867.     else
  3868.     if $test -r /usr/include/termio.h ; then
  3869.         d_termio="$define"
  3870.         echo "termio.h found."
  3871.     else
  3872.         echo "System is a pyramid, and universe is att,"
  3873.         echo "termio.h not found--you could have problems."
  3874.     fi
  3875.     fi
  3876. elif bsd ; then
  3877.     if $test -r /usr/include/sgtty.h ; then
  3878.     echo "sgtty.h found."
  3879.     elif $test -r /usr/include/termio.h ; then
  3880.     d_termio="$define"
  3881.     echo "termio.h found."
  3882.     else
  3883.     echo "Neither termio.h nor sgtty.h found--you could have problems."
  3884.     fi
  3885. else
  3886.     if $test -r /usr/include/termio.h ; then
  3887.     d_termio="$define"
  3888.     echo "termio.h found."
  3889.     elif $test -r /usr/include/sgtty.h ; then
  3890.     echo "sgtty.h found."
  3891.     else
  3892.     echo "Neither termio.h nor sgtty.h found--you could have problems."
  3893.     fi
  3894. fi
  3895.  
  3896. : see if we should include time.h, sys/time.h, or both
  3897. cat <<'EOM'
  3898.   
  3899. Testing to see if we should include <time.h>, <sys/time.h> or both.
  3900. I'm now running the test program...
  3901. EOM
  3902. $cat >try.c <<'EOCP'
  3903. #ifdef I_TIME
  3904. #include <time.h>
  3905. #endif
  3906. #ifdef I_SYSTIME
  3907. #ifdef SYSTIMEKERNEL
  3908. #define KERNEL
  3909. #endif
  3910. #include <sys/time.h>
  3911. #endif
  3912. main()
  3913. {
  3914.     struct tm foo;
  3915. #ifdef S_TIMEVAL
  3916.     struct timeval bar;
  3917. #endif
  3918.     if (foo.tm_sec == foo.tm_sec)
  3919.     exit(0);
  3920. #ifdef S_TIMEVAL
  3921.     if (bar.tv_sec == bar.tv_sec)
  3922.     exit(0);
  3923. #endif
  3924.     exit(1);
  3925. }
  3926. EOCP
  3927. flags=''
  3928. for s_timeval in '-DS_TIMEVAL' ''; do
  3929.     for d_systimekernel in '' '-DSYSTIMEKERNEL'; do
  3930.     for i_time in '-DI_TIME' ''; do
  3931.         for i_systime in '-DI_SYSTIME' ''; do
  3932.         case "$flags" in
  3933.         '') echo "Trying $i_time $i_systime $d_systimekernel $s_timeval"
  3934.             if $cc $ccflags $i_time $i_systime $d_systimekernel $s_timeval \
  3935.                 try.c -o try >/dev/null 2>&1 ; then
  3936.             set X $i_time $i_systime $d_systimekernel $s_timeval
  3937.             shift
  3938.             flags="$*"
  3939.             echo "Succeeded with $flags"
  3940.             fi
  3941.             ;;
  3942.         esac
  3943.         done
  3944.     done
  3945.     done
  3946. done
  3947. case "$flags" in
  3948. *SYSTIMEKERNEL*) d_systimekernel="$define";;
  3949. *) d_systimekernel="$undef";;
  3950. esac
  3951. case "$flags" in
  3952. *I_TIME*) i_time="$define";;
  3953. *) i_time="$undef";;
  3954. esac
  3955. case "$flags" in
  3956. *I_SYSTIME*) i_systime="$define";;
  3957. *) i_systime="$undef";;
  3958. esac
  3959. $rm -f try.c try
  3960.  
  3961. : see if there is a tzname
  3962. set tzname d_tzname
  3963. eval $inlibc
  3964.  
  3965. if $test "$d_tzname" = "$undef"; then
  3966.     set _tzname d_tzname
  3967.     eval $inlibc
  3968. fi
  3969.  
  3970. timeincl=""
  3971. if $test "$i_time" = define ; then
  3972.     timeincl="/usr/include/time.h"
  3973. fi
  3974. if $test "$i_systime" = define ; then
  3975.     timeincl="$timeincl /usr/include/sys/time.h"
  3976. fi
  3977. $cat $timeincl /dev/null | $cppstdin $cppminus > try.c 2>&1
  3978. if $contains 'tz_minuteswest' try.c > /dev/null 2>&1 ; then
  3979.     echo "You have tz_minuteswest defined in $timeincl rather than timezone."
  3980.     d_tz_min="$define"
  3981. else
  3982.     echo "You have timezone defined in $timeincl rather than tz_minuteswest."
  3983.     d_tz_min="$undef"
  3984. fi
  3985.  
  3986. #    try alternate test for nm commands that have problems
  3987. #    with data items being parsed
  3988.  
  3989.  
  3990. if Cppsym ultrix ; then
  3991.     echo "running Ultrix, will not test for tzname in $timeincl"
  3992. else
  3993.     if $test "$d_tzname" = "$undef"; then
  3994.     if $contains tzname try.c >/dev/null 2>&1 ; then
  3995.         echo "tzname found in $timeincl"
  3996.         d_tzname="$define"
  3997.     fi
  3998.     fi
  3999. fi
  4000.  
  4001. $rm -f try.c
  4002. : check for valid reply/to fields
  4003. case "$d_useembed" in
  4004. "$define")    dflt=y;;
  4005. "$undef")    dflt=n;;
  4006. *)            if $test "$d_internet" = "$define" ; then
  4007.                 dflt=y
  4008.             else
  4009.                 dflt=n
  4010.             fi
  4011.             ;;
  4012. esac
  4013. $cat <<EOM
  4014.  
  4015. One of the more annoying quirks of the UUCP network and various other
  4016. systems that interact with it are that everyone seems to have different
  4017. ideas about how to do routing, etc.  Therefore, a lot of times e-mail
  4018. will arrive from off site with corrupt, unusable "Reply-To:" and "From:"
  4019. fields.  This next question relates to whether your site is liable to
  4020. get mangled fields or not...
  4021.  
  4022. Does your site receive e-mail with valid "Reply-To:" and "From:" fields?
  4023.  
  4024. EOM
  4025. $echo $n "Use Reply-To: and From: addresses? [$dflt] $c"
  4026. rp="Are Reply-to: and From: addresses reliable? [$dflt]"
  4027. . myread
  4028. case "$ans" in
  4029. y*) d_useembed="$define";;
  4030. *)  d_useembed="$undef";;
  4031. esac
  4032.  
  4033. : see if getdomainname exists
  4034. if $contains "^getdomainname\$" libc.list > /dev/null 2>&1; then
  4035.     echo "getdomainname() found"
  4036.     d_domname=$define;
  4037. elif $contains "^getdomnm\$" libc.list > /dev/null 2>&1; then
  4038.     echo "getdomainname() found"
  4039.     d_domname=$define;
  4040. else
  4041.     echo "getdomainname() not found"
  4042.     d_domname=$undef
  4043. fi
  4044.  
  4045. case "$d_domname" in
  4046. "$define")    cat <<EOM
  4047.  
  4048. The getdomainname system call was found.  When running NIS, this usually
  4049. returns the NIS domain and not the mail domain.  If this is the case,
  4050. it should not be used to obtain the domain name, and the domain name
  4051. should be compiled into the code, and the global elm.rc file should
  4052. be used to override the compiled in value.
  4053.  
  4054. If the getdomainname call does return the correct mail domain, it can
  4055. be used.
  4056.  
  4057. EOM
  4058.         case "$d_usegetdom" in
  4059.         "$define")    dflt=y;;
  4060.         "$undef")    dflt=n;;
  4061.         *)        dflt=y;;
  4062.         esac
  4063.         echo " "
  4064.         rp="Should getdomainname() be used to obtain the mail domain? [$dflt]"
  4065.         $echo $n "$rp $c"
  4066.         . myread
  4067.         case "$ans" in
  4068.         y*) d_usegetdom="$define";;
  4069.         *)  d_usegetdom="$undef";;
  4070.         esac
  4071.         ;;
  4072. *)        d_usegetdom="$undef";;
  4073. esac;
  4074. : see if utime.h is in includepath
  4075. echo " "
  4076. i_utime=`loc utime.h "" /usr/include $includepath`
  4077. if $test -n "$i_utime"; then
  4078.     echo "Found <utime.h>"
  4079.     i_utime="$define"
  4080.     i_sysutime="$undef"
  4081. else
  4082.     i_sysutime=`loc sys/utime.h "" /usr/include $includepath`
  4083.     if $test -n "$i_sysutime"; then
  4084.         echo "Found <sys/utime.h>"
  4085.         i_utime="$undef"
  4086.         i_sys/utime="$define"
  4087.     else
  4088.         echo "Did not find <utime.h> or <sys/utime.h>"
  4089.         i_utime="$undef"
  4090.         i_sysutime="$undef"
  4091.     fi
  4092. fi
  4093.  
  4094. : check for utimbuf structure
  4095. echo " "
  4096. case "$d_utimbuf" in
  4097. "$define")    ;;
  4098. "$undef")    ;;
  4099. *)
  4100. : Pyramid passes the att compile test but still needs the definition
  4101.     if Cppsym pyr ; then
  4102.         if $test "`/bin/universe`" = "att" ; then
  4103.         d_utimbuf="$undef"
  4104.         echo "I will use my 'utimbuf' structure..."
  4105.             fi
  4106.     else
  4107.       if $test "$d_utimbuf" != "$define"; then
  4108.           echo "Checking to see if struct utimbuf exists."
  4109.           $cat >try.c <<'EOCP'
  4110. #include <stdio.h>
  4111. #include <fcntl.h>
  4112. #include <sys/types.h>
  4113. #include <sys/stat.h>
  4114. #define far /* to keep Xenix from complaining */
  4115. #if (defined(BSD) || !defined(apollo))
  4116. #  include <sys/file.h>
  4117. #endif
  4118. #ifdef I_TIME
  4119. #  include <time.h>
  4120. #endif
  4121. #ifdef I_SYSTIME
  4122. #  include <sys/time.h>
  4123. #endif
  4124. #ifdef BSD
  4125. #  include <sys/timeb.h>
  4126. #endif
  4127. #ifdef I_UTIME
  4128. #  include <utime.h>
  4129. #endif
  4130. #ifdef I_SYSUTIME
  4131. #  include <sys/utime.h>
  4132. #endif
  4133.  
  4134. main()
  4135. {
  4136. struct utimbuf test;
  4137. test.actime = 0;
  4138. exit(1);
  4139. }
  4140. EOCP
  4141.           cflags=$ccflags
  4142.           if $test "$i_utime" = "$define"; then
  4143.           cflags="$cflags -DI_UTIME"
  4144.           fi
  4145.           if $test "$i_sysutime" = "$define"; then
  4146.           cflags="$cflags -DI_SYSUTIME"
  4147.           fi
  4148.           if $test "$i_time" = "$define"; then
  4149.           cflags="$cflags -DI_TIME"
  4150.           fi
  4151.           if $test "$i_systime" = "$define"; then
  4152.           cflags="$cflags -DI_SYSTIME"
  4153.           fi
  4154.           if $test "$d_bsd" = "$define"; then
  4155.           cflags="$cflags -DBSD"
  4156.           fi
  4157.           if $cc $cflags try.c -o try >/dev/null 2>&1 ; then
  4158.           d_utimbuf="$define"
  4159.           echo "You have the 'utimbuf' structure..."
  4160.           else
  4161.           echo "I will use my 'utimbuf' structure..."
  4162.           d_utimbuf="$undef"
  4163.           fi
  4164.           $rm -f try.c try.o try
  4165.         fi
  4166.     fi
  4167.     ;;
  4168. esac
  4169.  
  4170. : see if there is a vfork
  4171. if Cppsym sgi ; then
  4172.     d_vfork="$undef"
  4173. else
  4174.     set vfork d_vfork
  4175.     eval $inlibc
  4176. fi
  4177.  
  4178. : see if memory.h is in includepath
  4179. echo " "
  4180. i_memory=`loc memory.h "" /usr/include $includepath`
  4181. if $test -n "$i_memory"; then
  4182.     echo "Found <memory.h>"
  4183.     i_memory="$define"
  4184. else
  4185.     echo "Did not find <memory.h>"
  4186.     i_memory="$undef"
  4187. fi
  4188.  
  4189. : see if stdlib.h is in includepath
  4190. echo " "
  4191. i_stdlib=`loc stdlib.h "" /usr/include $includepath`
  4192. if $test -n "$i_stdlib"; then
  4193.     echo "Found <stdlib.h>"
  4194.     i_stdlib="$define"
  4195. else
  4196.     echo "Did not find <stdlib.h>"
  4197.     i_stdlib="$undef"
  4198. fi
  4199.  
  4200. : see if signal is declared as pointer to function returning int or void
  4201. echo " "
  4202. $cppstdin $cppflags < /usr/include/signal.h >$$.tmp
  4203. if $contains 'void.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4204.     echo "You have void (*signal())() instead of int."
  4205.     sigtype="void"
  4206. elif $contains 'int.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4207.     echo "You have int (*signal())() instead of void."
  4208.     sigtype="int"
  4209. elif $contains 'extern[     ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
  4210.     echo "You have int (*signal())() instead of void."
  4211.     sigtype="int"
  4212. elif $contains 'sigfunc_t.*[^s]signal' $$.tmp >/dev/null 2>&1 ; then
  4213.     echo "You have sigfunc_t (*signal())() instead of int."
  4214.     sigtype="sigfunc_t"
  4215. elif $test -n "$sigtype"; then
  4216.     echo $n "As you already told me, signal handlers return $sigtype"
  4217. else
  4218.     echo "I can't determine whether signal handlers return void or int..."
  4219.     echo "I'm assuming they return void like ANSI and POSIX want."
  4220.     echo "If not, you will have to change sigtype to match the typedef"
  4221.     echo "used by the signal handlers.  Change it config.sh at the edit "
  4222.     echo "question at the end of Configure."
  4223.     sigtype="void"
  4224. fi
  4225. rm -f $$.tmp
  4226.  
  4227. : preserve RCS keywords in files with variable substitution, grrr
  4228. Log='$Log'
  4229. Header='$Header'
  4230.  
  4231. : get default batch subject
  4232. $cat <<EOM
  4233.  
  4234. Elm will provide a default subject for mail messages that are sent
  4235. in batch mode (redirected from a file.)
  4236. EOM
  4237.  
  4238. case "$defbatsub" in
  4239.     '') dflt='no subject (file transmission)';;
  4240.     *)  dflt="$defbatsub";;
  4241. esac
  4242. echo " "
  4243. rp="Default batch subject: [$dflt]"
  4244. $echo $n "$rp $c"
  4245. . myread
  4246. defbatsub="$ans"
  4247.  
  4248. : determine default editor
  4249. case "$defeditor" in
  4250. '')
  4251.     case "$vi" in
  4252.     */*) dflt="$vi";;
  4253.     *) dflt=/usr/ucb/vi;;
  4254.     esac
  4255.     ;;
  4256. *)  dflt="$defeditor"
  4257.     ;;
  4258. esac
  4259.  
  4260. $cat <<EOM
  4261.  
  4262. Elm must be configured with a default editor.  On most systems this may
  4263. be 'vi'.  If you prefer to use some other, easier editor enter it here.
  4264. You will be given a change to provide command line options to this
  4265. command in the next question.
  4266.  
  4267. EOM
  4268.  
  4269. cont=true
  4270. while $test "$cont" ; do
  4271.     echo " "
  4272.     rp="What is the default editor on your system? [$dflt]"
  4273.     $echo $n "$rp $c"
  4274.     . myread
  4275.     defeditor="$ans"
  4276.     if $test -f "$ans"; then
  4277.     cont=''
  4278.     else
  4279.     lookup=`loc "$ans" "" . $pth`
  4280.     if $test -f "$lookup"; then
  4281.         cont=''
  4282.         defeditor=$lookup
  4283.     else
  4284.         if $test "$fastread" = yes; then
  4285.             dflt=y
  4286.         else
  4287.             dflt=n
  4288.         fi
  4289.         echo "Editor $ans doesn't exist."
  4290.         rp="Use that name anyway? [$dflt]"
  4291.         $echo $n "$rp $c"
  4292.         . myread
  4293.         dflt=''
  4294.         case "$ans" in
  4295.         y*) cont='';;
  4296.         esac
  4297.         fi
  4298.     fi
  4299. done
  4300.  
  4301. : determine the editor flags to use
  4302. $cat <<EOM
  4303.  
  4304. If this editor requires any options for proper use, specify them
  4305. here.  To specify no options, enter the word "none".  For example,
  4306. 'pico' users will want to use the -t option.  This is the proper
  4307. place to specify that option.
  4308.  
  4309. EOM
  4310. dflt="$editoropts"
  4311. rp="What options should Elm use with $defeditor: [$dflt]"
  4312. $echo $n "$rp $c"
  4313. . myread
  4314. editoropts=$ans
  4315. case "$editoropts" in
  4316. 'none') editoropts=''
  4317.      ;;
  4318. esac
  4319.  
  4320. : determine where public libraries go
  4321. case "$lib" in
  4322. '')
  4323.     dflt=`loc . "." /usr/local/lib /usr/lib /lib`
  4324.     ;;
  4325. *)  dflt="$lib"
  4326.     ;;
  4327. esac
  4328. cont=true
  4329. while $test "$cont" ; do
  4330.     echo " "
  4331.     rp="Where do you want to put the public libraries? [$dflt]"
  4332.     $echo $n "$rp $c"
  4333.     . myread
  4334.     lib="$ans"
  4335.     lib=`filexp $lib`
  4336.     if $test -d "$lib"; then
  4337.     cont=''
  4338.     else
  4339.     dflt=n
  4340.     rp="Directory $lib doesn't exist.  Use that name anyway? [$dflt]"
  4341.     $echo $n "$rp $c"
  4342.     . myread
  4343.     dflt=''
  4344.     case "$ans" in
  4345.     y*) cont='';;
  4346.     esac
  4347.     fi
  4348. done
  4349.  
  4350. : ask the preferred line printer and options for this system.
  4351. case "$linepr" in
  4352. '')
  4353.     if $test -f "$lp"; then
  4354.     dflt="$lp"
  4355.     elif $test -f "$lpr"; then
  4356.     dflt="$lpr"
  4357.     else
  4358.     dflt=
  4359.     fi
  4360.     ;;
  4361. *)  dflt="$linepr";;
  4362. esac
  4363.  
  4364. linepr='blurfl/dyick'
  4365. $cat <<EOM
  4366.  
  4367. Elm has an option to send messages to the printer.  This question
  4368. asks for the default spooler name.  You can also specify options to
  4369. the command by separating them from the command by at least one space. 
  4370.  
  4371. EOM
  4372. cont=true
  4373. while $test "$cont" ; do
  4374.     rp="What print spooler do you prefer to use with Elm? [$dflt]"
  4375.     $echo $n "$rp $c"
  4376.     . myread
  4377.     linepr="$ans"
  4378.     ans=`$expr "$linepr" : "\([^ ]*\).*"`
  4379.     case "$ans" in
  4380.     /*)
  4381.     if $test -f "$ans"; then
  4382.         cont=''
  4383.     else
  4384.         if $test "$fastread" = yes; then
  4385.         dflt=y
  4386.         else
  4387.         dflt=n
  4388.         fi
  4389.         rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4390.         $echo $n "$rp $c"
  4391.         . myread
  4392.         case "$ans" in
  4393.         y*) cont='';;
  4394.         esac
  4395.     fi
  4396.     ;;
  4397.     *)
  4398.         if $test "$fastread" = yes; then
  4399.         echo "The print spooler needs to be a full path name."
  4400.         echo "Using the current, possibly improper, value."
  4401.         cont=''
  4402.     else
  4403.         echo "Please give the full path name."
  4404.     fi
  4405.     ;;
  4406.     esac
  4407. done
  4408.  
  4409. : ask the preferred pager for this system.
  4410. case "$pager" in
  4411. '') dflt="builtin+";;
  4412. *)  dflt="$pager";;
  4413. esac
  4414.  
  4415. pager='blurfl/dyick'
  4416. echo " "
  4417. cont=true
  4418. while $test "$cont" ; do
  4419.     rp="What pager do you prefer to use with $package? [$dflt]"
  4420.     $echo $n "$rp $c"
  4421.     . myread
  4422.     pager="$ans"
  4423.     case "$ans" in
  4424.     builtin)
  4425.         cont=''
  4426.     ;;
  4427.     builtin+)
  4428.         cont=''
  4429.     ;;
  4430.     /*)
  4431.     if $test -f "$ans"; then
  4432.         cont=''
  4433.     else
  4434.         if $test "$fastread" = yes; then
  4435.         dflt=y
  4436.         else
  4437.         dflt=n
  4438.         fi
  4439.         rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4440.         $echo $n "$rp $c"
  4441.         . myread
  4442.         case "$ans" in
  4443.         y*) cont='';;
  4444.         esac
  4445.     fi
  4446.     ;;
  4447.     *)
  4448.     echo "Please give the full path name."
  4449.     ;;
  4450.     esac
  4451. done
  4452.  
  4453. : find out which shell people like to use most
  4454. case "$prefshell" in
  4455. '')
  4456.     if $test -f /bin/ksh; then
  4457.     dflt='/bin/ksh'
  4458.     elif $test -f /bin/csh; then
  4459.     dflt='/bin/csh'
  4460.     else
  4461.     dflt='/bin/sh'
  4462.     fi
  4463.     ;;
  4464. *)  dflt="$prefshell";;
  4465. esac
  4466. cont=true
  4467. while $test "$cont" ; do
  4468.     echo " "
  4469.     echo "Give the full path name of the shell most people like to use on your"
  4470.     $echo $n "system: [$dflt] $c"
  4471.     rp="Preferred shell: [$dflt]"
  4472.     . myread
  4473.     prefshell=$ans
  4474.     if test -f $ans; then
  4475.     cont=''
  4476.     else
  4477.     if $test "$fastread" = yes; then
  4478.         dflt=y
  4479.     else
  4480.         dflt=n
  4481.     fi
  4482.     rp="File $ans doesn't exist.  Use that name anyway? [$dflt]"
  4483.     $echo $n "$rp $c"
  4484.     . myread
  4485.     dflt=''
  4486.     case "$ans" in
  4487.     y*) cont='';;
  4488.     esac
  4489.     fi
  4490. done
  4491.  
  4492. : see if ar generates random libraries by itself
  4493. echo " "
  4494. echo "Checking how to generate random libraries on your machine..."
  4495. ar rc ran.a /dev/null
  4496. if ar ts ran.a >/dev/null 2>&1; then
  4497.     echo "ar appears to generate random libraries itself."
  4498.     orderlib=false
  4499.     ranlib=":"
  4500. else
  4501.     if test -f /usr/bin/ranlib; then
  4502.         ranlib=/usr/bin/ranlib
  4503.     elif test -f /bin/ranlib; then
  4504.         ranlib=/bin/ranlib
  4505.     fi
  4506.  
  4507.     if test -n "$ranlib"; then
  4508.         echo "your system has $ranlib; we'll use that."
  4509.         orderlib=false
  4510.     else
  4511.         echo "your system doesn't seem to support random libraries"
  4512.         echo "so we'll use lorder and tsort to order the libraries."
  4513.         orderlib=true
  4514.         ranlib=":"
  4515.     fi
  4516. fi
  4517.  
  4518. : determine the name of the tape device
  4519. rmttape=`loc rct0 "" /dev`
  4520. if $test -z "$rmttape"; then
  4521.     rmttape=`loc rmt0 "" /dev`
  4522. fi
  4523. if $test -z "$rmttape"; then
  4524.     rmttape=`loc rtp0 "unknown-remote-tape-unit" /dev`
  4525. fi
  4526. echo "remote tape drive is $rmttape"
  4527. echo " "
  4528. : where do we get termlib routines from
  4529. echo " "
  4530. case "$d_havetlib" in
  4531. "$define")
  4532.     echo "Termlib routines in '$termlib' from prior Configure run"
  4533.     ;;
  4534. *)
  4535.     ans=`loc libtermlib.a x $libpth`
  4536.     if $test "$ans" = x; then
  4537.         ans=`loc Slibtermlib.a x $libpth`
  4538.     fi
  4539.     case "$ans" in
  4540.     /usr/lib*|/usr/ccs/lib*|/lib*)
  4541.     termlib='-ltermlib'
  4542.     d_havetlib="$define"
  4543.     echo "Termlib library found."
  4544.     ;;
  4545.     /*)
  4546.     termlib="$ans"
  4547.     d_havetlib="$define"
  4548.     echo "Termlib library found."
  4549.     ;;
  4550.     *)
  4551.     ans=`loc libcurses.a x $libpth`
  4552.     if $test "$ans" = x; then
  4553.         ans=`loc Slibcurses.a x $libpth`
  4554.     fi
  4555.     case "$ans" in
  4556.     /*)
  4557.         ar t $ans >grimble
  4558.         if $contains tputs.o grimble >/dev/null 2>&1; then
  4559.         termlib='-lcurses'
  4560.         d_havetlib="$define"
  4561.         echo "Terminfo routines found in -lcurses library."
  4562.         else
  4563.         ans=x
  4564.         fi
  4565.         rm -f grimble
  4566.         ;;
  4567.     esac
  4568.     esac
  4569.     if $test "$ans" = x; then
  4570.     ans=`loc libtermcap.a x $libpth`
  4571.     if $test "$ans" = x; then
  4572.         ans=`loc Slibtermcap.a x $libpth`
  4573.     fi
  4574.     case "$ans" in
  4575.     /usr/lib*|/usr/ccs/lib*|/lib*)
  4576.         termlib='-ltermcap'
  4577.         d_havetlib="$define"
  4578.         echo "Termcap library found."
  4579.         ;;
  4580.     /*)
  4581.         termlib="$ans"
  4582.         d_havetlib="$define"
  4583.         echo "Termcap library found."
  4584.         ;;
  4585.     *)
  4586.         case "$termlib" in
  4587.         '')
  4588.         dflt=y
  4589.         rp="Your system appears to NOT have termlib-style routines.  Is this true? [$dflt]"
  4590.         $echo $n "$rp $c"
  4591.         . myread
  4592.         case "$ans" in
  4593.             n*|f*) d_havetlib="$define"
  4594.               echo "Then where are the termlib-style routines kept (specify either -llibname"
  4595.               $echo $n " or full pathname (~name ok))? $c"
  4596.               rp='Specify termlib:'
  4597.               . myread
  4598.               termlib=`filexp $ans`
  4599.               ;;
  4600.             *)    d_havetlib="$undef"
  4601.               termlib=''
  4602.               echo "You will have to play around with term.c then."
  4603.               ;;
  4604.         esac
  4605.         echo " "
  4606.         ;;
  4607.         *)  echo "You said termlib was $termlib before."
  4608.         ;;
  4609.         esac
  4610.         ;;
  4611.     esac
  4612.     fi
  4613.     ;;
  4614. esac
  4615. : determine where temporary files should go
  4616. case "$tmpdir" in
  4617. '')
  4618.     dflt=`loc . "." "/tmp /usr/tmp"`
  4619.     ;;
  4620. *)  dflt="$tmpdir"
  4621.     ;;
  4622. esac
  4623. if $test -d "$tmpdir" -a "$tmpdir" != ""; then
  4624.     $echo " "
  4625.     $echo "Temporary files will be put in the $tmpdir directory"
  4626. else
  4627.     cont=true
  4628.     while $test "$cont" ; do
  4629.         $echo " "
  4630.         rp="Where do you want to put the temporary files? [$dflt]"
  4631.         $echo $n "$rp $c"
  4632.         . myread
  4633.         tmpdir="$ans"
  4634.         tmpdir=`filexp $tmpdir`
  4635.         if $test -d "$tmpdir" -a "$tmpdir" != ""; then
  4636.         cont=''
  4637.         else
  4638.         if $test "$fastread" = yes; then
  4639.             dflt=y
  4640.         else
  4641.             dflt=n
  4642.         fi
  4643.         rp="Directory $tmpdir doesn't exist.  Use that name anyway? [$dflt]"
  4644.         $echo $n "$rp $c"
  4645.         . myread
  4646.         dflt=''
  4647.         case "$ans" in
  4648.         y*) cont='';;
  4649.         esac
  4650.         fi
  4651.     done
  4652. fi
  4653.  
  4654. : if pmake exists, allow its use for parallel make
  4655.  
  4656. if $test -f "$pmake" ; then
  4657.     case "$use_pmake" in
  4658.     n)  dflt=n;;
  4659.     *)  dflt=y;;
  4660.     esac
  4661.  
  4662.     $cat <<EOM
  4663.  
  4664. The executable file pmake was found on this system.  Usually this
  4665. file indicates a parallel make, which executes much faster.  Should
  4666. this system use the pmake command as its make command?
  4667.  
  4668. EOM
  4669.     rp="Does this system use pmake as its make? [$dflt]"
  4670.     $echo $n "$rp $c"
  4671.     . myread
  4672.     case "$ans" in
  4673.     y*) use_pmake=y
  4674.         make="$pmake";;
  4675.     *)  use_pmake=n;;
  4676.     esac
  4677. else
  4678.     use_pmake=n
  4679. fi
  4680.  
  4681. : the "config.over" file can be used to patch configuration changes
  4682. if test -f ../config.over ; then
  4683.     echo " "
  4684.     echo "I have found a \"config.over\" file."
  4685.     dflt=y
  4686.     rp="Do you want to load the \"config.over\" file? [$dflt]"
  4687.     $echo $n "$rp $c"
  4688.     . myread
  4689.     case "$ans" in
  4690.         n*)    echo "OK, I'll ignore it."
  4691.         ;;
  4692.     *)    . ../config.over
  4693.         echo "Configuration override changes have been loaded from config.over."
  4694.         ;;
  4695.     esac
  4696. fi
  4697.  
  4698. echo " "
  4699. echo "End of configuration questions."
  4700. echo " "
  4701.  
  4702. : create config.sh file
  4703. echo " "
  4704. if test -d ../UU; then
  4705.     cd ..
  4706. fi
  4707. echo "Creating config.sh..."
  4708. $spitshell <<EOT >config.sh
  4709. $startsh
  4710. # config.sh
  4711. # This file was produced by running the Configure script.
  4712.  
  4713. Log='$Log'
  4714. Header='$Header'
  4715. bin='$bin'
  4716. contains='$contains'
  4717. cppstdin='$cppstdin'
  4718. cppminus='$cppminus'
  4719. d_getopt='$d_getopt'
  4720. d_memcpy='$d_memcpy'
  4721. d_mkdir='$d_mkdir'
  4722. d_rename='$d_rename'
  4723. d_symlink='$d_symlink'
  4724. d_whoami='$d_whoami'
  4725. n='$n'
  4726. c='$c'
  4727. orderlib='$orderlib'
  4728. ranlib='$ranlib'
  4729. package='$package'
  4730. pager='$pager'
  4731. prefshell='$prefshell'
  4732. spitshell='$spitshell'
  4733. shsharp='$shsharp'
  4734. sharpbang='$sharpbang'
  4735. startsh='$startsh'
  4736. d_eunice='$d_eunice'
  4737. define='$define'
  4738. eunicefix='$eunicefix'
  4739. loclist='$loclist'
  4740. expr='$expr'
  4741. sed='$sed'
  4742. echo='$echo'
  4743. cat='$cat'
  4744. rm='$rm'
  4745. mv='$mv'
  4746. cp='$cp'
  4747. tail='$tail'
  4748. tr='$tr'
  4749. mkdir='$mkdir'
  4750. sort='$sort'
  4751. uniq='$uniq'
  4752. grep='$grep'
  4753. trylist='$trylist'
  4754. test='$test'
  4755. inews='$inews'
  4756. ispell='$ispell'
  4757. egrep='$egrep'
  4758. more='$more'
  4759. pg='$pg'
  4760. Mcc='$Mcc'
  4761. vi='$vi'
  4762. mailx='$mailx'
  4763. mail='$mail'
  4764. cpp='$cpp'
  4765. perl='$perl'
  4766. emacs='$emacs'
  4767. ls='$ls'
  4768. rmail='$rmail'
  4769. sendmail='$sendmail'
  4770. shar='$shar'
  4771. smail='$smail'
  4772. submit='$submit'
  4773. tbl='$tbl'
  4774. troff='$troff'
  4775. nroff='$nroff'
  4776. uname='$uname'
  4777. uuname='$uuname'
  4778. line='$line'
  4779. chgrp='$chgrp'
  4780. chmod='$chmod'
  4781. lint='$lint'
  4782. sleep='$sleep'
  4783. pr='$pr'
  4784. tar='$tar'
  4785. ln='$ln'
  4786. lpr='$lpr'
  4787. lp='$lp'
  4788. touch='$touch'
  4789. make='$make'
  4790. date='$date'
  4791. csh='$csh'
  4792. pmake='$pmake'
  4793. mips='$mips'
  4794. col='$col'
  4795. pack='$pack'
  4796. compress='$compress'
  4797. execmail='$execmail'
  4798. libswanted='$libswanted'
  4799. c_date='$c_date'
  4800. d_altcheck='$d_altcheck'
  4801. d_ascii='$d_ascii'
  4802. d_calendar='$d_calendar'
  4803. calendar='$calendar'
  4804. d_content='$d_content'
  4805. d_crypt='$d_crypt'
  4806. cryptlib='$cryptlib'
  4807. d_cuserid='$d_cuserid'
  4808. d_disphost='$d_disphost'
  4809. d_domname='$d_domname'
  4810. d_usegetdom='$d_usegetdom'
  4811. d_errlst='$d_errlst'
  4812. d_flock='$d_flock'
  4813. d_dotlock='$d_dotlock'
  4814. d_fcntlock='$d_fcntlock'
  4815. lock_dir='$lock_dir'
  4816. has_flock='$has_flock'
  4817. has_fcntl='$has_fcntl'
  4818. d_ftruncate='$d_ftruncate'
  4819. d_gethname='$d_gethname'
  4820. d_douname='$d_douname'
  4821. d_phostname='$d_phostname'
  4822. d_host_comp='$d_host_comp'
  4823. ign_hname='$ign_hname'
  4824. d_havetlib='$d_havetlib'
  4825. termlib='$termlib'
  4826. d_index='$d_index'
  4827. d_internet='$d_internet'
  4828. d_ispell='$d_ispell'
  4829. ispell_path='$ispell_path'
  4830. ispell_options='$ispell_options'
  4831. d_locale='$d_locale'
  4832. d_nl_types='$d_nl_types'
  4833. d_msgcat='$d_msgcat'
  4834. d_usenls='$d_usenls'
  4835. d_mboxedit='$d_mboxedit'
  4836. d_mime='$d_mime'
  4837. defencoding='$defencoding'
  4838. defcharset='$defcharset'
  4839. defdispcharset='$defdispcharset'
  4840. d_mmdf='$d_mmdf'
  4841. d_newauto='$d_newauto'
  4842. d_noaddfrom='$d_noaddfrom'
  4843. d_usedomain='$d_usedomain'
  4844. d_nocheckvalid='$d_nocheckvalid'
  4845. d_noxheader='$d_noxheader'
  4846. d_pidcheck='$d_pidcheck'
  4847. d_portable='$d_portable'
  4848. d_ptem='$d_ptem'
  4849. d_putenv='$d_putenv'
  4850. d_remlock='$d_remlock'
  4851. maxattempts='$maxattempts'
  4852. d_setgid='$d_setgid'
  4853. d_savegrpmboxid='$d_savegrpmboxid'
  4854. mailermode='$mailermode'
  4855. d_sigvec='$d_sigvec'
  4856. d_sigvectr='$d_sigvectr'
  4857. d_sigset='$d_sigset'
  4858. d_sighold='$d_sighold'
  4859. d_sigprocmask='$d_sigprocmask'
  4860. d_sigblock='$d_sigblock'
  4861. d_sigaction='$d_sigaction'
  4862. d_strcspn='$d_strcspn'
  4863. d_strspn='$d_strspn'
  4864. d_strpbrk='$d_strpbrk'
  4865. d_strings='$d_strings'
  4866. d_pwdinsys='$d_pwdinsys'
  4867. strings='$strings'
  4868. includepath='$includepath'
  4869. d_strstr='$d_strstr'
  4870. d_strtok='$d_strtok'
  4871. d_subshell='$d_subshell'
  4872. d_tempnam='$d_tempnam'
  4873. tempnamo='$tempnamo'
  4874. tempnamc='$tempnamc'
  4875. d_termio='$d_termio'
  4876. d_termios='$d_termios'
  4877. d_tz_min='$d_tz_min'
  4878. d_tzname='$d_tzname'
  4879. d_useembed='$d_useembed'
  4880. d_utimbuf='$d_utimbuf'
  4881. d_vfork='$d_vfork'
  4882. defbatsub='$defbatsub'
  4883. defeditor='$defeditor'
  4884. editoropts='$editoropts'
  4885. hostname='$hostname'
  4886. phostname='$phostname'
  4887. mydomain='$mydomain'
  4888. autohostname='$autohostname'
  4889. i_memory='$i_memory'
  4890. i_stdlib='$i_stdlib'
  4891. i_time='$i_time'
  4892. i_systime='$i_systime'
  4893. d_systimekernel='$d_systimekernel'
  4894. i_utime='$i_utime'
  4895. i_sysutime='$i_sysutime'
  4896. lib='$lib'
  4897. libc='$libc'
  4898. linepr='$linepr'
  4899. maildir='$maildir'
  4900. mailer='$mailer'
  4901. mailgrp='$mailgrp'
  4902. mansrc='$mansrc'
  4903. catmansrc='$catmansrc'
  4904. manext='$manext'
  4905. manext_choice='$manext_choice'
  4906. catmanext='$catmanext'
  4907. catmanext_choice='$catmanext_choice'
  4908. packed='$packed'
  4909. manroff='$manroff'
  4910. manroffopts='$manroffopts'
  4911. suffix='$suffix'
  4912. packer='$packer'
  4913. models='$models'
  4914. split='$split'
  4915. small='$small'
  4916. medium='$medium'
  4917. large='$large'
  4918. huge='$huge'
  4919. optimize='$optimize'
  4920. ccflags='$ccflags'
  4921. cppflags='$cppflags'
  4922. ldflags='$ldflags'
  4923. cc='$cc'
  4924. libs='$libs'
  4925. nametype='$nametype'
  4926. d_passnames='$d_passnames'
  4927. d_berknames='$d_berknames'
  4928. d_usgnames='$d_usgnames'
  4929. passcat='$passcat'
  4930. rmttape='$rmttape'
  4931. roff='$roff'
  4932. roffopts='$roffopts'
  4933. sigtype='$sigtype'
  4934. tmpdir='$tmpdir'
  4935. use_pmake='$use_pmake'
  4936. xencf='$xencf'
  4937. xenlf='$xenlf'
  4938. d_xenix='$d_xenix'
  4939. d_bsd='$d_bsd'
  4940. CONFIG=true
  4941. EOT
  4942.  
  4943. CONFIG=true
  4944.  
  4945. echo " "
  4946. dflt=''
  4947. fastread=''
  4948. echo "If you didn't make any mistakes, then just type a carriage return here."
  4949. rp="If you need to edit config.sh, do it as a shell escape here:"
  4950. $echo $n "$rp $c"
  4951. . UU/myread
  4952. case "$ans" in
  4953. '') ;;
  4954. *) : in case they cannot read
  4955.     eval $ans;;
  4956. esac
  4957. : if this fails, just run all the .SH files by hand
  4958. . ./config.sh
  4959.  
  4960. echo " "
  4961. echo "Doing variable substitutions on .SH files..."
  4962. set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  4963. shift
  4964. case $# in
  4965. 0) set x *.SH; shift;;
  4966. esac
  4967. if test ! -f $1; then
  4968.     shift
  4969. fi
  4970. for file in $*; do
  4971.     case "$file" in
  4972.     */*)
  4973.     dir=`$expr X$file : 'X\(.*\)/'`
  4974.     file=`$expr X$file : 'X.*/\(.*\)'`
  4975.     (cd $dir && . $file)
  4976.     ;;
  4977.     *)
  4978.     . $file
  4979.     ;;
  4980.     esac
  4981. done
  4982. if test -f config.h.SH; then
  4983.     if test ! -f config.h; then
  4984.     : oops, they left it out of MANIFEST, probably, so do it anyway.
  4985.     . config.h.SH
  4986.     fi
  4987. fi
  4988.  
  4989. if $contains '^depend:' Makefile >/dev/null 2>&1; then
  4990.     dflt=n
  4991.     $cat <<EOM
  4992.  
  4993. Now you need to generate make dependencies by running "make depend".
  4994. You might prefer to run it in background: "make depend > makedepend.out &"
  4995. It can take a while, so you might not want to run it right now.
  4996.  
  4997. EOM
  4998.     rp="Run make depend now? [$dflt]"
  4999.     $echo $n "$rp $c"
  5000.     . UU/myread
  5001.     case "$ans" in
  5002.     y*) make depend && echo "Now you must run a make."
  5003.     ;;
  5004.     *)  echo "You must run 'make depend' then 'make'."
  5005.     ;;
  5006.     esac
  5007. elif test -f Makefile; then
  5008.     echo " "
  5009.     echo "Now you must run a make."
  5010. else
  5011.     echo "Done."
  5012. fi
  5013.  
  5014. $rm -f kit*isdone
  5015. : the following is currently useless
  5016. cd UU && $rm -f $rmlist
  5017. : since this removes it all anyway
  5018. cd .. && $rm -rf UU
  5019. : end of Configure
  5020.