[librsvgmm] New MM_INIT_MODULE() Autoconf macro



commit 5f820835415a601c062205d0a121ba0d479aadc5
Author: Daniel Elstner <daniel kitta gmail com>
Date:   Sun Jul 12 21:20:15 2009 +0200

    New MM_INIT_MODULE() Autoconf macro
    
    * build/mm-module.m4: New file, defining the MM_INIT_MODULE()
    Autoconf macro to simplify the configuration of a library module.

 build/mm-module.m4 |   67 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 67 insertions(+), 0 deletions(-)
---
diff --git a/build/mm-module.m4 b/build/mm-module.m4
new file mode 100644
index 0000000..58946a0
--- /dev/null
+++ b/build/mm-module.m4
@@ -0,0 +1,67 @@
+## Copyright (c) 2009  Daniel Elstner <daniel kitta gmail com>
+##
+## This file is part of mm-autofu.
+##
+## mm-autofu is free software: you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published
+## by the Free Software Foundation, either version 2 of the License,
+## or (at your option) any later version.
+##
+## mm-autofu is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with mm-autofu.  If not, see <http://www.gnu.org/licenses/>.
+
+#serial 20090712
+
+## _MM_INIT_MODULE_VERSION(basename, BASENAME, [major], [minor], [micro])
+##
+m4_define([_MM_INIT_MODULE_VERSION],
+[dnl
+m4_ifvaln([$3], [AC_DEFINE([$2][_MAJOR_VERSION], [$3], [Major version number of $1.])])[]dnl
+m4_ifvaln([$4], [AC_DEFINE([$2][_MINOR_VERSION], [$4], [Minor version number of $1.])])[]dnl
+m4_ifval([$5],  [AC_DEFINE([$2][_MICRO_VERSION], [$5], [Micro version number of $1.])])[]dnl
+])
+
+## _MM_INIT_MODULE_SUBST(module-name, module-version, basename, api-version, BASENAME)
+##
+m4_define([_MM_INIT_MODULE_SUBST],
+[dnl
+AC_SUBST([$5][_MODULE_NAME], [$1])
+AC_SUBST([$5][_VERSION], [$2])
+m4_ifvaln([$4], [AC_SUBST([$5][_API_VERSION], [$4])])[]dnl
+_MM_INIT_MODULE_VERSION([$3], [$5], m4_bpatsubst([$2], [[^0123456789]+], [,]))[]dnl
+])
+
+## _MM_INIT_MODULE_BASENAME(module-name, module-version, basename, api-version)
+##
+m4_define([_MM_INIT_MODULE_BASENAME],
+          [_MM_INIT_MODULE_SUBST([$1], [$2], [$3], [$4], m4_quote(AS_TR_CPP([$3])))])
+
+## 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.
+##
+## Substitutions: <BASENAME>_MODULE_NAME        <module-name>
+##                <BASENAME>_VERSION            <module-version>
+##                <BASENAME>_API_VERSION        <api-version>
+##
+## Defines:       <BASENAME>_MAJOR_VERSION      <major>
+##                <BASENAME>_MINOR_VERSION      <minor>
+##                <BASENAME>_MICRO_VERSION      <micro>
+##
+## Where:         <BASENAME>                    AS_TR_CPP(<basename>)
+##                <basename>[-<api-version>]    <module-name>
+##                <major>.<minor>.<micro>[.*]   <module-version>
+##
+AC_DEFUN([MM_INIT_MODULE], 
+[dnl
+m4_assert([$# >= 2])[]dnl
+_MM_INIT_MODULE_BASENAME([$1], [$2],
+                         m4_quote(m4_bpatsubst([$1], [-[.0123456789]+$])),
+                         m4_quote(m4_bregexp([$1], [-\([.0123456789]+\)$], [\1])))[]dnl
+])



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]