Lines Matching +full:disable +full:- +full:dc
3 # SPDX-License-Identifier: BSD-2-Clause
5 # Copyright (c) 2018-2024 Gavin D. Howard and contributors.
42 if [ $# -gt 0 ]; then
53 printf ' %s -h\n' "$script"
54 printf ' %s --help\n' "$script"
55 printf ' %s [-a|-bD|-dB|-c] [-CeEfgGHilmMNPrtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\\\n' "$script"
56 printf ' [-s SETTING] [-S SETTING] [-p TYPE]\n'
58 printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage] \\\n'
59 printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n'
60 printf ' [--disable-history --disable-man-pages --disable-nls --disable-strip] \\\n'
61 printf ' [--enable-editline] [--enable-readline] [--enable-internal-history] \\\n'
62 printf ' [--disable-problematic-tests] [--install-all-locales] \\\n'
63 printf ' [--opt=OPT_LEVEL] [--karatsuba-len=KARATSUBA_LEN] \\\n'
64 printf ' [--set-default-on=SETTING] [--set-default-off=SETTING] \\\n'
65 printf ' [--predefined-build-type=TYPE] \\\n'
66 printf ' [--prefix=PREFIX] [--bindir=BINDIR] [--datarootdir=DATAROOTDIR] \\\n'
67 printf ' [--datadir=DATADIR] [--mandir=MANDIR] [--man1dir=MAN1DIR] \\\n'
68 printf ' [--man3dir=MAN3DIR]\n'
70 if [ "$_usage_val" -ne 0 ]; then
75 printf ' -a, --library\n'
80 printf ' -b, --bc-only\n'
81 printf ' Build bc only. It is an error if "-d", "--dc-only", "-B", or\n'
82 printf ' "--disable-bc" are specified too.\n'
83 printf ' -B, --disable-bc\n'
84 printf ' Disable bc. It is an error if "-b", "--bc-only", "-D", or "--disable-dc"\n'
86 printf ' -c, --coverage\n'
88 printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n'
89 printf ' Requires a compiler that use gcc-compatible coverage options\n'
90 printf ' -C, --disable-clean\n'
91 printf ' Disable the clean that configure.sh does before configure.\n'
92 printf ' -d, --dc-only\n'
93 printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n'
94 printf ' "--disable-dc" are specified too.\n'
95 printf ' -D, --disable-dc\n'
96 printf ' Disable dc. It is an error if "-d", "--dc-only", "-B", or "--disable-bc"\n'
98 printf ' -e, --enable-editline\n'
100 printf ' want vi-like or Emacs-like behavior in history. This option is ignored\n'
101 printf ' if history is disabled. If the -r or -i options are given with this\n'
103 printf ' -E, --disable-extra-math\n'
104 printf ' Disable extra math. This includes: "$" operator (truncate to integer),\n'
108 printf ' -f, --force\n'
112 printf ' -g, --debug\n'
113 printf ' Build in debug mode. Adds the "-g" flag, and if there are no\n'
114 printf ' other CFLAGS, and "-O" was not given, this also adds the "-O0"\n'
115 printf ' flag. If this flag is *not* given, "-DNDEBUG" is added to CPPFLAGS\n'
117 printf ' -G, --disable-generated-tests\n'
118 printf ' Disable generating tests. This is for platforms that do not have a\n'
119 printf ' GNU bc-compatible bc to generate tests.\n'
120 printf ' -h, --help\n'
122 printf ' -H, --disable-history\n'
123 printf ' Disable history.\n'
124 printf ' -i, --enable-internal-history\n'
127 printf ' If this option is given along with -e and -r, the last occurrence of\n'
129 printf ' -k KARATSUBA_LEN, --karatsuba-len KARATSUBA_LEN\n'
132 printf ' -l, --install-all-locales\n'
136 printf ' -m, --enable-memcheck\n'
138 printf ' -M, --disable-man-pages\n'
139 printf ' Disable installing manpages.\n'
140 printf ' -N, --disable-nls\n'
141 printf ' Disable POSIX locale (NLS) support.\n'
144 printf ' to happen, you must disable locales (NLS) completely.\n'
145 printf ' -O OPT_LEVEL, --opt OPT_LEVEL\n'
149 printf ' -p TYPE, --predefined-build-type=TYPE\n'
155 printf ' matching the BSD bc and BSD dc), "GNU" (for matching the GNU bc and\n'
156 printf ' dc), "GDH" (for the preferred build of the author, Gavin D. Howard),\n'
159 printf ' -P, --disable-problematic-tests\n'
162 printf ' -r, --enable-readline\n'
164 printf ' that want vi-like or Emacs-like behavior in history. This option is\n'
165 printf ' ignored if history is disabled. If this option is given along with -e\n'
166 printf ' and -i, the last occurrence of all of the three is used.\n'
167 printf ' -s SETTING, --set-default-on SETTING\n'
169 printf ' for SETTING. For multiple instances of the -s or -S for the the same\n'
171 printf ' -S SETTING, --set-default-off SETTING\n'
173 printf ' for SETTING. For multiple instances of the -s or -S for the the same\n'
175 printf ' -t, --enable-test-timing\n'
177 printf ' -T, --disable-strip\n'
178 printf ' Disable stripping symbols from the compiled binary or binaries.\n'
180 printf ' -v, --enable-valgrind\n'
182 printf ' -z, --enable-fuzz-mode\n'
184 printf ' -Z, --enable-ossfuzz-mode\n'
185 printf ' Enable fuzzing mode for OSS-Fuzz. THIS IS FOR DEVELOPMENT ONLY.\n'
186 printf ' --prefix PREFIX\n'
192 printf ' happen, you must disable locales (NLS) completely.\n'
193 printf ' --bindir BINDIR\n'
196 printf ' --includedir INCLUDEDIR\n'
199 printf ' --libdir LIBDIR\n'
202 printf ' --datarootdir DATAROOTDIR\n'
205 printf ' --datadir DATADIR\n'
208 printf ' --mandir MANDIR\n'
211 printf ' --man1dir MAN1DIR\n'
214 printf ' --man3dir MAN3DIR\n'
240 printf ' want that to happen, you must disable locales (NLS) completely.\n'
257 printf ' PC_PATH The location to install pkg-config files to. Must be an\n'
259 printf ' output of `pkg-config --variable=pc_path pkg-config`.\n'
272 printf ' except that 32-bit platforms with 64-bit longs may want to set\n'
286 printf ' most production-ready compilers, this limit probably is not\n'
291 printf ' non-existent value, will cause the build system to compile and\n'
303 printf 'bc and dc have some settings that, while they cannot be removed by build time\n'
308 printf 'environment variables users can use to change them. (For the defaults, non-zero\n'
317 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
322 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
323 printf '| dc.sigint_reset | Whether SIGINT will | 1 | DC_SIGINT_RESET |\n'
324 printf '| | reset dc, instead of | | |\n'
327 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
331 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
332 printf '| dc.tty_mode | Whether TTY mode for | 0 | BC_TTY_MODE |\n'
333 printf '| | dc should be on when | | |\n'
335 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
339 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
340 printf '| dc.prompt | Whether the prompt | $DC_TTY_MODE | DC_PROMPT |\n'
341 printf '| | for dc should be on | | |\n'
343 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
347 printf '| | given with the -e or | | |\n'
348 printf '| | -f options. | | |\n'
349 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
350 printf '| dc.expr_exit | Whether to exit dc | 1 | DC_EXPR_EXIT |\n'
353 printf '| | given with the -e or | | |\n'
354 printf '| | -f options. | | |\n'
355 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
362 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
363 printf '| dc.digit_clamp | Whether to have dc | 0 | DC_DIGIT_CLAMP |\n'
369 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
372 printf 'that this bc and dc will conform to the expectations of the user on each\n'
387 if [ "$#" -ne 3 ]; then
401 # a space-separated list of words, so filenames are expected to *not* have
404 # @param files The list of space-separated filenames to replace extensions for.
409 if [ "$#" -ne 3 ]; then
438 if [ "$#" -ne 3 ]; then
456 if [ "$#" -ge 1 ] && [ "$1" != "" ]; then
458 while [ "$#" -ge 1 ]; do
466 _find_src_files_files=$(find "$scriptdir/src" -depth -name "*.c" -print | LC_ALL=C sort)
491 if [ "$#" -lt 1 ]; then
498 if [ "$#" -ge 1 ]; then
539 # @param extra_math An integer that, if non-zero, activates extra math tests.
540 # @param time_tests An integer that, if non-zero, tells the test suite to time
557 if [ "$_gen_std_tests_extra_math" -eq 0 ]; then
559 if [ -z "${_gen_std_tests_extra_required##*$_gen_std_tests_t*}" ]; then
638 # @param extra_math An integer that, if non-zero, activates extra math tests.
639 # @param generate An integer that, if non-zero, activates generated tests.
640 # @param time_tests An integer that, if non-zero, tells the test suite to time
678 # non-collision avoidance that the other variables do is that we *do* want
685 dc.sigint_reset) dc_default_sigint_reset="$_set_default_on" ;;
687 dc.tty_mode) dc_default_tty_mode="$_set_default_on" ;;
689 dc.prompt) dc_default_prompt="$_set_default_on" ;;
691 dc.expr_exit) dc_default_expr_exit="$_set_default_on";;
693 dc.digit_clamp) dc_default_digit_clamp="$_set_default_on";;
705 # non-collision avoidance that the other variables do is that we *do* want
779 CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
780 CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
815 CFLAGS="-Weverything -Wno-padded -Wno-unsafe-buffer-usage -Wno-poison-system-directories"
816 CFLAGS="$CFLAGS -Wno-switch-default -Werror -pedantic -std=c11"
923 while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvzZ-" opt; do
957 -)
959 arg="${arg#--}"
964 bc-only) bc_only=1 ;;
965 dc-only) dc_only=1 ;;
971 if [ "$#" -lt 2 ]; then
972 usage "No argument given for '--$arg' option"
978 if [ "$#" -lt 2 ]; then
979 usage "No argument given for '--$arg' option"
985 if [ "$#" -lt 2 ]; then
986 usage "No argument given for '--$arg' option"
992 if [ "$#" -lt 2 ]; then
993 usage "No argument given for '--$arg' option"
999 if [ "$#" -lt 2 ]; then
1000 usage "No argument given for '--$arg' option"
1006 if [ "$#" -lt 2 ]; then
1007 usage "No argument given for '--$arg' option"
1013 if [ "$#" -lt 2 ]; then
1014 usage "No argument given for '--$arg' option"
1020 if [ "$#" -lt 2 ]; then
1021 usage "No argument given for '--$arg' option"
1027 if [ "$#" -lt 2 ]; then
1028 usage "No argument given for '--$arg' option"
1032 karatsuba-len=?*) karatsuba_len="$LONG_OPTARG" ;;
1033 karatsuba-len)
1034 if [ "$#" -lt 2 ]; then
1035 usage "No argument given for '--$arg' option"
1041 if [ "$#" -lt 2 ]; then
1042 usage "No argument given for '--$arg' option"
1046 set-default-on=?*) set_default 1 "$LONG_OPTARG" ;;
1047 set-default-on)
1048 if [ "$#" -lt 2 ]; then
1049 usage "No argument given for '--$arg' option"
1053 set-default-off=?*) set_default 0 "$LONG_OPTARG" ;;
1054 set-default-off)
1055 if [ "$#" -lt 2 ]; then
1056 usage "No argument given for '--$arg' option"
1060 predefined-build-type=?*) predefined_build "$LONG_OPTARG" ;;
1061 predefined-build-type)
1062 if [ "$#" -lt 2 ]; then
1063 usage "No argument given for '--$arg' option"
1067 disable-bc) dc_only=1 ;;
1068 disable-dc) bc_only=1 ;;
1069 disable-clean) clean=0 ;;
1070 disable-extra-math) extra_math=0 ;;
1071 disable-generated-tests) generate_tests=0 ;;
1072 disable-history) hist=0 ;;
1073 disable-man-pages) install_manpages=0 ;;
1074 disable-nls) nls=0 ;;
1075 disable-strip) strip_bin=0 ;;
1076 disable-problematic-tests) problematic_tests=0 ;;
1077 enable-editline) hist_impl="editline" ;;
1078 enable-readline) hist_impl="readline" ;;
1079 enable-internal-history) hist_impl="internal" ;;
1080 enable-test-timing) time_tests=1 ;;
1081 enable-valgrind) vg=1 ;;
1082 enable-fuzz-mode) fuzz=1 ;;
1083 enable-ossfuzz-mode) ossfuzz=1 ;;
1084 enable-memcheck) memcheck=1 ;;
1085 install-all-locales) all_locales=1 ;;
1086 help* | bc-only* | dc-only* | coverage* | debug*)
1087 usage "No arg allowed for --$arg option" ;;
1088 disable-bc* | disable-dc* | disable-clean*)
1089 usage "No arg allowed for --$arg option" ;;
1090 disable-extra-math*)
1091 usage "No arg allowed for --$arg option" ;;
1092 disable-generated-tests* | disable-history*)
1093 usage "No arg allowed for --$arg option" ;;
1094 disable-man-pages* | disable-nls* | disable-strip*)
1095 usage "No arg allowed for --$arg option" ;;
1096 disable-problematic-tests*)
1097 usage "No arg allowed for --$arg option" ;;
1098 enable-fuzz-mode* | enable-test-timing* | enable-valgrind*)
1099 usage "No arg allowed for --$arg option" ;;
1100 enable-memcheck* | install-all-locales*)
1101 usage "No arg allowed for --$arg option" ;;
1102 enable-editline* | enable-readline*)
1103 usage "No arg allowed for --$arg option" ;;
1104 enable-internal-history*)
1105 usage "No arg allowed for --$arg option" ;;
1106 '') break ;; # "--" terminates argument processing
1118 if [ "$clean" -ne 0 ]; then
1119 if [ -f ./Makefile ]; then
1124 # It is an error to say that bc only should be built and likewise for dc.
1125 if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then
1126 usage "Can only specify one of -b(-D) or -d(-B)"
1131 if [ "$library" -ne 0 ]; then
1132 if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then
1133 usage "Must not specify -b(-D) or -d(-B) when building the library"
1139 (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;;
1143 if [ "$karatsuba_len" -lt 16 ]; then
1147 set -e
1149 if [ -z "${LONG_BIT+set}" ]; then
1151 elif [ "$LONG_BIT" -lt 32 ]; then
1154 LONG_BIT_DEFINE="-DBC_LONG_BIT=$LONG_BIT"
1157 if [ -z "$CC" ]; then
1183 if [ -z "$HOSTCC" ] && [ -z "$HOST_CC" ]; then
1185 elif [ -z "$HOSTCC" ]; then
1210 if [ -z "${HOSTCFLAGS+set}" ] && [ -z "${HOST_CFLAGS+set}" ]; then
1212 elif [ -z "${HOSTCFLAGS+set}" ]; then
1227 bc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n bc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(BC_EXEC)"
1228 dc_test="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh dc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(DC_EXEC)"
1229 dc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n dc $extra_math 1 $generate_tests $problematic_tests $time_tests \$(DC_EXEC)"
1235 if [ "$vg" -ne 0 ]; then
1249 karatsuba="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'"
1250 karatsuba_test="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'"
1257 default_target_cmd="\$(CC) \$(CFLAGS) \$(OBJS) \$(LDFLAGS) -o \$(EXEC)"
1265 # the library is being built, bc only, dc only, or both calculators.
1266 if [ "$library" -ne 0 ]; then
1272 dc=1
1275 default_target_cmd="ar -r -cu \$(LIBBC) \$(OBJ)"
1286 elif [ "$bc_only" -eq 1 ]; then
1289 dc=0
1295 dc_test="@printf 'No dc tests to run\\\\n'"
1296 dc_test_np="@printf 'No dc tests to run\\\\n'"
1308 elif [ "$dc_only" -eq 1 ]; then
1311 dc=1
1316 executables="dc"
1318 main_exec="DC"
1334 elif [ "$ossfuzz" -eq 1 ]; then
1336 if [ "$bc_only" -ne 0 ] || [ "$dc_only" -ne 0 ]; then
1337 usage "An OSS-Fuzz build must build both fuzzers."
1341 dc=1
1343 # Expressions *cannot* exit in an OSS-Fuzz build.
1352 if [ "$library" -eq 0 ]; then
1367 default_target_cmd="\$(CXX) \$(CFLAGS) src/dc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(DC_FUZZER) \&\& ln -sf ./dc_fuzzer_c \$(DC_FUZZER_C)"
1368 second_target_cmd="\$(CXX) \$(CFLAGS) src/bc_fuzzer.o \$(LIB_FUZZING_ENGINE) \$(OBJS) \$(LDFLAGS) -o \$(BC_FUZZER) \&\& ln -sf ./bc_fuzzer_c \$(BC_FUZZER_C)"
1376 dc=1
1378 executables="bc and dc"
1383 if [ "$library" -eq 0 ]; then
1398 default_target_cmd="\$(LINK) \$(BIN) \$(EXEC_PREFIX)\$(DC)"
1402 if [ "$fuzz" -ne 0 ] && [ "$ossfuzz" -ne 0 ]; then
1403 usage "Fuzzing mode and OSS-Fuzz mode are mutually exclusive"
1407 if [ "$fuzz" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then
1415 if [ "$debug" -eq 1 ]; then
1417 if [ -z "$CFLAGS" ] && [ -z "$optimization" ]; then
1418 CFLAGS="-O0"
1421 CFLAGS="-g $CFLAGS"
1424 CPPFLAGS="-DNDEBUG $CPPFLAGS"
1428 if [ -n "$optimization" ]; then
1429 CFLAGS="-O$optimization $CFLAGS"
1433 if [ "$coverage" -eq 1 ]; then
1435 if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then
1436 usage "Can only specify -c without -b or -d"
1439 CFLAGS="-fprofile-arcs -ftest-coverage -g -O0 $CFLAGS"
1440 CPPFLAGS="-DNDEBUG $CPPFLAGS"
1442 COVERAGE_OUTPUT="@gcov -pabcdf \$(GCDA) \$(BC_GCDA) \$(DC_GCDA) \$(HISTORY_GCDA) \$(RAND_GCDA)"
1443 COVERAGE_OUTPUT="$COVERAGE_OUTPUT;\$(RM) -f \$(GEN)*.gc*"
1444 COVERAGE_OUTPUT="$COVERAGE_OUTPUT;gcovr --exclude-unreachable-branches --exclude-throw-branches --html-details --output index.html"
1453 if [ -z "${DESTDIR+set}" ]; then
1460 if [ -z "${PREFIX+set}" ]; then
1467 if [ -z "${BINDIR+set}" ]; then
1471 if [ -z "${INCLUDEDIR+set}" ]; then
1475 if [ -z "${LIBDIR+set}" ]; then
1479 if [ -z "${PC_PATH+set}" ]; then
1483 command -v pkg-config > /dev/null
1486 set -e
1488 if [ "$err" -eq 0 ]; then
1489 PC_PATH=$(pkg-config --variable=pc_path pkg-config)
1500 if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then
1501 if [ -z "${DATAROOTDIR+set}" ]; then
1507 if [ "$install_manpages" -ne 0 ]; then
1509 if [ -z "${DATADIR+set}" ]; then
1513 if [ -z "${MANDIR+set}" ]; then
1517 if [ -z "${MAN1DIR+set}" ]; then
1521 if [ -z "${MAN3DIR+set}" ]; then
1533 if [ "$nls" -ne 0 ]; then
1539 flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc"
1540 flags="$flags -DBC_ENABLE_HISTORY=$hist -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0"
1541 flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0"
1542 flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1547 flags="$flags -Wno-unreachable-code"
1550 "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -E > /dev/null
1554 rm -rf "./vm.o"
1557 # and NLS is not supported on Windows or musl, so disable it.
1558 if [ "$err" -ne 0 ]; then
1560 if [ $force -eq 0 ]; then
1574 rm -rf "./en_US.cat"
1576 if [ "$err" -ne 0 ]; then
1578 if [ $force -eq 0 ]; then
1592 printf 'Cross-compile detected.\n\n'
1597 if [ -z "$NLSPATH" ]; then
1608 set -e
1616 if [ "$nls" -ne 0 ] && [ "$all_locales" -ne 0 ]; then
1617 install_locales="\$(LOCALE_INSTALL) -l \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)"
1623 if [ "$hist" -eq 1 ]; then
1640 flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc"
1641 flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0"
1642 flags="$flags -DBC_ENABLE_EDITLINE=$editline -DBC_ENABLE_READLINE=$readline"
1643 flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -DBC_ENABLE_OSSFUZZ=0"
1644 flags="$flags -I$scriptdir/include/ -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1646 "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -E > /dev/null
1650 rm -rf "./history.o"
1653 # and history is not supported on Windows, so disable it.
1654 if [ "$err" -ne 0 ]; then
1656 if [ $force -eq 0 ]; then
1666 set -e
1675 # We have to disable the history tests if it is disabled or valgrind is on. Or
1677 if [ "$hist" -eq 0 ] || [ "$vg" -ne 0 ]; then
1681 CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0"
1684 if [ "$editline" -eq 0 ] && [ "$readline" -eq 0 ]; then
1686 history_tests="$history_tests \&\& \$(TESTSDIR)/history.sh bc -a \&\&"
1687 history_tests="$history_tests \$(TESTSDIR)/history.sh dc -a \&\& printf"
1696 if [ "$editline" -ne 0 ]; then
1697 LDFLAGS="$LDFLAGS -ledit"
1698 CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0"
1699 elif [ "$readline" -ne 0 ]; then
1700 LDFLAGS="$LDFLAGS -lreadline"
1701 CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1"
1703 CPPFLAGS="$CPPFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0"
1715 flags="-DBC_TEST_FREEBSD -DBC_ENABLE_AFL=0"
1716 "$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null
1720 if [ "$err" -ne 0 ]; then
1724 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1732 flags="-DBC_TEST_APPLE -DBC_ENABLE_AFL=0"
1733 "$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null
1737 if [ "$err" -ne 0 ]; then
1739 apple="-D_DARWIN_C_SOURCE"
1746 if [ "$debug" -eq 0 ] && [ "$apple" = "" ] && [ "$strip_bin" -ne 0 ]; then
1747 LDFLAGS="-s $LDFLAGS"
1754 # have to check at configure time and set it on the compiler command-line. And
1760 flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0"
1761 "$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/scripts/os.c" > /dev/null
1765 if [ "$err" -ne 0 ]; then
1768 bsd="-D_BSD_SOURCE"
1771 if [ "$readline" -ne 0 ]; then
1780 set -e
1782 if [ "$library" -eq 1 ]; then
1786 if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then
1797 GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -DBC_ENABLE_OSSFUZZ=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC) \$(GEN_C)"
1800 if [ -z "${GEN_HOST+set}" ]; then
1803 if [ "$GEN_HOST" -eq 0 ]; then
1816 if [ "$extra_math" -eq 0 ]; then
1828 if [ "$hist" -eq 0 ]; then
1835 if [ "$nls" -eq 0 ]; then
1839 if [ "$bc" -eq 0 ]; then
1845 if [ "$dc" -eq 0 ]; then
1846 unneeded="$unneeded dc.c dc_lex.c dc_parse.c"
1853 version=$(cat "$scriptdir/include/version.h" | grep "VERSION " - | awk '{ print $3 }' -)
1855 if [ "$library" -ne 0 ]; then
1860 unneeded="$unneeded dc.c dc_lex.c dc_parse.c"
1874 pkg_config_uninstall="\$(RM) -f \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\""
1883 elif [ "$ossfuzz" -ne 0 ]; then
1912 if [ "$vg" -ne 0 ] || [ "$ossfuzz" -ne 0 ]; then
1928 dc_tests=$(gen_std_test_targets dc)
1929 dc_script_tests=$(gen_script_test_targets dc)
1930 dc_err_tests=$(gen_err_test_targets dc)
1937 if [ "$bc" -ne 0 ]; then
1942 if [ "$dc" -ne 0 ]; then
1943 printf 'Building dc\n'
1945 printf 'Not building dc\n'
1984 printf 'dc.sigint_reset=%s\n' "$dc_default_sigint_reset"
1986 printf 'dc.tty_mode=%s\n' "$dc_default_tty_mode"
1988 printf 'dc.prompt=%s\n' "$dc_default_prompt"
1990 printf 'dc.expr_exit=%s\n' "$dc_default_expr_exit"
1992 printf 'dc.digit_clamp=%s\n' "$dc_default_digit_clamp"
1999 if [ "$nls" -ne 0 ] && [ "${NLSPATH#$PREFIX}" = "${NLSPATH}" ] && [ "$defprefix" -eq 0 ]; then
2007 printf ' locales outside of $PREFIX, you must disable NLS with the -N or the\n'
2008 printf ' --disable-nls options.\n'
2039 SRC_TARGETS=$(printf '%s\n\nsrc/%s: src %s %s\n\t$(CC) $(CFLAGS) -o src/%s -c %s\n' \
2050 contents=$(replace "$contents" "DC_ENABLED" "$dc")
2173 if [ "$bc" -ne 0 ]; then
2179 if [ "$dc" -ne 0 ]; then
2180 gen_std_tests dc "$extra_math" "$time_tests" $dc_test_exec
2181 gen_script_tests dc "$extra_math" "$generate_tests" "$time_tests" $dc_test_exec
2182 gen_err_tests dc $dc_test_exec
2185 if [ "$ossfuzz" -ne 0 ]; then
2187 printf 'bc_fuzzer_c: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_c\n' >> Makefile
2188 printf 'bc_fuzzer_C: $(BC_FUZZER)\n\tln -sf $(BC_FUZZER) bc_fuzzer_C\n' >> Makefile
2189 printf 'dc_fuzzer_c: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_c\n' >> Makefile
2190 printf 'dc_fuzzer_C: $(DC_FUZZER)\n\tln -sf $(DC_FUZZER) dc_fuzzer_C\n' >> Makefile
2195 mkdir -p manuals
2196 cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md
2197 cp -f "$scriptdir/manuals/bc/$manpage_args.1" manuals/bc.1
2198 cp -f "$scriptdir/manuals/dc/$manpage_args.1.md" manuals/dc.1.md
2199 cp -f "$scriptdir/manuals/dc/$manpage_args.1" manuals/dc.1