6176
6191
AC_MSG_RESULT([$SED])
6180
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
6181
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
6182
dnl also defines GSTUFF_PKG_ERRORS on error
6183
AC_DEFUN([PKG_CHECK_MODULES], [
6186
if test -z "$PKG_CONFIG"; then
6187
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
6190
if test "$PKG_CONFIG" = "no" ; then
6191
echo "*** The pkg-config script could not be found. Make sure it is"
6192
echo "*** in your path, or set the PKG_CONFIG environment variable"
6193
echo "*** to the full path to pkg-config."
6194
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
6196
PKG_CONFIG_MIN_VERSION=0.9.0
6197
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
6198
AC_MSG_CHECKING(for $2)
6200
if $PKG_CONFIG --exists "$2" ; then
6204
AC_MSG_CHECKING($1_CFLAGS)
6205
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
6206
AC_MSG_RESULT($$1_CFLAGS)
6208
AC_MSG_CHECKING($1_LIBS)
6209
$1_LIBS=`$PKG_CONFIG --libs "$2"`
6210
AC_MSG_RESULT($$1_LIBS)
6214
## If we have a custom action on failure, don't print errors, but
6215
## do set a variable so people can do so.
6216
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6217
ifelse([$4], ,echo $$1_PKG_ERRORS,)
6194
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
6196
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
6198
# This program is free software; you can redistribute it and/or modify
6199
# it under the terms of the GNU General Public License as published by
6200
# the Free Software Foundation; either version 2 of the License, or
6201
# (at your option) any later version.
6203
# This program is distributed in the hope that it will be useful, but
6204
# WITHOUT ANY WARRANTY; without even the implied warranty of
6205
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
6206
# General Public License for more details.
6208
# You should have received a copy of the GNU General Public License
6209
# along with this program; if not, write to the Free Software
6210
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
6212
# As a special exception to the GNU General Public License, if you
6213
# distribute this file as part of a program that contains a
6214
# configuration script generated by Autoconf, you may include it under
6215
# the same distribution terms that you use for the rest of that program.
6217
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
6218
# ----------------------------------
6219
AC_DEFUN([PKG_PROG_PKG_CONFIG],
6220
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
6221
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
6222
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
6223
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
6224
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
6226
if test -n "$PKG_CONFIG"; then
6227
_pkg_min_version=m4_default([$1], [0.9.0])
6228
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
6229
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
6230
AC_MSG_RESULT([yes])
6237
])# PKG_PROG_PKG_CONFIG
6239
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
6241
# Check to see whether a particular set of modules exists. Similar
6242
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
6245
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
6246
# this or PKG_CHECK_MODULES is called, or make sure to call
6247
# PKG_CHECK_EXISTS manually
6248
# --------------------------------------------------------------
6249
AC_DEFUN([PKG_CHECK_EXISTS],
6250
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6251
if test -n "$PKG_CONFIG" && \
6252
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
6253
m4_ifval([$2], [$2], [:])
6254
m4_ifvaln([$3], [else
6259
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
6260
# ---------------------------------------------
6261
m4_define([_PKG_CONFIG],
6262
[if test -n "$PKG_CONFIG"; then
6263
if test -n "$$1"; then
6266
PKG_CHECK_EXISTS([$3],
6267
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
6275
# _PKG_SHORT_ERRORS_SUPPORTED
6276
# -----------------------------
6277
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
6278
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
6279
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
6280
_pkg_short_errors_supported=yes
6282
_pkg_short_errors_supported=no
6284
])# _PKG_SHORT_ERRORS_SUPPORTED
6287
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
6288
# [ACTION-IF-NOT-FOUND])
6291
# Note that if there is a possibility the first call to
6292
# PKG_CHECK_MODULES might not happen, you should be sure to include an
6293
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
6296
# --------------------------------------------------------------
6297
AC_DEFUN([PKG_CHECK_MODULES],
6298
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
6299
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
6300
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
6303
AC_MSG_CHECKING([for $1])
6305
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
6306
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
6308
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
6309
and $1[]_LIBS to avoid the need to call pkg-config.
6310
See the pkg-config man page for more details.])
6312
if test $pkg_failed = yes; then
6313
_PKG_SHORT_ERRORS_SUPPORTED
6314
if test $_pkg_short_errors_supported = yes; then
6315
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
6317
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
6223
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
6224
echo "*** See http://www.freedesktop.org/software/pkgconfig"
6228
if test $succeeded = yes; then
6229
ifelse([$3], , :, [$3])
6231
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])
6319
# Put the nasty error message in config.log where it belongs
6320
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
6322
ifelse([$4], , [AC_MSG_ERROR(dnl
6323
[Package requirements ($2) were not met:
6327
Consider adjusting the PKG_CONFIG_PATH environment variable if you
6328
installed software in a non-standard prefix.
6333
elif test $pkg_failed = untried; then
6334
ifelse([$4], , [AC_MSG_FAILURE(dnl
6335
[The pkg-config script could not be found or is too old. Make sure it
6336
is in your PATH or set the PKG_CONFIG environment variable to the full
6341
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
6344
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
6345
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
6346
AC_MSG_RESULT([yes])
6347
ifelse([$3], , :, [$3])
6349
])# PKG_CHECK_MODULES
6237
6351
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.