remake-m4-pr10111.sh 1.7 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 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. m4_include([foobar.m4])
  26. AC_OUTPUT
  27. END
  28. : > foobar.m4
  29. cat > Makefile.am <<'END'
  30. $(srcdir)/foobar.m4:
  31. echo ': foobar was here :' > $@
  32. END
  33. $ACLOCAL
  34. $AUTOCONF
  35. $AUTOMAKE
  36. ./configure
  37. # OK, so the developer wants to interactively try out how the
  38. # "distributed form" of his package behaves.
  39. $MAKE distdir
  40. cd $distdir
  41. # He's interested in trying out a VPATH build.
  42. mkdir build
  43. cd build
  44. ../configure
  45. # He wants to verify that the rules he's written to rebuild a file
  46. # included by configure.ac works also in VPATH builds.
  47. rm -f ../foobar.m4
  48. $MAKE
  49. grep ': foobar was here :' ../configure
  50. $MAKE distcheck
  51. :