This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH,libgomp] install-html target for libgomp


This patch adds the necessary bits to be able to install an HTML version
of the libgomp documentation; it also tweaks the documentation slightly
to work on case-insensitive filesystems.  (Similar tweaks have been done
for other GNU projects.)

Tested with cross to arm-none-linux-gnueabi by 'make install-html
install-pdf'.  OK to commit?

-Nathan

2009-06-23  Nathan Froyd  <froydnj@codesourcery.com>

	* libgomp.texi (Library Index): Renamed from "Index" to prevent
	conflict with index.html on case-insensitive filesystems.
	* configure.ac (datarootdir, docdir, pdfdir, htmldir): Add
	appropriate --with options and AC_SUBSTs.
	* configure: Regenerate.
	* Makefile.am (datarootdir, docdir, htmldir, pdfdir): Define.
	(HTMLS_INSTALL, HTMLS_BUILD): Define.
	($(HTMLS_BUILD)): New rule.
	(html__strip_dir): Define.
	(install-html): New rule.
	(TEXI2HTML): Define.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.

Index: configure
===================================================================
Index: configure.ac
===================================================================
--- configure.ac	(revision 148853)
+++ configure.ac	(working copy)
@@ -94,6 +94,30 @@ esac
 AC_SUBST(toolexecdir)
 AC_SUBST(toolexeclibdir)
 
+AC_ARG_WITH(datarootdir,
+[  --with-datarootdir=DIR  Use DIR as the data root [[PREFIX/share]]],
+datarootdir="\${prefix}/$with_datarootdir",
+datarootdir='$(prefix)/share')
+AC_SUBST(datarootdir)
+
+AC_ARG_WITH(docdir,
+[  --with-docdir=DIR       Install documentation in DIR [[DATAROOTDIR]]],
+docdir="\${prefix}/$with_docdir",
+docdir='$(datarootdir)')
+AC_SUBST(docdir)
+
+AC_ARG_WITH(pdfdir,
+[  --with-pdfdir           install pdf in this directory.],
+[pdfdir="\${prefix}/${withval}"],
+[pdfdir="\${docdir}"])
+AC_SUBST(pdfdir)
+
+AC_ARG_WITH(htmldir,
+[  --with-htmldir=DIR      html documentation in in DIR [[DOCDIR]]],
+htmldir="\${prefix}/$with_htmldir",
+htmldir='$(docdir)')
+AC_SUBST(htmldir)
+
 # Check the compiler.
 # The same as in boehm-gc and libstdc++. Have to borrow it from there.
 # We must force CC to /not/ be precious variables; otherwise
Index: libgomp.texi
===================================================================
--- libgomp.texi	(revision 148853)
+++ libgomp.texi	(working copy)
@@ -94,7 +94,7 @@ for multi-platform shared-memory paralle
                                How you can copy and share this manual.
 * Funding::                    How to help assure continued work for free 
                                software.
-* Index::                      Index of this documentation.
+* Library Index::              Index of this documentation.
 @end menu
 
 
@@ -1713,8 +1713,8 @@ Bugs in the GNU OpenMP implementation sh
 @c Index
 @c ---------------------------------------------------------------------
 
-@node Index
-@unnumbered Index
+@node Library Index
+@unnumbered Library Index
 
 @printindex cp
 
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 148853)
+++ Makefile.am	(working copy)
@@ -1,5 +1,10 @@
 ## Process this file with automake to produce Makefile.in
 
+datarootdir = @datarootdir@
+docdir = @docdir@
+htmldir = @htmldir@
+pdfdir = @pdfdir@
+
 ACLOCAL_AMFLAGS = -I .. -I ../config
 SUBDIRS = testsuite
 
@@ -55,10 +60,30 @@ fortran.o: libgomp_f.h
 env.lo: libgomp_f.h
 env.o: libgomp_f.h
 
+HTMLS_INSTALL=libgomp
+HTMLS_BUILD=libgomp/index.html
+
+$(HTMLS_BUILD): $(info_TEXINFOS)
+	$(TEXI2HTML) $(MAKEINFOFLAGS) -I$(srcdir) -o $(@D) $<
+
+html__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 
-# No install-html or install-pdf support in automake yet
-.PHONY: install-html install-pdf
-install-html:
+install-html: $(HTMLS_BUILD)
+	@$(NORMAL_INSTALL)
+	test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)"
+	@list='$(HTMLS_INSTALL)'; for p in $$list; do \
+	  if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \
+	  f=$(html__strip_dir) \
+	  if test -d "$$d$$p"; then \
+	    echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
+	    echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \
+	  else \
+	    echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \
+	    $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \
+	  fi; \
+	done
 
 install-pdf: $(PDFS)
 	@$(NORMAL_INSTALL)
@@ -76,6 +101,7 @@ install-pdf: $(PDFS)
 # `texinfo.tex' for your package. The value of this variable should be
 # the relative path from the current `Makefile.am' to `texinfo.tex'.
 TEXINFO_TEX   = ../gcc/doc/include/texinfo.tex
+TEXI2HTML = $(MAKEINFO) --html
 
 # Defines info, dvi, pdf and html targets
 MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
Index: Makefile.in
===================================================================
Index: testsuite/Makefile.in
===================================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]