diff --git a/.gitignore b/.gitignore index 9423d67d..289ed0dd 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,14 @@ config.* tags /Doxyfile + +# 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 acef6f6b..293a0142 100644 --- a/configure.ac +++ b/configure.ac @@ -98,6 +98,48 @@ AC_ARG_ENABLE(doxygen, AC_PATH_PROG(DOXYGEN,doxygen,false) AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes") +# 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])],, @@ -153,6 +195,7 @@ AC_OUTPUT( stp/Makefile doc/Makefile doc/examples/Makefile + doc/manuals/Makefile contrib/Makefile contrib/systemd/Makefile Doxyfile 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 6832dd42..00000000 --- a/doc/manuals/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -TOPDIR = .. - -ASCIIDOC = osmostp-usermanual.adoc -include $(TOPDIR)/build/Makefile.asciidoc.inc -osmostp-usermanual.pdf: chapters/*.adoc -aoip-mgw-options.pdf: aoip-mgw-options.adoc mgw/*.msc - -VTY_REFERENCE = osmostp-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..ce5b1284 --- /dev/null +++ b/doc/manuals/Makefile.am @@ -0,0 +1,17 @@ +EXTRA_DIST = osmostp-usermanual.adoc \ + osmostp-usermanual-docinfo.xml \ + osmostp-vty-reference.xml \ + chapters \ + vty + +if BUILD_MANUALS + ASCIIDOC = osmostp-usermanual.adoc + include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc + osmostp-usermanual.pdf: $(srcdir)/chapters/*.adoc + aoip-mgw-options.pdf: $(srcdir)/aoip-mgw-options.adoc $(srcdir)/mgw/*.msc + + VTY_REFERENCE = osmostp-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/osmostp-usermanual.adoc b/doc/manuals/osmostp-usermanual.adoc index 6dc1d08b..9f41e5de 100644 --- a/doc/manuals/osmostp-usermanual.adoc +++ b/doc/manuals/osmostp-usermanual.adoc @@ -3,32 +3,32 @@ OsmoSTP User Manual Harald Welte -include::../common/chapters/preface.adoc[] +include::./common/chapters/preface.adoc[] -// include::chapters/overview.adoc[] +// include::{srcdir}/chapters/overview.adoc[] -include::../common/chapters/sigtran.adoc[] +include::./common/chapters/sigtran.adoc[] -include::../common/chapters/sigtran-osmocom.adoc[] +include::./common/chapters/sigtran-osmocom.adoc[] -//include::chapters/running.adoc[] -// include::chapters/control.adoc[] +//include::{srcdir}/chapters/running.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::../common/chapters/bts.adoc[] +//include::./common/chapters/bts.adoc[] //include::../OsmoNITB/chapters/bts-examples.adoc[] -//include::../common/chapters/control_if.adoc[] +//include::./common/chapters/control_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/osmostp-vty-reference.xml b/doc/manuals/osmostp-vty-reference.xml index b4ee500b..ae0f7b09 100644 --- a/doc/manuals/osmostp-vty-reference.xml +++ b/doc/manuals/osmostp-vty-reference.xml @@ -5,7 +5,7 @@ --> + ]>