53
53
AC_SUBST([USE_NLS])
56
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
57
# serial 1 (pkg-config-0.24)
59
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
61
# This program is free software; you can redistribute it and/or modify
62
# it under the terms of the GNU General Public License as published by
63
# the Free Software Foundation; either version 2 of the License, or
64
# (at your option) any later version.
66
# This program is distributed in the hope that it will be useful, but
67
# WITHOUT ANY WARRANTY; without even the implied warranty of
68
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
69
# General Public License for more details.
71
# You should have received a copy of the GNU General Public License
72
# along with this program; if not, write to the Free Software
73
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
75
# As a special exception to the GNU General Public License, if you
76
# distribute this file as part of a program that contains a
77
# configuration script generated by Autoconf, you may include it under
78
# the same distribution terms that you use for the rest of that program.
80
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
81
# ----------------------------------
82
AC_DEFUN([PKG_PROG_PKG_CONFIG],
83
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
84
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
85
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
86
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
87
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
88
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
90
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
91
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
93
if test -n "$PKG_CONFIG"; then
94
_pkg_min_version=m4_default([$1], [0.9.0])
95
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
96
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
103
])# PKG_PROG_PKG_CONFIG
105
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
107
# Check to see whether a particular set of modules exists. Similar
108
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
110
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
111
# only at the first occurence in configure.ac, so if the first place
112
# it's called might be skipped (such as if it is within an "if", you
113
# have to call PKG_CHECK_EXISTS manually
114
# --------------------------------------------------------------
115
AC_DEFUN([PKG_CHECK_EXISTS],
116
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
117
if test -n "$PKG_CONFIG" && \
118
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
119
m4_default([$2], [:])
120
m4_ifvaln([$3], [else
124
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
125
# ---------------------------------------------
126
m4_define([_PKG_CONFIG],
127
[if test -n "$$1"; then
129
elif test -n "$PKG_CONFIG"; then
130
PKG_CHECK_EXISTS([$3],
131
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
132
test "x$?" != "x0" && pkg_failed=yes ],
139
# _PKG_SHORT_ERRORS_SUPPORTED
140
# -----------------------------
141
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
142
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
143
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
144
_pkg_short_errors_supported=yes
146
_pkg_short_errors_supported=no
148
])# _PKG_SHORT_ERRORS_SUPPORTED
151
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
152
# [ACTION-IF-NOT-FOUND])
155
# Note that if there is a possibility the first call to
156
# PKG_CHECK_MODULES might not happen, you should be sure to include an
157
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160
# --------------------------------------------------------------
161
AC_DEFUN([PKG_CHECK_MODULES],
162
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
163
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
164
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
167
AC_MSG_CHECKING([for $1])
169
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
170
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
172
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
173
and $1[]_LIBS to avoid the need to call pkg-config.
174
See the pkg-config man page for more details.])
176
if test $pkg_failed = yes; then
178
_PKG_SHORT_ERRORS_SUPPORTED
179
if test $_pkg_short_errors_supported = yes; then
180
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
182
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
184
# Put the nasty error message in config.log where it belongs
185
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
187
m4_default([$4], [AC_MSG_ERROR(
188
[Package requirements ($2) were not met:
192
Consider adjusting the PKG_CONFIG_PATH environment variable if you
193
installed software in a non-standard prefix.
197
elif test $pkg_failed = untried; then
199
m4_default([$4], [AC_MSG_FAILURE(
200
[The pkg-config script could not be found or is too old. Make sure it
201
is in your PATH or set the PKG_CONFIG environment variable to the full
206
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
209
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
210
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
214
])# PKG_CHECK_MODULES
217
# PKG_INSTALLDIR(DIRECTORY)
218
# -------------------------
219
# Substitutes the variable pkgconfigdir as the location where a module
220
# should install pkg-config .pc files. By default the directory is
221
# $libdir/pkgconfig, but the default can be changed by passing
222
# DIRECTORY. The user can override through the --with-pkgconfigdir
224
AC_DEFUN([PKG_INSTALLDIR],
225
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
226
m4_pushdef([pkg_description],
227
[pkg-config installation directory @<:@]pkg_default[@:>@])
228
AC_ARG_WITH([pkgconfigdir],
229
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
230
[with_pkgconfigdir=]pkg_default)
231
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
232
m4_popdef([pkg_default])
233
m4_popdef([pkg_description])
234
]) dnl PKG_INSTALLDIR
237
# PKG_NOARCH_INSTALLDIR(DIRECTORY)
238
# -------------------------
239
# Substitutes the variable noarch_pkgconfigdir as the location where a
240
# module should install arch-independent pkg-config .pc files. By
241
# default the directory is $datadir/pkgconfig, but the default can be
242
# changed by passing DIRECTORY. The user can override through the
243
# --with-noarch-pkgconfigdir parameter.
244
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
245
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
246
m4_pushdef([pkg_description],
247
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
248
AC_ARG_WITH([noarch-pkgconfigdir],
249
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
250
[with_noarch_pkgconfigdir=]pkg_default)
251
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
252
m4_popdef([pkg_default])
253
m4_popdef([pkg_description])
254
]) dnl PKG_NOARCH_INSTALLDIR
257
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
258
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
259
# -------------------------------------------
260
# Retrieves the value of the pkg-config variable for the given module.
261
AC_DEFUN([PKG_CHECK_VAR],
262
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
263
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
265
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
266
AS_VAR_COPY([$1], [pkg_cv_][$1])
268
AS_VAR_IF([$1], [""], [$5], [$4])dnl
56
271
# ===========================================================================
57
272
# http://autoconf-archive.cryp.to/ax_check_enable_debug.html
58
273
# ===========================================================================
1124
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
1125
# serial 1 (pkg-config-0.24)
1127
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
1129
# This program is free software; you can redistribute it and/or modify
1130
# it under the terms of the GNU General Public License as published by
1131
# the Free Software Foundation; either version 2 of the License, or
1132
# (at your option) any later version.
1134
# This program is distributed in the hope that it will be useful, but
1135
# WITHOUT ANY WARRANTY; without even the implied warranty of
1136
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1137
# General Public License for more details.
1139
# You should have received a copy of the GNU General Public License
1140
# along with this program; if not, write to the Free Software
1141
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
1143
# As a special exception to the GNU General Public License, if you
1144
# distribute this file as part of a program that contains a
1145
# configuration script generated by Autoconf, you may include it under
1146
# the same distribution terms that you use for the rest of that program.
1148
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
1149
# ----------------------------------
1150
AC_DEFUN([PKG_PROG_PKG_CONFIG],
1151
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
1152
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
1153
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
1154
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
1155
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
1157
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
1158
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
1160
if test -n "$PKG_CONFIG"; then
1161
_pkg_min_version=m4_default([$1], [0.9.0])
1162
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
1163
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
1164
AC_MSG_RESULT([yes])
1170
])# PKG_PROG_PKG_CONFIG
1172
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
1174
# Check to see whether a particular set of modules exists. Similar
1175
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
1177
# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1178
# only at the first occurence in configure.ac, so if the first place
1179
# it's called might be skipped (such as if it is within an "if", you
1180
# have to call PKG_CHECK_EXISTS manually
1181
# --------------------------------------------------------------
1182
AC_DEFUN([PKG_CHECK_EXISTS],
1183
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1184
if test -n "$PKG_CONFIG" && \
1185
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
1186
m4_default([$2], [:])
1187
m4_ifvaln([$3], [else
1191
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
1192
# ---------------------------------------------
1193
m4_define([_PKG_CONFIG],
1194
[if test -n "$$1"; then
1196
elif test -n "$PKG_CONFIG"; then
1197
PKG_CHECK_EXISTS([$3],
1198
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
1205
# _PKG_SHORT_ERRORS_SUPPORTED
1206
# -----------------------------
1207
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
1208
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
1209
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
1210
_pkg_short_errors_supported=yes
1212
_pkg_short_errors_supported=no
1214
])# _PKG_SHORT_ERRORS_SUPPORTED
1217
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
1218
# [ACTION-IF-NOT-FOUND])
1221
# Note that if there is a possibility the first call to
1222
# PKG_CHECK_MODULES might not happen, you should be sure to include an
1223
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
1226
# --------------------------------------------------------------
1227
AC_DEFUN([PKG_CHECK_MODULES],
1228
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
1229
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
1230
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
1233
AC_MSG_CHECKING([for $1])
1235
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
1236
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
1238
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
1239
and $1[]_LIBS to avoid the need to call pkg-config.
1240
See the pkg-config man page for more details.])
1242
if test $pkg_failed = yes; then
1244
_PKG_SHORT_ERRORS_SUPPORTED
1245
if test $_pkg_short_errors_supported = yes; then
1246
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1`
1248
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1`
1250
# Put the nasty error message in config.log where it belongs
1251
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
1253
m4_default([$4], [AC_MSG_ERROR(
1254
[Package requirements ($2) were not met:
1258
Consider adjusting the PKG_CONFIG_PATH environment variable if you
1259
installed software in a non-standard prefix.
1263
elif test $pkg_failed = untried; then
1265
m4_default([$4], [AC_MSG_FAILURE(
1266
[The pkg-config script could not be found or is too old. Make sure it
1267
is in your PATH or set the PKG_CONFIG environment variable to the full
1272
To get pkg-config, see <http://pkg-config.freedesktop.org/>.])dnl
1275
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
1276
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
1277
AC_MSG_RESULT([yes])
1280
])# PKG_CHECK_MODULES
1282
1346
AC_DEFUN([YELP_HELP_INIT],
1284
1348
AC_REQUIRE([AC_PROG_LN_S])
1999
2068
AC_CONFIG_COMMANDS_PRE(dnl
2000
2069
[m4_provide_if([_AM_COMPILER_EXEEXT],
2001
2070
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
2072
# POSIX will say in a future version that running "rm -f" with no argument
2073
# is OK; and we want to be able to make that assumption in our Makefile
2074
# recipes. So use an aggressive probe to check that the usage we want is
2075
# actually supported "in the wild" to an acceptable degree.
2076
# See automake bug#10828.
2077
# To make any issue more visible, cause the running configure to be aborted
2078
# by default if the 'rm' program in use doesn't match our expectations; the
2079
# user can still override this though.
2080
if rm -f && rm -fr && rm -rf; then : OK; else
2084
Your 'rm' program seems unable to run without file operands specified
2085
on the command line, even when the '-f' option is present. This is contrary
2086
to the behaviour of most rm programs out there, and not conforming with
2087
the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
2089
Please tell bug-automake@gnu.org about your system, including the value
2090
of your $PATH and any error possibly output before this message. This
2091
can help us improve future automake versions.
2094
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
2095
echo 'Configuration will proceed anyway, since you have set the' >&2
2096
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
2100
Aborting the configuration process, to ensure you take notice of the issue.
2102
You can download and install GNU coreutils to get an 'rm' implementation
2103
that behaves properly: <http://www.gnu.org/software/coreutils/>.
2105
If you want to complete the configuration process using your problematic
2106
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
2107
to "yes", and re-run configure.
2110
AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
2004
2115
dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
2225
2335
AC_DEFUN([_AM_IF_OPTION],
2226
2336
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
2338
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
2340
# This file is free software; the Free Software Foundation
2341
# gives unlimited permission to copy and/or distribute it,
2342
# with or without modifications, as long as this notice is preserved.
2346
# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
2347
# to automatically call this.
2348
AC_DEFUN([_AM_PROG_CC_C_O],
2349
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
2350
AC_REQUIRE_AUX_FILE([compile])dnl
2351
AC_LANG_PUSH([C])dnl
2353
[whether $CC understands -c and -o together],
2354
[am_cv_prog_cc_c_o],
2355
[AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
2356
# Make sure it works both with $CC and with simple cc.
2357
# Following AC_PROG_CC_C_O, we do the test twice because some
2358
# compilers refuse to overwrite an existing .o file with -o,
2359
# though they will create one.
2360
am_cv_prog_cc_c_o=yes
2362
if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
2363
&& test -f conftest2.$ac_objext; then
2366
am_cv_prog_cc_c_o=no
2370
rm -f core conftest*
2372
if test "$am_cv_prog_cc_c_o" != yes; then
2373
# Losing compiler, so override with the script.
2374
# FIXME: It is wrong to rewrite CC.
2375
# But if we don't then we get into trouble of one sort or another.
2376
# A longer-term fix would be to have automake use am__CC in this case,
2377
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
2378
CC="$am_aux_dir/compile $CC"
2382
# For backward compatibility.
2383
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
2228
2385
# Copyright (C) 2001-2013 Free Software Foundation, Inc.
2230
2387
# This file is free software; the Free Software Foundation