]>
Commit | Line | Data |
---|---|---|
2232061b | 1 | # generated automatically by aclocal 1.11.3 -*- Autoconf -*- |
ef016f83 MF |
2 | |
3 | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, | |
2232061b MF |
4 | # 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, |
5 | # Inc. | |
ef016f83 MF |
6 | # This file is free software; the Free Software Foundation |
7 | # gives unlimited permission to copy and/or distribute it, | |
8 | # with or without modifications, as long as this notice is preserved. | |
9 | ||
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | |
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | |
13 | # PARTICULAR PURPOSE. | |
14 | ||
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 | # ---------------------------------- | |
41 | AC_DEFUN([PKG_PROG_PKG_CONFIG], | |
42 | [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) | |
9c082ca8 MF |
43 | m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) |
44 | m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) | |
ef016f83 MF |
45 | AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) |
46 | AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) | |
47 | AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) | |
48 | ||
49 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then | |
50 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) | |
51 | fi | |
52 | if 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 | |
61 | fi[]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 | # -------------------------------------------------------------- | |
74 | AC_DEFUN([PKG_CHECK_EXISTS], | |
75 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
76 | if test -n "$PKG_CONFIG" && \ | |
77 | AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then | |
78 | m4_default([$2], [:]) | |
79 | m4_ifvaln([$3], [else | |
80 | $3])dnl | |
81 | fi]) | |
82 | ||
83 | # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) | |
84 | # --------------------------------------------- | |
85 | m4_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], | |
9c082ca8 MF |
90 | [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` |
91 | test "x$?" != "x0" && pkg_failed=yes ], | |
ef016f83 MF |
92 | [pkg_failed=yes]) |
93 | else | |
94 | pkg_failed=untried | |
95 | fi[]dnl | |
96 | ])# _PKG_CONFIG | |
97 | ||
98 | # _PKG_SHORT_ERRORS_SUPPORTED | |
99 | # ----------------------------- | |
100 | AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], | |
101 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) | |
102 | if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then | |
103 | _pkg_short_errors_supported=yes | |
104 | else | |
105 | _pkg_short_errors_supported=no | |
106 | fi[]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 | # -------------------------------------------------------------- | |
120 | AC_DEFUN([PKG_CHECK_MODULES], | |
121 | [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl | |
122 | AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl | |
123 | AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl | |
124 | ||
125 | pkg_failed=no | |
126 | AC_MSG_CHECKING([for $1]) | |
127 | ||
128 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) | |
129 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) | |
130 | ||
131 | m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS | |
132 | and $1[]_LIBS to avoid the need to call pkg-config. | |
133 | See the pkg-config man page for more details.]) | |
134 | ||
135 | if test $pkg_failed = yes; then | |
136 | AC_MSG_RESULT([no]) | |
137 | _PKG_SHORT_ERRORS_SUPPORTED | |
138 | if test $_pkg_short_errors_supported = yes; then | |
9c082ca8 | 139 | $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` |
ef016f83 | 140 | else |
9c082ca8 | 141 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` |
ef016f83 MF |
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 | ||
151 | Consider adjusting the PKG_CONFIG_PATH environment variable if you | |
152 | installed software in a non-standard prefix. | |
153 | ||
154 | _PKG_TEXT])[]dnl | |
155 | ]) | |
156 | elif 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 | |
160 | is in your PATH or set the PKG_CONFIG environment variable to the full | |
161 | path to pkg-config. | |
162 | ||
163 | _PKG_TEXT | |
164 | ||
9c082ca8 | 165 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl |
ef016f83 MF |
166 | ]) |
167 | else | |
168 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS | |
169 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS | |
170 | AC_MSG_RESULT([yes]) | |
171 | $3 | |
172 | fi[]dnl | |
173 | ])# PKG_CHECK_MODULES | |
174 | ||
db2e4d67 MF |
175 | # AM_CONDITIONAL -*- Autoconf -*- |
176 | ||
177 | # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008 | |
178 | # Free Software Foundation, Inc. | |
179 | # | |
180 | # This file is free software; the Free Software Foundation | |
181 | # gives unlimited permission to copy and/or distribute it, | |
182 | # with or without modifications, as long as this notice is preserved. | |
183 | ||
184 | # serial 9 | |
185 | ||
186 | # AM_CONDITIONAL(NAME, SHELL-CONDITION) | |
187 | # ------------------------------------- | |
188 | # Define a conditional. | |
189 | AC_DEFUN([AM_CONDITIONAL], | |
190 | [AC_PREREQ(2.52)dnl | |
191 | ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], | |
192 | [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl | |
193 | AC_SUBST([$1_TRUE])dnl | |
194 | AC_SUBST([$1_FALSE])dnl | |
195 | _AM_SUBST_NOTMAKE([$1_TRUE])dnl | |
196 | _AM_SUBST_NOTMAKE([$1_FALSE])dnl | |
197 | m4_define([_AM_COND_VALUE_$1], [$2])dnl | |
198 | if $2; then | |
199 | $1_TRUE= | |
200 | $1_FALSE='#' | |
201 | else | |
202 | $1_TRUE='#' | |
203 | $1_FALSE= | |
204 | fi | |
205 | AC_CONFIG_COMMANDS_PRE( | |
206 | [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then | |
207 | AC_MSG_ERROR([[conditional "$1" was never defined. | |
208 | Usually this means the macro was only invoked conditionally.]]) | |
209 | fi])]) | |
210 | ||
211 | # Copyright (C) 2003, 2005 Free Software Foundation, Inc. | |
212 | # | |
213 | # This file is free software; the Free Software Foundation | |
214 | # gives unlimited permission to copy and/or distribute it, | |
215 | # with or without modifications, as long as this notice is preserved. | |
216 | ||
217 | # serial 2 | |
218 | ||
219 | # Check whether the underlying file-system supports filenames | |
220 | # with a leading dot. For instance MS-DOS doesn't. | |
221 | AC_DEFUN([AM_SET_LEADING_DOT], | |
222 | [rm -rf .tst 2>/dev/null | |
223 | mkdir .tst 2>/dev/null | |
224 | if test -d .tst; then | |
225 | am__leading_dot=. | |
226 | else | |
227 | am__leading_dot=_ | |
228 | fi | |
229 | rmdir .tst 2>/dev/null | |
230 | AC_SUBST([am__leading_dot])]) | |
231 | ||
2232061b | 232 | # Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. |
db2e4d67 MF |
233 | # |
234 | # This file is free software; the Free Software Foundation | |
235 | # gives unlimited permission to copy and/or distribute it, | |
236 | # with or without modifications, as long as this notice is preserved. | |
237 | ||
2232061b | 238 | # serial 3 |
db2e4d67 MF |
239 | |
240 | # _AM_SUBST_NOTMAKE(VARIABLE) | |
241 | # --------------------------- | |
242 | # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. | |
243 | # This macro is traced by Automake. | |
244 | AC_DEFUN([_AM_SUBST_NOTMAKE]) | |
245 | ||
246 | # AM_SUBST_NOTMAKE(VARIABLE) | |
2232061b | 247 | # -------------------------- |
db2e4d67 MF |
248 | # Public sister of _AM_SUBST_NOTMAKE. |
249 | AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) | |
250 |