warnings-strictness-interactions.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 the default warnings triggered by a strictness specified
  17. # in AUTOMAKE_OPTIONS take precedence over explicit warnings given in
  18. # AM_INIT_AUTOMAKE.
  19. . test-init.sh
  20. # We want (almost) complete control over automake options.
  21. AUTOMAKE="$am_original_AUTOMAKE -Werror"
  22. cat > Makefile.am <<END
  23. AUTOMAKE_OPTIONS =
  24. FOO := bar
  25. END
  26. set_am_opts ()
  27. {
  28. set +x
  29. sed <$2 >$2-t -e "s|^\\(AUTOMAKE_OPTIONS\\) *=.*|\\1 = $1|" \
  30. -e "s|^\\(AM_INIT_AUTOMAKE\\).*|\\1([$1])|"
  31. mv -f $2-t $2
  32. set -x
  33. cat $2
  34. }
  35. set_am_opts '-Wportability' configure.ac
  36. set_am_opts 'foreign' Makefile.am
  37. $ACLOCAL
  38. $AUTOMAKE
  39. rm -rf autom4te*.cache
  40. # Files required in gnu strictness.
  41. touch README INSTALL NEWS AUTHORS ChangeLog COPYING
  42. set_am_opts '-Wno-portability' configure.ac
  43. set_am_opts 'gnu' Makefile.am
  44. AUTOMAKE_fails
  45. $ACLOCAL
  46. grep '^Makefile\.am:2:.*:=.*not portable' stderr
  47. :