annotate m4/pkg.m4 @ 4677:04c53c9d261b

Add provision for Interface plugins.
author William Pitcock <nenolod@atheme.org>
date Sun, 29 Jun 2008 12:59:51 -0500
parents 0813d0d66627
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
1 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
2 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
3 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
4 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
5 # This program is free software; you can redistribute it and/or modify
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
6 # it under the terms of the GNU General Public License as published by
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
7 # the Free Software Foundation; either version 2 of the License, or
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
8 # (at your option) any later version.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
9 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
10 # This program is distributed in the hope that it will be useful, but
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
13 # General Public License for more details.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
14 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
15 # You should have received a copy of the GNU General Public License
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
16 # along with this program; if not, write to the Free Software
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
18 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
19 # As a special exception to the GNU General Public License, if you
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
20 # distribute this file as part of a program that contains a
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
21 # configuration script generated by Autoconf, you may include it under
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
22 # the same distribution terms that you use for the rest of that program.
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
23
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
24 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
25 # ----------------------------------
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
26 AC_DEFUN([PKG_PROG_PKG_CONFIG],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
27 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
28 m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
29 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
30 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
31 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
32 fi
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
33 if test "x$PKG_CONFIG" != "x"; then
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
34 _pkg_min_version=m4_default([$1], [0.9.0])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
35 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
4472
973f75277ce4 Some old versions of pkg-config don't _really_ obey --errors-to-stdout, so we redirect stderr to stdout on shell level.
Matti Hamalainen <ccr@tnsp.org>
parents: 4471
diff changeset
36 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version ; then
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
37 AC_MSG_RESULT([yes])
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
38 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
39 _pkg_short_errors_supported=yes
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
40 else
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
41 _pkg_short_errors_supported=no
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
42 fi
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
43 else
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
44 AC_MSG_RESULT([no])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
45 PKG_CONFIG=""
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
46 fi
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
47
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
48 fi[]dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
49 ])# PKG_PROG_PKG_CONFIG
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
50
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
51 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
52 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
53 # Check to see whether a particular set of modules exists. Similar
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
54 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
55 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
56 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
57 # Similar to PKG_CHECK_MODULES, make sure that the first instance of
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
58 # this or PKG_CHECK_MODULES is called, or make sure to call
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
59 # PKG_CHECK_EXISTS manually
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
60 # --------------------------------------------------------------
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
61 AC_DEFUN([PKG_CHECK_EXISTS],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
62 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
63 if test "x$PKG_CONFIG" != "x" && \
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
64 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
65 m4_ifval([$2], [$2], [:])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
66 m4_ifvaln([$3], [else
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
67 $3])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
68 fi])
0
cb178e5ad177 [svn] Import audacious source.
nenolod
parents:
diff changeset
69
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
70 # _PKG_CONFIG([VARIABLE], [MODULES])
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
71 # ---------------------------------------------
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
72 m4_define([_PKG_CONFIG],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
73 [if test "x$PKG_CONFIG" != "x"; then
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
74 if AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$2"]); then
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
75 if test "x${$1[]_CFLAGS}" != "x"; then
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
76 pkg_cv_[]$1[]_CFLAGS="${$1[]_CFLAGS}"
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
77 else
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
78 pkg_cv_[]$1[]_CFLAGS=`$PKG_CONFIG --cflags "$2" 2>/dev/null`
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
79 fi
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
80 if test "x${$1[]_LIBS}" != "x"; then
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
81 pkg_cv_[]$1[]_LIBS="${$1_LIBS}"
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
82 else
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
83 pkg_cv_[]$1[]_LIBS=`$PKG_CONFIG --libs "$2" 2>/dev/null`
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
84 fi
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
85 else
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
86 pkg_failed="yes"
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
87 fi
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
88 else
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
89 pkg_failed="untried"
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
90 fi[]dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
91 ])# _PKG_CONFIG
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
92
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
93 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
94 # [ACTION-IF-NOT-FOUND])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
95 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
96 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
97 # Note that if there is a possibility the first call to
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
98 # PKG_CHECK_MODULES might not happen, you should be sure to include an
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
99 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
100 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
101 #
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
102 # --------------------------------------------------------------
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
103 AC_DEFUN([PKG_CHECK_MODULES],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
104 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
105 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
106 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
107 pkg_failed=no
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
108 AC_MSG_CHECKING([for $1])
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
109 _PKG_CONFIG([$1], [$2])
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
110 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
111 and $1[]_LIBS to avoid the need to call pkg-config.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
112 See the pkg-config man page for more details.])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
113
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
114 if test "x$pkg_failed" = "xyes"; then
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
115 if test "x$_pkg_short_errors_supported" = "xyes"; then
4472
973f75277ce4 Some old versions of pkg-config don't _really_ obey --errors-to-stdout, so we redirect stderr to stdout on shell level.
Matti Hamalainen <ccr@tnsp.org>
parents: 4471
diff changeset
116 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2" 2>&1`
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
117 else
4472
973f75277ce4 Some old versions of pkg-config don't _really_ obey --errors-to-stdout, so we redirect stderr to stdout on shell level.
Matti Hamalainen <ccr@tnsp.org>
parents: 4471
diff changeset
118 $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2" 2>&1`
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
119 fi
4639
0813d0d66627 Sanitize pkg.m4 somewhat.
Matti Hamalainen <ccr@tnsp.org>
parents: 4621
diff changeset
120 dnl Put the nasty error message in config.log where it belongs
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
121 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
122 ifelse([$4], , [AC_MSG_ERROR(dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
123 [Package requirements ($2) were not met:
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
124
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
125 $$1_PKG_ERRORS
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
126
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
127 Consider adjusting the PKG_CONFIG_PATH environment variable if you
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
128 installed software in a non-standard prefix.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
129
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
130 _PKG_TEXT
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
131 ])],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
132 [AC_MSG_RESULT([no])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
133 $4])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
134 elif test "x$pkg_failed" = "xuntried"; then
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
135 ifelse([$4], , [AC_MSG_FAILURE(dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
136 [The pkg-config script could not be found or is too old. Make sure it
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
137 is in your PATH or set the PKG_CONFIG environment variable to the full
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
138 path to pkg-config.
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
139
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
140 _PKG_TEXT
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
141
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
142 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
143 [$4])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
144 else
4621
fb56923e8206 Updated pkg.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 4472
diff changeset
145 $1[]_CFLAGS="$pkg_cv_[]$1[]_CFLAGS"
fb56923e8206 Updated pkg.m4.
Matti Hamalainen <ccr@tnsp.org>
parents: 4472
diff changeset
146 $1[]_LIBS="$pkg_cv_[]$1[]_LIBS"
4471
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
147 AC_MSG_RESULT([yes])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
148 ifelse([$3], , :, [$3])
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
149 fi[]dnl
4d1dffd9ebf7 Updated pkg.m4 from Debian testing and added some shell portability fixes myself.
Matti Hamalainen <ccr@tnsp.org>
parents: 4462
diff changeset
150 ])# PKG_CHECK_MODULES