home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume7 / patch2 / patch11 / text0000.txt < prev   
Encoding:
Text File  |  1988-06-04  |  33.0 KB  |  1,472 lines

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