diff options
author | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-02-23 18:09:05 -0300 |
---|---|---|
committer | Kelvin M. Klann <kmk3.code@protonmail.com> | 2024-02-24 18:50:43 -0300 |
commit | 93d623fdf9bee70bfae50168ac163825361f38e0 (patch) | |
tree | 4d944eee9eebdfc7c639577a685769c470a93a01 /configure | |
parent | profiles: drop paths already in wusc (#6218) (diff) | |
download | firejail-93d623fdf9bee70bfae50168ac163825361f38e0.tar.gz firejail-93d623fdf9bee70bfae50168ac163825361f38e0.tar.zst firejail-93d623fdf9bee70bfae50168ac163825361f38e0.zip |
build: allow overriding certain tools
Allow overriding the following tools at configure-time and build-time:
* codespell
* cppcheck
* gawk
* scan-build
For example, instead of hardcoding `gawk`, enable overriding it at
configure-time with:
./configure GAWK=/path/to/gawk
To override it for a single `make` invocation:
make GAWK=/path/to/gawk
Also, add default values for the programs that are not found (rather
than leaving the variables empty), to make error messages clearer when
trying to run them:
$ make CPPCHECK= cppcheck-old
[...]
force --error-exitcode=1 --enable=warning,performance .
make: force: No such file or directory
$ make CPPCHECK=cppcheck cppcheck-old
[...]
cppcheck --force --error-exitcode=1 --enable=warning,performance .
make: cppcheck: No such file or directory
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 238 |
1 files changed, 193 insertions, 45 deletions
@@ -665,7 +665,6 @@ HAVE_GLOBALCFG | |||
665 | HAVE_CHROOT | 665 | HAVE_CHROOT |
666 | HAVE_PRIVATE_LIB | 666 | HAVE_PRIVATE_LIB |
667 | HAVE_PRIVATE_HOME | 667 | HAVE_PRIVATE_HOME |
668 | HAVE_GAWK | ||
669 | HAVE_MAN | 668 | HAVE_MAN |
670 | HAVE_USERTMPFS | 669 | HAVE_USERTMPFS |
671 | HAVE_OUTPUT | 670 | HAVE_OUTPUT |
@@ -683,6 +682,10 @@ PKG_CONFIG | |||
683 | HAVE_APPARMOR | 682 | HAVE_APPARMOR |
684 | HAVE_IDS | 683 | HAVE_IDS |
685 | DEPS_CFLAGS | 684 | DEPS_CFLAGS |
685 | SCAN_BUILD | ||
686 | GAWK | ||
687 | CPPCHECK | ||
688 | CODESPELL | ||
686 | OBJEXT | 689 | OBJEXT |
687 | EXEEXT | 690 | EXEEXT |
688 | ac_ct_CC | 691 | ac_ct_CC |
@@ -3270,6 +3273,194 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' | |||
3270 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' | 3273 | ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' |
3271 | ac_compiler_gnu=$ac_cv_c_compiler_gnu | 3274 | ac_compiler_gnu=$ac_cv_c_compiler_gnu |
3272 | 3275 | ||
3276 | for ac_prog in codespell | ||
3277 | do | ||
3278 | # Extract the first word of "$ac_prog", so it can be a program name with args. | ||
3279 | set dummy $ac_prog; ac_word=$2 | ||
3280 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
3281 | printf %s "checking for $ac_word... " >&6; } | ||
3282 | if test ${ac_cv_prog_CODESPELL+y} | ||
3283 | then : | ||
3284 | printf %s "(cached) " >&6 | ||
3285 | else $as_nop | ||
3286 | if test -n "$CODESPELL"; then | ||
3287 | ac_cv_prog_CODESPELL="$CODESPELL" # Let the user override the test. | ||
3288 | else | ||
3289 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
3290 | for as_dir in $PATH | ||
3291 | do | ||
3292 | IFS=$as_save_IFS | ||
3293 | case $as_dir in #((( | ||
3294 | '') as_dir=./ ;; | ||
3295 | */) ;; | ||
3296 | *) as_dir=$as_dir/ ;; | ||
3297 | esac | ||
3298 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
3299 | if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then | ||
3300 | ac_cv_prog_CODESPELL="$ac_prog" | ||
3301 | printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 | ||
3302 | break 2 | ||
3303 | fi | ||
3304 | done | ||
3305 | done | ||
3306 | IFS=$as_save_IFS | ||
3307 | |||
3308 | fi | ||
3309 | fi | ||
3310 | CODESPELL=$ac_cv_prog_CODESPELL | ||
3311 | if test -n "$CODESPELL"; then | ||
3312 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CODESPELL" >&5 | ||
3313 | printf "%s\n" "$CODESPELL" >&6; } | ||
3314 | else | ||
3315 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3316 | printf "%s\n" "no" >&6; } | ||
3317 | fi | ||
3318 | |||
3319 | |||
3320 | test -n "$CODESPELL" && break | ||
3321 | done | ||
3322 | |||
3323 | for ac_prog in cppcheck | ||
3324 | do | ||
3325 | # Extract the first word of "$ac_prog", so it can be a program name with args. | ||
3326 | set dummy $ac_prog; ac_word=$2 | ||
3327 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
3328 | printf %s "checking for $ac_word... " >&6; } | ||
3329 | if test ${ac_cv_prog_CPPCHECK+y} | ||
3330 | then : | ||
3331 | printf %s "(cached) " >&6 | ||
3332 | else $as_nop | ||
3333 | if test -n "$CPPCHECK"; then | ||
3334 | ac_cv_prog_CPPCHECK="$CPPCHECK" # Let the user override the test. | ||
3335 | else | ||
3336 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
3337 | for as_dir in $PATH | ||
3338 | do | ||
3339 | IFS=$as_save_IFS | ||
3340 | case $as_dir in #((( | ||
3341 | '') as_dir=./ ;; | ||
3342 | */) ;; | ||
3343 | *) as_dir=$as_dir/ ;; | ||
3344 | esac | ||
3345 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
3346 | if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then | ||
3347 | ac_cv_prog_CPPCHECK="$ac_prog" | ||
3348 | printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 | ||
3349 | break 2 | ||
3350 | fi | ||
3351 | done | ||
3352 | done | ||
3353 | IFS=$as_save_IFS | ||
3354 | |||
3355 | fi | ||
3356 | fi | ||
3357 | CPPCHECK=$ac_cv_prog_CPPCHECK | ||
3358 | if test -n "$CPPCHECK"; then | ||
3359 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPPCHECK" >&5 | ||
3360 | printf "%s\n" "$CPPCHECK" >&6; } | ||
3361 | else | ||
3362 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3363 | printf "%s\n" "no" >&6; } | ||
3364 | fi | ||
3365 | |||
3366 | |||
3367 | test -n "$CPPCHECK" && break | ||
3368 | done | ||
3369 | |||
3370 | for ac_prog in gawk | ||
3371 | do | ||
3372 | # Extract the first word of "$ac_prog", so it can be a program name with args. | ||
3373 | set dummy $ac_prog; ac_word=$2 | ||
3374 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
3375 | printf %s "checking for $ac_word... " >&6; } | ||
3376 | if test ${ac_cv_prog_GAWK+y} | ||
3377 | then : | ||
3378 | printf %s "(cached) " >&6 | ||
3379 | else $as_nop | ||
3380 | if test -n "$GAWK"; then | ||
3381 | ac_cv_prog_GAWK="$GAWK" # Let the user override the test. | ||
3382 | else | ||
3383 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
3384 | for as_dir in $PATH | ||
3385 | do | ||
3386 | IFS=$as_save_IFS | ||
3387 | case $as_dir in #((( | ||
3388 | '') as_dir=./ ;; | ||
3389 | */) ;; | ||
3390 | *) as_dir=$as_dir/ ;; | ||
3391 | esac | ||
3392 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
3393 | if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then | ||
3394 | ac_cv_prog_GAWK="$ac_prog" | ||
3395 | printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 | ||
3396 | break 2 | ||
3397 | fi | ||
3398 | done | ||
3399 | done | ||
3400 | IFS=$as_save_IFS | ||
3401 | |||
3402 | fi | ||
3403 | fi | ||
3404 | GAWK=$ac_cv_prog_GAWK | ||
3405 | if test -n "$GAWK"; then | ||
3406 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GAWK" >&5 | ||
3407 | printf "%s\n" "$GAWK" >&6; } | ||
3408 | else | ||
3409 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3410 | printf "%s\n" "no" >&6; } | ||
3411 | fi | ||
3412 | |||
3413 | |||
3414 | test -n "$GAWK" && break | ||
3415 | done | ||
3416 | |||
3417 | for ac_prog in scan-build | ||
3418 | do | ||
3419 | # Extract the first word of "$ac_prog", so it can be a program name with args. | ||
3420 | set dummy $ac_prog; ac_word=$2 | ||
3421 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
3422 | printf %s "checking for $ac_word... " >&6; } | ||
3423 | if test ${ac_cv_prog_SCAN_BUILD+y} | ||
3424 | then : | ||
3425 | printf %s "(cached) " >&6 | ||
3426 | else $as_nop | ||
3427 | if test -n "$SCAN_BUILD"; then | ||
3428 | ac_cv_prog_SCAN_BUILD="$SCAN_BUILD" # Let the user override the test. | ||
3429 | else | ||
3430 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
3431 | for as_dir in $PATH | ||
3432 | do | ||
3433 | IFS=$as_save_IFS | ||
3434 | case $as_dir in #((( | ||
3435 | '') as_dir=./ ;; | ||
3436 | */) ;; | ||
3437 | *) as_dir=$as_dir/ ;; | ||
3438 | esac | ||
3439 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
3440 | if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then | ||
3441 | ac_cv_prog_SCAN_BUILD="$ac_prog" | ||
3442 | printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 | ||
3443 | break 2 | ||
3444 | fi | ||
3445 | done | ||
3446 | done | ||
3447 | IFS=$as_save_IFS | ||
3448 | |||
3449 | fi | ||
3450 | fi | ||
3451 | SCAN_BUILD=$ac_cv_prog_SCAN_BUILD | ||
3452 | if test -n "$SCAN_BUILD"; then | ||
3453 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SCAN_BUILD" >&5 | ||
3454 | printf "%s\n" "$SCAN_BUILD" >&6; } | ||
3455 | else | ||
3456 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3457 | printf "%s\n" "no" >&6; } | ||
3458 | fi | ||
3459 | |||
3460 | |||
3461 | test -n "$SCAN_BUILD" && break | ||
3462 | done | ||
3463 | |||
3273 | 3464 | ||
3274 | DEPS_CFLAGS="" | 3465 | DEPS_CFLAGS="" |
3275 | 3466 | ||
@@ -3901,50 +4092,7 @@ if test "x$enable_man" != "xno" | |||
3901 | then : | 4092 | then : |
3902 | 4093 | ||
3903 | HAVE_MAN="-DHAVE_MAN" | 4094 | HAVE_MAN="-DHAVE_MAN" |
3904 | # Extract the first word of "gawk", so it can be a program name with args. | 4095 | if test "x$GAWK" = "x" |
3905 | set dummy gawk; ac_word=$2 | ||
3906 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 | ||
3907 | printf %s "checking for $ac_word... " >&6; } | ||
3908 | if test ${ac_cv_prog_HAVE_GAWK+y} | ||
3909 | then : | ||
3910 | printf %s "(cached) " >&6 | ||
3911 | else $as_nop | ||
3912 | if test -n "$HAVE_GAWK"; then | ||
3913 | ac_cv_prog_HAVE_GAWK="$HAVE_GAWK" # Let the user override the test. | ||
3914 | else | ||
3915 | as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
3916 | for as_dir in $PATH | ||
3917 | do | ||
3918 | IFS=$as_save_IFS | ||
3919 | case $as_dir in #((( | ||
3920 | '') as_dir=./ ;; | ||
3921 | */) ;; | ||
3922 | *) as_dir=$as_dir/ ;; | ||
3923 | esac | ||
3924 | for ac_exec_ext in '' $ac_executable_extensions; do | ||
3925 | if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then | ||
3926 | ac_cv_prog_HAVE_GAWK="yes" | ||
3927 | printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 | ||
3928 | break 2 | ||
3929 | fi | ||
3930 | done | ||
3931 | done | ||
3932 | IFS=$as_save_IFS | ||
3933 | |||
3934 | test -z "$ac_cv_prog_HAVE_GAWK" && ac_cv_prog_HAVE_GAWK="no" | ||
3935 | fi | ||
3936 | fi | ||
3937 | HAVE_GAWK=$ac_cv_prog_HAVE_GAWK | ||
3938 | if test -n "$HAVE_GAWK"; then | ||
3939 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAVE_GAWK" >&5 | ||
3940 | printf "%s\n" "$HAVE_GAWK" >&6; } | ||
3941 | else | ||
3942 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
3943 | printf "%s\n" "no" >&6; } | ||
3944 | fi | ||
3945 | |||
3946 | |||
3947 | if test "x$HAVE_GAWK" != "xyes" | ||
3948 | then : | 4096 | then : |
3949 | as_fn_error $? "*** gawk not found ***" "$LINENO" 5 | 4097 | as_fn_error $? "*** gawk not found ***" "$LINENO" 5 |
3950 | fi | 4098 | fi |