warning-groups-win-over-strictness.sh 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #! /bin/sh
  2. # Copyright (C) 2011-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 explicitly-defined warning levels take precedence over
  17. # implicit strictness-implied warnings, even when these explicit warning
  18. # levels are "catch-all warnings" (such as '-Wall' and '-Wnone').
  19. # Since we are at it, also throw in *.am and *.m4 file inclusions.
  20. . test-init.sh
  21. # We want complete control over automake options.
  22. AUTOMAKE=$am_original_AUTOMAKE
  23. # Files required in gnu and/or gnits strictness.
  24. touch README INSTALL NEWS AUTHORS ChangeLog COPYING THANKS
  25. cat > configure.ac << END
  26. AC_INIT([$me], [1.0])
  27. m4_include([am-init-automake.m4])
  28. AC_PROG_CC
  29. AC_CONFIG_FILES([Makefile])
  30. # Other similar tests do not use AC_OUTPUT, so we use it here,
  31. # for completeness and for better coverage.
  32. AC_OUTPUT
  33. END
  34. cat > Makefile.am <<END
  35. include automake-options.am
  36. FOO := bar
  37. END
  38. rm -rf autom4te*.cache
  39. : > automake-options.am
  40. echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
  41. $ACLOCAL
  42. AUTOMAKE_fails -Werror -Wall --foreign
  43. grep '^Makefile\.am:.*:=.*not portable' stderr
  44. rm -rf autom4te*.cache
  45. : > automake-options.am
  46. echo 'AM_INIT_AUTOMAKE([-Werror -Wnone gnu])' > am-init-automake.m4
  47. $ACLOCAL
  48. $AUTOMAKE
  49. rm -rf autom4te*.cache
  50. echo 'AUTOMAKE_OPTIONS = -Werror -Wnone gnits' > automake-options.am
  51. echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
  52. $ACLOCAL
  53. $AUTOMAKE
  54. :