output10.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #! /bin/sh
  2. # Copyright (C) 2003-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. # Make sure an AC_CONFIG_FILES can have an AC_CONFIG_FILES output as input.
  17. # This is comparable to 'output9.sh', but testing Makefile rules.
  18. # PR/411
  19. . test-init.sh
  20. cat >> configure.ac << END
  21. AC_SUBST([FOO], [top])
  22. AC_SUBST([BAR], [bot])
  23. AC_CONFIG_FILES([a/top])
  24. AC_CONFIG_FILES([a/bot])
  25. AC_CONFIG_FILES([b/Makefile:a/top:b/Makefile.in:a/bot])
  26. AC_OUTPUT
  27. END
  28. mkdir a
  29. mkdir b
  30. cat >Makefile.am <<\EOF
  31. SUBDIRS = b
  32. dist-hook:
  33. test ! -f $(distdir)/a/top
  34. test ! -f $(distdir)/a/bot
  35. EOF
  36. cat >b/Makefile.am <<\EOF
  37. output:
  38. echo $(TOP)$(BOT) > ok
  39. EOF
  40. echo TOP=@FOO@ >a/top.in
  41. echo BOT=@BAR@ >a/bot.in
  42. $ACLOCAL
  43. $AUTOCONF
  44. $AUTOMAKE
  45. mkdir build
  46. cd build
  47. ../configure
  48. cd b
  49. $MAKE output
  50. grep topbot ok
  51. cd ..
  52. $MAKE distcheck