blob: 1f0e6f485c9beac14bdeebd8653ce1bac22a48c4 [file] [log] [blame]
Ned Deilybec699e2016-03-08 00:28:37 -05001# generated automatically by aclocal 1.15 -*- Autoconf -*-
doko@ubuntu.com35363502015-04-13 20:53:43 +02002
Ned Deilybec699e2016-03-08 00:28:37 -05003# Copyright (C) 1996-2014 Free Software Foundation, Inc.
doko@ubuntu.com35363502015-04-13 20:53:43 +02004
5# This file is free software; the Free Software Foundation
6# gives unlimited permission to copy and/or distribute it,
7# with or without modifications, as long as this notice is preserved.
8
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12# PARTICULAR PURPOSE.
13
14m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
16# serial 1 (pkg-config-0.24)
17#
18# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
19#
20# This program is free software; you can redistribute it and/or modify
21# it under the terms of the GNU General Public License as published by
22# the Free Software Foundation; either version 2 of the License, or
23# (at your option) any later version.
24#
25# This program is distributed in the hope that it will be useful, but
26# WITHOUT ANY WARRANTY; without even the implied warranty of
27# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28# General Public License for more details.
29#
30# You should have received a copy of the GNU General Public License
31# along with this program; if not, write to the Free Software
32# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33#
34# As a special exception to the GNU General Public License, if you
35# distribute this file as part of a program that contains a
36# configuration script generated by Autoconf, you may include it under
37# the same distribution terms that you use for the rest of that program.
38
39# PKG_PROG_PKG_CONFIG([MIN-VERSION])
40# ----------------------------------
41AC_DEFUN([PKG_PROG_PKG_CONFIG],
42[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
43m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
44m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
45AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
46AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
47AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
48
49if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
50 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
51fi
52if test -n "$PKG_CONFIG"; then
53 _pkg_min_version=m4_default([$1], [0.9.0])
54 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
55 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
56 AC_MSG_RESULT([yes])
57 else
58 AC_MSG_RESULT([no])
59 PKG_CONFIG=""
60 fi
61fi[]dnl
62])# PKG_PROG_PKG_CONFIG
63
64# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
65#
66# Check to see whether a particular set of modules exists. Similar
67# to PKG_CHECK_MODULES(), but does not set variables or print errors.
68#
69# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
70# only at the first occurence in configure.ac, so if the first place
71# it's called might be skipped (such as if it is within an "if", you
72# have to call PKG_CHECK_EXISTS manually
73# --------------------------------------------------------------
74AC_DEFUN([PKG_CHECK_EXISTS],
75[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
76if test -n "$PKG_CONFIG" && \
77 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
78 m4_default([$2], [:])
79m4_ifvaln([$3], [else
80 $3])dnl
81fi])
82
83# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
84# ---------------------------------------------
85m4_define([_PKG_CONFIG],
86[if test -n "$$1"; then
87 pkg_cv_[]$1="$$1"
88 elif test -n "$PKG_CONFIG"; then
89 PKG_CHECK_EXISTS([$3],
90 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
91 test "x$?" != "x0" && pkg_failed=yes ],
92 [pkg_failed=yes])
93 else
94 pkg_failed=untried
95fi[]dnl
96])# _PKG_CONFIG
97
98# _PKG_SHORT_ERRORS_SUPPORTED
99# -----------------------------
100AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
101[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
102if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
103 _pkg_short_errors_supported=yes
104else
105 _pkg_short_errors_supported=no
106fi[]dnl
107])# _PKG_SHORT_ERRORS_SUPPORTED
108
109
110# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
111# [ACTION-IF-NOT-FOUND])
112#
113#
114# Note that if there is a possibility the first call to
115# PKG_CHECK_MODULES might not happen, you should be sure to include an
116# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
117#
118#
119# --------------------------------------------------------------
120AC_DEFUN([PKG_CHECK_MODULES],
121[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
122AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
123AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
124
125pkg_failed=no
126AC_MSG_CHECKING([for $1])
127
128_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
129_PKG_CONFIG([$1][_LIBS], [libs], [$2])
130
131m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
132and $1[]_LIBS to avoid the need to call pkg-config.
133See the pkg-config man page for more details.])
134
135if test $pkg_failed = yes; then
136 AC_MSG_RESULT([no])
137 _PKG_SHORT_ERRORS_SUPPORTED
138 if test $_pkg_short_errors_supported = yes; then
139 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
140 else
141 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
142 fi
143 # Put the nasty error message in config.log where it belongs
144 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
145
146 m4_default([$4], [AC_MSG_ERROR(
147[Package requirements ($2) were not met:
148
149$$1_PKG_ERRORS
150
151Consider adjusting the PKG_CONFIG_PATH environment variable if you
152installed software in a non-standard prefix.
153
154_PKG_TEXT])[]dnl
155 ])
156elif test $pkg_failed = untried; then
157 AC_MSG_RESULT([no])
158 m4_default([$4], [AC_MSG_FAILURE(
159[The pkg-config script could not be found or is too old. Make sure it
160is in your PATH or set the PKG_CONFIG environment variable to the full
161path to pkg-config.
162
163_PKG_TEXT
164
165To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
166 ])
167else
168 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
169 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
170 AC_MSG_RESULT([yes])
171 $3
172fi[]dnl
173])# PKG_CHECK_MODULES
174
175
176# PKG_INSTALLDIR(DIRECTORY)
177# -------------------------
178# Substitutes the variable pkgconfigdir as the location where a module
179# should install pkg-config .pc files. By default the directory is
180# $libdir/pkgconfig, but the default can be changed by passing
181# DIRECTORY. The user can override through the --with-pkgconfigdir
182# parameter.
183AC_DEFUN([PKG_INSTALLDIR],
184[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
185m4_pushdef([pkg_description],
186 [pkg-config installation directory @<:@]pkg_default[@:>@])
187AC_ARG_WITH([pkgconfigdir],
188 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
189 [with_pkgconfigdir=]pkg_default)
190AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
191m4_popdef([pkg_default])
192m4_popdef([pkg_description])
193]) dnl PKG_INSTALLDIR
194
195
196# PKG_NOARCH_INSTALLDIR(DIRECTORY)
197# -------------------------
198# Substitutes the variable noarch_pkgconfigdir as the location where a
199# module should install arch-independent pkg-config .pc files. By
200# default the directory is $datadir/pkgconfig, but the default can be
201# changed by passing DIRECTORY. The user can override through the
202# --with-noarch-pkgconfigdir parameter.
203AC_DEFUN([PKG_NOARCH_INSTALLDIR],
204[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
205m4_pushdef([pkg_description],
206 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
207AC_ARG_WITH([noarch-pkgconfigdir],
208 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
209 [with_noarch_pkgconfigdir=]pkg_default)
210AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
211m4_popdef([pkg_default])
212m4_popdef([pkg_description])
213]) dnl PKG_NOARCH_INSTALLDIR
214
215
216# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
217# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
218# -------------------------------------------
219# Retrieves the value of the pkg-config variable for the given module.
220AC_DEFUN([PKG_CHECK_VAR],
221[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
222AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
223
224_PKG_CONFIG([$1], [variable="][$3]["], [$2])
225AS_VAR_COPY([$1], [pkg_cv_][$1])
226
227AS_VAR_IF([$1], [""], [$5], [$4])dnl
228])# PKG_CHECK_VAR
229