home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume7 / patch2 / patch11 < prev    next >
Internet Message Format  |  1988-06-04  |  34KB

  1. From bbn.com!bbn!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!elroy!devvax!lwall Sat Jun  4 20:08:55 EDT 1988
  2. Article 1010 of comp.sources.bugs:
  3. Path: bbn.com!bbn!mit-eddie!bloom-beacon!tut.cis.ohio-state.edu!mailrus!ames!elroy!devvax!lwall
  4. >From: lwall@devvax.JPL.NASA.GOV (Larry Wall)
  5. Newsgroups: comp.sources.bugs
  6. Subject: patch 2.0 patch #11
  7. Summary: This is an official patch for patch 2.0.  Please apply it.
  8. Message-ID: <2169@devvax.JPL.NASA.GOV>
  9. Date: 3 Jun 88 23:50:40 GMT
  10. Organization: Jet Propulsion Laboratory
  11. Lines: 1469
  12.  
  13. System: patch version 2.0
  14. Patch #: 11
  15. Priority: same as patch 10
  16. Subject: patch 10 continued
  17.  
  18. Description:
  19.     This is a new Configure.
  20.  
  21. Fix:    Unlike most patches, this one contains an entire new Configure
  22.     script, which is shorter than the diffs.  Unshar this file in
  23.     your patch source directory.  Please make sure you've just applied
  24.     patch #10--this one doesn't check that patchlevel.h is correct.
  25.  
  26.     After applying:
  27.         Configure    (or Configure -d)
  28.         make
  29.         make install
  30.  
  31.     If you are missing previous patches they can be obtained from me:
  32.  
  33.     Larry Wall
  34.     lwall@jpl-devvax.jpl.nasa.gov
  35.  
  36.     If you send a mail message of the following form it will greatly speed
  37.     processing:
  38.  
  39.     Subject: Command
  40.     @SH mailpatch PATH patch 2.0 LIST
  41.            ^ note the c
  42.  
  43.     where PATH is a return path FROM ME TO YOU in Internet notation, and
  44.     LIST is the number of one or more patches you need, separated by spaces,
  45.     commas, and/or hyphens.  Saying 35- says everything from 35 to the end.
  46.  
  47.     You can also get the patches via anonymous FTP from
  48.     jpl-devvax.jpl.nasa.gov (128.149.8.43).
  49.  
  50. #!/bin/sh
  51. echo 'If this kit is complete, "End of kit" will echo at the end'
  52. echo Extracting Configure
  53. sed >Configure <<'!STUFFY!FUNK!' -e 's/X//'
  54. X#! /bin/sh
  55. X#
  56. X# If these # comments don't work, trim them.  Don't worry about any other
  57. X# shell scripts, Configure will trim # comments from them for you.
  58. X#
  59. X# (If you are trying to port this package to a machine without sh, I would
  60. X# suggest you cut out the prototypical config.h from the end of Configure
  61. X# and edit it to reflect your system.  Some packages may include samples
  62. X# of config.h for certain machines, so you might look for one of those.)
  63. X#
  64. X# $Header: Configure,v 2.0.1.1 88/06/03 15:00:13 lwall Locked $
  65. X#
  66. X# Yes, you may rip this off to use in other distribution packages.
  67. X# (Note: this Configure script was generated automatically.  Rather than
  68. X# working with this copy of Configure, you may wish to get metaconfig.)
  69. X
  70. X: sanity checks
  71. XPATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc'
  72. Xexport PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  73. X
  74. Xif test ! -t 0; then
  75. X    echo "Say 'sh Configure', not 'sh <Configure'"
  76. X    exit 1
  77. Xfi
  78. X
  79. X(alias) >/dev/null 2>&1 && \
  80. X    echo "(I see you are using the Korn shell.  Some ksh's blow up on Configure," && \
  81. X    echo "especially on exotic machines.  If yours does, try the Bourne shell instead.)"
  82. X
  83. Xif test ! -d ../UU; then
  84. X    if test ! -d UU; then
  85. X    mkdir UU
  86. X    fi
  87. X    cd UU
  88. Xfi
  89. X
  90. Xcase "$1" in
  91. X-d) shift; fastread='yes';;
  92. Xesac
  93. X
  94. Xd_eunice=''
  95. Xeunicefix=''
  96. Xdefine=''
  97. Xloclist=''
  98. Xexpr=''
  99. Xsed=''
  100. Xecho=''
  101. Xcat=''
  102. Xrm=''
  103. Xmv=''
  104. Xcp=''
  105. Xtail=''
  106. Xtr=''
  107. Xmkdir=''
  108. Xsort=''
  109. Xuniq=''
  110. Xgrep=''
  111. Xtrylist=''
  112. Xtest=''
  113. Xinews=''
  114. Xegrep=''
  115. Xmore=''
  116. Xpg=''
  117. XMcc=''
  118. Xvi=''
  119. Xmailx=''
  120. Xmail=''
  121. Xcpp=''
  122. XLog=''
  123. XHeader=''
  124. Xbin=''
  125. Xcc=''
  126. Xcontains=''
  127. Xcppstdin=''
  128. Xcppminus=''
  129. Xd_charsprf=''
  130. Xd_flexfnam=''
  131. Xd_index=''
  132. Xd_voidsig=''
  133. Xlibc=''
  134. Xmansrc=''
  135. Xmanext=''
  136. Xmodels=''
  137. Xsplit=''
  138. Xsmall=''
  139. Xmedium=''
  140. Xlarge=''
  141. Xhuge=''
  142. Xccflags=''
  143. Xldflags=''
  144. Xn=''
  145. Xc=''
  146. Xpackage=''
  147. Xregisters=''
  148. Xreg1=''
  149. Xreg2=''
  150. Xreg3=''
  151. Xreg4=''
  152. Xreg5=''
  153. Xreg6=''
  154. Xreg7=''
  155. Xreg8=''
  156. Xreg9=''
  157. Xreg10=''
  158. Xreg11=''
  159. Xreg12=''
  160. Xreg13=''
  161. Xreg14=''
  162. Xreg15=''
  163. Xreg16=''
  164. Xspitshell=''
  165. Xshsharp=''
  166. Xsharpbang=''
  167. Xstartsh=''
  168. Xvoidflags=''
  169. Xdefvoidused=''
  170. XCONFIG=''
  171. X
  172. X: set package name
  173. Xpackage=patch
  174. X
  175. Xecho " "
  176. Xecho "Beginning of configuration questions for $package kit."
  177. X: Eunice requires " " instead of "", can you believe it
  178. Xecho " "
  179. X
  180. Xdefine='define'
  181. Xundef='/*undef'
  182. Xlibpth='/usr/lib /usr/local/lib /lib'
  183. Xsmallmach='pdp11 i8086 z8000 i80286 iAPX286'
  184. Xrmlist='kit[1-9]isdone kit[1-9][0-9]isdone'
  185. Xtrap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  186. X
  187. X: We must find out about Eunice early
  188. Xeunicefix=':'
  189. Xif test -f /etc/unixtovms; then
  190. X    eunicefix=/etc/unixtovms
  191. Xfi
  192. Xif test -f /etc/unixtovms.exe; then
  193. X    eunicefix=/etc/unixtovms.exe
  194. Xfi
  195. X
  196. Xattrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  197. Xattrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
  198. Xattrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  199. Xattrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX"
  200. Xattrlist="$attrlist $mc68k __STDC__"
  201. Xpth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /lib"
  202. Xd_newshome="../../NeWS"
  203. Xdefvoidused=7
  204. X
  205. X: some greps do not return status, grrr.
  206. Xecho "grimblepritz" >grimble
  207. Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
  208. X    contains=contains
  209. Xelif grep grimblepritz grimble >/dev/null 2>&1 ; then
  210. X    contains=grep
  211. Xelse
  212. X    contains=contains
  213. Xfi
  214. Xrm -f grimble
  215. X: the following should work in any shell
  216. Xcase "$contains" in
  217. Xcontains*)
  218. X    echo " "
  219. X    echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  220. X    cat >contains <<'EOSS'
  221. Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  222. XEOSS
  223. Xchmod +x contains
  224. Xesac
  225. X
  226. X: first determine how to suppress newline on echo command
  227. Xecho "Checking echo to see how to suppress newlines..."
  228. X(echo "hi there\c" ; echo " ") >.echotmp
  229. Xif $contains c .echotmp >/dev/null 2>&1 ; then
  230. X    echo "...using -n."
  231. X    n='-n'
  232. X    c=''
  233. Xelse
  234. X    cat <<'EOM'
  235. X...using \c
  236. XEOM
  237. X    n=''
  238. X    c='\c'
  239. Xfi
  240. Xecho $n "Type carriage return to continue.  Your cursor should be here-->$c"
  241. Xread ans
  242. Xrm -f .echotmp
  243. X
  244. X: now set up to do reads with possible shell escape and default assignment
  245. Xcat <<EOSC >myread
  246. Xcase "\$fastread" in
  247. Xyes) ans=''; echo " " ;;
  248. X*) ans='!';;
  249. Xesac
  250. Xwhile expr "X\$ans" : "X!" >/dev/null; do
  251. X    read ans
  252. X    case "\$ans" in
  253. X    !)
  254. X    sh
  255. X    echo " "
  256. X    echo $n "\$rp $c"
  257. X    ;;
  258. X    !*)
  259. X    set \`expr "X\$ans" : "X!\(.*\)\$"\`
  260. X    sh -c "\$*"
  261. X    echo " "
  262. X    echo $n "\$rp $c"
  263. X    ;;
  264. X    esac
  265. Xdone
  266. Xrp='Your answer:'
  267. Xcase "\$ans" in
  268. X'') ans="\$dflt";;
  269. Xesac
  270. XEOSC
  271. X
  272. X: general instructions
  273. Xcat <<EOH
  274. XThis installation shell script will examine your system and ask you questions
  275. Xto determine how the $package package should be installed.  If you get stuck
  276. Xon a question, you may use a ! shell escape to start a subshell or execute
  277. Xa command.  Many of the questions will have default answers in square
  278. Xbrackets--typing carriage return will give you the default.
  279. X
  280. XOn some of the questions which ask for file or directory names you are
  281. Xallowed to use the ~name construct to specify the login directory belonging
  282. Xto "name", even if you don't have a shell which knows about that.  Questions
  283. Xwhere this is allowed will be marked "(~name ok)".
  284. X
  285. XEOH
  286. Xrp="[Type carriage return to continue]"
  287. Xecho $n "$rp $c"
  288. X. myread
  289. Xcat <<EOH
  290. X
  291. XMuch effort has been expended to ensure that this shell script will run
  292. Xon any Unix system.  If despite that it blows up on you, your best bet is
  293. Xto edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
  294. Xknow how I blew it.  If you can't run Configure for some reason, you'll have
  295. Xto generate a config.sh file by hand.
  296. X
  297. XThis installation script affects things in two ways: 1) it may do direct
  298. Xvariable substitutions on some of the files included in this kit, and
  299. X2) it builds a config.h file for inclusion in C programs.  You may edit
  300. Xany of these files as the need arises after running this script.
  301. X
  302. XIf you make a mistake on a question, there is no easy way to back up to it
  303. Xcurrently.  The easiest thing to do is to edit config.sh and rerun all the
  304. XSH files.  Configure will offer to let you do this before it runs the SH files.
  305. X
  306. XEOH
  307. Xrp="[Type carriage return to continue]"
  308. Xecho $n "$rp $c"
  309. X. myread
  310. X
  311. X: get old answers, if there is a config file out there
  312. Xif test -f ../config.sh; then
  313. X    echo " "
  314. X    dflt=y
  315. X    rp="I see a config.sh file.  Did Configure make it on THIS system? [$dflt]"
  316. X    echo $n "$rp $c"
  317. X    . myread
  318. X    case "$ans" in
  319. X    n*) echo "OK, I'll ignore it.";;
  320. X    *)  echo "Fetching default answers from your old config.sh file..."
  321. X    tmp="$n"
  322. X    ans="$c"
  323. X        . ../config.sh
  324. X    n="$tmp"
  325. X    c="$ans"
  326. X    ;;
  327. X    esac
  328. Xfi
  329. X
  330. X: find out where common programs are
  331. Xecho " "
  332. Xecho "Locating common programs..."
  333. Xcat <<EOSC >loc
  334. X$startsh
  335. Xcase \$# in
  336. X0) exit 1;;
  337. Xesac
  338. Xthing=\$1
  339. Xshift
  340. Xdflt=\$1
  341. Xshift
  342. Xfor dir in \$*; do
  343. X    case "\$thing" in
  344. X    .)
  345. X    if test -d \$dir/\$thing; then
  346. X        echo \$dir
  347. X        exit 0
  348. X    fi
  349. X    ;;
  350. X    *)
  351. X    if test -f \$dir/\$thing; then
  352. X        echo \$dir/\$thing
  353. X        exit 0
  354. X    elif test -f \$dir/\$thing.exe; then
  355. X        : on Eunice apparently
  356. X        echo \$dir/\$thing
  357. X        exit 0
  358. X    fi
  359. X    ;;
  360. X    esac
  361. Xdone
  362. Xecho \$dflt
  363. Xexit 1
  364. XEOSC
  365. Xchmod +x loc
  366. X$eunicefix loc
  367. Xloclist="
  368. Xexpr
  369. Xsed
  370. Xecho
  371. Xcat
  372. Xrm
  373. Xtr
  374. Xgrep
  375. X"
  376. Xtrylist="
  377. Xtest
  378. XMcc
  379. Xcpp
  380. X"
  381. Xfor file in $loclist; do
  382. X    xxx=`loc $file $file $pth`
  383. X    eval $file=$xxx
  384. X    eval _$file=$xxx
  385. X    case "$xxx" in
  386. X    /*)
  387. X    echo $file is in $xxx.
  388. X    ;;
  389. X    *)
  390. X    echo "I don't know where $file is.  I hope it's in everyone's PATH."
  391. X    ;;
  392. X    esac
  393. Xdone
  394. Xecho " "
  395. Xecho "Don't worry if any of the following aren't found..."
  396. Xans=offhand
  397. Xfor file in $trylist; do
  398. X    xxx=`loc $file $file $pth`
  399. X    eval $file=$xxx
  400. X    eval _$file=$xxx
  401. X    case "$xxx" in
  402. X    /*)
  403. X    echo $file is in $xxx.
  404. X    ;;
  405. X    *)
  406. X    echo "I don't see $file out there, $ans."
  407. X    ans=either
  408. X    ;;
  409. X    esac
  410. Xdone
  411. Xcase "$egrep" in
  412. Xegrep)
  413. X    echo "Substituting grep for egrep."
  414. X    egrep=$grep
  415. X    ;;
  416. Xesac
  417. Xcase "$test" in
  418. Xtest)
  419. X    echo "Hopefully test is built into your sh."
  420. X    ;;
  421. X/bin/test)
  422. X    echo " "
  423. X    dflt=n
  424. X    rp="Is your "'"'"test"'"'" built into sh? [$dflt] (OK to guess)"
  425. X    echo $n "$rp $c"
  426. X    . myread
  427. X    case "$ans" in
  428. X    y*) test=test ;;
  429. X    esac
  430. X    ;;
  431. X*)
  432. X    test=test
  433. X    ;;
  434. Xesac
  435. Xcase "$echo" in
  436. Xecho)
  437. X    echo "Hopefully echo is built into your sh."
  438. X    ;;
  439. X/bin/echo)
  440. X    echo " "
  441. X    echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  442. X    $echo $n "hi there$c" >foo1
  443. X    echo $n "hi there$c" >foo2
  444. X    if cmp foo1 foo2 >/dev/null 2>&1; then
  445. X    echo "They are compatible.  In fact, they may be identical."
  446. X    else
  447. X    case "$n" in
  448. X    '-n') n='' c='\c' ans='\c' ;;
  449. X    *) n='-n' c='' ans='-n' ;;
  450. X    esac
  451. X    cat <<FOO
  452. XThey are not compatible!  You are probably running ksh on a non-USG system.
  453. XI'll have to use /bin/echo instead of the builtin, since Bourne shell doesn't
  454. Xhave echo built in and we may have to run some Bourne shell scripts.  That
  455. Xmeans I'll have to use $ans to suppress newlines now.  Life is ridiculous.
  456. X
  457. XFOO
  458. X    rp="Your cursor should be here-->"
  459. X    $echo $n "$rp$c"
  460. X    . myread
  461. X    fi
  462. X    $rm -f foo1 foo2
  463. X    ;;
  464. X*)
  465. X    : cross your fingers
  466. X    echo=echo
  467. X    ;;
  468. Xesac
  469. Xrmlist="$rmlist loc"
  470. X
  471. X: get list of predefined functions in a handy place
  472. Xecho " "
  473. Xif test -f /lib/libc.a; then
  474. X    echo "Your C library is in /lib/libc.a.  You're normal."
  475. X    libc=/lib/libc.a
  476. Xelse
  477. X    ans=`loc libc.a blurfl/dyick $libpth`
  478. X    if test ! -f $ans; then
  479. X    ans=`loc clib blurfl/dyick $libpth`
  480. X    fi
  481. X    if test ! -f $ans; then
  482. X    ans=`loc libc blurfl/dyick $libpth`
  483. X    fi
  484. X    if test -f $ans; then
  485. X    echo "Your C library is in $ans, of all places."
  486. X    libc=$ans
  487. X    else
  488. X    if test -f "$libc"; then
  489. X        echo "Your C library is in $libc, like you said before."
  490. X    else
  491. X        cat <<EOM
  492. XI can't seem to find your C library.  I've looked in the following places:
  493. X
  494. X    $libpth
  495. X
  496. XNone of these seems to contain your C library.  What is the full name
  497. XEOM
  498. X        dflt=None
  499. X        $echo $n "of your C library? $c"
  500. X        rp='C library full name?'
  501. X        . myread
  502. X        libc="$ans"
  503. X    fi
  504. X    fi
  505. Xfi
  506. Xecho " "
  507. X$echo $n "Extracting names from $libc for later perusal...$c"
  508. Xnm $libc 2>/dev/null | sed -n -e 's/^.* T _//p' -e 's/^.* T //p' > libc.list
  509. Xif $contains '^printf$' libc.list >/dev/null 2>&1; then
  510. X    echo "done"
  511. Xelse
  512. X    nm $libc 2>/dev/null | sed -n -e 's/^.* D _//p' -e 's/^.* D //p' > libc.list
  513. X    if $contains '^printf$' libc.list >/dev/null 2>&1; then
  514. X    echo "done"
  515. X    else
  516. X    echo " "
  517. X    echo "nm didn't seem to work right."
  518. X    echo "Trying ar instead..."
  519. X    if ar t $libc | sed -e 's/\.o$//' > libc.list; then
  520. X        echo "Ok."
  521. X    else
  522. X        echo "That didn't work either.  Giving up."
  523. X        exit 1
  524. X    fi
  525. X    fi
  526. Xfi
  527. Xrmlist="$rmlist libc.list"
  528. X
  529. X: make some quick guesses about what we are up against
  530. Xecho " "
  531. X$echo $n "Hmm...  $c"
  532. Xif $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
  533. X    echo "Looks kind of like a BSD system, but we'll see..."
  534. X    echo exit 0 >bsd
  535. X    echo exit 1 >usg
  536. X    echo exit 1 >v7
  537. Xelif $contains '^fcntl$' libc.list >/dev/null 2>&1 ; then
  538. X    echo "Looks kind of like a USG system, but we'll see..."
  539. X    echo exit 1 >bsd
  540. X    echo exit 0 >usg
  541. X    echo exit 1 >v7
  542. Xelse
  543. X    echo "Looks kind of like a version 7 system, but we'll see..."
  544. X    echo exit 1 >bsd
  545. X    echo exit 1 >usg
  546. X    echo exit 0 >v7
  547. Xfi
  548. Xif $contains '^vmssystem$' libc.list >/dev/null 2>&1 ; then
  549. X    cat <<'EOI'
  550. XThere is, however, a strange, musty smell in the air that reminds me of
  551. Xsomething...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  552. XEOI
  553. X    echo "exit 0" >eunice
  554. X    eunicefix=unixtovms
  555. X    d_eunice="$define"
  556. X: it so happens the Eunice I know will not run shell scripts in Unix format
  557. Xelse
  558. X    echo " "
  559. X    echo "Congratulations.  You aren't running Eunice."
  560. X    eunicefix=':'
  561. X    d_eunice="$undef"
  562. X    echo "exit 1" >eunice
  563. Xfi
  564. Xif test -f /xenix; then
  565. X    echo "Actually, this looks more like a XENIX system..."
  566. X    echo "exit 0" >xenix
  567. Xelse
  568. X    echo " "
  569. X    echo "It's not Xenix..."
  570. X    echo "exit 1" >xenix
  571. Xfi
  572. Xchmod +x xenix
  573. X$eunicefix xenix
  574. Xif test -f /venix; then
  575. X    echo "Actually, this looks more like a VENIX system..."
  576. X    echo "exit 0" >venix
  577. Xelse
  578. X    echo " "
  579. X    if xenix; then
  580. X    : null
  581. X    else
  582. X    echo "Nor is it Venix..."
  583. X    fi
  584. X    echo "exit 1" >venix
  585. Xfi
  586. Xchmod +x bsd usg v7 eunice venix
  587. X$eunicefix bsd usg v7 eunice venix
  588. Xrmlist="$rmlist bsd usg v7 eunice venix xenix"
  589. X
  590. X: see if sh knows # comments
  591. Xecho " "
  592. Xecho "Checking your sh to see if it knows about # comments..."
  593. Xif sh -c '#' >/dev/null 2>&1 ; then
  594. X    echo "Your sh handles # comments correctly."
  595. X    shsharp=true
  596. X    spitshell=cat
  597. X    echo " "
  598. X    echo "Okay, let's see if #! works on this system..."
  599. X    echo "#!/bin/echo hi" > try
  600. X    $eunicefix try
  601. X    chmod +x try
  602. X    try > today
  603. X    if $contains hi today >/dev/null 2>&1; then
  604. X    echo "It does."
  605. X    sharpbang='#!'
  606. X    else
  607. X    echo "#! /bin/echo hi" > try
  608. X    $eunicefix try
  609. X    chmod +x try
  610. X    try > today
  611. X    if test -s today; then
  612. X        echo "It does."
  613. X        sharpbang='#! '
  614. X    else
  615. X        echo "It doesn't."
  616. X        sharpbang=': use '
  617. X    fi
  618. X    fi
  619. Xelse
  620. X    echo "Your sh doesn't grok # comments--I will strip them later on."
  621. X    shsharp=false
  622. X    echo "exec grep -v '^#'" >spitshell
  623. X    chmod +x spitshell
  624. X    $eunicefix spitshell
  625. X    spitshell=`pwd`/spitshell
  626. X    echo "I presume that if # doesn't work, #! won't work either!"
  627. X    sharpbang=': use '
  628. Xfi
  629. X
  630. X: figure out how to guarantee sh startup
  631. Xecho " "
  632. Xecho "Checking out how to guarantee sh startup..."
  633. Xstartsh=$sharpbang'/bin/sh'
  634. Xecho "Let's see if '$startsh' works..."
  635. Xcat >try <<EOSS
  636. X$startsh
  637. Xset abc
  638. Xtest "$?abc" != 1
  639. XEOSS
  640. X
  641. Xchmod +x try
  642. X$eunicefix try
  643. Xif try; then
  644. X    echo "Yup, it does."
  645. Xelse
  646. X    echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  647. Xfi
  648. Xrm -f try today
  649. X
  650. X: see if sprintf is declared as int or pointer to char
  651. Xecho " "
  652. Xcat >.ucbsprf.c <<'EOF'
  653. Xmain() { char buf[10]; exit((unsigned long)sprintf(buf,"%s","foo") > 10L); }
  654. XEOF
  655. Xif cc .ucbsprf.c -o .ucbsprf >/dev/null 2>&1 && .ucbsprf; then
  656. X    echo "Your sprintf() returns (int)."
  657. X    d_charsprf="$undef"
  658. Xelse
  659. X    echo "Your sprintf() returns (char*)."
  660. X    d_charsprf="$define"
  661. Xfi
  662. X/bin/rm -f .ucbsprf.c .ucbsprf
  663. X
  664. X: see if we can have long filenames
  665. Xecho " "
  666. Xrm -f 123456789abcde
  667. Xif (echo hi >123456789abcdef) 2>/dev/null; then
  668. X    : not version 8
  669. X    if test -f 123456789abcde; then
  670. X    echo 'You cannot have filenames longer than 14 characters.  Sigh.'
  671. X    d_flexfnam="$undef"
  672. X    else
  673. X    echo 'You can have filenames longer than 14 characters.'
  674. X    d_flexfnam="$define"
  675. X    fi
  676. Xelse
  677. X    : version 8 probably
  678. X    echo "You can't have filenames longer than 14 chars.  V8 can't even think about them!"
  679. X    d_flexfnam="$undef"
  680. Xfi 
  681. X: index or strcpy
  682. Xecho " "
  683. Xcase "$d_index" in
  684. Xn) dflt=n;;
  685. X*) dflt=y;;
  686. Xesac
  687. Xif $contains '^index$' libc.list >/dev/null 2>&1 ; then
  688. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  689. X    echo "Your system has both index() and strchr().  Shall I use"
  690. X    rp="index() rather than strchr()? [$dflt]"
  691. X    $echo $n "$rp $c"
  692. X    . myread
  693. X    case "$ans" in
  694. X        n*) d_index="$define" ;;
  695. X        *)  d_index="$undef" ;;
  696. X    esac
  697. X    else
  698. X    d_index="$undef"
  699. X    echo "index() found."
  700. X    fi
  701. Xelse
  702. X    if $contains '^strchr$' libc.list >/dev/null 2>&1 ; then
  703. X    d_index="$define"
  704. X    echo "strchr() found."
  705. X    else
  706. X    echo "No index() or strchr() found!"
  707. X    d_index="$undef"
  708. X    fi
  709. Xfi
  710. X
  711. X: see if signal is declared as pointer to function returning int or void
  712. Xecho " "
  713. Xif $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
  714. X    echo "You have void (*signal())() instead of int."
  715. X    d_voidsig="$define"
  716. Xelse
  717. X    echo "You have int (*signal())() instead of void."
  718. X    d_voidsig="$undef"
  719. Xfi
  720. X
  721. X: check for void type
  722. Xecho " "
  723. X$cat <<EOM
  724. XChecking to see how well your C compiler groks the void type...
  725. X
  726. X  Support flag bits are:
  727. X    1: basic void declarations.
  728. X    2: arrays of pointers to functions returning void.
  729. X    4: operations between pointers to and addresses of void functions.
  730. X
  731. XEOM
  732. Xcase "$voidflags" in
  733. X'')
  734. X    $cat >try.c <<'EOCP'
  735. X#if TRY & 1
  736. Xvoid main() {
  737. X#else
  738. Xmain() {
  739. X#endif
  740. X    extern void *moo();
  741. X    void *(*goo)();
  742. X#if TRY & 2
  743. X    void (*foo[10])();
  744. X#endif
  745. X
  746. X#if TRY & 4
  747. X    if(*goo == moo) {
  748. X        exit(0);
  749. X    }
  750. X#endif
  751. X    exit(0);
  752. X}
  753. XEOCP
  754. X    if cc -S -DTRY=7 try.c >.out 2>&1 ; then
  755. X    voidflags=7
  756. X    echo "It appears to support void fully."
  757. X    if $contains warning .out >/dev/null 2>&1; then
  758. X        echo "However, you might get some warnings that look like this:"
  759. X        $cat .out
  760. X    fi
  761. X    else
  762. X    echo "Hmm, you compiler has some difficulty with void.  Checking further..."
  763. X    if cc -S -DTRY=1 try.c >/dev/null 2>&1 ; then
  764. X        echo "It supports 1..."
  765. X        if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
  766. X        voidflags=3
  767. X        echo "And it supports 2 but not 4."
  768. X        else
  769. X        echo "It doesn't support 2..."
  770. X        if cc -S -DTRY=3 try.c >/dev/null 2>&1 ; then
  771. X            voidflags=5
  772. X            echo "But it supports 4."
  773. X        else
  774. X            voidflags=1
  775. X            echo "And it doesn't support 4."
  776. X        fi
  777. X        fi
  778. X    else
  779. X        echo "There is no support at all for void."
  780. X        voidflags=0
  781. X    fi
  782. X    fi
  783. Xesac
  784. Xdflt="$voidflags";
  785. Xrp="Your void support flags add up to what? [$dflt]"
  786. X$echo $n "$rp $c"
  787. X. myread
  788. Xvoidflags="$ans"
  789. X$rm -f try.* .out
  790. X
  791. X: see how we invoke the C preprocessor
  792. Xecho " "
  793. Xecho "Now, how can we feed standard input to your C preprocessor..."
  794. Xcat <<'EOT' >testcpp.c
  795. X#define ABC abc
  796. X#define XYZ xyz
  797. XABC.XYZ
  798. XEOT
  799. Xecho 'Maybe "'$cpp'" will work...'
  800. X$cpp <testcpp.c >testcpp.out 2>&1
  801. Xif $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  802. X    echo "Yup, it does."
  803. X    cppstdin="$cpp"
  804. X    cppminus='';
  805. Xelse
  806. X    echo 'Nope, maybe "'$cpp' -" will work...'
  807. X    $cpp - <testcpp.c >testcpp.out 2>&1
  808. X    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  809. X    echo "Yup, it does."
  810. X    cppstdin="$cpp"
  811. X    cppminus='-';
  812. X    else
  813. X    echo 'No such luck...maybe "cc -E" will work...'
  814. X    cc -E <testcpp.c >testcpp.out 2>&1
  815. X    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  816. X        echo "It works!"
  817. X        cppstdin='cc -E'
  818. X        cppminus='';
  819. X    else
  820. X        echo 'Nixed again...maybe "cc -E -" will work...'
  821. X        cc -E - <testcpp.c >testcpp.out 2>&1
  822. X        if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  823. X        echo "Hooray, it works!  I was beginning to wonder."
  824. X        cppstdin='cc -E'
  825. X        cppminus='-';
  826. X        else
  827. X        echo 'Nope...maybe "cc -P" will work...'
  828. X        cc -P <testcpp.c >testcpp.out 2>&1
  829. X        if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  830. X            echo "Yup, that does."
  831. X            cppstdin='cc -P'
  832. X            cppminus='';
  833. X        else
  834. X            echo 'Nope...maybe "cc -P -" will work...'
  835. X            cc -P - <testcpp.c >testcpp.out 2>&1
  836. X            if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  837. X            echo "Yup, that does."
  838. X            cppstdin='cc -P'
  839. X            cppminus='-';
  840. X            else
  841. X            echo 'Hmm...perhaps you already told me...'
  842. X            case "$cppstdin" in
  843. X            '') ;;
  844. X            *) $cppstdin $cppminus <testcpp.c >testcpp.out 2>&1;;
  845. X            esac
  846. X            if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  847. X                echo "Hooray, you did!  I was beginning to wonder."
  848. X            else
  849. X                echo 'Uh-uh.  Time to get fancy...'
  850. X                echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
  851. X                cppstdin='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
  852. X                cppminus='';
  853. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  854. X                if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  855. X                echo "Eureka!."
  856. X                else
  857. X                dflt=blurfl
  858. X                $echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
  859. X                rp='Name a C preprocessor:'
  860. X                . myread
  861. X                cppstdin="$ans"
  862. X                $cppstdin <testcpp.c >testcpp.out 2>&1
  863. X                if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
  864. X                    echo "OK, that will do."
  865. X                else
  866. X                    echo "Sorry, I can't get that to work.  Go find one."
  867. X                    exit 1
  868. X                fi
  869. X                fi
  870. X            fi
  871. X            fi
  872. X        fi
  873. X        fi
  874. X    fi
  875. X    fi
  876. Xfi
  877. Xrm -f testcpp.c testcpp.out
  878. X
  879. X: get C preprocessor symbols handy
  880. Xecho " "
  881. Xecho $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
  882. X$cat <<EOSS >Cppsym
  883. X$startsh
  884. Xcase "\$1" in
  885. X-l) list=true
  886. X    shift
  887. X    ;;
  888. Xesac
  889. Xunknown=''
  890. Xcase "\$list\$#" in
  891. X1|2)
  892. X    for sym do
  893. X    if $contains "^\$1$" Cppsym.true >/dev/null 2>&1; then
  894. X        exit 0
  895. X    elif $contains "^\$1$" Cppsym.know >/dev/null 2>&1; then
  896. X        :
  897. X    else
  898. X        unknown="\$unknown \$sym"
  899. X    fi
  900. X    done
  901. X    set X \$unknown
  902. X    shift
  903. X    ;;
  904. Xesac
  905. Xcase \$# in
  906. X0) exit 1;;
  907. Xesac
  908. Xecho \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
  909. X#ifdef \1\\
  910. Xexit 0; _ _ _ _\1\\     \1\\
  911. X#endif\\
  912. X/' >/tmp/Cppsym\$\$
  913. Xecho exit 1 >>/tmp/Cppsym\$\$
  914. X$cppstdin $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  915. Xcase "\$list" in
  916. Xtrue) awk 'NF > 5 {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  917. X*)
  918. X    sh /tmp/Cppsym2\$\$
  919. X    status=\$?
  920. X    ;;
  921. Xesac
  922. X$rm -f /tmp/Cppsym\$\$ /tmp/Cppsym2\$\$
  923. Xexit \$status
  924. XEOSS
  925. Xchmod +x Cppsym
  926. X$eunicefix Cppsym
  927. Xecho "Your C preprocessor defines the following symbols:"
  928. XCppsym -l $attrlist >Cppsym.true
  929. Xcat Cppsym.true
  930. Xrmlist="$rmlist Cppsym Cppsym.know Cppsym.true"
  931. X
  932. X: see how many register declarations we want to use
  933. Xcase "$registers" in
  934. X'')
  935. X    if Cppsym vax; then
  936. X    dflt=6
  937. X    elif Cppsym sun mc68000; then
  938. X    dflt=10
  939. X    elif Cppsym pyr; then
  940. X    dflt=14
  941. X    elif Cppsym ns32000 ns16000; then
  942. X    dflt=5
  943. X    elif Cppsym $smallmach; then
  944. X    dflt=3
  945. X    else
  946. X    : if you have any other numbers for me, send them in
  947. X    dflt=6
  948. X    fi
  949. X    ;;
  950. X*)  dflt=$registers ;;
  951. Xesac
  952. Xcat <<EOM
  953. XDifferent C compilers on different machines pay attention to different
  954. Xnumbers of register declarations.  About how many register declarations in
  955. XEOM
  956. X$echo $n "each routine does your C compiler pay attention to? (OK to guess) [$dflt] $c"
  957. Xrp="# register declarations used? [$dflt]"
  958. X. myread
  959. Xregisters=$ans
  960. Xreg1=''
  961. Xawk "BEGIN { for (i=1; i<=16; i++) printf \"reg%d=''\n\", i}" </dev/null >.foo
  962. X. .foo
  963. Xawk "BEGIN { for (i=1; i<=$registers; i++) printf \"reg%d=register\n\", i}" \
  964. X    </dev/null >.foo
  965. X. .foo
  966. Xrm -f .foo
  967. X
  968. X: preserve RCS keywords in files with variable substitution, grrr
  969. XLog='$Log'
  970. XHeader='$Header'
  971. X
  972. X: set up shell script to do ~ expansion
  973. Xcat >filexp <<EOSS
  974. X$startsh
  975. X: expand filename
  976. Xcase "\$1" in
  977. X ~/*|~)
  978. X    echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  979. X    ;;
  980. X ~*)
  981. X    if $test -f /bin/csh; then
  982. X    /bin/csh -f -c "glob \$1"
  983. X    echo ""
  984. X    else
  985. X    name=\`$expr x\$1 : '..\([^/]*\)'\`
  986. X    dir=\`$sed -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}' </etc/passwd\`
  987. X    if $test ! -d "\$dir"; then
  988. X        me=\`basename \$0\`
  989. X        echo "\$me: can't locate home directory for: \$name" >&2
  990. X        exit 1
  991. X    fi
  992. X    case "\$1" in
  993. X    */*)
  994. X        echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  995. X        ;;
  996. X    *)
  997. X        echo \$dir
  998. X        ;;
  999. X    esac
  1000. X    fi
  1001. X    ;;
  1002. X*)
  1003. X    echo \$1
  1004. X    ;;
  1005. Xesac
  1006. XEOSS
  1007. Xchmod +x filexp
  1008. X$eunicefix filexp
  1009. X
  1010. X: determine where public executables go
  1011. Xcase "$bin" in
  1012. X'')
  1013. X    dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  1014. X    ;;
  1015. X*)  dflt="$bin"
  1016. X    ;;
  1017. Xesac
  1018. Xcont=true
  1019. Xwhile $test "$cont" ; do
  1020. X    echo " "
  1021. X    rp="Where do you want to put the public executables? [$dflt]"
  1022. X    $echo $n "$rp $c"
  1023. X    . myread
  1024. X    bin="$ans"
  1025. X    bin=`filexp $bin`
  1026. X    if test -d $bin; then
  1027. X    cont=''
  1028. X    else
  1029. X    dflt=n
  1030. X    rp="Directory $bin doesn't exist.  Use that name anyway? [$dflt]"
  1031. X    $echo $n "$rp $c"
  1032. X    . myread
  1033. X    dflt=''
  1034. X    case "$ans" in
  1035. X    y*) cont='';;
  1036. X    esac
  1037. X    fi
  1038. Xdone
  1039. X
  1040. X: determine where manual pages go
  1041. Xcase "$mansrc" in
  1042. X'')
  1043. X    dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
  1044. X    ;;
  1045. X*)  dflt="$mansrc"
  1046. X    ;;
  1047. Xesac
  1048. Xcont=true
  1049. Xwhile $test "$cont" ; do
  1050. X    echo " "
  1051. X    rp="Where do the manual pages (source) go? [$dflt]"
  1052. X    $echo $n "$rp $c"
  1053. X    . myread
  1054. X    mansrc=`filexp "$ans"`
  1055. X    if test -d $mansrc; then
  1056. X    cont=''
  1057. X    else
  1058. X    dflt=n
  1059. X    rp="Directory $mansrc doesn't exist.  Use that name anyway? [$dflt]"
  1060. X    $echo $n "$rp $c"
  1061. X    . myread
  1062. X    dflt=''
  1063. X    case "$ans" in
  1064. X    y*) cont='';;
  1065. X    esac
  1066. X    fi
  1067. Xdone
  1068. Xcase "$mansrc" in
  1069. X*l)
  1070. X    manext=l
  1071. X    ;;
  1072. X*n)
  1073. X    manext=n
  1074. X    ;;
  1075. X*C)
  1076. X    manext=C
  1077. X    ;;
  1078. X*)
  1079. X    manext=1
  1080. X    ;;
  1081. Xesac
  1082. X
  1083. X: see what memory models we can support
  1084. Xcase "$models" in
  1085. X'')
  1086. X    if Cppsym pdp11; then
  1087. X    dflt='unsplit split'
  1088. X    else
  1089. X    ans=`loc . X /lib/small /lib/large /usr/lib/small /usr/lib/large /lib/medium /usr/lib/medium /lib/huge`
  1090. X    case "$ans" in
  1091. X    X) dflt='none';;
  1092. X    *)  if $test -d /lib/small || $test -d /usr/lib/small; then
  1093. X        dflt='small'
  1094. X        else
  1095. X        dflt=''
  1096. X        fi
  1097. X        if $test -d /lib/medium || $test -d /usr/lib/medium; then
  1098. X        dflt="$dflt medium"
  1099. X        fi
  1100. X        if $test -d /lib/large || $test -d /usr/lib/large; then
  1101. X        dflt="$dflt large"
  1102. X        fi
  1103. X        if $test -d /lib/huge || $test -d /usr/lib/huge; then
  1104. X        dflt="$dflt huge"
  1105. X        fi
  1106. X    esac
  1107. X    fi
  1108. X    ;;
  1109. X*)  dflt="$models" ;;
  1110. Xesac
  1111. X$cat <<EOM
  1112. XSome systems have different model sizes.  On most systems they are called
  1113. Xsmall, medium, large, and huge.  On the PDP11 they are called unsplit and
  1114. Xsplit.  If your system doesn't support different memory models, say "none".
  1115. XIf you wish to force everything to one memory model, say "none" here and
  1116. Xput the appropriate flags later when it asks you for other cc and ld flags.
  1117. XVenix systems may wish to put "none" and let the compiler figure things out.
  1118. X(In the following question multiple model names should be space separated.)
  1119. X
  1120. XEOM
  1121. Xrp="Which models are supported? [$dflt]"
  1122. X$echo $n "$rp $c"
  1123. X. myread
  1124. Xmodels="$ans"
  1125. X
  1126. Xcase "$models" in
  1127. Xnone)
  1128. X    small=''
  1129. X    medium=''
  1130. X    large=''
  1131. X    huge=''
  1132. X    unsplit=''
  1133. X    split=''
  1134. X    ;;
  1135. X*split)
  1136. X    case "$split" in
  1137. X    '') 
  1138. X    if $contains '-i' $mansrc/ld.1 >/dev/null 2>&1 || \
  1139. X       $contains '-i' $mansrc/cc.1 >/dev/null 2>&1; then
  1140. X        dflt='-i'
  1141. X    else
  1142. X        dflt='none'
  1143. X    fi
  1144. X    ;;
  1145. X    *) dflt="$split";;
  1146. X    esac
  1147. X    rp="What flag indicates separate I and D space? [$dflt]"
  1148. X    $echo $n "$rp $c"
  1149. X    . myread
  1150. X    case "$ans" in
  1151. X    none) ans='';;
  1152. X    esac
  1153. X    split="$ans"
  1154. X    unsplit=''
  1155. X    ;;
  1156. X*large*|*small*|*medium*|*huge*)
  1157. X    case "$model" in
  1158. X    *large*)
  1159. X    case "$large" in
  1160. X    '') dflt='-Ml';;
  1161. X    *) dflt="$large";;
  1162. X    esac
  1163. X    rp="What flag indicates large model? [$dflt]"
  1164. X    $echo $n "$rp $c"
  1165. X    . myread
  1166. X    case "$ans" in
  1167. X    none) ans='';
  1168. X    esac
  1169. X    large="$ans"
  1170. X    ;;
  1171. X    *) large='';;
  1172. X    esac
  1173. X    case "$model" in
  1174. X    *huge*)
  1175. X    case "$huge" in
  1176. X    '') dflt='-Mh';;
  1177. X    *) dflt="$huge";;
  1178. X    esac
  1179. X    rp="What flag indicates huge model? [$dflt]"
  1180. X    $echo $n "$rp $c"
  1181. X    . myread
  1182. X    case "$ans" in
  1183. X    none) ans='';
  1184. X    esac
  1185. X    huge="$ans"
  1186. X    ;;
  1187. X    *) huge="$large";;
  1188. X    esac
  1189. X    case "$model" in
  1190. X    *medium*)
  1191. X    case "$medium" in
  1192. X    '') dflt='-Mm';;
  1193. X    *) dflt="$medium";;
  1194. X    esac
  1195. X    rp="What flag indicates medium model? [$dflt]"
  1196. X    $echo $n "$rp $c"
  1197. X    . myread
  1198. X    case "$ans" in
  1199. X    none) ans='';
  1200. X    esac
  1201. X    medium="$ans"
  1202. X    ;;
  1203. X    *) medium="$large";;
  1204. X    esac
  1205. X    case "$model" in
  1206. X    *small*)
  1207. X    case "$small" in
  1208. X    '') dflt='none';;
  1209. X    *) dflt="$small";;
  1210. X    esac
  1211. X    rp="What flag indicates small model? [$dflt]"
  1212. X    $echo $n "$rp $c"
  1213. X    . myread
  1214. X    case "$ans" in
  1215. X    none) ans='';
  1216. X    esac
  1217. X    small="$ans"
  1218. X    ;;
  1219. X    *) small='';;
  1220. X    esac
  1221. X    ;;
  1222. X*)
  1223. X    echo "Unrecognized memory models--you may have to edit Makefile.SH"
  1224. X    ;;
  1225. Xesac
  1226. X
  1227. Xcase "$ccflags" in
  1228. X'') dflt='none';;
  1229. X*) dflt="$ccflags";;
  1230. Xesac
  1231. Xecho " "
  1232. Xrp="Any additional cc flags? [$dflt]"
  1233. X$echo $n "$rp $c"
  1234. X. myread
  1235. Xcase "$ans" in
  1236. Xnone) ans='';
  1237. Xesac
  1238. Xccflags="$ans"
  1239. X
  1240. Xcase "$ldflags" in
  1241. X'') if venix; then
  1242. X    dflt='-i -z'
  1243. X    else
  1244. X    dflt='none'
  1245. X    fi
  1246. X    ;;
  1247. X*) dflt="$ldflags";;
  1248. Xesac
  1249. Xecho " "
  1250. Xrp="Any additional ld flags? [$dflt]"
  1251. X$echo $n "$rp $c"
  1252. X. myread
  1253. Xcase "$ans" in
  1254. Xnone) ans='';
  1255. Xesac
  1256. Xldflags="$ans"
  1257. X
  1258. X: see if we need a special compiler
  1259. Xecho " "
  1260. Xif usg; then
  1261. X    case "$cc" in
  1262. X    '')
  1263. X    case "$Mcc" in
  1264. X    /*) dflt='Mcc'
  1265. X        ;;
  1266. X    *)
  1267. X        case "$large" in
  1268. X        -M*)
  1269. X        dflt='cc'
  1270. X        ;;
  1271. X        *)
  1272. X        if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1273. X            dflt='cc -M'
  1274. X        else
  1275. X            dflt='cc'
  1276. X        fi
  1277. X        ;;
  1278. X        esac
  1279. X        ;;
  1280. X    esac
  1281. X    ;;
  1282. X    *)  dflt="$cc";;
  1283. X    esac
  1284. X    $cat <<'EOM'
  1285. XOn some systems the default C compiler will not resolve multiple global
  1286. Xreferences that happen to have the same name.  On some such systems the
  1287. X"Mcc" command may be used to force these to be resolved.  On other systems
  1288. Xa "cc -M" command is required.  (Note that the -M flag on other systems
  1289. Xindicates a memory model to use!)  What command will force resolution on
  1290. XEOM
  1291. X    $echo $n "this system? [$dflt] $c"
  1292. X    rp="Command to resolve multiple refs? [$dflt]"
  1293. X    . myread
  1294. X    cc="$ans"
  1295. Xelse
  1296. X    echo "Not a USG system--assuming cc can resolve multiple definitions."
  1297. X    cc=cc
  1298. Xfi
  1299. X
  1300. Xecho " "
  1301. Xecho "End of configuration questions."
  1302. Xecho " "
  1303. X
  1304. X: create config.sh file
  1305. Xecho " "
  1306. Xif test -d ../UU; then
  1307. X    cd ..
  1308. Xfi
  1309. Xecho "Creating config.sh..."
  1310. X$spitshell <<EOT >config.sh
  1311. X$startsh
  1312. X# config.sh
  1313. X# This file was produced by running the Configure script.
  1314. X
  1315. Xd_eunice='$d_eunice'
  1316. Xeunicefix='$eunicefix'
  1317. Xdefine='$define'
  1318. Xloclist='$loclist'
  1319. Xexpr='$expr'
  1320. Xsed='$sed'
  1321. Xecho='$echo'
  1322. Xcat='$cat'
  1323. Xrm='$rm'
  1324. Xmv='$mv'
  1325. Xcp='$cp'
  1326. Xtail='$tail'
  1327. Xtr='$tr'
  1328. Xmkdir='$mkdir'
  1329. Xsort='$sort'
  1330. Xuniq='$uniq'
  1331. Xgrep='$grep'
  1332. Xtrylist='$trylist'
  1333. Xtest='$test'
  1334. Xinews='$inews'
  1335. Xegrep='$egrep'
  1336. Xmore='$more'
  1337. Xpg='$pg'
  1338. XMcc='$Mcc'
  1339. Xvi='$vi'
  1340. Xmailx='$mailx'
  1341. Xmail='$mail'
  1342. Xcpp='$cpp'
  1343. XLog='$Log'
  1344. XHeader='$Header'
  1345. Xbin='$bin'
  1346. Xcc='$cc'
  1347. Xcontains='$contains'
  1348. Xcppstdin='$cppstdin'
  1349. Xcppminus='$cppminus'
  1350. Xd_charsprf='$d_charsprf'
  1351. Xd_flexfnam='$d_flexfnam'
  1352. Xd_index='$d_index'
  1353. Xd_voidsig='$d_voidsig'
  1354. Xlibc='$libc'
  1355. Xmansrc='$mansrc'
  1356. Xmanext='$manext'
  1357. Xmodels='$models'
  1358. Xsplit='$split'
  1359. Xsmall='$small'
  1360. Xmedium='$medium'
  1361. Xlarge='$large'
  1362. Xhuge='$huge'
  1363. Xccflags='$ccflags'
  1364. Xldflags='$ldflags'
  1365. Xn='$n'
  1366. Xc='$c'
  1367. Xpackage='$package'
  1368. Xregisters='$registers'
  1369. Xreg1='$reg1'
  1370. Xreg2='$reg2'
  1371. Xreg3='$reg3'
  1372. Xreg4='$reg4'
  1373. Xreg5='$reg5'
  1374. Xreg6='$reg6'
  1375. Xreg7='$reg7'
  1376. Xreg8='$reg8'
  1377. Xreg9='$reg9'
  1378. Xreg10='$reg10'
  1379. Xreg11='$reg11'
  1380. Xreg12='$reg12'
  1381. Xreg13='$reg13'
  1382. Xreg14='$reg14'
  1383. Xreg15='$reg15'
  1384. Xreg16='$reg16'
  1385. Xspitshell='$spitshell'
  1386. Xshsharp='$shsharp'
  1387. Xsharpbang='$sharpbang'
  1388. Xstartsh='$startsh'
  1389. Xvoidflags='$voidflags'
  1390. Xdefvoidused='$defvoidused'
  1391. XCONFIG=true
  1392. XEOT
  1393. XCONFIG=true
  1394. X
  1395. Xecho " "
  1396. Xdflt=''
  1397. Xfastread=''
  1398. Xecho "If you didn't make any mistakes, then just type a carriage return here."
  1399. Xrp="If you need to edit config.sh, do it as a shell escape here:"
  1400. X$echo $n "$rp $c"
  1401. X. UU/myread
  1402. Xcase "$ans" in
  1403. X'') ;;
  1404. X*) : in case they cannot read
  1405. X    eval $ans;;
  1406. Xesac
  1407. X. ./config.sh
  1408. X
  1409. Xecho " "
  1410. Xecho "Doing variable substitutions on .SH files..."
  1411. Xset x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  1412. Xshift
  1413. Xcase $# in
  1414. X0) set x *.SH; shift;;
  1415. Xesac
  1416. Xif test ! -f $1; then
  1417. X    shift
  1418. Xfi
  1419. Xfor file in $*; do
  1420. X    case "$file" in
  1421. X    */*)
  1422. X    dir=`$expr X$file : 'X\(.*\)/'`
  1423. X    file=`$expr X$file : 'X.*/\(.*\)'`
  1424. X    (cd $dir && . $file)
  1425. X    ;;
  1426. X    *)
  1427. X    . $file
  1428. X    ;;
  1429. X    esac
  1430. Xdone
  1431. Xif test -f config.h.SH; then
  1432. X    if test ! -f config.h; then
  1433. X    : oops, they left it out of MANIFEST, probably, so do it anyway.
  1434. X    . config.h.SH
  1435. X    fi
  1436. Xfi
  1437. X
  1438. Xif $contains '^depend:' Makefile >/dev/null 2>&1; then
  1439. X    dflt=n
  1440. X    $cat <<EOM
  1441. X
  1442. XNow you need to generate make dependencies by running "make depend".
  1443. XYou might prefer to run it in background: "make depend > makedepend.out &"
  1444. XIt can take a while, so you might not want to run it right now.
  1445. X
  1446. XEOM
  1447. X    rp="Run make depend now? [$dflt]"
  1448. X    $echo $n "$rp $c"
  1449. X    . UU/myread
  1450. X    case "$ans" in
  1451. X    y*) make depend
  1452. X    echo "Now you must run a make."
  1453. X    ;;
  1454. X    *)  echo "You must run 'make depend' then 'make'."
  1455. X    ;;
  1456. X    esac
  1457. Xelif test -f Makefile; then
  1458. X    echo " "
  1459. X    echo "Now you must run a make."
  1460. Xelse
  1461. X    echo "Done."
  1462. Xfi
  1463. X
  1464. X$rm -f kit*isdone
  1465. Xcd UU && $rm -f $rmlist
  1466. X: end of Configure
  1467. !STUFFY!FUNK!
  1468. echo Extracting patchlevel.h
  1469. sed >patchlevel.h <<'!STUFFY!FUNK!' -e 's/X//'
  1470. X#define PATCHLEVEL 11
  1471. !STUFFY!FUNK!
  1472. echo ""
  1473. echo "End of kit"
  1474. : I do not append .signature, but someone might mail this.
  1475. exit
  1476.  
  1477.  
  1478.