colon2.sh 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #! /bin/sh
  2. # Copyright (C) 1996-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 ":" works with files automake generates.
  17. # See also sister test 'colon3.sh'.
  18. . test-init.sh
  19. cat > configure.ac <<END
  20. AC_INIT([$me], [1.0])
  21. AM_INIT_AUTOMAKE
  22. AC_CONFIG_FILES([Makefile:zardoz.in])
  23. AC_OUTPUT
  24. END
  25. cat > zardoz.am <<END
  26. .PHONY: dummy
  27. dummy:
  28. END
  29. $ACLOCAL
  30. $AUTOMAKE
  31. # Automake should have created zardoz.in.
  32. test -f zardoz.in
  33. # The generated file should refer to zardoz.in and zardoz.am, but
  34. # never just "zardoz".
  35. $FGREP 'zardoz.am' zardoz.in
  36. $FGREP 'zardoz.in' zardoz.in
  37. sed -e 's|zardoz\.am|zrdz.am|g' \
  38. -e 's|zardoz\.in|zrdz.in|g' \
  39. <zardoz.in | $FGREP 'zardoz' && exit 1
  40. # The configure-generated Makefile should depend on zardoz.in, two.in and
  41. # three.in. The automake-generated zardoz.in should depend on zardoz.am.
  42. # Let's do this check the right way by running configure and make.
  43. str='%% ZaR DoZ %%'
  44. $AUTOCONF
  45. ./configure
  46. test -f Makefile # Sanity check.
  47. $MAKE dummy
  48. # Again, make sure that the generated Makefile do not unduly
  49. # refer to 'zardoz' .
  50. $MAKE -n zardoz && exit 1
  51. $sleep
  52. cat >> zardoz.am <<END
  53. check-local: testam testin testmk
  54. .PHONY: testam testin testmk
  55. testam:
  56. grep '$str' \$(srcdir)/zardoz.am
  57. testin:
  58. grep '$str' \$(srcdir)/zardoz.in
  59. testmk:
  60. grep '$str' Makefile
  61. END
  62. $MAKE Makefile # For non-GNU make.
  63. $MAKE testam testin testmk
  64. $MAKE distcheck
  65. :