• Home
  • Raw
  • Download

Lines Matching +full:gcov +full:- +full:exec

3 # SPDX-License-Identifier: BSD-2-Clause
5 # Copyright (c) 2018-2023 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' "$scri…
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'
87 printf ' Generate test coverage code. Requires gcov and gcovr.\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'
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'
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'
119 printf ' GNU bc-compatible bc to generate tests.\n'
120 printf ' -h, --help\n'
122 printf ' -H, --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'
140 printf ' -N, --disable-nls\n'
145 printf ' -O OPT_LEVEL, --opt OPT_LEVEL\n'
149 printf ' -p TYPE, --predefined-build-type=TYPE\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 -r, 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'
180 printf ' -v, --enable-valgrind\n'
182 printf ' -z, --enable-fuzz-mode\n'
184 printf ' --prefix PREFIX\n'
191 printf ' --bindir BINDIR\n'
194 printf ' --includedir INCLUDEDIR\n'
197 printf ' --libdir LIBDIR\n'
200 printf ' --datarootdir DATAROOTDIR\n'
203 printf ' --datadir DATADIR\n'
206 printf ' --mandir MANDIR\n'
209 printf ' --man1dir MAN1DIR\n'
212 printf ' --man3dir MAN3DIR\n'
255 printf ' PC_PATH The location to install pkg-config files to. Must be an\n'
257 printf ' output of `pkg-config --variable=pc_path pkg-config`.\n'
270 printf ' except that 32-bit platforms with 64-bit longs may want to set\n'
284 printf ' most production-ready compilers, this limit probably is not\n'
289 printf ' non-existent value, will cause the build system to compile and\n'
306 printf 'environment variables users can use to change them. (For the defaults, non-zero\n'
315 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
320 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
325 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
329 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
333 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
337 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
341 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
345 printf '| | given with the -e or | | |\n'
346 printf '| | -f options. | | |\n'
347 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
351 printf '| | given with the -e or | | |\n'
352 printf '| | -f options. | | |\n'
353 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
360 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
367 printf '| --------------- | -------------------- | ------------ | -------------------- |\n'
385 if [ "$#" -ne 3 ]; then
399 # a space-separated list of words, so filenames are expected to *not* have
402 # @param files The list of space-separated filenames to replace extensions for.
407 if [ "$#" -ne 3 ]; then
436 if [ "$#" -ne 3 ]; then
454 if [ "$#" -ge 1 ] && [ "$1" != "" ]; then
456 while [ "$#" -ge 1 ]; do
464 _find_src_files_files=$(find "$scriptdir/src/" -depth -name "*.c" -print | LC_ALL=C sort)
489 if [ "$#" -lt 1 ]; then
496 if [ "$#" -ge 1 ]; then
537 # @param extra_math An integer that, if non-zero, activates extra math tests.
538 # @param time_tests An integer that, if non-zero, tells the test suite to time
555 if [ "$_gen_std_tests_extra_math" -eq 0 ]; then
557 if [ -z "${_gen_std_tests_extra_required##*$_gen_std_tests_t*}" ]; then
636 # @param extra_math An integer that, if non-zero, activates extra math tests.
637 # @param generate An integer that, if non-zero, activates generated tests.
638 # @param time_tests An integer that, if non-zero, tells the test suite to time
676 # non-collision avoidance that the other variables do is that we *do* want
703 # non-collision avoidance that the other variables do is that we *do* want
775 CFLAGS="-flto -Weverything -Wno-padded -Werror -pedantic -std=c11"
809 CFLAGS="-Weverything -Wno-padded -Werror -pedantic -std=c11"
914 while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do
947 -)
949 arg="${arg#--}"
954 bc-only) bc_only=1 ;;
955 dc-only) dc_only=1 ;;
961 if [ "$#" -lt 2 ]; then
962 usage "No argument given for '--$arg' option"
968 if [ "$#" -lt 2 ]; then
969 usage "No argument given for '--$arg' option"
975 if [ "$#" -lt 2 ]; then
976 usage "No argument given for '--$arg' option"
982 if [ "$#" -lt 2 ]; then
983 usage "No argument given for '--$arg' option"
989 if [ "$#" -lt 2 ]; then
990 usage "No argument given for '--$arg' option"
996 if [ "$#" -lt 2 ]; then
997 usage "No argument given for '--$arg' option"
1003 if [ "$#" -lt 2 ]; then
1004 usage "No argument given for '--$arg' option"
1010 if [ "$#" -lt 2 ]; then
1011 usage "No argument given for '--$arg' option"
1017 if [ "$#" -lt 2 ]; then
1018 usage "No argument given for '--$arg' option"
1022 karatsuba-len=?*) karatsuba_len="$LONG_OPTARG" ;;
1023 karatsuba-len)
1024 if [ "$#" -lt 2 ]; then
1025 usage "No argument given for '--$arg' option"
1031 if [ "$#" -lt 2 ]; then
1032 usage "No argument given for '--$arg' option"
1036 set-default-on=?*) set_default 1 "$LONG_OPTARG" ;;
1037 set-default-on)
1038 if [ "$#" -lt 2 ]; then
1039 usage "No argument given for '--$arg' option"
1043 set-default-off=?*) set_default 0 "$LONG_OPTARG" ;;
1044 set-default-off)
1045 if [ "$#" -lt 2 ]; then
1046 usage "No argument given for '--$arg' option"
1050 predefined-build-type=?*) predefined_build "$LONG_OPTARG" ;;
1051 predefined-build-type)
1052 if [ "$#" -lt 2 ]; then
1053 usage "No argument given for '--$arg' option"
1057 disable-bc) dc_only=1 ;;
1058 disable-dc) bc_only=1 ;;
1059 disable-clean) clean=0 ;;
1060 disable-extra-math) extra_math=0 ;;
1061 disable-generated-tests) generate_tests=0 ;;
1062 disable-history) hist=0 ;;
1063 disable-man-pages) install_manpages=0 ;;
1064 disable-nls) nls=0 ;;
1065 disable-strip) strip_bin=0 ;;
1066 disable-problematic-tests) problematic_tests=0 ;;
1067 enable-editline) hist_impl="editline" ;;
1068 enable-readline) hist_impl="readline" ;;
1069 enable-internal-history) hist_impl="internal" ;;
1070 enable-test-timing) time_tests=1 ;;
1071 enable-valgrind) vg=1 ;;
1072 enable-fuzz-mode) fuzz=1 ;;
1073 enable-memcheck) memcheck=1 ;;
1074 install-all-locales) all_locales=1 ;;
1075 help* | bc-only* | dc-only* | coverage* | debug*)
1076 usage "No arg allowed for --$arg option" ;;
1077 disable-bc* | disable-dc* | disable-clean*)
1078 usage "No arg allowed for --$arg option" ;;
1079 disable-extra-math*)
1080 usage "No arg allowed for --$arg option" ;;
1081 disable-generated-tests* | disable-history*)
1082 usage "No arg allowed for --$arg option" ;;
1083 disable-man-pages* | disable-nls* | disable-strip*)
1084 usage "No arg allowed for --$arg option" ;;
1085 disable-problematic-tests*)
1086 usage "No arg allowed for --$arg option" ;;
1087 enable-fuzz-mode* | enable-test-timing* | enable-valgrind*)
1088 usage "No arg allowed for --$arg option" ;;
1089 enable-memcheck* | install-all-locales*)
1090 usage "No arg allowed for --$arg option" ;;
1091 enable-editline* | enable-readline*)
1092 usage "No arg allowed for --$arg option" ;;
1093 enable-internal-history*)
1094 usage "No arg allowed for --$arg option" ;;
1095 '') break ;; # "--" terminates argument processing
1107 if [ "$clean" -ne 0 ]; then
1108 if [ -f ./Makefile ]; then
1114 if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then
1115 usage "Can only specify one of -b(-D) or -d(-B)"
1120 if [ "$library" -ne 0 ]; then
1121 if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then
1122 usage "Must not specify -b(-D) or -d(-B) when building the library"
1128 (*[!0-9]*|'') usage "KARATSUBA_LEN is not a number" ;;
1132 if [ "$karatsuba_len" -lt 16 ]; then
1136 set -e
1138 if [ -z "${LONG_BIT+set}" ]; then
1140 elif [ "$LONG_BIT" -lt 32 ]; then
1143 LONG_BIT_DEFINE="-DBC_LONG_BIT=$LONG_BIT"
1146 if [ -z "$CC" ]; then
1172 if [ -z "$HOSTCC" ] && [ -z "$HOST_CC" ]; then
1174 elif [ -z "$HOSTCC" ]; then
1199 if [ -z "${HOSTCFLAGS+set}" ] && [ -z "${HOST_CFLAGS+set}" ]; then
1201 elif [ -z "${HOSTCFLAGS+set}" ]; then
1216 bc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n bc $extra_math 1…
1218 dc_test_np="@export BC_TEST_OUTPUT_DIR=\"$builddir/tests\"; \$(TESTSDIR)/all.sh -n dc $extra_math 1…
1224 if [ "$vg" -ne 0 ]; then
1246 default_target_cmd="\$(CC) \$(CFLAGS) \$(OBJS) \$(LDFLAGS) -o \$(EXEC)"
1255 if [ "$library" -ne 0 ]; then
1264 default_target_cmd="ar -r -cu \$(LIBBC) \$(OBJ)"
1275 elif [ "$bc_only" -eq 1 ]; then
1297 elif [ "$dc_only" -eq 1 ]; then
1333 if [ "$library" -eq 0 ]; then
1353 if [ "$fuzz" -ne 0 ]; then
1361 if [ "$debug" -eq 1 ]; then
1363 if [ -z "$CFLAGS" ] && [ -z "$optimization" ]; then
1364 CFLAGS="-O0"
1370 CFLAGS="-gdwarf-4 $CFLAGS"
1372 CFLAGS="-g $CFLAGS"
1377 CPPFLAGS="-DNDEBUG $CPPFLAGS"
1379 if [ "$strip_bin" -ne 0 ]; then
1380 LDFLAGS="-s $LDFLAGS"
1385 if [ -n "$optimization" ]; then
1386 CFLAGS="-O$optimization $CFLAGS"
1390 if [ "$coverage" -eq 1 ]; then
1392 if [ "$bc_only" -eq 1 ] || [ "$dc_only" -eq 1 ]; then
1393 usage "Can only specify -c without -b or -d"
1396 CFLAGS="-fprofile-arcs -ftest-coverage -g -O0 $CFLAGS"
1397 CPPFLAGS="-DNDEBUG $CPPFLAGS"
1399 COVERAGE_OUTPUT="@gcov -pabcdf \$(GCDA) \$(BC_GCDA) \$(DC_GCDA) \$(HISTORY_GCDA) \$(RAND_GCDA)"
1400 COVERAGE_OUTPUT="$COVERAGE_OUTPUT;\$(RM) -f \$(GEN)*.gc*"
1401 …COVERAGE_OUTPUT="$COVERAGE_OUTPUT;gcovr --exclude-unreachable-branches --exclude-throw-branches --
1411 if [ -z "${DESTDIR+set}" ]; then
1418 if [ -z "${PREFIX+set}" ]; then
1425 if [ -z "${BINDIR+set}" ]; then
1429 if [ -z "${INCLUDEDIR+set}" ]; then
1433 if [ -z "${LIBDIR+set}" ]; then
1437 if [ -z "${PC_PATH+set}" ]; then
1441 command -v pkg-config > /dev/null
1444 set -e
1446 if [ "$err" -eq 0 ]; then
1447 PC_PATH=$(pkg-config --variable=pc_path pkg-config)
1458 if [ "$install_manpages" -ne 0 ] || [ "$nls" -ne 0 ]; then
1459 if [ -z "${DATAROOTDIR+set}" ]; then
1465 if [ "$install_manpages" -ne 0 ]; then
1467 if [ -z "${DATADIR+set}" ]; then
1471 if [ -z "${MANDIR+set}" ]; then
1475 if [ -z "${MAN1DIR+set}" ]; then
1479 if [ -z "${MAN3DIR+set}" ]; then
1491 if [ "$nls" -ne 0 ]; then
1497 flags="-DBC_ENABLE_NLS=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc"
1498 flags="$flags -DBC_ENABLE_HISTORY=$hist -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0"
1499 flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/"
1500 flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1505 flags="$flags -Wno-unreachable-code"
1508 "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/vm.c" -o "./vm.o" > /dev/null 2>&1
1512 rm -rf "./vm.o"
1516 if [ "$err" -ne 0 ]; then
1518 if [ $force -eq 0 ]; then
1532 rm -rf "./en_US.cat"
1534 if [ "$err" -ne 0 ]; then
1536 if [ $force -eq 0 ]; then
1550 printf 'Cross-compile detected.\n\n'
1555 if [ -z "$NLSPATH" ]; then
1566 set -e
1574 if [ "$nls" -ne 0 ] && [ "$all_locales" -ne 0 ]; then
1575 install_locales="\$(LOCALE_INSTALL) -l \$(NLSPATH) \$(MAIN_EXEC) \$(DESTDIR)"
1581 if [ "$hist" -eq 1 ]; then
1598 flags="-DBC_ENABLE_HISTORY=1 -DBC_ENABLED=$bc -DDC_ENABLED=$dc"
1599 flags="$flags -DBC_ENABLE_NLS=$nls -DBC_ENABLE_LIBRARY=0 -DBC_ENABLE_AFL=0"
1600 flags="$flags -DBC_ENABLE_EDITLINE=$editline -DBC_ENABLE_READLINE=$readline"
1601 flags="$flags -DBC_ENABLE_EXTRA_MATH=$extra_math -I$scriptdir/include/"
1602 flags="$flags -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1604 "$CC" $CPPFLAGS $CFLAGS $flags -c "$scriptdir/src/history.c" -o "./history.o" > /dev/null 2>&1
1608 rm -rf "./history.o"
1612 if [ "$err" -ne 0 ]; then
1614 if [ $force -eq 0 ]; then
1624 set -e
1635 if [ "$hist" -eq 0 ] || [ "$vg" -ne 0 ]; then
1639 CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0"
1642 if [ "$editline" -eq 0 ] && [ "$readline" -eq 0 ]; then
1644 history_tests="$history_tests \&\& \$(TESTSDIR)/history.sh bc -a \&\&"
1645 history_tests="$history_tests \$(TESTSDIR)/history.sh dc -a \&\& printf"
1654 if [ "$editline" -ne 0 ]; then
1655 LDFLAGS="$LDFLAGS -ledit"
1656 CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=1 -DBC_ENABLE_READLINE=0"
1657 elif [ "$readline" -ne 0 ]; then
1658 LDFLAGS="$LDFLAGS -lreadline"
1659 CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=1"
1661 CFLAGS="$CFLAGS -DBC_ENABLE_EDITLINE=0 -DBC_ENABLE_READLINE=0"
1673 flags="-DBC_TEST_FREEBSD -DBC_ENABLE_AFL=0"
1674 "$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1
1678 if [ "$err" -ne 0 ]; then
1682 CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700"
1689 # have to check at configure time and set it on the compiler command-line. And
1696 flags="-DBC_TEST_OPENBSD -DBC_ENABLE_AFL=0"
1697 "$CC" $CPPFLAGS $CFLAGS $flags "-I$scriptdir/include" -E "$scriptdir/src/vm.c" > /dev/null 2>&1
1701 if [ "$err" -ne 0 ]; then
1704 bsd="-D_BSD_SOURCE"
1707 if [ "$readline" -ne 0 ]; then
1716 if [ "$library" -eq 1 ]; then
1720 if [ "$extra_math" -eq 1 ] && [ "$bc" -ne 0 ] && [ "$library" -eq 0 ]; then
1731 GEN_EXEC_TARGET="\$(HOSTCC) -DBC_ENABLE_AFL=0 -I$scriptdir/include/ \$(HOSTCFLAGS) -o \$(GEN_EXEC)…
1734 if [ -z "${GEN_HOST+set}" ]; then
1737 if [ "$GEN_HOST" -eq 0 ]; then
1749 if [ "$extra_math" -eq 0 ]; then
1761 if [ "$hist" -eq 0 ]; then
1768 if [ "$nls" -eq 0 ]; then
1772 if [ "$bc" -eq 0 ]; then
1778 if [ "$dc" -eq 0 ]; then
1786 version=$(cat "$scriptdir/include/version.h" | grep "VERSION " - | awk '{ print $3 }' -)
1788 if [ "$library" -ne 0 ]; then
1807 pkg_config_uninstall="\$(RM) -f \"\$(DESTDIR)\$(PC_PATH)/\$(BCL_PC)\""
1836 if [ "$vg" -ne 0 ]; then
1859 if [ "$bc" -ne 0 ]; then
1864 if [ "$dc" -ne 0 ]; then
1921 if [ "$nls" -ne 0 ] && [ "${NLSPATH#$PREFIX}" = "${NLSPATH}" ] && [ "$defprefix" -eq 0 ]; then
1929 printf ' locales outside of $PREFIX, you must disable NLS with the -N or the\n'
1930 printf ' --disable-nls options.\n'
1961 SRC_TARGETS=$(printf '%s\n\nsrc/%s: src %s %s\n\t$(CC) $(CFLAGS) -o src/%s -c %s\n' \
2051 contents=$(replace "$contents" "EXEC" "$executable")
2092 if [ "$bc" -ne 0 ]; then
2098 if [ "$dc" -ne 0 ]; then
2105 mkdir -p manuals
2106 cp -f "$scriptdir/manuals/bc/$manpage_args.1.md" manuals/bc.1.md
2107 cp -f "$scriptdir/manuals/bc/$manpage_args.1" manuals/bc.1
2108 cp -f "$scriptdir/manuals/dc/$manpage_args.1.md" manuals/dc.1.md
2109 cp -f "$scriptdir/manuals/dc/$manpage_args.1" manuals/dc.1