22
22
# [ -b || --build ] || #
23
23
# [ -c || --config ] || #
24
24
# [ -C || --distcheck ] || #
25
26
# [ -d || --debug ] || #
26
27
# [ -D || --dist ] || #
27
28
# [ -g || --gnulib ] || #
28
29
# [ -h || --help ] || #
29
30
# [ -H || --header-check ] || #
31
# [ -i || --iwyu ] || #
30
32
# [ -K || --check ] || #
31
33
# [ -m || --menu-config ] || #
32
34
# [ -p || --parallel-jobs ] || #
156
158
# from configurable-options.sh #
157
159
# 21/11/2021 MG 1.4.10 Tighten SPDX tag. #
158
160
# 07/06/2022 MG 1.5.1 Add compiler option -A --analyzer. #
161
# 28/08/2022 MG 1.5.2 Add --CC option for compiler. Same as #
162
# bootstrap.sh -c . -- CC=clang #
163
# Add option for include-what-you-use. #
160
165
#########################################################################
164
169
# Init variables #
165
170
##################
167
readonly version=1.5.1 # set version variable
168
readonly packageversion=1.3.13-2-g434aead6108a # Version of the complete package
172
readonly version=1.5.2 # set version variable
173
readonly packageversion=1.4.1-4-g43faa4806e08 # Version of the complete package
211
218
-b or --build make the project
212
219
-c or --config congigure the project
213
220
-C or --distcheck perform normal distcheck
221
--CC=compiler Compiler to use, eg gcc, clang etc
214
222
-d or --debug build with appropriate debug flags
215
223
-D or --dist perform a make dist
216
224
-g or --gnulib run gnulib-tool --update
217
225
-h or --help displays usage information
218
226
-H or --header-check show include stack depth
227
-i or --iwyu Use clang's include-what-you-use
219
228
-K or --check run make check
220
229
-m or --menu-config Invoke menu of configurable options
221
230
-p[X] or --parallel-jobs[=X] number of jobs to pass to make as --jobs=
289
298
local script_name="acmbuild.sh/bootstrap.sh"
292
tmp="getopt -o aAbcCdDghHKmp::stTvV "
293
tmp+="--long at-only,analyzer,build,check,config,distcheck,debug,dist"
294
tmp+=",gnulib,help,header-check,menu-config,parallel-jobs::,sparse"
295
tmp+=",source-tarball,testing-hacks,verbose,version"
301
tmp="getopt -o aAbcCdDghHiKmp::stTvV "
302
tmp+="--long at-only,analyzer,build,CC:,check,config,distcheck,debug"
303
tmp+=",dist,gnulib,help,header-check,iwyu,menu-config,parallel-jobs::"
304
tmp+=",sparse,source-tarball,testing-hacks,verbose,version"
296
305
GETOPTTEMP=$($tmp -n "$script_name" -- "$@")
297
306
std_cmd_err_handler $?
430
if [[ $atonly || $analyzer || $debug || $headercheck || $sparse \
431
|| $testinghacks ]] || $verbose ; then
447
if [[ $atonly || $analyzer || $cc || $debug || $headercheck \
448
|| $sparse || $testinghacks ]] || $verbose ; then
432
449
if ! $config ; then
433
msg="Options a, A, d, H, s, t and v require option c."
450
msg="Options a, A, CC, d, H, s, t and v require"
457
# include-what-you-use cannot be used with a number of other options.
458
if [[ $atonly || $analyzer || $cc || $debug || $headercheck \
459
|| $sparse || $testinghacks ]] || $build || $check || $dist \
460
|| $distcheck || $gnulib || $menuconfig || $tarball \
463
msg="Options a, A, b, C, CC, d, D, g, H, k, m, s, t"
464
msg+=", T and v cannot be used with option i"
470
# Sparse and CC conflict, both setting the CC variable.
471
if [[ $cc && $sparse ]]; then
472
msg="Options CC and s are mutually exclusive."
439
477
# One option has to be selected.
440
478
if ! $build && ! $check && ! $config && ! $distcheck && ! $dist \
441
&& ! $gnulib && ! $tarball ; then
442
output "Either b, c, C, D, g, K or T must be set." 1
479
&& ! $gnulib && ! $iwyu && ! $tarball ; then
480
output "Either b, c, C, D, g, i, K or T must be set." 1
525
563
output "$msg" $status
526
564
std_cmd_err_handler $status
528
cmdline="$basedir/configure$configcli_extra_args$verboseconfig"
566
cmdline="$basedir/configure$cc$configcli_extra_args$verboseconfig"
529
567
cmdline+="$atonly$analyzer$debug$headercheck$sparse$testinghacks"