summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorDaniel Elstner <danielk@openismus.com>2009-08-08 18:22:11 +0200
committerDaniel Elstner <danielk@openismus.com>2009-08-08 18:22:11 +0200
commit7465c0ccc19d0eba90d5a83e0cacca111afd75a7 (patch)
treebae6782e3054fad3508fe09f79707da29ae5920a /macros
parent70ed1e7ff3a17168fc9a14ac140b158159f78b5b (diff)
downloadmm-common-7465c0ccc19d0eba90d5a83e0cacca111afd75a7.tar.gz
Split MM_ARG_ENABLE_DOCUMENTATION for AC_REQUIRE
* macros/mm-doc.m4 (MM_ARG_ENABLE_DOCUMENTATION): Move the macro body to a separate implementation macro, pulled in by means of AC_REQUIRE. The indirection ensures the consistent use of AC_REQUIRE, so that the macro is always expanded only once.
Diffstat (limited to 'macros')
-rw-r--r--macros/mm-doc.m447
1 files changed, 30 insertions, 17 deletions
diff --git a/macros/mm-doc.m4 b/macros/mm-doc.m4
index 5f421a7..40ef53b 100644
--- a/macros/mm-doc.m4
+++ b/macros/mm-doc.m4
@@ -15,26 +15,17 @@
## You should have received a copy of the GNU General Public License
## along with mm-common. If not, see <http://www.gnu.org/licenses/>.
-#serial 20090807
+#serial 20090808
-## MM_ARG_ENABLE_DOCUMENTATION
-##
-## Provide the --disable-documentation configure option. By default,
-## the documentation will be included in the build. If not explicitly
-## disabled, also check whether the necessary tools are installed, and
-## abort if any are missing.
-##
-## The tools checked for are Perl, dot, Doxygen and xsltproc. The
-## substitution variables PERL, DOT, DOXYGEN and XSLTPROC are set to
-## the command paths, unless overridden in the user environment.
+## _MM_ARG_ENABLE_DOCUMENTATION
##
-## If the package provides the --enable-maintainer-mode option, the
-## tools dot, Doxygen and xsltproc are mandatory only when maintainer
-## mode is enabled. Perl is required for the installdox utility even
-## if not in maintainer mode.
+## Implementation of MM_ARG_ENABLE_DOCUMENTATION, pulled in indirectly
+## through AC_REQUIRE() to make sure it is expanded only once.
##
-AC_DEFUN([MM_ARG_ENABLE_DOCUMENTATION],
+m4_define([_MM_ARG_ENABLE_DOCUMENTATION],
[dnl
+AC_PROVIDE([$0])[]dnl
+dnl
AC_ARG_VAR([PERL], [path to Perl interpreter])[]dnl
AC_ARG_VAR([DOT], [path to dot utility])[]dnl
AC_ARG_VAR([DOXYGEN], [path to Doxygen utility])[]dnl
@@ -70,6 +61,28 @@ AC_SUBST([DOXYGEN_TAGFILES], [[]])
AC_SUBST([DOCINSTALL_FLAGS], [[]])[]dnl
])
+## MM_ARG_ENABLE_DOCUMENTATION
+##
+## Provide the --disable-documentation configure option. By default,
+## the documentation will be included in the build. If not explicitly
+## disabled, also check whether the necessary tools are installed, and
+## abort if any are missing.
+##
+## The tools checked for are Perl, dot, Doxygen and xsltproc. The
+## substitution variables PERL, DOT, DOXYGEN and XSLTPROC are set to
+## the command paths, unless overridden in the user environment.
+##
+## If the package provides the --enable-maintainer-mode option, the
+## tools dot, Doxygen and xsltproc are mandatory only when maintainer
+## mode is enabled. Perl is required for the installdox utility even
+## if not in maintainer mode.
+##
+AC_DEFUN([MM_ARG_ENABLE_DOCUMENTATION],
+[dnl
+AC_BEFORE([$0], [MM_ARG_WITH_TAGFILE_DOC])[]dnl
+AC_REQUIRE([_MM_ARG_ENABLE_DOCUMENTATION])[]dnl
+])
+
## _MM_ARG_WITH_TAGFILE_DOC(option-basename, tagfilename, [module])
##
m4_define([_MM_ARG_WITH_TAGFILE_DOC],
@@ -152,7 +165,7 @@ AC_DEFUN([MM_ARG_WITH_TAGFILE_DOC],
[dnl
m4_assert([$# >= 1])[]dnl
m4_ifval([$2], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])])[]dnl
-AC_REQUIRE([MM_ARG_ENABLE_DOCUMENTATION])[]dnl
+AC_REQUIRE([_MM_ARG_ENABLE_DOCUMENTATION])[]dnl
dnl
AS_IF([test "x$ENABLE_DOCUMENTATION" != xno], [_MM_ARG_WITH_TAGFILE_DOC(
m4_quote(m4_bpatsubst([$1], [\([-+][0123456789]\|[+]*[._]\).*$])), [$1], [$2])])[]dnl