Pablo Galindo | a25f3c4 | 2020-04-23 01:38:11 +0100 | [diff] [blame] | 1 | # generated automatically by aclocal 1.16.2 -*- Autoconf -*- |
doko@ubuntu.com | 3536350 | 2015-04-13 20:53:43 +0200 | [diff] [blame] | 2 | |
Pablo Galindo | a25f3c4 | 2020-04-23 01:38:11 +0100 | [diff] [blame] | 3 | # Copyright (C) 1996-2020 Free Software Foundation, Inc. |
doko@ubuntu.com | 3536350 | 2015-04-13 20:53:43 +0200 | [diff] [blame] | 4 | |
| 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. |
| 8 | |
| 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 |
| 12 | # PARTICULAR PURPOSE. |
| 13 | |
| 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) |
Petr Viktorin | c6d7e82 | 2020-10-22 18:11:53 +0200 | [diff] [blame] | 15 | # =========================================================================== |
| 16 | # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html |
| 17 | # =========================================================================== |
| 18 | # |
| 19 | # SYNOPSIS |
| 20 | # |
| 21 | # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) |
| 22 | # |
| 23 | # DESCRIPTION |
| 24 | # |
| 25 | # Check whether the given FLAG works with the current language's compiler |
| 26 | # or gives an error. (Warnings, however, are ignored) |
| 27 | # |
| 28 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on |
| 29 | # success/failure. |
| 30 | # |
| 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. |
| 35 | # |
| 36 | # INPUT gives an alternative input source to AC_COMPILE_IFELSE. |
| 37 | # |
| 38 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this |
| 39 | # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. |
| 40 | # |
| 41 | # LICENSE |
| 42 | # |
| 43 | # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de> |
| 44 | # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com> |
| 45 | # |
| 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 |
| 49 | # warranty. |
| 50 | |
| 51 | #serial 6 |
| 52 | |
| 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 |
| 68 | |
Pablo Galindo | a25f3c4 | 2020-04-23 01:38:11 +0100 | [diff] [blame] | 69 | # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 70 | # serial 12 (pkg-config-0.29.2) |
Pablo Galindo | a25f3c4 | 2020-04-23 01:38:11 +0100 | [diff] [blame] | 71 | |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 72 | dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. |
| 73 | dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> |
| 74 | dnl |
| 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. |
| 79 | dnl |
| 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. |
| 84 | dnl |
| 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 |
| 88 | dnl 02111-1307, USA. |
| 89 | dnl |
| 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 |
| 94 | dnl program. |
| 95 | |
| 96 | dnl PKG_PREREQ(MIN-VERSION) |
| 97 | dnl ----------------------- |
| 98 | dnl Since: 0.29 |
| 99 | 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. |
| 104 | dnl |
| 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])]) |
| 108 | dnl |
| 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], |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 112 | [m4_define([PKG_MACROS_VERSION], [0.29.2]) |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 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])]) |
| 115 | ])dnl PKG_PREREQ |
| 116 | |
| 117 | dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) |
| 118 | dnl ---------------------------------- |
| 119 | dnl Since: 0.16 |
| 120 | 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]) |
| 133 | |
| 134 | if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then |
| 135 | AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) |
| 136 | fi |
| 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 |
| 141 | AC_MSG_RESULT([yes]) |
| 142 | else |
| 143 | AC_MSG_RESULT([no]) |
| 144 | PKG_CONFIG="" |
| 145 | fi |
| 146 | fi[]dnl |
| 147 | ])dnl PKG_PROG_PKG_CONFIG |
| 148 | |
| 149 | dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 150 | dnl ------------------------------------------------------------------- |
| 151 | dnl Since: 0.18 |
| 152 | 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. |
| 155 | dnl |
| 156 | dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) |
| 157 | dnl only at the first occurence 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 |
| 166 | $3])dnl |
| 167 | fi]) |
| 168 | |
| 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 |
| 175 | pkg_cv_[]$1="$$1" |
| 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 ], |
| 180 | [pkg_failed=yes]) |
| 181 | else |
| 182 | pkg_failed=untried |
| 183 | fi[]dnl |
| 184 | ])dnl _PKG_CONFIG |
| 185 | |
| 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 |
| 193 | else |
| 194 | _pkg_short_errors_supported=no |
| 195 | fi[]dnl |
| 196 | ])dnl _PKG_SHORT_ERRORS_SUPPORTED |
| 197 | |
| 198 | |
| 199 | dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 200 | dnl [ACTION-IF-NOT-FOUND]) |
| 201 | dnl -------------------------------------------------------------- |
| 202 | dnl Since: 0.4.0 |
| 203 | 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 |
| 211 | |
| 212 | pkg_failed=no |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 213 | AC_MSG_CHECKING([for $2]) |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 214 | |
| 215 | _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) |
| 216 | _PKG_CONFIG([$1][_LIBS], [libs], [$2]) |
| 217 | |
| 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.]) |
| 221 | |
| 222 | if test $pkg_failed = yes; then |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 223 | AC_MSG_RESULT([no]) |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 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` |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 227 | else |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 228 | $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` |
| 229 | fi |
| 230 | # Put the nasty error message in config.log where it belongs |
| 231 | echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD |
| 232 | |
| 233 | m4_default([$4], [AC_MSG_ERROR( |
| 234 | [Package requirements ($2) were not met: |
| 235 | |
| 236 | $$1_PKG_ERRORS |
| 237 | |
| 238 | Consider adjusting the PKG_CONFIG_PATH environment variable if you |
| 239 | installed software in a non-standard prefix. |
| 240 | |
| 241 | _PKG_TEXT])[]dnl |
| 242 | ]) |
| 243 | elif test $pkg_failed = untried; then |
Pablo Galindo | a57b3d3 | 2020-11-17 00:00:38 +0000 | [diff] [blame] | 244 | AC_MSG_RESULT([no]) |
Chih-Hsuan Yen | 03c0d2e | 2018-05-24 14:37:08 +0800 | [diff] [blame] | 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 |
| 248 | path to pkg-config. |
| 249 | |
| 250 | _PKG_TEXT |
| 251 | |
| 252 | To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl |
| 253 | ]) |
| 254 | else |
| 255 | $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS |
| 256 | $1[]_LIBS=$pkg_cv_[]$1[]_LIBS |
| 257 | AC_MSG_RESULT([yes]) |
| 258 | $3 |
| 259 | fi[]dnl |
| 260 | ])dnl PKG_CHECK_MODULES |
| 261 | |
| 262 | |
| 263 | dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], |
| 264 | dnl [ACTION-IF-NOT-FOUND]) |
| 265 | dnl --------------------------------------------------------------------- |
| 266 | dnl Since: 0.29 |
| 267 | 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. |
| 271 | dnl |
| 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 |
| 275 | dnl configure.ac. |
| 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 |
| 283 | |
| 284 | |
| 285 | dnl PKG_INSTALLDIR([DIRECTORY]) |
| 286 | dnl ------------------------- |
| 287 | dnl Since: 0.27 |
| 288 | 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 |
| 293 | dnl parameter. |
| 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]) |
| 304 | ])dnl PKG_INSTALLDIR |
| 305 | |
| 306 | |
| 307 | dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) |
| 308 | dnl -------------------------------- |
| 309 | dnl Since: 0.27 |
| 310 | 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 |
| 327 | |
| 328 | |
| 329 | dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, |
| 330 | dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
| 331 | dnl ------------------------------------------- |
| 332 | dnl Since: 0.28 |
| 333 | 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 |
| 338 | |
| 339 | _PKG_CONFIG([$1], [variable="][$3]["], [$2]) |
| 340 | AS_VAR_COPY([$1], [pkg_cv_][$1]) |
| 341 | |
| 342 | AS_VAR_IF([$1], [""], [$5], [$4])dnl |
| 343 | ])dnl PKG_CHECK_VAR |
| 344 | |
Benjamin Peterson | b3b8cb4 | 2018-09-18 23:49:05 -0700 | [diff] [blame] | 345 | m4_include([m4/ax_c_float_words_bigendian.m4]) |
Christian Heimes | ff5be6e | 2018-01-20 13:19:21 +0100 | [diff] [blame] | 346 | m4_include([m4/ax_check_openssl.m4]) |