diff options
| author | Michael Forney <mforney@mforney.org> | 2020-12-03 01:16:58 -0800 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-12-03 02:02:23 -0800 |
| commit | 1f05b9a1a093accaee5ff20433d86876125c4671 (patch) | |
| tree | 00f949d5f40ec6dd5e9694bba7f90a9b337966ac /pkg/bc/gen.lua | |
| parent | 54df165fdacbbd46a69eefa2e9aa6de25a04a037 (diff) | |
bc: Switch back to GNU bc
The 1.07 release means we don't have to apply a bunch of patches,
and it is a smaller binary anyway.
Diffstat (limited to 'pkg/bc/gen.lua')
| -rw-r--r-- | pkg/bc/gen.lua | 69 |
1 files changed, 9 insertions, 60 deletions
diff --git a/pkg/bc/gen.lua b/pkg/bc/gen.lua index f02abc76..a7956d8c 100644 --- a/pkg/bc/gen.lua +++ b/pkg/bc/gen.lua @@ -1,69 +1,18 @@ cflags{ - '-D NDEBUG', - '-D VERSION=3.1.6', + '-std=c99', '-Wall', '-Wpedantic', '-D _POSIX_C_SOURCE=200809L', - '-I $srcdir/include', - '-include $dir/config.h', + '-I $dir', + '-I $srcdir/h', } -sub('tools.ninja', function() - toolchain(config.host) - exe('strgen', {'gen/strgen.c'}) - rule('strgen', [[$outdir/strgen $in $out $name $header '$label' '$define' $removetabs]]) - build('strgen', '$outdir/bc_help.c', {'$srcdir/gen/bc_help.txt', '|', '$outdir/strgen'}, { - name='bc_help', header='bc.h', label='', define='BC_ENABLED', removetabs='', - }) - build('strgen', '$outdir/dc_help.c', {'$srcdir/gen/dc_help.txt', '|', '$outdir/strgen'}, { - name='dc_help', header='dc.h', label='', define='DC_ENABLED', removetabs='', - }) - build('strgen', '$outdir/lib.c', {'$srcdir/gen/lib.bc', '|', '$outdir/strgen'}, { - name='bc_lib', header='bc.h', label='bc_lib_name', define='BC_ENABLED', removetabs='1', - }) - build('strgen', '$outdir/lib2.c', {'$srcdir/gen/lib2.bc', '|', '$outdir/strgen'}, { - name='bc_lib2', header='bc.h', label='bc_lib2_name', define='BC_ENABLED && BC_ENABLE_EXTRA_MATH', removetabs='1', - }) -end) - exe('bin/bc', [[ - src/( - args.c - data.c - file.c - lang.c - lex.c - main.c - num.c - opt.c - parse.c - program.c - read.c - vector.c - vm.c - bc/(bc.c lex.c parse.c) - dc/(dc.c lex.c parse.c) - history/history.c - rand/rand.c + bc/( + main.c bc.c scan.c execute.c load.c storage.c util.c global.c + warranty.c ) - $outdir/(bc_help.c dc_help.c lib.c lib2.c) + lib/number.c ]]) file('bin/bc', '755', '$outdir/bin/bc') +man{'doc/bc.1'} -local opts = {} -for line in iterlines('config.h', 1) do - local var, val = line:match('^define ([^ ]+) ([^ ]+)') - if var and val == '1' then - opts[var] = true - end -end - -local manfile = '' -if not opts.BC_ENABLE_EXTRA_MATH then manfile = manfile..'E' end -if not opts.BC_ENABLE_HISTORY then manfile = manfile..'H' end -if not opts.BC_ENABLE_NLS then manfile = manfile..'N' end -if not opts.BC_ENABLE_PROMPT then manfile = manfile..'P' end -if manfile == '' then manfile = 'A' end - -build('copy', '$outdir/bc.1', '$srcdir/manuals/bc/'..manfile..'.1') -man{'$outdir/bc.1'} - -fetch 'git' +fetch 'curl' |
