colon3.sh 2.2 KB

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