remake-deleted-am-2.sh 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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". This test checks deeper inclusion
  18. # stacks, and use VPATH builds.
  19. . test-init.sh
  20. echo AC_OUTPUT >> configure.ac
  21. $ACLOCAL
  22. $AUTOCONF
  23. cat > Makefile.am <<'END'
  24. include $(srcdir)/foo.am
  25. END
  26. cat > foo.am <<'END'
  27. # this is foo
  28. include sub/bar.am
  29. include baz.am
  30. END
  31. mkdir sub
  32. echo 'include $(top_srcdir)/sub/zardoz.am' > sub/bar.am
  33. echo '# this is zardoz' > sub/zardoz.am
  34. echo 'include fnord.am' > baz.am
  35. echo '# you are not seeing this' > fnord.am
  36. $AUTOMAKE
  37. # Sanity checks.
  38. $FGREP 'this is zardoz' Makefile.in
  39. $FGREP 'you are not seeing this' Makefile.in
  40. mkdir build
  41. cd build
  42. srcdir=..
  43. $srcdir/configure
  44. $MAKE
  45. $sleep
  46. echo '# this is baz' > $srcdir/baz.am
  47. rm -f $srcdir/fnord.am
  48. $MAKE
  49. # Sanity checks.
  50. $FGREP 'you are not seeing this' $srcdir/Makefile.in Makefile && exit 1
  51. $FGREP 'this is baz' $srcdir/Makefile.in
  52. $FGREP 'this is baz' Makefile
  53. $sleep
  54. rm -rf $srcdir/sub $srcdir/foo.am $srcdir/baz.am
  55. echo '# no more inclusions' > $srcdir/Makefile.am
  56. $MAKE
  57. # Sanity checks.
  58. $EGREP 'this is (foo|bar|baz)' Makefile $srcdir/Makefile.in && exit 1
  59. $FGREP 'no more inclusions' Makefile
  60. :