silent-configsite.sh 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. # Copyright (C) 2010-2017 Free Software Foundation, Inc.
  3. #
  4. # This program is free software; you can redistribute it and/or modify
  5. # it under the terms of the GNU General Public License as published by
  6. # the Free Software Foundation; either version 2, or (at your option)
  7. # any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. # Check that the user can control default mode of silent-rules
  17. # from config.site, and that this default can be overridden from
  18. # either the ./configure or make command line.
  19. . test-init.sh
  20. cat >> configure.ac <<'EOF'
  21. # This line will be edited later to force silent-rules default.
  22. AC_OUTPUT
  23. EOF
  24. cat > Makefile.am <<'EOF'
  25. .PHONY: test-silent test-nosilent
  26. test-silent:
  27. test x'$(AM_DEFAULT_VERBOSITY)' = x'0'
  28. test-nosilent:
  29. test x'$(AM_DEFAULT_VERBOSITY)' = x'1'
  30. EOF
  31. unset enable_silent_rules
  32. : 'No explicit default in configure.ac, enable by default in config.site'
  33. $ACLOCAL
  34. $AUTOCONF
  35. $AUTOMAKE --add-missing
  36. echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
  37. CONFIG_SITE=./config.site ./configure
  38. $MAKE test-silent
  39. $MAKE distclean
  40. # Command line should win over default values in config.site.
  41. CONFIG_SITE=./config.site ./configure --disable-silent-rules
  42. $MAKE test-nosilent
  43. $MAKE distclean
  44. : 'Disable by default in configure.ac, enable by default in config.site'
  45. sed 's/.*silent-rules default.*/AM_SILENT_RULES([no])/' configure.ac > t
  46. diff t configure.ac && fatal_ "editing configure.ac"
  47. mv -f t configure.ac
  48. $ACLOCAL
  49. $AUTOCONF
  50. $AUTOMAKE --add-missing
  51. echo "enable_silent_rules=\${enable_silent_rules-yes}" > config.site
  52. CONFIG_SITE=./config.site ./configure
  53. $MAKE test-silent
  54. # Command line should win over default values in config.site.
  55. $MAKE distclean
  56. CONFIG_SITE=./config.site ./configure --disable-silent-rules
  57. $MAKE test-nosilent
  58. $MAKE distclean
  59. : 'Enable by default in configure.ac, disable by default in config.site'
  60. sed 's/.*AM_SILENT_RULES.*/AM_SILENT_RULES([yes])/' configure.ac > t
  61. diff t configure.ac && fatal_ "editing configure.ac"
  62. mv -f t configure.ac
  63. $ACLOCAL
  64. $AUTOCONF
  65. $AUTOMAKE --add-missing
  66. echo "enable_silent_rules=\${enable_silent_rules-no}" > config.site
  67. CONFIG_SITE=./config.site ./configure
  68. $MAKE test-nosilent
  69. $MAKE distclean
  70. # Command line should win over default values in config.site.
  71. CONFIG_SITE=./config.site ./configure --enable-silent-rules
  72. $MAKE test-silent
  73. $MAKE distclean
  74. :