Module: xenomai-forge
Branch: next
Commit: 1195ce379963b045c933b499c21789db75c443a5
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=1195ce379963b045c933b499c21789db75c443a5

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Jul 30 18:37:20 2014 +0200

doc: consider pdfdir, htmldir, mandir when installing

---

 configure                |   13 +++++++++++--
 configure.ac             |   18 +++++++++++++++---
 doc/asciidoc/Makefile.in |   28 ++++++++++++++--------------
 doc/doxygen/Makefile.in  |   28 ++++++++++++++--------------
 doc/install-dist.rules   |   16 +++++++++-------
 5 files changed, 63 insertions(+), 40 deletions(-)

diff --git a/configure b/configure
index f5d8730..f99b007 100755
--- a/configure
+++ b/configure
@@ -13595,8 +13595,17 @@ if test x${XENO_BUILD_DOC} = xy -a x"$W3M" = x ; then
    as_fn_error $? "Missing the w3m tool to build the documentation" "$LINENO" 5
 fi
 
-if test x$docdir = x; then
-       docdir=$datadir/doc/$PACKAGE-$VERSION
+
+if test x$pdfdir = x'${docdir}'; then
+   pdfdir='${docdir}/pdf'
+fi
+
+if test x$mandir = x'${docdir}'; then
+   mandir='${docdir}/man'
+fi
+
+if test x$htmldir = x'${docdir}'; then
+   htmldir='${docdir}/html'
 fi
 
 
diff --git a/configure.ac b/configure.ac
index cf70c34..207ddb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -407,10 +407,22 @@ if test x${XENO_BUILD_DOC} = xy -a x"$W3M" = x ; then
    AC_MSG_ERROR([Missing the w3m tool to build the documentation])
 fi
 
-if test x$docdir = x; then
-       docdir=$datadir/doc/$PACKAGE-$VERSION
+dnl Set better default values for pdfdir, mandir and htmldir
+dnl This won't override user settings, unless the user wants
+dnl the default values, which we ban...
+
+if test x$pdfdir = x'${docdir}'; then
+   pdfdir='${docdir}/pdf'
+fi
+AC_SUBST(pdfdir)
+if test x$mandir = x'${docdir}'; then
+   mandir='${docdir}/man'
+fi
+AC_SUBST(mandir)
+if test x$htmldir = x'${docdir}'; then
+   htmldir='${docdir}/html'
 fi
-AC_SUBST(docdir)
+AC_SUBST(htmldir)
 
 XENO_RUN_DOC=y
 if test x$XENO_BUILD_DOC = x -a x$XENO_INSTALL_DOC = x; then
diff --git a/doc/asciidoc/Makefile.in b/doc/asciidoc/Makefile.in
index 522fa8a..e33a2be 100644
--- a/doc/asciidoc/Makefile.in
+++ b/doc/asciidoc/Makefile.in
@@ -245,6 +245,14 @@ build_vendor = @build_vendor@
 builddir = @builddir@
 datadir = @datadir@
 datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
 
 # -*- makefile -*-
 # Generic rules for installation and distribution of documentation.
@@ -258,14 +266,6 @@ datarootdir = @datarootdir@
 # can be from . or from a directory containing pre-built versions)
 #
 # PDF_DOCSDIR & MAN_DOCSDIR: same thing for pdf and man files.
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
 htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
@@ -594,7 +594,7 @@ uninstall-am: uninstall-local
 install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        docs="$(HTML_DOCS)"; abs_builddir=$$PWD; \
        for dir in $$docs; do \
-           dest=$(DESTDIR)$(docdir)/$$dir; \
+           dest=$(DESTDIR)$(htmldir)/$$dir; \
            $(mkinstalldirs) $$dest; \
            abs_dest=`cd $$dest && pwd` ; \
            cd $(HTML_DOCSDIR)$$dir || exit 1; \
