You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

414 lines
15 KiB

  1. # generated automatically by aclocal 1.16.2 -*- Autoconf -*-
  2. # Copyright (C) 1996-2020 Free Software Foundation, Inc.
  3. # This file is free software; the Free Software Foundation
  4. # gives unlimited permission to copy and/or distribute it,
  5. # with or without modifications, as long as this notice is preserved.
  6. # This program is distributed in the hope that it will be useful,
  7. # but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  8. # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. # PARTICULAR PURPOSE.
  10. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
  11. # ===========================================================================
  12. # https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
  13. # ===========================================================================
  14. #
  15. # SYNOPSIS
  16. #
  17. # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
  18. #
  19. # DESCRIPTION
  20. #
  21. # Check whether the given FLAG works with the current language's compiler
  22. # or gives an error. (Warnings, however, are ignored)
  23. #
  24. # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
  25. # success/failure.
  26. #
  27. # If EXTRA-FLAGS is defined, it is added to the current language's default
  28. # flags (e.g. CFLAGS) when the check is done. The check is thus made with
  29. # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
  30. # force the compiler to issue an error when a bad flag is given.
  31. #
  32. # INPUT gives an alternative input source to AC_COMPILE_IFELSE.
  33. #
  34. # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
  35. # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
  36. #
  37. # LICENSE
  38. #
  39. # Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
  40. # Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
  41. #
  42. # Copying and distribution of this file, with or without modification, are
  43. # permitted in any medium without royalty provided the copyright notice
  44. # and this notice are preserved. This file is offered as-is, without any
  45. # warranty.
  46. #serial 6
  47. AC_DEFUN([AX_CHECK_COMPILE_FLAG],
  48. [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
  49. AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
  50. AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
  51. ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
  52. _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
  53. AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
  54. [AS_VAR_SET(CACHEVAR,[yes])],
  55. [AS_VAR_SET(CACHEVAR,[no])])
  56. _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
  57. AS_VAR_IF(CACHEVAR,yes,
  58. [m4_default([$2], :)],
  59. [m4_default([$3], :)])
  60. AS_VAR_POPDEF([CACHEVAR])dnl
  61. ])dnl AX_CHECK_COMPILE_FLAGS
  62. # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
  63. # serial 11 (pkg-config-0.29.1)
  64. dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
  65. dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
  66. dnl
  67. dnl This program is free software; you can redistribute it and/or modify
  68. dnl it under the terms of the GNU General Public License as published by
  69. dnl the Free Software Foundation; either version 2 of the License, or
  70. dnl (at your option) any later version.
  71. dnl
  72. dnl This program is distributed in the hope that it will be useful, but
  73. dnl WITHOUT ANY WARRANTY; without even the implied warranty of
  74. dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  75. dnl General Public License for more details.
  76. dnl
  77. dnl You should have received a copy of the GNU General Public License
  78. dnl along with this program; if not, write to the Free Software
  79. dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  80. dnl 02111-1307, USA.
  81. dnl
  82. dnl As a special exception to the GNU General Public License, if you
  83. dnl distribute this file as part of a program that contains a
  84. dnl configuration script generated by Autoconf, you may include it under
  85. dnl the same distribution terms that you use for the rest of that
  86. dnl program.
  87. dnl PKG_PREREQ(MIN-VERSION)
  88. dnl -----------------------
  89. dnl Since: 0.29
  90. dnl
  91. dnl Verify that the version of the pkg-config macros are at least
  92. dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
  93. dnl installed version of pkg-config, this checks the developer's version
  94. dnl of pkg.m4 when generating configure.
  95. dnl
  96. dnl To ensure that this macro is defined, also add:
  97. dnl m4_ifndef([PKG_PREREQ],
  98. dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
  99. dnl
  100. dnl See the "Since" comment for each macro you use to see what version
  101. dnl of the macros you require.
  102. m4_defun([PKG_PREREQ],
  103. [m4_define([PKG_MACROS_VERSION], [0.29.1])
  104. m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
  105. [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
  106. ])dnl PKG_PREREQ
  107. dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
  108. dnl ----------------------------------
  109. dnl Since: 0.16
  110. dnl
  111. dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
  112. dnl first found in the path. Checks that the version of pkg-config found
  113. dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
  114. dnl used since that's the first version where most current features of
  115. dnl pkg-config existed.
  116. AC_DEFUN([PKG_PROG_PKG_CONFIG],
  117. [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
  118. m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
  119. m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
  120. AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
  121. AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
  122. AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
  123. if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
  124. AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
  125. fi
  126. if test -n "$PKG_CONFIG"; then
  127. _pkg_min_version=m4_default([$1], [0.9.0])
  128. AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
  129. if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
  130. AC_MSG_RESULT([yes])
  131. else
  132. AC_MSG_RESULT([no])
  133. PKG_CONFIG=""
  134. fi
  135. fi[]dnl
  136. ])dnl PKG_PROG_PKG_CONFIG
  137. dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  138. dnl -------------------------------------------------------------------
  139. dnl Since: 0.18
  140. dnl
  141. dnl Check to see whether a particular set of modules exists. Similar to
  142. dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
  143. dnl
  144. dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  145. dnl only at the first occurence in configure.ac, so if the first place
  146. dnl it's called might be skipped (such as if it is within an "if", you
  147. dnl have to call PKG_CHECK_EXISTS manually
  148. AC_DEFUN([PKG_CHECK_EXISTS],
  149. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  150. if test -n "$PKG_CONFIG" && \
  151. AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
  152. m4_default([$2], [:])
  153. m4_ifvaln([$3], [else
  154. $3])dnl
  155. fi])
  156. dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
  157. dnl ---------------------------------------------
  158. dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
  159. dnl pkg_failed based on the result.
  160. m4_define([_PKG_CONFIG],
  161. [if test -n "$$1"; then
  162. pkg_cv_[]$1="$$1"
  163. elif test -n "$PKG_CONFIG"; then
  164. PKG_CHECK_EXISTS([$3],
  165. [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
  166. test "x$?" != "x0" && pkg_failed=yes ],
  167. [pkg_failed=yes])
  168. else
  169. pkg_failed=untried
  170. fi[]dnl
  171. ])dnl _PKG_CONFIG
  172. dnl _PKG_SHORT_ERRORS_SUPPORTED
  173. dnl ---------------------------
  174. dnl Internal check to see if pkg-config supports short errors.
  175. AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
  176. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
  177. if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
  178. _pkg_short_errors_supported=yes
  179. else
  180. _pkg_short_errors_supported=no
  181. fi[]dnl
  182. ])dnl _PKG_SHORT_ERRORS_SUPPORTED
  183. dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  184. dnl [ACTION-IF-NOT-FOUND])
  185. dnl --------------------------------------------------------------
  186. dnl Since: 0.4.0
  187. dnl
  188. dnl Note that if there is a possibility the first call to
  189. dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
  190. dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
  191. AC_DEFUN([PKG_CHECK_MODULES],
  192. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  193. AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
  194. AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
  195. pkg_failed=no
  196. AC_MSG_CHECKING([for $1])
  197. _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
  198. _PKG_CONFIG([$1][_LIBS], [libs], [$2])
  199. m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
  200. and $1[]_LIBS to avoid the need to call pkg-config.
  201. See the pkg-config man page for more details.])
  202. if test $pkg_failed = yes; then
  203. AC_MSG_RESULT([no])
  204. _PKG_SHORT_ERRORS_SUPPORTED
  205. if test $_pkg_short_errors_supported = yes; then
  206. $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
  207. else
  208. $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
  209. fi
  210. # Put the nasty error message in config.log where it belongs
  211. echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
  212. m4_default([$4], [AC_MSG_ERROR(
  213. [Package requirements ($2) were not met:
  214. $$1_PKG_ERRORS
  215. Consider adjusting the PKG_CONFIG_PATH environment variable if you
  216. installed software in a non-standard prefix.
  217. _PKG_TEXT])[]dnl
  218. ])
  219. elif test $pkg_failed = untried; then
  220. AC_MSG_RESULT([no])
  221. m4_default([$4], [AC_MSG_FAILURE(
  222. [The pkg-config script could not be found or is too old. Make sure it
  223. is in your PATH or set the PKG_CONFIG environment variable to the full
  224. path to pkg-config.
  225. _PKG_TEXT
  226. To get pkg-config, see <http://pkg-config.freedesktop.org/>.])[]dnl
  227. ])
  228. else
  229. $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
  230. $1[]_LIBS=$pkg_cv_[]$1[]_LIBS
  231. AC_MSG_RESULT([yes])
  232. $3
  233. fi[]dnl
  234. ])dnl PKG_CHECK_MODULES
  235. dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
  236. dnl [ACTION-IF-NOT-FOUND])
  237. dnl ---------------------------------------------------------------------
  238. dnl Since: 0.29
  239. dnl
  240. dnl Checks for existence of MODULES and gathers its build flags with
  241. dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
  242. dnl and VARIABLE-PREFIX_LIBS from --libs.
  243. dnl
  244. dnl Note that if there is a possibility the first call to
  245. dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
  246. dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
  247. dnl configure.ac.
  248. AC_DEFUN([PKG_CHECK_MODULES_STATIC],
  249. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  250. _save_PKG_CONFIG=$PKG_CONFIG
  251. PKG_CONFIG="$PKG_CONFIG --static"
  252. PKG_CHECK_MODULES($@)
  253. PKG_CONFIG=$_save_PKG_CONFIG[]dnl
  254. ])dnl PKG_CHECK_MODULES_STATIC
  255. dnl PKG_INSTALLDIR([DIRECTORY])
  256. dnl -------------------------
  257. dnl Since: 0.27
  258. dnl
  259. dnl Substitutes the variable pkgconfigdir as the location where a module
  260. dnl should install pkg-config .pc files. By default the directory is
  261. dnl $libdir/pkgconfig, but the default can be changed by passing
  262. dnl DIRECTORY. The user can override through the --with-pkgconfigdir
  263. dnl parameter.
  264. AC_DEFUN([PKG_INSTALLDIR],
  265. [m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
  266. m4_pushdef([pkg_description],
  267. [pkg-config installation directory @<:@]pkg_default[@:>@])
  268. AC_ARG_WITH([pkgconfigdir],
  269. [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
  270. [with_pkgconfigdir=]pkg_default)
  271. AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
  272. m4_popdef([pkg_default])
  273. m4_popdef([pkg_description])
  274. ])dnl PKG_INSTALLDIR
  275. dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
  276. dnl --------------------------------
  277. dnl Since: 0.27
  278. dnl
  279. dnl Substitutes the variable noarch_pkgconfigdir as the location where a
  280. dnl module should install arch-independent pkg-config .pc files. By
  281. dnl default the directory is $datadir/pkgconfig, but the default can be
  282. dnl changed by passing DIRECTORY. The user can override through the
  283. dnl --with-noarch-pkgconfigdir parameter.
  284. AC_DEFUN([PKG_NOARCH_INSTALLDIR],
  285. [m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
  286. m4_pushdef([pkg_description],
  287. [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
  288. AC_ARG_WITH([noarch-pkgconfigdir],
  289. [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
  290. [with_noarch_pkgconfigdir=]pkg_default)
  291. AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
  292. m4_popdef([pkg_default])
  293. m4_popdef([pkg_description])
  294. ])dnl PKG_NOARCH_INSTALLDIR
  295. dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
  296. dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
  297. dnl -------------------------------------------
  298. dnl Since: 0.28
  299. dnl
  300. dnl Retrieves the value of the pkg-config variable for the given module.
  301. AC_DEFUN([PKG_CHECK_VAR],
  302. [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
  303. AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
  304. _PKG_CONFIG([$1], [variable="][$3]["], [$2])
  305. AS_VAR_COPY([$1], [pkg_cv_][$1])
  306. AS_VAR_IF([$1], [""], [$5], [$4])dnl
  307. ])dnl PKG_CHECK_VAR
  308. dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  309. dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
  310. dnl [DESCRIPTION], [DEFAULT])
  311. dnl ------------------------------------------
  312. dnl
  313. dnl Prepare a "--with-" configure option using the lowercase
  314. dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
  315. dnl PKG_CHECK_MODULES in a single macro.
  316. AC_DEFUN([PKG_WITH_MODULES],
  317. [
  318. m4_pushdef([with_arg], m4_tolower([$1]))
  319. m4_pushdef([description],
  320. [m4_default([$5], [build with ]with_arg[ support])])
  321. m4_pushdef([def_arg], [m4_default([$6], [auto])])
  322. m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
  323. m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
  324. m4_case(def_arg,
  325. [yes],[m4_pushdef([with_without], [--without-]with_arg)],
  326. [m4_pushdef([with_without],[--with-]with_arg)])
  327. AC_ARG_WITH(with_arg,
  328. AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
  329. [AS_TR_SH([with_]with_arg)=def_arg])
  330. AS_CASE([$AS_TR_SH([with_]with_arg)],
  331. [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
  332. [auto],[PKG_CHECK_MODULES([$1],[$2],
  333. [m4_n([def_action_if_found]) $3],
  334. [m4_n([def_action_if_not_found]) $4])])
  335. m4_popdef([with_arg])
  336. m4_popdef([description])
  337. m4_popdef([def_arg])
  338. ])dnl PKG_WITH_MODULES
  339. dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  340. dnl [DESCRIPTION], [DEFAULT])
  341. dnl -----------------------------------------------
  342. dnl
  343. dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
  344. dnl check._[VARIABLE-PREFIX] is exported as make variable.
  345. AC_DEFUN([PKG_HAVE_WITH_MODULES],
  346. [
  347. PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
  348. AM_CONDITIONAL([HAVE_][$1],
  349. [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
  350. ])dnl PKG_HAVE_WITH_MODULES
  351. dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
  352. dnl [DESCRIPTION], [DEFAULT])
  353. dnl ------------------------------------------------------
  354. dnl
  355. dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
  356. dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
  357. dnl and preprocessor variable.
  358. AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
  359. [
  360. PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
  361. AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
  362. [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
  363. ])dnl PKG_HAVE_DEFINE_WITH_MODULES
  364. m4_include([m4/ax_c_float_words_bigendian.m4])
  365. m4_include([m4/ax_check_openssl.m4])