automake: display whether sleep supports fractional seconds as yes/no.
[automake.git] / m4 / silent.m4
blob69c024cb65ad09604ebb2337dafab6573c2a3ab0
1 ##                                                          -*- Autoconf -*-
2 # Copyright (C) 2009-2024 Free Software Foundation, Inc.
4 # This file is free software; the Free Software Foundation
5 # gives unlimited permission to copy and/or distribute it,
6 # with or without modifications, as long as this notice is preserved.
8 # _AM_SILENT_RULES
9 # ----------------
10 # Enable less verbose build rules support.
11 AC_DEFUN([_AM_SILENT_RULES],
12 [AM_DEFAULT_VERBOSITY=1
13 AC_ARG_ENABLE([silent-rules], [dnl
14 AS_HELP_STRING(
15   [--enable-silent-rules],
16   [less verbose build output (undo: "make V=1")])
17 AS_HELP_STRING(
18   [--disable-silent-rules],
19   [verbose build output (undo: "make V=0")])dnl
21 dnl
22 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
23 dnl do not support nested variable expansions.
24 dnl See automake bug#9928 and bug#10237.
25 am_make=${MAKE-make}
26 AC_CACHE_CHECK([whether $am_make supports nested variables],
27    [am_cv_make_support_nested_variables],
28    [if AS_ECHO([['TRUE=$(BAR$(V))
29 BAR0=false
30 BAR1=true
31 V=1
32 am__doit:
33         @$(TRUE)
34 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
35   am_cv_make_support_nested_variables=yes
36 else
37   am_cv_make_support_nested_variables=no
38 fi])
39 AC_SUBST([AM_V])dnl
40 AM_SUBST_NOTMAKE([AM_V])dnl
41 AC_SUBST([AM_DEFAULT_V])dnl
42 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
43 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
44 AM_BACKSLASH='\'
45 AC_SUBST([AM_BACKSLASH])dnl
46 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
47 dnl Delay evaluation of AM_DEFAULT_VERBOSITY to the end to allow multiple calls
48 dnl to AM_SILENT_RULES to change the default value.
49 AC_CONFIG_COMMANDS_PRE([dnl
50 case $enable_silent_rules in @%:@ (((
51   yes) AM_DEFAULT_VERBOSITY=0;;
52    no) AM_DEFAULT_VERBOSITY=1;;
53 esac
54 if test $am_cv_make_support_nested_variables = yes; then
55   dnl Using '$V' instead of '$(V)' breaks IRIX make.
56   AM_V='$(V)'
57   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
58 else
59   AM_V=$AM_DEFAULT_VERBOSITY
60   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
62 ])dnl
65 # AM_SILENT_RULES([DEFAULT])
66 # --------------------------
67 # Set the default verbosity level to DEFAULT ("yes" being less verbose, "no" or
68 # empty being verbose).
69 AC_DEFUN([AM_SILENT_RULES],
70 [AC_REQUIRE([_AM_SILENT_RULES])
71 AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1])])