From d21e0532bc2ed3d18514f2b172fbcbeb4a2981c8 Mon Sep 17 00:00:00 2001 From: Jon Shallow Date: Mon, 12 Feb 2018 11:11:40 +0000 Subject: [PATCH] configure.ac: Add in man page building with --enable-manpages Create a new --enable-doxygen Make --enable-documentation include both --enable-manpages and --enable-doxygen and --disable-documentation include --disable-manpages and --disable-doxygen --- configure.ac | 120 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 78 insertions(+), 42 deletions(-) diff --git a/configure.ac b/configure.ac index 791d32e0..c87837e5 100644 --- a/configure.ac +++ b/configure.ac @@ -155,23 +155,36 @@ AC_SUBST(libcoap_SYMBOLS) # configure options # __documentation__ -doxygen_version_required=1.7.0 -dot_version_required=2.26.0 - AC_ARG_ENABLE([documentation], [AS_HELP_STRING([--enable-documentation], - [Enable building the documentation [default=yes]])], + [Enable building all the documentation [default=yes]])], [build_documentation="$enableval"], [build_documentation="yes"]) -if test "x$build_documentation" = "xyes"; then +AM_CONDITIONAL(BUILD_DOCUMENTATION, [test "x$build_documentation" = "xyes"]) + +doxygen_version_required=1.7.0 +dot_version_required=2.26.0 + +AC_ARG_ENABLE([doxygen], + [AS_HELP_STRING([--enable-doxygen], + [Enable building the doxygen documentation [default=yes]])], + [build_doxygen="$enableval"], + [build_doxygen="yes"]) + +if test -z "$enable_doxygen"; then + if test "x$enable_documentation" = "xno"; then + build_doxygen="no" + fi +fi + +if test "x$build_doxygen" = "xyes"; then # Check for doxygen AC_PATH_PROGS([DOXYGEN], [doxygen]) if test -z "$DOXYGEN"; then - if test "x$build_documentation" = "xyes"; then - AC_MSG_WARN([==> Doxygen not found - continuing without Doxygen support]) - AC_MSG_WARN([==> The libcoap html documentation will not be build!]) - doxygen_version="not found" + if test "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> You want to build the doxygen documentation but doxygen was not found!]) + AC_MSG_ERROR([==> Install the package containg doxygen or disable the doxygen documentation using '--disable-doxygen'.]) fi else AC_MSG_CHECKING([for compatible doxygen version (>= $doxygen_version_required)]) @@ -182,9 +195,9 @@ if test "x$build_documentation" = "xyes"; then DOXYGEN=""], [AC_MSG_RESULT([yes $doxygen_version])], [AC_MSG_RESULT([yes $doxygen_version])]) - if test "x$DOXYGEN" = "x" -a "x$build_documentation" = "xyes"; then - AC_MSG_ERROR([==> Doxygen $doxygen_version too old. Doxygen >= $doxygen_version_required required for documentation build.]) - AC_MSG_ERROR([==> Install required doxygen version or disable the documentation using '--disable-documentation'.]) + if test "x$DOXYGEN" = "x" -a "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> Doxygen $doxygen_version too old. Doxygen >= $doxygen_version_required required for documentation build.]) + AC_MSG_ERROR([==> Install required doxygen version or disable the doxygen documentation using '--disable-doxygen'.]) else # we found doxygen and the version is valid DOC_DIR=doc @@ -221,9 +234,9 @@ if test "x$build_documentation" = "xyes"; then DOT=""], [AC_MSG_RESULT([yes $dot_version])], [AC_MSG_RESULT([yes $dot_version])]) - if test "x$DOT" = "x" -a "x$build_documentation" = "xyes"; then - AC_MSG_WARN([==> Graphviz dot $dot_version too old. Graphviz >= $dot_version_required required for documentation build.]) - AC_MSG_ERROR([==> Install required graphviz version or disable the documentation using '--disable-documentation'.]) + if test "x$DOT" = "x" -a "x$build_doxygen" = "xyes"; then + AC_MSG_WARN([==> Graphviz dot $dot_version too old. Graphviz >= $dot_version_required required for doxygen build.]) + AC_MSG_ERROR([==> Install required graphviz version or disable the doxygen documentation using '--disable-doxygen'.]) fi # we found dot and the version is valid HAVE_DOT="YES" @@ -237,11 +250,39 @@ if test "x$build_documentation" = "xyes"; then fi fi fi -AM_CONDITIONAL(BUILD_DOCUMENTATION, [test "x$build_documentation" = "xyes"]) +AM_CONDITIONAL(BUILD_DOXYGEN, [test "x$build_doxygen" = "xyes"]) AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])]) +# __manpages__ + +AC_ARG_ENABLE([manpages], + [AS_HELP_STRING([--enable-manpages], + [Enable building the manpages [default=yes]])], + [build_manpages="$enableval"], + [build_manpages="yes"]) + +if test -z "$enable_manpages"; then + if test "x$enable_documentation" = "xno"; then + build_manpages="no" + fi +fi + +if test "x$build_manpages" = "xyes"; then + AC_ARG_VAR([A2X], [a2x command]) + AC_PATH_PROG([A2X], [a2x]) + if test "x$A2X" = "x"; then + AC_MSG_WARN([==> You want to build the manpages, but a2x was not found!]) + AC_MSG_ERROR([==> Install the package containg a2x (mostly asciidoc) or disable the build of the manpages using '--disable-manpages'.]) + build_manpages="no" + else + MAN_DIR=man + AC_SUBST(MAN_DIR) + fi +fi +AM_CONDITIONAL(BUILD_MANPAGES, [test "x$build_manpages" = "xyes"]) + # configure options # __dtls__ # The Datagram Transport Layer Security (DTLS) feature needs cryptographic @@ -433,15 +474,6 @@ AC_ARG_ENABLE([examples], [build_examples="$enableval"], [build_examples="yes"]) -if test "x$build_examples" = "xyes" -a "x$build_documentation" = "xyes"; then - AC_ARG_VAR([A2X], [a2x command]) - AC_PATH_PROG([A2X], [a2x]) - if test "x$A2X" = "x"; then - AC_MSG_WARN([==> You want to build the examples binaries, that is also including the respective manpages but a2x was not found!]) - AC_MSG_ERROR([==> Install the package containg a2x (mostly asciidoc) or disable the build of the examples using '--disable-examples'.]) - fi - build_examples="yes" -fi AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$build_examples" = "xyes"]) # end configure options @@ -568,10 +600,19 @@ AC_CONFIG_FILES([ Makefile doc/Makefile examples/Makefile -examples/coap-client.txt -examples/coap-server.txt -examples/coap-rd.txt include/coap/coap.h +man/coap.txt +man/coap_attribute.txt +man/coap_context.txt +man/coap_handler.txt +man/coap_observe.txt +man/coap_recovery.txt +man/coap_resource.txt +man/coap_tls_library.txt +man/coap-client.txt +man/coap-server.txt +man/coap-rd.txt +man/Makefile tests/Makefile libcoap-$LIBCOAP_API_VERSION.pc:libcoap-$LIBCOAP_API_VERSION.pc.in ]) @@ -605,8 +646,8 @@ fi if test "x$build_dtls" != "xyes"; then AC_MSG_RESULT([ build DTLS support : "no"]) fi -if test "x$build_documentation" = "xyes" -a "x$DOXYGEN" != "x"; then - AC_MSG_RESULT([ build documentation : "yes"]) +if test "x$build_doxygen" = "xyes"; then + AC_MSG_RESULT([ build doxygen pages : "yes"]) AC_MSG_RESULT([ --> Doxygen around : "yes" ($DOXYGEN $doxygen_version)]) if test "x$DOT" = "x"; then AC_MSG_RESULT([ --> dot around : "no" (DOT not found!)]) @@ -614,10 +655,15 @@ if test "x$build_documentation" = "xyes" -a "x$DOXYGEN" != "x"; then AC_MSG_RESULT([ --> dot around : "yes" ($DOT $dot_version)]) fi else - if test "x$build_documentation" = "xno"; then - AC_MSG_RESULT([ build documentation : "no"]) + if test "x$build_doxygen" = "xno"; then + AC_MSG_RESULT([ build doxygen pages : "no"]) fi fi +if test "x$build_manpages" = "xyes"; then + AC_MSG_RESULT([ build man pages : "yes"]) +else + AC_MSG_RESULT([ build man pages : "no"]) +fi if test "x$build_tests" = "xyes"; then AC_MSG_RESULT([ build unit test binary : "yes"]) else @@ -625,16 +671,6 @@ else fi if test "x$build_examples" = "xyes"; then AC_MSG_RESULT([ build examples : "yes"]) - if test "x$A2X" != "x"; then - AC_MSG_RESULT([ --> use a2x : "yes" ($A2X)]) - else - AC_MSG_RESULT([ --> use a2x : "no"]) - fi else AC_MSG_RESULT([ build examples : "no"]) fi -if test "x$build_dtls" = "xyes"; then - AC_MSG_RESULT([ build with DTLS support : "yes"]) -else - AC_MSG_RESULT([ build with DTLS support : "no"]) -fi