home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / unix / volume27 / mthreads / part04 < prev    next >
Encoding:
Text File  |  1993-11-20  |  69.7 KB  |  3,062 lines

  1. Newsgroups: comp.sources.unix
  2. From: davison@borland.com (Wayne Davison)
  3. Subject: v27i093: mthreads - netnews database generator/manager, V3.1, Part04/04
  4. References: <1.753873779.13611@gw.home.vix.com>
  5. Sender: unix-sources-moderator@gw.home.vix.com
  6. Approved: vixie@gw.home.vix.com
  7.  
  8. Submitted-By: davison@borland.com (Wayne Davison)
  9. Posting-Number: Volume 27, Issue 93
  10. Archive-Name: mthreads/part04
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 4 (of 4)."
  19. # Contents:  Configure
  20. # Wrapped by vixie@gw.home.vix.com on Sun Nov 21 01:12:02 1993
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'Configure' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'Configure'\"
  24. else
  25. echo shar: Extracting \"'Configure'\" \(66634 characters\)
  26. sed "s/^X//" >'Configure' <<'END_OF_FILE'
  27. X#! /bin/sh
  28. X#
  29. X# If these # comments don't work, trim them.  Don't worry about any other
  30. X# shell scripts, Configure will trim # comments from them for you.
  31. X#
  32. X# (If you are trying to port this package to a machine without sh,
  33. X# I would suggest you have a look at the prototypical config.h.SH file
  34. X# and edit it to reflect your system. Some packages may include samples
  35. X# of config.h for certain machines, so you might look for one of those.)
  36. X#
  37. X# Yes, you may rip this off to use in other distribution packages. This
  38. X# script belongs to the public domain and cannot be copyrighted.
  39. X#
  40. X# (Note: this Configure script was generated automatically. Rather than
  41. X# working with this copy of Configure, you may wish to get metaconfig.
  42. X# The dist-3.0 package (which contains metaconfig) was posted in
  43. X# comp.sources.misc so you may fetch it yourself from your nearest
  44. X# archive site. Check with Archie if you don't know where that can be.)
  45. X#
  46. X
  47. X# $Id: Head.U,v 3.0.1.1 1993/08/27 14:38:07 ram Exp $
  48. X#
  49. X# Generated on Fri Sep 24 11:09:28 PDT 1993 [metaconfig 3.0 PL9]
  50. X
  51. Xcat >/tmp/c1$$ <<EOF
  52. XARGGGHHHH!!!!!
  53. X
  54. XSCO csh still thinks true is false.  Write to SCO today and tell them that next
  55. Xyear Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
  56. X
  57. X(Actually, Configure ought to just patch csh in place.  Hmm.  Hmmmmm.  All
  58. Xwe'd have to do is go in and swap the && and || tokens, wherever they are.)
  59. X
  60. X[End of diatribe. We now return you to your regularly scheduled programming...]
  61. XEOF
  62. Xcat >/tmp/c2$$ <<EOF
  63. X
  64. XOOPS!  You naughty creature!  You didn't run Configure with sh!
  65. XI will attempt to remedy the situation by running sh for you...
  66. XEOF
  67. X
  68. Xtrue || cat /tmp/c1$$ /tmp/c2$$
  69. Xtrue || exec sh $0 $argv:q
  70. X
  71. X(exit $?0) || cat /tmp/c2$$
  72. X(exit $?0) || exec sh $0 $argv:q
  73. Xrm -f /tmp/c1$$ /tmp/c2$$
  74. X
  75. X: Sanity checks
  76. XPATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin"
  77. XPATH=$PATH:'/usr/5bin:/etc:/usr/gnu/bin:/usr/new:/usr/new/bin:/usr/nbin'
  78. XPATH=$PATH:'/sys5.3/bin:/sys5.3/usr/bin:/bsd4.3/bin:/bsd4.3/usr/ucb'
  79. XPATH=$PATH:'/bsd4.3/usr/bin:/usr/bsd:/bsd43/bin:/usr/ccs/bin'
  80. XPATH=$PATH:'/etc:/usr/lib:/usr/ucblib:/lib:/usr/ccs/lib'
  81. Xexport PATH
  82. X
  83. Xif test ! -t 0; then
  84. X    echo "Say 'sh Configure', not 'sh <Configure'"
  85. X    exit 1
  86. Xfi
  87. X
  88. X: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
  89. Xif test -f /hp-ux -a -f /bin/ksh; then
  90. X    if (alias -x) >/dev/null 2>&1; then
  91. X        : already under /bin/ksh
  92. X    else
  93. X        cat <<'EOM'
  94. X(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
  95. XEOM
  96. X        exec /bin/ksh $0 "$@"
  97. X    fi
  98. Xelse
  99. X    : Warn them if they use ksh on other systems
  100. X    (alias -x) >/dev/null 2>&1 && \
  101. X        cat <<'EOM'
  102. X(I see you are using the Korn shell.  Some ksh's blow up on Configure,
  103. Xespecially on exotic machines.  If yours does, try the Bourne shell instead.)
  104. XEOM
  105. Xfi
  106. X
  107. X: Configure runs within the UU subdirectory
  108. Xtest -d UU || mkdir UU
  109. Xcd UU && rm -f *
  110. X
  111. Xd_bsd=''
  112. Xd_eunice=''
  113. Xd_xenix=''
  114. Xeunicefix=''
  115. XMcc=''
  116. Xawk=''
  117. Xcat=''
  118. Xcpp=''
  119. Xdate=''
  120. Xecho=''
  121. Xegrep=''
  122. Xexpr=''
  123. Xgcc=''
  124. Xgrep=''
  125. Xlint=''
  126. Xmail=''
  127. Xmkdir=''
  128. Xmv=''
  129. Xnroff=''
  130. Xrm=''
  131. Xsed=''
  132. Xsendmail=''
  133. Xsort=''
  134. Xtest=''
  135. Xtr=''
  136. Xuname=''
  137. Xuniq=''
  138. Xuuname=''
  139. Xvi=''
  140. Xhint=''
  141. Xmyuname=''
  142. XId=''
  143. XLog=''
  144. Xactive=''
  145. Xacttimes=''
  146. Xd_acttimes=''
  147. Xmyactive=''
  148. Xafs=''
  149. Xcc=''
  150. Xccflags=''
  151. Xcppflags=''
  152. Xldflags=''
  153. Xlkflags=''
  154. Xoptimize=''
  155. Xcf_by=''
  156. Xcf_time=''
  157. Xcontains=''
  158. Xcppminus=''
  159. Xcppstdin=''
  160. Xd_chsize=''
  161. Xd_ftrncate=''
  162. Xd_memcmp=''
  163. Xd_memcpy=''
  164. Xd_memset=''
  165. Xd_newsadm=''
  166. Xnewsadmin=''
  167. Xd_nntp=''
  168. Xservername=''
  169. Xd_normsig=''
  170. Xjobslib=''
  171. Xd_novoid=''
  172. Xvoid=''
  173. Xd_portable=''
  174. Xd_rename=''
  175. Xd_sighold=''
  176. Xd_strchr=''
  177. Xd_syslog=''
  178. Xsyslog=''
  179. Xd_libndir=''
  180. Xd_usendir=''
  181. Xlibndir=''
  182. Xndirc=''
  183. Xndiro=''
  184. Xd_usleep=''
  185. Xd_vfork=''
  186. Xd_voidsig=''
  187. Xsignal_t=''
  188. Xd_dirnamlen=''
  189. Xi_dirent=''
  190. Xi_stdlib=''
  191. Xi_string=''
  192. Xstrings=''
  193. Xi_sysdir=''
  194. Xi_sysndir=''
  195. Xi_systime=''
  196. Xi_time=''
  197. Xi_unistd=''
  198. Xi_vfork=''
  199. Xlibc=''
  200. Xplibpth=''
  201. Xxlibpth=''
  202. Xlibs=''
  203. Xinstallmansrc=''
  204. Xmanext=''
  205. Xmansrc=''
  206. Xmansrcexp=''
  207. Xc=''
  208. Xn=''
  209. Xnewslib=''
  210. Xnewslibexp=''
  211. Xnewsspool=''
  212. Xpackage=''
  213. Xspackage=''
  214. Xinstallprivlib=''
  215. Xprivlib=''
  216. Xprivlibexp=''
  217. Xsharpbang=''
  218. Xshsharp=''
  219. Xspitshell=''
  220. Xstartsh=''
  221. Xsysman=''
  222. Xthreaddir=''
  223. Xnm_opt=''
  224. Xrunnm=''
  225. Xusenm=''
  226. Xincpath=''
  227. Xmips=''
  228. Xmips_type=''
  229. Xusrinc=''
  230. Xd_whoami=''
  231. XCONFIG=''
  232. X
  233. X: script used to extract .SH files with variable substitutions
  234. Xcat >extract <<'EOS'
  235. XCONFIG=true
  236. Xecho "Doing variable substitutions on .SH files..."
  237. Xif test -f MANIFEST; then
  238. X    set x `awk '{print $1}' <MANIFEST | grep '\.SH'`
  239. Xelse
  240. X    echo "(Looking for .SH files under the current directory.)"
  241. X    set x `find . -name "*.SH" -print`
  242. Xfi
  243. Xshift
  244. Xcase $# in
  245. X0) set x *.SH; shift;;
  246. Xesac
  247. Xif test ! -f $1; then
  248. X    shift
  249. Xfi
  250. Xfor file in $*; do
  251. X    case "$file" in
  252. X    */*)
  253. X        dir=`expr X$file : 'X\(.*\)/'`
  254. X        file=`expr X$file : 'X.*/\(.*\)'`
  255. X        (cd $dir && . ./$file)
  256. X        ;;
  257. X    *)
  258. X        . ./$file
  259. X        ;;
  260. X    esac
  261. Xdone
  262. XEOS
  263. X
  264. X: produce awk script to parse command line options
  265. Xcat >options.awk <<'EOF'
  266. XBEGIN {
  267. X    optstr = "deEf:hrsSV";    # getopt-style specification
  268. X
  269. X    len = length(optstr);
  270. X    for (i = 1; i <= len; i++) {
  271. X        c = substr(optstr, i, 1);
  272. X        if (i < len) a = substr(optstr, i + 1, 1); else a = "";
  273. X        if (a == ":") {
  274. X            arg[c] = 1;
  275. X            i++;
  276. X        }
  277. X        opt[c] = 1;
  278. X    }
  279. X}
  280. X{
  281. X    expect = 0;
  282. X    str = $0;
  283. X    if (substr(str, 1, 1) != "-") {
  284. X        printf("'%s'\n", str);
  285. X        next;
  286. X    }
  287. X    len = length($0);
  288. X    for (i = 2; i <= len; i++) {
  289. X        c = substr(str, i, 1);
  290. X        if (!opt[c]) {
  291. X            printf("-%s\n", substr(str, i));
  292. X            next;
  293. X        }
  294. X        printf("-%s\n", c);
  295. X        if (arg[c]) {
  296. X            if (i < len)
  297. X                printf("'%s'\n", substr(str, i + 1));
  298. X            else
  299. X                expect = 1;
  300. X            next;
  301. X        }
  302. X    }
  303. X}
  304. XEND {
  305. X    if (expect)
  306. X        print "?";
  307. X}
  308. XEOF
  309. X
  310. X: process the command line options
  311. Xset X `for arg in "$@"; do echo $arg; done | awk -f options.awk`
  312. Xeval "set $*"
  313. Xshift
  314. Xrm -f options.awk
  315. X
  316. X: set up default values
  317. Xfastread=''
  318. Xreuseval=false
  319. Xconfig_sh=''
  320. Xalldone=''
  321. Xerror=''
  322. Xsilent=''
  323. Xextractsh=''
  324. X
  325. X: option parsing
  326. Xwhile test $# -gt 0; do
  327. X    case "$1" in
  328. X    -d) shift; fastread=yes;;
  329. X    -e) shift; alldone=cont;;
  330. X    -f)
  331. X        shift
  332. X        cd ..
  333. X        if test -r "$1"; then
  334. X            config_sh="$1"
  335. X        else
  336. X            echo "Configure: cannot read config file $1." >&2
  337. X            error=true
  338. X        fi
  339. X        cd UU
  340. X        shift;;
  341. X    -h) shift; error=true;;
  342. X    -r) shift; reuseval=true;;
  343. X    -s) shift; silent=true;;
  344. X    -E) shift; alldone=exit;;
  345. X    -S) shift; extractsh=true;;
  346. X    -V) echo "Configure generated by metaconfig 3.0 PL9." >&2
  347. X        exit 0;;
  348. X    --) break;;
  349. X    -*) echo "Configure: unknown option $1" >&2; shift; error=true;;
  350. X    *) break;;
  351. X    esac
  352. Xdone
  353. X
  354. Xcase "$error" in
  355. Xtrue)
  356. X    cat >&2 <<EOM
  357. XUsage: Configure [-dehrESV] [-f config.sh]
  358. X  -d : use defaults for all answers.
  359. X  -e : go on without questioning past the production of config.sh.
  360. X  -f : specify an alternate default configuration file.
  361. X  -h : print this help message and exit (with an error status).
  362. X  -r : reuse C symbols value if possible (skips costly nm extraction).
  363. X  -s : silent mode, only echoes questions and essential information.
  364. X  -E : stop at the end of questions, after having produced config.sh.
  365. X  -S : perform variable substitutions on all .SH files (can mix with -f)
  366. X  -V : print version number and exit (with a zero status).
  367. XEOM
  368. X    exit 1
  369. X    ;;
  370. Xesac
  371. X
  372. Xexec 4>&1
  373. Xcase "$silent" in
  374. Xtrue) exec 1>/dev/null;;
  375. Xesac
  376. X
  377. Xcase "$extractsh" in
  378. Xtrue)
  379. X    case "$config_sh" in
  380. X    '') config_sh='config.sh'; config='./config.sh';;
  381. X    /*) config="$config_sh";;
  382. X    *) config="./$config_sh";;
  383. X    esac
  384. X    echo " "
  385. X    echo "Fetching answers from $config_sh..."
  386. X    cd ..
  387. X    . $config
  388. X    echo " "
  389. X    . ./UU/extract
  390. X    rm -rf UU
  391. X    echo "Done."
  392. X    exit 0
  393. X    ;;
  394. Xesac
  395. X
  396. X: set package name
  397. Xpackage=mthreads
  398. Xfirst=`echo $package | sed -e 's/^\(.\).*/\1/'`
  399. Xlast=`echo $package | sed -e 's/^.\(.*\)/\1/'`
  400. Xspackage=`echo $first | tr '[a-z]' '[A-Z]'`$last
  401. X: Eunice requires " " instead of "", can you believe it
  402. Xecho " "
  403. X: Here we go...
  404. Xecho "Beginning of configuration questions for $package."
  405. X
  406. Xdefine='define'
  407. Xundef='undef'
  408. Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286'
  409. Xrmlist=''
  410. X
  411. Xtrap 'echo " "; rm -rf $rmlist; exit 1' 1 2 3 15
  412. X
  413. X: We must find out about Eunice early
  414. Xeunicefix=':'
  415. Xif test -f /etc/unixtovms; then
  416. X    eunicefix=/etc/unixtovms
  417. Xfi
  418. Xif test -f /etc/unixtovms.exe; then
  419. X    eunicefix=/etc/unixtovms.exe
  420. Xfi
  421. X
  422. Xi_sysselct=''
  423. X: change the next line if compiling for Xenix/286 on Xenix/386
  424. Xxlibpth='/usr/lib/386 /lib/386'
  425. X
  426. X: general looking path for locating libraries
  427. Xlibpth='/usr/lib/large /lib '$xlibpth' /lib/large'
  428. Xlibpth=$libpth' /usr/lib/small /lib/small'
  429. X
  430. X: no additional library wanted by default
  431. Xlibswanted=''
  432. X
  433. Xlarge=''
  434. Xinclwanted='/usr/include/NET-5000'
  435. X
  436. Xlibswanted='malloc bsd socket bsdipc sun net hdb bbn str inet nls nsl c_s intl x'
  437. X
  438. X: Some greps do not return status, grrr.
  439. Xecho "grimblepritz" >grimble
  440. Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
  441. X    contains=contains
  442. Xelif grep grimblepritz grimble >/dev/null 2>&1 ; then
  443. X    contains=grep
  444. Xelse
  445. X    contains=contains
  446. Xfi
  447. Xrm -f grimble
  448. X: the following should work in any shell
  449. Xcase "$contains" in
  450. Xcontains*)
  451. X    echo " "
  452. X    echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  453. X    cat >contains <<'EOSS'
  454. Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  455. XEOSS
  456. Xchmod +x contains
  457. Xesac
  458. X
  459. X: first determine how to suppress newline on echo command
  460. Xecho " "
  461. Xecho "Checking echo to see how to suppress newlines..."
  462. X(echo "hi there\c" ; echo " ") >.echotmp
  463. Xif $contains c .echotmp >/dev/null 2>&1 ; then
  464. X    echo "...using -n."
  465. X    n='-n'
  466. X    c=''
  467. Xelse
  468. X    cat <<'EOM'
  469. X...using \c
  470. XEOM
  471. X    n=''
  472. X    c='\c'
  473. Xfi
  474. Xecho $n "The star should be here-->$c"
  475. Xecho '*'
  476. Xrm -f .echotmp
  477. X
  478. X: Now test for existence of everything in MANIFEST
  479. Xecho " "
  480. Xif test -f ../MANIFEST; then
  481. X    echo "First let's make sure your kit is complete.  Checking..." >&4
  482. X    awk '$1 !~ /PACK[A-Z]+/ {print $1}' ../MANIFEST | split -50
  483. X    rm -f missing
  484. X    for filelist in x??; do
  485. X        (cd ..; ls `cat UU/$filelist` >/dev/null 2>>UU/missing)
  486. X    done
  487. X    if test -s missing; then
  488. X        cat missing >&4
  489. X        cat >&4 <<'EOM'
  490. X
  491. XTHIS PACKAGE SEEMS TO BE INCOMPLETE.
  492. X
  493. XYou have the option of continuing the configuration process, despite the
  494. Xdistinct possibility that your kit is damaged, by typing 'y'es.  If you
  495. Xdo, don't blame me if something goes wrong.  I advise you to type 'n'o
  496. Xand contact the author (davison@borland.com).
  497. X
  498. XEOM
  499. X        echo $n "Continue? [n] $c" >&4
  500. X        read ans
  501. X        case "$ans" in
  502. X        y*)
  503. X            echo "Continuing..." >&4
  504. X            rm -f missing
  505. X            ;;
  506. X        *)
  507. X            echo "ABORTING..." >&4
  508. X            kill $$
  509. X            ;;
  510. X        esac
  511. X    else
  512. X        echo "Looks good..." >&4
  513. X    fi
  514. Xelse
  515. X    echo "There is no MANIFEST file.  I hope your kit is complete !"
  516. Xfi
  517. Xrm -f missing x??
  518. X
  519. X: compute the number of columns on the terminal for proper question formatting
  520. Xcase "$COLUMNS" in
  521. X'') COLUMNS='80';;
  522. Xesac
  523. X
  524. X: set up the echo used in my read
  525. Xmyecho="case \"\$xxxm\" in
  526. X'') echo $n \"\$rp $c\" >&4;;
  527. X*) case \"\$rp\" in
  528. X    '') echo $n \"[\$xxxm] $c\";;
  529. X    *)
  530. X        if test \`echo \"\$rp [\$xxxm]  \" | wc -c\` -ge $COLUMNS; then
  531. X            echo \"\$rp\" >&4
  532. X            echo $n \"[\$xxxm] $c\" >&4
  533. X        else
  534. X            echo $n \"\$rp [\$xxxm] $c\" >&4
  535. X        fi
  536. X        ;;
  537. X    esac;;
  538. Xesac"
  539. X
  540. X: now set up to do reads with possible shell escape and default assignment
  541. Xcat <<EOSC >myread
  542. Xxxxm=\$dflt
  543. X$myecho
  544. Xans='!'
  545. Xcase "\$fastread" in
  546. Xyes) case "\$dflt" in
  547. X    '') ;;
  548. X    *) ans='';
  549. X        case "\$silent-\$rp" in
  550. X        true-) ;;
  551. X        *) echo " " >&4;;
  552. X        esac;;
  553. X    esac;;
  554. X*) case "\$silent" in
  555. X    true) case "\$rp" in
  556. X        '') ans='';;
  557. X        esac;;
  558. X    esac;;
  559. Xesac
  560. Xwhile expr "X\$ans" : "X!" >/dev/null; do
  561. X    read answ
  562. X    set x \$xxxm
  563. X    shift
  564. X    aok=''; eval "ans=\"\$answ\"" && aok=y
  565. X    case  "\$answ" in
  566. X    "\$ans")
  567. X        case "\$ans" in
  568. X        "!")
  569. X            sh 1>&4
  570. X            echo " "
  571. X            $myecho
  572. X            ;;
  573. X        !*)
  574. X            set x \`expr "X\$ans" : "X!\(.*\)\$"\`
  575. X            shift
  576. X            sh 1>&4 -c "\$*"
  577. X            echo " "
  578. X            $myecho
  579. X            ;;
  580. X        esac;;
  581. X    *)
  582. X        case "\$aok" in
  583. X        y)
  584. X            echo "*** Substitution done -- please confirm."
  585. X            xxxm="\$ans"
  586. X            ans=\`echo $n "\$ans$c" | tr '\012' ' '\`
  587. X            xxxm="\$ans"
  588. X            ans=!
  589. X            ;;
  590. X        *)
  591. X            echo "*** Error -- try again."
  592. X            ans=!
  593. X            ;;
  594. X        esac
  595. X        $myecho
  596. X        ;;
  597. X    esac
  598. X    case "\$ans\$xxxm\$nostick" in
  599. X    '')
  600. X        ans=!
  601. X        $myecho
  602. X        ;;
  603. X    esac
  604. Xdone
  605. Xcase "\$ans" in
  606. X'') ans="\$xxxm";;
  607. Xesac
  608. XEOSC
  609. X
  610. X: create .config dir to save info across Configure sessions
  611. Xtest -d ../.config || mkdir ../.config
  612. Xcat >../.config/README <<EOF
  613. XThis directory created by Configure to save information that should
  614. Xpersist across sessions.
  615. X
  616. XYou may safely delete it if you wish.
  617. XEOF
  618. X
  619. X: general instructions
  620. Xneedman=true
  621. Xfirsttime=true
  622. Xuser=`( (logname) 2>/dev/null || whoami) 2>&1`
  623. Xif $contains "^$user\$" ../.config/instruct >/dev/null 2>&1; then
  624. X    firsttime=false
  625. X    echo " "
  626. X    rp='Would you like to see the instructions?'
  627. X    dflt=n
  628. X    . ./myread
  629. X    case "$ans" in
  630. X    [yY]*) ;;
  631. X    *) needman=false;;
  632. X    esac
  633. Xfi
  634. Xif $needman; then
  635. X    cat <<EOH
  636. XThis installation shell script will examine your system and ask you questions
  637. Xto determine how the mthreads package should be installed. If you get
  638. Xstuck on a question, you may use a ! shell escape to start a subshell or
  639. Xexecute a command.  Many of the questions will have default answers in square
  640. Xbrackets; typing carriage return will give you the default.
  641. X
  642. XOn some of the questions which ask for file or directory names you are allowed
  643. Xto use the ~name construct to specify the login directory belonging to "name",
  644. Xeven if you don't have a shell which knows about that.  Questions where this is
  645. Xallowed will be marked "(~name ok)".
  646. X
  647. XEOH
  648. X    rp=''
  649. X    dflt='Type carriage return to continue'
  650. X    . ./myread
  651. X    cat <<'EOH'
  652. X
  653. XThe prompter used in this script allows you to use shell variables and
  654. Xbackticks in your answers.  You may use $1, $2, etc...  to refer to the words
  655. Xin the default answer, as if the default line was a set of arguments given to a
  656. Xscript shell.  This means you may also use $* to repeat the whole default line,
  657. Xso you do not have to re-type everything to add something to the default.
  658. X
  659. XEverytime there is a substitution, you will have to confirm.  If there is an
  660. Xerror (e.g. an unmatched backtick), the default answer will remain unchanged
  661. Xand you will be prompted again.
  662. X
  663. XIf you are in a hurry, you may run 'Configure -d'.  This will bypass nearly all
  664. Xthe questions and use the computed defaults (or the previous answers if there
  665. Xwas already a config.sh file). Type 'Configure -h' for a list of options.
  666. X
  667. XEOH
  668. X    . ./myread
  669. X    cat <<EOH
  670. X
  671. XMuch effort has been expended to ensure that this shell script will run on any
  672. XUnix system.  If despite that it blows up on yours, your best bet is to edit
  673. XConfigure and run it again.  Also, let me (davison@borland.com)
  674. Xknow how I blew it.  If you can't run Configure for some reason, you'll have to
  675. Xgenerate a config.sh file by hand.
  676. X
  677. XThis installation script affects things in two ways:
  678. X
  679. X1) it may do direct variable substitutions on some of the files included
  680. X   in this kit.
  681. X2) it builds a config.h file for inclusion in C programs.  You may edit
  682. X   any of these files as the need arises after running this script.
  683. X
  684. XIf you make a mistake on a question, there is no easy way to back up to it
  685. Xcurrently.  The easiest thing to do is to edit config.sh and rerun all the SH
  686. Xfiles.  Configure will offer to let you do this before it runs the SH files.
  687. X
  688. XEOH
  689. X    dflt='Type carriage return to continue'
  690. X    . ./myread
  691. X    case "$firsttime" in
  692. X    true) echo $user >>../.config/instruct;;
  693. X    esac
  694. Xfi
  695. X
  696. X: see if sh knows # comments
  697. Xecho " "
  698. Xecho "Checking your sh to see if it knows about # comments..." >&4
  699. Xif sh -c '#' >/dev/null 2>&1 ; then
  700. X    echo "Your sh handles # comments correctly."
  701. X    shsharp=true
  702. X    spitshell=cat
  703. X    echo " "
  704. X    echo "Okay, let's see if #! works on this system..."
  705. X    echo "#!/bin/cat" >try
  706. X    $eunicefix try
  707. X    chmod +x try
  708. X    ./try > today
  709. X    if test -s today; then
  710. X        echo "It does."
  711. X        sharpbang='#!'
  712. X    else
  713. X        echo "#! /bin/cat" > try
  714. X        $eunicefix try
  715. X        chmod +x try
  716. X        ./try > today
  717. X        if test -s today; then
  718. X            echo "It does."
  719. X            sharpbang='#! '
  720. X        else
  721. X            echo "It's just a comment."
  722. X            sharpbang=': use '
  723. X        fi
  724. X    fi
  725. Xelse
  726. X    echo "Your sh doesn't grok # comments--I will strip them later on."
  727. X    shsharp=false
  728. X    echo "exec grep -v '^[     ]*#'" >spitshell
  729. X    chmod +x spitshell
  730. X    $eunicefix spitshell
  731. X    spitshell=`pwd`/spitshell
  732. X    echo "I presume that if # doesn't work, #! won't work either!"
  733. X    sharpbang=': use '
  734. Xfi
  735. Xrm -f try today
  736. X
  737. X: figure out how to guarantee sh startup
  738. Xecho " "
  739. Xecho "Checking out how to guarantee sh startup..." >&4
  740. Xcase "$SYSTYPE" in
  741. X*bsd*|sys5*) startsh=$sharpbang"/$SYSTYPE/bin/sh";;
  742. X*) startsh=$sharpbang'/bin/sh';;
  743. Xesac
  744. Xecho "Let's see if '$startsh' works..."
  745. Xcat >try <<EOSS
  746. X$startsh
  747. Xset abc
  748. Xtest "$?abc" != 1
  749. XEOSS
  750. X
  751. Xchmod +x try
  752. X$eunicefix try
  753. Xif ./try; then
  754. X    echo "Yup, it does."
  755. Xelse
  756. Xecho "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  757. Xfi
  758. Xrm -f try
  759. X
  760. X: find out where common programs are
  761. Xecho " "
  762. Xecho "Locating common programs..." >&4
  763. Xcat <<EOSC >loc
  764. X$startsh
  765. Xcase \$# in
  766. X0) exit 1;;
  767. Xesac
  768. Xthing=\$1
  769. Xshift
  770. Xdflt=\$1
  771. Xshift
  772. Xfor dir in \$*; do
  773. X    case "\$thing" in
  774. X    .)
  775. X    if test -d \$dir/\$thing; then
  776. X        echo \$dir
  777. X        exit 0
  778. X    fi
  779. X    ;;
  780. X    *)
  781. X    if test -f \$dir/\$thing; then
  782. X        echo \$dir/\$thing
  783. X        exit 0
  784. X    elif test -f \$dir/\$thing.exe; then
  785. X        : on Eunice apparently
  786. X        echo \$dir/\$thing
  787. X        exit 0
  788. X    fi
  789. X    ;;
  790. X    esac
  791. Xdone
  792. Xecho \$dflt
  793. Xexit 1
  794. XEOSC
  795. Xchmod +x loc
  796. X$eunicefix loc
  797. Xloclist="
  798. Xawk
  799. Xcat
  800. Xecho
  801. Xexpr
  802. Xgrep
  803. Xmkdir
  804. Xmv
  805. Xrm
  806. Xsed
  807. Xsort
  808. Xtr
  809. Xuniq
  810. X"
  811. Xtrylist="
  812. XMcc
  813. Xcpp
  814. Xdate
  815. Xegrep
  816. Xnroff
  817. Xtest
  818. Xuname
  819. X"
  820. Xpth=`echo $PATH | sed -e 's/:/ /g'`
  821. Xpth="$pth /lib /usr/lib"
  822. Xfor file in $loclist; do
  823. X    xxx=`./loc $file $file $pth`
  824. X    eval $file=$xxx
  825. X    eval _$file=$xxx
  826. X    case "$xxx" in
  827. X    /*)
  828. X        echo $file is in $xxx.
  829. X        ;;
  830. X    *)
  831. X        echo "I don't know where $file is.  I hope it's in everyone's PATH."
  832. X        ;;
  833. X    esac
  834. Xdone
  835. Xecho " "
  836. Xecho "Don't worry if any of the following aren't found..."
  837. Xsay=offhand
  838. Xfor file in $trylist; do
  839. X    xxx=`./loc $file $file $pth`
  840. X    eval $file=$xxx
  841. X    eval _$file=$xxx
  842. X    case "$xxx" in
  843. X    /*)
  844. X        echo $file is in $xxx.
  845. X        ;;
  846. X    *)
  847. X        echo "I don't see $file out there, $say."
  848. X        say=either
  849. X        ;;
  850. X    esac
  851. Xdone
  852. Xcase "$egrep" in
  853. Xegrep)
  854. X    echo "Substituting grep for egrep."
  855. X    egrep=$grep
  856. X    ;;
  857. Xesac
  858. Xcase "$test" in
  859. Xtest)
  860. X    echo "Hopefully test is built into your sh."
  861. X    ;;
  862. X*)
  863. X    if sh -c "PATH= test true" >/dev/null 2>&1; then
  864. X        echo "Using the test built into your sh."
  865. X        test=test
  866. X    fi
  867. X    ;;
  868. Xesac
  869. Xcase "$echo" in
  870. Xecho)
  871. X    echo "Hopefully echo is built into your sh."
  872. X    ;;
  873. X*)
  874. X    echo " "
  875. Xecho "Checking compatibility between $echo and builtin echo (if any)..." >&4
  876. X    $echo $n "hi there$c" >foo1
  877. X    echo $n "hi there$c" >foo2
  878. X    if cmp foo1 foo2 >/dev/null 2>&1; then
  879. X        echo "They are compatible.  In fact, they may be identical."
  880. X    else
  881. X        case "$n" in
  882. X        '-n') n='' c='\c';;
  883. X        *) n='-n' c='';;
  884. X        esac
  885. X        cat <<FOO
  886. XThey are not compatible!  You are probably running ksh on a non-USG system.
  887. XI'll have to use $echo instead of the builtin, since Bourne shell doesn't
  888. Xhave echo built in and we may have to run some Bourne shell scripts.  That
  889. Xmeans I'll have to use '$n$c' to suppress newlines now.  Life is ridiculous.
  890. X
  891. XFOO
  892. X        $echo $n "The star should be here-->$c"
  893. X        $echo "*"
  894. X    fi
  895. X    $rm -f foo1 foo2
  896. X    ;;
  897. Xesac
  898. X
  899. X: Try to determine whether config.sh was made on this system
  900. Xcase "$config_sh" in
  901. X'')
  902. Xmyuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
  903. Xdflt=n
  904. Xif test "$fastread" = yes; then
  905. X    dflt=y
  906. Xelif test -f ../config.sh; then
  907. X    oldmyuname=''
  908. X    if $contains myuname= ../config.sh >/dev/null 2>&1; then
  909. X        eval "old`grep myuname= ../config.sh`"
  910. X    fi
  911. X    if test "X$myuname" = "X$oldmyuname"; then
  912. X        dflt=y
  913. X    fi
  914. Xfi
  915. X
  916. X: Get old answers from old config file if Configure was run on the
  917. X: same system, otherwise use the hints.
  918. Xhint=default
  919. Xcd ..
  920. Xif test -f config.sh; then
  921. X    echo " "
  922. X    rp="I see a config.sh file.  Do you want to use it to set the defaults?"
  923. X    . UU/myread
  924. X    case "$ans" in
  925. X    n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
  926. X    *)  echo "Fetching default answers from your old config.sh file..." >&4
  927. X        tmp="$n"
  928. X        tans="$c"
  929. X        . ./config.sh
  930. X        cp config.sh UU
  931. X        n="$tmp"
  932. X        c="$tans"
  933. X        hint=previous
  934. X        ;;
  935. X    esac
  936. Xfi
  937. Xif test ! -f config.sh; then
  938. X    $cat <<EOM
  939. X
  940. XFirst time through, eh?  I have some defaults handy for the following systems:
  941. X
  942. XEOM
  943. X    cd hints; ls -C *.sh | $sed 's/\.sh/   /g' >&4
  944. X    dflt=''
  945. X    : Half the following guesses are probably wrong... If you have better
  946. X    : tests or hints, please send them to davison@borland.com
  947. X    : The metaconfig authors would also appreciate a copy...
  948. X    $test -f /vmunix && $test -f /usr/convex/spucmd && dflt="$dflt convexos"
  949. X    $test -f /irix && dflt="$dflt sgi"
  950. X    $test -f /xenix && dflt="$dflt sco_xenix"
  951. X    $test -f /dynix && dflt="$dflt dynix"
  952. X    $test -f /bin/mips && /bin/mips && dflt="$dflt mips"
  953. X    $test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next"
  954. X    if $test -f $uname; then
  955. X        set `$uname -a | tr '[A-Z]' '[a-z]'`
  956. X
  957. X        $test -f $5.sh && dflt="$dflt $5"
  958. X
  959. X        case "$5" in
  960. X        mips*) dflt="$dflt mips";;
  961. X        [23]100) dflt="$dflt mips";;
  962. X        next*) dflt="$dflt next" ;;
  963. X        esac
  964. X
  965. X        case "$1" in
  966. X        aix) dflt="$dflt aix_rs" ;;
  967. X        sunos)    case "$3" in
  968. X            4.1*) dflt="$dflt sunos_4_1" ;;
  969. X            esac
  970. X            ;;
  971. X        dgux) dflt="$dflt dgux" ;;
  972. X        hp*ux) dflt="$dflt hpux" ;;
  973. X        next) dflt="$dflt next" ;;
  974. X        irix) dflt="$dflt sgi" ;;
  975. X        convexos) dflt="$dflt convexos";;
  976. X        $2) if $test -f /usr/lib/sysadm/sysadm.menu; then
  977. X            if $test ! -f /etc/copyrights/01.sco; then
  978. X                set 3 2 0
  979. X            else
  980. X                set `uname -X 2>&1 | grep Release`
  981. X                if test "x$1" != "xRelease"; then
  982. X                set 3 2 1
  983. X                else
  984. X                set `echo $3 | sed 's/[^0-9]/ /g'`
  985. X                fi
  986. X            fi
  987. X            if $test -f sco_$1_$2_$3.sh; then
  988. X                dflt="$dflt sco_$1_$2_$3"
  989. X            elif $test -f sco_$1_$2.sh; then
  990. X                dflt="$dflt sco_$1_$2"
  991. X            elif $test -f sco_$1.sh; then
  992. X                dflt="$dflt sco_$1"
  993. X            fi
  994. X            fi ;;
  995. X        esac
  996. X    fi
  997. X    set X `echo $dflt | tr ' ' '\012' | sort | uniq`
  998. X    shift
  999. X    dflt=''
  1000. X    for file in $*; do
  1001. X        if $test -f "$file.sh"; then
  1002. X            dflt="$dflt $file"
  1003. X        fi
  1004. X    done
  1005. X    set X $dflt
  1006. X    shift
  1007. X    dflt=${1+"$@"}
  1008. X    case "$dflt" in
  1009. X    '') dflt=none;;
  1010. X    esac
  1011. X    $cat <<EOM
  1012. X
  1013. XYou may give one or more space-separated answers, or "none" if appropriate.
  1014. XIf your OS version has no hints, DO NOT give a wrong version -- say "none".
  1015. X
  1016. XEOM
  1017. X    rp="Which of these apply, if any?"
  1018. X    . ../UU/myread
  1019. X    for file in $ans; do
  1020. X        if $test -f $file.sh; then
  1021. X            . ./$file.sh
  1022. X            $cat $file.sh >> ../UU/config.sh
  1023. X        elif $test X$ans = X -o X$ans = Xnone ; then
  1024. X            :
  1025. X        else
  1026. X            echo "$file.sh does not exist -- ignored"
  1027. X        fi
  1028. X    done
  1029. X    hint=recommended
  1030. X    cd ..
  1031. Xfi
  1032. Xcd UU
  1033. X;;
  1034. X*)
  1035. X    echo " "
  1036. X    echo "Fetching default answers from $config_sh..." >&4
  1037. X    tmp="$n"
  1038. X    tans="$c"
  1039. X    cd ..
  1040. X    cp $config_sh config.sh 2>/dev/null
  1041. X    . ./config.sh
  1042. X    cd UU
  1043. X    cp ../config.sh .
  1044. X    n="$tmp"
  1045. X    c="$tans"
  1046. X    hint=previous
  1047. X    ;;
  1048. Xesac
  1049. X
  1050. X: Restore computed paths
  1051. Xfor file in $loclist $trylist; do
  1052. X    eval $file="\$_$file"
  1053. Xdone
  1054. X
  1055. X: who configured the system
  1056. Xcf_time=`$date 2>&1`
  1057. Xcf_by=`( (logname) 2>/dev/null || whoami) 2>&1`
  1058. X
  1059. X: set up shell script to do ~ expansion
  1060. Xcat >filexp <<EOSS
  1061. X$startsh
  1062. X: expand filename
  1063. Xcase "\$1" in
  1064. X ~/*|~)
  1065. X    echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  1066. X    ;;
  1067. X ~*)
  1068. X    if $test -f /bin/csh; then
  1069. X        /bin/csh -f -c "glob \$1"
  1070. X        failed=$?
  1071. X        echo ""
  1072. X        exit \$failed
  1073. X    else
  1074. X        name=\`$expr x\$1 : '..\([^/]*\)'\`
  1075. X        dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  1076. X        if $test ! -d "\$dir"; then
  1077. X            me=\`basename \$0\`
  1078. X            echo "\$me: can't locate home directory for: \$name" >&2
  1079. X            exit 1
  1080. X        fi
  1081. X        case "\$1" in
  1082. X        */*)
  1083. X            echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  1084. X            ;;
  1085. X        *)
  1086. X            echo \$dir
  1087. X            ;;
  1088. X        esac
  1089. X    fi
  1090. X    ;;
  1091. X*)
  1092. X    echo \$1
  1093. X    ;;
  1094. Xesac
  1095. XEOSS
  1096. Xchmod +x filexp
  1097. X$eunicefix filexp
  1098. X
  1099. X: check if NNTP is to be used
  1100. Xcase "$d_nntp" in
  1101. X"$define") dflt="y";;
  1102. X*)       dflt="n";;
  1103. Xesac
  1104. X$echo " "
  1105. Xrp="Do you want mthreads to access news via NNTP?"
  1106. X. myread
  1107. Xcase "$ans" in
  1108. Xn*)    d_nntp="$undef";;
  1109. Xy*)    d_nntp="$define"
  1110. X    newsspool=/tmp
  1111. X    $echo "net.foobar 00001 00001 y" > .falseactive
  1112. X    case "$servername" in
  1113. X    '')  dflt="no default" ;;
  1114. X    *)   dflt="$servername";;
  1115. X    esac
  1116. X    $cat <<EOM
  1117. X
  1118. X$spackage needs to know what machine you wish to use as a news server.  You
  1119. Xcan specify a machine name directly, or a filename from which to read
  1120. Xthe name (start the name with a slash or a tilde to distinguish it).
  1121. XNote also that the environment variable NNTPSERVER can be used to
  1122. Xoverride this default setting.
  1123. X
  1124. XEOM
  1125. X
  1126. X    rp="Enter a file name (~name ok) or machine name:"
  1127. X    . myread
  1128. X    ans=`./filexp "$ans"`
  1129. X    case "$ans" in
  1130. X    /*) if $test ! -f $ans; then
  1131. X        $echo "(You'll need to create $ans before $package will work.)"
  1132. X        fi;;
  1133. X    esac
  1134. X    servername="$ans"
  1135. Xesac
  1136. X
  1137. X: decide how portable to be
  1138. Xcase "$d_portable" in
  1139. X"$define") dflt=y;;
  1140. X*)    dflt=n;;
  1141. Xesac
  1142. X$cat <<'EOH'
  1143. XI can set things up so that your shell scripts and binaries are more portable,
  1144. Xat what may be a noticable cost in performance.  In particular, if you
  1145. Xask to be portable, the following happens:
  1146. X
  1147. X     1) Shell scripts will rely on the PATH variable rather than using
  1148. X    the paths derived above.
  1149. X     2) ~username interpretations will be done at run time rather than
  1150. X    by Configure.
  1151. X
  1152. XEOH
  1153. Xrp="Do you expect to run these scripts and binaries on multiple machines?"
  1154. X. ./myread
  1155. Xcase "$ans" in
  1156. X    y*) d_portable="$define"
  1157. X    for file in $loclist; do
  1158. X        eval $file=$file
  1159. X    done
  1160. X    ;;
  1161. X    *)  d_portable="$undef" ;;
  1162. Xesac
  1163. X
  1164. X: now set up to get a file name
  1165. Xcat <<'EOSC' >getfile
  1166. Xtilde=''
  1167. Xfullpath=''
  1168. Xalready=''
  1169. Xskip=''
  1170. Xnone_ok=''
  1171. Xexp_file=''
  1172. Xorig_rp="$rp"
  1173. Xorig_dflt="$dflt"
  1174. X
  1175. Xcase "$fn" in
  1176. X*~*) tilde=true;;
  1177. Xesac
  1178. Xcase "$fn" in
  1179. X*/*) fullpath=true;;
  1180. Xesac
  1181. Xcase "$fn" in
  1182. X*+*) skip=true;;
  1183. Xesac
  1184. Xcase "$fn" in
  1185. X*n*) none_ok=true;;
  1186. Xesac
  1187. Xcase "$fn" in
  1188. X*e*) exp_file=true;;
  1189. Xesac
  1190. X
  1191. Xcase "$fn" in
  1192. X*f*) type='File';;
  1193. X*d*) type='Directory';;
  1194. X*l*) type='Locate'; fn=`expr $fn : '.*:\(.*\)'`;;
  1195. Xesac
  1196. X
  1197. Xwhat="$type"
  1198. Xcase "$what" in
  1199. XLocate) what='File';;
  1200. Xesac
  1201. X
  1202. Xcase "$exp_file" in
  1203. X'')
  1204. X    case "$d_portable" in
  1205. X    "$define") ;;
  1206. X    *) exp_file=true;;
  1207. X    esac
  1208. X    ;;
  1209. Xesac
  1210. X
  1211. Xcd ..
  1212. Xwhile test "$type"; do
  1213. X    redo=''
  1214. X    rp="$orig_rp"
  1215. X    dflt="$orig_dflt"
  1216. X    case "$tilde" in
  1217. X    true) rp="$rp (~name ok)";;
  1218. X    esac
  1219. X    . UU/myread
  1220. X    case "$ans" in
  1221. X    none)
  1222. X        value=''
  1223. X        ansexp=''
  1224. X        case "$none_ok" in
  1225. X        true) type='';;
  1226. X        esac
  1227. X        ;;
  1228. X    *)
  1229. X        case "$tilde" in
  1230. X        '') value="$ans"
  1231. X            ansexp="$ans";;
  1232. X        *)
  1233. X            value=`UU/filexp $ans`
  1234. X            case $? in
  1235. X            0)
  1236. X                if test "$ans" != "$value"; then
  1237. X                    echo "(That is $value on this particular system.)"
  1238. X                fi
  1239. X                ;;
  1240. X            *) value="$ans";;
  1241. X            esac
  1242. X            ansexp="$value"
  1243. X            case "$exp_file" in
  1244. X            '') value="$ans";;
  1245. X            esac
  1246. X            ;;
  1247. X        esac
  1248. X        case "$fullpath" in
  1249. X        true)
  1250. X            case "$ansexp" in
  1251. X            /*) value="$ansexp" ;;
  1252. X            *)
  1253. X                redo=true
  1254. X                case "$already" in
  1255. X                true)
  1256. X                echo "I shall only accept a full path name, as in /bin/ls." >&4
  1257. X                echo "Use a ! shell escape if you wish to check pathnames." >&4
  1258. X                    ;;
  1259. X                *)
  1260. X                echo "Please give a full path name, starting with slash." >&4
  1261. X                    case "$tilde" in
  1262. X                    true)
  1263. X                echo "Note that using ~name is ok provided it expands well." >&4
  1264. X                        already=true
  1265. X                        ;;
  1266. X                    esac
  1267. X                esac
  1268. X                ;;
  1269. X            esac
  1270. X            ;;
  1271. X        esac
  1272. X        case "$redo" in
  1273. X        '')
  1274. X            case "$type" in
  1275. X            File)
  1276. X                if test -f "$ansexp"; then
  1277. X                    type=''
  1278. X                elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
  1279. X                then
  1280. X                    echo "($value is not a plain file, but that's ok.)"
  1281. X                    type=''
  1282. X                fi
  1283. X                ;;
  1284. X            Directory)
  1285. X                if test -d "$ansexp"; then
  1286. X                    type=''
  1287. X                fi
  1288. X                ;;
  1289. X            Locate)
  1290. X                if test -d "$value"; then
  1291. X                    echo "(Looking for $fn in directory $value.)"
  1292. X                    value="$value/$fn"
  1293. X                fi
  1294. X                if test -f "$value"; then
  1295. X                    type=''
  1296. X                fi
  1297. X                ;;
  1298. X            esac
  1299. X
  1300. X            case "$skip" in
  1301. X            true) type='';
  1302. X            esac
  1303. X
  1304. X            case "$type" in
  1305. X            '') ;;
  1306. X            *)
  1307. X                if test "$fastread" = yes; then
  1308. X                    dflt=y
  1309. X                else
  1310. X                    dflt=n
  1311. X                fi
  1312. X                rp="$what $value doesn't exist.  Use that name anyway?"
  1313. X                . UU/myread
  1314. X                dflt=''
  1315. X                case "$ans" in
  1316. X                y*) type='';;
  1317. X                *) echo " ";;
  1318. X                esac
  1319. X                ;;
  1320. X            esac
  1321. X            ;;
  1322. X        esac
  1323. X        ;;
  1324. X    esac
  1325. Xdone
  1326. Xcd UU
  1327. Xans="$value"
  1328. Xrp="$orig_rp"
  1329. Xdflt="$orig_dflt"
  1330. XEOSC
  1331. X
  1332. X: figure out news library
  1333. Xcase "$d_nntp" in
  1334. Xdefine) newslib=/tmp
  1335. X    newslibexp=/tmp
  1336. X    ;;
  1337. X*)    case "$newslib" in
  1338. X    '') dflt=/usr/lib/news;;
  1339. X    *)  dflt=$newslib;;
  1340. X    esac
  1341. X    $echo " "
  1342. X    fn=d~
  1343. X    rp='Where is the news library directory?'
  1344. X    . ./getfile
  1345. X    newslib="$ans"
  1346. X    newslibexp=`./filexp $newslib`
  1347. Xesac
  1348. X
  1349. X: locate active file and active.times file
  1350. X$echo " "
  1351. Xcase "$d_nntp" in
  1352. Xdefine) active=none
  1353. X    myactive=.falseactive
  1354. X    : check for active.times
  1355. X    case "$acttimes" in
  1356. X    ''|none) dflt="n";;
  1357. X    *)       dflt="y";;
  1358. X    esac
  1359. X    cat <<'EOM'
  1360. X
  1361. XIf your server maintains an accurate "active.times" file, trn can make use
  1362. Xof the NEWGROUPS call in NNTP to find new groups instead of using the old
  1363. Xmethod of adding all groups not listed in your .newsrc.  If you aren't sure,
  1364. Xguess and see if you get notified of the new groups as they are created.
  1365. X
  1366. XEOM
  1367. X    rp="Does your server support a reliable NEWGROUPS call?"
  1368. X    . ./myread
  1369. X    case "$ans" in
  1370. X    y*) acttimes="nntp" d_acttimes="$define";;
  1371. X    *)  acttimes='none' d_acttimes="$undef";;
  1372. X    esac
  1373. X    ;;
  1374. X*)    case "$active" in
  1375. X    '') dflt=$newslib/active ;;
  1376. X    *)  dflt="$active";;
  1377. X    esac
  1378. X    fn=l~:active
  1379. X    rp='Where is the active file?'
  1380. X    . ./getfile
  1381. X    active="$ans"
  1382. X    myactive=`./filexp $active`
  1383. X    : check for active.times
  1384. X    case "$acttimes" in
  1385. X    ''|nntp) dflt="${active}.times";;
  1386. X    *)       dflt="$acttimes";;
  1387. X    esac
  1388. X    $cat <<'EOM'
  1389. X
  1390. XIf your news system maintains an "active.times" file, trn can use it for a
  1391. Xfast new-group check.  If it's not around, answer "none" and the active
  1392. Xfile will be scanned for new groups when it changes size.
  1393. X
  1394. XEOM
  1395. X    fn=ln~:active.times
  1396. X    rp='The full pathname of active.times or "none"?'
  1397. X    . ./getfile
  1398. X    acttimes="$ans"
  1399. X    case "$acttimes" in
  1400. X    '') acttimes=none d_acttimes="$undef";;
  1401. X    *) d_acttimes="$define";;
  1402. X    esac
  1403. Xesac
  1404. X
  1405. X: determine where manual pages are on this system
  1406. Xecho " "
  1407. Xcase "$sysman" in
  1408. X'') 
  1409. X    syspath='/usr/man/man1 /usr/man/man1 /usr/man/mann'
  1410. X    syspath="$syspath /usr/man/manl /usr/man/local/man1"
  1411. X    syspath="$syspath /usr/man/u_man/man1 /usr/share/man/man1"
  1412. X    syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
  1413. X    syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
  1414. X    syspath="$syspath /usr/man/man.L /local/man/man1"
  1415. X    sysman=`./loc . $syspath`
  1416. X    ;;
  1417. Xesac
  1418. Xif $test -d "$sysman"; then
  1419. X    echo "System manual is in $sysman." >&4
  1420. Xelse
  1421. X    echo "Could not find manual pages in source form." >&4
  1422. Xfi
  1423. X
  1424. X: make some quick guesses about what we are up against
  1425. Xecho " "
  1426. X$echo $n "Hmm...  $c"
  1427. Xecho exit 1 >bsd
  1428. Xecho exit 1 >usg
  1429. Xecho exit 1 >v7
  1430. Xecho exit 1 >osf1
  1431. Xecho exit 1 >eunice
  1432. Xecho exit 1 >xenix
  1433. Xecho exit 1 >venix
  1434. X$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
  1435. Xif test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
  1436. Xthen
  1437. X    echo "Looks kind of like an OSF/1 system, but we'll see..."
  1438. X    echo exit 0 >osf1
  1439. Xelif test `echo abc | tr a-z A-Z` = Abc ; then
  1440. X    xxx=`./loc addbib blurfl $pth`
  1441. X    if $test -f $xxx; then
  1442. X    echo "Looks kind of like a USG system with BSD features, but we'll see..."
  1443. X        echo exit 0 >bsd
  1444. X        echo exit 0 >usg
  1445. X    else
  1446. X        if $contains SIGTSTP foo >/dev/null 2>&1 ; then
  1447. X            echo "Looks kind of like an extended USG system, but we'll see..."
  1448. X        else
  1449. X            echo "Looks kind of like a USG system, but we'll see..."
  1450. X        fi
  1451. X        echo exit 0 >usg
  1452. X    fi
  1453. X    d_bsd="$undef"
  1454. Xelif $contains SIGTSTP foo >/dev/null 2>&1 ; then
  1455. X    echo "Looks kind of like a BSD system, but we'll see..."
  1456. X    d_bsd="$define"
  1457. X    echo exit 0 >bsd
  1458. Xelse
  1459. X    echo "Looks kind of like a Version 7 system, but we'll see..."
  1460. X    d_bsd="$undef"
  1461. X    echo exit 0 >v7
  1462. Xfi
  1463. Xcase "$eunicefix" in
  1464. X*unixtovms*)
  1465. X    $cat <<'EOI'
  1466. XThere is, however, a strange, musty smell in the air that reminds me of
  1467. Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  1468. XEOI
  1469. X    echo exit 0 >eunice
  1470. X    d_eunice="$define"
  1471. X: it so happens the Eunice I know will not run shell scripts in Unix format
  1472. X    ;;
  1473. X*)
  1474. X    echo " "
  1475. X    echo "Congratulations.  You aren't running Eunice."
  1476. X    d_eunice="$undef"
  1477. X    ;;
  1478. Xesac
  1479. Xif test -f /xenix; then
  1480. X    echo "Actually, this looks more like a XENIX system..."
  1481. X    echo exit 0 >xenix
  1482. X    d_xenix="$define"
  1483. Xelse
  1484. X    echo " "
  1485. X    echo "It's not Xenix..."
  1486. X    d_xenix="$undef"
  1487. Xfi
  1488. Xchmod +x xenix
  1489. X$eunicefix xenix
  1490. Xif test -f /venix; then
  1491. X    echo "Actually, this looks more like a VENIX system..."
  1492. X    echo exit 0 >venix
  1493. Xelse
  1494. X    echo " "
  1495. X    if xenix; then
  1496. X        : null
  1497. X    else
  1498. X        echo "Nor is it Venix..."
  1499. X    fi
  1500. Xfi
  1501. Xchmod +x bsd usg v7 osf1 eunice xenix venix
  1502. X$eunicefix bsd usg v7 osf1 eunice xenix venix
  1503. X$rm -f foo
  1504. X
  1505. X: see if we need a special compiler
  1506. Xecho " "
  1507. Xif usg; then
  1508. X    case "$cc" in
  1509. X    '') case "$Mcc" in
  1510. X        /*) dflt='Mcc';;
  1511. X        *) case "$large" in
  1512. X            -M*) dflt='cc';;
  1513. X            *)    if $contains '\-M' $sysman/cc.1 >/dev/null 2>&1 ; then
  1514. X                    if $contains '\-M' $sysman/cpp.1 >/dev/null 2>&1; then
  1515. X                        dflt='cc'
  1516. X                    else
  1517. X                        dflt='cc -M'
  1518. X                    fi
  1519. X                else
  1520. X                    dflt='cc'
  1521. X                fi;;
  1522. X            esac;;
  1523. X        esac;;
  1524. X    *)  dflt="$cc";;
  1525. X    esac
  1526. X    $cat <<'EOM'
  1527. XOn some systems the default C compiler will not resolve multiple global
  1528. Xreferences that happen to have the same name.  On some such systems the "Mcc"
  1529. Xcommand may be used to force these to be resolved.  On other systems a "cc -M"
  1530. Xcommand is required.  (Note that the -M flag on other systems indicates a
  1531. Xmemory model to use!) If you have the Gnu C compiler, you might wish to use
  1532. Xthat instead.
  1533. X
  1534. XEOM
  1535. X    rp="What command will force resolution on this system?"
  1536. X    . ./myread
  1537. X    cc="$ans"
  1538. Xelse
  1539. X    case "$cc" in
  1540. X    '') dflt=cc;;
  1541. X    *) dflt="$cc";;
  1542. X    esac
  1543. X    rp="Use which C compiler?"
  1544. X    . ./myread
  1545. X    cc="$ans"
  1546. Xfi
  1547. Xcase "$cc" in
  1548. Xgcc*) cpp=`./loc gcc-cpp $cpp $pth`;;
  1549. Xesac
  1550. X
  1551. X: What should the include directory be ?
  1552. Xecho " "
  1553. X$echo $n "Hmm...  $c"
  1554. Xcase "$usrinc" in
  1555. X'') dflt='/usr/include';;
  1556. X*) dflt=$usrinc;;
  1557. Xesac
  1558. Xincpath=''
  1559. Xmips_type=''
  1560. Xif $test -f /bin/mips && /bin/mips; then
  1561. X    echo "Looks like a MIPS system..."
  1562. X    $cat >usr.c <<'EOCP'
  1563. X#ifdef SYSTYPE_BSD43
  1564. X/bsd43
  1565. X#endif
  1566. XEOCP
  1567. X    if $cc -E usr.c > usr.out && $contains / usr.out >/dev/null 2>&1; then
  1568. X        dflt='/bsd43/usr/include'
  1569. X        incpath='/bsd43'
  1570. X        mips_type='BSD 4.3'
  1571. X    else
  1572. X        mips_type='System V'
  1573. X    fi
  1574. X    $rm -f usr.c usr.out
  1575. X    echo "and you're compiling with the $mips_type compiler and libraries."
  1576. Xelse
  1577. X    echo "Doesn't look like a MIPS system."
  1578. X    echo "exit 1" >mips
  1579. X    chmod +x mips
  1580. X    $eunicefix mips
  1581. Xfi
  1582. Xecho " "
  1583. Xfn=d/
  1584. Xrp='Where are the include files you want to use?'
  1585. X. ./getfile
  1586. Xusrinc="$ans"
  1587. X
  1588. X: Set private lib path
  1589. Xcase "$plibpth" in
  1590. X'') if mips; then
  1591. X        plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
  1592. X    else
  1593. X        plibpth="/usr/ccs/lib /usr/lib /usr/ucblib /usr/local/lib"
  1594. X    fi;;
  1595. Xesac
  1596. Xlibpth="$plibpth $libpth"
  1597. X
  1598. X: Looking for optional libraries
  1599. Xecho " "
  1600. Xecho "Checking for optional libraries..." >&4
  1601. Xcase "$libs" in
  1602. X' '|'') dflt='';;
  1603. X*) dflt="$libs";;
  1604. Xesac
  1605. Xcase "$libswanted" in
  1606. X'') libswanted='c_s';;
  1607. Xesac
  1608. Xfor thislib in $libswanted; do
  1609. X    case "$thislib" in
  1610. X    dbm) thatlib=ndbm;;
  1611. X    *_s) thatlib=NONE;;
  1612. X    *) thatlib="${thislib}_s";;
  1613. X    *) thatlib=NONE;;
  1614. X    esac
  1615. X    yyy="$incpath/usr/ccs/lib $incpath/usr/lib $incpath/usr/ucblib"
  1616. X    yyy="$yyy $incpath/usr/local/lib $incpath/lib"
  1617. X    xxx=`./loc lib$thislib.a X $yyy`
  1618. X    if $test -f $xxx; then
  1619. X        echo "Found -l$thislib."
  1620. X        case "$dflt" in
  1621. X        *-l$thislib*|*-l$thatlib*);;
  1622. X        *) dflt="$dflt -l$thislib";;
  1623. X        esac
  1624. X    else
  1625. X        xxx=`./loc lib$thislib.a X $libpth`
  1626. X        if $test -f $xxx; then
  1627. X            echo "Found $xxx."
  1628. X            case "$dflt" in
  1629. X            *$xxx*);;
  1630. X            *) dflt="$dflt $xxx";;
  1631. X            esac
  1632. X        else
  1633. X            xxx=`./loc Slib$thislib.a X $xlibpth`
  1634. X            if $test -f $xxx; then
  1635. X                echo "Found -l$thislib."
  1636. X                case "$dflt" in
  1637. X                *-l$thislib*|*-l$thatlib*);;
  1638. X                *) dflt="$dflt -l$thislib";;
  1639. X                esac
  1640. X            else
  1641. X                echo "No -l$thislib."
  1642. X            fi
  1643. X        fi
  1644. X    fi
  1645. Xdone
  1646. Xset X $dflt
  1647. Xshift
  1648. Xdflt="$*"
  1649. Xcase "$libs" in
  1650. X'') dflt="$dflt";;
  1651. X*) dflt="$libs";;
  1652. Xesac
  1653. Xcase "$dflt" in
  1654. X' '|'') dflt='none';;
  1655. Xesac
  1656. X
  1657. X$cat <<EOM
  1658. XSome versions of Unix support shared libraries, which make executables smaller
  1659. Xbut make load time slightly longer.
  1660. X
  1661. XOn some systems, mostly newer Unix System V's, the shared library is included
  1662. Xby putting the option "-lc_s" as the last thing on the cc command line when
  1663. Xlinking.  Other systems use shared libraries by default.  There may be other
  1664. Xlibraries needed to compile $package on your machine as well.  If your system
  1665. Xneeds the "-lc_s" option, include it here.  Include any other special libraries
  1666. Xhere as well.  Say "none" for none.
  1667. XEOM
  1668. X
  1669. Xecho " "
  1670. Xrp="Any additional libraries?"
  1671. X. ./myread
  1672. Xcase "$ans" in
  1673. Xnone) libs=' ';;
  1674. X*) libs="$ans";;
  1675. Xesac
  1676. X
  1677. Xusenm=true
  1678. Xrunnm=$usenm
  1679. Xcase "$reuseval" in
  1680. Xtrue) runnm=false;;
  1681. Xesac
  1682. X
  1683. X: nm options which may be necessary
  1684. Xcase "$nm_opt" in
  1685. X'') if $test -f /mach_boot; then
  1686. X        nm_opt=''
  1687. X    elif $test -d /usr/ccs/lib; then
  1688. X        nm_opt='-p'
  1689. X    elif $test -f /dgux; then
  1690. X        nm_opt='-p'
  1691. X    else
  1692. X        nm_opt=''
  1693. X    fi;;
  1694. Xesac
  1695. X
  1696. Xcase "$runnm" in
  1697. Xtrue)
  1698. X: get list of predefined functions in a handy place
  1699. Xecho " "
  1700. Xcase "$libc" in
  1701. X'') libc=unknown
  1702. X    case "$libs" in
  1703. X    *-lc_s*) libc=`./loc libc_s.a $libc $libpth`
  1704. X    esac
  1705. X    ;;
  1706. Xesac
  1707. Xlibpth="$plibpth $libpth"
  1708. Xlibnames='';
  1709. Xcase "$libs" in
  1710. X'') ;;
  1711. X*)  for thislib in $libs; do
  1712. X    case "$thislib" in
  1713. X    -l*)
  1714. X        thislib=`expr X$thislib : 'X-l\(.*\)'`
  1715. X        try=`./loc lib$thislib.a blurfl/dyick $libpth`
  1716. X        if test ! -f $try; then
  1717. X            try=`./loc lib$thislib blurfl/dyick $libpth`
  1718. X            if test ! -f $try; then
  1719. X                try=`./loc $thislib blurfl/dyick $libpth`
  1720. X                if test ! -f $try; then
  1721. X                    try=`./loc Slib$thislib.a blurfl/dyick $xlibpth`
  1722. X                    if test ! -f $try; then
  1723. X                        try=''
  1724. X                    fi
  1725. X                fi
  1726. X            fi
  1727. X        fi
  1728. X        libnames="$libnames $try"
  1729. X        ;;
  1730. X    *) libnames="$libnames $thislib" ;;
  1731. X    esac
  1732. X    done
  1733. X    ;;
  1734. Xesac
  1735. Xxxx=normal
  1736. Xcase "$libc" in
  1737. Xunknown)
  1738. X    set /usr/ccs/lib/libc.so
  1739. X    $test -r $1 || set /usr/lib/libc.so
  1740. X    $test -r $1 || set /usr/shlib/libc.so
  1741. X    $test -r $1 || set /usr/lib/libc.so.[0-9]*
  1742. X    $test -r $1 || set /lib/libsys_s.a
  1743. X    eval set \$$#
  1744. X    ;;
  1745. X*)
  1746. X    set blurfl
  1747. X    ;;
  1748. Xesac
  1749. Xif $test -r "$1"; then
  1750. X    echo "Your (shared) C library seems to be in $1."
  1751. X    libc="$1"
  1752. Xelif $test -r /lib/libc && $test -r /lib/clib; then
  1753. X    echo "Your C library seems to be in both /lib/clib and /lib/libc."
  1754. X    xxx=apollo
  1755. X    libc='/lib/clib /lib/libc'
  1756. X    if $test -r /lib/syslib; then
  1757. X        echo "(Your math library is in /lib/syslib.)"
  1758. X        libc="$libc /lib/syslib"
  1759. X    fi
  1760. Xelif $test -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
  1761. X    echo "Your C library seems to be in $libc, as you said before."
  1762. Xelif $test -r $incpath/usr/lib/libc.a; then
  1763. X    libc=$incpath/usr/lib/libc.a;
  1764. X    echo "Your C library seems to be in $libc.  That's fine."
  1765. Xelif $test -r /lib/libc.a; then
  1766. X    libc=/lib/libc.a;
  1767. X    echo "Your C library seems to be in $libc.  You're normal."
  1768. Xelse
  1769. X    if tans=`./loc libc.a blurfl/dyick $libpth`; $test -r "$tans"; then
  1770. X        :
  1771. X    elif tans=`./loc libc blurfl/dyick $libpth`; $test -r "$tans"; then
  1772. X        libnames="$libnames "`./loc clib blurfl/dyick $libpth`
  1773. X    elif tans=`./loc clib blurfl/dyick $libpth`; $test -r "$tans"; then
  1774. X        :
  1775. X    elif tans=`./loc Slibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
  1776. X        :
  1777. X    elif tans=`./loc Mlibc.a blurfl/dyick $xlibpth`; $test -r "$tans"; then
  1778. X        :
  1779. X    else
  1780. X        tans=`./loc Llibc.a blurfl/dyick $xlibpth`
  1781. X    fi
  1782. X    if $test -r "$tans"; then
  1783. X        echo "Your C library seems to be in $tans, of all places."
  1784. X        libc=$tans
  1785. X    else
  1786. X        libc='blurfl'
  1787. X    fi
  1788. Xfi
  1789. Xif $test $xxx = apollo -o -r "$libc" || (test -h "$libc") >/dev/null 2>&1; then
  1790. X    dflt="$libc"
  1791. X    cat <<EOM
  1792. X
  1793. XIf the guess above is wrong (which it might be if you're using a strange
  1794. Xcompiler, or your machine supports multiple models), you can override it here.
  1795. X
  1796. XEOM
  1797. Xelse
  1798. X    dflt=''
  1799. X    echo $libpth | tr ' ' '\012' | sort | uniq > libpath
  1800. X    cat >&4 <<EOM
  1801. XI can't seem to find your C library.  I've looked in the following places:
  1802. X
  1803. XEOM
  1804. X    $sed 's/^/    /' libpath
  1805. X    cat <<EOM
  1806. X
  1807. XNone of these seems to contain your C library. I need to get its name...
  1808. X
  1809. XEOM
  1810. Xfi
  1811. Xfn=f
  1812. Xrp='Where is your C library?'
  1813. X. ./getfile
  1814. Xlibc="$ans"
  1815. X
  1816. Xecho " "
  1817. Xecho $libc $libnames | tr ' ' '\012' | sort | uniq > libnames
  1818. Xset X `cat libnames`
  1819. Xshift
  1820. Xxxx=files
  1821. Xcase $# in 1) xxx=file; esac
  1822. Xecho "Extracting names from the following $xxx for later perusal:" >&4
  1823. Xecho " "
  1824. X$sed 's/^/    /' libnames >&4
  1825. Xecho " "
  1826. X$echo $n "This may take a while...$c" >&4
  1827. X
  1828. Xnm $nm_opt $* 2>/dev/null >libc.tmp
  1829. X$echo $n ".$c"
  1830. X$grep fprintf libc.tmp > libc.ptf
  1831. Xxscan='eval "<libc.ptf $com >libc.list"; $echo $n ".$c" >&4'
  1832. Xxrun='eval "<libc.tmp $com >libc.list"; echo "done" >&4'
  1833. Xif com="$sed -n -e 's/^.* [ADTS]  *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
  1834. X    eval $xscan;\
  1835. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1836. X        eval $xrun
  1837. Xelif com="$sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p'";\
  1838. X    eval $xscan;\
  1839. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1840. X        eval $xrun
  1841. Xelif com="$sed -n -e '/|UNDEF/d' -e '/FUNC..GL/s/^.*|__*//p'";\
  1842. X    eval $xscan;\
  1843. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1844. X        eval $xrun
  1845. Xelif com="$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p'";\
  1846. X    eval $xscan;\
  1847. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1848. X        eval $xrun
  1849. Xelif com="$sed -n -e 's/^_//' -e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p'";\
  1850. X    eval $xscan;\
  1851. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1852. X        eval $xrun
  1853. Xelif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p'";\
  1854. X    eval $xscan;\
  1855. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1856. X        eval $xrun
  1857. Xelif com="$grep '|' | $sed -n -e '/|COMMON/d' -e '/|DATA/d' \
  1858. X                -e '/ file/d' -e 's/^\([^     ]*\).*/\1/p'";\
  1859. X    eval $xscan;\
  1860. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1861. X        eval $xrun
  1862. Xelif com="$sed -n -e 's/^.*|FUNC |GLOB .*|//p' -e 's/^.*|FUNC |WEAK .*|//p'";\
  1863. X    eval $xscan;\
  1864. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1865. X        eval $xrun
  1866. Xelif com="$sed -n -e 's/^__//' -e '/|Undef/d' -e '/|Proc/s/ .*//p'";\
  1867. X    eval $xscan;\
  1868. X    $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1869. X        eval $xrun
  1870. Xelse
  1871. X    nm -p $* 2>/dev/null >libc.tmp
  1872. X    com="$sed -n -e 's/^.* [ADTS]  *_[_.]*//p' -e 's/^.* [ADTS] //p'";\
  1873. X    eval "<libc.tmp $com >libc.list"
  1874. X    if $contains '^fprintf$' libc.list >/dev/null 2>&1; then
  1875. X        nm_opt='-p'
  1876. X        echo "done" >&4
  1877. X    else
  1878. X        echo " "
  1879. X        echo "nm didn't seem to work right. Trying ar instead..." >&4
  1880. X        com=''
  1881. X        if ar t $libc > libc.tmp; then
  1882. X            for thisname in $libnames; do
  1883. X                ar t $thisname >>libc.tmp
  1884. X            done
  1885. X            $sed -e 's/\.o$//' < libc.tmp > libc.list
  1886. X            echo "Ok." >&4
  1887. X        else
  1888. X            echo "ar didn't seem to work right." >&4
  1889. X            echo "Maybe this is a Cray...trying bld instead..." >&4
  1890. X            if bld t $libc | $sed -e 's/.*\///' -e 's/\.o:.*$//' > libc.list; then
  1891. X                for thisname in $libnames; do
  1892. X                    bld t $libnames | \
  1893. X                    $sed -e 's/.*\///' -e 's/\.o:.*$//' >>libc.list
  1894. X                    ar t $thisname >>libc.tmp
  1895. X                done
  1896. X                echo "Ok." >&4
  1897. X            else
  1898. X                echo "That didn't work either.  Giving up." >&4
  1899. X                exit 1
  1900. X            fi
  1901. X        fi
  1902. X    fi
  1903. Xfi
  1904. Xnm_extract="$com"
  1905. Xif $test -f /lib/syscalls.exp; then
  1906. X    echo " "
  1907. X    echo "Also extracting names from /lib/syscalls.exp for good ole AIX..." >&4
  1908. X    $sed -n 's/^\([^     ]*\)[     ]*syscall$/\1/p' /lib/syscalls.exp >>libc.list
  1909. Xfi
  1910. X;;
  1911. Xesac
  1912. X$rm -f libnames libpath
  1913. X
  1914. X: determine optimize, if desired, or use for debug flag also
  1915. Xcase "$optimize" in
  1916. X' ') dflt="none";;
  1917. X'') dflt="-O";;
  1918. X*) dflt="$optimize";;
  1919. Xesac
  1920. X$cat <<EOH
  1921. X
  1922. XSome C compilers have problems with their optimizers, by default, $package
  1923. Xcompiles with the -O flag to use the optimizer.  Alternately, you might want
  1924. Xto use the symbolic debugger, which uses the -g flag (on traditional Unix
  1925. Xsystems).  Either flag can be specified here.  To use neither flag, specify
  1926. Xthe word "none".
  1927. X
  1928. XEOH
  1929. Xrp="What optimizer/debugger flag should be used?"
  1930. X. ./myread
  1931. Xoptimize="$ans"
  1932. Xcase "$optimize" in
  1933. X'none') optimize=" ";;
  1934. Xesac
  1935. X
  1936. Xcase "$ccflags" in
  1937. X'')    case "$optimize" in
  1938. X    *-g*) dflt="-DDEBUG";;
  1939. X    *)    dflt='';;
  1940. X    esac
  1941. X    case "$cc" in
  1942. X    *gcc*)    if test -d /etc/conf/kconfig.d &&
  1943. X          $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
  1944. X        then
  1945. X            dflt="$dflt -posix"
  1946. X        fi
  1947. X        ;;
  1948. X    esac
  1949. X    ;;
  1950. X*) dflt="$ccflags" ;;
  1951. Xesac
  1952. X
  1953. Xcase "$mips_type" in
  1954. X*BSD*) ;;
  1955. X'') ;;
  1956. X*) inclwanted="$inclwanted $usrinc/bsd";;
  1957. Xesac
  1958. Xfor thisincl in $inclwanted; do
  1959. X    if $test -d $thisincl; then
  1960. X        if $test x$thisincl != x$usrinc; then
  1961. X            case "$dflt" in
  1962. X            *$thisincl*);;
  1963. X            *) dflt="$dflt -I$thisincl";;
  1964. X            esac
  1965. X        fi
  1966. X    fi
  1967. Xdone
  1968. X
  1969. Xinctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
  1970. X    xxx=true;
  1971. Xelif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
  1972. X    xxx=true;
  1973. Xelse
  1974. X    xxx=false;
  1975. Xfi;
  1976. Xif $xxx; then
  1977. X    case "$dflt" in
  1978. X    *$2*);;
  1979. X    *) dflt="$dflt -D$2";;
  1980. X    esac;
  1981. Xfi'
  1982. X
  1983. Xif ./osf1; then
  1984. X    set signal.h __LANGUAGE_C__; eval $inctest
  1985. Xelse
  1986. X    set signal.h LANGUAGE_C; eval $inctest
  1987. Xfi
  1988. Xset signal.h NO_PROTOTYPE; eval $inctest
  1989. Xset signal.h _NO_PROTO; eval $inctest
  1990. X
  1991. Xcase "$dflt" in
  1992. X'') dflt=none;;
  1993. Xesac
  1994. X$cat <<EOH
  1995. X
  1996. XYour C compiler may want other flags.  For this question you should include
  1997. X-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
  1998. Xbut you should NOT include libraries or ld flags like -lwhatever.  If you
  1999. Xwant $package to honor its debug switch, you should include -DDEBUG here.
  2000. XTo use no flags, specify the word "none".
  2001. X
  2002. XEOH
  2003. Xset X $dflt
  2004. Xshift
  2005. Xdflt=${1+"$@"}
  2006. Xrp="Any additional cc flags?"
  2007. X. ./myread
  2008. Xcase "$ans" in
  2009. Xnone) ccflags='';;
  2010. X*) ccflags="$ans";;
  2011. Xesac
  2012. X
  2013. X: the following weeds options from ccflags that are of no interest to cpp
  2014. Xcppflags="$ccflags"
  2015. Xcase "$mips_type" in
  2016. X'');;
  2017. X*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
  2018. Xesac
  2019. Xcase "$cppflags" in
  2020. X'');;
  2021. X*)  set X $cppflags
  2022. X    cppflags=''
  2023. X    for flag
  2024. X    do
  2025. X        case $flag in
  2026. X        -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";;
  2027. X        esac
  2028. X    done
  2029. X    ;;
  2030. Xesac
  2031. X
  2032. X: flags used in final linking phase
  2033. Xcase "$ldflags" in
  2034. X'') if venix; then
  2035. X        dflt='-i -z'
  2036. X    else
  2037. X        dflt='none'
  2038. X    fi
  2039. X    ;;
  2040. X*) dflt="$ldflags";;
  2041. Xesac
  2042. Xecho " "
  2043. Xrp="Any additional ld flags (NOT including libraries)?"
  2044. X. ./myread
  2045. Xcase "$ans" in
  2046. Xnone) ldflags='';;
  2047. X*)    ldflags="$ans";;
  2048. Xesac
  2049. Xrmlist="$rmlist pdp11"
  2050. X
  2051. X: is a C symbol defined?
  2052. Xcsym='tlook=$1;
  2053. Xcase "$3" in
  2054. X-v) tf=libc.tmp; tc=""; tdc="";;
  2055. X-a) tf=libc.tmp; tc="[0]"; tdc=[];;
  2056. X*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
  2057. Xesac;
  2058. Xtx=yes;
  2059. Xcase "$reuseval-$4" in
  2060. Xtrue-) ;;
  2061. Xtrue-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
  2062. Xesac;
  2063. Xcase "$tx" in
  2064. Xyes)
  2065. X    case "$runnm" in
  2066. X    true)
  2067. X        if $contains $tlook $tf >/dev/null 2>&1;
  2068. X        then tval=true;
  2069. X        else tval=false;
  2070. X        fi;;
  2071. X    *)
  2072. X        echo "main() { extern int $1$tdc; printf(\"%d\", $1$tc); }" > t.c;
  2073. X        if $cc $ccflags -o t t.c $ldflags $libs >/dev/null 2>&1;
  2074. X        then tval=true;
  2075. X        else tval=false;
  2076. X        fi;
  2077. X        $rm -f t t.c;;
  2078. X    esac;;
  2079. X*)
  2080. X    case "$tval" in
  2081. X    $define) tval=true;;
  2082. X    *) tval=false;;
  2083. X    esac;;
  2084. Xesac;
  2085. Xeval "$2=$tval"'
  2086. X
  2087. X: set up the script used to warn in case of inconsistency
  2088. Xcat <<'EOSC' >whoa
  2089. Xdflt=y
  2090. Xecho " "
  2091. Xecho "*** WHOA THERE!!! ***" >&4
  2092. Xecho "    The $hint value for \$$var on this machine was \"$was\"!" >&4
  2093. Xrp="    Keep the $hint value?"
  2094. X. ./myread
  2095. Xcase "$ans" in
  2096. Xy) td=$was; tu=$was;;
  2097. Xesac
  2098. XEOSC
  2099. X
  2100. X: define an is-in-libc? function
  2101. Xinlibc='echo " "; td=$define; tu=$undef;
  2102. Xsym=$1; var=$2; eval "was=\$$2";
  2103. Xtx=yes;
  2104. Xcase "$reuseval$was" in
  2105. Xtrue) ;;
  2106. Xtrue*) tx=no;;
  2107. Xesac;
  2108. Xcase "$tx" in
  2109. Xyes)
  2110. X    set $sym tres -f;
  2111. X    eval $csym;
  2112. X    case "$tres" in
  2113. X    true)
  2114. X        echo "$sym() found." >&4;
  2115. X        case "$was" in $undef) . whoa; esac; eval "$var=\$td";;
  2116. X    *)
  2117. X        echo "$sym() NOT found." >&4;
  2118. X        case "$was" in $define) . whoa; esac; eval "$var=\$tu";;
  2119. X    esac;;
  2120. X*)
  2121. X    case "$was" in
  2122. X    $define) echo "$sym() found." >&4;;
  2123. X    *) echo "$sym() NOT found." >&4;;
  2124. X    esac;;
  2125. Xesac'
  2126. X
  2127. X: see if chsize exists
  2128. Xset chsize d_chsize
  2129. Xeval $inlibc
  2130. X
  2131. X: see if ftruncate exists
  2132. Xset ftruncate d_ftrncate
  2133. Xeval $inlibc
  2134. X
  2135. X: see how we invoke the C preprocessor
  2136. Xecho " "
  2137. Xecho "Now, how can we feed standard input to your C preprocessor..." >&4
  2138. Xcat <<'EOT' >testcpp.c
  2139. X#define ABC abc
  2140. X#define XYZ xyz
  2141. XABC.XYZ
  2142. XEOT
  2143. Xcd ..
  2144. Xecho 'cat >.$$.c; '"$cc"' -E ${1+"$@"} .$$.c; rm .$$.c' >cppstdin
  2145. Xchmod 755 cppstdin
  2146. Xwrapper=`pwd`/cppstdin
  2147. Xcd UU
  2148. Xif $test "X$cppstdin" != "X" && \
  2149. X    $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1 && \
  2150. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2151. X    echo "You used to use $cppstdin $cppminus so we'll use that again."
  2152. Xelif $test "$cc" = gcc && \
  2153. X    (echo "Using gcc, eh?  We'll try to force gcc -E using a wrapper..."; \
  2154. X    $wrapper <testcpp.c >testcpp.out 2>&1; \
  2155. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1) ; then
  2156. X    echo "Yup, we can."
  2157. X    cppstdin="$wrapper"
  2158. X    cppminus='';
  2159. Xelif echo 'Maybe "'"$cc"' -E" will work...'; \
  2160. X    $cc -E <testcpp.c >testcpp.out 2>&1; \
  2161. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2162. X    echo "Yup, it does."
  2163. X    cppstdin="$cc -E"
  2164. X    cppminus='';
  2165. Xelif echo 'Nope...maybe "'"$cc"' -E -" will work...'; \
  2166. X    $cc -E - <testcpp.c >testcpp.out 2>&1; \
  2167. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2168. X    echo "Yup, it does."
  2169. X    cppstdin="$cc -E"
  2170. X    cppminus='-';
  2171. Xelif echo 'No such luck, maybe "'$cpp'" will work...'; \
  2172. X    $cpp <testcpp.c >testcpp.out 2>&1; \
  2173. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2174. X    echo "It works!"
  2175. X    cppstdin="$cpp"
  2176. X    cppminus='';
  2177. Xelif echo 'Nixed again...maybe "'$cpp' -" will work...'; \
  2178. X    $cpp - <testcpp.c >testcpp.out 2>&1; \
  2179. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2180. X    echo "Hooray, it works!  I was beginning to wonder."
  2181. X    cppstdin="$cpp"
  2182. X    cppminus='-';
  2183. Xelif echo 'Nope...maybe "'"$cc"' -P" will work...'; \
  2184. X    $cc -P <testcpp.c >testcpp.out 2>&1; \
  2185. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2186. X    echo "Yipee, that works!"
  2187. X    cppstdin="$cc -P"
  2188. X    cppminus='';
  2189. Xelif echo 'Nope...maybe "'"$cc"' -P -" will work...'; \
  2190. X    $cc -P - <testcpp.c >testcpp.out 2>&1; \
  2191. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2192. X    echo "At long last!"
  2193. X    cppstdin="$cc -P"
  2194. X    cppminus='-';
  2195. Xelif echo 'Uh-uh.  Time to get fancy.  Trying a wrapper...'; \
  2196. X    $wrapper <testcpp.c >testcpp.out 2>&1; \
  2197. X    $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2198. X    cppstdin="$wrapper"
  2199. X    cppminus=''
  2200. X    echo "Eureka!"
  2201. Xelse
  2202. X    dflt=''
  2203. X    rp="No dice.  I can't find a C preprocessor.  Name one:"
  2204. X    . ./myread
  2205. X    cppstdin="$ans"
  2206. X    $cppstdin <testcpp.c >testcpp.out 2>&1
  2207. X    if $contains 'abc.*xyz' testcpp.out >/dev/null 2>&1 ; then
  2208. X        echo "OK, that will do." >&4
  2209. X    else
  2210. Xecho "Sorry, I can't get that to work.  Go find one and rerun Configure." >&4
  2211. X        exit 1
  2212. X    fi
  2213. Xfi
  2214. Xcase "$cppstdin" in
  2215. X"$wrapper") ;;
  2216. X*) $rm -f $wrapper;;
  2217. Xesac
  2218. X$rm -f testcpp.c testcpp.out
  2219. X
  2220. X: determine filename position in cpp output
  2221. Xecho " "
  2222. Xecho "Computing filename position in cpp output for #include directives..." >&4
  2223. Xecho '#include <stdio.h>' > foo.c
  2224. X$cat >fieldn <<EOF
  2225. X$startsh
  2226. X$cppstdin $cppminus $cppflags <foo.c 2>/dev/null | \
  2227. X$grep '^[     ]*#.*stdio\.h' | \
  2228. Xwhile read cline; do
  2229. X    pos=1
  2230. X    set \$cline
  2231. X    while $test \$# -gt 0; do
  2232. X        if $test -r \`echo \$1 | $tr -d '"'\`; then
  2233. X            echo "\$pos"
  2234. X            exit 0
  2235. X        fi
  2236. X        shift
  2237. X        pos=\`expr \$pos + 1\`
  2238. X    done
  2239. Xdone
  2240. XEOF
  2241. Xchmod +x fieldn
  2242. Xfieldn=`./fieldn`
  2243. X$rm -f foo.c fieldn
  2244. Xcase $fieldn in
  2245. X'') pos='???';;
  2246. X1) pos=first;;
  2247. X2) pos=second;;
  2248. X3) pos=third;;
  2249. X*) pos="${fieldn}th";;
  2250. Xesac
  2251. Xecho "Your cpp writes the filename in the $pos field of the line."
  2252. X
  2253. X: locate header file
  2254. X$cat >findhdr <<EOF
  2255. X$startsh
  2256. Xwanted=\$1
  2257. Xname=''
  2258. Xif test -f $usrinc/\$wanted; then
  2259. X    echo "$usrinc/\$wanted"
  2260. X    exit 0
  2261. Xfi
  2262. Xawkprg='{ print \$$fieldn }'
  2263. Xecho "#include <\$wanted>" > foo\$\$.c
  2264. X$cppstdin $cppminus $cppflags < foo\$\$.c 2>/dev/null | \
  2265. X$grep "^[     ]*#.*\$wanted" | \
  2266. Xwhile read cline; do
  2267. X    name=\`echo \$cline | $awk "\$awkprg" | $tr -d '"'\`
  2268. X    case "\$name" in
  2269. X    */\$wanted) echo "\$name"; exit 0;;
  2270. X    *) name='';;
  2271. X    esac;
  2272. Xdone;
  2273. X$rm -f foo\$\$.c;
  2274. Xcase "\$name" in
  2275. X'') exit 1;;
  2276. Xesac
  2277. XEOF
  2278. Xchmod +x findhdr
  2279. X
  2280. X: see if there are directory access routines out there
  2281. Xecho " "
  2282. Xif $test `./findhdr ndir.h` && \
  2283. X      ( $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ); then
  2284. X    echo "Ndir library found." >&4
  2285. X    if $test -r /usr/lib/libndir.a; then
  2286. X        libndir='-lndir'
  2287. X    else
  2288. X        libndir="/usr/local/lib/libndir.a"
  2289. X    fi
  2290. X    d_libndir="$define"
  2291. X    d_usendir="$undef"
  2292. X    ndirc=''
  2293. X    ndiro=''
  2294. Xelse
  2295. X    libndir=''
  2296. X    d_libndir="$undef"
  2297. X    if set readdir val -f; eval $csym; $val; then
  2298. X    echo "No ndir library found, but you have readdir() so we'll use that." >&4
  2299. X        d_usendir="$undef"
  2300. X        ndirc=''
  2301. X        ndiro=''
  2302. X    else
  2303. X        echo "No ndir library found--using ./ndir.c." >&4
  2304. X        d_usendir="$define"
  2305. X        ndirc='ndir.c'
  2306. X        ndiro='ndir.o'
  2307. X    fi
  2308. Xfi
  2309. X
  2310. X: see if memcmp exists
  2311. Xset memcmp d_memcmp
  2312. Xeval $inlibc
  2313. X
  2314. X: see if memcpy exists
  2315. Xset memcpy d_memcpy
  2316. Xeval $inlibc
  2317. X
  2318. X: see if memset exists
  2319. Xset memset d_memset
  2320. Xeval $inlibc
  2321. X
  2322. X: function used to set $1 to $val
  2323. Xsetvar='var=$1; eval "was=\$$1"; td=$define; tu=$undef;
  2324. Xcase "$val$was" in
  2325. X$define$undef) . whoa; eval "$var=\$td";;
  2326. X$undef$define) . whoa; eval "$var=\$tu";;
  2327. X*) eval "$var=$val";;
  2328. Xesac'
  2329. X
  2330. X: see if we need -ljobs and if we have sigset, etc.
  2331. Xecho " "
  2332. Xif $test -r /usr/lib/libjobs.a || $test -r /usr/local/lib/libjobs.a ; then
  2333. X    echo "Jobs library found." >&4
  2334. X    val="$undef"
  2335. X    jobslib='-ljobs'
  2336. Xelse
  2337. X    if bsd; then
  2338. X        echo "No jobs library found. (I suppose this is at least 4.2...)" >&4
  2339. X    else
  2340. X        echo "No jobs library found. (That's okay, we all have our faults.)" >&4
  2341. X    fi
  2342. X    val="$define"
  2343. X    jobslib=''
  2344. Xfi
  2345. Xset d_normsig
  2346. Xeval $setvar
  2347. X
  2348. X: check for void type
  2349. Xecho " "
  2350. X$echo "Checking to see how well your C compiler groks the void type..."
  2351. X$cat >void.c <<'EOCP'
  2352. Xvoid main(){;}
  2353. XEOCP
  2354. Xif $cc -c void.c >/dev/null 2>&1 ; then
  2355. X    d_novoid="$undef"
  2356. X    $echo "Yup, it does."
  2357. Xelse
  2358. X    d_novoid="$define"
  2359. X    $echo "Nope, it doesn't (boo hiss).  I will substitute int."
  2360. Xfi
  2361. X$rm void.*
  2362. X
  2363. X: see if rename exists
  2364. Xset rename d_rename
  2365. Xeval $inlibc
  2366. X
  2367. X: see if sighold exists
  2368. Xset sighold d_sighold
  2369. Xeval $inlibc
  2370. X
  2371. X: see which of string.h or strings.h is needed
  2372. Xecho " "
  2373. Xstrings=`./findhdr string.h`
  2374. Xif $test "$strings" && $test -r "$strings"; then
  2375. X    echo "Using <string.h> instead of <strings.h>." >&4
  2376. X    val="$define"
  2377. Xelse
  2378. X    val="$undef"
  2379. X    strings=`./findhdr strings.h`
  2380. X    if $test "$strings" && $test -r "$strings"; then
  2381. X        echo "Using <strings.h> instead of <string.h>." >&4
  2382. X    else
  2383. X        echo "No string header found -- You'll surely have problems." >&4
  2384. X    fi
  2385. Xfi
  2386. Xset i_string
  2387. Xeval $setvar
  2388. Xcase "$i_string" in
  2389. X"$undef") strings=`./findhdr strings.h`;;
  2390. X*)      strings=`./findhdr string.h`;;
  2391. Xesac
  2392. X
  2393. X: index or strchr
  2394. Xecho " "
  2395. Xif set index val -f; eval $csym; $val; then
  2396. X    if set strchr val -f d_strchr; eval $csym; $val; then
  2397. X        if $contains strchr "$strings" >/dev/null 2>&1 ; then
  2398. X            val="$define"
  2399. X            echo "strchr() found." >&4
  2400. X        else
  2401. X            val="$undef"
  2402. X            echo "index() found." >&4
  2403. X        fi
  2404. X    else
  2405. X        val="$undef"
  2406. X        echo "index() found." >&4
  2407. X    fi
  2408. Xelse
  2409. X    if set strchr val -f d_strchr; eval $csym; $val; then
  2410. X        val="$define"
  2411. X        echo "strchr() found." >&4
  2412. X    else
  2413. X        echo "No index() or strchr() found!" >&4
  2414. X        val="$undef"
  2415. X    fi
  2416. Xfi
  2417. Xset d_strchr
  2418. Xeval $setvar
  2419. X
  2420. X: check if syslog is available and desired
  2421. Xif set syslog val -f; eval $csym; $val; then
  2422. X    case "$d_syslog" in
  2423. X    $define) dflt=y ;;
  2424. X    *)  dflt=n ;;
  2425. X    esac
  2426. X    $echo " "
  2427. X    $echo "Mthreads can either use a custom log file or the syslog functions for"
  2428. X    $echo "maintaining its log messages."
  2429. X    rp="Would you prefer to use syslog?"
  2430. X    . myread
  2431. X    case $ans in
  2432. X    n*) syslog=LOG_NEWS
  2433. X        d_syslog="$undef"
  2434. X        ;;
  2435. X    *)  case "$syslog" in
  2436. X        LOG_*) dflt="$syslog" ;;
  2437. X        *)     dflt=LOG_NEWS ;;
  2438. X        esac
  2439. X        $cat <<'EOM'
  2440. X
  2441. XIf your syslog has LOG_NEWS or LOG_DAEMON, you'll probably want to use
  2442. Xone of these for your logging.  If it doesn't, accept the default and
  2443. Xwe'll figure that out later.
  2444. XEOM
  2445. X        rp="Syslog priority to use?"
  2446. X        . myread
  2447. X        syslog="$ans"
  2448. X        d_syslog="$define"
  2449. X        ;;
  2450. X    esac
  2451. Xelse
  2452. X        syslog=LOG_NEWS
  2453. X    d_syslog="$undef"
  2454. Xfi
  2455. X
  2456. X: see if usleep exists
  2457. Xset usleep d_usleep
  2458. Xeval $inlibc
  2459. X
  2460. X: backward compatibility for d_hvfork
  2461. Xif test X$d_hvfork != X; then
  2462. X    d_vfork="$d_hvfork"
  2463. X    d_hvfork=''
  2464. Xfi
  2465. X: see if there is a vfork
  2466. Xset vfork d_vfork
  2467. Xeval $inlibc
  2468. X
  2469. X: preserve RCS keywords in files with variable substitution, grrr
  2470. XId='$Id'
  2471. XLog='$Log'
  2472. X
  2473. X: is AFS running?
  2474. Xecho " "
  2475. Xif test -d /afs; then
  2476. X    echo "AFS may be running... I'll be extra cautious then..." >&4
  2477. X    afs=true
  2478. Xelse
  2479. X    echo "AFS does not seem to be running..." >&4
  2480. X    afs=false
  2481. Xfi
  2482. X
  2483. X: determine where manual pages go
  2484. X$cat <<EOM
  2485. X
  2486. X$package has manual pages available in source form.
  2487. XEOM
  2488. Xcase "$nroff" in
  2489. Xnroff)
  2490. X    echo "However, you don't have nroff, so they're probably useless to you."
  2491. X    case "$mansrc" in
  2492. X    '') mansrc="none";;
  2493. X    esac;;
  2494. Xesac
  2495. Xecho "If you don't want the manual sources installed, answer 'none'."
  2496. Xcase "$mansrc" in
  2497. X'')
  2498. X    lookpath='/usr/local/man/man1 /usr/local/man/man1 /usr/man/manl'
  2499. X    lookpath="$lookpath /usr/man/local/man1 /usr/man/l_man/man1"
  2500. X    lookpath="$lookpath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
  2501. X    lookpath="$lookpath /usr/man/man.L"
  2502. X    mansrc=`./loc . $lookpath`
  2503. X    if $test -d "$mansrc"; then
  2504. X        dflt="$mansrc"
  2505. X    else
  2506. X        dflt="$sysman"
  2507. X    fi
  2508. X    ;;
  2509. X*)  dflt="$mansrc"
  2510. X    ;;
  2511. Xesac
  2512. Xecho " "
  2513. Xfn=dn~
  2514. Xrp='Where do the manual pages (source) go?'
  2515. X. ./getfile
  2516. Xmansrc="$ans"
  2517. Xmansrcexp="$ansexp"
  2518. Xif $afs; then
  2519. X    $cat <<EOM
  2520. X
  2521. XSince you are running AFS, I need to distinguish the directory in which
  2522. Xmanual pages reside from the directory in which they are installed (and from
  2523. Xwhich they are presumably copied to the former directory by occult means).
  2524. X
  2525. XEOM
  2526. X    case "$installmansrc" in
  2527. X    '') dflt=`echo $mansrcexp | sed 's#^/afs/#/afs/.#'`;;
  2528. X    *) dflt="$installmansrc";;
  2529. X    esac
  2530. X    fn=de~
  2531. X    rp='Where will man pages be installed?'
  2532. X    . ./getfile
  2533. X    installmansrc="$ans"
  2534. Xelse
  2535. X    installmansrc="$mansrcexp"
  2536. Xfi
  2537. X
  2538. X
  2539. Xcase "$mansrc" in
  2540. X'') manext='0';;
  2541. X*l) manext=l;;
  2542. X*n) manext=n;;
  2543. X*o) manext=l;;
  2544. X*p) manext=n;;
  2545. X*C) manext=C;;
  2546. X*L) manext=L;;
  2547. X*L1) manext=L1;;
  2548. X*L8) manext=L8;;
  2549. X*8) manext=8;;
  2550. X*) manext=1;;
  2551. Xesac
  2552. X
  2553. X: determine where private executables go
  2554. Xcase "$privlib" in
  2555. X'')    dflt=/usr/lib/$package
  2556. X    $test -d /usr/local/lib && dflt=/usr/local/lib/$package
  2557. X    $test -d /local/lib && dflt=/local/lib/$package ;;
  2558. X*)    dflt="$privlib" ;;
  2559. Xesac
  2560. X$cat <<EOM
  2561. X
  2562. XMthreads and its support files should be installed into its own directory.
  2563. XIf you like, you can choose the same directory as trn's private library
  2564. Xfiles.
  2565. X
  2566. XEOM
  2567. Xfn=d~+
  2568. Xrp='Pathname where mthreads and its files will reside?'
  2569. X. ./getfile
  2570. Xprivlib="$ans"
  2571. Xprivlibexp="$ansexp"
  2572. Xif $afs; then
  2573. X    $cat <<EOM
  2574. X
  2575. XSince you are running AFS, I need to distinguish the directory in which
  2576. Xthe files reside from the directory in which they are installed (and from
  2577. Xwhich they are presumably copied to the former directory by occult means).
  2578. X
  2579. XEOM
  2580. X    case "$installprivlib" in
  2581. X    '') dflt=`echo $privlibexp | sed 's#^/afs/#/afs/.#'`;;
  2582. X    *) dflt="$installprivlib";;
  2583. X    esac
  2584. X    fn=de~
  2585. X    rp='Where will mthreads and its files be installed?'
  2586. X    . ./getfile
  2587. X    installprivlib="$ans"
  2588. Xelse
  2589. X    installprivlib="$privlibexp"
  2590. Xfi
  2591. X
  2592. X: get news administrator name
  2593. Xcase "$newsadmin" in
  2594. X'')
  2595. X    if $contains "^news:" /etc/passwd >/dev/null 2>&1 ; then
  2596. X        dflt=news
  2597. X    elif $contains "^usenet:" /etc/passwd >/dev/null 2>&1 ; then
  2598. X        dflt=usenet
  2599. X    elif eunice; then
  2600. X        dflt=system
  2601. X    else
  2602. X        dflt=root
  2603. X    fi
  2604. X    ;;
  2605. X*)
  2606. X    dflt="$newsadmin"
  2607. X    ;;
  2608. Xesac
  2609. X$cat <<'EOM'
  2610. XMany systems keep their news in a private directory, or have a non-superuser
  2611. Xin charge of administering news.  (If you don't have such a user, take the
  2612. Xdefault answer.)  I need the login name (not directory) which is used for
  2613. Xnews administration.
  2614. X
  2615. XEOM
  2616. Xrp="News admin login?"
  2617. X. ./myread
  2618. Xnewsadmin="$ans"
  2619. Xcase "$newsadmin" in
  2620. Xroot) val="$undef" ;;
  2621. X*) val="$define" ;;
  2622. Xesac
  2623. Xset d_newsadm
  2624. Xeval $setvar
  2625. X
  2626. X: locate news spool directory
  2627. Xif $test "X$d_nntp" = "X$define" ; then
  2628. X    newsspool="/tmp"
  2629. Xelse
  2630. X    case "$newsspool" in
  2631. X    '') dflt=/usr/spool/news;;
  2632. X    *) dflt="$newsspool";;
  2633. X    esac
  2634. X    $echo " "
  2635. X    fn=d~
  2636. X    rp='Where is news spooled?'
  2637. X    . ./getfile
  2638. X    newsspool="$ans"
  2639. Xfi
  2640. X
  2641. X: see if signal is declared as pointer to function returning int or void
  2642. Xecho " "
  2643. Xxxx=`./findhdr signal.h`
  2644. X$test "$xxx" && $cppstdin $cppminus $cppflags < $xxx >$$.tmp 2>/dev/null
  2645. Xif $contains 'int.*\*[     ]*signal' $$.tmp >/dev/null 2>&1 ; then
  2646. X    echo "You have int (*signal())() instead of void." >&4
  2647. X    val="$undef"
  2648. X    signal_t="int"
  2649. Xelif $contains 'void.*\*[     ]*signal' $$.tmp >/dev/null 2>&1 ; then
  2650. X    echo "You have void (*signal())() instead of int." >&4
  2651. X    val="$define"
  2652. X    signal_t="void"
  2653. Xelif $contains 'extern[     ]*[(\*]*signal' $$.tmp >/dev/null 2>&1 ; then
  2654. X    echo "You have int (*signal())() instead of void." >&4
  2655. X    val="$undef"
  2656. X    signal_t="int"
  2657. Xelse
  2658. X    case "$d_voidsig" in
  2659. X    '')
  2660. X    echo "I can't determine whether signal handler returns void or int..." >&4
  2661. X        dflt=void
  2662. X        rp="What type does your signal handler returns?"
  2663. X        . ./myread
  2664. X        case "$ans" in
  2665. X        void) val="$define"; signal_t="void";;
  2666. X        *) val="$undef"; signal_t="int";;
  2667. X        esac;;
  2668. X    *) echo "As you already told me, signal handler returns $signal_t." >&4;;
  2669. X    esac
  2670. Xfi
  2671. Xset d_voidsig
  2672. Xeval $setvar
  2673. X$rm -f $$.tmp
  2674. X
  2675. X: check on .thread file placement
  2676. Xcase "$threaddir" in
  2677. X'')    if $test "X$d_nntp" = "X$define" ; then
  2678. X        dflt="/usr/spool/threads"
  2679. X    else
  2680. X        dflt="$newsspool"
  2681. X    fi
  2682. X    ;;
  2683. X*)    dflt="$threaddir";;
  2684. Xesac
  2685. X$echo " "
  2686. X$echo "$spackage needs to know the base directory for the thread files"
  2687. X$echo "on your system."
  2688. Xrp="Where do thread files reside?"
  2689. X. ./myread
  2690. Xthreaddir="$ans"
  2691. X
  2692. X: see if this is a dirent system
  2693. Xecho " "
  2694. Xif xinc=`./findhdr dirent.h`; $test "$xinc"; then
  2695. X    val="$define"
  2696. X    echo "<dirent.h> found." >&4
  2697. Xelse
  2698. X    val="$undef"
  2699. X    if xinc=`./findhdr sys/dir.h`; $test "$xinc"; then
  2700. X        echo "<sys/dir.h> found." >&4
  2701. X        echo " "
  2702. X    else
  2703. X        xinc=`./findhdr sys/ndir.h`
  2704. X    fi
  2705. X    echo "<dirent.h> NOT found." >&4
  2706. Xfi
  2707. Xset i_dirent
  2708. Xeval $setvar
  2709. X
  2710. X: define an alternate in-header-list? function
  2711. Xinhdr='echo " "; td=$define; tu=$undef; yyy=$@;
  2712. Xcont=true; xxf="echo \"<\$1> found.\" >&4";
  2713. Xcase $# in 2) xxnf="echo \"<\$1> NOT found.\" >&4";;
  2714. X*) xxnf="echo \"<\$1> NOT found, ...\" >&4";;
  2715. Xesac;
  2716. Xcase $# in 4) instead=instead;; *) instead="at last";; esac;
  2717. Xwhile $test "$cont"; do
  2718. X    xxx=`./findhdr $1`
  2719. X    var=$2; eval "was=\$$2";
  2720. X    if $test "$xxx" && $test -r "$xxx";
  2721. X    then eval $xxf;
  2722. X        eval "case \"\$$var\" in $undef) . whoa; esac"; eval "$var=\$td";
  2723. X        cont="";
  2724. X    else eval $xxnf;
  2725. X        eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu"; fi;
  2726. X    set $yyy; shift; shift; yyy=$@;
  2727. X    case $# in 0) cont="";;
  2728. X    2) xxf="echo \"but I found <\$1> $instead.\" >&4";
  2729. X        xxnf="echo \"and I did not find <\$1> either.\" >&4";;
  2730. X    *) xxf="echo \"but I found <\$1\> instead.\" >&4";
  2731. X        xxnf="echo \"there is no <\$1>, ...\" >&4";;
  2732. X    esac;
  2733. Xdone;
  2734. Xwhile $test "$yyy";
  2735. Xdo set $yyy; var=$2; eval "was=\$$2";
  2736. X    eval "case \"\$$var\" in $define) . whoa; esac"; eval "$var=\$tu";
  2737. X    set $yyy; shift; shift; yyy=$@;
  2738. Xdone'
  2739. X
  2740. X: see if stdlib is available
  2741. Xset stdlib.h i_stdlib
  2742. Xeval $inhdr
  2743. X
  2744. X: see if this is an sysdir system
  2745. Xset sys/dir.h i_sysdir
  2746. Xeval $inhdr
  2747. X
  2748. X: see if this is an sysndir system
  2749. Xset sys/ndir.h i_sysndir
  2750. Xeval $inhdr
  2751. X
  2752. X: see if we should include time.h, sys/time.h, or both
  2753. Xecho " "
  2754. Xecho "Testing to see if we should include <time.h>, <sys/time.h> or both." >&4
  2755. X$echo $n "I'm now running the test program...$c"
  2756. X$cat >try.c <<'EOCP'
  2757. X#include <sys/types.h>
  2758. X#ifdef I_TIME
  2759. X#include <time.h>
  2760. X#endif
  2761. X#ifdef I_SYSTIME
  2762. X#include <sys/time.h>
  2763. X#endif
  2764. X#ifdef I_SYSSELECT
  2765. X#include <sys/select.h>
  2766. X#endif
  2767. Xmain()
  2768. X{
  2769. X    struct tm foo;
  2770. X#ifdef S_TIMEVAL
  2771. X    struct timeval bar;
  2772. X#endif
  2773. X#ifdef S_TIMEZONE
  2774. X    struct timezone tzp;
  2775. X#endif
  2776. X    if (foo.tm_sec == foo.tm_sec)
  2777. X        exit(0);
  2778. X#ifdef S_TIMEVAL
  2779. X    if (bar.tv_sec == bar.tv_sec)
  2780. X        exit(0);
  2781. X#endif
  2782. X    exit(1);
  2783. X}
  2784. XEOCP
  2785. Xflags=''
  2786. Xfor s_timezone in '-DS_TIMEZONE' ''; do
  2787. Xsysselect=''
  2788. Xfor s_timeval in '-DS_TIMEVAL' ''; do
  2789. Xfor i_time in '' '-DI_TIME'; do
  2790. Xfor i_systime in '-DI_SYSTIME' ''; do
  2791. X    case "$flags" in
  2792. X    '') $echo $n ".$c"
  2793. X        if $cc $ccflags \
  2794. X        $i_time $i_systime $sysselect $s_timeval $s_timezone \
  2795. X        try.c -o try >/dev/null 2>&1 ; then
  2796. X            set X $i_time $i_systime $sysselect $s_timeval
  2797. X            shift
  2798. X            flags="$*"
  2799. X            echo " "
  2800. X            $echo $n "Succeeded with $flags$c"
  2801. X        fi
  2802. X        ;;
  2803. X    esac
  2804. Xdone
  2805. Xdone
  2806. Xdone
  2807. Xdone
  2808. Xecho " "
  2809. Xcase "$flags" in
  2810. X*I_TIME*) i_time="$define"
  2811. X    echo "We'll include <time.h>." >&4;;
  2812. X*) i_time="$undef";;
  2813. Xesac
  2814. Xcase "$flags" in
  2815. X*I_SYSTIME*) i_systime="$define"
  2816. X    echo "We'll include <sys/time.h>." >&4;;
  2817. X*) i_systime="$undef";;
  2818. Xesac
  2819. X$rm -f try.c try
  2820. X
  2821. X: see if this is a unistd.h system
  2822. Xset unistd.h i_unistd
  2823. Xeval $inhdr
  2824. X
  2825. X: see if this is a vfork system
  2826. Xset vfork.h i_vfork
  2827. Xeval $inhdr
  2828. X
  2829. X: end of configuration questions
  2830. Xecho " "
  2831. Xecho "End of configuration questions."
  2832. Xecho " "
  2833. X
  2834. X: back to where it started
  2835. Xif test -d ../UU; then
  2836. X    mv filexp ..
  2837. X    cd ..
  2838. Xfi
  2839. X
  2840. X: configuration may be patched via a 'config.over' file
  2841. Xif $test -f config.over; then
  2842. X    echo " "
  2843. X    dflt=y
  2844. X    rp='I see a config.over file.  Do you wish to load it?'
  2845. X    . UU/myread
  2846. X    case "$ans" in
  2847. X    n*) echo "OK, I'll ignore it.";;
  2848. X    *)    . ./config.over
  2849. X        echo "Configuration override changes have been loaded."
  2850. X        ;;
  2851. X    esac
  2852. Xfi
  2853. X
  2854. X: create config.sh file
  2855. Xecho " "
  2856. Xecho "Creating config.sh..." >&4
  2857. X$spitshell <<EOT >config.sh
  2858. X$startsh
  2859. X#
  2860. X# This file was produced by running the Configure script. It holds all the
  2861. X# definitions figured out by Configure. Should you modify one of these values,
  2862. X# do not forget to propagate your changes by running "Configure -der". You may
  2863. X# instead choose to run each of the .SH files by yourself, or "Configure -S".
  2864. X#
  2865. X
  2866. X# Configuration time: $cf_time
  2867. X# Configured by: $cf_by
  2868. X# Target system: $myuname
  2869. X
  2870. Xd_bsd='$d_bsd'
  2871. Xd_eunice='$d_eunice'
  2872. Xd_xenix='$d_xenix'
  2873. Xeunicefix='$eunicefix'
  2874. XMcc='$Mcc'
  2875. Xawk='$awk'
  2876. Xcat='$cat'
  2877. Xcpp='$cpp'
  2878. Xdate='$date'
  2879. Xecho='$echo'
  2880. Xegrep='$egrep'
  2881. Xexpr='$expr'
  2882. Xgcc='$gcc'
  2883. Xgrep='$grep'
  2884. Xlint='$lint'
  2885. Xmail='$mail'
  2886. Xmkdir='$mkdir'
  2887. Xmv='$mv'
  2888. Xnroff='$nroff'
  2889. Xrm='$rm'
  2890. Xsed='$sed'
  2891. Xsendmail='$sendmail'
  2892. Xsort='$sort'
  2893. Xtest='$test'
  2894. Xtr='$tr'
  2895. Xuname='$uname'
  2896. Xuniq='$uniq'
  2897. Xuuname='$uuname'
  2898. Xvi='$vi'
  2899. Xhint='$hint'
  2900. Xmyuname='$myuname'
  2901. XId='$Id'
  2902. XLog='$Log'
  2903. Xactive='$active'
  2904. Xacttimes='$acttimes'
  2905. Xd_acttimes='$d_acttimes'
  2906. Xmyactive='$myactive'
  2907. Xafs='$afs'
  2908. Xcc='$cc'
  2909. Xccflags='$ccflags'
  2910. Xcppflags='$cppflags'
  2911. Xldflags='$ldflags'
  2912. Xlkflags='$lkflags'
  2913. Xoptimize='$optimize'
  2914. Xcf_by='$cf_by'
  2915. Xcf_time='$cf_time'
  2916. Xcontains='$contains'
  2917. Xcppminus='$cppminus'
  2918. Xcppstdin='$cppstdin'
  2919. Xd_chsize='$d_chsize'
  2920. Xd_ftrncate='$d_ftrncate'
  2921. Xd_memcmp='$d_memcmp'
  2922. Xd_memcpy='$d_memcpy'
  2923. Xd_memset='$d_memset'
  2924. Xd_newsadm='$d_newsadm'
  2925. Xnewsadmin='$newsadmin'
  2926. Xd_nntp='$d_nntp'
  2927. Xservername='$servername'
  2928. Xd_normsig='$d_normsig'
  2929. Xjobslib='$jobslib'
  2930. Xd_novoid='$d_novoid'
  2931. Xvoid='$void'
  2932. Xd_portable='$d_portable'
  2933. Xd_rename='$d_rename'
  2934. Xd_sighold='$d_sighold'
  2935. Xd_strchr='$d_strchr'
  2936. Xd_syslog='$d_syslog'
  2937. Xsyslog='$syslog'
  2938. Xd_libndir='$d_libndir'
  2939. Xd_usendir='$d_usendir'
  2940. Xlibndir='$libndir'
  2941. Xndirc='$ndirc'
  2942. Xndiro='$ndiro'
  2943. Xd_usleep='$d_usleep'
  2944. Xd_vfork='$d_vfork'
  2945. Xd_voidsig='$d_voidsig'
  2946. Xsignal_t='$signal_t'
  2947. Xd_dirnamlen='$d_dirnamlen'
  2948. Xi_dirent='$i_dirent'
  2949. Xi_stdlib='$i_stdlib'
  2950. Xi_string='$i_string'
  2951. Xstrings='$strings'
  2952. Xi_sysdir='$i_sysdir'
  2953. Xi_sysndir='$i_sysndir'
  2954. Xi_systime='$i_systime'
  2955. Xi_time='$i_time'
  2956. Xi_unistd='$i_unistd'
  2957. Xi_vfork='$i_vfork'
  2958. Xlibc='$libc'
  2959. Xplibpth='$plibpth'
  2960. Xxlibpth='$xlibpth'
  2961. Xlibs='$libs'
  2962. Xinstallmansrc='$installmansrc'
  2963. Xmanext='$manext'
  2964. Xmansrc='$mansrc'
  2965. Xmansrcexp='$mansrcexp'
  2966. Xc='$c'
  2967. Xn='$n'
  2968. Xnewslib='$newslib'
  2969. Xnewslibexp='$newslibexp'
  2970. Xnewsspool='$newsspool'
  2971. Xpackage='$package'
  2972. Xspackage='$spackage'
  2973. Xinstallprivlib='$installprivlib'
  2974. Xprivlib='$privlib'
  2975. Xprivlibexp='$privlibexp'
  2976. Xsharpbang='$sharpbang'
  2977. Xshsharp='$shsharp'
  2978. Xspitshell='$spitshell'
  2979. Xstartsh='$startsh'
  2980. Xsysman='$sysman'
  2981. Xthreaddir='$threaddir'
  2982. Xnm_opt='$nm_opt'
  2983. Xrunnm='$runnm'
  2984. Xusenm='$usenm'
  2985. Xincpath='$incpath'
  2986. Xmips='$mips'
  2987. Xmips_type='$mips_type'
  2988. Xusrinc='$usrinc'
  2989. XEOT
  2990. X
  2991. X: add special variables
  2992. X$test -f patchlevel.h && \
  2993. Xawk '/^#define/ {printf "%s=%s %s%s\n",$2,$3,$4,$5}' patchlevel.h >>config.sh
  2994. Xecho "CONFIG=true" >>config.sh
  2995. X
  2996. X: Finish up by extracting the .SH files
  2997. Xcase "$alldone" in
  2998. Xexit)
  2999. X    $rm -rf UU
  3000. X    echo "Done."
  3001. X    exit 0
  3002. X    ;;
  3003. Xcont)
  3004. X    ;;
  3005. X'')
  3006. X    echo " "
  3007. X    dflt=''
  3008. X    nostick=true
  3009. Xecho "If you didn't make any mistakes, then just type a carriage return here."
  3010. X    rp="If you need to edit config.sh, do it as a shell escape here:"
  3011. X    . UU/myread
  3012. X    nostick=''
  3013. X    case "$ans" in
  3014. X    '') ;;
  3015. X    *) : in case they cannot read
  3016. X        sh 1>&4 -c "$ans";;
  3017. X    esac
  3018. X    ;;
  3019. Xesac
  3020. X
  3021. X: if this fails, just run all the .SH files by hand
  3022. X. ./config.sh
  3023. X
  3024. Xecho " "
  3025. Xexec 1>&4
  3026. X. UU/extract
  3027. X
  3028. Xecho " "
  3029. Xecho 'Now type "make".'
  3030. X
  3031. X$rm -f kit*isdone ark*isdone
  3032. X$rm -rf UU
  3033. X: End of Configure
  3034. END_OF_FILE
  3035. if test 66634 -ne `wc -c <'Configure'`; then
  3036.     echo shar: \"'Configure'\" unpacked with wrong size!
  3037. fi
  3038. chmod +x 'Configure'
  3039. # end of 'Configure'
  3040. fi
  3041. echo shar: End of archive 4 \(of 4\).
  3042. cp /dev/null ark4isdone
  3043. MISSING=""
  3044. for I in 1 2 3 4 ; do
  3045.     if test ! -f ark${I}isdone ; then
  3046.     MISSING="${MISSING} ${I}"
  3047.     fi
  3048. done
  3049. if test "${MISSING}" = "" ; then
  3050.     echo You have unpacked all 4 archives.
  3051.     rm -f ark[1-9]isdone
  3052. else
  3053.     echo You still need to unpack the following archives:
  3054.     echo "        " ${MISSING}
  3055. fi
  3056. ##  End of shell archive.
  3057. exit 0
  3058.