home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume39 / dist-3.0 / part12 < prev    next >
Encoding:
Text File  |  1993-08-19  |  55.1 KB  |  1,923 lines

  1. Newsgroups: comp.sources.misc
  2. From: Raphael Manfredi <ram@acri.fr>
  3. Subject: v39i016:  dist-3.0 - Configure script generator and related tools, Part12/28
  4. Message-ID: <1993Aug19.131218.5355@sparky.sterling.com>
  5. X-Md4-Signature: 86636887355af05f49e7b6ecc3364a01
  6. Sender: kent@sparky.sterling.com (Kent Landfield)
  7. Organization: Advanced Computer Research Institute, Lyon, France.
  8. Date: Thu, 19 Aug 1993 13:12:18 GMT
  9. Approved: kent@sparky.sterling.com
  10.  
  11. Submitted-by: Raphael Manfredi <ram@acri.fr>
  12. Posting-number: Volume 39, Issue 16
  13. Archive-name: dist-3.0/part12
  14. Environment: UNIX, Perl, RCS
  15.  
  16. #! /bin/sh
  17. # This is a shell archive.  Remove anything before this line, then feed it
  18. # into a shell via "sh file" or similar.  To overwrite existing files,
  19. # type "sh file -c".
  20. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  21. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  22. # Contents:  mcon/U/Getfile.U mcon/U/Guess.U mcon/U/Head.U mcon/U/Loc.U
  23. #   mcon/U/ccflags.U mcon/U/d_NOFILE.U mcon/U/i_sysioctl.U
  24. #   mcon/U/locdist.U mcon/makegloss.SH mcon/pl/xwant.pl
  25. # Wrapped by ram@soft208 on Wed Aug 18 14:42:20 1993
  26. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 12 (of 28)."'
  29. if test -f 'mcon/U/Getfile.U' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'mcon/U/Getfile.U'\"
  31. else
  32.   echo shar: Extracting \"'mcon/U/Getfile.U'\" \(5238 characters\)
  33.   sed "s/^X//" >'mcon/U/Getfile.U' <<'END_OF_FILE'
  34. X?RCS: $Id: Getfile.U,v 3.0 1993/08/18 12:04:56 ram Exp $
  35. X?RCS:
  36. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  37. X?RCS: 
  38. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  39. X?RCS: as specified in the README file that comes with the distribution.
  40. X?RCS: You may reuse parts of this distribution only within the terms of
  41. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  42. X?RCS: of the source tree for dist 3.0.
  43. X?RCS:
  44. X?RCS: $Log: Getfile.U,v $
  45. X?RCS: Revision 3.0  1993/08/18  12:04:56  ram
  46. X?RCS: Baseline for dist 3.0 netwide release.
  47. X?RCS:
  48. X?X: 
  49. X?X: This unit produces a bit of shell code that must be dotted in in order
  50. X?X: to get a file name and make some sanity checks. Optionally, a ~name
  51. X?X: expansion is performed.
  52. X?X:    
  53. X?X: To use this unit, $rp and $dflt must hold the question and the
  54. X?X: default answer, which will be passed as-is to the myread script.
  55. X?X: The $fn variable must hold the file type (f or d, for file/directory).
  56. X?X:
  57. X?X: If is is followed by a ~, then ~name substitution will occur. Upon return,
  58. X?X: $ans is set with the filename value. If a / is specified, then only a full
  59. X?X: path name is accepted (but ~ substitution occurs before, if needed). The
  60. X?X:    expanded path name is returned in that case/
  61. X?X:
  62. X?X: If a + is specified, the existence checks are skipped. This usually means
  63. X?X: the file/directory is under the full control of the program.
  64. X?X:
  65. X?X: If the 'n' (none) type is used, then the user may answer none.
  66. X?X: The 'e' (expand) switch may be used to bypass d_portable, expansing ~name.
  67. X?X:
  68. X?X: If the 'l' (locate) type is used, then it must end with a ':' and then a
  69. X?X:    file name. If the answer is a directory, the file name will be appended
  70. X?X: before testing for file existence. This is useful in locate-style
  71. X?X: questions like "where is the active file?". In that case, one should
  72. X?X: use:
  73. X?X:
  74. X?X:   dflt='~news/lib'
  75. X?X:   fn='l~:active'
  76. X?X:   rp='Where is the active file?'
  77. X?X:   . ./getfile
  78. X?X:   active="$ans"
  79. X?X: 
  80. X?X: If the answer to the question is 'none', then the existence checks are
  81. X?X:    skipped and the empty string is returned.
  82. X?X:
  83. X?MAKE:Getfile: d_portable Myread Filexp
  84. X?MAKE:    -pick add $@ %<
  85. X?V:ansexp:fn
  86. X?T:tilde type what orig_rp orig_dflt fullpath already redo skip none_ok \
  87. X    value exp_file
  88. X: now set up to get a file name
  89. Xcat <<'EOSC' >getfile
  90. Xtilde=''
  91. Xfullpath=''
  92. Xalready=''
  93. Xskip=''
  94. Xnone_ok=''
  95. Xexp_file=''
  96. Xorig_rp="$rp"
  97. Xorig_dflt="$dflt"
  98. X
  99. Xcase "$fn" in
  100. X*~*) tilde=true;;
  101. Xesac
  102. Xcase "$fn" in
  103. X*/*) fullpath=true;;
  104. Xesac
  105. Xcase "$fn" in
  106. X*+*) skip=true;;
  107. Xesac
  108. Xcase "$fn" in
  109. X*n*) none_ok=true;;
  110. Xesac
  111. Xcase "$fn" in
  112. X*e*) exp_file=true;;
  113. Xesac
  114. X
  115. Xcase "$fn" in
  116. X*f*) type='File';;
  117. X*d*) type='Directory';;
  118. X*l*) type='Locate'; fn=`expr $fn : '.*:\(.*\)'`;;
  119. Xesac
  120. X
  121. Xwhat="$type"
  122. Xcase "$what" in
  123. XLocate) what='File';;
  124. Xesac
  125. X
  126. Xcase "$exp_file" in
  127. X'')
  128. X    case "$d_portable" in
  129. X    "$define") ;;
  130. X    *) exp_file=true;;
  131. X    esac
  132. X    ;;
  133. Xesac
  134. X
  135. Xwhile test "$type"; do
  136. X    redo=''
  137. X    rp="$orig_rp"
  138. X    dflt="$orig_dflt"
  139. X    case "$tilde" in
  140. X    true) rp="$rp (~name ok)";;
  141. X    esac
  142. X    . ./myread
  143. X    case "$ans" in
  144. X    none)
  145. X        value=''
  146. X        ansexp=''
  147. X        case "$none_ok" in
  148. X        true) type='';;
  149. X        esac
  150. X        ;;
  151. X    *)
  152. X        case "$tilde" in
  153. X        '') value="$ans"
  154. X            ansexp="$ans";;
  155. X        *)
  156. X            value=`./filexp $ans`
  157. X            case $? in
  158. X            0)
  159. X                if test "$ans" != "$value"; then
  160. X                    echo "(That is $value on this particular system.)"
  161. X                fi
  162. X                ;;
  163. X            *) value="$ans";;
  164. X            esac
  165. X            ansexp="$value"
  166. X            case "$exp_file" in
  167. X            '') value="$ans";;
  168. X            esac
  169. X            ;;
  170. X        esac
  171. X        case "$fullpath" in
  172. X        true)
  173. X?X: Perform all the checks on ansexp and not value since when d_portable
  174. X?X: is defined, the original un-expanded answer which is stored in value
  175. X?X: would lead to "non-existent" error messages whilst ansexp has been
  176. X?X: properly expanded. -- Fixed by Jan.Djarv@sa.erisoft.se (Jan Djarv)
  177. X?X: Always expand ~user if '/' was requested 
  178. X            case "$ansexp" in
  179. X            /*) value="$ansexp" ;;
  180. X            *)
  181. X                redo=true
  182. X                case "$already" in
  183. X                true)
  184. X                echo "I shall only accept a full path name, as in /bin/ls." >&4
  185. X                echo "Use a ! shell escape if you wish to check pathnames." >&4
  186. X                    ;;
  187. X                *)
  188. X                echo "Please give a full path name, starting with slash." >&4
  189. X                    case "$tilde" in
  190. X                    true)
  191. X                echo "Note that using ~name is ok provided it expands well." >&4
  192. X                        already=true
  193. X                        ;;
  194. X                    esac
  195. X                esac
  196. X                ;;
  197. X            esac
  198. X            ;;
  199. X        esac
  200. X        case "$redo" in
  201. X        '')
  202. X            case "$type" in
  203. X            File)
  204. X                if test -f "$ansexp"; then
  205. X                    type=''
  206. X                elif test -r "$ansexp" || (test -h "$ansexp") >/dev/null 2>&1
  207. X                then
  208. X                    echo "($value is not a plain file, but that's ok.)"
  209. X                    type=''
  210. X                fi
  211. X                ;;
  212. X            Directory)
  213. X                if test -d "$ansexp"; then
  214. X                    type=''
  215. X                fi
  216. X                ;;
  217. X            Locate)
  218. X                if test -d "$value"; then
  219. X                    echo "(Looking for $fn in directory $value.)"
  220. X                    value="$value/$fn"
  221. X                fi
  222. X                if test -f "$value"; then
  223. X                    type=''
  224. X                fi
  225. X                ;;
  226. X            esac
  227. X
  228. X            case "$skip" in
  229. X            true) type='';
  230. X            esac
  231. X
  232. X            case "$type" in
  233. X            '') ;;
  234. X            *)
  235. X                if test "$fastread" = yes; then
  236. X                    dflt=y
  237. X                else
  238. X                    dflt=n
  239. X                fi
  240. X                rp="$what $value doesn't exist.  Use that name anyway?"
  241. X                . ./myread
  242. X                dflt=''
  243. X                case "$ans" in
  244. X                y*) type='';;
  245. X                *) echo " ";;
  246. X                esac
  247. X                ;;
  248. X            esac
  249. X            ;;
  250. X        esac
  251. X        ;;
  252. X    esac
  253. Xdone
  254. Xans="$value"
  255. Xrp="$orig_rp"
  256. Xdflt="$orig_dflt"
  257. XEOSC
  258. X
  259. END_OF_FILE
  260.   if test 5238 -ne `wc -c <'mcon/U/Getfile.U'`; then
  261.     echo shar: \"'mcon/U/Getfile.U'\" unpacked with wrong size!
  262.   fi
  263.   # end of 'mcon/U/Getfile.U'
  264. fi
  265. if test -f 'mcon/U/Guess.U' -a "${1}" != "-c" ; then 
  266.   echo shar: Will not clobber existing file \"'mcon/U/Guess.U'\"
  267. else
  268.   echo shar: Extracting \"'mcon/U/Guess.U'\" \(4185 characters\)
  269.   sed "s/^X//" >'mcon/U/Guess.U' <<'END_OF_FILE'
  270. X?RCS: $Id: Guess.U,v 3.0 1993/08/18 12:04:57 ram Exp $
  271. X?RCS:
  272. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  273. X?RCS: 
  274. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  275. X?RCS: as specified in the README file that comes with the distribution.
  276. X?RCS: You may reuse parts of this distribution only within the terms of
  277. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  278. X?RCS: of the source tree for dist 3.0.
  279. X?RCS:
  280. X?RCS: $Log: Guess.U,v $
  281. X?RCS: Revision 3.0  1993/08/18  12:04:57  ram
  282. X?RCS: Baseline for dist 3.0 netwide release.
  283. X?RCS:
  284. X?X: 
  285. X?X: This unit hazards some guesses as to what the general nature of the system
  286. X?X: is.  The information it collects here is used primarily to establish default
  287. X?X: answers to other questions.
  288. X?X: 
  289. X?MAKE:Guess d_eunice d_xenix d_bsd: cat test echo n c contains rm Loc eunicefix
  290. X?MAKE:    -pick add $@ %<
  291. X?S:d_eunice:
  292. X?S:    This variable conditionally defines the symbols EUNICE and VAX, which
  293. X?S:    alerts the C program that it must deal with ideosyncracies of VMS.
  294. X?S:.
  295. X?S:d_xenix:
  296. X?S:    This variable conditionally defines the symbol XENIX, which alerts
  297. X?S:    the C program that it runs under Xenix.
  298. X?S:.
  299. X?S:d_bsd:
  300. X?S:    This symbol conditionally defines the symbol BSD when running on a
  301. X?S:    BSD system.
  302. X?S:.
  303. X?C:EUNICE:
  304. X?C:    This symbol, if defined, indicates that the program is being compiled
  305. X?C:    under the EUNICE package under VMS.  The program will need to handle
  306. X?C:    things like files that don't go away the first time you unlink them,
  307. X?C:    due to version numbering.  It will also need to compensate for lack
  308. X?C:    of a respectable link() command.
  309. X?C:.
  310. X?C:VMS:
  311. X?C:    This symbol, if defined, indicates that the program is running under
  312. X?C:    VMS.  It is currently only set in conjunction with the EUNICE symbol.
  313. X?C:.
  314. X?C:XENIX:
  315. X?C:    This symbol, if defined, indicates thet the program is running under
  316. X?C:    Xenix (at least 3.0 ?).
  317. X?C:.
  318. X?C:BSD:
  319. X?C:    This symbol, if defined, indicates that the program is running under
  320. X?C:    a BSD system.
  321. X?C:.
  322. X?H:#$d_eunice EUNICE        /**/
  323. X?H:#$d_eunice VMS        /**/
  324. X?H:#$d_xenix XENIX        /**/
  325. X?H:#$d_bsd BSD        /**/
  326. X?H:.
  327. X?T:xxx
  328. X: make some quick guesses about what we are up against
  329. Xecho " "
  330. X$echo $n "Hmm...  $c"
  331. X?X:
  332. X?X: Do not use 'usrinc', or we get a circular dependency. because
  333. X?X: usrinc is defined in model.U, which relies on us...
  334. X?X:
  335. X$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
  336. Xif test `echo abc | tr a-z A-Z` = Abc ; then
  337. X    xxx=`./loc addbib blurfl $pth`
  338. X    if $test -f $xxx; then
  339. X    echo "Looks kind of like a USG system with BSD features, but we'll see..."
  340. X        echo exit 0 >bsd
  341. X        echo exit 0 >usg
  342. X        echo exit 1 >v7
  343. X    else
  344. X        if $contains SIGTSTP foo >/dev/null 2>&1 ; then
  345. X            echo "Looks kind of like an extended USG system, but we'll see..."
  346. X        else
  347. X            echo "Looks kind of like a USG system, but we'll see..."
  348. X        fi
  349. X        echo exit 1 >bsd
  350. X        echo exit 0 >usg
  351. X        echo exit 1 >v7
  352. X    fi
  353. X    d_bsd="$undef"
  354. Xelif $contains SIGTSTP foo >/dev/null 2>&1 ; then
  355. X    echo "Looks kind of like a BSD system, but we'll see..."
  356. X    d_bsd="$define"
  357. X    echo exit 0 >bsd
  358. X    echo exit 1 >usg
  359. X    echo exit 1 >v7
  360. Xelse
  361. X    echo "Looks kind of like a Version 7 system, but we'll see..."
  362. X    d_bsd="$undef"
  363. X    echo exit 1 >bsd
  364. X    echo exit 1 >usg
  365. X    echo exit 0 >v7
  366. Xfi
  367. Xcase "$eunicefix" in
  368. X*unixtovms*)
  369. X    $cat <<'EOI'
  370. XThere is, however, a strange, musty smell in the air that reminds me of
  371. Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  372. XEOI
  373. X    echo "exit 0" >eunice
  374. X    d_eunice="$define"
  375. X: it so happens the Eunice I know will not run shell scripts in Unix format
  376. X    ;;
  377. X*)
  378. X    echo " "
  379. X    echo "Congratulations.  You aren't running Eunice."
  380. X    d_eunice="$undef"
  381. X    echo "exit 1" >eunice
  382. X    ;;
  383. Xesac
  384. Xif test -f /xenix; then
  385. X    echo "Actually, this looks more like a XENIX system..."
  386. X    echo "exit 0" >xenix
  387. X    d_xenix="$define"
  388. Xelse
  389. X    echo " "
  390. X    echo "It's not Xenix..."
  391. X    echo "exit 1" >xenix
  392. X    d_xenix="$undef"
  393. Xfi
  394. Xchmod +x xenix
  395. X$eunicefix xenix
  396. Xif test -f /venix; then
  397. X    echo "Actually, this looks more like a VENIX system..."
  398. X    echo "exit 0" >venix
  399. Xelse
  400. X    echo " "
  401. X    if xenix; then
  402. X        : null
  403. X    else
  404. X        echo "Nor is it Venix..."
  405. X    fi
  406. X    echo "exit 1" >venix
  407. Xfi
  408. Xchmod +x bsd usg v7 eunice venix
  409. X$eunicefix bsd usg v7 eunice venix
  410. X$rm -f foo
  411. X
  412. END_OF_FILE
  413.   if test 4185 -ne `wc -c <'mcon/U/Guess.U'`; then
  414.     echo shar: \"'mcon/U/Guess.U'\" unpacked with wrong size!
  415.   fi
  416.   # end of 'mcon/U/Guess.U'
  417. fi
  418. if test -f 'mcon/U/Head.U' -a "${1}" != "-c" ; then 
  419.   echo shar: Will not clobber existing file \"'mcon/U/Head.U'\"
  420. else
  421.   echo shar: Extracting \"'mcon/U/Head.U'\" \(4830 characters\)
  422.   sed "s/^X//" >'mcon/U/Head.U' <<'END_OF_FILE'
  423. X?RCS: $Id: Head.U,v 3.0 1993/08/18 12:04:58 ram Exp $
  424. X?RCS:
  425. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  426. X?RCS: 
  427. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  428. X?RCS: as specified in the README file that comes with the distribution.
  429. X?RCS: You may reuse parts of this distribution only within the terms of
  430. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  431. X?RCS: of the source tree for dist 3.0.
  432. X?RCS:
  433. X?RCS: $Log: Head.U,v $
  434. X?RCS: Revision 3.0  1993/08/18  12:04:58  ram
  435. X?RCS: Baseline for dist 3.0 netwide release.
  436. X?RCS:
  437. X?X: 
  438. X?X: This is the very first unit in the Configure script.  It is mostly just
  439. X?X: things to keep people from getting into a tizzy right off the bat.
  440. X?X: 
  441. X?MAKE:Head:
  442. X?MAKE:    -pick wipe $@ %<
  443. X?V:PATH
  444. X?T:argv Id
  445. X#! /bin/sh
  446. X#
  447. X# If these # comments don't work, trim them. Don't worry about any other
  448. X# shell scripts, Configure will trim # comments from them for you.
  449. X#
  450. X# (If you are trying to port this package to a machine without sh,
  451. X# I would suggest you have a look at the prototypical config_h.SH file
  452. X# and edit it to reflect your system. Some packages may include samples
  453. X# of config.h for certain machines, so you might look for one of those.)
  454. X#
  455. X?X:
  456. X?X: NOTE THAT A CONFIGURE SCRIPT IS IN THE PUBLIC DOMAIN (whether or not
  457. X?X: the software which uses it is in the public domain).
  458. X?X:
  459. X# Yes, you may rip this off to use in other distribution packages. This
  460. X# script belongs to the public domain and cannot be copyrighted.
  461. X#
  462. X?X:
  463. X?X: WE ASK YOU NOT TO REMOVE OR ALTER THE FOLLOWING PARAGRAPH, PLEASE:
  464. X?X:
  465. X# (Note: this Configure script was generated automatically. Rather than
  466. X# working with this copy of Configure, you may wish to get metaconfig.
  467. X# The dist-3.0 package (which contains metaconfig) was posted in
  468. X# comp.sources.misc so you may fetch it yourself from your nearest
  469. X# archive site. Check with Archie if you don't know where that can be.)
  470. X#
  471. X?X:
  472. X?X: NOTA BENE:
  473. X?X: If you develop you own version of metaconfig based on this work,
  474. X?X: you have to add some comments telling that the script was generated
  475. X?X: by your version, not mine: It credits your work.
  476. X?X:
  477. X
  478. X# $Id: Head.U,v 3.0 1993/08/18 12:04:58 ram Exp $
  479. X#
  480. X# Generated on <DATE> [metaconfig <VERSION> PL<PATCHLEVEL>]
  481. X
  482. Xcat >/tmp/c1$$ <<EOF
  483. XARGGGHHHH!!!!!
  484. X
  485. XSCO csh still thinks true is false.  Write to SCO today and tell them that next
  486. Xyear Configure ought to "rm /bin/csh" unless they fix their blasted shell. :-)
  487. X
  488. X(Actually, Configure ought to just patch csh in place.  Hmm.  Hmmmmm.  All
  489. Xwe'd have to do is go in and swap the && and || tokens, wherever they are.)
  490. X
  491. X[End of diatribe. We now return you to your regularly scheduled programming...]
  492. XEOF
  493. Xcat >/tmp/c2$$ <<EOF
  494. X
  495. XOOPS!  You naughty creature!  You didn't run Configure with sh!
  496. XI will attempt to remedy the situation by running sh for you...
  497. XEOF
  498. X
  499. Xtrue || cat /tmp/c1$$ /tmp/c2$$
  500. Xtrue || exec sh $0 $argv:q
  501. X
  502. X(exit $?0) || cat /tmp/c2$$
  503. X(exit $?0) || exec sh $0 $argv:q
  504. Xrm -f /tmp/c1$$ /tmp/c2$$
  505. X
  506. X?X:
  507. X?X: There are two schools of thoughts here. Some people correctly argue that
  508. X?X: the user has a better chance than we do of setting a reasonable PATH and
  509. X?X: others argue that Configure is the best place there is to set up a suitable
  510. X?X: PATH. Well, here we try to compromize by keeping the user's PATH and
  511. X?X: appending some directories which are known to work on some machine or the
  512. X?X: other. The rationale behind this being that a novice user might not have a
  513. X?X: proper environment variable set, and some directories like /etc (where
  514. X?X: chown is located on some BSD systems) may be missing--RAM.
  515. X?X:
  516. X: Sanity checks
  517. XPATH=".:$PATH:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin"
  518. XPATH=$PATH:'/usr/5bin:/etc:/usr/gnu/bin:/usr/new:/usr/new/bin:/usr/nbin'
  519. XPATH=$PATH:'/sys5.3/bin:/sys5.3/usr/bin:/bsd4.3/bin:/bsd4.3/usr/ucb'
  520. XPATH=$PATH:'/bsd4.3/usr/bin:/usr/bsd:/bsd43/bin:/usr/ccs/bin'
  521. XPATH=$PATH:'/etc:/usr/lib:/usr/ucblib:/lib:/usr/ccs/lib'
  522. Xexport PATH
  523. X
  524. Xif test ! -t 0; then
  525. X    echo "Say 'sh Configure', not 'sh <Configure'"
  526. X    exit 1
  527. Xfi
  528. X
  529. X: On HP-UX, large Configure scripts may exercise a bug in /bin/sh
  530. Xif test -f /hp-ux -a -x /bin/ksh; then
  531. X    if (alias -x) >/dev/null 2>&1; then
  532. X        : already under /bin/ksh
  533. X    else
  534. X        cat <<'EOM'
  535. X(Feeding myself to ksh to avoid nasty sh bug in "here document" expansion.)
  536. XEOM
  537. X        exec /bin/ksh $0 "$@"
  538. X    fi
  539. Xelse
  540. X    : Warn them if they use ksh on other systems
  541. X?X:
  542. X?X: Use (alias -x) and not (alias) since zsh and bash recognize the alias
  543. X?X: builtin but not the -x option which is typically ksh...
  544. X?X:
  545. X    (alias -x) >/dev/null 2>&1 && \
  546. X        cat <<'EOM'
  547. X(I see you are using the Korn shell.  Some ksh's blow up on Configure,
  548. Xespecially on exotic machines.  If yours does, try the Bourne shell instead.)
  549. XEOM
  550. Xfi
  551. X
  552. X: Configure runs within the UU subdirectory
  553. Xtest -d UU || mkdir UU
  554. Xcd UU && rm -f *
  555. X
  556. END_OF_FILE
  557.   if test 4830 -ne `wc -c <'mcon/U/Head.U'`; then
  558.     echo shar: \"'mcon/U/Head.U'\" unpacked with wrong size!
  559.   fi
  560.   # end of 'mcon/U/Head.U'
  561. fi
  562. if test -f 'mcon/U/Loc.U' -a "${1}" != "-c" ; then 
  563.   echo shar: Will not clobber existing file \"'mcon/U/Loc.U'\"
  564. else
  565.   echo shar: Extracting \"'mcon/U/Loc.U'\" \(5207 characters\)
  566.   sed "s/^X//" >'mcon/U/Loc.U' <<'END_OF_FILE'
  567. X?RCS: $Id: Loc.U,v 3.0 1993/08/18 12:05:05 ram Exp $
  568. X?RCS:
  569. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  570. X?RCS: 
  571. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  572. X?RCS: as specified in the README file that comes with the distribution.
  573. X?RCS: You may reuse parts of this distribution only within the terms of
  574. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  575. X?RCS: of the source tree for dist 3.0.
  576. X?RCS:
  577. X?RCS: $Log: Loc.U,v $
  578. X?RCS: Revision 3.0  1993/08/18  12:05:05  ram
  579. X?RCS: Baseline for dist 3.0 netwide release.
  580. X?RCS:
  581. X?X: 
  582. X?X: This unit produces a shell script "loc" which can be used to find out
  583. X?X: where in a list of directories something is.  It then uses loc to
  584. X?X: determine the location of commonly used programs.  It leaves loc sitting
  585. X?X: around for other Configure units to use, but arranges for its demise
  586. X?X: at the end of Configure.
  587. X?X: 
  588. X?X: To add a new program to find, add it both to the ?MAKE: line and to either
  589. X?X: the loclist or trylist variable.
  590. X?X: 
  591. X?X: I put startsh at the end of the dependency list, in order to avoid the
  592. X?X: loading of the spitshell unit before the instructions.
  593. X?X:
  594. X?MAKE:Loc Mcc awk bash bison cat chgrp chmod chown compress cp cpio cpp csh \
  595. X    date echo egrep emacs expr flex gcc grep inews ksh less line lint ln lp \
  596. X    lpr ls mail mailx make mkdir more mv nroff perl pg pmake pr rm rmail sed \
  597. X    sendmail sh shar sleep smail sort submit tail tar tbl test touch tr \
  598. X    troff uname uniq uuname vi zcat: eunicefix n c Instruct Myread startsh
  599. X?MAKE:    -pick weed $@ %<
  600. X?LINT:describe Loc Mcc awk bash bison cat chgrp chmod chown compress cp cpio \
  601. X    cpp csh date echo egrep emacs expr flex gcc grep inews ksh less line lint \
  602. X    ln lp lpr ls mail mailx make mkdir more mv nroff perl pg pmake pr rm \
  603. X    rmail sed sendmail sh shar sleep smail sort submit tail tar tbl test \
  604. X    touch tr troff uname uniq uuname vi zcat
  605. X?V::pth loclist trylist
  606. X?T:thing xxx dir file say
  607. X: find out where common programs are
  608. Xecho " "
  609. Xecho "Locating common programs..." >&4
  610. Xcat <<EOSC >loc
  611. X$startsh
  612. Xcase \$# in
  613. X0) exit 1;;
  614. Xesac
  615. Xthing=\$1
  616. Xshift
  617. Xdflt=\$1
  618. Xshift
  619. Xfor dir in \$*; do
  620. X    case "\$thing" in
  621. X    .)
  622. X    if test -d \$dir/\$thing; then
  623. X        echo \$dir
  624. X        exit 0
  625. X    fi
  626. X    ;;
  627. X    *)
  628. X    if test -f \$dir/\$thing; then
  629. X        echo \$dir/\$thing
  630. X        exit 0
  631. X    elif test -f \$dir/\$thing.exe; then
  632. X        : on Eunice apparently
  633. X        echo \$dir/\$thing
  634. X        exit 0
  635. X    fi
  636. X    ;;
  637. X    esac
  638. Xdone
  639. Xecho \$dflt
  640. Xexit 1
  641. XEOSC
  642. Xchmod +x loc
  643. X$eunicefix loc
  644. Xloclist="
  645. X?awk:awk
  646. X?cat:cat
  647. X?chgrp:chgrp
  648. X?chmod:chmod
  649. X?chown:chown
  650. X?cp:cp
  651. X?echo:echo
  652. X?expr:expr
  653. X?grep:grep
  654. X?ln:ln
  655. X?ls:ls
  656. X?make:make
  657. X?mkdir:mkdir
  658. X?mv:mv
  659. X?rm:rm
  660. X?sed:sed
  661. X?sleep:sleep
  662. X?sort:sort
  663. X?tail:tail
  664. X?touch:touch
  665. X?tr:tr
  666. X?uniq:uniq
  667. X"
  668. Xtrylist="
  669. X?Mcc:Mcc
  670. X?bash:bash
  671. X?bison:bison
  672. X?compress:compress
  673. X?cpio:cpio
  674. X?cpp:cpp
  675. X?csh:csh
  676. X?date:date
  677. X?egrep:egrep
  678. X?emacs:emacs
  679. X?flex:flex
  680. X?gcc:gcc
  681. X?inews:inews
  682. X?ksh:ksh
  683. X?less:less
  684. X?line:line
  685. X?lint:lint
  686. X?lp:lp
  687. X?lpr:lpr
  688. X?mail:mail
  689. X?mailx:mailx
  690. X?more:more
  691. X?nroff:nroff
  692. X?perl:perl
  693. X?pg:pg
  694. X?pmake:pmake
  695. X?pr:pr
  696. X?rmail:rmail
  697. X?sendmail:sendmail
  698. X?sh:sh
  699. X?shar:shar
  700. X?smail:smail
  701. X?submit:submit
  702. X?tar:tar
  703. X?tbl:tbl
  704. X?test:test
  705. X?troff:troff
  706. X?uname:uname
  707. X?uuname:uuname
  708. X?vi:vi
  709. X?zcat:zcat
  710. X"
  711. X?LINT:set Loc Mcc awk bash bison cat chgrp chmod chown compress cp cpio cpp \
  712. X    csh date echo egrep emacs expr flex gcc grep inews ksh less line lint ln \
  713. X    lp lpr ls mail mailx make mkdir more mv nroff perl pg pmake pr rm rmail \
  714. X    sed sendmail sh shar sleep smail sort submit tail tar tbl test touch tr \
  715. X    troff uname uniq uuname vi zcat
  716. Xpth=`echo $PATH | sed -e 's/:/ /g'`
  717. Xpth="$pth /lib /usr/lib"
  718. Xfor file in $loclist; do
  719. X    xxx=`./loc $file $file $pth`
  720. X    eval $file=$xxx
  721. X    eval _$file=$xxx
  722. X    case "$xxx" in
  723. X    /*)
  724. X        echo $file is in $xxx.
  725. X        ;;
  726. X    *)
  727. X        echo "I don't know where $file is.  I hope it's in everyone's PATH."
  728. X        ;;
  729. X    esac
  730. Xdone
  731. Xecho " "
  732. Xecho "Don't worry if any of the following aren't found..."
  733. Xsay=offhand
  734. Xfor file in $trylist; do
  735. X    xxx=`./loc $file $file $pth`
  736. X    eval $file=$xxx
  737. X    eval _$file=$xxx
  738. X    case "$xxx" in
  739. X    /*)
  740. X        echo $file is in $xxx.
  741. X        ;;
  742. X    *)
  743. X        echo "I don't see $file out there, $say."
  744. X        say=either
  745. X        ;;
  746. X    esac
  747. Xdone
  748. Xcase "$egrep" in
  749. Xegrep)
  750. X    echo "Substituting grep for egrep."
  751. X    egrep=$grep
  752. X    ;;
  753. Xesac
  754. Xcase "$test" in
  755. Xtest)
  756. X    echo "Hopefully test is built into your sh."
  757. X    ;;
  758. X/bin/test)
  759. X    if sh -c "PATH= test true" >/dev/null 2>&1; then
  760. X        echo "Using the test built into your sh."
  761. X        test=test
  762. X    fi
  763. X    ;;
  764. X*)
  765. X    test=test
  766. X    ;;
  767. Xesac
  768. X?LINT:change n c
  769. Xcase "$echo" in
  770. Xecho)
  771. X    echo "Hopefully echo is built into your sh."
  772. X    ;;
  773. X*)
  774. X    echo " "
  775. Xecho "Checking compatibility between $echo and builtin echo (if any)..." >&4
  776. X    $echo $n "hi there$c" >foo1
  777. X    echo $n "hi there$c" >foo2
  778. X    if cmp foo1 foo2 >/dev/null 2>&1; then
  779. X        echo "They are compatible.  In fact, they may be identical."
  780. X    else
  781. X        case "$n" in
  782. X        '-n') n='' c='\c';;
  783. X        *) n='-n' c='';;
  784. X        esac
  785. X        cat <<FOO
  786. XThey are not compatible!  You are probably running ksh on a non-USG system.
  787. XI'll have to use $echo instead of the builtin, since Bourne shell doesn't
  788. Xhave echo built in and we may have to run some Bourne shell scripts.  That
  789. Xmeans I'll have to use '$n$c' to suppress newlines now.  Life is ridiculous.
  790. X
  791. XFOO
  792. X        $echo $n "The star should be here-->$c"
  793. X        $echo "*"
  794. X    fi
  795. X    $rm -f foo1 foo2
  796. X    ;;
  797. Xesac
  798. X
  799. END_OF_FILE
  800.   if test 5207 -ne `wc -c <'mcon/U/Loc.U'`; then
  801.     echo shar: \"'mcon/U/Loc.U'\" unpacked with wrong size!
  802.   fi
  803.   # end of 'mcon/U/Loc.U'
  804. fi
  805. if test -f 'mcon/U/ccflags.U' -a "${1}" != "-c" ; then 
  806.   echo shar: Will not clobber existing file \"'mcon/U/ccflags.U'\"
  807. else
  808.   echo shar: Extracting \"'mcon/U/ccflags.U'\" \(4893 characters\)
  809.   sed "s/^X//" >'mcon/U/ccflags.U' <<'END_OF_FILE'
  810. X?RCS: $Id: ccflags.U,v 3.0 1993/08/18 12:05:31 ram Exp $
  811. X?RCS:
  812. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  813. X?RCS: 
  814. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  815. X?RCS: as specified in the README file that comes with the distribution.
  816. X?RCS: You may reuse parts of this distribution only within the terms of
  817. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  818. X?RCS: of the source tree for dist 3.0.
  819. X?RCS:
  820. X?RCS: $Log: ccflags.U,v $
  821. X?RCS: Revision 3.0  1993/08/18  12:05:31  ram
  822. X?RCS: Baseline for dist 3.0 netwide release.
  823. X?RCS:
  824. X?MAKE:ccflags ldflags lkflags cppflags optimize: test cat Myread Guess \
  825. X    Oldconfig +cc mips_type +usrinc package contains
  826. X?MAKE:    -pick add $@ %<
  827. X?S:ccflags:
  828. X?S:    This variable contains any additional C compiler flags desired by
  829. X?S:    the user.  It is up to the Makefile to use this.
  830. X?S:.
  831. X?S:cppflags:
  832. X?S:    This variable holds the flags that will be passed to the C pre-
  833. X?S:    processor. It is up to the Makefile to use it.
  834. X?S:.
  835. X?S:optimize:
  836. X?S:    This variable contains any optimizer/debugger flag that should be used.
  837. X?S:    It is up to the Makefile to use it.
  838. X?S:.
  839. X?S:ldflags:
  840. X?S:    This variable contains any additional C loader flags desired by
  841. X?S:    the user.  It is up to the Makefile to use this.
  842. X?S:.
  843. X?S:lkflags:
  844. X?S:    This variable contains any additional C partial linker flags desired by
  845. X?S:    the user.  It is up to the Makefile to use this.
  846. X?S:.
  847. X?T:inctest thisincl xxx flag inclwanted tans
  848. X?INIT:: no include file wanted by default
  849. X?INIT:inclwanted=''
  850. X?INIT:
  851. X: determine optimize, if desired, or use for debug flag also
  852. Xcase "$optimize" in
  853. X' ') dflt="none";;
  854. X'') dflt="-O";;
  855. X*) dflt="$optimize";;
  856. Xesac
  857. X$cat <<EOH
  858. X
  859. XSome C compilers have problems with their optimizers, by default, $package
  860. Xcompiles with the -O flag to use the optimizer.  Alternately, you might want
  861. Xto use the symbolic debugger, which uses the -g flag (on traditional Unix
  862. Xsystems).  Either flag can be specified here.  To use neither flag, specify
  863. Xthe word "none".
  864. X
  865. XEOH
  866. Xrp="What optimizer/debugger flag should be used?"
  867. X. ./myread
  868. Xoptimize="$ans"
  869. Xcase "$optimize" in
  870. X'none') optimize=" ";;
  871. Xesac
  872. X
  873. Xcase "$ccflags" in
  874. X'')    case "$cc" in
  875. X    *gcc*) dflt='-fpcc-struct-return';;
  876. X    *) dflt='';;
  877. X    esac
  878. X    case "$optimize" in
  879. X    *-g*) dflt="$dflt -DDEBUG";;
  880. X    esac
  881. X?X: check for POSIXized ISC
  882. X    case "$cc" in
  883. X    *gcc*)    if test -d /etc/conf/kconfig.d &&
  884. X          $contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
  885. X        then
  886. X            dflt="$dflt -posix"
  887. X        fi
  888. X        ;;
  889. X    esac
  890. X    ;;
  891. X*) dflt="$ccflags" ;;
  892. Xesac
  893. X
  894. X?X: In USG mode, a MIPS system may need some BSD includes
  895. Xcase "$mips_type" in
  896. X*BSD*) ;;
  897. X'') ;;
  898. X*) inclwanted="$inclwanted $usrinc/bsd";;
  899. Xesac
  900. Xfor thisincl in $inclwanted; do
  901. X    if $test -d $thisincl; then
  902. X        if $test x$thisincl != x$usrinc; then
  903. X            case "$dflt" in
  904. X            *$thisincl*);;
  905. X            *) dflt="$dflt -I$thisincl";;
  906. X            esac
  907. X        fi
  908. X    fi
  909. Xdone
  910. X
  911. X?X: Include test function (header, symbol)
  912. Xinctest='if $contains $2 $usrinc/$1 >/dev/null 2>&1; then
  913. X    xxx=true;
  914. Xelif $contains $2 $usrinc/sys/$1 >/dev/null 2>&1; then
  915. X    xxx=true;
  916. Xelse
  917. X    xxx=false;
  918. Xfi;
  919. Xif $xxx; then
  920. X    case "$dflt" in
  921. X    *$2*);;
  922. X    *) dflt="$dflt -D$2";;
  923. X    esac;
  924. Xfi'
  925. X
  926. X?X: SCO unix uses NO_PROTOTYPE instead of _NO_PROTO
  927. Xset signal.h LANGUAGE_C; eval $inctest
  928. Xset signal.h NO_PROTOTYPE; eval $inctest
  929. Xset signal.h _NO_PROTO; eval $inctest
  930. X
  931. Xcase "$dflt" in
  932. X'') dflt=none;;
  933. Xesac
  934. X$cat <<EOH
  935. X
  936. XYour C compiler may want other flags.  For this question you should include
  937. X-I/whatever and -DWHATEVER flags and any other flags used by the C compiler,
  938. Xbut you should NOT include libraries or ld flags like -lwhatever.  To use no
  939. Xflags, specify the word "none".
  940. X
  941. XEOH
  942. X?X: strip leading space
  943. Xset X $dflt
  944. Xshift
  945. Xdflt=${1+"$@"}
  946. Xrp="Any additional cc flags?"
  947. X. ./myread
  948. Xtans="$ans"
  949. Xcase "$tans" in
  950. Xnone) tans='';
  951. Xesac
  952. Xccflags="$tans"
  953. X
  954. X: the following weeds options from ccflags that are of no interest to cpp
  955. Xcppflags="$ccflags"
  956. Xcase "$cc" in
  957. X*gcc*) cppflags="$cppflags -D__GNUC__";;
  958. Xesac
  959. Xcase "$mips_type" in
  960. X'');;
  961. X*BSD*) cppflags="$cppflags -DSYSTYPE_BSD43";;
  962. Xesac
  963. Xcase "$cppflags" in
  964. X'');;
  965. X*)  set X $cppflags
  966. X    cppflags=''
  967. X    for flag
  968. X    do
  969. X        case $flag in
  970. X        -D*|-I*|-traditional|-ansi|-nostdinc) cppflags="$cppflags $flag";;
  971. X        esac
  972. X    done
  973. X    case "$cppflags" in
  974. X    *-*)  echo "(C preprocessor flags: $cppflags)";;
  975. X    esac
  976. X    ;;
  977. Xesac
  978. X
  979. X: flags used in final linking phase
  980. Xcase "$ldflags" in
  981. X'') if venix; then
  982. X        dflt='-i -z'
  983. X    else
  984. X        dflt='none'
  985. X    fi
  986. X    ;;
  987. X*) dflt="$ldflags";;
  988. Xesac
  989. Xecho " "
  990. Xrp="Any additional ld flags (NOT including libraries)?"
  991. X. ./myread
  992. Xtans="$ans"
  993. Xcase "$tans" in
  994. Xnone) tans='';
  995. Xesac
  996. Xldflags="$tans"
  997. Xrmlist="$rmlist pdp11"
  998. X
  999. X@if lkflags
  1000. X: partial linking may need other flags
  1001. Xcase "$lkflags" in
  1002. X'') case "$ldflags" in
  1003. X    '') dflt='none';;
  1004. X    *) dflt="$ldflags";;
  1005. X    esac;;
  1006. X*) dflt="$lkflags";;
  1007. Xesac
  1008. Xecho " "
  1009. Xrp="Partial linking flags to be used (NOT including -r)?"
  1010. X. ./myread
  1011. Xtans="$ans"
  1012. Xcase "$tans" in
  1013. Xnone) tans='';
  1014. Xesac
  1015. Xlkflags="$tans"
  1016. X
  1017. X@end
  1018. END_OF_FILE
  1019.   if test 4893 -ne `wc -c <'mcon/U/ccflags.U'`; then
  1020.     echo shar: \"'mcon/U/ccflags.U'\" unpacked with wrong size!
  1021.   fi
  1022.   # end of 'mcon/U/ccflags.U'
  1023. fi
  1024. if test -f 'mcon/U/d_NOFILE.U' -a "${1}" != "-c" ; then 
  1025.   echo shar: Will not clobber existing file \"'mcon/U/d_NOFILE.U'\"
  1026. else
  1027.   echo shar: Extracting \"'mcon/U/d_NOFILE.U'\" \(4810 characters\)
  1028.   sed "s/^X//" >'mcon/U/d_NOFILE.U' <<'END_OF_FILE'
  1029. X?RCS: $Id: d_NOFILE.U,v 3.0 1993/08/18 12:05:39 ram Exp $
  1030. X?RCS:
  1031. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  1032. X?RCS: 
  1033. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  1034. X?RCS: as specified in the README file that comes with the distribution.
  1035. X?RCS: You may reuse parts of this distribution only within the terms of
  1036. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  1037. X?RCS: of the source tree for dist 3.0.
  1038. X?RCS:
  1039. X?RCS: $Log: d_NOFILE.U,v $
  1040. X?RCS: Revision 3.0  1993/08/18  12:05:39  ram
  1041. X?RCS: Baseline for dist 3.0 netwide release.
  1042. X?RCS:
  1043. X?MAKE:nofile d_gettblsz tablesize: Myread Guess libc cat +cc +ccflags +libs \
  1044. X    test rm Csym
  1045. X?MAKE:    -pick add $@ %<
  1046. X?S:nofile:
  1047. X?S:    This variable contains the number of file descriptors available to the
  1048. X?S:    process.
  1049. X?S:.
  1050. X?S:d_gettblsz:
  1051. X?S:    This variable conditionally handles remapping of the getdtablesize()
  1052. X?S:    subroutine to ulimit(4,0), or the NOFILE manifest constant.
  1053. X?S:.
  1054. X?S:tablesize:
  1055. X?S:    This variable contains either the 'NOFILE' constant or 'ulimit(4, 0L)'
  1056. X?S:    and is used as the remapped value for the getdtablesize() macro.
  1057. X?S:.
  1058. X?C:getdtablesize:
  1059. X?C:    This catches use of the getdtablesize() subroutine, and remaps it
  1060. X?C:    to either ulimit(4,0) or NOFILE, if getdtablesize() isn't available.
  1061. X?C:.
  1062. X?C:VAL_NOFILE:
  1063. X?C:    This symbol contains the number of file descriptors available to the
  1064. X?C:    process, as determined at configuration time. Unless a static constant
  1065. X?C:    is needed, you should rely on getdtablesize() to obtain that number.
  1066. X?C:.
  1067. X?H:#$d_gettblsz getdtablesize() $tablesize    /**/
  1068. X?H:#define VAL_NOFILE $nofile    /* Number of file descriptors */
  1069. X?H:.
  1070. X?T:d_ulimit4 val
  1071. X: see if getdtablesize exists
  1072. Xecho " "
  1073. X?X: Revert logical value (d_gettblsz is undef iff getdtablesize is present)
  1074. Xcase "$d_gettblsz" in
  1075. X$define) d_gettblsz="$undef";;
  1076. X$undef) d_gettblsz="$define";;
  1077. Xesac
  1078. Xif set getdtablesize val -f d_gettblsz; eval $csym; $val; then
  1079. X    echo 'getdtablesize() found.' >&4
  1080. X    d_gettblsz="$undef"
  1081. X    tablesize=''
  1082. X@if VAL_NOFILE || nofile
  1083. X    $cat >nofile.c <<'EOCP'
  1084. X#include <stdio.h>
  1085. Xmain()
  1086. X{
  1087. X    printf("%d\n", getdtablesize());
  1088. X}
  1089. XEOCP
  1090. X    nofile=''
  1091. X    if $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1; then
  1092. X        nofile=`./nofile 2>/dev/null`
  1093. X    fi
  1094. X    if $test "$nofile"; then
  1095. X        echo "(You have $nofile file descriptors available per process.)"
  1096. X    else
  1097. X        nofile='20'
  1098. X        if ./bsd; then
  1099. X            nofile='64'
  1100. X        fi
  1101. X    echo "(Hmm... Let's say you have $nofile file descriptors available.)"
  1102. X    fi
  1103. X@end
  1104. Xelse
  1105. X    echo 'getdtablesize() NOT found...' >&4
  1106. X    if set ulimit val -f; eval $csym; $val; then
  1107. X        echo 'Maybe ulimit(4,0) will work...'
  1108. X        $cat >nofile.c <<'EOCP'
  1109. X#include <stdio.h>
  1110. X#ifdef GETPARAM_H
  1111. X#include <sys/param.h>
  1112. X#endif
  1113. Xmain()
  1114. X{
  1115. X    printf("%d %d\n",
  1116. X#ifdef NOFILE
  1117. X        NOFILE,
  1118. X#else
  1119. X        0,
  1120. X#endif
  1121. X        ulimit(4,0));
  1122. X        exit(0);
  1123. X}
  1124. XEOCP
  1125. X        if $cc $ccflags -DGETPARAM_H nofile.c -o nofile $libs >/dev/null 2>&1 \
  1126. X            || $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1 ; then
  1127. X            set `./nofile`
  1128. X            d_gettblsz=$1
  1129. X            d_ulimit4=$2
  1130. X            if $test "$d_ulimit4" -lt 0; then
  1131. X                echo "Your ulimit() call doesn't tell me what I want to know."
  1132. X                echo "We'll just use NOFILE in this case."
  1133. X                nofile=$d_gettblsz
  1134. X                d_gettblsz="$define"
  1135. X                tablesize='NOFILE'
  1136. X            else
  1137. X                if $test "$d_gettblsz" -gt 0; then
  1138. X                echo "Your system defines NOFILE to be $d_gettblsz, and" >&4
  1139. X                else
  1140. X                echo "I had trouble getting NOFILE from your system, but" >&4
  1141. X                fi
  1142. Xecho "ulimit returns $d_ulimit4 as the number of available file descriptors." >&4
  1143. X                dflt='y';
  1144. X                echo " "
  1145. X    rp='Should I use ulimit to get the number of available file descriptors?'
  1146. X                . ./myread
  1147. X                case "$ans" in
  1148. X                y*)
  1149. X                    nofile=$d_ulimit4
  1150. X                    d_gettblsz="$define"
  1151. X                    tablesize='ulimit(4, 0L)'
  1152. X                    echo "Using ulimit(4,0)."
  1153. X                    ;;
  1154. X                *)
  1155. X                    nofile=$d_gettblsz
  1156. X                    d_gettblsz="$define"
  1157. X                    tablesize='NOFILE'
  1158. X                    echo "Using NOFILE."
  1159. X                    ;;
  1160. X                esac
  1161. X            fi
  1162. X        else
  1163. X            echo "Strange, I couldn't get my test program to compile."
  1164. X            echo "We'll just use NOFILE in this case."
  1165. X            d_gettblsz="$define"
  1166. X            tablesize='NOFILE'
  1167. X            nofile=''
  1168. X        fi
  1169. X    else
  1170. X        echo 'Using NOFILE instead.'
  1171. X        d_gettblsz="$define"
  1172. X        tablesize='NOFILE'
  1173. X        nofile=''
  1174. X    fi
  1175. Xfi
  1176. X@if VAL_NOFILE || nofile
  1177. Xcase "$nofile" in
  1178. X'')
  1179. X    $cat >nofile.c <<'EOCP'
  1180. X#include <stdio.h>
  1181. X#ifdef GETPARAM_H
  1182. X#include <sys/param.h>
  1183. X#endif
  1184. Xmain()
  1185. X{
  1186. X    printf("%d\n",
  1187. X#ifdef NOFILE
  1188. X        NOFILE,
  1189. X#else
  1190. X        0,
  1191. X#endif
  1192. X        );
  1193. X        exit(0);
  1194. X}
  1195. XEOCP
  1196. X    if $cc $ccflags -DGETPARAM_H nofile.c -o nofile $libs >/dev/null 2>&1 \
  1197. X        || $cc $ccflags nofile.c -o nofile $libs >/dev/null 2>&1 ; then
  1198. X        nofile=`./nofile 2>/dev/null`
  1199. X    fi
  1200. X    if $test "$nofile"; then
  1201. X        echo "(You have $nofile file descriptors available per process.)"
  1202. X    else
  1203. X        nofile='20'
  1204. X        if ./bsd; then
  1205. X            nofile='64'
  1206. X        fi
  1207. X    echo "(Hmm... Let's say you have $nofile file descriptors available.)"
  1208. X    fi
  1209. X    ;;
  1210. Xesac
  1211. X@end
  1212. X$rm -f nofile*
  1213. X
  1214. END_OF_FILE
  1215.   if test 4810 -ne `wc -c <'mcon/U/d_NOFILE.U'`; then
  1216.     echo shar: \"'mcon/U/d_NOFILE.U'\" unpacked with wrong size!
  1217.   fi
  1218.   # end of 'mcon/U/d_NOFILE.U'
  1219. fi
  1220. if test -f 'mcon/U/i_sysioctl.U' -a "${1}" != "-c" ; then 
  1221.   echo shar: Will not clobber existing file \"'mcon/U/i_sysioctl.U'\"
  1222. else
  1223.   echo shar: Extracting \"'mcon/U/i_sysioctl.U'\" \(4919 characters\)
  1224.   sed "s/^X//" >'mcon/U/i_sysioctl.U' <<'END_OF_FILE'
  1225. X?RCS: $Id: i_sysioctl.U,v 3.0 1993/08/18 12:08:32 ram Exp $
  1226. X?RCS:
  1227. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  1228. X?RCS: 
  1229. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  1230. X?RCS: as specified in the README file that comes with the distribution.
  1231. X?RCS: You may reuse parts of this distribution only within the terms of
  1232. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  1233. X?RCS: of the source tree for dist 3.0.
  1234. X?RCS:
  1235. X?RCS: $Log: i_sysioctl.U,v $
  1236. X?RCS: Revision 3.0  1993/08/18  12:08:32  ram
  1237. X?RCS: Baseline for dist 3.0 netwide release.
  1238. X?RCS:
  1239. X?MAKE:i_sysioctl i_bsdioctl i_syssockio d_voidtty: test contains cat \
  1240. X    i_termio i_termios i_sgtty Setvar Findhdr
  1241. X?MAKE:    -pick add $@ %<
  1242. X?S:i_sysioctl:
  1243. X?S:    This variable conditionally defines the I_SYS_IOCTL symbol, which
  1244. X?S:    indicates to the C program that <sys/ioctl.h> exists and should
  1245. X?S:    be included.
  1246. X?S:.
  1247. X?S:i_bsdioctl:
  1248. X?S:    This variable conditionally defines the I_SYS_BSDIOCTL symbol, which
  1249. X?S:    indicates to the C program that <sys/bsdioctl.h> exists and should
  1250. X?S:    be included.
  1251. X?S:.
  1252. X?S:i_syssockio:
  1253. X?S:    This variable conditionally defines I_SYS_SOCKIO to indicate to the
  1254. X?S:    C program that socket ioctl codes may be found in <sys/sockio.h>
  1255. X?S:    instead of <sys/ioctl.h>.
  1256. X?S:.
  1257. X?S:d_voidtty:
  1258. X?S:    This variable conditionally defines USE_IOCNOTTY to indicate that the
  1259. X?S:    ioctl() call with TIOCNOTTY should be used to void tty association.
  1260. X?S:    Otherwise (on USG probably), it is enough to close the standard file
  1261. X?S:    decriptors and do a setpgrp().
  1262. X?S:.
  1263. X?C:I_SYS_IOCTL (I_SYSIOCTL):
  1264. X?C:    This symbol, if defined, indicates that <sys/ioctl.h> exists and should
  1265. X?C:    be included. Otherwise, include <sgtty.h> or <termio.h>.
  1266. X?C:.
  1267. X?C:I_SYS_BSDIOCTL (I_BSDIOCTL):
  1268. X?C:    This symbol, if defined, indicates that <sys/bsdioctl.h> exists and should
  1269. X?C:    be included. Otherwise, try <sys/ioctl.h>. This is primarly intended for
  1270. X?C:    definitions of sockets options, like SIOCATMARK.
  1271. X?C:.
  1272. X?C:I_SYS_SOCKIO (I_SYSSOCKIO):
  1273. X?C:    This symbol, if defined, indicates the <sys/sockio.h> should be included
  1274. X?C:    to get socket ioctl options, like SIOCATMARK.
  1275. X?C:.
  1276. X?C:USE_TIOCNOTTY (VOIDTTY):
  1277. X?C:    This symbol, if defined indicate to the C program that the ioctl()
  1278. X?C:    call with TIOCNOTTY should be used to void tty association.
  1279. X?C:    Otherwise (on USG probably), it is enough to close the standard file
  1280. X?C:    decriptors and do a setpgrp().
  1281. X?C:.
  1282. X?H:#$i_sysioctl    I_SYS_IOCTL        /**/
  1283. X?H:#$i_bsdioctl    I_SYS_BSDIOCTL        /**/
  1284. X?H:#$i_syssockio I_SYS_SOCKIO    /**/
  1285. X?H:#$d_voidtty USE_TIOCNOTTY    /**/
  1286. X?H:.
  1287. X?T:xxx
  1288. X: see if ioctl defs are in sgtty/termio or sys/ioctl
  1289. Xecho " "
  1290. Xif $test `./findhdr sys/ioctl.h`; then
  1291. X    val="$define"
  1292. X    echo "<sys/ioctl.h> found." >&4
  1293. Xelse
  1294. X    val="$undef"
  1295. X    $test $i_termio = "$define" && xxx="termio.h"
  1296. X    $test $i_termios = "$define" && xxx="termios.h"
  1297. X    $test $i_sgtty = "$define" && xxx="sgtty.h"
  1298. Xecho "No <sys/ioctl.h> found, assuming ioctl args are defined in <$xxx>." >&4
  1299. Xfi
  1300. X?LINT:set i_sysioctl
  1301. Xset i_sysioctl
  1302. Xeval $setvar
  1303. X
  1304. X@if I_BSDIOCTL || i_bsdioctl
  1305. X?X:
  1306. X?X:    The only machine I know where this inclusion was necessary is a
  1307. X?X:    BULL DPX 5000 (a French machine).
  1308. X?X:
  1309. X: see if socket ioctl defs are in sys/bsdioctl or sys/ioctl
  1310. Xecho " "
  1311. Xif $test `./findhdr sys/bsdioctl.h`; then
  1312. X    if $contains SIOCATMARK `./findhdr sys/bsdioctl.h` >/dev/null 2>&1; then
  1313. X        val="$define"
  1314. X        echo "You have socket ioctls defined in <sys/bsdioctl.h>." >&4
  1315. X    else
  1316. X        val="$undef"
  1317. X        echo "No socket ioctls found in <sys/bsdioctl.h>." >&4
  1318. X    fi
  1319. Xelse
  1320. X    val="$undef"
  1321. X    echo "<sys/bsdioctl.h> not found, but that's ok." >&4
  1322. Xfi
  1323. X?LINT:set i_bsdioctl
  1324. Xset i_bsdioctl
  1325. Xeval $setvar
  1326. X
  1327. X@end
  1328. X@if I_SYSSOCKIO || i_syssockio
  1329. X: see if socket ioctl defs are in sys/sockio.h
  1330. Xecho " "
  1331. Xif $test `./findhdr sys/sockio.h`; then
  1332. X    if $contains SIOCATMARK `./findhdr sys/sockio.h` >/dev/null 2>&1; then
  1333. X        val="$define"
  1334. X        echo "You have socket ioctls defined in <sys/sockio.h>." >&4
  1335. X    else
  1336. X        val="$undef"
  1337. X        echo "No socket ioctls found in <sys/sockio.h>." >&4
  1338. X    fi
  1339. Xelse
  1340. X    val="$undef"
  1341. X@if I_BSDIOCTL
  1342. X    case "$i_bsdioctl" in
  1343. X    "$define") $cat <<EOM
  1344. X<sys/sockio.h> not found, using ioctls from <sys/bsdioctl.h>.
  1345. XEOM
  1346. X    ;;
  1347. X    *) $cat <<EOM
  1348. X<sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
  1349. XEOM
  1350. X    ;;
  1351. X    esac
  1352. X@else
  1353. X    $cat <<EOM
  1354. X<sys/sockio.h> not found, assuming socket ioctls are in <sys/ioctl.h>.
  1355. XEOM
  1356. X@end
  1357. Xfi
  1358. X?LINT:set i_syssockio
  1359. Xset i_syssockio
  1360. Xeval $setvar
  1361. X
  1362. X@end
  1363. X@if VOIDTTY || d_voidtty
  1364. X: check how to void tty association
  1365. Xecho " "
  1366. Xcase "$i_sysioctl" in
  1367. X"$define") xxx=`./findhdr sys/ioctl.h`;;
  1368. X?X: $xxx was set during the determination of i_sysioctl
  1369. X*) xxx=`./findhdr $xxx`;;
  1370. Xesac
  1371. Xif $contains TIOCNOTTY $xxx >/dev/null 2>&1; then
  1372. X    val="$define"
  1373. X    echo "TIOCNOTTY found in $xxx." >&4
  1374. X    echo "Using ioctl() call on /dev/tty to void tty association." >&4
  1375. Xelse
  1376. X    val="$undef"
  1377. X    echo "Closing standard file descriptors should void tty association." >&4
  1378. Xfi
  1379. X?LINT:set d_voidtty
  1380. Xset d_voidtty
  1381. Xeval $setvar
  1382. X
  1383. X@end
  1384. END_OF_FILE
  1385.   if test 4919 -ne `wc -c <'mcon/U/i_sysioctl.U'`; then
  1386.     echo shar: \"'mcon/U/i_sysioctl.U'\" unpacked with wrong size!
  1387.   fi
  1388.   # end of 'mcon/U/i_sysioctl.U'
  1389. fi
  1390. if test -f 'mcon/U/locdist.U' -a "${1}" != "-c" ; then 
  1391.   echo shar: Will not clobber existing file \"'mcon/U/locdist.U'\"
  1392. else
  1393.   echo shar: Extracting \"'mcon/U/locdist.U'\" \(4712 characters\)
  1394.   sed "s/^X//" >'mcon/U/locdist.U' <<'END_OF_FILE'
  1395. X?RCS: $Id: locdist.U,v 3.0 1993/08/18 12:09:06 ram Exp $
  1396. X?RCS:
  1397. X?RCS: Copyright (c) 1991-1993, Raphael Manfredi
  1398. X?RCS: 
  1399. X?RCS: You may redistribute only under the terms of the Artistic Licence,
  1400. X?RCS: as specified in the README file that comes with the distribution.
  1401. X?RCS: You may reuse parts of this distribution only within the terms of
  1402. X?RCS: that same Artistic Licence; a copy of which may be found at the root
  1403. X?RCS: of the source tree for dist 3.0.
  1404. X?RCS:
  1405. X?RCS: $Log: locdist.U,v $
  1406. X?RCS: Revision 3.0  1993/08/18  12:09:06  ram
  1407. X?RCS: Baseline for dist 3.0 netwide release.
  1408. X?RCS:
  1409. X?MAKE:locdist orgdist citydist statedist cntrydist contdist: test \
  1410. X    newslibexp cat Myread Oldconfig
  1411. X?MAKE:    -pick add $@ %<
  1412. X?S:locdist:
  1413. X?S:    This variable contains the eventual value of the LOCDIST symbol,
  1414. X?S:    which is the local organization's distribution name for news.
  1415. X?S:.
  1416. X?S:orgdist:
  1417. X?S:    This variable contains the eventual value of the ORGDIST symbol,
  1418. X?S:    which is the organization's distribution name for news.
  1419. X?S:.
  1420. X?S:citydist:
  1421. X?S:    This variable contains the eventual value of the CITYDIST symbol,
  1422. X?S:    which is the city's distribution name for news.
  1423. X?S:.
  1424. X?S:statedist:
  1425. X?S:    This variable contains the eventual value of the STATEDIST symbol,
  1426. X?S:    which is the state's or province's distribution name for news.
  1427. X?S:.
  1428. X?S:cntrydist:
  1429. X?S:    This variable contains the eventual value of the CNTRYDIST symbol,
  1430. X?S:    which is the country's distribution name for news.
  1431. X?S:.
  1432. X?S:contdist:
  1433. X?S:    This variable contains the eventual value of the CONTDIST symbol,
  1434. X?S:    which is the continent's distribution name for news.
  1435. X?S:.
  1436. X?C:LOCDIST:
  1437. X?C:    This symbol contains the distribution name for the news system that
  1438. X?C:    restricts article distribution to the local organization.
  1439. X?C:.
  1440. X?C:ORGDIST:
  1441. X?C:    This symbol contains the distribution name for the news system that
  1442. X?C:    restricts article distribution to the organization.
  1443. X?C:.
  1444. X?C:CITYDIST:
  1445. X?C:    This symbol contains the distribution name for the news system that
  1446. X?C:    restricts article distribution to the city.
  1447. X?C:.
  1448. X?C:STATEDIST:
  1449. X?C:    This symbol contains the distribution name for the news system that
  1450. X?C:    restricts article distribution to the state or province.
  1451. X?C:.
  1452. X?C:CNTRYDIST:
  1453. X?C:    This symbol contains the distribution name for the news system that
  1454. X?C:    restricts article distribution to the country.
  1455. X?C:.
  1456. X?C:CONTDIST:
  1457. X?C:    This symbol contains the distribution name for the news system that
  1458. X?C:    restricts article distribution to the continent.
  1459. X?C:.
  1460. X?H:#define LOCDIST "$locdist"        /**/
  1461. X?H:#define ORGDIST "$orgdist"        /**/
  1462. X?H:#define CITYDIST "$citydist"        /**/
  1463. X?H:#define STATEDIST "$statedist"        /**/
  1464. X?H:#define CNTRYDIST "$cntrydist"        /**/
  1465. X?H:#define CONTDIST "$contdist"        /**/
  1466. X?H:.
  1467. X: get the local distributions
  1468. X$cat <<'EOH'
  1469. XDistribution groups are the things you use on the Distribution line to limit
  1470. Xwhere an article will go to.  You are likely to be a member of several
  1471. Xdistribution groups, such as organization, city, state, province, country,
  1472. Xcontinent, etc.  For example, Los Angeles has the distribution code "la",
  1473. XNew Jersey has the code "nj", and Europe has the code "eunet".
  1474. X
  1475. XThe categories you will be asked are: 
  1476. X
  1477. Xlocal organization    (Could be just one machine or a cluster or an office)
  1478. Xorganization        att, dec, kgb, ...
  1479. Xcity            la, ny, mosc, ...
  1480. Xstate/province        ca, nj, bc, ...
  1481. Xcountry            usa, can, rok, whatever
  1482. Xcontinent        na (North America), asia, etc.
  1483. X
  1484. XEOH
  1485. Xif $test -f $newslibexp/distributions; then
  1486. X    case "$silent" in
  1487. X    true) ;;
  1488. X    *)    dflt='Hit return to continue'
  1489. X        rp=''
  1490. X        . ./myread
  1491. X        ;;
  1492. X    esac
  1493. X    echo "Here is your distributions file:" >&4
  1494. X    echo " " >&4
  1495. X    $cat >&4 $newslibexp/distributions
  1496. X    echo " " >&4
  1497. Xfi
  1498. Xecho "Use 'none' for any distributions you don't have."
  1499. Xecho " "
  1500. Xcase "$locdist" in
  1501. X'') dflt="none";;
  1502. X*)  dflt="$locdist";;
  1503. Xesac
  1504. Xrp="What is the distribution code for your local organization?"
  1505. X. ./myread
  1506. Xlocdist="$ans"
  1507. Xcase "$orgdist" in
  1508. X'') dflt="none";;
  1509. X*)  dflt="$orgdist";;
  1510. Xesac
  1511. Xrp="What is the distribution code for your organization?"
  1512. X. ./myread
  1513. Xorgdist="$ans"
  1514. Xcase "$citydist" in
  1515. X'') dflt="none";;
  1516. X*)  dflt="$citydist";;
  1517. Xesac
  1518. Xrp="What is the distribution code for your city?"
  1519. X. ./myread
  1520. Xcitydist="$ans"
  1521. Xcase "$statedist" in
  1522. X'') dflt="none";;
  1523. X*)  dflt="$statedist";;
  1524. Xesac
  1525. Xrp="What is the distribution code for your state/province?"
  1526. X. ./myread
  1527. Xstatedist="$ans"
  1528. Xcase "$cntrydist" in
  1529. X'') dflt="none";;
  1530. X*)  dflt="$cntrydist";;
  1531. Xesac
  1532. Xrp="What is the distribution code for your country?"
  1533. X. ./myread
  1534. Xcntrydist="$ans"
  1535. Xcase "$contdist" in
  1536. X'') dflt="none";;
  1537. X*)  dflt="$contdist";;
  1538. Xesac
  1539. Xrp="What is the distribution code for your continent?"
  1540. X. ./myread
  1541. Xcontdist="$ans"
  1542. X$cat <<'EOM'
  1543. X  
  1544. XIf you have any other distribution groups you will need to edit Pnews
  1545. Xand newsetup to add them.
  1546. XEOM
  1547. X
  1548. END_OF_FILE
  1549.   if test 4712 -ne `wc -c <'mcon/U/locdist.U'`; then
  1550.     echo shar: \"'mcon/U/locdist.U'\" unpacked with wrong size!
  1551.   fi
  1552.   # end of 'mcon/U/locdist.U'
  1553. fi
  1554. if test -f 'mcon/makegloss.SH' -a "${1}" != "-c" ; then 
  1555.   echo shar: Will not clobber existing file \"'mcon/makegloss.SH'\"
  1556. else
  1557.   echo shar: Extracting \"'mcon/makegloss.SH'\" \(5163 characters\)
  1558.   sed "s/^X//" >'mcon/makegloss.SH' <<'END_OF_FILE'
  1559. Xcase $CONFIG in
  1560. X'')
  1561. X    if test -f config.sh; then TOP=.;
  1562. X    elif test -f ../config.sh; then TOP=..;
  1563. X    elif test -f ../../config.sh; then TOP=../..;
  1564. X    elif test -f ../../../config.sh; then TOP=../../..;
  1565. X    elif test -f ../../../../config.sh; then TOP=../../../..;
  1566. X    else
  1567. X        (echo "Can't find config.sh."; exit 1)
  1568. X    fi
  1569. X    . $TOP/config.sh
  1570. X    ;;
  1571. Xesac
  1572. Xcase "$0" in
  1573. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  1574. Xesac
  1575. Xecho "Extracting mcon/makegloss (with variable substitutions)"
  1576. X$spitshell >makegloss <<!GROK!THIS!
  1577. X$startperl
  1578. X    eval "exec perl -S \$0 \$*"
  1579. X        if \$running_under_some_shell;
  1580. X
  1581. X!GROK!THIS!
  1582. X$spitshell >>makegloss <<'!NO!SUBS!'
  1583. X# $Id: makegloss.SH,v 3.0 1993/08/18 12:10:12 ram Exp $
  1584. X#
  1585. X#  Copyright (c) 1991-1993, Raphael Manfredi
  1586. X#  
  1587. X#  You may redistribute only under the terms of the Artistic Licence,
  1588. X#  as specified in the README file that comes with the distribution.
  1589. X#  You may reuse parts of this distribution only within the terms of
  1590. X#  that same Artistic Licence; a copy of which may be found at the root
  1591. X#  of the source tree for dist 3.0.
  1592. X#
  1593. X# Original Author: Larry Wall <lwall@netlabs.com>
  1594. X#
  1595. X# $Log: makegloss.SH,v $
  1596. X# Revision 3.0  1993/08/18  12:10:12  ram
  1597. X# Baseline for dist 3.0 netwide release.
  1598. X#
  1599. X
  1600. Xopen(G,">Glossary") || die "Can't create Glossary.\n";
  1601. Xprint G
  1602. X'[This Glossary is automatically generated from the Unit files.  Do not edit
  1603. Xthis file or your changes will be lost.  Edit the appropriate Unit instead.]
  1604. X
  1605. XThis file contains a listing of all the C preprocessor symbols and shell
  1606. Xvariables whose value can be determined by a Configure script.  For the
  1607. Xmost part, any symbol in UPPERCASE is a C preprocessor symbol, and
  1608. Xwill be defined in config.h.  Symbols in lowercase are shell variables,
  1609. Xand are defined in config.sh.
  1610. X
  1611. XIf you write your shell scripts and C programs in terms of these symbols,
  1612. Xmetaconfig can automatically build you a Configure script that will determine
  1613. Xthe value of those symbols.  See the README file for a description of how
  1614. Xto use metaconfig.
  1615. X
  1616. XIn the following listing, the Unit: line indicates the name of the unit
  1617. Xwhere this symbol is defined, and the Wants: line indicates what other
  1618. Xsymbols must be determined in order to figure out the value of this one.
  1619. XIf there is an "(Also defines ...)" entry, it indicates what other symbols
  1620. Xare defined by the Unit other than the one corresponding to the unit name.
  1621. X
  1622. XVariable of the form d_* either have the value "define" or "/*define", and
  1623. Xcontrol whether some C preprocessor symbol gets defined or not.
  1624. X
  1625. X';
  1626. X
  1627. X@ARGV = <U/*.U>;
  1628. Xwhile (<>) {
  1629. X    if (/^\?[\w\-]+:/) {     # We may have found a control line
  1630. X        # Long lines may be escaped with a final backslash
  1631. X        $_ .= &complete_line if s/\\\s*$//;
  1632. X    }
  1633. X    if (/^\?MAKE:.*:/) {
  1634. X        ($unit,$also,$wants) = /^\?MAKE:\s*(\w+)\s*(.*):\s*(.*)/;
  1635. X        @Wants = split(/ /,$wants);
  1636. X        $wants = '';
  1637. X        $option = '';
  1638. X        foreach (@Wants) {
  1639. X            if (s/^\+//) {
  1640. X                $option .= "$_ ";
  1641. X            } else {
  1642. X                $wants .= "$_ ";
  1643. X            }
  1644. X        }
  1645. X        chop($option);
  1646. X        chop($wants);
  1647. X        $head = '';
  1648. X        $_ = "Unit: $unit";
  1649. X        $_ .= " (Also defines $also)" if $also;
  1650. X        $head .= do format($_);
  1651. X        if ($wants) {
  1652. X            $_ = "Wants: $wants";
  1653. X            $head .= do format($_);
  1654. X        }
  1655. X        if ($option) {
  1656. X            $_ = "Optional: $option";
  1657. X            $head .= do format($_);
  1658. X        }
  1659. X        $head .= "\n";
  1660. X    }
  1661. X
  1662. X    # Example of expression matched by the following pattern:
  1663. X    #   ?C:symbol ~ alias (obsolete list):
  1664. X    # The main symbol (optionally aliased) can be followed by a list of
  1665. X    # obsolete symbols (the list is space separated).
  1666. X
  1667. X    if (s/^\?[CS]:(\w+)(\s*~\s*\S+)?\s*(\(.*\))?:s*$/$1:\n/) {
  1668. X        $sym = $1;
  1669. X        $obsoleted = $3;
  1670. X        push(@syms, $sym);
  1671. X        $header{$sym} .= $head;
  1672. X        if ($obsoleted =~ s/^\((.*)\)$/$1/) {
  1673. X            @obsoleted = split(' ', $obsoleted);
  1674. X            foreach $obs (@obsoleted) {
  1675. X                push(@syms, $obs);
  1676. X                $header{$obs} = "\tObsoleted by $sym.\n\n";
  1677. X            }
  1678. X        }
  1679. X    }
  1680. X    elsif (s/^\?[CS]://) {        # Must be inside definition
  1681. X        if (/^\.$/) {            # Closing line
  1682. X            $def{$sym} .= "\n";
  1683. X            $sym = '';
  1684. X        }
  1685. X        else {
  1686. X            s/^(\t|  ? ? ? ? ? ? ?)//;
  1687. X            $def{$sym} .= "\t" . $_;
  1688. X        }
  1689. X    }
  1690. X}
  1691. X
  1692. Xforeach $sym (sort @syms) {
  1693. X    print G "$sym:\n";
  1694. X    print G $header{$sym};
  1695. X    print G $def{$sym};
  1696. X}
  1697. Xclose G;
  1698. X
  1699. X# Format $_ to fit in 80 columns (70 + size of tabs)
  1700. X# Long lines are split, and the all but the first are indented
  1701. X# by two leading spaces. The whole thing is then indented by
  1702. X# one tab.
  1703. Xsub format {
  1704. X    local($tmp);
  1705. X    local($head) = '';
  1706. X    local($_) = shift(@_);
  1707. X    while (length($_) > 70) {
  1708. X        $tmp = substr($_,0,70);
  1709. X        $tmp =~ s/^(.*) .*/$1/;
  1710. X        $head .= "\t$tmp\n";
  1711. X        $_ = ' ' . substr($_,length($tmp),9999);
  1712. X    }
  1713. X    $head .= "\t$_\n";
  1714. X}
  1715. X
  1716. X# The first line was escaped with a final \ character. Every following line
  1717. X# is to be appended to it (until we found a real \n not escaped). Note that
  1718. X# the leading spaces of the continuation line are removed, so any space should
  1719. X# be added before the former \ if needed.
  1720. Xsub complete_line {
  1721. X    local($_);
  1722. X    local($read) = '';        # Concatenation of all the continuation lines found
  1723. X    while (<>) {
  1724. X        s/^\s+//;                # Remove leading spaces
  1725. X        if (s/\\\s*$//) {        # Still followed by a continuation line
  1726. X            $read .= $_;    
  1727. X        } else {                # We've reached the end of the continuation
  1728. X            return $read . $_;
  1729. X        }
  1730. X    }
  1731. X}
  1732. X
  1733. X!NO!SUBS!
  1734. Xchmod 755 makegloss
  1735. X$eunicefix makegloss
  1736. END_OF_FILE
  1737.   if test 5163 -ne `wc -c <'mcon/makegloss.SH'`; then
  1738.     echo shar: \"'mcon/makegloss.SH'\" unpacked with wrong size!
  1739.   fi
  1740.   chmod +x 'mcon/makegloss.SH'
  1741.   # end of 'mcon/makegloss.SH'
  1742. fi
  1743. if test -f 'mcon/pl/xwant.pl' -a "${1}" != "-c" ; then 
  1744.   echo shar: Will not clobber existing file \"'mcon/pl/xwant.pl'\"
  1745. else
  1746.   echo shar: Extracting \"'mcon/pl/xwant.pl'\" \(4720 characters\)
  1747.   sed "s/^X//" >'mcon/pl/xwant.pl' <<'END_OF_FILE'
  1748. X;# $Id: xwant.pl,v 3.0 1993/08/18 12:10:32 ram Exp $
  1749. X;#
  1750. X;#  Copyright (c) 1991-1993, Raphael Manfredi
  1751. X;#  
  1752. X;#  You may redistribute only under the terms of the Artistic Licence,
  1753. X;#  as specified in the README file that comes with the distribution.
  1754. X;#  You may reuse parts of this distribution only within the terms of
  1755. X;#  that same Artistic Licence; a copy of which may be found at the root
  1756. X;#  of the source tree for dist 3.0.
  1757. X;#
  1758. X;# $Log: xwant.pl,v $
  1759. X;# Revision 3.0  1993/08/18  12:10:32  ram
  1760. X;# Baseline for dist 3.0 netwide release.
  1761. X;#
  1762. X;# 
  1763. X;# These two arrays record the file names of the files which may (or may not)
  1764. X;# contain shell or C symbols known by metaconfig.
  1765. X;#  @SHlist records the .SH files
  1766. X;#  @clist records the C-like files (i.e. .[chyl])
  1767. X;#
  1768. X# Parse files and build cross references
  1769. Xsub build_xref {
  1770. X    print "Building cross-reference files...\n" unless $opt_s;
  1771. X    unless (-f $NEWMANI) {
  1772. X        &manifake;
  1773. X        die "No $NEWMANI--don't know who to scan.\n" unless -f $NEWMANI;
  1774. X    }
  1775. X
  1776. X    open(FUI, "|sort | uniq >I.fui") || die "Can't create I.fui.\n";
  1777. X    open(UIF, "|sort | uniq >I.uif") || die "Can't create I.uif.\n";
  1778. X
  1779. X    local($search);                            # Where to-be-evaled script is held
  1780. X    local($_) = ' ' x 50000 if $opt_m;        # Pre-extend pattern search space
  1781. X    local(%visited);                        # Records visited files
  1782. X    local(%lastfound);                        # Where last occurence of key was
  1783. X
  1784. X    # Map shell symbol names to units by reverse engineering the @Master array
  1785. X    # which records all the known shell symbols and the units where they
  1786. X    # are defined.
  1787. X    foreach $init (@Master) {
  1788. X        $init =~ /^\?(.*):(.*)=''/ && ($shwanted{"\$$2"} = $1);
  1789. X    }
  1790. X
  1791. X    # Now we are a little clever, and build a loop to eval so that we don't
  1792. X    # have to recompile our patterns on every file.  We also use "study" since
  1793. X    # we are searching the same string for many different things.  Hauls!
  1794. X
  1795. X    if (@clist) {
  1796. X        print "    Scanning .[chyl] files for symbols...\n" unless $opt_s;
  1797. X        $search = ' ' x (40 * (@cmaster + @ocmaster));    # Pre-extend
  1798. X        $search = "while (<>) {study;\n";                # Init loop over ARGV
  1799. X        foreach $key (keys(cmaster)) {
  1800. X            $search .= "\$cmaster{'$key'} .= \"\$ARGV#\" if /\\b$key\\b/;\n";
  1801. X        }
  1802. X        foreach $key (grep(!/^\$/, keys %Obsolete)) {
  1803. X            $search .= "&ofound('$key') if /\\b$key\\b/;\n";
  1804. X        }
  1805. X        $search .= "}\n";            # terminate loop
  1806. X        print $search if $opt_d;
  1807. X        @ARGV = @clist;
  1808. X        # Swallow each file as a whole, if memory is available
  1809. X        undef $/ if $opt_m;
  1810. X        eval $search;
  1811. X        eval '';
  1812. X        $/ = "\n";
  1813. X        while (($key,$value) = each(cmaster)) {
  1814. X            next if $value eq '';
  1815. X            foreach $file (sort(split(/#/, $value))) {
  1816. X                next if $file eq '';
  1817. X                # %cwanted may contain value separated by \n -- take last one
  1818. X                @sym = split(/\n/, $cwanted{$key});
  1819. X                $sym = pop(@sym);
  1820. X                $shell = "\$$sym";
  1821. X                print FUI
  1822. X                    pack("A35", $file),
  1823. X                    pack("A20", "$shwanted{$shell}.U"),
  1824. X                    $key, "\n";
  1825. X                print UIF
  1826. X                    pack("A20", "$shwanted{$shell}.U"),
  1827. X                    pack("A25", $key),
  1828. X                    $file, "\n";
  1829. X            }
  1830. X        }
  1831. X    }
  1832. X
  1833. X    undef @clist;
  1834. X    undef %cwanted;
  1835. X    undef %cmaster;        # We're not building Configure, we may delete this
  1836. X    %visited = ();
  1837. X    %lastfound = ();
  1838. X
  1839. X    if (@SHlist) {
  1840. X        print "    Scanning .SH files for symbols...\n" unless $opt_s;
  1841. X        $search = ' ' x (40 * (@shmaster + @oshmaster));    # Pre-extend
  1842. X        $search = "while (<>) {study;\n";
  1843. X        # All the keys already have a leading '$'
  1844. X        foreach $key (keys(shmaster)) {
  1845. X            $search .= "\$shmaster{'$key'} .= \"\$ARGV#\" if /\\$key\\b/;\n";
  1846. X        }
  1847. X        foreach $key (grep (/^\$/, keys %Obsolete)) {
  1848. X            $search .= "&ofound('$key') if /\\$key\\b/;\n";
  1849. X        }
  1850. X        $search .= "}\n";
  1851. X        print $search if $opt_d;
  1852. X        @ARGV = @SHlist;
  1853. X        # Swallow each file as a whole, if memory is available
  1854. X        undef $/ if $opt_m;
  1855. X        eval $search;
  1856. X        eval '';
  1857. X        $/ = "\n";
  1858. X        while (($key,$value) = each(shmaster)) {
  1859. X            next if $value eq '';
  1860. X            foreach $file (sort(split(/#/, $value))) {
  1861. X                next if $file eq '';
  1862. X                print FUI
  1863. X                    pack("A35", $file),
  1864. X                    pack("A20", "$shwanted{$key}.U"),
  1865. X                    $key, "\n";
  1866. X                print UIF
  1867. X                    pack("A20", "$shwanted{$key}.U"),
  1868. X                    pack("A25", $key),
  1869. X                    $file, "\n";
  1870. X            }
  1871. X        }
  1872. X    }
  1873. X
  1874. X    close FUI;
  1875. X    close UIF;
  1876. X
  1877. X    # If obsolete symbols where found, write an Obsolete file which lists where
  1878. X    # each of them appear and the new symbol to be used. Also write Obsol_h.U
  1879. X    # and Obsol_sh.U in .MT for later perusal.
  1880. X
  1881. X    &dump_obsolete;                        # Dump obsolete symbols if any
  1882. X
  1883. X    # Clean-up memory by freeing useless data structures
  1884. X    undef @SHlist;
  1885. X    undef %shmaster;
  1886. X}
  1887. X
  1888. X# This routine records matches of obsolete keys (C or shell)
  1889. Xsub ofound {
  1890. X    local($key) = @_;
  1891. X    local($_) = $Obsolete{$key};        # Value of new symbol
  1892. X    $ofound{"$ARGV $key $_"}++;            # Record obsolete match
  1893. X    $cmaster{$_} .= "$ARGV#" unless /^\$/;    # A C hit
  1894. X    $shmaster{$_} .= "$ARGV#" if /^\$/;        # Or a shell one
  1895. X}
  1896. X
  1897. END_OF_FILE
  1898.   if test 4720 -ne `wc -c <'mcon/pl/xwant.pl'`; then
  1899.     echo shar: \"'mcon/pl/xwant.pl'\" unpacked with wrong size!
  1900.   fi
  1901.   # end of 'mcon/pl/xwant.pl'
  1902. fi
  1903. echo shar: End of archive 12 \(of 28\).
  1904. cp /dev/null ark12isdone
  1905. MISSING=""
  1906. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ; do
  1907.     if test ! -f ark${I}isdone ; then
  1908.     MISSING="${MISSING} ${I}"
  1909.     fi
  1910. done
  1911. if test "${MISSING}" = "" ; then
  1912.     echo You have unpacked all 28 archives.
  1913.     echo "Please run PACKNOTES through sh, read REAMDE and then type Configure."
  1914.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1915. else
  1916.     echo You still must unpack the following archives:
  1917.     echo "        " ${MISSING}
  1918. fi
  1919. exit 0
  1920.  
  1921. exit 0 # Just in case...
  1922.