1 dnl -*- Mode: Autoconf; tab-width: 4; indent-tabs-mode: nil; fill-column: 102 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 m4_define([_libo_define_pkg_version], [
13 echo "$ver" | while read major minor micro; do
14 AC_DEFINE_UNQUOTED([$1_VERSION_MAJOR], [$major])
15 AC_DEFINE_UNQUOTED([$1_VERSION_MINOR], [$minor])
16 AC_DEFINE_UNQUOTED([$1_VERSION_MICRO], [$micro])
21 m4_define([_libo_define_pkg_version_direct], [
22 AC_DEFINE([$1_VERSION_MAJOR], [$2])
23 AC_DEFINE([$1_VERSION_MINOR], [$3])
24 AC_DEFINE([$1_VERSION_MICRO], [$4])
27 # libo_PKG_VERSION(VARIABLE-STEM, MODULE, BUNDLED-VERSION)
28 AC_DEFUN([libo_PKG_VERSION], [
29 AS_IF([test -n "$SYSTEM_$1"], [
30 AC_REQUIRE([PKG_PROG_PKG_CONFIG])
31 AC_MSG_CHECKING([for $1 version])
32 AS_IF([test -n "$PKG_CONFIG"], [
33 ver=`$PKG_CONFIG --modversion "$2"`
34 AS_IF([test -n "$ver"], [
36 _libo_define_pkg_version([$1], [$ver])
38 AC_MSG_ERROR([not found])
41 AC_MSG_ERROR([not found])
44 _libo_define_pkg_version_direct([$1], m4_translit([$3], [.], [,]))
48 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: