aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-02-23 18:09:05 -0300
committerLibravatar Kelvin M. Klann <kmk3.code@protonmail.com>2024-02-24 18:50:43 -0300
commit93d623fdf9bee70bfae50168ac163825361f38e0 (patch)
tree4d944eee9eebdfc7c639577a685769c470a93a01 /configure
parentprofiles: drop paths already in wusc (#6218) (diff)
downloadfirejail-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-xconfigure238
1 files changed, 193 insertions, 45 deletions
diff --git a/configure b/configure
index adcd6162b..61c025a20 100755
--- a/configure
+++ b/configure
@@ -665,7 +665,6 @@ HAVE_GLOBALCFG
665HAVE_CHROOT 665HAVE_CHROOT
666HAVE_PRIVATE_LIB 666HAVE_PRIVATE_LIB
667HAVE_PRIVATE_HOME 667HAVE_PRIVATE_HOME
668HAVE_GAWK
669HAVE_MAN 668HAVE_MAN
670HAVE_USERTMPFS 669HAVE_USERTMPFS
671HAVE_OUTPUT 670HAVE_OUTPUT
@@ -683,6 +682,10 @@ PKG_CONFIG
683HAVE_APPARMOR 682HAVE_APPARMOR
684HAVE_IDS 683HAVE_IDS
685DEPS_CFLAGS 684DEPS_CFLAGS
685SCAN_BUILD
686GAWK
687CPPCHECK
688CODESPELL
686OBJEXT 689OBJEXT
687EXEEXT 690EXEEXT
688ac_ct_CC 691ac_ct_CC
@@ -3270,6 +3273,194 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
3270ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' 3273ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
3271ac_compiler_gnu=$ac_cv_c_compiler_gnu 3274ac_compiler_gnu=$ac_cv_c_compiler_gnu
3272 3275
3276for ac_prog in codespell
3277do
3278 # Extract the first word of "$ac_prog", so it can be a program name with args.
3279set dummy $ac_prog; ac_word=$2
3280{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3281printf %s "checking for $ac_word... " >&6; }
3282if test ${ac_cv_prog_CODESPELL+y}
3283then :
3284 printf %s "(cached) " >&6
3285else $as_nop
3286 if test -n "$CODESPELL"; then
3287 ac_cv_prog_CODESPELL="$CODESPELL" # Let the user override the test.
3288else
3289as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3290for as_dir in $PATH
3291do
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
3304done
3305 done
3306IFS=$as_save_IFS
3307
3308fi
3309fi
3310CODESPELL=$ac_cv_prog_CODESPELL
3311if test -n "$CODESPELL"; then
3312 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CODESPELL" >&5
3313printf "%s\n" "$CODESPELL" >&6; }
3314else
3315 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3316printf "%s\n" "no" >&6; }
3317fi
3318
3319
3320 test -n "$CODESPELL" && break
3321done
3322
3323for ac_prog in cppcheck
3324do
3325 # Extract the first word of "$ac_prog", so it can be a program name with args.
3326set dummy $ac_prog; ac_word=$2
3327{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3328printf %s "checking for $ac_word... " >&6; }
3329if test ${ac_cv_prog_CPPCHECK+y}
3330then :
3331 printf %s "(cached) " >&6
3332else $as_nop
3333 if test -n "$CPPCHECK"; then
3334 ac_cv_prog_CPPCHECK="$CPPCHECK" # Let the user override the test.
3335else
3336as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3337for as_dir in $PATH
3338do
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
3351done
3352 done
3353IFS=$as_save_IFS
3354
3355fi
3356fi
3357CPPCHECK=$ac_cv_prog_CPPCHECK
3358if test -n "$CPPCHECK"; then
3359 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPPCHECK" >&5
3360printf "%s\n" "$CPPCHECK" >&6; }
3361else
3362 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3363printf "%s\n" "no" >&6; }
3364fi
3365
3366
3367 test -n "$CPPCHECK" && break
3368done
3369
3370for ac_prog in gawk
3371do
3372 # Extract the first word of "$ac_prog", so it can be a program name with args.
3373set dummy $ac_prog; ac_word=$2
3374{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3375printf %s "checking for $ac_word... " >&6; }
3376if test ${ac_cv_prog_GAWK+y}
3377then :
3378 printf %s "(cached) " >&6
3379else $as_nop
3380 if test -n "$GAWK"; then
3381 ac_cv_prog_GAWK="$GAWK" # Let the user override the test.
3382else
3383as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3384for as_dir in $PATH
3385do
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
3398done
3399 done
3400IFS=$as_save_IFS
3401
3402fi
3403fi
3404GAWK=$ac_cv_prog_GAWK
3405if test -n "$GAWK"; then
3406 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GAWK" >&5
3407printf "%s\n" "$GAWK" >&6; }
3408else
3409 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3410printf "%s\n" "no" >&6; }
3411fi
3412
3413
3414 test -n "$GAWK" && break
3415done
3416
3417for ac_prog in scan-build
3418do
3419 # Extract the first word of "$ac_prog", so it can be a program name with args.
3420set dummy $ac_prog; ac_word=$2
3421{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3422printf %s "checking for $ac_word... " >&6; }
3423if test ${ac_cv_prog_SCAN_BUILD+y}
3424then :
3425 printf %s "(cached) " >&6
3426else $as_nop
3427 if test -n "$SCAN_BUILD"; then
3428 ac_cv_prog_SCAN_BUILD="$SCAN_BUILD" # Let the user override the test.
3429else
3430as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3431for as_dir in $PATH
3432do
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
3445done
3446 done
3447IFS=$as_save_IFS
3448
3449fi
3450fi
3451SCAN_BUILD=$ac_cv_prog_SCAN_BUILD
3452if test -n "$SCAN_BUILD"; then
3453 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SCAN_BUILD" >&5
3454printf "%s\n" "$SCAN_BUILD" >&6; }
3455else
3456 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3457printf "%s\n" "no" >&6; }
3458fi
3459
3460
3461 test -n "$SCAN_BUILD" && break
3462done
3463
3273 3464
3274DEPS_CFLAGS="" 3465DEPS_CFLAGS=""
3275 3466
@@ -3901,50 +4092,7 @@ if test "x$enable_man" != "xno"
3901then : 4092then :
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"
3905set dummy gawk; ac_word=$2
3906{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
3907printf %s "checking for $ac_word... " >&6; }
3908if test ${ac_cv_prog_HAVE_GAWK+y}
3909then :
3910 printf %s "(cached) " >&6
3911else $as_nop
3912 if test -n "$HAVE_GAWK"; then
3913 ac_cv_prog_HAVE_GAWK="$HAVE_GAWK" # Let the user override the test.
3914else
3915as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3916for as_dir in $PATH
3917do
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
3930done
3931 done
3932IFS=$as_save_IFS
3933
3934 test -z "$ac_cv_prog_HAVE_GAWK" && ac_cv_prog_HAVE_GAWK="no"
3935fi
3936fi
3937HAVE_GAWK=$ac_cv_prog_HAVE_GAWK
3938if test -n "$HAVE_GAWK"; then
3939 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $HAVE_GAWK" >&5
3940printf "%s\n" "$HAVE_GAWK" >&6; }
3941else
3942 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
3943printf "%s\n" "no" >&6; }
3944fi
3945
3946
3947 if test "x$HAVE_GAWK" != "xyes"
3948then : 4096then :
3949 as_fn_error $? "*** gawk not found ***" "$LINENO" 5 4097 as_fn_error $? "*** gawk not found ***" "$LINENO" 5
3950fi 4098fi