source: chapter06/bc.xml@ 18f4298

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 18f4298 was 18f4298, checked in by Bruce Dubbs <bdubbs@…>, 7 years ago

Fies for bc in the early LFS environment

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

  • Property mode set to 100644
File size: 4.4 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>Create temporary symbolic links so the package can find
60 the readline library and confirm that its required libncurses
61 library is available. Even though the libraries are in /tools/lib
62 at this point, the system will use /usr/lib at the end of
63 this chapter.</para>
64
65<screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
66ln -sfv libncurses.so.6 /usr/lib/libncurses.so</userinput></screen>
67
68 <para>Fix an issue in <command>configure</command> due to missing
69 files in the early stages of LFS:</para>
70
71<screen><userinput remap="pre">sed -i -e '/flex/s/as_fn_error/: ;; # &amp;/' configure</userinput></screen>
72
73 <para>Prepare Bc for compilation:</para>
74
75<screen><userinput remap="configure">./configure --prefix=/usr \
76 --with-readline \
77 --mandir=/usr/share/man \
78 --infodir=/usr/share/info</userinput></screen>
79
80 <variablelist>
81 <title>The meaning of the configure options:</title>
82
83 <varlistentry>
84 <term><parameter>--with-readline</parameter></term>
85 <listitem>
86 <para>This option tells Bc to use the <filename
87 class="libraryfile">readline</filename> library that is already
88 installed on the system rather than using its own readline
89 version.</para>
90 </listitem>
91 </varlistentry>
92
93 </variablelist>
94
95 <para>Compile the package:</para>
96
97<screen><userinput remap="make">make</userinput></screen>
98
99 <para>To test bc, run the commands below. There is quite a bit of output,
100 so you may want to redirect it to a file. There are a very small percentage
101 of tests (10 of 12,144) that will indicate a round off error at the last
102 digit.</para>
103
104<screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
105
106 <para>Install the package:</para>
107
108<screen><userinput remap="install">make install</userinput></screen>
109
110 </sect2>
111
112 <sect2 id="contents-bc" role="content">
113 <title>Contents of Bc</title>
114
115 <segmentedlist>
116 <segtitle>Installed programs</segtitle>
117
118 <seglistitem>
119 <seg>bc and dc</seg>
120 </seglistitem>
121 </segmentedlist>
122
123 <variablelist>
124 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
125 <?dbfo list-presentation="list"?>
126 <?dbhtml list-presentation="table"?>
127
128 <varlistentry id="bc">
129 <term><command>bc</command></term>
130 <listitem>
131 <para>is a command line calculator</para>
132 <indexterm zone="ch-system-bc bc">
133 <primary sortas="b-bc">bc</primary>
134 </indexterm>
135 </listitem>
136 </varlistentry>
137
138 <varlistentry id="dc">
139 <term><command>dc</command></term>
140 <listitem>
141 <para>is a reverse-polish command line calculator</para>
142 <indexterm zone="ch-system-bc dc">
143 <primary sortas="b-dc">dc</primary>
144 </indexterm>
145 </listitem>
146 </varlistentry>
147
148 </variablelist>
149
150 </sect2>
151
152</sect1>
Note: See TracBrowser for help on using the repository browser.