6171
6171
AC_MSG_RESULT([$SED])
6175
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
6176
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
6177
dnl also defines GSTUFF_PKG_ERRORS on error
6178
AC_DEFUN([PKG_CHECK_MODULES], [
6181
if test -z "$PKG_CONFIG"; then
6182
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
6185
if test "$PKG_CONFIG" = "no" ; then
6186
echo "*** The pkg-config script could not be found. Make sure it is"
6187
echo "*** in your path, or set the PKG_CONFIG environment variable"
6188
echo "*** to the full path to pkg-config."
6189
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
6191
PKG_CONFIG_MIN_VERSION=0.9.0
6192
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
6193
AC_MSG_CHECKING(for $2)
6195
if $PKG_CONFIG --exists "$2" ; then
6199
AC_MSG_CHECKING($1_CFLAGS)
6200
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
6201
AC_MSG_RESULT($$1_CFLAGS)
6203
AC_MSG_CHECKING($1_LIBS)
6204
$1_LIBS=`$PKG_CONFIG --libs "$2"`
6205
AC_MSG_RESULT($$1_LIBS)
6209
## If we have a custom action on failure, don't print errors, but
6210
## do set a variable so people can do so.
6211
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6212
ifelse([$4], ,echo $$1_PKG_ERRORS,)
6174
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
6176
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
6178
# This program is free software; you can redistribute it and/or modify
6179
# it under the terms of the GNU General Public License as published by
6180
# the Free Software Foundation; either version 2 of the License, or
6181
# (at your option) any later version.
6183
# This program is distributed in the hope that it will be useful, but
6184
# WITHOUT ANY WARRANTY; without even the implied warranty of
6185
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6186
# General Public License for more details.
6188
# You should have received a copy of the GNU General Public License
6189
# along with this program; if not, write to the Free Software
6190
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6192
# As a special exception to the GNU General Public License, if you
6193
# distribute this file as part of a program that contains a
6194
# configuration script generated by Autoconf, you may include it under
6195
# the same distribution terms that you use for the rest of that program.
6197
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
6198
# ----------------------------------
6199
AC_DEFUN([PKG_PROG_PKG_CONFIG],
6200
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
6201
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
6202
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
6203
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
6204
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
6206
if test -n "$PKG_CONFIG"; then
6207
_pkg_min_version=m4_default([$1], [0.9.0])
6208
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6209
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6210
AC_MSG_RESULT([yes])
6217
])# PKG_PROG_PKG_CONFIG
6219
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6221
# Check to see whether a particular set of modules exists. Similar
6222
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6225
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6226
# this or PKG_CHECK_MODULES is called, or make sure to call
6227
# PKG_CHECK_EXISTS manually
6228
# --------------------------------------------------------------
6229
AC_DEFUN([PKG_CHECK_EXISTS],
6230
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6231
if test -n "$PKG_CONFIG" && \
6232
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
6233
m4_ifval([$2], [$2], [:])
6234
m4_ifvaln([$3], [else
6239
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
6240
# ---------------------------------------------
6241
m4_define([_PKG_CONFIG],
6242
[if test -n "$PKG_CONFIG"; then
6243
if test -n "$$1"; then
6246
PKG_CHECK_EXISTS([$3],
6247
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
6255
# _PKG_SHORT_ERRORS_SUPPORTED
6256
# -----------------------------
6257
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
6258
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
6259
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6260
_pkg_short_errors_supported=yes
6262
_pkg_short_errors_supported=no
6264
])# _PKG_SHORT_ERRORS_SUPPORTED
6267
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
6268
# [ACTION-IF-NOT-FOUND])
6271
# Note that if there is a possibility the first call to
6272
# PKG_CHECK_MODULES might not happen, you should be sure to include an
6273
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
6276
# --------------------------------------------------------------
6277
AC_DEFUN([PKG_CHECK_MODULES],
6278
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6279
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
6280
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
6283
AC_MSG_CHECKING([for $1])
6285
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
6286
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
6288
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
6289
and $1[]_LIBS to avoid the need to call pkg-config.
6290
See the pkg-config man page for more details.])
6292
if test $pkg_failed = yes; then
6293
_PKG_SHORT_ERRORS_SUPPORTED
6294
if test $_pkg_short_errors_supported = yes; then
6295
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
6297
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6218
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
6219
echo "*** See http://www.freedesktop.org/software/pkgconfig"
6223
if test $succeeded = yes; then
6224
ifelse([$3], , :, [$3])
6226
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
6299
# Put the nasty error message in config.log where it belongs
6300
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
6302
ifelse([$4], , [AC_MSG_ERROR(dnl
6303
[Package requirements ($2) were not met:
6307
Consider adjusting the PKG_CONFIG_PATH environment variable if you
6308
installed software in a non-standard prefix.
6313
elif test $pkg_failed = untried; then
6314
ifelse([$4], , [AC_MSG_FAILURE(dnl
6315
[The pkg-config script could not be found or is too old. Make sure it
6316
is in your PATH or set the PKG_CONFIG environment variable to the full
6321
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
6324
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
6325
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
6326
AC_MSG_RESULT([yes])
6327
ifelse([$3], , :, [$3])
6329
])# PKG_CHECK_MODULES
6232
6331
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.