Merge branch 'maint'
[platform/upstream/automake.git] / m4 / silent.m4
1 ##                                                          -*- Autoconf -*-
2 # Copyright (C) 2009-2012 Free Software Foundation, Inc.
3 #
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.
7
8 # serial 3
9
10 # AM_SILENT_RULES([DEFAULT])
11 # --------------------------
12 # Enable less verbose build rules; with the default set to DEFAULT
13 # ("yes" being less verbose, "no" or empty being verbose).
14 AC_DEFUN([AM_SILENT_RULES],
15 [AC_ARG_ENABLE([silent-rules], [dnl
16 AS_HELP_STRING(
17   [--enable-silent-rules],
18   [less verbose build output (undo: "make V=1")])
19 AS_HELP_STRING(
20   [--disable-silent-rules],
21   [verbose build output (undo: "make V=0")])dnl
22 ])
23 case $enable_silent_rules in @%:@ (((
24   yes) AM_DEFAULT_VERBOSITY=0;;
25    no) AM_DEFAULT_VERBOSITY=1;;
26     *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
27 esac
28 dnl
29 dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
30 dnl do not support nested variable expansions.
31 dnl See automake bug#9928 and bug#10237.
32 am_make=${MAKE-make}
33 AC_CACHE_CHECK([whether $am_make supports nested variables],
34    [am_cv_make_support_nested_variables],
35    [if AS_ECHO([['TRUE=$(BAR$(V))
36 BAR0=false
37 BAR1=true
38 V=1
39 am__doit:
40         @$(TRUE)
41 .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
42   am_cv_make_support_nested_variables=yes
43 else
44   am_cv_make_support_nested_variables=no
45 fi])
46 if test $am_cv_make_support_nested_variables = yes; then
47   dnl Using '$V' instead of '$(V)' breaks IRIX make.
48   AM_V='$(V)'
49   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
50 else
51   AM_V=$AM_DEFAULT_VERBOSITY
52   AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
53 fi
54 AC_SUBST([AM_V])dnl
55 AM_SUBST_NOTMAKE([AM_V])dnl
56 AC_SUBST([AM_DEFAULT_V])dnl
57 AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
58 AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
59 AM_BACKSLASH='\'
60 AC_SUBST([AM_BACKSLASH])dnl
61 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
62 ])