home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume22 / elm2.3 / part02 < prev    next >
Encoding:
Internet Message Format  |  1990-06-07  |  48.0 KB

  1. Subject:  v22i061:  ELM mail syste, release 2.3, Part02/26
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: aae9f1d0 b687e788 392aac14 6118e224
  5.  
  6. Submitted-by: Syd Weinstein <syd@dsinc.dsi.com>
  7. Posting-number: Volume 22, Issue 61
  8. Archive-name: elm2.3/part02
  9.  
  10. ---- Cut Here and unpack ----
  11. #!/bin/sh
  12. # this is part 2 of a multipart archive
  13. # do not concatenate these parts, unpack them in order with /bin/sh
  14. # file Configure continued
  15. #
  16. CurArch=2
  17. if test ! -r s2_seq_.tmp
  18. then echo "Please unpack part 1 first!"
  19.      exit 1; fi
  20. ( read Scheck
  21.   if test "$Scheck" != $CurArch
  22.   then echo "Please unpack part $Scheck next!"
  23.        exit 1;
  24.   else exit 0; fi
  25. ) < s2_seq_.tmp || exit 1
  26. echo "x - Continuing file Configure"
  27. sed 's/^X//' << 'SHAR_EOF' >> Configure
  28. X    *large*)
  29. X    case "$large" in
  30. X    '') dflt='-Ml';;
  31. X    *) dflt="$large";;
  32. X    esac
  33. X    rp="What flag indicates large model? [$dflt]"
  34. X    $echo $n "$rp $c"
  35. X    . myread
  36. X    case "$ans" in
  37. X    none) ans='';
  38. X    esac
  39. X    large="$ans"
  40. X    ;;
  41. X    *) large='';;
  42. X    esac
  43. X    case "$models" in
  44. X    *huge*)
  45. X    case "$huge" in
  46. X    '') dflt='-Mh';;
  47. X    *) dflt="$huge";;
  48. X    esac
  49. X    rp="What flag indicates huge model? [$dflt]"
  50. X    $echo $n "$rp $c"
  51. X    . myread
  52. X    case "$ans" in
  53. X    none) ans='';
  54. X    esac
  55. X    huge="$ans"
  56. X    ;;
  57. X    *) huge="$large";;
  58. X    esac
  59. X    case "$models" in
  60. X    *medium*)
  61. X    case "$medium" in
  62. X    '') dflt='-Mm';;
  63. X    *) dflt="$medium";;
  64. X    esac
  65. X    rp="What flag indicates medium model? [$dflt]"
  66. X    $echo $n "$rp $c"
  67. X    . myread
  68. X    case "$ans" in
  69. X    none) ans='';
  70. X    esac
  71. X    medium="$ans"
  72. X    ;;
  73. X    *) medium="$large";;
  74. X    esac
  75. X    case "$models" in
  76. X    *small*)
  77. X    case "$small" in
  78. X    '') dflt='none';;
  79. X    *) dflt="$small";;
  80. X    esac
  81. X    rp="What flag indicates small model? [$dflt]"
  82. X    $echo $n "$rp $c"
  83. X    . myread
  84. X    case "$ans" in
  85. X    none) ans='';
  86. X    esac
  87. X    small="$ans"
  88. X    ;;
  89. X    *) small='';;
  90. X    esac
  91. X    ;;
  92. X*)
  93. X    echo "Unrecognized memory models--you may have to edit Makefile.SH"
  94. X    ;;
  95. Xesac
  96. Xfi
  97. X
  98. X: see if we need a special compiler
  99. Xecho " "
  100. Xif usg; then
  101. X    case "$cc" in
  102. X    '')
  103. X    case "$Mcc" in
  104. X    /*) dflt='Mcc'
  105. X        ;;
  106. X    *)
  107. X        case "$large" in
  108. X        -M*)
  109. X        dflt='cc'
  110. X        ;;
  111. X        *)
  112. X        if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  113. X            dflt='cc -M'
  114. X        else
  115. X            dflt='cc'
  116. X        fi
  117. X        ;;
  118. X        esac
  119. X        ;;
  120. X    esac
  121. X    ;;
  122. X    *)  dflt="$cc";;
  123. X    esac
  124. X    $cat <<'EOM'
  125. X  
  126. XOn some systems the default C compiler will not resolve multiple global
  127. Xreferences that happen to have the same name.  On some such systems the
  128. X"Mcc" command may be used to force these to be resolved.  On other systems
  129. Xa "cc -M" command is required.  (Note that the -M flag on other systems
  130. Xindicates a memory model to use!)  If you have the Gnu C compiler, you
  131. Xmight wish to use that instead.  What command will force resolution on
  132. XEOM
  133. X    $echo $n "this system? [$dflt] $c"
  134. X    rp="Command to resolve multiple refs? [$dflt]"
  135. X    . myread
  136. X    cc="$ans"
  137. Xelse
  138. X    case "$cc" in
  139. X    '') dflt=cc;;
  140. X    *) dflt="$cc";;
  141. X    esac
  142. X    rp="Use which C compiler? [$dflt]"
  143. X    $echo $n "$rp $c"
  144. X    . myread
  145. X    cc="$ans"
  146. Xfi
  147. Xcase "$cc" in
  148. Xgcc*) cpp=`loc gcc-cpp $cpp $pth`;;
  149. Xesac
  150. X
  151. X: determine optimize, if desired, or use for debug flag also
  152. Xcase "$optimize" in
  153. X' ') dflt="none"
  154. X     ;;
  155. X'') dflt="-O";
  156. X    ;;
  157. X*)  dflt="$optimize"
  158. X    ;;
  159. Xesac
  160. Xcat <<EOH
  161. X
  162. XSome C compilers have problems with their optimizers, by default, $package
  163. Xcompiles with the -O flag to use the optimizer.  Alternately, you might
  164. Xwant to use the symbolic debugger, which uses the -g flag (on traditional
  165. XUnix systems).  Either flag can be specified here.  To use neither flag,
  166. Xspecify the word "none".
  167. X  
  168. XEOH
  169. Xrp="What optimizer/debugger flag should be used? [$dflt]"
  170. X$echo $n "$rp $c"
  171. X. myread
  172. Xoptimize="$ans"
  173. Xcase "$optimize" in
  174. X'none') optimize=" "
  175. X     ;;
  176. Xesac
  177. X
  178. Xcase "$ccflags" in
  179. X'') case "$cc" in
  180. X    *gcc*) dflt='-fpcc-struct-return';;
  181. X    *) dflt='';;
  182. X    esac
  183. X    ;;
  184. X*) dflt="$ccflags";;
  185. Xesac
  186. Xfor thisincl in $inclwanted; do
  187. X    if test -d $thisincl; then
  188. X    case "$dflt" in
  189. X    *$thisincl*);;
  190. X    *) dflt="$dflt -I$thisincl";;
  191. X    esac
  192. X    fi
  193. Xdone
  194. Xcase "$optimize" in
  195. X-g*)
  196. X    case "$dflt" in
  197. X    *DEBUG*);;
  198. X    *) dflt="$dflt -DDEBUG";;
  199. X    esac
  200. X    ;;
  201. Xesac
  202. Xcase "$dflt" in
  203. X'') dflt=none;;
  204. Xesac
  205. Xif $test -n "$xencf" ; then
  206. X    $echo "Xenix 286 system, using compiler flags $xencf"
  207. X    $echo "do not respecify these flags below."
  208. X    $echo ""
  209. Xfi
  210. Xcat <<EOH
  211. X
  212. XYour C compiler may want other flags.  For this question you should
  213. Xinclude -I/whatever and -DWHATEVER flags and any other flags used by
  214. Xthe C compiler, but you should NOT include libraries or ld flags like
  215. X-lwhatever.  To use no flags, specify the word "none".
  216. X  
  217. XEOH
  218. Xrp="Any additional cc flags? [$dflt]"
  219. X$echo $n "$rp $c"
  220. X. myread
  221. Xcase "$ans" in
  222. Xnone) ans='';
  223. Xesac
  224. Xccflags="$ans"
  225. X
  226. X: the following weeds options from ccflags that are of no interest to cpp
  227. Xcppflags="$ccflags"
  228. Xcase "$cc" in
  229. X*gcc*) cppflags="$cppflags -D__GNUC__";;
  230. Xesac
  231. Xcase "$cppflags" in
  232. X'');;
  233. X*)  set X $cppflags
  234. X    cppflags=''
  235. X    for flag do
  236. X    case $flag in
  237. X    -D*|-I*) cppflags="$cppflags $flag";;
  238. X    esac
  239. X    done
  240. X    case "$cppflags" in
  241. X    *-*)  echo "(C preprocessor flags: $cppflags)";;
  242. X    esac
  243. X    ;;
  244. Xesac
  245. X
  246. Xif $test -n "$xenlf" ; then
  247. X    $echo "Xenix 286 system, using linker flags $xenlf"
  248. X    $echo "do not respecify these flags below"
  249. X    $echo ""
  250. Xfi
  251. Xcase "$ldflags" in
  252. X'') if venix; then
  253. X    dflt='-i -z'
  254. X    else
  255. X    dflt='none'
  256. X    fi
  257. X    ;;
  258. X*) dflt="$ldflags";;
  259. Xesac
  260. Xecho " "
  261. Xrp="Any additional ld flags (NOT including libraries)? [$dflt]"
  262. X$echo $n "$rp $c"
  263. X. myread
  264. Xcase "$ans" in
  265. Xnone) ans='';
  266. Xesac
  267. Xldflags="$ans"
  268. Xrmlist="$rmlist pdp11"
  269. X
  270. Xecho " "
  271. Xecho "Checking for optional libraries..."
  272. Xcase "$libs" in
  273. X'') dflt='';;
  274. X*) dflt="$libs";;
  275. Xesac
  276. Xcase "$libswanted" in
  277. X'') libswanted='c_s';;
  278. Xesac
  279. Xfor thislib in $libswanted; do
  280. X    case "$thislib" in
  281. X    dbm) thatlib=ndbm;;
  282. X    *_s) thatlib=NONE;;
  283. X    *) thatlib="${thislib}_s";;
  284. X    *) thatlib=NONE;;
  285. X    esac
  286. X    xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib`
  287. X    if test -f $xxx; then
  288. X    echo "Found -l$thislib."
  289. X    case "$dflt" in
  290. X    *-l$thislib*|*-l$thatlib*);;
  291. X    *) dflt="$dflt -l$thislib";;
  292. X    esac
  293. X    else
  294. X    xxx=`loc lib$thislib.a X $libpth`
  295. X    if test -f $xxx; then
  296. X        echo "Found $xxx."
  297. X        case "$dflt" in
  298. X        *$xxx*);;
  299. X        *) dflt="$dflt $xxx";;
  300. X        esac
  301. X    else
  302. X        xxx=`loc Slib$thislib.a X $xlibpth`
  303. X        if test -f $xxx; then
  304. X        echo "Found -l$thislib."
  305. X        case "$dflt" in
  306. X        *-l$thislib*|*-l$thatlib*);;
  307. X        *) dflt="$dflt -l$thislib";;
  308. X        esac
  309. X        else
  310. X        echo "No -l$thislib."
  311. X        fi
  312. X    fi
  313. X    fi
  314. Xdone
  315. Xset X $dflt
  316. Xshift
  317. Xdflt="$*"
  318. Xcase "$dflt" in
  319. X'') dflt='none';;
  320. Xesac
  321. X
  322. X$cat <<EOM
  323. XSome versions of Unix support shared libraries, which make
  324. Xexecutables smaller but make load time slightly longer.
  325. X
  326. XOn some systems, mostly newer Unix System V's, the shared library
  327. Xis included by putting the option "-lc_s" as the last thing on the
  328. Xcc command line when linking.  Other systems use shared libraries
  329. Xby default.  There may be other libraries needed to compile $package
  330. Xon your machine as well.  If your system needs the "-lc_s" option,
  331. Xinclude it here.  Include any other special libraries here as well.
  332. XSay "none" for none.
  333. XEOM
  334. X
  335. Xecho " "
  336. Xrp="Any additional libraries? [$dflt]"
  337. X$echo $n "$rp $c"
  338. X. myread
  339. Xcase "$ans" in
  340. Xnone) ans='';
  341. Xesac
  342. Xlibs="$ans"
  343. X
  344. X: check for ordering of bytes in a long
  345. Xcase "$byteorder" in
  346. X'')
  347. Xcat <<'EOM'
  348. X  
  349. XIn the following, larger digits indicate more significance.  A big-endian
  350. Xmachine like a Pyramid or a Motorola 680?0 chip will come out to 4321.  A
  351. Xlittle-endian machine like a Vax or an Intel 80?86 chip would be 1234.  Other
  352. Xmachines may have weird orders like 3412.  A Cray will report 87654321.  If
  353. Xthe test program works the default is probably right.
  354. XI'm now running the test program...
  355. XEOM
  356. X    $cat >try.c <<'EOCP'
  357. X#include <stdio.h>
  358. Xmain()
  359. X{
  360. X    int i;
  361. X    union {
  362. X    unsigned long l;
  363. X    char c[sizeof(long)];
  364. X    } u;
  365. X
  366. X    if (sizeof(long) > 4)
  367. X    u.l = 0x0807060504030201;
  368. X    else
  369. X    u.l = 0x04030201;
  370. X    for (i=0; i < sizeof(long); i++)
  371. X    printf("%c",u.c[i]+'0');
  372. X    printf("\n");
  373. X}
  374. XEOCP
  375. X    if $cc try.c -o try >/dev/null 2>&1 ; then
  376. X    dflt=`./try`
  377. X    case "$dflt" in
  378. X    ????|????????) echo "(The test program ran ok.)";;
  379. X    *) echo "(The test program didn't run right for some reason.)";;
  380. X    esac
  381. X    else
  382. X    dflt='4321'
  383. X    echo "(I can't seem to compile the test program.  Guessing big-endian...)"
  384. X    fi
  385. X    ;;
  386. X*)
  387. X    echo " "
  388. X    dflt="$byteorder"
  389. X    ;;
  390. Xesac
  391. Xrp="What is the order of bytes in a long? [$dflt]"
  392. X$echo $n "$rp $c"
  393. X. myread
  394. Xbyteorder="$ans"
  395. X$rm -f try.c try
  396. X
  397. X: get list of predefined functions in a handy place
  398. Xecho " "
  399. Xcase "$libc" in
  400. X'') libc=unknown;;
  401. Xesac
  402. Xcase "$libpth" in
  403. X'') libpth='/lib /usr/lib /usr/local/lib';;
  404. Xesac
  405. Xcase "$libs" in
  406. X*-lc_s*) libc=`loc libc_s.a $libc $libpth`
  407. Xesac
  408. Xlibnames='';
  409. Xcase "$libs" in
  410. X'') ;;
  411. X*)  for thislib in $libs; do
  412. X    case "$thislib" in
  413. X    -l*) thislib=`expr X$thislib : 'X-l\(.*\)'`
  414. X        try=`loc lib$thislib.a blurfl/dyick $libpth`
  415. X        if test ! -f $try; then
  416. X        try=`loc lib$thislib blurfl/dyick $libpth`
  417. X        if test ! -f $try; then
  418. X            try=`loc $thislib blurfl/dyick $libpth`
  419. X            if test ! -f $try; then
  420. X            try=`loc Slib$thislib.a blurfl/dyick $xlibpth`
  421. X            if test ! -f $try; then
  422. X                try=''
  423. X            fi
  424. X            fi
  425. X        fi
  426. X        fi
  427. X        libnames="$libnames $try"
  428. X        ;;
  429. X    *) libnames="$libnames $thislib" ;;
  430. X    esac
  431. X    done
  432. X    ;;
  433. Xesac
  434. Xset /usr/lib/libc.so.[0-9]*
  435. Xeval set \$$#
  436. Xif test -f "$1"; then
  437. X    echo "Your shared C library is in $1."
  438. X    libc="$1"
  439. Xelif test -f $libc; then
  440. X    echo "Your C library is in $libc, like you said before."
  441. Xelif test -f /lib/libc.a; then
  442. X    echo "Your C library is in /lib/libc.a.  You're normal."
  443. X    libc=/lib/libc.a
  444. Xelse
  445. X    if test "$uname_os" != DomainOS ; then
  446. X        ans=`loc libc.a blurfl/dyick $libpth`
  447. X    fi
  448. X    if test ! -f "$ans"; then
  449. X    ans=`loc libc blurfl/dyick $libpth`
  450. X    fi
  451. X    if test ! -f "$ans"; then
  452. X    ans=`loc clib blurfl/dyick $libpth`
  453. X    fi
  454. X    if test ! -f "$ans"; then
  455. X    ans=`loc Slibc.a blurfl/dyick $xlibpth`
  456. X    fi
  457. X    if test ! -f "$ans"; then
  458. X    ans=`loc Mlibc.a blurfl/dyick $xlibpth`
  459. X    fi
  460. X    if test ! -f "$ans"; then
  461. X    ans=`loc Llibc.a blurfl/dyick $xlibpth`
  462. X    fi
  463. X    if test -f "$ans"; then
  464. X    echo "Your C library is in $ans, of all places."
  465. X    libc=$ans
  466. X    else
  467. X    cat <<EOM
  468. XI can't seem to find your C library.  I've looked in the following places:
  469. X
  470. X    $libpth
  471. X
  472. XNone of these seems to contain your C library.  What is the full name
  473. XEOM
  474. X    dflt=None
  475. X    $echo $n "of your C library? $c"
  476. X    rp='C library full name?'
  477. X    . myread
  478. X    libc="$ans"
  479. X    fi
  480. Xfi
  481. Xecho " "
  482. Xset `echo $libc $libnames | tr ' ' '\012' | sort | uniq`
  483. X$echo $n "Extracting names from $* for later perusal...$c"
  484. Xnm $* 2>/dev/null >libc.tmp
  485. X$sed -n -e 's/^.* [AT]  *_[_.]*//p' -e 's/^.* [AT] //p' <libc.tmp >libc.list
  486. Xif $contains '^printf$' libc.list >/dev/null 2>&1; then
  487. X    echo "done"
  488. Xelse
  489. X    $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
  490. X    $contains '^printf$' libc.list >/dev/null 2>&1 || \
  491. X    $sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
  492. X    $contains '^printf$' libc.list >/dev/null 2>&1 || \
  493. X       $sed -n -e 's/^_//' \
  494. X          -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
  495. X    if $contains '^printf$' libc.list >/dev/null 2>&1; then
  496. X    echo "done"
  497. X    else
  498. X    echo " "
  499. X    echo "nm didn't seem to work right."
  500. X    echo "Trying ar instead..."
  501. X    if ar t $libc > libc.tmp; then
  502. X        for thisname in $libnames; do
  503. X        ar t $thisname >>libc.tmp
  504. X        done
  505. X        $sed -e 's/\.o$//' < libc.tmp > libc.list
  506. X        echo "Ok."
  507. X    else
  508. X        echo "ar didn't seem to work right."
  509. X        echo "Maybe this is a Cray...trying bld instead..."
  510. X        if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
  511. X        for thisname in $libnames; do
  512. X            bld t $libnames | \
  513. X            $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
  514. X            ar t $thisname >>libc.tmp
  515. X        done
  516. X        echo "Ok."
  517. X        else
  518. X            echo "That didn't work either.  Giving up."
  519. X            exit 1
  520. X        fi
  521. X    fi
  522. X    fi
  523. Xfi
  524. X
  525. Xinlibc='echo " ";
  526. Xif $contains "^$1\$" libc.list >/dev/null 2>&1;
  527. Xthen echo "$1() found"; eval "$2=$define";
  528. Xelse echo "$1() not found"; eval "$2=$undef"; fi'
  529. X
  530. Xrmlist="$rmlist libc.tmp libc.list"
  531. X
  532. X: see if nfs exists
  533. Xecho " "
  534. Xdflt=`loc exports xyz /etc /usr/etc`
  535. Xif $test "$dflt" = xyz; then
  536. X    dflt=`loc nfsd xyz /etc /usr/etc $pth`
  537. Xfi
  538. Xif $test "$dflt" = xyz; then
  539. X    echo "System does not support NFS, internal byte order will be used"
  540. X    d_nfs="$undef"
  541. Xelse
  542. X    echo "System supports NFS, network byte order will be used"
  543. X    d_nfs="$define"
  544. Xfi
  545. X
  546. Xif $test "$d_nfs" = "$define"; then
  547. X    case "$byteorder" in
  548. X    4321)
  549. X        d_networkorder="$undef";
  550. X        ;;
  551. X    *)
  552. X        d_networkorder="$define";
  553. X        if $contains ntohl libc.list >/dev/null 2>&1; then
  554. X        echo 'ntohl found in libc, no special libraries needed for network byte ordering'
  555. X        else
  556. X        echo 'ntohl not found in libc, be sure to specify the library for network support'
  557. X        echo 'as an optional library'
  558. X        fi
  559. X        ;;
  560. X    esac
  561. Xelse
  562. X    d_networkorder="$undef";
  563. Xfi
  564. X
  565. X: get calendar mode and default calendar file name
  566. X$cat <<EOM
  567. X
  568. XThere is a neat feature that enables scanning of the message body for
  569. Xentries to add to the users ".calendar" (or whatever) file.  These
  570. Xentries are then processed by the system program calendar.  To use
  571. Xthis feature it needs to be enabled.  The name of the per user calendar
  572. Xfile used by your systems calendar program is also required.
  573. XEOM
  574. X
  575. Xcase "$d_calendar" in
  576. X"$define") dflt=y;;
  577. X"$undef")  dflt=n;;
  578. X*)       dflt=y;;
  579. Xesac
  580. X
  581. Xrp="Enable calendar feature [$dflt]"
  582. X$echo $n "$rp $c"
  583. X. myread
  584. Xcase "$ans" in
  585. Xy*) d_calendar="$define";;
  586. X*)  d_calendar="$undef";;
  587. Xesac
  588. X
  589. Xcase "$calendar" in
  590. X    '') dflt='calendar';;
  591. X    *)  dflt=$calendar;;
  592. Xesac
  593. X
  594. Xif $test "$d_calendar" = "$define"; then
  595. X    echo " "
  596. X    rp="Default calendar file: [$dflt]"
  597. X    $echo $n "$rp $c"
  598. X    . myread
  599. X    calendar="$ans"
  600. Xfi
  601. X
  602. X: find out how to find out full name
  603. Xecho " "
  604. Xcase "$d_berknames" in
  605. X"$define")
  606. X    dflt=y;;
  607. X"$undef")
  608. X    dflt=n;;
  609. X*)
  610. X    if bsd; then
  611. X    dflt=y
  612. X    elif xenix; then
  613. X    dflt=y
  614. X    else
  615. X    dflt=n
  616. X    fi
  617. X    ;;
  618. Xesac
  619. Xecho "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  620. X$echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  621. Xrp="Berkeley/V7 format full name? [$dflt]"
  622. X. myread
  623. Xcase "$ans" in
  624. X  y*)
  625. X    d_passnames="$define"
  626. X    d_berknames="$define"
  627. X    d_usgnames="$undef"
  628. X    nametype=bsd
  629. X    ;;
  630. X  *)
  631. X    echo " "
  632. X    case "$d_usgnames" in
  633. X    "$define")
  634. X    dflt=y;;
  635. X    "$undef")
  636. X    dflt=n;;
  637. X    *)
  638. X    if usg; then
  639. X        dflt=y
  640. X    else
  641. X        dflt=n
  642. X    fi
  643. X    ;;
  644. X    esac
  645. X    echo "Does your passwd file keep full names in USG format (name sandwiched"
  646. X    $echo $n "between a '-' and a '(')? [$dflt] $c"
  647. X    rp="USG format full name? [$dflt]"
  648. X    . myread
  649. X    case "$ans" in
  650. X      n*)
  651. X    echo "Full name will be taken from ~/.fullname"
  652. X    d_passnames="$undef"
  653. X    d_berknames="$undef"
  654. X    d_usgnames="$undef"
  655. X    nametype=other
  656. X    ;;
  657. X      *)
  658. X    d_passnames="$define"
  659. X    d_berknames="$undef"
  660. X    d_usgnames="$define"
  661. X    nametype=usg
  662. X    ;;
  663. X    esac
  664. X    ;;
  665. Xesac
  666. X
  667. X: see if we have to deal with yellow pages
  668. Xif $test -d /usr/etc/yp; then
  669. X    if $test "$passcat" = "ypcat passwd"; then
  670. X    dflt=y
  671. X    elif $contains '^\+:' /etc/passwd; then
  672. X    dflt=y
  673. X    else
  674. X    dflt=n
  675. X    fi
  676. X    rp="Are you getting the passwd file via yellow pages? [$dflt]"
  677. X    $echo $n "$rp $c"
  678. X    . myread
  679. X    case "$ans" in
  680. X    y*) passcat='ypcat passwd';;
  681. X    *) passcat='cat /etc/passwd';;
  682. X    esac
  683. Xelse
  684. X    passcat='cat /etc/passwd'
  685. Xfi
  686. X
  687. X: see if crypt exists
  688. Xecho " "
  689. Xif $contains '^crypt$' libc.list >/dev/null 2>&1; then
  690. X    echo 'crypt() found.'
  691. X    d_crypt="$define"
  692. X    cryptlib=''
  693. Xelse
  694. X    cryptlib=`loc Slibcrypt.a "" $xlibpth`
  695. X    if $test -z "$cryptlib"; then
  696. X    cryptlib=`loc Mlibcrypt.a "" $xlibpth`
  697. X    else
  698. X    cryptlib=-lcrypt
  699. X    fi
  700. X    if $test -z "$cryptlib"; then
  701. X    cryptlib=`loc Llibcrypt.a "" $xlibpth`
  702. X    else
  703. X    cryptlib=-lcrypt
  704. X    fi
  705. X    if $test -z "$cryptlib"; then
  706. X    cryptlib=`loc libcrypt.a "" $libpth`
  707. X    else
  708. X    cryptlib=-lcrypt
  709. X    fi
  710. X    if $test -z "$cryptlib"; then
  711. X    echo 'crypt() not found.'
  712. X    d_crypt="$undef"
  713. X    else
  714. X    d_crypt="$define"
  715. X    fi
  716. Xfi
  717. X
  718. X: check for cuserid function
  719. Xecho " "
  720. Xif $contains '^cuserid$' libc.list >/dev/null 2>&1 ; then
  721. X    echo "cuserid() found."
  722. X    d_cuserid="$undef"
  723. Xelse
  724. X    echo "No cuserid() found--will use mine."
  725. X    d_cuserid="$define"
  726. Xfi
  727. X
  728. X: now get the host name
  729. Xecho " "
  730. Xecho "Figuring out host name..."
  731. Xecho 'Maybe "hostname" will work...'
  732. Xif ans=`sh -c hostname 2>&1` ; then
  733. X    hostname=$ans
  734. X    phostname=hostname
  735. Xelse
  736. X    if xenix; then
  737. X    echo 'Oh, dear.  Maybe "/etc/systemid" is the key...'
  738. X    if ans=`cat /etc/systemid 2>&1` ; then
  739. X        hostname=$ans
  740. X        phostname='cat /etc/systemid'
  741. X        echo "Whadyaknow.  Xenix always was a bit strange..."
  742. X    else
  743. X        echo 'No, maybe "uuname -l" will work...'
  744. X        if ans=`sh -c 'uuname -l' 2>&1` ; then
  745. X        hostname=$ans
  746. X        phostname='uuname -l'
  747. X        else
  748. X        echo 'Strange.  Maybe "uname -n" will work...'
  749. X        if ans=`sh -c 'uname -n' 2>&1` ; then
  750. X            hostname=$ans
  751. X            phostname='uname -n'
  752. X        else
  753. X            echo 'Oh well, maybe I can mine it out of whoami.h...'
  754. X            if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  755. X            hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  756. X            phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  757. X            else
  758. X            case "$hostname" in
  759. X            '') echo "Does this machine have an identity crisis or something?"
  760. X                phostname=''
  761. X                ;;
  762. X            *)  echo "Well, you said $hostname before...";;
  763. X            esac
  764. X            fi
  765. X        fi
  766. X        fi
  767. X    fi
  768. X    else
  769. X    if $test -r /etc/systemid ; then
  770. X        echo "What is a non-Xenix system doing with /etc/systemid?"
  771. X    fi
  772. X    echo 'No, maybe "uuname -l" will work...'
  773. X    if $test -n "$uuname" && ans=`sh -c "$uuname -l" 2>&1` ; then
  774. X        hostname=$ans
  775. X        phostname="$uuname -l"
  776. X    else
  777. X        echo 'Strange.  Maybe "uname -n" will work...'
  778. X        if $test -n "$uname" && ans=`sh -c "$uname -n" 2>&1` ; then
  779. X        hostname=$ans
  780. X        phostname="$uname -n"
  781. X        else
  782. X        if ans=`cat /etc/systemid 2>&1` ; then
  783. X            hostname=$ans
  784. X            phostname='cat /etc/systemid'
  785. X            echo "Well, I'll use the systemid file anyway..."
  786. X        else
  787. X            echo 'Oh well, maybe I can mine it out of whoami.h...'
  788. X            if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  789. X            hostname=`echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  790. X            phostname="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  791. X            else
  792. X            case "$hostname" in
  793. X            '') echo "Does this machine have an identity crisis or something?"
  794. X                phostname=''
  795. X                ;;
  796. X            *)  echo "Well, you said $hostname before...";;
  797. X            esac
  798. X            fi
  799. X        fi
  800. X        fi
  801. X    fi
  802. X    fi
  803. Xfi
  804. X: you do not want to know about this
  805. Xset $hostname
  806. Xhostname=$1
  807. X
  808. X: translate upper to lower if necessary
  809. Xcase "$hostname" in
  810. X    *[A-Z]*)
  811. X    hostname=`echo $hostname | tr '[A-Z]' '[a-z]'`
  812. X    echo "(Normalizing case in your host name)"
  813. X    ;;
  814. Xesac
  815. X
  816. X: verify guess
  817. Xif $test "$hostname" ; then
  818. X    dflt=y
  819. X    echo 'Your host name appears to be "'$hostname'".'
  820. X    $echo $n "Is this correct? [$dflt] $c"
  821. X    rp="Sitename is $hostname? [$dflt]"
  822. X    . myread
  823. X    case "$ans" in
  824. X      y*)  ;;
  825. X      *)      hostname='' ;;
  826. X    esac
  827. Xfi
  828. X
  829. X: bad guess or no guess
  830. Xwhile $test "X$hostname" = X ; do
  831. X    dflt=''
  832. X    rp="Please type the (one word) name of your host:"
  833. X    $echo $n "$rp $c"
  834. X    . myread
  835. X    hostname="$ans"
  836. Xdone
  837. X
  838. Xecho " "
  839. Xcase "$hostname" in
  840. X*.*)
  841. X    dflt=`$expr "X$hostname" : "X[^.]*\(\..*\)"`
  842. X    hostname=`$expr "X$hostname" : "X\([^.]*\)\."`
  843. X    echo "(Trimming domain name from host name--host name is now $hostname)"
  844. X    ;;
  845. X*)  case "$mydomain" in
  846. X    '') dflt='.UUCP';;
  847. X    *) dflt="$mydomain";;
  848. X    esac
  849. X    ;;
  850. Xesac
  851. Xrp="What is your domain name? [$dflt]"
  852. X$echo $n "$rp $c"
  853. X. myread
  854. Xcase "$ans" in
  855. X'') ;;
  856. X.*) ;;
  857. X*) ans=".$ans";;
  858. Xesac
  859. Xmydomain="$ans"
  860. X
  861. X: a little sanity check here
  862. Xcase "$phostname" in
  863. X'') ;;
  864. X*)  case `$phostname` in
  865. X    $hostname$mydomain|$hostname) ;;
  866. X    *)
  867. X    case "$phostname" in
  868. X    sed*)
  869. X        echo "(That doesn't agree with your whoami.h file, by the way.)"
  870. X        ;;
  871. X    *)
  872. X        echo "(That doesn't agree with your $phostname command, by the way.)"
  873. X        ;;
  874. X    esac
  875. X    phostname=''
  876. X    ;;
  877. X    esac
  878. X    ;;
  879. Xesac
  880. X
  881. X: decide how portable to be
  882. Xcase "$d_portable" in
  883. X"$define") dflt=y;;
  884. X*)    dflt=n;;
  885. Xesac
  886. X$cat <<'EOH'
  887. XI can set things up so that your shell scripts and binaries are more portable,
  888. Xat what may be a noticable cost in performance.  In particular, if you
  889. Xask to be portable, the following happens:
  890. X
  891. X     1) shell scripts will rely on the PATH variable rather than using
  892. X    the paths derived above.
  893. X     2) ~username interpretations will be done at run time rather than
  894. X    by Configure.
  895. X     3) the system name will be determined at run time, if at all possible.
  896. X
  897. XEOH
  898. Xrp="Do you expect to run these scripts and binaries on multiple machines? [$dflt]"
  899. X$echo $n "$rp $c"
  900. X. myread
  901. Xcase "$ans" in
  902. X    y*) d_portable="$define"
  903. X    for file in $loclist; do
  904. X        eval $file=$file
  905. X    done
  906. X    ;;
  907. X    *)  d_portable="$undef" ;;
  908. Xesac
  909. X
  910. X: see if there is a whoami file
  911. Xecho " "
  912. Xif $test -r /usr/include/whoami.h ; then
  913. X    d_whoami="$define"
  914. X    echo "whoami.h found."
  915. Xelse
  916. X    d_whoami="$undef"
  917. Xfi
  918. X
  919. X: see how we will look up host name
  920. Xecho " "
  921. Xd_douname="$undef"
  922. Xd_gethname="$undef"
  923. Xif $test -z "$d_phostname"; then
  924. X    d_phostname="$undef"
  925. Xfi
  926. X
  927. Xif $contains '^gethostname$' libc.list >/dev/null 2>&1 ; then
  928. X    echo "gethostname() found."
  929. X    d_gethname="$define"
  930. X    ans=gethostname
  931. Xelif xenix; then
  932. X    if $test -n "$uname"; then
  933. X    u_name=`$uname -n`
  934. X    else
  935. X    u_name=
  936. X    fi
  937. X    if $test -n "$line"; then
  938. X    if $test -r /etc/systemid; then
  939. X        s_name=`$line < /etc/systemid`
  940. X    else
  941. X        s_name=
  942. X    fi
  943. X    else
  944. X    s_name=
  945. X    fi
  946. X    if $test -n "$u_name"; then
  947. X    if $test "$u_name" = "$s_name"; then
  948. X        cat <<EOM
  949. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  950. Xreturns the name compiled into the operating system via configure.
  951. XElm needs the UUCP name, and currently these two match.  However, they
  952. Xneed not match.  Be sure to always keep these two names in sync.
  953. XSince they match, Elm will not consider that the Xenix uname function
  954. Xis broken.  However, if you are not always able to make them
  955. Xmatch, answer the compile in hostname question Yes.
  956. XEOM
  957. X        if $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  958. X        echo "uname() found."
  959. X        d_douname="$define"
  960. X        ans=uname
  961. X        fi
  962. X    else
  963. X        cat <<EOM
  964. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  965. Xreturns the name compiled into the operating system via configure.
  966. XYour /etc/systemid file contains $s_name.
  967. XBut uname returns $u_name.
  968. XSince Elm needs the UUCP name, and currently these two do not match,
  969. XElm will assume Xenix uname() is broken.
  970. XEOM
  971. X    fi
  972. X    else
  973. X    cat <<EOM
  974. XOn Xenix, UUCP uses the name found in /etc/systemid, while uname()
  975. Xreturns the name compiled into the operating system via configure.
  976. XElm needs the UUCP name, and currently the compiled in name is undefined.
  977. XSince mail needs the UUCP name, and these two need not match, Elm will
  978. Xassume Xenix uname() is broken.
  979. XEOM
  980. X    fi
  981. Xelif $contains '^uname$' libc.list >/dev/null 2>&1 ; then
  982. X    echo "uname() found."
  983. X    d_douname="$define"
  984. X    ans=uname
  985. Xfi
  986. X
  987. Xcase "$d_douname$d_gethname" in
  988. X*define*)
  989. X    case "$d_host_comp" in
  990. X    "$define") dflt=y;;
  991. X    *)  dflt=n;;
  992. X    esac
  993. X    cat <<EOM
  994. XEvery now and then someone has a $ans() that lies about the hostname
  995. Xbut can't be fixed for political or economic reasons.  Would you like to
  996. XEOM
  997. X    rp="pretend $ans() isn't there and maybe compile in the hostname? [$dflt]"
  998. X    $echo $n "$rp $c"
  999. X    . myread
  1000. X    case "$ans" in
  1001. X    y*) d_douname="$undef"
  1002. X    d_gethname="$undef"
  1003. X    d_host_comp="$define"
  1004. X    $echo $n "Okay... $c"
  1005. X    ;;
  1006. X    *)
  1007. X    d_host_comp="$undef"
  1008. X    ;;
  1009. X    esac
  1010. X    ;;
  1011. Xesac
  1012. X
  1013. Xcase "$d_douname$d_gethname" in
  1014. X*define*) ;;
  1015. X*)
  1016. X    case "$phostname" in
  1017. X      '') ;;
  1018. X      *)
  1019. X    $cat <<EOT
  1020. XThere is no gethostname() or uname() on this system.  You have two
  1021. Xpossibilities at this point:
  1022. X
  1023. X1)  You can have your host name ($hostname) compiled into $package, which
  1024. X    lets $package start up faster, but makes your binaries non-portable, or
  1025. X2)  you can have $package use a
  1026. X    
  1027. X    popen("$phostname","r")
  1028. X
  1029. X    which will start slower but be more portable.
  1030. X
  1031. XOption 1 will give you the option of using whoami.h if you have one.  If you
  1032. Xwant option 2 but with a different command, you can edit config.sh at the
  1033. Xend of this shell script.
  1034. X
  1035. XEOT
  1036. X    case "$d_phostname" in
  1037. X    "$define") dflt=n;;
  1038. X    "$undef")  dflt=y;;
  1039. X    '')
  1040. X        case "$d_portable" in
  1041. X        "$define") dflt=n ;;
  1042. X        *)      dflt=y ;;
  1043. X        esac
  1044. X        ;;
  1045. X    esac
  1046. X    rp="Do you want your host name compiled in? [$dflt]"
  1047. X    $echo $n "$rp $c"
  1048. X    . myread
  1049. X    case "$ans" in
  1050. X      n*) d_phostname="$define"
  1051. X          d_host_comp="$undef"
  1052. X          ;;
  1053. X      *)  phostname=''
  1054. X          d_host_comp="$define"
  1055. X          d_phostname="$undef"
  1056. X          ;;
  1057. X    esac
  1058. X    ;;
  1059. X    esac
  1060. X    case "$phostname" in
  1061. X      '')
  1062. X    case "$d_whoami" in
  1063. X      "$define")
  1064. X        dflt=y
  1065. X        $cat <<EOM
  1066. XNo hostname function--you can either use the whoami.h file, which has this line:
  1067. X
  1068. X    `grep sysname /usr/include/whoami.h`
  1069. X
  1070. Xor you can have the name we came up with earlier ($hostname) hardwired in.
  1071. XEOM
  1072. X        rp="Use whoami.h to get hostname? [$dflt]"
  1073. X        $echo $n "$rp $c"
  1074. X        . myread
  1075. X        case "$ans" in
  1076. X        n*) d_whoami="$undef";;
  1077. X        esac
  1078. X        ;;
  1079. X      "$undef")
  1080. X        echo 'No hostname function and no whoami.h--hardwiring "'$hostname'".'
  1081. X        d_host_comp="$define"
  1082. X        d_phostname="$undef"
  1083. X        ;;
  1084. X    esac
  1085. X    ;;
  1086. X    esac
  1087. X    ;;
  1088. Xesac
  1089. X
  1090. X: see if flock exists
  1091. Xecho " "
  1092. Xif $contains flock libc.list >/dev/null 2>&1; then
  1093. X    echo 'flock() found.'
  1094. X    if $contains EWOULDBLOCK /usr/include/errno.h > /dev/null 2>&1; then
  1095. X    echo 'EWOULDBLOCK found, will use flock type mailbox locking'
  1096. X        d_flock="$define"
  1097. X    elif $contains EWOULDBLOCK /usr/include/sys/errno.h > /dev/null 2>&1; then
  1098. X    echo 'EWOULDBLOCK found, will use flock type mailbox locking'
  1099. X        d_flock="$define"
  1100. X    else
  1101. X    echo 'flock() not found--will use .lock type mailbox locking'
  1102. X    d_flock="$undef"
  1103. X    fi
  1104. Xelse
  1105. X    echo 'flock() not found--will use .lock type mailbox locking'
  1106. X    d_flock="$undef"
  1107. X    d_flockonly="$undef"
  1108. Xfi
  1109. X
  1110. Xif $test "$d_flock" = "$define"; then
  1111. X    case "$d_flockonly" in
  1112. X    "$define")    dflt=y;;
  1113. X    "$undef")    dflt=n;;
  1114. X    *)        dflt=n;;
  1115. X    esac
  1116. X    $cat <<EOM
  1117. XSome sites wish to use flock style locking only.  This allows Elm
  1118. Xto be installed without the setgid bit being set on some systems
  1119. Xthat would otherwise require it.
  1120. X
  1121. XNote: Be sure no other mail utility that needs to lock the mail spool
  1122. Xfile uses .lock type locking before using only flock style locking.
  1123. X
  1124. XEOM
  1125. X    rp="Would you like to use flock style mail spool locking only? [$dflt]"
  1126. X    $echo $n "$rp $c"
  1127. X    . myread
  1128. X    case "$ans" in
  1129. X    y*) d_flockonly="$define";;
  1130. X    *)  d_flockonly="$undef";;
  1131. X    esac
  1132. Xfi
  1133. X
  1134. Xif $test -d /usr/spool/locks ; then
  1135. X    lock_dir=/usr/spool/locks
  1136. Xelif $test -d /usr/spool/uucp ; then
  1137. X    lock_dir=/usr/spool/uucp
  1138. Xelif $test -d /var/spool/locks ; then
  1139. X    lock_dir=/var/spool/locks
  1140. Xelif $test -d /var/spool/uucp ; then
  1141. X    lock_dir=/var/spool/uucp
  1142. Xelse
  1143. X    lock_dir=/tmp
  1144. Xfi
  1145. Xecho " "
  1146. Xecho "Non mailbox locks will use the $lock_dir directory"
  1147. Xecho " "
  1148. X
  1149. X: see if getopt exists
  1150. Xset getopt d_getopt
  1151. Xeval $inlibc
  1152. X
  1153. X: determine pathnames of the domains and pathalias
  1154. Xcase "$pathalias" in
  1155. X'') dflt=`loc paths blurfl/dyick $pth /usr/lib/uucp`
  1156. X    if $test "$dflt" = blurfl/dyick; then
  1157. X    dflt=`loc nmail.paths /usr/lib/nmail.paths $pth /usr/lib/uucp`
  1158. X    fi
  1159. X    ;;
  1160. X*)  dflt="$pathalias";;
  1161. Xesac
  1162. Xcont=true
  1163. Xwhile $test "$cont" ; do
  1164. X    echo " "
  1165. X    echo "Give the full path name of the pathalias"
  1166. X    rp="data file? [$dflt]"
  1167. X    $echo $n "$rp $c"
  1168. X    . myread
  1169. X    pathalias="$ans"
  1170. X    if $test -f "$ans"; then
  1171. X    cont=''
  1172. X    else
  1173. X    if $test "$fastread" = yes; then
  1174. X        dflt=y
  1175. X    else
  1176. X        dflt=n
  1177. X    fi
  1178. X    echo "Pathalias data file $ans doesn't exist."
  1179. X    rp="Use that name anyway? [$dflt]"
  1180. X    $echo $n "$rp $c"
  1181. X    . myread
  1182. X    dflt=''
  1183. X    case "$ans" in
  1184. X    y*) cont='';;
  1185. X    esac
  1186. X    fi
  1187. Xdone
  1188. X
  1189. Xcase "$domains" in
  1190. X'') dflt=`loc domains /usr/lib/domains $pth /usr/lib/uucp`;;
  1191. X*)  dflt="$domains";;
  1192. Xesac
  1193. Xcont=true
  1194. Xwhile $test "$cont" ; do
  1195. X    echo " "
  1196. X    echo "Where does the uumail-style 'domains'"
  1197. X    rp="file live? [$dflt]"
  1198. X    $echo $n "$rp $c"
  1199. X    . myread
  1200. X    domains="$ans"
  1201. X    if $test -f "$ans"; then
  1202. X    cont=''
  1203. X    else
  1204. X    if $test "$fastread" = yes; then
  1205. X        dflt=y
  1206. X    else
  1207. X        dflt=n
  1208. X    fi
  1209. X    echo "Domains data file $ans doesn't exist."
  1210. X    rp="Use that name anyway? [$dflt]"
  1211. X    $echo $n "$rp $c"
  1212. X    . myread
  1213. X    dflt=''
  1214. X    case "$ans" in
  1215. X    y*) cont='';;
  1216. X    esac
  1217. X    fi
  1218. Xdone
  1219. X: is pathalias available as a dbm file
  1220. Xd_havedbm="$undef"
  1221. Xdbm=''
  1222. X
  1223. Xif $test -f "$pathalias.pag" -a -f "$pathalias.dir"; then
  1224. X    ans=`loc libdbm.a x $libpth`
  1225. X    if $test "$ans" = x; then
  1226. X    ans=`loc Slibdbm.a x $libpth`
  1227. X    fi
  1228. X    if $test "$ans" = x; then
  1229. X    dflt=y
  1230. X    echo " "
  1231. X    rp="You have pathalias as a DBM file, but I cannot find the
  1232. XDBM library.  Do you have dbm? [$dflt]"
  1233. X    $echo $n "$rp $c"
  1234. X    . myread
  1235. X    case "$ans" in
  1236. X        y*|t*) d_havedbm="$define"
  1237. X        echo " "
  1238. X        echo "Then where are the dbm routines kept (specify either -llibname"
  1239. X        $echo $n " or full pathname (~name ok))? $c"
  1240. X        rp='Specify dbm library:'
  1241. X        . myread
  1242. X        dbm=`filexp $ans`
  1243. X        ;;
  1244. X        *)    d_havedbm="$undef"
  1245. X        dbm=''
  1246. X        echo "I will use the non dbm access methods then."
  1247. X        ;;
  1248. X    esac
  1249. X    else
  1250. X    echo " "
  1251. X    echo "You have pathalias as a DBM file...I'll use that instead."
  1252. X    dbm=-ldbm
  1253. X    d_havedbm="$define"
  1254. X    fi
  1255. Xfi
  1256. X
  1257. X: see if strings.h is in /usr/include or /usr/include/sys
  1258. Xecho " "
  1259. Xstrings=`loc string.h "" /usr/include $includepath`
  1260. Xif $test -z "$strings"; then
  1261. X    strings=`loc strings.h "" /usr/include $includepath`
  1262. Xfi
  1263. Xwhile $test -z "$strings"; do
  1264. X    echo " "
  1265. X    dflt=''
  1266. X    rp="What is the full path name of the include file directory? []"
  1267. X    $echo $n "$rp $c"
  1268. X    . myread
  1269. X    includepath=`filexp $ans`
  1270. X    if $test -d "$includepath"; then
  1271. X        strings=`loc string.h "" /usr/include $includepath`
  1272. X        if $test -z "$strings"; then
  1273. X            strings=`loc strings.h "" /usr/include $includepath`
  1274. X        fi
  1275. X        if $test -z "$strings"; then
  1276. X            $cat <<EOM
  1277. X
  1278. XInclude file string.h or strings.h not found in $includepath.
  1279. XElm requires string.h on USG type systems or strings.h on BSD type
  1280. Xsystems.  Please specify the directory where one of these files can
  1281. Xbe found.
  1282. XEOM
  1283. X        fi
  1284. X    else
  1285. X        echo "Directory $includepath not found"
  1286. X    fi
  1287. Xdone
  1288. X
  1289. Xstrings_f=`$expr "$strings" : ".*/\(.*\)"`
  1290. Xif $test "$strings_f" = "string.h"; then
  1291. X    d_strings="$undef"
  1292. X    echo Using string.h instead of strings.h
  1293. Xelse
  1294. X    d_strings="$define"
  1295. X    echo Using strings.h instead of string.h
  1296. Xfi
  1297. Xpwdinsys=`loc pwd.h "" /usr/include $includepath`
  1298. Xif $test -z "$pwdinsys"; then
  1299. X    d_pwdinsys="$define"
  1300. Xelse
  1301. X    d_pwdinsys="$undef"
  1302. Xfi
  1303. X
  1304. X: index or strcpy
  1305. Xecho " "
  1306. Xcase "$d_index" in
  1307. Xn) dflt=n;;
  1308. X*) dflt=y;;
  1309. Xesac
  1310. Xif $contains '^index$' libc.list >/dev/null 2>&1 ; then
  1311. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  1312. X    if $contains strchr "$strings" >/dev/null 2>&1 ; then
  1313. X        if $contains index "$strings" >/dev/null 2>&1 ; then
  1314. X#            has index, strchr, and index and strchr in strings.h
  1315. X        echo "Your system has both index() and strchr().  Shall I use"
  1316. X        rp="index() rather than strchr()? [$dflt]"
  1317. X        $echo $n "$rp $c"
  1318. X        . myread
  1319. X        case "$ans" in
  1320. X            n*) d_index="$define" ;;
  1321. X            *)  d_index="$undef" ;;
  1322. X        esac
  1323. X        else
  1324. X#            has index, strchr, and strchr in strings.h
  1325. X        d_index="$define"
  1326. X            echo "strchr() found."
  1327. X        fi
  1328. X    else
  1329. X#            has index, strchr, and no strchr in strings.h
  1330. X        d_index="$undef"
  1331. X        echo "index() found."
  1332. X    fi
  1333. X    else
  1334. X#            has only index, no strchr, strings.h is a moot point
  1335. X    d_index="$undef"
  1336. X    echo "index() found."
  1337. X    fi
  1338. Xelse
  1339. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  1340. X    d_index="$define"
  1341. X    echo "strchr() found."
  1342. X    else
  1343. X    echo "No index() or strchr() found!"
  1344. X    d_index="$undef"
  1345. X    fi
  1346. Xfi
  1347. X
  1348. X: determine mail delivery agent for Elm to use
  1349. Xcase "$mailer" in
  1350. X'')
  1351. X    if $test -f "$sendmail"; then
  1352. X    dflt="$sendmail"
  1353. X    elif $test -f "$rmail"; then
  1354. X    dflt="$rmail"
  1355. X    elif $test -f /bin/mail; then
  1356. X    dflt=/bin/mail
  1357. X    else
  1358. X    dflt=$mail
  1359. X    fi
  1360. X    ;;
  1361. X*)  dflt="$mailer";;
  1362. Xesac
  1363. Xcont=true
  1364. Xwhile $test "$cont" ; do
  1365. X    echo " "
  1366. X    echo "Give the full path name of the program used to deliver mail on your"
  1367. X    $echo $n "system: [$dflt] $c"
  1368. X    rp="Preferred mail delivery agent: [$dflt]"
  1369. X    . myread
  1370. X    mailer="$ans"
  1371. X    if $test -f "$ans"; then
  1372. X    cont=''
  1373. X    else
  1374. X    if $test "$fastread" = yes; then
  1375. X        dflt=y
  1376. X    else
  1377. X        dflt=n
  1378. X    fi
  1379. X    echo "Mail delivery agent $ans doesn't exist."
  1380. X    rp="Use that name anyway? [$dflt]"
  1381. X    $echo $n "$rp $c"
  1382. X    . myread
  1383. X    dflt=''
  1384. X    case "$ans" in
  1385. X    y*) cont='';;
  1386. X    esac
  1387. X    fi
  1388. Xdone
  1389. Xif $test "$mailer" != "$sendmail"; then
  1390. X    sendmail=''
  1391. Xfi
  1392. X
  1393. X: check for internet mailer
  1394. Xcase "$d_internet" in
  1395. X"$define")    dflt=y;;
  1396. X"$undef")    dflt=n;;
  1397. X*)    if $test -f "$sendmail"; then
  1398. X        dflt=y
  1399. X    elif $test -f "$smail"; then
  1400. X        dflt=y
  1401. X    else
  1402. X        dflt=n
  1403. X    fi
  1404. X    ;;
  1405. Xesac
  1406. X$cat <<EOM
  1407. XSome newer mailers can deliver mail to addresses of the INTERNET persuasion,
  1408. Xsuch as user@host.UUCP.  Other older mailers require the complete path to
  1409. Xthe destination to be specified in the address.  Does your mailer understand
  1410. XEOM
  1411. X$echo $n "INTERNET addresses? [$dflt] $c"
  1412. Xrp="Does your mailer understand INTERNET addresses? [$dflt]"
  1413. X. myread
  1414. Xcase "$ans" in
  1415. Xy*) d_internet="$define";;
  1416. X*)  d_internet="$undef";;
  1417. Xesac
  1418. X
  1419. Xcase "$d_mboxedit" in
  1420. X"$define") dflt=y;;
  1421. X"$undef")  dflt=n;;
  1422. X*)    dflt=n;;
  1423. Xesac
  1424. X$cat <<EOM
  1425. XA lot of sites that install the Elm Mail System find that the function
  1426. XE)dit mailbox from within Elm is dangerous and confusing.  If you choose,
  1427. Xyou can instead disable that function, with the program being slightly
  1428. Xsmaller and presenting an appropriate error message to the user if they
  1429. Xtry to E)dit their mailbox.
  1430. X
  1431. XEOM
  1432. Xrp="Would you like to enable the E)dit Mailbox function? [$dflt]"
  1433. X$echo $n "$rp $c"
  1434. X. myread
  1435. Xcase "$ans" in
  1436. Xy*) d_mboxedit="$define";;
  1437. X*)  d_mboxedit="$undef";;
  1438. Xesac
  1439. X
  1440. X: see if mkdir exists
  1441. Xset mkdir d_mkdir
  1442. Xeval $inlibc
  1443. X
  1444. Xcase "$d_mmdf" in
  1445. X"$define") dflt=y;;
  1446. X"$undef")  dflt=n;;
  1447. X*)    dflt=n;;
  1448. Xesac
  1449. X$cat <<EOM
  1450. XSome systems run MMDF as their Mail Transport Agent.  MMDF uses
  1451. Xa different way of delimiting messages in the mailbox files.
  1452. XUsually this is a series of four Control A's.  $package needs to know
  1453. Xif this system uses MMDF.
  1454. X
  1455. XEOM
  1456. Xrp="Does this system use MMDF as its MTA? [$dflt]"
  1457. X$echo $n "$rp $c"
  1458. X. myread
  1459. Xcase "$ans" in
  1460. Xy*) d_mmdf="$define";;
  1461. X*)  d_mmdf="$undef";;
  1462. Xesac
  1463. X
  1464. X: ask about newmail running in the background automatically
  1465. Xcase "$d_newauto" in
  1466. X"$define")    dflt=y;;
  1467. X"$undef")    dflt=n;;
  1468. X*)        dflt=y;;
  1469. Xesac
  1470. Xecho " "
  1471. Xrp="Should newmail automatically run in the background? [$dflt]"
  1472. X$echo $n "$rp $c"
  1473. X. myread
  1474. Xcase "$ans" in
  1475. Xy*) d_newauto="$define";;
  1476. X*)  d_newauto="$undef";;
  1477. Xesac
  1478. X
  1479. Xcase "$d_notouchadd" in
  1480. X"$define") dflt=n;;
  1481. X"$undef")  dflt=y;;
  1482. X*)       dflt=y;;
  1483. Xesac
  1484. X$cat <<EOM
  1485. X
  1486. XSome sites are configured so that the low level transport mechanism
  1487. Xis supposed to resolve and rewrite uucp paths, unreachable
  1488. Xdomains/networks, and so on.  If your site running either "smail",
  1489. Xa "gateway" configuration of sendmail, or some similar software
  1490. Xthen the low level transport mechanism will resolve the uucp
  1491. Xpaths.  In this case it is not necessary to have Elm resolve
  1492. Xthe paths on outbound mail addresses.
  1493. X
  1494. XEOM
  1495. Xecho " "
  1496. Xrp="Should Elm resolve outbound addresses? [$dflt]"
  1497. X$echo $n "$rp $c"
  1498. X. myread
  1499. Xcase "$ans" in
  1500. Xy*) d_notouchadd="$undef";;
  1501. X*)  d_notouchadd="$define";;
  1502. Xesac
  1503. X
  1504. Xcase "$d_pafirst" in
  1505. X"$define") dflt=y;;
  1506. X"$undef")  dflt=n;;
  1507. X*)       dflt=n;;
  1508. Xesac
  1509. Xif $test "$d_notouchadd" = "$undef"; then
  1510. X    $cat <<EOM
  1511. X
  1512. XWhen given a machine that you talk to directly, should the 'pathalias'
  1513. Xroute to the machine be used instead?"
  1514. XEOM
  1515. X    echo " "
  1516. X    rp="Would you like to use pathalias route instead? [$dflt]"
  1517. X    $echo $n "$rp $c"
  1518. X    . myread
  1519. X    case "$ans" in
  1520. X    y*) d_pafirst="$define";;
  1521. X    *)  d_pafirst="$undef";;
  1522. X    esac
  1523. Xelse
  1524. X    d_pafirst="$undef"
  1525. Xfi
  1526. X
  1527. Xif $test -f "$sendmail"; then
  1528. X    echo "You're running sendmail.  Setting noaddfrom, nocheckvalid, usedomain"
  1529. X    d_noaddfrom="$define"
  1530. X    d_nocheckvalid="$define"
  1531. X    d_usedomain="$undef"
  1532. Xelse
  1533. X    case "$d_nocheckvalid" in
  1534. X    "$define") dflt=n;;
  1535. X    "$undef")  dflt=y;;
  1536. X    *)       dflt=y;;
  1537. X    esac
  1538. X
  1539. X    $cat << EOM
  1540. X
  1541. XSince you're not running sendmail, should I check local user entered
  1542. Xaddresses against the valid mailboxes on this system?
  1543. XEOM
  1544. X
  1545. X    echo " "
  1546. X    rp="Would you like to check local addresses? [$dflt]"
  1547. X    $echo $n "$rp $c"
  1548. X    . myread
  1549. X    case "$ans" in
  1550. X    y*) d_nocheckvalid="$undef";;
  1551. X    *)  d_nocheckvalid="$define";;
  1552. X    esac
  1553. X
  1554. X    if $test "$d_internet" = "$define"; then
  1555. X        case "$d_usedomain" in
  1556. X        "$define") dflt=y;;
  1557. X        "$undef")  dflt=n;;
  1558. X        *)       dflt=y;;
  1559. X        esac
  1560. X
  1561. X        $cat <<EOM
  1562. X
  1563. XAre you running a machine where you want to have a domain name appended
  1564. Xto the hostname on outbound mail?
  1565. XEOM
  1566. X        echo " "
  1567. X        rp="Would you like the domain name appended? [$dflt]"
  1568. X        $echo $n "$rp $c"
  1569. X        . myread
  1570. X        case "$ans" in
  1571. X        y*) d_usedomain="$define";;
  1572. X        *)  d_usedomain="$undef";;
  1573. X        esac
  1574. X    else
  1575. X        d_usedomain="$undef"
  1576. X        $cat <<EOM
  1577. X
  1578. XSince your mailer does not understand internet addresses, undefining
  1579. Xusedomain, your domain name will not be appended to the hostname on
  1580. Xoutbound mail.
  1581. X
  1582. XEOM
  1583. X    fi
  1584. X
  1585. X    case "$d_noaddfrom" in
  1586. X    "$define") dflt=y;;
  1587. X    "$undef")  dflt=n;;
  1588. X    *)       dflt=n;;
  1589. X    esac
  1590. X    echo " "
  1591. X    rp="Does your mailer add the From: header for you? [$dflt]"
  1592. X    $echo $n "$rp $c"
  1593. X    . myread
  1594. X    case "$ans" in
  1595. X    y*) d_noaddfrom="$define";;
  1596. X    *)  d_noaddfrom="$undef";;
  1597. X    esac
  1598. Xfi
  1599. X
  1600. X: ask about optimizing return addresses
  1601. Xcase "$d_optreturn" in
  1602. X"$define")    dflt=y;;
  1603. X"$undef")    dflt=n;;
  1604. X*)        dflt=n;;
  1605. Xesac
  1606. Xecho " "
  1607. Xecho "Should I optimize the return address when you"
  1608. Xrp="'alias current message'? [$dflt]"
  1609. X$echo $n "$rp $c"
  1610. X. myread
  1611. Xcase "$ans" in
  1612. Xy*) d_optreturn="$define";;
  1613. X*)  d_optreturn="$undef";;
  1614. Xesac
  1615. X
  1616. X: check for "kill(pid, 0)"
  1617. Xecho " "
  1618. Xcase "$d_pidcheck" in
  1619. X"$define")    ;;
  1620. X"$undef")    ;;
  1621. X*)
  1622. X        echo "Checking to see if kill(pid, 0) works..."
  1623. X        $cat >try.c <<'EOCP'
  1624. Xmain()
  1625. X    {
  1626. X    int    pid, status0, status9;
  1627. X
  1628. X    if ((pid = fork()) == 0)
  1629. X        {
  1630. X        sleep(30);
  1631. X        exit(1);
  1632. X        }
  1633. X    status0 = kill(pid, 0);
  1634. X    status9 = kill(pid, 9);
  1635. X    exit(status0 == status9);
  1636. X    }
  1637. XEOCP
  1638. X        if $cc try.c -o try >/dev/null 2>&1 ; then
  1639. X        if try >/dev/null 2>&1 ; then
  1640. X            echo "Your system does not support kill(pid, 0)..."
  1641. X            d_pidcheck="$undef"
  1642. X        else
  1643. X            d_pidcheck="$define"
  1644. X            echo "Your system supports kill(pid, 0)..."
  1645. X        fi
  1646. X        else
  1647. X        echo "Your system does not support kill(pid, 0)..."
  1648. X        d_pidcheck="$undef"
  1649. X        fi
  1650. X        $rm -f try.c try.o try
  1651. X    ;;
  1652. Xesac
  1653. X
  1654. X: see if /usr/include/sys/ptem.h exists, making it a possible System V/386
  1655. Xd_ptem="$undef"
  1656. Xif usg ; then
  1657. X    echo " "
  1658. X    echo "Checking to see if your system has sys/ptem.h..."
  1659. X    if $test -f /usr/include/sys/ptem.h ; then
  1660. X        echo "Yep, it does..."
  1661. X        if "$contains" "struct winsize" /usr/include/sys/ptem.h >/dev/null 2>&1 ; then
  1662. X        d_ptem="$define"
  1663. X        echo "  and it has the needed structure."
  1664. X    fi
  1665. X    fi
  1666. Xfi
  1667. X
  1668. X: get remove at last flag and number of lock attempts
  1669. X$cat <<EOM
  1670. X
  1671. XThe next pair of questions have to do with what to do when another
  1672. Xprogram has locked a mailbox...
  1673. X
  1674. XFirst, how many times should the Elm check for the removal of the lock
  1675. Xfile before giving up?
  1676. XEOM
  1677. X
  1678. Xcase "$maxattempts" in
  1679. X    '') dflt=6;;
  1680. X    *)  dflt=$maxattempts;;
  1681. Xesac
  1682. Xcont=true
  1683. Xwhile $test "$cont" ; do
  1684. X    echo " "
  1685. X    rp="Number of lock attempts: [$dflt]"
  1686. X    $echo $n "$rp $c"
  1687. X    . myread
  1688. X    maxattempts="$ans"
  1689. X    if $test "$maxattempts" -lt 3 -o "$maxattempts" -gt 10 ; then
  1690. X    echo "The recommended range is 3-10"
  1691. X    odflt=$dflt
  1692. X    dflt=n
  1693. X    rp="Should I use your answer of $maxattempts lock attempts anyway? [$dflt]"
  1694. X    $echo $n "$rp $c"
  1695. X    . myread
  1696. X    dflt=$odflt
  1697. X    case "$ans" in
  1698. X    y*) cont='';;
  1699. X    esac
  1700. X    else
  1701. X    cont=''
  1702. X    fi
  1703. Xdone
  1704. X
  1705. Xcase "$d_remlock" in
  1706. X"$define") dflt=y;;
  1707. X"$undef")  dflt=n;;
  1708. X*)       dflt=n;;
  1709. Xesac
  1710. Xecho " "
  1711. Xrp="Should it REMOVE the lockfile after $maxattempts checks? [$dflt]"
  1712. X$echo $n "$rp $c"
  1713. X. myread
  1714. Xcase "$ans" in
  1715. Xy*) d_remlock="$define";;
  1716. X*)  d_remlock="$undef";;
  1717. Xesac
  1718. X
  1719. X: see if rename exists
  1720. Xset rename d_rename
  1721. Xeval $inlibc
  1722. X
  1723. X: ask about setgid running of Elm
  1724. Xcase "$d_setgid" in
  1725. X"$define")    dflt=y;;
  1726. X"$undef")    dflt=n;;
  1727. X*)        dflt=y;;
  1728. Xesac
  1729. Xecho " "
  1730. Xrp="Am I going to be running as a setgid program? [$dflt]"
  1731. X$echo $n "$rp $c"
  1732. X. myread
  1733. Xcase "$ans" in
  1734. Xy*) d_setgid="$define";;
  1735. X*)  d_setgid="$undef";;
  1736. Xesac
  1737. Xcase "$d_setgid" in
  1738. X"$define")    mailermode=2755;;
  1739. X*)        mailermode=755;;
  1740. Xesac
  1741. X
  1742. X: see if sigvector exists -- since sigvec will match the substring
  1743. Xecho " "
  1744. Xif $contains sigvector libc.list >/dev/null 2>&1; then
  1745. X    echo 'sigvector() found--you must be running HP-UX.'
  1746. X    d_sigvectr="$define"
  1747. X    d_sigvec="$define"
  1748. Xelse
  1749. X: try the original name
  1750. X    d_sigvectr="$undef"
  1751. X    if $contains sigvec libc.list >/dev/null 2>&1; then
  1752. X    echo 'sigvec() found.'
  1753. X    d_sigvec="$define"
  1754. X    else
  1755. X    echo 'sigvec() not found--race conditions with signals may occur.'
  1756. X    d_sigvec="$undef"
  1757. X    fi
  1758. Xfi
  1759. X
  1760. X: see if strspn exists
  1761. Xecho " "
  1762. Xif $contains strspn libc.list >/dev/null 2>&1; then
  1763. X    echo 'strspn() found.'
  1764. X    d_strspn="$define"
  1765. Xelse
  1766. X    echo 'strspn() not found--will use our strspn instead.'
  1767. X    d_strspn="$undef"
  1768. Xfi
  1769. X
  1770. X: see if strcspn exists
  1771. Xecho " "
  1772. Xif $contains strcspn libc.list >/dev/null 2>&1; then
  1773. X    echo 'strcspn() found.'
  1774. X    d_strcspn="$define"
  1775. Xelse
  1776. X    echo 'strcspn() not found--will use our strcspn instead.'
  1777. X    d_strcspn="$undef"
  1778. Xfi
  1779. X
  1780. Xcase "$d_subshell" in
  1781. X"$define") dflt=y;;
  1782. X"$undef")  dflt=n;;
  1783. X*)    dflt=y;;
  1784. Xesac
  1785. X$cat <<EOM
  1786. XSome sites wish to disable the usage of the shell escape from Elm.
  1787. XIf you choose, you can not allow subshells from withing Elm.
  1788. X
  1789. XNote: This only controls Elms usage of the ! command.  Any pager or
  1790. Xeditor could still allow subshells.
  1791. X
  1792. XEOM
  1793. Xrp="Would you like to allow the ! command (subshells)? [$dflt]"
  1794. X$echo $n "$rp $c"
  1795. X. myread
  1796. Xcase "$ans" in
  1797. Xy*) d_subshell="$define";;
  1798. X*)  d_subshell="$undef";;
  1799. Xesac
  1800. X
  1801. X: see if tempnam exists
  1802. Xecho " "
  1803. Xif $contains tempnam libc.list >/dev/null 2>&1; then
  1804. X    echo 'tempnam() found.'
  1805. X    d_tempnam="$define"
  1806. Xelse
  1807. X    echo 'tempnam() not found--will use our tempnam instead.'
  1808. X    d_tempnam="$undef"
  1809. Xfi
  1810. X
  1811. X: see how we invoke the C preprocessor
  1812. Xecho " "
  1813. Xecho "Now, how can we feed standard input to your C preprocessor..."
  1814. Xcat <<'EOT' >testcpp.c
  1815. X#define ABC abc
  1816. X#define XYZ xyz
  1817. XABC.XYZ
  1818. XEOT
  1819. Xecho 'Maybe "'"$cc"' -E" will work...'
  1820. X$cc -E <testcpp.c >testcpp.out 2>&1
  1821. X: try to force gcc preprocessor if that is the compiler they are using
  1822. Xcase $? in
  1823. X0) cppstdin="$cc -E";;
  1824. X*) case "$cc" in
  1825. X    *gcc*)
  1826. X    cd ..
  1827. X    echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  1828. X    echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  1829. X    chmod 755 cppstdin
  1830. X    cppstdin=`pwd`/cppstdin
  1831. X    cppminus='';
  1832. X    cd UU
  1833. X    $cppstdin <testcpp.c >testcpp.out 2>&1
  1834. X    ;;
  1835. X    esac
  1836. X    ;;
  1837. Xesac
  1838. Xif $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1839. X    echo "Yup, it does."
  1840. X    cppstdin="$cc -E"
  1841. X    cppminus='';
  1842. Xelse
  1843. X    echo 'Nope, maybe "'$cpp'" will work...'
  1844. X    $cpp <testcpp.c >testcpp.out 2>&1
  1845. X    if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1846. X    echo "Yup, it does."
  1847. X    cppstdin="$cpp"
  1848. X    cppminus='';
  1849. X    else
  1850. X    echo 'No such luck...maybe "'$cpp' -" will work...'
  1851. X    $cpp - <testcpp.c >testcpp.out 2>&1
  1852. X    if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1853. X        echo "It works!"
  1854. X        cppstdin="$cpp"
  1855. X        cppminus='-';
  1856. X    else
  1857. X        echo 'Nixed again...maybe "'"$cc"' -E -" will work...'
  1858. X        $cc -E - <testcpp.c >testcpp.out 2>&1
  1859. X        if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1860. X        echo "Hooray, it works!  I was beginning to wonder."
  1861. X        cppstdin="$cc -E"
  1862. X        cppminus='-';
  1863. X        else
  1864. X        echo 'Nope...maybe "'"$cc"' -P" will work...'
  1865. X        $cc -P <testcpp.c >testcpp.out 2>&1
  1866. X        if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1867. X            echo "Yup, that does."
  1868. X            cppstdin="$cc -P"
  1869. X            cppminus='';
  1870. X        else
  1871. X            echo 'Nope...maybe "'"$cc"' -P -" will work...'
  1872. X            $cc -P - <testcpp.c >testcpp.out 2>&1
  1873. X            if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1874. X            echo "Yup, that does."
  1875. X            cppstdin="$cc -P"
  1876. X            cppminus='-';
  1877. X            else
  1878. X            echo 'Hmm...perhaps you already told me...'
  1879. X            case "$cppstdin" in
  1880. X            '') ;;
  1881. X            *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  1882. X            esac
  1883. X            if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1884. X                echo "Hooray, you did!  I was beginning to wonder."
  1885. X            else
  1886. X                echo 'Uh-uh.  Time to get fancy...'
  1887. X                cd ..
  1888. X                echo 'Trying (cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c)'
  1889. X                echo 'cat >/tmp/$$.c; '"$cc"' -E /tmp/$$.c; rm /tmp/$$.c' >cppstdin
  1890. X                chmod 755 cppstdin
  1891. X                cppstdin=`pwd`/cppstdin
  1892. X                cppminus='';
  1893. X                cd UU
  1894. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  1895. X                if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1896. X                echo "Eureka!."
  1897. X                else
  1898. X                dflt=blurfl
  1899. X                $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  1900. X                rp='Name a C preprocessor:'
  1901. X                . myread
  1902. X                cppstdin="$ans"
  1903. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  1904. X                if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  1905. X                    echo "OK, that will do."
  1906. X                else
  1907. X                    echo "Sorry, I can't get that to work.  Go find one."
  1908. X                    exit 1
  1909. X                fi
  1910. X                fi
  1911. X            fi
  1912. X            fi
  1913. X        fi
  1914. X        fi
  1915. X    fi
  1916. X    fi
  1917. Xfi
  1918. Xrm -f testcpp.c testcpp.out
  1919. X
  1920. X: get C preprocessor symbols handy
  1921. Xecho " "
  1922. Xecho $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
  1923. X$cat <<EOSS >Cppsym
  1924. X$startsh
  1925. Xcase "\$1" in
  1926. X-l) list=true
  1927. X    shift
  1928. X    ;;
  1929. Xesac
  1930. Xunknown=''
  1931. Xcase "\$list\$#" in
  1932. X1|2)
  1933. X    for sym do
  1934. X    if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  1935. X        exit 0
  1936. X    elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  1937. X        :
  1938. X    else
  1939. X        unknown="\$unknown \$sym"
  1940. X    fi
  1941. X    done
  1942. X    set X \$unknown
  1943. X    shift
  1944. X    ;;
  1945. Xesac
  1946. Xcase \$# in
  1947. X0) exit 1;;
  1948. Xesac
  1949. Xecho \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
  1950. X#ifdef \1\\
  1951. Xexit 0; _ _ _ _\1\\     \1\\
  1952. X#endif\\
  1953. X/' >/tmp/Cppsym\$\$
  1954. Xecho exit 1 >>/tmp/Cppsym\$\$
  1955. X$cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  1956. Xcase "\$list" in
  1957. Xtrue) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  1958. X*)
  1959. X    sh /tmp/Cppsym2\$\$
  1960. X    status=\$?
  1961. X    ;;
  1962. Xesac
  1963. X$rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  1964. Xexit \$status
  1965. XEOSS
  1966. Xchmod +x Cppsym
  1967. X$eunicefix Cppsym
  1968. Xecho "Your C preprocessor defines the following symbols:"
  1969. XCppsym -l $attrlist >Cppsym.true
  1970. Xcat Cppsym.true
  1971. Xrmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  1972. X
  1973. X: see if this is a termio system
  1974. X: Prefer POSIX-approved termios.h over all else.
  1975. X:
  1976. Xecho " "
  1977. Xd_termios="$undef"
  1978. Xd_termio="$undef"
  1979. Xif $test -r /usr/include/termios.h ; then
  1980. X    set tcsetattr d_termios
  1981. X    eval $inlibc
  1982. Xfi
  1983. Xif $test "$d_termios" = "$define" ; then
  1984. X    echo "You have POSIX termios.h... good!"
  1985. Xelif Cppsym pyr ; then
  1986. X    if $test "`/bin/universe`" = "ucb" ; then
  1987. X    if $test -r /usr/include/sgtty.h ; then
  1988. X        echo "sgtty.h found."
  1989. X    else
  1990. X        echo "System is a pyramid, and universe is bsd,"
  1991. X        echo "sgtty.h not found--you could have problems."
  1992. X    fi
  1993. X    else
  1994. X    if $test -r /usr/include/termio.h ; then
  1995. X        d_termio="$define"
  1996. X        echo "termio.h found."
  1997. X    else
  1998. X        echo "System is a pyramid, and universe is att,"
  1999. X        echo "termio.h not found--you could have problems."
  2000. X    fi
  2001. X    fi
  2002. Xelif bsd ; then
  2003. X    if $test -r /usr/include/sgtty.h ; then
  2004. X    echo "sgtty.h found."
  2005. X    elif $test -r /usr/include/termio.h ; then
  2006. X    d_termio="$define"
  2007. X    echo "termio.h found."
  2008. X    else
  2009. X    echo "Neither termio.h nor sgtty.h found--you could have problems."
  2010. SHAR_EOF
  2011. echo "End of part 2"
  2012. echo "File Configure is continued in part 3"
  2013. echo "3" > s2_seq_.tmp
  2014. exit 0
  2015. exit 0 # Just in case...
  2016.