1# generated automatically by aclocal 1.15.1 -*- Autoconf -*- 2 3# Copyright (C) 1996-2017 Free Software Foundation, Inc. 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 14m4_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# =========================================================================== 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 53AC_DEFUN([AX_CHECK_COMPILE_FLAG], 54[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 55AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl 56AC_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]) 63AS_VAR_IF(CACHEVAR,yes, 64 [m4_default([$2], :)], 65 [m4_default([$3], :)]) 66AS_VAR_POPDEF([CACHEVAR])dnl 67])dnl AX_CHECK_COMPILE_FLAGS 68 69dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- 70dnl serial 11 (pkg-config-0.29) 71dnl 72dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>. 73dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com> 74dnl 75dnl This program is free software; you can redistribute it and/or modify 76dnl it under the terms of the GNU General Public License as published by 77dnl the Free Software Foundation; either version 2 of the License, or 78dnl (at your option) any later version. 79dnl 80dnl This program is distributed in the hope that it will be useful, but 81dnl WITHOUT ANY WARRANTY; without even the implied warranty of 82dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 83dnl General Public License for more details. 84dnl 85dnl You should have received a copy of the GNU General Public License 86dnl along with this program; if not, write to the Free Software 87dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 88dnl 02111-1307, USA. 89dnl 90dnl As a special exception to the GNU General Public License, if you 91dnl distribute this file as part of a program that contains a 92dnl configuration script generated by Autoconf, you may include it under 93dnl the same distribution terms that you use for the rest of that 94dnl program. 95 96dnl PKG_PREREQ(MIN-VERSION) 97dnl ----------------------- 98dnl Since: 0.29 99dnl 100dnl Verify that the version of the pkg-config macros are at least 101dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's 102dnl installed version of pkg-config, this checks the developer's version 103dnl of pkg.m4 when generating configure. 104dnl 105dnl To ensure that this macro is defined, also add: 106dnl m4_ifndef([PKG_PREREQ], 107dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])]) 108dnl 109dnl See the "Since" comment for each macro you use to see what version 110dnl of the macros you require. 111m4_defun([PKG_PREREQ], 112[m4_define([PKG_MACROS_VERSION], [0.29]) 113m4_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 117dnl PKG_PROG_PKG_CONFIG([MIN-VERSION]) 118dnl ---------------------------------- 119dnl Since: 0.16 120dnl 121dnl Search for the pkg-config tool and set the PKG_CONFIG variable to 122dnl first found in the path. Checks that the version of pkg-config found 123dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is 124dnl used since that's the first version where most current features of 125dnl pkg-config existed. 126AC_DEFUN([PKG_PROG_PKG_CONFIG], 127[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) 128m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) 129m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) 130AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) 131AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) 132AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) 133 134if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then 135 AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) 136fi 137if 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 146fi[]dnl 147])dnl PKG_PROG_PKG_CONFIG 148 149dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 150dnl ------------------------------------------------------------------- 151dnl Since: 0.18 152dnl 153dnl Check to see whether a particular set of modules exists. Similar to 154dnl PKG_CHECK_MODULES(), but does not set variables or print errors. 155dnl 156dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 157dnl only at the first occurrence in configure.ac, so if the first place 158dnl it's called might be skipped (such as if it is within an "if", you 159dnl have to call PKG_CHECK_EXISTS manually 160AC_DEFUN([PKG_CHECK_EXISTS], 161[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 162if test -n "$PKG_CONFIG" && \ 163 AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then 164 m4_default([$2], [:]) 165m4_ifvaln([$3], [else 166 $3])dnl 167fi]) 168 169dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) 170dnl --------------------------------------------- 171dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting 172dnl pkg_failed based on the result. 173m4_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 183fi[]dnl 184])dnl _PKG_CONFIG 185 186dnl _PKG_SHORT_ERRORS_SUPPORTED 187dnl --------------------------- 188dnl Internal check to see if pkg-config supports short errors. 189AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], 190[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) 191if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then 192 _pkg_short_errors_supported=yes 193else 194 _pkg_short_errors_supported=no 195fi[]dnl 196])dnl _PKG_SHORT_ERRORS_SUPPORTED 197 198 199dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 200dnl [ACTION-IF-NOT-FOUND]) 201dnl -------------------------------------------------------------- 202dnl Since: 0.4.0 203dnl 204dnl Note that if there is a possibility the first call to 205dnl PKG_CHECK_MODULES might not happen, you should be sure to include an 206dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac 207AC_DEFUN([PKG_CHECK_MODULES], 208[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 209AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl 210AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl 211 212pkg_failed=no 213AC_MSG_CHECKING([for $1]) 214 215_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) 216_PKG_CONFIG([$1][_LIBS], [libs], [$2]) 217 218m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS 219and $1[]_LIBS to avoid the need to call pkg-config. 220See the pkg-config man page for more details.]) 221 222if test $pkg_failed = yes; then 223 AC_MSG_RESULT([no]) 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` 227 else 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 238Consider adjusting the PKG_CONFIG_PATH environment variable if you 239installed software in a non-standard prefix. 240 241_PKG_TEXT])[]dnl 242 ]) 243elif test $pkg_failed = untried; then 244 AC_MSG_RESULT([no]) 245 m4_default([$4], [AC_MSG_FAILURE( 246[The pkg-config script could not be found or is too old. Make sure it 247is in your PATH or set the PKG_CONFIG environment variable to the full 248path to pkg-config. 249 250_PKG_TEXT 251 252To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl 253 ]) 254else 255 $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS 256 $1[]_LIBS=$pkg_cv_[]$1[]_LIBS 257 AC_MSG_RESULT([yes]) 258 $3 259fi[]dnl 260])dnl PKG_CHECK_MODULES 261 262 263dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], 264dnl [ACTION-IF-NOT-FOUND]) 265dnl --------------------------------------------------------------------- 266dnl Since: 0.29 267dnl 268dnl Checks for existence of MODULES and gathers its build flags with 269dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags 270dnl and VARIABLE-PREFIX_LIBS from --libs. 271dnl 272dnl Note that if there is a possibility the first call to 273dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to 274dnl include an explicit call to PKG_PROG_PKG_CONFIG in your 275dnl configure.ac. 276AC_DEFUN([PKG_CHECK_MODULES_STATIC], 277[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 278_save_PKG_CONFIG=$PKG_CONFIG 279PKG_CONFIG="$PKG_CONFIG --static" 280PKG_CHECK_MODULES($@) 281PKG_CONFIG=$_save_PKG_CONFIG[]dnl 282])dnl PKG_CHECK_MODULES_STATIC 283 284 285dnl PKG_INSTALLDIR([DIRECTORY]) 286dnl ------------------------- 287dnl Since: 0.27 288dnl 289dnl Substitutes the variable pkgconfigdir as the location where a module 290dnl should install pkg-config .pc files. By default the directory is 291dnl $libdir/pkgconfig, but the default can be changed by passing 292dnl DIRECTORY. The user can override through the --with-pkgconfigdir 293dnl parameter. 294AC_DEFUN([PKG_INSTALLDIR], 295[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) 296m4_pushdef([pkg_description], 297 [pkg-config installation directory @<:@]pkg_default[@:>@]) 298AC_ARG_WITH([pkgconfigdir], 299 [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, 300 [with_pkgconfigdir=]pkg_default) 301AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) 302m4_popdef([pkg_default]) 303m4_popdef([pkg_description]) 304])dnl PKG_INSTALLDIR 305 306 307dnl PKG_NOARCH_INSTALLDIR([DIRECTORY]) 308dnl -------------------------------- 309dnl Since: 0.27 310dnl 311dnl Substitutes the variable noarch_pkgconfigdir as the location where a 312dnl module should install arch-independent pkg-config .pc files. By 313dnl default the directory is $datadir/pkgconfig, but the default can be 314dnl changed by passing DIRECTORY. The user can override through the 315dnl --with-noarch-pkgconfigdir parameter. 316AC_DEFUN([PKG_NOARCH_INSTALLDIR], 317[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) 318m4_pushdef([pkg_description], 319 [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) 320AC_ARG_WITH([noarch-pkgconfigdir], 321 [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, 322 [with_noarch_pkgconfigdir=]pkg_default) 323AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) 324m4_popdef([pkg_default]) 325m4_popdef([pkg_description]) 326])dnl PKG_NOARCH_INSTALLDIR 327 328 329dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE, 330dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 331dnl ------------------------------------------- 332dnl Since: 0.28 333dnl 334dnl Retrieves the value of the pkg-config variable for the given module. 335AC_DEFUN([PKG_CHECK_VAR], 336[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl 337AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl 338 339_PKG_CONFIG([$1], [variable="][$3]["], [$2]) 340AS_VAR_COPY([$1], [pkg_cv_][$1]) 341 342AS_VAR_IF([$1], [""], [$5], [$4])dnl 343])dnl PKG_CHECK_VAR 344 345m4_include([config/m4/icu-conditional.m4]) 346m4_include([acinclude.m4]) 347