From 25cca256e03d215bf1dd54fb4b8bad7f48f4036e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Wed, 7 Sep 2016 20:35:57 +0000 Subject: [PATCH] allow plantuml with doxygen < 1.8.11 --- scripts/ax_init_standard_project.m4 | 27 +++++++++++++++------------ scripts/bootstrap.sh | 19 +++++++++---------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/scripts/ax_init_standard_project.m4 b/scripts/ax_init_standard_project.m4 index f72bd88..4755401 100644 --- a/scripts/ax_init_standard_project.m4 +++ b/scripts/ax_init_standard_project.m4 @@ -543,20 +543,12 @@ AC_DEFUN([AX_USE_SCRIPTS], [ AC_CONFIG_FILES([scripts/makefile]) ]) -# use this in configure.ac to support PlantUML in Doxygen generation -AC_DEFUN([AX_USE_PLANTUML], [ - if test -f "${srcdir}/doc/plantuml.jar"; then - PLANTUML="doc/plantuml.jar" - AX_SUBST(PLANTUML) - fi - AM_CONDITIONAL(HAVE_PLANTUML, test -n "$PLANTUML") -]) - # use this in configure.ac to support Doxygen documentation generation AC_DEFUN([AX_USE_DOXYGEN], [ AC_CHECK_PROG(have_doxygen, doxygen, yes, no) AC_CHECK_PROG(have_dot, dot, yes, no) AC_CHECK_PROG(have_mscgen, mscgen, yes, no) + AM_CONDITIONAL(NEED_PLANTUML, test "$have_doxygen" = "yes" -a "1.8.11" != $((echo "1.8.11"; doxygen -v) | sort -V | head -1)) PDF_DOC=${PACKAGE_NAME}-${PACKAGE_VERSION}.pdf AC_SUBST(PDF_DOC) if test "$have_doxygen" = "no"; then @@ -581,14 +573,25 @@ AC_DEFUN([AX_USE_DOXYGEN], [ AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [pdf gen-uml-images], [doc/makefile.in]) test -f doc/makefile.in && cat >> doc/makefile.in < Bob: test - @enduml * Enable Debian packaging by calling "make deb": AX_USE_DEBIAN_PACKAGING * Enable RPM packaging by calling "make rpm": AX_USE_RPM_PACKAGING * Enable C++ testing using CppUnit: AX_USE_CPPUNIT @@ -555,7 +550,6 @@ AX_INIT_STANDARD_PROJECT #AX_USE_LIBTOOL #AX_USE_SCRIPTS #AX_USE_DOXYGEN -#AX_USE_PLANTUML #AX_USE_DEBIAN_PACKAGING #AX_USE_RPM_PACKAGING #AX_USE_CPPUNIT @@ -975,7 +969,7 @@ to --condition AX_USE_DOXYGEN doc/style.css <@AUTHOR_NAME@"' - if testtag AX_USE_PLANTUML; then - doxyreplace PLANTUML_JAR_PATH '"@top_srcdir@/@PLANTUML@"' + # hack plantuml for doxygen < 1.8.11 + if test "1.8.11" = $((echo "1.8.11"; doxygen -v) | sort -V | head -1); then + doxyreplace PLANTUML_JAR_PATH '"@top_srcdir@/doc/plantuml.jar"' + else + doxyadd ALIASES '"startuml{1}=@image html \\1\\n@image latex \\1\\n\\if DontIgnorePlantUMLCode"' + doxyadd ALIASES '"enduml=\\endif"' + doxyadd IMAGE_PATH '"gen-uml-images"' fi doxyreplace ENABLE_PREPROCESSING YES doxyreplace MACRO_EXPANSION YES