Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Feb 2021 21:15:18 GMT
From:      Stefan Eßer <se@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 106efdb060ae - stable/13 - Vendor import of Gavin Howard's bc version 3.2.6
Message-ID:  <202102052115.115LFIer089187@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by se:

URL: https://cgit.FreeBSD.org/src/commit/?id=106efdb060ae523a88caf5ddc3516500cf5b1d64

commit 106efdb060ae523a88caf5ddc3516500cf5b1d64
Author:     Stefan Eßer <se@FreeBSD.org>
AuthorDate: 2021-01-31 19:56:48 +0000
Commit:     Stefan Eßer <se@FreeBSD.org>
CommitDate: 2021-02-05 21:01:25 +0000

    Vendor import of Gavin Howard's bc version 3.2.6
    
    (cherry picked from commit 47a52dc4d48f259ab7d9f9ba6b65f4f2331a22dc)
    
    Second attempt after revert of a previous commit that affected files
    with similar names in unrelated directories.
    
    Thanks go to Martin Birgmaier for reporting the issue and identifying
    the cause of git getting confused: files from the root of the vendor
    files were associated with files in the FreeBSD base root directory.
    
    Martin Birgmaier points out that to make this cherry-pick succeed,
    the option -Xsubtree=contrib/bc has to be passed to prevent files
    outside that path to be considered.
