[1fb7bae] | 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>
|
---|
[be00729f] | 43 | <!--
|
---|
[a36bd4f] | 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 > bc/fix-libmath_h << "EOF"
|
---|
| 48 | #! /bin/bash
|
---|
| 49 | sed -e '1 s/^/{"/' \
|
---|
| 50 | -e 's/$/",/' \
|
---|
| 51 | -e '2,$ s/^/"/' \
|
---|
| 52 | -e '$ d' \
|
---|
| 53 | -i libmath.h
|
---|
| 54 |
|
---|
| 55 | sed -e '$ s/$/0}/' \
|
---|
| 56 | -i libmath.h
|
---|
| 57 | EOF</userinput></screen>
|
---|
[70e3330] | 58 |
|
---|
[18f4298] | 59 | <para>Create temporary symbolic links so the package can find
|
---|
[1e472fb] | 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 |
|
---|
[18f4298] | 65 | <screen><userinput remap="pre">ln -sv /tools/lib/libncursesw.so.6 /usr/lib/libncursesw.so.6
|
---|
[8262e52] | 66 | ln -sfv libncursesw.so.6 /usr/lib/libncurses.so</userinput></screen>
|
---|
[18f4298] | 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/: ;; # &/' configure</userinput></screen>
|
---|
[be00729f] | 72 | -->
|
---|
[1fb7bae] | 73 | <para>Prepare Bc for compilation:</para>
|
---|
[be00729f] | 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 | <screen><userinput remap="configure">PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3</userinput></screen>
|
---|
[1fb7bae] | 81 |
|
---|
| 82 | <variablelist>
|
---|
| 83 | <title>The meaning of the configure options:</title>
|
---|
[be00729f] | 84 | <!--
|
---|
[1fb7bae] | 85 | <varlistentry>
|
---|
[be00729f] | 86 | <term><parameter>- -with-readline</parameter></term>
|
---|
[1fb7bae] | 87 | <listitem>
|
---|
| 88 | <para>This option tells Bc to use the <filename
|
---|
| 89 | class="libraryfile">readline</filename> library that is already
|
---|
| 90 | installed on the system rather than using its own readline
|
---|
| 91 | version.</para>
|
---|
| 92 | </listitem>
|
---|
| 93 | </varlistentry>
|
---|
[be00729f] | 94 | -->
|
---|
| 95 | <varlistentry>
|
---|
| 96 | <term><parameter>CC=gcc CFLAGS="-std=c99"</parameter></term>
|
---|
| 97 | <listitem>
|
---|
| 98 | <para>These parameters specify the compiler and C standard to use.</para>
|
---|
| 99 | </listitem>
|
---|
| 100 | </varlistentry>
|
---|
[1fb7bae] | 101 |
|
---|
[be00729f] | 102 | <varlistentry>
|
---|
| 103 | <term><parameter>-O3</parameter></term>
|
---|
| 104 | <listitem>
|
---|
| 105 | <para>Specify the optimization to use.</para>
|
---|
| 106 | </listitem>
|
---|
| 107 | </varlistentry>
|
---|
| 108 |
|
---|
| 109 | <varlistentry>
|
---|
| 110 | <term><parameter>-G</parameter></term>
|
---|
| 111 | <listitem>
|
---|
| 112 | <para>Omit parts of the test suite that won't work
|
---|
| 113 | without a GNU bc present.</para>
|
---|
| 114 | </listitem>
|
---|
| 115 | </varlistentry>
|
---|
[1fb7bae] | 116 | </variablelist>
|
---|
| 117 |
|
---|
| 118 | <para>Compile the package:</para>
|
---|
| 119 |
|
---|
[e97fa92] | 120 | <screen><userinput remap="make">make</userinput></screen>
|
---|
[be00729f] | 121 | <!--
|
---|
[1fb7bae] | 122 | <para>To test bc, run the commands below. There is quite a bit of output,
|
---|
| 123 | so you may want to redirect it to a file. There are a very small percentage
|
---|
[edbeeb5] | 124 | of tests (10 of 12,144) that will indicate a round off error at the last
|
---|
[1fb7bae] | 125 | digit.</para>
|
---|
| 126 |
|
---|
| 127 | <screen><userinput remap="test">echo "quit" | ./bc/bc -l Test/checklib.b</userinput></screen>
|
---|
[be00729f] | 128 | -->
|
---|
| 129 |
|
---|
| 130 | <para>To test bc, run:</para>
|
---|
| 131 |
|
---|
| 132 | <screen><userinput remap="test">make test</userinput></screen>
|
---|
| 133 |
|
---|
[1fb7bae] | 134 |
|
---|
| 135 | <para>Install the package:</para>
|
---|
| 136 |
|
---|
| 137 | <screen><userinput remap="install">make install</userinput></screen>
|
---|
| 138 |
|
---|
| 139 | </sect2>
|
---|
| 140 |
|
---|
| 141 | <sect2 id="contents-bc" role="content">
|
---|
| 142 | <title>Contents of Bc</title>
|
---|
| 143 |
|
---|
| 144 | <segmentedlist>
|
---|
| 145 | <segtitle>Installed programs</segtitle>
|
---|
| 146 |
|
---|
| 147 | <seglistitem>
|
---|
| 148 | <seg>bc and dc</seg>
|
---|
| 149 | </seglistitem>
|
---|
| 150 | </segmentedlist>
|
---|
| 151 |
|
---|
| 152 | <variablelist>
|
---|
| 153 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 154 | <?dbfo list-presentation="list"?>
|
---|
| 155 | <?dbhtml list-presentation="table"?>
|
---|
| 156 |
|
---|
| 157 | <varlistentry id="bc">
|
---|
| 158 | <term><command>bc</command></term>
|
---|
| 159 | <listitem>
|
---|
[0d84af1] | 160 | <para>A command line calculator</para>
|
---|
[1fb7bae] | 161 | <indexterm zone="ch-system-bc bc">
|
---|
| 162 | <primary sortas="b-bc">bc</primary>
|
---|
| 163 | </indexterm>
|
---|
| 164 | </listitem>
|
---|
| 165 | </varlistentry>
|
---|
| 166 |
|
---|
| 167 | <varlistentry id="dc">
|
---|
| 168 | <term><command>dc</command></term>
|
---|
| 169 | <listitem>
|
---|
[0d84af1] | 170 | <para>A reverse-polish command line calculator</para>
|
---|
[1fb7bae] | 171 | <indexterm zone="ch-system-bc dc">
|
---|
| 172 | <primary sortas="b-dc">dc</primary>
|
---|
| 173 | </indexterm>
|
---|
| 174 | </listitem>
|
---|
| 175 | </varlistentry>
|
---|
| 176 |
|
---|
| 177 | </variablelist>
|
---|
| 178 |
|
---|
| 179 | </sect2>
|
---|
| 180 |
|
---|
| 181 | </sect1>
|
---|