]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
Build: Add --enable-doxygen to generate and install API docs
authorLasse Collin <lasse.collin@tukaani.org>
Sat, 27 Apr 2024 14:47:09 +0000 (17:47 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 30 Apr 2024 14:09:08 +0000 (17:09 +0300)
It requires Doxygen. This option is disabled by default.

INSTALL
configure.ac
src/liblzma/api/Makefile.am

diff --git a/INSTALL b/INSTALL
index ad924fe512a6a489f66084abed20e62545cc3f1c..37c40055fb484e4790b4e5e67762a22c4d3a92c0 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -352,6 +352,12 @@ XZ Utils Installation
                 will still be installed. The $docdir can be changed
                 with --docdir=DIR.
 
+    --enable-doxygen
+                Enable generation of the HTML version of the liblzma API
+                documentation using Doxygen. The resulting files are
+                installed to $docdir/api. This option assumes that
+                the 'doxygen' tool is available.
+
     --disable-assembler
                 This disables CRC32 and CRC64 assembly code on
                 32-bit x86. This option currently does nothing
index 68a02c97a5068650e8865d9aee394f784f8877f3..2e3320f0ec1a700e734c314b03088700a929927b 100644 (file)
@@ -516,10 +516,18 @@ AM_CONDITIONAL([COND_SCRIPTS], [test x$enable_scripts != xno])
 
 AC_ARG_ENABLE([doc], [AS_HELP_STRING([--disable-doc],
                [do not install documentation files to docdir
-               (man pages will still be installed)])],
+               (man pages are still installed and,
+               if --enable-doxygen is used,
+               liblzma API documentation is installed too)])],
        [], [enable_doc=yes])
 AM_CONDITIONAL([COND_DOC], [test x$enable_doc != xno])
 
+AC_ARG_ENABLE([doxygen], [AS_HELP_STRING([--enable-doxygen],
+               [generate HTML version of the liblzma API documentation
+               using Doxygen and install the result to docdir])],
+       [], [enable_doxygen=no])
+AM_CONDITIONAL([COND_DOXYGEN], [test x$enable_doxygen != xno])
+
 
 ##############
 # Sandboxing #
index a7cb3c47a640779376f613fb8cb895185d9c896d..4f91c77a60fba9df42a1f00be929b63dc1b948c9 100644 (file)
@@ -17,3 +17,22 @@ nobase_include_HEADERS = \
        lzma/stream_flags.h \
        lzma/version.h \
        lzma/vli.h
+
+if COND_DOXYGEN
+$(top_builddir)/doc/api/index.html: $(top_srcdir)/doxygen/update-doxygen $(top_srcdir)/doxygen/Doxyfile $(nobase_include_HEADERS)
+       $(MKDIR_P) "$(top_builddir)/doc"
+       "$(top_srcdir)/doxygen/update-doxygen" api \
+               "$(top_srcdir)" "$(top_builddir)/doc"
+
+all-local: $(top_builddir)/doc/api/index.html
+
+install-data-local:
+       $(MKDIR_P) "$(DESTDIR)$(docdir)/api"
+       $(INSTALL_DATA) "$(top_builddir)"/doc/api/* "$(DESTDIR)$(docdir)/api"
+
+uninstall-local:
+       rm -rf "$(DESTDIR)$(docdir)/api"
+
+clean-local:
+       rm -rf "$(top_builddir)/doc/api"
+endif