home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume23 / abc / patch3 < prev    next >
Encoding:
Internet Message Format  |  1991-01-08  |  48.5 KB

  1. Subject:  v23i108:  ABC interactive programming environment, Patch3
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 34d706c0 6ee2f5b7 a706d021 f9222d8a
  5.  
  6. Submitted-by: timo@cwi.nl
  7. Posting-number: Volume 23, Issue 108
  8. Archive-name: abc/patch3
  9.  
  10. This is the second patch from the authors for the ABC interactive
  11. programming environment. It contains some fixes for minor bugs, reported
  12. in comp.sources.d, or already found by us before.
  13.  
  14. Most fixed problems concern different brands of Unix:
  15.  - the getcwd() problem on ATT System V machines,
  16.  - conflicts with library names, e.g. compound() and remove(),
  17.  - better guess of Unix-brand in the Setup script, leaving the ultimate 
  18.    choice to the installer.
  19.  
  20. Another major improvement is that the installer does not need to execute
  21. 'make makefiles' and 'make depend' anymore; you can immediately start with
  22. 'make all'. We experienced that these features, intended to help in
  23. porting ABC to other platforms, only caused confusion in assisting people
  24. with installation problems.
  25.  
  26. If you have ftp-ed your version of ABC (e.g. as abc.unix.tar.Z) you can
  27. also apply this patch to incorporate these fixes.
  28.  
  29. If you want to port ABC to other systems, contact us (at abc@cwi.nl) and
  30. we will send you a beta version for porters, with lots of help,
  31. guidelines, etc. shortly.
  32.  
  33. groetjes, Timo Krijnen (timo@cwi.nl).
  34.  
  35. PS. This patch will overwrite existing files, without warning.  It also
  36. assumes the program 'patch' is in your $PATH; if you do not have 'patch'
  37. you can apply the patches at the end manually since they are not that
  38. large.
  39.  
  40. -------
  41. : This is a shell archive.
  42. : Extract with 'sh this_file'.
  43. echo 'Start of second Authors patch for ABC system (bugfixes):'
  44. echo 'x - abc/Setup'
  45. sed 's/^X//' > 'abc/Setup' << 'EOF'
  46. X: 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.'
  47. X
  48. Xecho "Configuration questions for the ABC system."
  49. X
  50. X: some greps do not return status, fix this first.
  51. Xecho "grimblepritz" >grimble
  52. Xif grep blurfldyick grimble >/dev/null 2>&1 ; then
  53. X    contains=./contains
  54. Xelse
  55. X    if grep grimblepritz grimble >/dev/null 2>&1 ; then
  56. X        contains=grep
  57. X    else
  58. X        contains=./contains
  59. X    fi
  60. Xfi
  61. Xrm grimble
  62. X: the following should work in any shell
  63. Xcase $contains in
  64. X./contains)
  65. X    echo " "
  66. X    echo "Grep doesn't return a status; attempting remedial action."
  67. X    cat >contains <<'EOF'
  68. Xgrep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  69. XEOF
  70. X    chmod 755 ./contains;;
  71. Xesac
  72. X
  73. X: 'Determine if echo -n works'
  74. Xcase  `echo -n foo` in
  75. X-n*) n="" ;;
  76. X*) n=-n ;;
  77. Xesac
  78. X
  79. X: 'Get answers from previous run'
  80. Xif test -r answers
  81. Xthen
  82. X    . ./answers
  83. Xelse
  84. X    rootdef="/tmp/abc"
  85. X    abcdef="/usr/local"
  86. X    libdef="/usr/local/lib/abc"
  87. X    mandef="/usr/man/manl"
  88. Xfi
  89. X
  90. X: 'Are we preparing for cross compilation?'
  91. Xecho " "
  92. Xecho $n "Are you going to cross-compile the ABC system to a remote machine? [no] "
  93. Xif ./readyn "$n"
  94. Xthen
  95. Xremote=" remote"
  96. Xrootdir='blurfl'
  97. Xwhile test ! -d "$rootdir" ; do
  98. X    case $rootdir in
  99. X    blurfl)
  100. X        echo " "
  101. X        echo "Then please type the full pathname of a local directory"
  102. X        echo "where you have write permission"
  103. X        echo "and which we can use as a local root to install"
  104. X        echo "the ABC system for you to copy to the remote machine"
  105. X        echo $n " [default $rootdef] "
  106. X        ;;
  107. X    *)     echo "$rootdir does not appear to exist."
  108. X        echo $n "Are you sure you typed the right name? [no] "
  109. X        if ./readyn "$n"
  110. X        then
  111. X            echo "Don't forget to make $rootdir before 'make install'."
  112. X        else
  113. X            echo $n "Please try again [default $rootdef] "
  114. X        fi
  115. X        ;;
  116. X    esac
  117. X    read rootdir
  118. X    case $rootdir in
  119. X    "") rootdir=$rootdef;;
  120. X    esac
  121. Xdone
  122. Xelse
  123. Xecho "No cross compilation worries then."
  124. Xremote=""
  125. Xrootdir=""
  126. Xfi
  127. X
  128. X: 'What C compiler?'
  129. Xecho " "
  130. Xecho $n "C compiler to use [default cc] "
  131. Xread ans
  132. Xcase $ans in
  133. X'')    cc="cc";;
  134. X*)    cc="$ans";;
  135. Xesac
  136. Xecho "We will use '$cc' to invoke the C compiler."
  137. X
  138. X: 'What unix?'
  139. Xecho " "
  140. Xecho $n "Finding out about your brand of unix ... "
  141. Xcat >brand.c <<EOF
  142. X#include <stdio.h>
  143. X#include <signal.h>
  144. Xmain() {
  145. X#ifdef SIGXCPU
  146. X#ifdef SIGVTALRM
  147. X    printf("BSD4_2\n");
  148. X#else
  149. X    printf("BSD\n");
  150. X#endif
  151. X#else
  152. X#ifdef SIGPWR
  153. X    printf("ATT\n");
  154. X#else
  155. X    printf("unknown\n"); /* Version 7 we hope ... */
  156. X#endif
  157. X#endif
  158. X}
  159. XEOF
  160. X$cc brand.c -o brand
  161. Xunix=`./brand`
  162. Xrm -f brand*
  163. X
  164. Xecho " "
  165. Xcase $unix in
  166. XBSD4_2)
  167. X    echo "You seem to be running Berkeley's BSD unix version 4.2,"
  168. X    echo "or some compatible unix version."
  169. X    defunix=1
  170. X    ;;
  171. XBSD)
  172. X    echo "You seem to be running Berkeley's BSD unix,"
  173. X    echo "or some compatible unix version."
  174. X    defunix=2
  175. X    ;;
  176. XATT)
  177. X    echo "You seem to be running ATT's System III or System V unix,"
  178. X    echo "or some compatible unix version."
  179. X    defunix=3
  180. X    ;;
  181. X*)    defunix=5;;
  182. Xesac
  183. X
  184. Xecho "The ABC system can be configured for:"
  185. Xecho "   1) Berkeley's BSD unix, version 4.2 or newer;"
  186. Xecho "   2) Berkeley's BSD unix, version 4.1 or older;"
  187. Xecho "   3) ATT's System III or System V unix;"
  188. Xecho "   4) Bell Labs Version 7;"
  189. Xecho "   5) any other unix."
  190. X
  191. Xans="again"
  192. Xwhile test "$ans" = "again" ; do
  193. X    echo $n "Please type the number of the configuration you want [default $defunix] "
  194. X    read ans
  195. X    case $ans in
  196. X    '')        ans="default";;
  197. X    1|2|3|4|5)    defunix=$ans;;
  198. X    *)        ans="again";;
  199. X    esac
  200. Xdone
  201. X
  202. Xcase $defunix in
  203. X1)    unix="BSD4_2";;
  204. X2)    unix="BSD";;
  205. X3)    unix="ATT";;
  206. X4)    unix="VERSION7";;
  207. X5)    unix="unknown"
  208. X    echo "See ./unix/*.h (especially comp.h and os.h) and ./Problems in case of problems.";;
  209. Xesac
  210. X
  211. X: 'tty or termio system?'
  212. Xecho " "
  213. Xecho $n "Checking for tty or termio system ... "
  214. Xtermio=""
  215. Xcase $unix in
  216. XATT)    files="termio.h sgtty.h";;
  217. X*)    files="sgtty.h termio.h";;
  218. Xesac
  219. Xfor f in $files
  220. Xdo
  221. X    if test -r /usr/include/$f
  222. X    then
  223. X        case $f in
  224. X        termio.h)
  225. X            termio="#define"
  226. X            echo "termio.h found."
  227. X            break;;
  228. X        sgtty.h)
  229. X            termio="#undef"
  230. X            echo "sgtty.h found."
  231. X            break;;
  232. X        esac
  233. X    fi
  234. Xdone
  235. Xcase $termio in
  236. X'')    echo " "
  237. X    echo "Neither termio.h nor sgtty.h found."
  238. X    echo "See ./unix/trm.c, ./unix/keys.c and ./keys/abckeys.c"
  239. X    echo "in case of problems."
  240. X    termio="#undef "
  241. Xesac
  242. X
  243. X: 'Include <strings.h> or <string.h>?'
  244. Xecho " "
  245. Xecho $n "Finding include file for string operations ... "
  246. Xif test -r /usr/include/strings.h
  247. Xthen
  248. X    strs="<strings.h>"
  249. X    echo "strings.h found."
  250. Xelse
  251. X    if test -r /usr/include/string.h
  252. X    then
  253. X        strs="<string.h>"
  254. X        echo "string.h found."
  255. X    else
  256. X        strs="no_strs"
  257. X        echo " "
  258. X        echo "Neither strings.h nor string.h found."
  259. X        echo "We will add some external definitions to ./unix/os.h."
  260. X    fi
  261. Xfi
  262. X
  263. X: 'Some ATT System V have <unistd.h> for <sys/file.h>'
  264. X: 'Some systems have both and may need either one, so we must check'
  265. Xecho " "
  266. Xecho $n "Finding include file for access modes ... "
  267. Xcase $unix in
  268. XATT)    files="sys/file.h unistd.h";;
  269. X*)    files="unistd.h sys/file.h";;
  270. Xesac
  271. Xmodes="no_modes"
  272. Xfor f in $files
  273. Xdo
  274. X    if $contains F_OK /usr/include/$f >/dev/null 2>&1
  275. X    then
  276. X        modes="<$f>"
  277. X        echo "proper $f found."
  278. X        break
  279. X    fi
  280. Xdone
  281. Xcase $modes in
  282. Xno_modes)
  283. X    echo " "
  284. X    echo "No access mode definitions found in sys/file.h or unistd.h."
  285. X    echo "We will substitute our own definitions in ./unix/os.h."
  286. X    ;;
  287. Xesac
  288. X
  289. X: 'Some Berkeley systems (and the PC:-) have ftime(), including <sys/timeb.h>'
  290. Xecho " "
  291. Xecho $n "Finding include file for ftime(3) ... "
  292. Xif test -r /usr/include/sys/timeb.h
  293. Xthen
  294. X    ftime="#define"
  295. X    echo "sys/timeb.h found."
  296. Xelse
  297. X    ftime="#undef "
  298. X    echo " "
  299. X    echo "No sys/timeb.h found."
  300. X    echo "We will assume ftime(3) is not available in ./unix/comp.h."
  301. X    echo "The ABC function \"now\" will only return entire seconds."
  302. Xfi
  303. X
  304. X: 'Check for void type'
  305. Xecho " "
  306. Xecho $n "Checking to see if your compiler accepts the void type ... "
  307. Xcat >void.c << EOF
  308. Xvoid main();
  309. XEOF
  310. Xif $cc -c void.c >/dev/null 2>&1
  311. Xthen
  312. X    void="(void)"
  313. X    echo "yes, it does."
  314. Xelse
  315. X    void="      "
  316. X    echo "no, it doesn't."
  317. X    echo "We will use an empty VOID in casts."
  318. Xfi
  319. Xrm -f void.c void.o
  320. X
  321. X: 'Determine type for signal handlers'
  322. Xcase $void in
  323. X"(void)")
  324. Xecho " "
  325. Xecho $n "Finding type for signal handlers ... "
  326. Xecho "#include <signal.h>" >sigtype.c
  327. Xecho "main() { void (*oldsig)(); oldsig= signal(SIGINT, SIG_IGN); }" >>sigtype.c
  328. X$cc -c sigtype.c >warnings 2>&1
  329. Xif test -s warnings
  330. Xthen
  331. X    sigtype=int
  332. X    echo "assuming int."
  333. Xelse
  334. X    sigtype=void
  335. X    echo "found void."
  336. Xfi
  337. Xrm -f sigtype.c sigtype.o warnings
  338. X;;
  339. X*)    sigtype=int;;
  340. Xesac
  341. X
  342. X: 'Floating point arithmetic ok?'
  343. Xecho " "
  344. Xcase $remote in
  345. X" remote")
  346. Xecho "Does your C compiler need a special flag for"
  347. Xecho $n "loading (probably software) floating point routines? "
  348. Xread ans
  349. Xcase $ans in
  350. Xy*|Y*)    echo $n "What flag is needed [default -f] "
  351. X    read fflag
  352. X    case $fflag in
  353. X    '')    fflag="-f";;
  354. X    esac
  355. X    echo "We will try $fflag."
  356. X    ;;
  357. X*)    echo "Assuming no flag is needed."
  358. X    fflag=
  359. X    ;;
  360. Xesac
  361. X;;
  362. X*)
  363. Xecho $n "Checking your floating point ... "
  364. Xcat >float.c <<EOF
  365. X#include <stdio.h>
  366. Xdouble dadd(a, b) double a, b; {
  367. X    return a+b;
  368. X}
  369. Xmain() {
  370. X    double a, b, c;
  371. X    double dadd();
  372. X    a = 3.14;
  373. X    b = 2.7 * a;
  374. X    c = dadd(a, b);
  375. X    exit(0);
  376. X}
  377. XEOF
  378. X$cc -O float.c -o float >/dev/null 2>&1
  379. Xif sh 2>/dev/null <<EOF
  380. X    if ./float
  381. X    then exit 0
  382. X    else exit 1
  383. X    fi
  384. XEOF
  385. Xthen
  386. X    echo "seems to be alright."
  387. X    fflag=""
  388. Xelse
  389. X    echo " "
  390. X    echo "Your C compiler seems to need a special flag for"
  391. X    echo "loading (probably software) floating point routines."
  392. X    echo $n "What flag is needed [default -f] "
  393. X    read fflag
  394. X    case $fflag in
  395. X    '')    fflag="-f";;
  396. X    esac
  397. X    $cc -O $fflag float.c -o float >/dev/null 2>&1
  398. X    until sh 2>/dev/null <<EOF
  399. X        if ./float
  400. X        then echo "Flag $fflag seems to be allright."
  401. X             exit 0
  402. X        else exit 1
  403. X        fi
  404. XEOF
  405. X    do
  406. X        echo "This flag doesn't seem to work."
  407. X        echo "Try again ([RETURN] to give up) "
  408. X        read fflag
  409. X        case $fflag in
  410. X        '')    echo "Giving up on floating point flag"
  411. X            break;;
  412. X        esac
  413. X        $cc -O $fflag float.c -o float >/dev/null 2>&1
  414. X    done
  415. Xfi
  416. Xrm -f float* core
  417. X;;
  418. Xesac
  419. X
  420. X: 'termcap library for ABC editor'
  421. Xecho " "
  422. Xecho $n "Searching for your termcap-like library routines ... "
  423. Xif test -r /lib/libtermcap.a -o -r /usr/lib/libtermcap.a
  424. Xthen
  425. X    termlib="-ltermcap"
  426. X    echo "termcap library found."
  427. Xelif test -r /usr/local/lib/libtermcap.a
  428. Xthen
  429. X    termlib="/usr/local/lib/libtermcap.a"
  430. X    echo "local termcap library found."
  431. Xelif test -r /lib/libcurses.a -o -r /usr/lib/libcurses.a
  432. Xthen
  433. X    termlib="-lcurses"
  434. X    echo "terminfo library found."
  435. Xelif test -r /usr/local/lib/libcurses.a
  436. Xthen
  437. X    termlib="/usr/local/lib/libcurses.a"
  438. X    echo "local terminfo library found."
  439. Xelif test -r /lib/libtermlib.a -o -r /usr/lib/libtermlib.a
  440. Xthen
  441. X    termlib="-ltermlib"
  442. X    echo "termlib library found."
  443. Xelif test -r /usr/local/lib/libtermlib.a
  444. Xthen
  445. X    termlib="/usr/local/lib/libtermlib.a"
  446. X    echo "local termlib library found."
  447. Xelse
  448. X    echo " "
  449. X    echo "Your system appears NOT to have any termcap-like library."
  450. X    echo $n "Is this true? "
  451. X    read ans
  452. X    case $ans in
  453. X    n*|N*|f*|F*)    termlib="ask_it"
  454. X        ;;
  455. X    *)    termlib="libtermcap.a"
  456. X        cat <<\EOF
  457. XWe will setup ./Makefile to use the public domain version of the
  458. Xtermcap routines from ./tc. Your users must set the $TERMCAP and
  459. X$TERM environment variables appropriately in their profile; or you
  460. Xcan install shell scripts that arrange these.
  461. XHowever, it would be better if your system administrator installs
  462. Xtermcap in the proper places. You should run Setup again after she
  463. Xhas done so.
  464. XSee ./tc/README for details.
  465. XEOF
  466. X        ;;
  467. X    esac
  468. Xfi
  469. Xwhile test "$termlib" = "ask_it" -o "$termlib" = "try_again"; do
  470. X    case $termlib in
  471. X    ask_it)
  472. X        echo " "
  473. X        echo "Please specify where the termcap-like routines are kept"
  474. X        echo $n " (either full pathname or -lxxx option) "
  475. X        ;;
  476. X    try_again)
  477. X        echo $n "Please try again (full pathname or -lyyy option) "
  478. X        ;;
  479. X    esac
  480. X    read termlib
  481. X    case $termlib in
  482. X    -l*)
  483. X        echo "Hope $termlib will do the job."
  484. X        ;;
  485. X    /*)
  486. X        if test -r $termlib
  487. X        then
  488. X            echo "Ok, we will try $termlib."
  489. X        else
  490. X            echo "$termlib does not appear to exist."
  491. X            termlib="try_again"
  492. X        fi
  493. X        ;;
  494. X    *)
  495. X        echo "$termlib is not a valid library specification."
  496. X        termlib="try_again"
  497. X        ;;
  498. X    esac
  499. Xdone
  500. X
  501. X: 'Shall we make ABC public?'
  502. Xpublic="no"
  503. Xecho " "
  504. Xecho $n "Do you want to make ABC publically available? [no] "
  505. Xif ./readyn "$n"
  506. Xthen
  507. Xpublic="yes"
  508. Xabcdir='blurfl'
  509. Xwhile test ! -d "$rootdir$abcdir" ; do
  510. X    case $abcdir in
  511. X    blurfl)
  512. X        echo " "
  513. X        echo "Please type the full pathname of a$remote directory"
  514. X        echo "in which you have write permission, and where you"
  515. X        echo "want the binaries 'abc' and 'abckeys' installed"
  516. X        echo $n " [default $abcdef] "
  517. X        ;;
  518. X    *)     echo "$rootdir$abcdir does not appear to exist."
  519. X        echo $n "Are you sure you typed the right name? "
  520. X        read ans
  521. X        case $ans in
  522. X        y*|Y*)    echo "Don't forget to make $rootdir$abcdir before 'make install'."
  523. X            break
  524. X            ;;
  525. X        *)    echo " "
  526. X            echo $n "Please try again [default $abcdef] "
  527. X            ;;
  528. X        esac
  529. X        ;;
  530. X    esac
  531. X    read abcdir
  532. X    case $abcdir in
  533. X    "") abcdir=$abcdef;;
  534. X    esac
  535. Xdone
  536. Xlibdir='blurfl'
  537. Xwhile test ! -d "$rootdir$libdir" ; do
  538. X    case $libdir in
  539. X    blurfl)
  540. X        echo " "
  541. X        echo "Please type the full pathname of the$remote directory"
  542. X        echo "where you want to install the auxiliary datafiles"
  543. X        echo "needed by the ABC system"
  544. X        echo $n " [default $libdef] "
  545. X        ;;
  546. X    *)     echo "$rootdir$libdir does not appear to exist."
  547. X        echo $n "Are you sure you typed the right name? "
  548. X        read ans
  549. X        case $ans in
  550. X        y*|Y*)    echo "Don't forget to make $rootdir$libdir before 'make install'."
  551. X            break
  552. X            ;;
  553. X        *)    echo " "
  554. X            echo $n "Please try again [default $libdef] "
  555. X            ;;
  556. X        esac
  557. X        ;;
  558. X    esac
  559. X    read libdir
  560. X    case $libdir in
  561. X    "") libdir=$libdef;;
  562. X    esac
  563. Xdone
  564. Xmandir='blurfl'
  565. Xwhile test ! -d "$rootdir$mandir" ; do
  566. X    case $mandir in
  567. X    blurfl)
  568. X        echo " "
  569. X        echo "Please type the full pathname of the$remote directory"
  570. X        echo "where you want to install the 'abc.1' manual page"
  571. X        echo $n " [default $mandef] "
  572. X        ;;
  573. X    *)     echo "$rootdir$mandir does not appear to exist."
  574. X        echo $n "Are you sure you typed the right name? "
  575. X        read ans
  576. X        case $ans in
  577. X        y*|Y*)    echo "Don't forget to make $rootdir$mandir before 'make install'."
  578. X            break
  579. X            ;;
  580. X        *)    echo " "
  581. X            echo $n "Please try again [default $mandef] "
  582. X            ;;
  583. X        esac
  584. X        ;;
  585. X    esac
  586. X    read mandir
  587. X    case $mandir in
  588. X    "") mandir=$mandef;;
  589. X    esac
  590. Xdone
  591. Xelse
  592. Xabcdir="$abcdef"
  593. Xlibdir="$libdef"
  594. Xmandir="$mandef"
  595. Xfi
  596. X
  597. Xcat >answers <<EOF
  598. Xrootdef="$rootdir"
  599. Xabcdef="$abcdir"
  600. Xlibdef="$libdir"
  601. Xmandef="$mandir"
  602. XEOF
  603. X
  604. Xecho " "
  605. Xecho "End of configuration questions for the ABC system."
  606. X
  607. Xrm -f ./contains
  608. X
  609. Xeditor="ed -"
  610. X
  611. X: 'Getting generic copies of Makefile and unix/comp.h and unix/os.h.'
  612. X: 'Since some tars leave the owner of the tape as the owner of the files'
  613. X: 'this will make sure the edit scripts will not fail.'
  614. X
  615. Xecho " "
  616. Xecho "Creating Makefile from Makefile.unix."
  617. X
  618. Xtouch Makefile || (echo "Oops!"; exit 1)
  619. Xcat >Makefile <<EOF
  620. X# This file was generated and edited by the Setup command.
  621. X# To make lasting changes edit the files Makefile.unix and Setup,
  622. X# and run Setup again.
  623. X# 
  624. XEOF
  625. Xchmod 644 Makefile
  626. Xcat Makefile.unix >>Makefile || (echo "Oops!"; exit 1)
  627. X
  628. Xecho "Creating uhdrs/os.h from uhdrs/os.h.gen."
  629. X
  630. Xtouch uhdrs/os.h  || (echo "Oops!"; exit 1)
  631. Xcat >uhdrs/os.h <<EOF
  632. X/* This file was generated and edited by the Setup command. */
  633. X/* To make lasting changes edit the files uhdrs/os.h.gen and Setup, */
  634. X/* and run Setup again. */
  635. X
  636. XEOF
  637. Xchmod 644 uhdrs/os.h
  638. Xcat uhdrs/os.h.gen >>uhdrs/os.h
  639. X
  640. Xecho " "
  641. Xecho $n "Editing appropriate definitions in these files ... "
  642. X
  643. Xcase $unix in
  644. XBSD4_2)
  645. X    make="make \$(MFLAGS)"
  646. X    strchr="index"
  647. X    perror="#define"
  648. X    mkdir="#define"
  649. X    rename="#define"
  650. X    select="#define"
  651. X    readdir="#define"
  652. X    getwd="#define"
  653. X    getcwd="#undef "
  654. X    ;;
  655. XBSD)    make="make \$(MFLAGS)"
  656. X    strchr="index"
  657. X    perror="#define"
  658. X    mkdir="#undef "
  659. X    rename="#undef "
  660. X    select="#undef "
  661. X    readdir="#undef "
  662. X    getwd="#undef "
  663. X    getcwd="#undef "
  664. X    ;;
  665. XATT)    make="make -\$(MAKEFLAGS)"
  666. X    strchr="strchr"
  667. X    perror="#define"
  668. X    mkdir="#define"
  669. X    rename="#undef "
  670. X    select="#undef "
  671. X    readdir="#undef "
  672. X    getwd="#undef "
  673. X    getcwd="#define"
  674. X    ;;
  675. XVERSION7|unknown|*)
  676. X    make="make"
  677. X    strchr="index"
  678. X    perror="#undef "
  679. X    mkdir="#undef "
  680. X    rename="#undef "
  681. X    select="#undef "
  682. X    readdir="#undef "
  683. X    getwd="#undef "
  684. X    getcwd="#undef "
  685. X    ;;
  686. Xesac
  687. X
  688. X$editor Makefile <<EOF
  689. X/^MAKE=/s?MAKE=.*?MAKE= $make?
  690. X/^CC=/s?CC=.*?CC= $cc?
  691. X/^FLOAT=/s?FLOAT=.*?FLOAT= $fflag?
  692. X/^TERMLIB=/s?TERMLIB=.*?TERMLIB= $termlib?
  693. Xw
  694. Xq
  695. XEOF
  696. X
  697. Xcase $public in
  698. Xyes)
  699. X    $editor Makefile <<EOF
  700. X    /^DESTABC=/s?DESTABC=.*?DESTABC= $abcdir?
  701. X    /^DESTLIB=/s?DESTLIB=.*?DESTLIB= $libdir?
  702. X    /^DESTMAN=/s?DESTMAN=.*?DESTMAN= $mandir?
  703. X    w
  704. X    q
  705. XEOF
  706. X    ;;
  707. Xesac
  708. X
  709. X$editor uhdrs/os.h <<EOF
  710. X/^#include <strings.h>/s?<strings.h>?$strs?
  711. X/^#include <sys\/file.h>/s?<sys/file.h>?$modes?
  712. X/^#define VOID/s?(void)?$void?
  713. X/^#define SIGTYPE/s?int?$sigtype?
  714. X/^#undef  TERMIO/s?#undef ?$termio?
  715. X/^#define HAS_FTIME/s?#define?$ftime?
  716. X/^#define HAS_PERROR/s?#define?$perror?
  717. X/^#define HAS_MKDIR/s?#define?$mkdir?
  718. X/^#define HAS_GETWD/s?#define?$getwd?
  719. X/^#undef  HAS_GETCWD/s?#undef ?$getcwd?
  720. X/^#define HAS_RENAME/s?#define?$rename?
  721. X/^#define HAS_SELECT/s?#define?$select?
  722. X/^#define HAS_READDIR/s?#define?$readdir?
  723. Xw
  724. Xq
  725. XEOF
  726. X
  727. Xcase $strs in
  728. Xno_strs)
  729. X    case $strchr in
  730. X    "index")    index=index; rindex=rindex;;
  731. X    "strchr")    index=strchr; rindex=strrchr;;
  732. X    esac
  733. X    $editor uhdrs/os.h <<EOF
  734. X/#include no_strs/c
  735. X
  736. Xextern char *strcat();
  737. Xextern int strcmp();
  738. Xextern int strncmp();
  739. Xextern char *strcpy();
  740. Xextern char *strncpy();
  741. Xextern int strlen();
  742. Xextern char *$index();
  743. Xextern char *$rindex();
  744. X
  745. X.
  746. Xw
  747. Xq
  748. XEOF
  749. X;;
  750. Xesac
  751. X
  752. Xcase $modes in
  753. Xno_modes)
  754. X    $editor unix/os.h <<EOF
  755. X/#include no_modes/c
  756. X
  757. X#define R_OK 4
  758. X#define W_OK 2
  759. X#define F_OK 0
  760. X.
  761. Xw
  762. Xq
  763. XEOF
  764. X;;
  765. Xesac
  766. X
  767. Xcase $strchr in
  768. Xstrchr)    $editor uhdrs/os.h <<EOF
  769. X/#define strchr/,/#define strrchr/d
  770. Xw
  771. Xq
  772. XEOF
  773. X;;
  774. Xesac
  775. X
  776. Xcase $termlib in
  777. Xlibtermcap.a)
  778. X    $editor Makefile <<EOF
  779. X    /TERMLIB=/s?.*?TERMLIB=?
  780. X    /#OWNTLIB=/s?#??
  781. X    /#KOWNTLIB=/s?#??
  782. X    /#OWNTBASE=/s?#??
  783. X    w
  784. X    q
  785. XEOF
  786. X    ;;
  787. Xesac
  788. X
  789. Xecho $n " "
  790. Xecho "done."
  791. X
  792. Xecho " "
  793. Xecho "This completes the setup of the ABC system."
  794. X
  795. Xcase $remote in
  796. X' remote')
  797. X    cat <<EOF
  798. XYou should first compile mkconfig (from ./mkconfig.c and ./uhdrs/os.h)
  799. Xwith 'make mkconfig' here, run it on the remote machine and copy the
  800. Xresult to ./uhdrs/config.h.
  801. XAfter that you can proceed here with 'make all'.
  802. XEOF
  803. X    ;;
  804. X*)    echo "You can now try 'make all'."
  805. X    ;;
  806. Xesac
  807. X
  808. Xcase $remote in
  809. X" remote")
  810. X    if test ! -d "$rootdir"
  811. X    then
  812. X        echo " "
  813. X        echo "You should 'mkdir $rootdir' before 'make install'."
  814. X    fi
  815. X    ;;
  816. Xesac
  817. X
  818. Xcase $public in
  819. Xyes)
  820. X    if test ! -d "$rootdir$abcdir"
  821. X    then
  822. X        echo " "
  823. X        echo "You should 'mkdir $rootdir$abcdir' before 'make install'."
  824. X    fi
  825. X    if test ! -d "$rootdir$libdir"
  826. X    then
  827. X        echo "You should 'mkdir $rootdir$libdir' before 'make install'."
  828. X    fi
  829. X    if test ! -d "$rootdir$mandir"
  830. X    then
  831. X        echo "You should 'mkdir $rootdir$mandir' before 'make install'."
  832. X    fi
  833. X    ;;
  834. Xesac
  835. X
  836. Xexit 0
  837. EOF
  838. chmod +x 'abc/Setup'
  839. echo 'x - abc/readyn'
  840. sed 's/^X//' > 'abc/readyn' << 'EOF'
  841. X: 'Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1990.'
  842. X:
  843. X: 'read yes or no [default no]'
  844. X
  845. Xn=$1
  846. X
  847. Xwhile true
  848. Xdo 
  849. X    read ans
  850. X    case $ans in
  851. X    y|Y|t|T|yes|Yes|YES|true|True|TRUE)    exit 0;;
  852. X    ''|n|N|f|F|no|No|NO|false|False|FALSE)    exit 1;;
  853. X    *)        echo $n "Please answer with yes or no "
  854. X    esac
  855. Xdone
  856. EOF
  857. chmod +x 'abc/readyn'
  858. echo 'x - abc/Makefile.unix'
  859. sed 's/^X//' > 'abc/Makefile.unix' << 'EOF'
  860. X#######################################################################
  861. X#                                                                     #
  862. X#                 Makefile for ABC system under unix.                 #
  863. X#                                                                     #
  864. X#######################################################################
  865. X
  866. X# --- Some make's only make love with the Bourne shell ---
  867. X#
  868. X
  869. XSHELL=    /bin/sh
  870. X
  871. X
  872. X# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  873. X# +++ Start of editable macro definitions; filled in by ./Setup      +++
  874. X# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  875. X
  876. X# --- pass make options ---
  877. X#
  878. X# On 4.{23}BSD the macro $(MFLAGS) is set by make to the collection of
  879. X# command line options (such as -k, -i) and passed to make in subdirectories.
  880. X# For System V use $(MAKEFLAGS). Otherwise just fill in 'make'.
  881. X
  882. XMAKE=    make $(MFLAGS)
  883. X
  884. X
  885. X# --- C compiler to use ---
  886. X#
  887. X# In case you might want to change it to e.g. 'gcc' (the GNU C compiler).
  888. X
  889. XCC=    cc
  890. X
  891. X
  892. X# --- Where to install the stuff ---
  893. X#
  894. X# These should all be absolute pathnames.
  895. X
  896. X# destination directory for binaries 'abc' and 'abckeys':
  897. X
  898. XDESTABC=/usr/local
  899. X
  900. X# destination directory for auxiliary data files:
  901. X
  902. XDESTLIB=/usr/local/lib/abc
  903. X
  904. X# destination directory for 'abc.1' manual page:
  905. X
  906. XDESTMAN=/usr/man/manl
  907. X
  908. X# local destination if you cross-compile; empty otherwise:
  909. X
  910. XDESTROOT=
  911. X# you should first generate uhdrs/config.h remotely;
  912. X# see 'make config' below.
  913. X
  914. X# directory where 'abc' and 'abckeys' should locate auxiliary files,
  915. X# when created in the current directory;
  916. X# change this to some proper absolute pathname, like /ufs/$user,
  917. X# if `pwd` gives an unsteady pathname, e.g. when using NFS mounted filesystems.
  918. X
  919. XDESTALL="`pwd`"
  920. X
  921. X
  922. X# --- Software floating point needed? ---
  923. X
  924. XFLOAT=
  925. X
  926. X
  927. X# --- Flags to the C compiler ---
  928. X
  929. XDEFS=    -DNDEBUG
  930. XCFLAGS= -O $(FLOAT) $(DEFS)
  931. X
  932. X
  933. X# --- Flags to the loader ---
  934. X
  935. XLDFLAGS=
  936. X
  937. X
  938. X# --- Specify termcap or terminfo library ---
  939. X#
  940. X# Set TERMLIB to the appropriate termcap or terminfo library specification
  941. X# (either -lxxx option or absolute pathname) if your system has one.
  942. X# Otherwise leave TERMLIB empty and remove the comment symbols before
  943. X# the definitions of OWNTLIB, KOWNTLIB and OWNTBASE to install the
  944. X# public domain version from ./tc.
  945. X
  946. XTERMLIB= -ltermcap
  947. X
  948. X#OWNTLIB= libtermcap.a
  949. X#KOWNTLIB= ../libtermcap.a
  950. X#OWNTBASE= termcap
  951. X
  952. X
  953. X# --- Libraries for editor-interpreter 'abc' ---
  954. X
  955. XLIBS=    -lm $(TERMLIB) $(OWNTLIB)
  956. X
  957. X
  958. X# --- Libraries for utility 'abckeys' ---
  959. X
  960. XKLIBS=    $(TERMLIB) $(KOWNTLIB)
  961. X
  962. X
  963. X# +++++++++++++++++++++++++++++++++++++++++
  964. X# +++ End of editable macro definitions +++
  965. X# +++++++++++++++++++++++++++++++++++++++++
  966. X#
  967. X# The remaining macro definitions should only have to be edited
  968. X# if you make very drastic changes.
  969. X
  970. X# --- Include flags to the C compiler for editor and interpreter directories ---
  971. X
  972. XBINCL=    -I../bhdrs -I../uhdrs
  973. XEINCL=    -I../bhdrs -I../ehdrs -I../uhdrs -I../btr
  974. XIINCL=    -I../bhdrs -I../ihdrs -I../uhdrs
  975. XUINCL=    -I../bhdrs -I../ehdrs -I../ihdrs -I../uhdrs
  976. X
  977. X# --- Editor and interpreter directories ---
  978. X
  979. XCDIRS=    b bed bint1 bint2 bint3 btr unix stc bio
  980. X
  981. XBDIRS=    b
  982. XEDIRS=    bed
  983. XIDIRS=    bint1 bint2 bint3 btr stc bio
  984. XUDIRS=    unix
  985. X
  986. X# --- Editor and interpreter files ---
  987. X
  988. XBOBJS=    b/*.o
  989. XEOBJS=    bed/*.o
  990. XIOBJS=    bint1/*.o bint2/*.o bint3/*.o btr/*.o stc/*.o bio/*.o
  991. XUOBJS=    unix/*.o
  992. X
  993. XBSRCS=    b/*.c
  994. XESRCS=    bed/*.c
  995. XISRCS=    bint1/*.c bint2/*.c bint3/*.c btr/*.c stc/*.c bio/*.c
  996. XUSRCS=    unix/*.c
  997. X
  998. XBHDRS=    bhdrs/*.h
  999. XEHDRS=    ehdrs/*.h
  1000. XIHDRS=    ihdrs/*.h btr/*.h bio/*.h
  1001. XUHDRS=    uhdrs/*.h
  1002. X
  1003. X# --- Preliminary dependencies (do not change for Unix) ---
  1004. X
  1005. XCONFIG=    uhdrs/config.h
  1006. XOSHDIR= uhdrs
  1007. X
  1008. XDEST=    uhdrs/dest.h
  1009. X
  1010. X# --- Stuff for programmers ---
  1011. X
  1012. XLINT=        lint
  1013. X# change the next one to -p for ATT System V
  1014. XLINTFLAGS=    -abhxp
  1015. XLINCL=        -Ibhdrs -Iehdrs -Iihdrs -Iuhdrs -Ibtr
  1016. X
  1017. XTAGDIRS=b bed bint1 bint2 bint3 btr stc bio unix keys bhdrs ehdrs ihdrs uhdrs
  1018. X
  1019. X
  1020. X# -------------------------------------------
  1021. X# ---  make all: make everything locally  ---
  1022. X# -------------------------------------------
  1023. X#
  1024. X# This makes all programs and utilities in the current directory.
  1025. X# (Except for the ready-for-use default key definitions files).
  1026. X
  1027. Xall:    alldest abc.ld abckeys.ld
  1028. X    @./ch_all "$(DESTROOT)"
  1029. X
  1030. X# The target 'alldest' is used to communicate the place of auxiliary files.
  1031. X# This target is also used for a separate 'make abc' or 'make abckeys'.
  1032. X#
  1033. X# Dependency on the (non-existent) file "ALWAYS" causes this entry to
  1034. X# be (re)made unconditionally. Make won't complain about ALWAYS not being
  1035. X# found because there is also a rule referencing it as target at the
  1036. X# very end (which actually doesn't make it, but make doesn't care).
  1037. X
  1038. Xalldest: ALWAYS
  1039. X    echo "#define ABCLIB \"$(DESTALL)\"" >dest
  1040. X    if cmp -s dest $(DEST); then rm dest; else mv dest $(DEST); fi
  1041. X
  1042. X# CONFIG: generate include file with info about the hardware configuration.
  1043. X#
  1044. X# Special care is taken to remove an incomplete $(CONFIG) if mkconfig
  1045. X# fails halfway. Otherwise a subsequent 'make depend' will happily go on.
  1046. X
  1047. Xconfig: $(CONFIG)
  1048. X
  1049. X$(CONFIG): mkconfig.c $(OSHDIR)/osconf.h
  1050. X    @./ch_config "$(DESTROOT)" "$(CONFIG)"
  1051. X    $(CC) -I$(OSHDIR) mkconfig.c -o mkconfig
  1052. X    ./mkconfig >$(CONFIG) || (rm -f $(CONFIG) && exit 1)
  1053. X
  1054. X# abc: make the executable that is the kernel of the system.
  1055. X#
  1056. X# The load must be unconditional, since we cannot know whether
  1057. X# any of the submakes had to update some subtarget.
  1058. X
  1059. Xabc: alldest abc.ld
  1060. X
  1061. Xabc.ld:    $(CONFIG) $(BDIRS) $(EDIRS) $(IDIRS) $(UDIRS) \
  1062. X        $(OWNTLIB) $(OWNTBASE) ALWAYS
  1063. X    $(CC) $(LDFLAGS) $(BOBJS) $(EOBJS) $(IOBJS) $(UOBJS) $(LIBS) -o abc
  1064. X
  1065. X# Call make for each editor and interpreter subdirectory with proper flags.
  1066. X#
  1067. X# If a dependency line has more than one item left of the colon, the
  1068. X# commands are executed for each of the items, with $@ substituted
  1069. X# by the item's name.
  1070. X
  1071. X$(BDIRS): $(CONFIG) ALWAYS
  1072. X    cd $@; $(MAKE) -f MF -f DEP CFLAGS='$(CFLAGS) $(BINCL)' all
  1073. X
  1074. X$(EDIRS): $(CONFIG) ALWAYS
  1075. X    cd $@; $(MAKE) -f MF -f DEP CFLAGS='$(CFLAGS) $(EINCL)' all
  1076. X
  1077. X$(IDIRS): $(CONFIG) ALWAYS
  1078. X    cd $@; $(MAKE) -f MF -f DEP CFLAGS='$(CFLAGS) $(IINCL)' all
  1079. X
  1080. X$(UDIRS): $(CONFIG) ALWAYS
  1081. X    cd $@; $(MAKE) -f MF -f DEP CFLAGS='$(CFLAGS) $(UINCL)' all
  1082. X
  1083. X# Make utility 'abckeys' for redefinition of keybindings.
  1084. X#
  1085. X# The submake will find out whether recompilation is necessary.
  1086. X
  1087. Xabckeys: alldest abckeys.ld
  1088. X
  1089. Xabckeys.ld: $(CONFIG) $(OWNTLIB) $(OWNTBASE) ALWAYS
  1090. X    cd keys; \
  1091. X     $(MAKE) -f Makefile -f DEP \
  1092. X         CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" LIBS="$(KLIBS)" all
  1093. X
  1094. X
  1095. X# ----------------------------------------------
  1096. X# --- make examples: try the ABC interpreter ---
  1097. X# ----------------------------------------------
  1098. X
  1099. Xexamples:
  1100. X    @cd ex; ./DoExamples local
  1101. X#    ch_examples is embedded in DoExamples to cope with cross compilation.
  1102. X
  1103. X
  1104. X# ---------------------------------------------------------
  1105. X# --- make try_editor: try the ABC editor interactively ---
  1106. X# ---------------------------------------------------------
  1107. X
  1108. Xtry_editor:
  1109. X    @cd ex; ./TryEditor local
  1110. X#    ch_tryeditor embedded in TryEditor.
  1111. X
  1112. X# ---------------------------------------------------------
  1113. X# --- make install: install everything in public places ---
  1114. X# ---------------------------------------------------------
  1115. X#
  1116. X# The dependency of 'install' on installdest communicates the place
  1117. X# and place of auxiliary files to the binaries 'abc' and 'abckeys'.
  1118. X# The unconditional submakes of the targets 'abc.ld' and 'abckeys.ld'
  1119. X# causes the proper files to be remade.
  1120. X#
  1121. X# The directory ukeys contains default keydefinitions files for
  1122. X# several terminals.
  1123. X
  1124. Xinstall: installdest abc.ld abckeys.ld
  1125. X    cp abc abckeys $(DESTROOT)$(DESTABC)
  1126. X    cp abc.msg abc.hlp $(DESTROOT)$(DESTLIB)
  1127. X    cd ukeys; cp abckeys_* $(DESTROOT)$(DESTLIB)
  1128. X    cp abc.1 $(DESTROOT)$(DESTMAN)
  1129. X    @./ch_install "$(DESTABC)" "$(DESTLIB)" "$(DESTMAN)" "$(DESTROOT)"
  1130. X
  1131. Xinstalldest: ALWAYS
  1132. X    echo "#define ABCLIB \"$(DESTLIB)\"" >dest
  1133. X    if cmp -s dest $(DEST); then rm dest; else mv dest $(DEST); fi
  1134. X
  1135. X
  1136. X# -------------------------------------------------
  1137. X# --- Make our own termcap library and database ---
  1138. X# -------------------------------------------------
  1139. X#
  1140. X# For systems that really don't have any termlib-like library
  1141. X# this makes our own from public domain sources in ./tc.
  1142. X# See ./tc/README for details.
  1143. X# This happens automatically if you remove the comment symbols before
  1144. X# the definitions of OWNTLIB and OWNTBASE above.
  1145. X
  1146. Xlibtermcap.a:
  1147. X    cd tc; make library
  1148. X
  1149. Xtermcap:
  1150. X    cd tc; make database
  1151. X
  1152. X
  1153. X# -----------------------------------
  1154. X# ---  make clean: local cleanup  ---
  1155. X# -----------------------------------
  1156. X
  1157. Xclean:
  1158. X    rm -f */*.o mkconfig $(CONFIG) $(DEST) core ex/out
  1159. X    ./ch_clean
  1160. X
  1161. X
  1162. X# ---------------------------------------------
  1163. X# ---  Utilities for the programmer/porter  ---
  1164. X# ---------------------------------------------
  1165. X
  1166. Xmflags:
  1167. X    echo MFLAGS="$(MFLAGS)", MAKEFLAGS="$(MAKEFLAGS)"
  1168. X
  1169. X# --- make makefiles: construct trivial makefiles in subdirectories ---
  1170. X#
  1171. X# This reconstructs trivial makefiles called 'MF' in relevant subdirectories.
  1172. X# See ./Port for details.
  1173. X
  1174. Xmakefiles:
  1175. X    for i in $(CDIRS); do \
  1176. X        ( cd $$i; echo all: *.c | sed 's/\.c/.o/g' >MF ) done
  1177. X
  1178. X# No automatic makefile in ./keys. Edit that one yourself if need be.
  1179. X
  1180. X# --- How to generate dependency information for make ---
  1181. X#
  1182. X# Set MKDEP to $(CC) -M $(DEFS) or to ../scripts/mkdep $(DEFS).
  1183. X# 'cc -M' is a 4.2BSD-only feature which causes the C preprocessor
  1184. X# to output a list of dependencies that is directly usable by make.
  1185. X# This can be simulated exactly by piping the output of your preprocessor
  1186. X# through the shell script ./scripts/mkdep.
  1187. X# Check the comments there to see if it needs polishing for your system.
  1188. X
  1189. XMKDEP=    $(CC) -M $(DEFS)
  1190. X
  1191. X# --- make depend: construct makefiles with dependencies in subdirectories ---
  1192. X#
  1193. X# This reconstructs additional makefiles called 'DEP' in subdirectories
  1194. X# containing the dependency information.
  1195. X# Dependencies on system include files are grep'ed out, to make the
  1196. X# resulting DEP files distributable.
  1197. X# See ./Port.
  1198. X
  1199. Xdepend: $(CONFIG) $(DEST) bdep edep idep udep kdep
  1200. X
  1201. Xbdep:
  1202. X    for i in $(BDIRS); do \
  1203. X    ( echo $$i; cd $$i; $(MKDEP) $(BINCL) *.c | grep -v ': /' >DEP ) done
  1204. X
  1205. Xedep:
  1206. X    for i in $(EDIRS); do \
  1207. X    ( echo $$i; cd $$i; $(MKDEP) $(EINCL) *.c | grep -v ': /' >DEP ) done
  1208. X
  1209. Xidep:
  1210. X    for i in $(IDIRS); do \
  1211. X    ( echo $$i; cd $$i; $(MKDEP) $(IINCL) *.c | grep -v ': /' >DEP ) done
  1212. X
  1213. Xudep:
  1214. X    for i in $(UDIRS); do \
  1215. X    ( echo $$i; cd $$i; $(MKDEP) $(UINCL) *.c | grep -v ': /' >DEP ) done
  1216. X
  1217. Xkdep:
  1218. X    cd keys; \
  1219. X    $(MAKE) MKDEP="$(MKDEP)" DEFS="$(DEFS)" depend | grep -v ': /' >DEP
  1220. X
  1221. X$(DEST): alldest
  1222. X
  1223. X# --- make messages ---
  1224. X#
  1225. X# Make new messages file when you have changed or added any MESS/GMESS
  1226. X# definitions in the source.
  1227. X# Note: the Collect and Change scripts can be found in ./scripts.
  1228. X# See ./Problems for details.
  1229. X
  1230. Xmessages: abc.msg
  1231. X
  1232. Xabc.msg: $(BSRCS) $(ESRCS) $(ISRCS) $(USRCS) \
  1233. X        ihdrs/i0err.h ehdrs/erro.h bio/i4bio.h
  1234. X    ./scripts/Collect $(BSRCS) $(ESRCS) $(ISRCS) $(USRCS) \
  1235. X        ihdrs/i0err.h ehdrs/erro.h bio/i4bio.h >abc.msg
  1236. X
  1237. X# --- make help ---
  1238. X#
  1239. X# Help file from manual entry.
  1240. X# Sorry, the file unix/abc.mac was created from copyrighted material;
  1241. X# therefore, it is not in the distribution.
  1242. X#
  1243. X
  1244. Xhelp: abc.hlp
  1245. X
  1246. Xabc.hlp: unix/abc.mac abc.1
  1247. X    nroff unix/abc.mac abc.1 >abc.help
  1248. X    (echo "SUMMARY OF SPECIAL ACTIONS"; \
  1249. X     sed -e '1,/^SUMMARY/d' abc.help; \
  1250. X     echo " "; \
  1251. X     sed -e '/^SUMMARY/,$$d' abc.help) >abc.hlp
  1252. X    rm abc.help
  1253. X
  1254. X# ---  make clobber: additional local cleanup   ---
  1255. X
  1256. Xclobber:
  1257. X    rm -f abc abckeys */tags tags ID
  1258. X
  1259. X# --- make lint, tags and id ---
  1260. X
  1261. Xlint:    $(DEST) abclint klint
  1262. X
  1263. Xabclint:
  1264. X    $(LINT) $(LINTFLAGS) $(DEFS) $(LINCL) \
  1265. X        $(BSRCS) $(ESRCS) $(ISRCS) $(USRCS)
  1266. X
  1267. Xklint:
  1268. X    cd keys; \
  1269. X     $(MAKE) LINT="$(LINT)" LINTFLAGS="$(LINTFLAGS)" DEFS="$(DEFS)" lint
  1270. X
  1271. Xtags:    ALWAYS
  1272. X    etags */*.h */*.c
  1273. X    rm -f tags   # Remove it so it will be remade when an interrupt hits
  1274. X    for i in $(TAGDIRS); \
  1275. X    do \
  1276. X        ( echo $$i; cd $$i; ctags -w *.[ch]; \
  1277. X          sed "s,    ,    $$i/," tags \
  1278. X        ) \
  1279. X    done | sort -o tags
  1280. X
  1281. X
  1282. Xid:    ALWAYS
  1283. X    mkid */*.[hc]
  1284. X
  1285. X
  1286. XALWAYS: # Must not exist, but must be mentioned in the makefile
  1287. EOF
  1288. echo 'x - abc/README'
  1289. sed 's/^X//' > 'abc/README' << 'EOF'
  1290. XCopyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  1291. X
  1292. XHOW TO INSTALL ABC:
  1293. X
  1294. XYou will need 2.5 megabytes in total to compile and load the ABC system.
  1295. XTo start type:
  1296. X
  1297. X        ./Setup
  1298. X
  1299. Xwhich will ask you some questions to set the ABC system up on your
  1300. Xinstallation.  You can call "Setup" any number of times without spoiling
  1301. Xfiles.  So run it once to see what questions you will be asked.  If you
  1302. Xdon't know the answer to some question, you can run it again.
  1303. X
  1304. X        make all
  1305. X
  1306. Xwill compile and load the ABC system, producing the programs "abc" and
  1307. X"abckeys" locally in this directory.  You can test the ABC interpreter with:
  1308. X
  1309. X        make examples
  1310. X
  1311. XThis runs some examples in ./ex. It does not test the ABC editor, however;
  1312. Xthat can only be done interactively with
  1313. X
  1314. X        make try_editor
  1315. X
  1316. XConsult the sheet "HOW TO TRY THE ABC EDITOR" (also in ./README2).
  1317. X
  1318. XIf all is well and you want to make ABC public
  1319. X
  1320. X        make install
  1321. X
  1322. Xwill do some compiling to get the right pathnames in, and install the binaries
  1323. X"abc" and "abckeys", the "abc.1" manual file, and the auxiliary files in the
  1324. Xdirectories you indicated during setup.  Finally
  1325. X
  1326. X        make clean
  1327. X
  1328. Xwill clean all intermediate object files from the source directories.
  1329. X
  1330. XIf you have made ABC public, all necessary files have been copied to the
  1331. Xpublic places, and you can get rid of the entire ABC file system hierarchy
  1332. Xyou extracted from the tape, if you want.
  1333. X
  1334. XIf there are any problems, don't panic. See ./Problems for advice.  Also
  1335. Xedit the example Bug Report form in ./doc to communicate the problem to us.
  1336. XWe can then send out diffs for fixed problems in the future.
  1337. X
  1338. XAbove all, we would be very grateful to receive any comments you have about
  1339. Xthe setup procedure, or the ABC system in general, on how to make it easier
  1340. Xto use.
  1341. X
  1342. XGood luck!
  1343. EOF
  1344. echo 'x - abc/Problems'
  1345. sed 's/^X//' > 'abc/Problems' << 'EOF'
  1346. XCopyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988.
  1347. X
  1348. XHOW TO TACKLE PROBLEMS DURING ABC INSTALLATION
  1349. X
  1350. XThis file contains some detailed advice in case you run into problems while
  1351. Xinstalling the ABC system.
  1352. X
  1353. XTHE SETUP PROCEDURE
  1354. X
  1355. XYour best bet if the "Setup" script fails is to read it, locate the
  1356. Xproblem, change it and run it again.  You can always shorten its runtime by
  1357. Xchanging long pieces into the simple setting of a shell variable.  For
  1358. Xinstance, once you are sure your floating point is allright, you might
  1359. Xreplace the whole section titled "Floating point arithmetic ok?" by a
  1360. Xsimple "fflag=".
  1361. X
  1362. XNormally you should not edit the files that Setup creates (./Makefile
  1363. Xand ./uhdrs/os.h) directly, but their ancestors (./Makefile.unix and
  1364. X./uhdrs/os.h.gen) and run Setup to incorporate your changes.
  1365. XIf you really want to change them directly, also change Setup to
  1366. Xwork on them or remove Setup completely.
  1367. X
  1368. XMACHINE CONFIGURATION
  1369. X
  1370. XThe file ./uhdrs/config.h is created by compiling "mkconfig.c" and running
  1371. X"mkconfig" on your target machine, since it tries to establish some facts
  1372. Xabout the hardware configuration.  (If you are cross-compiling you should
  1373. Xdo that before a "make depend" since that would run mkconfig on the local
  1374. X(compiling) machine.)
  1375. X
  1376. XIf you really have to edit uhdrs/config.h, you should edit the Makefile (or
  1377. XMakefile.unix) so that it will not overwrite it anymore.
  1378. X
  1379. XThe problem most encountered with mkconfig is "unexpected over/underflow".
  1380. XThis is usually caused by a bug in "printf", where it can't print very
  1381. Xlarge or very small numbers.  Look at the last line produced by mkconfig
  1382. Xbefore it failed, and then locate the printf after the one that printed
  1383. Xthat line.  If it is trying to print a comment (rather than a #define),
  1384. Xyou can safely comment out the printf and try again.  (You might also want
  1385. Xto report the bug to your UNIX supplier.)
  1386. X
  1387. XOTHER UNIX's
  1388. X
  1389. XThe installation of the ABC system has been tested under 4.3 BSD UNIX on
  1390. XTahoe, Vax, Sun and Sparc machines, under ATT System V Release 3.0 UNIX on an
  1391. XIntel 80386, and under MINIX, which is supposed to be VERSION 7 UNIX
  1392. Xcompatible.  The Setup script tries to find out whether your UNIX is one of
  1393. Xthese, and creates ./uhdrs/os.h from ./uhdrs/os.h.gen accordingly.  We
  1394. Xexpect you will have no problems compiling the ABC system in this case.
  1395. X
  1396. XIf your UNIX is different, the Setup script will create a file ./uhdrs/os.h
  1397. Xwith most defaults setup for a VERSION 7 UNIX system, since that makes a
  1398. Xminimum number of assumptions.  Examine the resulting file, and change the
  1399. Xnames of system include files if they are different on your system.  Also
  1400. Xcheck the definitions and UNIX specific flags in this file.  See the
  1401. Xcomments, and use your systems manual to find out how to set them.  Don't
  1402. Xforget that this file is created by running Setup; change Setup if you want
  1403. Xto edit uhdrs/os.h directly, or edit uhdrs/os.h.gen and run Setup again.
  1404. X
  1405. XIf your machine's memory is not that big, you might examine ./uhdrs/feat.h
  1406. Xto turn off some features in an attempt to make the ABC editor-interpreter
  1407. Xsmaller.
  1408. X
  1409. XWe have tried to gather the operating system dependent parts in ./unix/*.c
  1410. Xand ./uhdrs/*.h.  Examine these if any problems in compilation remain.
  1411. X
  1412. XEDITOR PROBLEMS
  1413. X
  1414. XOnce the ABC system is compiled, you may encounter problems when you use
  1415. Xthe ABC editor.  Our experience is that most of these problems are caused
  1416. Xby erroneous or insufficiently detailed termcap entries, which decribe your
  1417. Xterminal's capabilities; so first check the "termcap(5)" manual entry (or
  1418. X"terminfo(4)" for terminfo systems).  Ask your system's guru to give you a
  1419. Xhand if you are not familiar with these.
  1420. X
  1421. XWe use the following entries from the termcap database if they are defined
  1422. Xfor your terminal:
  1423. X
  1424. X       Name   Type   Description
  1425. X
  1426. X       AL     str    add n new blank lines
  1427. X       CM     str    screen-relative cursor motion
  1428. X       DL     str    delete n lines
  1429. X       al     str    add new blank line
  1430. X       am     bool   has automatic margins
  1431. X       bc     str    backspace character
  1432. X       bs     bool   terminal can backspace
  1433. X       cd     str    clear to end of display
  1434. X       ce     str    clear to end of line
  1435. X       cl     str    cursor home and clear screen
  1436. X       cm     str    cursor motion
  1437. X       co     num    number of columns in a line
  1438. X       cp     str    cursor position sense reply
  1439. X       cr     str    carriage return
  1440. X       cs     str    change scrolling region
  1441. X       da     bool   display may be retained above screen
  1442. X       db     bool   display may be retained below screen
  1443. X       dc     str    delete character
  1444. X       dl     str    delete line
  1445. X       dm     str    enter delete mode
  1446. X       do     str    cursor down one line
  1447. X       ed     str    end delete mode
  1448. X       ei     str    end insert mode
  1449. X       hc     bool   hardcopy terminal
  1450. X       ho     str    cursor home
  1451. X       ic     str    insert character (if necessary; may pad)
  1452. X       im     str    enter insert mode
  1453. X       in     bool   not save to have null chars on the screen
  1454. X       ke     str    keypad mode end
  1455. X       ks     str    keypad mode start
  1456. X       le     str    cursor left
  1457. X       li     num    number of lines on screen
  1458. X       mi     bool   move safely in insert (and delete?) mode
  1459. X       ms     bool   move safely in standout mode
  1460. X       nd     str    cursor right (non-destructive space)
  1461. X       nl     str    newline
  1462. X       pc     str    pad character
  1463. X       se     str    end standout mode
  1464. X       sf     str    scroll text up (from bottom of region)
  1465. X       sg     num    number of garbage characters left by so or se (default 0)
  1466. X       so     str    begin standout mode
  1467. X       sp     str    sense cursor position
  1468. X       sr     str    scroll text down (from top of region)
  1469. X       te     str    end termcap
  1470. X       ti     str    start termcap
  1471. X       ue     str    end underscore mode
  1472. X       up     str    cursor up
  1473. X       us     str    start underscore mode
  1474. X       vb     str    visible bell
  1475. X       ve     str    make cursor visible again
  1476. X       vi     str    make cursor invisible
  1477. X       xn     bool   newline ignored after 80 cols (VT100 / Concept glitch)
  1478. X       xs     bool   standout not erased by overwriting
  1479. X
  1480. XOf these your termcap entry should at least define the following:
  1481. X
  1482. X       le OR bc OR bs
  1483. X       up
  1484. X       cm OR CM OR (ho AND do AND nd)
  1485. X       (al AND dl) OR (cs AND sr)
  1486. X       ce
  1487. X       (so AND se AND sg = 0 [or not defined]) OR (us AND ue)
  1488. X
  1489. XIf either of these requirements is not fulfilled, the ABC editor will
  1490. Xcomplain that your terminal is too dumb.
  1491. X
  1492. XOne common problem on terminals with resizeable windows is that the ABC
  1493. Xprompt shows up like
  1494. X
  1495. X       >>>
  1496. X           ?
  1497. X
  1498. Xon two lines instead of one.  This means that the "li#" entry in your
  1499. XTERMCAP does not accurately reflect the number of lines actually in the
  1500. Xwindow.  This can be remedied by changing the setting of your TERMCAP
  1501. Xenvironment variable, using the output of "stty size" (see stty(1)).  (On
  1502. Xsystems that have the TIOCGWINSZ ioctl, we use it to get the proper window
  1503. Xsize; see tty(4) on BSD UNIX systems).
  1504. X
  1505. XERROR MESSAGES
  1506. X
  1507. XThe error messages that ABC displays are all gathered in a file and only
  1508. Xread when necessary.  This was done to diminish the store used for all
  1509. Xthese strings and to enhance the adaptability of ABC to another natural
  1510. Xlanguage.
  1511. X
  1512. XIf you want the error messages in another language, for example French, you
  1513. Xonly have to replace the file ./abc.msg by a French version.
  1514. EOF
  1515. echo 'x - abc/ch_all'
  1516. sed 's/^X//' > 'abc/ch_all' << 'EOF'
  1517. X: 'Check if make all went allright.'
  1518. X
  1519. Xdestroot="$1"
  1520. X
  1521. Xerrors="no"
  1522. X
  1523. Xecho " "
  1524. X
  1525. Xfor f in abc abckeys
  1526. Xdo
  1527. X    if test ! -s $f
  1528. X    then
  1529. X        echo "*** Failed to make $f"
  1530. X        errors="yes"
  1531. X    fi
  1532. Xdone
  1533. X
  1534. Xcase $errors in
  1535. Xyes)
  1536. X    exit 1
  1537. X    ;;
  1538. Xno)
  1539. X    case $destroot in
  1540. X    '')    echo "The 'abc' command should now work."
  1541. X        echo "You can test the ABC interpreter with 'make examples'."
  1542. X        ;;
  1543. X    *)    echo "That 'make all' went well."
  1544. X        echo "Say 'make install' to install the ABC system in $destroot."
  1545. X        ;;
  1546. X    esac
  1547. X    exit 0
  1548. X    ;;
  1549. Xesac
  1550. EOF
  1551. chmod +x 'abc/ch_all'
  1552. echo 'x - abc/ch_install'
  1553. sed 's/^X//' > 'abc/ch_install' << 'EOF'
  1554. X: 'Check if make install went allright.'
  1555. X
  1556. Xabcdir="$1"
  1557. Xlibdir="$2"
  1558. Xmandir="$3"
  1559. Xdestroot="$4"
  1560. X
  1561. Xerrors="no"
  1562. X
  1563. Xecho " "
  1564. X
  1565. Xfor f in abc abckeys
  1566. Xdo
  1567. X    if test ! -s $destroot$abcdir/$f
  1568. X    then
  1569. X        echo "*** Failed to install '$f' in $destroot$abcdir"
  1570. X        errors="yes"
  1571. X    fi
  1572. Xdone
  1573. X
  1574. Xfor f in abc.msg abc.hlp
  1575. Xdo
  1576. X    if test ! -s $destroot$libdir/$f
  1577. X    then
  1578. X        echo "*** Failed to install '$f' in $destroot$libdir"
  1579. X        errors="yes"
  1580. X    fi
  1581. Xdone
  1582. X
  1583. Xif test ! -s $destroot$mandir/abc.1
  1584. Xthen
  1585. X    echo "*** Failed to install 'abc.1' manual in $destroot$mandir"
  1586. X    errors="yes"
  1587. Xfi
  1588. X
  1589. Xcase $errors in
  1590. Xyes)
  1591. X    exit 1
  1592. X    ;;
  1593. Xno)
  1594. X    echo "The ABC system is installed."
  1595. X    case $destroot in
  1596. X    '')    echo "You can clean up with 'make clean'.";;
  1597. X    *)    echo "You can copy from $destroot to the target machine."
  1598. X        echo "To test ABC there also copy ./ex there,"
  1599. X        echo "and use ./ex/DoExamples and ./ex/TryEditor"
  1600. X        echo "to test the interpreter and the editor, respectively."
  1601. X        echo "If all is well, you can clean up here with 'make clean'."
  1602. X        ;;
  1603. X    esac
  1604. X    exit 0
  1605. X    ;;    
  1606. Xesac
  1607. EOF
  1608. chmod +x 'abc/ch_install'
  1609. echo 'x - abc/ch_clean'
  1610. sed 's/^X//' > 'abc/ch_clean' << 'EOF'
  1611. X: 'from make clean to make clobber'
  1612. X
  1613. Xecho " "
  1614. Xecho "You can clean up the results from 'make all' with 'make clobber'."
  1615. X
  1616. Xexit 0
  1617. EOF
  1618. chmod +x 'abc/ch_clean'
  1619. patch ./abc/bhdrs/bfil.h <<EOF
  1620. *** /ufs/timo/abcdist/abc/bhdrs/bfil.h    Thu Jan 25 12:54:30 1990
  1621. --- ./abc/bhdrs/bfil.h    Fri Jan  4 09:46:54 1991
  1622. ***************
  1623. *** 1,8 ****
  1624.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1625.   
  1626. ! /* MESSFILE and HELPFILE in ../?hdrs/dest.h. */
  1627.   #define KEYSFILE    "abc.key"
  1628.   
  1629.   #define PERMFILE    "perm.abc"
  1630.   #define SUGGFILE    "suggest.abc"
  1631. --- 1,8 ----
  1632.   /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1988. */
  1633.   
  1634. ! #define MESSFILE    "abc.msg"
  1635.   #define KEYSFILE    "abc.key"
  1636. + #define HELPFILE    "abc.hlp"
  1637.   
  1638.   #define PERMFILE    "perm.abc"
  1639.   #define SUGGFILE    "suggest.abc"
  1640. EOF
  1641. patch ./abc/bhdrs/bobj.h <<EOF
  1642. *** /ufs/timo/abcdist/abc/bhdrs/bobj.h    Thu Jan 25 12:54:30 1990
  1643. --- ./abc/bhdrs/bobj.h    Thu Jan  3 15:24:27 1991
  1644. ***************
  1645. *** 9,14 ****
  1646. --- 9,15 ----
  1647.   #define log2 b_log2
  1648.   #define pi b_pi
  1649.   #define random b_random
  1650. + #define remove b_remove
  1651.   
  1652.   /****************************** general ******************************/
  1653.   
  1654. ***************
  1655. *** 115,121 ****
  1656.   value root2();
  1657.   value log2();
  1658.   value pi();
  1659. ! value e();
  1660.   value nowisthetime();
  1661.   value exactly();
  1662.   bool exact();
  1663. --- 116,122 ----
  1664.   value root2();
  1665.   value log2();
  1666.   value pi();
  1667. ! value e_natural();
  1668.   value nowisthetime();
  1669.   value exactly();
  1670.   bool exact();
  1671. EOF
  1672. patch ./abc/bhdrs/release.h <<EOF
  1673. *** /ufs/timo/abcdist/abc/bhdrs/release.h    Thu Jan 25 12:54:30 1990
  1674. --- ./abc/bhdrs/release.h    Thu Jan  3 15:30:18 1991
  1675. ***************
  1676. *** 1 ****
  1677. ! #define RELEASE "1.02.01"
  1678. --- 1 ----
  1679. ! #define RELEASE "1.02.02"
  1680. EOF
  1681. patch ./abc/bint1/i1fun.c <<EOF
  1682. *** /ufs/timo/abcdist/abc/bint1/i1fun.c    Thu Jan 25 12:54:13 1990
  1683. --- ./abc/bint1/i1fun.c    Thu Jan  3 15:24:26 1991
  1684. ***************
  1685. *** 531,537 ****
  1686.   /* The rest of the mathematical functions */
  1687.   
  1688.   Visible value pi() { return (value) mk_approx(3.141592653589793238463, 0.0); }
  1689. ! Visible value e() { return (value) mk_approx(2.718281828459045235360, 0.0); }
  1690.   
  1691.   Hidden real over_two_pi(v) value v; {
  1692.       real two_pi = mk_approx(6.283185307179586476926, 0.0);
  1693. --- 531,537 ----
  1694.   /* The rest of the mathematical functions */
  1695.   
  1696.   Visible value pi() { return (value) mk_approx(3.141592653589793238463, 0.0); }
  1697. ! Visible value e_natural() { return (value) mk_approx(2.718281828459045235360, 0.0); }
  1698.   
  1699.   Hidden real over_two_pi(v) value v; {
  1700.       real two_pi = mk_approx(6.283185307179586476926, 0.0);
  1701. EOF
  1702. patch ./abc/bint3/i3fpr.c <<EOF
  1703. *** /ufs/timo/abcdist/abc/bint3/i3fpr.c    Thu Jan 25 12:54:20 1990
  1704. --- ./abc/bint3/i3fpr.c    Thu Jan  3 15:24:26 1991
  1705. ***************
  1706. *** 55,61 ****
  1707.       {S_NUMBER,    Dfd, Other, size2},
  1708.   
  1709.       {F_pi,        Zfd, Other, pi},
  1710. !     {F_e,        Zfd, Other, e},
  1711.       {F_now,        Zfd, Other, nowisthetime},
  1712.       
  1713.       {F_abs,        Mfd, Nume, absval},
  1714. --- 55,61 ----
  1715.       {S_NUMBER,    Dfd, Other, size2},
  1716.   
  1717.       {F_pi,        Zfd, Other, pi},
  1718. !     {F_e,        Zfd, Other, e_natural},
  1719.       {F_now,        Zfd, Other, nowisthetime},
  1720.       
  1721.       {F_abs,        Mfd, Nume, absval},
  1722. EOF
  1723. patch ./abc/ihdrs/i2par.h <<EOF
  1724. *** /ufs/timo/abcdist/abc/ihdrs/i2par.h    Thu Jan 25 12:54:32 1990
  1725. --- ./abc/ihdrs/i2par.h    Thu Jan  3 15:19:20 1991
  1726. ***************
  1727. *** 2,11 ****
  1728.   
  1729.   /***********************************************************************/
  1730.   
  1731. - #ifdef macintosh
  1732.   /* Avoid name conflict with standard header files: */
  1733.   #define compound b_compound
  1734. - #endif
  1735.   
  1736.   /* General parsing routines */
  1737.   
  1738. --- 2,9 ----
  1739. EOF
  1740. patch ./abc/uhdrs/os.h.gen <<EOF
  1741. *** /ufs/timo/abcdist/abc/uhdrs/os.h.gen    Thu Jan 25 12:54:43 1990
  1742. --- ./abc/uhdrs/os.h.gen    Thu Jan  3 16:38:30 1991
  1743. ***************
  1744. *** 66,72 ****
  1745. --- 66,74 ----
  1746.   #define HAS_FTIME    /* ftime() and <sys/timeb.h> available */
  1747.   #define HAS_PERROR    /* can use sys_errlist and sys_nerr (from perror(3)) */
  1748.   #define HAS_MKDIR    /* mkdir() and rmdir() available */
  1749. + /* define either one of the next two, or neither: */
  1750.   #define HAS_GETWD    /* getwd() available */
  1751. + #undef  HAS_GETCWD    /* getcwd() available instead */
  1752.   #define HAS_RENAME    /* rename() available */
  1753.   #define HAS_SELECT    /* 4.2 BSD select() system call available */
  1754.   #define HAS_READDIR    /* Berkeley style directory reading routines */
  1755. EOF
  1756. patch ./abc/unix/u1file.c <<EOF
  1757. *** /ufs/timo/abcdist/abc/unix/u1file.c    Thu Jan 25 12:54:26 1990
  1758. --- ./abc/unix/u1file.c    Thu Jan  3 16:35:54 1991
  1759. ***************
  1760. *** 9,16 ****
  1761.   extern char *getwd();
  1762.   
  1763.   Visible char *curdir() {
  1764. !     static char buffer[SIZE_PATH];
  1765.       return getwd(buffer);
  1766.   }
  1767.   
  1768.   Hidden string searchfile(base, abclib) string base; string abclib; {
  1769. --- 9,22 ----
  1770.   extern char *getwd();
  1771.   
  1772.   Visible char *curdir() {
  1773. !     static char buffer[1024];
  1774. ! #ifdef HAS_GETCWD
  1775. !     char *getcwd();
  1776. !     return getcwd(buffer, 1024);
  1777. ! #else
  1778. !     char *getwd();
  1779.       return getwd(buffer);
  1780. + #endif
  1781.   }
  1782.   
  1783.   Hidden string searchfile(base, abclib) string base; string abclib; {
  1784. EOF
  1785. patch ./abc/unix/u1os.c <<EOF
  1786. *** /ufs/timo/abcdist/abc/unix/u1os.c    Thu Jan 25 12:54:26 1990
  1787. --- ./abc/unix/u1os.c    Thu Jan  3 16:35:54 1991
  1788. ***************
  1789. *** 16,22 ****
  1790. --- 16,24 ----
  1791.   
  1792.   #endif /* !NDEBUG */
  1793.   
  1794. + #ifndef HAS_GETCWD
  1795.   #ifndef HAS_GETWD
  1796. + /* neither getwd, nor getcwd provided; define our own: */
  1797.   
  1798.   /* getwd - get working directory */
  1799.   
  1800. ***************
  1801. *** 37,42 ****
  1802. --- 39,45 ----
  1803.           return (char*) NULL;
  1804.   }
  1805.   
  1806. + #endif /* !HAS_GETCWD */
  1807.   #endif /* !HAS_GETWD */
  1808.   
  1809.   #ifndef HAS_RENAME
  1810. EOF
  1811. patch ./abc/doc/BugReport <<EOF
  1812. *** abc.1.02.01/doc/BugReport    Thu Jan 25 12:54:44 1990
  1813. --- abc/doc/BugReport    Fri Jan  4 21:13:31 1991
  1814. ***************
  1815. *** 19,25 ****
  1816.   Operating System:  O 4.3 BSD   O Version 7   O System V   O other: .......
  1817.   
  1818.   ==========================================================================
  1819. ! ABC Release 1.02.01.
  1820.   ==========================================================================
  1821.   
  1822.   FAULTY PROGRAM:
  1823. --- 19,25 ----
  1824.   Operating System:  O 4.3 BSD   O Version 7   O System V   O other: .......
  1825.   
  1826.   ==========================================================================
  1827. ! ABC Release 1.02.02.
  1828.   ==========================================================================
  1829.   
  1830.   FAULTY PROGRAM:
  1831. EOF
  1832. echo 'Second Authors patch for ABC system (bugfixes) complete.'
  1833. exit 0
  1834.  
  1835. exit 0 # Just in case...
  1836.