~m-grant-prg/libmgesysutils/focal

« back to all changes in this revision

Viewing changes to bootstrap.sh

  • Committer: Mark Grant
  • Date: 2020-10-31 10:38:20 UTC
  • mfrom: (65.1.1 focal-trunk)
  • Revision ID: m.grant.prg@gmail.com-20201031103820-meqjxj5p1rl0ukuv
Merge from focal trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
#                               [ -h || --help ] ||                     #
28
28
#                               [ -H || --header-check ] ||             #
29
29
#                               [ -K || --check ] ||                    #
 
30
#                               [ -p || --parallel-jobs ] ||            #
30
31
#                               [ -s || --sparse ] ||                   #
31
32
#                               [ -t || --testing-hacks ] ||            #
32
33
#                               [ -T || --source-tarball ] ||           #
142
143
#                               Cannot test for existence of file with  #
143
144
#                               a variable which has retained quotes,   #
144
145
#                               so introduce unquoted basedirunq.       #
 
146
# 01/12/2019    MG      1.4.7   Add parallel jobs option to pass to     #
 
147
#                               make as --jobs                          #
145
148
#                                                                       #
146
149
#########################################################################
147
150
 
150
153
# Init variables #
151
154
##################
152
155
 
153
 
readonly version=1.4.6                  # set version variable
154
 
readonly packageversion=1.3.8   # Version of the complete package
 
156
readonly version=1.4.7                  # set version variable
 
157
readonly packageversion=1.3.9   # Version of the complete package
155
158
 
156
159
# Set defaults
157
160
atonly=""
163
166
distcheck=false
164
167
gnulib=false
165
168
headercheck=""
 
169
par_jobs=""
166
170
sparse=""
167
171
tarball=false
168
172
testinghacks=""
199
203
        -h or --help displays usage information
200
204
        -H or --header-check show include stack depth
201
205
        -K or --check run make check
 
206
        -p[X] or --parallel-jobs[=X] number of jobs to pass to make as --jobs=
 
207
                If not specified make is sequential
 
208
                If no value X is given then defaults to nproc
202
209
        -s or --sparse build using sparse
203
210
        -t or --testing-hacks some build changes may be required for testing
204
211
                purposes. e.g. A script may invoke a project jar file which
267
274
        local script_name="acmbuild.sh/bootstrap.sh"
268
275
        local tmp
269
276
 
270
 
        tmp="getopt -o abcCdDghHKstTvV "
 
277
        tmp="getopt -o abcCdDghHKp::stTvV "
271
278
        tmp+="--long at-only,build,check,config,distcheck,debug,dist,gnulib,"
272
 
        tmp+="help,header-check,sparse,source-tarball,testing-hacks,verbose,"
273
 
        tmp+="version"
 
279
        tmp+="help,header-check,parallel-jobs::,sparse,source-tarball,"
 
280
        tmp+="testing-hacks,verbose,version"
274
281
        GETOPTTEMP=$($tmp -n "$script_name" -- "$@")
275
282
        std_cmd_err_handler $?
276
283
 
334
341
                        headercheck=" --enable-headercheck=yes"
335
342
                        shift
336
343
                        ;;
 
344
                -p|--parallel-jobs)
 
345
                        if [[ -z "$2" ]]; then
 
346
                                par_jobs=" --jobs=$(nproc)"
 
347
                        else
 
348
                                par_jobs=" --jobs=$2"
 
349
                        fi
 
350
                        shift 2
 
351
                        ;;
337
352
                -K|--check)
338
353
                        if $distcheck || $dist || $tarball; then
339
354
                                msg="Options C, D, K and T are mutually "
469
484
        local status
470
485
 
471
486
        if $build ; then
472
 
                cmdline="make"$verbosemake
 
487
                cmdline="make"$verbosemake$par_jobs
473
488
        fi
474
489
 
475
490
        if $check ; then
476
491
                if [[ ! $cmdline ]]; then
477
 
                        cmdline="make"$verbosemake
 
492
                        cmdline="make"$verbosemake$par_jobs
478
493
                fi
479
494
                cmdline+=" check"
480
495
        fi
481
496
 
482
497
        if $distcheck ; then
483
 
                cmdline="make"$verbosemake" distcheck clean"
 
498
                cmdline="make"$verbosemake$par_jobs" distcheck clean"
484
499
        fi
485
500
 
486
501
        if $dist ; then
487
 
                cmdline="make"$verbosemake" dist clean"
 
502
                cmdline="make"$verbosemake$par_jobs" dist clean"
488
503
        fi
489
504
 
490
505
        if $tarball ; then
491
 
                cmdline="make"$verbosemake" srctarball clean"
 
506
                cmdline="make"$verbosemake$par_jobs" srctarball clean"
492
507
        fi
493
508
 
494
509
        # May get here with cmdline empty if, for example, only the -g option