|
1 |
| -# generated automatically by aclocal 1.15 -*- Autoconf -*- |
| 1 | +# generated automatically by aclocal 1.16.2 -*- Autoconf -*- |
2 | 2 |
|
3 |
| -# Copyright (C) 1996-2014 Free Software Foundation, Inc. |
| 3 | +# Copyright (C) 1996-2020 Free Software Foundation, Inc. |
4 | 4 |
|
5 | 5 | # This file is free software; the Free Software Foundation
|
6 | 6 | # gives unlimited permission to copy and/or distribute it,
|
|
12 | 12 | # PARTICULAR PURPOSE.
|
13 | 13 |
|
14 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
|
15 |
| -dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
16 |
| -dnl serial 11 (pkg-config-0.29.1) |
17 |
| -dnl |
| 15 | +# =============================================================================== |
| 16 | +# https://www.gnu.org/software/autoconf-archive/ax_c_float_words_bigendian.html |
| 17 | +# =============================================================================== |
| 18 | +# |
| 19 | +# SYNOPSIS |
| 20 | +# |
| 21 | +# AX_C_FLOAT_WORDS_BIGENDIAN([ACTION-IF-TRUE], [ACTION-IF-FALSE], [ACTION-IF-UNKNOWN]) |
| 22 | +# |
| 23 | +# DESCRIPTION |
| 24 | +# |
| 25 | +# Checks the ordering of words within a multi-word float. This check is |
| 26 | +# necessary because on some systems (e.g. certain ARM systems), the float |
| 27 | +# word ordering can be different from the byte ordering. In a multi-word |
| 28 | +# float context, "big-endian" implies that the word containing the sign |
| 29 | +# bit is found in the memory location with the lowest address. This |
| 30 | +# implementation was inspired by the AC_C_BIGENDIAN macro in autoconf. |
| 31 | +# |
| 32 | +# The endianness is detected by first compiling C code that contains a |
| 33 | +# special double float value, then grepping the resulting object file for |
| 34 | +# certain strings of ASCII values. The double is specially crafted to have |
| 35 | +# a binary representation that corresponds with a simple string. In this |
| 36 | +# implementation, the string "noonsees" was selected because the |
| 37 | +# individual word values ("noon" and "sees") are palindromes, thus making |
| 38 | +# this test byte-order agnostic. If grep finds the string "noonsees" in |
| 39 | +# the object file, the target platform stores float words in big-endian |
| 40 | +# order. If grep finds "seesnoon", float words are in little-endian order. |
| 41 | +# If neither value is found, the user is instructed to specify the |
| 42 | +# ordering. |
| 43 | +# |
| 44 | +# LICENSE |
| 45 | +# |
| 46 | +# Copyright (c) 2008 Daniel Amelang <[email protected]> |
| 47 | +# |
| 48 | +# Copying and distribution of this file, with or without modification, are |
| 49 | +# permitted in any medium without royalty provided the copyright notice |
| 50 | +# and this notice are preserved. This file is offered as-is, without any |
| 51 | +# warranty. |
| 52 | + |
| 53 | +#serial 11 |
| 54 | + |
| 55 | +AC_DEFUN([AX_C_FLOAT_WORDS_BIGENDIAN], |
| 56 | + [AC_CACHE_CHECK(whether float word ordering is bigendian, |
| 57 | + ax_cv_c_float_words_bigendian, [ |
| 58 | +
|
| 59 | +ax_cv_c_float_words_bigendian=unknown |
| 60 | +AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ |
| 61 | +
|
| 62 | +double d = 90904234967036810337470478905505011476211692735615632014797120844053488865816695273723469097858056257517020191247487429516932130503560650002327564517570778480236724525140520121371739201496540132640109977779420565776568942592.0; |
| 63 | +
|
| 64 | +]])], [ |
| 65 | +
|
| 66 | +if grep noonsees conftest.$ac_objext >/dev/null ; then |
| 67 | + ax_cv_c_float_words_bigendian=yes |
| 68 | +fi |
| 69 | +if grep seesnoon conftest.$ac_objext >/dev/null ; then |
| 70 | + if test "$ax_cv_c_float_words_bigendian" = unknown; then |
| 71 | + ax_cv_c_float_words_bigendian=no |
| 72 | + else |
| 73 | + ax_cv_c_float_words_bigendian=unknown |
| 74 | + fi |
| 75 | +fi |
| 76 | +
|
| 77 | +])]) |
| 78 | +
|
| 79 | +case $ax_cv_c_float_words_bigendian in |
| 80 | + yes) |
| 81 | + m4_default([$1], |
| 82 | + [AC_DEFINE([FLOAT_WORDS_BIGENDIAN], 1, |
| 83 | + [Define to 1 if your system stores words within floats |
| 84 | + with the most significant word first])]) ;; |
| 85 | + no) |
| 86 | + $2 ;; |
| 87 | + *) |
| 88 | + m4_default([$3], |
| 89 | + [AC_MSG_ERROR([ |
| 90 | +
|
| 91 | +Unknown float word ordering. You need to manually preset |
| 92 | +ax_cv_c_float_words_bigendian=no (or yes) according to your system. |
| 93 | +
|
| 94 | + ])]) ;; |
| 95 | +esac |
| 96 | +
|
| 97 | +])# AX_C_FLOAT_WORDS_BIGENDIAN |
| 98 | + |
| 99 | +# =========================================================================== |
| 100 | +# https://www.gnu.org/software/autoconf-archive/ax_check_openssl.html |
| 101 | +# =========================================================================== |
| 102 | +# |
| 103 | +# SYNOPSIS |
| 104 | +# |
| 105 | +# AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]]) |
| 106 | +# |
| 107 | +# DESCRIPTION |
| 108 | +# |
| 109 | +# Look for OpenSSL in a number of default spots, or in a user-selected |
| 110 | +# spot (via --with-openssl). Sets |
| 111 | +# |
| 112 | +# OPENSSL_INCLUDES to the include directives required |
| 113 | +# OPENSSL_LIBS to the -l directives required |
| 114 | +# OPENSSL_LDFLAGS to the -L or -R flags required |
| 115 | +# |
| 116 | +# and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately |
| 117 | +# |
| 118 | +# This macro sets OPENSSL_INCLUDES such that source files should use the |
| 119 | +# openssl/ directory in include directives: |
| 120 | +# |
| 121 | +# #include <openssl/hmac.h> |
| 122 | +# |
| 123 | +# LICENSE |
| 124 | +# |
| 125 | +# Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/> |
| 126 | +# Copyright (c) 2009,2010 Dustin J. Mitchell <[email protected]> |
| 127 | +# |
| 128 | +# Copying and distribution of this file, with or without modification, are |
| 129 | +# permitted in any medium without royalty provided the copyright notice |
| 130 | +# and this notice are preserved. This file is offered as-is, without any |
| 131 | +# warranty. |
| 132 | + |
| 133 | +#serial 10 |
| 134 | + |
| 135 | +AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL]) |
| 136 | +AC_DEFUN([AX_CHECK_OPENSSL], [ |
| 137 | + found=false |
| 138 | + AC_ARG_WITH([openssl], |
| 139 | + [AS_HELP_STRING([--with-openssl=DIR], |
| 140 | + [root of the OpenSSL directory])], |
| 141 | + [ |
| 142 | + case "$withval" in |
| 143 | + "" | y | ye | yes | n | no) |
| 144 | + AC_MSG_ERROR([Invalid --with-openssl value]) |
| 145 | + ;; |
| 146 | + *) ssldirs="$withval" |
| 147 | + ;; |
| 148 | + esac |
| 149 | + ], [ |
| 150 | + # if pkg-config is installed and openssl has installed a .pc file, |
| 151 | + # then use that information and don't search ssldirs |
| 152 | + AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) |
| 153 | + if test x"$PKG_CONFIG" != x""; then |
| 154 | + OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null` |
| 155 | + if test $? = 0; then |
| 156 | + OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null` |
| 157 | + OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null` |
| 158 | + found=true |
| 159 | + fi |
| 160 | + fi |
| 161 | +
|
| 162 | + # no such luck; use some default ssldirs |
| 163 | + if ! $found; then |
| 164 | + ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr" |
| 165 | + fi |
| 166 | + ] |
| 167 | + ) |
| 168 | +
|
| 169 | +
|
| 170 | + # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in |
| 171 | + # an 'openssl' subdirectory |
| 172 | +
|
| 173 | + if ! $found; then |
| 174 | + OPENSSL_INCLUDES= |
| 175 | + for ssldir in $ssldirs; do |
| 176 | + AC_MSG_CHECKING([for openssl/ssl.h in $ssldir]) |
| 177 | + if test -f "$ssldir/include/openssl/ssl.h"; then |
| 178 | + OPENSSL_INCLUDES="-I$ssldir/include" |
| 179 | + OPENSSL_LDFLAGS="-L$ssldir/lib" |
| 180 | + OPENSSL_LIBS="-lssl -lcrypto" |
| 181 | + found=true |
| 182 | + AC_MSG_RESULT([yes]) |
| 183 | + break |
| 184 | + else |
| 185 | + AC_MSG_RESULT([no]) |
| 186 | + fi |
| 187 | + done |
| 188 | +
|
| 189 | + # if the file wasn't found, well, go ahead and try the link anyway -- maybe |
| 190 | + # it will just work! |
| 191 | + fi |
| 192 | +
|
| 193 | + # try the preprocessor and linker with our new flags, |
| 194 | + # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS |
| 195 | +
|
| 196 | + AC_MSG_CHECKING([whether compiling and linking against OpenSSL works]) |
| 197 | + echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \ |
| 198 | + "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD |
| 199 | +
|
| 200 | + save_LIBS="$LIBS" |
| 201 | + save_LDFLAGS="$LDFLAGS" |
| 202 | + save_CPPFLAGS="$CPPFLAGS" |
| 203 | + LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS" |
| 204 | + LIBS="$OPENSSL_LIBS $LIBS" |
| 205 | + CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS" |
| 206 | + AC_LINK_IFELSE( |
| 207 | + [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])], |
| 208 | + [ |
| 209 | + AC_MSG_RESULT([yes]) |
| 210 | + $1 |
| 211 | + ], [ |
| 212 | + AC_MSG_RESULT([no]) |
| 213 | + $2 |
| 214 | + ]) |
| 215 | + CPPFLAGS="$save_CPPFLAGS" |
| 216 | + LDFLAGS="$save_LDFLAGS" |
| 217 | + LIBS="$save_LIBS" |
| 218 | +
|
| 219 | + AC_SUBST([OPENSSL_INCLUDES]) |
| 220 | + AC_SUBST([OPENSSL_LIBS]) |
| 221 | + AC_SUBST([OPENSSL_LDFLAGS]) |
| 222 | +]) |
| 223 | + |
| 224 | +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- |
| 225 | +# serial 11 (pkg-config-0.29.1) |
| 226 | + |
18 | 227 | dnl Copyright © 2004 Scott James Remnant <[email protected]>.
|
19 | 228 | dnl Copyright © 2012-2015 Dan Nicholson <[email protected]>
|
20 | 229 | dnl
|
@@ -288,5 +497,71 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
|
288 | 497 | AS_VAR_IF([$1], [""], [$5], [$4])dnl
|
289 | 498 | ])dnl PKG_CHECK_VAR
|
290 | 499 |
|
291 |
| -m4_include([m4/ax_c_float_words_bigendian.m4]) |
292 |
| -m4_include([m4/ax_check_openssl.m4]) |
| 500 | +dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 501 | +dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND], |
| 502 | +dnl [DESCRIPTION], [DEFAULT]) |
| 503 | +dnl ------------------------------------------ |
| 504 | +dnl |
| 505 | +dnl Prepare a "--with-" configure option using the lowercase |
| 506 | +dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and |
| 507 | +dnl PKG_CHECK_MODULES in a single macro. |
| 508 | +AC_DEFUN([PKG_WITH_MODULES], |
| 509 | +[ |
| 510 | +m4_pushdef([with_arg], m4_tolower([$1])) |
| 511 | +
|
| 512 | +m4_pushdef([description], |
| 513 | + [m4_default([$5], [build with ]with_arg[ support])]) |
| 514 | +
|
| 515 | +m4_pushdef([def_arg], [m4_default([$6], [auto])]) |
| 516 | +m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes]) |
| 517 | +m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no]) |
| 518 | +
|
| 519 | +m4_case(def_arg, |
| 520 | + [yes],[m4_pushdef([with_without], [--without-]with_arg)], |
| 521 | + [m4_pushdef([with_without],[--with-]with_arg)]) |
| 522 | +
|
| 523 | +AC_ARG_WITH(with_arg, |
| 524 | + AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),, |
| 525 | + [AS_TR_SH([with_]with_arg)=def_arg]) |
| 526 | +
|
| 527 | +AS_CASE([$AS_TR_SH([with_]with_arg)], |
| 528 | + [yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)], |
| 529 | + [auto],[PKG_CHECK_MODULES([$1],[$2], |
| 530 | + [m4_n([def_action_if_found]) $3], |
| 531 | + [m4_n([def_action_if_not_found]) $4])]) |
| 532 | +
|
| 533 | +m4_popdef([with_arg]) |
| 534 | +m4_popdef([description]) |
| 535 | +m4_popdef([def_arg]) |
| 536 | +
|
| 537 | +])dnl PKG_WITH_MODULES |
| 538 | + |
| 539 | +dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 540 | +dnl [DESCRIPTION], [DEFAULT]) |
| 541 | +dnl ----------------------------------------------- |
| 542 | +dnl |
| 543 | +dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES |
| 544 | +dnl check._[VARIABLE-PREFIX] is exported as make variable. |
| 545 | +AC_DEFUN([PKG_HAVE_WITH_MODULES], |
| 546 | +[ |
| 547 | +PKG_WITH_MODULES([$1],[$2],,,[$3],[$4]) |
| 548 | +
|
| 549 | +AM_CONDITIONAL([HAVE_][$1], |
| 550 | + [test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"]) |
| 551 | +])dnl PKG_HAVE_WITH_MODULES |
| 552 | + |
| 553 | +dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES, |
| 554 | +dnl [DESCRIPTION], [DEFAULT]) |
| 555 | +dnl ------------------------------------------------------ |
| 556 | +dnl |
| 557 | +dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after |
| 558 | +dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make |
| 559 | +dnl and preprocessor variable. |
| 560 | +AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES], |
| 561 | +[ |
| 562 | +PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4]) |
| 563 | +
|
| 564 | +AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"], |
| 565 | + [AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])]) |
| 566 | +])dnl PKG_HAVE_DEFINE_WITH_MODULES |
| 567 | + |
0 commit comments