From 820eb8d5dcec1737c56673fc60aa3f2b5dc75044 Mon Sep 17 00:00:00 2001 From: Daniel Elstner Date: Sat, 15 Aug 2009 01:49:29 +0200 Subject: Make MM_INIT_MODULE version argument optional * macros/mm-module.m4 (MM_INIT_MODULE): If no version argument has been specified, use the expansion of AC_PACKAGE_VERSION as default value. --- macros/mm-module.m4 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'macros') diff --git a/macros/mm-module.m4 b/macros/mm-module.m4 index 5073bc8..6c7d70a 100644 --- a/macros/mm-module.m4 +++ b/macros/mm-module.m4 @@ -42,10 +42,12 @@ m4_define([_MM_INIT_MODULE_BASENAME], [_MM_INIT_MODULE_SUBST([$1], [$2], [$3], [$4], m4_quote(AS_TR_CPP(m4_quote(m4_translit([$3], [+], [X])))))]) -## MM_INIT_MODULE(module-name, module-version) +## MM_INIT_MODULE(module-name, [module-version]) ## ## Set up substitution variables and macro definitions for a module with ## the specified pkg-config and triplet. +## If no is specified, it defaults to the expansion of +## AC_PACKAGE_VERSION. ## ## Substitutions: _MODULE_NAME ## _VERSION @@ -55,15 +57,16 @@ m4_define([_MM_INIT_MODULE_BASENAME], ## _MINOR_VERSION ## _MICRO_VERSION ## -## Where: AS_TR_CPP( ~ tr/+/X) +## Where: AS_TR_CPP( ~ t/+/X/) ## [-] ## ..[.*] ## AC_DEFUN([MM_INIT_MODULE], [dnl -m4_assert([$# >= 2])[]dnl +m4_assert([$# >= 1])[]dnl AC_REQUIRE([_MM_PRE_INIT])[]dnl -_MM_INIT_MODULE_BASENAME([$1], [$2], - m4_quote(m4_bpatsubst([$1], [-[.0123456789]+$])), - m4_quote(m4_bregexp([$1], [-\([.0123456789]+\)$], [\1])))[]dnl +_MM_INIT_MODULE_BASENAME([$1], + m4_quote(m4_ifval([$2], [$2], m4_defn([AC_PACKAGE_VERSION]))), + m4_quote(m4_bpatsubst([$1], [-[.0123456789]+$])), + m4_quote(m4_bregexp([$1], [-\([.0123456789]+\)$], [\1])))[]dnl ]) -- cgit v1.2.1