colon6.sh 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #! /bin/sh
  2. # Copyright (C) 1998-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. # Yet another multi-":" test, this time from Ken Pizzini.
  17. . test-init.sh
  18. cat > configure.ac <<END
  19. AC_INIT([$me], [1.0])
  20. AM_INIT_AUTOMAKE
  21. # With this, version.good should depend on version.gin, while
  22. # Makefile should not depend on either of them.
  23. AC_CONFIG_FILES([demo/Makefile demo/version.good:demo/version.gin])
  24. AC_OUTPUT
  25. END
  26. mkdir demo
  27. : > demo/version.gin
  28. : > demo/Makefile.am
  29. $ACLOCAL
  30. $AUTOMAKE
  31. # These are older "grepping checks", kept mostly for backward-compatibility.
  32. # They might (unlikely, but possibly) require updating when automake
  33. # internals are changed. Just relax or remove if they become too fragile.
  34. $EGREP 'Makefile:.*(demo|version)' demo/Makefile.in && exit 1
  35. grep 'version\.good:.*version\.gin' demo/Makefile.in
  36. $AUTOCONF
  37. for vpath in : false; do
  38. if $vpath; then
  39. srcdir=..
  40. mkdir build
  41. cd build
  42. else
  43. srcdir=.
  44. fi
  45. $srcdir/configure
  46. test -f demo/version.good # Sanity check.
  47. test ! -s demo/version.good # Likewise.
  48. cd demo
  49. $sleep
  50. # HP-UX make considers targets with exact time stamps as one of their
  51. # prerequisites out of date. Ensure Makefile is newer than config.status to
  52. # avoid triggering the am--refresh rule in the (here-nonexistent) toplevel
  53. # Makefile.
  54. touch Makefile
  55. # version.good should depend on version.gin.
  56. echo "Rebuilt (srcdir=$srcdir)" > ../$srcdir/demo/version.gin
  57. $MAKE version.good
  58. $FGREP "Rebuilt (srcdir=$srcdir)" version.good
  59. # Makefile should not depend on version.good.
  60. rm -f version.good
  61. $MAKE Makefile
  62. test ! -e version.good
  63. # version.good should be rebuilt from version.gin.
  64. $MAKE version.good
  65. test -f version.good
  66. # Makefile should not depend on version.gin.
  67. rm -f ../$srcdir/demo/version.gin
  68. $MAKE Makefile
  69. test ! -e ../$srcdir/demo/version.gin # Sanity check.
  70. # version.good should depend on version.gin.
  71. rm -f version.good
  72. run_make -M -e FAIL version.good
  73. # Try to verify that we errored out for the right reason.
  74. $FGREP version.gin output
  75. cd .. # Back in top builddir.
  76. cd $srcdir
  77. # Re-create it for the next pass (if any).
  78. : > demo/version.gin
  79. done
  80. :