author | mullan |
Wed, 13 Nov 2019 13:43:06 -0500 | |
changeset 59059 | 27a266d5fb13 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
1 |
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
15070
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
2 |
|
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
3 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
4 |
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
6 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
7 |
# This code is free software; you can redistribute it and/or modify it |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
9 |
# published by the Free Software Foundation. Oracle designates this |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
10 |
# particular file as subject to the "Classpath" exception as provided |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
11 |
# by Oracle in the LICENSE file that accompanied this code. |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
12 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
13 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
14 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
15 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
16 |
# version 2 for more details (a copy is included in the LICENSE file that |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
17 |
# accompanied this code). |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
18 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
19 |
# You should have received a copy of the GNU General Public License version |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
20 |
# 2 along with this work; if not, write to the Free Software Foundation, |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
21 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
22 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
23 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
24 |
# or visit www.oracle.com if you need additional information or have any |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
25 |
# questions. |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
26 |
# |
f8c9af9daf6f
8005284: build-infra: nonstandard copyright headers under common/autoconf/build-aux
ohair
parents:
12258
diff
changeset
|
27 |
|
12258
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
28 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
29 |
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
30 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
31 |
# This program is free software; you can redistribute it and/or modify |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
32 |
# it under the terms of the GNU General Public License as published by |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
33 |
# the Free Software Foundation; either version 2 of the License, or |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
34 |
# (at your option) any later version. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
35 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
36 |
# This program is distributed in the hope that it will be useful, but |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
37 |
# WITHOUT ANY WARRANTY; without even the implied warranty of |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
38 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
39 |
# General Public License for more details. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
40 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
41 |
# You should have received a copy of the GNU General Public License |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
42 |
# along with this program; if not, write to the Free Software |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
43 |
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
44 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
45 |
# As a special exception to the GNU General Public License, if you |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
46 |
# distribute this file as part of a program that contains a |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
47 |
# configuration script generated by Autoconf, you may include it under |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
48 |
# the same distribution terms that you use for the rest of that program. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
49 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
50 |
# PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
51 |
# ---------------------------------- |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
52 |
AC_DEFUN([PKG_PROG_PKG_CONFIG], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
53 |
[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
54 |
m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
55 |
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
56 |
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
57 |
AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
58 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
59 |
if test -n "$PKG_CONFIG"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
60 |
_pkg_min_version=m4_default([$1], [0.9.0]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
61 |
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
62 |
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
63 |
AC_MSG_RESULT([yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
64 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
65 |
AC_MSG_RESULT([no]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
66 |
PKG_CONFIG="" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
67 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
68 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
69 |
fi[]dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
70 |
])# PKG_PROG_PKG_CONFIG |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
71 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
72 |
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
73 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
74 |
# Check to see whether a particular set of modules exists. Similar |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
75 |
# to PKG_CHECK_MODULES(), but does not set variables or print errors. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
76 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
77 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
78 |
# Similar to PKG_CHECK_MODULES, make sure that the first instance of |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
79 |
# this or PKG_CHECK_MODULES is called, or make sure to call |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
80 |
# PKG_CHECK_EXISTS manually |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
81 |
# -------------------------------------------------------------- |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
82 |
AC_DEFUN([PKG_CHECK_EXISTS], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
83 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
84 |
if test -n "$PKG_CONFIG" && \ |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
85 |
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
86 |
m4_ifval([$2], [$2], [:]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
87 |
m4_ifvaln([$3], [else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
88 |
$3])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
89 |
fi]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
90 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
91 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
92 |
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
93 |
# --------------------------------------------- |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
94 |
m4_define([_PKG_CONFIG], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
95 |
[if test -n "$$1"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
96 |
pkg_cv_[]$1="$$1" |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
97 |
elif test -n "$PKG_CONFIG"; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
98 |
PKG_CHECK_EXISTS([$3], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
99 |
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
100 |
[pkg_failed=yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
101 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
102 |
pkg_failed=untried |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
103 |
fi[]dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
104 |
])# _PKG_CONFIG |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
105 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
106 |
# _PKG_SHORT_ERRORS_SUPPORTED |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
107 |
# ----------------------------- |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
108 |
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
109 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
110 |
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
111 |
_pkg_short_errors_supported=yes |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
112 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
113 |
_pkg_short_errors_supported=no |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
114 |
fi[]dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
115 |
])# _PKG_SHORT_ERRORS_SUPPORTED |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
116 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
117 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
118 |
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
119 |
# [ACTION-IF-NOT-FOUND]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
120 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
121 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
122 |
# Note that if there is a possibility the first call to |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
123 |
# PKG_CHECK_MODULES might not happen, you should be sure to include an |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
124 |
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
125 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
126 |
# |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
127 |
# -------------------------------------------------------------- |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
128 |
AC_DEFUN([PKG_CHECK_MODULES], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
129 |
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
130 |
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
131 |
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
132 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
133 |
pkg_failed=no |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
134 |
AC_MSG_CHECKING([for $1]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
135 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
136 |
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
137 |
_PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
138 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
139 |
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
140 |
and $1[]_LIBS to avoid the need to call pkg-config. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
141 |
See the pkg-config man page for more details.]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
142 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
143 |
if test $pkg_failed = yes; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
144 |
_PKG_SHORT_ERRORS_SUPPORTED |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
145 |
if test $_pkg_short_errors_supported = yes; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
146 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
147 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
148 |
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
149 |
fi |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
150 |
# Put the nasty error message in config.log where it belongs |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
151 |
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
152 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
153 |
ifelse([$4], , [AC_MSG_ERROR(dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
154 |
[Package requirements ($2) were not met: |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
155 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
156 |
$$1_PKG_ERRORS |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
157 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
158 |
Consider adjusting the PKG_CONFIG_PATH environment variable if you |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
159 |
installed software in a non-standard prefix. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
160 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
161 |
_PKG_TEXT |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
162 |
])], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
163 |
[AC_MSG_RESULT([no]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
164 |
$4]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
165 |
elif test $pkg_failed = untried; then |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
166 |
ifelse([$4], , [AC_MSG_FAILURE(dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
167 |
[The pkg-config script could not be found or is too old. Make sure it |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
168 |
is in your PATH or set the PKG_CONFIG environment variable to the full |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
169 |
path to pkg-config. |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
170 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
171 |
_PKG_TEXT |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
172 |
|
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
173 |
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])], |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
174 |
[$4]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
175 |
else |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
176 |
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
177 |
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
178 |
AC_MSG_RESULT([yes]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
179 |
ifelse([$3], , :, [$3]) |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
180 |
fi[]dnl |
6ec26f6cc53e
7074397: Build infrastructure changes (makefile re-write)
ohair
parents:
diff
changeset
|
181 |
])# PKG_CHECK_MODULES |