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/.
9 # <lowercase check>,<variable prefix>,<pkg-config query>,
10 # <internal CFLAGS>,<internal LIBS>,<external (default: FALSE)>
11 AC_DEFUN([libo_CHECK_SYSTEM_MODULE], [
12 AC_ARG_WITH(system-$1,
13 AS_HELP_STRING([m4_ifnblank([$6],[--without-system-$1],[--with-system-$1])],
15 Build and bundle the internal $1 instead of using the operating system one.,
16 Use $1 from the operating system instead of building and bundling it.)]),
17 ,[m4_ifnblank([$6],[with_system_$1="yes"],[with_system_$1="$with_system_libs"])])
18 AC_MSG_CHECKING([which $1 to use])
19 if test "$test_$1" != "no"; then
21 if test "$with_system_$1" = yes -a "$test_system_$1" != no; then
22 AC_MSG_RESULT([external])
24 PKG_CHECK_MODULES([$2], [$3])
25 $2_CFLAGS=$(printf '%s' "${$2_CFLAGS}" | sed -e "s/-I/${ISYSTEM?}/g")
26 FilterLibs "${$2_LIBS}"
27 $2_LIBS="$filteredlibs"
29 AC_MSG_RESULT([internal])
33 BUILD_TYPE="$BUILD_TYPE $2"
36 AC_MSG_RESULT([ignored])
44 dnl vim:set shiftwidth=4 softtabstop=4 expandtab: