txinfo-builddir.sh 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #! /bin/sh
  2. # Copyright (C) 2012-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 info files are built in builddir when needed.
  17. # This test that this can be done through the so far undocumented
  18. # option 'info-in-builddir', as requested by at least GCC, GDB,
  19. # GNU binutils and the GNU bfd library. See automake bug#11034.
  20. required='makeinfo tex texi2dvi'
  21. . test-init.sh
  22. if useless_vpath_rebuild; then
  23. skip_ "$MAKE has brittle VPATH support"
  24. fi
  25. echo AC_OUTPUT >> configure.ac
  26. cat > Makefile.am << 'END'
  27. AUTOMAKE_OPTIONS = info-in-builddir
  28. info_TEXINFOS = foo.texi subdir/bar.texi mu.texi
  29. subdir_bar_TEXINFOS = subdir/inc.texi
  30. CLEANFILES = mu.info
  31. # mu.info should not be rebuilt in the current directory, since
  32. # it's up-to-date in $(srcdir).
  33. # This can be caused by a subtle issue related to VPATH handling
  34. # of version.texi (see also the comment in texi-vers.am): because
  35. # stamp-vti is newer than version.texi, the 'version.texi: stamp-vti'
  36. # rule is always triggered. Still that's not a reason for 'make'
  37. # to think 'version.texi' has been created...
  38. check-local:
  39. test ! -e mu.info
  40. test -f $(srcdir)/mu.info
  41. END
  42. mkdir subdir
  43. cat > foo.texi << 'END'
  44. \input texinfo
  45. @setfilename foo.info
  46. @settitle foo
  47. @node Top
  48. Hello walls.
  49. @include version.texi
  50. @bye
  51. END
  52. cat > mu.texi << 'END'
  53. \input texinfo
  54. @setfilename mu.info
  55. @settitle mu
  56. @node Top
  57. Mu mu mu.
  58. @bye
  59. END
  60. cat > subdir/bar.texi << 'END'
  61. \input texinfo
  62. @setfilename bar.info
  63. @settitle bar
  64. @node Top
  65. Hello walls.
  66. @include inc.texi
  67. @bye
  68. END
  69. echo "I'm included." > subdir/inc.texi
  70. $ACLOCAL
  71. $AUTOMAKE --add-missing
  72. $AUTOCONF
  73. mkdir build
  74. cd build
  75. ../configure
  76. $MAKE info
  77. test -f foo.info
  78. test -f subdir/bar.info
  79. test -f mu.info
  80. test -f ../stamp-vti
  81. test -f ../version.texi
  82. test ! -e ../foo.info
  83. test ! -e ../subdir/bar.info
  84. test ! -e ../mu.info
  85. $MAKE clean
  86. test -f foo.info
  87. test -f subdir/bar.info
  88. test ! -e mu.info
  89. test -f ../stamp-vti
  90. test -f ../version.texi
  91. # Make sure stamp-vti is older that version.texi.
  92. # (A common situation in a real tree).
  93. $sleep
  94. touch ../stamp-vti
  95. $MAKE distcheck
  96. # Being distributed, this file should have been rebuilt.
  97. test -f mu.info
  98. $MAKE distclean
  99. test -f ../stamp-vti
  100. test -f ../version.texi
  101. test -f foo.info
  102. test -f subdir/bar.info
  103. test ! -e mu.info
  104. ../configure
  105. $MAKE maintainer-clean
  106. test ! -e ../stamp-vti
  107. test ! -e ../version.texi
  108. test ! -e stamp-vti
  109. test ! -e version.texi
  110. test ! -e foo.info
  111. test ! -e subdir/bar.info
  112. test ! -e mu.info
  113. :