From be8a83f681368307ca1c2d8726d27f5b98973231 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Wed, 14 Nov 2018 10:47:01 +0100 Subject: [PATCH] build manuals moved here from osmo-gsm-manuals.git Moved to doc/manuals/, with full commit history, in preceding merge commit. Now incorporate in the build system. Build with: $ autoreconf -fi $ ./configure --enable-manuals $ make Shared files from osmo-gsm-manuals.git are found automatically if - the repository is checked out in ../osmo-gsm-manuals; or - if it osmo-gsm-manuals was installed with "make install"; or - OSMO_GSM_MANUALS_DIR is set. Related: OS#3385 Change-Id: I2762171af0bf719a34ba12a0c2e4dcc206098beb --- .gitignore | 11 +++++++ configure.ac | 45 ++++++++++++++++++++++++++- doc/Makefile.am | 1 + doc/manuals/Makefile | 10 ------ doc/manuals/Makefile.am | 16 ++++++++++ doc/manuals/osmotrx-usermanual.adoc | 36 ++++++++++----------- doc/manuals/osmotrx-vty-reference.xml | 2 +- 7 files changed, 91 insertions(+), 30 deletions(-) delete mode 100644 doc/manuals/Makefile create mode 100644 doc/manuals/Makefile.am diff --git a/.gitignore b/.gitignore index 83c59d9d..ad4c4e3c 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,14 @@ tests/testsuite.log # vim *.sw? + +# manuals +doc/manuals/*.html +doc/manuals/*.svg +doc/manuals/*.pdf +doc/manuals/*__*.png +doc/manuals/*.check +doc/manuals/generated/ +doc/manuals/osmomsc-usermanual.xml +doc/manuals/common +doc/manuals/build diff --git a/configure.ac b/configure.ac index 64e3b357..2e036bab 100644 --- a/configure.ac +++ b/configure.ac @@ -223,6 +223,48 @@ PKG_CHECK_MODULES(FFTWF, fftw3f) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) +# Generate manuals +AC_ARG_ENABLE(manuals, + [AS_HELP_STRING( + [--enable-manuals], + [Generate manual PDFs [default=no]], + )], + [osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"]) +AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"]) +AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals" + fallback]) +if test x"$osmo_ac_build_manuals" = x"yes" +then + # Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback) + if test -n "$OSMO_GSM_MANUALS_DIR"; then + echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)" + else + OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)" + if test -n "$OSMO_GSM_MANUALS_DIR"; then + echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)" + else + OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals" + echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)" + fi + fi + if ! test -d "$OSMO_GSM_MANUALS_DIR"; then + AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.") + fi + + # Find and run check-depends + CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh" + if ! test -x "$CHECK_DEPENDS"; then + CHECK_DEPENDS="osmo-gsm-manuals-check-depends" + fi + if ! $CHECK_DEPENDS; then + AC_MSG_ERROR("missing dependencies for --enable-manuals") + fi + + # Put in Makefile with absolute path + OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")" + AC_SUBST([OSMO_GSM_MANUALS_DIR]) +fi + # https://www.freedesktop.org/software/systemd/man/daemon.html AC_ARG_WITH([systemdsystemunitdir], [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, @@ -267,4 +309,5 @@ AC_CONFIG_FILES([\ contrib/systemd/Makefile \ ]) -AC_OUTPUT +AC_OUTPUT( + doc/manuals/Makefile) diff --git a/doc/Makefile.am b/doc/Makefile.am index 1d42b0aa..2f308154 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,3 +1,4 @@ SUBDIRS = \ examples \ + manuals \ $(NULL) diff --git a/doc/manuals/Makefile b/doc/manuals/Makefile deleted file mode 100644 index 81aec9a6..00000000 --- a/doc/manuals/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -TOPDIR = .. - -ASCIIDOC = osmotrx-usermanual.adoc -ASCIIDOC_DEPS = chapters/*.adoc -include $(TOPDIR)/build/Makefile.asciidoc.inc - -VTY_REFERENCE = osmotrx-vty-reference.xml -include $(TOPDIR)/build/Makefile.vty-reference.inc - -include $(TOPDIR)/build/Makefile.common.inc diff --git a/doc/manuals/Makefile.am b/doc/manuals/Makefile.am new file mode 100644 index 00000000..a1f3bfb9 --- /dev/null +++ b/doc/manuals/Makefile.am @@ -0,0 +1,16 @@ +EXTRA_DIST = osmotrx-usermanual.adoc \ + osmotrx-usermanual-docinfo.xml \ + osmotrx-vty-reference.xml \ + chapters \ + vty + +if BUILD_MANUALS + ASCIIDOC = osmotrx-usermanual.adoc + ASCIIDOC_DEPS = $(srcdir)/chapters/*.adoc + include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc + + VTY_REFERENCE = osmotrx-vty-reference.xml + include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc + + include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc +endif diff --git a/doc/manuals/osmotrx-usermanual.adoc b/doc/manuals/osmotrx-usermanual.adoc index 14f55148..a17a8993 100644 --- a/doc/manuals/osmotrx-usermanual.adoc +++ b/doc/manuals/osmotrx-usermanual.adoc @@ -5,38 +5,38 @@ OsmoTRX User Manual Pau Espin Pedrol -include::../common/chapters/preface.adoc[] +include::./common/chapters/preface.adoc[] -include::chapters/overview.adoc[] +include::{srcdir}/chapters/overview.adoc[] -include::chapters/running.adoc[] +include::{srcdir}/chapters/running.adoc[] -include::../common/chapters/control_if.adoc[] +include::./common/chapters/control_if.adoc[] -include::chapters/control.adoc[] +include::{srcdir}/chapters/control.adoc[] -include::../common/chapters/vty.adoc[] +include::./common/chapters/vty.adoc[] -include::../common/chapters/logging.adoc[] +include::./common/chapters/logging.adoc[] -include::chapters/counters.adoc[] +include::{srcdir}/chapters/counters.adoc[] -include::chapters/configuration.adoc[] +include::{srcdir}/chapters/configuration.adoc[] -include::chapters/trx-architectures.adoc[] +include::{srcdir}/chapters/trx-architectures.adoc[] -include::chapters/trx-devices.adoc[] +include::{srcdir}/chapters/trx-devices.adoc[] -include::chapters/trx-backends.adoc[] +include::{srcdir}/chapters/trx-backends.adoc[] -include::chapters/code-architecture.adoc[] +include::{srcdir}/chapters/code-architecture.adoc[] -include::../common/chapters/trx_if.adoc[] +include::./common/chapters/trx_if.adoc[] -include::../common/chapters/port_numbers.adoc[] +include::./common/chapters/port_numbers.adoc[] -include::../common/chapters/bibliography.adoc[] +include::./common/chapters/bibliography.adoc[] -include::../common/chapters/glossary.adoc[] +include::./common/chapters/glossary.adoc[] -include::../common/chapters/gfdl.adoc[] +include::./common/chapters/gfdl.adoc[] diff --git a/doc/manuals/osmotrx-vty-reference.xml b/doc/manuals/osmotrx-vty-reference.xml index ae0afbfd..42919292 100644 --- a/doc/manuals/osmotrx-vty-reference.xml +++ b/doc/manuals/osmotrx-vty-reference.xml @@ -5,7 +5,7 @@ --> + ]>