amopts-location.sh 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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 errors about AUTOMAKE_OPTIONS refers to correct
  17. # locations.
  18. . test-init.sh
  19. cat > Makefile.am <<'END'
  20. # comment \
  21. # continued
  22. include Makefile0.am
  23. END
  24. cat > Makefile0.am <<'END'
  25. #1
  26. #2
  27. #3
  28. include Makefile1.am
  29. END
  30. cat > Makefile1.am <<'END'
  31. AUTOMAKE_OPTIONS = tar-pax
  32. # comment
  33. END
  34. cat > Makefile2.am <<'END'
  35. ## automake comment
  36. bar:
  37. :
  38. line = \
  39. continued
  40. AUTOMAKE_OPTIONS = tar-ustar
  41. END
  42. cat > Makefile3.am <<'END'
  43. quux = a
  44. AUTOMAKE_OPTIONS =
  45. quux += b
  46. AUTOMAKE_OPTIONS += tar-v7
  47. zardoz = 1
  48. END
  49. cat >>configure.ac <<'END'
  50. AC_CONFIG_FILES([Makefile2 Makefile3])
  51. END
  52. $ACLOCAL
  53. # Automake options 'tar-v7', 'tar-ustar' and 'tar-pax' can only be used
  54. # as argument to AM_INIT_AUTOMAKE, and not in AUTOMAKE_OPTIONS.
  55. AUTOMAKE_fails
  56. # Check that all the expected line numbers are correctly reported
  57. # in automake warning/error messages.
  58. grep '^Makefile1\.am:1:.*tar-pax' stderr
  59. grep '^Makefile2\.am:6:.*tar-ustar' stderr
  60. grep '^Makefile3\.am:2:.*tar-v7' stderr
  61. grep '^Makefile\.am:3:.*Makefile0\.am.*included from here' stderr
  62. grep '^Makefile0\.am:4:.*Makefile1\.am.*included from here' stderr
  63. # And also check that no botched line number is reported.
  64. cat stderr \
  65. | grep -v '^Makefile\.am:3:' \
  66. | grep -v '^Makefile0\.am:4:' \
  67. | grep -v '^Makefile1\.am:1:' \
  68. | grep -v '^Makefile2\.am:6:' \
  69. | grep -v '^Makefile3\.am:2:' \
  70. | grep . && exit 1
  71. :