1 # generated automatically by aclocal 1.11.1 -*- Autoconf -*-
3 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4 # 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 # This file is free software; the Free Software Foundation
6 # gives unlimited permission to copy and/or distribute it,
7 # with or without modifications, as long as this notice is preserved.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
11 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14 # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
15 # serial 1 (pkg-config-0.24)
17 # Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
19 # This program is free software; you can redistribute it and/or modify
20 # it under the terms of the GNU General Public License as published by
21 # the Free Software Foundation; either version 2 of the License, or
22 # (at your option) any later version.
24 # This program is distributed in the hope that it will be useful, but
25 # WITHOUT ANY WARRANTY; without even the implied warranty of
26 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 # General Public License for more details.
29 # You should have received a copy of the GNU General Public License
30 # along with this program; if not, write to the Free Software
31 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
33 # As a special exception to the GNU General Public License, if you
34 # distribute this file as part of a program that contains a
35 # configuration script generated by Autoconf, you may include it under
36 # the same distribution terms that you use for the rest of that program.
38 # PKG_PROG_PKG_CONFIG([MIN-VERSION])
39 # ----------------------------------
40 AC_DEFUN([PKG_PROG_PKG_CONFIG],
41 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
42 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
43 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
44 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
45 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
46 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
48 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
49 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
51 if test -n "$PKG_CONFIG"; then
52 _pkg_min_version=m4_default([$1], [0.9.0])
53 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
54 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
61 ])# PKG_PROG_PKG_CONFIG
63 # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
65 # Check to see whether a particular set of modules exists. Similar
66 # to PKG_CHECK_MODULES(), but does not set variables or print errors.
68 # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
69 # only at the first occurence in configure.ac, so if the first place
70 # it's called might be skipped (such as if it is within an "if", you
71 # have to call PKG_CHECK_EXISTS manually
72 # --------------------------------------------------------------
73 AC_DEFUN([PKG_CHECK_EXISTS],
74 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
75 if test -n "$PKG_CONFIG" && \
76 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
82 # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
83 # ---------------------------------------------
84 m4_define([_PKG_CONFIG],
85 [if test -n "$$1"; then
87 elif test -n "$PKG_CONFIG"; then
88 PKG_CHECK_EXISTS([$3],
89 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
90 test "x$?" != "x0" && pkg_failed=yes ],
97 # _PKG_SHORT_ERRORS_SUPPORTED
98 # -----------------------------
99 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
100 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
101 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
102 _pkg_short_errors_supported=yes
104 _pkg_short_errors_supported=no
106 ])# _PKG_SHORT_ERRORS_SUPPORTED
109 # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
110 # [ACTION-IF-NOT-FOUND])
113 # Note that if there is a possibility the first call to
114 # PKG_CHECK_MODULES might not happen, you should be sure to include an
115 # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
118 # --------------------------------------------------------------
119 AC_DEFUN([PKG_CHECK_MODULES],
120 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
121 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
122 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
125 AC_MSG_CHECKING([for $1])
127 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
128 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
130 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
131 and $1[]_LIBS to avoid the need to call pkg-config.
132 See the pkg-config man page for more details.])
134 if test $pkg_failed = yes; then
136 _PKG_SHORT_ERRORS_SUPPORTED
137 if test $_pkg_short_errors_supported = yes; then
138 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
140 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
142 # Put the nasty error message in config.log where it belongs
143 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
145 m4_default([$4], [AC_MSG_ERROR(
146 [Package requirements ($2) were not met:
150 Consider adjusting the PKG_CONFIG_PATH environment variable if you
151 installed software in a non-standard prefix.
155 elif test $pkg_failed = untried; then
157 m4_default([$4], [AC_MSG_FAILURE(
158 [The pkg-config script could not be found or is too old. Make sure it
159 is in your PATH or set the PKG_CONFIG environment variable to the full
164 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
167 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
168 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
172 ])# PKG_CHECK_MODULES
175 # PKG_INSTALLDIR(DIRECTORY)
176 # -------------------------
177 # Substitutes the variable pkgconfigdir as the location where a module
178 # should install pkg-config .pc files. By default the directory is
179 # $libdir/pkgconfig, but the default can be changed by passing
180 # DIRECTORY. The user can override through the --with-pkgconfigdir
182 AC_DEFUN([PKG_INSTALLDIR],
183 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
184 m4_pushdef([pkg_description],
185 [pkg-config installation directory @<:@]pkg_default[@:>@])
186 AC_ARG_WITH([pkgconfigdir],
187 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
188 [with_pkgconfigdir=]pkg_default)
189 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
190 m4_popdef([pkg_default])
191 m4_popdef([pkg_description])
192 ]) dnl PKG_INSTALLDIR
195 # PKG_NOARCH_INSTALLDIR(DIRECTORY)
196 # -------------------------
197 # Substitutes the variable noarch_pkgconfigdir as the location where a
198 # module should install arch-independent pkg-config .pc files. By
199 # default the directory is $datadir/pkgconfig, but the default can be
200 # changed by passing DIRECTORY. The user can override through the
201 # --with-noarch-pkgconfigdir parameter.
202 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
203 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
204 m4_pushdef([pkg_description],
205 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
206 AC_ARG_WITH([noarch-pkgconfigdir],
207 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
208 [with_noarch_pkgconfigdir=]pkg_default)
209 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
210 m4_popdef([pkg_default])
211 m4_popdef([pkg_description])
212 ]) dnl PKG_NOARCH_INSTALLDIR
215 # PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
216 # [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
217 # -------------------------------------------
218 # Retrieves the value of the pkg-config variable for the given module.
219 AC_DEFUN([PKG_CHECK_VAR],
220 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
221 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
223 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
224 AS_VAR_COPY([$1], [pkg_cv_][$1])
226 AS_VAR_IF([$1], [""], [$5], [$4])dnl
229 # AM_CONDITIONAL -*- Autoconf -*-
231 # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
232 # Free Software Foundation, Inc.
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.
240 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
241 # -------------------------------------
242 # Define a conditional.
243 AC_DEFUN([AM_CONDITIONAL],
245 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
246 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
247 AC_SUBST([$1_TRUE])dnl
248 AC_SUBST([$1_FALSE])dnl
249 _AM_SUBST_NOTMAKE([$1_TRUE])dnl
250 _AM_SUBST_NOTMAKE([$1_FALSE])dnl
251 m4_define([_AM_COND_VALUE_$1], [$2])dnl
259 AC_CONFIG_COMMANDS_PRE(
260 [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
261 AC_MSG_ERROR([[conditional "$1" was never defined.
262 Usually this means the macro was only invoked conditionally.]])
265 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
267 # This file is free software; the Free Software Foundation
268 # gives unlimited permission to copy and/or distribute it,
269 # with or without modifications, as long as this notice is preserved.
273 # Check whether the underlying file-system supports filenames
274 # with a leading dot. For instance MS-DOS doesn't.
275 AC_DEFUN([AM_SET_LEADING_DOT],
276 [rm -rf .tst 2>/dev/null
277 mkdir .tst 2>/dev/null
278 if test -d .tst; then
283 rmdir .tst 2>/dev/null
284 AC_SUBST([am__leading_dot])])
286 # Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
289 # Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
290 # Free Software Foundation, Inc.
292 # This file is free software; the Free Software Foundation
293 # gives unlimited permission to copy and/or distribute it,
294 # with or without modifications, as long as this notice is preserved.
298 # AM_MAINTAINER_MODE([DEFAULT-MODE])
299 # ----------------------------------
300 # Control maintainer-specific portions of Makefiles.
301 # Default is to disable them, unless `enable' is passed literally.
302 # For symmetry, `disable' may be passed as well. Anyway, the user
303 # can override the default with the --enable/--disable switch.
304 AC_DEFUN([AM_MAINTAINER_MODE],
305 [m4_case(m4_default([$1], [disable]),
306 [enable], [m4_define([am_maintainer_other], [disable])],
307 [disable], [m4_define([am_maintainer_other], [enable])],
308 [m4_define([am_maintainer_other], [enable])
309 m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
310 AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
311 dnl maintainer-mode's default is 'disable' unless 'enable' is passed
312 AC_ARG_ENABLE([maintainer-mode],
313 [ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
314 (and sometimes confusing) to the casual installer],
315 [USE_MAINTAINER_MODE=$enableval],
316 [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
317 AC_MSG_RESULT([$USE_MAINTAINER_MODE])
318 AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
319 MAINT=$MAINTAINER_MODE_TRUE
324 AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
326 # Copyright (C) 2006, 2008 Free Software Foundation, Inc.
328 # This file is free software; the Free Software Foundation
329 # gives unlimited permission to copy and/or distribute it,
330 # with or without modifications, as long as this notice is preserved.
334 # _AM_SUBST_NOTMAKE(VARIABLE)
335 # ---------------------------
336 # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
337 # This macro is traced by Automake.
338 AC_DEFUN([_AM_SUBST_NOTMAKE])
340 # AM_SUBST_NOTMAKE(VARIABLE)
341 # ---------------------------
342 # Public sister of _AM_SUBST_NOTMAKE.
343 AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])