summaryrefslogtreecommitdiff
path: root/m4/libo_pkg_version.m4
blob: c004b92b2b06e0bdab59b01e6629789fdd0ef41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#

m4_define([_libo_define_pkg_version], [
    save_IFS="$IFS"
    IFS=.
    echo "$ver" | while read major minor micro; do
        AC_DEFINE_UNQUOTED([$1_VERSION_MAJOR], [$major])
        AC_DEFINE_UNQUOTED([$1_VERSION_MINOR], [$minor])
        AC_DEFINE_UNQUOTED([$1_VERSION_MICRO], [$micro])
    done
    IFS="$save_IFS"
])

m4_define([_libo_define_pkg_version_direct], [
    AC_DEFINE([$1_VERSION_MAJOR], [$2])
    AC_DEFINE([$1_VERSION_MINOR], [$3])
    AC_DEFINE([$1_VERSION_MICRO], [$4])
])

# libo_PKG_VERSION(VARIABLE-STEM, MODULE, BUNDLED-VERSION)
AC_DEFUN([libo_PKG_VERSION], [
    AS_IF([test -n "$SYSTEM_$1"], [
        AC_REQUIRE([PKG_PROG_PKG_CONFIG])
        AC_MSG_CHECKING([for $1 version])
        AS_IF([test -n "$PKG_CONFIG"], [
            ver=`$PKG_CONFIG --modversion "$2"`
            AS_IF([test -n "$ver"], [
                AC_MSG_RESULT([$ver])
                _libo_define_pkg_version([$1], [$ver])
            ], [
                AC_MSG_ERROR([not found])
            ])
        ], [
            AC_MSG_ERROR([not found])
        ])
    ], [
        _libo_define_pkg_version_direct([$1], m4_translit([$3], [.], [,]))
    ])
])

dnl vim:set shiftwidth=4 softtabstop=4 expandtab:
boost::noncopyable in ..Jochen Nitschke 2015-11-10loplugin:nullptr (automatic rewrite)Stephan Bergmann 2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann 2015-08-29o3tl/cow_wrapper: remove boost dependencyDaniel Robertson 2015-07-17com::sun::star->css in basctlNoel Grandin 2015-07-06tdf#88206 replace cppu::WeakImplHelper* etc.Takeshi Abe 2014-12-05Removed useless includes in basctl/source/basicide/ treeAndrea Gelmini 2014-04-01Explicitly mark overriding destructors as "virtual"Stephan Bergmann 2014-03-27Second batch of adding SAL_OVERRIDE to overriding function declarationsStephan Bergmann 2014-02-26cppuhelper: retrofit std::exception into overriding exception specsStephan Bergmann 2014-02-23Remove unneccessary commentsAlexander Wilms 2014-01-17Remove use of deprecated css::document::XEventBroadcaster/ListenerStephan Bergmann 2014-01-16Introduce com.sun.star.frame.theGlobalEventBroadcaster singletonStephan Bergmann