From 94ca0708a2c3151fe7e92f97bb4ebeb65cb029c9 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 21 Feb 2013 19:19:48 -0600 Subject: doc: Support texi2any and texi2html This was tested with texi2html-1.82-5.1.el6.noarch and a locally built texinfo 5.0. These are completely different implementations and require different invocations. The Makefile dependencies appear to work but are likely not perfect at this point. The key point is that the autoconf probe detects which to use and responds accordingly with preference given to texi2any. --- doc/configure.ac | 11 +++++++++++ doc/index.html.in | 24 ++++++++++++------------ doc/main.am | 8 ++++++++ doc/project.am | 36 +++++++++++++++++++++++++++++------- doc/texi2any_init.in | 20 ++++++++++++++++++++ 5 files changed, 80 insertions(+), 19 deletions(-) create mode 100644 doc/texi2any_init.in (limited to 'doc') diff --git a/doc/configure.ac b/doc/configure.ac index eaa50e984e..7c8a69c7fc 100644 --- a/doc/configure.ac +++ b/doc/configure.ac @@ -75,8 +75,18 @@ AC_PROG_LN_S AC_CHECK_PROGS(PERL,perl) +AC_CHECK_PROGS(TEXI2ANY,texi2any) +AC_SUBST(TEXI2ANY) +AM_CONDITIONAL(USE_TEXI2ANY, + test "$enable_html" = "yes" \ + && test x"$TEXI2ANY" != x"") + AC_CHECK_PROGS(TEXI2HTML,texi2html) AC_SUBST(TEXI2HTML) +AM_CONDITIONAL(USE_TEXI2HTML, + test "$enable_html" = "yes" \ + && test x"$TEXI2ANY" = x"" \ + && test x"$TEXI2HTML" != x"") AC_CHECK_PROGS(GS,gs) AM_CONDITIONAL(GS,test x"$GS" != x"") @@ -169,5 +179,6 @@ new_chapters/Makefile cpu_supplement/Makefile shell/Makefile texi2html_init +texi2any_init ]) AC_OUTPUT diff --git a/doc/index.html.in b/doc/index.html.in index 0eb9c71943..824a9724b7 100644 --- a/doc/index.html.in +++ b/doc/index.html.in @@ -16,7 +16,7 @@ - + Getting Started with RTEMS @@ -26,7 +26,7 @@ - + RTEMS Applications C User's Guide @@ -36,7 +36,7 @@ - + RTEMS POSIX API User's Guide @@ -46,7 +46,7 @@ - + RTEMS TCP/IP Networking Supplement @@ -56,7 +56,7 @@ - + RTEMS Shell User's Guide @@ -68,7 +68,7 @@ - + RTEMS Applications Ada User's Guide @@ -81,7 +81,7 @@ - + RTEMS BSP and Device Driver Development Guide @@ -91,7 +91,7 @@ - + RTEMS CPU Architecture Supplement @@ -101,7 +101,7 @@ - + RTEMS Development Environment Guide @@ -111,7 +111,7 @@ - + RTEMS Porting Guide @@ -121,7 +121,7 @@ - + RTEMS POSIX 1003.1 Compliance Guide @@ -131,7 +131,7 @@ - + RTEMS Filesystem Design Guide diff --git a/doc/main.am b/doc/main.am index 3df1dd66ed..c19f7e6a25 100644 --- a/doc/main.am +++ b/doc/main.am @@ -4,5 +4,13 @@ endif TEXI2HTML_ARGS=\ -D use-html --split node \ +-o ./ \ +--top-file index.html \ --init-file=$(top_builddir)/texi2html_init \ -I $(srcdir) -I $(top_srcdir) -I $(top_builddir) -I . + +TEXI2ANY_ARGS=\ +--html -D use-html --split node \ +-o ./ \ +--init-file=$(top_builddir)/texi2any_init \ +-I $(srcdir) -I $(top_srcdir) -I $(top_builddir) -I . diff --git a/doc/project.am b/doc/project.am index fcc96c14b4..6a8778bfc5 100644 --- a/doc/project.am +++ b/doc/project.am @@ -1,4 +1,4 @@ -# HACK: makeinfo is locale sensitive +# HACK: makeinfo is locale sensitive LANG=C SUFFIXES = .t @@ -37,20 +37,42 @@ CLEANFILES += $(PROJECT).pdf MOSTLYCLEANFILES += $(PDF_IMAGES) -## HTML +## HTML SUFFIXES += .html -$(PROJECT)*.html: $(PROJECT).texi $($(PROJECT)_TEXINFOS) +if USE_HTML + +<<<<<<< HEAD +html_project_DATA = +======= +html_project_DATA = +MOSTLYCLEANFILES += $(PROJECT)*.html +html_project_DATA += *.html +>>>>>>> bdf959d... doc/project.am: Fix whitespace at EOL + +if USE_TEXI2HTML +index.html $(PROJECT)*.html: $(PROJECT).texi $($(PROJECT)_TEXINFOS) rm -rf $(PROJECT).html $(TEXI2HTML) $(TEXI2HTML_ARGS) --menu $< $< -rm -rf $(PROJECT) MOSTLYCLEANFILES += $(PROJECT)*.html -## Common installation points -if USE_HTML -html_project_DATA = $(PROJECT)*.html -endif +html_project_DATA += index.html $(PROJECT)*.html +endif # USE_TEXI2HTML + +if USE_TEXI2ANY +index.html *.html: $(PROJECT).texi $($(PROJECT)_TEXINFOS) + rm -rf $(PROJECT).html + $(TEXI2ANY) $(TEXI2ANY_ARGS) $< + +MOSTLYCLEANFILES += $(PROJECT)/*.html + +html_project_DATA += *.html +endif # USE_TEXI2ANY + +endif # USE_HTML + if USE_DVI dvi_DATA = $(PROJECT).dvi diff --git a/doc/texi2any_init.in b/doc/texi2any_init.in new file mode 100644 index 0000000000..d70517ea8b --- /dev/null +++ b/doc/texi2any_init.in @@ -0,0 +1,20 @@ +set_from_init_file ('AFTER_BODY_OPEN', +' +RTEMS
+Logo +

RTEMS @VERSION@ On-Line Library

+'); + +texinfo_register_handler('setup', \&add_button); + +my $button_text = 'Directory'; +sub add_button($) +{ + my $self = shift; + foreach my $button_type ('SECTION_BUTTONS', 'CHAPTER_BUTTONS', + 'MISC_BUTTONS', 'TOP_BUTTONS') { + my $buttons = $self->get_conf($button_type); + push @$buttons, \$button_text; + } + return 1; +} -- cgit v1.2.3