home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / linux / 6532 < prev    next >
Encoding:
Text File  |  1992-07-23  |  2.9 KB  |  129 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!world!jrs
  3. From: jrs@world.std.com (Rick Sladkey)
  4. Subject: Re: Anyone done bc?
  5. In-Reply-To: davidsen@ariel.crd.GE.COM's message of 22 Jul 92 20:18:24 GMT
  6. Message-ID: <JRS.92Jul22222131@lepton.world.std.com>
  7. Lines: 116
  8. Sender: jrs@world.std.com (Rick Sladkey)
  9. Organization: The World
  10. References: <1992Jul22.201824.23946@crd.ge.com>
  11. Date: Thu, 23 Jul 1992 02:21:31 GMT
  12.  
  13. >>>>> On 22 Jul 92 20:18:24 GMT, davidsen@ariel.crd.GE.COM (william E
  14. >>>>> Davidsen) said:
  15.  
  16. bill> Last night using linux I realized how much I use bc. Has anyone done a
  17. bill> port, or is there even a free version? Seems there was a GNU version,
  18. bill> but it may only have been dc.
  19.  
  20. There is a GNU version available from prep and the others as:
  21.  
  22. prep.mit.edu:/pub/gnu/bc-1.02.tar.Z
  23.  
  24. You may want bison and flex although these are not strictly necessary.
  25. The original distribution requires ed but Linux has none so I used awk.
  26.  
  27. Here is a Linux patch for bc-1.06.tar.Z:
  28. -----
  29. diff -rcN ../bc-1.02/Makefile ./Makefile
  30. *** ../bc-1.02/Makefile    Wed Mar  4 18:21:47 1992
  31. --- ./Makefile    Wed Jul 22 21:35:21 1992
  32. ***************
  33. *** 6,12 ****
  34.   #
  35.   #  LIBDIR and BINDIR are where bc and libmath.b will be put.
  36.   #
  37. ! PREFIX = /usr/local
  38.   LIBDIR = $(PREFIX)/lib
  39.   BINDIR = $(PREFIX)/bin
  40.   MANDIR = $(PREFIX)/man/man1
  41. --- 6,12 ----
  42.   #
  43.   #  LIBDIR and BINDIR are where bc and libmath.b will be put.
  44.   #
  45. ! PREFIX = /usr
  46.   LIBDIR = $(PREFIX)/lib
  47.   BINDIR = $(PREFIX)/bin
  48.   MANDIR = $(PREFIX)/man/man1
  49. ***************
  50. *** 23,33 ****
  51.   # Programs definitions for use by make.
  52.   #
  53.   SHELL = /bin/sh
  54. ! YACC = yacc
  55. ! #YACC = bison -y
  56.   LEX = flex -I8
  57.   #LEX = lex
  58. ! CC = cc
  59.   UUENCODE = uue
  60.   MAKE = make
  61.   #
  62. --- 23,33 ----
  63.   # Programs definitions for use by make.
  64.   #
  65.   SHELL = /bin/sh
  66. ! #YACC = yacc
  67. ! YACC = bison -y
  68.   LEX = flex -I8
  69.   #LEX = lex
  70. ! CC = gcc
  71.   UUENCODE = uue
  72.   MAKE = make
  73.   #
  74. ***************
  75. *** 37,43 ****
  76.   #  README file for more details.
  77.   #
  78.   O=o
  79. ! CFLAGS = -O -D_POSIX_SOURCE
  80.   LDFLAGS = 
  81.   #
  82.   # For the PC version of MINIX (K&R compiler), use the following lines.
  83. --- 37,43 ----
  84.   #  README file for more details.
  85.   #
  86.   O=o
  87. ! CFLAGS = -O2 -D_POSIX_SOURCE
  88.   LDFLAGS = 
  89.   #
  90.   # For the PC version of MINIX (K&R compiler), use the following lines.
  91. diff -rcN ../bc-1.02/config.h ./config.h
  92. *** ../bc-1.02/config.h
  93. --- ./config.h    Wed Jul 22 21:33:46 1992
  94. ***************
  95. *** 0 ****
  96. --- 1 ----
  97. + /* config.h */
  98. diff -rcN ../bc-1.02/fix_math.h ./fix_math.h
  99. *** ../bc-1.02/fix_math.h    Fri Nov  1 21:19:55 1991
  100. --- ./fix_math.h    Wed Jul 22 21:53:39 1992
  101. ***************
  102. *** 1,8 ****
  103. ! ed math.h <<EOS-EOS
  104. ! 1,1s/^/"/
  105. ! 1,\$s/\$/\\\\/
  106. ! \$,\$d
  107. ! \$,\$s/\\\\\$/"/
  108. ! w
  109. ! q
  110. ! EOS-EOS
  111. --- 1,14 ----
  112. ! awk '
  113. ! { line[++n] = $0 }
  114. ! END {
  115. !     printf "\""
  116. !     for (i = 1; i < n; i++) {
  117. !         printf "%s", line[i]
  118. !         if (i < n - 1)
  119. !             printf "\\\n"
  120. !         else
  121. !             printf "\"\n"
  122. !     }
  123. ! }
  124. ! ' <math.h >new.math.h
  125. ! mv new.math.h math.h
  126. --
  127. Rick Sladkey
  128. jrs@world.std.com
  129.