remake-deleted-am.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 inclusion of '.am' fragments by automake does not suffer
  17. # of the "deleted header problem". Basic checks are done here.
  18. . test-init.sh
  19. echo AC_OUTPUT >> configure.ac
  20. $ACLOCAL
  21. $AUTOCONF
  22. cat > Makefile.am <<'END'
  23. include foo.am
  24. include $(srcdir)/bar.am
  25. include $(top_srcdir)/baz.am
  26. END
  27. echo '# this is foo' > foo.am
  28. echo '# this is bar' > bar.am
  29. echo '# this is baz' > baz.am
  30. $AUTOMAKE
  31. # Sanity checks.
  32. $FGREP 'this is foo' Makefile.in
  33. $FGREP 'this is bar' Makefile.in
  34. $FGREP 'this is baz' Makefile.in
  35. ./configure
  36. $MAKE # Should be no-op.
  37. $sleep
  38. sed '/^include foo\.am$/d' Makefile.am > t
  39. mv -f t Makefile.am
  40. rm -f foo.am
  41. $MAKE Makefile
  42. # Sanity checks.
  43. $FGREP 'this is foo' Makefile.in Makefile && exit 1
  44. $FGREP 'this is bar' Makefile.in
  45. $FGREP 'this is bar' Makefile
  46. $FGREP 'this is baz' Makefile.in
  47. $FGREP 'this is baz' Makefile
  48. $sleep
  49. echo '# empty empty' > Makefile.am
  50. rm -f bar.am baz.am
  51. $MAKE Makefile
  52. # Sanity checks.
  53. $FGREP 'empty empty' Makefile.in
  54. $FGREP 'empty empty' Makefile
  55. grep 'this is ba[rz]' Makefile Makefile.in && exit 1
  56. :