diff options
author | Daniel Elstner <daniel.kitta@gmail.com> | 2009-08-15 01:49:29 +0200 |
---|---|---|
committer | Daniel Elstner <daniel.kitta@gmail.com> | 2009-08-15 02:11:05 +0200 |
commit | 820eb8d5dcec1737c56673fc60aa3f2b5dc75044 (patch) | |
tree | a2073c6e58b8d649ee8e0e1081055986095e1579 /macros | |
parent | dca699de71404b59f54cea33872d1eaadba4bfce (diff) | |
download | mm-common-820eb8d5dcec1737c56673fc60aa3f2b5dc75044.tar.gz |
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.
Diffstat (limited to 'macros')
-rw-r--r-- | macros/mm-module.m4 | 15 |
1 files changed, 9 insertions, 6 deletions
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 <module-name> and <module-version> triplet. +## If no <module-version> is specified, it defaults to the expansion of +## AC_PACKAGE_VERSION. ## ## Substitutions: <BASENAME>_MODULE_NAME <module-name> ## <BASENAME>_VERSION <module-version> @@ -55,15 +57,16 @@ m4_define([_MM_INIT_MODULE_BASENAME], ## <BASENAME>_MINOR_VERSION <minor> ## <BASENAME>_MICRO_VERSION <micro> ## -## Where: <BASENAME> AS_TR_CPP(<basename> ~ tr/+/X) +## Where: <BASENAME> AS_TR_CPP(<basename> ~ t/+/X/) ## <basename>[-<api-version>] <module-name> ## <major>.<minor>.<micro>[.*] <module-version> ## 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 ]) |