---
 contrib/bc/.gitignore                              |   9 +
 contrib/bc/LICENSE.md                              |  52 ++-
 contrib/bc/Makefile.in                             | 122 ++++--
 contrib/bc/NEWS.md                                 |  35 ++
 contrib/bc/NOTICE.md                               |   2 +-
 contrib/bc/README.md                               |   1 +
 contrib/bc/configure.sh                            | 348 +++++++++++++++---
 contrib/bc/exec-install.sh                         |   2 +-
 contrib/bc/functions.sh                            |  90 +++--
 contrib/bc/gen/bc_help.txt                         |   2 +-
 contrib/bc/gen/dc_help.txt                         |   2 +-
 contrib/bc/gen/lib.bc                              |   2 +-
 contrib/bc/gen/lib2.bc                             |   2 +-
 contrib/bc/gen/strgen.c                            |   4 +-
 contrib/bc/gen/strgen.sh                           |   4 +-
 contrib/bc/include/args.h                          |   2 +-
 contrib/bc/include/bc.h                            |   2 +-
 contrib/bc/include/bcl.h                           |   2 +-
 contrib/bc/include/dc.h                            |   2 +-
 contrib/bc/include/file.h                          |   2 +-
 contrib/bc/include/history.h                       |   2 +-
 contrib/bc/include/lang.h                          |   2 +-
 contrib/bc/include/lex.h                           |   2 +-
 contrib/bc/include/library.h                       |   2 +-
 contrib/bc/include/num.h                           |   4 +-
 contrib/bc/include/opt.h                           |   2 +-
 contrib/bc/include/parse.h                         |   2 +-
 contrib/bc/include/program.h                       |   2 +-
 contrib/bc/include/rand.h                          |  31 +-
 contrib/bc/include/read.h                          |   2 +-
 contrib/bc/include/status.h                        |  14 +-
 contrib/bc/include/vector.h                        |   3 +-
 contrib/bc/include/vm.h                            |  19 +-
 contrib/bc/karatsuba.py                            |   2 +-
 contrib/bc/link.sh                                 |   2 +-
 contrib/bc/locale_install.sh                       |   2 +-
 contrib/bc/locale_uninstall.sh                     |   2 +-
 contrib/bc/locales/de_DE.ISO8859-1.msg             |   2 +-
 contrib/bc/locales/de_DE.UTF-8.msg                 |   2 +-
 contrib/bc/locales/en_US.msg                       |   2 +-
 contrib/bc/locales/es_ES.ISO8859-1.msg             |   2 +-
 contrib/bc/locales/es_ES.UTF-8.msg                 |   2 +-
 contrib/bc/locales/fr_FR.ISO8859-1.msg             |   2 +-
 contrib/bc/locales/fr_FR.UTF-8.msg                 |   2 +-
 contrib/bc/locales/ja_JP.UTF-8.msg                 |   2 +-
 contrib/bc/locales/ja_JP.eucJP.msg                 |   2 +-
 contrib/bc/locales/nl_NL.ISO8859-1.msg             |   2 +-
 contrib/bc/locales/nl_NL.UTF-8.msg                 |   2 +-
 contrib/bc/locales/pl_PL.ISO8859-2.msg             |   2 +-
 contrib/bc/locales/pl_PL.UTF-8.msg                 |   2 +-
 contrib/bc/locales/pt_PT.ISO8859-1.msg             |   2 +-
 contrib/bc/locales/pt_PT.UTF-8.msg                 |   2 +-
 contrib/bc/locales/ru_RU.CP1251.msg                |   2 +-
 contrib/bc/locales/ru_RU.CP866.msg                 |   2 +-
 contrib/bc/locales/ru_RU.ISO8859-5.msg             |   2 +-
 contrib/bc/locales/ru_RU.KOI8-R.msg                |   2 +-
 contrib/bc/locales/ru_RU.UTF-8.msg                 |   2 +-
 contrib/bc/locales/zh_CN.GB18030.msg               |   2 +-
 contrib/bc/locales/zh_CN.GB2312.msg                |   2 +-
 contrib/bc/locales/zh_CN.GBK.msg                   |   2 +-
 contrib/bc/locales/zh_CN.UTF-8.msg                 |   2 +-
 contrib/bc/locales/zh_CN.eucCN.msg                 |   2 +-
 contrib/bc/manpage.sh                              |   2 +-
 contrib/bc/manuals/bc.1.md.in                      |   7 +-
 contrib/bc/manuals/bc/A.1                          |   8 +-
 contrib/bc/manuals/bc/A.1.md                       |   7 +-
 contrib/bc/manuals/bc/E.1                          |   4 +-
 contrib/bc/manuals/bc/E.1.md                       |   2 +-
 contrib/bc/manuals/bc/EH.1                         |   4 +-
 contrib/bc/manuals/bc/EH.1.md                      |   2 +-
 contrib/bc/manuals/bc/EHN.1                        |   4 +-
 contrib/bc/manuals/bc/EHN.1.md                     |   2 +-
 contrib/bc/manuals/bc/EHNP.1                       |   4 +-
 contrib/bc/manuals/bc/EHNP.1.md                    |   2 +-
 contrib/bc/manuals/bc/EHP.1                        |   4 +-
 contrib/bc/manuals/bc/EHP.1.md                     |   2 +-
 contrib/bc/manuals/bc/EN.1                         |   4 +-
 contrib/bc/manuals/bc/EN.1.md                      |   2 +-
 contrib/bc/manuals/bc/ENP.1                        |   4 +-
 contrib/bc/manuals/bc/ENP.1.md                     |   2 +-
 contrib/bc/manuals/bc/EP.1                         |   4 +-
 contrib/bc/manuals/bc/EP.1.md                      |   2 +-
 contrib/bc/manuals/bc/H.1                          |   8 +-
 contrib/bc/manuals/bc/H.1.md                       |   7 +-
 contrib/bc/manuals/bc/HN.1                         |   8 +-
 contrib/bc/manuals/bc/HN.1.md                      |   7 +-
 contrib/bc/manuals/bc/HNP.1                        |   8 +-
 contrib/bc/manuals/bc/HNP.1.md                     |   7 +-
 contrib/bc/manuals/bc/HP.1                         |   8 +-
 contrib/bc/manuals/bc/HP.1.md                      |   7 +-
 contrib/bc/manuals/bc/N.1                          |   8 +-
 contrib/bc/manuals/bc/N.1.md                       |   7 +-
 contrib/bc/manuals/bc/NP.1                         |   8 +-
 contrib/bc/manuals/bc/NP.1.md                      |   7 +-
 contrib/bc/manuals/bc/P.1                          |   8 +-
 contrib/bc/manuals/bc/P.1.md                       |   7 +-
 contrib/bc/manuals/bcl.3                           |   4 +-
 contrib/bc/manuals/bcl.3.md                        |   2 +-
 contrib/bc/manuals/dc.1.md.in                      |   7 +-
 contrib/bc/manuals/dc/A.1                          |  10 +-
 contrib/bc/manuals/dc/A.1.md                       |   7 +-
 contrib/bc/manuals/dc/E.1                          |   4 +-
 contrib/bc/manuals/dc/E.1.md                       |   2 +-
 contrib/bc/manuals/dc/EH.1                         |   4 +-
 contrib/bc/manuals/dc/EH.1.md                      |   2 +-
 contrib/bc/manuals/dc/EHN.1                        |   4 +-
 contrib/bc/manuals/dc/EHN.1.md                     |   2 +-
 contrib/bc/manuals/dc/EHNP.1                       |   4 +-
 contrib/bc/manuals/dc/EHNP.1.md                    |   2 +-
 contrib/bc/manuals/dc/EHP.1                        |   4 +-
 contrib/bc/manuals/dc/EHP.1.md                     |   2 +-
 contrib/bc/manuals/dc/EN.1                         |   4 +-
 contrib/bc/manuals/dc/EN.1.md                      |   2 +-
 contrib/bc/manuals/dc/ENP.1                        |   4 +-
 contrib/bc/manuals/dc/ENP.1.md                     |   2 +-
 contrib/bc/manuals/dc/EP.1                         |   4 +-
 contrib/bc/manuals/dc/EP.1.md                      |   2 +-
 contrib/bc/manuals/dc/H.1                          |  10 +-
 contrib/bc/manuals/dc/H.1.md                       |   7 +-
 contrib/bc/manuals/dc/HN.1                         |  10 +-
 contrib/bc/manuals/dc/HN.1.md                      |   7 +-
 contrib/bc/manuals/dc/HNP.1                        |  10 +-
 contrib/bc/manuals/dc/HNP.1.md                     |   7 +-
 contrib/bc/manuals/dc/HP.1                         |  10 +-
 contrib/bc/manuals/dc/HP.1.md                      |   7 +-
 contrib/bc/manuals/dc/N.1                          |  10 +-
 contrib/bc/manuals/dc/N.1.md                       |   7 +-
 contrib/bc/manuals/dc/NP.1                         |  10 +-
 contrib/bc/manuals/dc/NP.1.md                      |   7 +-
 contrib/bc/manuals/dc/P.1                          |  10 +-
 contrib/bc/manuals/dc/P.1.md                       |   7 +-
 contrib/bc/manuals/header.txt                      |   2 +-
 contrib/bc/manuals/header_bc.txt                   |   2 +-
 contrib/bc/manuals/header_bcl.txt                  |   2 +-
 contrib/bc/manuals/header_dc.txt                   |   2 +-
 contrib/bc/release.sh                              |  18 +-
 contrib/bc/src/args.c                              |   2 +-
 contrib/bc/src/bc.c                                |   2 +-
 contrib/bc/src/bc_lex.c                            |   2 +-
 contrib/bc/src/bc_parse.c                          |   2 +-
 contrib/bc/src/data.c                              |   4 +-
 contrib/bc/src/dc.c                                |   2 +-
 contrib/bc/src/dc_lex.c                            |   6 +-
 contrib/bc/src/dc_parse.c                          |   2 +-
 contrib/bc/src/file.c                              |   4 +-
 contrib/bc/src/history.c                           |  15 +-
 contrib/bc/src/lang.c                              |  14 +-
 contrib/bc/src/lex.c                               |   4 +-
 contrib/bc/src/library.c                           |  12 +-
 contrib/bc/src/main.c                              |  13 +-
 contrib/bc/src/num.c                               |  10 +-
 contrib/bc/src/opt.c                               |   2 +-
 contrib/bc/src/parse.c                             |   8 +-
 contrib/bc/src/program.c                           |  31 +-
 contrib/bc/src/rand.c                              |  42 +--
 contrib/bc/src/read.c                              |   6 +-
 contrib/bc/src/vector.c                            |   8 +-
 contrib/bc/src/vm.c                                |  86 ++++-
 contrib/bc/tests/afl.py                            |  22 +-
 contrib/bc/tests/all.sh                            | 191 +---------
 contrib/bc/tests/bc/all.txt                        |   6 +-
 contrib/bc/tests/bc/scripts/all.txt                |  15 +
 contrib/bc/tests/bc/timeconst.sh                   |   9 +-
 contrib/bc/tests/bcl.c                             |   2 +-
 contrib/bc/tests/dc/errors/30.txt                  |   1 +
 contrib/bc/tests/dc/errors/31.txt                  |   1 +
 contrib/bc/tests/dc/scripts/all.txt                |   9 +
 contrib/bc/tests/diff.sh                           |  51 +++
 contrib/bc/tests/errors.sh                         |  20 +-
 contrib/bc/tests/extra_required.txt                |   7 +
 contrib/bc/tests/fuzzing/bc.dict                   |  68 ++++
 contrib/bc/tests/fuzzing/bc_inputs1/abs.txt        |   7 +
 contrib/bc/tests/fuzzing/bc_inputs1/add.txt        | 146 ++++++++
 contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt |  26 ++
 contrib/bc/tests/fuzzing/bc_inputs1/array.bc       |  60 +++
 contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt     |  10 +
 .../bc/tests/fuzzing/bc_inputs1/assignments.txt    | 122 ++++++
 contrib/bc/tests/fuzzing/bc_inputs1/basic.txt      |   7 +
 contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt    | 184 ++++++++++
 contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt     |  44 +++
 contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt    |  35 ++
 contrib/bc/tests/fuzzing/bc_inputs1/divide.txt     |  31 ++
 .../bc/tests/fuzzing/bc_inputs1/engineering.txt    |  19 +
 contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt   |  22 ++
 contrib/bc/tests/fuzzing/bc_inputs1/functions.bc   |   7 +
 contrib/bc/tests/fuzzing/bc_inputs1/functions.txt  |  13 +
 contrib/bc/tests/fuzzing/bc_inputs1/globals.txt    |  21 ++
 contrib/bc/tests/fuzzing/bc_inputs1/len.bc         |  48 +++
 contrib/bc/tests/fuzzing/bc_inputs1/length.txt     |  59 +++
 contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt      |   4 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt      |   4 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt       |  15 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt       |   6 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt       |  10 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt       |   2 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt       |   5 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt       |  12 +
 contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt       |   3 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt      |   1 +
 contrib/bc/tests/fuzzing/bc_inputs2/log.txt        |  22 ++
 contrib/bc/tests/fuzzing/bc_inputs2/misc.txt       |  13 +
 contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt      |  76 ++++
 contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt      | 110 ++++++
 contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt      |  12 +
 contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt    |  69 ++++
 contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt   |  40 ++
 contrib/bc/tests/fuzzing/bc_inputs2/pi.txt         |   4 +
 contrib/bc/tests/fuzzing/bc_inputs2/places.txt     |  19 +
 contrib/bc/tests/fuzzing/bc_inputs2/power.txt      |  44 +++
 contrib/bc/tests/fuzzing/bc_inputs2/print2.txt     | 194 ++++++++++
 contrib/bc/tests/fuzzing/bc_inputs2/references.bc  | 408 +++++++++++++++++++++
 contrib/bc/tests/fuzzing/bc_inputs2/scale.txt      |  57 +++
 contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt |  51 +++
 contrib/bc/tests/fuzzing/bc_inputs2/shift.txt      | 281 ++++++++++++++
 contrib/bc/tests/fuzzing/bc_inputs2/sine.txt       | 207 +++++++++++
 contrib/bc/tests/fuzzing/bc_inputs3/01.txt         | 339 +++++++++++++++++
 contrib/bc/tests/fuzzing/bc_inputs3/02.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/03.txt         |   2 +
 contrib/bc/tests/fuzzing/bc_inputs3/04.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/05.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/06.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/07.txt         |   8 +
 contrib/bc/tests/fuzzing/bc_inputs3/08.txt         |   3 +
 contrib/bc/tests/fuzzing/bc_inputs3/09.txt         |  11 +
 contrib/bc/tests/fuzzing/bc_inputs3/10.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/11.txt         |  99 +++++
 contrib/bc/tests/fuzzing/bc_inputs3/12.txt         |   2 +
 contrib/bc/tests/fuzzing/bc_inputs3/13.txt         |  56 +++
 contrib/bc/tests/fuzzing/bc_inputs3/14.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/15.txt         |   3 +
 contrib/bc/tests/fuzzing/bc_inputs3/16.txt         |   1 +
 contrib/bc/tests/fuzzing/bc_inputs3/17.txt         |  11 +
 contrib/bc/tests/fuzzing/bc_inputs3/18.txt         |   3 +
 contrib/bc/tests/fuzzing/bc_inputs3/19.txt         |   5 +
 contrib/bc/tests/fuzzing/bc_inputs3/20.txt         |  51 +++
 contrib/bc/tests/fuzzing/bc_inputs3/21.txt         |  10 +
 contrib/bc/tests/fuzzing/bc_inputs3/22.txt         |   2 +
 contrib/bc/tests/fuzzing/bc_inputs3/23.txt         | Bin 0 -> 1024 bytes
 contrib/bc/tests/fuzzing/bc_inputs3/24.txt         |   4 +
 contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt       |  14 +
 contrib/bc/tests/fuzzing/bc_inputs3/strings.txt    |  12 +
 contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt   | 153 ++++++++
 contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt      |  15 +
 contrib/bc/tests/fuzzing/bc_inputs3/void.txt       |  20 +
 contrib/bc/tests/fuzzing/dc_inputs/01.txt          |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/02.txt          |   5 +
 contrib/bc/tests/fuzzing/dc_inputs/03.txt          |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/04.txt          |   9 +
 contrib/bc/tests/fuzzing/dc_inputs/05.txt          |   3 +
 contrib/bc/tests/fuzzing/dc_inputs/06.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/07.txt          |   3 +
 contrib/bc/tests/fuzzing/dc_inputs/08.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/09.txt          |   9 +
 contrib/bc/tests/fuzzing/dc_inputs/10.txt          |  11 +
 contrib/bc/tests/fuzzing/dc_inputs/11.txt          |   4 +
 contrib/bc/tests/fuzzing/dc_inputs/12.txt          |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/13.txt          |   7 +
 contrib/bc/tests/fuzzing/dc_inputs/14.txt          |   7 +
 contrib/bc/tests/fuzzing/dc_inputs/15.txt          |  11 +
 contrib/bc/tests/fuzzing/dc_inputs/16.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/17.txt          |  20 +
 contrib/bc/tests/fuzzing/dc_inputs/18.txt          |   3 +
 contrib/bc/tests/fuzzing/dc_inputs/19.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/20.txt          |   3 +
 contrib/bc/tests/fuzzing/dc_inputs/21.txt          |   5 +
 contrib/bc/tests/fuzzing/dc_inputs/22.txt          |  36 ++
 contrib/bc/tests/fuzzing/dc_inputs/23.txt          |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/24.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/25.txt          |   6 +
 contrib/bc/tests/fuzzing/dc_inputs/26.txt          | 155 ++++++++
 contrib/bc/tests/fuzzing/dc_inputs/27.txt          |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/28.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/29.txt          |  13 +
 contrib/bc/tests/fuzzing/dc_inputs/30.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/31.txt          |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/abs.txt         |   7 +
 contrib/bc/tests/fuzzing/dc_inputs/add.txt         |  33 ++
 contrib/bc/tests/fuzzing/dc_inputs/array.dc        |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/boolean.txt     |  80 ++++
 contrib/bc/tests/fuzzing/dc_inputs/decimal.txt     |  36 ++
 contrib/bc/tests/fuzzing/dc_inputs/divide.txt      |  33 ++
 contrib/bc/tests/fuzzing/dc_inputs/divmod.txt      |  64 ++++
 contrib/bc/tests/fuzzing/dc_inputs/else.dc         |   4 +
 contrib/bc/tests/fuzzing/dc_inputs/engineering.txt |  19 +
 contrib/bc/tests/fuzzing/dc_inputs/loop.dc         |   3 +
 contrib/bc/tests/fuzzing/dc_inputs/misc.txt        |   1 +
 contrib/bc/tests/fuzzing/dc_inputs/modexp.txt      | 103 ++++++
 contrib/bc/tests/fuzzing/dc_inputs/modulus.txt     |  70 ++++
 contrib/bc/tests/fuzzing/dc_inputs/multiply.txt    |  42 +++
 contrib/bc/tests/fuzzing/dc_inputs/places.txt      |  14 +
 contrib/bc/tests/fuzzing/dc_inputs/power.txt       |  36 ++
 contrib/bc/tests/fuzzing/dc_inputs/quit.dc         |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/scientific.txt  |  51 +++
 contrib/bc/tests/fuzzing/dc_inputs/shift.txt       |  42 +++
 contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt        |  14 +
 contrib/bc/tests/fuzzing/dc_inputs/stdin.txt       | 205 +++++++++++
 contrib/bc/tests/fuzzing/dc_inputs/stream.dc       |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/strings.txt     |  50 +++
 contrib/bc/tests/fuzzing/dc_inputs/subtract.txt    |  33 ++
 contrib/bc/tests/fuzzing/dc_inputs/trunc.txt       |  11 +
 contrib/bc/tests/fuzzing/dc_inputs/vars.txt        |   2 +
 contrib/bc/tests/fuzzing/dc_inputs/weird.dc        |   2 +
 contrib/bc/tests/other.sh                          | 271 ++++++++++++++
 contrib/bc/tests/radamsa.sh                        |   2 +-
 contrib/bc/tests/randmath.py                       |   2 +-
 contrib/bc/tests/read.sh                           |  23 +-
 contrib/bc/tests/script.sh                         |  26 +-
 contrib/bc/tests/scripts.sh                        |   9 +-
 contrib/bc/tests/stdin.sh                          |  23 +-
 contrib/bc/tests/test.sh                           |  32 +-
 320 files changed, 6246 insertions(+), 712 deletions(-)

diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore
index fb9bc5ab6aa2..5c2bbae866c0 100644
--- a/contrib/bc/.gitignore
+++ b/contrib/bc/.gitignore
@@ -34,6 +34,13 @@ config.mak
 timeconst.bc
 Makefile
 
+tests/fuzzing/bc_outputs1/*
+tests/fuzzing/bc_outputs2/*
+tests/fuzzing/bc_outputs3/*
+tests/fuzzing/dc_outputs/*
+tests/bc_outputs/*
+tests/dc_outputs/*
+
 .gdb_history
 
 # Ignore the generated test files
@@ -57,5 +64,7 @@ perf.data.old
 *.html
 *.profraw
 
+core.*
+
 cscope*.out
 tags
diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md
index 1681a053e0de..269e131cc81d 100644
--- a/contrib/bc/LICENSE.md
+++ b/contrib/bc/LICENSE.md
@@ -1,6 +1,6 @@
 # License
 
-Copyright (c) 2018-2020 Gavin D. Howard <yzena.tech@gmail.com>
+Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com>
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
@@ -31,7 +31,7 @@ copyrights and license:
 Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com><br>
 Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com><br>
 Copyright (c) 2018 rain-1 <rain1@openmailbox.org><br>
-Copyright (c) 2018-2020, Gavin D. Howard <yzena.tech@gmail.com>
+Copyright (c) 2018-2021, Gavin D. Howard <yzena.tech@gmail.com>
 
 Redistribution and use in source and binary forms, with or without modification,
 are permitted provided that the following conditions are met:
@@ -53,3 +53,51 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+## Rand
+
+The files `src/rand.c` and `include/rand.h` are under the following copyrights
+and license:
+
+Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors
+Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com>
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+## `safe-install.sh`
+
+The file `safe-install.sh` is under the following copyright and license:
+
+Copyright (c) 2021 Rich Felker
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the “Software”), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
+the Software, and to permit persons to whom the Software is furnished to do so,
+subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in
index d17e74163397..8ae982bd99fe 100644
--- a/contrib/bc/Makefile.in
+++ b/contrib/bc/Makefile.in
@@ -1,7 +1,7 @@
 #
 # SPDX-License-Identifier: BSD-2-Clause
 #
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
@@ -29,7 +29,7 @@
 #
 .POSIX:
 
-VERSION = 3.2.4
+VERSION = 3.2.6
 
 SRC = %%SRC%%
 OBJ = %%OBJ%%
@@ -41,6 +41,13 @@ BC_ENABLED = %%BC_ENABLED%%
 DC_ENABLED_NAME = DC_ENABLED
 DC_ENABLED = %%DC_ENABLED%%
 
+HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h
+BC_HEADERS = include/bc.h
+DC_HEADERS = include/dc.h
+HISTORY_HEADERS = include/history.h
+EXTRA_MATH_HEADERS = include/rand.h
+LIBRARY_HEADERS = include/bcl.h include/library.h
+
 GEN_DIR = gen
 GEN = %%GEN%%
 GEN_EXEC = $(GEN_DIR)/$(GEN)
@@ -82,6 +89,11 @@ DC = dc
 BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC)
 DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC)
 
+BC_TEST_OUTPUTS = tests/bc_outputs
+BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3
+DC_TEST_OUTPUTS = tests/dc_outputs
+DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs
+
 LIB = libbcl
 LIB_NAME = $(LIB).a
 LIBBC = $(BIN)/$(LIB_NAME)
@@ -125,6 +137,9 @@ BC_ENABLE_NLS = %%NLS%%
 BC_ENABLE_PROMPT = %%PROMPT%%
 BC_LONG_BIT = %%LONG_BIT%%
 
+BC_ENABLE_AFL = %%FUZZ%%
+BC_ENABLE_MEMCHECK = %%MEMCHECK%%
+
 RM = rm
 MKDIR = mkdir
 
@@ -138,6 +153,8 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh
 
 VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
 
+TEST_STARS = "***********************************************************************"
+
 BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%%
 
 CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED)
@@ -147,7 +164,8 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700
 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN)
 CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT)
 CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH)
-CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY)
+CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY)
+CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL)
 CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%%
 LDFLAGS = %%LDFLAGS%%
 
@@ -159,20 +177,15 @@ HOSTCC = %%HOSTCC%%
 BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1
 BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1
 
-OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
-OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
+OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
 
-.c.o:
-	$(CC) $(CFLAGS) -o $@ -c $<
-
-all: %%ALL_PREREQ%%
+all: %%DEFAULT_TARGET%%
 
-execs: make_bin $(OBJ_TARGETS)
-	$(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC)
-	%%LINK%%
+%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%%
+	%%DEFAULT_TARGET_CMD%%
 
-library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O)
-	ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ)
+%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%%
+	%%SECOND_TARGET_CMD%%
 
 $(GEN_EXEC):
 	%%GEN_EXEC_TARGET%%
@@ -180,18 +193,32 @@ $(GEN_EXEC):
 $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB)
 	$(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS)
 
+$(BC_LIB_O): $(BC_LIB_C)
+	$(CC) $(CFLAGS) -o $@ -c $<
+
 $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2)
 	$(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS)
 
+$(BC_LIB2_O): $(BC_LIB2_C)
+	$(CC) $(CFLAGS) -o $@ -c $<
+
 $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP)
 	$(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME)
 
+$(BC_HELP_O): $(BC_HELP_C)
+	$(CC) $(CFLAGS) -o $@ -c $<
+
 $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP)
 	$(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME)
 
-make_bin:
+$(DC_HELP_O): $(DC_HELP_C)
+	$(CC) $(CFLAGS) -o $@ -c $<
+
+$(BIN):
 	$(MKDIR) -p $(BIN)
 
+headers: %%HEADERS%%
+
 help:
 	@printf 'available targets:\n'
 	@printf '\n'
@@ -222,41 +249,68 @@ help:
 	@printf '    valgrind_dc     runs the dc test suite, if dc has been built,\n'
 	@printf '                    through valgrind\n'
 
+run_all_tests:
+	%%BC_ALL_TESTS%%
+	%%TIMECONST_ALL_TESTS%%
+	%%DC_ALL_TESTS%%
+
 check: test
 
 test: %%TESTS%%
 
-test_bc:
-	%%BC_TEST%%
+test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other
+	@printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n'
+
+test_bc_tests:%%BC_TESTS%%
+
+test_bc_scripts:%%BC_SCRIPT_TESTS%%
+
+test_bc_stdin:
+	@sh tests/stdin.sh bc %%BC_TEST_EXEC%%
+
+test_bc_read:
+	@sh tests/read.sh bc %%BC_TEST_EXEC%%
+
+test_bc_errors:
+	@sh tests/errors.sh bc %%BC_TEST_EXEC%%
+
+test_bc_other:
+	@sh tests/other.sh bc %%BC_TEST_EXEC%%
+
+test_bc_header:
+	@printf '$(TEST_STARS)\n\nRunning bc tests...\n\n'
 
-test_dc:
-	%%DC_TEST%%
+test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other
+	@printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n'
 
-time_test: time_test_bc timeconst time_test_dc
+test_dc_tests:%%DC_TESTS%%
 
-time_test_bc:
-	%%BC_TIME_TEST%%
+test_dc_scripts:%%DC_SCRIPT_TESTS%%
 
-time_test_dc:
-	%%DC_TIME_TEST%%
+test_dc_stdin:
+	@sh tests/stdin.sh dc %%DC_TEST_EXEC%%
+
+test_dc_read:
+	@sh tests/read.sh dc %%DC_TEST_EXEC%%
+
+test_dc_errors:
+	@sh tests/errors.sh dc %%DC_TEST_EXEC%%
+
+test_dc_other:
+	@sh tests/other.sh dc %%DC_TEST_EXEC%%
+
+test_dc_header:
+	@printf '$(TEST_STARS)\n\nRunning dc tests...\n\n'
 
 timeconst:
 	%%TIMECONST%%
 
-library_test: library
+library_test: $(LIBBC)
 	$(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST)
 
 test_library: library_test
 	$(BCL_TEST)
 
-valgrind: valgrind_bc valgrind_dc
-
-valgrind_bc:
-	%%VG_BC_TEST%%
-
-valgrind_dc:
-	%%VG_DC_TEST%%
-
 karatsuba:
 	%%KARATSUBA%%
 
@@ -296,6 +350,8 @@ clean:%%CLEAN_PREREQS%%
 	@$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O)
 	@$(RM) -f $(BC_HELP_C) $(BC_HELP_O)
 	@$(RM) -f $(DC_HELP_C) $(DC_HELP_O)
+	@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
+	@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
 
 clean_config: clean
 	@printf 'Cleaning config...\n'
diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md
index f4fc2f5779ce..5982defb754c 100644
--- a/contrib/bc/NEWS.md
+++ b/contrib/bc/NEWS.md
@@ -1,5 +1,40 @@
 # News
 
+## 3.2.6
+
+This is a production release that fixes the build on FreeBSD.
+
+There was a syntax error in `configure.sh` that the Linux shell did not catch,
+and FreeBSD depends on the existence of `tests/all.sh`.
+
+All users that already upgraded to `3.2.5` should update to this release, with
+my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in
+favor of this version.
+
+## 3.2.5
+
+This is a production release that fixes several bugs and adds a couple small
+things.
+
+The two most important bugs were bugs that causes `dc` to access memory
+out-of-bounds (crash in debug builds). This was found by upgrading to `afl++`
+from `afl`. Both were caused by a failure to distinguish between the same two
+cases.
+
+Another bug was the failure to put all of the licenses in the `LICENSE.md` file.
+
+Third, some warnings by `scan-build` were found and eliminated. This needed one
+big change: `bc` and `dc` now bail out as fast as possible on fatal errors
+instead of unwinding the stack.
+
+Fourth, the pseudo-random number now attempts to seed itself with `/dev/random`
+if `/dev/urandom` fails.
+
+Finally, this release has a few quality-of-life changes to the build system. The
+usage should not change at all; the only thing that changed was making sure the
+`Makefile.in` was written to rebuild properly when headers changed and to not
+rebuild when not necessary.
+
 ## 3.2.4
 
 This is a production release that fixes a warning on `gcc` 6 or older, which
diff --git a/contrib/bc/NOTICE.md b/contrib/bc/NOTICE.md
index 92117daa9a6c..56d2935ab4b3 100644
--- a/contrib/bc/NOTICE.md
+++ b/contrib/bc/NOTICE.md
@@ -1,6 +1,6 @@
 # Notice
 
-Copyright 2018-2020 Gavin D. Howard and contributors.
+Copyright 2018-2021 Gavin D. Howard and contributors.
 
 ## Contributors
 
diff --git a/contrib/bc/README.md b/contrib/bc/README.md
index 6f3c3f252cbc..beda88d23f90 100644
--- a/contrib/bc/README.md
+++ b/contrib/bc/README.md
@@ -39,6 +39,7 @@ Systems that are known to work:
 * Mac OSX
 * Solaris* (as long as the Solaris version supports POSIX 2008)
 * AIX
+* HP-UX* (except for history)
 
 Please submit bug reports if this `bc` does not build out of the box on any
 system besides Windows. If Windows binaries are needed, they can be found at
diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh
index b6caf3debba3..ae1675cde97d 100755
--- a/contrib/bc/configure.sh
+++ b/contrib/bc/configure.sh
@@ -2,7 +2,7 @@
 #
 # SPDX-License-Identifier: BSD-2-Clause
 #
-# Copyright (c) 2018-2020 Gavin D. Howard and contributors.
+# Copyright (c) 2018-2021 Gavin D. Howard and contributors.
 #
 # Redistribution and use in source and binary forms, with or without
 # modification, are permitted provided that the following conditions are met:
@@ -33,6 +33,8 @@ script=$(basename "$script")
 
 . "$scriptdir/functions.sh"
 
+cd "$scriptdir"
+
 usage() {
 
 	if [ $# -gt 0 ]; then
@@ -48,7 +50,7 @@ usage() {
 	printf 'usage:\n'
 	printf '    %s -h\n' "$script"
 	printf '    %s --help\n' "$script"
-	printf '    %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
+	printf '    %s [-a|-bD|-dB|-c] [-CEfgGHlmMNPtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script"
 	printf '    %s \\\n' "$script"
 	printf '       [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n'
 	printf '       [--force --debug --disable-extra-math --disable-generated-tests]    \\\n'
@@ -73,6 +75,8 @@ usage() {
 	printf '        Generate test coverage code. Requires gcov and regcovr.\n'
 	printf '        It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n'
 	printf '        Requires a compiler that use gcc-compatible coverage options\n'
+	printf '    -C, --disable-clean\n'
+	printf '        Disable the clean that configure.sh does before configure.\n'
 	printf '    -d, --dc-only\n'
 	printf '        Build dc only. It is an error if "-b", "--bc-only", "-D", or\n'
 	printf '        "--disable-dc" are specified too.\n'
@@ -107,6 +111,8 @@ usage() {
 	printf '        Installs all locales, regardless of how many are on the system. This\n'
 	printf '        option is useful for package maintainers who want to make sure that\n'
 	printf '        a package contains all of the locales that end users might need.\n'
+	printf '    -m, --enable-memcheck\n'
+	printf '        Enable memcheck mode, to ensure no memory leaks. For development only.\n'
 	printf '    -M, --disable-man-pages\n'
 	printf '        Disable installing manpages.\n'
 	printf '    -N, --disable-nls\n'
@@ -119,9 +125,15 @@ usage() {
 	printf '        Disables the prompt in the built bc. The prompt will never show up,\n'
 	printf '        or in other words, it will be permanently disabled and cannot be\n'
 	printf '        enabled.\n'
+	printf '    -t, --enable-test-timing\n'
+	printf '        Enable the timing of tests. This is for development only.\n'
 	printf '    -T, --disable-strip\n'
 	printf '        Disable stripping symbols from the compiled binary or binaries.\n'
 	printf '        Stripping symbols only happens when debug mode is off.\n'
+	printf '    -v, --enable-valgrind\n'
+	printf '        Enable a build appropriate for valgrind. For development only.\n'
+	printf '    -z, --enable-fuzz-mode\n'
+	printf '        Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n'
 	printf '    --prefix PREFIX\n'
 	printf '        The prefix to install to. Overrides "$PREFIX" if it exists.\n'
 	printf '        If PREFIX is "/usr", install path will be "/usr/bin".\n'
@@ -277,6 +289,23 @@ replace() {
 	substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement"
 }
 
+find_src_files() {
+
+	if [ "$#" -ge 1 ] && [ "$1" != "" ]; then
+
+		while [ "$#" -ge 1 ]; do
+			_find_src_files_a="${1## }"
+			shift
+			_find_src_files_args="$_find_src_files_args ! -path src/${_find_src_files_a}"
+		done
+
+	else
+		_find_src_files_args="-print"
+	fi
+
+	printf '%s\n' $(find src/ -depth -name "*.c" $_find_src_files_args)
+}
+
 gen_file_list() {
 
 	if [ "$#" -lt 1 ]; then
@@ -291,15 +320,9 @@ gen_file_list() {
 	cd "$scriptdir"
 
 	if [ "$#" -ge 1 ]; then
-
-		while [ "$#" -ge 1 ]; do
-			a="$1"
-			shift
-			args="$args ! -path src/${a}"
-		done
-
+		_gen_file_list_unneeded="$@"
 	else
-		args="-print"
+		_gen_file_list_unneeded=""
 	fi
 
 	_gen_file_list_needle_src="SRC"
@@ -307,7 +330,7 @@ gen_file_list() {
 	_gen_file_list_needle_gcda="GCDA"
 	_gen_file_list_needle_gcno="GCNO"
 
-	_gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ')
+	_gen_file_list_replacement=$(find_src_files $_gen_file_list_unneeded | tr '\n' ' ')
 	_gen_file_list_contents=$(replace "$_gen_file_list_contents" \
 		"$_gen_file_list_needle_src" "$_gen_file_list_replacement")
 
@@ -328,6 +351,101 @@ gen_file_list() {
 	printf '%s\n' "$_gen_file_list_contents"
 }
 
+gen_tests() {
+
+	_gen_tests_name="$1"
+	shift
+
+	_gen_tests_uname="$1"
+	shift
+
+	_gen_tests_extra_math="$1"
+	shift
+
+	_gen_tests_time_tests="$1"
+	shift
+
+	_gen_tests_extra_required=$(cat tests/extra_required.txt)
+
+	for _gen_tests_t in $(cat "$scriptdir/tests/$_gen_tests_name/all.txt"); do
+
+		if [ "$_gen_tests_extra_math" -eq 0 ]; then
+
+			if [ -z "${_gen_tests_extra_required##*$_gen_tests_t*}" ]; then
+				printf 'test_%s_%s:\n\t@printf "Skipping %s %s\\n"\n\n' \
+					"$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \
+					"$_gen_tests_t" >> "$scriptdir/Makefile"
+				continue
+			fi
+
+		fi
+
+		printf 'test_%s_%s:\n\t@sh tests/test.sh %s %s %s %s %s\n\n' \
+			"$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \
+			"$_gen_tests_t" "$generate_tests" "$time_tests" \
+			"$*" >> "$scriptdir/Makefile"
+
+	done
+}
+
+gen_test_targets() {
+
+	_gen_test_targets_name="$1"
+	shift
+
+	_gen_test_targets_tests=$(cat "$scriptdir/tests/${_gen_test_targets_name}/all.txt")
+
+	for _gen_test_targets_t in $_gen_test_targets_tests; do
+		printf ' test_%s_%s' "$_gen_test_targets_name" "$_gen_test_targets_t"
+	done
+
+	printf '\n'
+}
+
+gen_script_tests() {
+
+	_gen_script_tests_name="$1"
+	shift
+
+	_gen_script_tests_extra_math="$1"
+	shift
+
+	_gen_script_tests_generate="$1"
+	shift
+
+	_gen_script_tests_time="$1"
+	shift
+
+	_gen_script_tests_tests=$(cat "$scriptdir/tests/$_gen_script_tests_name/scripts/all.txt")
+
+	for _gen_script_tests_f in $_gen_script_tests_tests; do
+
+		_gen_script_tests_b=$(basename "$_gen_script_tests_f" ".${_gen_script_tests_name}")
+
+		printf 'test_%s_script_%s:\n\t@sh tests/script.sh %s %s %s 1 %s %s %s\n\n' \
+			"$_gen_script_tests_name" "$_gen_script_tests_b" "$_gen_script_tests_name" \
+			"$_gen_script_tests_f" "$_gen_script_tests_extra_math" "$_gen_script_tests_generate" \
+			"$_gen_script_tests_time" "$*" >> "$scriptdir/Makefile"
+	done
+}
+
+gen_script_test_targets() {
+
+	_gen_script_test_targets_name="$1"
+	shift
+
+	_gen_script_test_targets_tests=$(cat "$scriptdir/tests/$_gen_script_test_targets_name/scripts/all.txt")
+
+	for _gen_script_test_targets_f in $_gen_script_test_targets_tests; do
+		_gen_script_test_targets_b=$(basename "$_gen_script_test_targets_f" \
+			".$_gen_script_test_targets_name")
+		printf ' test_%s_script_%s' "$_gen_script_test_targets_name" \
+			"$_gen_script_test_targets_b"
+	done
+
+	printf '\n'
+}
+
 bc_only=0
 dc_only=0
 coverage=0
@@ -344,14 +462,20 @@ force=0
 strip_bin=1
 all_locales=0
 library=0
+fuzz=0
+time_tests=0
+vg=0
+memcheck=0
+clean=1
 
-while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do
+while getopts "abBcdDEfgGhHk:lMmNO:PStTvz-" opt; do
 
 	case "$opt" in
 		a) library=1 ;;
 		b) bc_only=1 ;;
 		B) dc_only=1 ;;
 		c) coverage=1 ;;
+		C) clean=0 ;;
 		d) dc_only=1 ;;
*** 10727 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102052115.115LFIer089187>