txinfo-many-output-formats-vpath.sh 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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. # Test support for building HTML documentation, and the many
  17. # install-DOC flavors, in VPATH builds.
  18. # Keep in sync with sister test 'txinfo-many-output-formats.sh'.
  19. # FIXME: in the long term, the best thing to do is probably to convert
  20. # FIXME: this test and that sister test to TAP, and merge them.
  21. required='makeinfo tex texi2dvi'
  22. . test-init.sh
  23. cat >>configure.ac <<\EOF
  24. AC_CONFIG_FILES([rec/Makefile])
  25. # At the time of writing, Autoconf does not supplies any of these
  26. # definitions (and those below are purposely not those of the standard).
  27. AC_SUBST([dvidir], ['${datadir}/${PACKAGE}/dvi'])
  28. AC_SUBST([htmldir], ['${datadir}/${PACKAGE}/html'])
  29. AC_SUBST([pdfdir], ['${datadir}/${PACKAGE}/pdf'])
  30. AC_SUBST([psdir], ['${datadir}/${PACKAGE}/ps'])
  31. AC_OUTPUT
  32. EOF
  33. cat > Makefile.am << 'END'
  34. SUBDIRS = rec
  35. info_TEXINFOS = main.texi sub/main2.texi
  36. END
  37. cat > main.texi << 'END'
  38. \input texinfo
  39. @setfilename main.info
  40. @settitle main
  41. @node Top
  42. Hello walls.
  43. @bye
  44. END
  45. mkdir sub
  46. cat > sub/main2.texi << 'END'
  47. \input texinfo
  48. @setfilename main2.info
  49. @settitle main2
  50. @node Top
  51. Hello walls.
  52. @bye
  53. END
  54. mkdir rec
  55. cat > rec/main3.texi << 'END'
  56. \input texinfo
  57. @setfilename main3.info
  58. @settitle main3
  59. @node Top
  60. Hello walls.
  61. @bye
  62. END
  63. cat > rec/Makefile.am << 'END'
  64. info_TEXINFOS = main3.texi
  65. install-pdf-local:
  66. @$(MKDIR_P) "$(pdfdir)"
  67. : > "$(pdfdir)/hello"
  68. uninstall-local:
  69. rm -f "$(pdfdir)/hello"
  70. check-local: ps pdf dvi html # For "make distcheck".
  71. END
  72. $ACLOCAL
  73. $AUTOMAKE --add-missing
  74. $AUTOCONF
  75. # To simplify syncing with sister test 'txinfo-many-output-formats.sh'
  76. srcdir=..
  77. if test $srcdir = ..; then
  78. mkdir build
  79. cd build
  80. fi
  81. $srcdir/configure --prefix="$(pwd)"
  82. $MAKE
  83. $sleep
  84. # Test production of split-per-node HTML.
  85. $MAKE html
  86. test -d main.html
  87. test -d sub/main2.html
  88. test -d rec/main3.html
  89. # Rebuilding main.html should cause its timestamp to be updated.
  90. is_newest main.html $srcdir/main.texi
  91. $sleep
  92. touch $srcdir/main.texi
  93. $MAKE html
  94. is_newest main.html $srcdir/main.texi
  95. $MAKE clean
  96. test ! -e main.html
  97. test ! -e sub/main2.html
  98. test ! -e rec/main3.html
  99. # Test production of a single HTML file.
  100. run_make MAKEINFOFLAGS=--no-split html
  101. test -f main.html
  102. test -f sub/main2.html
  103. test -f rec/main3.html
  104. $MAKE clean
  105. test ! -e main.html
  106. test ! -e sub/main2.html
  107. test ! -e rec/main3.html
  108. # Make sure AM_MAKEINFOHTMLFLAGS is supported, and override AM_MAKEINFO.
  109. cp $srcdir/Makefile.am $srcdir/Makefile.sav
  110. cat >> $srcdir/Makefile.am <<'EOF'
  111. AM_MAKEINFOHTMLFLAGS = --no-headers --no-split
  112. AM_MAKEINFOFLAGS = --unsupported-option
  113. EOF
  114. (cd $srcdir && $AUTOMAKE)
  115. ./config.status Makefile
  116. $MAKE html
  117. test -f main.html
  118. test -f sub/main2.html
  119. test -d rec/main3.html
  120. $MAKE clean
  121. test ! -e main.html
  122. test ! -e sub/main2.html
  123. test ! -e rec/main3.html
  124. $MAKE install-html
  125. test -f share/$me/html/main.html
  126. test -f share/$me/html/main2.html
  127. test -d share/$me/html/main3.html
  128. $MAKE uninstall
  129. test ! -e share/$me/html/main.html
  130. test ! -e share/$me/html/main2.html
  131. test ! -e share/$me/html/main3.html
  132. $MAKE dvi
  133. test -f main.dvi
  134. test -f sub/main2.dvi
  135. test -f rec/main3.dvi
  136. $MAKE clean
  137. test ! -e main.dvi
  138. test ! -e sub/main2.dvi
  139. test ! -e rec/main3.dvi
  140. $MAKE install-dvi
  141. test -f share/$me/dvi/main.dvi
  142. test -f share/$me/dvi/main2.dvi
  143. test -f share/$me/dvi/main3.dvi
  144. $MAKE uninstall
  145. test ! -e share/$me/dvi/main.dvi
  146. test ! -e share/$me/dvi/main2.dvi
  147. test ! -e share/$me/dvi/main3.dvi
  148. dvips --help || skip_ "dvips is missing"
  149. $MAKE install-ps
  150. test -f share/$me/ps/main.ps
  151. test -f share/$me/ps/main2.ps
  152. test -f share/$me/ps/main3.ps
  153. $MAKE uninstall
  154. test ! -e share/$me/ps/main.ps
  155. test ! -e share/$me/ps/main2.ps
  156. test ! -e share/$me/ps/main3.ps
  157. pdfetex --help || pdftex --help \
  158. || skip_ "pdftex and pdfetex are both missing"
  159. $MAKE install-pdf
  160. test -f share/$me/pdf/main.pdf
  161. test -f share/$me/pdf/main2.pdf
  162. test -f share/$me/pdf/main3.pdf
  163. test -f share/$me/pdf/hello
  164. $MAKE uninstall
  165. test ! -e share/$me/pdf/main.pdf
  166. test ! -e share/$me/pdf/main2.pdf
  167. test ! -e share/$me/pdf/main3.pdf
  168. test ! -e share/$me/pdf/hello
  169. # Restore the makefile without a broken AM_MAKEINFOFLAGS definition.
  170. cp -f $srcdir/Makefile.sav $srcdir/Makefile.am
  171. using_gmake || $MAKE Makefile
  172. $MAKE distcheck
  173. :