[lfs-dev] bc ready

Gavin Howard gavin.d.howard at gmail.com
Sun Jul 14 20:32:25 PDT 2019

> I've added your version of bc to LFS.  I have one minor issue.  When the
> tests are run, there is no indication of the results.  There is a long
> list of activities, but I assume that a lack of failure notices means
> success.  A notice of how many tests passed and/or failed would be nice.
>    -- Bruce

I have made it so the test suite prints "All bc tests passed", as well
as "pass" after every test, if a test is passed. The change is in
version 2.1.1 (https://github.com/gavinhoward/bc/releases/tag/2.1.1).

Unfortunately, and this is a weakness in my custom test suite, it will
quit as soon as the first test fails. Maybe someday I can fix that,
but for now, it should work for Linux from Scratch.

The new instructions:

<<Begin instructions>>
Prepare Bc for compilation:

    PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3

The meaning of the configure options:

* PREFIX=/usr
  Like --prefix in other packages.
* CC=gcc
  Set the C compiler. This package defaults to c99, which doesn't exist.
* CFLAGS="-std=c99"
  Sets the C standard that gcc uses to be C99.
* -G
  Disables tests in the test suite that requires another bc to
generate results for.
* -O3
  Enables optimization. This bc gets an order of magnitude more
performance from optimizations, and these optimizations have been

Compile the package:


If desired, test bc:

    make test_bc

All of the tests have passed if you see the following line near the
end of the output:

    All bc tests passed.

If you do not see that output, the test suite failed.

Install the package:

    make install
<<End instructions>>

I realized that the instruction to run the test suite should be `make
test_bc` because otherwise, dc is tested as well.

Does this help? I can make more changes if it won't.

Gavin Howard

More information about the lfs-dev mailing list