remake-am-pr10111.sh 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 our remake rules doesn't give spurious successes in
  17. # some corner case situations where they should actually fail.
  18. # See automake bug#10111.
  19. # To be clear, we are speaking about *very* corner-case situations here,
  20. # and the fact that the remake rules might get confused in them is not a
  21. # big deal in practice (in fact, this test *currently fails*). Still,
  22. # keeping the limitation exposed is a good idea anyway.
  23. . test-init.sh
  24. cat >> configure.ac <<'END'
  25. AC_OUTPUT
  26. END
  27. : > foobar.am
  28. cat > Makefile.am <<'END'
  29. include $(srcdir)/foobar.am
  30. $(srcdir)/foobar.am:
  31. ## Creative quoting is to avoid spurious matches in the grepping
  32. ## of Makefile.in, later.
  33. echo "mu =" foobar "was here =" > $@
  34. END
  35. $ACLOCAL
  36. $AUTOCONF
  37. $AUTOMAKE
  38. ./configure
  39. # OK, so the developer wants to interactively try out how the
  40. # "distributed form" of his package behaves.
  41. $MAKE distdir
  42. cd $distdir
  43. # He's interested in trying out a VPATH build.
  44. mkdir build
  45. cd build
  46. ../configure
  47. # He wants to verify that the rules he's written to rebuild a file
  48. # included by configure.ac works also in VPATH builds.
  49. rm -f ../foobar.am
  50. $MAKE
  51. grep '= foobar was here =' ../Makefile.in
  52. $MAKE distcheck
  53. :