14
14
m4_ifndef([AC_AUTOCONF_VERSION],
15
15
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
16
m4_if(AC_AUTOCONF_VERSION, [2.61],,
17
[m4_warning([this file was generated for autoconf 2.61.
16
m4_if(AC_AUTOCONF_VERSION, [2.63],,
17
[m4_warning([this file was generated for autoconf 2.63.
18
18
You have another version of autoconf. It may work, but is not guaranteed to.
19
19
If you have problems, you may need to regenerate the build system entirely.
20
20
To do so, use the procedure documented by the package, typically `autoreconf'.])])
22
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
24
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
26
# This program is free software; you can redistribute it and/or modify
27
# it under the terms of the GNU General Public License as published by
28
# the Free Software Foundation; either version 2 of the License, or
29
# (at your option) any later version.
31
# This program is distributed in the hope that it will be useful, but
32
# WITHOUT ANY WARRANTY; without even the implied warranty of
33
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
34
# General Public License for more details.
36
# You should have received a copy of the GNU General Public License
37
# along with this program; if not, write to the Free Software
38
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
40
# As a special exception to the GNU General Public License, if you
41
# distribute this file as part of a program that contains a
42
# configuration script generated by Autoconf, you may include it under
43
# the same distribution terms that you use for the rest of that program.
45
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
46
# ----------------------------------
47
AC_DEFUN([PKG_PROG_PKG_CONFIG],
48
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
49
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
50
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
51
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
52
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
54
if test -n "$PKG_CONFIG"; then
55
_pkg_min_version=m4_default([$1], [0.9.0])
56
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
57
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
65
])# PKG_PROG_PKG_CONFIG
67
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
69
# Check to see whether a particular set of modules exists. Similar
70
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
73
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
74
# this or PKG_CHECK_MODULES is called, or make sure to call
75
# PKG_CHECK_EXISTS manually
76
# --------------------------------------------------------------
77
AC_DEFUN([PKG_CHECK_EXISTS],
78
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
79
if test -n "$PKG_CONFIG" && \
80
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
81
m4_ifval([$2], [$2], [:])
87
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
88
# ---------------------------------------------
89
m4_define([_PKG_CONFIG],
90
[if test -n "$PKG_CONFIG"; then
91
if test -n "$$1"; then
94
PKG_CHECK_EXISTS([$3],
95
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
103
# _PKG_SHORT_ERRORS_SUPPORTED
104
# -----------------------------
105
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
106
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
107
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
108
_pkg_short_errors_supported=yes
110
_pkg_short_errors_supported=no
112
])# _PKG_SHORT_ERRORS_SUPPORTED
115
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
116
# [ACTION-IF-NOT-FOUND])
119
# Note that if there is a possibility the first call to
120
# PKG_CHECK_MODULES might not happen, you should be sure to include an
121
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
124
# --------------------------------------------------------------
125
AC_DEFUN([PKG_CHECK_MODULES],
126
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
127
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
128
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
131
AC_MSG_CHECKING([for $1])
133
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
134
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
136
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
137
and $1[]_LIBS to avoid the need to call pkg-config.
138
See the pkg-config man page for more details.])
140
if test $pkg_failed = yes; then
141
_PKG_SHORT_ERRORS_SUPPORTED
142
if test $_pkg_short_errors_supported = yes; then
143
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
145
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
147
# Put the nasty error message in config.log where it belongs
148
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
150
ifelse([$4], , [AC_MSG_ERROR(dnl
151
[Package requirements ($2) were not met:
155
Consider adjusting the PKG_CONFIG_PATH environment variable if you
156
installed software in a non-standard prefix.
162
elif test $pkg_failed = untried; then
163
ifelse([$4], , [AC_MSG_FAILURE(dnl
164
[The pkg-config script could not be found or is too old. Make sure it
165
is in your PATH or set the PKG_CONFIG environment variable to the full
170
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])],
173
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
174
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
176
ifelse([$3], , :, [$3])
178
])# PKG_CHECK_MODULES
22
180
# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
24
182
# This file is free software; the Free Software Foundation
543
701
rmdir .tst 2>/dev/null
544
702
AC_SUBST([am__leading_dot])])
704
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
707
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005
708
# Free Software Foundation, Inc.
710
# This file is free software; the Free Software Foundation
711
# gives unlimited permission to copy and/or distribute it,
712
# with or without modifications, as long as this notice is preserved.
716
AC_DEFUN([AM_MAINTAINER_MODE],
717
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
718
dnl maintainer-mode is disabled by default
719
AC_ARG_ENABLE(maintainer-mode,
720
[ --enable-maintainer-mode enable make rules and dependencies not useful
721
(and sometimes confusing) to the casual installer],
722
USE_MAINTAINER_MODE=$enableval,
723
USE_MAINTAINER_MODE=no)
724
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
725
AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
726
MAINT=$MAINTAINER_MODE_TRUE
731
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
546
733
# Check to see how 'make' treats includes. -*- Autoconf -*-
548
735
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.