extra-portability3.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 interactions between the 'portability-recursive' and
  17. # 'extra-portability' warning categories.
  18. . test-init.sh
  19. # We want (almost) complete control over automake options.
  20. AUTOMAKE="$am_original_AUTOMAKE --foreign -Werror"
  21. cat >>configure.ac <<END
  22. AC_PROG_CC
  23. AC_PROG_RANLIB
  24. AC_OUTPUT
  25. END
  26. $ACLOCAL
  27. cat >Makefile.am <<'END'
  28. baz = $(foo$(bar))
  29. lib_LIBRARIES = libfoo.a
  30. libfoo_a_SOURCES = foo.c
  31. END
  32. # 'extra-portability' implies 'portability-recursive'.
  33. AUTOMAKE_fails -Wextra-portability
  34. grep 'requires.*AM_PROG_AR' stderr
  35. grep 'recursive variable expansion' stderr
  36. # We can disable 'extra-portability' while leaving
  37. # 'portability-recursive' intact.
  38. AUTOMAKE_fails -Wportability-recursive -Wno-extra-portability
  39. grep 'requires.*AM_PROG_AR' stderr && exit 1
  40. grep 'recursive variable expansion' stderr
  41. # We can disable 'portability-recursive' while leaving
  42. # 'extra-portability' intact.
  43. AUTOMAKE_fails -Wextra-portability -Wno-portability-recursive
  44. grep 'requires.*AM_PROG_AR' stderr
  45. grep 'recursive variable expansion' stderr && exit 1
  46. # Disabling 'portability' disables 'portability-recursive' and
  47. # 'extra-portability'.
  48. $AUTOMAKE -Wextra-portability -Wno-portability
  49. :