@@ -607,14 +607,14 @@ install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        done
 
 install-pdfdocs: $(PDF_DOCS:%=$(PDF_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/pdf; \
+       docs="$^"; dest=$(DESTDIR)$(pdfdir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
        done
 
 install-mandocs: $(MAN_DOCS:%=$(MAN_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/man; \
+       docs="$^"; dest=$(DESTDIR)$(mandir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
@@ -655,9 +655,9 @@ dist-docs-hook: all-local dist-htmldocs dist-mandocs 
dist-pdfdocs
 # To make distcheck happy.
 uninstall-docs:
        if test -n "$(HTML_DOCS)" -o -n "$(PDF_DOCS)" -o -n "$(MAN_DOCS)"; then 
\
-           targets="$(HTML_DOCS:%=$(DESTDIR)$(docdir)/%) \
-               $(PDF_DOCS:%=$(DESTDIR)$(docdir)/pdf/%) \
-               $(MAN_DOCS:%=$(DESTDIR)$(docdir)/man/%)"; \
+           targets="$(HTML_DOCS:%=$(DESTDIR)$(htmldir)/%) \
+               $(PDF_DOCS:%=$(DESTDIR)$(pdfdir)/%) \
+               $(MAN_DOCS:%=$(DESTDIR)$(mandir)/%)"; \
            for t in $$targets; do \
                if test -d $$t; then $(RM) $$t/*; $(RM) -r $$t; \
                else $(RM) $$t; fi; \
diff --git a/doc/doxygen/Makefile.in b/doc/doxygen/Makefile.in
index a51490a..64da583 100644
--- a/doc/doxygen/Makefile.in
+++ b/doc/doxygen/Makefile.in
@@ -249,6 +249,14 @@ build_vendor = @build_vendor@
 builddir = @builddir@
 datadir = @datadir@
 datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
 
 # -*- makefile -*-
 # Generic rules for installation and distribution of documentation.
@@ -262,14 +270,6 @@ datarootdir = @datarootdir@
 # can be from . or from a directory containing pre-built versions)
 #
 # PDF_DOCSDIR & MAN_DOCSDIR: same thing for pdf and man files.
-docdir = @docdir@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
 htmldir = @htmldir@
 includedir = @includedir@
 infodir = @infodir@
@@ -541,7 +541,7 @@ uninstall-am: uninstall-local
 install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        docs="$(HTML_DOCS)"; abs_builddir=$$PWD; \
        for dir in $$docs; do \
-           dest=$(DESTDIR)$(docdir)/$$dir; \
+           dest=$(DESTDIR)$(htmldir)/$$dir; \
            $(mkinstalldirs) $$dest; \
            abs_dest=`cd $$dest && pwd` ; \
            cd $(HTML_DOCSDIR)$$dir || exit 1; \
@@ -554,14 +554,14 @@ install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        done
 
 install-pdfdocs: $(PDF_DOCS:%=$(PDF_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/pdf; \
+       docs="$^"; dest=$(DESTDIR)$(pdfdir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
        done
 
 install-mandocs: $(MAN_DOCS:%=$(MAN_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/man; \
+       docs="$^"; dest=$(DESTDIR)$(mandir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
@@ -602,9 +602,9 @@ dist-docs-hook: all-local dist-htmldocs dist-mandocs 
dist-pdfdocs
 # To make distcheck happy.
 uninstall-docs:
        if test -n "$(HTML_DOCS)" -o -n "$(PDF_DOCS)" -o -n "$(MAN_DOCS)"; then 
\
-           targets="$(HTML_DOCS:%=$(DESTDIR)$(docdir)/%) \
-               $(PDF_DOCS:%=$(DESTDIR)$(docdir)/pdf/%) \
-               $(MAN_DOCS:%=$(DESTDIR)$(docdir)/man/%)"; \
+           targets="$(HTML_DOCS:%=$(DESTDIR)$(htmldir)/%) \
+               $(PDF_DOCS:%=$(DESTDIR)$(pdfdir)/%) \
+               $(MAN_DOCS:%=$(DESTDIR)$(mandir)/%)"; \
            for t in $$targets; do \
                if test -d $$t; then $(RM) $$t/*; $(RM) -r $$t; \
                else $(RM) $$t; fi; \
diff --git a/doc/install-dist.rules b/doc/install-dist.rules
index 02b7cfd..eac6355 100644
--- a/doc/install-dist.rules
+++ b/doc/install-dist.rules
@@ -10,14 +10,16 @@
 # can be from . or from a directory containing pre-built versions)
 #
 # PDF_DOCSDIR & MAN_DOCSDIR: same thing for pdf and man files.
-docdir=@docdir@
+htmldir=@htmldir@
+mandir=@mandir@
+pdfdir=@pdfdir@
 doc_top_distdir=$(top_builddir)/$(PACKAGE)-$(VERSION)
 GEN_DOC_DIST_ROOT=$(doc_top_distdir)/doc/prebuilt
 
 install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        docs="$(HTML_DOCS)"; abs_builddir=$$PWD; \
        for dir in $$docs; do \
-           dest=$(DESTDIR)$(docdir)/$$dir; \
+           dest=$(DESTDIR)$(htmldir)/$$dir; \
            $(mkinstalldirs) $$dest; \
            abs_dest=`cd $$dest && pwd` ; \
            cd $(HTML_DOCSDIR)$$dir || exit 1; \
@@ -30,14 +32,14 @@ install-htmldocs: $(HTML_DOCS:%=$(HTML_DOCSDIR)%)
        done
 
 install-pdfdocs: $(PDF_DOCS:%=$(PDF_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/pdf; \
+       docs="$^"; dest=$(DESTDIR)$(pdfdir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
        done
 
 install-mandocs: $(MAN_DOCS:%=$(MAN_DOCSDIR)%)
-       docs="$^"; dest=$(DESTDIR)$(docdir)/man; \
+       docs="$^"; dest=$(DESTDIR)$(mandir); \
        $(mkinstalldirs) $$dest && \
        for f in $$docs; do \
            $(INSTALL_DATA) $$f $$dest; \
@@ -78,9 +80,9 @@ dist-docs-hook: all-local dist-htmldocs dist-mandocs 
dist-pdfdocs
 # To make distcheck happy.
 uninstall-docs:
        if test -n "$(HTML_DOCS)" -o -n "$(PDF_DOCS)" -o -n "$(MAN_DOCS)"; then 
\
-           targets="$(HTML_DOCS:%=$(DESTDIR)$(docdir)/%) \
-               $(PDF_DOCS:%=$(DESTDIR)$(docdir)/pdf/%) \
-               $(MAN_DOCS:%=$(DESTDIR)$(docdir)/man/%)"; \
+           targets="$(HTML_DOCS:%=$(DESTDIR)$(htmldir)/%) \
+               $(PDF_DOCS:%=$(DESTDIR)$(pdfdir)/%) \
+               $(MAN_DOCS:%=$(DESTDIR)$(mandir)/%)"; \
            for t in $$targets; do \
                if test -d $$t; then $(RM) $$t/*; $(RM) -r $$t; \
                else $(RM) $$t; fi; \


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to