1 # generated automatically by aclocal 1.15.1 -*- Autoconf -*-
3 # Copyright (C) 1996-2017 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 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
15 # ===========================================================================
16 # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
17 # ===========================================================================
21 # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
25 # Check whether the given FLAG works with the current language's compiler
26 # or gives an error. (Warnings, however, are ignored)
28 # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
31 # If EXTRA-FLAGS is defined, it is added to the current language's default
32 # flags (e.g. CFLAGS) when the check is done. The check is thus made with
33 # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
34 # force the compiler to issue an error when a bad flag is given.
36 # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
38 # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
39 # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
43 # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
44 # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
46 # Copying and distribution of this file, with or without modification, are
47 # permitted in any medium without royalty provided the copyright notice
48 # and this notice are preserved. This file is offered as-is, without any
53 AC_DEFUN([AX_CHECK_COMPILE_FLAG],
54 [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
55 AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
56 AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
57 ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
58 _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
59 AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
60 [AS_VAR_SET(CACHEVAR,[yes])],
61 [AS_VAR_SET(CACHEVAR,[no])])
62 _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
63 AS_VAR_IF(CACHEVAR,yes,
64 [m4_default([$2], :)],
65 [m4_default([$3], :)])
66 AS_VAR_POPDEF([CACHEVAR])dnl
67 ])dnl AX_CHECK_COMPILE_FLAGS
69 dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
70 dnl serial 11 (pkg-config-0.29)
72 dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
73 dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
75 dnl This program is free software; you can redistribute it and/or modify
76 dnl it under the terms of the GNU General Public License as published by
77 dnl the Free Software Foundation; either version 2 of the License, or
78 dnl (at your option) any later version.
80 dnl This program is distributed in the hope that it will be useful, but
81 dnl WITHOUT ANY WARRANTY; without even the implied warranty of
82 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
83 dnl General Public License for more details.
85 dnl You should have received a copy of the GNU General Public License
86 dnl along with this program; if not, write to the Free Software
87 dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
90 dnl As a special exception to the GNU General Public License, if you
91 dnl distribute this file as part of a program that contains a
92 dnl configuration script generated by Autoconf, you may include it under
93 dnl the same distribution terms that you use for the rest of that
96 dnl PKG_PREREQ(MIN-VERSION)
97 dnl -----------------------
100 dnl Verify that the version of the pkg-config macros are at least
101 dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
102 dnl installed version of pkg-config, this checks the developer's version
103 dnl of pkg.m4 when generating configure.
105 dnl To ensure that this macro is defined, also add:
106 dnl m4_ifndef([PKG_PREREQ],
107 dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
109 dnl See the "Since" comment for each macro you use to see what version
110 dnl of the macros you require.
111 m4_defun([PKG_PREREQ],
112 [m4_define([PKG_MACROS_VERSION], [0.29])
113 m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
114 [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
117 dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
118 dnl ----------------------------------
121 dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
122 dnl first found in the path. Checks that the version of pkg-config found
123 dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
124 dnl used since that's the first version where most current features of
125 dnl pkg-config existed.
126 AC_DEFUN([PKG_PROG_PKG_CONFIG],
127 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
128 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
129 m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
130 AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
131 AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
132 AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
134 if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
135 AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
137 if test -n "$PKG_CONFIG"; then
138 _pkg_min_version=m4_default([$1], [0.9.0])
139 AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
140 if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
147 ])dnl PKG_PROG_PKG_CONFIG
149 dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
150 dnl -------------------------------------------------------------------
153 dnl Check to see whether a particular set of modules exists. Similar to
154 dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
156 dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
157 dnl only at the first occurrence in configure.ac, so if the first place
158 dnl it's called might be skipped (such as if it is within an "if", you
159 dnl have to call PKG_CHECK_EXISTS manually
160 AC_DEFUN([PKG_CHECK_EXISTS],
161 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
162 if test -n "$PKG_CONFIG" && \
163 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
164 m4_default([$2], [:])
165 m4_ifvaln([$3], [else
169 dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
170 dnl ---------------------------------------------
171 dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
172 dnl pkg_failed based on the result.
173 m4_define([_PKG_CONFIG],
174 [if test -n "$$1"; then
176 elif test -n "$PKG_CONFIG"; then
177 PKG_CHECK_EXISTS([$3],
178 [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
179 test "x$?" != "x0" && pkg_failed=yes ],
186 dnl _PKG_SHORT_ERRORS_SUPPORTED
187 dnl ---------------------------
188 dnl Internal check to see if pkg-config supports short errors.
189 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
190 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
191 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
192 _pkg_short_errors_supported=yes
194 _pkg_short_errors_supported=no
196 ])dnl _PKG_SHORT_ERRORS_SUPPORTED
199 dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
200 dnl [ACTION-IF-NOT-FOUND])
201 dnl --------------------------------------------------------------
204 dnl Note that if there is a possibility the first call to
205 dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
206 dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
207 AC_DEFUN([PKG_CHECK_MODULES],
208 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
209 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
210 AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
213 AC_MSG_CHECKING([for $1])
215 _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
216 _PKG_CONFIG([$1][_LIBS], [libs], [$2])
218 m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
219 and $1[]_LIBS to avoid the need to call pkg-config.
220 See the pkg-config man page for more details.])
222 if test $pkg_failed = yes; then
224 _PKG_SHORT_ERRORS_SUPPORTED
225 if test $_pkg_short_errors_supported = yes; then
226 $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
228 $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
230 # Put the nasty error message in config.log where it belongs
231 echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
233 m4_default([$4], [AC_MSG_ERROR(
234 [Package requirements ($2) were not met:
238 Consider adjusting the PKG_CONFIG_PATH environment variable if you
239 installed software in a non-standard prefix.
243 elif test $pkg_failed = untried; then
245 m4_default([$4], [AC_MSG_FAILURE(
246 [The pkg-config script could not be found or is too old. Make sure it
247 is in your PATH or set the PKG_CONFIG environment variable to the full
252 To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
255 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
256 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
260 ])dnl PKG_CHECK_MODULES
263 dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
264 dnl [ACTION-IF-NOT-FOUND])
265 dnl ---------------------------------------------------------------------
268 dnl Checks for existence of MODULES and gathers its build flags with
269 dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
270 dnl and VARIABLE-PREFIX_LIBS from --libs.
272 dnl Note that if there is a possibility the first call to
273 dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
274 dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
276 AC_DEFUN([PKG_CHECK_MODULES_STATIC],
277 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
278 _save_PKG_CONFIG=$PKG_CONFIG
279 PKG_CONFIG="$PKG_CONFIG --static"
280 PKG_CHECK_MODULES($@)
281 PKG_CONFIG=$_save_PKG_CONFIG[]dnl
282 ])dnl PKG_CHECK_MODULES_STATIC
285 dnl PKG_INSTALLDIR([DIRECTORY])
286 dnl -------------------------
289 dnl Substitutes the variable pkgconfigdir as the location where a module
290 dnl should install pkg-config .pc files. By default the directory is
291 dnl $libdir/pkgconfig, but the default can be changed by passing
292 dnl DIRECTORY. The user can override through the --with-pkgconfigdir
294 AC_DEFUN([PKG_INSTALLDIR],
295 [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
296 m4_pushdef([pkg_description],
297 [pkg-config installation directory @<:@]pkg_default[@:>@])
298 AC_ARG_WITH([pkgconfigdir],
299 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
300 [with_pkgconfigdir=]pkg_default)
301 AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
302 m4_popdef([pkg_default])
303 m4_popdef([pkg_description])
307 dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
308 dnl --------------------------------
311 dnl Substitutes the variable noarch_pkgconfigdir as the location where a
312 dnl module should install arch-independent pkg-config .pc files. By
313 dnl default the directory is $datadir/pkgconfig, but the default can be
314 dnl changed by passing DIRECTORY. The user can override through the
315 dnl --with-noarch-pkgconfigdir parameter.
316 AC_DEFUN([PKG_NOARCH_INSTALLDIR],
317 [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
318 m4_pushdef([pkg_description],
319 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
320 AC_ARG_WITH([noarch-pkgconfigdir],
321 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
322 [with_noarch_pkgconfigdir=]pkg_default)
323 AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
324 m4_popdef([pkg_default])
325 m4_popdef([pkg_description])
326 ])dnl PKG_NOARCH_INSTALLDIR
329 dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
330 dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
331 dnl -------------------------------------------
334 dnl Retrieves the value of the pkg-config variable for the given module.
335 AC_DEFUN([PKG_CHECK_VAR],
336 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
337 AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
339 _PKG_CONFIG([$1], [variable="][$3]["], [$2])
340 AS_VAR_COPY([$1], [pkg_cv_][$1])
342 AS_VAR_IF([$1], [""], [$5], [$4])dnl
345 m4_include([config/m4/icu-conditional.m4])
346 m4_include([acinclude.m4])