source: chapter06/bc.xml@ aac5eb8

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 8.1 8.1-rc1 8.1-rc2 8.2 8.2-rc1 8.3 8.3-rc1 8.3-rc2 8.4 8.4-rc1 9.0 9.0-rc1 9.1 9.1-rc1 cross-chap5 ml-11.0 multilib old-trunk trunk xry111/git-transition xry111/glibc-2.34 xry111/tester-nohack xry111/usr-move
Last change on this file since aac5eb8 was aac5eb8, checked in by Bruce Dubbs <bdubbs@…>, 5 years ago

Fix an error in bc-1.07

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11220 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 4.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="ch-system-bc" role="wrap">
9 <?dbhtml filename="bc.html"?>
10
11 <sect1info condition="script">
12 <productname>bc</productname>
13 <productnumber>&bc-version;</productnumber>
14 <address>&bc-url;</address>
15 </sect1info>
16
17 <title>Bc-&bc-version;</title>
18
19 <indexterm zone="ch-system-bc">
20 <primary sortas="a-Bc">Bc</primary>
21 </indexterm>
22
23 <sect2 role="package">
24 <title/>
25
26 <para>The Bc package contains an arbitrary precision numeric processing
27 language.</para>
28
29 <segmentedlist>
30 <segtitle>&buildtime;</segtitle>
31 <segtitle>&diskspace;</segtitle>
32
33 <seglistitem>
34 <seg>&bc-ch6-sbu;</seg>
35 <seg>&bc-ch6-du;</seg>
36 </seglistitem>
37 </segmentedlist>
38
39 </sect2>
40
41 <sect2 role="installation">
42 <title>Installation of Bc</title>
43
44 <para>First, change an internal script to use <command>sed</command> instead
45 of <command>ed</command>:</para>
46
47<screen><userinput remap="pre">cat &gt; bc/fix-libmath_h &lt;&lt; "EOF"
48#! /bin/bash
49sed -e '1 s/^/{"/' \
50 -e 's/$/",/' \
51 -e '2,$ s/^/"/' \
52 -e '$ d' \
53 -i libmath.h
54
55sed -e '$ s/$/0}/' \
56 -i libmath.h
57EOF</userinput></screen>
58
59 <para>Now fix an error in the code:</para>
60
61<screen><userinput remap="pre">sed -i "/return (' ')/s/' '/':'/" bc/execute.c</userinput></screen>
62
63
64 <para>Create temporary symbolic links so the package can find
65 the readline library and confirm that its required libncurses
66 library is available. Even though the libraries are in /tools/lib
67 at this point, the system will use /usr/lib at the end of
68 this chapter.</para>
69
70<screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
71ln -sfv libncurses.so.6 /usr/lib/libncurses.so</userinput></screen>
72
73 <para>Fix an issue in <command>configure</command> due to missing
74 files in the early stages of LFS:</para>
75
76<screen><userinput remap="pre">sed -i -e '/flex/s/as_fn_error/: ;; # &amp;/' configure</userinput></screen>
77
78 <para>Prepare Bc for compilation:</para>
79
80<screen><userinput remap="configure">./configure --prefix=/usr \
81 --with-readline \
82 --mandir=/usr/share/man \
83 --infodir=/usr/share/info</userinput></screen>
84
85 <variablelist>
86 <title>The meaning of the configure options:</title>
87
88 <varlistentry>
89 <term><parameter>--with-readline</parameter></term>
90 <listitem>
91 <para>This option tells Bc to use the <filename
92 class="libraryfile">readline</filename> library that is already
93 installed on the system rather than using its own readline
94 version.</para>
95 </listitem>
96 </varlistentry>
97
98 </variablelist>
99
100 <para>Compile the package:</para>
101
102<screen><userinput remap="make">make -j1</userinput></screen>
103
104 <para>To test bc, run the commands below. There is quite a bit of output,
105 so you may want to redirect it to a file. There are a very small percentage
106 of tests (10 of 12,144) that will indicate a round off error at the last
107 digit.</para>
108
109<screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
110
111 <para>Install the package:</para>
112
113<screen><userinput remap="install">make install</userinput></screen>
114
115 </sect2>
116
117 <sect2 id="contents-bc" role="content">
118 <title>Contents of Bc</title>
119
120 <segmentedlist>
121 <segtitle>Installed programs</segtitle>
122
123 <seglistitem>
124 <seg>bc and dc</seg>
125 </seglistitem>
126 </segmentedlist>
127
128 <variablelist>
129 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
130 <?dbfo list-presentation="list"?>
131 <?dbhtml list-presentation="table"?>
132
133 <varlistentry id="bc">
134 <term><command>bc</command></term>
135 <listitem>
136 <para>is a command line calculator</para>
137 <indexterm zone="ch-system-bc bc">
138 <primary sortas="b-bc">bc</primary>
139 </indexterm>
140 </listitem>
141 </varlistentry>
142
143 <varlistentry id="dc">
144 <term><command>dc</command></term>
145 <listitem>
146 <para>is a reverse-polish command line calculator</para>
147 <indexterm zone="ch-system-bc dc">
148 <primary sortas="b-dc">dc</primary>
149 </indexterm>
150 </listitem>
151 </varlistentry>
152
153 </variablelist>
154
155 </sect2>
156
157</sect1>
Note: See TracBrowser for help on using the repository browser.