diff -Nru python-nacl-1.4.0/CHANGELOG.rst python-nacl-1.5.0/CHANGELOG.rst --- python-nacl-1.4.0/CHANGELOG.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/CHANGELOG.rst 2022-01-07 21:54:10.000000000 +0000 @@ -1,6 +1,17 @@ Changelog ========= +1.5.0 (2022-01-07) +------------------ + +* **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. +* **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` + wheels. +* Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS + ``universal2`` wheels (the latter supports macOS ``arm64``). +* Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). +* Add inline type hints. + 1.4.0 (2020-05-25) ------------------ diff -Nru python-nacl-1.4.0/debian/changelog python-nacl-1.5.0/debian/changelog --- python-nacl-1.4.0/debian/changelog 2021-10-07 10:23:01.000000000 +0000 +++ python-nacl-1.5.0/debian/changelog 2022-01-17 22:56:00.000000000 +0000 @@ -1,14 +1,26 @@ -python-nacl (1.4.0-1build2) impish; urgency=medium +python-nacl (1.5.0-2) unstable; urgency=medium - * No-change rebuild to build packages with zstd compression. + * Upload to unstable - -- Matthias Klose Thu, 07 Oct 2021 12:23:01 +0200 + -- Scott Kitterman Mon, 17 Jan 2022 17:56:00 -0500 -python-nacl (1.4.0-1build1) hirsute; urgency=medium +python-nacl (1.5.0-1) experimental; urgency=medium - * No-change rebuild to build with python3.9 as supported. + [ Ondřej Nový ] + * d/control: Update Maintainer field with new Debian Python Team + contact address. + * d/control: Update Vcs-* fields with new Debian Python Team Salsa + layout. - -- Matthias Klose Sat, 24 Oct 2020 12:44:25 +0200 + [ Scott Kitterman ] + * New upstream release + - Refresh patches + * Add pybuild-plugin-pyproject to build depends to build using + pyproject.toml + * Update debian/copyright + * Bump standards-version to 4.6.0 without further change + + -- Scott Kitterman Wed, 12 Jan 2022 01:08:24 -0500 python-nacl (1.4.0-1) unstable; urgency=medium diff -Nru python-nacl-1.4.0/debian/control python-nacl-1.5.0/debian/control --- python-nacl-1.4.0/debian/control 2020-05-26 07:44:05.000000000 +0000 +++ python-nacl-1.5.0/debian/control 2022-01-12 06:13:38.000000000 +0000 @@ -1,5 +1,5 @@ Source: python-nacl -Maintainer: Debian Python Modules Team +Maintainer: Debian Python Team Uploaders: Tristan Seligmann , Colin Watson , Scott Kitterman Section: python @@ -7,6 +7,7 @@ Build-Depends: debhelper-compat (= 12), dh-python, + pybuild-plugin-pyproject, libsodium-dev (>= 1.0.16), python3-all-dev, python3-cffi (>= 1.0.0), @@ -16,10 +17,10 @@ python3-six, python3-sphinx, python3-wheel, -Standards-Version: 4.5.0 +Standards-Version: 4.6.0 Homepage: https://github.com/pyca/pynacl/ -Vcs-Git: https://salsa.debian.org/python-team/modules/python-nacl.git -Vcs-Browser: https://salsa.debian.org/python-team/modules/python-nacl +Vcs-Git: https://salsa.debian.org/python-team/packages/python-nacl.git +Vcs-Browser: https://salsa.debian.org/python-team/packages/python-nacl Package: python3-nacl Architecture: any diff -Nru python-nacl-1.4.0/debian/copyright python-nacl-1.5.0/debian/copyright --- python-nacl-1.4.0/debian/copyright 2020-05-26 07:38:50.000000000 +0000 +++ python-nacl-1.5.0/debian/copyright 2022-01-12 06:15:38.000000000 +0000 @@ -4,7 +4,7 @@ License: Apache-2.0 Files: * -Copyright: 2013-2019 Donald Stufft and individual contributors +Copyright: 2013-2021 Donald Stufft and individual contributors License: Apache-2.0 Files: debian/* diff -Nru python-nacl-1.4.0/debian/patches/0001-remove-privacy-breach-images.patch python-nacl-1.5.0/debian/patches/0001-remove-privacy-breach-images.patch --- python-nacl-1.4.0/debian/patches/0001-remove-privacy-breach-images.patch 2020-05-26 07:53:53.000000000 +0000 +++ python-nacl-1.5.0/debian/patches/0001-remove-privacy-breach-images.patch 2022-01-12 06:17:40.000000000 +0000 @@ -6,11 +6,11 @@ README.rst | 14 -------------- 1 file changed, 14 deletions(-) -diff --git a/README.rst b/README.rst -index 368cb75..805ff14 100644 ---- a/README.rst -+++ b/README.rst -@@ -2,20 +2,6 @@ +Index: python-nacl/README.rst +=================================================================== +--- python-nacl.orig/README.rst ++++ python-nacl/README.rst +@@ -2,17 +2,6 @@ PyNaCl: Python binding to the libsodium library =============================================== @@ -18,11 +18,8 @@ - :target: https://pypi.org/project/PyNaCl/ - :alt: Latest Version - --.. image:: https://travis-ci.org/pyca/pynacl.svg?branch=master -- :target: https://travis-ci.org/pyca/pynacl -- --.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=master -- :target: https://codecov.io/github/pyca/pynacl?branch=master +-.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=main +- :target: https://codecov.io/github/pyca/pynacl?branch=main - -.. image:: https://img.shields.io/pypi/pyversions/pynacl.svg - :target: https://pypi.org/project/PyNaCl/ @@ -30,4 +27,4 @@ - PyNaCl is a Python binding to `libsodium`_, which is a fork of the `Networking and Cryptography library`_. These libraries have a stated goal of - improving usability, security and speed. It supports Python 2.7 and 3.5+ as + improving usability, security and speed. It supports Python 3.6+ as well as diff -Nru python-nacl-1.4.0/docs/conf.py python-nacl-1.5.0/docs/conf.py --- python-nacl-1.4.0/docs/conf.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/docs/conf.py 2022-01-07 21:54:10.000000000 +0000 @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # This file is execfile()d with the current directory set to its containing dir # diff -Nru python-nacl-1.4.0/docs/exceptions.rst python-nacl-1.5.0/docs/exceptions.rst --- python-nacl-1.4.0/docs/exceptions.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/docs/exceptions.rst 2022-01-07 21:54:10.000000000 +0000 @@ -1,6 +1,8 @@ Exceptions ========== +.. currentmodule:: nacl.exceptions + All of the exceptions raised from PyNaCl-exposed methods/functions are subclasses of :py:exc:`nacl.exceptions.CryptoError`. This means downstream users can just wrap cryptographic operations inside a @@ -70,3 +72,28 @@ is a subclass of both CryptoError and standard library's ValueError + + +Utility functions for exception handling +---------------------------------------- + +.. function:: ensure(cond, *args, raising=nacl.exceptions.AssertionError) + + Returns if a condition is true, otherwise raise a caller-configurable + :py:class:`Exception` + + :param cond: the condition to be checked + :type cond: bool + :param sequence args: the arguments to be passed to the exception's + constructor + :param raising: the exception to be raised if `cond` is `False` + :type raising: exception + +Example usage: + +.. code-block:: python + + nacl.exceptions.ensure( + a == 1 or a == 2, + "a must be either 1 or 2" + ) diff -Nru python-nacl-1.4.0/docs/signing.rst python-nacl-1.5.0/docs/signing.rst --- python-nacl-1.4.0/docs/signing.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/docs/signing.rst 2022-01-07 21:54:10.000000000 +0000 @@ -229,9 +229,9 @@ Verifies the signature of a signed message. :param bytes smessage: The signed message to verify. This is either - the original message or the concated signature and message. + the original message or the concatenated signature and message. :param bytes signature: The signature of the message to verify against. - If the value of ``smessage`` is the concated signature and message, + If the value of ``smessage`` is the concatenated signature and message, this parameter can be ``None``. :param encoder: A class that is able to decode the secret message and signature. diff -Nru python-nacl-1.4.0/docs/utils.rst python-nacl-1.5.0/docs/utils.rst --- python-nacl-1.4.0/docs/utils.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/docs/utils.rst 2022-01-07 21:54:10.000000000 +0000 @@ -36,15 +36,3 @@ :param encoder: The encoder class used to encode the produced bytes. :return bytes: The random bytestring. -.. function:: ensure(cond, *args, raising=nacl.exceptions.AssertionError) - - Returns if a condition is true, otherwise raise a caller-configurable - :py:class:`Exception` - - :param cond: the condition to be checked - :type cond: bool - :param sequence args: the arguments to be passed to the exception's - constructor - :param raising: the exception to be raised if `cond` is `False` - :type raising: exception - diff -Nru python-nacl-1.4.0/docs/vectors/python/argondriver.py python-nacl-1.5.0/docs/vectors/python/argondriver.py --- python-nacl-1.4.0/docs/vectors/python/argondriver.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/docs/vectors/python/argondriver.py 2022-01-07 21:54:10.000000000 +0000 @@ -1,6 +1,5 @@ #!/usr/bin/python # -from __future__ import division, print_function import argparse import json @@ -10,7 +9,7 @@ import sys -class argonRunner(object): +class argonRunner: GOODCHARS = string.ascii_letters + string.digits def __init__(self, args): @@ -33,45 +32,55 @@ self.count = 0 def _runOnce(self, passwd, salt, dgst_len, maxmem, iters): - """ - """ - argv = [self.exe, salt.encode('ascii'), - '-t', '{0:2d}'.format(iters), - '-m', '{0:2d}'.format(maxmem), - '-l', '{0:3d}'.format(dgst_len), - '-v', self.version, - ] + argv = [ + self.exe, + salt.encode("ascii"), + "-t", + "{:2d}".format(iters), + "-m", + "{:2d}".format(maxmem), + "-l", + "{:3d}".format(dgst_len), + "-v", + self.version, + ] if self.encoded: - argv.append('-e') - mode = 'crypt' + argv.append("-e") + mode = "crypt" else: - argv.append('-r') - mode = 'raw' - if self.construct == 'argon2i': - argv.append('-i') - elif self.construct == 'argon2d': - argv.append('-d') - elif self.construct == 'argon2id': - argv.append('-id') - p = subprocess.Popen(argv, stdin=subprocess.PIPE, - stdout=subprocess.PIPE) - out, err = p.communicate(passwd.encode('ascii')) - return dict(passwd=passwd, salt=salt, dgst_len=dgst_len, - maxmem=2 ** maxmem, iters=iters, mode=mode, - pwhash=out.decode('ascii').rstrip(), - construct=self.construct, - ) + argv.append("-r") + mode = "raw" + if self.construct == "argon2i": + argv.append("-i") + elif self.construct == "argon2d": + argv.append("-d") + elif self.construct == "argon2id": + argv.append("-id") + p = subprocess.Popen( + argv, stdin=subprocess.PIPE, stdout=subprocess.PIPE + ) + out, err = p.communicate(passwd.encode("ascii")) + return dict( + passwd=passwd, + salt=salt, + dgst_len=dgst_len, + maxmem=2 ** maxmem, + iters=iters, + mode=mode, + pwhash=out.decode("ascii").rstrip(), + construct=self.construct, + ) def _genSalt(self): sltln = self.rng.randint(self.mnsaltlen, self.mxsaltlen) chrs = [self.rng.choice(self.GOODCHARS) for x in range(sltln)] - return ''.join(chrs) + return "".join(chrs) def _genPw(self): pwln = self.rng.randint(self.mnpwlen, self.mxpwlen) chrs = [self.rng.choice(self.GOODCHARS) for x in range(pwln)] - return ''.join(chrs) + return "".join(chrs) def __next__(self): if self.count >= self.maxcount: @@ -91,42 +100,62 @@ next = __next__ -if __name__ == '__main__': +if __name__ == "__main__": p = argparse.ArgumentParser() - p.add_argument('-x', '--executable', dest='exe', required=True) - p.add_argument('-c', '--construction', dest='construct', - type=str, default='argon2i') - p.add_argument('-v', '--version', dest='version', - type=str, default='13') - p.add_argument('-e', '--encoded', dest='encoded', default=False, - action='store_true',) - p.add_argument('-s', '--min-salt-len', dest='mnsaltlen', type=int, - default=8) - p.add_argument('-S', '--max-salt-len', dest='mxsaltlen', type=int, - default=8) - p.add_argument('-p', '--min-password-len', dest='mnpwlen', - type=int, default=16) - p.add_argument('-P', '--max-password-len', dest='mxpwlen', - type=int, default=16) - p.add_argument('-l', '--min-digest-len', dest='mndgstlen', - type=int, default=64) - p.add_argument('-L', '--max-digest-len', dest='mxdgstlen', - type=int, default=64) - p.add_argument('-m', '--min-memory-exponent', dest='mnmem', - type=int, default=16) - p.add_argument('-M', '--max-memory-exponent', dest='mxmem', - type=int, default=16) - p.add_argument('-t', '--min-time-opscount', dest='mniters', - type=int, default=3) - p.add_argument('-T', '--max-time-opscount', dest='mxiters', - type=int, default=3) - p.add_argument('-n', '--count', dest='n', type=int, default=10) - p.add_argument('-w', '--output', dest='outfile', - default=sys.stdout, type=argparse.FileType('w')) + p.add_argument("-x", "--executable", dest="exe", required=True) + p.add_argument( + "-c", "--construction", dest="construct", type=str, default="argon2i" + ) + p.add_argument("-v", "--version", dest="version", type=str, default="13") + p.add_argument( + "-e", + "--encoded", + dest="encoded", + default=False, + action="store_true", + ) + p.add_argument( + "-s", "--min-salt-len", dest="mnsaltlen", type=int, default=8 + ) + p.add_argument( + "-S", "--max-salt-len", dest="mxsaltlen", type=int, default=8 + ) + p.add_argument( + "-p", "--min-password-len", dest="mnpwlen", type=int, default=16 + ) + p.add_argument( + "-P", "--max-password-len", dest="mxpwlen", type=int, default=16 + ) + p.add_argument( + "-l", "--min-digest-len", dest="mndgstlen", type=int, default=64 + ) + p.add_argument( + "-L", "--max-digest-len", dest="mxdgstlen", type=int, default=64 + ) + p.add_argument( + "-m", "--min-memory-exponent", dest="mnmem", type=int, default=16 + ) + p.add_argument( + "-M", "--max-memory-exponent", dest="mxmem", type=int, default=16 + ) + p.add_argument( + "-t", "--min-time-opscount", dest="mniters", type=int, default=3 + ) + p.add_argument( + "-T", "--max-time-opscount", dest="mxiters", type=int, default=3 + ) + p.add_argument("-n", "--count", dest="n", type=int, default=10) + p.add_argument( + "-w", + "--output", + dest="outfile", + default=sys.stdout, + type=argparse.FileType("w"), + ) args = p.parse_args() res = [x for x in argonRunner(args)] - json.dump(res, args.outfile, indent=2, separators=(',', ': ')) + json.dump(res, args.outfile, indent=2, separators=(",", ": ")) diff -Nru python-nacl-1.4.0/INSTALL.rst python-nacl-1.5.0/INSTALL.rst --- python-nacl-1.4.0/INSTALL.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/INSTALL.rst 2022-01-07 21:54:10.000000000 +0000 @@ -12,6 +12,16 @@ $ pip install pynacl +Faster wheel build +------------------ + +You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` +and enable `parallelization`_: + +.. code-block:: console + + $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl + Linux source build ------------------ @@ -32,6 +42,8 @@ .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools is generally discouraged, and is completely unsupported in PyNaCl's case. +.. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html + .. _libsodium: https://github.com/jedisct1/libsodium .. [#many] `manylinux1 wheels `_ diff -Nru python-nacl-1.4.0/MANIFEST.in python-nacl-1.5.0/MANIFEST.in --- python-nacl-1.4.0/MANIFEST.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/MANIFEST.in 2022-01-07 21:54:10.000000000 +0000 @@ -27,6 +27,7 @@ recursive-include docs *.rst recursive-include docs Makefile recursive-include docs/vectors/c-source *.c +prune docs/_build recursive-include tests *.py recursive-include tests/data * @@ -36,11 +37,9 @@ # Add PyNaCl header files recursive-include src/bindings *.py *.h -# Remove our travis files -exclude .travis.yml -exclude .travis -exclude .travis/install.sh -exclude .travis/run.sh +# Remove our CI files +recursive-exclude .github * +recursive-exclude .circleci * # Remove readthedocs config exclude .readthedocs.yml diff -Nru python-nacl-1.4.0/PKG-INFO python-nacl-1.5.0/PKG-INFO --- python-nacl-1.4.0/PKG-INFO 2020-05-25 19:39:19.496695000 +0000 +++ python-nacl-1.5.0/PKG-INFO 2022-01-07 21:55:15.580999100 +0000 @@ -1,219 +1,241 @@ Metadata-Version: 2.1 Name: PyNaCl -Version: 1.4.0 +Version: 1.5.0 Summary: Python binding to the Networking and Cryptography (NaCl) library Home-page: https://github.com/pyca/pynacl/ Author: The PyNaCl developers Author-email: cryptography-dev@python.org License: Apache License 2.0 -Description: =============================================== - PyNaCl: Python binding to the libsodium library - =============================================== - - .. image:: https://img.shields.io/pypi/v/pynacl.svg - :target: https://pypi.org/project/PyNaCl/ - :alt: Latest Version - - .. image:: https://travis-ci.org/pyca/pynacl.svg?branch=master - :target: https://travis-ci.org/pyca/pynacl - - .. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=master - :target: https://codecov.io/github/pyca/pynacl?branch=master - - .. image:: https://img.shields.io/pypi/pyversions/pynacl.svg - :target: https://pypi.org/project/PyNaCl/ - :alt: Compatible Python Versions - - PyNaCl is a Python binding to `libsodium`_, which is a fork of the - `Networking and Cryptography library`_. These libraries have a stated goal of - improving usability, security and speed. It supports Python 2.7 and 3.5+ as - well as PyPy 2.6+. - - .. _libsodium: https://github.com/jedisct1/libsodium - .. _Networking and Cryptography library: https://nacl.cr.yp.to/ - - Features - -------- - - * Digital signatures - * Secret-key encryption - * Public-key encryption - * Hashing and message authentication - * Password based key derivation and password hashing - - `Changelog`_ - ------------ - - .. _Changelog: https://pynacl.readthedocs.io/en/stable/changelog/ - - Installation - ============ - - Binary wheel install - -------------------- - - PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , - so all dependencies are included. Make sure you have an up-to-date pip - and run: - - .. code-block:: console - - $ pip install pynacl - - Linux source build - ------------------ - - PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled - with PyNaCl so to install you can run: - - .. code-block:: console - - $ pip install pynacl - - If you'd prefer to use the version of ``libsodium`` provided by your - distribution, you can disable the bundled copy during install by running: - - .. code-block:: console - - $ SODIUM_INSTALL=system pip install pynacl - - .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools - is generally discouraged, and is completely unsupported in PyNaCl's case. - - .. _libsodium: https://github.com/jedisct1/libsodium - - .. [#many] `manylinux1 wheels `_ - are built on a baseline linux environment based on Centos 5.11 - and should work on most x86 and x86_64 glibc based linux environments. - - Changelog - ========= - - 1.4.0 (2020-05-25) - ------------------ - - * Update ``libsodium`` to 1.0.18. - * **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` - wheels. Continuing to produce them was a maintenance burden. - * Added support for Python 3.8, and removed support for Python 3.4. - * Add low level bindings for extracting the seed and the public key - from crypto_sign_ed25519 secret key - * Add low level bindings for deterministic random generation. - * Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) - * Fix checks on very slow builders (#481, #495) - * Add low-level bindings to ed25519 arithmetic functions - * Update low-level blake2b state implementation - * Fix wrong short-input behavior of SealedBox.decrypt() (#517) - * Raise CryptPrefixError exception instead of InvalidkeyError when trying - to check a password against a verifier stored in a unknown format (#519) - * Add support for minimal builds of libsodium. Trying to call functions - not available in a minimal build will raise an UnavailableError - exception. To compile a minimal build of the bundled libsodium, set - the SODIUM_INSTALL_MINIMAL environment variable to any non-empty - string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. - - 1.3.0 2018-09-26 - ---------------- - - * Added support for Python 3.7. - * Update ``libsodium`` to 1.0.16. - * Run and test all code examples in PyNaCl docs through sphinx's - doctest builder. - * Add low-level bindings for chacha20-poly1305 AEAD constructions. - * Add low-level bindings for the chacha20-poly1305 secretstream constructions. - * Add low-level bindings for ed25519ph pre-hashed signing construction. - * Add low-level bindings for constant-time increment and addition - on fixed-precision big integers represented as little-endian - byte sequences. - * Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. - * Add low-level bindings for libsodium's crypto_kx... key exchange - construction. - * Set hypothesis deadline to None in tests/test_pwhash.py to avoid - incorrect test failures on slower processor architectures. GitHub - issue #370 - - 1.2.1 - 2017-12-04 - ------------------ - - * Update hypothesis minimum allowed version. - * Infrastructure: add proper configuration for readthedocs builder - runtime environment. - - 1.2.0 - 2017-11-01 - ------------------ - - * Update ``libsodium`` to 1.0.15. - * Infrastructure: add jenkins support for automatic build of - ``manylinux1`` binary wheels - * Added support for ``SealedBox`` construction. - * Added support for ``argon2i`` and ``argon2id`` password hashing constructs - and restructured high-level password hashing implementation to expose - the same interface for all hashers. - * Added support for 128 bit ``siphashx24`` variant of ``siphash24``. - * Added support for ``from_seed`` APIs for X25519 keypair generation. - * Dropped support for Python 3.3. - - 1.1.2 - 2017-03-31 - ------------------ - - * reorder link time library search path when using bundled - libsodium - - 1.1.1 - 2017-03-15 - ------------------ - - * Fixed a circular import bug in ``nacl.utils``. - - 1.1.0 - 2017-03-14 - ------------------ - - * Dropped support for Python 2.6. - * Added ``shared_key()`` method on ``Box``. - * You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or - ``SecretBox`` and it will automatically generate a random nonce. - * Added support for ``siphash24``. - * Added support for ``blake2b``. - * Added support for ``scrypt``. - * Update ``libsodium`` to 1.0.11. - * Default to the bundled ``libsodium`` when compiling. - * All raised exceptions are defined mixing-in - ``nacl.exceptions.CryptoError`` - - 1.0.1 - 2016-01-24 - ------------------ - - * Fix an issue with absolute paths that prevented the creation of wheels. - - 1.0 - 2016-01-23 - ---------------- - - * PyNaCl has been ported to use the new APIs available in cffi 1.0+. - Due to this change we no longer support PyPy releases older than 2.6. - * Python 3.2 support has been dropped. - * Functions to convert between Ed25519 and Curve25519 keys have been added. - - 0.3.0 - 2015-03-04 - ------------------ - - * The low-level API (`nacl.c.*`) has been changed to match the - upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). - The order of arguments and return values has changed significantly. To - avoid silent failures, `nacl.c` has been removed, and replaced with - `nacl.bindings` (with the new argument ordering). If you have code which - calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review - the new docstrings and update your code/imports to match the new - conventions. - Platform: UNKNOWN Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Requires-Python: >=3.6 Provides-Extra: tests Provides-Extra: docs +License-File: LICENSE + +=============================================== +PyNaCl: Python binding to the libsodium library +=============================================== + +.. image:: https://img.shields.io/pypi/v/pynacl.svg + :target: https://pypi.org/project/PyNaCl/ + :alt: Latest Version + +.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=main + :target: https://codecov.io/github/pyca/pynacl?branch=main + +.. image:: https://img.shields.io/pypi/pyversions/pynacl.svg + :target: https://pypi.org/project/PyNaCl/ + :alt: Compatible Python Versions + +PyNaCl is a Python binding to `libsodium`_, which is a fork of the +`Networking and Cryptography library`_. These libraries have a stated goal of +improving usability, security and speed. It supports Python 3.6+ as well as +PyPy 3. + +.. _libsodium: https://github.com/jedisct1/libsodium +.. _Networking and Cryptography library: https://nacl.cr.yp.to/ + +Features +-------- + +* Digital signatures +* Secret-key encryption +* Public-key encryption +* Hashing and message authentication +* Password based key derivation and password hashing + +`Changelog`_ +------------ + +.. _Changelog: https://pynacl.readthedocs.io/en/stable/changelog/ + +Installation +============ + +Binary wheel install +-------------------- + +PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , +so all dependencies are included. Make sure you have an up-to-date pip +and run: + +.. code-block:: console + + $ pip install pynacl + +Faster wheel build +------------------ + +You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` +and enable `parallelization`_: + +.. code-block:: console + + $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl + +Linux source build +------------------ + +PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled +with PyNaCl so to install you can run: + +.. code-block:: console + + $ pip install pynacl + +If you'd prefer to use the version of ``libsodium`` provided by your +distribution, you can disable the bundled copy during install by running: + +.. code-block:: console + + $ SODIUM_INSTALL=system pip install pynacl + +.. warning:: Usage of the legacy ``easy_install`` command provided by setuptools + is generally discouraged, and is completely unsupported in PyNaCl's case. + +.. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html + +.. _libsodium: https://github.com/jedisct1/libsodium + +.. [#many] `manylinux1 wheels `_ + are built on a baseline linux environment based on Centos 5.11 + and should work on most x86 and x86_64 glibc based linux environments. + +Changelog +========= + +1.5.0 (2022-01-07) +------------------ + +* **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. +* **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` + wheels. +* Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS + ``universal2`` wheels (the latter supports macOS ``arm64``). +* Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). +* Add inline type hints. + +1.4.0 (2020-05-25) +------------------ + +* Update ``libsodium`` to 1.0.18. +* **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` + wheels. Continuing to produce them was a maintenance burden. +* Added support for Python 3.8, and removed support for Python 3.4. +* Add low level bindings for extracting the seed and the public key + from crypto_sign_ed25519 secret key +* Add low level bindings for deterministic random generation. +* Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) +* Fix checks on very slow builders (#481, #495) +* Add low-level bindings to ed25519 arithmetic functions +* Update low-level blake2b state implementation +* Fix wrong short-input behavior of SealedBox.decrypt() (#517) +* Raise CryptPrefixError exception instead of InvalidkeyError when trying + to check a password against a verifier stored in a unknown format (#519) +* Add support for minimal builds of libsodium. Trying to call functions + not available in a minimal build will raise an UnavailableError + exception. To compile a minimal build of the bundled libsodium, set + the SODIUM_INSTALL_MINIMAL environment variable to any non-empty + string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. + +1.3.0 2018-09-26 +---------------- + +* Added support for Python 3.7. +* Update ``libsodium`` to 1.0.16. +* Run and test all code examples in PyNaCl docs through sphinx's + doctest builder. +* Add low-level bindings for chacha20-poly1305 AEAD constructions. +* Add low-level bindings for the chacha20-poly1305 secretstream constructions. +* Add low-level bindings for ed25519ph pre-hashed signing construction. +* Add low-level bindings for constant-time increment and addition + on fixed-precision big integers represented as little-endian + byte sequences. +* Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. +* Add low-level bindings for libsodium's crypto_kx... key exchange + construction. +* Set hypothesis deadline to None in tests/test_pwhash.py to avoid + incorrect test failures on slower processor architectures. GitHub + issue #370 + +1.2.1 - 2017-12-04 +------------------ + +* Update hypothesis minimum allowed version. +* Infrastructure: add proper configuration for readthedocs builder + runtime environment. + +1.2.0 - 2017-11-01 +------------------ + +* Update ``libsodium`` to 1.0.15. +* Infrastructure: add jenkins support for automatic build of + ``manylinux1`` binary wheels +* Added support for ``SealedBox`` construction. +* Added support for ``argon2i`` and ``argon2id`` password hashing constructs + and restructured high-level password hashing implementation to expose + the same interface for all hashers. +* Added support for 128 bit ``siphashx24`` variant of ``siphash24``. +* Added support for ``from_seed`` APIs for X25519 keypair generation. +* Dropped support for Python 3.3. + +1.1.2 - 2017-03-31 +------------------ + +* reorder link time library search path when using bundled + libsodium + +1.1.1 - 2017-03-15 +------------------ + +* Fixed a circular import bug in ``nacl.utils``. + +1.1.0 - 2017-03-14 +------------------ + +* Dropped support for Python 2.6. +* Added ``shared_key()`` method on ``Box``. +* You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or + ``SecretBox`` and it will automatically generate a random nonce. +* Added support for ``siphash24``. +* Added support for ``blake2b``. +* Added support for ``scrypt``. +* Update ``libsodium`` to 1.0.11. +* Default to the bundled ``libsodium`` when compiling. +* All raised exceptions are defined mixing-in + ``nacl.exceptions.CryptoError`` + +1.0.1 - 2016-01-24 +------------------ + +* Fix an issue with absolute paths that prevented the creation of wheels. + +1.0 - 2016-01-23 +---------------- + +* PyNaCl has been ported to use the new APIs available in cffi 1.0+. + Due to this change we no longer support PyPy releases older than 2.6. +* Python 3.2 support has been dropped. +* Functions to convert between Ed25519 and Curve25519 keys have been added. + +0.3.0 - 2015-03-04 +------------------ + +* The low-level API (`nacl.c.*`) has been changed to match the + upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). + The order of arguments and return values has changed significantly. To + avoid silent failures, `nacl.c` has been removed, and replaced with + `nacl.bindings` (with the new argument ordering). If you have code which + calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review + the new docstrings and update your code/imports to match the new + conventions. + + diff -Nru python-nacl-1.4.0/pyproject.toml python-nacl-1.5.0/pyproject.toml --- python-nacl-1.4.0/pyproject.toml 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/pyproject.toml 2022-01-07 21:54:10.000000000 +0000 @@ -6,3 +6,76 @@ "cffi>=1.4.1; python_implementation != 'PyPy'", ] build-backend = "setuptools.build_meta" + +[tool.black] +line-length = 79 +target-version = ["py36"] + +[tool.mypy] +show_error_codes = true +warn_redundant_casts = true +warn_incomplete_stub = true + +disallow_any_unimported = true +disallow_any_expr = true # overridden to `false` inside `nacl.bindings` +disallow_any_decorated = true +disallow_any_explicit = true +disallow_any_generics = true +disallow_subclassing_any = true + +disallow_untyped_calls = true +disallow_untyped_defs = true +disallow_incomplete_defs = true +check_untyped_defs = true +disallow_untyped_decorators = true + +no_implicit_optional = true + +warn_unused_ignores = true +warn_no_return = true +warn_return_any = true # overridden to `false` inside `nacl.bindings` +warn_unreachable = true + +no_implicit_reexport = true +strict_equality = true + +files = [ + "src/nacl", + "tests", +] + +[[tool.mypy.overrides]] +module = [ + "nacl._sodium", +] +ignore_missing_imports = true + +# Within `nacl.bindings`, all of the C functions exposed via cffi in +# nacl._sodium return `Any` as far as mypy is concerned. It's not worth it to +# stub the C functions or cast() their uses. But this means there are more +# `Any`s floating around. So the more restrictive any checks we'd like to use +# should only be turned on outside of `bindings`. + +[[tool.mypy.overrides]] +module = [ + "nacl.bindings.*", +] +disallow_any_expr = false +warn_return_any = false + +# Loosen some of the checks within the tests. Note that `tests.utils` passes with the +# strict checks on, but it's included here in the list of modules with looser checks +# to keep mypy's config simple(r). + +[[tool.mypy.overrides]] +module = [ + "tests.*", +] +# Some library helpers types' involve `Any`, in particular `pytest.mark.parameterize` +# and `hypothesis.strategies.sampledfrom`. +disallow_any_expr = false +disallow_any_decorated = false + +# It's not useful to annotate each test function as `-> None`. +disallow_untyped_defs = false +disallow_incomplete_defs = false diff -Nru python-nacl-1.4.0/README.rst python-nacl-1.5.0/README.rst --- python-nacl-1.4.0/README.rst 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/README.rst 2022-01-07 21:54:10.000000000 +0000 @@ -6,11 +6,8 @@ :target: https://pypi.org/project/PyNaCl/ :alt: Latest Version -.. image:: https://travis-ci.org/pyca/pynacl.svg?branch=master - :target: https://travis-ci.org/pyca/pynacl - -.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=master - :target: https://codecov.io/github/pyca/pynacl?branch=master +.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=main + :target: https://codecov.io/github/pyca/pynacl?branch=main .. image:: https://img.shields.io/pypi/pyversions/pynacl.svg :target: https://pypi.org/project/PyNaCl/ @@ -18,8 +15,8 @@ PyNaCl is a Python binding to `libsodium`_, which is a fork of the `Networking and Cryptography library`_. These libraries have a stated goal of -improving usability, security and speed. It supports Python 2.7 and 3.5+ as -well as PyPy 2.6+. +improving usability, security and speed. It supports Python 3.6+ as well as +PyPy 3. .. _libsodium: https://github.com/jedisct1/libsodium .. _Networking and Cryptography library: https://nacl.cr.yp.to/ diff -Nru python-nacl-1.4.0/setup.py python-nacl-1.5.0/setup.py --- python-nacl-1.4.0/setup.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/setup.py 2022-01-07 21:54:10.000000000 +0000 @@ -13,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import errno import functools @@ -21,26 +20,23 @@ import os import os.path import platform +import shutil import subprocess import sys -from distutils.sysconfig import get_config_vars +from sysconfig import get_config_vars from setuptools import Distribution, setup +from setuptools.command.build_clib import build_clib as _build_clib from setuptools.command.build_ext import build_ext as _build_ext -try: - from setuptools.command.build_clib import build_clib as _build_clib -except ImportError: - from distutils.command.build_clib import build_clib as _build_clib - -requirements = ["six"] -setup_requirements = ["setuptools", - "wheel"] -test_requirements = ["pytest>=3.2.1,!=3.3.0", - "hypothesis>=3.27.0"] -docs_requirements = ["sphinx>=1.6.5", - "sphinx_rtd_theme"] +requirements = [] +setup_requirements = ["setuptools"] +test_requirements = [ + "pytest>=3.2.1,!=3.3.0", + "hypothesis>=3.27.0", +] +docs_requirements = ["sphinx>=1.6.5", "sphinx_rtd_theme"] if platform.python_implementation() == "PyPy": @@ -71,23 +67,6 @@ import nacl # noqa -def which(name, flags=os.X_OK): # Taken from twisted - result = [] - exts = filter(None, os.environ.get('PATHEXT', '').split(os.pathsep)) - path = os.environ.get('PATH', None) - if path is None: - return [] - for p in os.environ.get('PATH', '').split(os.pathsep): - p = os.path.join(p, name) - if os.access(p, flags): - result.append(p) - for e in exts: - pext = p + e - if os.access(pext, flags): - result.append(pext) - return result - - def use_system(): install_type = os.environ.get("SODIUM_INSTALL") @@ -100,13 +79,11 @@ class Distribution(Distribution): - def has_c_libraries(self): return not use_system() class build_clib(_build_clib): - def get_source_files(self): files = glob.glob(here("src/libsodium/*")) files += glob.glob(here("src/libsodium/*/*")) @@ -131,10 +108,12 @@ return # use Python's build environment variables - build_env = {key: val for key, val in - get_config_vars().items() if key in - ("LDFLAGS", "CFLAGS", "CC", "CCSHARED", "LDSHARED") and - key not in os.environ} + build_env = { + key: val + for key, val in get_config_vars().items() + if key in ("LDFLAGS", "CFLAGS", "CC", "CCSHARED", "LDSHARED") + and key not in os.environ + } os.environ.update(build_env) # Ensure our temporary build directory exists @@ -147,39 +126,45 @@ # Ensure all of our executable files have their permission set for filename in [ - "src/libsodium/autogen.sh", - "src/libsodium/compile", - "src/libsodium/configure", - "src/libsodium/depcomp", - "src/libsodium/install-sh", - "src/libsodium/missing", - "src/libsodium/msvc-scripts/process.bat", - "src/libsodium/test/default/wintest.bat"]: + "src/libsodium/autogen.sh", + "src/libsodium/compile", + "src/libsodium/configure", + "src/libsodium/depcomp", + "src/libsodium/install-sh", + "src/libsodium/missing", + "src/libsodium/msvc-scripts/process.bat", + "src/libsodium/test/default/wintest.bat", + ]: os.chmod(here(filename), 0o755) - if not which("make"): + if not shutil.which("make"): raise Exception("ERROR: The 'make' utility is missing from PATH") # Locate our configure script configure = abshere("src/libsodium/configure") # Run ./configure - configure_flags = ["--disable-shared", "--enable-static", - "--disable-debug", "--disable-dependency-tracking", - "--with-pic"] + configure_flags = [ + "--disable-shared", + "--enable-static", + "--disable-debug", + "--disable-dependency-tracking", + "--with-pic", + ] if platform.system() == "SunOS": # On Solaris, libssp doesn't link statically and causes linker # errors during import configure_flags.append("--disable-ssp") - if os.environ.get('SODIUM_INSTALL_MINIMAL'): + if os.environ.get("SODIUM_INSTALL_MINIMAL"): configure_flags.append("--enable-minimal") subprocess.check_call( - [configure] + configure_flags + - ["--prefix", os.path.abspath(self.build_clib)], + [configure] + + configure_flags + + ["--prefix", os.path.abspath(self.build_clib)], cwd=build_temp, ) - make_args = os.environ.get('LIBSODIUM_MAKE_ARGS', '').split() + make_args = os.environ.get("LIBSODIUM_MAKE_ARGS", "").split() # Build the library subprocess.check_call(["make"] + make_args, cwd=build_temp) @@ -191,7 +176,6 @@ class build_ext(_build_ext): - def run(self): if self.distribution.has_c_libraries(): build_clib = self.get_finalized_command("build_clib") @@ -199,10 +183,12 @@ os.path.join(build_clib.build_clib, "include"), ) self.library_dirs.insert( - 0, os.path.join(build_clib.build_clib, "lib64"), + 0, + os.path.join(build_clib.build_clib, "lib64"), ) self.library_dirs.insert( - 0, os.path.join(build_clib.build_clib, "lib"), + 0, + os.path.join(build_clib.build_clib, "lib"), ) return _build_ext.run(self) @@ -216,51 +202,33 @@ setup( name=nacl.__title__, version=nacl.__version__, - description=nacl.__summary__, - long_description='\n'.join((README, INSTALL, CHANGELOG)), + long_description="\n".join((README, INSTALL, CHANGELOG)), url=nacl.__uri__, license=nacl.__license__, - author=nacl.__author__, author_email=nacl.__email__, - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + python_requires=">=3.6", setup_requires=setup_requirements, install_requires=requirements, - extras_require={ - "tests": test_requirements, - "docs": docs_requirements, - }, + extras_require={"tests": test_requirements, "docs": docs_requirements}, tests_require=test_requirements, - package_dir={"": "src"}, - packages=[ - "nacl", - "nacl.pwhash", - "nacl.bindings", - ], - + packages=["nacl", "nacl.pwhash", "nacl.bindings"], + package_data={"nacl": ["py.typed"]}, ext_package="nacl", - cffi_modules=[ - "src/bindings/build.py:ffi", - ], - - cmdclass={ - "build_clib": build_clib, - "build_ext": build_ext, - }, + cffi_modules=["src/bindings/build.py:ffi"], + cmdclass={"build_clib": build_clib, "build_ext": build_ext}, distclass=Distribution, zip_safe=False, - classifiers=[ "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", - ] + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + ], ) diff -Nru python-nacl-1.4.0/src/bindings/build.py python-nacl-1.5.0/src/bindings/build.py --- python-nacl-1.4.0/src/bindings/build.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/bindings/build.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,7 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import glob import os.path @@ -36,7 +35,7 @@ ffi = FFI() for header in HEADERS: - with open(header, "r") as hfile: + with open(header) as hfile: ffi.cdef(hfile.read()) source = [] @@ -51,7 +50,7 @@ source.append("#include ") for header in MINIMAL_HEADERS: - with open(header, "r") as hfile: + with open(header) as hfile: source.append(hfile.read()) if sys.platform == "win32": diff -Nru python-nacl-1.4.0/src/libsodium/aclocal.m4 python-nacl-1.5.0/src/libsodium/aclocal.m4 --- python-nacl-1.4.0/src/libsodium/aclocal.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/aclocal.m4 2022-01-07 21:54:10.000000000 +0000 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.16.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.3 -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -14,13 +14,13 @@ m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, -[m4_warning([this file was generated for autoconf 2.69. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],, +[m4_warning([this file was generated for autoconf 2.71. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2018 Free Software Foundation, Inc. +# Copyright (C) 2002-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -35,7 +35,7 @@ [am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.16.1], [], +m4_if([$1], [1.16.3], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.16.1])dnl +[AM_AUTOMAKE_VERSION([1.16.3])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Figure out how to run the assembler. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -78,7 +78,7 @@ # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -130,7 +130,7 @@ # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -161,7 +161,7 @@ Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -352,7 +352,7 @@ # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -391,7 +391,9 @@ done if test $am_rc -ne 0; then AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE="gmake" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking).]) fi @@ -418,7 +420,7 @@ # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -615,7 +617,7 @@ done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -636,7 +638,7 @@ fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2018 Free Software Foundation, Inc. +# Copyright (C) 2003-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -658,7 +660,7 @@ # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -693,7 +695,7 @@ # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -736,7 +738,7 @@ # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2018 Free Software Foundation, Inc. +# Copyright (C) 1997-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -757,12 +759,7 @@ [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then @@ -775,7 +772,7 @@ # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -804,7 +801,7 @@ AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -851,7 +848,7 @@ # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -870,7 +867,7 @@ # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -951,7 +948,7 @@ rm -f conftest.file ]) -# Copyright (C) 2009-2018 Free Software Foundation, Inc. +# Copyright (C) 2009-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1011,7 +1008,7 @@ _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2018 Free Software Foundation, Inc. +# Copyright (C) 2001-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1039,7 +1036,7 @@ INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2018 Free Software Foundation, Inc. +# Copyright (C) 2006-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1058,7 +1055,7 @@ # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2018 Free Software Foundation, Inc. +# Copyright (C) 2004-2020 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1189,6 +1186,7 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR +m4_include([m4/ax_add_fortify_source.m4]) m4_include([m4/ax_check_catchable_abrt.m4]) m4_include([m4/ax_check_catchable_segv.m4]) m4_include([m4/ax_check_compile_flag.m4]) diff -Nru python-nacl-1.4.0/src/libsodium/appveyor.yml python-nacl-1.5.0/src/libsodium/appveyor.yml --- python-nacl-1.4.0/src/libsodium/appveyor.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/appveyor.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,24 @@ +version: 1.0.18.{build} + +os: Visual Studio 2017 + +environment: + matrix: + - platform: Win32 + configuration: Debug + - platform: Win32 + configuration: Release + - platform: x64 + configuration: Debug + - platform: x64 + configuration: Release + +matrix: + fast_finish: false + +init: msbuild /version + +build: + parallel: true + project: libsodium.vcxproj + verbosity: minimal diff -Nru python-nacl-1.4.0/src/libsodium/autogen.sh python-nacl-1.5.0/src/libsodium/autogen.sh --- python-nacl-1.4.0/src/libsodium/autogen.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/autogen.sh 2022-01-07 21:54:10.000000000 +0000 @@ -1,5 +1,55 @@ #! /bin/sh +args=$(getopt bfos "$@") +if [ $? -ne 0 ]; then + echo "Usage: autogen.sh [-b] [-f] [-o] [-s] [--]" + echo + echo "> -b: do not update the system detection scripts" + echo "> -f: force the recreation of all autoconf scripts" + echo "> -o: overwrite/downgrade system detection scripts" + echo "> -s: setup an environment for developers" + exit 2 +fi + +force=false +update_config=true +overwrite_config=false +dev_setup=false + +eval set -- "$args" + +while [ $# -ne 0 ]; do + case $1 in + -b) + update_config=false + ;; + -f) + force=true + ;; + -o) + overwrite_config=true + ;; + -s) + dev_setup=true + ;; + --) + shift + break + ;; + esac + shift +done + +if [ -s configure ]; then + if [ "$force" != true ]; then + echo "autoconf scripts already exist." >&2 + exit 0 + fi +elif [ "$dev_setup" != true ]; then + echo "A development environment was not created." + exit 0 +fi + if glibtoolize --version >/dev/null 2>&1; then LIBTOOLIZE='glibtoolize' else @@ -26,25 +76,39 @@ exit 1 } -if autoreconf --version >/dev/null 2>&1; then - autoreconf -ivf -else - $LIBTOOLIZE && - aclocal && - automake --add-missing --force-missing --include-deps && - autoconf +if [ "$overwrite_config" = false ]; then + if [ -f build-aux/config.guess ]; then + mv build-aux/config.guess build-aux/config.guess.stable + fi + if [ -f build-aux/config.sub ]; then + mv build-aux/config.sub build-aux/config.sub.stable + fi +fi +$LIBTOOLIZE --copy --install && + aclocal && + automake --add-missing --copy --force-missing --include-deps && + autoconf && echo Done. +if [ "$overwrite_config" = false ]; then + if [ -f build-aux/config.guess.stable ]; then + mv build-aux/config.guess.stable build-aux/config.guess + fi + if [ -f build-aux/config.sub.stable ]; then + mv build-aux/config.sub.stable build-aux/config.sub + fi fi -[ -z "$DO_NOT_UPDATE_CONFIG_SCRIPTS" ] && +[ "$update_config" = true ] && [ -z "$DO_NOT_UPDATE_CONFIG_SCRIPTS" ] && command -v curl >/dev/null 2>&1 && { echo "Downloading config.guess and config.sub..." - curl -sL -o config.guess \ + curl -sSL --fail -o config.guess \ 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD' && - mv -f config.guess build-aux/config.guess + chmod +x config.guess && + chmod +x build-aux/config.guess - curl -sL -o config.sub \ + curl -sSL --fail -o config.sub \ 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD' && + chmod +x build-aux/config.sub && mv -f config.sub build-aux/config.sub echo "Done." diff -Nru python-nacl-1.4.0/src/libsodium/azure-pipelines.yml python-nacl-1.5.0/src/libsodium/azure-pipelines.yml --- python-nacl-1.4.0/src/libsodium/azure-pipelines.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/azure-pipelines.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,141 @@ +trigger: + - stable + - next + +pr: none + +jobs: + - job: "wasi" + pool: + vmImage: "ubuntu-20.04" + steps: + - script: | + sudo apt-get install build-essential curl cmake lld + displayName: Install system packages + - script: | + curl https://get.wasmer.io -sSfL | sh + displayName: Install wasmer + - script: | + curl -sL -o - https://ziglang.org/download/0.8.0/zig-linux-x86_64-0.8.0.tar.xz | tar xJ -f - -C /opt/ + sudo mv /opt/zig-* /opt/zig + env PATH=/opt/zig/bin:/opt/zig:$PATH + displayName: Install the Zig SDK + - script: | + env WASMER_DIR=${HOME}/.wasmer PATH=${HOME}/.wasmer/bin:/opt/wasi-sdk/bin:${HOME}/.cargo/bin:$PATH dist-build/wasm32-wasi.sh + displayName: Compile libsodium + - task: PublishBuildArtifacts@1 + condition: not(canceled()) + inputs: + pathToPublish: libsodium-wasm32-wasi + artifactName: libsodium-wasm32-wasi + + - job: "windows" + pool: + vmImage: "windows-2019" + steps: + - powershell: | + cd builds\msvc\build + & .\buildbase.bat ..\vs2019\libsodium.sln 16 + displayName: Compile it all + - powershell: | + mkdir bin\include\sodium + Copy-Item "src\libsodium\include\sodium\*.h" -Destination "bin\include\sodium" -Recurse + Copy-Item "src\libsodium\include\*.h" -Destination "bin\include\" + displayName: Copy header files + - task: PublishBuildArtifacts@1 + condition: not(canceled()) + inputs: + pathToPublish: bin + artifactName: libsodium + + - job: "windows_old" + pool: + vmImage: "vs2017-win2016" + steps: + - powershell: | + cd builds\msvc\build + & .\buildbase.bat ..\vs2017\libsodium.sln 15 + displayName: Compile it all + - task: PublishBuildArtifacts@1 + condition: not(canceled()) + inputs: + pathToPublish: bin + artifactName: libsodium + + - job: mingw64 + pool: + vmImage: "windows-2019" + steps: + - powershell: | + (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe", "sfx.exe") + .\sfx.exe -y -o\ + del sfx.exe + displayName: Install MSYS2 + - script: | + set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem + %CD:~0,2%\msys64\usr\bin\bash -lc + %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" + %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' + %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' + displayName: Update MSYS2 + - script: | + set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem + %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-x86_64-toolchain + %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc + %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf + displayName: Install Toolchain + - script: | + set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin + set MSYS2_ROOT=%CD:~0,2%\msys64 + set MSYSTEM=MINGW64 + set CHERE_INVOKING=yes + %MSYS2_ROOT%\cmd\msystem MINGW64 + %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win64.sh + env: + CHERE_INVOKING: yes + MSYS2_ARCH: x86_64 + displayName: Compile libsodium + - task: PublishBuildArtifacts@1 + condition: not(canceled()) + inputs: + pathToPublish: libsodium-win64 + artifactName: libsodium-win64 + + - job: mingw32 + pool: + vmImage: "windows-2019" + steps: + - powershell: | + (New-Object Net.WebClient).DownloadFile("https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe", "sfx.exe") + .\sfx.exe -y -o\ + del sfx.exe + displayName: Install MSYS2 + - script: | + set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem + %CD:~0,2%\msys64\usr\bin\bash -lc + %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm -Sydd filesystem" + %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' + %CD:~0,2%\msys64\usr\bin\bash -lc 'pacman --noconfirm -Syuu' + displayName: Update MSYS2 + - script: | + set PATH=%CD:~0,2%\msys64\usr\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem + %CD:~0,2%\msys64\usr\bin\pacman --noconfirm --needed -S base-devel mingw-w64-i686-toolchain + %CD:~0,2%\msys64\usr\bin\pacman --noconfirm -Scc + %CD:~0,2%\msys64\usr\bin\sed -i "s|#CacheDir.*|CacheDir=/c/Users/%USERNAME%/AppData/Local/Temp|g" /etc/pacman.conf + displayName: Install Toolchain + - script: | + set PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;%CD:~0,2%\msys64\usr\bin;%CD:~0,2%\msys64\bin + set MSYS2_ROOT=%CD:~0,2%\msys64 + set MSYSTEM=MINGW32 + set CHERE_INVOKING=yes + %MSYS2_ROOT%\cmd\msystem MINGW32 + %CD:~0,2%\msys64\usr\bin\bash -lc dist-build/msys2-win32.sh + env: + CHERE_INVOKING: yes + MSYS2_ARCH: x86_64 + displayName: Compile libsodium + - task: PublishBuildArtifacts@1 + condition: not(canceled()) + inputs: + pathToPublish: libsodium-win32 + artifactName: libsodium-win32 diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/compile python-nacl-1.5.0/src/libsodium/build-aux/compile --- python-nacl-1.4.0/src/libsodium/build-aux/compile 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/compile 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -53,7 +53,7 @@ MINGW*) file_conv=mingw ;; - CYGWIN*) + CYGWIN* | MSYS*) file_conv=cygwin ;; *) @@ -67,7 +67,7 @@ mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; - cygwin/*) + cygwin/* | msys/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/config.guess python-nacl-1.5.0/src/libsodium/build-aux/config.guess --- python-nacl-1.4.0/src/libsodium/build-aux/config.guess 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/config.guess 2022-01-07 21:54:10.000000000 +0000 @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2019-05-28' +timestamp='2021-01-01' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,12 +27,12 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . -me=`echo "$0" | sed -e 's,.*/,,'` +me=$(echo "$0" | sed -e 's,.*/,,') usage="\ Usage: $0 [OPTION] @@ -50,7 +50,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -99,9 +99,11 @@ trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039 - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } @@ -129,16 +131,14 @@ PATH=$PATH:/.attbin ; export PATH fi -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown -UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown +UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown +UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown +UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown +UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" @@ -147,17 +147,29 @@ LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')" - # If ldd exists, use it to detect musl libc. - if command -v ldd >/dev/null && \ - ldd --version 2>&1 | grep -q ^musl - then - LIBC=musl + # Second heuristic to detect musl libc. + if [ "$LIBC" = unknown ] && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if [ "$LIBC" = unknown ]; then + LIBC=gnu fi ;; esac @@ -177,19 +189,20 @@ # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" - UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ + UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \ "/sbin/$sysctl" 2>/dev/null || \ "/usr/sbin/$sysctl" 2>/dev/null || \ - echo unknown)` + echo unknown)) case "$UNAME_MACHINE_ARCH" in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,') + endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p') machine="${arch}${endian}"-unknown ;; *) machine="$UNAME_MACHINE_ARCH"-unknown ;; @@ -220,7 +233,7 @@ case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` + abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr") ;; esac # The OS release @@ -233,7 +246,7 @@ release='-gnu' ;; *) - release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2) ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: @@ -242,15 +255,15 @@ echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//') echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//') echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" exit ;; *:LibertyBSD:*:*) - UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//') echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" exit ;; *:MidnightBSD:*:*) @@ -262,6 +275,9 @@ *:SolidBSD:*:*) echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; + *:OS108:*:*) + echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE" + exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; @@ -271,26 +287,29 @@ *:Sortix:*:*) echo "$UNAME_MACHINE"-unknown-sortix exit ;; + *:Twizzler:*:*) + echo "$UNAME_MACHINE"-unknown-twizzler + exit ;; *:Redox:*:*) echo "$UNAME_MACHINE"-unknown-redox exit ;; mips:OSF1:*.*) - echo mips-dec-osf1 - exit ;; + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}') ;; *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}') ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. - ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1) case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE=alpha ;; @@ -328,7 +347,7 @@ # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" + echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 @@ -362,7 +381,7 @@ exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then + if test "$( (/bin/universe) 2>/dev/null)" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd @@ -375,17 +394,17 @@ echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) - case `/usr/bin/uname -p` in + case $(/usr/bin/uname -p) in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" + echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux"$UNAME_RELEASE" @@ -396,7 +415,7 @@ # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -404,30 +423,30 @@ SUN_ARCH=x86_64 fi fi - echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case "$(/usr/bin/arch -k)" in Series*|S4*) - UNAME_RELEASE=`uname -v` + UNAME_RELEASE=$(uname -v) ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" + echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')" exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) - UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null) test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + case "$(/bin/arch)" in sun3) echo m68k-sun-sunos"$UNAME_RELEASE" ;; @@ -507,8 +526,8 @@ } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && - dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`"$dummy" "$dummyarg"` && + dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') && + SYSTEM_NAME=$("$dummy" "$dummyarg") && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos"$UNAME_RELEASE" exit ;; @@ -535,11 +554,11 @@ exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] + UNAME_PROCESSOR=$(/usr/bin/uname -p) + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ - [ "$TARGET_BINARY_INTERFACE"x = x ] + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then echo m88k-dg-dgux"$UNAME_RELEASE" else @@ -563,17 +582,17 @@ echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" + echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + exit ;; # Note that: echo "'$(uname -s)'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) - if [ -x /usr/bin/oslevel ] ; then - IBM_REV=`/usr/bin/oslevel` + if test -x /usr/bin/oslevel ; then + IBM_REV=$(/usr/bin/oslevel) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -593,7 +612,7 @@ exit(0); } EOF - if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") then echo "$SYSTEM_NAME" else @@ -606,15 +625,15 @@ fi exit ;; *:AIX:*:[4567]) - IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }') if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if [ -x /usr/bin/lslpp ] ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | - awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` + if test -x /usr/bin/lslpp ; then + IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc | + awk -F: '{ print $3 }' | sed s/[0-9]*$/0/) else IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi @@ -642,14 +661,14 @@ echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') case "$UNAME_MACHINE" in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) - if [ -x /usr/bin/getconf ]; then - sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + if test -x /usr/bin/getconf; then + sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null) + sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null) case "$sc_cpu_version" in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 @@ -661,7 +680,7 @@ esac ;; esac fi - if [ "$HP_ARCH" = "" ]; then + if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" @@ -696,11 +715,11 @@ exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy") test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ "$HP_ARCH" = hppa2.0w ] + if test "$HP_ARCH" = hppa2.0w then set_cc_for_build @@ -724,7 +743,7 @@ echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//') echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) @@ -754,7 +773,7 @@ exit (0); } EOF - $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; @@ -774,7 +793,7 @@ echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) - if [ -x /usr/sbin/sysversion ] ; then + if test -x /usr/sbin/sysversion ; then echo "$UNAME_MACHINE"-unknown-osf1mk else echo "$UNAME_MACHINE"-unknown-osf1 @@ -823,14 +842,14 @@ echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz) + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/') echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///') + FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/') echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) @@ -843,25 +862,25 @@ echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" exit ;; arm:FreeBSD:*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi else - echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf fi exit ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=$(/usr/bin/uname -p) case "$UNAME_PROCESSOR" in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac - echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; i*:CYGWIN*:*) echo "$UNAME_MACHINE"-pc-cygwin @@ -897,15 +916,15 @@ echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" + echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')" exit ;; *:GNU:*:*) # the GNU system - echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" + echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" + echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC" exit ;; *:Minix:*:*) echo "$UNAME_MACHINE"-unknown-minix @@ -918,7 +937,7 @@ echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -977,6 +996,9 @@ k1om:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; m32r*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; @@ -1027,7 +1049,7 @@ #endif #endif EOF - eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`" + eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) @@ -1047,7 +1069,7 @@ exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level - case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; *) echo hppa-unknown-linux-"$LIBC" ;; @@ -1065,7 +1087,7 @@ ppcle:Linux:*:*) echo powerpcle-unknown-linux-"$LIBC" exit ;; - riscv32:Linux:*:* | riscv64:Linux:*:*) + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) @@ -1087,7 +1109,17 @@ echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo "$UNAME_MACHINE"-pc-linux-"$LIBC" + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI="$LIBC"x32 + fi + fi + echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI" exit ;; xtensa*:Linux:*:*) echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" @@ -1127,7 +1159,7 @@ echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; i*86:*:4.*:*) - UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` + UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//') if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else @@ -1136,7 +1168,7 @@ exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. - case `/bin/uname -X | grep "^Machine"` in + case $(/bin/uname -X | grep "^Machine") in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; @@ -1145,10 +1177,10 @@ exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then - UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then - UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //')) (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 @@ -1198,7 +1230,7 @@ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1209,7 +1241,7 @@ NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ - && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ @@ -1242,7 +1274,7 @@ exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv @@ -1276,7 +1308,7 @@ echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if [ -d /usr/nec ]; then + if test -d /usr/nec; then echo mips-nec-sysv"$UNAME_RELEASE" else echo mips-unknown-sysv"$UNAME_RELEASE" @@ -1324,8 +1356,11 @@ *:Rhapsody:*:*) echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; + arm64:Darwin:*:*) + echo aarch64-apple-darwin"$UNAME_RELEASE" + exit ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac @@ -1338,7 +1373,7 @@ else set_cc_for_build fi - if [ "$CC_FOR_BUILD" != no_compiler_found ]; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null @@ -1362,7 +1397,7 @@ echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) - UNAME_PROCESSOR=`uname -p` + UNAME_PROCESSOR=$(uname -p) if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc @@ -1430,10 +1465,10 @@ echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" + echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')" exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=$( (uname -p) 2>/dev/null) case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1443,7 +1478,7 @@ echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" + echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')" exit ;; i*86:rdos:*:*) echo "$UNAME_MACHINE"-pc-rdos @@ -1501,7 +1536,7 @@ #define __ARCHITECTURE__ "m68k" #endif int version; - version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null); if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else @@ -1593,7 +1628,7 @@ } EOF -$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`$dummy` && +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. @@ -1618,9 +1653,15 @@ operating system you are using. If your script is old, overwrite *all* copies of config.guess and config.sub with the latest versions from: - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + https://git.savannah.gnu.org/cgit/config.git/plain/config.guess and - https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +EOF + +year=$(echo $timestamp | sed 's,-.*,,') +# shellcheck disable=SC2003 +if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then + cat >&2 </dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null` - -hostinfo = `(hostinfo) 2>/dev/null` -/bin/universe = `(/bin/universe) 2>/dev/null` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` -/bin/arch = `(/bin/arch) 2>/dev/null` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` +uname -m = $( (uname -m) 2>/dev/null || echo unknown) +uname -r = $( (uname -r) 2>/dev/null || echo unknown) +uname -s = $( (uname -s) 2>/dev/null || echo unknown) +uname -v = $( (uname -v) 2>/dev/null || echo unknown) + +/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null) +/bin/uname -X = $( (/bin/uname -X) 2>/dev/null) + +hostinfo = $( (hostinfo) 2>/dev/null) +/bin/universe = $( (/bin/universe) 2>/dev/null) +/usr/bin/arch -k = $( (/usr/bin/arch -k) 2>/dev/null) +/bin/arch = $( (/bin/arch) 2>/dev/null) +/usr/bin/oslevel = $( (/usr/bin/oslevel) 2>/dev/null) +/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null) UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/config.sub python-nacl-1.5.0/src/libsodium/build-aux/config.sub --- python-nacl-1.4.0/src/libsodium/build-aux/config.sub 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/config.sub 2022-01-07 21:54:10.000000000 +0000 @@ -1,8 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2019 Free Software Foundation, Inc. +# Copyright 1992-2021 Free Software Foundation, Inc. -timestamp='2019-05-23' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2021-07-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -33,7 +35,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -67,7 +76,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2019 Free Software Foundation, Inc. +Copyright 1992-2021 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -124,28 +133,27 @@ ;; *-*-*-*) basic_machine=$field1-$field2 - os=$field3-$field4 + basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ - | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) basic_machine=$field1 - os=$maybe_os + basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown - os=linux-android + basic_os=linux-android ;; *) basic_machine=$field1-$field2 - os=$field3 + basic_os=$field3 ;; esac ;; @@ -154,7 +162,7 @@ case $field1-$field2 in decstation-3100) basic_machine=mips-dec - os= + basic_os= ;; *-*) # Second component is usually, but not always the OS @@ -162,7 +170,7 @@ # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ @@ -175,11 +183,11 @@ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 - os= + basic_os= ;; *) basic_machine=$field1 - os=$field2 + basic_os=$field2 ;; esac ;; @@ -191,450 +199,451 @@ case $field1 in 386bsd) basic_machine=i386-pc - os=bsd + basic_os=bsd ;; a29khif) basic_machine=a29k-amd - os=udi + basic_os=udi ;; adobe68k) basic_machine=m68010-adobe - os=scout + basic_os=scout ;; alliant) basic_machine=fx80-alliant - os= + basic_os= ;; altos | altos3068) basic_machine=m68k-altos - os= + basic_os= ;; am29k) basic_machine=a29k-none - os=bsd + basic_os=bsd ;; amdahl) basic_machine=580-amdahl - os=sysv + basic_os=sysv ;; amiga) basic_machine=m68k-unknown - os= + basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown - os=amigaos + basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown - os=sysv4 + basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo - os=sysv + basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo - os=bsd + basic_os=bsd ;; aros) basic_machine=i386-pc - os=aros + basic_os=aros ;; aux) basic_machine=m68k-apple - os=aux + basic_os=aux ;; balance) basic_machine=ns32k-sequent - os=dynix + basic_os=dynix ;; blackfin) basic_machine=bfin-unknown - os=linux + basic_os=linux ;; cegcc) basic_machine=arm-unknown - os=cegcc + basic_os=cegcc ;; convex-c1) basic_machine=c1-convex - os=bsd + basic_os=bsd ;; convex-c2) basic_machine=c2-convex - os=bsd + basic_os=bsd ;; convex-c32) basic_machine=c32-convex - os=bsd + basic_os=bsd ;; convex-c34) basic_machine=c34-convex - os=bsd + basic_os=bsd ;; convex-c38) basic_machine=c38-convex - os=bsd + basic_os=bsd ;; cray) basic_machine=j90-cray - os=unicos + basic_os=unicos ;; crds | unos) basic_machine=m68k-crds - os= + basic_os= ;; da30) basic_machine=m68k-da30 - os= + basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec - os= + basic_os= ;; delta88) basic_machine=m88k-motorola - os=sysv3 + basic_os=sysv3 ;; dicos) basic_machine=i686-pc - os=dicos + basic_os=dicos ;; djgpp) basic_machine=i586-pc - os=msdosdjgpp + basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd - os=ebmon + basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson - os=ose + basic_os=ose ;; gmicro) basic_machine=tron-gmicro - os=sysv + basic_os=sysv ;; go32) basic_machine=i386-pc - os=go32 + basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi - os=hms + basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi - os=xray + basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi - os=hms + basic_os=hms ;; harris) basic_machine=m88k-harris - os=sysv3 + basic_os=sysv3 ;; - hp300) + hp300 | hp300hpux) basic_machine=m68k-hp + basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp - os=bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=hpux + basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp - os=osf + basic_os=osf ;; hppro) basic_machine=hppa1.1-hp - os=proelf + basic_os=proelf ;; i386mach) basic_machine=i386-mach - os=mach - ;; - vsta) - basic_machine=i386-pc - os=vsta + basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi - os=sysv + basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown - os=linux + basic_os=linux ;; magnum | m3230) basic_machine=mips-mips - os=sysv + basic_os=sysv ;; merlin) basic_machine=ns32k-utek - os=sysv + basic_os=sysv ;; mingw64) basic_machine=x86_64-pc - os=mingw64 + basic_os=mingw64 ;; mingw32) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown - os=mingw32ce + basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; morphos) basic_machine=powerpc-unknown - os=morphos + basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown - os=moxiebox + basic_os=moxiebox ;; msdos) basic_machine=i386-pc - os=msdos + basic_os=msdos ;; msys) basic_machine=i686-pc - os=msys + basic_os=msys ;; mvs) basic_machine=i370-ibm - os=mvs + basic_os=mvs ;; nacl) basic_machine=le32-unknown - os=nacl + basic_os=nacl ;; ncr3000) basic_machine=i486-ncr - os=sysv4 + basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc - os=netbsd + basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel - os=linux + basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony - os=newsos + basic_os=newsos ;; news1000) basic_machine=m68030-sony - os=newsos + basic_os=newsos ;; necv70) basic_machine=v70-nec - os=sysv + basic_os=sysv ;; nh3000) basic_machine=m68k-harris - os=cxux + basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris - os=cxux + basic_os=cxux ;; nindy960) basic_machine=i960-intel - os=nindy + basic_os=nindy ;; mon960) basic_machine=i960-intel - os=mon960 + basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq - os=nonstopux + basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm - os=os400 + basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson - os=ose + basic_os=ose ;; os68k) basic_machine=m68k-none - os=os68k + basic_os=os68k ;; paragon) basic_machine=i860-intel - os=osf + basic_os=osf ;; parisc) basic_machine=hppa-unknown - os=linux + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp ;; pw32) basic_machine=i586-unknown - os=pw32 + basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc - os=rdos + basic_os=rdos ;; rdos32) basic_machine=i386-pc - os=rdos + basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k - os=coff + basic_os=coff ;; sa29200) basic_machine=a29k-amd - os=udi + basic_os=udi ;; sei) basic_machine=mips-sei - os=seiux + basic_os=seiux ;; sequent) basic_machine=i386-sequent - os= + basic_os= ;; sps7) basic_machine=m68k-bull - os=sysv2 + basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem - os= + basic_os= ;; stratus) basic_machine=i860-stratus - os=sysv4 + basic_os=sysv4 ;; sun2) basic_machine=m68000-sun - os= + basic_os= ;; sun2os3) basic_machine=m68000-sun - os=sunos3 + basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun - os=sunos4 + basic_os=sunos4 ;; sun3) basic_machine=m68k-sun - os= + basic_os= ;; sun3os3) basic_machine=m68k-sun - os=sunos3 + basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun - os=sunos4 + basic_os=sunos4 ;; sun4) basic_machine=sparc-sun - os= + basic_os= ;; sun4os3) basic_machine=sparc-sun - os=sunos3 + basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun - os=sunos4 + basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun - os=solaris2 + basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun - os= + basic_os= ;; sv1) basic_machine=sv1-cray - os=unicos + basic_os=unicos ;; symmetry) basic_machine=i386-sequent - os=dynix + basic_os=dynix ;; t3e) basic_machine=alphaev5-cray - os=unicos + basic_os=unicos ;; t90) basic_machine=t90-cray - os=unicos + basic_os=unicos ;; toad1) basic_machine=pdp10-xkl - os=tops20 + basic_os=tops20 ;; tpf) basic_machine=s390x-ibm - os=tpf + basic_os=tpf ;; udi29k) basic_machine=a29k-amd - os=udi + basic_os=udi ;; ultra3) basic_machine=a29k-nyu - os=sym1 + basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec - os=none + basic_os=none ;; vaxv) basic_machine=vax-dec - os=sysv + basic_os=sysv ;; vms) basic_machine=vax-dec - os=vms + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta ;; vxworks960) basic_machine=i960-wrs - os=vxworks + basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs - os=vxworks + basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs - os=vxworks + basic_os=vxworks ;; xbox) basic_machine=i686-pc - os=mingw32 + basic_os=mingw32 ;; ymp) basic_machine=ymp-cray - os=unicos + basic_os=unicos ;; *) basic_machine=$1 - os= + basic_os= ;; esac ;; @@ -686,17 +695,17 @@ bluegene*) cpu=powerpc vendor=ibm - os=cnk + basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec - os=tops10 + basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec - os=tops20 + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) @@ -706,7 +715,7 @@ dpx2*) cpu=m68k vendor=bull - os=sysv3 + basic_os=sysv3 ;; encore | umax | mmax) cpu=ns32k @@ -715,7 +724,7 @@ elxsi) cpu=elxsi vendor=elxsi - os=${os:-bsd} + basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 @@ -728,7 +737,7 @@ h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 @@ -771,36 +780,36 @@ i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv32 + basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv4 + basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=sysv + basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc - os=solaris2 + basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray - os=${os:-unicos} + basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi - case $os in + case $basic_os in irix*) ;; *) - os=irix4 + basic_os=irix4 ;; esac ;; @@ -811,26 +820,26 @@ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari - os=mint + basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony - os=newsos + basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next - case $os in + case $basic_os in openstep*) ;; nextstep*) ;; ns2*) - os=nextstep2 + basic_os=nextstep2 ;; *) - os=nextstep3 + basic_os=nextstep3 ;; esac ;; @@ -841,12 +850,12 @@ op50n-* | op60c-*) cpu=hppa1.1 vendor=oki - os=proelf + basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi - os=hiuxwe2 + basic_os=hiuxwe2 ;; pbd) cpu=sparc @@ -883,12 +892,12 @@ sde) cpu=mipsisa32 vendor=sde - os=${os:-elf} + basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs - os=vxworks + basic_os=vxworks ;; tower | tower-32) cpu=m68k @@ -905,7 +914,7 @@ w89k-*) cpu=hppa1.1 vendor=winbond - os=proelf + basic_os=proelf ;; none) cpu=none @@ -958,11 +967,11 @@ # some cases the only manufacturer, in others, it is the most popular. craynv-unknown) vendor=cray - os=${os:-unicosmp} + basic_os=${basic_os:-unicosmp} ;; c90-unknown | c90-cray) vendor=cray - os=${os:-unicos} + basic_os=${Basic_os:-unicos} ;; fx80-unknown) vendor=alliant @@ -1006,7 +1015,7 @@ dpx20-unknown | dpx20-bull) cpu=rs6000 vendor=bull - os=${os:-bosx} + basic_os=${basic_os:-bosx} ;; # Here we normalize CPU types irrespective of the vendor @@ -1015,7 +1024,7 @@ ;; blackfin-*) cpu=bfin - os=linux + basic_os=linux ;; c54x-*) cpu=tic54x @@ -1028,7 +1037,7 @@ ;; e500v[12]-*) cpu=powerpc - os=$os"spe" + basic_os=${basic_os}"spe" ;; mips3*-*) cpu=mips64 @@ -1038,7 +1047,7 @@ ;; m68knommu-*) cpu=m68k - os=linux + basic_os=linux ;; m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) cpu=s12z @@ -1048,7 +1057,7 @@ ;; parisc-*) cpu=hppa - os=linux + basic_os=linux ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) cpu=i586 @@ -1104,11 +1113,14 @@ xscale-* | xscalee[bl]-*) cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; + arm64-*) + cpu=aarch64 + ;; # Recognize the canonical CPU Types that limit and/or modify the # company names they are paired with. cr16-*) - os=${os:-elf} + basic_os=${basic_os:-elf} ;; crisv32-* | etraxfs*-*) cpu=crisv32 @@ -1119,7 +1131,7 @@ vendor=axis ;; crx-*) - os=${os:-elf} + basic_os=${basic_os:-elf} ;; neo-tandem) cpu=neo @@ -1141,16 +1153,12 @@ cpu=nsx vendor=tandem ;; - s390-*) - cpu=s390 - vendor=ibm - ;; - s390x-*) - cpu=s390x - vendor=ibm + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony ;; tile*-*) - os=${os:-linux-gnu} + basic_os=${basic_os:-linux-gnu} ;; *) @@ -1166,8 +1174,8 @@ | alphapca5[67] | alpha64pca5[67] \ | am33_2.0 \ | amdgcn \ - | arc | arceb \ - | arm | arm[lb]e | arme[lb] | armv* \ + | arc | arceb | arc32 | arc64 \ + | arm | arm[lb]e | arme[lb] | armv* \ | avr | avr32 \ | asmjs \ | ba \ @@ -1186,6 +1194,7 @@ | k1om \ | le32 | le64 \ | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ | m32c | m32r | m32rle \ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ @@ -1204,9 +1213,13 @@ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ @@ -1230,8 +1243,9 @@ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ | pru \ | pyramid \ - | riscv | riscv32 | riscv64 \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ | score \ | sh | shl \ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ @@ -1241,6 +1255,7 @@ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ | spu \ | tahoe \ + | thumbv7* \ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ | tron \ | ubicom32 \ @@ -1278,8 +1293,47 @@ # Decode manufacturer-specific aliases for certain operating systems. -if [ x$os != x ] +if test x$basic_os != x then + +# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + IFS="-" read kernel os <&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1533,6 +1512,7 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. +kernel= case $cpu-$vendor in score-*) os=elf @@ -1544,7 +1524,8 @@ os=riscix1.2 ;; arm*-rebel) - os=linux + kernel=linux + os=gnu ;; arm*-semi) os=aout @@ -1710,84 +1691,178 @@ os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) - case $os in - riscix*) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - sunos*) + *-sunos*) vendor=sun ;; - cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - beos*) + *-beos*) vendor=be ;; - hpux*) + *-hpux*) vendor=hp ;; - mpeix*) + *-mpeix*) vendor=hp ;; - hiux*) + *-hiux*) vendor=hitachi ;; - unos*) + *-unos*) vendor=crds ;; - dgux*) + *-dgux*) vendor=dg ;; - luna*) + *-luna*) vendor=omron ;; - genix*) + *-genix*) vendor=ns ;; - clix*) + *-clix*) vendor=intergraph ;; - mvs* | opened*) + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - os400*) + s390-* | s390x-*) vendor=ibm ;; - ptx*) + *-ptx*) vendor=sequent ;; - tpf*) + *-tpf*) vendor=ibm ;; - vxsim* | vxworks* | windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - aux*) + *-aux*) vendor=apple ;; - hms*) + *-hms*) vendor=hitachi ;; - mpw* | macos*) + *-mpw* | *-macos*) vendor=apple ;; - *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; - vos*) + *-vos*) vendor=stratus ;; esac ;; esac -echo "$cpu-$vendor-$os" +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/depcomp python-nacl-1.5.0/src/libsodium/build-aux/depcomp --- python-nacl-1.4.0/src/libsodium/build-aux/depcomp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/depcomp 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2018 Free Software Foundation, Inc. +# Copyright (C) 1999-2020 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/install-sh python-nacl-1.5.0/src/libsodium/build-aux/install-sh --- python-nacl-1.4.0/src/libsodium/build-aux/install-sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/install-sh 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2018-03-11.20; # UTC +scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -69,6 +69,11 @@ # Desired mode of installed file. mode=0755 +# Create dirs (including intermediate dirs) using mode 755. +# This is like GNU 'install' as of coreutils 8.32 (2020). +mkdir_umask=22 + +backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= @@ -99,18 +104,28 @@ --version display version info and exit. -c (ignored) - -C install only if different (preserve the last data modification time) + -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. + -p pass -p to $cpprog. -s $stripprog installed files. + -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + +By default, rm is invoked with -f; when overridden with RMPROG, +it's up to you to specify -f if you want it. + +If -S is not specified, no backups are attempted. + +Email bug reports to bug-automake@gnu.org. +Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do @@ -137,8 +152,13 @@ -o) chowncmd="$chownprog $2" shift;; + -p) cpprog="$cpprog -p";; + -s) stripcmd=$stripprog;; + -S) backupsuffix="$2" + shift;; + -t) is_target_a_directory=always dst_arg=$2 @@ -255,6 +275,10 @@ dstdir=$dst test -d "$dstdir" dstdir_status=$? + # Don't chown directories that already exist. + if test $dstdir_status = 0; then + chowncmd="" + fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command @@ -301,22 +325,6 @@ if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then @@ -326,52 +334,49 @@ fi posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - # Note that $RANDOM variable is not portable (e.g. dash); Use it - # here however when possible just to lower collision chance. - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - - trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 - - # Because "mkdir -p" follows existing symlinks and we likely work - # directly in world-writeable /tmp, make sure that the '$tmpdir' - # directory is successfully created first before we actually test - # 'mkdir -p' feature. - if (umask $mkdir_umask && - $mkdirprog $mkdir_mode "$tmpdir" && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - test_tmpdir="$tmpdir/a" - ls_ld_tmpdir=`ls -ld "$test_tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null - fi - trap '' 0;; - esac;; + # The $RANDOM variable is not portable (e.g., dash). Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap ' + ret=$? + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null + exit $ret + ' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p'. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; esac if @@ -382,7 +387,7 @@ then : else - # The umask is ridiculous, or mkdir does not conform to POSIX, + # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. @@ -411,7 +416,7 @@ prefixes= else if $posix_mkdir; then - (umask=$mkdir_umask && + (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 @@ -451,7 +456,18 @@ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + (umask $cp_umask && + { test -z "$stripcmd" || { + # Create $dsttmp read-write so that cp doesn't create it read-only, + # which would cause strip to fail. + if test -z "$doit"; then + : >"$dsttmp" # No need to fork-exec 'touch'. + else + $doit touch "$dsttmp" + fi + } + } && + $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -477,6 +493,13 @@ then rm -f "$dsttmp" else + # If $backupsuffix is set, and the file being installed + # already exists, attempt a backup. Don't worry if it fails, + # e.g., if mv doesn't support -f. + if test -n "$backupsuffix" && test -f "$dst"; then + $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null + fi + # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || @@ -491,9 +514,9 @@ # file should still install successfully. { test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || + $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/missing python-nacl-1.5.0/src/libsodium/build-aux/missing --- python-nacl-1.4.0/src/libsodium/build-aux/missing 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/missing 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2018 Free Software Foundation, Inc. +# Copyright (C) 1996-2020 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify diff -Nru python-nacl-1.4.0/src/libsodium/build-aux/test-driver python-nacl-1.5.0/src/libsodium/build-aux/test-driver --- python-nacl-1.4.0/src/libsodium/build-aux/test-driver 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/build-aux/test-driver 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,7 @@ scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2018 Free Software Foundation, Inc. +# Copyright (C) 2011-2020 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,11 +42,13 @@ { cat < - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -278,12 +278,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -278,12 +278,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -278,12 +278,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -278,12 +278,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -278,12 +278,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -623,9 +623,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\sandy2x @@ -638,9 +635,6 @@ crypto_scalarmult\curve25519\sandy2x - - crypto_scalarmult\curve25519\sandy2x - crypto_scalarmult\curve25519\ref10 diff -Nru python-nacl-1.4.0/src/libsodium/ChangeLog python-nacl-1.5.0/src/libsodium/ChangeLog --- python-nacl-1.4.0/src/libsodium/ChangeLog 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/ChangeLog 2022-01-07 21:54:10.000000000 +0000 @@ -1,10 +1,11 @@ * Version 1.0.18 - - The Enterprise versions of Visual Studio are now supported. + - Enterprise versions of Visual Studio are now supported. - Visual Studio 2019 is now supported. - 32-bit binaries for Visual Studio 2010 are now provided. - - A test that didn't work properly on Linux systems with overcommit -memory turned on has been removed. This fixes Ansible builds. + - A test designed to trigger an OOM condition didn't work on Linux systems +with memory overcommit turned on. It has been removed in order to fix +Ansible builds. - Emscripten: `print` and `printErr` functions are overridden to send errors to the console, if there is one. - Emscripten: `UTF8ToString()` is now exported since `Pointer_stringify()` @@ -14,15 +15,15 @@ - New target: WebAssembly/WASI (compile with `dist-builds/wasm32-wasi.sh`). - New functions to map a hash to an edwards25519 point or get a random point: `core_ed25519_from_hash()` and `core_ed25519_random()`. - - `crypto_core_ed25519_scalar_mul()` has been implemented for `scalar*scalar` -`(mod L)` multiplication. - - Support for the Ristretto group has been implemented, for compatibility + - `crypto_core_ed25519_scalar_mul()` has been implemented for +`scalar*scalar (mod L)` multiplication. + - Support for the Ristretto group has been implemented for interoperability with wasm-crypto. - Improvements have been made to the test suite. - - Portability improvements has been made. + - Portability improvements have been made. - `getentropy()` is now used on systems providing this system call. - - `randombytes_salsa20 has been renamed to `randombytes_internal`. - - Support for (p)nacl has been removed. + - `randombytes_salsa20` has been renamed to `randombytes_internal`. + - Support for NativeClient has been removed. - Most `((nonnull))` attributes have been relaxed to allow 0-length inputs to be `NULL`. - The `-ftree-vectorize` and `-ftree-slp-vectorize` compiler switches are diff -Nru python-nacl-1.4.0/src/libsodium/configure python-nacl-1.5.0/src/libsodium/configure --- python-nacl-1.4.0/src/libsodium/configure 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/configure 2022-01-07 21:54:10.000000000 +0000 @@ -1,11 +1,12 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libsodium 1.0.18. +# Generated by GNU Autoconf 2.71 for libsodium 1.0.18. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Inc. # # # This configure script is free software; the Free Software Foundation @@ -16,14 +17,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -33,46 +36,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -81,13 +84,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -96,8 +92,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -109,30 +109,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. @@ -154,20 +134,22 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 -as_fn_exit 255 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + as_bourne_compatible="as_nop=: +if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else +else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( @@ -187,12 +169,15 @@ as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } -if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : +if ( set x; as_fn_ret_success y && test x = \"\$1\" ) +then : -else +else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 +blah=\$(echo \$(echo blah)) +test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO @@ -207,30 +192,38 @@ PATH=/empty FPATH=/empty; export PATH FPATH test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\ || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1" - if (eval "$as_required") 2>/dev/null; then : + if (eval "$as_required") 2>/dev/null +then : as_have_required=yes -else +else $as_nop as_have_required=no fi - if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null +then : -else +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. - as_shell=$as_dir/$as_base + as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : CONFIG_SHELL=$as_shell as_have_required=yes - if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null +then : break 2 fi fi @@ -238,14 +231,21 @@ esac as_found=false done -$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && - { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : - CONFIG_SHELL=$SHELL as_have_required=yes -fi; } IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null +then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi +fi - if test "x$CONFIG_SHELL" != x; then : + if test "x$CONFIG_SHELL" != x +then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also @@ -263,18 +263,19 @@ exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. -$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi - if test x$as_have_required = xno; then : - $as_echo "$0: This script requires a shell more modern than all" - $as_echo "$0: the shells that I found on your system." - if test x${ZSH_VERSION+set} = xset ; then - $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" - $as_echo "$0: be upgraded to zsh 4.3.4 or later." + if test x$as_have_required = xno +then : + printf "%s\n" "$0: This script requires a shell more modern than all" + printf "%s\n" "$0: the shells that I found on your system." + if test ${ZSH_VERSION+y} ; then + printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" + printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else - $as_echo "$0: Please tell bug-autoconf@gnu.org and + printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/jedisct1/libsodium/issues about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run @@ -302,6 +303,7 @@ } as_unset=as_fn_unset + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -319,6 +321,14 @@ as_fn_set_status $1 exit $1 } # as_fn_exit +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -333,7 +343,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -342,7 +352,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -381,12 +391,13 @@ # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -398,18 +409,27 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith +# as_fn_nop +# --------- +# Do nothing but, unlike ":", preserve the value of $?. +as_fn_nop () +{ + return $? +} +as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -421,9 +441,9 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -450,7 +470,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -494,7 +514,7 @@ s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall @@ -508,6 +528,10 @@ exit } + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -521,6 +545,13 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -593,52 +624,47 @@ PACKAGE_VERSION='1.0.18' PACKAGE_STRING='libsodium 1.0.18' PACKAGE_BUGREPORT='https://github.com/jedisct1/libsodium/issues' -PACKAGE_URL='https://github.com/jedisct1/libsodium' +PACKAGE_URL='https://libsodium.org' ac_unique_file="src/libsodium/sodium/version.c" # Factoring default headers for most tests. ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include +#include +#ifdef HAVE_STDIO_H +# include #endif -#ifdef STDC_HEADERS +#ifdef HAVE_STDLIB_H # include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif #endif #ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif # include #endif -#ifdef HAVE_STRINGS_H -# include -#endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif" +ac_header_c_list= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS HAVE_LD_OUTPUT_DEF_FALSE HAVE_LD_OUTPUT_DEF_TRUE -AS WASI_FALSE WASI_TRUE EMSCRIPTEN_FALSE @@ -688,11 +714,6 @@ FGREP LIBTOOL CWFLAGS -am__fastdepCCAS_FALSE -am__fastdepCCAS_TRUE -CCASDEPMODE -CCASFLAGS -CCAS VALGRIND_CHECK_RULES valgrind_enabled_tools valgrind_tools @@ -708,6 +729,7 @@ SAFECODE_HOME PTHREAD_CFLAGS PTHREAD_LIBS +PTHREAD_CXX PTHREAD_CC ax_pthread_config EGREP @@ -717,6 +739,11 @@ SODIUM_LIBRARY_MINIMAL_DEF MINIMAL_FALSE MINIMAL_TRUE +am__fastdepCCAS_FALSE +am__fastdepCCAS_TRUE +CCASDEPMODE +CCASFLAGS +CCAS am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -767,6 +794,10 @@ INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM +target_os +target_vendor +target_cpu +target host_os host_vendor host_cpu @@ -794,6 +825,7 @@ docdir oldincludedir includedir +runstatedir localstatedir sharedstatedir sysconfdir @@ -854,10 +886,10 @@ LDFLAGS LIBS CPPFLAGS -CPP -SAFECODE_HOME CCAS CCASFLAGS +CPP +SAFECODE_HOME CWFLAGS LT_SYS_LIBRARY_PATH AR' @@ -899,6 +931,7 @@ sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -928,8 +961,6 @@ *) ac_optarg=yes ;; esac - # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; @@ -970,9 +1001,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -996,9 +1027,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" @@ -1151,6 +1182,15 @@ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; + -runstatedir | --runstatedir | --runstatedi | --runstated \ + | --runstate | --runstat | --runsta | --runst | --runs \ + | --run | --ru | --r) + ac_prev=runstatedir ;; + -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ + | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ + | --run=* | --ru=* | --r=*) + runstatedir=$ac_optarg ;; + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1200,9 +1240,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1216,9 +1256,9 @@ ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" @@ -1262,9 +1302,9 @@ *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; @@ -1280,7 +1320,7 @@ case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1288,7 +1328,7 @@ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir + libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1344,7 +1384,7 @@ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | +printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1441,6 +1481,7 @@ --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1466,6 +1507,7 @@ System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi @@ -1545,11 +1587,11 @@ LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory + CCAS assembler compiler command (defaults to CC) + CCASFLAGS assembler compiler flags (defaults to CFLAGS) CPP C preprocessor SAFECODE_HOME set to the safecode base directory - CCAS assembler compiler command (defaults to CC) - CCASFLAGS assembler compiler flags (defaults to CFLAGS) CWFLAGS define to compilation flags for generating extra warnings LT_SYS_LIBRARY_PATH User-defined run-time library search path. @@ -1559,7 +1601,7 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . -libsodium home page: . +libsodium home page: . _ACEOF ac_status=$? fi @@ -1575,9 +1617,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1605,7 +1647,8 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. + # Check for configure.gnu first; this name is used for a wrapper for + # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive @@ -1613,7 +1656,7 @@ echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1623,9 +1666,9 @@ if $ac_init_version; then cat <<\_ACEOF libsodium configure 1.0.18 -generated by GNU Autoconf 2.69 +generated by GNU Autoconf 2.71 -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1642,14 +1685,14 @@ ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext + rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1657,14 +1700,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest.$ac_objext; then : + } && test -s conftest.$ac_objext +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1674,20 +1718,53 @@ } # ac_fn_c_try_compile +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + eval "$3=yes" +else $as_nop + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +eval ac_res=\$$3 + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - rm -f conftest.$ac_objext conftest$ac_exeext + rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1695,17 +1772,18 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1732,7 +1810,7 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -1740,14 +1818,15 @@ cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - }; then : + } +then : ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 @@ -1757,101 +1836,10 @@ } # ac_fn_c_try_cpp -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ----------------------------------------------------------- ## -## Report this to https://github.com/jedisct1/libsodium/issues ## -## ----------------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_try_run LINENO # ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. +# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that +# executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack @@ -1861,25 +1849,26 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; } +then : ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: program exited with status $ac_status" >&5 + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status @@ -1890,48 +1879,18 @@ } # ac_fn_c_try_run -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. @@ -1939,16 +1898,9 @@ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif + which can conflict with char $2 (); below. */ +#include #undef $2 /* Override any GCC internal prototype to avoid an error. @@ -1966,24 +1918,25 @@ #endif int -main () +main (void) { return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$3=yes" -else +else $as_nop eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -1995,17 +1948,18 @@ ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +printf %s "checking for $2... " >&6; } +if eval test \${$3+y} +then : + printf %s "(cached) " >&6 +else $as_nop eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof ($2)) return 0; @@ -2013,12 +1967,13 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int -main () +main (void) { if (sizeof (($2))) return 0; @@ -2026,29 +1981,50 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop eval "$3=yes" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type +ac_configure_args_raw= +for ac_arg +do + case $ac_arg in + *\'*) + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append ac_configure_args_raw " '$ac_arg'" +done + +case $ac_configure_args_raw in + *$as_nl*) + ac_safe_unquote= ;; + *) + ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. + ac_unsafe_a="$ac_unsafe_z#~" + ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" + ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; +esac + cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by libsodium $as_me 1.0.18, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was - $ $0 $@ + $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log @@ -2081,8 +2057,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS @@ -2117,7 +2097,7 @@ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; @@ -2152,11 +2132,13 @@ # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? + # Sanitize IFS. + IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo - $as_echo "## ---------------- ## + printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo @@ -2167,8 +2149,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -2192,7 +2174,7 @@ ) echo - $as_echo "## ----------------- ## + printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo @@ -2200,14 +2182,14 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then - $as_echo "## ------------------- ## + printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo @@ -2215,15 +2197,15 @@ do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then - $as_echo "## ----------- ## + printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo @@ -2231,8 +2213,8 @@ echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + printf "%s\n" "$as_me: caught signal $ac_signal" + printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -2246,63 +2228,48 @@ # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h -$as_echo "/* confdefs.h */" > confdefs.h +printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF +printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF +printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF +printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF +printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF +printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define PACKAGE_URL "$PACKAGE_URL" -_ACEOF +printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - # We do not want a PATH search for config.site. - case $CONFIG_SITE in #(( - -*) ac_site_file1=./$CONFIG_SITE;; - */*) ac_site_file1=$CONFIG_SITE;; - *) ac_site_file1=./$CONFIG_SITE;; - esac + ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" + +for ac_site_file in $ac_site_files do - test "x$ac_site_file" = xNONE && continue - if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + case $ac_site_file in #( + */*) : + ;; #( + *) : + ac_site_file=./$ac_site_file ;; +esac + if test -f "$ac_site_file" && test -r "$ac_site_file"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi @@ -2312,138 +2279,532 @@ # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) as_fn_append ac_configure_args " '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 -fi -## -------------------- ## -## Main body of script. ## -## -------------------- ## - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +# Test code for whether the C compiler supports C89 (global declarations) +ac_c_conftest_c89_globals=' +/* Does the compiler advertise C89 conformance? + Do not test the value of __STDC__, because some compilers set it to 0 + while being otherwise adequately conformant. */ +#if !defined __STDC__ +# error "Compiler does not advertise C89 conformance" +#endif -ac_aux_dir= -for ac_dir in build-aux "$srcdir"/build-aux; do - if test -f "$ac_dir/install-sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ +struct buf { int x; }; +struct buf * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not \xHH hex character constants. + These do not provoke an error unfortunately, instead are silently treated + as an "x". The following induces an error, until -std is added to get + proper ANSI mode. Curiously \x00 != x always comes out true, for an + array size at least. It is necessary to write \x00 == 0 to get something + that is true only with -std. */ +int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) '\''x'\'' +int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), + int, int);' + +# Test code for whether the C compiler supports C89 (body of main). +ac_c_conftest_c89_main=' +ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); +' + +# Test code for whether the C compiler supports C99 (global declarations) +ac_c_conftest_c99_globals=' +// Does the compiler advertise C99 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L +# error "Compiler does not advertise C99 conformance" +#endif + +#include +extern int puts (const char *); +extern int printf (const char *, ...); +extern int dprintf (int, const char *, ...); +extern void *malloc (size_t); + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +// dprintf is used instead of fprintf to avoid needing to declare +// FILE and stderr. +#define debug(...) dprintf (2, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + #error "your preprocessor is broken" +#endif +#if BIG_OK +#else + #error "your preprocessor is broken" +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static bool +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str = ""; + int number = 0; + float fnumber = 0; + + while (*format) + { + switch (*format++) + { + case '\''s'\'': // string + str = va_arg (args_copy, const char *); + break; + case '\''d'\'': // int + number = va_arg (args_copy, int); + break; + case '\''f'\'': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); + + return *str && number && fnumber; +} +' + +# Test code for whether the C compiler supports C99 (body of main). +ac_c_conftest_c99_main=' + // Check bool. + _Bool success = false; + success |= (argc != 0); + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[0] = argv[0][0]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' + || dynamic_array[ni.number - 1] != 543); +' + +# Test code for whether the C compiler supports C11 (global declarations) +ac_c_conftest_c11_globals=' +// Does the compiler advertise C11 conformance? +#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L +# error "Compiler does not advertise C11 conformance" +#endif + +// Check _Alignas. +char _Alignas (double) aligned_as_double; +char _Alignas (0) no_special_alignment; +extern char aligned_as_int; +char _Alignas (0) _Alignas (int) aligned_as_int; + +// Check _Alignof. +enum +{ + int_alignment = _Alignof (int), + int_array_alignment = _Alignof (int[100]), + char_alignment = _Alignof (char) +}; +_Static_assert (0 < -_Alignof (int), "_Alignof is signed"); + +// Check _Noreturn. +int _Noreturn does_not_return (void) { for (;;) continue; } + +// Check _Static_assert. +struct test_static_assert +{ + int x; + _Static_assert (sizeof (int) <= sizeof (long int), + "_Static_assert does not work in struct"); + long int y; +}; + +// Check UTF-8 literals. +#define u8 syntax error! +char const utf8_literal[] = u8"happens to be ASCII" "another string"; + +// Check duplicate typedefs. +typedef long *long_ptr; +typedef long int *long_ptr; +typedef long_ptr long_ptr; + +// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. +struct anonymous +{ + union { + struct { int i; int j; }; + struct { int k; long int l; } w; + }; + int m; +} v1; +' + +# Test code for whether the C compiler supports C11 (body of main). +ac_c_conftest_c11_main=' + _Static_assert ((offsetof (struct anonymous, i) + == offsetof (struct anonymous, w.k)), + "Anonymous union alignment botch"); + v1.i = 2; + v1.w.k = 5; + ok |= v1.i != 5; +' + +# Test code for whether the C compiler supports C11 (complete). +ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} +${ac_c_conftest_c11_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + ${ac_c_conftest_c11_main} + return ok; +} +" + +# Test code for whether the C compiler supports C99 (complete). +ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} +${ac_c_conftest_c99_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + ${ac_c_conftest_c99_main} + return ok; +} +" + +# Test code for whether the C compiler supports C89 (complete). +ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} + +int +main (int argc, char **argv) +{ + int ok = 0; + ${ac_c_conftest_c89_main} + return ok; +} +" + +as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H" +as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H" +as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H" +as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H" +as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H" +as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H" +as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H" +as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H" +as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H" +as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H" +as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H" + +# Auxiliary files required by this configure script. +ac_aux_files="ltmain.sh compile missing install-sh config.guess config.sub" + +# Locations in which to look for auxiliary files. +ac_aux_dir_candidates="${srcdir}/build-aux" + +# Search for a directory containing all of the required auxiliary files, +# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates. +# If we don't find one directory that contains all the files we need, +# we report the set of missing files from the *first* directory in +# $ac_aux_dir_candidates and give up. +ac_missing_aux_files="" +ac_first_candidate=: +printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in $ac_aux_dir_candidates +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + as_found=: + + printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5 + ac_aux_dir_found=yes + ac_install_sh= + for ac_aux in $ac_aux_files + do + # As a special case, if "install-sh" is required, that requirement + # can be satisfied by any of "install-sh", "install.sh", or "shtool", + # and $ac_install_sh is set appropriately for whichever one is found. + if test x"$ac_aux" = x"install-sh" + then + if test -f "${as_dir}install-sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5 + ac_install_sh="${as_dir}install-sh -c" + elif test -f "${as_dir}install.sh"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5 + ac_install_sh="${as_dir}install.sh -c" + elif test -f "${as_dir}shtool"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5 + ac_install_sh="${as_dir}shtool install -c" + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} install-sh" + else + break + fi + fi + else + if test -f "${as_dir}${ac_aux}"; then + printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5 + else + ac_aux_dir_found=no + if $ac_first_candidate; then + ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}" + else + break + fi + fi + fi + done + if test "$ac_aux_dir_found" = yes; then + ac_aux_dir="$as_dir" break fi + ac_first_candidate=false + + as_found=false done -if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 +IFS=$as_save_IFS +if $as_found +then : + +else $as_nop + as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 fi + # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. +if test -f "${ac_aux_dir}config.guess"; then + ac_config_guess="$SHELL ${ac_aux_dir}config.guess" +fi +if test -f "${ac_aux_dir}config.sub"; then + ac_config_sub="$SHELL ${ac_aux_dir}config.sub" +fi +if test -f "$ac_aux_dir/configure"; then + ac_configure="$SHELL ${ac_aux_dir}configure" +fi +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } -if ${ac_cv_build+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + + # Make sure we can run config.sub. +$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 || + as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5 + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +printf %s "checking build system type... " >&6; } +if test ${ac_cv_build+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_build_alias=$build_alias test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` + ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 +ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +printf "%s\n" "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; @@ -2462,21 +2823,22 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if ${ac_cv_host+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +printf %s "checking host system type... " >&6; } +if test ${ac_cv_host+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +printf "%s\n" "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; @@ -2495,9 +2857,50 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 +printf %s "checking target system type... " >&6; } +if test ${ac_cv_target+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` || + as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5 +fi + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5 +printf "%s\n" "$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- am__api_version='1.16' -# Find a good install program. We prefer a C program (faster), + + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install @@ -2511,20 +2914,25 @@ # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if ${ac_cv_path_install+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${ac_cv_path_install+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in #(( - ./ | .// | /[cC]/* | \ + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + # Account for fact that we put trailing slashes in our PATH walk. +case $as_dir in #(( + ./ | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; @@ -2534,13 +2942,13 @@ # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else @@ -2548,12 +2956,12 @@ echo one > conftest.one echo two > conftest.two mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c" break 3 fi fi @@ -2569,7 +2977,7 @@ rm -rf conftest.one conftest.two conftest.dir fi - if test "${ac_cv_path_install+set}" = set; then + if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a @@ -2579,8 +2987,8 @@ INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +printf "%s\n" "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2590,8 +2998,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 -$as_echo_n "checking whether build environment is sane... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 +printf %s "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' @@ -2645,8 +3053,8 @@ as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= @@ -2665,26 +3073,23 @@ # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"` + # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` -if test x"${MISSING+set}" != xset; then - case $am_aux_dir in - *\ * | *\ *) - MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; - *) - MISSING="\${SHELL} $am_aux_dir/missing" ;; - esac + + if test x"${MISSING+set}" != xset; then + MISSING="\${SHELL} '$am_aux_dir/missing'" fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 -$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 +printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then @@ -2704,11 +3109,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -2716,11 +3122,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2731,11 +3141,11 @@ fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -2744,11 +3154,12 @@ ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -2756,11 +3167,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2771,11 +3186,11 @@ fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -2783,8 +3198,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -2796,25 +3211,31 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 -$as_echo_n "checking for a thread-safe mkdir -p... " >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5 +printf %s "checking for a race-free mkdir -p... " >&6; } if test -z "$MKDIR_P"; then - if ${ac_cv_path_mkdir+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${ac_cv_path_mkdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do - as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue - case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( - 'mkdir (GNU coreutils) '* | \ - 'mkdir (coreutils) '* | \ + as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue + case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir ('*'coreutils) '* | \ + 'BusyBox '* | \ 'mkdir (fileutils) '4.1*) - ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext break 3;; esac done @@ -2825,7 +3246,7 @@ fi test -d ./--version && rmdir ./--version - if test "${ac_cv_path_mkdir+set}" = set; then + if test ${ac_cv_path_mkdir+y}; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a @@ -2835,18 +3256,19 @@ MKDIR_P="$ac_install_sh -d" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 -$as_echo "$MKDIR_P" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 +printf "%s\n" "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AWK+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AWK+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else @@ -2854,11 +3276,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2869,24 +3295,25 @@ fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 +printf "%s\n" "$AWK" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if eval test \${ac_cv_prog_make_${ac_make}_set+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @@ -2902,12 +3329,12 @@ rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2921,7 +3348,8 @@ rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -2931,12 +3359,13 @@ *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -2948,8 +3377,8 @@ am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -2984,14 +3413,10 @@ VERSION='1.0.18' -cat >>confdefs.h <<_ACEOF -#define PACKAGE "$PACKAGE" -_ACEOF +printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h -cat >>confdefs.h <<_ACEOF -#define VERSION "$VERSION" -_ACEOF +printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h # Some tools Automake needs. @@ -3037,29 +3462,29 @@ # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 -$as_echo_n "checking whether UID '$am_uid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UID '$am_uid' is supported by ustar format" >&5 +printf %s "checking whether UID '$am_uid' is supported by ustar format... " >&6; } if test $am_uid -le $am_max_uid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 -$as_echo_n "checking whether GID '$am_gid' is supported by ustar format... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether GID '$am_gid' is supported by ustar format" >&5 +printf %s "checking whether GID '$am_gid' is supported by ustar format... " >&6; } if test $am_gid -le $am_max_gid; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } _am_tools=none fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 -$as_echo_n "checking how to create a ustar tar archive... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to create a ustar tar archive" >&5 +printf %s "checking how to create a ustar tar archive... " >&6; } # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. @@ -3134,14 +3559,15 @@ done rm -rf conftest.dir - if ${am_cv_prog_tar_ustar+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${am_cv_prog_tar_ustar+y} +then : + printf %s "(cached) " >&6 +else $as_nop am_cv_prog_tar_ustar=$_am_tool fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 -$as_echo "$am_cv_prog_tar_ustar" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_tar_ustar" >&5 +printf "%s\n" "$am_cv_prog_tar_ustar" >&6; } @@ -3191,7 +3617,8 @@ fi # Check whether --enable-silent-rules was given. -if test "${enable_silent_rules+set}" = set; then : +if test ${enable_silent_rules+y} +then : enableval=$enable_silent_rules; fi @@ -3201,12 +3628,13 @@ *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 -$as_echo_n "checking whether $am_make supports nested variables... " >&6; } -if ${am_cv_make_support_nested_variables+:} false; then : - $as_echo_n "(cached) " >&6 -else - if $as_echo 'TRUE=$(BAR$(V)) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 +printf %s "checking whether $am_make supports nested variables... " >&6; } +if test ${am_cv_make_support_nested_variables+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if printf "%s\n" 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 @@ -3218,8 +3646,8 @@ am_cv_make_support_nested_variables=no fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 -$as_echo "$am_cv_make_support_nested_variables" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 +printf "%s\n" "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' @@ -3230,17 +3658,18 @@ AM_BACKSLASH='\' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 +printf %s "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : +if test ${enable_maintainer_mode+y} +then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else +else $as_nop USE_MAINTAINER_MODE=no fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 +printf "%s\n" "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' @@ -3253,7 +3682,8 @@ # Check whether --enable-dependency-tracking was given. -if test "${enable_dependency_tracking+set}" = set; then : +if test ${enable_dependency_tracking+y} +then : enableval=$enable_dependency_tracking; fi @@ -3299,95 +3729,20 @@ PKGCONFIG_LIBS_PRIVATE="" -if pwd | fgrep ' ' > /dev/null 2>&1; then : +if pwd | fgrep ' ' > /dev/null 2>&1 +then : as_fn_error $? "The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions" "$LINENO" 5 fi -# Check whether --enable-ssp was given. -if test "${enable_ssp+set}" = set; then : - enableval=$enable_ssp; - if test "x$enableval" = "xno"; then : - enable_ssp="no" -else - - enable_ssp="yes" - -fi - -else - enable_ssp="yes" -fi -# Check whether --enable-asm was given. -if test "${enable_asm+set}" = set; then : - enableval=$enable_asm; - if test "x$enableval" = "xno"; then : - enable_asm="no" - -else - - enable_asm="yes" - -fi - -else - - enable_asm="yes" - -fi - - -DEPDIR="${am__leading_dot}deps" - -ac_config_commands="$ac_config_commands depfiles" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 -$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } -cat > confinc.mk << 'END' -am__doit: - @echo this is the am__doit target >confinc.out -.PHONY: am__doit -END -am__include="#" -am__quote= -# BSD make does it like this. -echo '.include "confinc.mk" # ignored' > confmf.BSD -# Other make implementations (GNU, Solaris 10, AIX) do it like this. -echo 'include confinc.mk # ignored' > confmf.GNU -_am_result=no -for s in GNU BSD; do - { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 - (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - case $?:`cat confinc.out 2>/dev/null` in #( - '0:this is the am__doit target') : - case $s in #( - BSD) : - am__include='.include' am__quote='"' ;; #( - *) : - am__include='include' am__quote='' ;; -esac ;; #( - *) : - ;; -esac - if test "$am__include" != "#"; then - _am_result="yes ($s style)" - break - fi -done -rm -f confinc.* confmf.* -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 -$as_echo "${_am_result}" >&6; } ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -3397,11 +3752,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3409,11 +3765,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3424,11 +3784,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3437,11 +3797,12 @@ ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3449,11 +3810,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3464,11 +3829,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -3476,8 +3841,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3490,11 +3855,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3502,11 +3868,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3517,11 +3887,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3530,11 +3900,12 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3543,15 +3914,19 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3567,18 +3942,18 @@ # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3589,11 +3964,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else @@ -3601,11 +3977,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3616,11 +3996,11 @@ fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 -$as_echo "$CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3633,11 +4013,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else @@ -3645,11 +4026,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -3660,11 +4045,11 @@ fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -3676,8 +4061,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -3685,25 +4070,129 @@ fi fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. +set dummy ${ac_tool_prefix}clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +printf "%s\n" "$CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi -test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "clang", so it can be a program name with args. +set dummy clang; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="clang" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +printf "%s\n" "$ac_ct_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +fi + + +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. -$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 -for ac_option in --version -v -V -qversion; do +for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then @@ -3713,7 +4202,7 @@ cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done @@ -3721,7 +4210,7 @@ /* end confdefs.h. */ int -main () +main (void) { ; @@ -3733,9 +4222,9 @@ # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +printf %s "checking whether the C compiler works... " >&6; } +ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" @@ -3756,11 +4245,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, @@ -3777,7 +4267,7 @@ # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi @@ -3793,44 +4283,46 @@ done test "$ac_cv_exeext" = no && ac_cv_exeext= -else +else $as_nop ac_file='' fi -if test -z "$ac_file"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -$as_echo "$as_me: failed program was:" >&5 +if test -z "$ac_file" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +printf %s "checking for C compiler default output file name... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with @@ -3844,15 +4336,15 @@ * ) break;; esac done -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext @@ -3861,7 +4353,7 @@ /* end confdefs.h. */ #include int -main () +main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; @@ -3873,8 +4365,8 @@ ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in @@ -3882,10 +4374,10 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in @@ -3893,39 +4385,40 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "cannot run C compiled programs. + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } -if ${ac_cv_objext+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +printf %s "checking for suffix of object files... " >&6; } +if test ${ac_cv_objext+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; @@ -3939,11 +4432,12 @@ *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 +printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then : + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in @@ -3952,31 +4446,32 @@ break;; esac done -else - $as_echo "$as_me: failed program was:" >&5 +else $as_nop + printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if ${ac_cv_c_compiler_gnu+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 +printf %s "checking whether the compiler supports GNU C... " >&6; } +if test ${ac_cv_c_compiler_gnu+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __GNUC__ choke me @@ -3986,29 +4481,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_compiler_gnu=yes -else +else $as_nop ac_compiler_gnu=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } +ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi -ac_test_CFLAGS=${CFLAGS+set} +ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if ${ac_cv_prog_cc_g+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +printf %s "checking whether $CC accepts -g... " >&6; } +if test ${ac_cv_prog_cc_g+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no @@ -4017,57 +4516,60 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes -else +else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +printf "%s\n" "$ac_cv_prog_cc_g" >&6; } +if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then @@ -4082,168 +4584,401 @@ CFLAGS= fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if ${ac_cv_prog_cc_c89+:} false; then : - $as_echo_n "(cached) " >&6 -else +ac_prog_cc_stdc=no +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 +printf %s "checking for $CC option to enable C11 features... " >&6; } +if test ${ac_cv_prog_cc_c11+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c11=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c11_program +_ACEOF +for ac_arg in '' -std=gnu11 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c11=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c11" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c11" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c11" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } + CC="$CC $ac_cv_prog_cc_c11" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 + ac_prog_cc_stdc=c11 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 +printf %s "checking for $CC option to enable C99 features... " >&6; } +if test ${ac_cv_prog_cc_c99+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_c_conftest_c99_program +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c99" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c99" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } + CC="$CC $ac_cv_prog_cc_c99" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 + ac_prog_cc_stdc=c99 +fi +fi +if test x$ac_prog_cc_stdc = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 +printf %s "checking for $CC option to enable C89 features... " >&6; } +if test ${ac_cv_prog_cc_c89+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include -#include -struct stat; -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) +$ac_c_conftest_c89_program +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC +fi + +if test "x$ac_cv_prog_cc_c89" = xno +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +printf "%s\n" "unsupported" >&6; } +else $as_nop + if test "x$ac_cv_prog_cc_c89" = x +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +printf "%s\n" "none needed" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } + CC="$CC $ac_cv_prog_cc_c89" +fi + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 + ac_prog_cc_stdc=c89 +fi +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 +printf %s "checking whether $CC understands -c and -o together... " >&6; } +if test ${am_cv_prog_cc_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) { - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; + + ; + return 0; } +_ACEOF + # Make sure it works both with $CC and with simple cc. + # Following AC_PROG_CC_C_O, we do the test twice because some + # compilers refuse to overwrite an existing .o file with -o, + # though they will create one. + am_cv_prog_cc_c_o=yes + for am_i in 1 2; do + if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 + ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } \ + && test -f conftest2.$ac_objext; then + : OK + else + am_cv_prog_cc_c_o=no + break + fi + done + rm -f core conftest* + unset am_i +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 +printf "%s\n" "$am_cv_prog_cc_c_o" >&6; } +if test "$am_cv_prog_cc_c_o" != yes; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +DEPDIR="${am__leading_dot}deps" -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; +ac_config_commands="$ac_config_commands depfiles" + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' +am__doit: + @echo this is the am__doit target >confinc.out +.PHONY: am__doit +END +am__include="#" +am__quote= +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : + ;; +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +printf "%s\n" "${_am_result}" >&6; } + + +depcc="$CC" am_compiler_list= + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CC_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named 'D' -- because '-MD' means "put the output + # in D". + rm -rf conftest.dir + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + am__universal=false + case " $depcc " in #( + *\ -arch\ *\ -arch\ *) am__universal=true ;; + esac + + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with + # Solaris 10 /bin/sh. + echo '/* dummy */' > sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + # We check with '-c' and '-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle '-M -o', and we need to detect this. Also, some Intel + # versions had trouble with output in subdirs. + am__obj=sub/conftest.${OBJEXT-o} + am__minus_obj="-o $am__obj" + case $depmode in + gcc) + # This depmode causes a compiler race in universal mode. + test "$am__universal" = false || continue + ;; + nosideeffect) + # After this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested. + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + msvc7 | msvc7msys | msvisualcpp | msvcmsys) + # This compiler won't grok '-c -o', but also, the minuso test has + # not run yet. These depmodes are late enough in the game, and + # so weak that their functioning should not be impacted. + am__obj=conftest.${OBJEXT-o} + am__minus_obj= + ;; + none) break ;; + esac + if depmode=$depmode \ + source=sub/conftest.c object=$am__obj \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep $am__obj sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c89=$ac_arg + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c89" != xno; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 -$as_echo_n "checking whether $CC understands -c and -o together... " >&6; } -if ${am_cv_prog_cc_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +# By default we simply use the C compiler to build assembly code. -int -main () -{ +test "${CCAS+set}" = set || CCAS=$CC +test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS - ; - return 0; -} -_ACEOF - # Make sure it works both with $CC and with simple cc. - # Following AC_PROG_CC_C_O, we do the test twice because some - # compilers refuse to overwrite an existing .o file with -o, - # though they will create one. - am_cv_prog_cc_c_o=yes - for am_i in 1 2; do - if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 - ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } \ - && test -f conftest2.$ac_objext; then - : OK - else - am_cv_prog_cc_c_o=no - break - fi - done - rm -f core conftest* - unset am_i -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 -$as_echo "$am_cv_prog_cc_c_o" >&6; } -if test "$am_cv_prog_cc_c_o" != yes; then - # Losing compiler, so override with the script. - # FIXME: It is wrong to rewrite CC. - # But if we don't then we get into trouble of one sort or another. - # A longer-term fix would be to have automake use am__CC in this case, - # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" - CC="$am_aux_dir/compile $CC" -fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -depcc="$CC" am_compiler_list= +depcc="$CCAS" am_compiler_list= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CC_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 +printf %s "checking dependency style of $depcc... " >&6; } +if test ${am_cv_CCAS_dependencies_compiler_type+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For @@ -4264,14 +4999,12 @@ # directory. mkdir sub - am_cv_CC_dependencies_compiler_type=none + am_cv_CCAS_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false - case " $depcc " in #( - *\ -arch\ *\ -arch\ *) am__universal=true ;; - esac + for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers @@ -4337,7 +5070,7 @@ # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CC_dependencies_compiler_type=$depmode + am_cv_CCAS_dependencies_compiler_type=$depmode break fi fi @@ -4346,33 +5079,251 @@ cd .. rm -rf conftest.dir else - am_cv_CC_dependencies_compiler_type=none + am_cv_CCAS_dependencies_compiler_type=none fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } -CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 +printf "%s\n" "$am_cv_CCAS_dependencies_compiler_type" >&6; } +CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then - am__fastdepCC_TRUE= - am__fastdepCC_FALSE='#' + && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then + am__fastdepCCAS_TRUE= + am__fastdepCCAS_FALSE='#' else - am__fastdepCC_TRUE='#' - am__fastdepCC_FALSE= + am__fastdepCCAS_TRUE='#' + am__fastdepCCAS_FALSE= fi -if test "x$EMSCRIPTEN" != "x"; then : +ac_header= ac_cache= +for ac_item in $ac_header_c_list +do + if test $ac_cache; then + ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default" + if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then + printf "%s\n" "#define $ac_item 1" >> confdefs.h + fi + ac_header= ac_cache= + elif test $ac_header; then + ac_cache=$ac_item + else + ac_header=$ac_item + fi +done + - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -s ASSERTIONS=0" >&5 -$as_echo_n "checking whether C compiler accepts -s ASSERTIONS=0... " >&6; } -if ${ax_cv_check_cflags___s_ASSERTIONS_0+:} false; then : - $as_echo_n "(cached) " >&6 -else + + + + + + +if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes +then : + +printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h + +fi + + + + + + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test ${ac_cv_safe_to_define___extensions__+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_safe_to_define___extensions__=yes +else $as_nop + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5 +printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } +if test ${ac_cv_should_define__xopen_source+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_cv_should_define__xopen_source=no + if test $ac_cv_header_wchar_h = yes +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #define _XOPEN_SOURCE 500 + #include + mbstate_t x; +int +main (void) +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + ac_cv_should_define__xopen_source=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 +printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } + + printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h + + printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h + + printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h + + printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h + + if test $ac_cv_header_minix_config_h = yes +then : + MINIX=yes + printf "%s\n" "#define _MINIX 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h + + printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h + +else $as_nop + MINIX= +fi + if test $ac_cv_safe_to_define___extensions__ = yes +then : + printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h + +fi + if test $ac_cv_should_define__xopen_source = yes +then : + printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h + +fi + + + +# Check whether --enable-ssp was given. +if test ${enable_ssp+y} +then : + enableval=$enable_ssp; + if test "x$enableval" = "xno" +then : + + enable_ssp="no" + +else $as_nop + + enable_ssp="yes" + +fi + +else $as_nop + + enable_ssp="yes" + +fi + + +# Check whether --enable-asm was given. +if test ${enable_asm+y} +then : + enableval=$enable_asm; + if test "x$enableval" = "xno" +then : + + enable_asm="no" + +else $as_nop + + enable_asm="yes" + +fi + +else $as_nop + + enable_asm="yes" + +fi + + +if test "x$EMSCRIPTEN" != "x" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -s ASSERTIONS=0" >&5 +printf %s "checking whether C compiler accepts -s ASSERTIONS=0... " >&6; } +if test ${ax_cv_check_cflags___s_ASSERTIONS_0+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -s ASSERTIONS=0" @@ -4380,34 +5331,37 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___s_ASSERTIONS_0=yes -else +else $as_nop ax_cv_check_cflags___s_ASSERTIONS_0=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___s_ASSERTIONS_0" >&5 -$as_echo "$ax_cv_check_cflags___s_ASSERTIONS_0" >&6; } -if test "x$ax_cv_check_cflags___s_ASSERTIONS_0" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___s_ASSERTIONS_0" >&5 +printf "%s\n" "$ax_cv_check_cflags___s_ASSERTIONS_0" >&6; } +if test "x$ax_cv_check_cflags___s_ASSERTIONS_0" = xyes +then : enable_asm="no" - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: compiling to JavaScript - asm implementations disabled" >&5 -$as_echo "$as_me: WARNING: compiling to JavaScript - asm implementations disabled" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: compiling to JavaScript - asm implementations disabled" >&5 +printf "%s\n" "$as_me: WARNING: compiling to JavaScript - asm implementations disabled" >&2;} -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&5 -$as_echo "$as_me: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&5 +printf "%s\n" "$as_me: WARNING: EMSCRIPTEN environment variable defined, but emcc doesn't appear to be used - Assuming compilation to native code" >&2;} CFLAGS="$CFLAGS -U__EMSCRIPTEN__" unset EMSCRIPTEN @@ -4417,27 +5371,30 @@ fi # Check whether --enable-pie was given. -if test "${enable_pie+set}" = set; then : +if test ${enable_pie+y} +then : enableval=$enable_pie; enable_pie=$enableval -else +else $as_nop enable_pie="maybe" fi case $host_os in #( - mingw*|cygwin*|msys) : + mingw*|cygwin*|msys|eabi*) : enable_pie="no" ;; #( *) : ;; esac # Check whether --enable-blocking-random was given. -if test "${enable_blocking_random+set}" = set; then : +if test ${enable_blocking_random+y} +then : enableval=$enable_blocking_random; - if test "x$enableval" = "xyes"; then : + if test "x$enableval" = "xyes" +then : -$as_echo "#define USE_BLOCKING_RANDOM 1" >>confdefs.h +printf "%s\n" "#define USE_BLOCKING_RANDOM 1" >>confdefs.h fi @@ -4446,23 +5403,25 @@ # Check whether --enable-minimal was given. -if test "${enable_minimal+set}" = set; then : +if test ${enable_minimal+y} +then : enableval=$enable_minimal; - if test "x$enableval" = "xyes"; then : + if test "x$enableval" = "xyes" +then : enable_minimal="yes" SODIUM_LIBRARY_MINIMAL_DEF="#define SODIUM_LIBRARY_MINIMAL 1" -$as_echo "#define MINIMAL 1" >>confdefs.h +printf "%s\n" "#define MINIMAL 1" >>confdefs.h -else +else $as_nop enable_minimal="no" fi -else +else $as_nop enable_minimal="no" @@ -4480,18 +5439,20 @@ # Check whether --with-pthreads was given. -if test "${with_pthreads+set}" = set; then : +if test ${with_pthreads+y} +then : withval=$with_pthreads; -else +else $as_nop withval="yes" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -4505,10 +5466,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -4517,13 +5483,13 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4551,8 +5517,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -4561,40 +5527,36 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if ${ac_cv_prog_CPP+:} false; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else $as_nop + # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -4606,10 +5568,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4619,7 +5582,8 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : break fi @@ -4631,29 +5595,24 @@ else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif +#include Syntax error _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : -else +else $as_nop # Broken: fails on valid input. continue fi @@ -4665,10 +5624,11 @@ /* end confdefs.h. */ #include _ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : +if ac_fn_c_try_cpp "$LINENO" +then : # Broken: success on invalid input. continue -else +else $as_nop # Passes both tests. ac_preproc_ok=: break @@ -4678,11 +5638,12 @@ done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : +if $ac_preproc_ok +then : -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +else $as_nop + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi @@ -4694,11 +5655,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if ${ac_cv_path_GREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +printf %s "checking for grep that handles long lines and -e... " >&6; } +if test ${ac_cv_path_GREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST @@ -4706,10 +5668,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP @@ -4718,13 +5685,13 @@ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + printf "%s\n" 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4752,16 +5719,17 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +printf "%s\n" "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if ${ac_cv_path_EGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +printf %s "checking for egrep... " >&6; } +if test ${ac_cv_path_EGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else @@ -4772,10 +5740,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP @@ -4784,13 +5757,13 @@ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + printf "%s\n" 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -4819,12 +5792,13 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -if test "x$withval" = "xyes"; then : +if test "x$withval" = "xyes" +then : @@ -4849,38 +5823,41 @@ ax_pthread_save_CC="$CC" ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" - if test "x$PTHREAD_CC" != "x"; then : + if test "x$PTHREAD_CC" != "x" +then : CC="$PTHREAD_CC" fi + if test "x$PTHREAD_CXX" != "x" +then : + CXX="$PTHREAD_CXX" +fi CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 -$as_echo_n "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS" >&5 +printf %s "checking for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char pthread_join (); int -main () +main (void) { return pthread_join (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } if test "x$ax_pthread_ok" = "xno"; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" @@ -4895,10 +5872,12 @@ # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" @@ -4922,7 +5901,7 @@ # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case $host_os in +case $target_os in freebsd*) @@ -4956,11 +5935,12 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 -$as_echo "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} + $EGREP "AX_PTHREAD_ZOS_MISSING" >/dev/null 2>&1 +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&5 +printf "%s\n" "$as_me: WARNING: IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support." >&2;} fi -rm -f conftest* +rm -rf conftest* ;; @@ -4974,46 +5954,18 @@ # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). - ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" - ;; -esac - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -if test "x$GCC" = "xyes"; then : - ax_pthread_flags="-pthread -pthreads $ax_pthread_flags" -fi - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac -if test "x$ax_pthread_check_macro" = "x--"; then : - ax_pthread_check_cond=0 -else - ax_pthread_check_cond="!defined($ax_pthread_check_macro)" -fi # Are we compiling with Clang? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 -$as_echo_n "checking whether $CC is Clang... " >&6; } -if ${ax_cv_PTHREAD_CLANG+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC is Clang" >&5 +printf %s "checking whether $CC is Clang... " >&6; } +if test ${ax_cv_PTHREAD_CLANG+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_CLANG=no # Note that Autoconf sets GCC=yes for Clang as well as GCC if test "x$GCC" = "xyes"; then @@ -5026,150 +5978,99 @@ _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1; then : + $EGREP "AX_PTHREAD_CC_IS_CLANG" >/dev/null 2>&1 +then : ax_cv_PTHREAD_CLANG=yes fi -rm -f conftest* +rm -rf conftest* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 -$as_echo "$ax_cv_PTHREAD_CLANG" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG" >&6; } ax_pthread_clang="$ax_cv_PTHREAD_CLANG" -ax_pthread_clang_warning=no - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) +# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - PTHREAD_CFLAGS="-pthread" - PTHREAD_LIBS= +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + +if test "x$GCC" = "xyes" +then : + ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags" +fi + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +if test "x$ax_pthread_clang" = "xyes" +then : + ax_pthread_flags="-pthread,-lpthread -pthread" +fi - ax_pthread_ok=yes - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. +# The presence of a feature test macro requesting re-entrant function +# definitions is, on some systems, a strong hint that pthreads support is +# correctly enabled - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 -$as_echo_n "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } -if ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+:} false; then : - $as_echo_n "(cached) " >&6 -else - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - if test "x$ax_pthread_try" = "xunknown"; then : - break -fi - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_link="$ax_pthread_2step_ac_link" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int main(void){return 0;} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - break -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext +case $target_os in + darwin* | hpux* | linux* | osf* | solaris*) + ax_pthread_check_macro="_REENTRANT" + ;; -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - if test "x$ax_pthread_try" = "x"; then : - ax_pthread_try=no -fi - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + aix*) + ax_pthread_check_macro="_THREAD_SAFE" + ;; + *) + ax_pthread_check_macro="--" + ;; +esac +if test "x$ax_pthread_check_macro" = "x--" +then : + ax_pthread_check_cond=0 +else $as_nop + ax_pthread_check_cond="!defined($ax_pthread_check_macro)" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 -$as_echo "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac -fi # $ax_pthread_clang = yes if test "x$ax_pthread_ok" = "xno"; then for ax_pthread_try_flag in $ax_pthread_flags; do case $ax_pthread_try_flag in none) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 -$as_echo_n "checking whether pthreads work without any flags... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5 +printf %s "checking whether pthreads work without any flags... " >&6; } ;; - -mt,pthread) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with -mt -lpthread" >&5 -$as_echo_n "checking whether pthreads work with -mt -lpthread... " >&6; } - PTHREAD_CFLAGS="-mt" - PTHREAD_LIBS="-lpthread" + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"" >&5 +printf %s "checking whether pthreads work with \"$PTHREAD_CFLAGS\" and \"$PTHREAD_LIBS\"... " >&6; } ;; -*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 -$as_echo_n "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $ax_pthread_try_flag" >&5 +printf %s "checking whether pthreads work with $ax_pthread_try_flag... " >&6; } PTHREAD_CFLAGS="$ax_pthread_try_flag" ;; pthread-config) # Extract the first word of "pthread-config", so it can be a program name with args. set dummy pthread-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ax_pthread_config+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ax_pthread_config+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ax_pthread_config"; then ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test. else @@ -5177,11 +6078,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ax_pthread_config="yes" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5193,15 +6098,16 @@ fi ax_pthread_config=$ac_cv_prog_ax_pthread_config if test -n "$ax_pthread_config"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 -$as_echo "$ax_pthread_config" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5 +printf "%s\n" "$ax_pthread_config" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - if test "x$ax_pthread_config" = "xno"; then : + if test "x$ax_pthread_config" = "xno" +then : continue fi PTHREAD_CFLAGS="`pthread-config --cflags`" @@ -5209,8 +6115,8 @@ ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 -$as_echo_n "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$ax_pthread_try_flag" >&5 +printf %s "checking for the pthreads library -l$ax_pthread_try_flag... " >&6; } PTHREAD_LIBS="-l$ax_pthread_try_flag" ;; esac @@ -5236,10 +6142,16 @@ # if $ax_pthread_check_cond # error "$ax_pthread_check_macro must be defined" # endif - static void routine(void *a) { a = 0; } + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } static void *start_routine(void *a) { return a; } int -main () +main (void) { pthread_t th; pthread_attr_t attr; pthread_create(&th, 0, start_routine, 0); @@ -5251,18 +6163,20 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_pthread_ok=yes fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$ax_pthread_save_CFLAGS" LIBS="$ax_pthread_save_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 -$as_echo "$ax_pthread_ok" >&6; } - if test "x$ax_pthread_ok" = "xyes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5 +printf "%s\n" "$ax_pthread_ok" >&6; } + if test "x$ax_pthread_ok" = "xyes" +then : break fi @@ -5271,6 +6185,109 @@ done fi + +# Clang needs special handling, because older versions handle the -pthread +# option in a rather... idiosyncratic way + +if test "x$ax_pthread_clang" = "xyes"; then + + # Clang takes -pthread; it has never supported any other flag + + # (Note 1: This will need to be revisited if a system that Clang + # supports has POSIX threads in a separate library. This tends not + # to be the way of modern systems, but it's conceivable.) + + # (Note 2: On some systems, notably Darwin, -pthread is not needed + # to get POSIX threads support; the API is always present and + # active. We could reasonably leave PTHREAD_CFLAGS empty. But + # -pthread does define _REENTRANT, and while the Darwin headers + # ignore this macro, third-party headers might not.) + + # However, older versions of Clang make a point of warning the user + # that, in an invocation where only linking and no compilation is + # taking place, the -pthread option has no effect ("argument unused + # during compilation"). They expect -pthread to be passed in only + # when source code is being compiled. + # + # Problem is, this is at odds with the way Automake and most other + # C build frameworks function, which is that the same flags used in + # compilation (CFLAGS) are also used in linking. Many systems + # supported by AX_PTHREAD require exactly this for POSIX threads + # support, and in fact it is often not straightforward to specify a + # flag that is used only in the compilation phase and not in + # linking. Such a scenario is extremely rare in practice. + # + # Even though use of the -pthread flag in linking would only print + # a warning, this can be a nuisance for well-run software projects + # that build with -Werror. So if the active version of Clang has + # this misfeature, we search for an option to squash it. + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread" >&5 +printf %s "checking whether Clang needs flag to prevent \"argument unused\" warning when linking with -pthread... " >&6; } +if test ${ax_cv_PTHREAD_CLANG_NO_WARN_FLAG+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown + # Create an alternate version of $ac_link that compiles and + # links in two steps (.c -> .o, .o -> exe) instead of one + # (.c -> exe), because the warning occurs only in the second + # step + ax_pthread_save_ac_link="$ac_link" + ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' + ax_pthread_link_step=`printf "%s\n" "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" + ax_pthread_save_CFLAGS="$CFLAGS" + for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do + if test "x$ax_pthread_try" = "xunknown" +then : + break +fi + CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" + ac_link="$ax_pthread_save_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_link="$ax_pthread_2step_ac_link" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(void){return 0;} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + break +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + done + ac_link="$ax_pthread_save_ac_link" + CFLAGS="$ax_pthread_save_CFLAGS" + if test "x$ax_pthread_try" = "x" +then : + ax_pthread_try=no +fi + ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" + +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&5 +printf "%s\n" "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" >&6; } + + case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in + no | unknown) ;; + *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; + esac + +fi # $ax_pthread_clang = yes + + + # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then ax_pthread_save_CFLAGS="$CFLAGS" @@ -5279,98 +6296,105 @@ LIBS="$PTHREAD_LIBS $LIBS" # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 -$as_echo_n "checking for joinable pthread attribute... " >&6; } -if ${ax_cv_PTHREAD_JOINABLE_ATTR+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5 +printf %s "checking for joinable pthread attribute... " >&6; } +if test ${ax_cv_PTHREAD_JOINABLE_ATTR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_JOINABLE_ATTR=unknown for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int attr = $ax_pthread_attr; return attr /* ; */ ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 -$as_echo "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_JOINABLE_ATTR" >&5 +printf "%s\n" "$ax_cv_PTHREAD_JOINABLE_ATTR" >&6; } if test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"; then : + test "x$ax_pthread_joinable_attr_defined" != "xyes" +then : -cat >>confdefs.h <<_ACEOF -#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR -_ACEOF +printf "%s\n" "#define PTHREAD_CREATE_JOINABLE $ax_cv_PTHREAD_JOINABLE_ATTR" >>confdefs.h ax_pthread_joinable_attr_defined=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 -$as_echo_n "checking whether more special flags are required for pthreads... " >&6; } -if ${ax_cv_PTHREAD_SPECIAL_FLAGS+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether more special flags are required for pthreads" >&5 +printf %s "checking whether more special flags are required for pthreads... " >&6; } +if test ${ax_cv_PTHREAD_SPECIAL_FLAGS+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in + case $target_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 -$as_echo "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_SPECIAL_FLAGS" >&5 +printf "%s\n" "$ax_cv_PTHREAD_SPECIAL_FLAGS" >&6; } if test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"; then : + test "x$ax_pthread_special_flags_added" != "xyes" +then : PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" ax_pthread_special_flags_added=yes fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 -$as_echo_n "checking for PTHREAD_PRIO_INHERIT... " >&6; } -if ${ax_cv_PTHREAD_PRIO_INHERIT+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PRIO_INHERIT" >&5 +printf %s "checking for PTHREAD_PRIO_INHERIT... " >&6; } +if test ${ax_cv_PTHREAD_PRIO_INHERIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { int i = PTHREAD_PRIO_INHERIT; + return i; ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_PTHREAD_PRIO_INHERIT=yes -else +else $as_nop ax_cv_PTHREAD_PRIO_INHERIT=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 -$as_echo "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_PTHREAD_PRIO_INHERIT" >&5 +printf "%s\n" "$ax_cv_PTHREAD_PRIO_INHERIT" >&6; } if test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"; then : + test "x$ax_pthread_prio_inherit_defined" != "xyes" +then : -$as_echo "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD_PRIO_INHERIT 1" >>confdefs.h ax_pthread_prio_inherit_defined=yes @@ -5381,26 +6405,38 @@ # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then - case $host_os in + case $target_os in aix*) case "x/$CC" in #( x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6) : #handle absolute path differently from PATH based program lookup case "x$CC" in #( x/*) : - if as_fn_executable_p ${CC}_r; then : + + if as_fn_executable_p ${CC}_r +then : PTHREAD_CC="${CC}_r" -fi ;; #( +fi + if test "x${CXX}" != "x" +then : + if as_fn_executable_p ${CXX}_r +then : + PTHREAD_CXX="${CXX}_r" +fi +fi + ;; #( *) : - for ac_prog in ${CC}_r + + for ac_prog in ${CC}_r do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_PTHREAD_CC+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CC+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$PTHREAD_CC"; then ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. else @@ -5408,11 +6444,65 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 +printf "%s\n" "$PTHREAD_CC" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" + + if test "x${CXX}" != "x" +then : + for ac_prog in ${CXX}_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_PTHREAD_CXX+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$PTHREAD_CXX"; then + ac_cv_prog_PTHREAD_CXX="$PTHREAD_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_PTHREAD_CC="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_PTHREAD_CXX="$ac_prog" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5421,21 +6511,25 @@ fi fi -PTHREAD_CC=$ac_cv_prog_PTHREAD_CC -if test -n "$PTHREAD_CC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5 -$as_echo "$PTHREAD_CC" >&6; } +PTHREAD_CXX=$ac_cv_prog_PTHREAD_CXX +if test -n "$PTHREAD_CXX"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CXX" >&5 +printf "%s\n" "$PTHREAD_CXX" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi - test -n "$PTHREAD_CC" && break + test -n "$PTHREAD_CXX" && break done -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" - ;; -esac ;; #( +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + +fi + + ;; +esac + ;; #( *) : ;; esac @@ -5445,6 +6539,8 @@ fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" + @@ -5459,7 +6555,7 @@ #include int -main () +main (void) { pthread_mutex_t mutex; @@ -5472,10 +6568,11 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : -$as_echo "#define HAVE_PTHREAD 1" >>confdefs.h +printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h with_threads="yes" LIBS="$PTHREAD_LIBS $LIBS" @@ -5484,14 +6581,14 @@ CC="$PTHREAD_CC" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext : else ax_pthread_ok=no - { $as_echo "$as_me:${as_lineno-$LINENO}: pthread mutexes are not available" >&5 -$as_echo "$as_me: pthread mutexes are not available" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: pthread mutexes are not available" >&5 +printf "%s\n" "$as_me: pthread mutexes are not available" >&6;} fi ac_ext=c @@ -5502,14 +6599,16 @@ -else +else $as_nop with_threads="no" fi # Check whether --with-safecode was given. -if test "${with_safecode+set}" = set; then : - withval=$with_safecode; if test "x$withval" = "xyes"; then : +if test ${with_safecode+y} +then : + withval=$with_safecode; if test "x$withval" = "xyes" +then : : ${SAFECODE_HOME:=/opt/safecode} @@ -5524,14 +6623,17 @@ # Check whether --with-ctgrind was given. -if test "${with_ctgrind+set}" = set; then : - withval=$with_ctgrind; if test "x$withval" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ct_poison in -lctgrind" >&5 -$as_echo_n "checking for ct_poison in -lctgrind... " >&6; } -if ${ac_cv_lib_ctgrind_ct_poison+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${with_ctgrind+y} +then : + withval=$with_ctgrind; if test "x$withval" = "xyes" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ct_poison in -lctgrind" >&5 +printf %s "checking for ct_poison in -lctgrind... " >&6; } +if test ${ac_cv_lib_ctgrind_ct_poison+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lctgrind $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5540,33 +6642,30 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char ct_poison (); int -main () +main (void) { return ct_poison (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_ctgrind_ct_poison=yes -else +else $as_nop ac_cv_lib_ctgrind_ct_poison=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ctgrind_ct_poison" >&5 -$as_echo "$ac_cv_lib_ctgrind_ct_poison" >&6; } -if test "x$ac_cv_lib_ctgrind_ct_poison" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBCTGRIND 1 -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ctgrind_ct_poison" >&5 +printf "%s\n" "$ac_cv_lib_ctgrind_ct_poison" >&6; } +if test "x$ac_cv_lib_ctgrind_ct_poison" = xyes +then : + printf "%s\n" "#define HAVE_LIBCTGRIND 1" >>confdefs.h LIBS="-lctgrind $LIBS" @@ -5579,14 +6678,17 @@ # Check whether --enable-retpoline was given. -if test "${enable_retpoline+set}" = set; then : - enableval=$enable_retpoline; if test "x$enableval" = "xyes"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk-inline" >&5 -$as_echo_n "checking whether C compiler accepts -mindirect-branch=thunk-inline... " >&6; } -if ${ax_cv_check_cflags___mindirect_branch_thunk_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${enable_retpoline+y} +then : + enableval=$enable_retpoline; if test "x$enableval" = "xyes" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch=thunk-inline" >&5 +printf %s "checking whether C compiler accepts -mindirect-branch=thunk-inline... " >&6; } +if test ${ax_cv_check_cflags___mindirect_branch_thunk_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mindirect-branch=thunk-inline" @@ -5594,32 +6696,36 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mindirect_branch_thunk_inline=yes -else +else $as_nop ax_cv_check_cflags___mindirect_branch_thunk_inline=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_thunk_inline" >&5 -$as_echo "$ax_cv_check_cflags___mindirect_branch_thunk_inline" >&6; } -if test "x$ax_cv_check_cflags___mindirect_branch_thunk_inline" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_thunk_inline" >&5 +printf "%s\n" "$ax_cv_check_cflags___mindirect_branch_thunk_inline" >&6; } +if test "x$ax_cv_check_cflags___mindirect_branch_thunk_inline" = xyes +then : CFLAGS="$CFLAGS -mindirect-branch=thunk-inline" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mretpoline" >&5 -$as_echo_n "checking whether C compiler accepts -mretpoline... " >&6; } -if ${ax_cv_check_cflags___mretpoline+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mretpoline" >&5 +printf %s "checking whether C compiler accepts -mretpoline... " >&6; } +if test ${ax_cv_check_cflags___mretpoline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mretpoline" @@ -5627,38 +6733,42 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mretpoline=yes -else +else $as_nop ax_cv_check_cflags___mretpoline=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mretpoline" >&5 -$as_echo "$ax_cv_check_cflags___mretpoline" >&6; } -if test "x$ax_cv_check_cflags___mretpoline" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mretpoline" >&5 +printf "%s\n" "$ax_cv_check_cflags___mretpoline" >&6; } +if test "x$ax_cv_check_cflags___mretpoline" = xyes +then : CFLAGS="$CFLAGS -mretpoline" -else +else $as_nop : fi fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch-register" >&5 -$as_echo_n "checking whether C compiler accepts -mindirect-branch-register... " >&6; } -if ${ax_cv_check_cflags___mindirect_branch_register+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mindirect-branch-register" >&5 +printf %s "checking whether C compiler accepts -mindirect-branch-register... " >&6; } +if test ${ax_cv_check_cflags___mindirect_branch_register+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mindirect-branch-register" @@ -5666,27 +6776,30 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mindirect_branch_register=yes -else +else $as_nop ax_cv_check_cflags___mindirect_branch_register=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_register" >&5 -$as_echo "$ax_cv_check_cflags___mindirect_branch_register" >&6; } -if test "x$ax_cv_check_cflags___mindirect_branch_register" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mindirect_branch_register" >&5 +printf "%s\n" "$ax_cv_check_cflags___mindirect_branch_register" >&6; } +if test "x$ax_cv_check_cflags___mindirect_branch_register" = xyes +then : : -else +else $as_nop : fi @@ -5698,11 +6811,14 @@ ENABLE_CWFLAGS=no # Check whether --enable-debug was given. -if test "${enable_debug+set}" = set; then : +if test ${enable_debug+y} +then : enableval=$enable_debug; - if test "x$enableval" = "xyes"; then : + if test "x$enableval" = "xyes" +then : - if test "x$LX_CFLAGS" = "xNONE"; then : + if test "x$LX_CFLAGS" = "xNONE" +then : nxflags="" for flag in `echo $CFLAGS`; do @@ -5729,15 +6845,18 @@ # Check whether --enable-opt was given. -if test "${enable_opt+set}" = set; then : +if test ${enable_opt+y} +then : enableval=$enable_opt; - if test "x$enableval" = "xyes"; then : + if test "x$enableval" = "xyes" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Ofast" >&5 -$as_echo_n "checking whether C compiler accepts -Ofast... " >&6; } -if ${ax_cv_check_cflags___Ofast+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -Ofast" >&5 +printf %s "checking whether C compiler accepts -Ofast... " >&6; } +if test ${ax_cv_check_cflags___Ofast+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -Ofast" @@ -5745,35 +6864,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___Ofast=yes -else +else $as_nop ax_cv_check_cflags___Ofast=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Ofast" >&5 -$as_echo "$ax_cv_check_cflags___Ofast" >&6; } -if test "x$ax_cv_check_cflags___Ofast" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___Ofast" >&5 +printf "%s\n" "$ax_cv_check_cflags___Ofast" >&6; } +if test "x$ax_cv_check_cflags___Ofast" = xyes +then : CFLAGS="$CFLAGS -Ofast" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-vectorize" >&5 -$as_echo_n "checking whether C compiler accepts -ftree-vectorize... " >&6; } -if ${ax_cv_check_cflags___ftree_vectorize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-vectorize" >&5 +printf %s "checking whether C compiler accepts -ftree-vectorize... " >&6; } +if test ${ax_cv_check_cflags___ftree_vectorize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ftree-vectorize" @@ -5781,35 +6904,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___ftree_vectorize=yes -else +else $as_nop ax_cv_check_cflags___ftree_vectorize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_vectorize" >&5 -$as_echo "$ax_cv_check_cflags___ftree_vectorize" >&6; } -if test "x$ax_cv_check_cflags___ftree_vectorize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_vectorize" >&5 +printf "%s\n" "$ax_cv_check_cflags___ftree_vectorize" >&6; } +if test "x$ax_cv_check_cflags___ftree_vectorize" = xyes +then : CFLAGS="$CFLAGS -ftree-vectorize" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-slp-vectorize" >&5 -$as_echo_n "checking whether C compiler accepts -ftree-slp-vectorize... " >&6; } -if ${ax_cv_check_cflags___ftree_slp_vectorize+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftree-slp-vectorize" >&5 +printf %s "checking whether C compiler accepts -ftree-slp-vectorize... " >&6; } +if test ${ax_cv_check_cflags___ftree_slp_vectorize+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ftree-slp-vectorize" @@ -5817,35 +6944,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___ftree_slp_vectorize=yes -else +else $as_nop ax_cv_check_cflags___ftree_slp_vectorize=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_slp_vectorize" >&5 -$as_echo "$ax_cv_check_cflags___ftree_slp_vectorize" >&6; } -if test "x$ax_cv_check_cflags___ftree_slp_vectorize" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftree_slp_vectorize" >&5 +printf "%s\n" "$ax_cv_check_cflags___ftree_slp_vectorize" >&6; } +if test "x$ax_cv_check_cflags___ftree_slp_vectorize" = xyes +then : CFLAGS="$CFLAGS -ftree-slp-vectorize" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fomit-frame-pointer" >&5 -$as_echo_n "checking whether C compiler accepts -fomit-frame-pointer... " >&6; } -if ${ax_cv_check_cflags___fomit_frame_pointer+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fomit-frame-pointer" >&5 +printf %s "checking whether C compiler accepts -fomit-frame-pointer... " >&6; } +if test ${ax_cv_check_cflags___fomit_frame_pointer+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fomit-frame-pointer" @@ -5853,35 +6984,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fomit_frame_pointer=yes -else +else $as_nop ax_cv_check_cflags___fomit_frame_pointer=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fomit_frame_pointer" >&5 -$as_echo "$ax_cv_check_cflags___fomit_frame_pointer" >&6; } -if test "x$ax_cv_check_cflags___fomit_frame_pointer" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fomit_frame_pointer" >&5 +printf "%s\n" "$ax_cv_check_cflags___fomit_frame_pointer" >&6; } +if test "x$ax_cv_check_cflags___fomit_frame_pointer" = xyes +then : CFLAGS="$CFLAGS -fomit-frame-pointer" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -march=native" >&5 -$as_echo_n "checking whether C compiler accepts -march=native... " >&6; } -if ${ax_cv_check_cflags___march_native+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -march=native" >&5 +printf %s "checking whether C compiler accepts -march=native... " >&6; } +if test ${ax_cv_check_cflags___march_native+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -march=native" @@ -5889,27 +7024,30 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___march_native=yes -else +else $as_nop ax_cv_check_cflags___march_native=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___march_native" >&5 -$as_echo "$ax_cv_check_cflags___march_native" >&6; } -if test "x$ax_cv_check_cflags___march_native" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___march_native" >&5 +printf "%s\n" "$ax_cv_check_cflags___march_native" >&6; } +if test "x$ax_cv_check_cflags___march_native" = xyes +then : CFLAGS="$CFLAGS -march=native" -else +else $as_nop : fi @@ -5923,961 +7061,554 @@ - # Check whether --enable-valgrind was given. -if test "${enable_valgrind+set}" = set; then : - enableval=$enable_valgrind; enable_valgrind=$enableval -else - enable_valgrind=no -fi - - - if test "$enable_valgrind" != "no"; then : - - # Check for Valgrind. - # Extract the first word of "valgrind", so it can be a program name with args. -set dummy valgrind; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_VALGRIND+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$VALGRIND"; then - ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_VALGRIND="valgrind" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -VALGRIND=$ac_cv_prog_VALGRIND -if test -n "$VALGRIND"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 -$as_echo "$VALGRIND" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - - if test "$VALGRIND" = ""; then : - - if test "$enable_valgrind" = "yes"; then : - - as_fn_error $? "Could not find valgrind; either install it or reconfigure with --disable-valgrind" "$LINENO" 5 - -else - - enable_valgrind=no - -fi - -else - - enable_valgrind=yes - -fi - -fi - - if test "$enable_valgrind" = "yes"; then - VALGRIND_ENABLED_TRUE= - VALGRIND_ENABLED_FALSE='#' -else - VALGRIND_ENABLED_TRUE='#' - VALGRIND_ENABLED_FALSE= -fi - - VALGRIND_ENABLED=$enable_valgrind - - - # Check for Valgrind tools we care about. - valgrind_enabled_tools= - - # Check whether --enable-valgrind-memcheck was given. -if test "${enable_valgrind_memcheck+set}" = set; then : - enableval=$enable_valgrind_memcheck; enable_valgrind_memcheck=$enableval -else - enable_valgrind_memcheck= -fi - - if test "$enable_valgrind" = "no"; then : - - enable_valgrind_memcheck=no -elif test "$enable_valgrind_memcheck" != "no"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool memcheck" >&5 -$as_echo_n "checking for Valgrind tool memcheck... " >&6; } -if ${ax_cv_valgrind_tool_memcheck+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_valgrind_tool_memcheck=no - - if `$VALGRIND --tool=memcheck --help >/dev/null 2>&1`; then : - - ax_cv_valgrind_tool_memcheck=yes - -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_memcheck" >&5 -$as_echo "$ax_cv_valgrind_tool_memcheck" >&6; } - if test "$ax_cv_valgrind_tool_memcheck" = "no"; then : - - if test "$enable_valgrind_memcheck" = "yes"; then : - - as_fn_error $? "Valgrind does not support memcheck; reconfigure with --disable-valgrind-memcheck" "$LINENO" 5 - -else - - enable_valgrind_memcheck=no - -fi - -else - - enable_valgrind_memcheck=yes - -fi - -fi - if test "$enable_valgrind_memcheck" = "yes"; then : - - valgrind_enabled_tools="$valgrind_enabled_tools memcheck" - -fi - ENABLE_VALGRIND_memcheck=$enable_valgrind_memcheck - - - # Check whether --enable-valgrind-helgrind was given. -if test "${enable_valgrind_helgrind+set}" = set; then : - enableval=$enable_valgrind_helgrind; enable_valgrind_helgrind=$enableval -else - enable_valgrind_helgrind= -fi - - if test "$enable_valgrind" = "no"; then : - - enable_valgrind_helgrind=no -elif test "$enable_valgrind_helgrind" != "no"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool helgrind" >&5 -$as_echo_n "checking for Valgrind tool helgrind... " >&6; } -if ${ax_cv_valgrind_tool_helgrind+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_valgrind_tool_helgrind=no - - if `$VALGRIND --tool=helgrind --help >/dev/null 2>&1`; then : - - ax_cv_valgrind_tool_helgrind=yes - -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_helgrind" >&5 -$as_echo "$ax_cv_valgrind_tool_helgrind" >&6; } - if test "$ax_cv_valgrind_tool_helgrind" = "no"; then : - - if test "$enable_valgrind_helgrind" = "yes"; then : - - as_fn_error $? "Valgrind does not support helgrind; reconfigure with --disable-valgrind-helgrind" "$LINENO" 5 - -else - - enable_valgrind_helgrind=no - -fi - -else - - enable_valgrind_helgrind=yes - -fi - -fi - if test "$enable_valgrind_helgrind" = "yes"; then : - - valgrind_enabled_tools="$valgrind_enabled_tools helgrind" - -fi - ENABLE_VALGRIND_helgrind=$enable_valgrind_helgrind - - - # Check whether --enable-valgrind-drd was given. -if test "${enable_valgrind_drd+set}" = set; then : - enableval=$enable_valgrind_drd; enable_valgrind_drd=$enableval -else - enable_valgrind_drd= -fi - - if test "$enable_valgrind" = "no"; then : - - enable_valgrind_drd=no -elif test "$enable_valgrind_drd" != "no"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool drd" >&5 -$as_echo_n "checking for Valgrind tool drd... " >&6; } -if ${ax_cv_valgrind_tool_drd+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_valgrind_tool_drd=no - - if `$VALGRIND --tool=drd --help >/dev/null 2>&1`; then : - - ax_cv_valgrind_tool_drd=yes - -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_drd" >&5 -$as_echo "$ax_cv_valgrind_tool_drd" >&6; } - if test "$ax_cv_valgrind_tool_drd" = "no"; then : - - if test "$enable_valgrind_drd" = "yes"; then : - - as_fn_error $? "Valgrind does not support drd; reconfigure with --disable-valgrind-drd" "$LINENO" 5 - -else - - enable_valgrind_drd=no - -fi - -else - - enable_valgrind_drd=yes - -fi - -fi - if test "$enable_valgrind_drd" = "yes"; then : - - valgrind_enabled_tools="$valgrind_enabled_tools drd" - -fi - ENABLE_VALGRIND_drd=$enable_valgrind_drd - - - # Check whether --enable-valgrind-sgcheck was given. -if test "${enable_valgrind_sgcheck+set}" = set; then : - enableval=$enable_valgrind_sgcheck; enable_valgrind_sgcheck=$enableval -else - enable_valgrind_sgcheck= -fi - - if test "$enable_valgrind" = "no"; then : - - enable_valgrind_sgcheck=no -elif test "$enable_valgrind_sgcheck" != "no"; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool sgcheck" >&5 -$as_echo_n "checking for Valgrind tool sgcheck... " >&6; } -if ${ax_cv_valgrind_tool_sgcheck+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_valgrind_tool_sgcheck=no - - if `$VALGRIND --tool=exp-sgcheck --help >/dev/null 2>&1`; then : - - ax_cv_valgrind_tool_sgcheck=yes - -fi - + # Check whether --enable-valgrind was given. +if test ${enable_valgrind+y} +then : + enableval=$enable_valgrind; enable_valgrind=$enableval +else $as_nop + enable_valgrind=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_sgcheck" >&5 -$as_echo "$ax_cv_valgrind_tool_sgcheck" >&6; } - if test "$ax_cv_valgrind_tool_sgcheck" = "no"; then : - if test "$enable_valgrind_sgcheck" = "yes"; then : - as_fn_error $? "Valgrind does not support sgcheck; reconfigure with --disable-valgrind-sgcheck" "$LINENO" 5 + if test "$enable_valgrind" != "no" +then : + # Check for Valgrind. + # Extract the first word of "valgrind", so it can be a program name with args. +set dummy valgrind; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_VALGRIND+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test -n "$VALGRIND"; then + ac_cv_prog_VALGRIND="$VALGRIND" # Let the user override the test. else - - enable_valgrind_sgcheck=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_prog_VALGRIND="valgrind" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS fi - +fi +VALGRIND=$ac_cv_prog_VALGRIND +if test -n "$VALGRIND"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VALGRIND" >&5 +printf "%s\n" "$VALGRIND" >&6; } else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi - enable_valgrind_sgcheck=yes -fi + if test "$VALGRIND" = "" +then : -fi - if test "$enable_valgrind_sgcheck" = "yes"; then : + if test "$enable_valgrind" = "yes" +then : - valgrind_enabled_tools="$valgrind_enabled_tools sgcheck" + as_fn_error $? "Could not find valgrind; either install it or reconfigure with --disable-valgrind" "$LINENO" 5 + +else $as_nop + + enable_valgrind=no fi - ENABLE_VALGRIND_sgcheck=$enable_valgrind_sgcheck +else $as_nop - valgrind_tools="memcheck helgrind drd sgcheck" + enable_valgrind=yes - valgrind_enabled_tools=$valgrind_enabled_tools +fi +fi -VALGRIND_CHECK_RULES=' -# Valgrind check -# -# Optional: -# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions -# files to load. (Default: empty) -# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. -# (Default: --num-callers=30) -# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: -# memcheck, helgrind, drd, sgcheck). (Default: various) + if test "$enable_valgrind" = "yes"; then + VALGRIND_ENABLED_TRUE= + VALGRIND_ENABLED_FALSE='#' +else + VALGRIND_ENABLED_TRUE='#' + VALGRIND_ENABLED_FALSE= +fi -# Optional variables -VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) -VALGRIND_FLAGS ?= --num-callers=30 -VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no -VALGRIND_helgrind_FLAGS ?= --history-level=approx -VALGRIND_drd_FLAGS ?= -VALGRIND_sgcheck_FLAGS ?= + VALGRIND_ENABLED=$enable_valgrind -# Internal use -valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) -valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) -valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) -valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) -valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) + # Check for Valgrind tools we care about. + valgrind_enabled_tools= -valgrind_quiet = $(valgrind_quiet_$(V)) -valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) -valgrind_quiet_0 = --quiet -valgrind_v_use = $(valgrind_v_use_$(V)) -valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY)) -valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%,%,$''@):; + # Check whether --enable-valgrind-memcheck was given. +if test ${enable_valgrind_memcheck+y} +then : + enableval=$enable_valgrind_memcheck; enable_valgrind_memcheck=$enableval +else $as_nop + enable_valgrind_memcheck= +fi -# Support running with and without libtool. -ifneq ($(LIBTOOL),) -valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute -else -valgrind_lt = -endif + if test "$enable_valgrind" = "no" +then : -# Use recursive makes in order to ignore errors during check -check-valgrind: -ifeq ($(VALGRIND_ENABLED),yes) - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \ - $(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool)) -else - @echo "Need to use GNU make and reconfigure with --enable-valgrind" -endif + enable_valgrind_memcheck=no +elif test "$enable_valgrind_memcheck" != "no" +then : -# Valgrind running -VALGRIND_TESTS_ENVIRONMENT = \ - $(TESTS_ENVIRONMENT) \ - env VALGRIND=$(VALGRIND) \ - G_SLICE=always-malloc,debug-blocks \ - G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool memcheck" >&5 +printf %s "checking for Valgrind tool memcheck... " >&6; } +if test ${ax_cv_valgrind_tool_memcheck+y} +then : + printf %s "(cached) " >&6 +else $as_nop -VALGRIND_LOG_COMPILER = \ - $(valgrind_lt) \ - $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) + ax_cv_valgrind_tool_memcheck=no -define valgrind_tool_rule = -check-valgrind-$(1): -ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) - $$(valgrind_v_use)$$(MAKE) check-TESTS \ - TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \ - LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \ - LOG_FLAGS="$$(valgrind_$(1)_flags)" \ - TEST_SUITE_LOG=test-suite-$(1).log -else ifeq ($$(VALGRIND_ENABLED),yes) - @echo "Need to reconfigure with --enable-valgrind-$(1)" -else - @echo "Need to reconfigure with --enable-valgrind" -endif -endef + if `$VALGRIND --tool=memcheck --help >/dev/null 2>&1` +then : -$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool)))) + ax_cv_valgrind_tool_memcheck=yes -A''M_DISTCHECK_CONFIGURE_FLAGS ?= -A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind +fi -MOSTLYCLEANFILES ?= -MOSTLYCLEANFILES += $(valgrind_log_files) +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_memcheck" >&5 +printf "%s\n" "$ax_cv_valgrind_tool_memcheck" >&6; } + if test "$ax_cv_valgrind_tool_memcheck" = "no" +then : -.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools)) -' + if test "$enable_valgrind_memcheck" = "yes" +then : - if test "$enable_valgrind" != "yes"; then : + as_fn_error $? "Valgrind does not support memcheck; reconfigure with --disable-valgrind-memcheck" "$LINENO" 5 - VALGRIND_CHECK_RULES=' -check-valgrind: - @echo "Need to use GNU make and reconfigure with --enable-valgrind"' +else $as_nop + + enable_valgrind_memcheck=no fi +else $as_nop + enable_valgrind_memcheck=yes +fi +fi + if test "$enable_valgrind_memcheck" = "yes" +then : + valgrind_enabled_tools="$valgrind_enabled_tools memcheck" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include -#include +fi + ENABLE_VALGRIND_memcheck=$enable_valgrind_memcheck -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; + # Check whether --enable-valgrind-helgrind was given. +if test ${enable_valgrind_helgrind+y} +then : + enableval=$enable_valgrind_helgrind; enable_valgrind_helgrind=$enableval +else $as_nop + enable_valgrind_helgrind= +fi -struct incomplete_array -{ - int datasize; - double data[]; -}; + if test "$enable_valgrind" = "no" +then : -struct named_init { - int number; - const wchar_t *name; - double average; -}; + enable_valgrind_helgrind=no +elif test "$enable_valgrind_helgrind" != "no" +then : -typedef const char *ccp; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool helgrind" >&5 +printf %s "checking for Valgrind tool helgrind... " >&6; } +if test ${ax_cv_valgrind_tool_helgrind+y} +then : + printf %s "(cached) " >&6 +else $as_nop -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} + ax_cv_valgrind_tool_helgrind=no -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); + if `$VALGRIND --tool=helgrind --help >/dev/null 2>&1` +then : - const char *str; - int number; - float fnumber; + ax_cv_valgrind_tool_helgrind=yes - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} +fi -int -main () -{ +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_helgrind" >&5 +printf "%s\n" "$ax_cv_valgrind_tool_helgrind" >&6; } + if test "$ax_cv_valgrind_tool_helgrind" = "no" +then : - // Check bool. - _Bool success = false; + if test "$enable_valgrind_helgrind" = "yes" +then : - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; + as_fn_error $? "Valgrind does not support helgrind; reconfigure with --disable-valgrind-helgrind" "$LINENO" 5 - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); +else $as_nop - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; + enable_valgrind_helgrind=no - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; +fi - ni.number = 58; +else $as_nop - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; + enable_valgrind_helgrind=yes - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); +fi - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC + if test "$enable_valgrind_helgrind" = "yes" +then : + + valgrind_enabled_tools="$valgrind_enabled_tools helgrind" fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : + ENABLE_VALGRIND_helgrind=$enable_valgrind_helgrind + + # Check whether --enable-valgrind-drd was given. +if test ${enable_valgrind_drd+y} +then : + enableval=$enable_valgrind_drd; enable_valgrind_drd=$enableval +else $as_nop + enable_valgrind_drd= fi + if test "$enable_valgrind" = "no" +then : -# By default we simply use the C compiler to build assembly code. + enable_valgrind_drd=no +elif test "$enable_valgrind_drd" != "no" +then : -test "${CCAS+set}" = set || CCAS=$CC -test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool drd" >&5 +printf %s "checking for Valgrind tool drd... " >&6; } +if test ${ax_cv_valgrind_tool_drd+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ax_cv_valgrind_tool_drd=no + if `$VALGRIND --tool=drd --help >/dev/null 2>&1` +then : -depcc="$CCAS" am_compiler_list= + ax_cv_valgrind_tool_drd=yes -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 -$as_echo_n "checking dependency style of $depcc... " >&6; } -if ${am_cv_CCAS_dependencies_compiler_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then - # We make a subdir and do the tests there. Otherwise we can end up - # making bogus files that we don't know about and never remove. For - # instance it was reported that on HP-UX the gcc test will end up - # making a dummy file named 'D' -- because '-MD' means "put the output - # in D". - rm -rf conftest.dir - mkdir conftest.dir - # Copy depcomp to subdir because otherwise we won't find it if we're - # using a relative directory. - cp "$am_depcomp" conftest.dir - cd conftest.dir - # We will build objects and dependencies in a subdirectory because - # it helps to detect inapplicable dependency modes. For instance - # both Tru64's cc and ICC support -MD to output dependencies as a - # side effect of compilation, but ICC will put the dependencies in - # the current directory while Tru64 will put them in the object - # directory. - mkdir sub +fi - am_cv_CCAS_dependencies_compiler_type=none - if test "$am_compiler_list" = ""; then - am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` - fi - am__universal=false +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_drd" >&5 +printf "%s\n" "$ax_cv_valgrind_tool_drd" >&6; } + if test "$ax_cv_valgrind_tool_drd" = "no" +then : + if test "$enable_valgrind_drd" = "yes" +then : - for depmode in $am_compiler_list; do - # Setup a source with many dependencies, because some compilers - # like to wrap large dependency lists on column 80 (with \), and - # we should not choose a depcomp mode which is confused by this. - # - # We need to recreate these files for each test, as the compiler may - # overwrite some of them when testing with obscure command lines. - # This happens at least with the AIX C compiler. - : > sub/conftest.c - for i in 1 2 3 4 5 6; do - echo '#include "conftst'$i'.h"' >> sub/conftest.c - # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with - # Solaris 10 /bin/sh. - echo '/* dummy */' > sub/conftst$i.h - done - echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + as_fn_error $? "Valgrind does not support drd; reconfigure with --disable-valgrind-drd" "$LINENO" 5 - # We check with '-c' and '-o' for the sake of the "dashmstdout" - # mode. It turns out that the SunPro C++ compiler does not properly - # handle '-M -o', and we need to detect this. Also, some Intel - # versions had trouble with output in subdirs. - am__obj=sub/conftest.${OBJEXT-o} - am__minus_obj="-o $am__obj" - case $depmode in - gcc) - # This depmode causes a compiler race in universal mode. - test "$am__universal" = false || continue - ;; - nosideeffect) - # After this tag, mechanisms are not by side-effect, so they'll - # only be used when explicitly requested. - if test "x$enable_dependency_tracking" = xyes; then - continue - else - break - fi - ;; - msvc7 | msvc7msys | msvisualcpp | msvcmsys) - # This compiler won't grok '-c -o', but also, the minuso test has - # not run yet. These depmodes are late enough in the game, and - # so weak that their functioning should not be impacted. - am__obj=conftest.${OBJEXT-o} - am__minus_obj= - ;; - none) break ;; - esac - if depmode=$depmode \ - source=sub/conftest.c object=$am__obj \ - depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ - $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ - >/dev/null 2>conftest.err && - grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && - grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && - grep $am__obj sub/conftest.Po > /dev/null 2>&1 && - ${MAKE-make} -s -f confmf > /dev/null 2>&1; then - # icc doesn't choke on unknown options, it will just issue warnings - # or remarks (even with -Werror). So we grep stderr for any message - # that says an option was ignored or not supported. - # When given -MP, icc 7.0 and 7.1 complain thusly: - # icc: Command line warning: ignoring option '-M'; no argument required - # The diagnosis changed in icc 8.0: - # icc: Command line remark: option '-MP' not supported - if (grep 'ignoring option' conftest.err || - grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else - am_cv_CCAS_dependencies_compiler_type=$depmode - break - fi - fi - done +else $as_nop + + enable_valgrind_drd=no - cd .. - rm -rf conftest.dir -else - am_cv_CCAS_dependencies_compiler_type=none fi +else $as_nop + + enable_valgrind_drd=yes + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5 -$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; } -CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then - am__fastdepCCAS_TRUE= - am__fastdepCCAS_FALSE='#' -else - am__fastdepCCAS_TRUE='#' - am__fastdepCCAS_FALSE= fi + if test "$enable_valgrind_drd" = "yes" +then : + valgrind_enabled_tools="$valgrind_enabled_tools drd" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if ${ac_cv_header_stdc+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include +fi + ENABLE_VALGRIND_drd=$enable_valgrind_drd -int -main () -{ - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no + # Check whether --enable-valgrind-sgcheck was given. +if test ${enable_valgrind_sgcheck+y} +then : + enableval=$enable_valgrind_sgcheck; enable_valgrind_sgcheck=$enableval +else $as_nop + enable_valgrind_sgcheck= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + if test "$enable_valgrind" = "no" +then : -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : + enable_valgrind_sgcheck=no +elif test "$enable_valgrind_sgcheck" != "no" +then : -else - ac_cv_header_stdc=no -fi -rm -f conftest* + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Valgrind tool sgcheck" >&5 +printf %s "checking for Valgrind tool sgcheck... " >&6; } +if test ${ax_cv_valgrind_tool_sgcheck+y} +then : + printf %s "(cached) " >&6 +else $as_nop -fi + ax_cv_valgrind_tool_sgcheck=no -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include + if `$VALGRIND --tool=exp-sgcheck --help >/dev/null 2>&1` +then : -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : + ax_cv_valgrind_tool_sgcheck=yes -else - ac_cv_header_stdc=no fi -rm -f conftest* fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_valgrind_tool_sgcheck" >&5 +printf "%s\n" "$ax_cv_valgrind_tool_sgcheck" >&6; } + if test "$ax_cv_valgrind_tool_sgcheck" = "no" +then : -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif + if test "$enable_valgrind_sgcheck" = "yes" +then : -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : + as_fn_error $? "Valgrind does not support sgcheck; reconfigure with --disable-valgrind-sgcheck" "$LINENO" 5 + +else $as_nop + + enable_valgrind_sgcheck=no -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext fi +else $as_nop + + enable_valgrind_sgcheck=yes + fi + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then + if test "$enable_valgrind_sgcheck" = "yes" +then : -$as_echo "#define STDC_HEADERS 1" >>confdefs.h + valgrind_enabled_tools="$valgrind_enabled_tools sgcheck" fi + ENABLE_VALGRIND_sgcheck=$enable_valgrind_sgcheck -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF -fi + valgrind_tools="memcheck helgrind drd sgcheck" -done + valgrind_enabled_tools=$valgrind_enabled_tools + + +VALGRIND_CHECK_RULES=' +# Valgrind check +# +# Optional: +# - VALGRIND_SUPPRESSIONS_FILES: Space-separated list of Valgrind suppressions +# files to load. (Default: empty) +# - VALGRIND_FLAGS: General flags to pass to all Valgrind tools. +# (Default: --num-callers=30) +# - VALGRIND_$toolname_FLAGS: Flags to pass to Valgrind $toolname (one of: +# memcheck, helgrind, drd, sgcheck). (Default: various) + +# Optional variables +VALGRIND_SUPPRESSIONS ?= $(addprefix --suppressions=,$(VALGRIND_SUPPRESSIONS_FILES)) +VALGRIND_FLAGS ?= --num-callers=30 +VALGRIND_memcheck_FLAGS ?= --leak-check=full --show-reachable=no +VALGRIND_helgrind_FLAGS ?= --history-level=approx +VALGRIND_drd_FLAGS ?= +VALGRIND_sgcheck_FLAGS ?= + +# Internal use +valgrind_log_files = $(addprefix test-suite-,$(addsuffix .log,$(valgrind_tools))) +valgrind_memcheck_flags = --tool=memcheck $(VALGRIND_memcheck_FLAGS) +valgrind_helgrind_flags = --tool=helgrind $(VALGRIND_helgrind_FLAGS) +valgrind_drd_flags = --tool=drd $(VALGRIND_drd_FLAGS) +valgrind_sgcheck_flags = --tool=exp-sgcheck $(VALGRIND_sgcheck_FLAGS) +valgrind_quiet = $(valgrind_quiet_$(V)) +valgrind_quiet_ = $(valgrind_quiet_$(AM_DEFAULT_VERBOSITY)) +valgrind_quiet_0 = --quiet +valgrind_v_use = $(valgrind_v_use_$(V)) +valgrind_v_use_ = $(valgrind_v_use_$(AM_DEFAULT_VERBOSITY)) +valgrind_v_use_0 = @echo " USE " $(patsubst check-valgrind-%,%,$''@):; - ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" -if test "x$ac_cv_header_minix_config_h" = xyes; then : - MINIX=yes +# Support running with and without libtool. +ifneq ($(LIBTOOL),) +valgrind_lt = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=execute else - MINIX= -fi - +valgrind_lt = +endif - if test "$MINIX" = yes; then +# Use recursive makes in order to ignore errors during check +check-valgrind: +ifeq ($(VALGRIND_ENABLED),yes) + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \ + $(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool)) +else + @echo "Need to use GNU make and reconfigure with --enable-valgrind" +endif -$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h +# Valgrind running +VALGRIND_TESTS_ENVIRONMENT = \ + $(TESTS_ENVIRONMENT) \ + env VALGRIND=$(VALGRIND) \ + G_SLICE=always-malloc,debug-blocks \ + G_DEBUG=fatal-warnings,fatal-criticals,gc-friendly +VALGRIND_LOG_COMPILER = \ + $(valgrind_lt) \ + $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) -$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h +define valgrind_tool_rule = +check-valgrind-$(1): +ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) + $$(valgrind_v_use)$$(MAKE) check-TESTS \ + TESTS_ENVIRONMENT="$$(VALGRIND_TESTS_ENVIRONMENT)" \ + LOG_COMPILER="$$(VALGRIND_LOG_COMPILER)" \ + LOG_FLAGS="$$(valgrind_$(1)_flags)" \ + TEST_SUITE_LOG=test-suite-$(1).log +else ifeq ($$(VALGRIND_ENABLED),yes) + @echo "Need to reconfigure with --enable-valgrind-$(1)" +else + @echo "Need to reconfigure with --enable-valgrind" +endif +endef +$(foreach tool,$(valgrind_tools),$(eval $(call valgrind_tool_rule,$(tool)))) -$as_echo "#define _MINIX 1" >>confdefs.h +A''M_DISTCHECK_CONFIGURE_FLAGS ?= +A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-valgrind - fi +MOSTLYCLEANFILES ?= +MOSTLYCLEANFILES += $(valgrind_log_files) +.PHONY: check-valgrind $(add-prefix check-valgrind-,$(valgrind_tools)) +' - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if ${ac_cv_safe_to_define___extensions__+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "$enable_valgrind" != "yes" +then : -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ + VALGRIND_CHECK_RULES=' +check-valgrind: + @echo "Need to use GNU make and reconfigure with --enable-valgrind"' - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_safe_to_define___extensions__=yes -else - ac_cv_safe_to_define___extensions__=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h - $as_echo "#define _ALL_SOURCE 1" >>confdefs.h - $as_echo "#define _GNU_SOURCE 1" >>confdefs.h - $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h - $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 -$as_echo_n "checking for variable-length arrays... " >&6; } -if ${ac_cv_c_vararrays+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for variable-length arrays" >&5 +printf %s "checking for variable-length arrays... " >&6; } +if test ${ac_cv_c_vararrays+y} +then : + printf %s "(cached) " >&6 +else $as_nop + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC_NO_VLA__ + defined + #endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "defined" >/dev/null 2>&1 +then : + ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined' +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Test for VLA support. This test is partly inspired + from examples in the C standard. Use at least two VLA + functions to detect the GCC 3.4.3 bug described in: + https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00014.html + */ + #ifdef __STDC_NO_VLA__ + syntax error; + #else + extern int n; + int B[100]; + int fvla (int m, int C[m][m]); + + int + simple (int count, int all[static count]) + { + return all[count - 1]; + } + + int + fvla (int m, int C[m][m]) + { + typedef int VLA[m][m]; + VLA x; + int D[m]; + static int (*q)[m] = &B; + int (*s)[n] = q; + return C && &x[0][0] == &D[0] && &D[0] == s[0]; + } + #endif int -main () +main (void) { -static int x; char a[++x]; a[sizeof a - 1] = 0; return a[0]; + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_vararrays=yes -else +else $as_nop ac_cv_c_vararrays=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +fi +rm -rf conftest* + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 -$as_echo "$ac_cv_c_vararrays" >&6; } - if test $ac_cv_c_vararrays = yes; then +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_vararrays" >&5 +printf "%s\n" "$ac_cv_c_vararrays" >&6; } + if test "$ac_cv_c_vararrays" = yes; then + +printf "%s\n" "#define HAVE_C_VARARRAYS 1" >>confdefs.h -$as_echo "#define HAVE_C_VARARRAYS 1" >>confdefs.h + elif test "$ac_cv_c_vararrays" = no; then + +printf "%s\n" "#define __STDC_NO_VLA__ 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __wasi__ defined" >&5 -$as_echo_n "checking for __wasi__ defined... " >&6; } -if ${ac_cv_defined___wasi__+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __wasi__ defined" >&5 +printf %s "checking for __wasi__ defined... " >&6; } +if test ${ac_cv_defined___wasi__+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifdef __wasi__ @@ -6890,99 +7621,95 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_defined___wasi__=yes -else +else $as_nop ac_cv_defined___wasi__=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined___wasi__" >&5 -$as_echo "$ac_cv_defined___wasi__" >&6; } -if test $ac_cv_defined___wasi__ != "no"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined___wasi__" >&5 +printf "%s\n" "$ac_cv_defined___wasi__" >&6; } +if test $ac_cv_defined___wasi__ != "no" +then : WASI="yes" fi +case $host_os in #( + linux-gnu) : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FORTIFY_SOURCE defined" >&5 -$as_echo_n "checking for _FORTIFY_SOURCE defined... " >&6; } -if ${ac_cv_defined__FORTIFY_SOURCE+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS" >&5 +printf %s "checking whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + int -main () +main (void) { - #ifdef _FORTIFY_SOURCE - int ok; - #else - choke me - #endif + #ifndef _FORTIFY_SOURCE + return 0; + #else + this_is_an_error; + #endif + ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_defined__FORTIFY_SOURCE=yes -else - ac_cv_defined__FORTIFY_SOURCE=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_defined__FORTIFY_SOURCE" >&5 -$as_echo "$ac_cv_defined__FORTIFY_SOURCE" >&6; } -if test $ac_cv_defined__FORTIFY_SOURCE != "no"; then : +if ac_fn_c_try_link "$LINENO" +then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -D_FORTIFY_SOURCE=2" >&5 -$as_echo_n "checking whether C compiler accepts -D_FORTIFY_SOURCE=2... " >&6; } -if ${ax_cv_check_cflags___D_FORTIFY_SOURCE_2+:} false; then : - $as_echo_n "(cached) " >&6 -else + #define _FORTIFY_SOURCE 2 + #include + int main() { + const char *s = " "; + strcpy(s, "x"); + return strlen(s)-1; + } + - ax_check_save_flags=$CFLAGS - CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=2" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x - ; - return 0; -} _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ax_cv_check_cflags___D_FORTIFY_SOURCE_2=yes -else - ax_cv_check_cflags___D_FORTIFY_SOURCE_2=no +if ac_fn_c_try_link "$LINENO" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - CFLAGS=$ax_check_save_flags -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___D_FORTIFY_SOURCE_2" >&5 -$as_echo "$ax_cv_check_cflags___D_FORTIFY_SOURCE_2" >&6; } -if test "x$ax_cv_check_cflags___D_FORTIFY_SOURCE_2" = xyes; then : - CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" -else - : -fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + ;; #( + *) : + ;; +esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fvisibility=hidden" >&5 -$as_echo_n "checking whether C compiler accepts -fvisibility=hidden... " >&6; } -if ${ax_cv_check_cflags___fvisibility_hidden+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fvisibility=hidden" >&5 +printf %s "checking whether C compiler accepts -fvisibility=hidden... " >&6; } +if test ${ax_cv_check_cflags___fvisibility_hidden+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fvisibility=hidden" @@ -6990,41 +7717,45 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fvisibility_hidden=yes -else +else $as_nop ax_cv_check_cflags___fvisibility_hidden=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fvisibility_hidden" >&5 -$as_echo "$ax_cv_check_cflags___fvisibility_hidden" >&6; } -if test "x$ax_cv_check_cflags___fvisibility_hidden" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fvisibility_hidden" >&5 +printf "%s\n" "$ax_cv_check_cflags___fvisibility_hidden" >&6; } +if test "x$ax_cv_check_cflags___fvisibility_hidden" = xyes +then : CFLAGS="$CFLAGS -fvisibility=hidden" -else +else $as_nop : fi case $host_os in #( - cygwin*|mingw*|msys|pw32*|cegcc*) : + cygwin*|mingw*|msys|pw32*|cegcc*|eabi*) : ;; #( *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIC" >&5 -$as_echo_n "checking whether C compiler accepts -fPIC... " >&6; } -if ${ax_cv_check_cflags___fPIC+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIC" >&5 +printf %s "checking whether C compiler accepts -fPIC... " >&6; } +if test ${ax_cv_check_cflags___fPIC+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fPIC" @@ -7032,40 +7763,45 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fPIC=yes -else +else $as_nop ax_cv_check_cflags___fPIC=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIC" >&5 -$as_echo "$ax_cv_check_cflags___fPIC" >&6; } -if test "x$ax_cv_check_cflags___fPIC" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIC" >&5 +printf "%s\n" "$ax_cv_check_cflags___fPIC" >&6; } +if test "x$ax_cv_check_cflags___fPIC" = xyes +then : CFLAGS="$CFLAGS -fPIC" -else +else $as_nop : fi ;; esac -if test "$enable_pie" != "no"; then : +if test "$enable_pie" != "no" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIE" >&5 -$as_echo_n "checking whether C compiler accepts -fPIE... " >&6; } -if ${ax_cv_check_cflags___fPIE+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fPIE" >&5 +printf %s "checking whether C compiler accepts -fPIE... " >&6; } +if test ${ax_cv_check_cflags___fPIE+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fPIE" @@ -7073,31 +7809,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fPIE=yes -else +else $as_nop ax_cv_check_cflags___fPIE=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIE" >&5 -$as_echo "$ax_cv_check_cflags___fPIE" >&6; } -if test "x$ax_cv_check_cflags___fPIE" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -pie" >&5 -$as_echo_n "checking whether the linker accepts -pie... " >&6; } -if ${ax_cv_check_ldflags___pie+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fPIE" >&5 +printf "%s\n" "$ax_cv_check_cflags___fPIE" >&6; } +if test "x$ax_cv_check_cflags___fPIE" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -pie" >&5 +printf %s "checking whether the linker accepts -pie... " >&6; } +if test ${ax_cv_check_ldflags___pie+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -pie" @@ -7105,46 +7845,49 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___pie=yes -else +else $as_nop ax_cv_check_ldflags___pie=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___pie" >&5 -$as_echo "$ax_cv_check_ldflags___pie" >&6; } -if test "x$ax_cv_check_ldflags___pie" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___pie" >&5 +printf "%s\n" "$ax_cv_check_ldflags___pie" >&6; } +if test "x$ax_cv_check_ldflags___pie" = xyes +then : CFLAGS="$CFLAGS -fPIE" LDFLAGS="$LDFLAGS -pie" -else +else $as_nop : fi -else +else $as_nop : fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-strict-aliasing" >&5 -$as_echo_n "checking whether C compiler accepts -fno-strict-aliasing... " >&6; } -if ${ax_cv_check_cflags___fno_strict_aliasing+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-strict-aliasing" >&5 +printf %s "checking whether C compiler accepts -fno-strict-aliasing... " >&6; } +if test ${ax_cv_check_cflags___fno_strict_aliasing+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-strict-aliasing" @@ -7152,35 +7895,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fno_strict_aliasing=yes -else +else $as_nop ax_cv_check_cflags___fno_strict_aliasing=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_aliasing" >&5 -$as_echo "$ax_cv_check_cflags___fno_strict_aliasing" >&6; } -if test "x$ax_cv_check_cflags___fno_strict_aliasing" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_aliasing" >&5 +printf "%s\n" "$ax_cv_check_cflags___fno_strict_aliasing" >&6; } +if test "x$ax_cv_check_cflags___fno_strict_aliasing" = xyes +then : CFLAGS="$CFLAGS -fno-strict-aliasing" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-strict-overflow" >&5 -$as_echo_n "checking whether C compiler accepts -fno-strict-overflow... " >&6; } -if ${ax_cv_check_cflags___fno_strict_overflow+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-strict-overflow" >&5 +printf %s "checking whether C compiler accepts -fno-strict-overflow... " >&6; } +if test ${ax_cv_check_cflags___fno_strict_overflow+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-strict-overflow" @@ -7188,33 +7935,37 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fno_strict_overflow=yes -else +else $as_nop ax_cv_check_cflags___fno_strict_overflow=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_overflow" >&5 -$as_echo "$ax_cv_check_cflags___fno_strict_overflow" >&6; } -if test "x$ax_cv_check_cflags___fno_strict_overflow" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_strict_overflow" >&5 +printf "%s\n" "$ax_cv_check_cflags___fno_strict_overflow" >&6; } +if test "x$ax_cv_check_cflags___fno_strict_overflow" = xyes +then : CFLAGS="$CFLAGS -fno-strict-overflow" -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fwrapv" >&5 -$as_echo_n "checking whether C compiler accepts -fwrapv... " >&6; } -if ${ax_cv_check_cflags___fwrapv+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fwrapv" >&5 +printf %s "checking whether C compiler accepts -fwrapv... " >&6; } +if test ${ax_cv_check_cflags___fwrapv+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fwrapv" @@ -7222,27 +7973,30 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fwrapv=yes -else +else $as_nop ax_cv_check_cflags___fwrapv=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fwrapv" >&5 -$as_echo "$ax_cv_check_cflags___fwrapv" >&6; } -if test "x$ax_cv_check_cflags___fwrapv" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fwrapv" >&5 +printf "%s\n" "$ax_cv_check_cflags___fwrapv" >&6; } +if test "x$ax_cv_check_cflags___fwrapv" = xyes +then : CFLAGS="$CFLAGS -fwrapv" -else +else $as_nop : fi @@ -7250,7 +8004,8 @@ fi -if test "$GCC" = "yes" ; then : +if test "$GCC" = "yes" +then : case $host_cpu in #( i?86|amd64|x86_64) : @@ -7264,15 +8019,17 @@ int main(void) { return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : -else +else $as_nop - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flax-vector-conversions" >&5 -$as_echo_n "checking whether C compiler accepts -flax-vector-conversions... " >&6; } -if ${ax_cv_check_cflags___flax_vector_conversions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -flax-vector-conversions" >&5 +printf %s "checking whether C compiler accepts -flax-vector-conversions... " >&6; } +if test ${ax_cv_check_cflags___flax_vector_conversions+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -flax-vector-conversions" @@ -7280,33 +8037,36 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___flax_vector_conversions=yes -else +else $as_nop ax_cv_check_cflags___flax_vector_conversions=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___flax_vector_conversions" >&5 -$as_echo "$ax_cv_check_cflags___flax_vector_conversions" >&6; } -if test "x$ax_cv_check_cflags___flax_vector_conversions" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___flax_vector_conversions" >&5 +printf "%s\n" "$ax_cv_check_cflags___flax_vector_conversions" >&6; } +if test "x$ax_cv_check_cflags___flax_vector_conversions" = xyes +then : CFLAGS="$CFLAGS -flax-vector-conversions" -else +else $as_nop : fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; #( *) : @@ -7318,9 +8078,11 @@ LIBTOOL_OLD_FLAGS="$LIBTOOL_EXTRA_FLAGS" LIBTOOL_EXTRA_FLAGS="$LIBTOOL_EXTRA_FLAGS -version-info $SODIUM_LIBRARY_VERSION" # Check whether --enable-soname-versions was given. -if test "${enable_soname_versions+set}" = set; then : +if test ${enable_soname_versions+y} +then : enableval=$enable_soname_versions; - if test "x$enableval" = "xno"; then : + if test "x$enableval" = "xno" +then : LIBTOOL_EXTRA_FLAGS="$LIBTOOL_OLD_FLAGS -avoid-version" @@ -7333,11 +8095,12 @@ case $host_os in #( cygwin*|mingw*|msys|pw32*|cegcc*) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--dynamicbase" >&5 -$as_echo_n "checking whether the linker accepts -Wl,--dynamicbase... " >&6; } -if ${ax_cv_check_ldflags___Wl___dynamicbase+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--dynamicbase" >&5 +printf %s "checking whether the linker accepts -Wl,--dynamicbase... " >&6; } +if test ${ax_cv_check_ldflags___Wl___dynamicbase+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--dynamicbase" @@ -7345,35 +8108,38 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl___dynamicbase=yes -else +else $as_nop ax_cv_check_ldflags___Wl___dynamicbase=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___dynamicbase" >&5 -$as_echo "$ax_cv_check_ldflags___Wl___dynamicbase" >&6; } -if test "x$ax_cv_check_ldflags___Wl___dynamicbase" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___dynamicbase" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl___dynamicbase" >&6; } +if test "x$ax_cv_check_ldflags___Wl___dynamicbase" = xyes +then : LDFLAGS="$LDFLAGS -Wl,--dynamicbase" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--high-entropy-va" >&5 -$as_echo_n "checking whether the linker accepts -Wl,--high-entropy-va... " >&6; } -if ${ax_cv_check_ldflags___Wl___high_entropy_va+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--high-entropy-va" >&5 +printf %s "checking whether the linker accepts -Wl,--high-entropy-va... " >&6; } +if test ${ax_cv_check_ldflags___Wl___high_entropy_va+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--high-entropy-va" @@ -7381,35 +8147,38 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl___high_entropy_va=yes -else +else $as_nop ax_cv_check_ldflags___Wl___high_entropy_va=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___high_entropy_va" >&5 -$as_echo "$ax_cv_check_ldflags___Wl___high_entropy_va" >&6; } -if test "x$ax_cv_check_ldflags___Wl___high_entropy_va" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___high_entropy_va" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl___high_entropy_va" >&6; } +if test "x$ax_cv_check_ldflags___Wl___high_entropy_va" = xyes +then : LDFLAGS="$LDFLAGS -Wl,--high-entropy-va" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--nxcompat" >&5 -$as_echo_n "checking whether the linker accepts -Wl,--nxcompat... " >&6; } -if ${ax_cv_check_ldflags___Wl___nxcompat+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,--nxcompat" >&5 +printf %s "checking whether the linker accepts -Wl,--nxcompat... " >&6; } +if test ${ax_cv_check_ldflags___Wl___nxcompat+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--nxcompat" @@ -7417,27 +8186,29 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl___nxcompat=yes -else +else $as_nop ax_cv_check_ldflags___Wl___nxcompat=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___nxcompat" >&5 -$as_echo "$ax_cv_check_ldflags___Wl___nxcompat" >&6; } -if test "x$ax_cv_check_ldflags___Wl___nxcompat" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl___nxcompat" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl___nxcompat" >&6; } +if test "x$ax_cv_check_ldflags___Wl___nxcompat" = xyes +then : LDFLAGS="$LDFLAGS -Wl,--nxcompat" -else +else $as_nop : fi @@ -7447,13 +8218,14 @@ esac case $host_os in #( - cygwin*|mingw*|msys|pw32*|cegcc*) : + cygwin*|mingw*|msys|pw32*|cegcc*|eabi*) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-asynchronous-unwind-tables" >&5 -$as_echo_n "checking whether C compiler accepts -fno-asynchronous-unwind-tables... " >&6; } -if ${ax_cv_check_cflags___fno_asynchronous_unwind_tables+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fno-asynchronous-unwind-tables" >&5 +printf %s "checking whether C compiler accepts -fno-asynchronous-unwind-tables... " >&6; } +if test ${ax_cv_check_cflags___fno_asynchronous_unwind_tables+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables" @@ -7461,29 +8233,32 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fno_asynchronous_unwind_tables=yes -else +else $as_nop ax_cv_check_cflags___fno_asynchronous_unwind_tables=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&5 -$as_echo "$ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&6; } -if test "x$ax_cv_check_cflags___fno_asynchronous_unwind_tables" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&5 +printf "%s\n" "$ax_cv_check_cflags___fno_asynchronous_unwind_tables" >&6; } +if test "x$ax_cv_check_cflags___fno_asynchronous_unwind_tables" = xyes +then : CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables" -else +else $as_nop : fi @@ -7492,19 +8267,97 @@ ;; esac -if test "x$enable_ssp" != "xno"; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a broken Xcode version" >&5 +printf %s "checking for a broken Xcode version... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main (void) +{ + +#if !defined(__APPLE_CC__) || __APPLE_CC__ != 6000 +#error Not Apple +#endif +#if !defined(__clang_major__) || __clang_major__ != 11 +#error Not Xcode 11 +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Using unsupported Xcode version" >&5 +printf "%s\n" "$as_me: WARNING: Using unsupported Xcode version" >&2;} + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -fno-stack-check" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -fno-stack-check" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -fno-stack-check... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + ax_check_save_flags=$CFLAGS + CFLAGS="$CFLAGS $CFLAGS -fno-stack-check" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main (void) +{ +time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + eval "$as_CACHEVAR=yes" +else $as_nop + eval "$as_CACHEVAR=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS=$ax_check_save_flags +fi +eval ac_res=\$$as_CACHEVAR + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : + CFLAGS="$CFLAGS -fno-stack-check" +else $as_nop + : +fi + + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +if test "x$enable_ssp" != "xno" +then : case $host_os in #( - cygwin*|mingw*|msys|pw32*|cegcc*|haiku|none) : + cygwin*|mingw*|msys|pw32*|cegcc*|haiku|none|eabi*) : ;; #( *) : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector" >&5 -$as_echo_n "checking whether C compiler accepts -fstack-protector... " >&6; } -if ${ax_cv_check_cflags___fstack_protector+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -fstack-protector" >&5 +printf %s "checking whether C compiler accepts -fstack-protector... " >&6; } +if test ${ax_cv_check_cflags___fstack_protector+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -fstack-protector" @@ -7512,31 +8365,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___fstack_protector=yes -else +else $as_nop ax_cv_check_cflags___fstack_protector=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector" >&5 -$as_echo "$ax_cv_check_cflags___fstack_protector" >&6; } -if test "x$ax_cv_check_cflags___fstack_protector" = xyes; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector" >&5 -$as_echo_n "checking whether the linker accepts -fstack-protector... " >&6; } -if ${ax_cv_check_ldflags___fstack_protector+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___fstack_protector" >&5 +printf "%s\n" "$ax_cv_check_cflags___fstack_protector" >&6; } +if test "x$ax_cv_check_cflags___fstack_protector" = xyes +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -fstack-protector" >&5 +printf %s "checking whether the linker accepts -fstack-protector... " >&6; } +if test ${ax_cv_check_ldflags___fstack_protector+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -fstack-protector" @@ -7544,33 +8401,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___fstack_protector=yes -else +else $as_nop ax_cv_check_ldflags___fstack_protector=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector" >&5 -$as_echo "$ax_cv_check_ldflags___fstack_protector" >&6; } -if test "x$ax_cv_check_ldflags___fstack_protector" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___fstack_protector" >&5 +printf "%s\n" "$ax_cv_check_ldflags___fstack_protector" >&6; } +if test "x$ax_cv_check_ldflags___fstack_protector" = xyes +then : CFLAGS="$CFLAGS -fstack-protector" -else +else $as_nop : fi -else +else $as_nop : fi @@ -7583,12 +8442,13 @@ -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CFLAGS -Wall" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wall" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS -Wall... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wall" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wall" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -Wall... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS -Wall" @@ -7596,37 +8456,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CFLAGS -Wall" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CFLAGS -Wextra" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wextra" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS -Wextra... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -Wextra" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -Wextra" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -Wextra... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS -Wextra" @@ -7634,39 +8498,42 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CFLAGS -Wextra" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 -$as_echo_n "checking for clang... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for clang" >&5 +printf %s "checking for clang... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #ifndef __clang__ @@ -7677,15 +8544,17 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-warning-option" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-warning-option" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wno-unknown-warning-option... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-unknown-warning-option" @@ -7693,45 +8562,49 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wno-unknown-warning-option" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wbad-function-cast" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wbad-function-cast" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wbad-function-cast... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wbad-function-cast" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wbad-function-cast" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wbad-function-cast... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wbad-function-cast" @@ -7739,37 +8612,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wbad-function-cast" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wcast-qual" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wcast-qual" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wcast-qual... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wcast-qual" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wcast-qual" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wcast-qual... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wcast-qual" @@ -7777,37 +8654,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wcast-qual" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wdiv-by-zero" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wdiv-by-zero" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wdiv-by-zero... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wdiv-by-zero" @@ -7815,37 +8696,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wdiv-by-zero" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wduplicated-branches" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-branches" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wduplicated-branches... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-branches" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-branches" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wduplicated-branches... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wduplicated-branches" @@ -7853,37 +8738,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wduplicated-branches" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wduplicated-cond" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-cond" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wduplicated-cond... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wduplicated-cond" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wduplicated-cond" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wduplicated-cond... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wduplicated-cond" @@ -7891,37 +8780,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wduplicated-cond" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wfloat-equal" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wfloat-equal" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wfloat-equal... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wfloat-equal" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wfloat-equal" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wfloat-equal... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wfloat-equal" @@ -7929,37 +8822,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wfloat-equal" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wformat=2" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wformat=2" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wformat=2... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wformat=2" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wformat=2" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wformat=2... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wformat=2" @@ -7967,37 +8864,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wformat=2" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wlogical-op" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wlogical-op" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wlogical-op... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wlogical-op" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wlogical-op" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wlogical-op... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wlogical-op" @@ -8005,37 +8906,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wlogical-op" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wmaybe-uninitialized" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmaybe-uninitialized" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wmaybe-uninitialized... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmaybe-uninitialized" @@ -8043,37 +8948,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wmaybe-uninitialized" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wmisleading-indentation" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmisleading-indentation" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wmisleading-indentation... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmisleading-indentation" @@ -8081,37 +8990,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wmisleading-indentation" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wmissing-declarations" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-declarations" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wmissing-declarations... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-declarations" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-declarations" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wmissing-declarations... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmissing-declarations" @@ -8119,37 +9032,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wmissing-declarations" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wmissing-prototypes" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wmissing-prototypes" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wmissing-prototypes... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wmissing-prototypes" @@ -8157,37 +9074,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wmissing-prototypes" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wnested-externs" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnested-externs" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wnested-externs... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnested-externs" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnested-externs" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wnested-externs... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnested-externs" @@ -8195,37 +9116,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wnested-externs" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wno-type-limits" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-type-limits" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wno-type-limits... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-type-limits" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-type-limits" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wno-type-limits... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-type-limits" @@ -8233,37 +9158,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wno-type-limits" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-pragmas" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wno-unknown-pragmas" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wno-unknown-pragmas... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wno-unknown-pragmas" @@ -8271,37 +9200,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wno-unknown-pragmas" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wnormalized=id" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnormalized=id" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wnormalized=id... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnormalized=id" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnormalized=id" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wnormalized=id... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnormalized=id" @@ -8309,37 +9242,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wnormalized=id" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wnull-dereference" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnull-dereference" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wnull-dereference... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wnull-dereference" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wnull-dereference" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wnull-dereference... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wnull-dereference" @@ -8347,37 +9284,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wnull-dereference" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wold-style-declaration" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wold-style-declaration" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wold-style-declaration... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wold-style-declaration" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wold-style-declaration" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wold-style-declaration... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wold-style-declaration" @@ -8385,37 +9326,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wold-style-declaration" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wpointer-arith" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wpointer-arith" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wpointer-arith... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wpointer-arith" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wpointer-arith" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wpointer-arith... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wpointer-arith" @@ -8423,37 +9368,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wpointer-arith" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wredundant-decls" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wredundant-decls" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wredundant-decls... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wredundant-decls" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wredundant-decls" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wredundant-decls... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wredundant-decls" @@ -8461,37 +9410,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wredundant-decls" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wrestrict" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wrestrict" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wrestrict... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wrestrict" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wrestrict" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wrestrict... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wrestrict" @@ -8499,37 +9452,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wrestrict" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wshorten-64-to-32" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wshorten-64-to-32" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wshorten-64-to-32... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wshorten-64-to-32" @@ -8537,37 +9494,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wshorten-64-to-32" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wsometimes-uninitialized" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wsometimes-uninitialized" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wsometimes-uninitialized... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wsometimes-uninitialized" @@ -8575,37 +9536,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wsometimes-uninitialized" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wstrict-prototypes" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wstrict-prototypes" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wstrict-prototypes... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wstrict-prototypes" @@ -8613,37 +9578,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wstrict-prototypes" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wswitch-enum" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wswitch-enum" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wswitch-enum... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wswitch-enum" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wswitch-enum" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wswitch-enum... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wswitch-enum" @@ -8651,37 +9620,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wswitch-enum" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wvariable-decl" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wvariable-decl" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wvariable-decl... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wvariable-decl" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wvariable-decl" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wvariable-decl... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wvariable-decl" @@ -8689,37 +9662,41 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wvariable-decl" -else +else $as_nop : fi -as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CWFLAGS -Wwrite-strings" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wwrite-strings" >&5 -$as_echo_n "checking whether C compiler accepts $CWFLAGS -Wwrite-strings... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CWFLAGS -Wwrite-strings" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CWFLAGS -Wwrite-strings" >&5 +printf %s "checking whether C compiler accepts $CWFLAGS -Wwrite-strings... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CWFLAGS -Wwrite-strings" @@ -8727,37 +9704,44 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CWFLAGS="$CWFLAGS -Wwrite-strings" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,relro" >&5 -$as_echo_n "checking whether the linker accepts -Wl,-z,relro... " >&6; } -if ${ax_cv_check_ldflags___Wl__z_relro+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test "x$EMSCRIPTEN" = "x" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,relro" >&5 +printf %s "checking whether the linker accepts -Wl,-z,relro... " >&6; } +if test ${ax_cv_check_ldflags___Wl__z_relro+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,relro" @@ -8765,35 +9749,38 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl__z_relro=yes -else +else $as_nop ax_cv_check_ldflags___Wl__z_relro=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_relro" >&5 -$as_echo "$ax_cv_check_ldflags___Wl__z_relro" >&6; } -if test "x$ax_cv_check_ldflags___Wl__z_relro" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_relro" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl__z_relro" >&6; } +if test "x$ax_cv_check_ldflags___Wl__z_relro" = xyes +then : LDFLAGS="$LDFLAGS -Wl,-z,relro" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,now" >&5 -$as_echo_n "checking whether the linker accepts -Wl,-z,now... " >&6; } -if ${ax_cv_check_ldflags___Wl__z_now+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,now" >&5 +printf %s "checking whether the linker accepts -Wl,-z,now... " >&6; } +if test ${ax_cv_check_ldflags___Wl__z_now+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,now" @@ -8801,35 +9788,38 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl__z_now=yes -else +else $as_nop ax_cv_check_ldflags___Wl__z_now=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_now" >&5 -$as_echo "$ax_cv_check_ldflags___Wl__z_now" >&6; } -if test "x$ax_cv_check_ldflags___Wl__z_now" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_now" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl__z_now" >&6; } +if test "x$ax_cv_check_ldflags___Wl__z_now" = xyes +then : LDFLAGS="$LDFLAGS -Wl,-z,now" -else +else $as_nop : fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,noexecstack" >&5 -$as_echo_n "checking whether the linker accepts -Wl,-z,noexecstack... " >&6; } -if ${ax_cv_check_ldflags___Wl__z_noexecstack+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,noexecstack" >&5 +printf %s "checking whether the linker accepts -Wl,-z,noexecstack... " >&6; } +if test ${ax_cv_check_ldflags___Wl__z_noexecstack+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" @@ -8837,42 +9827,48 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_ldflags___Wl__z_noexecstack=yes -else +else $as_nop ax_cv_check_ldflags___Wl__z_noexecstack=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_noexecstack" >&5 -$as_echo "$ax_cv_check_ldflags___Wl__z_noexecstack" >&6; } -if test "x$ax_cv_check_ldflags___Wl__z_noexecstack" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_ldflags___Wl__z_noexecstack" >&5 +printf "%s\n" "$ax_cv_check_ldflags___Wl__z_noexecstack" >&6; } +if test "x$ax_cv_check_ldflags___Wl__z_noexecstack" = xyes +then : LDFLAGS="$LDFLAGS -Wl,-z,noexecstack" -else +else $as_nop : fi +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether segmentation violations can be caught when using the C compiler" >&5 -$as_echo_n "checking whether segmentation violations can be caught when using the C compiler... " >&6; } -if ${ax_cv_check_cCATCHABLE_SEGV+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether segmentation violations can be caught" >&5 +printf %s "checking whether segmentation violations can be caught... " >&6; } +if test ${ax_cv_check_cCATCHABLE_SEGV+y} +then : + printf %s "(cached) " >&6 +else $as_nop + + if test "$cross_compiling" = yes +then : ax_cv_check_cCATCHABLE_SEGV=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8882,7 +9878,7 @@ static void sig(int _) { exit(0); } int -main () +main (void) { volatile unsigned char * volatile x = (volatile unsigned char *) malloc(8); @@ -8900,9 +9896,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_check_cCATCHABLE_SEGV=yes -else +else $as_nop ax_cv_check_cCATCHABLE_SEGV=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8911,29 +9908,32 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_SEGV" >&5 -$as_echo "$ax_cv_check_cCATCHABLE_SEGV" >&6; } - if test "x$ax_cv_check_cCATCHABLE_SEGV" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_SEGV" >&5 +printf "%s\n" "$ax_cv_check_cCATCHABLE_SEGV" >&6; } + if test "x$ax_cv_check_cCATCHABLE_SEGV" = xyes +then : -$as_echo "#define HAVE_CATCHABLE_SEGV 1" >>confdefs.h +printf "%s\n" "#define HAVE_CATCHABLE_SEGV 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&5 -$as_echo "$as_me: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&5 +printf "%s\n" "$as_me: WARNING: On this platform, segmentation violations cannot be caught using signal handlers. This is expected if you enabled a tool such as Address Sanitizer (-fsanitize=address), but be aware that using Address Sanitizer may also significantly reduce performance." >&2;} fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether SIGABRT can be caught when using the C compiler" >&5 -$as_echo_n "checking whether SIGABRT can be caught when using the C compiler... " >&6; } -if ${ax_cv_check_cCATCHABLE_ABRT+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether SIGABRT can be caught" >&5 +printf %s "checking whether SIGABRT can be caught... " >&6; } +if test ${ax_cv_check_cCATCHABLE_ABRT+y} +then : + printf %s "(cached) " >&6 +else $as_nop - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : ax_cv_check_cCATCHABLE_ABRT=unknown -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -8965,7 +9965,7 @@ } int -main () +main (void) { signal(SIGABRT, sigabrt_handler_1); @@ -8976,9 +9976,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ax_cv_check_cCATCHABLE_ABRT=yes -else +else $as_nop ax_cv_check_cCATCHABLE_ABRT=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -8987,27 +9988,30 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_ABRT" >&5 -$as_echo "$ax_cv_check_cCATCHABLE_ABRT" >&6; } - if test "x$ax_cv_check_cCATCHABLE_ABRT" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cCATCHABLE_ABRT" >&5 +printf "%s\n" "$ax_cv_check_cCATCHABLE_ABRT" >&6; } + if test "x$ax_cv_check_cCATCHABLE_ABRT" = xyes +then : -$as_echo "#define HAVE_CATCHABLE_ABRT 1" >>confdefs.h +printf "%s\n" "#define HAVE_CATCHABLE_ABRT 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&5 -$as_echo "$as_me: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&2;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&5 +printf "%s\n" "$as_me: WARNING: On this platform, SIGABRT cannot be caught using signal handlers." >&2;} fi -if test "x$with_threads" = "xyes"; then : +if test "x$with_threads" = "xyes" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5 -$as_echo_n "checking for thread local storage (TLS) class... " >&6; } - if ${ac_cv_tls+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thread local storage (TLS) class" >&5 +printf %s "checking for thread local storage (TLS) class... " >&6; } + if test ${ac_cv_tls+y} +then : + printf %s "(cached) " >&6 +else $as_nop for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do case $ax_tls_keyword in #( none) : @@ -9016,47 +10020,45 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - static void - foo(void) { - static $ax_tls_keyword int bar; - exit(1); - } int -main () +main (void) { +static $ax_tls_keyword int bar; ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_tls=$ax_tls_keyword ; break -else +else $as_nop ac_cv_tls=none fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + ;; esac done fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5 -$as_echo "$ac_cv_tls" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_tls" >&5 +printf "%s\n" "$ac_cv_tls" >&6; } - if test "$ac_cv_tls" != "none"; then : + if test "$ac_cv_tls" != "none" +then : -cat >>confdefs.h <<_ACEOF -#define TLS $ac_cv_tls -_ACEOF +printf "%s\n" "#define TLS $ac_cv_tls" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: thread local storage is supported" >&5 -$as_echo "thread local storage is supported" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftls-model=local-dynamic" >&5 -$as_echo_n "checking whether C compiler accepts -ftls-model=local-dynamic... " >&6; } -if ${ax_cv_check_cflags___ftls_model_local_dynamic+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: thread local storage is supported" >&5 +printf "%s\n" "thread local storage is supported" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -ftls-model=local-dynamic" >&5 +printf %s "checking whether C compiler accepts -ftls-model=local-dynamic... " >&6; } +if test ${ax_cv_check_cflags___ftls_model_local_dynamic+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -ftls-model=local-dynamic" @@ -9064,41 +10066,44 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___ftls_model_local_dynamic=yes -else +else $as_nop ax_cv_check_cflags___ftls_model_local_dynamic=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftls_model_local_dynamic" >&5 -$as_echo "$ax_cv_check_cflags___ftls_model_local_dynamic" >&6; } -if test "x$ax_cv_check_cflags___ftls_model_local_dynamic" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___ftls_model_local_dynamic" >&5 +printf "%s\n" "$ax_cv_check_cflags___ftls_model_local_dynamic" >&6; } +if test "x$ax_cv_check_cflags___ftls_model_local_dynamic" = xyes +then : CFLAGS="$CFLAGS -ftls-model=local-dynamic" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: thread local storage is not supported" >&5 -$as_echo "thread local storage is not supported" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: thread local storage is not supported" >&5 +printf "%s\n" "thread local storage is not supported" >&6; } fi fi case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +printf "%s\n" "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac @@ -9118,6 +10123,7 @@ + ltmain=$ac_aux_dir/ltmain.sh # Backslashify metacharacters that are still active within @@ -9141,8 +10147,8 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 -$as_echo_n "checking how to print strings... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5 +printf %s "checking how to print strings... " >&6; } # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then @@ -9168,12 +10174,12 @@ } case $ECHO in - printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5 -$as_echo "printf" >&6; } ;; - print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 -$as_echo "print -r" >&6; } ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5 -$as_echo "cat" >&6; } ;; + printf*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: printf" >&5 +printf "%s\n" "printf" >&6; } ;; + print*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: print -r" >&5 +printf "%s\n" "print -r" >&6; } ;; + *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cat" >&5 +printf "%s\n" "cat" >&6; } ;; esac @@ -9189,11 +10195,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if ${ac_cv_path_SED+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5 +printf %s "checking for a sed that does not truncate output... " >&6; } +if test ${ac_cv_path_SED+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" @@ -9207,10 +10214,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in sed gsed + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" + ac_path_SED="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_SED" || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED @@ -9219,13 +10231,13 @@ ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" + printf "%s\n" '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -9253,8 +10265,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5 +printf "%s\n" "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed @@ -9271,11 +10283,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if ${ac_cv_path_FGREP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 +printf %s "checking for fgrep... " >&6; } +if test ${ac_cv_path_FGREP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else @@ -9286,10 +10299,15 @@ for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in fgrep + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" + ac_path_FGREP="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP @@ -9298,13 +10316,13 @@ ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + printf %s 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" + printf "%s\n" 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val @@ -9333,8 +10351,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 +printf "%s\n" "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" @@ -9359,17 +10377,18 @@ # Check whether --with-gnu-ld was given. -if test "${with_gnu_ld+set}" = set; then : +if test ${with_gnu_ld+y} +then : withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes -else +else $as_nop with_gnu_ld=no fi ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5 +printf %s "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw @@ -9398,15 +10417,16 @@ ;; esac elif test yes = "$with_gnu_ld"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5 +printf %s "checking for GNU ld... " >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5 +printf %s "checking for non-GNU ld... " >&6; } fi -if ${lt_cv_path_LD+:} false; then : - $as_echo_n "(cached) " >&6 -else +if test ${lt_cv_path_LD+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do @@ -9435,18 +10455,19 @@ LD=$lt_cv_path_LD if test -n "$LD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 -$as_echo "$LD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5 +printf "%s\n" "$LD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } -if ${lt_cv_prog_gnu_ld+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 +printf %s "checking if the linker ($LD) is GNU ld... " >&6; } +if test ${lt_cv_prog_gnu_ld+y} +then : + printf %s "(cached) " >&6 +else $as_nop # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5 +printf "%s\n" "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld @@ -9469,11 +10490,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } -if ${lt_cv_path_NM+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5 +printf %s "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +if test ${lt_cv_path_NM+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM @@ -9523,8 +10545,8 @@ : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5 +printf "%s\n" "$lt_cv_path_NM" >&6; } if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else @@ -9537,11 +10559,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else @@ -9549,11 +10572,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9564,11 +10591,11 @@ fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5 +printf "%s\n" "$DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9581,11 +10608,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DUMPBIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else @@ -9593,11 +10621,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9608,11 +10640,11 @@ fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5 +printf "%s\n" "$ac_ct_DUMPBIN" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -9624,8 +10656,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN @@ -9653,11 +10685,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } -if ${lt_cv_nm_interface+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5 +printf %s "checking the name lister ($NM) interface... " >&6; } +if test ${lt_cv_nm_interface+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5) @@ -9673,26 +10706,27 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 +printf "%s\n" "$lt_cv_nm_interface" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5 +printf %s "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5 +printf "%s\n" "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } -if ${lt_cv_sys_max_cmd_len+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5 +printf %s "checking the maximum length of command line arguments... " >&6; } +if test ${lt_cv_sys_max_cmd_len+y} +then : + printf %s "(cached) " >&6 +else $as_nop i=0 teststring=ABCD @@ -9819,11 +10853,11 @@ fi if test -n "$lt_cv_sys_max_cmd_len"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5 +printf "%s\n" "$lt_cv_sys_max_cmd_len" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5 -$as_echo "none" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none" >&5 +printf "%s\n" "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -9867,11 +10901,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 -$as_echo_n "checking how to convert $build file names to $host format... " >&6; } -if ${lt_cv_to_host_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5 +printf %s "checking how to convert $build file names to $host format... " >&6; } +if test ${lt_cv_to_host_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $host in *-*-mingw* ) case $build in @@ -9907,18 +10942,19 @@ fi to_host_file_cmd=$lt_cv_to_host_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 -$as_echo "$lt_cv_to_host_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_host_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 -$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; } -if ${lt_cv_to_tool_file_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5 +printf %s "checking how to convert $build file names to toolchain format... " >&6; } +if test ${lt_cv_to_tool_file_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop #assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in @@ -9934,22 +10970,23 @@ fi to_tool_file_cmd=$lt_cv_to_tool_file_cmd -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 -$as_echo "$lt_cv_to_tool_file_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5 +printf "%s\n" "$lt_cv_to_tool_file_cmd" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } -if ${lt_cv_ld_reload_flag+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5 +printf %s "checking for $LD option to reload object files... " >&6; } +if test ${lt_cv_ld_reload_flag+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5 +printf "%s\n" "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; @@ -9982,11 +11019,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else @@ -9994,11 +11032,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10009,11 +11051,11 @@ fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 +printf "%s\n" "$OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10022,11 +11064,12 @@ ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OBJDUMP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else @@ -10034,11 +11077,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10049,11 +11096,11 @@ fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 +printf "%s\n" "$ac_ct_OBJDUMP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then @@ -10061,8 +11108,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP @@ -10081,11 +11128,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } -if ${lt_cv_deplibs_check_method+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5 +printf %s "checking how to recognize dependent libraries... " >&6; } +if test ${lt_cv_deplibs_check_method+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -10281,8 +11329,8 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5 +printf "%s\n" "$lt_cv_deplibs_check_method" >&6; } file_magic_glob= want_nocaseglob=no @@ -10326,11 +11374,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else @@ -10338,11 +11387,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10353,11 +11406,11 @@ fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 +printf "%s\n" "$DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10366,11 +11419,12 @@ ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DLLTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else @@ -10378,11 +11432,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10393,11 +11451,11 @@ fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 +printf "%s\n" "$ac_ct_DLLTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then @@ -10405,8 +11463,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL @@ -10426,11 +11484,12 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 -$as_echo_n "checking how to associate runtime and link libraries... " >&6; } -if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5 +printf %s "checking how to associate runtime and link libraries... " >&6; } +if test ${lt_cv_sharedlib_from_linklib_cmd+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in @@ -10453,8 +11512,8 @@ esac fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 -$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5 +printf "%s\n" "$lt_cv_sharedlib_from_linklib_cmd" >&6; } sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO @@ -10469,11 +11528,12 @@ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -10481,11 +11541,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10496,11 +11560,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10513,11 +11577,12 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -10525,11 +11590,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$ac_prog" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10540,11 +11609,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10556,8 +11625,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -10577,30 +11646,32 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 -$as_echo_n "checking for archiver @FILE support... " >&6; } -if ${lt_cv_ar_at_file+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5 +printf %s "checking for archiver @FILE support... " >&6; } +if test ${lt_cv_ar_at_file+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ar_at_file=no cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. @@ -10608,7 +11679,7 @@ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5 (eval $lt_ar_try) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ @@ -10617,11 +11688,11 @@ rm -f conftest.* libconftest.a fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 -$as_echo "$lt_cv_ar_at_file" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5 +printf "%s\n" "$lt_cv_ar_at_file" >&6; } if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= @@ -10638,11 +11709,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else @@ -10650,11 +11722,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10665,11 +11741,11 @@ fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 +printf "%s\n" "$STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10678,11 +11754,12 @@ ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_STRIP+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_STRIP+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else @@ -10690,11 +11767,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10705,11 +11786,11 @@ fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 +printf "%s\n" "$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -10717,8 +11798,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -10737,11 +11818,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else @@ -10749,11 +11831,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10764,11 +11850,11 @@ fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 +printf "%s\n" "$RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -10777,11 +11863,12 @@ ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_RANLIB+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else @@ -10789,11 +11876,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -10804,11 +11895,11 @@ fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 +printf "%s\n" "$ac_ct_RANLIB" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then @@ -10816,8 +11907,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB @@ -10906,11 +11997,12 @@ # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } -if ${lt_cv_sys_global_symbol_pipe+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5 +printf %s "checking command to parse $NM output from $compiler object... " >&6; } +if test ${lt_cv_sys_global_symbol_pipe+y} +then : + printf %s "(cached) " >&6 +else $as_nop # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -11062,14 +12154,14 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then # Now try to grab the symbols. nlist=conftest.nm if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5 (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then @@ -11138,7 +12230,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s conftest$ac_exeext; then pipe_works=yes fi @@ -11173,11 +12265,11 @@ lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5 -$as_echo "failed" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: failed" >&5 +printf "%s\n" "failed" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5 -$as_echo "ok" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 +printf "%s\n" "ok" >&6; } fi # Response file support. @@ -11223,13 +12315,14 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 -$as_echo_n "checking for sysroot... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5 +printf %s "checking for sysroot... " >&6; } # Check whether --with-sysroot was given. -if test "${with_sysroot+set}" = set; then : +if test ${with_sysroot+y} +then : withval=$with_sysroot; -else +else $as_nop with_sysroot=no fi @@ -11247,24 +12340,25 @@ no|'') ;; #( *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 -$as_echo "$with_sysroot" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5 +printf "%s\n" "$with_sysroot" >&6; } as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5 ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 -$as_echo "${lt_sysroot:-no}" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5 +printf "%s\n" "${lt_sysroot:-no}" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 -$as_echo_n "checking for a working dd... " >&6; } -if ${ac_cv_path_lt_DD+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5 +printf %s "checking for a working dd... " >&6; } +if test ${ac_cv_path_lt_DD+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} @@ -11275,10 +12369,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in dd; do + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in dd + do for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext" + ac_path_lt_DD="$as_dir$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_lt_DD" || continue if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ @@ -11298,15 +12397,16 @@ rm -f conftest.i conftest2.i conftest.out fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 -$as_echo "$ac_cv_path_lt_DD" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5 +printf "%s\n" "$ac_cv_path_lt_DD" >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 -$as_echo_n "checking how to truncate binary pipes... " >&6; } -if ${lt_cv_truncate_bin+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5 +printf %s "checking how to truncate binary pipes... " >&6; } +if test ${lt_cv_truncate_bin+y} +then : + printf %s "(cached) " >&6 +else $as_nop printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= @@ -11317,8 +12417,8 @@ rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 -$as_echo "$lt_cv_truncate_bin" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5 +printf "%s\n" "$lt_cv_truncate_bin" >&6; } @@ -11341,7 +12441,8 @@ } # Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then : +if test ${enable_libtool_lock+y} +then : enableval=$enable_libtool_lock; fi @@ -11357,7 +12458,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) @@ -11377,7 +12478,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in @@ -11415,7 +12516,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then emul=elf case `/usr/bin/file conftest.$ac_objext` in @@ -11456,7 +12557,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *32-bit*) @@ -11519,11 +12620,12 @@ # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } -if ${lt_cv_cc_needs_belf+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5 +printf %s "checking whether the C compiler needs -belf... " >&6; } +if test ${lt_cv_cc_needs_belf+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -11534,19 +12636,20 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_cc_needs_belf=yes -else +else $as_nop lt_cv_cc_needs_belf=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -11555,8 +12658,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5 +printf "%s\n" "$lt_cv_cc_needs_belf" >&6; } if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS @@ -11569,7 +12672,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then case `/usr/bin/file conftest.o` in *64-bit*) @@ -11606,11 +12709,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args. set dummy ${ac_tool_prefix}mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$MANIFEST_TOOL"; then ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test. else @@ -11618,11 +12722,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11633,11 +12741,11 @@ fi MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL if test -n "$MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 -$as_echo "$MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5 +printf "%s\n" "$MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11646,11 +12754,12 @@ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL # Extract the first word of "mt", so it can be a program name with args. set dummy mt; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_MANIFEST_TOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_MANIFEST_TOOL"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test. else @@ -11658,11 +12767,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MANIFEST_TOOL="mt" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11673,11 +12786,11 @@ fi ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL if test -n "$ac_ct_MANIFEST_TOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 -$as_echo "$ac_ct_MANIFEST_TOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5 +printf "%s\n" "$ac_ct_MANIFEST_TOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_MANIFEST_TOOL" = x; then @@ -11685,8 +12798,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL @@ -11696,11 +12809,12 @@ fi test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 -$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } -if ${lt_cv_path_mainfest_tool+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5 +printf %s "checking if $MANIFEST_TOOL is a manifest tool... " >&6; } +if test ${lt_cv_path_mainfest_tool+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5 $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out @@ -11710,8 +12824,8 @@ fi rm -f conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 -$as_echo "$lt_cv_path_mainfest_tool" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5 +printf "%s\n" "$lt_cv_path_mainfest_tool" >&6; } if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi @@ -11726,11 +12840,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else @@ -11738,11 +12853,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11753,11 +12872,11 @@ fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5 +printf "%s\n" "$DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11766,11 +12885,12 @@ ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_DSYMUTIL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else @@ -11778,11 +12898,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11793,11 +12917,11 @@ fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5 +printf "%s\n" "$ac_ct_DSYMUTIL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then @@ -11805,8 +12929,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL @@ -11818,11 +12942,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else @@ -11830,11 +12955,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11845,11 +12974,11 @@ fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5 +printf "%s\n" "$NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11858,11 +12987,12 @@ ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_NMEDIT+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else @@ -11870,11 +13000,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11885,11 +13019,11 @@ fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5 +printf "%s\n" "$ac_ct_NMEDIT" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then @@ -11897,8 +13031,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT @@ -11910,11 +13044,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else @@ -11922,11 +13057,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11937,11 +13076,11 @@ fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5 +printf "%s\n" "$LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -11950,11 +13089,12 @@ ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_LIPO+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_LIPO+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else @@ -11962,11 +13102,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -11977,11 +13121,11 @@ fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5 +printf "%s\n" "$ac_ct_LIPO" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then @@ -11989,8 +13133,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO @@ -12002,11 +13146,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else @@ -12014,11 +13159,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -12029,11 +13178,11 @@ fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5 +printf "%s\n" "$OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -12042,11 +13191,12 @@ ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else @@ -12054,11 +13204,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -12069,11 +13223,11 @@ fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5 +printf "%s\n" "$ac_ct_OTOOL" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then @@ -12081,8 +13235,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL @@ -12094,11 +13248,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else @@ -12106,11 +13261,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -12121,11 +13280,11 @@ fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5 +printf "%s\n" "$OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -12134,11 +13293,12 @@ ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_OTOOL64+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else @@ -12146,11 +13306,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -12161,11 +13325,11 @@ fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5 +printf "%s\n" "$ac_ct_OTOOL64" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then @@ -12173,8 +13337,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 @@ -12209,11 +13373,12 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } -if ${lt_cv_apple_cc_single_mod+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5 +printf %s "checking for -single_module linker flag... " >&6; } +if test ${lt_cv_apple_cc_single_mod+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override @@ -12242,14 +13407,15 @@ rm -f conftest.* fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5 +printf "%s\n" "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } -if ${lt_cv_ld_exported_symbols_list+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5 +printf %s "checking for -exported_symbols_list linker flag... " >&6; } +if test ${lt_cv_ld_exported_symbols_list+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym @@ -12258,31 +13424,33 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_ld_exported_symbols_list=yes -else +else $as_nop lt_cv_ld_exported_symbols_list=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5 +printf "%s\n" "$lt_cv_ld_exported_symbols_list" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 -$as_echo_n "checking for -force_load linker flag... " >&6; } -if ${lt_cv_ld_force_load+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5 +printf %s "checking for -force_load linker flag... " >&6; } +if test ${lt_cv_ld_force_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} @@ -12310,23 +13478,18 @@ rm -rf conftest.dSYM fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 -$as_echo "$lt_cv_ld_force_load" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5 +printf "%s\n" "$lt_cv_ld_force_load" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[91]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[012][,.]*) + darwin*) + case ${MACOSX_DEPLOYMENT_TARGET},$host in + 10.[012],*|,*powerpc*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) + *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; @@ -12382,19 +13545,14 @@ esac } -for ac_header in dlfcn.h -do : - ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default +ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default " -if test "x$ac_cv_header_dlfcn_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_DLFCN_H 1 -_ACEOF +if test "x$ac_cv_header_dlfcn_h" = xyes +then : + printf "%s\n" "#define HAVE_DLFCN_H 1" >>confdefs.h fi -done - @@ -12410,7 +13568,8 @@ # Check whether --enable-shared was given. -if test "${enable_shared+set}" = set; then : +if test ${enable_shared+y} +then : enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; @@ -12428,7 +13587,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_shared=yes fi @@ -12441,7 +13600,8 @@ # Check whether --enable-static was given. -if test "${enable_static+set}" = set; then : +if test ${enable_static+y} +then : enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; @@ -12459,7 +13619,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_static=yes fi @@ -12473,7 +13633,8 @@ # Check whether --with-pic was given. -if test "${with_pic+set}" = set; then : +if test ${with_pic+y} +then : withval=$with_pic; lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; @@ -12490,7 +13651,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop pic_mode=default fi @@ -12502,7 +13663,8 @@ # Check whether --enable-fast-install was given. -if test "${enable_fast_install+set}" = set; then : +if test ${enable_fast_install+y} +then : enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; @@ -12520,7 +13682,7 @@ IFS=$lt_save_ifs ;; esac -else +else $as_nop enable_fast_install=yes fi @@ -12534,11 +13696,12 @@ shared_archive_member_spec= case $host,$enable_shared in power*-*-aix[5-9]*,yes) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 -$as_echo_n "checking which variant of shared library versioning to provide... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5 +printf %s "checking which variant of shared library versioning to provide... " >&6; } # Check whether --with-aix-soname was given. -if test "${with_aix_soname+set}" = set; then : +if test ${with_aix_soname+y} +then : withval=$with_aix_soname; case $withval in aix|svr4|both) ;; @@ -12547,18 +13710,19 @@ ;; esac lt_cv_with_aix_soname=$with_aix_soname -else - if ${lt_cv_with_aix_soname+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + if test ${lt_cv_with_aix_soname+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_with_aix_soname=aix fi with_aix_soname=$lt_cv_with_aix_soname fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 -$as_echo "$with_aix_soname" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5 +printf "%s\n" "$with_aix_soname" >&6; } if test aix != "$with_aix_soname"; then # For the AIX way of multilib, we name the shared archive member # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o', @@ -12640,11 +13804,12 @@ setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } -if ${lt_cv_objdir+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5 +printf %s "checking for objdir... " >&6; } +if test ${lt_cv_objdir+y} +then : + printf %s "(cached) " >&6 +else $as_nop rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then @@ -12655,17 +13820,15 @@ fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5 +printf "%s\n" "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir -cat >>confdefs.h <<_ACEOF -#define LT_OBJDIR "$lt_cv_objdir/" -_ACEOF +printf "%s\n" "#define LT_OBJDIR \"$lt_cv_objdir/\"" >>confdefs.h @@ -12711,11 +13874,12 @@ case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5 +printf %s "checking for ${ac_tool_prefix}file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -12764,11 +13928,11 @@ MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -12777,11 +13941,12 @@ if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } -if ${lt_cv_path_MAGIC_CMD+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for file" >&5 +printf %s "checking for file... " >&6; } +if test ${lt_cv_path_MAGIC_CMD+y} +then : + printf %s "(cached) " >&6 +else $as_nop case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. @@ -12830,11 +13995,11 @@ MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5 +printf "%s\n" "$MAGIC_CMD" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -12919,11 +14084,12 @@ lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } -if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +printf %s "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } +if test ${lt_cv_prog_compiler_rtti_exceptions+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -12954,8 +14120,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +printf "%s\n" "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" @@ -13312,26 +14478,28 @@ ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } -if ${lt_cv_prog_compiler_pic+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5 +printf %s "checking for $compiler option to produce PIC... " >&6; } +if test ${lt_cv_prog_compiler_pic+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic=$lt_prog_compiler_pic fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 -$as_echo "$lt_cv_prog_compiler_pic" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic" >&6; } lt_prog_compiler_pic=$lt_cv_prog_compiler_pic # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } -if ${lt_cv_prog_compiler_pic_works+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +printf %s "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } +if test ${lt_cv_prog_compiler_pic_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext @@ -13362,8 +14530,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_pic_works" >&6; } if test yes = "$lt_cv_prog_compiler_pic_works"; then case $lt_prog_compiler_pic in @@ -13391,11 +14559,12 @@ # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } -if ${lt_cv_prog_compiler_static_works+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +printf %s "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +if test ${lt_cv_prog_compiler_static_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_static_works=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $lt_tmp_static_flag" @@ -13419,8 +14588,8 @@ LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5 +printf "%s\n" "$lt_cv_prog_compiler_static_works" >&6; } if test yes = "$lt_cv_prog_compiler_static_works"; then : @@ -13434,11 +14603,12 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -13481,19 +14651,20 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } -if ${lt_cv_prog_compiler_c_o+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5 +printf %s "checking if $compiler supports -c -o file.$ac_objext... " >&6; } +if test ${lt_cv_prog_compiler_c_o+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest @@ -13536,8 +14707,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5 +printf "%s\n" "$lt_cv_prog_compiler_c_o" >&6; } @@ -13545,19 +14716,19 @@ hard_links=nottested if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5 +printf %s "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5 +printf "%s\n" "$hard_links" >&6; } if test no = "$hard_links"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5 +printf "%s\n" "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;} need_locks=warn fi else @@ -13569,8 +14740,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +printf %s "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= @@ -14125,21 +15296,23 @@ if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14154,7 +15327,7 @@ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -14178,21 +15351,23 @@ if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else - if ${lt_cv_aix_libpath_+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_aix_libpath_+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_aix_libpath_sed=' /Import File Strings/,/^$/ { @@ -14207,7 +15382,7 @@ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext if test -z "$lt_cv_aix_libpath_"; then lt_cv_aix_libpath_=/usr/lib:/lib @@ -14458,11 +15633,12 @@ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 -$as_echo_n "checking if $CC understands -b... " >&6; } -if ${lt_cv_prog_compiler__b+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5 +printf %s "checking if $CC understands -b... " >&6; } +if test ${lt_cv_prog_compiler__b+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_prog_compiler__b=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -b" @@ -14486,8 +15662,8 @@ LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 -$as_echo "$lt_cv_prog_compiler__b" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5 +printf "%s\n" "$lt_cv_prog_compiler__b" >&6; } if test yes = "$lt_cv_prog_compiler__b"; then archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' @@ -14527,28 +15703,30 @@ # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 -$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; } -if ${lt_cv_irix_exported_symbol+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5 +printf %s "checking whether the $host_os linker accepts -exported_symbol... " >&6; } +if test ${lt_cv_irix_exported_symbol+y} +then : + printf %s "(cached) " >&6 +else $as_nop save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int foo (void) { return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : lt_cv_irix_exported_symbol=yes -else +else $as_nop lt_cv_irix_exported_symbol=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 -$as_echo "$lt_cv_irix_exported_symbol" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5 +printf "%s\n" "$lt_cv_irix_exported_symbol" >&6; } if test yes = "$lt_cv_irix_exported_symbol"; then archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi @@ -14828,8 +16006,8 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5 +printf "%s\n" "$ld_shlibs" >&6; } test no = "$ld_shlibs" && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -14865,18 +16043,19 @@ # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } -if ${lt_cv_archive_cmds_need_lc+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5 +printf %s "checking whether -lc should be explicitly linked in... " >&6; } +if test ${lt_cv_archive_cmds_need_lc+y} +then : + printf %s "(cached) " >&6 +else $as_nop $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } 2>conftest.err; then soname=conftest lib=conftest @@ -14894,7 +16073,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then lt_cv_archive_cmds_need_lc=no @@ -14908,8 +16087,8 @@ $RM conftest* fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 -$as_echo "$lt_cv_archive_cmds_need_lc" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5 +printf "%s\n" "$lt_cv_archive_cmds_need_lc" >&6; } archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc ;; esac @@ -15068,8 +16247,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5 +printf %s "checking dynamic linker characteristics... " >&6; } if test yes = "$GCC"; then case $host_os in @@ -15630,9 +16809,10 @@ shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH - if ${lt_cv_shlibpath_overrides_runpath+:} false; then : - $as_echo_n "(cached) " >&6 -else + if test ${lt_cv_shlibpath_overrides_runpath+y} +then : + printf %s "(cached) " >&6 +else $as_nop lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir @@ -15642,19 +16822,21 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then : +if ac_fn_c_try_link "$LINENO" +then : + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null +then : lt_cv_shlibpath_overrides_runpath=yes fi fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir @@ -15886,8 +17068,8 @@ dynamic_linker=no ;; esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5 +printf "%s\n" "$dynamic_linker" >&6; } test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" @@ -16008,8 +17190,8 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5 +printf %s "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || @@ -16033,8 +17215,8 @@ # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5 +printf "%s\n" "$hardcode_action" >&6; } if test relink = "$hardcode_action" || test yes = "$inherit_rpath"; then @@ -16078,11 +17260,12 @@ darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16091,32 +17274,31 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else +else $as_nop lt_cv_dlopen=dyld lt_cv_dlopen_libs= @@ -16136,14 +17318,16 @@ *) ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load" -if test "x$ac_cv_func_shl_load" = xyes; then : +if test "x$ac_cv_func_shl_load" = xyes +then : lt_cv_dlopen=shl_load -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } -if ${ac_cv_lib_dld_shl_load+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5 +printf %s "checking for shl_load in -ldld... " >&6; } +if test ${ac_cv_lib_dld_shl_load+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16152,41 +17336,42 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char shl_load (); int -main () +main (void) { return shl_load (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_shl_load=yes -else +else $as_nop ac_cv_lib_dld_shl_load=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5 +printf "%s\n" "$ac_cv_lib_dld_shl_load" >&6; } +if test "x$ac_cv_lib_dld_shl_load" = xyes +then : lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld -else +else $as_nop ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen" -if test "x$ac_cv_func_dlopen" = xyes; then : +if test "x$ac_cv_func_dlopen" = xyes +then : lt_cv_dlopen=dlopen -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } -if ${ac_cv_lib_dl_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 +printf %s "checking for dlopen in -ldl... " >&6; } +if test ${ac_cv_lib_dl_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16195,37 +17380,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dl_dlopen=yes -else +else $as_nop ac_cv_lib_dl_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_dl_dlopen" >&6; } +if test "x$ac_cv_lib_dl_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } -if ${ac_cv_lib_svld_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5 +printf %s "checking for dlopen in -lsvld... " >&6; } +if test ${ac_cv_lib_svld_dlopen+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16234,37 +17419,37 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif char dlopen (); int -main () +main (void) { return dlopen (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_svld_dlopen=yes -else +else $as_nop ac_cv_lib_svld_dlopen=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5 +printf "%s\n" "$ac_cv_lib_svld_dlopen" >&6; } +if test "x$ac_cv_lib_svld_dlopen" = xyes +then : lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld -else - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } -if ${ac_cv_lib_dld_dld_link+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5 +printf %s "checking for dld_link in -ldld... " >&6; } +if test ${ac_cv_lib_dld_dld_link+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -16272,31 +17457,30 @@ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif + builtin and then its argument prototype would still apply. */ char dld_link (); int -main () +main (void) { return dld_link (); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_lib_dld_dld_link=yes -else +else $as_nop ac_cv_lib_dld_dld_link=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5 +printf "%s\n" "$ac_cv_lib_dld_dld_link" >&6; } +if test "x$ac_cv_lib_dld_dld_link" = xyes +then : lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld fi @@ -16335,11 +17519,12 @@ save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5 +printf %s "checking whether a program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self=cross else @@ -16418,7 +17603,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -16436,16 +17621,17 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5 +printf "%s\n" "$lt_cv_dlopen_self" >&6; } if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } -if ${lt_cv_dlopen_self_static+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5 +printf %s "checking whether a statically linked program can dlopen itself... " >&6; } +if test ${lt_cv_dlopen_self_static+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test yes = "$cross_compiling"; then : lt_cv_dlopen_self_static=cross else @@ -16524,7 +17710,7 @@ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? @@ -16542,8 +17728,8 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5 +printf "%s\n" "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS=$save_CPPFLAGS @@ -16581,13 +17767,13 @@ striplib= old_striplib= -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 +printf %s "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in @@ -16595,16 +17781,16 @@ if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi ;; *) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac fi @@ -16621,13 +17807,13 @@ # Report what library types will actually be built - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5 +printf %s "checking if libtool supports shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5 +printf "%s\n" "$can_build_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5 +printf %s "checking whether to build shared libraries... " >&6; } test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and @@ -16651,15 +17837,15 @@ fi ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5 +printf "%s\n" "$enable_shared" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5 +printf %s "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5 +printf "%s\n" "$enable_static" >&6; } @@ -16701,11 +17887,12 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else @@ -16713,11 +17900,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16728,11 +17919,11 @@ fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 -$as_echo "$AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 +printf "%s\n" "$AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi @@ -16741,11 +17932,12 @@ ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AR+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_prog_ac_ct_AR+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else @@ -16753,11 +17945,15 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -16768,11 +17964,11 @@ fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 +printf "%s\n" "$ac_ct_AR" >&6; } else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi if test "x$ac_ct_AR" = x; then @@ -16780,8 +17976,8 @@ else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR @@ -16792,15 +17988,17 @@ -if test "x$EMSCRIPTEN" = "x"; then : +if test "x$EMSCRIPTEN" = "x" +then : oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mmmx" >&5 -$as_echo_n "checking whether C compiler accepts -mmmx... " >&6; } -if ${ax_cv_check_cflags___mmmx+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mmmx" >&5 +printf %s "checking whether C compiler accepts -mmmx... " >&6; } +if test ${ax_cv_check_cflags___mmmx+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mmmx" @@ -16808,32 +18006,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mmmx=yes -else +else $as_nop ax_cv_check_cflags___mmmx=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 -$as_echo "$ax_cv_check_cflags___mmmx" >&6; } -if test "x$ax_cv_check_cflags___mmmx" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 +printf "%s\n" "$ax_cv_check_cflags___mmmx" >&6; } +if test "x$ax_cv_check_cflags___mmmx" = xyes +then : CFLAGS="$CFLAGS -mmmx" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MMX instructions set" >&5 -$as_echo_n "checking for MMX instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MMX instructions set" >&5 +printf %s "checking for MMX instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16841,24 +18042,26 @@ #include int -main () +main (void) { __m64 x = _mm_setzero_si64(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_MMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mmmx" >&5 -$as_echo_n "checking whether C compiler accepts -mmmx... " >&6; } -if ${ax_cv_check_cflags___mmmx+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_MMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mmmx" >&5 +printf %s "checking whether C compiler accepts -mmmx... " >&6; } +if test ${ax_cv_check_cflags___mmmx+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mmmx" @@ -16866,43 +18069,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mmmx=yes -else +else $as_nop ax_cv_check_cflags___mmmx=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 -$as_echo "$ax_cv_check_cflags___mmmx" >&6; } -if test "x$ax_cv_check_cflags___mmmx" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mmmx" >&5 +printf "%s\n" "$ax_cv_check_cflags___mmmx" >&6; } +if test "x$ax_cv_check_cflags___mmmx" = xyes +then : CFLAGS_MMX="-mmmx" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse2" >&5 -$as_echo_n "checking whether C compiler accepts -msse2... " >&6; } -if ${ax_cv_check_cflags___msse2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse2" >&5 +printf %s "checking whether C compiler accepts -msse2... " >&6; } +if test ${ax_cv_check_cflags___msse2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse2" @@ -16910,32 +18117,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse2=yes -else +else $as_nop ax_cv_check_cflags___msse2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 -$as_echo "$ax_cv_check_cflags___msse2" >&6; } -if test "x$ax_cv_check_cflags___msse2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse2" >&6; } +if test "x$ax_cv_check_cflags___msse2" = xyes +then : CFLAGS="$CFLAGS -msse2" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE2 instructions set" >&5 -$as_echo_n "checking for SSE2 instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE2 instructions set" >&5 +printf %s "checking for SSE2 instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -16946,7 +18156,7 @@ #include int -main () +main (void) { __m128d x = _mm_setzero_pd(); __m128i z = _mm_srli_epi64(_mm_setzero_si128(), 26); @@ -16954,17 +18164,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_EMMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse2" >&5 -$as_echo_n "checking whether C compiler accepts -msse2... " >&6; } -if ${ax_cv_check_cflags___msse2+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_EMMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse2" >&5 +printf %s "checking whether C compiler accepts -msse2... " >&6; } +if test ${ax_cv_check_cflags___msse2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse2" @@ -16972,43 +18184,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse2=yes -else +else $as_nop ax_cv_check_cflags___msse2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 -$as_echo "$ax_cv_check_cflags___msse2" >&6; } -if test "x$ax_cv_check_cflags___msse2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse2" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse2" >&6; } +if test "x$ax_cv_check_cflags___msse2" = xyes +then : CFLAGS_SSE2="-msse2" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse3" >&5 -$as_echo_n "checking whether C compiler accepts -msse3... " >&6; } -if ${ax_cv_check_cflags___msse3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse3" >&5 +printf %s "checking whether C compiler accepts -msse3... " >&6; } +if test ${ax_cv_check_cflags___msse3+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse3" @@ -17016,32 +18232,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse3=yes -else +else $as_nop ax_cv_check_cflags___msse3=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 -$as_echo "$ax_cv_check_cflags___msse3" >&6; } -if test "x$ax_cv_check_cflags___msse3" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse3" >&6; } +if test "x$ax_cv_check_cflags___msse3" = xyes +then : CFLAGS="$CFLAGS -msse3" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE3 instructions set" >&5 -$as_echo_n "checking for SSE3 instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE3 instructions set" >&5 +printf %s "checking for SSE3 instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17049,7 +18268,7 @@ #include int -main () +main (void) { __m128 x = _mm_addsub_ps(_mm_cvtpd_ps(_mm_setzero_pd()), _mm_cvtpd_ps(_mm_setzero_pd())); @@ -17057,17 +18276,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_PMMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse3" >&5 -$as_echo_n "checking whether C compiler accepts -msse3... " >&6; } -if ${ax_cv_check_cflags___msse3+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_PMMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse3" >&5 +printf %s "checking whether C compiler accepts -msse3... " >&6; } +if test ${ax_cv_check_cflags___msse3+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse3" @@ -17075,43 +18296,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse3=yes -else +else $as_nop ax_cv_check_cflags___msse3=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 -$as_echo "$ax_cv_check_cflags___msse3" >&6; } -if test "x$ax_cv_check_cflags___msse3" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse3" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse3" >&6; } +if test "x$ax_cv_check_cflags___msse3" = xyes +then : CFLAGS_SSE3="-msse3" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mssse3" >&5 -$as_echo_n "checking whether C compiler accepts -mssse3... " >&6; } -if ${ax_cv_check_cflags___mssse3+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mssse3" >&5 +printf %s "checking whether C compiler accepts -mssse3... " >&6; } +if test ${ax_cv_check_cflags___mssse3+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mssse3" @@ -17119,32 +18344,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mssse3=yes -else +else $as_nop ax_cv_check_cflags___mssse3=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 -$as_echo "$ax_cv_check_cflags___mssse3" >&6; } -if test "x$ax_cv_check_cflags___mssse3" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 +printf "%s\n" "$ax_cv_check_cflags___mssse3" >&6; } +if test "x$ax_cv_check_cflags___mssse3" = xyes +then : CFLAGS="$CFLAGS -mssse3" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSSE3 instructions set" >&5 -$as_echo_n "checking for SSSE3 instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSSE3 instructions set" >&5 +printf %s "checking for SSSE3 instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17152,24 +18380,26 @@ #include int -main () +main (void) { __m64 x = _mm_abs_pi32(_m_from_int(0)); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_TMMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mssse3" >&5 -$as_echo_n "checking whether C compiler accepts -mssse3... " >&6; } -if ${ax_cv_check_cflags___mssse3+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_TMMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mssse3" >&5 +printf %s "checking whether C compiler accepts -mssse3... " >&6; } +if test ${ax_cv_check_cflags___mssse3+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mssse3" @@ -17177,43 +18407,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mssse3=yes -else +else $as_nop ax_cv_check_cflags___mssse3=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 -$as_echo "$ax_cv_check_cflags___mssse3" >&6; } -if test "x$ax_cv_check_cflags___mssse3" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mssse3" >&5 +printf "%s\n" "$ax_cv_check_cflags___mssse3" >&6; } +if test "x$ax_cv_check_cflags___mssse3" = xyes +then : CFLAGS_SSSE3="-mssse3" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse4.1" >&5 -$as_echo_n "checking whether C compiler accepts -msse4.1... " >&6; } -if ${ax_cv_check_cflags___msse4_1+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse4.1" >&5 +printf %s "checking whether C compiler accepts -msse4.1... " >&6; } +if test ${ax_cv_check_cflags___msse4_1+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse4.1" @@ -17221,32 +18455,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse4_1=yes -else +else $as_nop ax_cv_check_cflags___msse4_1=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 -$as_echo "$ax_cv_check_cflags___msse4_1" >&6; } -if test "x$ax_cv_check_cflags___msse4_1" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse4_1" >&6; } +if test "x$ax_cv_check_cflags___msse4_1" = xyes +then : CFLAGS="$CFLAGS -msse4.1" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SSE4.1 instructions set" >&5 -$as_echo_n "checking for SSE4.1 instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SSE4.1 instructions set" >&5 +printf %s "checking for SSE4.1 instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17254,24 +18491,26 @@ #include int -main () +main (void) { __m128i x = _mm_minpos_epu16(_mm_setzero_si128()); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_SMMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse4.1" >&5 -$as_echo_n "checking whether C compiler accepts -msse4.1... " >&6; } -if ${ax_cv_check_cflags___msse4_1+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_SMMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -msse4.1" >&5 +printf %s "checking whether C compiler accepts -msse4.1... " >&6; } +if test ${ax_cv_check_cflags___msse4_1+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -msse4.1" @@ -17279,43 +18518,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___msse4_1=yes -else +else $as_nop ax_cv_check_cflags___msse4_1=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 -$as_echo "$ax_cv_check_cflags___msse4_1" >&6; } -if test "x$ax_cv_check_cflags___msse4_1" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___msse4_1" >&5 +printf "%s\n" "$ax_cv_check_cflags___msse4_1" >&6; } +if test "x$ax_cv_check_cflags___msse4_1" = xyes +then : CFLAGS_SSE41="-msse4.1" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx" >&5 -$as_echo_n "checking whether C compiler accepts -mavx... " >&6; } -if ${ax_cv_check_cflags___mavx+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx" >&5 +printf %s "checking whether C compiler accepts -mavx... " >&6; } +if test ${ax_cv_check_cflags___mavx+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx" @@ -17323,32 +18566,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx=yes -else +else $as_nop ax_cv_check_cflags___mavx=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 -$as_echo "$ax_cv_check_cflags___mavx" >&6; } -if test "x$ax_cv_check_cflags___mavx" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx" >&6; } +if test "x$ax_cv_check_cflags___mavx" = xyes +then : CFLAGS="$CFLAGS -mavx" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX instructions set" >&5 -$as_echo_n "checking for AVX instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX instructions set" >&5 +printf %s "checking for AVX instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17356,24 +18602,26 @@ #include int -main () +main (void) { _mm256_zeroall(); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_AVXINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx" >&5 -$as_echo_n "checking whether C compiler accepts -mavx... " >&6; } -if ${ax_cv_check_cflags___mavx+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_AVXINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx" >&5 +printf %s "checking whether C compiler accepts -mavx... " >&6; } +if test ${ax_cv_check_cflags___mavx+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx" @@ -17381,43 +18629,47 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx=yes -else +else $as_nop ax_cv_check_cflags___mavx=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 -$as_echo "$ax_cv_check_cflags___mavx" >&6; } -if test "x$ax_cv_check_cflags___mavx" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx" >&6; } +if test "x$ax_cv_check_cflags___mavx" = xyes +then : CFLAGS_AVX="-mavx" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx2" >&5 -$as_echo_n "checking whether C compiler accepts -mavx2... " >&6; } -if ${ax_cv_check_cflags___mavx2+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx2" >&5 +printf %s "checking whether C compiler accepts -mavx2... " >&6; } +if test ${ax_cv_check_cflags___mavx2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx2" @@ -17425,32 +18677,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx2=yes -else +else $as_nop ax_cv_check_cflags___mavx2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 -$as_echo "$ax_cv_check_cflags___mavx2" >&6; } -if test "x$ax_cv_check_cflags___mavx2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx2" >&6; } +if test "x$ax_cv_check_cflags___mavx2" = xyes +then : CFLAGS="$CFLAGS -mavx2" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX2 instructions set" >&5 -$as_echo_n "checking for AVX2 instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX2 instructions set" >&5 +printf %s "checking for AVX2 instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17458,7 +18713,7 @@ #include int -main () +main (void) { __m256 x = _mm256_set1_ps(3.14); @@ -17469,17 +18724,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_AVX2INTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx2" >&5 -$as_echo_n "checking whether C compiler accepts -mavx2... " >&6; } -if ${ax_cv_check_cflags___mavx2+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_AVX2INTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx2" >&5 +printf %s "checking whether C compiler accepts -mavx2... " >&6; } +if test ${ax_cv_check_cflags___mavx2+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx2" @@ -17487,32 +18744,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx2=yes -else +else $as_nop ax_cv_check_cflags___mavx2=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 -$as_echo "$ax_cv_check_cflags___mavx2" >&6; } -if test "x$ax_cv_check_cflags___mavx2" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx2" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx2" >&6; } +if test "x$ax_cv_check_cflags___mavx2" = xyes +then : CFLAGS_AVX2="-mavx2" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if _mm256_broadcastsi128_si256 is correctly defined" >&5 -$as_echo_n "checking if _mm256_broadcastsi128_si256 is correctly defined... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _mm256_broadcastsi128_si256 is correctly defined" >&5 +printf %s "checking if _mm256_broadcastsi128_si256 is correctly defined... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17520,38 +18780,40 @@ #include int -main () +main (void) { __m256i y = _mm256_broadcastsi128_si256(_mm_setzero_si128()); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define _mm256_broadcastsi128_si256 _mm_broadcastsi128_si256" >>confdefs.h +printf "%s\n" "#define _mm256_broadcastsi128_si256 _mm_broadcastsi128_si256" >>confdefs.h fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx512f" >&5 -$as_echo_n "checking whether C compiler accepts -mavx512f... " >&6; } -if ${ax_cv_check_cflags___mavx512f+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx512f" >&5 +printf %s "checking whether C compiler accepts -mavx512f... " >&6; } +if test ${ax_cv_check_cflags___mavx512f+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx512f" @@ -17559,32 +18821,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx512f=yes -else +else $as_nop ax_cv_check_cflags___mavx512f=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 -$as_echo "$ax_cv_check_cflags___mavx512f" >&6; } -if test "x$ax_cv_check_cflags___mavx512f" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx512f" >&6; } +if test "x$ax_cv_check_cflags___mavx512f" = xyes +then : CFLAGS="$CFLAGS -mavx512f" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AVX512F instructions set" >&5 -$as_echo_n "checking for AVX512F instructions set... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AVX512F instructions set" >&5 +printf %s "checking for AVX512F instructions set... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17592,7 +18857,7 @@ #include int -main () +main (void) { @@ -17615,17 +18880,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_AVX512FINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx512f" >&5 -$as_echo_n "checking whether C compiler accepts -mavx512f... " >&6; } -if ${ax_cv_check_cflags___mavx512f+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_AVX512FINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mavx512f" >&5 +printf %s "checking whether C compiler accepts -mavx512f... " >&6; } +if test ${ax_cv_check_cflags___mavx512f+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mavx512f" @@ -17633,39 +18900,43 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mavx512f=yes -else +else $as_nop ax_cv_check_cflags___mavx512f=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 -$as_echo "$ax_cv_check_cflags___mavx512f" >&6; } -if test "x$ax_cv_check_cflags___mavx512f" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mavx512f" >&5 +printf "%s\n" "$ax_cv_check_cflags___mavx512f" >&6; } +if test "x$ax_cv_check_cflags___mavx512f" = xyes +then : CFLAGS_AVX512F="-mavx512f" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - as_CACHEVAR=`$as_echo "ax_cv_check_cflags__$CFLAGS -mno-avx512f" | $as_tr_sh` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -mno-avx512f" >&5 -$as_echo_n "checking whether C compiler accepts $CFLAGS -mno-avx512f... " >&6; } -if eval \${$as_CACHEVAR+:} false; then : - $as_echo_n "(cached) " >&6 -else +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + as_CACHEVAR=`printf "%s\n" "ax_cv_check_cflags__$CFLAGS -mno-avx512f" | $as_tr_sh` +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts $CFLAGS -mno-avx512f" >&5 +printf %s "checking whether C compiler accepts $CFLAGS -mno-avx512f... " >&6; } +if eval test \${$as_CACHEVAR+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS $CFLAGS -mno-avx512f" @@ -17673,42 +18944,46 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : eval "$as_CACHEVAR=yes" -else +else $as_nop eval "$as_CACHEVAR=no" fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi eval ac_res=\$$as_CACHEVAR - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -if eval test \"x\$"$as_CACHEVAR"\" = x"yes"; then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +printf "%s\n" "$ac_res" >&6; } +if eval test \"x\$"$as_CACHEVAR"\" = x"yes" +then : CFLAGS="$CFLAGS -mno-avx512f" -else +else $as_nop : fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -maes" >&5 -$as_echo_n "checking whether C compiler accepts -maes... " >&6; } -if ${ax_cv_check_cflags___maes+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -maes" >&5 +printf %s "checking whether C compiler accepts -maes... " >&6; } +if test ${ax_cv_check_cflags___maes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -maes" @@ -17716,35 +18991,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___maes=yes -else +else $as_nop ax_cv_check_cflags___maes=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 -$as_echo "$ax_cv_check_cflags___maes" >&6; } -if test "x$ax_cv_check_cflags___maes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 +printf "%s\n" "$ax_cv_check_cflags___maes" >&6; } +if test "x$ax_cv_check_cflags___maes" = xyes +then : CFLAGS="$CFLAGS -maes" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 -$as_echo_n "checking whether C compiler accepts -mpclmul... " >&6; } -if ${ax_cv_check_cflags___mpclmul+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 +printf %s "checking whether C compiler accepts -mpclmul... " >&6; } +if test ${ax_cv_check_cflags___mpclmul+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mpclmul" @@ -17752,32 +19031,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mpclmul=yes -else +else $as_nop ax_cv_check_cflags___mpclmul=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 -$as_echo "$ax_cv_check_cflags___mpclmul" >&6; } -if test "x$ax_cv_check_cflags___mpclmul" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 +printf "%s\n" "$ax_cv_check_cflags___mpclmul" >&6; } +if test "x$ax_cv_check_cflags___mpclmul" = xyes +then : CFLAGS="$CFLAGS -mpclmul" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for AESNI instructions set and PCLMULQDQ" >&5 -$as_echo_n "checking for AESNI instructions set and PCLMULQDQ... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for AESNI instructions set and PCLMULQDQ" >&5 +printf %s "checking for AESNI instructions set and PCLMULQDQ... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17786,7 +19068,7 @@ #include int -main () +main (void) { __m128i x = _mm_aesimc_si128(_mm_setzero_si128()); __m128i y = _mm_clmulepi64_si128(_mm_setzero_si128(), _mm_setzero_si128(), 0); @@ -17794,17 +19076,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_WMMINTRIN_H 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -maes" >&5 -$as_echo_n "checking whether C compiler accepts -maes... " >&6; } -if ${ax_cv_check_cflags___maes+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_WMMINTRIN_H 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -maes" >&5 +printf %s "checking whether C compiler accepts -maes... " >&6; } +if test ${ax_cv_check_cflags___maes+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -maes" @@ -17812,35 +19096,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___maes=yes -else +else $as_nop ax_cv_check_cflags___maes=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 -$as_echo "$ax_cv_check_cflags___maes" >&6; } -if test "x$ax_cv_check_cflags___maes" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___maes" >&5 +printf "%s\n" "$ax_cv_check_cflags___maes" >&6; } +if test "x$ax_cv_check_cflags___maes" = xyes +then : CFLAGS_AESNI="-maes" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 -$as_echo_n "checking whether C compiler accepts -mpclmul... " >&6; } -if ${ax_cv_check_cflags___mpclmul+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mpclmul" >&5 +printf %s "checking whether C compiler accepts -mpclmul... " >&6; } +if test ${ax_cv_check_cflags___mpclmul+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mpclmul" @@ -17848,44 +19136,48 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mpclmul=yes -else +else $as_nop ax_cv_check_cflags___mpclmul=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 -$as_echo "$ax_cv_check_cflags___mpclmul" >&6; } -if test "x$ax_cv_check_cflags___mpclmul" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mpclmul" >&5 +printf "%s\n" "$ax_cv_check_cflags___mpclmul" >&6; } +if test "x$ax_cv_check_cflags___mpclmul" = xyes +then : CFLAGS_PCLMUL="-mpclmul" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" oldcflags="$CFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mrdrnd" >&5 -$as_echo_n "checking whether C compiler accepts -mrdrnd... " >&6; } -if ${ax_cv_check_cflags___mrdrnd+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mrdrnd" >&5 +printf %s "checking whether C compiler accepts -mrdrnd... " >&6; } +if test ${ax_cv_check_cflags___mrdrnd+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mrdrnd" @@ -17893,32 +19185,35 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mrdrnd=yes -else +else $as_nop ax_cv_check_cflags___mrdrnd=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 -$as_echo "$ax_cv_check_cflags___mrdrnd" >&6; } -if test "x$ax_cv_check_cflags___mrdrnd" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 +printf "%s\n" "$ax_cv_check_cflags___mrdrnd" >&6; } +if test "x$ax_cv_check_cflags___mrdrnd" = xyes +then : CFLAGS="$CFLAGS -mrdrnd" -else +else $as_nop : fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for RDRAND" >&5 -$as_echo_n "checking for RDRAND... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for RDRAND" >&5 +printf %s "checking for RDRAND... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17926,24 +19221,26 @@ #include int -main () +main (void) { unsigned long long x; _rdrand64_step(&x); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_RDRAND 1" >>confdefs.h - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mrdrnd" >&5 -$as_echo_n "checking whether C compiler accepts -mrdrnd... " >&6; } -if ${ax_cv_check_cflags___mrdrnd+:} false; then : - $as_echo_n "(cached) " >&6 -else +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_RDRAND 1" >>confdefs.h + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -mrdrnd" >&5 +printf %s "checking whether C compiler accepts -mrdrnd... " >&6; } +if test ${ax_cv_check_cflags___mrdrnd+y} +then : + printf %s "(cached) " >&6 +else $as_nop ax_check_save_flags=$CFLAGS CFLAGS="$CFLAGS -mrdrnd" @@ -17951,36 +19248,39 @@ /* end confdefs.h. */ #include int -main () +main (void) { time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ax_cv_check_cflags___mrdrnd=yes -else +else $as_nop ax_cv_check_cflags___mrdrnd=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext CFLAGS=$ax_check_save_flags fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 -$as_echo "$ax_cv_check_cflags___mrdrnd" >&6; } -if test "x$ax_cv_check_cflags___mrdrnd" = xyes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___mrdrnd" >&5 +printf "%s\n" "$ax_cv_check_cflags___mrdrnd" >&6; } +if test "x$ax_cv_check_cflags___mrdrnd" = xyes +then : CFLAGS_RDRAND="-mrdrnd" -else +else $as_nop : fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS="$oldcflags" @@ -17998,73 +19298,82 @@ -for ac_header in sys/mman.h sys/random.h intrin.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_header_compile "$LINENO" "sys/mman.h" "ac_cv_header_sys_mman_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_mman_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_MMAN_H 1" >>confdefs.h fi +ac_fn_c_check_header_compile "$LINENO" "sys/random.h" "ac_cv_header_sys_random_h" "$ac_includes_default" +if test "x$ac_cv_header_sys_random_h" = xyes +then : + printf "%s\n" "#define HAVE_SYS_RANDOM_H 1" >>confdefs.h -done +fi +ac_fn_c_check_header_compile "$LINENO" "intrin.h" "ac_cv_header_intrin_h" "$ac_includes_default" +if test "x$ac_cv_header_intrin_h" = xyes +then : + printf "%s\n" "#define HAVE_INTRIN_H 1" >>confdefs.h + +fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if _xgetbv() is available" >&5 -$as_echo_n "checking if _xgetbv() is available... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if _xgetbv() is available" >&5 +printf %s "checking if _xgetbv() is available... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { (void) _xgetbv(0) ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE__XGETBV 1" >>confdefs.h +printf "%s\n" "#define HAVE__XGETBV 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 -$as_echo_n "checking for inline... " >&6; } -if ${ac_cv_c_inline+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 +printf %s "checking for inline... " >&6; } +if test ${ac_cv_c_inline+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; -static $ac_kw foo_t static_foo () {return 0; } -$ac_kw foo_t foo () {return 0; } +static $ac_kw foo_t static_foo (void) {return 0; } +$ac_kw foo_t foo (void) {return 0; } #endif _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_inline=$ac_kw fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 -$as_echo "$ac_cv_c_inline" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 +printf "%s\n" "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; @@ -18088,11 +19397,12 @@ *) : ;; esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } -if ${ac_cv_c_bigendian+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 +printf %s "checking whether byte ordering is bigendian... " >&6; } +if test ${ac_cv_c_bigendian+y} +then : + printf %s "(cached) " >&6 +else $as_nop ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18103,7 +19413,8 @@ typedef int dummy; _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # Check for potential -arch flags. It is not universal unless # there are at least two -arch flags with different values. @@ -18127,7 +19438,7 @@ fi done fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $ac_cv_c_bigendian = unknown; then # See if sys/param.h defines the BYTE_ORDER macro. cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -18136,7 +19447,7 @@ #include int -main () +main (void) { #if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ @@ -18148,7 +19459,8 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18156,7 +19468,7 @@ #include int -main () +main (void) { #if BYTE_ORDER != BIG_ENDIAN not big endian @@ -18166,14 +19478,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). @@ -18182,7 +19495,7 @@ #include int -main () +main (void) { #if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) bogus endian macros @@ -18192,14 +19505,15 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : # It does; now see whether it defined to _BIG_ENDIAN or not. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { #ifndef _BIG_ENDIAN not big endian @@ -18209,31 +19523,33 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : ac_cv_c_bigendian=yes -else +else $as_nop ac_cv_c_bigendian=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi if test $ac_cv_c_bigendian = unknown; then # Compile a test program. - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes +then : # Try to guess by grepping values from an object file. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -short int ascii_mm[] = +unsigned short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = + unsigned short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; int use_ascii (int i) { return ascii_mm[i] + ascii_ii[i]; } - short int ebcdic_ii[] = + unsigned short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = + unsigned short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; @@ -18241,14 +19557,15 @@ extern int foo; int -main () +main (void) { return use_ascii (foo) == use_ebcdic (foo); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then ac_cv_c_bigendian=yes fi @@ -18261,13 +19578,13 @@ fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int -main () +main (void) { /* Are we little or big endian? From Harbison&Steele. */ @@ -18283,9 +19600,10 @@ return 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_bigendian=no -else +else $as_nop ac_cv_c_bigendian=yes fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18294,16 +19612,16 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 +printf "%s\n" "$ac_cv_c_bigendian" >&6; } case $ac_cv_c_bigendian in #( yes) -$as_echo "#define NATIVE_BIG_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define NATIVE_BIG_ENDIAN 1" >>confdefs.h ;; #( no) -$as_echo "#define NATIVE_LITTLE_ENDIAN 1" >>confdefs.h +printf "%s\n" "#define NATIVE_LITTLE_ENDIAN 1" >>confdefs.h ;; #( universal) as_fn_error $? "universal endianness is not supported - compile separately and use lipo(1)" "$LINENO" 5 @@ -18314,8 +19632,8 @@ esac -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __STDC_LIMIT_MACROS is required" >&5 -$as_echo_n "checking whether __STDC_LIMIT_MACROS is required... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __STDC_LIMIT_MACROS is required" >&5 +printf %s "checking whether __STDC_LIMIT_MACROS is required... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18323,7 +19641,7 @@ #include int -main () +main (void) { (void) SIZE_MAX; @@ -18333,25 +19651,26 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } CPPFLAGS="$CPPFLAGS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use inline asm code" >&5 -$as_echo_n "checking whether we can use inline asm code... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use inline asm code" >&5 +printf %s "checking whether we can use inline asm code... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { int a = 42; @@ -18362,30 +19681,32 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_INLINE_ASM 1" >>confdefs.h +printf "%s\n" "#define HAVE_INLINE_ASM 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext HAVE_AMD64_ASM_V=0 -if test "$enable_asm" != "no"; then : +if test "$enable_asm" != "no" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can use x86_64 asm code" >&5 -$as_echo_n "checking whether we can use x86_64 asm code... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can use x86_64 asm code" >&5 +printf %s "checking whether we can use x86_64 asm code... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__) @@ -18408,18 +19729,20 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_AMD64_ASM 1" >>confdefs.h +printf "%s\n" "#define HAVE_AMD64_ASM 1" >>confdefs.h HAVE_AMD64_ASM_V=1 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi if test $HAVE_AMD64_ASM_V = 1; then @@ -18433,16 +19756,17 @@ HAVE_AVX_ASM_V=0 -if test "$enable_asm" != "no"; then : +if test "$enable_asm" != "no" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can assemble AVX opcodes" >&5 -$as_echo_n "checking whether we can assemble AVX opcodes... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we can assemble AVX opcodes" >&5 +printf %s "checking whether we can assemble AVX opcodes... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__) @@ -18459,18 +19783,20 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_AVX_ASM 1" >>confdefs.h +printf "%s\n" "#define HAVE_AVX_ASM 1" >>confdefs.h HAVE_AVX_ASM_V=1 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi if test $HAVE_AVX_ASM_V = 1; then @@ -18483,8 +19809,8 @@ -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for 128-bit arithmetic" >&5 -$as_echo_n "checking for 128-bit arithmetic... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 128-bit arithmetic" >&5 +printf %s "checking for 128-bit arithmetic... " >&6; } HAVE_TI_MODE_V=0 cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18515,7 +19841,7 @@ } int -main () +main (void) { (void) fcontract; @@ -18524,18 +19850,19 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_compile "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_TI_MODE 1" >>confdefs.h +printf "%s\n" "#define HAVE_TI_MODE 1" >>confdefs.h HAVE_TI_MODE_V=1 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test $HAVE_TI_MODE_V = 1; then HAVE_TI_MODE_TRUE= HAVE_TI_MODE_FALSE='#' @@ -18547,15 +19874,16 @@ HAVE_CPUID_V=0 -if test "$enable_asm" != "no"; then : +if test "$enable_asm" != "no" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cpuid instruction" >&5 -$as_echo_n "checking for cpuid instruction... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cpuid instruction" >&5 +printf %s "checking for cpuid instruction... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { unsigned int cpu_info[4]; @@ -18568,32 +19896,35 @@ return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_CPUID 1" >>confdefs.h +printf "%s\n" "#define HAVE_CPUID 1" >>confdefs.h HAVE_CPUID_V=1 -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi asm_hide_symbol="unsupported" -if test "$enable_asm" != "no"; then : +if test "$enable_asm" != "no" +then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the .private_extern asm directive is supported" >&5 -$as_echo_n "checking if the .private_extern asm directive is supported... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the .private_extern asm directive is supported" >&5 +printf %s "checking if the .private_extern asm directive is supported... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { __asm__ __volatile__ (".private_extern dummy_symbol \n" @@ -18609,24 +19940,25 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } asm_hide_symbol=".private_extern" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the .hidden asm directive is supported" >&5 -$as_echo_n "checking if the .hidden asm directive is supported... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the .hidden asm directive is supported" >&5 +printf %s "checking if the .hidden asm directive is supported... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { __asm__ __volatile__ (".hidden dummy_symbol \n" @@ -18642,38 +19974,39 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - if test "$asm_hide_symbol" = "unsupported"; then : +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + if test "$asm_hide_symbol" = "unsupported" +then : asm_hide_symbol=".hidden" -else - { $as_echo "$as_me:${as_lineno-$LINENO}: unable to reliably tag symbols as private" >&5 -$as_echo "$as_me: unable to reliably tag symbols as private" >&6;} +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: unable to reliably tag symbols as private" >&5 +printf "%s\n" "$as_me: unable to reliably tag symbols as private" >&6;} asm_hide_symbol="unsupported" fi -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - if test "$asm_hide_symbol" != "unsupported"; then : + if test "$asm_hide_symbol" != "unsupported" +then : -cat >>confdefs.h <<_ACEOF -#define ASM_HIDE_SYMBOL $asm_hide_symbol -_ACEOF +printf "%s\n" "#define ASM_HIDE_SYMBOL $asm_hide_symbol" >>confdefs.h fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if weak symbols are supported" >&5 -$as_echo_n "checking if weak symbols are supported... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if weak symbols are supported" >&5 +printf %s "checking if weak symbols are supported... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18684,7 +20017,7 @@ void f(void *x) { __dummy(x); } int -main () +main (void) { @@ -18692,21 +20025,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } -$as_echo "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h +printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if data alignment is required" >&5 -$as_echo_n "checking if data alignment is required... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if data alignment is required" >&5 +printf %s "checking if data alignment is required... " >&6; } aligned_access_required=yes case $host_cpu in #( i?86|amd64|x86_64|powerpc*|s390*) : @@ -18720,39 +20054,41 @@ #endif int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_compile "$LINENO" +then : aligned_access_required=no fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; #( *) : ;; esac -if test "x$aligned_access_required" = "xyes"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if test "x$aligned_access_required" = "xyes" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } -$as_echo "#define CPU_UNALIGNED_ACCESS 1" >>confdefs.h +printf "%s\n" "#define CPU_UNALIGNED_ACCESS 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if atomic operations are supported" >&5 -$as_echo_n "checking if atomic operations are supported... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if atomic operations are supported" >&5 +printf %s "checking if atomic operations are supported... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int -main () +main (void) { static volatile int _sodium_lock; @@ -18764,43 +20100,44 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - -$as_echo "#define HAVE_ATOMIC_OPS 1" >>confdefs.h - -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + +printf "%s\n" "#define HAVE_ATOMIC_OPS 1" >>confdefs.h + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : +if test "x$ac_cv_type_size_t" = xyes +then : -else +else $as_nop -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF +printf "%s\n" "#define size_t unsigned int" >>confdefs.h fi # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 -$as_echo_n "checking for working alloca.h... " >&6; } -if ${ac_cv_working_alloca_h+:} false; then : - $as_echo_n "(cached) " >&6 -else +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5 +printf %s "checking for working alloca.h... " >&6; } +if test ${ac_cv_working_alloca_h+y} +then : + printf %s "(cached) " >&6 +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int -main () +main (void) { char *p = (char *) alloca (2 * sizeof (int)); if (p) return 0; @@ -18808,52 +20145,52 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_working_alloca_h=yes -else +else $as_nop ac_cv_working_alloca_h=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 -$as_echo "$ac_cv_working_alloca_h" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5 +printf "%s\n" "$ac_cv_working_alloca_h" >&6; } if test $ac_cv_working_alloca_h = yes; then -$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 -$as_echo_n "checking for alloca... " >&6; } -if ${ac_cv_func_alloca_works+:} false; then : - $as_echo_n "(cached) " >&6 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5 +printf %s "checking for alloca... " >&6; } +if test ${ac_cv_func_alloca_works+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test $ac_cv_working_alloca_h = yes; then + ac_cv_func_alloca_works=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#ifdef __GNUC__ -# define alloca __builtin_alloca -#else -# ifdef _MSC_VER +#include +#include +#ifndef alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _MSC_VER # include # define alloca _alloca # else -# ifdef HAVE_ALLOCA_H -# include -# else -# ifdef _AIX - #pragma alloca -# else -# ifndef alloca /* predefined by HP cc +Olibcalls */ -void *alloca (size_t); -# endif -# endif +# ifdef __cplusplus +extern "C" # endif +void *alloca (size_t); # endif #endif int -main () +main (void) { char *p = (char *) alloca (1); if (p) return 0; @@ -18861,20 +20198,22 @@ return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : ac_cv_func_alloca_works=yes -else +else $as_nop ac_cv_func_alloca_works=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 -$as_echo "$ac_cv_func_alloca_works" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5 +printf "%s\n" "$ac_cv_func_alloca_works" >&6; } +fi if test $ac_cv_func_alloca_works = yes; then -$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h +printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h else # The SVR3 libPW and SVR4 libucb both contain incompatible functions @@ -18884,58 +20223,19 @@ ALLOCA=\${LIBOBJDIR}alloca.$ac_objext -$as_echo "#define C_ALLOCA 1" >>confdefs.h - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5 -$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; } -if ${ac_cv_os_cray+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#if defined CRAY && ! defined CRAY2 -webecray -#else -wenotbecray -#endif - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "webecray" >/dev/null 2>&1; then : - ac_cv_os_cray=yes -else - ac_cv_os_cray=no -fi -rm -f conftest* - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5 -$as_echo "$ac_cv_os_cray" >&6; } -if test $ac_cv_os_cray = yes; then - for ac_func in _getb67 GETB67 getb67; do - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - -cat >>confdefs.h <<_ACEOF -#define CRAY_STACKSEG_END $ac_func -_ACEOF - - break -fi +printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h - done -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 -$as_echo_n "checking stack direction for C alloca... " >&6; } -if ${ac_cv_c_stack_direction+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test "$cross_compiling" = yes; then : +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5 +printf %s "checking stack direction for C alloca... " >&6; } +if test ${ac_cv_c_stack_direction+y} +then : + printf %s "(cached) " >&6 +else $as_nop + if test "$cross_compiling" = yes +then : ac_cv_c_stack_direction=0 -else +else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default @@ -18956,9 +20256,10 @@ return find_stack_direction (0, argc + !argv + 20) < 0; } _ACEOF -if ac_fn_c_try_run "$LINENO"; then : +if ac_fn_c_try_run "$LINENO" +then : ac_cv_c_stack_direction=1 -else +else $as_nop ac_cv_c_stack_direction=-1 fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ @@ -18966,90 +20267,62 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 -$as_echo "$ac_cv_c_stack_direction" >&6; } -cat >>confdefs.h <<_ACEOF -#define STACK_DIRECTION $ac_cv_c_stack_direction -_ACEOF +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5 +printf "%s\n" "$ac_cv_c_stack_direction" >&6; } +printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h fi -if test "x$EMSCRIPTEN" = "x"; then : +if test "x$EMSCRIPTEN" = "x" +then : - for ac_func in arc4random arc4random_buf -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF + ac_fn_c_check_func "$LINENO" "arc4random" "ac_cv_func_arc4random" +if test "x$ac_cv_func_arc4random" = xyes +then : + printf "%s\n" "#define HAVE_ARC4RANDOM 1" >>confdefs.h fi -done - - for ac_func in mmap mlock madvise mprotect -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "arc4random_buf" "ac_cv_func_arc4random_buf" +if test "x$ac_cv_func_arc4random_buf" = xyes +then : + printf "%s\n" "#define HAVE_ARC4RANDOM_BUF 1" >>confdefs.h fi -done - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getrandom with a standard API" >&5 -$as_echo_n "checking for getrandom with a standard API... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + if test "x$WASI" = "x" +then : -#include -#ifdef HAVE_UNISTD_H -# include -#endif -#ifdef HAVE_SYS_RANDOM_H -# include -#endif + ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap" +if test "x$ac_cv_func_mmap" = xyes +then : + printf "%s\n" "#define HAVE_MMAP 1" >>confdefs.h -int -main () -{ +fi +ac_fn_c_check_func "$LINENO" "mlock" "ac_cv_func_mlock" +if test "x$ac_cv_func_mlock" = xyes +then : + printf "%s\n" "#define HAVE_MLOCK 1" >>confdefs.h -unsigned char buf; -(void) getrandom((void *) &buf, 1U, 0U); +fi +ac_fn_c_check_func "$LINENO" "madvise" "ac_cv_func_madvise" +if test "x$ac_cv_func_madvise" = xyes +then : + printf "%s\n" "#define HAVE_MADVISE 1" >>confdefs.h - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - for ac_func in getrandom -do : - ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" -if test "x$ac_cv_func_getrandom" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETRANDOM 1 -_ACEOF +fi +ac_fn_c_check_func "$LINENO" "mprotect" "ac_cv_func_mprotect" +if test "x$ac_cv_func_mprotect" = xyes +then : + printf "%s\n" "#define HAVE_MPROTECT 1" >>confdefs.h fi -done -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getentropy with a standard API" >&5 -$as_echo_n "checking for getentropy with a standard API... " >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getrandom with a standard API" >&5 +printf %s "checking for getrandom with a standard API... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -19060,406 +20333,197 @@ #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif int -main () +main (void) { -#ifdef __APPLE__ -# error getentropy() is currently disabled on Apple operating systems -#endif - unsigned char buf; -(void) getentropy((void *) &buf, 1U); +(void) getrandom((void *) &buf, 1U, 0U); ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - for ac_func in getentropy -do : - ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy" -if test "x$ac_cv_func_getentropy" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_GETENTROPY 1 -_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_fn_c_check_func "$LINENO" "getrandom" "ac_cv_func_getrandom" +if test "x$ac_cv_func_getrandom" = xyes +then : + printf "%s\n" "#define HAVE_GETRANDOM 1" >>confdefs.h fi -done -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -fi -for ac_func in posix_memalign getpid nanosleep -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -for ac_func in memset_s explicit_bzero explicit_memset -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -if eval test \"x\$"$as_ac_var"\" = x"yes"; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - - - -TEST_LDFLAGS='' -if test "x$EMSCRIPTEN" != "x"; then : - - EXEEXT=.js - TEST_LDFLAGS='--memory-init-file 0 --pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' - -fi - - if test "x$EMSCRIPTEN" != "x"; then - EMSCRIPTEN_TRUE= - EMSCRIPTEN_FALSE='#' -else - EMSCRIPTEN_TRUE='#' - EMSCRIPTEN_FALSE= -fi - - if test "x$WASI" != "x"; then - WASI_TRUE= - WASI_FALSE='#' -else - WASI_TRUE='#' - WASI_FALSE= -fi - - - -$as_echo "#define CONFIGURED 1" >>confdefs.h + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getentropy with a standard API" >&5 +printf %s "checking for getentropy with a standard API... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#ifdef HAVE_UNISTD_H +# include +#endif +#ifdef HAVE_SYS_RANDOM_H +# include +#endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif +int +main (void) +{ +unsigned char buf; -enable_win32_dll=yes +if (&getentropy != NULL) { + (void) getentropy((void *) &buf, 1U); +} -case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. -set dummy ${ac_tool_prefix}as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$AS"; then - ac_cv_prog_AS="$AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_AS="${ac_tool_prefix}as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + ac_fn_c_check_func "$LINENO" "getentropy" "ac_cv_func_getentropy" +if test "x$ac_cv_func_getentropy" = xyes +then : + printf "%s\n" "#define HAVE_GETENTROPY 1" >>confdefs.h fi -fi -AS=$ac_cv_prog_AS -if test -n "$AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5 -$as_echo "$AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } fi -if test -z "$ac_cv_prog_AS"; then - ac_ct_AS=$AS - # Extract the first word of "as", so it can be a program name with args. -set dummy as; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_AS+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_AS"; then - ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_AS="as" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext fi -fi -ac_ct_AS=$ac_cv_prog_ac_ct_AS -if test -n "$ac_ct_AS"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5 -$as_echo "$ac_ct_AS" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_AS" = x; then - AS="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AS=$ac_ct_AS - fi -else - AS="$ac_cv_prog_AS" -fi +if test "x$WASI" = "x" +then : - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. -set dummy ${ac_tool_prefix}dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$DLLTOOL"; then - ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + ac_fn_c_check_func "$LINENO" "getpid" "ac_cv_func_getpid" +if test "x$ac_cv_func_getpid" = xyes +then : + printf "%s\n" "#define HAVE_GETPID 1" >>confdefs.h fi -fi -DLLTOOL=$ac_cv_prog_DLLTOOL -if test -n "$DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5 -$as_echo "$DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi + ac_fn_c_check_func "$LINENO" "getauxva" "ac_cv_func_getauxva" +if test "x$ac_cv_func_getauxva" = xyes +then : + printf "%s\n" "#define HAVE_GETAUXVA 1" >>confdefs.h fi -if test -z "$ac_cv_prog_DLLTOOL"; then - ac_ct_DLLTOOL=$DLLTOOL - # Extract the first word of "dlltool", so it can be a program name with args. -set dummy dlltool; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_DLLTOOL"; then - ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_DLLTOOL="dlltool" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +ac_fn_c_check_func "$LINENO" "elf_aux_info" "ac_cv_func_elf_aux_info" +if test "x$ac_cv_func_elf_aux_info" = xyes +then : + printf "%s\n" "#define HAVE_ELF_AUX_INFO 1" >>confdefs.h fi -fi -ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL -if test -n "$ac_ct_DLLTOOL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5 -$as_echo "$ac_ct_DLLTOOL" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_DLLTOOL" = x; then - DLLTOOL="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DLLTOOL=$ac_ct_DLLTOOL - fi -else - DLLTOOL="$ac_cv_prog_DLLTOOL" + fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +ac_fn_c_check_func "$LINENO" "posix_memalign" "ac_cv_func_posix_memalign" +if test "x$ac_cv_func_posix_memalign" = xyes +then : + printf "%s\n" "#define HAVE_POSIX_MEMALIGN 1" >>confdefs.h fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +ac_fn_c_check_func "$LINENO" "nanosleep" "ac_cv_func_nanosleep" +if test "x$ac_cv_func_nanosleep" = xyes +then : + printf "%s\n" "#define HAVE_NANOSLEEP 1" >>confdefs.h + fi -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +if test "x$WASI" = "x" +then : + + ac_fn_c_check_func "$LINENO" "memset_s" "ac_cv_func_memset_s" +if test "x$ac_cv_func_memset_s" = xyes +then : + printf "%s\n" "#define HAVE_MEMSET_S 1" >>confdefs.h fi +ac_fn_c_check_func "$LINENO" "explicit_bzero" "ac_cv_func_explicit_bzero" +if test "x$ac_cv_func_explicit_bzero" = xyes +then : + printf "%s\n" "#define HAVE_EXPLICIT_BZERO 1" >>confdefs.h + fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } +ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset" +if test "x$ac_cv_func_explicit_memset" = xyes +then : + printf "%s\n" "#define HAVE_EXPLICIT_MEMSET 1" >>confdefs.h + fi - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" + fi - ;; -esac -test -z "$AS" && AS=as +TEST_LDFLAGS='' +if test "x$EMSCRIPTEN" != "x" +then : + + EXEEXT=.js + TEST_LDFLAGS='--memory-init-file 0 --pre-js pre.js.inc -s RESERVED_FUNCTION_POINTERS=8' +fi + if test "x$EMSCRIPTEN" != "x"; then + EMSCRIPTEN_TRUE= + EMSCRIPTEN_FALSE='#' +else + EMSCRIPTEN_TRUE='#' + EMSCRIPTEN_FALSE= +fi + if test "x$WASI" != "x"; then + WASI_TRUE= + WASI_FALSE='#' +else + WASI_TRUE='#' + WASI_FALSE= +fi -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$OBJDUMP" && OBJDUMP=objdump +printf "%s\n" "#define CONFIGURED 1" >>confdefs.h - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if gcc/ld supports -Wl,--output-def" >&5 -$as_echo_n "checking if gcc/ld supports -Wl,--output-def... " >&6; } -if ${gl_cv_ld_output_def+:} false; then : - $as_echo_n "(cached) " >&6 -else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if gcc/ld supports -Wl,--output-def" >&5 +printf %s "checking if gcc/ld supports -Wl,--output-def... " >&6; } +if test ${gl_cv_ld_output_def+y} +then : + printf %s "(cached) " >&6 +else $as_nop if test "$enable_shared" = no; then gl_cv_ld_output_def="not needed, shared libraries are disabled" else @@ -19469,26 +20533,27 @@ /* end confdefs.h. */ int -main () +main (void) { ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO"; then : +if ac_fn_c_try_link "$LINENO" +then : gl_cv_ld_output_def=yes -else +else $as_nop gl_cv_ld_output_def=no fi -rm -f core conftest.err conftest.$ac_objext \ +rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext rm -f conftest.def LDFLAGS="$gl_ldflags_save" fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_ld_output_def" >&5 -$as_echo "$gl_cv_ld_output_def" >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_ld_output_def" >&5 +printf "%s\n" "$gl_cv_ld_output_def" >&6; } if test "x$gl_cv_ld_output_def" = "xyes"; then HAVE_LD_OUTPUT_DEF_TRUE= HAVE_LD_OUTPUT_DEF_FALSE='#' @@ -19502,7 +20567,8 @@ -if test "x$ENABLE_CWFLAGS" = "xyes"; then : +if test "x$ENABLE_CWFLAGS" = "xyes" +then : CFLAGS="$CFLAGS $CWFLAGS" @@ -19537,8 +20603,8 @@ case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( @@ -19568,15 +20634,15 @@ /^ac_cv_env_/b end t clear :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else @@ -19590,8 +20656,8 @@ fi fi else - { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -19644,7 +20710,7 @@ for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -19655,14 +20721,14 @@ LTLIBOBJS=$ac_ltlibobjs -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 -$as_echo_n "checking that generated files are newer than configure... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 +printf %s "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 -$as_echo "done" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5 +printf "%s\n" "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' @@ -19683,6 +20749,10 @@ as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then + as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${MINIMAL_TRUE}" && test -z "${MINIMAL_FALSE}"; then as_fn_error $? "conditional \"MINIMAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -19691,10 +20761,6 @@ as_fn_error $? "conditional \"VALGRIND_ENABLED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then - as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${HAVE_AMD64_ASM_TRUE}" && test -z "${HAVE_AMD64_ASM_FALSE}"; then as_fn_error $? "conditional \"HAVE_AMD64_ASM\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -19724,8 +20790,8 @@ ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL @@ -19748,14 +20814,16 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : +as_nop=: +if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 +then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else +else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( @@ -19765,46 +20833,46 @@ fi + +# Reset variables that may have inherited troublesome values from +# the environment. + +# IFS needs to be set, to space, tab, and newline, in precisely that order. +# (If _AS_PATH_WALK were called with IFS unset, it would have the +# side effect of setting IFS to empty, thus disabling word splitting.) +# Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -# Prefer a ksh shell builtin over an external printf program on Solaris, -# but without wasting forks for bash or zsh. -if test -z "$BASH_VERSION$ZSH_VERSION" \ - && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='print -r --' - as_echo_n='print -rn --' -elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in #( - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi +IFS=" "" $as_nl" + +PS1='$ ' +PS2='> ' +PS4='+ ' + +# Ensure predictable behavior from utilities with locale-dependent output. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# We cannot yet rely on "unset" to work, but we need these variables +# to be unset--not just set to an empty or harmless value--now, to +# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct +# also avoids known problems related to "unset" and subshell syntax +# in other old shells (e.g. bash 2.01 and pdksh 5.2.14). +for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH +do eval test \${$as_var+y} \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done + +# Ensure that fds 0, 1, and 2 are open. +if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi +if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then +if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || @@ -19813,13 +20881,6 @@ fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( @@ -19828,8 +20889,12 @@ for as_dir in $PATH do IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS @@ -19841,30 +20906,10 @@ as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi -# Unset variables that we do not need and which cause bugs (e.g. in -# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" -# suppresses any "Segmentation fault" message there. '((' could -# trigger a bug in pdksh 5.2.14. -for as_var in BASH_ENV ENV MAIL MAILPATH -do eval test x\${$as_var+set} = xset \ - && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE - -# CDPATH. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] @@ -19877,13 +20922,14 @@ as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 + printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $2" >&2 + printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error + # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -19910,18 +20956,20 @@ { eval $1=; unset $1;} } as_unset=as_fn_unset + # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. -if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null +then : eval 'as_fn_append () { eval $1+=\$2 }' -else +else $as_nop as_fn_append () { eval $1=\$$1\$2 @@ -19933,12 +20981,13 @@ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. -if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null +then : eval 'as_fn_arith () { as_val=$(( $* )) }' -else +else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` @@ -19969,7 +21018,7 @@ $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -19991,6 +21040,10 @@ as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Determine whether it's possible to make 'echo' print without a newline. +# These variables are no longer used directly by Autoconf, but are AC_SUBSTed +# for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) @@ -20004,6 +21057,12 @@ ECHO_N='-n';; esac +# For backward compatibility with old third-party macros, we provide +# the shell variables $as_echo and $as_echo_n. New code should use +# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. +as_echo='printf %s\n' +as_echo_n='printf %s' + rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -20045,7 +21104,7 @@ as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -20054,7 +21113,7 @@ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20117,7 +21176,7 @@ # values after options handling. ac_log=" This file was extended by libsodium $as_me 1.0.18, which was -generated by GNU Autoconf 2.69. Invocation command line was +generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -20168,17 +21227,19 @@ $config_commands Report bugs to . -libsodium home page: ." +libsodium home page: ." _ACEOF +ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` +ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ libsodium config.status 1.0.18 -configured by $0, generated by GNU Autoconf 2.69, +configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" -Copyright (C) 2012 Free Software Foundation, Inc. +Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -20218,21 +21279,21 @@ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) - $as_echo "$ac_cs_config"; exit ;; + printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; @@ -20260,7 +21321,7 @@ if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" @@ -20274,7 +21335,7 @@ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + printf "%s\n" "$ac_log" } >&5 _ACEOF @@ -20427,7 +21488,6 @@ enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`' old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`' striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`' -AS='`$ECHO "$AS" | $SED "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' @@ -20509,8 +21569,7 @@ install_override_mode \ finish_eval \ old_striplib \ -striplib \ -AS; do +striplib; do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes @@ -20603,8 +21662,8 @@ # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands + test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files + test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree @@ -20832,7 +21891,7 @@ esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done @@ -20840,17 +21899,17 @@ # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | + ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac @@ -20867,7 +21926,7 @@ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -20891,9 +21950,9 @@ case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -20955,8 +22014,8 @@ case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' @@ -21000,9 +22059,9 @@ { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" @@ -21014,8 +22073,8 @@ ;; - :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} + :C) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 +printf "%s\n" "$as_me: executing $ac_file commands" >&6;} ;; esac @@ -21041,7 +22100,7 @@ for am_mf do # Strip MF so we end up with the name of the file. - am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile which includes # dependency-tracking related rules and includes. # Grep'ing the whole file directly is not great: AIX grep has a line @@ -21053,7 +22112,7 @@ X"$am_mf" : 'X\(//\)[^/]' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$am_mf" | +printf "%s\n" X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -21075,7 +22134,7 @@ $as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ X"$am_mf" : 'X\(//\)$' \| \ X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$am_mf" | +printf "%s\n" X/"$am_mf" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -21100,10 +22159,12 @@ (exit $ac_status); } || am_rc=$? done if test $am_rc -ne 0; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "Something went wrong bootstrapping makefile fragments - for automatic dependency tracking. Try re-running configure with the + for automatic dependency tracking. If GNU make was not used, consider + re-running the configure script with MAKE=\"gmake\" (or whatever is + necessary). You can also try re-running configure with the '--disable-dependency-tracking' option to at least be able to build the package (albeit without support for automatic dependency tracking). See \`config.log' for more details" "$LINENO" 5; } @@ -21433,9 +22494,6 @@ old_striplib=$lt_old_striplib striplib=$lt_striplib -# Assembler program. -AS=$lt_AS - # The linker used to build libraries. LD=$lt_LD @@ -21646,6 +22704,7 @@ esac + ltmain=$ac_aux_dir/ltmain.sh @@ -21695,7 +22754,8 @@ $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi + diff -Nru python-nacl-1.4.0/src/libsodium/configure.ac python-nacl-1.5.0/src/libsodium/configure.ac --- python-nacl-1.4.0/src/libsodium/configure.ac 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/configure.ac 2022-01-07 21:54:10.000000000 +0000 @@ -1,12 +1,10 @@ -AC_PREREQ([2.65]) -AC_INIT([libsodium],[1.0.18], - [https://github.com/jedisct1/libsodium/issues], - [libsodium], - [https://github.com/jedisct1/libsodium]) +AC_PREREQ([2.69]) +AC_INIT([libsodium],[1.0.18],[https://github.com/jedisct1/libsodium/issues],[libsodium],[https://libsodium.org]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/libsodium/sodium/version.c]) AC_CANONICAL_HOST +AC_CANONICAL_TARGET AM_INIT_AUTOMAKE([1.11 dist-bzip2 tar-ustar foreign subdir-objects]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AM_MAINTAINER_MODE @@ -44,6 +42,10 @@ [AC_MSG_ERROR([The build directory contains whitespaces - This can cause tests/installation to fail due to limitations of some libtool versions])] ) +AC_PROG_CC +AM_PROG_AS +AC_USE_SYSTEM_EXTENSIONS + dnl Switches AC_ARG_ENABLE(ssp, @@ -87,7 +89,7 @@ [AS_HELP_STRING(--disable-pie,Do not produce position independent executables)], enable_pie=$enableval, enable_pie="maybe") -AS_CASE([$host_os], [mingw*|cygwin*|msys], [enable_pie="no"]) +AS_CASE([$host_os], [mingw*|cygwin*|msys|eabi*], [enable_pie="no"]) AC_ARG_ENABLE(blocking-random, [AS_HELP_STRING(--enable-blocking-random,Enable this switch only if /dev/urandom is totally broken on the target platform)], @@ -115,7 +117,7 @@ AM_CONDITIONAL([MINIMAL], [test x$enable_minimal = xyes]) AC_SUBST(SODIUM_LIBRARY_MINIMAL_DEF) -AC_ARG_WITH(pthreads, AC_HELP_STRING([--with-pthreads], +AC_ARG_WITH(pthreads, AS_HELP_STRING([--with-pthreads], [use pthreads library, or --without-pthreads to disable threading support.]), [ ], [withval="yes"]) @@ -210,22 +212,16 @@ dnl Checks -AC_PROG_CC_C99 -AM_PROG_AS -AC_USE_SYSTEM_EXTENSIONS AC_C_VARARRAYS AC_CHECK_DEFINE([__wasi__], [WASI="yes"], []) -AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [ - AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2], - [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"]) -]) +AS_CASE([$host_os], [linux-gnu], [AX_ADD_FORTIFY_SOURCE], [ ]) AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CFLAGS="$CFLAGS -fvisibility=hidden"]) -AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*], [ ], [ +AS_CASE([$host_os], [cygwin*|mingw*|msys|pw32*|cegcc*|eabi*], [ ], [ AX_CHECK_COMPILE_FLAG([-fPIC], [CFLAGS="$CFLAGS -fPIC"]) ]) @@ -262,7 +258,7 @@ LIBTOOL_OLD_FLAGS="$LIBTOOL_EXTRA_FLAGS" LIBTOOL_EXTRA_FLAGS="$LIBTOOL_EXTRA_FLAGS -version-info $SODIUM_LIBRARY_VERSION" AC_ARG_ENABLE(soname-versions, - [AC_HELP_STRING([--enable-soname-versions], [enable soname versions (must be disabled for Android) (default: enabled)])], + [AS_HELP_STRING([--enable-soname-versions], [enable soname versions (must be disabled for Android) (default: enabled)])], [ AS_IF([test "x$enableval" = "xno"], [ LIBTOOL_EXTRA_FLAGS="$LIBTOOL_OLD_FLAGS -avoid-version" @@ -278,16 +274,33 @@ ]) AS_CASE([$host_os], - [cygwin*|mingw*|msys|pw32*|cegcc*], [ + [cygwin*|mingw*|msys|pw32*|cegcc*|eabi*], [ AX_CHECK_COMPILE_FLAG([-fno-asynchronous-unwind-tables], [ [CFLAGS="$CFLAGS -fno-asynchronous-unwind-tables"] ]) ]) +AC_MSG_CHECKING(for a broken Xcode version) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ +#if !defined(__APPLE_CC__) || __APPLE_CC__ != 6000 +#error Not Apple +#endif +#if !defined(__clang_major__) || __clang_major__ != 11 +#error Not Xcode 11 +#endif +]])], + [AC_MSG_RESULT(yes) + AC_MSG_WARN([Using unsupported Xcode version]) + AX_CHECK_COMPILE_FLAG([$CFLAGS -fno-stack-check], + [CFLAGS="$CFLAGS -fno-stack-check"]) + ], + [AC_MSG_RESULT(no) +]) + AS_IF([test "x$enable_ssp" != "xno"],[ AS_CASE([$host_os], - [cygwin*|mingw*|msys|pw32*|cegcc*|haiku|none], [ ], + [cygwin*|mingw*|msys|pw32*|cegcc*|haiku|none|eabi*], [ ], [*], [ AX_CHECK_COMPILE_FLAG([-fstack-protector], [ AX_CHECK_LINK_FLAG([-fstack-protector], @@ -343,9 +356,11 @@ AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wvariable-decl], [CWFLAGS="$CWFLAGS -Wvariable-decl"]) AX_CHECK_COMPILE_FLAG([$CWFLAGS -Wwrite-strings], [CWFLAGS="$CWFLAGS -Wwrite-strings"]) -AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"]) -AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"]) -AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"]) +AS_IF([test "x$EMSCRIPTEN" = "x"], [ + AX_CHECK_LINK_FLAG([-Wl,-z,relro], [LDFLAGS="$LDFLAGS -Wl,-z,relro"]) + AX_CHECK_LINK_FLAG([-Wl,-z,now], [LDFLAGS="$LDFLAGS -Wl,-z,now"]) + AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [LDFLAGS="$LDFLAGS -Wl,-z,noexecstack"]) +]) AX_CHECK_CATCHABLE_SEGV AX_CHECK_CATCHABLE_ABRT @@ -605,7 +620,7 @@ HAVE_AMD64_ASM_V=0 AS_IF([test "$enable_asm" != "no"],[ AC_MSG_CHECKING(whether we can use x86_64 asm code) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__) # if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(_WIN32) || defined(_WIN64) @@ -634,7 +649,7 @@ HAVE_AVX_ASM_V=0 AS_IF([test "$enable_asm" != "no"],[ AC_MSG_CHECKING(whether we can assemble AVX opcodes) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ #if defined(__amd64) || defined(__amd64__) || defined(__x86_64__) # if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(_WIN32) || defined(_WIN64) @@ -694,7 +709,7 @@ HAVE_CPUID_V=0 AS_IF([test "$enable_asm" != "no"],[ AC_MSG_CHECKING(for cpuid instruction) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ ]], [[ unsigned int cpu_info[4]; __asm__ __volatile__ ("xchgl %%ebx, %k1; cpuid; xchgl %%ebx, %k1" : "=a" (cpu_info[0]), "=&r" (cpu_info[1]), @@ -795,7 +810,9 @@ AC_FUNC_ALLOCA AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_CHECK_FUNCS([arc4random arc4random_buf]) - AC_CHECK_FUNCS([mmap mlock madvise mprotect]) + AS_IF([test "x$WASI" = "x"],[ + AC_CHECK_FUNCS([mmap mlock madvise mprotect]) + ]) AC_MSG_CHECKING(for getrandom with a standard API) AC_LINK_IFELSE([AC_LANG_PROGRAM([[ @@ -806,6 +823,9 @@ #ifdef HAVE_SYS_RANDOM_H # include #endif +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions +#endif ]], [[ unsigned char buf; (void) getrandom((void *) &buf, 1U, 0U); @@ -824,21 +844,32 @@ #ifdef HAVE_SYS_RANDOM_H # include #endif -]], [[ -#ifdef __APPLE__ -# error getentropy() is currently disabled on Apple operating systems +#ifdef __SANITIZE_ADDRESS__ +# error A recent libasan version on an old system may intercept nonexistent functions #endif - +]], [[ unsigned char buf; -(void) getentropy((void *) &buf, 1U); + +if (&getentropy != NULL) { + (void) getentropy((void *) &buf, 1U); +} ]])], [AC_MSG_RESULT(yes) AC_CHECK_FUNCS([getentropy])], [AC_MSG_RESULT(no) ]) ]) -AC_CHECK_FUNCS([posix_memalign getpid nanosleep]) -AC_CHECK_FUNCS([memset_s explicit_bzero explicit_memset]) + +AS_IF([test "x$WASI" = "x"],[ + AC_CHECK_FUNCS([getpid]) + AC_CHECK_FUNCS([getauxva elf_aux_info]) +]) + +AC_CHECK_FUNCS([posix_memalign nanosleep]) + +AS_IF([test "x$WASI" = "x"],[ + AC_CHECK_FUNCS([memset_s explicit_bzero explicit_memset]) +]) AC_SUBST([LIBTOOL_EXTRA_FLAGS]) @@ -855,8 +886,7 @@ dnl Libtool. -LT_INIT([dlopen]) -AC_LIBTOOL_WIN32_DLL +LT_INIT([dlopen win32-dll]) gl_LD_OUTPUT_DEF dnl Output. diff -Nru python-nacl-1.4.0/src/libsodium/contrib/Findsodium.cmake python-nacl-1.5.0/src/libsodium/contrib/Findsodium.cmake --- python-nacl-1.4.0/src/libsodium/contrib/Findsodium.cmake 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/contrib/Findsodium.cmake 2022-01-07 21:54:10.000000000 +0000 @@ -213,7 +213,7 @@ string( REGEX REPLACE - ".*#[ \t]*define[ \t]*sodium_VERSION_STRING_STRING[ \t]*\"([^\n]*)\".*" + ".*define[ \t]+SODIUM_VERSION_STRING[^\"]+\"([^\"]+)\".*" "\\1" sodium_VERSION_STRING "${_VERSION_HEADER_CONTENT}") diff -Nru python-nacl-1.4.0/src/libsodium/contrib/Makefile.in python-nacl-1.5.0/src/libsodium/contrib/Makefile.in --- python-nacl-1.4.0/src/libsodium/contrib/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/contrib/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,9 +87,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = contrib ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -133,7 +135,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -217,6 +218,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -277,11 +279,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/android-build.sh python-nacl-1.5.0/src/libsodium/dist-build/android-build.sh --- python-nacl-1.4.0/src/libsodium/dist-build/android-build.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/android-build.sh 2022-01-07 21:54:10.000000000 +0000 @@ -10,7 +10,7 @@ if [ -z "$ANDROID_NDK_HOME" ]; then echo "You should probably set ANDROID_NDK_HOME to the directory containing" echo "the Android NDK" - exit + exit 1 fi if [ ! -f ./configure ]; then diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/apple-xcframework.sh python-nacl-1.5.0/src/libsodium/dist-build/apple-xcframework.sh --- python-nacl-1.4.0/src/libsodium/dist-build/apple-xcframework.sh 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/apple-xcframework.sh 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,448 @@ +#! /bin/sh + +export PREFIX="$(pwd)/libsodium-apple" +export MACOS_ARM64_PREFIX="${PREFIX}/tmp/macos-arm64" +export MACOS_X86_64_PREFIX="${PREFIX}/tmp/macos-x86_64" +export IOS32_PREFIX="${PREFIX}/tmp/ios32" +export IOS32s_PREFIX="${PREFIX}/tmp/ios32s" +export IOS64_PREFIX="${PREFIX}/tmp/ios64" +export IOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/ios-simulator-arm64" +export IOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/ios-simulator-i386" +export IOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/ios-simulator-x86_64" +export WATCHOS32_PREFIX="${PREFIX}/tmp/watchos32" +export WATCHOS64_32_PREFIX="${PREFIX}/tmp/watchos64_32" +export WATCHOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/watchos-simulator-arm64" +export WATCHOS_SIMULATOR_I386_PREFIX="${PREFIX}/tmp/watchos-simulator-i386" +export WATCHOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/watchos-simulator-x86_64" +export TVOS64_PREFIX="${PREFIX}/tmp/tvos64" +export TVOS_SIMULATOR_ARM64_PREFIX="${PREFIX}/tmp/tvos-simulator-arm64" +export TVOS_SIMULATOR_X86_64_PREFIX="${PREFIX}/tmp/tvos-simulator-x86_64" +export CATALYST_ARM64_PREFIX="${PREFIX}/tmp/catalyst-arm64" +export CATALYST_X86_64_PREFIX="${PREFIX}/tmp/catalyst-x86_64" +export LOG_FILE="${PREFIX}/tmp/build_log" +export XCODEDIR="$(xcode-select -p)" + +export MACOS_VERSION_MIN=${MACOS_VERSION_MIN-"10.10"} +export IOS_SIMULATOR_VERSION_MIN=${IOS_SIMULATOR_VERSION_MIN-"9.0.0"} +export IOS_VERSION_MIN=${IOS_VERSION_MIN-"9.0.0"} +export WATCHOS_SIMULATOR_VERSION_MIN=${WATCHOS_SIMULATOR_VERSION_MIN-"4.0.0"} +export WATCHOS_VERSION_MIN=${WATCHOS_VERSION_MIN-"4.0.0"} +export TVOS_SIMULATOR_VERSION_MIN=${TVOS_SIMULATOR_VERSION_MIN-"9.0.0"} +export TVOS_VERSION_MIN=${TVOS_VERSION_MIN-"9.0.0"} + +echo +echo "Warnings related to headers being present but not usable are due to functions" +echo "that didn't exist in the specified minimum iOS version level." +echo "They can be safely ignored." +echo + +if [ -z "$LIBSODIUM_FULL_BUILD" ]; then + export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" +else + export LIBSODIUM_ENABLE_MINIMAL_FLAG="" +fi + +APPLE_SILICON_SUPPORTED=false +echo 'int main(void){return 0;}' >comptest.c && cc --target=arm64-macos comptest.c 2>/dev/null && APPLE_SILICON_SUPPORTED=true +rm -f comptest.c + +NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) +PROCESSORS=${NPROCESSORS:-3} + +swift_module_map() { + echo 'module Clibsodium {' + echo ' header "sodium.h"' + echo ' export *' + echo '}' +} + +build_macos() { + export BASEDIR="${XCODEDIR}/Platforms/MacOSX.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + + ## macOS arm64 + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + export CFLAGS="-O2 -arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export LDFLAGS="-arch arm64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin20 --prefix="$MACOS_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi + + ## macOS x86_64 + export CFLAGS="-O2 -arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + export LDFLAGS="-arch x86_64 -mmacosx-version-min=${MACOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=x86_64-apple-darwin10 --prefix="$MACOS_X86_64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_ios() { + export BASEDIR="${XCODEDIR}/Platforms/iPhoneOS.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/iPhoneOS.sdk" + + ## 32-bit iOS + export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -mthumb -arch armv7 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$IOS32_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## 32-bit armv7s iOS + export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -mthumb -arch armv7s -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$IOS32s_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## 64-bit iOS + export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$IOS64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_ios_simulator() { + export BASEDIR="${XCODEDIR}/Platforms/iPhoneSimulator.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/iPhoneSimulator.sdk" + + ## arm64 simulator + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin20 --prefix="$IOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi + + ## i386 simulator + export CFLAGS="-fembed-bitcode -O2 -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch i386 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=i686-apple-darwin10 --prefix="$IOS_SIMULATOR_I386_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## x86_64 simulator + export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mios-simulator-version-min=${IOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=x86_64-apple-darwin10 --prefix="$IOS_SIMULATOR_X86_64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} + make -j${PROCESSORS} install || exit 1 +} + +build_watchos() { + export BASEDIR="${XCODEDIR}/Platforms/WatchOS.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/WatchOS.sdk" + + # 32-bit watchOS + export CFLAGS="-fembed-bitcode -O2 -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -mthumb -arch armv7k -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$WATCHOS32_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## 64-bit arm64_32 watchOS + export CFLAGS="-fembed-bitcode -O2 -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -mthumb -arch arm64_32 -isysroot ${SDK} -mwatchos-version-min=${WATCHOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$WATCHOS64_32_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_watchos_simulator() { + export BASEDIR="${XCODEDIR}/Platforms/WatchSimulator.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/WatchSimulator.sdk" + + ## arm64 simulator + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin20 --prefix="$WATCHOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi + + ## i386 simulator + export CFLAGS="-fembed-bitcode -O2 -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch i386 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=i686-apple-darwin10 --prefix="$WATCHOS_SIMULATOR_I386_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + + ## x86_64 simulator + export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mwatchos-simulator-version-min=${WATCHOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=x86_64-apple-darwin10 --prefix="$WATCHOS_SIMULATOR_X86_64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_tvos() { + export BASEDIR="${XCODEDIR}/Platforms/AppleTVOS.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/AppleTVOS.sdk" + + ## 64-bit tvOS + export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mtvos-version-min=${TVOS_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin10 --prefix="$TVOS64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +build_tvos_simulator() { + export BASEDIR="${XCODEDIR}/Platforms/AppleTVSimulator.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/AppleTVSimulator.sdk" + + ## arm64 simulator + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-darwin20 --prefix="$TVOS_SIMULATOR_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi + + ## x86_64 simulator + export CFLAGS="-fembed-bitcode -O2 -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + export LDFLAGS="-fembed-bitcode -arch x86_64 -isysroot ${SDK} -mtvos-simulator-version-min=${TVOS_SIMULATOR_VERSION_MIN}" + + make distclean >/dev/null 2>&1 + ./configure --host=x86_64-apple-darwin10 --prefix="$TVOS_SIMULATOR_X86_64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} + make -j${PROCESSORS} install || exit 1 +} + +build_catalyst() { + export BASEDIR="${XCODEDIR}/Platforms/MacOSX.platform/Developer" + export PATH="${BASEDIR}/usr/bin:$BASEDIR/usr/sbin:$PATH" + export SDK="${BASEDIR}/SDKs/MacOSX.sdk" + + ## arm64 catalyst + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + export CFLAGS="-O2 -arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}" + export LDFLAGS="-arch arm64 -target arm64-apple-ios13.0-macabi -isysroot ${SDK}" + + make distclean >/dev/null 2>&1 + ./configure --host=arm-apple-ios --prefix="$CATALYST_ARM64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 + fi + + ## x86_64 catalyst + export CFLAGS="-O2 -arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}" + export LDFLAGS="-arch x86_64 -target x86_64-apple-ios13.0-macabi -isysroot ${SDK}" + + make distclean >/dev/null 2>&1 + ./configure --host=x86_64-apple-ios --prefix="$CATALYST_X86_64_PREFIX" \ + ${LIBSODIUM_ENABLE_MINIMAL_FLAG} || exit 1 + make -j${PROCESSORS} install || exit 1 +} + +mkdir -p "${PREFIX}/tmp" +echo "Building for macOS..." +build_macos >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for iOS..." +build_ios >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for the iOS simulator..." +build_ios_simulator >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for watchOS..." +build_watchos >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for the watchOS simulator..." +build_watchos_simulator >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for tvOS..." +build_tvos >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for the tvOS simulator..." +build_tvos_simulator >"$LOG_FILE" 2>&1 || exit 1 +echo "Building for Catalyst..." +build_catalyst >"$LOG_FILE" 2>&1 || exit 1 + +echo "Adding the Clibsodium module map for Swift..." + +find "$PREFIX" -name "include" -type d -print | while read -r f; do + swift_module_map >"${f}/module.modulemap" +done + +echo "Bundling macOS targets..." + +mkdir -p "${PREFIX}/macos/lib" +cp -a "${MACOS_X86_64_PREFIX}/include" "${PREFIX}/macos/" +for ext in a dylib; do + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${MACOS_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${MACOS_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/macos/lib/libsodium.${ext}" + else + lipo -create \ + "${MACOS_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/macos/lib/libsodium.${ext}" + fi +done + +echo "Bundling iOS targets..." + +mkdir -p "${PREFIX}/ios/lib" +cp -a "${IOS64_PREFIX}/include" "${PREFIX}/ios/" +for ext in a dylib; do + lipo -create \ + "$IOS32_PREFIX/lib/libsodium.${ext}" \ + "$IOS32s_PREFIX/lib/libsodium.${ext}" \ + "$IOS64_PREFIX/lib/libsodium.${ext}" \ + -output "$PREFIX/ios/lib/libsodium.${ext}" +done + +echo "Bundling iOS simulators..." + +mkdir -p "${PREFIX}/ios-simulators/lib" +cp -a "${IOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/ios-simulators/" +for ext in a dylib; do + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${IOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${IOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ + "${IOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/ios-simulators/lib/libsodium.${ext}" || exit 1 + else + lipo -create \ + "${IOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ + "${IOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/ios-simulators/lib/libsodium.${ext}" || exit 1 + fi +done + +echo "Bundling watchOS targets..." + +mkdir -p "${PREFIX}/watchos/lib" +cp -a "${WATCHOS64_32_PREFIX}/include" "${PREFIX}/watchos/" +for ext in a dylib; do + lipo -create \ + "${WATCHOS32_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS64_32_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/watchos/lib/libsodium.${ext}" +done + +echo "Bundling watchOS simulators..." + +mkdir -p "${PREFIX}/watchos-simulators/lib" +cp -a "${WATCHOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/watchos-simulators/" +for ext in a dylib; do + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${WATCHOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/watchos-simulators/lib/libsodium.${ext}" + else + lipo -create \ + "${WATCHOS_SIMULATOR_I386_PREFIX}/lib/libsodium.${ext}" \ + "${WATCHOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/watchos-simulators/lib/libsodium.${ext}" + fi +done + +echo "Bundling tvOS targets..." + +mkdir -p "${PREFIX}/tvos/lib" +cp -a "${TVOS64_PREFIX}/include" "${PREFIX}/tvos/" +for ext in a dylib; do + lipo -create \ + "$TVOS64_PREFIX/lib/libsodium.${ext}" \ + -output "$PREFIX/tvos/lib/libsodium.${ext}" +done + +echo "Bundling tvOS simulators..." + +mkdir -p "${PREFIX}/tvos-simulators/lib" +cp -a "${TVOS_SIMULATOR_X86_64_PREFIX}/include" "${PREFIX}/tvos-simulators/" +for ext in a dylib; do + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${TVOS_SIMULATOR_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${TVOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/tvos-simulators/lib/libsodium.${ext}" || exit 1 + else + lipo -create \ + "${TVOS_SIMULATOR_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/tvos-simulators/lib/libsodium.${ext}" || exit 1 + fi +done + +echo "Bundling Catalyst targets..." + +mkdir -p "${PREFIX}/catalyst/lib" +cp -a "${CATALYST_X86_64_PREFIX}/include" "${PREFIX}/catalyst/" +for ext in a dylib; do + if [ ! -f "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" ]; then + continue + fi + if [ "$APPLE_SILICON_SUPPORTED" = "true" ]; then + lipo -create \ + "${CATALYST_ARM64_PREFIX}/lib/libsodium.${ext}" \ + "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/catalyst/lib/libsodium.${ext}" + else + lipo -create \ + "${CATALYST_X86_64_PREFIX}/lib/libsodium.${ext}" \ + -output "${PREFIX}/catalyst/lib/libsodium.${ext}" + fi +done + +echo "Creating Clibsodium.xcframework..." + +rm -rf "${PREFIX}/Clibsodium.xcframework" + +XCFRAMEWORK_ARGS="" +for f in macos ios ios-simulators watchos watchos-simulators tvos tvos-simulators catalyst; do + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -library ${PREFIX}/${f}/lib/libsodium.a" + XCFRAMEWORK_ARGS="${XCFRAMEWORK_ARGS} -headers ${PREFIX}/${f}/include" +done +xcodebuild -create-xcframework \ + ${XCFRAMEWORK_ARGS} \ + -output "${PREFIX}/Clibsodium.xcframework" >/dev/null + +ls -ld -- "$PREFIX" +ls -l -- "$PREFIX" +ls -l -- "$PREFIX/Clibsodium.xcframework" + +echo "Done!" + +# Cleanup +rm -rf -- "$PREFIX/tmp" +make distclean >/dev/null diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/emscripten.sh python-nacl-1.5.0/src/libsodium/dist-build/emscripten.sh --- python-nacl-1.4.0/src/libsodium/dist-build/emscripten.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/emscripten.sh 2022-01-07 21:54:10.000000000 +0000 @@ -14,6 +14,8 @@ export LDFLAGS="${LDFLAGS} -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s ALIASING_FUNCTION_POINTERS=1" export LDFLAGS="${LDFLAGS} -s DISABLE_EXCEPTION_CATCHING=1" export LDFLAGS="${LDFLAGS} -s ELIMINATE_DUPLICATE_FUNCTIONS=1" +export LDFLAGS="${LDFLAGS} -s NODEJS_CATCH_EXIT=0" +export LDFLAGS="${LDFLAGS} -s NODEJS_CATCH_REJECTION=0" export CFLAGS="-Os" echo @@ -34,6 +36,7 @@ echo "Building a sumo distribution in [${PREFIX}]" elif [ "x$1" = "x--browser-tests" ]; then export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" + export CPPFLAGS="${CPPFLAGS} -s FORCE_FILESYSTEM=1" export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}" export PREFIX="$(pwd)/libsodium-js-tests" export DONE_FILE="$(pwd)/js-tests-browser.done" @@ -43,7 +46,7 @@ elif [ "x$1" = "x--tests" ]; then echo "Building for testing" export EXPORTED_FUNCTIONS="$EXPORTED_FUNCTIONS_SUMO" - export CPPFLAGS="${CPPFLAGS} -DBENCHMARKS -DITERATIONS=10" + export CPPFLAGS="${CPPFLAGS} -s FORCE_FILESYSTEM=1 -DBENCHMARKS -DITERATIONS=10" export LDFLAGS="${LDFLAGS} -s TOTAL_MEMORY=${MAX_MEMORY_TESTS}" export PREFIX="$(pwd)/libsodium-js-tests" export DONE_FILE="$(pwd)/js-tests.done" @@ -76,7 +79,7 @@ "${PREFIX}/lib/libsodium.a" -o "${outFile}" || exit 1 } emmake make $MAKE_FLAGS install || exit 1 - emccLibsodium "${PREFIX}/lib/libsodium.asm.tmp.js" -Oz -s WASM=0 -s RUNNING_JS_OPTS=1 + emccLibsodium "${PREFIX}/lib/libsodium.asm.tmp.js" -Oz -s WASM=0 emccLibsodium "${PREFIX}/lib/libsodium.wasm.tmp.js" -O3 -s WASM=1 cat > "${PREFIX}/lib/libsodium.js" <<- EOM @@ -115,17 +118,28 @@ } }; Module.useBackupModule = function() { - var Module = _Module; - Object.keys(Module).forEach(function(k) { - if (k !== 'getRandomValue') { - delete Module[k]; - } + return new Promise(function(resolve, reject) { + var Module = {}; + Module.onAbort = reject; + + Module.onRuntimeInitialized = function() { + Object.keys(_Module).forEach(function(k) { + if (k !== 'getRandomValue') { + delete _Module[k]; + } + }); + Object.keys(Module).forEach(function(k) { + _Module[k] = Module[k]; + }); + resolve(); + }; + + $(cat "${PREFIX}/lib/libsodium.asm.tmp.js" | sed 's|use asm||g') }); - $(cat "${PREFIX}/lib/libsodium.asm.tmp.js" | sed 's|use asm||g') }; $(cat "${PREFIX}/lib/libsodium.wasm.tmp.js") }).catch(function() { - _Module.useBackupModule(); + return _Module.useBackupModule(); }); EOM diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/emscripten-symbols.def python-nacl-1.5.0/src/libsodium/dist-build/emscripten-symbols.def --- python-nacl-1.4.0/src/libsodium/dist-build/emscripten-symbols.def 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/emscripten-symbols.def 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,608 @@ +_crypto_aead_aes256gcm_abytes 0 0 +_crypto_aead_aes256gcm_beforenm 0 0 +_crypto_aead_aes256gcm_decrypt 0 0 +_crypto_aead_aes256gcm_decrypt_afternm 0 0 +_crypto_aead_aes256gcm_decrypt_detached 0 0 +_crypto_aead_aes256gcm_decrypt_detached_afternm 0 0 +_crypto_aead_aes256gcm_encrypt 0 0 +_crypto_aead_aes256gcm_encrypt_afternm 0 0 +_crypto_aead_aes256gcm_encrypt_detached 0 0 +_crypto_aead_aes256gcm_encrypt_detached_afternm 0 0 +_crypto_aead_aes256gcm_is_available 0 0 +_crypto_aead_aes256gcm_keybytes 0 0 +_crypto_aead_aes256gcm_keygen 0 0 +_crypto_aead_aes256gcm_messagebytes_max 0 0 +_crypto_aead_aes256gcm_npubbytes 0 0 +_crypto_aead_aes256gcm_nsecbytes 0 0 +_crypto_aead_aes256gcm_statebytes 0 0 +_crypto_aead_chacha20poly1305_abytes 1 1 +_crypto_aead_chacha20poly1305_decrypt 1 1 +_crypto_aead_chacha20poly1305_decrypt_detached 1 1 +_crypto_aead_chacha20poly1305_encrypt 1 1 +_crypto_aead_chacha20poly1305_encrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_abytes 1 1 +_crypto_aead_chacha20poly1305_ietf_decrypt 1 1 +_crypto_aead_chacha20poly1305_ietf_decrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_encrypt 1 1 +_crypto_aead_chacha20poly1305_ietf_encrypt_detached 1 1 +_crypto_aead_chacha20poly1305_ietf_keybytes 1 1 +_crypto_aead_chacha20poly1305_ietf_keygen 1 1 +_crypto_aead_chacha20poly1305_ietf_messagebytes_max 1 1 +_crypto_aead_chacha20poly1305_ietf_npubbytes 1 1 +_crypto_aead_chacha20poly1305_ietf_nsecbytes 1 1 +_crypto_aead_chacha20poly1305_keybytes 1 1 +_crypto_aead_chacha20poly1305_keygen 1 1 +_crypto_aead_chacha20poly1305_messagebytes_max 1 1 +_crypto_aead_chacha20poly1305_npubbytes 1 1 +_crypto_aead_chacha20poly1305_nsecbytes 1 1 +_crypto_aead_xchacha20poly1305_ietf_abytes 1 1 +_crypto_aead_xchacha20poly1305_ietf_decrypt 1 1 +_crypto_aead_xchacha20poly1305_ietf_decrypt_detached 1 1 +_crypto_aead_xchacha20poly1305_ietf_encrypt 1 1 +_crypto_aead_xchacha20poly1305_ietf_encrypt_detached 1 1 +_crypto_aead_xchacha20poly1305_ietf_keybytes 1 1 +_crypto_aead_xchacha20poly1305_ietf_keygen 1 1 +_crypto_aead_xchacha20poly1305_ietf_messagebytes_max 1 1 +_crypto_aead_xchacha20poly1305_ietf_npubbytes 1 1 +_crypto_aead_xchacha20poly1305_ietf_nsecbytes 1 1 +_crypto_auth 1 1 +_crypto_auth_bytes 1 1 +_crypto_auth_hmacsha256 0 1 +_crypto_auth_hmacsha256_bytes 0 1 +_crypto_auth_hmacsha256_final 0 1 +_crypto_auth_hmacsha256_init 0 1 +_crypto_auth_hmacsha256_keybytes 0 1 +_crypto_auth_hmacsha256_keygen 0 1 +_crypto_auth_hmacsha256_statebytes 0 1 +_crypto_auth_hmacsha256_update 0 1 +_crypto_auth_hmacsha256_verify 0 1 +_crypto_auth_hmacsha512 0 1 +_crypto_auth_hmacsha512256 0 1 +_crypto_auth_hmacsha512256_bytes 0 1 +_crypto_auth_hmacsha512256_final 0 1 +_crypto_auth_hmacsha512256_init 0 1 +_crypto_auth_hmacsha512256_keybytes 0 1 +_crypto_auth_hmacsha512256_keygen 0 1 +_crypto_auth_hmacsha512256_statebytes 0 1 +_crypto_auth_hmacsha512256_update 0 1 +_crypto_auth_hmacsha512256_verify 0 1 +_crypto_auth_hmacsha512_bytes 0 1 +_crypto_auth_hmacsha512_final 0 1 +_crypto_auth_hmacsha512_init 0 1 +_crypto_auth_hmacsha512_keybytes 0 1 +_crypto_auth_hmacsha512_keygen 0 1 +_crypto_auth_hmacsha512_statebytes 0 1 +_crypto_auth_hmacsha512_update 0 1 +_crypto_auth_hmacsha512_verify 0 1 +_crypto_auth_keybytes 1 1 +_crypto_auth_keygen 1 1 +_crypto_auth_primitive 0 1 +_crypto_auth_verify 1 1 +_crypto_box 0 1 +_crypto_box_afternm 0 1 +_crypto_box_beforenm 1 1 +_crypto_box_beforenmbytes 1 1 +_crypto_box_boxzerobytes 0 1 +_crypto_box_curve25519xchacha20poly1305_beforenm 0 1 +_crypto_box_curve25519xchacha20poly1305_beforenmbytes 0 1 +_crypto_box_curve25519xchacha20poly1305_detached 0 1 +_crypto_box_curve25519xchacha20poly1305_detached_afternm 0 1 +_crypto_box_curve25519xchacha20poly1305_easy 0 1 +_crypto_box_curve25519xchacha20poly1305_easy_afternm 0 1 +_crypto_box_curve25519xchacha20poly1305_keypair 0 1 +_crypto_box_curve25519xchacha20poly1305_macbytes 0 1 +_crypto_box_curve25519xchacha20poly1305_messagebytes_max 0 1 +_crypto_box_curve25519xchacha20poly1305_noncebytes 0 1 +_crypto_box_curve25519xchacha20poly1305_open_detached 0 1 +_crypto_box_curve25519xchacha20poly1305_open_detached_afternm 0 1 +_crypto_box_curve25519xchacha20poly1305_open_easy 0 1 +_crypto_box_curve25519xchacha20poly1305_open_easy_afternm 0 1 +_crypto_box_curve25519xchacha20poly1305_publickeybytes 0 1 +_crypto_box_curve25519xchacha20poly1305_seal 0 1 +_crypto_box_curve25519xchacha20poly1305_seal_open 0 1 +_crypto_box_curve25519xchacha20poly1305_sealbytes 0 1 +_crypto_box_curve25519xchacha20poly1305_secretkeybytes 0 1 +_crypto_box_curve25519xchacha20poly1305_seed_keypair 0 1 +_crypto_box_curve25519xchacha20poly1305_seedbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305 0 1 +_crypto_box_curve25519xsalsa20poly1305_afternm 0 1 +_crypto_box_curve25519xsalsa20poly1305_beforenm 0 1 +_crypto_box_curve25519xsalsa20poly1305_beforenmbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_boxzerobytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_keypair 0 1 +_crypto_box_curve25519xsalsa20poly1305_macbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_messagebytes_max 0 1 +_crypto_box_curve25519xsalsa20poly1305_noncebytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_open 0 1 +_crypto_box_curve25519xsalsa20poly1305_open_afternm 0 1 +_crypto_box_curve25519xsalsa20poly1305_publickeybytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_secretkeybytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_seed_keypair 0 1 +_crypto_box_curve25519xsalsa20poly1305_seedbytes 0 1 +_crypto_box_curve25519xsalsa20poly1305_zerobytes 0 1 +_crypto_box_detached 1 1 +_crypto_box_detached_afternm 1 1 +_crypto_box_easy 1 1 +_crypto_box_easy_afternm 1 1 +_crypto_box_keypair 1 1 +_crypto_box_macbytes 1 1 +_crypto_box_messagebytes_max 1 1 +_crypto_box_noncebytes 1 1 +_crypto_box_open 0 1 +_crypto_box_open_afternm 0 1 +_crypto_box_open_detached 1 1 +_crypto_box_open_detached_afternm 1 1 +_crypto_box_open_easy 1 1 +_crypto_box_open_easy_afternm 1 1 +_crypto_box_primitive 0 1 +_crypto_box_publickeybytes 1 1 +_crypto_box_seal 1 1 +_crypto_box_seal_open 1 1 +_crypto_box_sealbytes 1 1 +_crypto_box_secretkeybytes 1 1 +_crypto_box_seed_keypair 1 1 +_crypto_box_seedbytes 1 1 +_crypto_box_zerobytes 0 1 +_crypto_core_ed25519_add 0 1 +_crypto_core_ed25519_bytes 0 1 +_crypto_core_ed25519_from_hash 0 1 +_crypto_core_ed25519_from_uniform 0 1 +_crypto_core_ed25519_hashbytes 0 1 +_crypto_core_ed25519_is_valid_point 0 1 +_crypto_core_ed25519_nonreducedscalarbytes 0 1 +_crypto_core_ed25519_random 0 1 +_crypto_core_ed25519_scalar_add 0 1 +_crypto_core_ed25519_scalar_complement 0 1 +_crypto_core_ed25519_scalar_invert 0 1 +_crypto_core_ed25519_scalar_mul 0 1 +_crypto_core_ed25519_scalar_negate 0 1 +_crypto_core_ed25519_scalar_random 0 1 +_crypto_core_ed25519_scalar_reduce 0 1 +_crypto_core_ed25519_scalar_sub 0 1 +_crypto_core_ed25519_scalarbytes 0 1 +_crypto_core_ed25519_sub 0 1 +_crypto_core_ed25519_uniformbytes 0 1 +_crypto_core_hchacha20 0 1 +_crypto_core_hchacha20_constbytes 0 1 +_crypto_core_hchacha20_inputbytes 0 1 +_crypto_core_hchacha20_keybytes 0 1 +_crypto_core_hchacha20_outputbytes 0 1 +_crypto_core_hsalsa20 0 1 +_crypto_core_hsalsa20_constbytes 0 1 +_crypto_core_hsalsa20_inputbytes 0 1 +_crypto_core_hsalsa20_keybytes 0 1 +_crypto_core_hsalsa20_outputbytes 0 1 +_crypto_core_ristretto255_add 0 1 +_crypto_core_ristretto255_bytes 0 1 +_crypto_core_ristretto255_from_hash 0 1 +_crypto_core_ristretto255_hashbytes 0 1 +_crypto_core_ristretto255_is_valid_point 0 1 +_crypto_core_ristretto255_nonreducedscalarbytes 0 1 +_crypto_core_ristretto255_random 0 1 +_crypto_core_ristretto255_scalar_add 0 1 +_crypto_core_ristretto255_scalar_complement 0 1 +_crypto_core_ristretto255_scalar_invert 0 1 +_crypto_core_ristretto255_scalar_mul 0 1 +_crypto_core_ristretto255_scalar_negate 0 1 +_crypto_core_ristretto255_scalar_random 0 1 +_crypto_core_ristretto255_scalar_reduce 0 1 +_crypto_core_ristretto255_scalar_sub 0 1 +_crypto_core_ristretto255_scalarbytes 0 1 +_crypto_core_ristretto255_sub 0 1 +_crypto_core_ristretto255_uniformbytes 0 1 +_crypto_core_salsa20 0 1 +_crypto_core_salsa2012 0 1 +_crypto_core_salsa2012_constbytes 0 1 +_crypto_core_salsa2012_inputbytes 0 1 +_crypto_core_salsa2012_keybytes 0 1 +_crypto_core_salsa2012_outputbytes 0 1 +_crypto_core_salsa208 0 1 +_crypto_core_salsa208_constbytes 0 1 +_crypto_core_salsa208_inputbytes 0 1 +_crypto_core_salsa208_keybytes 0 1 +_crypto_core_salsa208_outputbytes 0 1 +_crypto_core_salsa20_constbytes 0 1 +_crypto_core_salsa20_inputbytes 0 1 +_crypto_core_salsa20_keybytes 0 1 +_crypto_core_salsa20_outputbytes 0 1 +_crypto_generichash 1 1 +_crypto_generichash_blake2b 0 1 +_crypto_generichash_blake2b_bytes 0 1 +_crypto_generichash_blake2b_bytes_max 0 1 +_crypto_generichash_blake2b_bytes_min 0 1 +_crypto_generichash_blake2b_final 0 1 +_crypto_generichash_blake2b_init 0 1 +_crypto_generichash_blake2b_init_salt_personal 0 1 +_crypto_generichash_blake2b_keybytes 0 1 +_crypto_generichash_blake2b_keybytes_max 0 1 +_crypto_generichash_blake2b_keybytes_min 0 1 +_crypto_generichash_blake2b_keygen 0 1 +_crypto_generichash_blake2b_personalbytes 0 1 +_crypto_generichash_blake2b_salt_personal 0 1 +_crypto_generichash_blake2b_saltbytes 0 1 +_crypto_generichash_blake2b_statebytes 0 1 +_crypto_generichash_blake2b_update 0 1 +_crypto_generichash_bytes 1 1 +_crypto_generichash_bytes_max 1 1 +_crypto_generichash_bytes_min 1 1 +_crypto_generichash_final 1 1 +_crypto_generichash_init 1 1 +_crypto_generichash_keybytes 1 1 +_crypto_generichash_keybytes_max 1 1 +_crypto_generichash_keybytes_min 1 1 +_crypto_generichash_keygen 1 1 +_crypto_generichash_primitive 0 1 +_crypto_generichash_statebytes 1 1 +_crypto_generichash_update 1 1 +_crypto_hash 1 1 +_crypto_hash_bytes 1 1 +_crypto_hash_primitive 0 1 +_crypto_hash_sha256 0 1 +_crypto_hash_sha256_bytes 0 1 +_crypto_hash_sha256_final 0 1 +_crypto_hash_sha256_init 0 1 +_crypto_hash_sha256_statebytes 0 1 +_crypto_hash_sha256_update 0 1 +_crypto_hash_sha512 0 1 +_crypto_hash_sha512_bytes 0 1 +_crypto_hash_sha512_final 0 1 +_crypto_hash_sha512_init 0 1 +_crypto_hash_sha512_statebytes 0 1 +_crypto_hash_sha512_update 0 1 +_crypto_kdf_blake2b_bytes_max 0 1 +_crypto_kdf_blake2b_bytes_min 0 1 +_crypto_kdf_blake2b_contextbytes 0 1 +_crypto_kdf_blake2b_derive_from_key 0 1 +_crypto_kdf_blake2b_keybytes 0 1 +_crypto_kdf_bytes_max 1 1 +_crypto_kdf_bytes_min 1 1 +_crypto_kdf_contextbytes 1 1 +_crypto_kdf_derive_from_key 1 1 +_crypto_kdf_keybytes 1 1 +_crypto_kdf_keygen 1 1 +_crypto_kdf_primitive 0 1 +_crypto_kx_client_session_keys 1 1 +_crypto_kx_keypair 1 1 +_crypto_kx_primitive 0 1 +_crypto_kx_publickeybytes 1 1 +_crypto_kx_secretkeybytes 1 1 +_crypto_kx_seed_keypair 1 1 +_crypto_kx_seedbytes 1 1 +_crypto_kx_server_session_keys 1 1 +_crypto_kx_sessionkeybytes 1 1 +_crypto_onetimeauth 0 1 +_crypto_onetimeauth_bytes 0 1 +_crypto_onetimeauth_final 0 1 +_crypto_onetimeauth_init 0 1 +_crypto_onetimeauth_keybytes 0 1 +_crypto_onetimeauth_keygen 0 1 +_crypto_onetimeauth_poly1305 0 1 +_crypto_onetimeauth_poly1305_bytes 0 1 +_crypto_onetimeauth_poly1305_final 0 1 +_crypto_onetimeauth_poly1305_init 0 1 +_crypto_onetimeauth_poly1305_keybytes 0 1 +_crypto_onetimeauth_poly1305_keygen 0 1 +_crypto_onetimeauth_poly1305_statebytes 0 1 +_crypto_onetimeauth_poly1305_update 0 1 +_crypto_onetimeauth_poly1305_verify 0 1 +_crypto_onetimeauth_primitive 0 1 +_crypto_onetimeauth_statebytes 0 1 +_crypto_onetimeauth_update 0 1 +_crypto_onetimeauth_verify 0 1 +_crypto_pwhash 1 1 +_crypto_pwhash_alg_argon2i13 1 1 +_crypto_pwhash_alg_argon2id13 1 1 +_crypto_pwhash_alg_default 1 1 +_crypto_pwhash_argon2i 0 1 +_crypto_pwhash_argon2i_alg_argon2i13 0 1 +_crypto_pwhash_argon2i_bytes_max 0 1 +_crypto_pwhash_argon2i_bytes_min 0 1 +_crypto_pwhash_argon2i_memlimit_interactive 0 1 +_crypto_pwhash_argon2i_memlimit_max 0 1 +_crypto_pwhash_argon2i_memlimit_min 0 1 +_crypto_pwhash_argon2i_memlimit_moderate 0 1 +_crypto_pwhash_argon2i_memlimit_sensitive 0 1 +_crypto_pwhash_argon2i_opslimit_interactive 0 1 +_crypto_pwhash_argon2i_opslimit_max 0 1 +_crypto_pwhash_argon2i_opslimit_min 0 1 +_crypto_pwhash_argon2i_opslimit_moderate 0 1 +_crypto_pwhash_argon2i_opslimit_sensitive 0 1 +_crypto_pwhash_argon2i_passwd_max 0 1 +_crypto_pwhash_argon2i_passwd_min 0 1 +_crypto_pwhash_argon2i_saltbytes 0 1 +_crypto_pwhash_argon2i_str 0 1 +_crypto_pwhash_argon2i_str_needs_rehash 0 1 +_crypto_pwhash_argon2i_str_verify 0 1 +_crypto_pwhash_argon2i_strbytes 0 1 +_crypto_pwhash_argon2i_strprefix 0 1 +_crypto_pwhash_argon2id 0 1 +_crypto_pwhash_argon2id_alg_argon2id13 0 1 +_crypto_pwhash_argon2id_bytes_max 0 1 +_crypto_pwhash_argon2id_bytes_min 0 1 +_crypto_pwhash_argon2id_memlimit_interactive 0 1 +_crypto_pwhash_argon2id_memlimit_max 0 1 +_crypto_pwhash_argon2id_memlimit_min 0 1 +_crypto_pwhash_argon2id_memlimit_moderate 0 1 +_crypto_pwhash_argon2id_memlimit_sensitive 0 1 +_crypto_pwhash_argon2id_opslimit_interactive 0 1 +_crypto_pwhash_argon2id_opslimit_max 0 1 +_crypto_pwhash_argon2id_opslimit_min 0 1 +_crypto_pwhash_argon2id_opslimit_moderate 0 1 +_crypto_pwhash_argon2id_opslimit_sensitive 0 1 +_crypto_pwhash_argon2id_passwd_max 0 1 +_crypto_pwhash_argon2id_passwd_min 0 1 +_crypto_pwhash_argon2id_saltbytes 0 1 +_crypto_pwhash_argon2id_str 0 1 +_crypto_pwhash_argon2id_str_needs_rehash 0 1 +_crypto_pwhash_argon2id_str_verify 0 1 +_crypto_pwhash_argon2id_strbytes 0 1 +_crypto_pwhash_argon2id_strprefix 0 1 +_crypto_pwhash_bytes_max 1 1 +_crypto_pwhash_bytes_min 1 1 +_crypto_pwhash_memlimit_interactive 1 1 +_crypto_pwhash_memlimit_max 1 1 +_crypto_pwhash_memlimit_min 1 1 +_crypto_pwhash_memlimit_moderate 1 1 +_crypto_pwhash_memlimit_sensitive 1 1 +_crypto_pwhash_opslimit_interactive 1 1 +_crypto_pwhash_opslimit_max 1 1 +_crypto_pwhash_opslimit_min 1 1 +_crypto_pwhash_opslimit_moderate 1 1 +_crypto_pwhash_opslimit_sensitive 1 1 +_crypto_pwhash_passwd_max 1 1 +_crypto_pwhash_passwd_min 1 1 +_crypto_pwhash_primitive 0 1 +_crypto_pwhash_saltbytes 1 1 +_crypto_pwhash_scryptsalsa208sha256 0 1 +_crypto_pwhash_scryptsalsa208sha256_bytes_max 0 1 +_crypto_pwhash_scryptsalsa208sha256_bytes_min 0 1 +_crypto_pwhash_scryptsalsa208sha256_ll 0 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_interactive 0 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_max 0 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_min 0 1 +_crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive 0 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_interactive 0 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_max 0 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_min 0 1 +_crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive 0 1 +_crypto_pwhash_scryptsalsa208sha256_passwd_max 0 1 +_crypto_pwhash_scryptsalsa208sha256_passwd_min 0 1 +_crypto_pwhash_scryptsalsa208sha256_saltbytes 0 1 +_crypto_pwhash_scryptsalsa208sha256_str 0 1 +_crypto_pwhash_scryptsalsa208sha256_str_needs_rehash 0 1 +_crypto_pwhash_scryptsalsa208sha256_str_verify 0 1 +_crypto_pwhash_scryptsalsa208sha256_strbytes 0 1 +_crypto_pwhash_scryptsalsa208sha256_strprefix 0 1 +_crypto_pwhash_str 1 1 +_crypto_pwhash_str_alg 1 1 +_crypto_pwhash_str_needs_rehash 1 1 +_crypto_pwhash_str_verify 1 1 +_crypto_pwhash_strbytes 1 1 +_crypto_pwhash_strprefix 1 1 +_crypto_scalarmult 1 1 +_crypto_scalarmult_base 1 1 +_crypto_scalarmult_bytes 1 1 +_crypto_scalarmult_curve25519 0 1 +_crypto_scalarmult_curve25519_base 0 1 +_crypto_scalarmult_curve25519_bytes 0 1 +_crypto_scalarmult_curve25519_scalarbytes 0 1 +_crypto_scalarmult_ed25519 0 1 +_crypto_scalarmult_ed25519_base 0 1 +_crypto_scalarmult_ed25519_base_noclamp 0 1 +_crypto_scalarmult_ed25519_bytes 0 1 +_crypto_scalarmult_ed25519_noclamp 0 1 +_crypto_scalarmult_ed25519_scalarbytes 0 1 +_crypto_scalarmult_primitive 0 1 +_crypto_scalarmult_ristretto255 0 1 +_crypto_scalarmult_ristretto255_base 0 1 +_crypto_scalarmult_ristretto255_bytes 0 1 +_crypto_scalarmult_ristretto255_scalarbytes 0 1 +_crypto_scalarmult_scalarbytes 1 1 +_crypto_secretbox 0 1 +_crypto_secretbox_boxzerobytes 0 1 +_crypto_secretbox_detached 1 1 +_crypto_secretbox_easy 1 1 +_crypto_secretbox_keybytes 1 1 +_crypto_secretbox_keygen 1 1 +_crypto_secretbox_macbytes 1 1 +_crypto_secretbox_messagebytes_max 1 1 +_crypto_secretbox_noncebytes 1 1 +_crypto_secretbox_open 0 1 +_crypto_secretbox_open_detached 1 1 +_crypto_secretbox_open_easy 1 1 +_crypto_secretbox_primitive 0 1 +_crypto_secretbox_xchacha20poly1305_detached 0 1 +_crypto_secretbox_xchacha20poly1305_easy 0 1 +_crypto_secretbox_xchacha20poly1305_keybytes 0 1 +_crypto_secretbox_xchacha20poly1305_macbytes 0 1 +_crypto_secretbox_xchacha20poly1305_messagebytes_max 0 1 +_crypto_secretbox_xchacha20poly1305_noncebytes 0 1 +_crypto_secretbox_xchacha20poly1305_open_detached 0 1 +_crypto_secretbox_xchacha20poly1305_open_easy 0 1 +_crypto_secretbox_xsalsa20poly1305 0 1 +_crypto_secretbox_xsalsa20poly1305_boxzerobytes 0 1 +_crypto_secretbox_xsalsa20poly1305_keybytes 0 1 +_crypto_secretbox_xsalsa20poly1305_keygen 0 1 +_crypto_secretbox_xsalsa20poly1305_macbytes 0 1 +_crypto_secretbox_xsalsa20poly1305_messagebytes_max 0 1 +_crypto_secretbox_xsalsa20poly1305_noncebytes 0 1 +_crypto_secretbox_xsalsa20poly1305_open 0 1 +_crypto_secretbox_xsalsa20poly1305_zerobytes 0 1 +_crypto_secretbox_zerobytes 0 1 +_crypto_secretstream_xchacha20poly1305_abytes 1 1 +_crypto_secretstream_xchacha20poly1305_headerbytes 1 1 +_crypto_secretstream_xchacha20poly1305_init_pull 1 1 +_crypto_secretstream_xchacha20poly1305_init_push 1 1 +_crypto_secretstream_xchacha20poly1305_keybytes 1 1 +_crypto_secretstream_xchacha20poly1305_keygen 1 1 +_crypto_secretstream_xchacha20poly1305_messagebytes_max 1 1 +_crypto_secretstream_xchacha20poly1305_pull 1 1 +_crypto_secretstream_xchacha20poly1305_push 1 1 +_crypto_secretstream_xchacha20poly1305_rekey 1 1 +_crypto_secretstream_xchacha20poly1305_statebytes 1 1 +_crypto_secretstream_xchacha20poly1305_tag_final 1 1 +_crypto_secretstream_xchacha20poly1305_tag_message 1 1 +_crypto_secretstream_xchacha20poly1305_tag_push 1 1 +_crypto_secretstream_xchacha20poly1305_tag_rekey 1 1 +_crypto_shorthash 1 1 +_crypto_shorthash_bytes 1 1 +_crypto_shorthash_keybytes 1 1 +_crypto_shorthash_keygen 1 1 +_crypto_shorthash_primitive 0 1 +_crypto_shorthash_siphash24 0 1 +_crypto_shorthash_siphash24_bytes 0 1 +_crypto_shorthash_siphash24_keybytes 0 1 +_crypto_shorthash_siphashx24 0 1 +_crypto_shorthash_siphashx24_bytes 0 1 +_crypto_shorthash_siphashx24_keybytes 0 1 +_crypto_sign 1 1 +_crypto_sign_bytes 1 1 +_crypto_sign_detached 1 1 +_crypto_sign_ed25519 0 1 +_crypto_sign_ed25519_bytes 0 1 +_crypto_sign_ed25519_detached 0 1 +_crypto_sign_ed25519_keypair 0 1 +_crypto_sign_ed25519_messagebytes_max 0 1 +_crypto_sign_ed25519_open 0 1 +_crypto_sign_ed25519_pk_to_curve25519 1 1 +_crypto_sign_ed25519_publickeybytes 0 1 +_crypto_sign_ed25519_secretkeybytes 0 1 +_crypto_sign_ed25519_seed_keypair 0 1 +_crypto_sign_ed25519_seedbytes 0 1 +_crypto_sign_ed25519_sk_to_curve25519 1 1 +_crypto_sign_ed25519_sk_to_pk 0 1 +_crypto_sign_ed25519_sk_to_seed 0 1 +_crypto_sign_ed25519_verify_detached 0 1 +_crypto_sign_ed25519ph_final_create 0 1 +_crypto_sign_ed25519ph_final_verify 0 1 +_crypto_sign_ed25519ph_init 0 1 +_crypto_sign_ed25519ph_statebytes 0 1 +_crypto_sign_ed25519ph_update 0 1 +_crypto_sign_edwards25519sha512batch 0 0 +_crypto_sign_edwards25519sha512batch_keypair 0 0 +_crypto_sign_edwards25519sha512batch_open 0 0 +_crypto_sign_final_create 1 1 +_crypto_sign_final_verify 1 1 +_crypto_sign_init 1 1 +_crypto_sign_keypair 1 1 +_crypto_sign_messagebytes_max 1 1 +_crypto_sign_open 1 1 +_crypto_sign_primitive 0 1 +_crypto_sign_publickeybytes 1 1 +_crypto_sign_secretkeybytes 1 1 +_crypto_sign_seed_keypair 1 1 +_crypto_sign_seedbytes 1 1 +_crypto_sign_statebytes 1 1 +_crypto_sign_update 1 1 +_crypto_sign_verify_detached 1 1 +_crypto_stream 0 1 +_crypto_stream_chacha20 0 1 +_crypto_stream_chacha20_ietf 0 1 +_crypto_stream_chacha20_ietf_keybytes 0 1 +_crypto_stream_chacha20_ietf_keygen 0 1 +_crypto_stream_chacha20_ietf_messagebytes_max 0 1 +_crypto_stream_chacha20_ietf_noncebytes 0 1 +_crypto_stream_chacha20_ietf_xor 0 1 +_crypto_stream_chacha20_ietf_xor_ic 0 1 +_crypto_stream_chacha20_keybytes 0 1 +_crypto_stream_chacha20_keygen 0 1 +_crypto_stream_chacha20_messagebytes_max 0 1 +_crypto_stream_chacha20_noncebytes 0 1 +_crypto_stream_chacha20_xor 0 1 +_crypto_stream_chacha20_xor_ic 0 1 +_crypto_stream_keybytes 0 1 +_crypto_stream_keygen 0 1 +_crypto_stream_messagebytes_max 0 1 +_crypto_stream_noncebytes 0 1 +_crypto_stream_primitive 0 1 +_crypto_stream_salsa20 0 1 +_crypto_stream_salsa2012 0 1 +_crypto_stream_salsa2012_keybytes 0 1 +_crypto_stream_salsa2012_keygen 0 1 +_crypto_stream_salsa2012_messagebytes_max 0 1 +_crypto_stream_salsa2012_noncebytes 0 1 +_crypto_stream_salsa2012_xor 0 1 +_crypto_stream_salsa208 0 1 +_crypto_stream_salsa208_keybytes 0 1 +_crypto_stream_salsa208_keygen 0 1 +_crypto_stream_salsa208_messagebytes_max 0 1 +_crypto_stream_salsa208_noncebytes 0 1 +_crypto_stream_salsa208_xor 0 1 +_crypto_stream_salsa20_keybytes 0 1 +_crypto_stream_salsa20_keygen 0 1 +_crypto_stream_salsa20_messagebytes_max 0 1 +_crypto_stream_salsa20_noncebytes 0 1 +_crypto_stream_salsa20_xor 0 1 +_crypto_stream_salsa20_xor_ic 0 1 +_crypto_stream_xchacha20 0 1 +_crypto_stream_xchacha20_keybytes 0 1 +_crypto_stream_xchacha20_keygen 0 1 +_crypto_stream_xchacha20_messagebytes_max 0 1 +_crypto_stream_xchacha20_noncebytes 0 1 +_crypto_stream_xchacha20_xor 0 1 +_crypto_stream_xchacha20_xor_ic 0 1 +_crypto_stream_xor 0 1 +_crypto_stream_xsalsa20 0 1 +_crypto_stream_xsalsa20_keybytes 0 1 +_crypto_stream_xsalsa20_keygen 0 1 +_crypto_stream_xsalsa20_messagebytes_max 0 1 +_crypto_stream_xsalsa20_noncebytes 0 1 +_crypto_stream_xsalsa20_xor 0 1 +_crypto_stream_xsalsa20_xor_ic 0 1 +_crypto_verify_16 0 1 +_crypto_verify_16_bytes 0 1 +_crypto_verify_32 0 1 +_crypto_verify_32_bytes 0 1 +_crypto_verify_64 0 1 +_crypto_verify_64_bytes 0 1 +_randombytes 1 1 +_randombytes_buf 1 1 +_randombytes_buf_deterministic 1 1 +_randombytes_close 1 1 +_randombytes_implementation_name 0 1 +_randombytes_random 1 1 +_randombytes_seedbytes 1 1 +_randombytes_set_implementation 0 0 +_randombytes_stir 1 1 +_randombytes_uniform 1 1 +_sodium_add 0 0 +_sodium_allocarray 0 0 +_sodium_base642bin 1 1 +_sodium_base64_encoded_len 1 1 +_sodium_bin2base64 1 1 +_sodium_bin2hex 1 1 +_sodium_compare 0 0 +_sodium_free 0 0 +_sodium_hex2bin 1 1 +_sodium_increment 0 0 +_sodium_init 1 1 +_sodium_is_zero 0 0 +_sodium_library_minimal 1 1 +_sodium_library_version_major 1 1 +_sodium_library_version_minor 1 1 +_sodium_malloc 0 0 +_sodium_memcmp 0 0 +_sodium_memzero 0 0 +_sodium_misuse 0 0 +_sodium_mlock 0 0 +_sodium_mprotect_noaccess 0 0 +_sodium_mprotect_readonly 0 0 +_sodium_mprotect_readwrite 0 0 +_sodium_munlock 0 0 +_sodium_pad 1 1 +_sodium_runtime_has_aesni 0 0 +_sodium_runtime_has_avx 0 0 +_sodium_runtime_has_avx2 0 0 +_sodium_runtime_has_avx512f 0 0 +_sodium_runtime_has_neon 0 0 +_sodium_runtime_has_pclmul 0 0 +_sodium_runtime_has_rdrand 0 0 +_sodium_runtime_has_sse2 0 0 +_sodium_runtime_has_sse3 0 0 +_sodium_runtime_has_sse41 0 0 +_sodium_runtime_has_ssse3 0 0 +_sodium_set_misuse_handler 0 0 +_sodium_stackzero 0 0 +_sodium_sub 0 0 +_sodium_unpad 1 1 +_sodium_version_string 1 1 diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/generate-emscripten-symbols.sh python-nacl-1.5.0/src/libsodium/dist-build/generate-emscripten-symbols.sh --- python-nacl-1.4.0/src/libsodium/dist-build/generate-emscripten-symbols.sh 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/generate-emscripten-symbols.sh 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,57 @@ +#! /bin/sh + +set -e + +symbols() { + { + SUMO="$1" + while read symbol standard sumo; do + found="$standard" + if [ "x$SUMO" = "xsumo" ]; then + found="$sumo" + fi + if [ "$found" = "1" ]; then + eval "defined_${symbol}=yes" + else + eval "defined_${symbol}=no" + fi + done < emscripten-symbols.def + + /usr/bin/nm /usr/local/lib/libsodium.23.dylib | \ + fgrep ' T _' | \ + cut -d' ' -f3 | { + while read symbol; do + eval "found=\$defined_${symbol}" + if [ "$found" = "yes" ]; then + echo "$symbol" + elif [ "$found" != "no" ]; then + echo >&2 + echo "*** [$symbol] was not expected ***" >&2 + echo >&2 + exit 1 + fi + done + } + } | \ + sort | \ + { + out='"_malloc","_free"' + while read symbol ; do + if [ ! -z "$out" ]; then + out="${out}," + fi + out="${out}\"${symbol}\"" + done + echo "[${out}]" + } +} + +out=$(symbols standard) +sed s/EXPORTED_FUNCTIONS_STANDARD=\'.*\'/EXPORTED_FUNCTIONS_STANDARD=\'${out}\'/ < emscripten.sh > emscripten.sh.tmp && \ + mv -f emscripten.sh.tmp emscripten.sh + +out=$(symbols sumo) +sed s/EXPORTED_FUNCTIONS_SUMO=\'.*\'/EXPORTED_FUNCTIONS_SUMO=\'${out}\'/ < emscripten.sh > emscripten.sh.tmp && \ + mv -f emscripten.sh.tmp emscripten.sh + +chmod +x emscripten.sh diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/ios.sh python-nacl-1.5.0/src/libsodium/dist-build/ios.sh --- python-nacl-1.4.0/src/libsodium/dist-build/ios.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/ios.sh 2022-01-07 21:54:10.000000000 +0000 @@ -101,8 +101,8 @@ make -j${PROCESSORS} install || exit 1 ## 64-bit iOS -export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN} -fembed-bitcode" -export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN} -fembed-bitcode" +export CFLAGS="-fembed-bitcode -O2 -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" +export LDFLAGS="-fembed-bitcode -arch arm64 -isysroot ${SDK} -mios-version-min=${IOS_VERSION_MIN}" make distclean > /dev/null diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/Makefile.am python-nacl-1.5.0/src/libsodium/dist-build/Makefile.am --- python-nacl-1.4.0/src/libsodium/dist-build/Makefile.am 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/Makefile.am 2022-01-07 21:54:10.000000000 +0000 @@ -10,6 +10,7 @@ android-x86_64.sh \ emscripten.sh \ ios.sh \ + apple-xcframework.sh \ msys2-win32.sh \ msys2-win64.sh \ watchos.sh \ diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/Makefile.in python-nacl-1.5.0/src/libsodium/dist-build/Makefile.in --- python-nacl-1.4.0/src/libsodium/dist-build/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,9 +87,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = dist-build ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -133,7 +135,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -217,6 +218,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -277,11 +279,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -298,6 +305,7 @@ android-x86_64.sh \ emscripten.sh \ ios.sh \ + apple-xcframework.sh \ msys2-win32.sh \ msys2-win64.sh \ watchos.sh \ diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/osx.sh python-nacl-1.5.0/src/libsodium/dist-build/osx.sh --- python-nacl-1.4.0/src/libsodium/dist-build/osx.sh 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/osx.sh 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,26 @@ +#! /bin/sh + +export PREFIX="$(pwd)/libsodium-osx" +export MACOS_VERSION_MIN=${MACOS_VERSION_MIN-"10.10"} + +if [ -z "$LIBSODIUM_FULL_BUILD" ]; then + export LIBSODIUM_ENABLE_MINIMAL_FLAG="--enable-minimal" +else + export LIBSODIUM_ENABLE_MINIMAL_FLAG="" +fi + +NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) +PROCESSORS=${NPROCESSORS:-3} + +mkdir -p $PREFIX || exit 1 + +export CFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN} -O2 -g" +export LDFLAGS="-mmacosx-version-min=${MACOS_VERSION_MIN}" + +make distclean >/dev/null +./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ + --prefix="$PREFIX" || exit 1 +make -j${PROCESSORS} check && make -j${PROCESSORS} install || exit 1 + +# Cleanup +make distclean >/dev/null diff -Nru python-nacl-1.4.0/src/libsodium/dist-build/wasm32-wasi.sh python-nacl-1.5.0/src/libsodium/dist-build/wasm32-wasi.sh --- python-nacl-1.4.0/src/libsodium/dist-build/wasm32-wasi.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/dist-build/wasm32-wasi.sh 2022-01-07 21:54:10.000000000 +0000 @@ -1,27 +1,18 @@ #! /bin/sh -if [ -z "$WASI_SYSROOT" ]; then - export WASI_SYSROOT="/opt/wasi-sysroot" -fi - -export PATH="/usr/local/opt/llvm/bin:$PATH" +export PATH="/opt/zig/bin:/opt/zig:/usr/local/opt/llvm/bin:$PATH" export PREFIX="$(pwd)/libsodium-wasm32-wasi" mkdir -p $PREFIX || exit 1 -export CC="clang" -export CFLAGS="-DED25519_NONDETERMINISTIC=1 --target=wasm32-wasi --sysroot=${WASI_SYSROOT} -O2" -export LDFLAGS="-s -Wl,--no-threads" -export NM="llvm-nm" -export AR="llvm-ar" -export RANLIB="llvm-ranlib" -export STRIP="llvm-strip" +export CC="zig cc" +export CFLAGS="-DED25519_NONDETERMINISTIC=1 --target=wasm32-wasi -O2" +export LDFLAGS="-s -Wl,--stack-first" +export AR="zig ar" +export RANLIB="zig ranlib" -make distclean > /dev/null - -grep -q -F -- 'wasi' build-aux/config.sub || \ - sed -i -e 's/-nacl\*)/-nacl*|-wasi)/' build-aux/config.sub +make distclean >/dev/null if [ "x$1" = "x--bench" ]; then export BENCHMARKS=1 @@ -34,16 +25,19 @@ export LIBSODIUM_ENABLE_MINIMAL_FLAG="" fi -./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ - --prefix="$PREFIX" --with-sysroot="$WASI_SYSROOT" \ - --host=wasm32-wasi \ - --disable-ssp --disable-shared || exit 1 +if ! ./configure ${LIBSODIUM_ENABLE_MINIMAL_FLAG} \ + --prefix="$PREFIX" \ + --host=wasm32-wasi \ + --disable-ssp --disable-shared --without-pthreads; then + cat config.log + exit 1 +fi NPROCESSORS=$(getconf NPROCESSORS_ONLN 2>/dev/null || getconf _NPROCESSORS_ONLN 2>/dev/null) PROCESSORS=${NPROCESSORS:-3} if [ -z "$BENCHMARKS" ]; then - make -j${PROCESSORS} check && make install && make distclean > /dev/null + make -j${PROCESSORS} check && make install && make distclean >/dev/null else make -j${PROCESSORS} && make check fi diff -Nru python-nacl-1.4.0/src/libsodium/.github/workflows/ci.yml python-nacl-1.5.0/src/libsodium/.github/workflows/ci.yml --- python-nacl-1.4.0/src/libsodium/.github/workflows/ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/.github/workflows/ci.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,125 @@ +name: CI + +on: + push: + branches: [master, stable, next] + pull_request: + branches: [master, stable, next] + + workflow_dispatch: + +jobs: + tcc: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update packages list + run: sudo apt-get update + + - name: Install dependencies + run: sudo apt-get install -y build-essential libtool autoconf automake tcc + + - name: Autogen + run: ./autogen.sh -s + + - name: Compilation with tcc + run: | + env CC=tcc CFLAGS='-w' CPPFLAGS="-DDEV_MODE=1" ./configure --prefix=/tmp --disable-dependency-tracking --disable-shared || cat config.log + make -j $(nproc) && make check && make install + env CC=tcc CPPFLAGS='-I/tmp/include' LDFLAGS='-L/tmp/lib' LD_LIBRARY_PATH='/tmp/lib' ./test/constcheck.sh + make uninstall + make distclean + + regular: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update packages list + run: sudo apt-get update + + - name: Install dependencies + run: sudo apt-get install -y build-essential libtool autoconf automake + + - name: Autogen + run: ./autogen.sh -s + + - name: C99 compat check + run: | + env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking + make -j $(nproc) CFLAGS='-g0' > /dev/null && cp src/libsodium/.libs/libsodium.so lib.so && make clean > /dev/null && make CFLAGS='-g0' CPPFLAGS='-DDEV_MODE=1 -DSODIUM_C99\(X\)=' > /dev/null && cp src/libsodium/.libs/libsodium.so lib-oldc.so && cmp lib.so lib-oldc.so && echo No binary changes && make clean > /dev/null + make distcheck + make distclean > /dev/null + + - name: Regular compilation + run: | + env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --enable-minimal + make -j $(nproc) + make check + ( echo '#include ' ; echo 'int main(void) { return sodium_init(); }' ) > /tmp/main.c && gcc -DDEV_MODE=1 -Isrc/libsodium/include -Isrc/libsodium/include/sodium $(find src -name '*.c' -o -name '*.S') /tmp/main.c + make distclean > /dev/null + + check-globals: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update packages list + run: sudo apt-get update + + - name: Install dependencies + run: sudo apt-get install -y build-essential libtool autoconf automake + + - name: Autogen + run: ./autogen.sh -s + + - name: Check globals + run: | + if [ -x test/rename-globals.sh ]; then test/rename-globals.sh; fi + + other-comp: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update packages list + run: sudo apt-get update + + - name: Install dependencies + run: sudo apt-get install -y build-essential libtool autoconf automake clang + + - name: Autogen + run: ./autogen.sh -s + + - name: Compilation with g++ + run: | + env CC=g++ CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking + make -j $(nproc) check + make clean > /dev/null + + - name: Compilation with clang + run: | + env CC=clang CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking + make -j $(nproc) check + make clean > /dev/null + + other-arch: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Update packages list + run: sudo apt-get update + + - name: Install dependencies + run: sudo apt-get install -y build-essential libtool autoconf automake qemu-user-static gcc-powerpc-linux-gnu + + - name: Autogen + run: ./autogen.sh -s + + - name: Big-Endian PowerPC compilation + run: | + env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking --host=powerpc-linux-gnu + make -j $(nproc) + make clean > /dev/null diff -Nru python-nacl-1.4.0/src/libsodium/.github/workflows/codeql-analysis.yml python-nacl-1.5.0/src/libsodium/.github/workflows/codeql-analysis.yml --- python-nacl-1.4.0/src/libsodium/.github/workflows/codeql-analysis.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/.github/workflows/codeql-analysis.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,31 @@ +name: "CodeQL scan" + +on: + push: + pull_request: + schedule: + - cron: '0 17 * * 2' + +jobs: + CodeQL-Build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 2 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: cpp + + - run: | + ./autogen.sh -s + env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking + make -j $(nproc) check + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 diff -Nru python-nacl-1.4.0/src/libsodium/.github/workflows/dotnet-core.yml python-nacl-1.5.0/src/libsodium/.github/workflows/dotnet-core.yml --- python-nacl-1.4.0/src/libsodium/.github/workflows/dotnet-core.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/.github/workflows/dotnet-core.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,316 @@ +name: .NET Package + +on: + push: + branches: + - stable + - next + +jobs: + + build-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: buildbase.bat + run: buildbase.bat ..\vs2019\libsodium.sln 16 + working-directory: builds/msvc/build/ + shell: cmd + - uses: actions/upload-artifact@v2 + with: + name: build-win-x64 + path: bin/x64/Release/v142/dynamic/libsodium.dll + - uses: actions/upload-artifact@v2 + with: + name: build-win-x86 + path: bin/Win32/Release/v142/dynamic/libsodium.dll + + build-linux-glibc: + runs-on: ubuntu-latest + container: + image: ubuntu:20.04 + steps: + - name: Set up build environment + run: | + apt-get update && apt-get install -y build-essential + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-debug --prefix=$PWD/.libsodium-build + - name: make + run: make + - name: make check + run: make check + - name: make install + run: make install + - name: strip + run: strip --strip-all .libsodium-build/lib/libsodium.so + - uses: actions/upload-artifact@v2 + with: + name: build-linux-x64 + path: .libsodium-build/lib/libsodium.so + + build-linux-glibc-arm64: + runs-on: ubuntu-latest + steps: + - name: Set up build environment + run: | + export DEBIAN_FRONTEND=noninteractive + + cat <<-EOF | sudo tee /etc/apt/sources.list.d/arm64.list >/dev/null + deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted + deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted + deb [arch=arm64] http://ports.ubuntu.com/ focal universe + deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe + deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse + deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse + deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse + EOF + + sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list + + sudo dpkg --add-architecture arm64 + + sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64 + + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu + - name: make + run: make -j $(nproc) + + - name: make check + run: | + make check + + - name: make install + run: make install + + - name: strip + run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so + - uses: actions/upload-artifact@v2 + with: + name: build-linux-arm64 + path: .libsodium-build/lib/libsodium.so + + build-linux-glibc-arm: + runs-on: ubuntu-20.04 + steps: + - name: Set up build environment + run: | + export DEBIAN_FRONTEND=noninteractive + + cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null + deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted + deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted + deb [arch=armhf] http://ports.ubuntu.com/ focal universe + deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe + deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse + deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse + deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse + EOF + + sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list + + sudo dpkg --add-architecture armhf + + sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf + + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf + - name: make + run: make -j $(nproc) + + - name: make check + run: | + make check + + - name: make install + run: make install + + - name: strip + run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so + - uses: actions/upload-artifact@v2 + with: + name: build-linux-arm + path: .libsodium-build/lib/libsodium.so + + build-linux-musl: + runs-on: ubuntu-latest + container: + image: alpine:3.13 + steps: + - name: Set up build environment + run: | + apk update + apk add alpine-sdk ca-certificates + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-debug --prefix=$PWD/.libsodium-build + - name: make + run: make + - name: make check + run: make check + - name: make install + run: make install + - name: strip + run: strip --strip-all .libsodium-build/lib/libsodium.so + - uses: actions/upload-artifact@v2 + with: + name: build-linux-musl-x64 + path: .libsodium-build/lib/libsodium.so + + build-macos: + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: configure + run: ./configure --disable-debug --prefix=$PWD/.libsodium-build + - name: make + run: make + - name: make check + run: make check + - name: make install + run: make install + - uses: actions/upload-artifact@v2 + with: + name: build-osx-x64 + path: .libsodium-build/lib/libsodium.dylib + + pack: + runs-on: ubuntu-latest + needs: + - build-windows + - build-linux-glibc + - build-linux-glibc-arm + - build-linux-glibc-arm64 + - build-linux-musl + - build-macos + container: + image: mcr.microsoft.com/dotnet/sdk:5.0 + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + steps: + - uses: actions/checkout@v1 + - uses: actions/download-artifact@v2 + with: + name: build-win-x64 + path: .libsodium-pack/runtimes/win-x64/native/ + - uses: actions/download-artifact@v2 + with: + name: build-win-x86 + path: .libsodium-pack/runtimes/win-x86/native/ + - uses: actions/download-artifact@v2 + with: + name: build-linux-x64 + path: .libsodium-pack/runtimes/linux-x64/native/ + - uses: actions/download-artifact@v2 + with: + name: build-linux-arm64 + path: .libsodium-pack/runtimes/linux-arm64/native/ + - uses: actions/download-artifact@v2 + with: + name: build-linux-arm + path: .libsodium-pack/runtimes/linux-arm/native/ + - uses: actions/download-artifact@v2 + with: + name: build-linux-musl-x64 + path: .libsodium-pack/runtimes/linux-musl-x64/native/ + - uses: actions/download-artifact@v2 + with: + name: build-osx-x64 + path: .libsodium-pack/runtimes/osx-x64/native/ + - name: Copy files + run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ + - name: Create NuGet package + run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj + - uses: actions/upload-artifact@v2 + with: + name: nuget-package + path: .libsodium-pack/bin/Release/*.nupkg + + build-test-binaries: + runs-on: ubuntu-latest + needs: + - pack + container: + image: mcr.microsoft.com/dotnet/sdk:5.0 + env: + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + steps: + - uses: actions/checkout@v1 + - uses: actions/download-artifact@v2 + with: + name: nuget-package + path: .libsodium-pack/ + - name: dotnet new + run: dotnet new console -n Tests -o .libsodium-test/ + - name: dotnet add package libsodium + run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack + - name: Copy files + run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs + - name: dotnet publish linux-x64 + run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: dotnet publish linux-arm + run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: dotnet publish linux-arm64 + run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true + working-directory: .libsodium-test/ + - name: Move Build Output + run: | + mkdir .libsodium-builds + mv .libsodium-test/bin/Release/net5.0/linux-arm/publish .libsodium-builds/linux-arm + mv .libsodium-test/bin/Release/net5.0/linux-arm64/publish .libsodium-builds/linux-arm64 + mv .libsodium-test/bin/Release/net5.0/linux-x64/publish .libsodium-builds/linux-x64 + - uses: actions/upload-artifact@v2 + with: + name: test-builds + path: .libsodium-builds/* + + run-test-binaries: + runs-on: ubuntu-20.04 + needs: + - build-test-binaries + env: + DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 + strategy: + matrix: + arch: [x64, arm, arm64] + steps: + - name: Set up build environment + run: | + export DEBIAN_FRONTEND=noninteractive + + cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse + deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse + EOF + + sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list + + sudo dpkg --add-architecture armhf + sudo dpkg --add-architecture arm64 + + sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64 + + - uses: actions/download-artifact@v2 + with: + name: test-builds + path: .libsodium-builds/ + + - name: Run ${{ matrix.arch }} + run: | + chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests + .libsodium-builds/linux-${{ matrix.arch }}/Tests + diff -Nru python-nacl-1.4.0/src/libsodium/.gitignore python-nacl-1.5.0/src/libsodium/.gitignore --- python-nacl-1.4.0/src/libsodium/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/.gitignore 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,162 @@ +*.bc +*.dSYM +*.done +*.final +*.gcda +*.gcno +*.i +*.la +*.lo +*.log +*.mem +*.nexe +*.o +*.plist +*.scan +*.sdf +*.status +*.tar.* +*.wasm +*.wast +*~ +.DS_Store +.deps +.dirstamp +.done +.libs +/bin/ +/obj/ +Build +INSTALL +Makefile +Makefile.in +Vagrantfile +aclocal.m4 +android-toolchain +android-toolchain-* +autom4te.cache +build +compile +confdefs.h +config.* +configure +configure.lineno +coverage.info +depcomp +install-sh +libsodium-*.tar.bz2 +libsodium-*.tar.gz +libsodium-*.vcproj +libsodium-*.vcproj.filters +libsodium-*.vcxproj +libsodium-*.vcxproj.filters +libsodium-android-* +libsodium-ios +libsodium-js +libsodium-js-* +libsodium-nativeclient +libsodium-nativeclient-* +libsodium-osx +libsodium-uninstalled.pc +libsodium-wasm32-wasi +libsodium-win32 +libsodium-win64 +libsodium.pc +libtool +ltmain.sh +m4/argz.m4 +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 +man/*.html +man/Makefile.in +missing +src/libsodium/*.def +src/libsodium/include/sodium/version.h +stamp-* +test-driver +test/default/*.asm.js +test/default/*.res +test/default/*.trs +test/default/aead_aes256gcm +test/default/aead_aes256gcm2 +test/default/aead_chacha20poly1305 +test/default/aead_chacha20poly13052 +test/default/aead_xchacha20poly1305 +test/default/auth +test/default/auth2 +test/default/auth3 +test/default/auth5 +test/default/auth6 +test/default/auth7 +test/default/box +test/default/box2 +test/default/box7 +test/default/box8 +test/default/box_easy +test/default/box_easy2 +test/default/box_seal +test/default/box_seed +test/default/browser +test/default/chacha20 +test/default/codecs +test/default/core1 +test/default/core2 +test/default/core3 +test/default/core4 +test/default/core5 +test/default/core6 +test/default/core_ed25519 +test/default/core_ristretto255 +test/default/ed25519_convert +test/default/generichash +test/default/generichash2 +test/default/generichash3 +test/default/hash +test/default/hash3 +test/default/kdf +test/default/keygen +test/default/kx +test/default/metamorphic +test/default/misuse +test/default/onetimeauth +test/default/onetimeauth2 +test/default/onetimeauth7 +test/default/pwhash_argon2i +test/default/pwhash_argon2id +test/default/pwhash_scrypt +test/default/pwhash_scrypt_ll +test/default/randombytes +test/default/scalarmult +test/default/scalarmult2 +test/default/scalarmult5 +test/default/scalarmult6 +test/default/scalarmult7 +test/default/scalarmult8 +test/default/scalarmult_ed25519 +test/default/scalarmult_ristretto255 +test/default/secretbox +test/default/secretbox2 +test/default/secretbox7 +test/default/secretbox8 +test/default/secretbox_easy +test/default/secretbox_easy2 +test/default/secretstream +test/default/shorthash +test/default/sign +test/default/siphashx24 +test/default/sodium_core +test/default/sodium_utils +test/default/sodium_utils2 +test/default/sodium_utils3 +test/default/sodium_version +test/default/stream +test/default/stream2 +test/default/stream3 +test/default/stream4 +test/default/verify1 +test/default/xchacha20 +test/js.done +testing diff -Nru python-nacl-1.4.0/src/libsodium/lgtm.yml python-nacl-1.5.0/src/libsodium/lgtm.yml --- python-nacl-1.4.0/src/libsodium/lgtm.yml 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/lgtm.yml 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,6 @@ +extraction: + cpp: + configure: + command: + - ./autogen.sh -s + - ./configure diff -Nru python-nacl-1.4.0/src/libsodium/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/libsodium.vcxproj 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -516,12 +516,10 @@ - - diff -Nru python-nacl-1.4.0/src/libsodium/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/libsodium.vcxproj.filters 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -614,9 +614,6 @@ Header Files - - Header Files - Header Files @@ -629,9 +626,6 @@ Header Files - - Header Files - Header Files diff -Nru python-nacl-1.4.0/src/libsodium/LICENSE python-nacl-1.5.0/src/libsodium/LICENSE --- python-nacl-1.4.0/src/libsodium/LICENSE 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/LICENSE 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ /* * ISC License * - * Copyright (c) 2013-2019 + * Copyright (c) 2013-2021 * Frank Denis * * Permission to use, copy, modify, and/or distribute this software for any Binary files /tmp/tmpq4ziyd5p/xJi4Yd6xUu/python-nacl-1.4.0/src/libsodium/logo.png and /tmp/tmpq4ziyd5p/hlyw6iCM2u/python-nacl-1.5.0/src/libsodium/logo.png differ diff -Nru python-nacl-1.4.0/src/libsodium/ltmain.sh python-nacl-1.5.0/src/libsodium/ltmain.sh --- python-nacl-1.4.0/src/libsodium/ltmain.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/ltmain.sh 1970-01-01 00:00:00.000000000 +0000 @@ -1,9661 +0,0 @@ - -# libtool (GNU libtool) 2.4.2 -# Written by Gordon Matzigkeit , 1996 - -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, -# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. -# This is free software; see the source for copying conditions. There is NO -# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -# GNU Libtool is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# As a special exception to the GNU General Public License, -# if you distribute this file as part of a program or library that -# is built using GNU Libtool, you may include this file under the -# same distribution terms that you use for the rest of that program. -# -# GNU Libtool is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Libtool; see the file COPYING. If not, a copy -# can be downloaded from http://www.gnu.org/licenses/gpl.html, -# or obtained by writing to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# Usage: $progname [OPTION]... [MODE-ARG]... -# -# Provide generalized library-building support services. -# -# --config show all configuration variables -# --debug enable verbose shell tracing -# -n, --dry-run display commands without modifying any files -# --features display basic configuration information and exit -# --mode=MODE use operation mode MODE -# --preserve-dup-deps don't remove duplicate dependency libraries -# --quiet, --silent don't print informational messages -# --no-quiet, --no-silent -# print informational messages (default) -# --no-warn don't display warning messages -# --tag=TAG use configuration variables from tag TAG -# -v, --verbose print more informational messages than default -# --no-verbose don't print the extra informational messages -# --version print version information -# -h, --help, --help-all print short, long, or detailed help message -# -# MODE must be one of the following: -# -# clean remove files from the build directory -# compile compile a source file into a libtool object -# execute automatically set library path, then run a program -# finish complete the installation of libtool libraries -# install install libraries or executables -# link create a library or an executable -# uninstall remove libraries from an installed directory -# -# MODE-ARGS vary depending on the MODE. When passed as first option, -# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that. -# Try `$progname --help --mode=MODE' for a more detailed description of MODE. -# -# When reporting a bug, please describe a test case to reproduce it and -# include the following information: -# -# host-triplet: $host -# shell: $SHELL -# compiler: $LTCC -# compiler flags: $LTCFLAGS -# linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.7ubuntu1 -# automake: $automake_version -# autoconf: $autoconf_version -# -# Report bugs to . -# GNU libtool home page: . -# General help using GNU software: . - -PROGRAM=libtool -PACKAGE=libtool -VERSION="2.4.2 Debian-2.4.2-1.7ubuntu1" -TIMESTAMP="" -package_revision=1.3337 - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - -# NLS nuisances: We save the old values to restore during execute mode. -lt_user_locale= -lt_safe_locale= -for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES -do - eval "if test \"\${$lt_var+set}\" = set; then - save_$lt_var=\$$lt_var - $lt_var=C - export $lt_var - lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" - lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" - fi" -done -LC_ALL=C -LANGUAGE=C -export LANGUAGE LC_ALL - -$lt_unset CDPATH - - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - - - -: ${CP="cp -f"} -test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'} -: ${MAKE="make"} -: ${MKDIR="mkdir"} -: ${MV="mv -f"} -: ${RM="rm -f"} -: ${SHELL="${CONFIG_SHELL-/bin/sh}"} -: ${Xsed="$SED -e 1s/^X//"} - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 -EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. -EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. - -exit_status=$EXIT_SUCCESS - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -dirname="s,/[^/]*$,," -basename="s,^.*/,," - -# func_dirname file append nondir_replacement -# Compute the dirname of FILE. If nonempty, add APPEND to the result, -# otherwise set result to NONDIR_REPLACEMENT. -func_dirname () -{ - func_dirname_result=`$ECHO "${1}" | $SED "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi -} # func_dirname may be replaced by extended shell implementation - - -# func_basename file -func_basename () -{ - func_basename_result=`$ECHO "${1}" | $SED "$basename"` -} # func_basename may be replaced by extended shell implementation - - -# func_dirname_and_basename file append nondir_replacement -# perform func_basename and func_dirname in a single function -# call: -# dirname: Compute the dirname of FILE. If nonempty, -# add APPEND to the result, otherwise set result -# to NONDIR_REPLACEMENT. -# value returned in "$func_dirname_result" -# basename: Compute filename of FILE. -# value retuned in "$func_basename_result" -# Implementation must be kept synchronized with func_dirname -# and func_basename. For efficiency, we do not delegate to -# those functions but instead duplicate the functionality here. -func_dirname_and_basename () -{ - # Extract subdirectory from the argument. - func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"` - if test "X$func_dirname_result" = "X${1}"; then - func_dirname_result="${3}" - else - func_dirname_result="$func_dirname_result${2}" - fi - func_basename_result=`$ECHO "${1}" | $SED -e "$basename"` -} # func_dirname_and_basename may be replaced by extended shell implementation - - -# func_stripname prefix suffix name -# strip PREFIX and SUFFIX off of NAME. -# PREFIX and SUFFIX must not contain globbing or regex special -# characters, hashes, percent signs, but SUFFIX may contain a leading -# dot (in which case that matches only a dot). -# func_strip_suffix prefix name -func_stripname () -{ - case ${2} in - .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; - *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; - esac -} # func_stripname may be replaced by extended shell implementation - - -# These SED scripts presuppose an absolute path with a trailing slash. -pathcar='s,^/\([^/]*\).*$,\1,' -pathcdr='s,^/[^/]*,,' -removedotparts=':dotsl - s@/\./@/@g - t dotsl - s,/\.$,/,' -collapseslashes='s@/\{1,\}@/@g' -finalslash='s,/*$,/,' - -# func_normal_abspath PATH -# Remove doubled-up and trailing slashes, "." path components, -# and cancel out any ".." path components in PATH after making -# it an absolute path. -# value returned in "$func_normal_abspath_result" -func_normal_abspath () -{ - # Start from root dir and reassemble the path. - func_normal_abspath_result= - func_normal_abspath_tpath=$1 - func_normal_abspath_altnamespace= - case $func_normal_abspath_tpath in - "") - # Empty path, that just means $cwd. - func_stripname '' '/' "`pwd`" - func_normal_abspath_result=$func_stripname_result - return - ;; - # The next three entries are used to spot a run of precisely - # two leading slashes without using negated character classes; - # we take advantage of case's first-match behaviour. - ///*) - # Unusual form of absolute path, do nothing. - ;; - //*) - # Not necessarily an ordinary path; POSIX reserves leading '//' - # and for example Cygwin uses it to access remote file shares - # over CIFS/SMB, so we conserve a leading double slash if found. - func_normal_abspath_altnamespace=/ - ;; - /*) - # Absolute path, do nothing. - ;; - *) - # Relative path, prepend $cwd. - func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath - ;; - esac - # Cancel out all the simple stuff to save iterations. We also want - # the path to end with a slash for ease of parsing, so make sure - # there is one (and only one) here. - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"` - while :; do - # Processed it all yet? - if test "$func_normal_abspath_tpath" = / ; then - # If we ascended to the root using ".." the result may be empty now. - if test -z "$func_normal_abspath_result" ; then - func_normal_abspath_result=/ - fi - break - fi - func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcar"` - func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ - -e "$pathcdr"` - # Figure out what to do with it - case $func_normal_abspath_tcomponent in - "") - # Trailing empty path component, ignore it. - ;; - ..) - # Parent dir; strip last assembled component from result. - func_dirname "$func_normal_abspath_result" - func_normal_abspath_result=$func_dirname_result - ;; - *) - # Actual path component, append it. - func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent - ;; - esac - done - # Restore leading double-slash if one was found on entry. - func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result -} - -# func_relative_path SRCDIR DSTDIR -# generates a relative path from SRCDIR to DSTDIR, with a trailing -# slash if non-empty, suitable for immediately appending a filename -# without needing to append a separator. -# value returned in "$func_relative_path_result" -func_relative_path () -{ - func_relative_path_result= - func_normal_abspath "$1" - func_relative_path_tlibdir=$func_normal_abspath_result - func_normal_abspath "$2" - func_relative_path_tbindir=$func_normal_abspath_result - - # Ascend the tree starting from libdir - while :; do - # check if we have found a prefix of bindir - case $func_relative_path_tbindir in - $func_relative_path_tlibdir) - # found an exact match - func_relative_path_tcancelled= - break - ;; - $func_relative_path_tlibdir*) - # found a matching prefix - func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" - func_relative_path_tcancelled=$func_stripname_result - if test -z "$func_relative_path_result"; then - func_relative_path_result=. - fi - break - ;; - *) - func_dirname $func_relative_path_tlibdir - func_relative_path_tlibdir=${func_dirname_result} - if test "x$func_relative_path_tlibdir" = x ; then - # Have to descend all the way to the root! - func_relative_path_result=../$func_relative_path_result - func_relative_path_tcancelled=$func_relative_path_tbindir - break - fi - func_relative_path_result=../$func_relative_path_result - ;; - esac - done - - # Now calculate path; take care to avoid doubling-up slashes. - func_stripname '' '/' "$func_relative_path_result" - func_relative_path_result=$func_stripname_result - func_stripname '/' '/' "$func_relative_path_tcancelled" - if test "x$func_stripname_result" != x ; then - func_relative_path_result=${func_relative_path_result}/${func_stripname_result} - fi - - # Normalisation. If bindir is libdir, return empty string, - # else relative path ending with a slash; either way, target - # file name can be directly appended. - if test ! -z "$func_relative_path_result"; then - func_stripname './' '' "$func_relative_path_result/" - func_relative_path_result=$func_stripname_result - fi -} - -# The name of this program: -func_dirname_and_basename "$progpath" -progname=$func_basename_result - -# Make sure we have an absolute path for reexecution: -case $progpath in - [\\/]*|[A-Za-z]:\\*) ;; - *[\\/]*) - progdir=$func_dirname_result - progdir=`cd "$progdir" && pwd` - progpath="$progdir/$progname" - ;; - *) - save_IFS="$IFS" - IFS=${PATH_SEPARATOR-:} - for progdir in $PATH; do - IFS="$save_IFS" - test -x "$progdir/$progname" && break - done - IFS="$save_IFS" - test -n "$progdir" || progdir=`pwd` - progpath="$progdir/$progname" - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed="${SED}"' -e 1s/^X//' -sed_quote_subst='s/\([`"$\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\(["`\\]\)/\\\1/g' - -# Sed substitution that turns a string into a regex matching for the -# string literally. -sed_make_literal_regex='s,[].[^$\\*\/],\\&,g' - -# Sed substitution that converts a w32 file name or path -# which contains forward slashes, into one that contains -# (escaped) backslashes. A very naive implementation. -lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - -# Re-`\' parameter expansions in output of double_quote_subst that were -# `\'-ed in input to the same. If an odd number of `\' preceded a '$' -# in input to double_quote_subst, that '$' was protected from expansion. -# Since each input `\' is now two `\'s, look for any number of runs of -# four `\'s followed by two `\'s and then a '$'. `\' that '$'. -bs='\\' -bs2='\\\\' -bs4='\\\\\\\\' -dollar='\$' -sed_double_backslash="\ - s/$bs4/&\\ -/g - s/^$bs2$dollar/$bs&/ - s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g - s/\n//g" - -# Standard options: -opt_dry_run=false -opt_help=false -opt_quiet=false -opt_verbose=false -opt_warning=: - -# func_echo arg... -# Echo program name prefixed message, along with the current mode -# name if it has been set yet. -func_echo () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }$*" -} - -# func_verbose arg... -# Echo program name prefixed message in verbose mode only. -func_verbose () -{ - $opt_verbose && func_echo ${1+"$@"} - - # A bug in bash halts the script if the last line of a function - # fails when set -e is in force, so we need another command to - # work around that: - : -} - -# func_echo_all arg... -# Invoke $ECHO with all args, space-separated. -func_echo_all () -{ - $ECHO "$*" -} - -# func_error arg... -# Echo program name prefixed message to standard error. -func_error () -{ - $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2 -} - -# func_warning arg... -# Echo program name prefixed warning message to standard error. -func_warning () -{ - $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2 - - # bash bug again: - : -} - -# func_fatal_error arg... -# Echo program name prefixed message to standard error, and exit. -func_fatal_error () -{ - func_error ${1+"$@"} - exit $EXIT_FAILURE -} - -# func_fatal_help arg... -# Echo program name prefixed message to standard error, followed by -# a help hint, and exit. -func_fatal_help () -{ - func_error ${1+"$@"} - func_fatal_error "$help" -} -help="Try \`$progname --help' for more information." ## default - - -# func_grep expression filename -# Check whether EXPRESSION matches any line of FILENAME, without output. -func_grep () -{ - $GREP "$1" "$2" >/dev/null 2>&1 -} - - -# func_mkdir_p directory-path -# Make sure the entire path to DIRECTORY-PATH is available. -func_mkdir_p () -{ - my_directory_path="$1" - my_dir_list= - - if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then - - # Protect directory names starting with `-' - case $my_directory_path in - -*) my_directory_path="./$my_directory_path" ;; - esac - - # While some portion of DIR does not yet exist... - while test ! -d "$my_directory_path"; do - # ...make a list in topmost first order. Use a colon delimited - # list incase some portion of path contains whitespace. - my_dir_list="$my_directory_path:$my_dir_list" - - # If the last portion added has no slash in it, the list is done - case $my_directory_path in */*) ;; *) break ;; esac - - # ...otherwise throw away the child directory and loop - my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"` - done - my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'` - - save_mkdir_p_IFS="$IFS"; IFS=':' - for my_dir in $my_dir_list; do - IFS="$save_mkdir_p_IFS" - # mkdir can fail with a `File exist' error if two processes - # try to create one of the directories concurrently. Don't - # stop in that case! - $MKDIR "$my_dir" 2>/dev/null || : - done - IFS="$save_mkdir_p_IFS" - - # Bail out if we (or some other process) failed to create a directory. - test -d "$my_directory_path" || \ - func_fatal_error "Failed to create \`$1'" - fi -} - - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$opt_dry_run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $MKDIR "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || \ - func_fatal_error "cannot create temporary directory \`$my_tmpdir'" - fi - - $ECHO "$my_tmpdir" -} - - -# func_quote_for_eval arg -# Aesthetically quote ARG to be evaled later. -# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT -# is double-quoted, suitable for a subsequent eval, whereas -# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters -# which are still active within double quotes backslashified. -func_quote_for_eval () -{ - case $1 in - *[\\\`\"\$]*) - func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;; - *) - func_quote_for_eval_unquoted_result="$1" ;; - esac - - case $func_quote_for_eval_unquoted_result in - # Double-quote args containing shell metacharacters to delay - # word splitting, command substitution and and variable - # expansion for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" - ;; - *) - func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" - esac -} - - -# func_quote_for_expand arg -# Aesthetically quote ARG to be evaled later; same as above, -# but do not quote variable references. -func_quote_for_expand () -{ - case $1 in - *[\\\`\"]*) - my_arg=`$ECHO "$1" | $SED \ - -e "$double_quote_subst" -e "$sed_double_backslash"` ;; - *) - my_arg="$1" ;; - esac - - case $my_arg in - # Double-quote args containing shell metacharacters to delay - # word splitting and command substitution for a subsequent eval. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - my_arg="\"$my_arg\"" - ;; - esac - - func_quote_for_expand_result="$my_arg" -} - - -# func_show_eval cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. -func_show_eval () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$my_cmd" - my_status=$? - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - - -# func_show_eval_locale cmd [fail_exp] -# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is -# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP -# is given, then evaluate it. Use the saved locale for evaluation. -func_show_eval_locale () -{ - my_cmd="$1" - my_fail_exp="${2-:}" - - ${opt_silent-false} || { - func_quote_for_expand "$my_cmd" - eval "func_echo $func_quote_for_expand_result" - } - - if ${opt_dry_run-false}; then :; else - eval "$lt_user_locale - $my_cmd" - my_status=$? - eval "$lt_safe_locale" - if test "$my_status" -eq 0; then :; else - eval "(exit $my_status); $my_fail_exp" - fi - fi -} - -# func_tr_sh -# Turn $1 into a string suitable for a shell variable name. -# Result is stored in $func_tr_sh_result. All characters -# not in the set a-zA-Z0-9_ are replaced with '_'. Further, -# if $1 begins with a digit, a '_' is prepended as well. -func_tr_sh () -{ - case $1 in - [0-9]* | *[!a-zA-Z0-9_]*) - func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'` - ;; - * ) - func_tr_sh_result=$1 - ;; - esac -} - - -# func_version -# Echo version message to standard output and exit. -func_version () -{ - $opt_debug - - $SED -n '/(C)/!b go - :more - /\./!{ - N - s/\n# / / - b more - } - :go - /^# '$PROGRAM' (GNU /,/# warranty; / { - s/^# // - s/^# *$// - s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ - p - }' < "$progpath" - exit $? -} - -# func_usage -# Echo short help message to standard output and exit. -func_usage () -{ - $opt_debug - - $SED -n '/^# Usage:/,/^# *.*--help/ { - s/^# // - s/^# *$// - s/\$progname/'$progname'/ - p - }' < "$progpath" - echo - $ECHO "run \`$progname --help | more' for full usage" - exit $? -} - -# func_help [NOEXIT] -# Echo long help message to standard output and exit, -# unless 'noexit' is passed as argument. -func_help () -{ - $opt_debug - - $SED -n '/^# Usage:/,/# Report bugs to/ { - :print - s/^# // - s/^# *$// - s*\$progname*'$progname'* - s*\$host*'"$host"'* - s*\$SHELL*'"$SHELL"'* - s*\$LTCC*'"$LTCC"'* - s*\$LTCFLAGS*'"$LTCFLAGS"'* - s*\$LD*'"$LD"'* - s/\$with_gnu_ld/'"$with_gnu_ld"'/ - s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/ - s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/ - p - d - } - /^# .* home page:/b print - /^# General help using/b print - ' < "$progpath" - ret=$? - if test -z "$1"; then - exit $ret - fi -} - -# func_missing_arg argname -# Echo program name prefixed message to standard error and set global -# exit_cmd. -func_missing_arg () -{ - $opt_debug - - func_error "missing argument for $1." - exit_cmd=exit -} - - -# func_split_short_opt shortopt -# Set func_split_short_opt_name and func_split_short_opt_arg shell -# variables after splitting SHORTOPT after the 2nd character. -func_split_short_opt () -{ - my_sed_short_opt='1s/^\(..\).*$/\1/;q' - my_sed_short_rest='1s/^..\(.*\)$/\1/;q' - - func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"` - func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"` -} # func_split_short_opt may be replaced by extended shell implementation - - -# func_split_long_opt longopt -# Set func_split_long_opt_name and func_split_long_opt_arg shell -# variables after splitting LONGOPT at the `=' sign. -func_split_long_opt () -{ - my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q' - my_sed_long_arg='1s/^--[^=]*=//' - - func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"` - func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"` -} # func_split_long_opt may be replaced by extended shell implementation - -exit_cmd=: - - - - - -magic="%%%MAGIC variable%%%" -magic_exe="%%%MAGIC EXE variable%%%" - -# Global variables. -nonopt= -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -# func_append var value -# Append VALUE to the end of shell variable VAR. -func_append () -{ - eval "${1}=\$${1}\${2}" -} # func_append may be replaced by extended shell implementation - -# func_append_quoted var value -# Quote VALUE and append to the end of shell variable VAR, separated -# by a space. -func_append_quoted () -{ - func_quote_for_eval "${2}" - eval "${1}=\$${1}\\ \$func_quote_for_eval_result" -} # func_append_quoted may be replaced by extended shell implementation - - -# func_arith arithmetic-term... -func_arith () -{ - func_arith_result=`expr "${@}"` -} # func_arith may be replaced by extended shell implementation - - -# func_len string -# STRING may not start with a hyphen. -func_len () -{ - func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len` -} # func_len may be replaced by extended shell implementation - - -# func_lo2o object -func_lo2o () -{ - func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"` -} # func_lo2o may be replaced by extended shell implementation - - -# func_xform libobj-or-source -func_xform () -{ - func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'` -} # func_xform may be replaced by extended shell implementation - - -# func_fatal_configuration arg... -# Echo program name prefixed message to standard error, followed by -# a configuration failure hint, and exit. -func_fatal_configuration () -{ - func_error ${1+"$@"} - func_error "See the $PACKAGE documentation for more information." - func_fatal_error "Fatal configuration error." -} - - -# func_config -# Display the configuration for all the tags in this script. -func_config () -{ - re_begincf='^# ### BEGIN LIBTOOL' - re_endcf='^# ### END LIBTOOL' - - # Default configuration. - $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" - - # Now print the configurations for the tags. - for tagname in $taglist; do - $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" - done - - exit $? -} - -# func_features -# Display the features supported by this script. -func_features () -{ - echo "host: $host" - if test "$build_libtool_libs" = yes; then - echo "enable shared libraries" - else - echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - echo "enable static libraries" - else - echo "disable static libraries" - fi - - exit $? -} - -# func_enable_tag tagname -# Verify that TAGNAME is valid, and either flag an error and exit, or -# enable the TAGNAME tag. We also add TAGNAME to the global $taglist -# variable here. -func_enable_tag () -{ - # Global variable: - tagname="$1" - - re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" - re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" - sed_extractcf="/$re_begincf/,/$re_endcf/p" - - # Validate tagname. - case $tagname in - *[!-_A-Za-z0-9,/]*) - func_fatal_error "invalid tag name: $tagname" - ;; - esac - - # Don't test for the "default" C tag, as we know it's - # there but not specially marked. - case $tagname in - CC) ;; - *) - if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then - taglist="$taglist $tagname" - - # Evaluate the configuration. Be careful to quote the path - # and the sed script, to avoid splitting on whitespace, but - # also don't use non-portable quotes within backquotes within - # quotes we have to do it in 2 steps: - extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` - eval "$extractedcf" - else - func_error "ignoring unknown tag $tagname" - fi - ;; - esac -} - -# func_check_version_match -# Ensure that we are using m4 macros, and libtool script from the same -# release of libtool. -func_check_version_match () -{ - if test "$package_revision" != "$macro_revision"; then - if test "$VERSION" != "$macro_version"; then - if test -z "$macro_version"; then - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from an older release. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, but the -$progname: definition of this LT_INIT comes from $PACKAGE $macro_version. -$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION -$progname: and run autoconf again. -_LT_EOF - fi - else - cat >&2 <<_LT_EOF -$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, -$progname: but the definition of this LT_INIT comes from revision $macro_revision. -$progname: You should recreate aclocal.m4 with macros from revision $package_revision -$progname: of $PACKAGE $VERSION and run autoconf again. -_LT_EOF - fi - - exit $EXIT_MISMATCH - fi -} - - -# Shorthand for --mode=foo, only valid as the first argument -case $1 in -clean|clea|cle|cl) - shift; set dummy --mode clean ${1+"$@"}; shift - ;; -compile|compil|compi|comp|com|co|c) - shift; set dummy --mode compile ${1+"$@"}; shift - ;; -execute|execut|execu|exec|exe|ex|e) - shift; set dummy --mode execute ${1+"$@"}; shift - ;; -finish|finis|fini|fin|fi|f) - shift; set dummy --mode finish ${1+"$@"}; shift - ;; -install|instal|insta|inst|ins|in|i) - shift; set dummy --mode install ${1+"$@"}; shift - ;; -link|lin|li|l) - shift; set dummy --mode link ${1+"$@"}; shift - ;; -uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) - shift; set dummy --mode uninstall ${1+"$@"}; shift - ;; -esac - - - -# Option defaults: -opt_debug=: -opt_dry_run=false -opt_config=false -opt_preserve_dup_deps=false -opt_features=false -opt_finish=false -opt_help=false -opt_help_all=false -opt_silent=: -opt_warning=: -opt_verbose=: -opt_silent=false -opt_verbose=false - - -# Parse options once, thoroughly. This comes as soon as possible in the -# script to make things like `--version' happen as quickly as we can. -{ - # this just eases exit handling - while test $# -gt 0; do - opt="$1" - shift - case $opt in - --debug|-x) opt_debug='set -x' - func_echo "enabling shell trace mode" - $opt_debug - ;; - --dry-run|--dryrun|-n) - opt_dry_run=: - ;; - --config) - opt_config=: -func_config - ;; - --dlopen|-dlopen) - optarg="$1" - opt_dlopen="${opt_dlopen+$opt_dlopen -}$optarg" - shift - ;; - --preserve-dup-deps) - opt_preserve_dup_deps=: - ;; - --features) - opt_features=: -func_features - ;; - --finish) - opt_finish=: -set dummy --mode finish ${1+"$@"}; shift - ;; - --help) - opt_help=: - ;; - --help-all) - opt_help_all=: -opt_help=': help-all' - ;; - --mode) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_mode="$optarg" -case $optarg in - # Valid mode arguments: - clean|compile|execute|finish|install|link|relink|uninstall) ;; - - # Catch anything else as an error - *) func_error "invalid argument for $opt" - exit_cmd=exit - break - ;; -esac - shift - ;; - --no-silent|--no-quiet) - opt_silent=false -func_append preserve_args " $opt" - ;; - --no-warning|--no-warn) - opt_warning=false -func_append preserve_args " $opt" - ;; - --no-verbose) - opt_verbose=false -func_append preserve_args " $opt" - ;; - --silent|--quiet) - opt_silent=: -func_append preserve_args " $opt" - opt_verbose=false - ;; - --verbose|-v) - opt_verbose=: -func_append preserve_args " $opt" -opt_silent=false - ;; - --tag) - test $# = 0 && func_missing_arg $opt && break - optarg="$1" - opt_tag="$optarg" -func_append preserve_args " $opt $optarg" -func_enable_tag "$optarg" - shift - ;; - - -\?|-h) func_usage ;; - --help) func_help ;; - --version) func_version ;; - - # Separate optargs to long options: - --*=*) - func_split_long_opt "$opt" - set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"} - shift - ;; - - # Separate non-argument short options: - -\?*|-h*|-n*|-v*) - func_split_short_opt "$opt" - set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"} - shift - ;; - - --) break ;; - -*) func_fatal_help "unrecognized option \`$opt'" ;; - *) set dummy "$opt" ${1+"$@"}; shift; break ;; - esac - done - - # Validate options: - - # save first non-option argument - if test "$#" -gt 0; then - nonopt="$opt" - shift - fi - - # preserve --debug - test "$opt_debug" = : || func_append preserve_args " --debug" - - case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) - # don't eliminate duplications in $postdeps and $predeps - opt_duplicate_compiler_generated_deps=: - ;; - *) - opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps - ;; - esac - - $opt_help || { - # Sanity checks first: - func_check_version_match - - if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - func_fatal_configuration "not configured to build any kind of library" - fi - - # Darwin sucks - eval std_shrext=\"$shrext_cmds\" - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$opt_dlopen" && test "$opt_mode" != execute; then - func_error "unrecognized option \`-dlopen'" - $ECHO "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$progname --help --mode=$opt_mode' for more information." - } - - - # Bail if the options were screwed - $exit_cmd $EXIT_FAILURE -} - - - - -## ----------- ## -## Main. ## -## ----------- ## - -# func_lalib_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_lalib_p () -{ - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 -} - -# func_lalib_unsafe_p file -# True iff FILE is a libtool `.la' library or `.lo' object file. -# This function implements the same check as func_lalib_p without -# resorting to external programs. To this end, it redirects stdin and -# closes it afterwards, without saving the original file descriptor. -# As a safety measure, use it only where a negative result would be -# fatal anyway. Works if `file' does not exist. -func_lalib_unsafe_p () -{ - lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then - for lalib_p_l in 1 2 3 4 - do - read lalib_p_line - case "$lalib_p_line" in - \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; - esac - done - exec 0<&5 5<&- - fi - test "$lalib_p" = yes -} - -# func_ltwrapper_script_p file -# True iff FILE is a libtool wrapper script -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_script_p () -{ - func_lalib_p "$1" -} - -# func_ltwrapper_executable_p file -# True iff FILE is a libtool wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_executable_p () -{ - func_ltwrapper_exec_suffix= - case $1 in - *.exe) ;; - *) func_ltwrapper_exec_suffix=.exe ;; - esac - $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 -} - -# func_ltwrapper_scriptname file -# Assumes file is an ltwrapper_executable -# uses $file to determine the appropriate filename for a -# temporary ltwrapper_script. -func_ltwrapper_scriptname () -{ - func_dirname_and_basename "$1" "" "." - func_stripname '' '.exe' "$func_basename_result" - func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" -} - -# func_ltwrapper_p file -# True iff FILE is a libtool wrapper script or wrapper executable -# This function is only a basic sanity check; it will hardly flush out -# determined imposters. -func_ltwrapper_p () -{ - func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" -} - - -# func_execute_cmds commands fail_cmd -# Execute tilde-delimited COMMANDS. -# If FAIL_CMD is given, eval that upon failure. -# FAIL_CMD may read-access the current command in variable CMD! -func_execute_cmds () -{ - $opt_debug - save_ifs=$IFS; IFS='~' - for cmd in $1; do - IFS=$save_ifs - eval cmd=\"$cmd\" - func_show_eval "$cmd" "${2-:}" - done - IFS=$save_ifs -} - - -# func_source file -# Source FILE, adding directory component if necessary. -# Note that it is not necessary on cygwin/mingw to append a dot to -# FILE even if both FILE and FILE.exe exist: automatic-append-.exe -# behavior happens only for exec(3), not for open(2)! Also, sourcing -# `FILE.' does not work on cygwin managed mounts. -func_source () -{ - $opt_debug - case $1 in - */* | *\\*) . "$1" ;; - *) . "./$1" ;; - esac -} - - -# func_resolve_sysroot PATH -# Replace a leading = in PATH with a sysroot. Store the result into -# func_resolve_sysroot_result -func_resolve_sysroot () -{ - func_resolve_sysroot_result=$1 - case $func_resolve_sysroot_result in - =*) - func_stripname '=' '' "$func_resolve_sysroot_result" - func_resolve_sysroot_result=$lt_sysroot$func_stripname_result - ;; - esac -} - -# func_replace_sysroot PATH -# If PATH begins with the sysroot, replace it with = and -# store the result into func_replace_sysroot_result. -func_replace_sysroot () -{ - case "$lt_sysroot:$1" in - ?*:"$lt_sysroot"*) - func_stripname "$lt_sysroot" '' "$1" - func_replace_sysroot_result="=$func_stripname_result" - ;; - *) - # Including no sysroot. - func_replace_sysroot_result=$1 - ;; - esac -} - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - $opt_debug - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - func_append_quoted CC_quoted "$arg" - done - CC_expanded=`func_echo_all $CC` - CC_quoted_expanded=`func_echo_all $CC_quoted` - case "$@ " in - " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ - " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - func_echo "unable to infer tagged configuration" - func_fatal_error "specify a tag with \`--tag'" -# else -# func_verbose "using $tagname tagged configuration" - fi - ;; - esac - fi -} - - - -# func_write_libtool_object output_name pic_name nonpic_name -# Create a libtool object file (analogous to a ".la" file), -# but don't create it if we're doing a dry run. -func_write_libtool_object () -{ - write_libobj=${1} - if test "$build_libtool_libs" = yes; then - write_lobj=\'${2}\' - else - write_lobj=none - fi - - if test "$build_old_libs" = yes; then - write_oldobj=\'${3}\' - else - write_oldobj=none - fi - - $opt_dry_run || { - cat >${write_libobj}T </dev/null` - if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then - func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | - $SED -e "$lt_sed_naive_backslashify"` - else - func_convert_core_file_wine_to_w32_result= - fi - fi -} -# end: func_convert_core_file_wine_to_w32 - - -# func_convert_core_path_wine_to_w32 ARG -# Helper function used by path conversion functions when $build is *nix, and -# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly -# configured wine environment available, with the winepath program in $build's -# $PATH. Assumes ARG has no leading or trailing path separator characters. -# -# ARG is path to be converted from $build format to win32. -# Result is available in $func_convert_core_path_wine_to_w32_result. -# Unconvertible file (directory) names in ARG are skipped; if no directory names -# are convertible, then the result may be empty. -func_convert_core_path_wine_to_w32 () -{ - $opt_debug - # unfortunately, winepath doesn't convert paths, only file names - func_convert_core_path_wine_to_w32_result="" - if test -n "$1"; then - oldIFS=$IFS - IFS=: - for func_convert_core_path_wine_to_w32_f in $1; do - IFS=$oldIFS - func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" - if test -n "$func_convert_core_file_wine_to_w32_result" ; then - if test -z "$func_convert_core_path_wine_to_w32_result"; then - func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result" - else - func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" - fi - fi - done - IFS=$oldIFS - fi -} -# end: func_convert_core_path_wine_to_w32 - - -# func_cygpath ARGS... -# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when -# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) -# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or -# (2), returns the Cygwin file name or path in func_cygpath_result (input -# file name or path is assumed to be in w32 format, as previously converted -# from $build's *nix or MSYS format). In case (3), returns the w32 file name -# or path in func_cygpath_result (input file name or path is assumed to be in -# Cygwin format). Returns an empty string on error. -# -# ARGS are passed to cygpath, with the last one being the file name or path to -# be converted. -# -# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH -# environment variable; do not put it in $PATH. -func_cygpath () -{ - $opt_debug - if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then - func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` - if test "$?" -ne 0; then - # on failure, ensure result is empty - func_cygpath_result= - fi - else - func_cygpath_result= - func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'" - fi -} -#end: func_cygpath - - -# func_convert_core_msys_to_w32 ARG -# Convert file name or path ARG from MSYS format to w32 format. Return -# result in func_convert_core_msys_to_w32_result. -func_convert_core_msys_to_w32 () -{ - $opt_debug - # awkward: cmd appends spaces to result - func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | - $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"` -} -#end: func_convert_core_msys_to_w32 - - -# func_convert_file_check ARG1 ARG2 -# Verify that ARG1 (a file name in $build format) was converted to $host -# format in ARG2. Otherwise, emit an error message, but continue (resetting -# func_to_host_file_result to ARG1). -func_convert_file_check () -{ - $opt_debug - if test -z "$2" && test -n "$1" ; then - func_error "Could not determine host file name corresponding to" - func_error " \`$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_file_result="$1" - fi -} -# end func_convert_file_check - - -# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH -# Verify that FROM_PATH (a path in $build format) was converted to $host -# format in TO_PATH. Otherwise, emit an error message, but continue, resetting -# func_to_host_file_result to a simplistic fallback value (see below). -func_convert_path_check () -{ - $opt_debug - if test -z "$4" && test -n "$3"; then - func_error "Could not determine the host path corresponding to" - func_error " \`$3'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This is a deliberately simplistic "conversion" and - # should not be "improved". See libtool.info. - if test "x$1" != "x$2"; then - lt_replace_pathsep_chars="s|$1|$2|g" - func_to_host_path_result=`echo "$3" | - $SED -e "$lt_replace_pathsep_chars"` - else - func_to_host_path_result="$3" - fi - fi -} -# end func_convert_path_check - - -# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG -# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT -# and appending REPL if ORIG matches BACKPAT. -func_convert_path_front_back_pathsep () -{ - $opt_debug - case $4 in - $1 ) func_to_host_path_result="$3$func_to_host_path_result" - ;; - esac - case $4 in - $2 ) func_append func_to_host_path_result "$3" - ;; - esac -} -# end func_convert_path_front_back_pathsep - - -################################################## -# $build to $host FILE NAME CONVERSION FUNCTIONS # -################################################## -# invoked via `$to_host_file_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# Result will be available in $func_to_host_file_result. - - -# func_to_host_file ARG -# Converts the file name ARG from $build format to $host format. Return result -# in func_to_host_file_result. -func_to_host_file () -{ - $opt_debug - $to_host_file_cmd "$1" -} -# end func_to_host_file - - -# func_to_tool_file ARG LAZY -# converts the file name ARG from $build format to toolchain format. Return -# result in func_to_tool_file_result. If the conversion in use is listed -# in (the comma separated) LAZY, no conversion takes place. -func_to_tool_file () -{ - $opt_debug - case ,$2, in - *,"$to_tool_file_cmd",*) - func_to_tool_file_result=$1 - ;; - *) - $to_tool_file_cmd "$1" - func_to_tool_file_result=$func_to_host_file_result - ;; - esac -} -# end func_to_tool_file - - -# func_convert_file_noop ARG -# Copy ARG to func_to_host_file_result. -func_convert_file_noop () -{ - func_to_host_file_result="$1" -} -# end func_convert_file_noop - - -# func_convert_file_msys_to_w32 ARG -# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_file_result. -func_convert_file_msys_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_to_host_file_result="$func_convert_core_msys_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_w32 - - -# func_convert_file_cygwin_to_w32 ARG -# Convert file name ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_file_cygwin_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # because $build is cygwin, we call "the" cygpath in $PATH; no need to use - # LT_CYGPATH in this case. - func_to_host_file_result=`cygpath -m "$1"` - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_cygwin_to_w32 - - -# func_convert_file_nix_to_w32 ARG -# Convert file name ARG from *nix to w32 format. Requires a wine environment -# and a working winepath. Returns result in func_to_host_file_result. -func_convert_file_nix_to_w32 () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_file_wine_to_w32 "$1" - func_to_host_file_result="$func_convert_core_file_wine_to_w32_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_w32 - - -# func_convert_file_msys_to_cygwin ARG -# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_file_msys_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - func_convert_core_msys_to_w32 "$1" - func_cygpath -u "$func_convert_core_msys_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_msys_to_cygwin - - -# func_convert_file_nix_to_cygwin ARG -# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed -# in a wine environment, working winepath, and LT_CYGPATH set. Returns result -# in func_to_host_file_result. -func_convert_file_nix_to_cygwin () -{ - $opt_debug - func_to_host_file_result="$1" - if test -n "$1"; then - # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. - func_convert_core_file_wine_to_w32 "$1" - func_cygpath -u "$func_convert_core_file_wine_to_w32_result" - func_to_host_file_result="$func_cygpath_result" - fi - func_convert_file_check "$1" "$func_to_host_file_result" -} -# end func_convert_file_nix_to_cygwin - - -############################################# -# $build to $host PATH CONVERSION FUNCTIONS # -############################################# -# invoked via `$to_host_path_cmd ARG' -# -# In each case, ARG is the path to be converted from $build to $host format. -# The result will be available in $func_to_host_path_result. -# -# Path separators are also converted from $build format to $host format. If -# ARG begins or ends with a path separator character, it is preserved (but -# converted to $host format) on output. -# -# All path conversion functions are named using the following convention: -# file name conversion function : func_convert_file_X_to_Y () -# path conversion function : func_convert_path_X_to_Y () -# where, for any given $build/$host combination the 'X_to_Y' value is the -# same. If conversion functions are added for new $build/$host combinations, -# the two new functions must follow this pattern, or func_init_to_host_path_cmd -# will break. - - -# func_init_to_host_path_cmd -# Ensures that function "pointer" variable $to_host_path_cmd is set to the -# appropriate value, based on the value of $to_host_file_cmd. -to_host_path_cmd= -func_init_to_host_path_cmd () -{ - $opt_debug - if test -z "$to_host_path_cmd"; then - func_stripname 'func_convert_file_' '' "$to_host_file_cmd" - to_host_path_cmd="func_convert_path_${func_stripname_result}" - fi -} - - -# func_to_host_path ARG -# Converts the path ARG from $build format to $host format. Return result -# in func_to_host_path_result. -func_to_host_path () -{ - $opt_debug - func_init_to_host_path_cmd - $to_host_path_cmd "$1" -} -# end func_to_host_path - - -# func_convert_path_noop ARG -# Copy ARG to func_to_host_path_result. -func_convert_path_noop () -{ - func_to_host_path_result="$1" -} -# end func_convert_path_noop - - -# func_convert_path_msys_to_w32 ARG -# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic -# conversion to w32 is not available inside the cwrapper. Returns result in -# func_to_host_path_result. -func_convert_path_msys_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from ARG. MSYS - # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; - # and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_msys_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_msys_to_w32 - - -# func_convert_path_cygwin_to_w32 ARG -# Convert path ARG from Cygwin to w32 format. Returns result in -# func_to_host_file_result. -func_convert_path_cygwin_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_cygwin_to_w32 - - -# func_convert_path_nix_to_w32 ARG -# Convert path ARG from *nix to w32 format. Requires a wine environment and -# a working winepath. Returns result in func_to_host_file_result. -func_convert_path_nix_to_w32 () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_to_host_path_result="$func_convert_core_path_wine_to_w32_result" - func_convert_path_check : ";" \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" - fi -} -# end func_convert_path_nix_to_w32 - - -# func_convert_path_msys_to_cygwin ARG -# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. -# Returns result in func_to_host_file_result. -func_convert_path_msys_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # See func_convert_path_msys_to_w32: - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_msys_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_msys_to_cygwin - - -# func_convert_path_nix_to_cygwin ARG -# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a -# a wine environment, working winepath, and LT_CYGPATH set. Returns result in -# func_to_host_file_result. -func_convert_path_nix_to_cygwin () -{ - $opt_debug - func_to_host_path_result="$1" - if test -n "$1"; then - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_stripname : : "$1" - func_to_host_path_tmp1=$func_stripname_result - func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" - func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" - func_to_host_path_result="$func_cygpath_result" - func_convert_path_check : : \ - "$func_to_host_path_tmp1" "$func_to_host_path_result" - func_convert_path_front_back_pathsep ":*" "*:" : "$1" - fi -} -# end func_convert_path_nix_to_cygwin - - -# func_mode_compile arg... -func_mode_compile () -{ - $opt_debug - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - pie_flag= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - test -n "$libobj" && \ - func_fatal_error "you cannot specify \`-o' more than once" - arg_mode=target - continue - ;; - - -pie | -fpie | -fPIE) - func_append pie_flag " $arg" - continue - ;; - - -shared | -static | -prefer-pic | -prefer-non-pic) - func_append later " $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - func_append_quoted lastarg "$arg" - done - IFS="$save_ifs" - func_stripname ' ' '' "$lastarg" - lastarg=$func_stripname_result - - # Add the arguments to base_compile. - func_append base_compile " $lastarg" - continue - ;; - - *) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - func_append_quoted base_compile "$lastarg" - done # for arg - - case $arg_mode in - arg) - func_fatal_error "you must specify an argument for -Xcompile" - ;; - target) - func_fatal_error "you must specify a target with \`-o'" - ;; - *) - # Get the name of the library object. - test -z "$libobj" && { - func_basename "$srcfile" - libobj="$func_basename_result" - } - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - case $libobj in - *.[cCFSifmso] | \ - *.ada | *.adb | *.ads | *.asm | \ - *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ - *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) - func_xform "$libobj" - libobj=$func_xform_result - ;; - esac - - case $libobj in - *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; - *) - func_fatal_error "cannot determine name of library object from \`$libobj'" - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - continue - ;; - - -static) - build_libtool_libs=no - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - func_quote_for_eval "$libobj" - test "X$libobj" != "X$func_quote_for_eval_result" \ - && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && func_warning "libobj name \`$libobj' may not contain shell special characters." - func_dirname_and_basename "$obj" "/" "" - objname="$func_basename_result" - xdir="$func_dirname_result" - lobj=${xdir}$objdir/$objname - - test -z "$base_compile" && \ - func_fatal_help "you must specify a compilation command" - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $ECHO "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - func_append removelist " $output_obj" - $ECHO "$srcfile" > "$lockfile" - fi - - $opt_dry_run || $RM $removelist - func_append removelist " $lockfile" - trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 - - func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 - srcfile=$func_to_tool_file_result - func_quote_for_eval "$srcfile" - qsrcfile=$func_quote_for_eval_result - - # Only build a PIC object if we are building libtool libraries. - if test "$build_libtool_libs" = yes; then - # Without this assignment, base_compile gets emptied. - fbsd_hideous_sh_bug=$base_compile - - if test "$pic_mode" != no; then - command="$base_compile $qsrcfile $pic_flag" - else - # Don't build PIC code - command="$base_compile $qsrcfile" - fi - - func_mkdir_p "$xdir$objdir" - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - func_append command " -o $lobj" - fi - - func_show_eval_locale "$command" \ - 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - func_show_eval '$MV "$output_obj" "$lobj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - fi - - # Only build a position-dependent object if we build old libraries. - if test "$build_old_libs" = yes; then - if test "$pic_mode" != yes; then - # Don't build PIC code - command="$base_compile $qsrcfile$pie_flag" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - func_append command " -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - func_append command "$suppress_output" - func_show_eval_locale "$command" \ - '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' - - if test "$need_locks" = warn && - test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then - $ECHO "\ -*** ERROR, $lockfile contains: -`cat $lockfile 2>/dev/null` - -but it should contain: -$srcfile - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $opt_dry_run || $RM $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - func_show_eval '$MV "$output_obj" "$obj"' \ - 'error=$?; $opt_dry_run || $RM $removelist; exit $error' - fi - fi - - $opt_dry_run || { - func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - removelist=$lockfile - $RM "$lockfile" - fi - } - - exit $EXIT_SUCCESS -} - -$opt_help || { - test "$opt_mode" = compile && func_mode_compile ${1+"$@"} -} - -func_mode_help () -{ - # We need to display help for each of the modes. - case $opt_mode in - "") - # Generic help is extracted from the usage comments - # at the start of this file. - func_help - ;; - - clean) - $ECHO \ -"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - - compile) - $ECHO \ -"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -no-suppress do not suppress compiler output for multiple passes - -prefer-pic try to build PIC objects only - -prefer-non-pic try to build non-PIC objects only - -shared do not build a \`.o' file suitable for static linking - -static only build a \`.o' file suitable for static linking - -Wc,FLAG pass FLAG directly to the compiler - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - - execute) - $ECHO \ -"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - - finish) - $ECHO \ -"Usage: $progname [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - - install) - $ECHO \ -"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The following components of INSTALL-COMMAND are treated specially: - - -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - - link) - $ECHO \ -"Usage: $progname [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -bindir BINDIR specify path to binaries directory (for systems where - libraries must be found in the PATH setting at runtime) - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -shared only do dynamic linking of libtool libraries - -shrext SUFFIX override the standard shared library file extension - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -weak LIBNAME declare that the target provides the LIBNAME interface - -Wc,FLAG - -Xcompiler FLAG pass linker-specific FLAG directly to the compiler - -Wl,FLAG - -Xlinker FLAG pass linker-specific FLAG directly to the linker - -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - - uninstall) - $ECHO \ -"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - - *) - func_fatal_help "invalid operation mode \`$opt_mode'" - ;; - esac - - echo - $ECHO "Try \`$progname --help' for more information about other modes." -} - -# Now that we've collected a possible --mode arg, show help if necessary -if $opt_help; then - if test "$opt_help" = :; then - func_mode_help - else - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - func_mode_help - done - } | sed -n '1p; 2,$s/^Usage:/ or: /p' - { - func_help noexit - for opt_mode in compile link execute install finish uninstall clean; do - echo - func_mode_help - done - } | - sed '1d - /^When reporting/,/^Report/{ - H - d - } - $x - /information about other modes/d - /more detailed .*MODE/d - s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' - fi - exit $? -fi - - -# func_mode_execute arg... -func_mode_execute () -{ - $opt_debug - # The first argument is the command name. - cmd="$nonopt" - test -z "$cmd" && \ - func_fatal_help "you must specify a COMMAND" - - # Handle -dlopen flags immediately. - for file in $opt_dlopen; do - test -f "$file" \ - || func_fatal_help "\`$file' is not a file" - - dir= - case $file in - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$lib' is not a valid libtool archive" - - # Read the libtool library. - dlname= - library_names= - func_source "$file" - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && \ - func_warning "\`$file' was not linked with \`-export-dynamic'" - continue - fi - - func_dirname "$file" "" "." - dir="$func_dirname_result" - - if test -f "$dir/$objdir/$dlname"; then - func_append dir "/$objdir" - else - if test ! -f "$dir/$dlname"; then - func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" - fi - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - func_dirname "$file" "" "." - dir="$func_dirname_result" - ;; - - *) - func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -* | *.la | *.lo ) ;; - *) - # Do a test to see if this is really a libtool program. - if func_ltwrapper_script_p "$file"; then - func_source "$file" - # Transform arg to wrapped name. - file="$progdir/$program" - elif func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - func_source "$func_ltwrapper_scriptname_result" - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - func_append_quoted args "$file" - done - - if test "X$opt_dry_run" = Xfalse; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - else - $lt_unset $lt_var - fi" - done - - # Now prepare to actually exec the command. - exec_cmd="\$cmd$args" - else - # Display what would be done. - if test -n "$shlibpath_var"; then - eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" - echo "export $shlibpath_var" - fi - $ECHO "$cmd$args" - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = execute && func_mode_execute ${1+"$@"} - - -# func_mode_finish arg... -func_mode_finish () -{ - $opt_debug - libs= - libdirs= - admincmds= - - for opt in "$nonopt" ${1+"$@"} - do - if test -d "$opt"; then - func_append libdirs " $opt" - - elif test -f "$opt"; then - if func_lalib_unsafe_p "$opt"; then - func_append libs " $opt" - else - func_warning "\`$opt' is not a valid libtool archive" - fi - - else - func_fatal_error "invalid argument \`$opt'" - fi - done - - if test -n "$libs"; then - if test -n "$lt_sysroot"; then - sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` - sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" - else - sysroot_cmd= - fi - - # Remove sysroot references - if $opt_dry_run; then - for lib in $libs; do - echo "removing references to $lt_sysroot and \`=' prefixes from $lib" - done - else - tmpdir=`func_mktempdir` - for lib in $libs; do - sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ - > $tmpdir/tmp-la - mv -f $tmpdir/tmp-la $lib - done - ${RM}r "$tmpdir" - fi - fi - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - func_execute_cmds "$finish_cmds" 'admincmds="$admincmds -'"$cmd"'"' - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $opt_dry_run || eval "$cmds" || func_append admincmds " - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - $opt_silent && exit $EXIT_SUCCESS - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - echo "----------------------------------------------------------------------" - echo "Libraries have been installed in:" - for libdir in $libdirs; do - $ECHO " $libdir" - done - echo - echo "If you ever happen to want to link against installed libraries" - echo "in a given directory, LIBDIR, you must either use libtool, and" - echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - echo " during execution" - fi - if test -n "$runpath_var"; then - echo " - add LIBDIR to the \`$runpath_var' environment variable" - echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $ECHO " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $ECHO " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - echo - - echo "See any operating system documentation about shared libraries for" - case $host in - solaris2.[6789]|solaris2.1[0-9]) - echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" - echo "pages." - ;; - *) - echo "more information, such as the ld(1) and ld.so(8) manual pages." - ;; - esac - echo "----------------------------------------------------------------------" - fi - exit $EXIT_SUCCESS -} - -test "$opt_mode" = finish && func_mode_finish ${1+"$@"} - - -# func_mode_install arg... -func_mode_install () -{ - $opt_debug - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - case $nonopt in *shtool*) :;; *) false;; esac; then - # Aesthetically quote it. - func_quote_for_eval "$nonopt" - install_prog="$func_quote_for_eval_result " - arg=$1 - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - func_quote_for_eval "$arg" - func_append install_prog "$func_quote_for_eval_result" - install_shared_prog=$install_prog - case " $install_prog " in - *[\\\ /]cp\ *) install_cp=: ;; - *) install_cp=false ;; - esac - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - no_mode=: - for arg - do - arg2= - if test -n "$dest"; then - func_append files " $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - if $install_cp; then :; else - prev=$arg - fi - ;; - -g | -m | -o) - prev=$arg - ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - if test "x$prev" = x-m && test -n "$install_override_mode"; then - arg2=$install_override_mode - no_mode=false - fi - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - func_quote_for_eval "$arg" - func_append install_prog " $func_quote_for_eval_result" - if test -n "$arg2"; then - func_quote_for_eval "$arg2" - fi - func_append install_shared_prog " $func_quote_for_eval_result" - done - - test -z "$install_prog" && \ - func_fatal_help "you must specify an install program" - - test -n "$prev" && \ - func_fatal_help "the \`$prev' option requires an argument" - - if test -n "$install_override_mode" && $no_mode; then - if $install_cp; then :; else - func_quote_for_eval "$install_override_mode" - func_append install_shared_prog " -m $func_quote_for_eval_result" - fi - fi - - if test -z "$files"; then - if test -z "$dest"; then - func_fatal_help "no file or destination specified" - else - func_fatal_help "you must specify a destination" - fi - fi - - # Strip any trailing slash from the destination. - func_stripname '' '/' "$dest" - dest=$func_stripname_result - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - func_dirname_and_basename "$dest" "" "." - destdir="$func_dirname_result" - destname="$func_basename_result" - - # Not a directory, so check to see that there is only one file specified. - set dummy $files; shift - test "$#" -gt 1 && \ - func_fatal_help "\`$dest' is not a directory" - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - func_fatal_help "\`$destdir' must be an absolute directory name" - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - func_append staticlibs " $file" - ;; - - *.la) - func_resolve_sysroot "$file" - file=$func_resolve_sysroot_result - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$file" \ - || func_fatal_help "\`$file' is not a valid libtool archive" - - library_names= - old_library= - relink_command= - func_source "$file" - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) func_append current_libdirs " $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) func_append future_libdirs " $libdir" ;; - esac - fi - - func_dirname "$file" "/" "" - dir="$func_dirname_result" - func_append dir "$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - test "$inst_prefix_dir" = "$destdir" && \ - func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` - else - relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` - fi - - func_warning "relinking \`$file'" - func_show_eval "$relink_command" \ - 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' - fi - - # See the names of the shared library. - set dummy $library_names; shift - if test -n "$1"; then - realname="$1" - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ - 'exit $?' - tstripme="$stripme" - case $host_os in - cygwin* | mingw* | pw32* | cegcc*) - case $realname in - *.dll.a) - tstripme="" - ;; - esac - ;; - esac - if test -n "$tstripme" && test -n "$striplib"; then - func_show_eval "$striplib $destdir/$realname" 'exit $?' - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - test "$linkname" != "$realname" \ - && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - func_execute_cmds "$postinstall_cmds" 'exit $?' - fi - - # Install the pseudo-library for information purposes. - func_basename "$file" - name="$func_basename_result" - instname="$dir/$name"i - func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' - - # Maybe install the static library, too. - test -n "$old_library" && func_append staticlibs " $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - func_lo2o "$destfile" - staticdest=$func_lo2o_result - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - func_fatal_help "cannot copy a libtool object to \`$destfile'" - ;; - esac - - # Install the libtool object if requested. - test -n "$destfile" && \ - func_show_eval "$install_prog $file $destfile" 'exit $?' - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - func_lo2o "$file" - staticobj=$func_lo2o_result - func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - func_basename "$file" - destfile="$func_basename_result" - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - func_stripname '' '.exe' "$file" - file=$func_stripname_result - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin* | *mingw*) - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - wrapper=$func_ltwrapper_scriptname_result - else - func_stripname '' '.exe' "$file" - wrapper=$func_stripname_result - fi - ;; - *) - wrapper=$file - ;; - esac - if func_ltwrapper_script_p "$wrapper"; then - notinst_deplibs= - relink_command= - - func_source "$wrapper" - - # Check the variables that should have been set. - test -z "$generated_by_libtool_version" && \ - func_fatal_error "invalid libtool wrapper script \`$wrapper'" - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - func_source "$lib" - fi - libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - func_warning "\`$lib' has not been installed in \`$libdir'" - finalize=no - fi - done - - relink_command= - func_source "$wrapper" - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - $opt_dry_run || { - if test "$finalize" = yes; then - tmpdir=`func_mktempdir` - func_basename "$file$stripped_ext" - file="$func_basename_result" - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` - - $opt_silent || { - func_quote_for_expand "$relink_command" - eval "func_echo $func_quote_for_expand_result" - } - if eval "$relink_command"; then : - else - func_error "error: relink \`$file' with the above command before installing it" - $opt_dry_run || ${RM}r "$tmpdir" - continue - fi - file="$outputname" - else - func_warning "cannot relink \`$file'" - fi - } - else - # Install the binary that we compiled earlier. - file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - func_stripname '' '.exe' "$destfile" - destfile=$func_stripname_result - ;; - esac - ;; - esac - func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' - $opt_dry_run || if test -n "$outputname"; then - ${RM}r "$tmpdir" - fi - ;; - esac - done - - for file in $staticlibs; do - func_basename "$file" - name="$func_basename_result" - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - - func_show_eval "$install_prog \$file \$oldlib" 'exit $?' - - if test -n "$stripme" && test -n "$old_striplib"; then - func_show_eval "$old_striplib $tool_oldlib" 'exit $?' - fi - - # Do each command in the postinstall commands. - func_execute_cmds "$old_postinstall_cmds" 'exit $?' - done - - test -n "$future_libdirs" && \ - func_warning "remember to run \`$progname --finish$future_libdirs'" - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - $opt_dry_run && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi -} - -test "$opt_mode" = install && func_mode_install ${1+"$@"} - - -# func_generate_dlsyms outputname originator pic_p -# Extract symbols from dlprefiles and create ${outputname}S.o with -# a dlpreopen symbol table. -func_generate_dlsyms () -{ - $opt_debug - my_outputname="$1" - my_originator="$2" - my_pic_p="${3-no}" - my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` - my_dlsyms= - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - my_dlsyms="${my_outputname}S.c" - else - func_error "not configured to extract global symbols from dlpreopened files" - fi - fi - - if test -n "$my_dlsyms"; then - case $my_dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${my_outputname}.nm" - - func_show_eval "$RM $nlist ${nlist}S ${nlist}T" - - # Parse the name list into a source file. - func_verbose "creating $output_objdir/$my_dlsyms" - - $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ -/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ -/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) -#pragma GCC diagnostic ignored \"-Wstrict-prototypes\" -#endif - -/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ -#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) -/* DATA imports from DLLs on WIN32 con't be const, because runtime - relocations are performed -- see ld's documentation on pseudo-relocs. */ -# define LT_DLSYM_CONST -#elif defined(__osf__) -/* This system does not cope well with relocations in const data. */ -# define LT_DLSYM_CONST -#else -# define LT_DLSYM_CONST const -#endif - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - func_verbose "generating symbol list for \`$output'" - - $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` - for progfile in $progfiles; do - func_to_tool_file "$progfile" func_convert_file_msys_to_w32 - func_verbose "extracting global C symbols from \`$func_to_tool_file_result'" - $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $opt_dry_run || { - eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - if test -n "$export_symbols_regex"; then - $opt_dry_run || { - eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - } - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $opt_dry_run || { - $RM $export_symbols - eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - } - else - $opt_dry_run || { - eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - eval '$MV "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* | *cegcc* ) - eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - } - fi - fi - - for dlprefile in $dlprefiles; do - func_verbose "extracting global C symbols from \`$dlprefile'" - func_basename "$dlprefile" - name="$func_basename_result" - case $host in - *cygwin* | *mingw* | *cegcc* ) - # if an import library, we need to obtain dlname - if func_win32_import_lib_p "$dlprefile"; then - func_tr_sh "$dlprefile" - eval "curr_lafile=\$libfile_$func_tr_sh_result" - dlprefile_dlbasename="" - if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then - # Use subshell, to avoid clobbering current variable values - dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` - if test -n "$dlprefile_dlname" ; then - func_basename "$dlprefile_dlname" - dlprefile_dlbasename="$func_basename_result" - else - # no lafile. user explicitly requested -dlpreopen . - $sharedlib_from_linklib_cmd "$dlprefile" - dlprefile_dlbasename=$sharedlib_from_linklib_result - fi - fi - $opt_dry_run || { - if test -n "$dlprefile_dlbasename" ; then - eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' - else - func_warning "Could not compute DLL name from $name" - eval '$ECHO ": $name " >> "$nlist"' - fi - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | - $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" - } - else # not an import lib - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - fi - ;; - *) - $opt_dry_run || { - eval '$ECHO ": $name " >> "$nlist"' - func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 - eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" - } - ;; - esac - done - - $opt_dry_run || { - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $MV "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if $GREP -v "^: " < "$nlist" | - if sort -k 3 /dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - $GREP -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' - else - echo '/* NONE */' >> "$output_objdir/$my_dlsyms" - fi - - echo >> "$output_objdir/$my_dlsyms" "\ - -/* The mapping between symbol names and symbols. */ -typedef struct { - const char *name; - void *address; -} lt_dlsymlist; -extern LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[]; -LT_DLSYM_CONST lt_dlsymlist -lt_${my_prefix}_LTX_preloaded_symbols[] = -{\ - { \"$my_originator\", (void *) 0 }," - - case $need_lib_prefix in - no) - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - *) - eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" - ;; - esac - echo >> "$output_objdir/$my_dlsyms" "\ - {0, (void *) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_${my_prefix}_LTX_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - } # !$opt_dry_run - - pic_flag_for_symtable= - case "$compile_command " in - *" -static "*) ;; - *) - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; - *-*-hpux*) - pic_flag_for_symtable=" $pic_flag" ;; - *) - if test "X$my_pic_p" != Xno; then - pic_flag_for_symtable=" $pic_flag" - fi - ;; - esac - ;; - esac - symtab_cflags= - for arg in $LTCFLAGS; do - case $arg in - -pie | -fpie | -fPIE) ;; - *) func_append symtab_cflags " $arg" ;; - esac - done - - # Now compile the dynamic symbol file. - func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' - - # Clean up the generated files. - func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' - - # Transform the symbol file into the correct name. - symfileobj="$output_objdir/${my_outputname}S.$objext" - case $host in - *cygwin* | *mingw* | *cegcc* ) - if test -f "$output_objdir/$my_outputname.def"; then - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` - else - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - fi - ;; - *) - compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` - ;; - esac - ;; - *) - func_fatal_error "unknown suffix for \`$my_dlsyms'" - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` - finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` - fi -} - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -# Despite the name, also deal with 64 bit binaries. -func_win32_libid () -{ - $opt_debug - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | - $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then - func_to_tool_file "$1" func_convert_file_msys_to_w32 - win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | - $SED -n -e ' - 1,100{ - / I /{ - s,.*,import, - p - q - } - }'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $ECHO "$win32_libid_type" -} - -# func_cygming_dll_for_implib ARG -# -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib () -{ - $opt_debug - sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` -} - -# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs -# -# The is the core of a fallback implementation of a -# platform-specific function to extract the name of the -# DLL associated with the specified import library LIBNAME. -# -# SECTION_NAME is either .idata$6 or .idata$7, depending -# on the platform and compiler that created the implib. -# -# Echos the name of the DLL associated with the -# specified import library. -func_cygming_dll_for_implib_fallback_core () -{ - $opt_debug - match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` - $OBJDUMP -s --section "$1" "$2" 2>/dev/null | - $SED '/^Contents of section '"$match_literal"':/{ - # Place marker at beginning of archive member dllname section - s/.*/====MARK====/ - p - d - } - # These lines can sometimes be longer than 43 characters, but - # are always uninteresting - /:[ ]*file format pe[i]\{,1\}-/d - /^In archive [^:]*:/d - # Ensure marker is printed - /^====MARK====/p - # Remove all lines with less than 43 characters - /^.\{43\}/!d - # From remaining lines, remove first 43 characters - s/^.\{43\}//' | - $SED -n ' - # Join marker and all lines until next marker into a single line - /^====MARK====/ b para - H - $ b para - b - :para - x - s/\n//g - # Remove the marker - s/^====MARK====// - # Remove trailing dots and whitespace - s/[\. \t]*$// - # Print - /./p' | - # we now have a list, one entry per line, of the stringified - # contents of the appropriate section of all members of the - # archive which possess that section. Heuristic: eliminate - # all those which have a first or second character that is - # a '.' (that is, objdump's representation of an unprintable - # character.) This should work for all archives with less than - # 0x302f exports -- but will fail for DLLs whose name actually - # begins with a literal '.' or a single character followed by - # a '.'. - # - # Of those that remain, print the first one. - $SED -e '/^\./d;/^.\./d;q' -} - -# func_cygming_gnu_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is a GNU/binutils-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_gnu_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` - test -n "$func_cygming_gnu_implib_tmp" -} - -# func_cygming_ms_implib_p ARG -# This predicate returns with zero status (TRUE) if -# ARG is an MS-style import library. Returns -# with nonzero status (FALSE) otherwise. -func_cygming_ms_implib_p () -{ - $opt_debug - func_to_tool_file "$1" func_convert_file_msys_to_w32 - func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` - test -n "$func_cygming_ms_implib_tmp" -} - -# func_cygming_dll_for_implib_fallback ARG -# Platform-specific function to extract the -# name of the DLL associated with the specified -# import library ARG. -# -# This fallback implementation is for use when $DLLTOOL -# does not support the --identify-strict option. -# Invoked by eval'ing the libtool variable -# $sharedlib_from_linklib_cmd -# Result is available in the variable -# $sharedlib_from_linklib_result -func_cygming_dll_for_implib_fallback () -{ - $opt_debug - if func_cygming_gnu_implib_p "$1" ; then - # binutils import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` - elif func_cygming_ms_implib_p "$1" ; then - # ms-generated import library - sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` - else - # unknown - sharedlib_from_linklib_result="" - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - $opt_debug - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - if test "$lock_old_archive_extraction" = yes; then - lockfile=$f_ex_an_ar_oldlib.lock - until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do - func_echo "Waiting for $lockfile to be removed" - sleep 2 - done - fi - func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ - 'stat=$?; rm -f "$lockfile"; exit $stat' - if test "$lock_old_archive_extraction" = yes; then - $opt_dry_run || rm -f "$lockfile" - fi - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" - fi -} - - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - $opt_debug - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - func_basename "$my_xlib" - my_xlib="$func_basename_result" - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - func_arith $extracted_serial + 1 - extracted_serial=$func_arith_result - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - func_mkdir_p "$my_xdir" - - case $host in - *-darwin*) - func_verbose "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - $opt_dry_run || { - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`basename "$darwin_archive"` - darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` - if test -n "$darwin_arches"; then - darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we've a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` - $LIPO -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - $RM -rf unfat-$$ - cd "$darwin_orig_dir" - else - cd $darwin_orig_dir - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - } # !$opt_dry_run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` - done - - func_extract_archives_result="$my_oldobjs" -} - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=${1-no} - - $ECHO "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variables: - generated_by_libtool_version='$macro_version' - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$ECHO are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - file=\"\$0\"" - - qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` - $ECHO "\ - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -\$1 -_LTECHO_EOF' -} - ECHO=\"$qECHO\" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ which is used only on -# windows platforms, and (c) all begin with the string "--lt-" -# (application programs are unlikely to have options which match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's $0 value, followed by "$@". -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=\$0 - shift - for lt_opt - do - case \"\$lt_opt\" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` - test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. - lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` - cat \"\$lt_dump_D/\$lt_dump_F\" - exit 0 - ;; - --lt-*) - \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n \"\$lt_option_debug\"; then - echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\" - lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $ECHO "\ - if test -n \"\$lt_option_debug\"; then - \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2 - func_lt_dump_args \${1+\"\$@\"} 1>&2 - fi - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $ECHO "\ - \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from \$@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case \" \$* \" in - *\\ --lt-*) - for lt_wr_arg - do - case \$lt_wr_arg in - --lt-*) ;; - *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; - esac - shift - done ;; - esac - func_exec_program_core \${1+\"\$@\"} -} - - # Parse options - func_parse_lt_options \"\$0\" \${1+\"\$@\"} - - # Find the directory that this script lives in. - thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 - if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then - # special case for '.' - if test \"\$thisdir\" = \".\"; then - thisdir=\`pwd\` - fi - # remove .libs from thisdir - case \"\$thisdir\" in - *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; - $objdir ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $ECHO "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $MKDIR \"\$progdir\" - else - $RM \"\$progdir/\$file\" - fi" - - $ECHO "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $ECHO \"\$relink_command_output\" >&2 - $RM \"\$progdir/\$file\" - exit 1 - fi - fi - - $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $RM \"\$progdir/\$program\"; - $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $RM \"\$progdir/\$file\" - fi" - else - $ECHO "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $ECHO "\ - - if test -f \"\$progdir/\$program\"; then" - - # fixup the dll searchpath if we need to. - # - # Fix the DLL searchpath if we need to. Do this before prepending - # to shlibpath, because on Windows, both are PATH and uninstalled - # libraries must come first. - if test -n "$dllsearchpath"; then - $ECHO "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $ECHO "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` - - export $shlibpath_var -" - fi - - $ECHO "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. - func_exec_program \${1+\"\$@\"} - fi - else - # The program doesn't exist. - \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 - \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 - exit 1 - fi -fi\ -" -} - - -# func_emit_cwrapperexe_src -# emit the source code for a wrapper executable on stdout -# Must ONLY be called from within func_mode_link because -# it depends on a number of variable set therein. -func_emit_cwrapperexe_src () -{ - cat < -#include -#ifdef _MSC_VER -# include -# include -# include -#else -# include -# include -# ifdef __CYGWIN__ -# include -# endif -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -/* declarations of non-ANSI functions */ -#if defined(__MINGW32__) -# ifdef __STRICT_ANSI__ -int _putenv (const char *); -# endif -#elif defined(__CYGWIN__) -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif -/* #elif defined (other platforms) ... */ -#endif - -/* portability defines, excluding path handling macros */ -#if defined(_MSC_VER) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -# define S_IXUSR _S_IEXEC -# ifndef _INTPTR_T_DEFINED -# define _INTPTR_T_DEFINED -# define intptr_t int -# endif -#elif defined(__MINGW32__) -# define setmode _setmode -# define stat _stat -# define chmod _chmod -# define getcwd _getcwd -# define putenv _putenv -#elif defined(__CYGWIN__) -# define HAVE_SETENV -# define FOPEN_WB "wb" -/* #elif defined (other platforms) ... */ -#endif - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef S_IXOTH -# define S_IXOTH 0 -#endif -#ifndef S_IXGRP -# define S_IXGRP 0 -#endif - -/* path handling portability macros */ -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# define FOPEN_WB "wb" -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#ifndef FOPEN_WB -# define FOPEN_WB "w" -#endif -#ifndef _O_BINARY -# define _O_BINARY 0 -#endif - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -#if defined(LT_DEBUGWRAPPER) -static int lt_debug = 1; -#else -static int lt_debug = 0; -#endif - -const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ - -void *xmalloc (size_t num); -char *xstrdup (const char *string); -const char *base_name (const char *name); -char *find_executable (const char *wrapper); -char *chase_symlinks (const char *pathspec); -int make_executable (const char *path); -int check_executable (const char *path); -char *strendzap (char *str, const char *pat); -void lt_debugprintf (const char *file, int line, const char *fmt, ...); -void lt_fatal (const char *file, int line, const char *message, ...); -static const char *nonnull (const char *s); -static const char *nonempty (const char *s); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); -char **prepare_spawn (char **argv); -void lt_dump_script (FILE *f); -EOF - - cat <= 0) - && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) - return 1; - else - return 0; -} - -int -make_executable (const char *path) -{ - int rval = 0; - struct stat st; - - lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", - nonempty (path)); - if ((!path) || (!*path)) - return 0; - - if (stat (path, &st) >= 0) - { - rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); - } - return rval; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise - Does not chase symlinks, even on platforms that support them. -*/ -char * -find_executable (const char *wrapper) -{ - int has_slash = 0; - const char *p; - const char *p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char *concat_name; - - lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", - nonempty (wrapper)); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char *path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char *q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR (*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = - XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = - XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", - nonnull (strerror (errno))); - tmp_len = strlen (tmp); - concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable (concat_name)) - return concat_name; - XFREE (concat_name); - return NULL; -} - -char * -chase_symlinks (const char *pathspec) -{ -#ifndef S_ISLNK - return xstrdup (pathspec); -#else - char buf[LT_PATHMAX]; - struct stat s; - char *tmp_pathspec = xstrdup (pathspec); - char *p; - int has_symlinks = 0; - while (strlen (tmp_pathspec) && !has_symlinks) - { - lt_debugprintf (__FILE__, __LINE__, - "checking path component for symlinks: %s\n", - tmp_pathspec); - if (lstat (tmp_pathspec, &s) == 0) - { - if (S_ISLNK (s.st_mode) != 0) - { - has_symlinks = 1; - break; - } - - /* search backwards for last DIR_SEPARATOR */ - p = tmp_pathspec + strlen (tmp_pathspec) - 1; - while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - p--; - if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) - { - /* no more DIR_SEPARATORS left */ - break; - } - *p = '\0'; - } - else - { - lt_fatal (__FILE__, __LINE__, - "error accessing file \"%s\": %s", - tmp_pathspec, nonnull (strerror (errno))); - } - } - XFREE (tmp_pathspec); - - if (!has_symlinks) - { - return xstrdup (pathspec); - } - - tmp_pathspec = realpath (pathspec, buf); - if (tmp_pathspec == 0) - { - lt_fatal (__FILE__, __LINE__, - "could not follow symlinks for %s", pathspec); - } - return xstrdup (tmp_pathspec); -#endif -} - -char * -strendzap (char *str, const char *pat) -{ - size_t len, patlen; - - assert (str != NULL); - assert (pat != NULL); - - len = strlen (str); - patlen = strlen (pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp (str, pat) == 0) - *str = '\0'; - } - return str; -} - -void -lt_debugprintf (const char *file, int line, const char *fmt, ...) -{ - va_list args; - if (lt_debug) - { - (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); - va_start (args, fmt); - (void) vfprintf (stderr, fmt, args); - va_end (args); - } -} - -static void -lt_error_core (int exit_status, const char *file, - int line, const char *mode, - const char *message, va_list ap) -{ - fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *file, int line, const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); - va_end (ap); -} - -static const char * -nonnull (const char *s) -{ - return s ? s : "(null)"; -} - -static const char * -nonempty (const char *s) -{ - return (s && !*s) ? "(empty)" : nonnull (s); -} - -void -lt_setenv (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_setenv) setting '%s' to '%s'\n", - nonnull (name), nonnull (value)); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - lt_debugprintf (__FILE__, __LINE__, - "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - nonnull (name), nonnull (value)); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -EOF - case $host_os in - mingw*) - cat <<"EOF" - -/* Prepares an argument vector before calling spawn(). - Note that spawn() does not by itself call the command interpreter - (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : - ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); - GetVersionEx(&v); - v.dwPlatformId == VER_PLATFORM_WIN32_NT; - }) ? "cmd.exe" : "command.com"). - Instead it simply concatenates the arguments, separated by ' ', and calls - CreateProcess(). We must quote the arguments since Win32 CreateProcess() - interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a - special way: - - Space and tab are interpreted as delimiters. They are not treated as - delimiters if they are surrounded by double quotes: "...". - - Unescaped double quotes are removed from the input. Their only effect is - that within double quotes, space and tab are treated like normal - characters. - - Backslashes not followed by double quotes are not special. - - But 2*n+1 backslashes followed by a double quote become - n backslashes followed by a double quote (n >= 0): - \" -> " - \\\" -> \" - \\\\\" -> \\" - */ -#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" -char ** -prepare_spawn (char **argv) -{ - size_t argc; - char **new_argv; - size_t i; - - /* Count number of arguments. */ - for (argc = 0; argv[argc] != NULL; argc++) - ; - - /* Allocate new argument vector. */ - new_argv = XMALLOC (char *, argc + 1); - - /* Put quoted arguments into the new argument vector. */ - for (i = 0; i < argc; i++) - { - const char *string = argv[i]; - - if (string[0] == '\0') - new_argv[i] = xstrdup ("\"\""); - else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) - { - int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); - size_t length; - unsigned int backslashes; - const char *s; - char *quoted_string; - char *p; - - length = 0; - backslashes = 0; - if (quote_around) - length++; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - length += backslashes + 1; - length++; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - length += backslashes + 1; - - quoted_string = XMALLOC (char, length + 1); - - p = quoted_string; - backslashes = 0; - if (quote_around) - *p++ = '"'; - for (s = string; *s != '\0'; s++) - { - char c = *s; - if (c == '"') - { - unsigned int j; - for (j = backslashes + 1; j > 0; j--) - *p++ = '\\'; - } - *p++ = c; - if (c == '\\') - backslashes++; - else - backslashes = 0; - } - if (quote_around) - { - unsigned int j; - for (j = backslashes; j > 0; j--) - *p++ = '\\'; - *p++ = '"'; - } - *p = '\0'; - - new_argv[i] = quoted_string; - } - else - new_argv[i] = (char *) string; - } - new_argv[argc] = NULL; - - return new_argv; -} -EOF - ;; - esac - - cat <<"EOF" -void lt_dump_script (FILE* f) -{ -EOF - func_emit_wrapper yes | - $SED -n -e ' -s/^\(.\{79\}\)\(..*\)/\1\ -\2/ -h -s/\([\\"]\)/\\\1/g -s/$/\\n/ -s/\([^\n]*\).*/ fputs ("\1", f);/p -g -D' - cat <<"EOF" -} -EOF -} -# end: func_emit_cwrapperexe_src - -# func_win32_import_lib_p ARG -# True if ARG is an import lib, as indicated by $file_magic_cmd -func_win32_import_lib_p () -{ - $opt_debug - case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in - *import*) : ;; - *) false ;; - esac -} - -# func_mode_link arg... -func_mode_link () -{ - $opt_debug - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - # It is impossible to link a dll without this setting, and - # we shouldn't force the makefile maintainer to figure out - # which system we are compiling for in order to pass an extra - # flag for every libtool invocation. - # allow_undefined=no - - # FIXME: Unfortunately, there are problems with the above when trying - # to make a dll which has undefined symbols, in which case not - # even a static library is built. For now, we need to specify - # -no-undefined on the libtool link line when we can be certain - # that all symbols are satisfied, otherwise we get a static library. - allow_undefined=yes - ;; - *) - allow_undefined=yes - ;; - esac - libtool_args=$nonopt - base_compile="$nonopt $@" - compile_command=$nonopt - finalize_command=$nonopt - - compile_rpath= - finalize_rpath= - compile_shlibpath= - finalize_shlibpath= - convenience= - old_convenience= - deplibs= - old_deplibs= - compiler_flags= - linker_flags= - dllsearchpath= - lib_search_path=`pwd` - inst_prefix_dir= - new_inherited_linker_flags= - - avoid_version=no - bindir= - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - precious_files_regex= - prefer_static_libs=no - preload=no - prev= - prevarg= - release= - rpath= - xrpath= - perm_rpath= - temp_rpath= - thread_safe=no - vinfo= - vinfo_number=no - weak_libs= - single_module="${wl}-single_module" - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -shared) - test "$build_libtool_libs" != yes && \ - func_fatal_configuration "can not build a shared library" - build_old_libs=no - break - ;; - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - func_warning "complete static linking is impossible in this configuration" - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - func_quote_for_eval "$arg" - qarg=$func_quote_for_eval_unquoted_result - func_append libtool_args " $func_quote_for_eval_result" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - func_append compile_command " @OUTPUT@" - func_append finalize_command " @OUTPUT@" - ;; - esac - - case $prev in - bindir) - bindir="$arg" - prev= - continue - ;; - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - func_append compile_command " @SYMFILE@" - func_append finalize_command " @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - func_append dlfiles " $arg" - else - func_append dlprefiles " $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - test -f "$arg" \ - || func_fatal_error "symbol file \`$arg' does not exist" - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - framework) - case $host in - *-*-darwin*) - case "$deplibs " in - *" $qarg.ltframework "*) ;; - *) func_append deplibs " $qarg.ltframework" # this is fixed later - ;; - esac - ;; - esac - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat "$save_arg"` - do -# func_append moreargs " $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - done - else - func_fatal_error "link input file \`$arg' does not exist" - fi - arg=$save_arg - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) func_append rpath " $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) func_append xrpath " $arg" ;; - esac - fi - prev= - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - weak) - func_append weak_libs " $arg" - prev= - continue - ;; - xcclinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xcompiler) - func_append compiler_flags " $qarg" - prev= - func_append compile_command " $qarg" - func_append finalize_command " $qarg" - continue - ;; - xlinker) - func_append linker_flags " $qarg" - func_append compiler_flags " $wl$qarg" - prev= - func_append compile_command " $wl$qarg" - func_append finalize_command " $wl$qarg" - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - func_fatal_error "\`-allow-undefined' must not be used because it is the default" - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -bindir) - prev=bindir - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - func_fatal_error "more than one -exported-symbols argument is not allowed" - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework) - prev=framework - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - func_append compile_command " $arg" - func_append finalize_command " $arg" - ;; - esac - continue - ;; - - -L*) - func_stripname "-L" '' "$arg" - if test -z "$func_stripname_result"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - test -z "$absdir" && \ - func_fatal_error "cannot determine absolute directory name of \`$dir'" - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "* | *" $arg "*) - # Will only happen for absolute or sysroot arguments - ;; - *) - # Preserve sysroot, but never include relative directories - case $dir in - [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; - *) func_append deplibs " -L$dir" ;; - esac - func_append lib_search_path " $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - ::) dllsearchpath=$dir;; - *) func_append dllsearchpath ":$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - func_append deplibs " System.ltframework" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - func_append deplibs " $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - # Darwin uses the -arch flag to determine output architecture. - -model|-arch|-isysroot|--sysroot) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - func_append compiler_flags " $arg" - func_append compile_command " $arg" - func_append finalize_command " $arg" - case "$new_inherited_linker_flags " in - *" $arg "*) ;; - * ) func_append new_inherited_linker_flags " $arg" ;; - esac - continue - ;; - - -multi_module) - single_module="${wl}-multi_module" - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) - # The PATH hackery in wrapper scripts is required on Windows - # and Darwin in order for the loader to find any dlls it needs. - func_warning "\`-no-install' is ignored for $host" - func_warning "assuming \`-no-fast-install' instead" - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - func_stripname '-R' '' "$arg" - dir=$func_stripname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - =*) - func_stripname '=' '' "$dir" - dir=$lt_sysroot$func_stripname_result - ;; - *) - func_fatal_error "only absolute run-paths are allowed" - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - continue - ;; - - -shared) - # The effects of -shared are defined in a previous loop. - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -weak) - prev=weak - continue - ;; - - -Wc,*) - func_stripname '-Wc,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $func_quote_for_eval_result" - func_append compiler_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Wl,*) - func_stripname '-Wl,' '' "$arg" - args=$func_stripname_result - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - func_quote_for_eval "$flag" - func_append arg " $wl$func_quote_for_eval_result" - func_append compiler_flags " $wl$func_quote_for_eval_result" - func_append linker_flags " $func_quote_for_eval_result" - done - IFS="$save_ifs" - func_stripname ' ' '' "$arg" - arg=$func_stripname_result - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # -msg_* for osf cc - -msg_*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - # Flags to be passed through unchanged, with rationale: - # -64, -mips[0-9] enable 64-bit mode for the SGI compiler - # -r[0-9][0-9]* specify processor for the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler - # +DA*, +DD* enable 64-bit mode for the HP compiler - # -q* compiler args for the IBM compiler - # -m*, -t[45]*, -txscale* architecture-specific flags for GCC - # -F/path path to uninstalled frameworks, gcc on darwin - # -p, -pg, --coverage, -fprofile-* profiling flags for GCC - # @file GCC response files - # -tp=* Portland pgcc target processor selection - # --sysroot=* for sysroot support - # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ - -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ - -O*|-flto*|-fwhopr*|-fuse-linker-plugin) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - func_append compile_command " $arg" - func_append finalize_command " $arg" - func_append compiler_flags " $arg" - continue - ;; - - # Some other compiler flag. - -* | +*) - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - - *.$objext) - # A standard object. - func_append objs " $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if func_lalib_unsafe_p "$arg"; then - pic_object= - non_pic_object= - - # Read the .lo file - func_source "$arg" - - if test -z "$pic_object" || - test -z "$non_pic_object" || - test "$pic_object" = none && - test "$non_pic_object" = none; then - func_fatal_error "cannot find name of object for \`$arg'" - fi - - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - func_append dlfiles " $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - func_append dlprefiles " $pic_object" - prev= - fi - - # A PIC object. - func_append libobjs " $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - func_append non_pic_objects " $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - func_append non_pic_objects " $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if $opt_dry_run; then - # Extract subdirectory from the argument. - func_dirname "$arg" "/" "" - xdir="$func_dirname_result" - - func_lo2o "$arg" - pic_object=$xdir$objdir/$func_lo2o_result - non_pic_object=$xdir$func_lo2o_result - func_append libobjs " $pic_object" - func_append non_pic_objects " $non_pic_object" - else - func_fatal_error "\`$arg' is not a valid libtool object" - fi - fi - ;; - - *.$libext) - # An archive. - func_append deplibs " $arg" - func_append old_deplibs " $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - func_resolve_sysroot "$arg" - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - func_append dlfiles " $func_resolve_sysroot_result" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - func_append dlprefiles " $func_resolve_sysroot_result" - prev= - else - func_append deplibs " $func_resolve_sysroot_result" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - func_quote_for_eval "$arg" - arg="$func_quote_for_eval_result" - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - done # argument parsing loop - - test -n "$prev" && \ - func_fatal_help "the \`$prevarg' option requires an argument" - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - func_append compile_command " $arg" - func_append finalize_command " $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - func_basename "$output" - outputname="$func_basename_result" - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - func_dirname "$output" "/" "" - output_objdir="$func_dirname_result$objdir" - func_to_tool_file "$output_objdir/" - tool_output_objdir=$func_to_tool_file_result - # Create the object directory. - func_mkdir_p "$output_objdir" - - # Determine the type of output - case $output in - "") - func_fatal_help "you must specify an output file" - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if $opt_preserve_dup_deps ; then - case "$libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append libs " $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if $opt_duplicate_compiler_generated_deps; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; - esac - func_append pre_post_deps " $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - notinst_path= # paths that contain not-installed libtool libraries - - case $linkmode in - lib) - passes="conv dlpreopen link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - - for pass in $passes; do - # The preopen pass in lib mode reverses $deplibs; put it back here - # so that -L comes before libs that need it for instance... - if test "$linkmode,$pass" = "lib,link"; then - ## FIXME: Find the place where the list is rebuilt in the wrong - ## order, and fix it there properly - tmp_deplibs= - for deplib in $deplibs; do - tmp_deplibs="$deplib $tmp_deplibs" - done - deplibs="$tmp_deplibs" - fi - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) - libs="$deplibs %DEPLIBS%" - test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" - ;; - esac - fi - if test "$linkmode,$pass" = "lib,dlpreopen"; then - # Collect and forward deplibs of preopened libtool libs - for lib in $dlprefiles; do - # Ignore non-libtool-libs - dependency_libs= - func_resolve_sysroot "$lib" - case $lib in - *.la) func_source "$func_resolve_sysroot_result" ;; - esac - - # Collect preopened libtool deplibs, except any this library - # has declared as weak libs - for deplib in $dependency_libs; do - func_basename "$deplib" - deplib_base=$func_basename_result - case " $weak_libs " in - *" $deplib_base "*) ;; - *) func_append deplibs " $deplib" ;; - esac - done - done - libs="$dlprefiles" - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ - |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append compiler_flags " $deplib" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - func_warning "\`-l' is ignored for archives/objects" - continue - fi - func_stripname '-l' '' "$deplib" - name=$func_stripname_result - if test "$linkmode" = lib; then - searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" - else - searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" - fi - for searchdir in $searchdirs; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if func_lalib_p "$lib"; then - library_names= - old_library= - func_source "$lib" - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - *.ltframework) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - if test "$linkmode" = lib ; then - case "$new_inherited_linker_flags " in - *" $deplib "*) ;; - * ) func_append new_inherited_linker_flags " $deplib" ;; - esac - fi - fi - continue - ;; - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - *) - func_warning "\`-L' is ignored for archives/objects" - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - func_stripname '-R' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - dir=$func_resolve_sysroot_result - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) func_append xrpath " $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) - func_resolve_sysroot "$deplib" - lib=$func_resolve_sysroot_result - ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - # Linking convenience modules into shared libraries is allowed, - # but linking other static libraries is non-portable. - case " $dlpreconveniencelibs " in - *" $deplib "*) ;; - *) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - echo - $ECHO "*** Warning: Trying to link with static lib archive $deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because the file extensions .$libext of this argument makes me believe" - echo "*** that it is just a static archive that I should not use here." - else - echo - $ECHO "*** Warning: Linking the shared library $output against the" - $ECHO "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - ;; - esac - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - func_append newdlprefiles " $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - func_append newdlfiles " $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - - if test "$found" = yes || test -f "$lib"; then : - else - func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" - fi - - # Check to see that this really is a libtool archive. - func_lalib_unsafe_p "$lib" \ - || func_fatal_error "\`$lib' is not a valid libtool archive" - - func_dirname "$lib" "" "." - ladir="$func_dirname_result" - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - inherited_linker_flags= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - func_source "$lib" - - # Convert "-framework foo" to "foo.ltframework" - if test -n "$inherited_linker_flags"; then - tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` - for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do - case " $new_inherited_linker_flags " in - *" $tmp_inherited_linker_flag "*) ;; - *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; - esac - done - fi - dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && func_append dlfiles " $dlopen" - test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - # It is a libtool convenience library, so add in its objects. - func_append convenience " $ladir/$objdir/$old_library" - func_append old_convenience " $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - func_fatal_error "\`$lib' is not a convenience library" - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - if test -n "$old_library" && - { test "$prefer_static_libs" = yes || - test "$prefer_static_libs,$installed" = "built,no"; }; then - linklib=$old_library - else - for l in $old_library $library_names; do - linklib="$l" - done - fi - if test -z "$linklib"; then - func_fatal_error "cannot find name of link library for \`$lib'" - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - func_fatal_error "cannot -dlopen a convenience library: \`$lib'" - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - func_append dlprefiles " $lib $dependency_libs" - else - func_append newdlfiles " $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - func_warning "cannot determine absolute directory name of \`$ladir'" - func_warning "passing it literally to the linker, although it might fail" - abs_ladir="$ladir" - fi - ;; - esac - func_basename "$lib" - laname="$func_basename_result" - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - func_warning "library \`$lib' was moved." - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$lt_sysroot$libdir" - absdir="$lt_sysroot$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - func_append notinst_path " $abs_ladir" - fi - fi # $installed = yes - func_stripname 'lib' '.la' "$laname" - name=$func_stripname_result - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir" && test "$linkmode" = prog; then - func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" - fi - case "$host" in - # special handling for platforms with PE-DLLs. - *cygwin* | *mingw* | *cegcc* ) - # Linker will automatically link against shared library if both - # static and shared are present. Therefore, ensure we extract - # symbols from the import library if a shared library is present - # (otherwise, the dlopen module name will be incorrect). We do - # this by putting the import library name into $newdlprefiles. - # We recover the dlopen module name by 'saving' the la file - # name in a special purpose variable, and (later) extracting the - # dlname from the la file. - if test -n "$dlname"; then - func_tr_sh "$dir/$linklib" - eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" - func_append newdlprefiles " $dir/$linklib" - else - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - fi - ;; - * ) - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - func_append newdlprefiles " $dir/$old_library" - # Keep a list of preopened convenience libraries to check - # that they are being used correctly in the link pass. - test -z "$libdir" && \ - func_append dlpreconveniencelibs " $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - func_append newdlprefiles " $dir/$dlname" - else - func_append newdlprefiles " $dir/$linklib" - fi - ;; - esac - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - func_append newlib_search_path " $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result" - func_append newlib_search_path " $func_resolve_sysroot_result" - ;; - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $deplib "*) func_append specialdeplibs " $deplib" ;; - esac - fi - func_append tmp_libs " $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath:" in - *"$absdir:"*) ;; - *) func_append temp_rpath "$absdir:" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - case $host in - *cygwin* | *mingw* | *cegcc*) - # No point in relinking DLLs because paths are not encoded - func_append notinst_deplibs " $lib" - need_relink=no - ;; - *) - if test "$installed" = no; then - func_append notinst_deplibs " $lib" - need_relink=yes - fi - ;; - esac - # This is a shared library - - # Warn about portability, can't link against -module's on some - # systems (darwin). Don't bleat about dlopened modules though! - dlopenmodule="" - for dlpremoduletest in $dlprefiles; do - if test "X$dlpremoduletest" = "X$lib"; then - dlopenmodule="$dlpremoduletest" - break - fi - done - if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then - echo - if test "$linkmode" = prog; then - $ECHO "*** Warning: Linking the executable $output against the loadable module" - else - $ECHO "*** Warning: Linking the shared library $output against the loadable module" - fi - $ECHO "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) func_append compile_rpath " $absdir" ;; - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - shift - realname="$1" - shift - libname=`eval "\\$ECHO \"$libname_spec\""` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw* | *cegcc*) - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - func_basename "$soroot" - soname="$func_basename_result" - func_stripname 'lib' '.dll' "$soname" - newlib=libimp-$func_stripname_result.a - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - func_verbose "extracting exported symbol list from \`$soname'" - func_execute_cmds "$extract_expsyms_cmds" 'exit $?' - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - func_verbose "generating import library for \`$soname'" - func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$opt_mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a (non-dlopened) module then we can not - # link against it, someone is ignoring the earlier warnings - if /usr/bin/file -L $add 2> /dev/null | - $GREP ": [^:]* bundle" >/dev/null ; then - if test "X$dlopenmodule" != "X$lib"; then - $ECHO "*** Warning: lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - echo - echo "*** And there doesn't seem to be a static archive available" - echo "*** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - elif test -n "$old_library"; then - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$absdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - func_fatal_configuration "unsupported hardcode properties" - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) func_append compile_shlibpath "$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && - test "$hardcode_minus_L" != yes && - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$opt_mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes && - test "$hardcode_direct_absolute" = no; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) func_append finalize_shlibpath "$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - func_append add_dir " -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - echo - $ECHO "*** Warning: This system can not link to static lib archive $lib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - echo "*** But as you try to build a module library, libtool will still create " - echo "*** a static module, that should work as long as the dlopening application" - echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) func_stripname '-R' '' "$libdir" - temp_xrpath=$func_stripname_result - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) func_append xrpath " $temp_xrpath";; - esac;; - *) func_append temp_deplibs " $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - func_append newlib_search_path " $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - case $deplib in - -L*) func_stripname '-L' '' "$deplib" - func_resolve_sysroot "$func_stripname_result";; - *) func_resolve_sysroot "$deplib" ;; - esac - if $opt_preserve_dup_deps ; then - case "$tmp_libs " in - *" $func_resolve_sysroot_result "*) - func_append specialdeplibs " $func_resolve_sysroot_result" ;; - esac - fi - func_append tmp_libs " $func_resolve_sysroot_result" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - path= - case $deplib in - -L*) path="$deplib" ;; - *.la) - func_resolve_sysroot "$deplib" - deplib=$func_resolve_sysroot_result - func_dirname "$deplib" "" "." - dir=$func_dirname_result - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - func_warning "cannot determine absolute directory name of \`$dir'" - absdir="$dir" - fi - ;; - esac - if $GREP "^installed=no" $deplib > /dev/null; then - case $host in - *-*-darwin*) - depdepl= - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$absdir/$objdir/$depdepl" ; then - depdepl="$absdir/$objdir/$depdepl" - darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - if test -z "$darwin_install_name"; then - darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` - fi - func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" - func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}" - path= - fi - fi - ;; - *) - path="-L$absdir/$objdir" - ;; - esac - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - test "$absdir" != "$libdir" && \ - func_warning "\`$deplib' seems to be moved" - - path="-L$absdir" - fi - ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - if test "$pass" = link; then - if test "$linkmode" = "prog"; then - compile_deplibs="$new_inherited_linker_flags $compile_deplibs" - finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" - else - compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - fi - fi - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) func_append lib_search_path " $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) func_append tmp_libs " $deplib" ;; - esac - ;; - *) func_append tmp_libs " $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - func_append tmp_libs " $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - fi - if test "$linkmode" = prog || test "$linkmode" = lib; then - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for archives" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for archives" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for archives" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for archives" - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for archives" - - test -n "$release" && \ - func_warning "\`-release' is ignored for archives" - - test -n "$export_symbols$export_symbols_regex" && \ - func_warning "\`-export-symbols' is ignored for archives" - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - func_append objs "$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - func_stripname 'lib' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - test "$module" = no && \ - func_fatal_help "libtool library \`$output' must begin with \`lib'" - - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - func_stripname '' '.la' "$outputname" - name=$func_stripname_result - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - func_stripname '' '.la' "$outputname" - libname=$func_stripname_result - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" - else - echo - $ECHO "*** Warning: Linking the shared library $output against the non-libtool" - $ECHO "*** objects $objs is not portable!" - func_append libobjs " $objs" - fi - fi - - test "$dlself" != no && \ - func_warning "\`-dlopen self' is ignored for libtool libraries" - - set dummy $rpath - shift - test "$#" -gt 1 && \ - func_warning "ignoring multiple \`-rpath's for a libtool library" - - install_libdir="$1" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - test -n "$vinfo" && \ - func_warning "\`-version-info/-version-number' is ignored for convenience libraries" - - test -n "$release" && \ - func_warning "\`-release' is ignored for convenience libraries" - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - shift - IFS="$save_ifs" - - test -n "$7" && \ - func_fatal_help "too many parameters to \`-version-info'" - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$1" - number_minor="$2" - number_revision="$3" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - # correct linux to gnu/linux during the next big refactor - darwin|linux|osf|windows|none) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|qnx|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - func_arith $number_major + $number_minor - current=$func_arith_result - age="$number_minor" - revision="$number_minor" - lt_irix_increment=no - ;; - *) - func_fatal_configuration "$modename: unknown library version type \`$version_type'" - ;; - esac - ;; - no) - current="$1" - revision="$2" - age="$3" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "CURRENT \`$current' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "REVISION \`$revision' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - func_error "AGE \`$age' must be a nonnegative integer" - func_fatal_error "\`$vinfo' is not valid version information" - ;; - esac - - if test "$age" -gt "$current"; then - func_error "AGE \`$age' is greater than the current interface number \`$current'" - func_fatal_error "\`$vinfo' is not valid version information" - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - func_arith $current + 1 - minor_current=$func_arith_result - xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current" - ;; - - irix | nonstopux) - if test "X$lt_irix_increment" = "Xno"; then - func_arith $current - $age - else - func_arith $current - $age + 1 - fi - major=$func_arith_result - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - func_arith $revision - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) # correct to gnu/linux during the next big refactor - func_arith $current - $age - major=.$func_arith_result - versuffix="$major.$age.$revision" - ;; - - osf) - func_arith $current - $age - major=.$func_arith_result - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - func_arith $current - $loop - iface=$func_arith_result - func_arith $loop - 1 - loop=$func_arith_result - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - func_append verstring ":${current}.0" - ;; - - qnx) - major=".$current" - versuffix=".$current" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - func_arith $current - $age - major=$func_arith_result - versuffix="-$major" - ;; - - *) - func_fatal_configuration "unknown library version type \`$version_type'" - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - func_warning "undefined symbols not allowed in $host shared libraries" - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - - fi - - func_generate_dlsyms "$libname" "$libname" "yes" - func_append libobjs " $symfileobj" - test "X$libobjs" = "X " && libobjs= - - if test "$opt_mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$ECHO "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext | *.gcno) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - func_append removelist " $p" - ;; - *) ;; - esac - done - test -n "$removelist" && \ - func_show_eval "${RM}r \$removelist" - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - func_append oldlibs " $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. - #for path in $notinst_path; do - # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` - # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` - # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` - #done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - func_replace_sysroot "$libdir" - func_append temp_xrpath " -R$func_replace_sysroot_result" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) func_append dlfiles " $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) func_append dlprefiles " $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - func_append deplibs " System.ltframework" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - func_append deplibs " -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $opt_dry_run || $RM conftest.c - cat > conftest.c </dev/null` - $nocaseglob - else - potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` - fi - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null | - $GREP " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | - $SED -e 10q | - $EGREP "$file_magic_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for file magic test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a file magic. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method; shift - match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` - for a_deplib in $deplibs; do - case $a_deplib in - -l*) - func_stripname -l '' "$a_deplib" - name=$func_stripname_result - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - func_append newdeplibs " $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval "\\$ECHO \"$libname_spec\""` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ - $EGREP "$match_pattern_regex" > /dev/null; then - func_append newdeplibs " $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - echo - $ECHO "*** Warning: linker path does not have real file for library $a_deplib." - echo "*** I have the capability to make that library automatically link in when" - echo "*** you link to this library. But I can only do this if you have a" - echo "*** shared version of the library, which you do not appear to have" - echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $ECHO "*** with $libname and none of the candidates passed a file format test" - $ECHO "*** using a regex pattern. Last file checked: $potlib" - fi - fi - ;; - *) - # Add a -L argument. - func_append newdeplibs " $a_deplib" - ;; - esac - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"` - done - fi - case $tmp_deplibs in - *[!\ \ ]*) - echo - if test "X$deplibs_check_method" = "Xnone"; then - echo "*** Warning: inter-library dependencies are not supported in this platform." - else - echo "*** Warning: inter-library dependencies are not known to be supported." - fi - echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - ;; - esac - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library with the System framework - newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - echo - echo "*** Warning: libtool could not satisfy all declared inter-library" - $ECHO "*** dependencies of module $libname. Therefore, libtool will create" - echo "*** a static module, that should work as long as the dlopening" - echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - echo - echo "*** However, this would only work if libtool was able to extract symbol" - echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - echo "*** not find such a program. So, this module is probably useless." - echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - echo "*** The inter-library dependencies that have been dropped here will be" - echo "*** automatically added whenever a program is linked with this library" - echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - echo - echo "*** Since this library must not contain undefined symbols," - echo "*** because either the platform does not support them or" - echo "*** it was explicitly requested with -no-undefined," - echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - case $host in - *-*-darwin*) - newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - deplibs="$new_libs" - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - # Remove ${wl} instances when linking with ld. - # FIXME: should test the right _cmds variable. - case $archive_cmds in - *\$LD\ *) wl= ;; - esac - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$opt_mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - func_replace_sysroot "$libdir" - libdir=$func_replace_sysroot_result - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append dep_rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - shift - realname="$1" - shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - func_append linknames " $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` - test "X$libobjs" = "X " && libobjs= - - delfiles= - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" - export_symbols="$output_objdir/$libname.uexp" - func_append delfiles " $export_symbols" - fi - - orig_export_symbols= - case $host_os in - cygwin* | mingw* | cegcc*) - if test -n "$export_symbols" && test -z "$export_symbols_regex"; then - # exporting using user supplied symfile - if test "x`$SED 1q $export_symbols`" != xEXPORTS; then - # and it's NOT already a .def file. Must figure out - # which of the given symbols are data symbols and tag - # them as such. So, trigger use of export_symbols_cmds. - # export_symbols gets reassigned inside the "prepare - # the list of exported symbols" if statement, so the - # include_expsyms logic still works. - orig_export_symbols="$export_symbols" - export_symbols= - always_export_symbols=yes - fi - fi - ;; - esac - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd1 in $cmds; do - IFS="$save_ifs" - # Take the normal branch if the nm_file_list_spec branch - # doesn't work or if tool conversion is not needed. - case $nm_file_list_spec~$to_tool_file_cmd in - *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) - try_normal_branch=yes - eval cmd=\"$cmd1\" - func_len " $cmd" - len=$func_len_result - ;; - *) - try_normal_branch=no - ;; - esac - if test "$try_normal_branch" = yes \ - && { test "$len" -lt "$max_cmd_len" \ - || test "$max_cmd_len" -le -1; } - then - func_show_eval "$cmd" 'exit $?' - skipped_export=false - elif test -n "$nm_file_list_spec"; then - func_basename "$output" - output_la=$func_basename_result - save_libobjs=$libobjs - save_output=$output - output=${output_objdir}/${output_la}.nm - func_to_tool_file "$output" - libobjs=$nm_file_list_spec$func_to_tool_file_result - func_append delfiles " $output" - func_verbose "creating $NM input file list: $output" - for obj in $save_libobjs; do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > "$output" - eval cmd=\"$cmd1\" - func_show_eval "$cmd" 'exit $?' - output=$save_output - libobjs=$save_libobjs - skipped_export=false - else - # The command line is too long to execute in one step. - func_verbose "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - func_append tmp_deplibs " $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec" && - test "$compiler_needs_object" = yes && - test -z "$libobjs"; then - # extract the archives, so we have objects to list. - # TODO: could optimize this to just extract one archive. - whole_archive_flag_spec= - fi - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - else - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - func_append linker_flags " $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - func_len " $test_cmds" && - len=$func_len_result && - test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise - # or, if using GNU ld and skipped_export is not :, use a linker - # script. - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - func_basename "$output" - output_la=$func_basename_result - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - last_robj= - k=1 - - if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then - output=${output_objdir}/${output_la}.lnkscript - func_verbose "creating GNU ld script: $output" - echo 'INPUT (' > $output - for obj in $save_libobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - echo ')' >> $output - func_append delfiles " $output" - func_to_tool_file "$output" - output=$func_to_tool_file_result - elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then - output=${output_objdir}/${output_la}.lnk - func_verbose "creating linker input file list: $output" - : > $output - set x $save_libobjs - shift - firstobj= - if test "$compiler_needs_object" = yes; then - firstobj="$1 " - shift - fi - for obj - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" >> $output - done - func_append delfiles " $output" - func_to_tool_file "$output" - output=$firstobj\"$file_list_spec$func_to_tool_file_result\" - else - if test -n "$save_libobjs"; then - func_verbose "creating reloadable object files..." - output=$output_objdir/$output_la-${k}.$objext - eval test_cmds=\"$reload_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - if test "X$objlist" = X || - test "$len" -lt "$max_cmd_len"; then - func_append objlist " $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - reload_objs=$objlist - eval concat_cmds=\"$reload_cmds\" - else - # All subsequent reloadable object files will link in - # the last one created. - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - func_arith $k + 1 - k=$func_arith_result - output=$output_objdir/$output_la-${k}.$objext - objlist=" $obj" - func_len " $last_robj" - func_arith $len0 + $func_len_result - len=$func_arith_result - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - reload_objs="$objlist $last_robj" - eval concat_cmds=\"\${concat_cmds}$reload_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" - fi - func_append delfiles " $output" - - else - output= - fi - - if ${skipped_export-false}; then - func_verbose "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $opt_dry_run || $RM $export_symbols - libobjs=$output - # Append the command to create the export file. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" - if test -n "$last_robj"; then - eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" - fi - fi - - test -n "$save_libobjs" && - func_verbose "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - if test -n "$export_symbols_regex" && ${skipped_export-false}; then - func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - func_show_eval '$MV "${export_symbols}T" "$export_symbols"' - fi - fi - - if ${skipped_export-false}; then - if test -n "$export_symbols" && test -n "$include_expsyms"; then - tmp_export_symbols="$export_symbols" - test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" - $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' - fi - - if test -n "$orig_export_symbols"; then - # The given exports_symbols file has to be filtered, so filter it. - func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" - # FIXME: $output_objdir/$libname.filter potentially contains lots of - # 's' commands which not all seds can handle. GNU sed should be fine - # though. Also, the filter scales superlinearly with the number of - # global variables. join(1) would be nice here, but unfortunately - # isn't a blessed tool. - $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter - func_append delfiles " $export_symbols $output_objdir/$libname.filter" - export_symbols=$output_objdir/$libname.def - $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols - fi - fi - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - test "X$libobjs" = "X " && libobjs= - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - fi - - if test -n "$delfiles"; then - # Append the command to remove temporary files to $cmds. - eval cmds=\"\$cmds~\$RM $delfiles\" - fi - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append libobjs " $func_extract_archives_result" - test "X$libobjs" = "X " && libobjs= - fi - - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $opt_silent || { - func_quote_for_expand "$cmd" - eval "func_echo $func_quote_for_expand_result" - } - $opt_dry_run || eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - ( cd "$output_objdir" && \ - $RM "${realname}T" && \ - $MV "${realname}U" "$realname" ) - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$opt_mode" = relink; then - $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - func_show_eval '${RM}r "$gentop"' - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - func_warning "\`-dlopen' is ignored for objects" - fi - - case " $deplibs" in - *\ -l* | *\ -L*) - func_warning "\`-l' and \`-L' are ignored for objects" ;; - esac - - test -n "$rpath" && \ - func_warning "\`-rpath' is ignored for objects" - - test -n "$xrpath" && \ - func_warning "\`-R' is ignored for objects" - - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for objects" - - test -n "$release" && \ - func_warning "\`-release' is ignored for objects" - - case $output in - *.lo) - test -n "$objs$old_deplibs" && \ - func_fatal_error "cannot build library object \`$output' from non-libtool objects" - - libobj=$output - func_lo2o "$libobj" - obj=$func_lo2o_result - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $opt_dry_run || $RM $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - func_append generated " $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # If we're not building shared, we need to use non_pic_objs - test "$build_libtool_libs" != yes && libobjs="$non_pic_objects" - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - func_execute_cmds "$reload_cmds" 'exit $?' - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - func_execute_cmds "$reload_cmds" 'exit $?' - fi - - if test -n "$gentop"; then - func_show_eval '${RM}r "$gentop"' - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) func_stripname '' '.exe' "$output" - output=$func_stripname_result.exe;; - esac - test -n "$vinfo" && \ - func_warning "\`-version-info' is ignored for programs" - - test -n "$release" && \ - func_warning "\`-release' is ignored for programs" - - test "$preload" = yes \ - && test "$dlopen_support" = unknown \ - && test "$dlopen_self" = unknown \ - && test "$dlopen_self_static" = unknown && \ - func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` - ;; - esac - - case $host in - *-*-darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - # But is supposedly fixed on 10.4 or later (yay!). - if test "$tagname" = CXX ; then - case ${MACOSX_DEPLOYMENT_TARGET-10.0} in - 10.[0123]) - func_append compile_command " ${wl}-bind_at_load" - func_append finalize_command " ${wl}-bind_at_load" - ;; - esac - fi - # Time to change all our "foo.ltframework" stuff back to "-framework foo" - compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - func_append new_libs " -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) func_append new_libs " $deplib" ;; - esac - ;; - *) func_append new_libs " $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - func_append compile_command " $compile_deplibs" - func_append finalize_command " $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) func_append finalize_rpath " $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) func_append perm_rpath " $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) - testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; - *) func_append dllsearchpath ":$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; - *) func_append dllsearchpath ":$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - func_append rpath " $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) func_append finalize_perm_rpath " $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` - fi - - func_generate_dlsyms "$outputname" "@PROGRAM@" "no" - - # template prelinking step - if test -n "$prelink_cmds"; then - func_execute_cmds "$prelink_cmds" 'exit $?' - fi - - wrappers_required=yes - case $host in - *cegcc* | *mingw32ce*) - # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. - wrappers_required=no - ;; - *cygwin* | *mingw* ) - if test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - *) - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - wrappers_required=no - fi - ;; - esac - if test "$wrappers_required" = no; then - # Replace the output file specification. - compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - exit_status=0 - func_show_eval "$link_command" 'exit_status=$?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Delete the generated files. - if test -f "$output_objdir/${outputname}S.${objext}"; then - func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' - fi - - exit $exit_status - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - func_append rpath "$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - func_append rpath "$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $opt_dry_run || $RM $output - # Link the executable and exit - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - func_warning "this platform does not like uninstalled shared libraries" - func_warning "\`$output' will be relinked during installation" - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname - - func_show_eval "$link_command" 'exit $?' - - if test -n "$postlink_cmds"; then - func_to_tool_file "$output_objdir/$outputname" - postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` - func_execute_cmds "$postlink_cmds" 'exit $?' - fi - - # Now create the wrapper script. - func_verbose "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - fi - - # Only actually do things if not in dry run mode. - $opt_dry_run || { - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) func_stripname '' '.exe' "$output" - output=$func_stripname_result ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - func_stripname '' '.exe' "$outputname" - outputname=$func_stripname_result ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - func_dirname_and_basename "$output" "" "." - output_name=$func_basename_result - output_path=$func_dirname_result - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $RM $cwrappersource $cwrapper - trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - func_emit_cwrapperexe_src > $cwrappersource - - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. - $opt_dry_run || { - $LTCC $LTCFLAGS -o $cwrapper $cwrappersource - $STRIP $cwrapper - } - - # Now, create the wrapper script for func_source use: - func_ltwrapper_scriptname $cwrapper - $RM $func_ltwrapper_scriptname_result - trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 - $opt_dry_run || { - # note: this script will not be executed, so do not chmod. - if test "x$build" = "x$host" ; then - $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result - else - func_emit_wrapper no > $func_ltwrapper_scriptname_result - fi - } - ;; - * ) - $RM $output - trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 - - func_emit_wrapper no > $output - chmod +x $output - ;; - esac - } - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save $symfileobj" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - if test "$preload" = yes && test -f "$symfileobj"; then - func_append oldobjs " $symfileobj" - fi - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $addlibs - func_append oldobjs " $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - - # Add any objects from preloaded convenience libraries - if test -n "$dlprefiles"; then - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - - func_extract_archives $gentop $dlprefiles - func_append oldobjs " $func_extract_archives_result" - fi - - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - func_basename "$obj" - $ECHO "$func_basename_result" - done | sort | sort -uc >/dev/null 2>&1); then - : - else - echo "copying selected object files to avoid basename conflicts..." - gentop="$output_objdir/${outputname}x" - func_append generated " $gentop" - func_mkdir_p "$gentop" - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - func_basename "$obj" - objbase="$func_basename_result" - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - func_arith $counter + 1 - counter=$func_arith_result - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - func_append oldobjs " $gentop/$newobj" - ;; - *) func_append oldobjs " $obj" ;; - esac - done - fi - func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 - tool_oldlib=$func_to_tool_file_result - eval cmds=\"$old_archive_cmds\" - - func_len " $cmds" - len=$func_len_result - if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - elif test -n "$archiver_list_spec"; then - func_verbose "using command file archive linking..." - for obj in $oldobjs - do - func_to_tool_file "$obj" - $ECHO "$func_to_tool_file_result" - done > $output_objdir/$libname.libcmd - func_to_tool_file "$output_objdir/$libname.libcmd" - oldobjs=" $archiver_list_spec$func_to_tool_file_result" - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - func_verbose "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - oldobjs= - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - eval test_cmds=\"$old_archive_cmds\" - func_len " $test_cmds" - len0=$func_len_result - len=$len0 - for obj in $save_oldobjs - do - func_len " $obj" - func_arith $len + $func_len_result - len=$func_arith_result - func_append objlist " $obj" - if test "$len" -lt "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - len=$len0 - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - func_execute_cmds "$cmds" 'exit $?' - done - - test -n "$generated" && \ - func_show_eval "${RM}r$generated" - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - func_verbose "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - func_quote_for_eval "$var_value" - relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - # Only create the output if not a dry run. - $opt_dry_run || { - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - func_basename "$deplib" - name="$func_basename_result" - func_resolve_sysroot "$deplib" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` - test -z "$libdir" && \ - func_fatal_error "\`$deplib' is not a valid libtool archive" - func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" - ;; - -L*) - func_stripname -L '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -L$func_replace_sysroot_result" - ;; - -R*) - func_stripname -R '' "$deplib" - func_replace_sysroot "$func_stripname_result" - func_append newdependency_libs " -R$func_replace_sysroot_result" - ;; - *) func_append newdependency_libs " $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - - for lib in $dlfiles; do - case $lib in - *.la) - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" - ;; - *) func_append newdlfiles " $lib" ;; - esac - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - *.la) - # Only pass preopened files to the pseudo-archive (for - # eventual linking with the app. that links it) if we - # didn't already link the preopened objects directly into - # the library: - func_basename "$lib" - name="$func_basename_result" - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - test -z "$libdir" && \ - func_fatal_error "\`$lib' is not a valid libtool archive" - func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" - ;; - esac - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlfiles " $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - func_append newdlprefiles " $abs" - done - dlprefiles="$newdlprefiles" - fi - $RM $output - # place dlname in correct position for cygwin - # In fact, it would be nice if we could use this code for all target - # systems that can't hard-code library paths into their executables - # and that have no shared library path variable independent of PATH, - # but it turns out we can't easily determine that from inspecting - # libtool variables, so we have to hard-code the OSs to which it - # applies here; at the moment, that means platforms that use the PE - # object format with DLL files. See the long comment at the top of - # tests/bindir.at for full details. - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) - # If a -bindir argument was supplied, place the dll there. - if test "x$bindir" != x ; - then - func_relative_path "$install_libdir" "$bindir" - tdlname=$func_relative_path_result$dlname - else - # Otherwise fall back on heuristic. - tdlname=../bin/$dlname - fi - ;; - esac - $ECHO > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Linker flags that can not go in dependency_libs. -inherited_linker_flags='$new_inherited_linker_flags' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Names of additional weak libraries provided by this library -weak_library_names='$weak_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $ECHO >> $output "\ -relink_command=\"$relink_command\"" - fi - done - } - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' - ;; - esac - exit $EXIT_SUCCESS -} - -{ test "$opt_mode" = link || test "$opt_mode" = relink; } && - func_mode_link ${1+"$@"} - - -# func_mode_uninstall arg... -func_mode_uninstall () -{ - $opt_debug - RM="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) func_append RM " $arg"; rmforce=yes ;; - -*) func_append RM " $arg" ;; - *) func_append files " $arg" ;; - esac - done - - test -z "$RM" && \ - func_fatal_help "you must specify an RM program" - - rmdirs= - - for file in $files; do - func_dirname "$file" "" "." - dir="$func_dirname_result" - if test "X$dir" = X.; then - odir="$objdir" - else - odir="$dir/$objdir" - fi - func_basename "$file" - name="$func_basename_result" - test "$opt_mode" = uninstall && odir="$dir" - - # Remember odir for removal later, being careful to avoid duplicates - if test "$opt_mode" = clean; then - case " $rmdirs " in - *" $odir "*) ;; - *) func_append rmdirs " $odir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if { test -L "$file"; } >/dev/null 2>&1 || - { test -h "$file"; } >/dev/null 2>&1 || - test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if func_lalib_p "$file"; then - func_source $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - func_append rmfiles " $odir/$n" - done - test -n "$old_library" && func_append rmfiles " $odir/$old_library" - - case "$opt_mode" in - clean) - case " $library_names " in - *" $dlname "*) ;; - *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; - esac - test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if func_lalib_p "$file"; then - - # Read the .lo file - func_source $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" && - test "$pic_object" != none; then - func_append rmfiles " $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" && - test "$non_pic_object" != none; then - func_append rmfiles " $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$opt_mode" = clean ; then - noexename=$name - case $file in - *.exe) - func_stripname '' '.exe' "$file" - file=$func_stripname_result - func_stripname '' '.exe' "$name" - noexename=$func_stripname_result - # $file with .exe has already been added to rmfiles, - # add $file without .exe - func_append rmfiles " $file" - ;; - esac - # Do a test to see if this is a libtool program. - if func_ltwrapper_p "$file"; then - if func_ltwrapper_executable_p "$file"; then - func_ltwrapper_scriptname "$file" - relink_command= - func_source $func_ltwrapper_scriptname_result - func_append rmfiles " $func_ltwrapper_scriptname_result" - else - relink_command= - func_source $dir/$noexename - fi - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - func_append rmfiles " $odir/$name $odir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - func_append rmfiles " $odir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - func_append rmfiles " $odir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - func_show_eval "$RM $rmfiles" 'exit_status=1' - done - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - func_show_eval "rmdir $dir >/dev/null 2>&1" - fi - done - - exit $exit_status -} - -{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } && - func_mode_uninstall ${1+"$@"} - -test -z "$opt_mode" && { - help="$generic_help" - func_fatal_help "you must specify a MODE" -} - -test -z "$exec_cmd" && \ - func_fatal_help "invalid operation mode \`$opt_mode'" - -if test -n "$exec_cmd"; then - eval exec "$exec_cmd" - exit $EXIT_FAILURE -fi - -exit $exit_status - - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -build_libtool_libs=no -build_old_libs=yes -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: -# vi:sw=2 - diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_add_fortify_source.m4 python-nacl-1.5.0/src/libsodium/m4/ax_add_fortify_source.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_add_fortify_source.m4 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_add_fortify_source.m4 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,74 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_add_fortify_source.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_ADD_FORTIFY_SOURCE +# +# DESCRIPTION +# +# Check whether -D_FORTIFY_SOURCE=2 can be added to CPPFLAGS without macro +# redefinition warnings or linker errors. Some distributions (such as +# Gentoo Linux) enable _FORTIFY_SOURCE globally in their compilers, +# leading to unnecessary warnings in the form of +# +# :0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] +# : note: this is the location of the previous definition +# +# which is a problem if -Werror is enabled. This macro checks whether +# _FORTIFY_SOURCE is already defined, and if not, adds -D_FORTIFY_SOURCE=2 +# to CPPFLAGS. +# +# Newer mingw-w64 msys2 package comes with a bug in +# headers-git-7.0.0.5546.d200317d-1. It broke -D_FORTIFY_SOURCE +# support, and would need -lssp or -fstack-protector. See +# https://github.com/msys2/MINGW-packages/issues/5803. Try to +# actually link it. +# +# LICENSE +# +# Copyright (c) 2017 David Seifert +# Copyright (c) 2019 Reini Urban +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 3 + +AC_DEFUN([AX_ADD_FORTIFY_SOURCE],[ + AC_MSG_CHECKING([whether to add -D_FORTIFY_SOURCE=2 to CPPFLAGS]) + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([], + [[ + #ifndef _FORTIFY_SOURCE + return 0; + #else + this_is_an_error; + #endif + ]] + )], + AC_LINK_IFELSE([ + AC_LANG_SOURCE([[ + #define _FORTIFY_SOURCE 2 + #include + int main() { + const char *s = " "; + strcpy(s, "x"); + return strlen(s)-1; + } + ]] + )], + [ + AC_MSG_RESULT([yes]) + CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2" + ], [ + AC_MSG_RESULT([no]) + ], + ), + [ + AC_MSG_RESULT([no]) + ]) +]) diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_check_catchable_abrt.m4 python-nacl-1.5.0/src/libsodium/m4/ax_check_catchable_abrt.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_check_catchable_abrt.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_check_catchable_abrt.m4 2022-01-07 21:54:10.000000000 +0000 @@ -11,7 +11,7 @@ AC_DEFUN([AX_CHECK_CATCHABLE_ABRT], [dnl AC_PREREQ(2.64) AS_VAR_PUSHDEF([CACHEVAR], [ax_cv_check_[]_AC_LANG_ABBREV[]CATCHABLE_ABRT])dnl - AC_CACHE_CHECK([whether SIGABRT can be caught when using the _AC_LANG compiler], CACHEVAR, [ + AC_CACHE_CHECK([whether SIGABRT can be caught], CACHEVAR, [ AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #include diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_check_catchable_segv.m4 python-nacl-1.5.0/src/libsodium/m4/ax_check_catchable_segv.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_check_catchable_segv.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_check_catchable_segv.m4 2022-01-07 21:54:10.000000000 +0000 @@ -11,7 +11,7 @@ AC_DEFUN([AX_CHECK_CATCHABLE_SEGV], [dnl AC_PREREQ(2.64) AS_VAR_PUSHDEF([CACHEVAR], [ax_cv_check_[]_AC_LANG_ABBREV[]CATCHABLE_SEGV])dnl - AC_CACHE_CHECK([whether segmentation violations can be caught when using the _AC_LANG compiler], CACHEVAR, [ + AC_CACHE_CHECK([whether segmentation violations can be caught], CACHEVAR, [ AC_RUN_IFELSE([ AC_LANG_PROGRAM([[ #include diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_check_compile_flag.m4 python-nacl-1.5.0/src/libsodium/m4/ax_check_compile_flag.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_check_compile_flag.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_check_compile_flag.m4 2022-01-07 21:54:10.000000000 +0000 @@ -1,10 +1,10 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html +# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html # =========================================================================== # # SYNOPSIS # -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS]) +# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) # # DESCRIPTION # @@ -29,33 +29,12 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 5 +#serial 6 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF @@ -63,8 +42,9 @@ AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_TRY_LINK([#include ], - [time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x], + AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM( +[#include ], [time_t x; int fodder = 0; if (fodder > -1000 && time(&x)) return (int) x] + )])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_check_gnu_make.m4 python-nacl-1.5.0/src/libsodium/m4/ax_check_gnu_make.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_check_gnu_make.m4 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_check_gnu_make.m4 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,84 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_check_gnu_make.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CHECK_GNU_MAKE() +# +# DESCRIPTION +# +# This macro searches for a GNU version of make. If a match is found: +# +# * The makefile variable `ifGNUmake' is set to the empty string, otherwise +# it is set to "#". This is useful for including a special features in a +# Makefile, which cannot be handled by other versions of make. +# * The variable `_cv_gnu_make_command` is set to the command to invoke +# GNU make if it exists, the empty string otherwise. +# * The variable `ax_cv_gnu_make_command` is set to the command to invoke +# GNU make by copying `_cv_gnu_make_command`, otherwise it is unset. +# * If GNU Make is found, its version is extracted from the output of +# `make --version` as the last field of a record of space-separated +# columns and saved into the variable `ax_check_gnu_make_version`. +# +# Here is an example of its use: +# +# Makefile.in might contain: +# +# # A failsafe way of putting a dependency rule into a makefile +# $(DEPEND): +# $(CC) -MM $(srcdir)/*.c > $(DEPEND) +# +# @ifGNUmake@ ifeq ($(DEPEND),$(wildcard $(DEPEND))) +# @ifGNUmake@ include $(DEPEND) +# @ifGNUmake@ endif +# +# Then configure.in would normally contain: +# +# AX_CHECK_GNU_MAKE() +# AC_OUTPUT(Makefile) +# +# Then perhaps to cause gnu make to override any other make, we could do +# something like this (note that GNU make always looks for GNUmakefile +# first): +# +# if ! test x$_cv_gnu_make_command = x ; then +# mv Makefile GNUmakefile +# echo .DEFAULT: > Makefile ; +# echo \ $_cv_gnu_make_command \$@ >> Makefile; +# fi +# +# Then, if any (well almost any) other make is called, and GNU make also +# exists, then the other make wraps the GNU make. +# +# LICENSE +# +# Copyright (c) 2008 John Darrington +# Copyright (c) 2015 Enrico M. Crisostomo +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 9 + +AC_DEFUN([AX_CHECK_GNU_MAKE],dnl + [AC_PROG_AWK + AC_CACHE_CHECK([for GNU make],[_cv_gnu_make_command],[dnl + _cv_gnu_make_command="" ; +dnl Search all the common names for GNU make + for a in "$MAKE" make gmake gnumake ; do + if test -z "$a" ; then continue ; fi ; + if "$a" --version 2> /dev/null | grep GNU 2>&1 > /dev/null ; then + _cv_gnu_make_command=$a ; + AX_CHECK_GNU_MAKE_HEADLINE=$("$a" --version 2> /dev/null | grep "GNU Make") + ax_check_gnu_make_version=$(echo ${AX_CHECK_GNU_MAKE_HEADLINE} | ${AWK} -F " " '{ print $(NF); }') + break ; + fi + done ;]) +dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise + AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])], [AS_VAR_SET([ifGNUmake], [""])]) + AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])]) + AC_SUBST([ifGNUmake]) +]) diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_pthread.m4 python-nacl-1.5.0/src/libsodium/m4/ax_pthread.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_pthread.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_pthread.m4 2022-01-07 21:54:10.000000000 +0000 @@ -14,20 +14,24 @@ # flags that are needed. (The user can also force certain compiler # flags/libs to be tested by setting these environment variables.) # -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) +# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is +# needed for multi-threaded programs (defaults to the value of CC +# respectively CXX otherwise). (This is necessary on e.g. AIX to use the +# special cc_r/CC_r compiler alias.) # # NOTE: You are assumed to not only compile your program with these flags, # but also to link with them as well. For example, you might link with # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # # If you are only building threaded programs, you may wish to use these # variables in your default LIBS, CFLAGS, and CC: # # LIBS="$PTHREAD_LIBS $LIBS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" # CC="$PTHREAD_CC" +# CXX="$PTHREAD_CXX" # # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to @@ -55,6 +59,7 @@ # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2011 Daniel Richard G. +# Copyright (c) 2019 Marc Stevens # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -82,11 +87,11 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 24 +#serial 30 AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) +AC_REQUIRE([AC_CANONICAL_TARGET]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_SED]) AC_LANG_PUSH([C]) @@ -104,6 +109,7 @@ ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_LIBS="$LIBS" AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) + AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) @@ -123,10 +129,12 @@ # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. +# Create a list of thread flags to try. Items with a "," contain both +# C compiler flags (before ",") and linker flags (after ","). Other items +# starting with a "-" are C compiler flags, and remaining items are +# library names, except for "none" which indicates that we try without +# any flags at all, and "pthread-config" which is a program returning +# the flags for the Pth emulation library. ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" @@ -150,7 +158,7 @@ # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) -case $host_os in +case $target_os in freebsd*) @@ -194,20 +202,53 @@ # that too in a future libc.) So we'll check first for the # standard Solaris way of linking pthreads (-mt -lpthread). - ax_pthread_flags="-mt,pthread pthread $ax_pthread_flags" + ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" ;; esac +# Are we compiling with Clang? + +AC_CACHE_CHECK([whether $CC is Clang], + [ax_cv_PTHREAD_CLANG], + [ax_cv_PTHREAD_CLANG=no + # Note that Autoconf sets GCC=yes for Clang as well as GCC + if test "x$GCC" = "xyes"; then + AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], + [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ +# if defined(__clang__) && defined(__llvm__) + AX_PTHREAD_CC_IS_CLANG +# endif + ], + [ax_cv_PTHREAD_CLANG=yes]) + fi + ]) +ax_pthread_clang="$ax_cv_PTHREAD_CLANG" + + # GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) +# Note that for GCC and Clang -pthread generally implies -lpthread, +# except when -nostdlib is passed. +# This is problematic using libtool to build C++ shared libraries with pthread: +# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 +# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 +# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 +# To solve this, first try -pthread together with -lpthread for GCC + AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread -pthreads $ax_pthread_flags"]) + [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) + +# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first + +AS_IF([test "x$ax_pthread_clang" = "xyes"], + [ax_pthread_flags="-pthread,-lpthread -pthread"]) + # The presence of a feature test macro requesting re-entrant function # definitions is, on some systems, a strong hint that pthreads support is # correctly enabled -case $host_os in +case $target_os in darwin* | hpux* | linux* | osf* | solaris*) ax_pthread_check_macro="_REENTRANT" ;; @@ -224,25 +265,86 @@ [ax_pthread_check_cond=0], [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) -# Are we compiling with Clang? -AC_CACHE_CHECK([whether $CC is Clang], - [ax_cv_PTHREAD_CLANG], - [ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], - [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - ], - [ax_cv_PTHREAD_CLANG=yes]) - fi - ]) -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" +if test "x$ax_pthread_ok" = "xno"; then +for ax_pthread_try_flag in $ax_pthread_flags; do + + case $ax_pthread_try_flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + *,*) + PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` + PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` + AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) + PTHREAD_CFLAGS="$ax_pthread_try_flag" + ;; + + pthread-config) + AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) + AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) + PTHREAD_LIBS="-l$ax_pthread_try_flag" + ;; + esac + + ax_pthread_save_CFLAGS="$CFLAGS" + ax_pthread_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include +# if $ax_pthread_check_cond +# error "$ax_pthread_check_macro must be defined" +# endif + static void *some_global = NULL; + static void routine(void *a) + { + /* To avoid any unused-parameter or + unused-but-set-parameter warning. */ + some_global = a; + } + static void *start_routine(void *a) { return a; }], + [pthread_t th; pthread_attr_t attr; + pthread_create(&th, 0, start_routine, 0); + pthread_join(th, 0); + pthread_attr_init(&attr); + pthread_cleanup_push(routine, 0); + pthread_cleanup_pop(0) /* ; */])], + [ax_pthread_ok=yes], + []) + + CFLAGS="$ax_pthread_save_CFLAGS" + LIBS="$ax_pthread_save_LIBS" + + AC_MSG_RESULT([$ax_pthread_ok]) + AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi -ax_pthread_clang_warning=no # Clang needs special handling, because older versions handle the -pthread # option in a rather... idiosyncratic way @@ -261,11 +363,6 @@ # -pthread does define _REENTRANT, and while the Darwin headers # ignore this macro, third-party headers might not.) - PTHREAD_CFLAGS="-pthread" - PTHREAD_LIBS= - - ax_pthread_ok=yes - # However, older versions of Clang make a point of warning the user # that, in an invocation where only linking and no compilation is # taking place, the -pthread option has no effect ("argument unused @@ -294,7 +391,7 @@ # step ax_pthread_save_ac_link="$ac_link" ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"` + ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_save_CFLAGS="$CFLAGS" for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do @@ -320,78 +417,7 @@ fi # $ax_pthread_clang = yes -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -mt,pthread) - AC_MSG_CHECKING([whether pthreads work with -mt -lpthread]) - PTHREAD_CFLAGS="-mt" - PTHREAD_LIBS="-lpthread" - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void routine(void *a) { a = 0; } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - AC_MSG_RESULT([$ax_pthread_ok]) - AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi # Various other checks: if test "x$ax_pthread_ok" = "xyes"; then @@ -424,7 +450,7 @@ AC_CACHE_CHECK([whether more special flags are required for pthreads], [ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in + case $target_os in solaris*) ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ;; @@ -438,7 +464,8 @@ AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], [ax_cv_PTHREAD_PRIO_INHERIT], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT;]])], + [[int i = PTHREAD_PRIO_INHERIT; + return i;]])], [ax_cv_PTHREAD_PRIO_INHERIT=yes], [ax_cv_PTHREAD_PRIO_INHERIT=no]) ]) @@ -453,25 +480,35 @@ # More AIX lossage: compile with *_r variant if test "x$GCC" != "xyes"; then - case $host_os in + case $target_os in aix*) AS_CASE(["x/$CC"], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [#handle absolute path differently from PATH based program lookup AS_CASE(["x$CC"], [x/*], - [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])], - [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])]) + [ + AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) + AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) + ], + [ + AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) + AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) + ] + ) + ]) ;; esac fi fi test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" +test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CC]) +AC_SUBST([PTHREAD_CXX]) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test "x$ax_pthread_ok" = "xyes"; then diff -Nru python-nacl-1.4.0/src/libsodium/m4/ax_tls.m4 python-nacl-1.5.0/src/libsodium/m4/ax_tls.m4 --- python-nacl-1.4.0/src/libsodium/m4/ax_tls.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/ax_tls.m4 2022-01-07 21:54:10.000000000 +0000 @@ -44,7 +44,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 14 +#serial 15 AC_DEFUN([AX_TLS], [ AC_MSG_CHECKING([for thread local storage (TLS) class]) @@ -52,23 +52,20 @@ [for ax_tls_keyword in thread_local _Thread_local __thread '__declspec(thread)' none; do AS_CASE([$ax_tls_keyword], [none], [ac_cv_tls=none ; break], - [AC_TRY_COMPILE( - [#include - static void - foo(void) { - static ] $ax_tls_keyword [ int bar; - exit(1); - }], - [], - [ac_cv_tls=$ax_tls_keyword ; break], - ac_cv_tls=none - )]) - done - ]) + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( + [#include ], + [static $ax_tls_keyword int bar;] + )], + [ac_cv_tls=$ax_tls_keyword ; break], + [ac_cv_tls=none] + )] + ) + done ] + ) AC_MSG_RESULT([$ac_cv_tls]) AS_IF([test "$ac_cv_tls" != "none"], - [AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class define it to that here]) - m4_ifnblank([$1],[$1])], - [m4_ifnblank([$2],[$2])]) + [AC_DEFINE_UNQUOTED([TLS],[$ac_cv_tls],[If the compiler supports a TLS storage class, define it to that here]) + m4_ifnblank([$1],[$1],[[:]])], + [m4_ifnblank([$2],[$2],[[:]])]) ]) diff -Nru python-nacl-1.4.0/src/libsodium/m4/libtool.m4 python-nacl-1.5.0/src/libsodium/m4/libtool.m4 --- python-nacl-1.4.0/src/libsodium/m4/libtool.m4 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/m4/libtool.m4 2022-01-07 21:54:10.000000000 +0000 @@ -1067,16 +1067,11 @@ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on - # if running on 10.5 or later, the deployment target defaults - # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? - case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in - 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) - _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; - 10.[[012]][[,.]]*) + darwin*) + case ${MACOSX_DEPLOYMENT_TARGET},$host in + 10.[[012]],*|,*powerpc*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; - 10.*) + *) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; diff -Nru python-nacl-1.4.0/src/libsodium/Makefile.in python-nacl-1.5.0/src/libsodium/Makefile.in --- python-nacl-1.4.0/src/libsodium/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -88,9 +88,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -206,9 +208,8 @@ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/src/libsodium/include/sodium/version.h.in \ AUTHORS ChangeLog THANKS build-aux/compile \ - build-aux/config.guess build-aux/config.sub \ - build-aux/install-sh build-aux/ltmain.sh build-aux/missing \ - compile depcomp install-sh ltmain.sh missing + build-aux/config.guess build-aux/config.sub build-aux/depcomp \ + build-aux/install-sh build-aux/ltmain.sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -247,6 +248,8 @@ DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best DIST_TARGETS = dist-bzip2 dist-gzip +# Exists only to be overridden by the user if desired. +AM_DISTCHECK_DVI_TARGET = dvi distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' @@ -256,7 +259,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -340,6 +342,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -400,11 +403,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -692,6 +700,10 @@ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) +dist-zstd: distdir + tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst + $(am__post_remove_distdir) + dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @@ -734,6 +746,8 @@ eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ + *.tar.zst*) \ + zstd -dc $(distdir).tar.zst | $(am__untar) ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) @@ -749,7 +763,7 @@ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ - && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ @@ -915,18 +929,18 @@ am--refresh check check-am clean clean-cscope clean-generic \ clean-libtool cscope cscopelist-am ctags ctags-am dist \ dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \ - dist-xz dist-zip distcheck distclean distclean-generic \ - distclean-libtool distclean-tags distcleancheck distdir \ - distuninstallcheck dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-pkgconfigDATA install-ps \ - install-ps-am install-strip installcheck installcheck-am \ - installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ - uninstall-am uninstall-pkgconfigDATA + dist-xz dist-zip dist-zstd distcheck distclean \ + distclean-generic distclean-libtool distclean-tags \ + distcleancheck distdir distuninstallcheck dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-pkgconfigDATA install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs installdirs-am \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am uninstall-pkgconfigDATA .PRECIOUS: Makefile diff -Nru python-nacl-1.4.0/src/libsodium/msvc-scripts/Makefile.in python-nacl-1.5.0/src/libsodium/msvc-scripts/Makefile.in --- python-nacl-1.4.0/src/libsodium/msvc-scripts/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/msvc-scripts/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,9 +87,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = msvc-scripts ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -133,7 +135,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -217,6 +218,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -277,11 +279,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru python-nacl-1.4.0/src/libsodium/packaging/dotnet-core/libsodium.pkgproj python-nacl-1.5.0/src/libsodium/packaging/dotnet-core/libsodium.pkgproj --- python-nacl-1.4.0/src/libsodium/packaging/dotnet-core/libsodium.pkgproj 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/dotnet-core/libsodium.pkgproj 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,37 @@ + + + + netstandard2.0 + true + false + true + + + + libsodium + 1.0.18.1 + Frank Denis + Internal implementation package not meant for direct consumption. Please do not reference directly. + © $([System.DateTime]::UtcNow.ToString(yyyy)) Frank Denis + ISC + true + https://libsodium.org/ + https://github.com/jedisct1/libsodium.git + git + 4.0 + + + + + + + + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/packaging/dotnet-core/test.cs python-nacl-1.5.0/src/libsodium/packaging/dotnet-core/test.cs --- python-nacl-1.4.0/src/libsodium/packaging/dotnet-core/test.cs 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/dotnet-core/test.cs 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,43 @@ +using System; +using System.Runtime.InteropServices; + +internal static class Program +{ + internal static int Main() + { + Console.WriteLine("sodium_version_string: {0}", Marshal.PtrToStringAnsi(sodium_version_string())); + Console.WriteLine("sodium_library_version_major: {0}", sodium_library_version_major()); + Console.WriteLine("sodium_library_version_minor: {0}", sodium_library_version_minor()); + Console.WriteLine("sodium_library_minimal: {0}", sodium_library_minimal()); + int error = sodium_init(); + Console.WriteLine("sodium_init: {0}", error); + if (error == 0) + { + randombytes_buf(out ulong buf, (UIntPtr)sizeof(ulong)); + Console.WriteLine("randombytes_buf: 0x'{0:X8}'", buf); + Console.WriteLine("crypto_aead_aes256gcm_is_available: {0}", crypto_aead_aes256gcm_is_available()); + } + return error == 0 ? 0 : 1; + } + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern int crypto_aead_aes256gcm_is_available(); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern void randombytes_buf(out ulong buf, UIntPtr size); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern int sodium_init(); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern int sodium_library_version_major(); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern int sodium_library_minimal(); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern int sodium_library_version_minor(); + + [DllImport("libsodium", CallingConvention = CallingConvention.Cdecl)] + private static extern IntPtr sodium_version_string(); +} diff -Nru python-nacl-1.4.0/src/libsodium/packaging/nuget/.gitignore python-nacl-1.5.0/src/libsodium/packaging/nuget/.gitignore --- python-nacl-1.4.0/src/libsodium/packaging/nuget/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/nuget/.gitignore 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,4 @@ +*.nupkg +package.nuspec +package.targets +package.xml diff -Nru python-nacl-1.4.0/src/libsodium/packaging/nuget/package.bat python-nacl-1.5.0/src/libsodium/packaging/nuget/package.bat --- python-nacl-1.4.0/src/libsodium/packaging/nuget/package.bat 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/nuget/package.bat 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,13 @@ +@ECHO OFF +ECHO Started nuget packaging build. +ECHO. +REM https://www.nuget.org/packages/gsl +gsl -q -script:package.gsl package.config +ECHO. +REM https://nuget.codeplex.com/releases +nuget pack package.nuspec -verbosity detailed +ECHO. +ECHO NOTE: Ignore warnings not applicable to native code: "Issue: Assembly outside lib folder." +ECHO. +ECHO Completed nuget packaging build. The package is in the following folder: +CD diff -Nru python-nacl-1.4.0/src/libsodium/packaging/nuget/package.config python-nacl-1.5.0/src/libsodium/packaging/nuget/package.config --- python-nacl-1.4.0/src/libsodium/packaging/nuget/package.config 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/nuget/package.config 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,4 @@ + + + + diff -Nru python-nacl-1.4.0/src/libsodium/packaging/nuget/package.gsl python-nacl-1.5.0/src/libsodium/packaging/nuget/package.gsl --- python-nacl-1.4.0/src/libsodium/packaging/nuget/package.gsl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/packaging/nuget/package.gsl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,260 @@ +.# Generate NuGet nuspec file (for subsequent packing). +.# +.# This is a code generator built using the iMatix GSL code generation +.# language. See https://github.com/imatix/gsl for details. This script +.# is licensed under MIT/X11. +.# +.echo "Generating package.nuspec from template." +.output "package.nuspec" + + + + + $(package.id) + $(package.version) + $(package.id) + libsodium contributors + Eric Voskuil + https://raw.github.com/jedisct1/libsodium/master/LICENSE + https://github.com/jedisct1/libsodium + http://upload.wikimedia.org/wikipedia/commons/thumb/7/78/Salt_shaker_on_white_background.jpg/220px-Salt_shaker_on_white_background.jpg + true + false + Sodium is a portable, cross-compilable, installable, packageable fork of NaCl, with a compatible API. + Portable fork of NaCl, packaged for Visual Studio 2013 (v120) and CTP_Nov2013 compilers. + https://raw.github.com/jedisct1/libsodium/master/ChangeLog + (c) 2013-2019, Frank Denis (attribution required) + native, NaCl, salt, sodium, libsodium, C++ + +.for dependency + +.endfor + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +.echo "Generating package.targets from template." +.output "package.targets" + + + + + + + + + + + + + $\(MSBuildThisFileDirectory)include\\;%(AdditionalIncludeDirectories) + + + advapi32.lib;crypt32.lib;%(AdditionalDependencies) + $\(MSBuildThisFileDirectory)bin\\;%(AdditionalLibraryDirectories) + + + + + SODIUM_STATIC;%(PreprocessorDefinitions) + + + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).lib;%(AdditionalDependencies) + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).lib;%(AdditionalDependencies) + + + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib;%(AdditionalDependencies) + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-s-$(package.pathversion).ltcg.lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-sgd-$(package.pathversion).ltcg.lib;%(AdditionalDependencies) + + + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib;%(AdditionalDependencies) + + + + + $(package.target)-x86-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-$(package.pathversion).imp.lib;%(AdditionalDependencies) + + + + + $(package.target)-x64-$(package.platformtoolset)-mt-gd-$(package.pathversion).imp.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + + + + +.echo "Generating package.xml (ui extension) from template." +.output "package.xml" + + + + + + + + + + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/README.markdown python-nacl-1.5.0/src/libsodium/README.markdown --- python-nacl-1.4.0/src/libsodium/README.markdown 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/README.markdown 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,8 @@ -[![Build Status](https://travis-ci.org/jedisct1/libsodium.svg?branch=master)](https://travis-ci.org/jedisct1/libsodium?branch=master) +[![GitHub CI](https://github.com/jedisct1/libsodium/workflows/CI/badge.svg)](https://github.com/jedisct1/libsodium/actions) [![Windows build status](https://ci.appveyor.com/api/projects/status/fu8s2elx25il98hj?svg=true)](https://ci.appveyor.com/project/jedisct1/libsodium) [![Coverity Scan Build Status](https://scan.coverity.com/projects/2397/badge.svg)](https://scan.coverity.com/projects/2397) [![Azure build status](https://jedisct1.visualstudio.com/Libsodium/_apis/build/status/jedisct1.libsodium?branchName=stable)](https://jedisct1.visualstudio.com/Libsodium/_build/latest?definitionId=3&branchName=stable) +[![CodeQL scan](https://github.com/jedisct1/libsodium/workflows/CodeQL%20scan/badge.svg)](https://github.com/jedisct1/libsodium/actions) ![libsodium](https://raw.github.com/jedisct1/libsodium/master/logo.png) ============ diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj --- python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,326 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + true + MultiByte + false + v140 + + + DynamicLibrary + true + MultiByte + false + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + StaticLibrary + false + true + MultiByte + v140 + + + DynamicLibrary + false + true + MultiByte + v140 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + true + true + true + + + + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters --- python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl --- python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,35 @@ + + + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + packaging + + + + + + + {{f1}} + + + {{f2}} + + + {{fd}} + + diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.tpl python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.tpl --- python-nacl-1.4.0/src/libsodium/regen-msvc/libsodium.vcxproj.tpl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/libsodium.vcxproj.tpl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,93 @@ + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + libsodium + {{platform}} + + + + DebugDLL + Win32 + + + ReleaseDLL + Win32 + + + DebugDLL + x64 + + + ReleaseDLL + x64 + + + DebugLTCG + Win32 + + + ReleaseLTCG + Win32 + + + DebugLTCG + x64 + + + ReleaseLTCG + x64 + + + DebugLIB + Win32 + + + ReleaseLIB + Win32 + + + DebugLIB + x64 + + + ReleaseLIB + x64 + + + + StaticLibrary + DynamicLibrary + + + + + + + + + + + + + + + + + + + + {{v1}} + + + {{v2}} + + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/regen-msvc.py python-nacl-1.5.0/src/libsodium/regen-msvc/regen-msvc.py --- python-nacl-1.4.0/src/libsodium/regen-msvc/regen-msvc.py 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/regen-msvc.py 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,188 @@ +#! /usr/bin/env python3 + +import glob +import os +import uuid + +dirs = set() + +tlv1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + tlv1 = tlv1 + ' \r\n'.format(file) + +tlv2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + tlv2 = tlv2 + ' \r\n'.format(file) + +tlf1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + tlf1 = tlf1 + ' \r\n'.format(file) + tlf1 = tlf1 + " Source Files\r\n" + tlf1 = tlf1 + " \r\n" + +tlf2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + tlf2 = tlf2 + ' \r\n'.format(file) + tlf2 = tlf2 + " Header Files\r\n" + tlf2 = tlf2 + " \r\n" + +v1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + file = file.replace("/", "\\") + v1 = v1 + ' \r\n'.format(file) + +v2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + file = file.replace("/", "\\") + v2 = v2 + ' \r\n'.format(file) + +f1 = "" +for file in glob.iglob("src/libsodium/**/*.c", recursive=True): + basedir = os.path.dirname(file).replace("src/libsodium/", "") + t = basedir + while t != "": + dirs.add(t) + t = os.path.dirname(t) + basedir = basedir.replace("/", "\\") + file = file.replace("/", "\\") + f1 = f1 + ' \r\n'.format(file) + f1 = f1 + " {}\r\n".format(basedir) + f1 = f1 + " \r\n" + +f2 = "" +for file in glob.iglob("src/libsodium/**/*.h", recursive=True): + basedir = os.path.dirname(file).replace("src/libsodium/", "") + t = basedir + while t != "": + dirs.add(t) + t = os.path.dirname(t) + basedir = basedir.replace("/", "\\") + file = file.replace("/", "\\") + f2 = f2 + ' \r\n'.format(file) + f2 = f2 + " {}\r\n".format(basedir) + f2 = f2 + " \r\n" + +fd = "" +dirs = list(dirs) +dirs.sort() +for dir in dirs: + dir = dir.replace("/", "\\") + uid = uuid.uuid3(uuid.UUID(bytes=b"LibSodiumMSVCUID"), dir) + fd = fd + ' \r\n'.format(dir) + fd = fd + " {{{}}}\r\n".format( + uid + ) + fd = fd + " \r\n" + + +def apply_template(tplfile, outfile, sbox): + tpl = "" + with open(tplfile, "rb") as fd: + tpl = fd.read() + for s in sbox.keys(): + tpl = tpl.replace( + str.encode("{{" + s + "}}", "utf8"), + str.encode(str.strip(sbox[s]), "utf8"), + ) + + with open(outfile, "wb") as fd: + fd.write(tpl) + + +sbox = { + "tlv1": tlv1, + "tlv2": tlv2, + "tlf1": tlf1, + "tlf2": tlf2, + "v1": v1, + "v2": v2, + "f1": f1, + "f2": f2, + "fd": fd, +} + +sd = os.path.dirname(os.path.realpath(__file__)) + +apply_template( + sd + "/tl_libsodium.vcxproj.filters.tpl", "libsodium.vcxproj.filters", sbox +) + +sbox.update({"platform": "v140"}) +apply_template(sd + "/tl_libsodium.vcxproj.tpl", "libsodium.vcxproj", sbox) + +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2019/libsodium/libsodium.vcxproj.filters", + sbox, +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2017/libsodium/libsodium.vcxproj.filters", + sbox, +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2015/libsodium/libsodium.vcxproj.filters", + sbox, +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2013/libsodium/libsodium.vcxproj.filters", + sbox, +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2012/libsodium/libsodium.vcxproj.filters", + sbox, +) +apply_template( + sd + "/libsodium.vcxproj.filters.tpl", + "builds/msvc/vs2010/libsodium/libsodium.vcxproj.filters", + sbox, +) + +sbox.update({"platform": "v142"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2019/libsodium/libsodium.vcxproj", + sbox, +) + +sbox.update({"platform": "v141"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2017/libsodium/libsodium.vcxproj", + sbox, +) + +sbox.update({"platform": "v140"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2015/libsodium/libsodium.vcxproj", + sbox, +) + +sbox.update({"platform": "v120"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2013/libsodium/libsodium.vcxproj", + sbox, +) + +sbox.update({"platform": "v110"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2012/libsodium/libsodium.vcxproj", + sbox, +) + +sbox.update({"platform": "v100"}) +apply_template( + sd + "/libsodium.vcxproj.tpl", + "builds/msvc/vs2010/libsodium/libsodium.vcxproj", + sbox, +) diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl python-nacl-1.5.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl --- python-nacl-1.4.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,23 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + {{tlf1}} + + + {{tlf2}} + + diff -Nru python-nacl-1.4.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl python-nacl-1.5.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl --- python-nacl-1.4.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,331 @@ + + + + + DebugDLL + Win32 + + + DebugDLL + x64 + + + Debug + Win32 + + + Debug + x64 + + + ReleaseDLL + Win32 + + + ReleaseDLL + x64 + + + Release + Win32 + + + Release + x64 + + + + {A185B162-6CB6-4502-B03F-B56F7699A8D9} + Win32Proj + libsodium + + + + StaticLibrary + true + MultiByte + false + {{platform}} + + + DynamicLibrary + true + MultiByte + false + {{platform}} + + + StaticLibrary + true + MultiByte + false + {{platform}} + + + DynamicLibrary + true + MultiByte + false + {{platform}} + + + StaticLibrary + false + true + MultiByte + {{platform}} + + + DynamicLibrary + false + true + MultiByte + {{platform}} + + + StaticLibrary + false + true + MultiByte + {{platform}} + + + DynamicLibrary + false + true + MultiByte + {{platform}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + true + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + false + $(SolutionDir)Build\$(Configuration)\$(Platform)\ + $(SolutionDir)Build\$(Configuration)\$(Platform)\Intermediate\ + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebug + + + Console + true + + + + + + + Level3 + Disabled + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDebugDLL + + + Console + true + + + + + Level3 + + + Full + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + Full + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + Speed + $(SolutionDir);$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include\sodium;$(SolutionDir)src\libsodium\include;%(AdditionalIncludeDirectories) + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_STATIC;SODIUM_EXPORT=;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreaded + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + SODIUM_EXPORT=__declspec(dllexport);SODIUM_DLL_EXPORT;WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + 4244;%(DisableSpecificWarnings) + MultiThreadedDLL + + + Console + true + true + true + + + + {{tlv1}} + + + {{tlv2}} + + + + + + + + + + diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c 2022-01-07 21:54:10.000000000 +0000 @@ -14,21 +14,21 @@ #include "crypto_aead_aes256gcm.h" #include "export.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "randombytes.h" #include "runtime.h" #include "utils.h" #if defined(HAVE_TMMINTRIN_H) && defined(HAVE_WMMINTRIN_H) -# ifdef __GNUC__ -# pragma GCC target("ssse3") -# pragma GCC target("aes") -# pragma GCC target("pclmul") -# endif +#ifdef __GNUC__ +# pragma GCC target("ssse3") +# pragma GCC target("aes") +# pragma GCC target("pclmul") +#endif #include #include +#include "private/sse2_64_32.h" #ifndef ENOSYS # define ENOSYS ENXIO @@ -365,7 +365,7 @@ */ \ MAKE4(RED_MUL_MID); \ \ -/* substracts x1*h1 and x0*h0 */ \ + /* subtracts x1*h1 and x0*h0 */ \ tmp0 = _mm_xor_si128(tmp0, lo); \ tmp0 = _mm_xor_si128(tmp0, hi); \ tmp0 = _mm_xor_si128(tmp1, tmp0); \ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_box/crypto_box_seal.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_box/crypto_box_seal.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_box/crypto_box_seal.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_box/crypto_box_seal.c 2022-01-07 21:54:10.000000000 +0000 @@ -32,10 +32,10 @@ if (crypto_box_keypair(epk, esk) != 0) { return -1; /* LCOV_EXCL_LINE */ } - memcpy(c, epk, crypto_box_PUBLICKEYBYTES); _crypto_box_seal_nonce(nonce, epk, pk); ret = crypto_box_easy(c + crypto_box_PUBLICKEYBYTES, m, mlen, nonce, pk, esk); + memcpy(c, epk, crypto_box_PUBLICKEYBYTES); sodium_memzero(esk, sizeof esk); sodium_memzero(epk, sizeof epk); sodium_memzero(nonce, sizeof nonce); diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_box/curve25519xchacha20poly1305/box_seal_curve25519xchacha20poly1305.c 2022-01-07 21:54:10.000000000 +0000 @@ -38,11 +38,11 @@ if (crypto_box_curve25519xchacha20poly1305_keypair(epk, esk) != 0) { return -1; /* LCOV_EXCL_LINE */ } - memcpy(c, epk, crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES); _crypto_box_curve25519xchacha20poly1305_seal_nonce(nonce, epk, pk); ret = crypto_box_curve25519xchacha20poly1305_easy( c + crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES, m, mlen, nonce, pk, esk); + memcpy(c, epk, crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES); sodium_memzero(esk, sizeof esk); sodium_memzero(epk, sizeof epk); sodium_memzero(nonce, sizeof nonce); diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_core/ed25519/core_ed25519.c 2022-01-07 21:54:10.000000000 +0000 @@ -81,10 +81,10 @@ void crypto_core_ed25519_random(unsigned char *p) { - unsigned char h[crypto_core_ed25519_HASHBYTES]; + unsigned char h[crypto_core_ed25519_UNIFORMBYTES]; randombytes_buf(h, sizeof h); - (void) crypto_core_ed25519_from_hash(p, h); + (void) crypto_core_ed25519_from_uniform(p, h); } void diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_core/ed25519/ref10/ed25519_ref10.c 2022-01-07 21:54:10.000000000 +0000 @@ -81,8 +81,7 @@ fe25519_sq(t3, t3); } fe25519_mul(t2, t3, t2); - fe25519_sq(t2, t2); - for (i = 1; i < 10; ++i) { + for (i = 1; i < 11; ++i) { fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); @@ -96,13 +95,11 @@ fe25519_sq(t3, t3); } fe25519_mul(t2, t3, t2); - fe25519_sq(t2, t2); - for (i = 1; i < 50; ++i) { + for (i = 1; i < 51; ++i) { fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); - fe25519_sq(t1, t1); - for (i = 1; i < 5; ++i) { + for (i = 1; i < 6; ++i) { fe25519_sq(t1, t1); } fe25519_mul(out, t1, t0); @@ -138,8 +135,7 @@ fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); - fe25519_sq(t1, t1); - for (i = 1; i < 10; ++i) { + for (i = 1; i < 11; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t0, t1, t0); @@ -153,8 +149,7 @@ fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); - fe25519_sq(t1, t1); - for (i = 1; i < 50; ++i) { + for (i = 1; i < 51; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t0, t1, t0); @@ -179,6 +174,55 @@ fe25519_cneg(h, f, fe25519_isnegative(f)); } +static inline void +fe25519_sqmul(fe25519 s, const int n, const fe25519 a) +{ + int i; + + for (i = 0; i < n; i++) { + fe25519_sq(s, s); + } + fe25519_mul(s, s, a); +} + +static unsigned int +fe25519_notsquare(const fe25519 x) +{ + fe25519 _10, _11, _1100, _1111, _11110000, _11111111; + fe25519 t, u, v; + unsigned char s[32]; + + /* Jacobi symbol - x^((p-1)/2) */ + fe25519_mul(_10, x, x); + fe25519_mul(_11, x, _10); + fe25519_sq(_1100, _11); + fe25519_sq(_1100, _1100); + fe25519_mul(_1111, _11, _1100); + fe25519_sq(_11110000, _1111); + fe25519_sq(_11110000, _11110000); + fe25519_sq(_11110000, _11110000); + fe25519_sq(_11110000, _11110000); + fe25519_mul(_11111111, _1111, _11110000); + fe25519_copy(t, _11111111); + fe25519_sqmul(t, 2, _11); + fe25519_copy(u, t); + fe25519_sqmul(t, 10, u); + fe25519_sqmul(t, 10, u); + fe25519_copy(v, t); + fe25519_sqmul(t, 30, v); + fe25519_copy(v, t); + fe25519_sqmul(t, 60, v); + fe25519_copy(v, t); + fe25519_sqmul(t, 120, v); + fe25519_sqmul(t, 10, u); + fe25519_sqmul(t, 3, _11); + fe25519_sq(t, t); + + fe25519_tobytes(s, t); + + return s[1] & 1; +} + /* r = p + q */ @@ -2071,46 +2115,52 @@ void sc25519_invert(unsigned char recip[32], const unsigned char s[32]) { - unsigned char _10[32], _100[32], _11[32], _101[32], _111[32], - _1001[32], _1011[32], _1111[32]; + unsigned char _10[32], _100[32], _1000[32], _10000[32], _100000[32], + _1000000[32], _10010011[32], _10010111[32], _100110[32], _1010[32], + _1010000[32], _1010011[32], _1011[32], _10110[32], _10111101[32], + _11[32], _1100011[32], _1100111[32], _11010011[32], _1101011[32], + _11100111[32], _11101011[32], _11110101[32]; sc25519_sq(_10, s); - sc25519_sq(_100, _10); - sc25519_mul(_11, _10, s); - sc25519_mul(_101, _10, _11); - sc25519_mul(_111, _10, _101); - sc25519_mul(_1001, _10, _111); - sc25519_mul(_1011, _10, _1001); - sc25519_mul(_1111, _100, _1011); - sc25519_mul(recip, _1111, s); - - sc25519_sqmul(recip, 123 + 3, _101); - sc25519_sqmul(recip, 2 + 2, _11); - sc25519_sqmul(recip, 1 + 4, _1111); - sc25519_sqmul(recip, 1 + 4, _1111); - sc25519_sqmul(recip, 4, _1001); - sc25519_sqmul(recip, 2, _11); - sc25519_sqmul(recip, 1 + 4, _1111); - sc25519_sqmul(recip, 1 + 3, _101); - sc25519_sqmul(recip, 3 + 3, _101); - sc25519_sqmul(recip, 3, _111); - sc25519_sqmul(recip, 1 + 4, _1111); - sc25519_sqmul(recip, 2 + 3, _111); - sc25519_sqmul(recip, 2 + 2, _11); - sc25519_sqmul(recip, 1 + 4, _1011); - sc25519_sqmul(recip, 2 + 4, _1011); - sc25519_sqmul(recip, 6 + 4, _1001); - sc25519_sqmul(recip, 2 + 2, _11); - sc25519_sqmul(recip, 3 + 2, _11); - sc25519_sqmul(recip, 3 + 2, _11); - sc25519_sqmul(recip, 1 + 4, _1001); - sc25519_sqmul(recip, 1 + 3, _111); - sc25519_sqmul(recip, 2 + 4, _1111); - sc25519_sqmul(recip, 1 + 4, _1011); - sc25519_sqmul(recip, 3, _101); - sc25519_sqmul(recip, 2 + 4, _1111); - sc25519_sqmul(recip, 3, _101); - sc25519_sqmul(recip, 1 + 2, _11); + sc25519_mul(_11, s, _10); + sc25519_mul(_100, s, _11); + sc25519_sq(_1000, _100); + sc25519_mul(_1010, _10, _1000); + sc25519_mul(_1011, s, _1010); + sc25519_sq(_10000, _1000); + sc25519_sq(_10110, _1011); + sc25519_mul(_100000, _1010, _10110); + sc25519_mul(_100110, _10000, _10110); + sc25519_sq(_1000000, _100000); + sc25519_mul(_1010000, _10000, _1000000); + sc25519_mul(_1010011, _11, _1010000); + sc25519_mul(_1100011, _10000, _1010011); + sc25519_mul(_1100111, _100, _1100011); + sc25519_mul(_1101011, _100, _1100111); + sc25519_mul(_10010011, _1000000, _1010011); + sc25519_mul(_10010111, _100, _10010011); + sc25519_mul(_10111101, _100110, _10010111); + sc25519_mul(_11010011, _10110, _10111101); + sc25519_mul(_11100111, _1010000, _10010111); + sc25519_mul(_11101011, _100, _11100111); + sc25519_mul(_11110101, _1010, _11101011); + + sc25519_mul(recip, _1011, _11110101); + sc25519_sqmul(recip, 126, _1010011); + sc25519_sqmul(recip, 9, _10); + sc25519_mul(recip, recip, _11110101); + sc25519_sqmul(recip, 7, _1100111); + sc25519_sqmul(recip, 9, _11110101); + sc25519_sqmul(recip, 11, _10111101); + sc25519_sqmul(recip, 8, _11100111); + sc25519_sqmul(recip, 9, _1101011); + sc25519_sqmul(recip, 6, _1011); + sc25519_sqmul(recip, 14, _10010011); + sc25519_sqmul(recip, 10, _1100011); + sc25519_sqmul(recip, 9, _10010111); + sc25519_sqmul(recip, 10, _11110101); + sc25519_sqmul(recip, 8, _11010011); + sc25519_sqmul(recip, 8, _11101011); } /* @@ -2470,93 +2520,34 @@ } static void -chi25519(fe25519 out, const fe25519 z) -{ - fe25519 t0, t1, t2, t3; - int i; - - fe25519_sq(t0, z); - fe25519_mul(t1, t0, z); - fe25519_sq(t0, t1); - fe25519_sq(t2, t0); - fe25519_sq(t2, t2); - fe25519_mul(t2, t2, t0); - fe25519_mul(t1, t2, z); - fe25519_sq(t2, t1); - - for (i = 1; i < 5; i++) { - fe25519_sq(t2, t2); - } - fe25519_mul(t1, t2, t1); - fe25519_sq(t2, t1); - for (i = 1; i < 10; i++) { - fe25519_sq(t2, t2); - } - fe25519_mul(t2, t2, t1); - fe25519_sq(t3, t2); - for (i = 1; i < 20; i++) { - fe25519_sq(t3, t3); - } - fe25519_mul(t2, t3, t2); - fe25519_sq(t2, t2); - for (i = 1; i < 10; i++) { - fe25519_sq(t2, t2); - } - fe25519_mul(t1, t2, t1); - fe25519_sq(t2, t1); - for (i = 1; i < 50; i++) { - fe25519_sq(t2, t2); - } - fe25519_mul(t2, t2, t1); - fe25519_sq(t3, t2); - for (i = 1; i < 100; i++) { - fe25519_sq(t3, t3); - } - fe25519_mul(t2, t3, t2); - fe25519_sq(t2, t2); - for (i = 1; i < 50; i++) { - fe25519_sq(t2, t2); - } - fe25519_mul(t1, t2, t1); - fe25519_sq(t1, t1); - for (i = 1; i < 4; i++) { - fe25519_sq(t1, t1); - } - fe25519_mul(out, t1, t0); -} - -static void ge25519_elligator2(unsigned char s[32], const fe25519 r, const unsigned char x_sign) { - fe25519 e; + fe25519 gx; fe25519 negx; fe25519 rr2; fe25519 x, x2, x3; ge25519_p3 p3; ge25519_p1p1 p1; ge25519_p2 p2; - unsigned int e_is_minus_1; + unsigned int notsquare; fe25519_sq2(rr2, r); rr2[0]++; fe25519_invert(rr2, rr2); - fe25519_mul(x, curve25519_A, rr2); + fe25519_mul32(x, rr2, curve25519_A[0]); fe25519_neg(x, x); fe25519_sq(x2, x); fe25519_mul(x3, x, x2); - fe25519_add(e, x3, x); - fe25519_mul(x2, x2, curve25519_A); - fe25519_add(e, x2, e); - - chi25519(e, e); + fe25519_add(gx, x3, x); + fe25519_mul32(x2, x2, curve25519_A[0]); + fe25519_add(gx, x2, gx); - fe25519_tobytes(s, e); - e_is_minus_1 = s[1] & 1; + notsquare = fe25519_notsquare(gx); fe25519_neg(negx, x); - fe25519_cmov(x, negx, e_is_minus_1); + fe25519_cmov(x, negx, notsquare); fe25519_0(x2); - fe25519_cmov(x2, curve25519_A, e_is_minus_1); + fe25519_cmov(x2, curve25519_A, notsquare); fe25519_sub(x, x, x2); /* yed = (x-1)/(x+1) */ @@ -2675,6 +2666,7 @@ { unsigned char c; unsigned char d; + unsigned char e; unsigned int i; c = (s[31] & 0x7f) ^ 0x7f; @@ -2683,8 +2675,9 @@ } c = (((unsigned int) c) - 1U) >> 8; d = (0xed - 1U - (unsigned int) s[0]) >> 8; + e = s[31] >> 7; - return 1 - (((c & d) | s[0]) & 1); + return 1 - (((c & d) | e | s[0]) & 1); } int @@ -2773,7 +2766,7 @@ fe25519_mul(ix, h->X, sqrtm1); /* ix = X*sqrt(-1) */ fe25519_mul(iy, h->Y, sqrtm1); /* iy = Y*sqrt(-1) */ - fe25519_mul(eden, den1, invsqrtamd); /* eden = den1*sqrt(a-d) */ + fe25519_mul(eden, den1, invsqrtamd); /* eden = den1/sqrt(a-d) */ fe25519_mul(t_z_inv, h->T, z_inv); /* t_z_inv = T*z_inv */ rotate = fe25519_isnegative(t_z_inv); @@ -2816,7 +2809,7 @@ fe25519_mul(u, u, onemsqd); /* u = (r+1)*(1-d^2) */ fe25519_1(c); fe25519_neg(c, c); /* c = -1 */ - fe25519_add(rpd, r, d); /* rpd = r*d */ + fe25519_add(rpd, r, d); /* rpd = r+d */ fe25519_mul(v, r, d); /* v = r*d */ fe25519_sub(v, c, v); /* v = c-r*d */ fe25519_mul(v, v, rpd); /* v = (c-r*d)*(r+d) */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-avx2.c 2022-01-07 21:54:10.000000000 +0000 @@ -8,7 +8,6 @@ #include "blake2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) @@ -24,6 +23,7 @@ # include # include # include +# include "private/sse2_64_32.h" # include "blake2b-compress-avx2.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-sse41.c 2022-01-07 21:54:10.000000000 +0000 @@ -7,7 +7,6 @@ #include "blake2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && \ defined(HAVE_SMMINTRIN_H) @@ -21,6 +20,7 @@ # include # include # include +# include "private/sse2_64_32.h" # include "blake2b-compress-sse41.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2b-compress-ssse3.c 2022-01-07 21:54:10.000000000 +0000 @@ -4,7 +4,6 @@ #include "blake2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) @@ -15,6 +14,7 @@ # include # include +# include "private/sse2_64_32.h" # include "blake2b-compress-ssse3.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_generichash/blake2b/ref/blake2.h 2022-01-07 21:54:10.000000000 +0000 @@ -23,20 +23,6 @@ #include "crypto_generichash_blake2b.h" #include "export.h" -#define blake2b_init_param crypto_generichash_blake2b__init_param -#define blake2b_init crypto_generichash_blake2b__init -#define blake2b_init_salt_personal \ - crypto_generichash_blake2b__init_salt_personal -#define blake2b_init_key crypto_generichash_blake2b__init_key -#define blake2b_init_key_salt_personal \ - crypto_generichash_blake2b__init_key_salt_personal -#define blake2b_update crypto_generichash_blake2b__update -#define blake2b_final crypto_generichash_blake2b__final -#define blake2b crypto_generichash_blake2b__blake2b -#define blake2b_salt_personal crypto_generichash_blake2b__blake2b_salt_personal -#define blake2b_pick_best_implementation \ - crypto_generichash_blake2b__pick_best_implementation - enum blake2b_constant { BLAKE2B_BLOCKBYTES = 128, BLAKE2B_OUTBYTES = 64, @@ -45,10 +31,12 @@ BLAKE2B_PERSONALBYTES = 16 }; -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -#pragma pack(1) +#ifdef __IBMC__ +# pragma pack(1) +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# pragma pack(1) #else -#pragma pack(push, 1) +# pragma pack(push, 1) #endif typedef struct blake2b_param_ { @@ -74,10 +62,12 @@ uint8_t last_node; } blake2b_state; -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) -#pragma pack() +#ifdef __IBMC__ +# pragma pack(pop) +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# pragma pack() #else -#pragma pack(pop) +# pragma pack(pop) #endif /* Streaming API */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_onetimeauth/poly1305/sse2/poly1305_sse2.c 2022-01-07 21:54:10.000000000 +0000 @@ -6,7 +6,6 @@ #include "crypto_verify_16.h" #include "poly1305_sse2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "utils.h" #if defined(HAVE_TI_MODE) && defined(HAVE_EMMINTRIN_H) @@ -16,6 +15,7 @@ # endif # include +# include "private/sse2_64_32.h" typedef __m128i xmmi; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.c 2022-01-07 21:54:10.000000000 +0000 @@ -27,7 +27,7 @@ argon2_ctx(argon2_context *context, argon2_type type) { /* 1. Validate all inputs */ - int result = validate_inputs(context); + int result = argon2_validate_inputs(context); uint32_t memory_blocks, segment_length; uint32_t pass; argon2_instance_t instance; @@ -65,7 +65,7 @@ /* 3. Initialization: Hashing inputs, allocating memory, filling first * blocks */ - result = initialize(&instance, context); + result = argon2_initialize(&instance, context); if (ARGON2_OK != result) { return result; @@ -73,11 +73,11 @@ /* 4. Filling memory */ for (pass = 0; pass < instance.passes; pass++) { - fill_memory_blocks(&instance, pass); + argon2_fill_memory_blocks(&instance, pass); } /* 5. Finalization */ - finalize(context, &instance); + argon2_finalize(context, &instance); return ARGON2_OK; } @@ -134,14 +134,10 @@ return result; } - /* if raw hash requested, write it */ - if (hash) { - memcpy(hash, out, hashlen); - } - /* if encoding requested, write it */ if (encoded && encodedlen) { - if (encode_string(encoded, encodedlen, &context, type) != ARGON2_OK) { + if (argon2_encode_string(encoded, encodedlen, + &context, type) != ARGON2_OK) { sodium_memzero(out, hashlen); sodium_memzero(encoded, encodedlen); free(out); @@ -149,6 +145,11 @@ } } + /* if raw hash requested, write it */ + if (hash) { + memcpy(hash, out, hashlen); + } + sodium_memzero(out, hashlen); free(out); @@ -214,7 +215,7 @@ ctx.secret = NULL; ctx.secretlen = 0; - /* max values, to be updated in decode_string */ + /* max values, to be updated in argon2_decode_string */ encoded_len = strlen(encoded); if (encoded_len > UINT32_MAX) { return ARGON2_DECODING_LENGTH_FAIL; @@ -240,7 +241,7 @@ return ARGON2_MEMORY_ALLOCATION_ERROR; } - decode_result = decode_string(&ctx, encoded, type); + decode_result = argon2_decode_string(&ctx, encoded, type); if (decode_result != ARGON2_OK) { free(ctx.ad); free(ctx.salt); diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.c 2022-01-07 21:54:10.000000000 +0000 @@ -35,13 +35,17 @@ # define MAP_ANON MAP_ANONYMOUS #endif #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #ifndef MAP_POPULATE # define MAP_POPULATE 0 #endif -static fill_segment_fn fill_segment = fill_segment_ref; +static fill_segment_fn fill_segment = argon2_fill_segment_ref; static void load_block(block *dst, const void *input) @@ -72,7 +76,7 @@ static int allocate_memory(block_region **region, uint32_t m_cost) { - void * base; + void *base; block *memory; size_t memory_size; @@ -95,12 +99,12 @@ -1, 0)) == MAP_FAILED) { base = NULL; /* LCOV_EXCL_LINE */ } /* LCOV_EXCL_LINE */ - memcpy(&memory, &base, sizeof memory); + memory = (block *) base; #elif defined(HAVE_POSIX_MEMALIGN) if ((errno = posix_memalign((void **) &base, 64, memory_size)) != 0) { base = NULL; } - memcpy(&memory, &base, sizeof memory); + memory = (block *) base; #else memory = NULL; if (memory_size + 63 < memory_size) { @@ -109,7 +113,7 @@ } else if ((base = malloc(memory_size + 63)) != NULL) { uint8_t *aligned = ((uint8_t *) base) + 63; aligned -= (uintptr_t) aligned & 63; - memcpy(&memory, &aligned, sizeof memory); + memory = (block *) aligned; } #endif if (base == NULL) { @@ -171,8 +175,8 @@ free(region); } -void -free_instance(argon2_instance_t *instance, int flags) +static void +argon2_free_instance(argon2_instance_t *instance, int flags) { /* Clear memory */ clear_memory(instance, flags & ARGON2_FLAG_CLEAR_MEMORY); @@ -185,7 +189,7 @@ } void -finalize(const argon2_context *context, argon2_instance_t *instance) +argon2_finalize(const argon2_context *context, argon2_instance_t *instance) { if (context != NULL && instance != NULL) { block blockhash; @@ -214,12 +218,12 @@ ARGON2_BLOCK_SIZE); /* clear blockhash_bytes */ } - free_instance(instance, context->flags); + argon2_free_instance(instance, context->flags); } } void -fill_memory_blocks(argon2_instance_t *instance, uint32_t pass) +argon2_fill_memory_blocks(argon2_instance_t *instance, uint32_t pass) { argon2_position_t position; uint32_t l; @@ -241,7 +245,7 @@ } int -validate_inputs(const argon2_context *context) +argon2_validate_inputs(const argon2_context *context) { /* LCOV_EXCL_START */ if (NULL == context) { @@ -321,6 +325,15 @@ } } + /* Validate lanes */ + if (ARGON2_MIN_LANES > context->lanes) { + return ARGON2_LANES_TOO_FEW; + } + + if (ARGON2_MAX_LANES < context->lanes) { + return ARGON2_LANES_TOO_MANY; + } + /* Validate memory cost */ if (ARGON2_MIN_MEMORY > context->m_cost) { return ARGON2_MEMORY_TOO_LITTLE; @@ -343,15 +356,6 @@ return ARGON2_TIME_TOO_LARGE; } - /* Validate lanes */ - if (ARGON2_MIN_LANES > context->lanes) { - return ARGON2_LANES_TOO_FEW; - } - - if (ARGON2_MAX_LANES < context->lanes) { - return ARGON2_LANES_TOO_MANY; - } - /* Validate threads */ if (ARGON2_MIN_THREADS > context->threads) { return ARGON2_THREADS_TOO_FEW; @@ -365,8 +369,8 @@ return ARGON2_OK; } -void -fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) +static void +argon2_fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance) { uint32_t l; /* Make the first and second block in each lane as G(H0||i||0) or @@ -389,8 +393,9 @@ sodium_memzero(blockhash_bytes, ARGON2_BLOCK_SIZE); } -void -initial_hash(uint8_t *blockhash, argon2_context *context, argon2_type type) +static void +argon2_initial_hash(uint8_t *blockhash, argon2_context *context, + argon2_type type) { crypto_generichash_blake2b_state BlakeHash; uint8_t value[4U /* sizeof(uint32_t) */]; @@ -473,7 +478,7 @@ } int -initialize(argon2_instance_t *instance, argon2_context *context) +argon2_initialize(argon2_instance_t *instance, argon2_context *context) { uint8_t blockhash[ARGON2_PREHASH_SEED_LENGTH]; int result = ARGON2_OK; @@ -491,7 +496,7 @@ result = allocate_memory(&(instance->region), instance->memory_blocks); if (ARGON2_OK != result) { - free_instance(instance, context->flags); + argon2_free_instance(instance, context->flags); return result; } @@ -499,45 +504,46 @@ /* H_0 + 8 extra bytes to produce the first blocks */ /* uint8_t blockhash[ARGON2_PREHASH_SEED_LENGTH]; */ /* Hashing all inputs */ - initial_hash(blockhash, context, instance->type); + argon2_initial_hash(blockhash, context, instance->type); /* Zeroing 8 extra bytes */ sodium_memzero(blockhash + ARGON2_PREHASH_DIGEST_LENGTH, ARGON2_PREHASH_SEED_LENGTH - ARGON2_PREHASH_DIGEST_LENGTH); /* 3. Creating first blocks, we always have at least two blocks in a slice */ - fill_first_blocks(blockhash, instance); + argon2_fill_first_blocks(blockhash, instance); /* Clearing the hash */ sodium_memzero(blockhash, ARGON2_PREHASH_SEED_LENGTH); return ARGON2_OK; } -int +static int argon2_pick_best_implementation(void) { /* LCOV_EXCL_START */ #if defined(HAVE_AVX512FINTRIN_H) && defined(HAVE_AVX2INTRIN_H) && \ - defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) + defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) && \ + !defined(__APPLE__) if (sodium_runtime_has_avx512f()) { - fill_segment = fill_segment_avx512f; + fill_segment = argon2_fill_segment_avx512f; return 0; } #endif #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_TMMINTRIN_H) && \ defined(HAVE_SMMINTRIN_H) if (sodium_runtime_has_avx2()) { - fill_segment = fill_segment_avx2; + fill_segment = argon2_fill_segment_avx2; return 0; } #endif #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) if (sodium_runtime_has_ssse3()) { - fill_segment = fill_segment_ssse3; + fill_segment = argon2_fill_segment_ssse3; return 0; } #endif - fill_segment = fill_segment_ref; + fill_segment = argon2_fill_segment_ref; return 0; /* LCOV_EXCL_STOP */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-core.h 2022-01-07 21:54:10.000000000 +0000 @@ -214,28 +214,7 @@ * @return ARGON2_OK if everything is all right, otherwise one of error codes * (all defined in */ -int validate_inputs(const argon2_context *context); - -/* - * Hashes all the inputs into @a blockhash[PREHASH_DIGEST_LENGTH], clears - * password and secret if needed - * @param context Pointer to the Argon2 internal structure containing memory - * pointer, and parameters for time and space requirements. - * @param blockhash Buffer for pre-hashing digest - * @param type Argon2 type - * @pre @a blockhash must have at least @a PREHASH_DIGEST_LENGTH bytes - * allocated - */ -void initial_hash(uint8_t *blockhash, argon2_context *context, - argon2_type type); - -/* - * Function creates first 2 blocks per lane - * @param instance Pointer to the current instance - * @param blockhash Pointer to the pre-hashing digest - * @pre blockhash must point to @a PREHASH_SEED_LENGTH allocated values - */ -void fill_first_blocks(uint8_t *blockhash, const argon2_instance_t *instance); +int argon2_validate_inputs(const argon2_context *context); /* * Function allocates memory, hashes the inputs with Blake, and creates first @@ -247,12 +226,7 @@ * @return Zero if successful, -1 if memory failed to allocate. @context->state * will be modified if successful. */ -int initialize(argon2_instance_t *instance, argon2_context *context); - -/* - * Deallocates memory. Used on error path. - */ -void free_instance(argon2_instance_t *instance, int flags); +int argon2_initialize(argon2_instance_t *instance, argon2_context *context); /* * XORing the last block of each lane, hashing it, making the tag. Deallocates @@ -265,7 +239,8 @@ * @pre if context->free_cbk is not NULL, it should point to a function that * deallocates memory */ -void finalize(const argon2_context *context, argon2_instance_t *instance); +void argon2_finalize(const argon2_context *context, + argon2_instance_t *instance); /* * Function that fills the segment using previous segments also from other @@ -276,15 +251,14 @@ */ typedef void (*fill_segment_fn)(const argon2_instance_t *instance, argon2_position_t position); -int argon2_pick_best_implementation(void); -void fill_segment_avx512f(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_avx2(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_ssse3(const argon2_instance_t *instance, - argon2_position_t position); -void fill_segment_ref(const argon2_instance_t *instance, - argon2_position_t position); +void argon2_fill_segment_avx512f(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_avx2(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_ssse3(const argon2_instance_t *instance, + argon2_position_t position); +void argon2_fill_segment_ref(const argon2_instance_t *instance, + argon2_position_t position); /* * Function that fills the entire memory t_cost times based on the first two @@ -292,6 +266,6 @@ * @param instance Pointer to the current instance * @return Zero if successful, -1 if memory failed to allocate */ -void fill_memory_blocks(argon2_instance_t *instance, uint32_t pass); +void argon2_fill_memory_blocks(argon2_instance_t *instance, uint32_t pass); #endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.c 2022-01-07 21:54:10.000000000 +0000 @@ -83,7 +83,7 @@ * output length must be in the allowed ranges defined in argon2.h. * * The ctx struct must contain buffers large enough to hold the salt and pwd - * when it is fed into decode_string. + * when it is fed into argon2_decode_string. */ /* @@ -91,7 +91,7 @@ * Returned value is ARGON2_OK on success. */ int -decode_string(argon2_context *ctx, const char *str, argon2_type type) +argon2_decode_string(argon2_context *ctx, const char *str, argon2_type type) { /* Prefix checking */ #define CC(prefix) \ @@ -193,7 +193,7 @@ BIN(ctx->salt, maxsaltlen, ctx->saltlen); CC("$"); BIN(ctx->out, maxoutlen, ctx->outlen); - validation_result = validate_inputs(ctx); + validation_result = argon2_validate_inputs(ctx); if (validation_result != ARGON2_OK) { return validation_result; } @@ -238,7 +238,8 @@ * On success, ARGON2_OK is returned. */ int -encode_string(char *dst, size_t dst_len, argon2_context *ctx, argon2_type type) +argon2_encode_string(char *dst, size_t dst_len, argon2_context *ctx, + argon2_type type) { #define SS(str) \ do { \ @@ -280,7 +281,7 @@ default: return ARGON2_ENCODING_FAIL; } - validation_result = validate_inputs(ctx); + validation_result = argon2_validate_inputs(ctx); if (validation_result != ARGON2_OK) { return validation_result; } diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-encoding.h 2022-01-07 21:54:10.000000000 +0000 @@ -17,8 +17,8 @@ * * No other parameters are checked */ -int encode_string(char *dst, size_t dst_len, argon2_context *ctx, - argon2_type type); +int argon2_encode_string(char *dst, size_t dst_len, argon2_context *ctx, + argon2_type type); /* * Decodes an Argon2 hash string into the provided structure 'ctx'. @@ -28,6 +28,7 @@ * * Returned value is ARGON2_OK on success. */ -int decode_string(argon2_context *ctx, const char *str, argon2_type type); +int argon2_decode_string(argon2_context *ctx, const char *str, + argon2_type type); #endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx2.c 2022-01-07 21:54:10.000000000 +0000 @@ -18,7 +18,6 @@ #include "argon2-core.h" #include "argon2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) @@ -33,10 +32,11 @@ # ifdef _MSC_VER # include /* for _mm_set_epi64x */ # endif -#include -#include -#include -#include +# include +# include +# include +# include +# include "private/sse2_64_32.h" # include "blamka-round-avx2.h" @@ -141,8 +141,8 @@ } void -fill_segment_avx2(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_avx2(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-avx512f.c 2022-01-07 21:54:10.000000000 +0000 @@ -18,7 +18,6 @@ #include "argon2-core.h" #include "argon2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_AVX512FINTRIN_H) && defined(HAVE_AVX2INTRIN_H) && \ defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H) @@ -34,10 +33,11 @@ # ifdef _MSC_VER # include /* for _mm_set_epi64x */ # endif -#include -#include -#include -#include +# include +# include +# include +# include +# include "private/sse2_64_32.h" # include "blamka-round-avx512f.h" @@ -146,8 +146,8 @@ } void -fill_segment_avx512f(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_avx512f(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ref.c 2022-01-07 21:54:10.000000000 +0000 @@ -141,7 +141,8 @@ } void -fill_segment_ref(const argon2_instance_t *instance, argon2_position_t position) +argon2_fill_segment_ref(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; /* Pseudo-random values that determine the reference block position */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2-fill-block-ssse3.c 2022-01-07 21:54:10.000000000 +0000 @@ -18,7 +18,6 @@ #include "argon2-core.h" #include "argon2.h" #include "private/common.h" -#include "private/sse2_64_32.h" #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) @@ -32,6 +31,7 @@ # endif # include # include +# include "private/sse2_64_32.h" # include "blamka-round-ssse3.h" @@ -140,8 +140,8 @@ } void -fill_segment_ssse3(const argon2_instance_t *instance, - argon2_position_t position) +argon2_fill_segment_ssse3(const argon2_instance_t *instance, + argon2_position_t position) { block *ref_block = NULL, *curr_block = NULL; uint64_t pseudo_rand, ref_index, ref_lane; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/argon2.h 2022-01-07 21:54:10.000000000 +0000 @@ -283,7 +283,7 @@ /** * Verifies a password against an encoded string - * Encoded string is restricted as in validate_inputs() + * Encoded string is restricted as in argon2_validate_inputs() * @param encoded String encoding parameters, salt, hash * @param pwd Pointer to password * @pre Returns ARGON2_OK if successful @@ -292,7 +292,7 @@ /** * Verifies a password against an encoded string - * Encoded string is restricted as in validate_inputs() + * Encoded string is restricted as in argon2_validate_inputs() * @param encoded String encoding parameters, salt, hash * @param pwd Pointer to password * @pre Returns ARGON2_OK if successful diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2i.c 2022-01-07 21:54:10.000000000 +0000 @@ -163,6 +163,10 @@ errno = EINVAL; return -1; } + if ((const void *) out == (const void *) passwd) { + errno = EINVAL; + return -1; + } switch (alg) { case crypto_pwhash_argon2i_ALG_ARGON2I13: if (argon2i_hash_raw((uint32_t) opslimit, (uint32_t) (memlimit / 1024U), @@ -261,7 +265,7 @@ ctx.outlen = ctx.pwdlen = ctx.saltlen = (uint32_t) fodder_len; ctx.ad = ctx.secret = NULL; ctx.adlen = ctx.secretlen = 0U; - if (decode_string(&ctx, str, type) != 0) { + if (argon2_decode_string(&ctx, str, type) != 0) { errno = EINVAL; ret = -1; } else if (ctx.t_cost != (uint32_t) opslimit || diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/argon2/pwhash_argon2id.c 2022-01-07 21:54:10.000000000 +0000 @@ -159,6 +159,10 @@ errno = EINVAL; return -1; } + if ((const void *) out == (const void *) passwd) { + errno = EINVAL; + return -1; + } switch (alg) { case crypto_pwhash_argon2id_ALG_ARGON2ID13: if (argon2id_hash_raw((uint32_t) opslimit, (uint32_t) (memlimit / 1024U), diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/crypto_scrypt.h 2022-01-07 21:54:10.000000000 +0000 @@ -61,38 +61,38 @@ typedef escrypt_region_t escrypt_local_t; -extern int escrypt_init_local(escrypt_local_t *__local); +int escrypt_init_local(escrypt_local_t *__local); -extern int escrypt_free_local(escrypt_local_t *__local); +int escrypt_free_local(escrypt_local_t *__local); -extern void *alloc_region(escrypt_region_t *region, size_t size); -extern int free_region(escrypt_region_t *region); +void *escrypt_alloc_region(escrypt_region_t *region, size_t size); +int escrypt_free_region(escrypt_region_t *region); typedef int (*escrypt_kdf_t)(escrypt_local_t *__local, const uint8_t *__passwd, size_t __passwdlen, const uint8_t *__salt, size_t __saltlen, uint64_t __N, uint32_t __r, uint32_t __p, uint8_t *__buf, size_t __buflen); -extern int escrypt_kdf_nosse(escrypt_local_t *__local, const uint8_t *__passwd, - size_t __passwdlen, const uint8_t *__salt, - size_t __saltlen, uint64_t __N, uint32_t __r, - uint32_t __p, uint8_t *__buf, size_t __buflen); - -extern int escrypt_kdf_sse(escrypt_local_t *__local, const uint8_t *__passwd, - size_t __passwdlen, const uint8_t *__salt, - size_t __saltlen, uint64_t __N, uint32_t __r, - uint32_t __p, uint8_t *__buf, size_t __buflen); - -extern uint8_t *escrypt_r(escrypt_local_t *__local, const uint8_t *__passwd, - size_t __passwdlen, const uint8_t *__setting, - uint8_t *__buf, size_t __buflen); - -extern uint8_t *escrypt_gensalt_r(uint32_t __N_log2, uint32_t __r, uint32_t __p, - const uint8_t *__src, size_t __srclen, - uint8_t *__buf, size_t __buflen); - -extern const uint8_t *escrypt_parse_setting(const uint8_t *setting, - uint32_t *N_log2_p, uint32_t *r_p, - uint32_t *p_p); +int escrypt_kdf_nosse(escrypt_local_t *__local, const uint8_t *__passwd, + size_t __passwdlen, const uint8_t *__salt, + size_t __saltlen, uint64_t __N, uint32_t __r, + uint32_t __p, uint8_t *__buf, size_t __buflen); + +int escrypt_kdf_sse(escrypt_local_t *__local, const uint8_t *__passwd, + size_t __passwdlen, const uint8_t *__salt, + size_t __saltlen, uint64_t __N, uint32_t __r, + uint32_t __p, uint8_t *__buf, size_t __buflen); + +uint8_t *escrypt_r(escrypt_local_t *__local, const uint8_t *__passwd, + size_t __passwdlen, const uint8_t *__setting, + uint8_t *__buf, size_t __buflen); + +uint8_t *escrypt_gensalt_r(uint32_t __N_log2, uint32_t __r, uint32_t __p, + const uint8_t *__src, size_t __srclen, + uint8_t *__buf, size_t __buflen); + +const uint8_t *escrypt_parse_setting(const uint8_t *setting, + uint32_t *N_log2_p, uint32_t *r_p, + uint32_t *p_p); #endif /* !_CRYPTO_SCRYPT_H_ */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c 2022-01-07 21:54:10.000000000 +0000 @@ -106,7 +106,7 @@ #endif } -/** +/* * salsa20_8(B): * Apply the salsa20/8 core to the provided block. */ @@ -168,11 +168,12 @@ } } -/** +/* * blockmix_salsa8(Bin, Bout, X, r): - * Compute Bout = BlockMix_{salsa20/8, r}(Bin). The input Bin must be 128r - * bytes in length; the output Bout must also be the same size. The - * temporary space X must be 64 bytes. + * Compute Bout = BlockMix_{salsa20/8, r}(Bin). + * The input Bin must be 128r bytes in length; + * The output Bout must also be the same size. + * The temporary space X must be 64 bytes. */ static void blockmix_salsa8(const uint32_t *Bin, uint32_t *Bout, uint32_t *X, size_t r) @@ -207,19 +208,19 @@ } } -/** +/* * integerify(B, r): * Return the result of parsing B_{2r-1} as a little-endian integer. */ static inline uint64_t integerify(const void *B, size_t r) { - const uint32_t *X = (const uint32_t *) ((uintptr_t)(B) + (2 * r - 1) * 64); + const uint32_t *X = ((const uint32_t *) B) + (2 * r - 1) * 16; - return (((uint64_t)(X[1]) << 32) + X[0]); + return ((uint64_t) (X[1]) << 32) + X[0]; } -/** +/* * smix(B, r, N, V, XY): * Compute B = SMix_r(B, N). The input B must be 128r bytes in length; * the temporary storage V must be 128rN bytes in length; the temporary @@ -282,7 +283,7 @@ } } -/** +/* * escrypt_kdf(local, passwd, passwdlen, salt, saltlen, * N, r, p, buf, buflen): * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, @@ -305,10 +306,6 @@ uint32_t i; /* Sanity-check parameters. */ - if (r == 0 || p == 0) { - errno = EINVAL; - return -1; - } #if SIZE_MAX > UINT32_MAX if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { errno = EFBIG; @@ -355,10 +352,10 @@ return -1; } if (local->size < need) { - if (free_region(local)) { + if (escrypt_free_region(local)) { return -1; } - if (!alloc_region(local, need)) { + if (!escrypt_alloc_region(local, need)) { return -1; } } @@ -367,7 +364,7 @@ XY = (uint32_t *) ((uint8_t *) V + V_size); /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ - PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); + escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); /* 2: for i = 0 to p - 1 do */ for (i = 0; i < p; i++) { @@ -376,7 +373,7 @@ } /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ - PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); + escrypt_PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); /* Success! */ return 0; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c 2022-01-07 21:54:10.000000000 +0000 @@ -39,13 +39,14 @@ #include "utils.h" /** - * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). */ void -PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt, - size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen) +escrypt_PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, + const uint8_t *salt, size_t saltlen, uint64_t c, + uint8_t *buf, size_t dkLen) { crypto_auth_hmacsha256_state PShctx, hctx; size_t i; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h 2022-01-07 21:54:10.000000000 +0000 @@ -35,11 +35,11 @@ #include "crypto_auth_hmacsha256.h" /** - * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). */ -void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, - uint8_t *, size_t); +void escrypt_PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, + uint64_t, uint8_t *, size_t); #endif /* !_SHA256_H_ */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pwhash_scryptsalsa208sha256.c 2022-01-07 21:54:10.000000000 +0000 @@ -176,6 +176,10 @@ errno = EINVAL; /* LCOV_EXCL_LINE */ return -1; /* LCOV_EXCL_LINE */ } + if ((const void *) out == (const void *) passwd) { + errno = EINVAL; + return -1; + } return crypto_pwhash_scryptsalsa208sha256_ll( (const uint8_t *) passwd, (size_t) passwdlen, (const uint8_t *) salt, crypto_pwhash_scryptsalsa208sha256_SALTBYTES, (uint64_t)(1) << N_log2, diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/scrypt_platform.c 2022-01-07 21:54:10.000000000 +0000 @@ -31,14 +31,18 @@ # define MAP_ANON MAP_ANONYMOUS #endif #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #ifndef MAP_POPULATE # define MAP_POPULATE 0 #endif void * -alloc_region(escrypt_region_t *region, size_t size) +escrypt_alloc_region(escrypt_region_t *region, size_t size) { uint8_t *base, *aligned; #if defined(MAP_ANON) && defined(HAVE_MMAP) @@ -77,7 +81,7 @@ } int -free_region(escrypt_region_t *region) +escrypt_free_region(escrypt_region_t *region) { if (region->base) { #if defined(MAP_ANON) && defined(HAVE_MMAP) @@ -104,5 +108,5 @@ int escrypt_free_local(escrypt_local_t *local) { - return free_region(local); + return escrypt_free_region(local); } diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c 2022-01-07 21:54:10.000000000 +0000 @@ -35,7 +35,6 @@ #include #include "private/common.h" -#include "private/sse2_64_32.h" #ifdef HAVE_EMMINTRIN_H @@ -46,21 +45,17 @@ # if defined(__XOP__) && defined(DISABLED) # include # endif +# include "private/sse2_64_32.h" # include "../crypto_scrypt.h" # include "../pbkdf2-sha256.h" -# if defined(__XOP__) && defined(DISABLED) -# define ARX(out, in1, in2, s) \ - out = _mm_xor_si128(out, _mm_roti_epi32(_mm_add_epi32(in1, in2), s)); -# else -# define ARX(out, in1, in2, s) \ +# define ARX(out, in1, in2, s) \ { \ __m128i T = _mm_add_epi32(in1, in2); \ out = _mm_xor_si128(out, _mm_slli_epi32(T, s)); \ out = _mm_xor_si128(out, _mm_srli_epi32(T, 32 - s)); \ } -# endif # define SALSA20_2ROUNDS \ /* Operate on "columns". */ \ @@ -85,7 +80,7 @@ X2 = _mm_shuffle_epi32(X2, 0x4E); \ X3 = _mm_shuffle_epi32(X3, 0x93); -/** +/* * Apply the salsa20/8 core to the block provided in (X0 ... X3) ^ (Z0 ... Z3). */ # define SALSA20_8_XOR(in, out) \ @@ -103,10 +98,11 @@ (out)[3] = X3 = _mm_add_epi32(X3, Y3); \ } -/** +/* * blockmix_salsa8(Bin, Bout, r): - * Compute Bout = BlockMix_{salsa20/8, r}(Bin). The input Bin must be 128r - * bytes in length; the output Bout must also be the same size. + * Compute Bout = BlockMix_{salsa20/8, r}(Bin). + * The input Bin must be 128r bytes in length; + * the output Bout must also be the same size. */ static inline void blockmix_salsa8(const __m128i *Bin, __m128i *Bout, size_t r) @@ -208,18 +204,20 @@ # undef XOR4 # undef XOR4_2 -/** +/* * integerify(B, r): * Return the result of parsing B_{2r-1} as a little-endian integer. * Note that B's layout is permuted compared to the generic implementation. */ -static inline uint32_t +static inline uint64_t integerify(const void *B, size_t r) { - return *(const uint32_t *) ((uintptr_t)(B) + (2 * r - 1) * 64); + const uint64_t *X = ((const uint64_t *) B) + (2 * r - 1) * 8; + + return *X; } -/** +/* * smix(B, r, N, V, XY): * Compute B = SMix_r(B, N). The input B must be 128r bytes in length; * the temporary storage V must be 128rN bytes in length; the temporary @@ -228,12 +226,12 @@ * multiple of 64 bytes. */ static void -smix(uint8_t *B, size_t r, uint32_t N, void *V, void *XY) +smix(uint8_t *B, size_t r, uint64_t N, void *V, void *XY) { size_t s = 128 * r; - __m128i * X = (__m128i *) V, *Y; + __m128i *X = (__m128i *) V, *Y; uint32_t *X32 = (uint32_t *) V; - uint32_t i, j; + uint64_t i, j; size_t k; /* 1: X <-- B */ @@ -295,7 +293,7 @@ } } -/** +/* * escrypt_kdf(local, passwd, passwdlen, salt, saltlen, * N, r, p, buf, buflen): * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, @@ -317,10 +315,6 @@ uint32_t i; /* Sanity-check parameters. */ - if (r == 0 || p == 0) { - errno = EINVAL; - return -1; - } # if SIZE_MAX > UINT32_MAX /* LCOV_EXCL_START */ if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { @@ -375,10 +369,10 @@ } /* LCOV_EXCL_END */ if (local->size < need) { - if (free_region(local)) { + if (escrypt_free_region(local)) { return -1; /* LCOV_EXCL_LINE */ } - if (!alloc_region(local, need)) { + if (!escrypt_alloc_region(local, need)) { return -1; /* LCOV_EXCL_LINE */ } } @@ -387,16 +381,16 @@ XY = (uint32_t *) ((uint8_t *) V + V_size); /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ - PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); + escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); /* 2: for i = 0 to p - 1 do */ for (i = 0; i < p; i++) { /* 3: B_i <-- MF(B_i, N) */ - smix(&B[(size_t) 128 * i * r], r, (uint32_t) N, V, XY); + smix(&B[(size_t) 128 * i * r], r, N, V, XY); } /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ - PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); + escrypt_PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); /* Success! */ return 0; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c 2022-01-07 21:54:10.000000000 +0000 @@ -123,7 +123,7 @@ fe25519_mul(x2, tmp1, tmp0); fe25519_sub(tmp1, tmp1, tmp0); fe25519_sq(z2, z2); - fe25519_scalar_product(z3, tmp1, 121666); + fe25519_mul32(z3, tmp1, 121666); fe25519_sq(x3, x3); fe25519_add(tmp0, tmp0, z3); fe25519_mul(z3, x1, z2); diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/curve25519_sandy2x.c 2022-01-07 21:54:10.000000000 +0000 @@ -15,7 +15,6 @@ #include "fe.h" #include "fe51.h" #include "ladder.h" -#include "ladder_base.h" #define x1 var[0] #define x2 var[1] @@ -61,54 +60,10 @@ return 0; } -#undef x2 -#undef z2 - -#define x2 var[0] -#define z2 var[1] - -static int -crypto_scalarmult_curve25519_sandy2x_base(unsigned char *q, - const unsigned char *n) -{ - unsigned char *t = q; - fe var[3]; - fe51 x_51; - fe51 z_51; - unsigned int i; - - for (i = 0;i < 32; i++) { - t[i] = n[i]; - } - t[0] &= 248; - t[31] &= 127; - t[31] |= 64; - - ladder_base(var, t); - - z_51.v[0] = (z2[1] << 26) + z2[0]; - z_51.v[1] = (z2[3] << 26) + z2[2]; - z_51.v[2] = (z2[5] << 26) + z2[4]; - z_51.v[3] = (z2[7] << 26) + z2[6]; - z_51.v[4] = (z2[9] << 26) + z2[8]; - - x_51.v[0] = (x2[1] << 26) + x2[0]; - x_51.v[1] = (x2[3] << 26) + x2[2]; - x_51.v[2] = (x2[5] << 26) + x2[4]; - x_51.v[3] = (x2[7] << 26) + x2[6]; - x_51.v[4] = (x2[9] << 26) + x2[8]; - - fe51_invert(&z_51, &z_51); - fe51_mul(&x_51, &x_51, &z_51); - fe51_pack(q, &x_51); - - return 0; -} - struct crypto_scalarmult_curve25519_implementation crypto_scalarmult_curve25519_sandy2x_implementation = { SODIUM_C99(.mult = ) crypto_scalarmult_curve25519_sandy2x, - SODIUM_C99(.mult_base = ) crypto_scalarmult_curve25519_sandy2x_base + SODIUM_C99(.mult_base = ) NULL }; #endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,18 +0,0 @@ -#ifndef ladder_base_H -#define ladder_base_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "fe.h" -#include "ladder_base_namespace.h" - -extern void ladder_base(fe *, const unsigned char *); - -#ifdef __cplusplus -} -#endif - -#endif /* ifndef ladder_base_H */ - diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -#ifndef ladder_base_namespace_H -#define ladder_base_namespace_H - -#define ladder_base crypto_scalarmult_curve25519_sandy2x_ladder_base -#define _ladder_base _crypto_scalarmult_curve25519_sandy2x_ladder_base - -#endif /* ifndef ladder_base_namespace_H */ - diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S 1970-01-01 00:00:00.000000000 +0000 @@ -1,1295 +0,0 @@ -#ifdef IN_SANDY2X - -#include "ladder_base_namespace.h" -#include "consts_namespace.h" -.p2align 5 - -#ifdef ASM_HIDE_SYMBOL -ASM_HIDE_SYMBOL ladder_base -ASM_HIDE_SYMBOL _ladder_base -#endif -.globl ladder_base -.globl _ladder_base -#ifdef __ELF__ -.type ladder_base, @function -.type _ladder_base, @function -#endif -ladder_base: -_ladder_base: - -mov %rsp,%r11 -and $31,%r11 -add $1568,%r11 -sub %r11,%rsp -movq %r11,1536(%rsp) -movq %r12,1544(%rsp) -movq %r13,1552(%rsp) -vmovdqa v0_0(%rip),%xmm0 -vmovdqa v1_0(%rip),%xmm1 -vmovdqa v9_0(%rip),%xmm2 -vmovdqa %xmm2,0(%rsp) -vmovdqa %xmm0,16(%rsp) -vmovdqa %xmm0,32(%rsp) -vmovdqa %xmm0,48(%rsp) -vmovdqa %xmm0,64(%rsp) -vmovdqa %xmm1,80(%rsp) -vmovdqa %xmm0,96(%rsp) -vmovdqa %xmm0,112(%rsp) -vmovdqa %xmm0,128(%rsp) -vmovdqa %xmm0,144(%rsp) -vmovdqa %xmm1,%xmm0 -vpxor %xmm1,%xmm1,%xmm1 -vpxor %xmm2,%xmm2,%xmm2 -vpxor %xmm3,%xmm3,%xmm3 -vpxor %xmm4,%xmm4,%xmm4 -vpxor %xmm5,%xmm5,%xmm5 -vpxor %xmm6,%xmm6,%xmm6 -vpxor %xmm7,%xmm7,%xmm7 -vpxor %xmm8,%xmm8,%xmm8 -vpxor %xmm9,%xmm9,%xmm9 -movq 0(%rsi),%rdx -movq 8(%rsi),%rcx -movq 16(%rsi),%r8 -movq 24(%rsi),%r9 -shrd $1,%rcx,%rdx -shrd $1,%r8,%rcx -shrd $1,%r9,%r8 -shr $1,%r9 -xorq 0(%rsi),%rdx -xorq 8(%rsi),%rcx -xorq 16(%rsi),%r8 -xorq 24(%rsi),%r9 -leaq 512(%rsp),%rsi -mov $64,%rax - -.p2align 4 -._ladder_base_small_loop: -mov %rdx,%r10 -mov %rcx,%r11 -mov %r8,%r12 -mov %r9,%r13 -shr $1,%rdx -shr $1,%rcx -shr $1,%r8 -shr $1,%r9 -and $1,%r10d -and $1,%r11d -and $1,%r12d -and $1,%r13d -neg %r10 -neg %r11 -neg %r12 -neg %r13 -movl %r10d,0(%rsi) -movl %r11d,256(%rsi) -movl %r12d,512(%rsi) -movl %r13d,768(%rsi) -add $4,%rsi -sub $1,%rax -jne ._ladder_base_small_loop -mov $255,%rdx -add $760,%rsi - -.p2align 4 -._ladder_base_loop: -sub $1,%rdx -vbroadcastss 0(%rsi),%xmm10 -sub $4,%rsi -vmovdqa 0(%rsp),%xmm11 -vmovdqa 80(%rsp),%xmm12 -vpxor %xmm11,%xmm0,%xmm13 -vpand %xmm10,%xmm13,%xmm13 -vpxor %xmm13,%xmm0,%xmm0 -vpxor %xmm13,%xmm11,%xmm11 -vpxor %xmm12,%xmm1,%xmm13 -vpand %xmm10,%xmm13,%xmm13 -vpxor %xmm13,%xmm1,%xmm1 -vpxor %xmm13,%xmm12,%xmm12 -vmovdqa 16(%rsp),%xmm13 -vmovdqa 96(%rsp),%xmm14 -vpxor %xmm13,%xmm2,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm2,%xmm2 -vpxor %xmm15,%xmm13,%xmm13 -vpxor %xmm14,%xmm3,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm3,%xmm3 -vpxor %xmm15,%xmm14,%xmm14 -vmovdqa %xmm13,0(%rsp) -vmovdqa %xmm14,16(%rsp) -vmovdqa 32(%rsp),%xmm13 -vmovdqa 112(%rsp),%xmm14 -vpxor %xmm13,%xmm4,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm4,%xmm4 -vpxor %xmm15,%xmm13,%xmm13 -vpxor %xmm14,%xmm5,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm5,%xmm5 -vpxor %xmm15,%xmm14,%xmm14 -vmovdqa %xmm13,32(%rsp) -vmovdqa %xmm14,80(%rsp) -vmovdqa 48(%rsp),%xmm13 -vmovdqa 128(%rsp),%xmm14 -vpxor %xmm13,%xmm6,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm6,%xmm6 -vpxor %xmm15,%xmm13,%xmm13 -vpxor %xmm14,%xmm7,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm7,%xmm7 -vpxor %xmm15,%xmm14,%xmm14 -vmovdqa %xmm13,48(%rsp) -vmovdqa %xmm14,96(%rsp) -vmovdqa 64(%rsp),%xmm13 -vmovdqa 144(%rsp),%xmm14 -vpxor %xmm13,%xmm8,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm8,%xmm8 -vpxor %xmm15,%xmm13,%xmm13 -vpxor %xmm14,%xmm9,%xmm15 -vpand %xmm10,%xmm15,%xmm15 -vpxor %xmm15,%xmm9,%xmm9 -vpxor %xmm15,%xmm14,%xmm14 -vmovdqa %xmm13,64(%rsp) -vmovdqa %xmm14,112(%rsp) -vpaddq subc0(%rip),%xmm11,%xmm10 -vpsubq %xmm12,%xmm10,%xmm10 -vpaddq %xmm12,%xmm11,%xmm11 -vpunpckhqdq %xmm10,%xmm11,%xmm12 -vpunpcklqdq %xmm10,%xmm11,%xmm10 -vpaddq %xmm1,%xmm0,%xmm11 -vpaddq subc0(%rip),%xmm0,%xmm0 -vpsubq %xmm1,%xmm0,%xmm0 -vpunpckhqdq %xmm11,%xmm0,%xmm1 -vpunpcklqdq %xmm11,%xmm0,%xmm0 -vpmuludq %xmm0,%xmm10,%xmm11 -vpmuludq %xmm1,%xmm10,%xmm13 -vmovdqa %xmm1,128(%rsp) -vpaddq %xmm1,%xmm1,%xmm1 -vpmuludq %xmm0,%xmm12,%xmm14 -vmovdqa %xmm0,144(%rsp) -vpaddq %xmm14,%xmm13,%xmm13 -vpmuludq %xmm1,%xmm12,%xmm0 -vmovdqa %xmm1,160(%rsp) -vpaddq %xmm3,%xmm2,%xmm1 -vpaddq subc2(%rip),%xmm2,%xmm2 -vpsubq %xmm3,%xmm2,%xmm2 -vpunpckhqdq %xmm1,%xmm2,%xmm3 -vpunpcklqdq %xmm1,%xmm2,%xmm1 -vpmuludq %xmm1,%xmm10,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vpmuludq %xmm3,%xmm10,%xmm2 -vmovdqa %xmm3,176(%rsp) -vpaddq %xmm3,%xmm3,%xmm3 -vpmuludq %xmm1,%xmm12,%xmm14 -vmovdqa %xmm1,192(%rsp) -vpaddq %xmm14,%xmm2,%xmm2 -vpmuludq %xmm3,%xmm12,%xmm1 -vmovdqa %xmm3,208(%rsp) -vpaddq %xmm5,%xmm4,%xmm3 -vpaddq subc2(%rip),%xmm4,%xmm4 -vpsubq %xmm5,%xmm4,%xmm4 -vpunpckhqdq %xmm3,%xmm4,%xmm5 -vpunpcklqdq %xmm3,%xmm4,%xmm3 -vpmuludq %xmm3,%xmm10,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vpmuludq %xmm5,%xmm10,%xmm4 -vmovdqa %xmm5,224(%rsp) -vpaddq %xmm5,%xmm5,%xmm5 -vpmuludq %xmm3,%xmm12,%xmm14 -vmovdqa %xmm3,240(%rsp) -vpaddq %xmm14,%xmm4,%xmm4 -vpaddq %xmm7,%xmm6,%xmm3 -vpaddq subc2(%rip),%xmm6,%xmm6 -vpsubq %xmm7,%xmm6,%xmm6 -vpunpckhqdq %xmm3,%xmm6,%xmm7 -vpunpcklqdq %xmm3,%xmm6,%xmm3 -vpmuludq %xmm3,%xmm10,%xmm6 -vpmuludq %xmm5,%xmm12,%xmm14 -vmovdqa %xmm5,256(%rsp) -vpmuludq v19_19(%rip),%xmm5,%xmm5 -vmovdqa %xmm5,272(%rsp) -vpaddq %xmm14,%xmm6,%xmm6 -vpmuludq %xmm7,%xmm10,%xmm5 -vmovdqa %xmm7,288(%rsp) -vpaddq %xmm7,%xmm7,%xmm7 -vpmuludq %xmm3,%xmm12,%xmm14 -vmovdqa %xmm3,304(%rsp) -vpaddq %xmm14,%xmm5,%xmm5 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vmovdqa %xmm3,320(%rsp) -vpaddq %xmm9,%xmm8,%xmm3 -vpaddq subc2(%rip),%xmm8,%xmm8 -vpsubq %xmm9,%xmm8,%xmm8 -vpunpckhqdq %xmm3,%xmm8,%xmm9 -vpunpcklqdq %xmm3,%xmm8,%xmm3 -vmovdqa %xmm3,336(%rsp) -vpmuludq %xmm7,%xmm12,%xmm8 -vmovdqa %xmm7,352(%rsp) -vpmuludq v19_19(%rip),%xmm7,%xmm7 -vmovdqa %xmm7,368(%rsp) -vpmuludq %xmm3,%xmm10,%xmm7 -vpaddq %xmm7,%xmm8,%xmm8 -vpmuludq %xmm9,%xmm10,%xmm7 -vmovdqa %xmm9,384(%rsp) -vpaddq %xmm9,%xmm9,%xmm9 -vpmuludq %xmm3,%xmm12,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vmovdqa %xmm3,400(%rsp) -vpmuludq v19_19(%rip),%xmm12,%xmm12 -vpmuludq %xmm9,%xmm12,%xmm3 -vmovdqa %xmm9,416(%rsp) -vpaddq %xmm3,%xmm11,%xmm11 -vmovdqa 0(%rsp),%xmm3 -vmovdqa 16(%rsp),%xmm9 -vpaddq subc2(%rip),%xmm3,%xmm10 -vpsubq %xmm9,%xmm10,%xmm10 -vpaddq %xmm9,%xmm3,%xmm3 -vpunpckhqdq %xmm10,%xmm3,%xmm9 -vpunpcklqdq %xmm10,%xmm3,%xmm3 -vpmuludq 144(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm0,%xmm0 -vpmuludq 128(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm2,%xmm2 -vpmuludq 192(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpmuludq 176(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm4,%xmm4 -vpmuludq 240(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm6,%xmm6 -vpmuludq 224(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm5,%xmm5 -vpmuludq 304(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpmuludq 288(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vpmuludq 336(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm11,%xmm11 -vpmuludq 384(%rsp),%xmm3,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 144(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpmuludq 160(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm1,%xmm1 -vpmuludq 192(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpmuludq 208(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpmuludq 240(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 256(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm8,%xmm8 -vpmuludq 304(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm9,%xmm9 -vpmuludq 352(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 336(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 416(%rsp),%xmm9,%xmm9 -vpaddq %xmm9,%xmm0,%xmm0 -vmovdqa 32(%rsp),%xmm3 -vmovdqa 80(%rsp),%xmm9 -vpaddq subc2(%rip),%xmm3,%xmm10 -vpsubq %xmm9,%xmm10,%xmm10 -vpaddq %xmm9,%xmm3,%xmm3 -vpunpckhqdq %xmm10,%xmm3,%xmm9 -vpunpcklqdq %xmm10,%xmm3,%xmm3 -vpmuludq 144(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpmuludq 128(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm4,%xmm4 -vpmuludq 192(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm6,%xmm6 -vpmuludq 176(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm5,%xmm5 -vpmuludq 240(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpmuludq 224(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vpmuludq 304(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm11,%xmm11 -vpmuludq 288(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm13,%xmm13 -vpmuludq 336(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm0,%xmm0 -vpmuludq 384(%rsp),%xmm3,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpmuludq 144(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpmuludq 160(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpmuludq 192(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 208(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm8,%xmm8 -vpmuludq 240(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm9,%xmm9 -vpmuludq 256(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 304(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 352(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm0,%xmm0 -vpmuludq 336(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpmuludq 416(%rsp),%xmm9,%xmm9 -vpaddq %xmm9,%xmm1,%xmm1 -vmovdqa 48(%rsp),%xmm3 -vmovdqa 96(%rsp),%xmm9 -vpaddq subc2(%rip),%xmm3,%xmm10 -vpsubq %xmm9,%xmm10,%xmm10 -vpaddq %xmm9,%xmm3,%xmm3 -vpunpckhqdq %xmm10,%xmm3,%xmm9 -vpunpcklqdq %xmm10,%xmm3,%xmm3 -vpmuludq 144(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm6,%xmm6 -vpmuludq 128(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm5,%xmm5 -vpmuludq 192(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpmuludq 176(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vpmuludq 240(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm11,%xmm11 -vpmuludq 224(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm13,%xmm13 -vpmuludq 304(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm0,%xmm0 -vpmuludq 288(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm2,%xmm2 -vpmuludq 336(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpmuludq 384(%rsp),%xmm3,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpmuludq 144(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 160(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm8,%xmm8 -vpmuludq 192(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm9,%xmm9 -vpmuludq 208(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 240(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 256(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm0,%xmm0 -vpmuludq 304(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpmuludq 352(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm1,%xmm1 -vpmuludq 336(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpmuludq 416(%rsp),%xmm9,%xmm9 -vpaddq %xmm9,%xmm6,%xmm6 -vmovdqa 64(%rsp),%xmm3 -vmovdqa 112(%rsp),%xmm9 -vpaddq subc2(%rip),%xmm3,%xmm10 -vpsubq %xmm9,%xmm10,%xmm10 -vpaddq %xmm9,%xmm3,%xmm3 -vpunpckhqdq %xmm10,%xmm3,%xmm9 -vpunpcklqdq %xmm10,%xmm3,%xmm3 -vpmuludq 144(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpmuludq 128(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm3,%xmm3 -vpmuludq 192(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm11,%xmm11 -vpmuludq 176(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm13,%xmm13 -vpmuludq 240(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm0,%xmm0 -vpmuludq 224(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm2,%xmm2 -vpmuludq 304(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpmuludq 288(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm4,%xmm4 -vpmuludq 336(%rsp),%xmm3,%xmm10 -vpaddq %xmm10,%xmm6,%xmm6 -vpmuludq 384(%rsp),%xmm3,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 144(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq v19_19(%rip),%xmm9,%xmm9 -vpmuludq 160(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 192(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 208(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm0,%xmm0 -vpmuludq 240(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpmuludq 256(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm1,%xmm1 -vpmuludq 304(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpmuludq 352(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpmuludq 336(%rsp),%xmm9,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 416(%rsp),%xmm9,%xmm9 -vpaddq %xmm9,%xmm8,%xmm8 -vpsrlq $25,%xmm4,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpand m25(%rip),%xmm4,%xmm4 -vpsrlq $26,%xmm11,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpand m26(%rip),%xmm11,%xmm11 -vpsrlq $26,%xmm6,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpand m26(%rip),%xmm6,%xmm6 -vpsrlq $25,%xmm13,%xmm3 -vpaddq %xmm3,%xmm0,%xmm0 -vpand m25(%rip),%xmm13,%xmm13 -vpsrlq $25,%xmm5,%xmm3 -vpaddq %xmm3,%xmm8,%xmm8 -vpand m25(%rip),%xmm5,%xmm5 -vpsrlq $26,%xmm0,%xmm3 -vpaddq %xmm3,%xmm2,%xmm2 -vpand m26(%rip),%xmm0,%xmm0 -vpsrlq $26,%xmm8,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpand m26(%rip),%xmm8,%xmm8 -vpsrlq $25,%xmm2,%xmm3 -vpaddq %xmm3,%xmm1,%xmm1 -vpand m25(%rip),%xmm2,%xmm2 -vpsrlq $25,%xmm7,%xmm3 -vpsllq $4,%xmm3,%xmm9 -vpaddq %xmm3,%xmm11,%xmm11 -vpsllq $1,%xmm3,%xmm3 -vpaddq %xmm3,%xmm9,%xmm9 -vpaddq %xmm9,%xmm11,%xmm11 -vpand m25(%rip),%xmm7,%xmm7 -vpsrlq $26,%xmm1,%xmm3 -vpaddq %xmm3,%xmm4,%xmm4 -vpand m26(%rip),%xmm1,%xmm1 -vpsrlq $26,%xmm11,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpand m26(%rip),%xmm11,%xmm11 -vpsrlq $25,%xmm4,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpand m25(%rip),%xmm4,%xmm4 -vpunpcklqdq %xmm13,%xmm11,%xmm3 -vpunpckhqdq %xmm13,%xmm11,%xmm9 -vpaddq subc0(%rip),%xmm9,%xmm10 -vpsubq %xmm3,%xmm10,%xmm10 -vpaddq %xmm9,%xmm3,%xmm3 -vpunpckhqdq %xmm3,%xmm10,%xmm9 -vpunpcklqdq %xmm3,%xmm10,%xmm10 -vpmuludq %xmm10,%xmm10,%xmm3 -vpaddq %xmm10,%xmm10,%xmm10 -vpmuludq %xmm9,%xmm10,%xmm11 -vpunpcklqdq %xmm2,%xmm0,%xmm12 -vpunpckhqdq %xmm2,%xmm0,%xmm0 -vpaddq subc2(%rip),%xmm0,%xmm2 -vpsubq %xmm12,%xmm2,%xmm2 -vpaddq %xmm0,%xmm12,%xmm12 -vpunpckhqdq %xmm12,%xmm2,%xmm0 -vpunpcklqdq %xmm12,%xmm2,%xmm2 -vpmuludq %xmm2,%xmm10,%xmm12 -vpaddq %xmm9,%xmm9,%xmm13 -vpmuludq %xmm13,%xmm9,%xmm9 -vpaddq %xmm9,%xmm12,%xmm12 -vpmuludq %xmm0,%xmm10,%xmm9 -vpmuludq %xmm2,%xmm13,%xmm14 -vpaddq %xmm14,%xmm9,%xmm9 -vpunpcklqdq %xmm4,%xmm1,%xmm14 -vpunpckhqdq %xmm4,%xmm1,%xmm1 -vpaddq subc2(%rip),%xmm1,%xmm4 -vpsubq %xmm14,%xmm4,%xmm4 -vpaddq %xmm1,%xmm14,%xmm14 -vpunpckhqdq %xmm14,%xmm4,%xmm1 -vpunpcklqdq %xmm14,%xmm4,%xmm4 -vmovdqa %xmm1,0(%rsp) -vpaddq %xmm1,%xmm1,%xmm1 -vmovdqa %xmm1,16(%rsp) -vpmuludq v19_19(%rip),%xmm1,%xmm1 -vmovdqa %xmm1,32(%rsp) -vpmuludq %xmm4,%xmm10,%xmm1 -vpmuludq %xmm2,%xmm2,%xmm14 -vpaddq %xmm14,%xmm1,%xmm1 -vpmuludq 0(%rsp),%xmm10,%xmm14 -vpmuludq %xmm4,%xmm13,%xmm15 -vpaddq %xmm15,%xmm14,%xmm14 -vpunpcklqdq %xmm5,%xmm6,%xmm15 -vpunpckhqdq %xmm5,%xmm6,%xmm5 -vpaddq subc2(%rip),%xmm5,%xmm6 -vpsubq %xmm15,%xmm6,%xmm6 -vpaddq %xmm5,%xmm15,%xmm15 -vpunpckhqdq %xmm15,%xmm6,%xmm5 -vpunpcklqdq %xmm15,%xmm6,%xmm6 -vmovdqa %xmm6,48(%rsp) -vpmuludq v19_19(%rip),%xmm6,%xmm6 -vmovdqa %xmm6,64(%rsp) -vmovdqa %xmm5,80(%rsp) -vpmuludq v38_38(%rip),%xmm5,%xmm5 -vmovdqa %xmm5,96(%rsp) -vpmuludq 48(%rsp),%xmm10,%xmm5 -vpaddq %xmm0,%xmm0,%xmm6 -vpmuludq %xmm6,%xmm0,%xmm0 -vpaddq %xmm0,%xmm5,%xmm5 -vpmuludq 80(%rsp),%xmm10,%xmm0 -vpmuludq %xmm4,%xmm6,%xmm15 -vpaddq %xmm15,%xmm0,%xmm0 -vpmuludq %xmm6,%xmm13,%xmm15 -vpaddq %xmm15,%xmm1,%xmm1 -vpmuludq %xmm6,%xmm2,%xmm15 -vpaddq %xmm15,%xmm14,%xmm14 -vpunpcklqdq %xmm7,%xmm8,%xmm15 -vpunpckhqdq %xmm7,%xmm8,%xmm7 -vpaddq subc2(%rip),%xmm7,%xmm8 -vpsubq %xmm15,%xmm8,%xmm8 -vpaddq %xmm7,%xmm15,%xmm15 -vpunpckhqdq %xmm15,%xmm8,%xmm7 -vpunpcklqdq %xmm15,%xmm8,%xmm8 -vmovdqa %xmm8,112(%rsp) -vpmuludq v19_19(%rip),%xmm8,%xmm8 -vmovdqa %xmm8,160(%rsp) -vpmuludq 112(%rsp),%xmm10,%xmm8 -vpmuludq %xmm7,%xmm10,%xmm10 -vpmuludq v38_38(%rip),%xmm7,%xmm15 -vpmuludq %xmm15,%xmm7,%xmm7 -vpaddq %xmm7,%xmm8,%xmm8 -vpmuludq %xmm15,%xmm13,%xmm7 -vpaddq %xmm7,%xmm3,%xmm3 -vpmuludq %xmm15,%xmm2,%xmm7 -vpaddq %xmm7,%xmm11,%xmm11 -vpmuludq 80(%rsp),%xmm13,%xmm7 -vpaddq %xmm7,%xmm7,%xmm7 -vpaddq %xmm7,%xmm8,%xmm8 -vpmuludq 16(%rsp),%xmm13,%xmm7 -vpaddq %xmm7,%xmm5,%xmm5 -vpmuludq 48(%rsp),%xmm13,%xmm7 -vpaddq %xmm7,%xmm0,%xmm0 -vpmuludq 112(%rsp),%xmm13,%xmm7 -vpaddq %xmm7,%xmm10,%xmm10 -vpmuludq %xmm15,%xmm6,%xmm7 -vpaddq %xmm7,%xmm12,%xmm12 -vpmuludq %xmm15,%xmm4,%xmm7 -vpaddq %xmm7,%xmm9,%xmm9 -vpaddq %xmm2,%xmm2,%xmm2 -vpmuludq %xmm4,%xmm2,%xmm7 -vpaddq %xmm7,%xmm5,%xmm5 -vpmuludq 160(%rsp),%xmm2,%xmm7 -vpaddq %xmm7,%xmm3,%xmm3 -vpmuludq 160(%rsp),%xmm6,%xmm7 -vpaddq %xmm7,%xmm11,%xmm11 -vpmuludq 0(%rsp),%xmm2,%xmm7 -vpaddq %xmm7,%xmm0,%xmm0 -vpmuludq 48(%rsp),%xmm2,%xmm7 -vpaddq %xmm7,%xmm8,%xmm8 -vpmuludq 80(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 96(%rsp),%xmm4,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpmuludq %xmm4,%xmm4,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpaddq %xmm4,%xmm4,%xmm2 -vpmuludq 160(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm12,%xmm12 -vpmuludq 16(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vpmuludq 48(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm14,%xmm14 -vpmuludq 96(%rsp),%xmm6,%xmm4 -vpaddq %xmm4,%xmm3,%xmm3 -vmovdqa 16(%rsp),%xmm4 -vpmuludq 160(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm9,%xmm9 -vpmuludq 16(%rsp),%xmm6,%xmm4 -vpaddq %xmm4,%xmm8,%xmm8 -vpmuludq 48(%rsp),%xmm6,%xmm4 -vpaddq %xmm4,%xmm10,%xmm10 -vpmuludq 80(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm4,%xmm4 -vpaddq %xmm4,%xmm5,%xmm5 -vpmuludq 112(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm0,%xmm0 -vmovdqa 48(%rsp),%xmm4 -vpaddq %xmm4,%xmm4,%xmm4 -vpmuludq 160(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vmovdqa 80(%rsp),%xmm4 -vpaddq %xmm4,%xmm4,%xmm4 -vpmuludq 160(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm14,%xmm14 -vpmuludq 64(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm3,%xmm3 -vmovdqa 16(%rsp),%xmm4 -vpmuludq 64(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm11,%xmm11 -vmovdqa 16(%rsp),%xmm4 -vpmuludq 96(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm12,%xmm12 -vmovdqa 48(%rsp),%xmm4 -vpmuludq 96(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm9,%xmm9 -vpmuludq 0(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vmovdqa 32(%rsp),%xmm2 -vpmuludq 0(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm3,%xmm3 -vmovdqa 64(%rsp),%xmm2 -vpmuludq 48(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vmovdqa 96(%rsp),%xmm2 -vpmuludq 80(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm1,%xmm1 -vmovdqa 160(%rsp),%xmm2 -vpmuludq 112(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpsrlq $26,%xmm3,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpand m26(%rip),%xmm3,%xmm3 -vpsrlq $25,%xmm14,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpand m25(%rip),%xmm14,%xmm14 -vpsrlq $25,%xmm11,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpand m25(%rip),%xmm11,%xmm11 -vpsrlq $26,%xmm5,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vpand m26(%rip),%xmm5,%xmm5 -vpsrlq $26,%xmm12,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpand m26(%rip),%xmm12,%xmm12 -vpsrlq $25,%xmm0,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpand m25(%rip),%xmm0,%xmm0 -vpsrlq $25,%xmm9,%xmm2 -vpaddq %xmm2,%xmm1,%xmm1 -vpand m25(%rip),%xmm9,%xmm9 -vpsrlq $26,%xmm8,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpand m26(%rip),%xmm8,%xmm8 -vpsrlq $26,%xmm1,%xmm2 -vpaddq %xmm2,%xmm14,%xmm14 -vpand m26(%rip),%xmm1,%xmm1 -vpsrlq $25,%xmm10,%xmm2 -vpsllq $4,%xmm2,%xmm4 -vpaddq %xmm2,%xmm3,%xmm3 -vpsllq $1,%xmm2,%xmm2 -vpaddq %xmm2,%xmm4,%xmm4 -vpaddq %xmm4,%xmm3,%xmm3 -vpand m25(%rip),%xmm10,%xmm10 -vpsrlq $25,%xmm14,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpand m25(%rip),%xmm14,%xmm14 -vpsrlq $26,%xmm3,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpand m26(%rip),%xmm3,%xmm3 -vpunpckhqdq %xmm11,%xmm3,%xmm2 -vmovdqa %xmm2,0(%rsp) -vpunpcklqdq %xmm11,%xmm3,%xmm2 -vpmuludq v9_9(%rip),%xmm2,%xmm2 -vmovdqa %xmm2,80(%rsp) -vpunpckhqdq %xmm9,%xmm12,%xmm2 -vmovdqa %xmm2,16(%rsp) -vpunpcklqdq %xmm9,%xmm12,%xmm2 -vpmuludq v9_9(%rip),%xmm2,%xmm2 -vmovdqa %xmm2,96(%rsp) -vpunpckhqdq %xmm14,%xmm1,%xmm2 -vmovdqa %xmm2,32(%rsp) -vpunpcklqdq %xmm14,%xmm1,%xmm1 -vpmuludq v9_9(%rip),%xmm1,%xmm1 -vmovdqa %xmm1,112(%rsp) -vpunpckhqdq %xmm0,%xmm5,%xmm1 -vmovdqa %xmm1,48(%rsp) -vpunpcklqdq %xmm0,%xmm5,%xmm0 -vpmuludq v9_9(%rip),%xmm0,%xmm0 -vmovdqa %xmm0,160(%rsp) -vpunpckhqdq %xmm10,%xmm8,%xmm0 -vmovdqa %xmm0,64(%rsp) -vpunpcklqdq %xmm10,%xmm8,%xmm0 -vpmuludq v9_9(%rip),%xmm0,%xmm0 -vmovdqa %xmm0,208(%rsp) -vmovdqa 144(%rsp),%xmm0 -vpmuludq %xmm0,%xmm0,%xmm1 -vpaddq %xmm0,%xmm0,%xmm0 -vmovdqa 128(%rsp),%xmm2 -vpmuludq %xmm2,%xmm0,%xmm3 -vmovdqa 192(%rsp),%xmm4 -vpmuludq %xmm4,%xmm0,%xmm5 -vmovdqa 176(%rsp),%xmm6 -vpmuludq %xmm6,%xmm0,%xmm7 -vmovdqa 240(%rsp),%xmm8 -vpmuludq %xmm8,%xmm0,%xmm9 -vpmuludq 224(%rsp),%xmm0,%xmm10 -vpmuludq 304(%rsp),%xmm0,%xmm11 -vpmuludq 288(%rsp),%xmm0,%xmm12 -vpmuludq 336(%rsp),%xmm0,%xmm13 -vmovdqa 384(%rsp),%xmm14 -vpmuludq %xmm14,%xmm0,%xmm0 -vpmuludq v38_38(%rip),%xmm14,%xmm15 -vpmuludq %xmm15,%xmm14,%xmm14 -vpaddq %xmm14,%xmm13,%xmm13 -vpaddq %xmm6,%xmm6,%xmm14 -vpmuludq %xmm14,%xmm6,%xmm6 -vpaddq %xmm6,%xmm11,%xmm11 -vpaddq %xmm2,%xmm2,%xmm6 -vpmuludq %xmm6,%xmm2,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpmuludq %xmm15,%xmm6,%xmm2 -vpaddq %xmm2,%xmm1,%xmm1 -vpmuludq %xmm15,%xmm4,%xmm2 -vpaddq %xmm2,%xmm3,%xmm3 -vpmuludq 256(%rsp),%xmm6,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpmuludq 304(%rsp),%xmm6,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 352(%rsp),%xmm6,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpmuludq 336(%rsp),%xmm6,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vpmuludq %xmm4,%xmm6,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpmuludq %xmm14,%xmm6,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpmuludq %xmm8,%xmm6,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq %xmm15,%xmm14,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpmuludq %xmm15,%xmm8,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpmuludq %xmm4,%xmm4,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpmuludq %xmm14,%xmm4,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpaddq %xmm4,%xmm4,%xmm2 -vpmuludq %xmm8,%xmm2,%xmm4 -vpaddq %xmm4,%xmm11,%xmm11 -vpmuludq 400(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vpmuludq 400(%rsp),%xmm14,%xmm4 -vpaddq %xmm4,%xmm3,%xmm3 -vpmuludq 224(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm12,%xmm12 -vpmuludq 304(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm13,%xmm13 -vpmuludq 288(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vpmuludq 368(%rsp),%xmm8,%xmm2 -vpaddq %xmm2,%xmm3,%xmm3 -vpmuludq %xmm8,%xmm14,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq %xmm8,%xmm8,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpaddq %xmm8,%xmm8,%xmm2 -vpmuludq 400(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm5,%xmm5 -vpmuludq 256(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm9,%xmm9 -vpmuludq 304(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm10,%xmm10 -vpmuludq 368(%rsp),%xmm14,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vmovdqa 256(%rsp),%xmm4 -vpmuludq 400(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm7,%xmm7 -vpmuludq 256(%rsp),%xmm14,%xmm4 -vpaddq %xmm4,%xmm13,%xmm13 -vpmuludq 304(%rsp),%xmm14,%xmm4 -vpaddq %xmm4,%xmm0,%xmm0 -vpmuludq 352(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm11,%xmm11 -vpmuludq 336(%rsp),%xmm15,%xmm4 -vpaddq %xmm4,%xmm12,%xmm12 -vmovdqa 304(%rsp),%xmm4 -vpaddq %xmm4,%xmm4,%xmm4 -vpmuludq 400(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm9,%xmm9 -vpmuludq 320(%rsp),%xmm2,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vmovdqa 256(%rsp),%xmm4 -vpmuludq 320(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm3,%xmm3 -vmovdqa 256(%rsp),%xmm4 -vpmuludq 368(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm5,%xmm5 -vmovdqa 304(%rsp),%xmm4 -vpmuludq 368(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm7,%xmm7 -vmovdqa 352(%rsp),%xmm4 -vpmuludq 400(%rsp),%xmm4,%xmm4 -vpaddq %xmm4,%xmm10,%xmm10 -vpmuludq 224(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vmovdqa 272(%rsp),%xmm2 -vpmuludq 224(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm1,%xmm1 -vmovdqa 320(%rsp),%xmm2 -vpmuludq 304(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vmovdqa 368(%rsp),%xmm2 -vpmuludq 288(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vmovdqa 400(%rsp),%xmm2 -vpmuludq 336(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpsrlq $26,%xmm1,%xmm2 -vpaddq %xmm2,%xmm3,%xmm3 -vpand m26(%rip),%xmm1,%xmm1 -vpsrlq $25,%xmm10,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpand m25(%rip),%xmm10,%xmm10 -vpsrlq $25,%xmm3,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpand m25(%rip),%xmm3,%xmm3 -vpsrlq $26,%xmm11,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpand m26(%rip),%xmm11,%xmm11 -vpsrlq $26,%xmm5,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpand m26(%rip),%xmm5,%xmm5 -vpsrlq $25,%xmm12,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpand m25(%rip),%xmm12,%xmm12 -vpsrlq $25,%xmm7,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpand m25(%rip),%xmm7,%xmm7 -vpsrlq $26,%xmm13,%xmm2 -vpaddq %xmm2,%xmm0,%xmm0 -vpand m26(%rip),%xmm13,%xmm13 -vpsrlq $26,%xmm9,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpand m26(%rip),%xmm9,%xmm9 -vpsrlq $25,%xmm0,%xmm2 -vpsllq $4,%xmm2,%xmm4 -vpaddq %xmm2,%xmm1,%xmm1 -vpsllq $1,%xmm2,%xmm2 -vpaddq %xmm2,%xmm4,%xmm4 -vpaddq %xmm4,%xmm1,%xmm1 -vpand m25(%rip),%xmm0,%xmm0 -vpsrlq $25,%xmm10,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpand m25(%rip),%xmm10,%xmm10 -vpsrlq $26,%xmm1,%xmm2 -vpaddq %xmm2,%xmm3,%xmm3 -vpand m26(%rip),%xmm1,%xmm1 -vpunpckhqdq %xmm3,%xmm1,%xmm2 -vpunpcklqdq %xmm3,%xmm1,%xmm1 -vmovdqa %xmm1,176(%rsp) -vpaddq subc0(%rip),%xmm2,%xmm3 -vpsubq %xmm1,%xmm3,%xmm3 -vpunpckhqdq %xmm3,%xmm2,%xmm1 -vpunpcklqdq %xmm3,%xmm2,%xmm2 -vmovdqa %xmm2,192(%rsp) -vmovdqa %xmm1,224(%rsp) -vpsllq $1,%xmm1,%xmm1 -vmovdqa %xmm1,240(%rsp) -vpmuludq v121666_121666(%rip),%xmm3,%xmm3 -vmovdqa 80(%rsp),%xmm1 -vpunpcklqdq %xmm1,%xmm3,%xmm2 -vpunpckhqdq %xmm1,%xmm3,%xmm1 -vpunpckhqdq %xmm7,%xmm5,%xmm3 -vpunpcklqdq %xmm7,%xmm5,%xmm4 -vmovdqa %xmm4,256(%rsp) -vpaddq subc2(%rip),%xmm3,%xmm5 -vpsubq %xmm4,%xmm5,%xmm5 -vpunpckhqdq %xmm5,%xmm3,%xmm4 -vpunpcklqdq %xmm5,%xmm3,%xmm3 -vmovdqa %xmm3,272(%rsp) -vmovdqa %xmm4,288(%rsp) -vpsllq $1,%xmm4,%xmm4 -vmovdqa %xmm4,304(%rsp) -vpmuludq v121666_121666(%rip),%xmm5,%xmm5 -vmovdqa 96(%rsp),%xmm3 -vpunpcklqdq %xmm3,%xmm5,%xmm4 -vpunpckhqdq %xmm3,%xmm5,%xmm3 -vpunpckhqdq %xmm10,%xmm9,%xmm5 -vpunpcklqdq %xmm10,%xmm9,%xmm6 -vmovdqa %xmm6,320(%rsp) -vpaddq subc2(%rip),%xmm5,%xmm7 -vpsubq %xmm6,%xmm7,%xmm7 -vpunpckhqdq %xmm7,%xmm5,%xmm6 -vpunpcklqdq %xmm7,%xmm5,%xmm5 -vmovdqa %xmm5,336(%rsp) -vmovdqa %xmm6,352(%rsp) -vpsllq $1,%xmm6,%xmm6 -vmovdqa %xmm6,368(%rsp) -vpmuludq v121666_121666(%rip),%xmm7,%xmm7 -vmovdqa 112(%rsp),%xmm5 -vpunpcklqdq %xmm5,%xmm7,%xmm6 -vpunpckhqdq %xmm5,%xmm7,%xmm5 -vpunpckhqdq %xmm12,%xmm11,%xmm7 -vpunpcklqdq %xmm12,%xmm11,%xmm8 -vmovdqa %xmm8,384(%rsp) -vpaddq subc2(%rip),%xmm7,%xmm9 -vpsubq %xmm8,%xmm9,%xmm9 -vpunpckhqdq %xmm9,%xmm7,%xmm8 -vpunpcklqdq %xmm9,%xmm7,%xmm7 -vmovdqa %xmm7,400(%rsp) -vmovdqa %xmm8,416(%rsp) -vpsllq $1,%xmm8,%xmm8 -vmovdqa %xmm8,432(%rsp) -vpmuludq v121666_121666(%rip),%xmm9,%xmm9 -vmovdqa 160(%rsp),%xmm7 -vpunpcklqdq %xmm7,%xmm9,%xmm8 -vpunpckhqdq %xmm7,%xmm9,%xmm7 -vpunpckhqdq %xmm0,%xmm13,%xmm9 -vpunpcklqdq %xmm0,%xmm13,%xmm0 -vmovdqa %xmm0,160(%rsp) -vpaddq subc2(%rip),%xmm9,%xmm10 -vpsubq %xmm0,%xmm10,%xmm10 -vpunpckhqdq %xmm10,%xmm9,%xmm0 -vpunpcklqdq %xmm10,%xmm9,%xmm9 -vmovdqa %xmm9,448(%rsp) -vmovdqa %xmm0,464(%rsp) -vpsllq $1,%xmm0,%xmm0 -vmovdqa %xmm0,480(%rsp) -vpmuludq v121666_121666(%rip),%xmm10,%xmm10 -vmovdqa 208(%rsp),%xmm0 -vpunpcklqdq %xmm0,%xmm10,%xmm9 -vpunpckhqdq %xmm0,%xmm10,%xmm0 -vpsrlq $26,%xmm2,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpand m26(%rip),%xmm2,%xmm2 -vpsrlq $25,%xmm5,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpand m25(%rip),%xmm5,%xmm5 -vpsrlq $25,%xmm1,%xmm10 -vpaddq %xmm10,%xmm4,%xmm4 -vpand m25(%rip),%xmm1,%xmm1 -vpsrlq $26,%xmm8,%xmm10 -vpaddq %xmm10,%xmm7,%xmm7 -vpand m26(%rip),%xmm8,%xmm8 -vpsrlq $26,%xmm4,%xmm10 -vpaddq %xmm10,%xmm3,%xmm3 -vpand m26(%rip),%xmm4,%xmm4 -vpsrlq $25,%xmm7,%xmm10 -vpaddq %xmm10,%xmm9,%xmm9 -vpand m25(%rip),%xmm7,%xmm7 -vpsrlq $25,%xmm3,%xmm10 -vpaddq %xmm10,%xmm6,%xmm6 -vpand m25(%rip),%xmm3,%xmm3 -vpsrlq $26,%xmm9,%xmm10 -vpaddq %xmm10,%xmm0,%xmm0 -vpand m26(%rip),%xmm9,%xmm9 -vpsrlq $26,%xmm6,%xmm10 -vpaddq %xmm10,%xmm5,%xmm5 -vpand m26(%rip),%xmm6,%xmm6 -vpsrlq $25,%xmm0,%xmm10 -vpsllq $4,%xmm10,%xmm11 -vpaddq %xmm10,%xmm2,%xmm2 -vpsllq $1,%xmm10,%xmm10 -vpaddq %xmm10,%xmm11,%xmm11 -vpaddq %xmm11,%xmm2,%xmm2 -vpand m25(%rip),%xmm0,%xmm0 -vpsrlq $25,%xmm5,%xmm10 -vpaddq %xmm10,%xmm8,%xmm8 -vpand m25(%rip),%xmm5,%xmm5 -vpsrlq $26,%xmm2,%xmm10 -vpaddq %xmm10,%xmm1,%xmm1 -vpand m26(%rip),%xmm2,%xmm2 -vpunpckhqdq %xmm1,%xmm2,%xmm10 -vmovdqa %xmm10,80(%rsp) -vpunpcklqdq %xmm1,%xmm2,%xmm1 -vpunpckhqdq %xmm3,%xmm4,%xmm2 -vmovdqa %xmm2,96(%rsp) -vpunpcklqdq %xmm3,%xmm4,%xmm2 -vpunpckhqdq %xmm5,%xmm6,%xmm3 -vmovdqa %xmm3,112(%rsp) -vpunpcklqdq %xmm5,%xmm6,%xmm3 -vpunpckhqdq %xmm7,%xmm8,%xmm4 -vmovdqa %xmm4,128(%rsp) -vpunpcklqdq %xmm7,%xmm8,%xmm4 -vpunpckhqdq %xmm0,%xmm9,%xmm5 -vmovdqa %xmm5,144(%rsp) -vpunpcklqdq %xmm0,%xmm9,%xmm0 -vmovdqa 176(%rsp),%xmm5 -vpaddq %xmm5,%xmm1,%xmm1 -vpunpcklqdq %xmm1,%xmm5,%xmm6 -vpunpckhqdq %xmm1,%xmm5,%xmm1 -vpmuludq 224(%rsp),%xmm6,%xmm5 -vpmuludq 192(%rsp),%xmm1,%xmm7 -vpaddq %xmm7,%xmm5,%xmm5 -vpmuludq 272(%rsp),%xmm6,%xmm7 -vpmuludq 240(%rsp),%xmm1,%xmm8 -vpaddq %xmm8,%xmm7,%xmm7 -vpmuludq 288(%rsp),%xmm6,%xmm8 -vpmuludq 272(%rsp),%xmm1,%xmm9 -vpaddq %xmm9,%xmm8,%xmm8 -vpmuludq 336(%rsp),%xmm6,%xmm9 -vpmuludq 304(%rsp),%xmm1,%xmm10 -vpaddq %xmm10,%xmm9,%xmm9 -vpmuludq 352(%rsp),%xmm6,%xmm10 -vpmuludq 336(%rsp),%xmm1,%xmm11 -vpaddq %xmm11,%xmm10,%xmm10 -vpmuludq 400(%rsp),%xmm6,%xmm11 -vpmuludq 368(%rsp),%xmm1,%xmm12 -vpaddq %xmm12,%xmm11,%xmm11 -vpmuludq 416(%rsp),%xmm6,%xmm12 -vpmuludq 400(%rsp),%xmm1,%xmm13 -vpaddq %xmm13,%xmm12,%xmm12 -vpmuludq 448(%rsp),%xmm6,%xmm13 -vpmuludq 432(%rsp),%xmm1,%xmm14 -vpaddq %xmm14,%xmm13,%xmm13 -vpmuludq 464(%rsp),%xmm6,%xmm14 -vpmuludq 448(%rsp),%xmm1,%xmm15 -vpaddq %xmm15,%xmm14,%xmm14 -vpmuludq 192(%rsp),%xmm6,%xmm6 -vpmuludq v19_19(%rip),%xmm1,%xmm1 -vpmuludq 480(%rsp),%xmm1,%xmm1 -vpaddq %xmm1,%xmm6,%xmm6 -vmovdqa 256(%rsp),%xmm1 -vpaddq %xmm1,%xmm2,%xmm2 -vpunpcklqdq %xmm2,%xmm1,%xmm15 -vpunpckhqdq %xmm2,%xmm1,%xmm1 -vpmuludq 192(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpmuludq 224(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpmuludq 272(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpmuludq 288(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 336(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpmuludq 352(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 400(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpmuludq 416(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm15,%xmm15 -vpmuludq 448(%rsp),%xmm15,%xmm2 -vpaddq %xmm2,%xmm6,%xmm6 -vpmuludq 464(%rsp),%xmm15,%xmm15 -vpaddq %xmm15,%xmm5,%xmm5 -vpmuludq 192(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpmuludq 240(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpmuludq 272(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 304(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpmuludq 336(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 368(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpmuludq 400(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm1,%xmm1 -vpmuludq 432(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm6,%xmm6 -vpmuludq 448(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpmuludq 480(%rsp),%xmm1,%xmm1 -vpaddq %xmm1,%xmm7,%xmm7 -vmovdqa 320(%rsp),%xmm1 -vpaddq %xmm1,%xmm3,%xmm3 -vpunpcklqdq %xmm3,%xmm1,%xmm2 -vpunpckhqdq %xmm3,%xmm1,%xmm1 -vpmuludq 192(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm9,%xmm9 -vpmuludq 224(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm10,%xmm10 -vpmuludq 272(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 288(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm12,%xmm12 -vpmuludq 336(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 352(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm2,%xmm2 -vpmuludq 400(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpmuludq 416(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 448(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq 464(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpmuludq 192(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 240(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm11,%xmm11 -vpmuludq 272(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 304(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpmuludq 336(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm1,%xmm1 -vpmuludq 368(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm6,%xmm6 -vpmuludq 400(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpmuludq 432(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpmuludq 448(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpmuludq 480(%rsp),%xmm1,%xmm1 -vpaddq %xmm1,%xmm9,%xmm9 -vmovdqa 384(%rsp),%xmm1 -vpaddq %xmm1,%xmm4,%xmm4 -vpunpcklqdq %xmm4,%xmm1,%xmm2 -vpunpckhqdq %xmm4,%xmm1,%xmm1 -vpmuludq 192(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm11,%xmm11 -vpmuludq 224(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm12,%xmm12 -vpmuludq 272(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm13,%xmm13 -vpmuludq 288(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm2,%xmm2 -vpmuludq 336(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm6,%xmm6 -vpmuludq 352(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm5,%xmm5 -vpmuludq 400(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm7,%xmm7 -vpmuludq 416(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm8,%xmm8 -vpmuludq 448(%rsp),%xmm2,%xmm3 -vpaddq %xmm3,%xmm9,%xmm9 -vpmuludq 464(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 192(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 240(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm13,%xmm13 -vpmuludq 272(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm1,%xmm1 -vpmuludq 304(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm6,%xmm6 -vpmuludq 336(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm5,%xmm5 -vpmuludq 368(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm7,%xmm7 -vpmuludq 400(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm8,%xmm8 -vpmuludq 432(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm9,%xmm9 -vpmuludq 448(%rsp),%xmm1,%xmm2 -vpaddq %xmm2,%xmm10,%xmm10 -vpmuludq 480(%rsp),%xmm1,%xmm1 -vpaddq %xmm1,%xmm11,%xmm11 -vmovdqa 160(%rsp),%xmm1 -vpaddq %xmm1,%xmm0,%xmm0 -vpunpcklqdq %xmm0,%xmm1,%xmm2 -vpunpckhqdq %xmm0,%xmm1,%xmm0 -vpmuludq 192(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm13,%xmm13 -vpmuludq 224(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm2,%xmm2 -vpmuludq 272(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm6,%xmm6 -vpmuludq 288(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm5,%xmm5 -vpmuludq 336(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm7,%xmm7 -vpmuludq 352(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm8,%xmm8 -vpmuludq 400(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm9,%xmm9 -vpmuludq 416(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm10,%xmm10 -vpmuludq 448(%rsp),%xmm2,%xmm1 -vpaddq %xmm1,%xmm11,%xmm11 -vpmuludq 464(%rsp),%xmm2,%xmm2 -vpaddq %xmm2,%xmm12,%xmm12 -vpmuludq 192(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm14,%xmm14 -vpmuludq v19_19(%rip),%xmm0,%xmm0 -vpmuludq 240(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm6,%xmm6 -vpmuludq 272(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm5,%xmm5 -vpmuludq 304(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm7,%xmm7 -vpmuludq 336(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm8,%xmm8 -vpmuludq 368(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm9,%xmm9 -vpmuludq 400(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm10,%xmm10 -vpmuludq 432(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm11,%xmm11 -vpmuludq 448(%rsp),%xmm0,%xmm1 -vpaddq %xmm1,%xmm12,%xmm12 -vpmuludq 480(%rsp),%xmm0,%xmm0 -vpaddq %xmm0,%xmm13,%xmm13 -vpsrlq $26,%xmm6,%xmm0 -vpaddq %xmm0,%xmm5,%xmm5 -vpand m26(%rip),%xmm6,%xmm6 -vpsrlq $25,%xmm10,%xmm0 -vpaddq %xmm0,%xmm11,%xmm11 -vpand m25(%rip),%xmm10,%xmm10 -vpsrlq $25,%xmm5,%xmm0 -vpaddq %xmm0,%xmm7,%xmm7 -vpand m25(%rip),%xmm5,%xmm5 -vpsrlq $26,%xmm11,%xmm0 -vpaddq %xmm0,%xmm12,%xmm12 -vpand m26(%rip),%xmm11,%xmm11 -vpsrlq $26,%xmm7,%xmm0 -vpaddq %xmm0,%xmm8,%xmm8 -vpand m26(%rip),%xmm7,%xmm7 -vpsrlq $25,%xmm12,%xmm0 -vpaddq %xmm0,%xmm13,%xmm13 -vpand m25(%rip),%xmm12,%xmm12 -vpsrlq $25,%xmm8,%xmm0 -vpaddq %xmm0,%xmm9,%xmm9 -vpand m25(%rip),%xmm8,%xmm8 -vpsrlq $26,%xmm13,%xmm0 -vpaddq %xmm0,%xmm14,%xmm14 -vpand m26(%rip),%xmm13,%xmm13 -vpsrlq $26,%xmm9,%xmm0 -vpaddq %xmm0,%xmm10,%xmm10 -vpand m26(%rip),%xmm9,%xmm9 -vpsrlq $25,%xmm14,%xmm0 -vpsllq $4,%xmm0,%xmm1 -vpaddq %xmm0,%xmm6,%xmm6 -vpsllq $1,%xmm0,%xmm0 -vpaddq %xmm0,%xmm1,%xmm1 -vpaddq %xmm1,%xmm6,%xmm6 -vpand m25(%rip),%xmm14,%xmm14 -vpsrlq $25,%xmm10,%xmm0 -vpaddq %xmm0,%xmm11,%xmm11 -vpand m25(%rip),%xmm10,%xmm10 -vpsrlq $26,%xmm6,%xmm0 -vpaddq %xmm0,%xmm5,%xmm5 -vpand m26(%rip),%xmm6,%xmm6 -vpunpckhqdq %xmm5,%xmm6,%xmm1 -vpunpcklqdq %xmm5,%xmm6,%xmm0 -vpunpckhqdq %xmm8,%xmm7,%xmm3 -vpunpcklqdq %xmm8,%xmm7,%xmm2 -vpunpckhqdq %xmm10,%xmm9,%xmm5 -vpunpcklqdq %xmm10,%xmm9,%xmm4 -vpunpckhqdq %xmm12,%xmm11,%xmm7 -vpunpcklqdq %xmm12,%xmm11,%xmm6 -vpunpckhqdq %xmm14,%xmm13,%xmm9 -vpunpcklqdq %xmm14,%xmm13,%xmm8 -cmp $0,%rdx -jne ._ladder_base_loop -vmovdqu %xmm1,80(%rdi) -vmovdqu %xmm0,0(%rdi) -vmovdqu %xmm3,96(%rdi) -vmovdqu %xmm2,16(%rdi) -vmovdqu %xmm5,112(%rdi) -vmovdqu %xmm4,32(%rdi) -vmovdqu %xmm7,128(%rdi) -vmovdqu %xmm6,48(%rdi) -vmovdqu %xmm9,144(%rdi) -vmovdqu %xmm8,64(%rdi) -movq 1536(%rsp),%r11 -movq 1544(%rsp),%r12 -movq 1552(%rsp),%r13 -add %r11,%rsp -ret - -#endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S 2022-01-07 21:54:10.000000000 +0000 @@ -8,7 +8,6 @@ #include "fe51_nsquare.S" #include "fe51_pack.S" #include "ladder.S" -#include "ladder_base.S" #if defined(__linux__) && defined(__ELF__) .section .note.GNU-stack,"",%progbits diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519.c 2022-01-07 21:54:10.000000000 +0000 @@ -30,7 +30,8 @@ int crypto_scalarmult_curve25519_base(unsigned char *q, const unsigned char *n) { - return implementation->mult_base(q, n); + return crypto_scalarmult_curve25519_ref10_implementation + .mult_base(q, n); } size_t diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_secretbox/crypto_secretbox_easy.c 2022-01-07 21:54:10.000000000 +0000 @@ -101,9 +101,9 @@ if (m == NULL) { return 0; } - if (((uintptr_t) c >= (uintptr_t) m && + if (((uintptr_t) c > (uintptr_t) m && (uintptr_t) c - (uintptr_t) m < clen) || - ((uintptr_t) m >= (uintptr_t) c && + ((uintptr_t) m > (uintptr_t) c && (uintptr_t) m - (uintptr_t) c < clen)) { /* LCOV_EXCL_LINE */ memmove(m, c, clen); c = m; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_secretbox/xchacha20poly1305/secretbox_xchacha20poly1305.c 2022-01-07 21:54:10.000000000 +0000 @@ -108,9 +108,9 @@ if (m == NULL) { return 0; } - if (((uintptr_t) c >= (uintptr_t) m && + if (((uintptr_t) c > (uintptr_t) m && (uintptr_t) c - (uintptr_t) m < clen) || - ((uintptr_t) m >= (uintptr_t) c && + ((uintptr_t) m > (uintptr_t) c && (uintptr_t) m - (uintptr_t) c < clen)) { /* LCOV_EXCL_LINE */ memmove(m, c, clen); c = m; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-avx2.c 2022-01-07 21:54:10.000000000 +0000 @@ -6,7 +6,6 @@ #include "core.h" #include "crypto_stream_chacha20.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "utils.h" #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ @@ -23,6 +22,7 @@ # include # include # include +# include "private/sse2_64_32.h" # include "../stream_chacha20.h" # include "chacha20_dolbeau-avx2.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/chacha20_dolbeau-ssse3.c 2022-01-07 21:54:10.000000000 +0000 @@ -6,7 +6,6 @@ #include "core.h" #include "crypto_stream_chacha20.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "utils.h" #if defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) @@ -18,6 +17,7 @@ # include # include +# include "private/sse2_64_32.h" # include "../stream_chacha20.h" # include "chacha20_dolbeau-ssse3.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/chacha20/dolbeau/u8.h 2022-01-07 21:54:10.000000000 +0000 @@ -2,21 +2,6 @@ #define VEC8_ROT(A, IMM) \ _mm256_or_si256(_mm256_slli_epi32(A, IMM), _mm256_srli_epi32(A, (32 - IMM))) -/* implements a vector quarter round by-the-book (naive!) */ -#define VEC8_QUARTERROUND_NAIVE(A, B, C, D) \ - x_##A = _mm256_add_epi32(x_##A, x_##B); \ - t_##A = _mm256_xor_si256(x_##D, x_##A); \ - x_##D = VEC8_ROT(t_##A, 16); \ - x_##C = _mm256_add_epi32(x_##C, x_##D); \ - t_##C = _mm256_xor_si256(x_##B, x_##C); \ - x_##B = VEC8_ROT(t_##C, 12); \ - x_##A = _mm256_add_epi32(x_##A, x_##B); \ - t_##A = _mm256_xor_si256(x_##D, x_##A); \ - x_##D = VEC8_ROT(t_##A, 8); \ - x_##C = _mm256_add_epi32(x_##C, x_##D); \ - t_##C = _mm256_xor_si256(x_##B, x_##C); \ - x_##B = VEC8_ROT(t_##C, 7) - /* same, but replace 2 of the shift/shift/or "rotation" by byte shuffles (8 & * 16) (better) */ #define VEC8_QUARTERROUND_SHUFFLE(A, B, C, D) \ @@ -33,22 +18,6 @@ t_##C = _mm256_xor_si256(x_##B, x_##C); \ x_##B = VEC8_ROT(t_##C, 7) -/* same, but replace 2 of the shift/shift/or "rotation" by byte & word shuffles - * (8 & 16) (not as good as previous) */ -#define VEC8_QUARTERROUND_SHUFFLE2(A, B, C, D) \ - x_##A = _mm256_add_epi32(x_##A, x_##B); \ - t_##A = _mm256_xor_si256(x_##D, x_##A); \ - x_##D = _mm256_shufflehi_epi16(_mm256_shufflelo_epi16(t_##A, 0xb1), 0xb1); \ - x_##C = _mm256_add_epi32(x_##C, x_##D); \ - t_##C = _mm256_xor_si256(x_##B, x_##C); \ - x_##B = VEC8_ROT(t_##C, 12); \ - x_##A = _mm256_add_epi32(x_##A, x_##B); \ - t_##A = _mm256_xor_si256(x_##D, x_##A); \ - x_##D = _mm256_shuffle_epi8(t_##A, rot8); \ - x_##C = _mm256_add_epi32(x_##C, x_##D); \ - t_##C = _mm256_xor_si256(x_##B, x_##C); \ - x_##B = VEC8_ROT(t_##C, 7) - #define VEC8_QUARTERROUND(A, B, C, D) VEC8_QUARTERROUND_SHUFFLE(A, B, C, D) #define VEC8_LINE1(A, B, C, D) \ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-avx2.c 2022-01-07 21:54:10.000000000 +0000 @@ -5,7 +5,6 @@ #include "crypto_stream_salsa20.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "utils.h" #if defined(HAVE_AVX2INTRIN_H) && defined(HAVE_EMMINTRIN_H) && \ @@ -22,6 +21,7 @@ #include #include #include +#include "private/sse2_64_32.h" # include "../stream_salsa20.h" # include "salsa20_xmm6int-avx2.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/crypto_stream/salsa20/xmm6int/salsa20_xmm6int-sse2.c 2022-01-07 21:54:10.000000000 +0000 @@ -5,7 +5,6 @@ #include "crypto_stream_salsa20.h" #include "private/common.h" -#include "private/sse2_64_32.h" #include "utils.h" #ifdef HAVE_EMMINTRIN_H @@ -14,6 +13,7 @@ # pragma GCC target("sse2") # endif # include +# include "private/sse2_64_32.h" # include "../stream_salsa20.h" # include "salsa20_xmm6int-sse2.h" diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/Makefile.in python-nacl-1.5.0/src/libsodium/src/libsodium/include/Makefile.in --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -88,9 +88,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = src/libsodium/include ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -182,7 +184,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -266,6 +267,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -326,11 +328,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_core_ed25519.h 2022-01-07 21:54:10.000000000 +0000 @@ -48,7 +48,7 @@ SODIUM_EXPORT int crypto_core_ed25519_from_hash(unsigned char *p, const unsigned char *h) - __attribute__ ((nonnull)); + __attribute__ ((nonnull)) __attribute__ ((deprecated)); SODIUM_EXPORT void crypto_core_ed25519_random(unsigned char *p) diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_generichash_blake2b.h 2022-01-07 21:54:10.000000000 +0000 @@ -14,7 +14,9 @@ extern "C" { #endif -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#ifdef __IBMC__ +# pragma pack(1) +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # pragma pack(1) #else # pragma pack(push, 1) @@ -24,7 +26,9 @@ unsigned char opaque[384]; } crypto_generichash_blake2b_state; -#if defined(__IBMC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) +#ifdef __IBMC__ +# pragma pack(pop) +#elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) # pragma pack() #else # pragma pack(pop) diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash.h 2022-01-07 21:54:10.000000000 +0000 @@ -2,7 +2,7 @@ #define crypto_hash_H /* - * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, + * WARNING: Unless you absolutely need to use SHA512 for interoperability, * purposes, you might want to consider crypto_generichash() instead. * Unlike SHA512, crypto_generichash() is not vulnerable to length * extension attacks. diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha256.h 2022-01-07 21:54:10.000000000 +0000 @@ -2,7 +2,7 @@ #define crypto_hash_sha256_H /* - * WARNING: Unless you absolutely need to use SHA256 for interoperatibility, + * WARNING: Unless you absolutely need to use SHA256 for interoperability, * purposes, you might want to consider crypto_generichash() instead. * Unlike SHA256, crypto_generichash() is not vulnerable to length * extension attacks. diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_hash_sha512.h 2022-01-07 21:54:10.000000000 +0000 @@ -2,7 +2,7 @@ #define crypto_hash_sha512_H /* - * WARNING: Unless you absolutely need to use SHA512 for interoperatibility, + * WARNING: Unless you absolutely need to use SHA512 for interoperability, * purposes, you might want to consider crypto_generichash() instead. * Unlike SHA512, crypto_generichash() is not vulnerable to length * extension attacks. diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/crypto_kdf_blake2b.h 2022-01-07 21:54:10.000000000 +0000 @@ -3,8 +3,8 @@ #include #include +#include -#include "crypto_kdf_blake2b.h" #include "export.h" #ifdef __cplusplus diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_25_5.h 2022-01-07 21:54:10.000000000 +0000 @@ -979,7 +979,7 @@ } static void -fe25519_scalar_product(fe25519 h, const fe25519 f, uint32_t n) +fe25519_mul32(fe25519 h, const fe25519 f, uint32_t n) { int64_t sn = (int64_t) n; int32_t f0 = f[0]; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/ed25519_ref10_fe_51.h 2022-01-07 21:54:10.000000000 +0000 @@ -490,7 +490,7 @@ } static void -fe25519_scalar_product(fe25519 h, const fe25519 f, uint32_t n) +fe25519_mul32(fe25519 h, const fe25519 f, uint32_t n) { const uint64_t mask = 0x7ffffffffffffULL; uint128_t a; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/private/sse2_64_32.h 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ #ifndef sse2_64_32_H #define sse2_64_32_H 1 -#include "common.h" +#include "private/common.h" #ifdef HAVE_INTRIN_H # include diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/utils.h python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/utils.h --- python-nacl-1.4.0/src/libsodium/src/libsodium/include/sodium/utils.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/include/sodium/utils.h 2022-01-07 21:54:10.000000000 +0000 @@ -134,7 +134,7 @@ * either 357 or 361 bytes. For this reason, when using sodium_malloc() to * allocate a crypto_generichash_state structure, padding must be added in * order to ensure proper alignment. crypto_generichash_statebytes() - * returns the rounded up structure size, and should be prefered to sizeof(): + * returns the rounded up structure size, and should be preferred to sizeof(): * state = sodium_malloc(crypto_generichash_statebytes()); */ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/Makefile.am python-nacl-1.5.0/src/libsodium/src/libsodium/Makefile.am --- python-nacl-1.4.0/src/libsodium/src/libsodium/Makefile.am 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/Makefile.am 2022-01-07 21:54:10.000000000 +0000 @@ -127,8 +127,7 @@ crypto_scalarmult/curve25519/sandy2x/fe51_mul.S \ crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S \ crypto_scalarmult/curve25519/sandy2x/fe51_pack.S \ - crypto_scalarmult/curve25519/sandy2x/ladder.S \ - crypto_scalarmult/curve25519/sandy2x/ladder_base.S + crypto_scalarmult/curve25519/sandy2x/ladder.S if HAVE_AVX_ASM libsodium_la_SOURCES += \ @@ -141,8 +140,6 @@ crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \ crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \ crypto_scalarmult/curve25519/sandy2x/ladder.h \ - crypto_scalarmult/curve25519/sandy2x/ladder_base.h \ - crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \ crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \ crypto_scalarmult/curve25519/sandy2x/sandy2x.S endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/Makefile.in python-nacl-1.5.0/src/libsodium/src/libsodium/Makefile.in --- python-nacl-1.4.0/src/libsodium/src/libsodium/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -90,6 +90,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ @HAVE_TI_MODE_TRUE@am__append_1 = \ @HAVE_TI_MODE_TRUE@ crypto_core/ed25519/ref10/fe_51/base.h \ @HAVE_TI_MODE_TRUE@ crypto_core/ed25519/ref10/fe_51/base2.h \ @@ -123,8 +124,6 @@ @HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \ @HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \ @HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder.h \ -@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_base.h \ -@HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \ @HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \ @HAVE_AVX_ASM_TRUE@ crypto_scalarmult/curve25519/sandy2x/sandy2x.S @@ -170,7 +169,8 @@ subdir = src/libsodium ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -358,8 +358,6 @@ crypto_scalarmult/curve25519/sandy2x/fe51_namespace.h \ crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c \ crypto_scalarmult/curve25519/sandy2x/ladder.h \ - crypto_scalarmult/curve25519/sandy2x/ladder_base.h \ - crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h \ crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h \ crypto_scalarmult/curve25519/sandy2x/sandy2x.S \ crypto_box/curve25519xchacha20poly1305/box_curve25519xchacha20poly1305.c \ @@ -754,7 +752,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -838,6 +835,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -898,11 +896,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -1001,8 +1004,7 @@ crypto_scalarmult/curve25519/sandy2x/fe51_mul.S \ crypto_scalarmult/curve25519/sandy2x/fe51_nsquare.S \ crypto_scalarmult/curve25519/sandy2x/fe51_pack.S \ - crypto_scalarmult/curve25519/sandy2x/ladder.S \ - crypto_scalarmult/curve25519/sandy2x/ladder_base.S + crypto_scalarmult/curve25519/sandy2x/ladder.S randombytes_internal_randombytes_internal_random_CFLAGS = @CFLAGS_RDRAND@ libsodium_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -no-undefined \ diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c python-nacl-1.5.0/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/randombytes/sysrandom/randombytes_sysrandom.c 2022-01-07 21:54:10.000000000 +0000 @@ -31,9 +31,10 @@ # define HAVE_LINUX_COMPATIBLE_GETRANDOM # endif # endif -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__DragonFly__) # include -# if defined(__FreeBSD_version) && __FreeBSD_version >= 1200000 +# if (defined(__FreeBSD_version) && __FreeBSD_version >= 1200000) || \ + (defined(__DragonFly_version) && __DragonFly_version >= 500700) # define HAVE_LINUX_COMPATIBLE_GETRANDOM # endif #endif diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/sodium/core.c python-nacl-1.5.0/src/libsodium/src/libsodium/sodium/core.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/sodium/core.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/sodium/core.c 2022-01-07 21:54:10.000000000 +0000 @@ -57,7 +57,7 @@ static CRITICAL_SECTION _sodium_lock; static volatile LONG _sodium_lock_initialized; -int +static int _sodium_crit_init(void) { LONG status = 0L; diff -Nru python-nacl-1.4.0/src/libsodium/src/libsodium/sodium/utils.c python-nacl-1.5.0/src/libsodium/src/libsodium/sodium/utils.c --- python-nacl-1.4.0/src/libsodium/src/libsodium/sodium/utils.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/libsodium/sodium/utils.c 2022-01-07 21:54:10.000000000 +0000 @@ -4,12 +4,15 @@ #include #include #include -#include #include #include #include #include +#ifndef __wasm__ +# include +#endif + #ifdef HAVE_SYS_MMAN_H # include #endif @@ -59,7 +62,11 @@ #define GARBAGE_VALUE 0xdb #ifndef MAP_NOCORE -# define MAP_NOCORE 0 +# ifdef MAP_CONCEAL +# define MAP_NOCORE MAP_CONCEAL +# else +# define MAP_NOCORE 0 +# endif #endif #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS) # define MAP_ANON MAP_ANONYMOUS @@ -81,7 +88,15 @@ # define MADV_DONTDUMP MADV_NOCORE #endif -static size_t page_size; +#ifndef DEFAULT_PAGE_SIZE +# ifdef PAGE_SIZE +# define DEFAULT_PAGE_SIZE PAGE_SIZE +# else +# define DEFAULT_PAGE_SIZE 0x10000 +# endif +#endif + +static size_t page_size = DEFAULT_PAGE_SIZE; static unsigned char canary[CANARY_SIZE]; /* LCOV_EXCL_START */ @@ -393,6 +408,8 @@ SYSTEM_INFO si; GetSystemInfo(&si); page_size = (size_t) si.dwPageSize; +# else +# warning Unknown page size # endif if (page_size < CANARY_SIZE || page_size < sizeof(size_t)) { sodium_misuse(); /* LCOV_EXCL_LINE */ diff -Nru python-nacl-1.4.0/src/libsodium/src/Makefile.in python-nacl-1.5.0/src/libsodium/src/Makefile.in --- python-nacl-1.4.0/src/libsodium/src/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/src/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,9 +87,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -193,7 +195,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -277,6 +278,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -337,11 +339,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru python-nacl-1.4.0/src/libsodium/test/constcheck.sh python-nacl-1.5.0/src/libsodium/test/constcheck.sh --- python-nacl-1.4.0/src/libsodium/test/constcheck.sh 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/constcheck.sh 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,20 @@ +#! /bin/sh + +CT='ct.c' + +echo '#include ' > "$CT" +echo '#include ' >> "$CT" +echo 'int main(void) {' >> "$CT" +for macro in $(egrep -r '#define crypto_.*BYTES(_[A-Z]+)? ' src/libsodium/include | \ + cut -d: -f2- | cut -d' ' -f2 | \ + fgrep -v edwards25519sha512batch | sort -u); do + func=$(echo "$macro" | tr A-Z a-z) + echo " assert($func() == $macro);" >> "$CT" +done +echo "return 0; }" >> "$CT" + +CPPFLAGS="${CPPFLAGS} -Wno-deprecated-declarations" +${CC:-cc} "$CT" $CPPFLAGS $CFLAGS $LDFLAGS -lsodium || exit 1 +./a.out || exit 1 +rm -f a.out "$CT" + diff -Nru python-nacl-1.4.0/src/libsodium/test/default/box_seal.c python-nacl-1.5.0/src/libsodium/test/default/box_seal.c --- python-nacl-1.4.0/src/libsodium/test/default/box_seal.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/box_seal.c 2022-01-07 21:54:10.000000000 +0000 @@ -41,10 +41,39 @@ assert(crypto_box_sealbytes() == crypto_box_SEALBYTES); } -#ifndef SODIUM_LIBRARY_MINIMAL static void tv2(void) { + unsigned char pk[crypto_box_PUBLICKEYBYTES]; + unsigned char sk[crypto_box_SECRETKEYBYTES]; + unsigned char *cm; + unsigned char *m2; + size_t m_len; + size_t cm_len; + + crypto_box_keypair(pk, sk); + m_len = (size_t) randombytes_uniform(1000); + cm_len = crypto_box_SEALBYTES + m_len; + m2 = (unsigned char *) sodium_malloc(m_len); + cm = (unsigned char *) sodium_malloc(cm_len); + randombytes_buf(cm, m_len); + if (crypto_box_seal(cm, cm, m_len, pk) != 0) { + printf("crypto_box_seal() failure\n"); + return; + } + if (crypto_box_seal_open(m2, cm, cm_len, pk, sk) != 0) { + printf("crypto_box_seal_open() failure\n"); + return; + } + assert(m_len == 0 || memcmp(cm, m2, m_len) != 0); + sodium_free(cm); + sodium_free(m2); +} + +#ifndef SODIUM_LIBRARY_MINIMAL +static +void tv3(void) +{ unsigned char pk[crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES]; unsigned char sk[crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES]; unsigned char *c; @@ -82,13 +111,46 @@ crypto_box_curve25519xchacha20poly1305_SEALBYTES); } +static +void tv4(void) +{ + unsigned char pk[crypto_box_curve25519xchacha20poly1305_PUBLICKEYBYTES]; + unsigned char sk[crypto_box_curve25519xchacha20poly1305_SECRETKEYBYTES]; + unsigned char *cm; + unsigned char *m2; + size_t m_len; + size_t cm_len; + + crypto_box_curve25519xchacha20poly1305_keypair(pk, sk); + m_len = (size_t) randombytes_uniform(1000); + cm_len = crypto_box_curve25519xchacha20poly1305_SEALBYTES + m_len; + m2 = (unsigned char *) sodium_malloc(m_len); + cm = (unsigned char *) sodium_malloc(cm_len); + randombytes_buf(cm, m_len); + if (crypto_box_curve25519xchacha20poly1305_seal(cm, cm, m_len, pk) != 0) { + printf("crypto_box_curve25519xchacha20poly1305_seal() failure\n"); + return; + } + if (crypto_box_curve25519xchacha20poly1305_seal_open(m2, cm, cm_len, pk, sk) != 0) { + printf("crypto_box_curve25519xchacha20poly1305_seal_open() failure\n"); + return; + } + assert(m_len == 0 || memcmp(cm, m2, m_len) != 0); + sodium_free(cm); + sodium_free(m2); +} + #else static -void tv2(void) +void tv3(void) { printf("0\n-1\n-1\n-1\n"); } + +static +void tv4(void) +{ } #endif int @@ -96,6 +158,8 @@ { tv1(); tv2(); + tv3(); + tv4(); return 0; } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/chacha20.c python-nacl-1.5.0/src/libsodium/test/default/chacha20.c --- python-nacl-1.4.0/src/libsodium/test/default/chacha20.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/chacha20.c 2022-01-07 21:54:10.000000000 +0000 @@ -137,7 +137,7 @@ assert(66 <= sizeof out); for (plen = 1U; plen < 66; plen += 3) { memset(out, (int) (plen & 0xff), sizeof out); - crypto_stream_chacha20(out, plen, nonce, key); + crypto_stream_chacha20_ietf(out, plen, nonce, key); sodium_bin2hex(out_hex, sizeof out_hex, out, sizeof out); printf("[%s]\n", out_hex); } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/chacha20.exp python-nacl-1.5.0/src/libsodium/test/default/chacha20.exp --- python-nacl-1.4.0/src/libsodium/test/default/chacha20.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/chacha20.exp 2022-01-07 21:54:10.000000000 +0000 @@ -36,28 +36,28 @@ [c2c64d378cd536374ae204b9ef933fcd1a8b2288b3dfa49672ab765b54ee27c78a970e0e955c14f3a88e741b97c286f75f8fc299e8148362fa198a39531bed6d1a91288c874ec254f322c2a197340c55bb3e9b3998f7de2309486a0bb494abd20c9c5ef99c1370d61e77f408ac5514f49202bcc6828d45409d2d1416f8ae106b06ebd2541256264fa415bd54cb12e1d4449ed85299a1b7a249b75ff6c89b2e3f] [10f1e7e4d13b5915500fdd1fa32071c4c7d1f4c733c068030422aa9ac3d46c4ed2826446079faa0914c2d705d98b02a2b5129cd1de164eb9cbd083e8a2503c4e0a88837739d7bf4ef8ccacb0ea2bb9d69d56c394aa351dfda5bf459f0a2e9fe8e721f89255f9c486bf21679c683d4f9c5cf2fa27865526005b06ca374c86af3bdcbfbdcb83be65862ed5c20eae5a43241d6a92da6dca9a156be25297f51c2718] [75924bad7831b25662dbac54b46827990b6168ae990e7bd7e1fd2ad282bf23ef052c7d1a0a6c1ef862070943a0d4da24705fbc006dfb85e2af18c0a264d772a44c70fbedac9d6a6867ff6be0a32826507f2c784101583211c9e2453d4cc8b283d5e86682bd4bf511271b91dbd351415f5a009d1f78b64085a9a4341be7d42e2679d57e2747097f0129950e2c9e9ca1356022d45da252af71ac37f351a2e77911] -[61010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101] -[6146f256040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404] -[6146f2564fe1bd070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707] -[6146f2564fe1bdf9bccd0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a] -[6146f2564fe1bdf9bccd0fe1ed0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d] -[6146f2564fe1bdf9bccd0fe1edf0da5d101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb00161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af1021c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7081f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f6222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c2973032e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2e34130343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2e3413018ff7e373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2e3413018ff7ed87cfa3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2e3413018ff7ed87cfa95b60f3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d] -[6146f2564fe1bdf9bccd0fe1edf0da5d92f1fa76cb002937ba9af10230a7085f55f67bf6ab410fba060c2c297303ace1e2e3413018ff7ed87cfa95b60f094ee5404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040] +[8a010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101] +[8adc91fd040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404] +[8adc91fd9ff4f0070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707070707] +[8adc91fd9ff4f0f51b0f0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a] +[8adc91fd9ff4f0f51b0fad50ff0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d0d] +[8adc91fd9ff4f0f51b0fad50ff15d637101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efd131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a742001c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c1c] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c151f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f1f] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd98222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d5282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f492e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69c313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1f343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434343434] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1ff9e939373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737373737] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1ff9e939a755843a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a3a] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1ff9e939a75584c52d693d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d3d] +[8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1ff9e939a75584c52d690a35d4404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040] [8adc91fd9ff4f0f51b0fad50ff15d637e40efda206cc52c783a74200503c1582cd9833367d0a54d57d3c9e998f490ee69ca34c1ff9e939a75584c52d690a35d410f1e7e4d13b5915500fdd1fa32071c4c7d1f4c733c068030422aa9ac3d46c4ed2826446079faa0914c2d705d98b02a2b5129cd1de164eb9cbd083e8a2503c4e0a88837739d7bf4ef8ccacb0ea2bb9d69d56c394aa351dfda5bf459f0a2e9fe8] [c89ed3bfddb6b2b7594def12bd579475a64cbfe0448e1085c1e50042127e57c08fda71743f4816973f7edcdbcd0b4ca4dee10e5dbbab7be517c6876f2b48779652b3a5a693791b57124d9f5de16233868593b68571822a414660e8d881962e0c90c0260445dde84b568095479bc940e0f750de939c540cfb8992c1aae0127e0c48cac1357b95fd0cba8eeef2a869fb94df1481d6e8775fbfe7fd07dd486cddaa] [42424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242] diff -Nru python-nacl-1.4.0/src/libsodium/test/default/cmptest.h python-nacl-1.5.0/src/libsodium/test/default/cmptest.h --- python-nacl-1.4.0/src/libsodium/test/default/cmptest.h 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/cmptest.h 2022-01-07 21:54:10.000000000 +0000 @@ -190,6 +190,7 @@ if (xmain() != 0) { return 99; } + fflush(fp_res); rewind(fp_res); if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) { perror("fopen(" TEST_NAME_OUT ")"); diff -Nru python-nacl-1.4.0/src/libsodium/test/default/codecs.c python-nacl-1.5.0/src/libsodium/test/default/codecs.c --- python-nacl-1.4.0/src/libsodium/test/default/codecs.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/codecs.c 2022-01-07 21:54:10.000000000 +0000 @@ -200,6 +200,12 @@ assert(sodium_base642bin(buf1, sizeof buf1, "O", (size_t) 1U, NULL, NULL, NULL, sodium_base64_VARIANT_ORIGINAL_NO_PADDING) == -1); + assert(sodium_base642bin(buf1, sizeof buf1, "", (size_t) 0U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == 0); + assert(sodium_base642bin(buf1, sizeof buf1, "A", (size_t) 1U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == -1); + assert(sodium_base642bin(buf1, sizeof buf1, "AA", (size_t) 2U, NULL, NULL, NULL, + sodium_base64_VARIANT_ORIGINAL) == -1); assert(sodium_base642bin(buf1, sizeof buf1, "kaw", (size_t) 3U, NULL, NULL, NULL, sodium_base64_VARIANT_ORIGINAL) == -1); assert(sodium_base642bin(buf1, sizeof buf1, "kQ*", (size_t) 3U, "@", NULL, NULL, diff -Nru python-nacl-1.4.0/src/libsodium/test/default/core_ed25519.c python-nacl-1.5.0/src/libsodium/test/default/core_ed25519.c --- python-nacl-1.4.0/src/libsodium/test/default/core_ed25519.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/core_ed25519.c 2022-01-07 21:54:10.000000000 +0000 @@ -13,6 +13,26 @@ 0xe4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f }; +static const unsigned char L_p1[32] = { + 0xee, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 +}; +static const unsigned char L[32] = { + 0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 +}; +static const unsigned char L_1[32] = { + 0xec, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10 +}; +static const unsigned char sc_8[32] = { + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +static const unsigned char sc_highbit[32] = { + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 +}; static void add_P(unsigned char * const S) @@ -44,14 +64,13 @@ int main(void) { - unsigned char *h, *r; + unsigned char *r; unsigned char *p, *p2, *p3; unsigned char *sc, *sc2, *sc3; unsigned char *sc64; char *hex; unsigned int i, j; - h = (unsigned char *) sodium_malloc(crypto_core_ed25519_HASHBYTES); r = (unsigned char *) sodium_malloc(crypto_core_ed25519_UNIFORMBYTES); p = (unsigned char *) sodium_malloc(crypto_core_ed25519_BYTES); for (i = 0; i < 500; i++) { @@ -63,14 +82,6 @@ printf("crypto_core_ed25519_from_uniform() returned an invalid point\n"); } - randombytes_buf(h, crypto_core_ed25519_HASHBYTES); - if (crypto_core_ed25519_from_hash(p, h) != 0) { - printf("crypto_core_ed25519_from_hash() failed\n"); - } - if (crypto_core_ed25519_is_valid_point(p) == 0) { - printf("crypto_core_ed25519_from_hash() returned an invalid point\n"); - } - crypto_core_ed25519_random(p); if (crypto_core_ed25519_is_valid_point(p) == 0) { printf("crypto_core_ed25519_random() returned an invalid point\n"); @@ -387,6 +398,114 @@ crypto_core_ed25519_scalar_mul(sc3, sc, sc2); assert(memcmp(sc3, sc, crypto_core_ed25519_SCALARBYTES) != 0); } + + crypto_core_ed25519_scalar_mul(sc, L_1, sc_8); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)*8: %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, sc_8, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("8(L-1): %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, L_1, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)^2: %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, L, sc_8); + + crypto_core_ed25519_scalar_mul(sc, L_p1, sc_8); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)*8: %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, sc_8, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("8(L+1): %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, L_p1, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)^2: %s\n", hex); + + crypto_core_ed25519_scalar_mul(sc, L_1, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)h: %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, sc_highbit, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h(L-1): %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, L_p1, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)h: %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, sc_highbit, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h(L+1): %s\n", hex); + crypto_core_ed25519_scalar_mul(sc, sc_highbit, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h^2: %s\n", hex); + + crypto_core_ed25519_scalar_mul(sc, L, sc_8); + assert(sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES)); + crypto_core_ed25519_scalar_mul(sc, sc_8, L); + assert(sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES)); + crypto_core_ed25519_scalar_mul(sc, L, L); + assert(sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES)); + crypto_core_ed25519_scalar_mul(sc, L, L_1); + assert(sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES)); + crypto_core_ed25519_scalar_mul(sc, L_1, L); + assert(sodium_is_zero(sc, crypto_core_ed25519_SCALARBYTES)); + + crypto_core_ed25519_scalar_add(sc, L_1, sc_8); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)+8: %s\n", hex); + crypto_core_ed25519_scalar_add(sc, sc_8, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("8+(L-1): %s\n", hex); + crypto_core_ed25519_scalar_add(sc, L_1, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)*2: %s\n", hex); + crypto_core_ed25519_scalar_add(sc, L, sc_8); + + crypto_core_ed25519_scalar_add(sc, L_p1, sc_8); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)+8: %s\n", hex); + crypto_core_ed25519_scalar_add(sc, sc_8, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("8+(L+1): %s\n", hex); + crypto_core_ed25519_scalar_add(sc, L_p1, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)*2: %s\n", hex); + + crypto_core_ed25519_scalar_add(sc, L_1, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L-1)+h: %s\n", hex); + crypto_core_ed25519_scalar_add(sc, sc_highbit, L_1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h+(L-1): %s\n", hex); + crypto_core_ed25519_scalar_add(sc, L_p1, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("(L+1)+h: %s\n", hex); + crypto_core_ed25519_scalar_add(sc, sc_highbit, L_p1); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h+(L+1): %s\n", hex); + crypto_core_ed25519_scalar_add(sc, sc_highbit, sc_highbit); + sodium_bin2hex(hex, crypto_core_ed25519_SCALARBYTES * 2 + 1, + sc, crypto_core_ed25519_SCALARBYTES); + printf("h*2: %s\n", hex); + sodium_free(hex); sodium_free(sc64); sodium_free(sc3); @@ -396,7 +515,6 @@ sodium_free(p2); sodium_free(p); sodium_free(r); - sodium_free(h); assert(crypto_core_ed25519_BYTES == crypto_core_ed25519_bytes()); assert(crypto_core_ed25519_SCALARBYTES == crypto_core_ed25519_scalarbytes()); @@ -404,8 +522,6 @@ assert(crypto_core_ed25519_NONREDUCEDSCALARBYTES >= crypto_core_ed25519_SCALARBYTES); assert(crypto_core_ed25519_UNIFORMBYTES == crypto_core_ed25519_uniformbytes()); assert(crypto_core_ed25519_UNIFORMBYTES >= crypto_core_ed25519_BYTES); - assert(crypto_core_ed25519_HASHBYTES == crypto_core_ed25519_hashbytes()); - assert(crypto_core_ed25519_HASHBYTES >= 2 * crypto_core_ed25519_BYTES); printf("OK\n"); diff -Nru python-nacl-1.4.0/src/libsodium/test/default/core_ed25519.exp python-nacl-1.5.0/src/libsodium/test/default/core_ed25519.exp --- python-nacl-1.4.0/src/libsodium/test/default/core_ed25519.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/core_ed25519.exp 2022-01-07 21:54:10.000000000 +0000 @@ -15,4 +15,26 @@ add2: b02e8581ce62f69922427c23f970f7e951525252525252525252525252525202 sub2: 3da570db4b001cbeb35a7b7fe588e72aaeadadadadadadadadadadadadadad0d mul: 4453ef38408c06677c1b810e4bf8b1991f01c88716fbfa2f075a518b77da400b +(L-1)*8: e5d3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010 +8(L-1): e5d3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010 +(L-1)^2: 0100000000000000000000000000000000000000000000000000000000000000 +(L+1)*8: 0800000000000000000000000000000000000000000000000000000000000000 +8(L+1): 0800000000000000000000000000000000000000000000000000000000000000 +(L+1)^2: 0100000000000000000000000000000000000000000000000000000000000000 +(L-1)h: 609faee7d21893c0b2e6bc17f5cef7a600000000000000000000000000000000 +h(L-1): 609faee7d21893c0b2e6bc17f5cef7a600000000000000000000000000000000 +(L+1)h: 8d344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +h(L+1): 8d344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +h^2: 726cf51b9ec1dda146af8c58ffd22d148f6ffd85f41cbb738f260cdf4650e60c +(L-1)+8: 0700000000000000000000000000000000000000000000000000000000000000 +8+(L-1): 0700000000000000000000000000000000000000000000000000000000000000 +(L-1)*2: ebd3f55c1a631258d69cf7a2def9de1400000000000000000000000000000010 +(L+1)+8: 0900000000000000000000000000000000000000000000000000000000000000 +8+(L+1): 0900000000000000000000000000000000000000000000000000000000000000 +(L+1)*2: 0200000000000000000000000000000000000000000000000000000000000000 +(L-1)+h: 8c344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +h+(L-1): 8c344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +(L+1)+h: 8e344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +h+(L+1): 8e344775474a7f9723b63a8be92ae76dffffffffffffffffffffffffffffff0f +h*2: 1000000000000000000000000000000000000000000000000000000000000000 OK diff -Nru python-nacl-1.4.0/src/libsodium/test/default/core_ristretto255.c python-nacl-1.5.0/src/libsodium/test/default/core_ristretto255.c --- python-nacl-1.4.0/src/libsodium/test/default/core_ristretto255.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/core_ristretto255.c 2022-01-07 21:54:10.000000000 +0000 @@ -10,6 +10,7 @@ "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", "f3ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", "edffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f", + "0100000000000000000000000000000000000000000000000000000000000080", /* Negative field elements */ "0100000000000000000000000000000000000000000000000000000000000000", @@ -171,7 +172,7 @@ printf("addition failed"); } if (crypto_core_ristretto255_sub(s2, s2, s_) != 0) { - printf("substraction failed"); + printf("subtraction failed"); } if (crypto_core_ristretto255_is_valid_point(s2) == 0) { printf("invalid point"); @@ -180,7 +181,7 @@ printf("s2 + s - s_ != s\n"); } if (crypto_core_ristretto255_sub(s2, s2, s) != 0) { - printf("substraction failed"); + printf("subtraction failed"); } if (crypto_core_ristretto255_is_valid_point(s2) == -1) { printf("s + s' - s - s' != 0"); diff -Nru python-nacl-1.4.0/src/libsodium/test/default/hash2.exp python-nacl-1.5.0/src/libsodium/test/default/hash2.exp --- python-nacl-1.4.0/src/libsodium/test/default/hash2.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/hash2.exp 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -24f950aac7b9ea9b3cb728228a0c82b67c39e96b4b344798870d5daee93e3ae5931baae8c7cacfea4b629452c38026a81d138bc7aad1af3ef7bfd5ec646d6c28 diff -Nru python-nacl-1.4.0/src/libsodium/test/default/index.html.tpl python-nacl-1.5.0/src/libsodium/test/default/index.html.tpl --- python-nacl-1.4.0/src/libsodium/test/default/index.html.tpl 1970-01-01 00:00:00.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/index.html.tpl 2022-01-07 21:54:10.000000000 +0000 @@ -0,0 +1,98 @@ + + + + + + + +

+
+ + + diff -Nru python-nacl-1.4.0/src/libsodium/test/default/Makefile.am python-nacl-1.5.0/src/libsodium/test/default/Makefile.am --- python-nacl-1.4.0/src/libsodium/test/default/Makefile.am 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/Makefile.am 2022-01-07 21:54:10.000000000 +0000 @@ -38,7 +38,6 @@ generichash2.exp \ generichash3.exp \ hash.exp \ - hash2.exp \ hash3.exp \ kdf.exp \ keygen.exp \ diff -Nru python-nacl-1.4.0/src/libsodium/test/default/Makefile.in python-nacl-1.5.0/src/libsodium/test/default/Makefile.in --- python-nacl-1.4.0/src/libsodium/test/default/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,6 +87,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ @EMSCRIPTEN_FALSE@am__append_1 = \ @EMSCRIPTEN_FALSE@ sodium_utils2 \ @EMSCRIPTEN_FALSE@ sodium_utils3 @@ -105,7 +106,8 @@ subdir = test/default ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -705,6 +707,7 @@ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` +AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)' RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log @@ -736,7 +739,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -820,6 +822,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -880,11 +883,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -929,7 +937,6 @@ generichash2.exp \ generichash3.exp \ hash.exp \ - hash2.exp \ hash3.exp \ kdf.exp \ keygen.exp \ @@ -1864,7 +1871,7 @@ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ - echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ + echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ diff -Nru python-nacl-1.4.0/src/libsodium/test/default/pwhash_scrypt.c python-nacl-1.5.0/src/libsodium/test/default/pwhash_scrypt.c --- python-nacl-1.4.0/src/libsodium/test/default/pwhash_scrypt.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/pwhash_scrypt.c 2022-01-07 21:54:10.000000000 +0000 @@ -297,16 +297,12 @@ { char *str_out; char *str_out2; - char *salt; const char *passwd = "Correct Horse Battery Staple"; - salt = (char *) sodium_malloc(crypto_pwhash_scryptsalsa208sha256_SALTBYTES); str_out = (char *) sodium_malloc(crypto_pwhash_scryptsalsa208sha256_STRBYTES); str_out2 = (char *) sodium_malloc(crypto_pwhash_scryptsalsa208sha256_STRBYTES); - memcpy(salt, "[<~A 32-bytes salt for scrypt~>]", - crypto_pwhash_scryptsalsa208sha256_SALTBYTES); if (crypto_pwhash_scryptsalsa208sha256_str(str_out, passwd, strlen(passwd), OPSLIMIT, MEMLIMIT) != 0) { printf("pwhash_str failure\n"); @@ -360,7 +356,6 @@ assert(crypto_pwhash_scryptsalsa208sha256_str_needs_rehash ("", OPSLIMIT, MEMLIMIT) == -1); - sodium_free(salt); sodium_free(str_out); sodium_free(str_out2); } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult2.c python-nacl-1.5.0/src/libsodium/test/default/scalarmult2.c --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult2.c 2022-01-07 21:54:10.000000000 +0000 @@ -8,25 +8,16 @@ 0x18, 0xb6, 0xfd, 0x1c, 0x2f, 0x8b, 0x27, 0xff, 0x88, 0xe0, 0xeb }; -static unsigned char bobpk[32]; - int main(void) { - int i; + unsigned char bobpk[32]; + char hex[65]; + int i; crypto_scalarmult_base(bobpk, bobsk); + sodium_bin2hex(hex, sizeof hex, bobpk, sizeof bobpk); + printf("%s\n", hex); - for (i = 0; i < 32; ++i) { - if (i > 0) { - printf(","); - } else { - printf(" "); - } - printf("0x%02x", (unsigned int) bobpk[i]); - if (i % 8 == 7) { - printf("\n"); - } - } return 0; } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult2.exp python-nacl-1.5.0/src/libsodium/test/default/scalarmult2.exp --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult2.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult2.exp 2022-01-07 21:54:10.000000000 +0000 @@ -1,4 +1 @@ - 0xde,0x9e,0xdb,0x7d,0x7b,0x7d,0xc1,0xb4 -,0xd3,0x5b,0x61,0xc2,0xec,0xe4,0x35,0x37 -,0x3f,0x83,0x43,0xc8,0x5b,0x78,0x67,0x4d -,0xad,0xfc,0x7e,0x14,0x6f,0x88,0x2b,0x4f +de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult5.c python-nacl-1.5.0/src/libsodium/test/default/scalarmult5.c --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult5.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult5.c 2022-01-07 21:54:10.000000000 +0000 @@ -14,27 +14,18 @@ 0x78, 0x67, 0x4d, 0xad, 0xfc, 0x7e, 0x14, 0x6f, 0x88, 0x2b, 0x4f }; -static unsigned char k[32]; - int main(void) { - int i; - int ret; + unsigned char k[32]; + char hex[65]; + int i; + int ret; ret = crypto_scalarmult(k, alicesk, bobpk); assert(ret == 0); + sodium_bin2hex(hex, sizeof hex, k, sizeof k); + printf("%s\n", hex); - for (i = 0; i < 32; ++i) { - if (i > 0) { - printf(","); - } else { - printf(" "); - } - printf("0x%02x", (unsigned int) k[i]); - if (i % 8 == 7) { - printf("\n"); - } - } return 0; } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult5.exp python-nacl-1.5.0/src/libsodium/test/default/scalarmult5.exp --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult5.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult5.exp 2022-01-07 21:54:10.000000000 +0000 @@ -1,4 +1 @@ - 0x4a,0x5d,0x9d,0x5b,0xa4,0xce,0x2d,0xe1 -,0x72,0x8e,0x3b,0xf4,0x80,0x35,0x0f,0x25 -,0xe0,0x7e,0x21,0xc9,0x47,0xd1,0x9e,0x33 -,0x76,0xf0,0x9b,0x3c,0x1e,0x16,0x17,0x42 +4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult.c python-nacl-1.5.0/src/libsodium/test/default/scalarmult.c --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult.c 2022-01-07 21:54:10.000000000 +0000 @@ -52,6 +52,12 @@ sodium_bin2hex(hex, sizeof hex, k, crypto_scalarmult_BYTES); printf("%s\n", hex); + alicepk[31] ^= 0x80; + ret = crypto_scalarmult(k, bobsk, alicepk); + assert(ret == 0); + sodium_bin2hex(hex, sizeof hex, k, crypto_scalarmult_BYTES); + printf("%s\n", hex); + ret = crypto_scalarmult(k, bobsk, small_order_p); assert(ret == -1); diff -Nru python-nacl-1.4.0/src/libsodium/test/default/scalarmult.exp python-nacl-1.5.0/src/libsodium/test/default/scalarmult.exp --- python-nacl-1.4.0/src/libsodium/test/default/scalarmult.exp 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/scalarmult.exp 2022-01-07 21:54:10.000000000 +0000 @@ -2,3 +2,4 @@ de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f 4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 +4a5d9d5ba4ce2de1728e3bf480350f25e07e21c947d19e3376f09b3c1e161742 diff -Nru python-nacl-1.4.0/src/libsodium/test/default/sodium_utils2.c python-nacl-1.5.0/src/libsodium/test/default/sodium_utils2.c --- python-nacl-1.4.0/src/libsodium/test/default/sodium_utils2.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/sodium_utils2.c 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,9 @@ #include #include -#include +#ifdef HAVE_CATCHABLE_SEGV +# include +#endif #define TEST_NAME "sodium_utils2" #include "cmptest.h" diff -Nru python-nacl-1.4.0/src/libsodium/test/default/sodium_utils3.c python-nacl-1.5.0/src/libsodium/test/default/sodium_utils3.c --- python-nacl-1.4.0/src/libsodium/test/default/sodium_utils3.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/sodium_utils3.c 2022-01-07 21:54:10.000000000 +0000 @@ -3,7 +3,9 @@ #include #include -#include +#ifdef HAVE_CATCHABLE_SEGV +# include +#endif #define TEST_NAME "sodium_utils3" #include "cmptest.h" diff -Nru python-nacl-1.4.0/src/libsodium/test/default/stream3.c python-nacl-1.5.0/src/libsodium/test/default/stream3.c --- python-nacl-1.4.0/src/libsodium/test/default/stream3.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/stream3.c 2022-01-07 21:54:10.000000000 +0000 @@ -24,8 +24,9 @@ for (i = 0; i < 32; ++i) { printf(",0x%02x", (unsigned int) rs[i]); - if (i % 8 == 7) + if (i % 8 == 7) { printf("\n"); + } } return 0; } diff -Nru python-nacl-1.4.0/src/libsodium/test/default/stream4.c python-nacl-1.5.0/src/libsodium/test/default/stream4.c --- python-nacl-1.4.0/src/libsodium/test/default/stream4.c 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/stream4.c 2022-01-07 21:54:10.000000000 +0000 @@ -41,8 +41,9 @@ for (i = 32; i < 163; ++i) { printf(",0x%02x", (unsigned int) c[i]); - if (i % 8 == 7) + if (i % 8 == 7) { printf("\n"); + } } printf("\n"); diff -Nru python-nacl-1.4.0/src/libsodium/test/default/wasi-test-wrapper.sh python-nacl-1.5.0/src/libsodium/test/default/wasi-test-wrapper.sh --- python-nacl-1.4.0/src/libsodium/test/default/wasi-test-wrapper.sh 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/default/wasi-test-wrapper.sh 2022-01-07 21:54:10.000000000 +0000 @@ -2,27 +2,84 @@ MAX_MEMORY_TESTS="67108864" +unset LDFLAGS +unset CFLAGS + +if command -v wasm-opt >/dev/null; then + wasm-opt -O4 -o "${1}.tmp" "$1" && mv -f "${1}.tmp" "$1" +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wavm" ]; then + if command -v wavm >/dev/null; then + wavm run --abi=wasi "$1" && exit 0 + fi +fi + if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmtime" ]; then if command -v wasmtime >/dev/null; then - wasmtime -o --dir=. "$1" && exit 0 + wasmtime run --dir=. "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then + if command -v wasmer >/dev/null; then + wasmer run "$1" "--${WASMER_BACKEND:-cranelift}" --dir=. && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasm3" ]; then + if command -v wasm3 >/dev/null; then + wasm3 "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "iwasm" ]; then + if iwasm | grep -qi wasi >/dev/null 2>&1; then + iwasm "$1" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "ssvm" ]; then + if command -v ssvmc >/dev/null && command -v ssvm >/dev/null; then + ssvmc "$1" "${1}.so" && + ssvm --dir=.:. "${1}.so" && + rm -f "${1}.so" + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "node" ]; then + if echo | node --experimental-wasi-unstable-preview1 >/dev/null 2>&1; then + { + echo "import fs from 'fs'; import { WASI } from 'wasi';" + echo "const wasi = new WASI({args: process.argv, env: process.env, preopens: {'.':'.'}});" + echo "const importObject = { wasi_snapshot_preview1: wasi.wasiImport };" + echo "const wasm = await WebAssembly.compile(fs.readFileSync('${1}'));" + echo "const instance = await WebAssembly.instantiate(wasm, importObject);" + echo "wasi.start(instance);" + } >"${1}.mjs" + cat "${1}.mjs" >/tmp/a + node --experimental-wasi-unstable-preview1 "${1}.mjs" 2>/tmp/err && + rm -f "${1}.mjs" && exit 0 + fi +fi + +if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer-js" ]; then + if command -v wasmer-js >/dev/null; then + wasmer-js run "$1" --dir=. && exit 0 fi fi if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "lucet" ]; then if command -v lucetc-wasi >/dev/null && command -v lucet-wasi >/dev/null; then lucetc-wasi \ - --reserved-size "${MAX_MEMORY_TESTS}" \ - -o "${1}.so" --opt-level fast "$1" && + --target-cpu native \ + --reserved-size "4GiB" \ + --opt-level speed \ + "$1" -o "${1}.so" && lucet-wasi --dir=.:. --max-heap-size "${MAX_MEMORY_TESTS}" "${1}.so" && rm -f "${1}.so" && exit 0 fi fi -if [ -z "$WASI_RUNTIME" ] || [ "$WASI_RUNTIME" = "wasmer" ]; then - if command -v wasmer >/dev/null; then - wasmer run "$1" --backend "${WASMER_BACKEND:-cranelift}" --dir=. && exit 0 - fi -fi - echo "WebAssembly runtime failed" >&2 exit 1 diff -Nru python-nacl-1.4.0/src/libsodium/test/Makefile.in python-nacl-1.5.0/src/libsodium/test/Makefile.in --- python-nacl-1.4.0/src/libsodium/test/Makefile.in 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/libsodium/test/Makefile.in 2022-01-07 21:54:10.000000000 +0000 @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.16.1 from Makefile.am. +# Makefile.in generated by automake 1.16.3 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2020 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -87,9 +87,11 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +target_triplet = @target@ subdir = test ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_add_fortify_source.m4 \ + $(top_srcdir)/m4/ax_check_catchable_abrt.m4 \ $(top_srcdir)/m4/ax_check_catchable_segv.m4 \ $(top_srcdir)/m4/ax_check_compile_flag.m4 \ $(top_srcdir)/m4/ax_check_define.m4 \ @@ -193,7 +195,6 @@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ -AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ @@ -277,6 +278,7 @@ PKGCONFIG_LIBS_PRIVATE = @PKGCONFIG_LIBS_PRIVATE@ PTHREAD_CC = @PTHREAD_CC@ PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_CXX = @PTHREAD_CXX@ PTHREAD_LIBS = @PTHREAD_LIBS@ RANLIB = @RANLIB@ SAFECODE_HOME = @SAFECODE_HOME@ @@ -337,11 +339,16 @@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ +target = @target@ target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_aead.py python-nacl-1.5.0/src/nacl/bindings/crypto_aead.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_aead.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_aead.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import Optional from nacl import exceptions as exc from nacl._sodium import ffi, lib @@ -24,50 +23,70 @@ authenticator """ -crypto_aead_chacha20poly1305_ietf_KEYBYTES = \ +crypto_aead_chacha20poly1305_ietf_KEYBYTES: int = ( lib.crypto_aead_chacha20poly1305_ietf_keybytes() -crypto_aead_chacha20poly1305_ietf_NSECBYTES = \ +) +crypto_aead_chacha20poly1305_ietf_NSECBYTES: int = ( lib.crypto_aead_chacha20poly1305_ietf_nsecbytes() -crypto_aead_chacha20poly1305_ietf_NPUBBYTES = \ +) +crypto_aead_chacha20poly1305_ietf_NPUBBYTES: int = ( lib.crypto_aead_chacha20poly1305_ietf_npubbytes() -crypto_aead_chacha20poly1305_ietf_ABYTES = \ +) +crypto_aead_chacha20poly1305_ietf_ABYTES: int = ( lib.crypto_aead_chacha20poly1305_ietf_abytes() -crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX = \ +) +crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX: int = ( lib.crypto_aead_chacha20poly1305_ietf_messagebytes_max() -_aead_chacha20poly1305_ietf_CRYPTBYTES_MAX = \ - crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX + \ - crypto_aead_chacha20poly1305_ietf_ABYTES +) +_aead_chacha20poly1305_ietf_CRYPTBYTES_MAX = ( + crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX + + crypto_aead_chacha20poly1305_ietf_ABYTES +) -crypto_aead_chacha20poly1305_KEYBYTES = \ +crypto_aead_chacha20poly1305_KEYBYTES: int = ( lib.crypto_aead_chacha20poly1305_keybytes() -crypto_aead_chacha20poly1305_NSECBYTES = \ +) +crypto_aead_chacha20poly1305_NSECBYTES: int = ( lib.crypto_aead_chacha20poly1305_nsecbytes() -crypto_aead_chacha20poly1305_NPUBBYTES = \ +) +crypto_aead_chacha20poly1305_NPUBBYTES: int = ( lib.crypto_aead_chacha20poly1305_npubbytes() -crypto_aead_chacha20poly1305_ABYTES = \ +) +crypto_aead_chacha20poly1305_ABYTES: int = ( lib.crypto_aead_chacha20poly1305_abytes() -crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX = \ +) +crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX: int = ( lib.crypto_aead_chacha20poly1305_messagebytes_max() -_aead_chacha20poly1305_CRYPTBYTES_MAX = \ - crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX + \ - crypto_aead_chacha20poly1305_ABYTES +) +_aead_chacha20poly1305_CRYPTBYTES_MAX = ( + crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX + + crypto_aead_chacha20poly1305_ABYTES +) -crypto_aead_xchacha20poly1305_ietf_KEYBYTES = \ +crypto_aead_xchacha20poly1305_ietf_KEYBYTES: int = ( lib.crypto_aead_xchacha20poly1305_ietf_keybytes() -crypto_aead_xchacha20poly1305_ietf_NSECBYTES = \ +) +crypto_aead_xchacha20poly1305_ietf_NSECBYTES: int = ( lib.crypto_aead_xchacha20poly1305_ietf_nsecbytes() -crypto_aead_xchacha20poly1305_ietf_NPUBBYTES = \ +) +crypto_aead_xchacha20poly1305_ietf_NPUBBYTES: int = ( lib.crypto_aead_xchacha20poly1305_ietf_npubbytes() -crypto_aead_xchacha20poly1305_ietf_ABYTES = \ +) +crypto_aead_xchacha20poly1305_ietf_ABYTES: int = ( lib.crypto_aead_xchacha20poly1305_ietf_abytes() -crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX = \ +) +crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX: int = ( lib.crypto_aead_xchacha20poly1305_ietf_messagebytes_max() -_aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX = \ - crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX + \ - crypto_aead_xchacha20poly1305_ietf_ABYTES +) +_aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX = ( + crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX + + crypto_aead_xchacha20poly1305_ietf_ABYTES +) -def crypto_aead_chacha20poly1305_ietf_encrypt(message, aad, nonce, key): +def crypto_aead_chacha20poly1305_ietf_encrypt( + message: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Encrypt the given ``message`` using the IETF ratified chacha20poly1305 construction described in RFC7539. @@ -75,7 +94,7 @@ :param message: :type message: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -83,31 +102,45 @@ :return: authenticated ciphertext :rtype: bytes """ - ensure(isinstance(message, bytes), 'Input message type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(message, bytes), + "Input message type must be bytes", + raising=exc.TypeError, + ) mlen = len(message) - ensure(mlen <= crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX, - 'Message must be at most {0} bytes long'.format( - crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_chacha20poly1305_ietf_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_ietf_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_chacha20poly1305_ietf_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_ietf_KEYBYTES), - raising=exc.TypeError) + ensure( + mlen <= crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX, + "Message must be at most {} bytes long".format( + crypto_aead_chacha20poly1305_ietf_MESSAGEBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_chacha20poly1305_ietf_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_ietf_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_chacha20poly1305_ietf_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_ietf_KEYBYTES + ), + raising=exc.TypeError, + ) if aad: _aad = aad @@ -122,21 +155,17 @@ ciphertext = ffi.new("unsigned char[]", mxout) - res = lib.crypto_aead_chacha20poly1305_ietf_encrypt(ciphertext, - clen, - message, - mlen, - _aad, - aalen, - ffi.NULL, - nonce, - key) + res = lib.crypto_aead_chacha20poly1305_ietf_encrypt( + ciphertext, clen, message, mlen, _aad, aalen, ffi.NULL, nonce, key + ) ensure(res == 0, "Encryption failed.", raising=exc.CryptoError) return ffi.buffer(ciphertext, clen[0])[:] -def crypto_aead_chacha20poly1305_ietf_decrypt(ciphertext, aad, nonce, key): +def crypto_aead_chacha20poly1305_ietf_decrypt( + ciphertext: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Decrypt the given ``ciphertext`` using the IETF ratified chacha20poly1305 construction described in RFC7539. @@ -144,7 +173,7 @@ :param ciphertext: :type ciphertext: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -152,32 +181,45 @@ :return: message :rtype: bytes """ - ensure(isinstance(ciphertext, bytes), - 'Input ciphertext type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(ciphertext, bytes), + "Input ciphertext type must be bytes", + raising=exc.TypeError, + ) clen = len(ciphertext) - ensure(clen <= _aead_chacha20poly1305_ietf_CRYPTBYTES_MAX, - 'Ciphertext must be at most {0} bytes long'.format( - _aead_chacha20poly1305_ietf_CRYPTBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_chacha20poly1305_ietf_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_ietf_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_chacha20poly1305_ietf_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_ietf_KEYBYTES), - raising=exc.TypeError) + ensure( + clen <= _aead_chacha20poly1305_ietf_CRYPTBYTES_MAX, + "Ciphertext must be at most {} bytes long".format( + _aead_chacha20poly1305_ietf_CRYPTBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_chacha20poly1305_ietf_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_ietf_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_chacha20poly1305_ietf_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_ietf_KEYBYTES + ), + raising=exc.TypeError, + ) mxout = clen - crypto_aead_chacha20poly1305_ietf_ABYTES @@ -191,22 +233,18 @@ _aad = ffi.NULL aalen = 0 - res = lib.crypto_aead_chacha20poly1305_ietf_decrypt(message, - mlen, - ffi.NULL, - ciphertext, - clen, - _aad, - aalen, - nonce, - key) + res = lib.crypto_aead_chacha20poly1305_ietf_decrypt( + message, mlen, ffi.NULL, ciphertext, clen, _aad, aalen, nonce, key + ) ensure(res == 0, "Decryption failed.", raising=exc.CryptoError) return ffi.buffer(message, mlen[0])[:] -def crypto_aead_chacha20poly1305_encrypt(message, aad, nonce, key): +def crypto_aead_chacha20poly1305_encrypt( + message: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Encrypt the given ``message`` using the "legacy" construction described in draft-agl-tls-chacha20poly1305. @@ -214,7 +252,7 @@ :param message: :type message: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -222,31 +260,45 @@ :return: authenticated ciphertext :rtype: bytes """ - ensure(isinstance(message, bytes), 'Input message type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(message, bytes), + "Input message type must be bytes", + raising=exc.TypeError, + ) mlen = len(message) - ensure(mlen <= crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX, - 'Message must be at most {0} bytes long'.format( - crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_chacha20poly1305_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_chacha20poly1305_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_KEYBYTES), - raising=exc.TypeError) + ensure( + mlen <= crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX, + "Message must be at most {} bytes long".format( + crypto_aead_chacha20poly1305_MESSAGEBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_chacha20poly1305_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_chacha20poly1305_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_KEYBYTES + ), + raising=exc.TypeError, + ) if aad: _aad = aad @@ -262,21 +314,17 @@ ciphertext = ffi.new("unsigned char[]", mxout) - res = lib.crypto_aead_chacha20poly1305_encrypt(ciphertext, - clen, - message, - mlen, - _aad, - aalen, - ffi.NULL, - nonce, - key) + res = lib.crypto_aead_chacha20poly1305_encrypt( + ciphertext, clen, message, mlen, _aad, aalen, ffi.NULL, nonce, key + ) ensure(res == 0, "Encryption failed.", raising=exc.CryptoError) return ffi.buffer(ciphertext, clen[0])[:] -def crypto_aead_chacha20poly1305_decrypt(ciphertext, aad, nonce, key): +def crypto_aead_chacha20poly1305_decrypt( + ciphertext: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Decrypt the given ``ciphertext`` using the "legacy" construction described in draft-agl-tls-chacha20poly1305. @@ -284,7 +332,7 @@ :param ciphertext: authenticated ciphertext :type ciphertext: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -292,32 +340,45 @@ :return: message :rtype: bytes """ - ensure(isinstance(ciphertext, bytes), - 'Input ciphertext type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(ciphertext, bytes), + "Input ciphertext type must be bytes", + raising=exc.TypeError, + ) clen = len(ciphertext) - ensure(clen <= _aead_chacha20poly1305_CRYPTBYTES_MAX, - 'Ciphertext must be at most {0} bytes long'.format( - _aead_chacha20poly1305_CRYPTBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_chacha20poly1305_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_chacha20poly1305_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_chacha20poly1305_KEYBYTES), - raising=exc.TypeError) + ensure( + clen <= _aead_chacha20poly1305_CRYPTBYTES_MAX, + "Ciphertext must be at most {} bytes long".format( + _aead_chacha20poly1305_CRYPTBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_chacha20poly1305_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_chacha20poly1305_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_chacha20poly1305_KEYBYTES + ), + raising=exc.TypeError, + ) mxout = clen - crypto_aead_chacha20poly1305_ABYTES @@ -331,22 +392,18 @@ _aad = ffi.NULL aalen = 0 - res = lib.crypto_aead_chacha20poly1305_decrypt(message, - mlen, - ffi.NULL, - ciphertext, - clen, - _aad, - aalen, - nonce, - key) + res = lib.crypto_aead_chacha20poly1305_decrypt( + message, mlen, ffi.NULL, ciphertext, clen, _aad, aalen, nonce, key + ) ensure(res == 0, "Decryption failed.", raising=exc.CryptoError) return ffi.buffer(message, mlen[0])[:] -def crypto_aead_xchacha20poly1305_ietf_encrypt(message, aad, nonce, key): +def crypto_aead_xchacha20poly1305_ietf_encrypt( + message: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Encrypt the given ``message`` using the long-nonces xchacha20poly1305 construction. @@ -354,7 +411,7 @@ :param message: :type message: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -362,31 +419,45 @@ :return: authenticated ciphertext :rtype: bytes """ - ensure(isinstance(message, bytes), 'Input message type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(message, bytes), + "Input message type must be bytes", + raising=exc.TypeError, + ) mlen = len(message) - ensure(mlen <= crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX, - 'Message must be at most {0} bytes long'.format( - crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_xchacha20poly1305_ietf_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_xchacha20poly1305_ietf_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_xchacha20poly1305_ietf_KEYBYTES), - raising=exc.TypeError) + ensure( + mlen <= crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX, + "Message must be at most {} bytes long".format( + crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_xchacha20poly1305_ietf_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_xchacha20poly1305_ietf_KEYBYTES + ), + raising=exc.TypeError, + ) if aad: _aad = aad @@ -402,21 +473,17 @@ ciphertext = ffi.new("unsigned char[]", mxout) - res = lib.crypto_aead_xchacha20poly1305_ietf_encrypt(ciphertext, - clen, - message, - mlen, - _aad, - aalen, - ffi.NULL, - nonce, - key) + res = lib.crypto_aead_xchacha20poly1305_ietf_encrypt( + ciphertext, clen, message, mlen, _aad, aalen, ffi.NULL, nonce, key + ) ensure(res == 0, "Encryption failed.", raising=exc.CryptoError) return ffi.buffer(ciphertext, clen[0])[:] -def crypto_aead_xchacha20poly1305_ietf_decrypt(ciphertext, aad, nonce, key): +def crypto_aead_xchacha20poly1305_ietf_decrypt( + ciphertext: bytes, aad: Optional[bytes], nonce: bytes, key: bytes +) -> bytes: """ Decrypt the given ``ciphertext`` using the long-nonces xchacha20poly1305 construction. @@ -424,7 +491,7 @@ :param ciphertext: authenticated ciphertext :type ciphertext: bytes :param aad: - :type aad: bytes + :type aad: Optional[bytes] :param nonce: :type nonce: bytes :param key: @@ -432,32 +499,45 @@ :return: message :rtype: bytes """ - ensure(isinstance(ciphertext, bytes), - 'Input ciphertext type must be bytes', - raising=exc.TypeError) + ensure( + isinstance(ciphertext, bytes), + "Input ciphertext type must be bytes", + raising=exc.TypeError, + ) clen = len(ciphertext) - ensure(clen <= _aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX, - 'Ciphertext must be at most {0} bytes long'.format( - _aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX), - raising=exc.ValueError) - - ensure(isinstance(aad, bytes) or (aad is None), - 'Additional data must be bytes or None', - raising=exc.TypeError) - - ensure(isinstance(nonce, bytes) and - len(nonce) == crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, - 'Nonce must be a {0} bytes long bytes sequence'.format( - crypto_aead_xchacha20poly1305_ietf_NPUBBYTES), - raising=exc.TypeError) - - ensure(isinstance(key, bytes) and - len(key) == crypto_aead_xchacha20poly1305_ietf_KEYBYTES, - 'Key must be a {0} bytes long bytes sequence'.format( - crypto_aead_xchacha20poly1305_ietf_KEYBYTES), - raising=exc.TypeError) + ensure( + clen <= _aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX, + "Ciphertext must be at most {} bytes long".format( + _aead_xchacha20poly1305_ietf_CRYPTBYTES_MAX + ), + raising=exc.ValueError, + ) + + ensure( + isinstance(aad, bytes) or (aad is None), + "Additional data must be bytes or None", + raising=exc.TypeError, + ) + + ensure( + isinstance(nonce, bytes) + and len(nonce) == crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, + "Nonce must be a {} bytes long bytes sequence".format( + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(key, bytes) + and len(key) == crypto_aead_xchacha20poly1305_ietf_KEYBYTES, + "Key must be a {} bytes long bytes sequence".format( + crypto_aead_xchacha20poly1305_ietf_KEYBYTES + ), + raising=exc.TypeError, + ) mxout = clen - crypto_aead_xchacha20poly1305_ietf_ABYTES mlen = ffi.new("unsigned long long *") @@ -470,15 +550,9 @@ _aad = ffi.NULL aalen = 0 - res = lib.crypto_aead_xchacha20poly1305_ietf_decrypt(message, - mlen, - ffi.NULL, - ciphertext, - clen, - _aad, - aalen, - nonce, - key) + res = lib.crypto_aead_xchacha20poly1305_ietf_decrypt( + message, mlen, ffi.NULL, ciphertext, clen, _aad, aalen, nonce, key + ) ensure(res == 0, "Decryption failed.", raising=exc.CryptoError) diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_box.py python-nacl-1.5.0/src/nacl/bindings/crypto_box.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_box.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_box.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import Tuple from nacl import exceptions as exc from nacl._sodium import ffi, lib @@ -22,17 +21,17 @@ __all__ = ["crypto_box_keypair", "crypto_box"] -crypto_box_SECRETKEYBYTES = lib.crypto_box_secretkeybytes() -crypto_box_PUBLICKEYBYTES = lib.crypto_box_publickeybytes() -crypto_box_SEEDBYTES = lib.crypto_box_seedbytes() -crypto_box_NONCEBYTES = lib.crypto_box_noncebytes() -crypto_box_ZEROBYTES = lib.crypto_box_zerobytes() -crypto_box_BOXZEROBYTES = lib.crypto_box_boxzerobytes() -crypto_box_BEFORENMBYTES = lib.crypto_box_beforenmbytes() -crypto_box_SEALBYTES = lib.crypto_box_sealbytes() +crypto_box_SECRETKEYBYTES: int = lib.crypto_box_secretkeybytes() +crypto_box_PUBLICKEYBYTES: int = lib.crypto_box_publickeybytes() +crypto_box_SEEDBYTES: int = lib.crypto_box_seedbytes() +crypto_box_NONCEBYTES: int = lib.crypto_box_noncebytes() +crypto_box_ZEROBYTES: int = lib.crypto_box_zerobytes() +crypto_box_BOXZEROBYTES: int = lib.crypto_box_boxzerobytes() +crypto_box_BEFORENMBYTES: int = lib.crypto_box_beforenmbytes() +crypto_box_SEALBYTES: int = lib.crypto_box_sealbytes() -def crypto_box_keypair(): +def crypto_box_keypair() -> Tuple[bytes, bytes]: """ Returns a randomly generated public and secret key. @@ -42,9 +41,7 @@ sk = ffi.new("unsigned char[]", crypto_box_SECRETKEYBYTES) rc = lib.crypto_box_keypair(pk, sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ( ffi.buffer(pk, crypto_box_PUBLICKEYBYTES)[:], @@ -52,7 +49,7 @@ ) -def crypto_box_seed_keypair(seed): +def crypto_box_seed_keypair(seed: bytes) -> Tuple[bytes, bytes]: """ Returns a (public, secret) keypair deterministically generated from an input ``seed``. @@ -69,9 +66,7 @@ :param seed: bytes :rtype: (bytes(public_key), bytes(secret_key)) """ - ensure(isinstance(seed, bytes), - "seed must be bytes", - raising=TypeError) + ensure(isinstance(seed, bytes), "seed must be bytes", raising=TypeError) if len(seed) != crypto_box_SEEDBYTES: raise exc.ValueError("Invalid seed") @@ -80,9 +75,7 @@ sk = ffi.new("unsigned char[]", crypto_box_SECRETKEYBYTES) rc = lib.crypto_box_seed_keypair(pk, sk, seed) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ( ffi.buffer(pk, crypto_box_PUBLICKEYBYTES)[:], @@ -90,7 +83,7 @@ ) -def crypto_box(message, nonce, pk, sk): +def crypto_box(message: bytes, nonce: bytes, pk: bytes, sk: bytes) -> bytes: """ Encrypts and returns a message ``message`` using the secret key ``sk``, public key ``pk``, and the nonce ``nonce``. @@ -114,14 +107,14 @@ ciphertext = ffi.new("unsigned char[]", len(padded)) rc = lib.crypto_box(ciphertext, padded, len(padded), nonce, pk, sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(ciphertext, len(padded))[crypto_box_BOXZEROBYTES:] -def crypto_box_open(ciphertext, nonce, pk, sk): +def crypto_box_open( + ciphertext: bytes, nonce: bytes, pk: bytes, sk: bytes +) -> bytes: """ Decrypts and returns an encrypted message ``ciphertext``, using the secret key ``sk``, public key ``pk``, and the nonce ``nonce``. @@ -145,13 +138,16 @@ plaintext = ffi.new("unsigned char[]", len(padded)) res = lib.crypto_box_open(plaintext, padded, len(padded), nonce, pk, sk) - ensure(res == 0, "An error occurred trying to decrypt the message", - raising=exc.CryptoError) + ensure( + res == 0, + "An error occurred trying to decrypt the message", + raising=exc.CryptoError, + ) return ffi.buffer(plaintext, len(padded))[crypto_box_ZEROBYTES:] -def crypto_box_beforenm(pk, sk): +def crypto_box_beforenm(pk: bytes, sk: bytes) -> bytes: """ Computes and returns the shared key for the public key ``pk`` and the secret key ``sk``. This can be used to speed up operations where the same @@ -170,14 +166,12 @@ k = ffi.new("unsigned char[]", crypto_box_BEFORENMBYTES) rc = lib.crypto_box_beforenm(k, pk, sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(k, crypto_box_BEFORENMBYTES)[:] -def crypto_box_afternm(message, nonce, k): +def crypto_box_afternm(message: bytes, nonce: bytes, k: bytes) -> bytes: """ Encrypts and returns the message ``message`` using the shared key ``k`` and the nonce ``nonce``. @@ -197,14 +191,14 @@ ciphertext = ffi.new("unsigned char[]", len(padded)) rc = lib.crypto_box_afternm(ciphertext, padded, len(padded), nonce, k) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(ciphertext, len(padded))[crypto_box_BOXZEROBYTES:] -def crypto_box_open_afternm(ciphertext, nonce, k): +def crypto_box_open_afternm( + ciphertext: bytes, nonce: bytes, k: bytes +) -> bytes: """ Decrypts and returns the encrypted message ``ciphertext``, using the shared key ``k`` and the nonce ``nonce``. @@ -223,15 +217,17 @@ padded = (b"\x00" * crypto_box_BOXZEROBYTES) + ciphertext plaintext = ffi.new("unsigned char[]", len(padded)) - res = lib.crypto_box_open_afternm( - plaintext, padded, len(padded), nonce, k) - ensure(res == 0, "An error occurred trying to decrypt the message", - raising=exc.CryptoError) + res = lib.crypto_box_open_afternm(plaintext, padded, len(padded), nonce, k) + ensure( + res == 0, + "An error occurred trying to decrypt the message", + raising=exc.CryptoError, + ) return ffi.buffer(plaintext, len(padded))[crypto_box_ZEROBYTES:] -def crypto_box_seal(message, pk): +def crypto_box_seal(message: bytes, pk: bytes) -> bytes: """ Encrypts and returns a message ``message`` using an ephemeral secret key and the public key ``pk``. @@ -245,13 +241,15 @@ .. versionadded:: 1.2 """ - ensure(isinstance(message, bytes), - "input message must be bytes", - raising=TypeError) - - ensure(isinstance(pk, bytes), - "public key must be bytes", - raising=TypeError) + ensure( + isinstance(message, bytes), + "input message must be bytes", + raising=TypeError, + ) + + ensure( + isinstance(pk, bytes), "public key must be bytes", raising=TypeError + ) if len(pk) != crypto_box_PUBLICKEYBYTES: raise exc.ValueError("Invalid public key") @@ -262,14 +260,12 @@ ciphertext = ffi.new("unsigned char[]", _clen) rc = lib.crypto_box_seal(ciphertext, message, _mlen, pk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(ciphertext, _clen)[:] -def crypto_box_seal_open(ciphertext, pk, sk): +def crypto_box_seal_open(ciphertext: bytes, pk: bytes, sk: bytes) -> bytes: """ Decrypts and returns an encrypted message ``ciphertext``, using the recipent's secret key ``sk`` and the sender's ephemeral public key @@ -283,17 +279,19 @@ .. versionadded:: 1.2 """ - ensure(isinstance(ciphertext, bytes), - "input ciphertext must be bytes", - raising=TypeError) - - ensure(isinstance(pk, bytes), - "public key must be bytes", - raising=TypeError) - - ensure(isinstance(sk, bytes), - "secret key must be bytes", - raising=TypeError) + ensure( + isinstance(ciphertext, bytes), + "input ciphertext must be bytes", + raising=TypeError, + ) + + ensure( + isinstance(pk, bytes), "public key must be bytes", raising=TypeError + ) + + ensure( + isinstance(sk, bytes), "secret key must be bytes", raising=TypeError + ) if len(pk) != crypto_box_PUBLICKEYBYTES: raise exc.ValueError("Invalid public key") @@ -303,10 +301,13 @@ _clen = len(ciphertext) - ensure(_clen >= crypto_box_SEALBYTES, - ("Input cyphertext must be " - "at least {} long").format(crypto_box_SEALBYTES), - raising=exc.TypeError) + ensure( + _clen >= crypto_box_SEALBYTES, + ("Input cyphertext must be at least {} long").format( + crypto_box_SEALBYTES + ), + raising=exc.TypeError, + ) _mlen = _clen - crypto_box_SEALBYTES @@ -314,7 +315,10 @@ plaintext = ffi.new("unsigned char[]", max(1, _mlen)) res = lib.crypto_box_seal_open(plaintext, ciphertext, _clen, pk, sk) - ensure(res == 0, "An error occurred trying to decrypt the message", - raising=exc.CryptoError) + ensure( + res == 0, + "An error occurred trying to decrypt the message", + raising=exc.CryptoError, + ) return ffi.buffer(plaintext, _mlen)[:] diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_core.py python-nacl-1.5.0/src/nacl/bindings/crypto_core.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_core.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_core.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib @@ -27,13 +26,13 @@ if has_crypto_core_ed25519: crypto_core_ed25519_BYTES = lib.crypto_core_ed25519_bytes() - crypto_core_ed25519_SCALARBYTES = \ - lib.crypto_core_ed25519_scalarbytes() - crypto_core_ed25519_NONREDUCEDSCALARBYTES = \ + crypto_core_ed25519_SCALARBYTES = lib.crypto_core_ed25519_scalarbytes() + crypto_core_ed25519_NONREDUCEDSCALARBYTES = ( lib.crypto_core_ed25519_nonreducedscalarbytes() + ) -def crypto_core_ed25519_is_valid_point(p): +def crypto_core_ed25519_is_valid_point(p: bytes) -> bool: """ Check if ``p`` represents a point on the edwards25519 curve, in canonical form, on the main subgroup, and that the point doesn't have a small order. @@ -46,19 +45,23 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and len(p) == crypto_core_ed25519_BYTES, - 'Point must be a crypto_core_ed25519_BYTES long bytes sequence', - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) and len(p) == crypto_core_ed25519_BYTES, + "Point must be a crypto_core_ed25519_BYTES long bytes sequence", + raising=exc.TypeError, + ) rc = lib.crypto_core_ed25519_is_valid_point(p) return rc == 1 -def crypto_core_ed25519_add(p, q): +def crypto_core_ed25519_add(p: bytes, q: bytes) -> bytes: """ Add two points on the edwards25519 curve. @@ -74,28 +77,32 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and isinstance(q, bytes) and - len(p) == crypto_core_ed25519_BYTES and - len(q) == crypto_core_ed25519_BYTES, - 'Each point must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_BYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) + and isinstance(q, bytes) + and len(p) == crypto_core_ed25519_BYTES + and len(q) == crypto_core_ed25519_BYTES, + "Each point must be a {} long bytes sequence".format( + "crypto_core_ed25519_BYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_BYTES) rc = lib.crypto_core_ed25519_add(r, p, q) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(r, crypto_core_ed25519_BYTES)[:] -def crypto_core_ed25519_sub(p, q): +def crypto_core_ed25519_sub(p: bytes, q: bytes) -> bytes: """ Subtract a point from another on the edwards25519 curve. @@ -111,28 +118,32 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and isinstance(q, bytes) and - len(p) == crypto_core_ed25519_BYTES and - len(q) == crypto_core_ed25519_BYTES, - 'Each point must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_BYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) + and isinstance(q, bytes) + and len(p) == crypto_core_ed25519_BYTES + and len(q) == crypto_core_ed25519_BYTES, + "Each point must be a {} long bytes sequence".format( + "crypto_core_ed25519_BYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_BYTES) rc = lib.crypto_core_ed25519_sub(r, p, q) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(r, crypto_core_ed25519_BYTES)[:] -def crypto_core_ed25519_scalar_invert(s): +def crypto_core_ed25519_scalar_invert(s: bytes) -> bytes: """ Return the multiplicative inverse of integer ``s`` modulo ``L``, i.e an integer ``i`` such that ``s * i = 1 (mod L)``, where ``L`` @@ -149,27 +160,29 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(s, bytes) and - len(s) == crypto_core_ed25519_SCALARBYTES, - 'Integer s must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(s, bytes) and len(s) == crypto_core_ed25519_SCALARBYTES, + "Integer s must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) rc = lib.crypto_core_ed25519_scalar_invert(r, s) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_negate(s): +def crypto_core_ed25519_scalar_negate(s: bytes) -> bytes: """ Return the integer ``n`` such that ``s + n = 0 (mod L)``, where ``L`` is the order of the main subgroup. @@ -183,15 +196,19 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(s, bytes) and - len(s) == crypto_core_ed25519_SCALARBYTES, - 'Integer s must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(s, bytes) and len(s) == crypto_core_ed25519_SCALARBYTES, + "Integer s must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) @@ -200,7 +217,7 @@ return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_complement(s): +def crypto_core_ed25519_scalar_complement(s: bytes) -> bytes: """ Return the complement of integer ``s`` modulo ``L``, i.e. an integer ``c`` such that ``s + c = 1 (mod L)``, where ``L`` is the order of @@ -215,15 +232,19 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(s, bytes) and - len(s) == crypto_core_ed25519_SCALARBYTES, - 'Integer s must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(s, bytes) and len(s) == crypto_core_ed25519_SCALARBYTES, + "Integer s must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) @@ -232,7 +253,7 @@ return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_add(p, q): +def crypto_core_ed25519_scalar_add(p: bytes, q: bytes) -> bytes: """ Add integers ``p`` and ``q`` modulo ``L``, where ``L`` is the order of the main subgroup. @@ -249,16 +270,22 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and isinstance(q, bytes) and - len(p) == crypto_core_ed25519_SCALARBYTES and - len(q) == crypto_core_ed25519_SCALARBYTES, - 'Each integer must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) + and isinstance(q, bytes) + and len(p) == crypto_core_ed25519_SCALARBYTES + and len(q) == crypto_core_ed25519_SCALARBYTES, + "Each integer must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) @@ -267,7 +294,7 @@ return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_sub(p, q): +def crypto_core_ed25519_scalar_sub(p: bytes, q: bytes) -> bytes: """ Subtract integers ``p`` and ``q`` modulo ``L``, where ``L`` is the order of the main subgroup. @@ -284,16 +311,22 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and isinstance(q, bytes) and - len(p) == crypto_core_ed25519_SCALARBYTES and - len(q) == crypto_core_ed25519_SCALARBYTES, - 'Each integer must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) + and isinstance(q, bytes) + and len(p) == crypto_core_ed25519_SCALARBYTES + and len(q) == crypto_core_ed25519_SCALARBYTES, + "Each integer must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) @@ -302,7 +335,7 @@ return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_mul(p, q): +def crypto_core_ed25519_scalar_mul(p: bytes, q: bytes) -> bytes: """ Multiply integers ``p`` and ``q`` modulo ``L``, where ``L`` is the order of the main subgroup. @@ -319,16 +352,22 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(p, bytes) and isinstance(q, bytes) and - len(p) == crypto_core_ed25519_SCALARBYTES and - len(q) == crypto_core_ed25519_SCALARBYTES, - 'Each integer must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(p, bytes) + and isinstance(q, bytes) + and len(p) == crypto_core_ed25519_SCALARBYTES + and len(q) == crypto_core_ed25519_SCALARBYTES, + "Each integer must be a {} long bytes sequence".format( + "crypto_core_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) @@ -337,7 +376,7 @@ return ffi.buffer(r, crypto_core_ed25519_SCALARBYTES)[:] -def crypto_core_ed25519_scalar_reduce(s): +def crypto_core_ed25519_scalar_reduce(s: bytes) -> bytes: """ Reduce integer ``s`` to ``s`` modulo ``L``, where ``L`` is the order of the main subgroup. @@ -351,15 +390,20 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_core_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(s, bytes) and - len(s) == crypto_core_ed25519_NONREDUCEDSCALARBYTES, - 'Integer s must be a {} long bytes sequence'.format( - 'crypto_core_ed25519_NONREDUCEDSCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_core_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(s, bytes) + and len(s) == crypto_core_ed25519_NONREDUCEDSCALARBYTES, + "Integer s must be a {} long bytes sequence".format( + "crypto_core_ed25519_NONREDUCEDSCALARBYTES" + ), + raising=exc.TypeError, + ) r = ffi.new("unsigned char[]", crypto_core_ed25519_SCALARBYTES) diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_generichash.py python-nacl-1.5.0/src/nacl/bindings/crypto_generichash.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_generichash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_generichash.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,72 +11,97 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - -from six import integer_types +from typing import NoReturn, TypeVar from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -crypto_generichash_BYTES = lib.crypto_generichash_blake2b_bytes() -crypto_generichash_BYTES_MIN = lib.crypto_generichash_blake2b_bytes_min() -crypto_generichash_BYTES_MAX = lib.crypto_generichash_blake2b_bytes_max() -crypto_generichash_KEYBYTES = lib.crypto_generichash_blake2b_keybytes() -crypto_generichash_KEYBYTES_MIN = lib.crypto_generichash_blake2b_keybytes_min() -crypto_generichash_KEYBYTES_MAX = lib.crypto_generichash_blake2b_keybytes_max() -crypto_generichash_SALTBYTES = lib.crypto_generichash_blake2b_saltbytes() -crypto_generichash_PERSONALBYTES = \ +crypto_generichash_BYTES: int = lib.crypto_generichash_blake2b_bytes() +crypto_generichash_BYTES_MIN: int = lib.crypto_generichash_blake2b_bytes_min() +crypto_generichash_BYTES_MAX: int = lib.crypto_generichash_blake2b_bytes_max() +crypto_generichash_KEYBYTES: int = lib.crypto_generichash_blake2b_keybytes() +crypto_generichash_KEYBYTES_MIN: int = ( + lib.crypto_generichash_blake2b_keybytes_min() +) +crypto_generichash_KEYBYTES_MAX: int = ( + lib.crypto_generichash_blake2b_keybytes_max() +) +crypto_generichash_SALTBYTES: int = lib.crypto_generichash_blake2b_saltbytes() +crypto_generichash_PERSONALBYTES: int = ( lib.crypto_generichash_blake2b_personalbytes() -crypto_generichash_STATEBYTES = lib.crypto_generichash_statebytes() - -_OVERLONG = '{0} length greater than {1} bytes' -_TOOBIG = '{0} greater than {1}' - - -def _checkparams(digest_size, key, salt, person): - """Check hash paramters""" - ensure(isinstance(key, bytes), - 'Key must be a bytes sequence', - raising=exc.TypeError) - - ensure(isinstance(salt, bytes), - 'Salt must be a bytes sequence', - raising=exc.TypeError) - - ensure(isinstance(person, bytes), - 'Person must be a bytes sequence', - raising=exc.TypeError) - - ensure(isinstance(digest_size, integer_types), - 'Digest size must be an integer number', - raising=exc.TypeError) - - ensure(digest_size <= crypto_generichash_BYTES_MAX, - _TOOBIG.format("Digest_size", crypto_generichash_BYTES_MAX), - raising=exc.ValueError) +) +crypto_generichash_STATEBYTES: int = lib.crypto_generichash_statebytes() - ensure(len(key) <= crypto_generichash_KEYBYTES_MAX, - _OVERLONG.format("Key", crypto_generichash_KEYBYTES_MAX), - raising=exc.ValueError) +_OVERLONG = "{0} length greater than {1} bytes" +_TOOBIG = "{0} greater than {1}" - ensure(len(salt) <= crypto_generichash_SALTBYTES, - _OVERLONG.format("Salt", crypto_generichash_SALTBYTES), - raising=exc.ValueError) - ensure(len(person) <= crypto_generichash_PERSONALBYTES, - _OVERLONG.format("Person", crypto_generichash_PERSONALBYTES), - raising=exc.ValueError) - - -def generichash_blake2b_salt_personal(data, - digest_size=crypto_generichash_BYTES, - key=b'', salt=b'', person=b''): +def _checkparams( + digest_size: int, key: bytes, salt: bytes, person: bytes +) -> None: + """Check hash parameters""" + ensure( + isinstance(key, bytes), + "Key must be a bytes sequence", + raising=exc.TypeError, + ) + + ensure( + isinstance(salt, bytes), + "Salt must be a bytes sequence", + raising=exc.TypeError, + ) + + ensure( + isinstance(person, bytes), + "Person must be a bytes sequence", + raising=exc.TypeError, + ) + + ensure( + isinstance(digest_size, int), + "Digest size must be an integer number", + raising=exc.TypeError, + ) + + ensure( + digest_size <= crypto_generichash_BYTES_MAX, + _TOOBIG.format("Digest_size", crypto_generichash_BYTES_MAX), + raising=exc.ValueError, + ) + + ensure( + len(key) <= crypto_generichash_KEYBYTES_MAX, + _OVERLONG.format("Key", crypto_generichash_KEYBYTES_MAX), + raising=exc.ValueError, + ) + + ensure( + len(salt) <= crypto_generichash_SALTBYTES, + _OVERLONG.format("Salt", crypto_generichash_SALTBYTES), + raising=exc.ValueError, + ) + + ensure( + len(person) <= crypto_generichash_PERSONALBYTES, + _OVERLONG.format("Person", crypto_generichash_PERSONALBYTES), + raising=exc.ValueError, + ) + + +def generichash_blake2b_salt_personal( + data: bytes, + digest_size: int = crypto_generichash_BYTES, + key: bytes = b"", + salt: bytes = b"", + person: bytes = b"", +) -> bytes: """One shot hash interface :param data: the input data to the hash function + :type data: bytes :param digest_size: must be at most :py:data:`.crypto_generichash_BYTES_MAX`; the default digest size is @@ -99,9 +124,11 @@ _checkparams(digest_size, key, salt, person) - ensure(isinstance(data, bytes), - 'Input data must be a bytes sequence', - raising=exc.TypeError) + ensure( + isinstance(data, bytes), + "Input data must be a bytes sequence", + raising=exc.TypeError, + ) digest = ffi.new("unsigned char[]", digest_size) @@ -112,45 +139,53 @@ ffi.memmove(_salt, salt, len(salt)) ffi.memmove(_person, person, len(person)) - rc = lib.crypto_generichash_blake2b_salt_personal(digest, digest_size, - data, len(data), - key, len(key), - _salt, _person) - ensure(rc == 0, 'Unexpected failure', - raising=exc.RuntimeError) + rc = lib.crypto_generichash_blake2b_salt_personal( + digest, digest_size, data, len(data), key, len(key), _salt, _person + ) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) return ffi.buffer(digest, digest_size)[:] -class Blake2State(object): +_Blake2State = TypeVar("_Blake2State", bound="Blake2State") + + +class Blake2State: """ Python-level wrapper for the crypto_generichash_blake2b state buffer """ - __slots__ = ['_statebuf', 'digest_size'] - def __init__(self, digest_size): - self._statebuf = ffi.new("unsigned char[]", - crypto_generichash_STATEBYTES) + __slots__ = ["_statebuf", "digest_size"] + + def __init__(self, digest_size: int): + self._statebuf = ffi.new( + "unsigned char[]", crypto_generichash_STATEBYTES + ) self.digest_size = digest_size - def __reduce__(self): + def __reduce__(self) -> NoReturn: """ Raise the same exception as hashlib's blake implementation on copy.copy() """ - raise TypeError("can't pickle {} objects".format( - self.__class__.__name__)) + raise TypeError( + "can't pickle {} objects".format(self.__class__.__name__) + ) - def copy(self): + def copy(self: _Blake2State) -> _Blake2State: _st = self.__class__(self.digest_size) - ffi.memmove(_st._statebuf, - self._statebuf, crypto_generichash_STATEBYTES) + ffi.memmove( + _st._statebuf, self._statebuf, crypto_generichash_STATEBYTES + ) return _st -def generichash_blake2b_init(key=b'', salt=b'', - person=b'', - digest_size=crypto_generichash_BYTES): +def generichash_blake2b_init( + key: bytes = b"", + salt: bytes = b"", + person: bytes = b"", + digest_size: int = crypto_generichash_BYTES, +) -> Blake2State: """ Create a new initialized blake2b hash state @@ -185,17 +220,15 @@ ffi.memmove(_salt, salt, len(salt)) ffi.memmove(_person, person, len(person)) - rc = lib.crypto_generichash_blake2b_init_salt_personal(state._statebuf, - key, len(key), - digest_size, - _salt, _person) - ensure(rc == 0, 'Unexpected failure', - raising=exc.RuntimeError) + rc = lib.crypto_generichash_blake2b_init_salt_personal( + state._statebuf, key, len(key), digest_size, _salt, _person + ) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) return state -def generichash_blake2b_update(state, data): +def generichash_blake2b_update(state: Blake2State, data: bytes) -> None: """Update the blake2b hash state :param state: a initialized Blake2bState object as returned from @@ -205,21 +238,25 @@ :type data: bytes """ - ensure(isinstance(state, Blake2State), - 'State must be a Blake2State object', - raising=exc.TypeError) - - ensure(isinstance(data, bytes), - 'Input data must be a bytes sequence', - raising=exc.TypeError) - - rc = lib.crypto_generichash_blake2b_update(state._statebuf, - data, len(data)) - ensure(rc == 0, 'Unexpected failure', - raising=exc.RuntimeError) + ensure( + isinstance(state, Blake2State), + "State must be a Blake2State object", + raising=exc.TypeError, + ) + + ensure( + isinstance(data, bytes), + "Input data must be a bytes sequence", + raising=exc.TypeError, + ) + + rc = lib.crypto_generichash_blake2b_update( + state._statebuf, data, len(data) + ) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) -def generichash_blake2b_final(state): +def generichash_blake2b_final(state: Blake2State) -> bytes: """Finalize the blake2b hash state and return the digest. :param state: a initialized Blake2bState object as returned from @@ -229,14 +266,16 @@ :rtype: bytes """ - ensure(isinstance(state, Blake2State), - 'State must be a Blake2State object', - raising=exc.TypeError) + ensure( + isinstance(state, Blake2State), + "State must be a Blake2State object", + raising=exc.TypeError, + ) _digest = ffi.new("unsigned char[]", crypto_generichash_BYTES_MAX) - rc = lib.crypto_generichash_blake2b_final(state._statebuf, - _digest, state.digest_size) + rc = lib.crypto_generichash_blake2b_final( + state._statebuf, _digest, state.digest_size + ) - ensure(rc == 0, 'Unexpected failure', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) return ffi.buffer(_digest, state.digest_size)[:] diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_hash.py python-nacl-1.5.0/src/nacl/bindings/crypto_hash.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_hash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_hash.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib @@ -20,12 +19,12 @@ # crypto_hash_BYTES = lib.crypto_hash_bytes() -crypto_hash_BYTES = lib.crypto_hash_sha512_bytes() -crypto_hash_sha256_BYTES = lib.crypto_hash_sha256_bytes() -crypto_hash_sha512_BYTES = lib.crypto_hash_sha512_bytes() +crypto_hash_BYTES: int = lib.crypto_hash_sha512_bytes() +crypto_hash_sha256_BYTES: int = lib.crypto_hash_sha256_bytes() +crypto_hash_sha512_BYTES: int = lib.crypto_hash_sha512_bytes() -def crypto_hash(message): +def crypto_hash(message: bytes) -> bytes: """ Hashes and returns the message ``message``. @@ -34,13 +33,11 @@ """ digest = ffi.new("unsigned char[]", crypto_hash_BYTES) rc = lib.crypto_hash(digest, message, len(message)) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(digest, crypto_hash_BYTES)[:] -def crypto_hash_sha256(message): +def crypto_hash_sha256(message: bytes) -> bytes: """ Hashes and returns the message ``message``. @@ -49,13 +46,11 @@ """ digest = ffi.new("unsigned char[]", crypto_hash_sha256_BYTES) rc = lib.crypto_hash_sha256(digest, message, len(message)) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(digest, crypto_hash_sha256_BYTES)[:] -def crypto_hash_sha512(message): +def crypto_hash_sha512(message: bytes) -> bytes: """ Hashes and returns the message ``message``. @@ -64,7 +59,5 @@ """ digest = ffi.new("unsigned char[]", crypto_hash_sha512_BYTES) rc = lib.crypto_hash_sha512(digest, message, len(message)) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(digest, crypto_hash_sha512_BYTES)[:] diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_kx.py python-nacl-1.5.0/src/nacl/bindings/crypto_kx.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_kx.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_kx.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,31 +11,32 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import Tuple from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -__all__ = ["crypto_kx_keypair", - "crypto_kx_client_session_keys", - "crypto_kx_server_session_keys", - "crypto_kx_PUBLIC_KEY_BYTES", - "crypto_kx_SECRET_KEY_BYTES", - "crypto_kx_SEED_BYTES", - "crypto_kx_SESSION_KEY_BYTES"] +__all__ = [ + "crypto_kx_keypair", + "crypto_kx_client_session_keys", + "crypto_kx_server_session_keys", + "crypto_kx_PUBLIC_KEY_BYTES", + "crypto_kx_SECRET_KEY_BYTES", + "crypto_kx_SEED_BYTES", + "crypto_kx_SESSION_KEY_BYTES", +] """ Implementations of client, server key exchange """ -crypto_kx_PUBLIC_KEY_BYTES = lib.crypto_kx_publickeybytes() -crypto_kx_SECRET_KEY_BYTES = lib.crypto_kx_secretkeybytes() -crypto_kx_SEED_BYTES = lib.crypto_kx_seedbytes() -crypto_kx_SESSION_KEY_BYTES = lib.crypto_kx_sessionkeybytes() +crypto_kx_PUBLIC_KEY_BYTES: int = lib.crypto_kx_publickeybytes() +crypto_kx_SECRET_KEY_BYTES: int = lib.crypto_kx_secretkeybytes() +crypto_kx_SEED_BYTES: int = lib.crypto_kx_seedbytes() +crypto_kx_SESSION_KEY_BYTES: int = lib.crypto_kx_sessionkeybytes() -def crypto_kx_keypair(): +def crypto_kx_keypair() -> Tuple[bytes, bytes]: """ Generate a keypair. This is a duplicate crypto_box_keypair, but @@ -48,11 +49,13 @@ res = lib.crypto_kx_keypair(public_key, secret_key) ensure(res == 0, "Key generation failed.", raising=exc.CryptoError) - return (ffi.buffer(public_key, crypto_kx_PUBLIC_KEY_BYTES)[:], - ffi.buffer(secret_key, crypto_kx_SECRET_KEY_BYTES)[:]) + return ( + ffi.buffer(public_key, crypto_kx_PUBLIC_KEY_BYTES)[:], + ffi.buffer(secret_key, crypto_kx_SECRET_KEY_BYTES)[:], + ) -def crypto_kx_seed_keypair(seed): +def crypto_kx_seed_keypair(seed: bytes) -> Tuple[bytes, bytes]: """ Generate a keypair with a given seed. This is functionally the same as crypto_box_seed_keypair, however @@ -65,21 +68,27 @@ """ public_key = ffi.new("unsigned char[]", crypto_kx_PUBLIC_KEY_BYTES) secret_key = ffi.new("unsigned char[]", crypto_kx_SECRET_KEY_BYTES) - ensure(isinstance(seed, bytes) and - len(seed) == crypto_kx_SEED_BYTES, - 'Seed must be a {0} byte long bytes sequence'.format( - crypto_kx_SEED_BYTES), - raising=exc.TypeError) + ensure( + isinstance(seed, bytes) and len(seed) == crypto_kx_SEED_BYTES, + "Seed must be a {} byte long bytes sequence".format( + crypto_kx_SEED_BYTES + ), + raising=exc.TypeError, + ) res = lib.crypto_kx_seed_keypair(public_key, secret_key, seed) ensure(res == 0, "Key generation failed.", raising=exc.CryptoError) - return (ffi.buffer(public_key, crypto_kx_PUBLIC_KEY_BYTES)[:], - ffi.buffer(secret_key, crypto_kx_SECRET_KEY_BYTES)[:]) + return ( + ffi.buffer(public_key, crypto_kx_PUBLIC_KEY_BYTES)[:], + ffi.buffer(secret_key, crypto_kx_SECRET_KEY_BYTES)[:], + ) -def crypto_kx_client_session_keys(client_public_key, - client_secret_key, - server_public_key): +def crypto_kx_client_session_keys( + client_public_key: bytes, + client_secret_key: bytes, + server_public_key: bytes, +) -> Tuple[bytes, bytes]: """ Generate session keys for the client. :param client_public_key: @@ -91,40 +100,53 @@ :return: (rx_key, tx_key) :rtype: (bytes, bytes) """ - ensure(isinstance(client_public_key, bytes) and - len(client_public_key) == crypto_kx_PUBLIC_KEY_BYTES, - 'Client public key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) - ensure(isinstance(client_secret_key, bytes) and - len(client_secret_key) == crypto_kx_SECRET_KEY_BYTES, - 'Client secret key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) - ensure(isinstance(server_public_key, bytes) and - len(server_public_key) == crypto_kx_PUBLIC_KEY_BYTES, - 'Server public key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) + ensure( + isinstance(client_public_key, bytes) + and len(client_public_key) == crypto_kx_PUBLIC_KEY_BYTES, + "Client public key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) + ensure( + isinstance(client_secret_key, bytes) + and len(client_secret_key) == crypto_kx_SECRET_KEY_BYTES, + "Client secret key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) + ensure( + isinstance(server_public_key, bytes) + and len(server_public_key) == crypto_kx_PUBLIC_KEY_BYTES, + "Server public key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) rx_key = ffi.new("unsigned char[]", crypto_kx_SESSION_KEY_BYTES) tx_key = ffi.new("unsigned char[]", crypto_kx_SESSION_KEY_BYTES) - res = lib.crypto_kx_client_session_keys(rx_key, - tx_key, - client_public_key, - client_secret_key, - server_public_key) - ensure(res == 0, - "Client session key generation failed.", - raising=exc.CryptoError) - - return (ffi.buffer(rx_key, crypto_kx_SESSION_KEY_BYTES)[:], - ffi.buffer(tx_key, crypto_kx_SESSION_KEY_BYTES)[:]) - - -def crypto_kx_server_session_keys(server_public_key, - server_secret_key, - client_public_key): + res = lib.crypto_kx_client_session_keys( + rx_key, tx_key, client_public_key, client_secret_key, server_public_key + ) + ensure( + res == 0, + "Client session key generation failed.", + raising=exc.CryptoError, + ) + + return ( + ffi.buffer(rx_key, crypto_kx_SESSION_KEY_BYTES)[:], + ffi.buffer(tx_key, crypto_kx_SESSION_KEY_BYTES)[:], + ) + + +def crypto_kx_server_session_keys( + server_public_key: bytes, + server_secret_key: bytes, + client_public_key: bytes, +) -> Tuple[bytes, bytes]: """ Generate session keys for the server. :param server_public_key: @@ -136,32 +158,43 @@ :return: (rx_key, tx_key) :rtype: (bytes, bytes) """ - ensure(isinstance(server_public_key, bytes) and - len(server_public_key) == crypto_kx_PUBLIC_KEY_BYTES, - 'Server public key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) - ensure(isinstance(server_secret_key, bytes) and - len(server_secret_key) == crypto_kx_SECRET_KEY_BYTES, - 'Server secret key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) - ensure(isinstance(client_public_key, bytes) and - len(client_public_key) == crypto_kx_PUBLIC_KEY_BYTES, - 'Client public key must be a {0} bytes long bytes sequence'.format( - crypto_kx_PUBLIC_KEY_BYTES), - raising=exc.TypeError) + ensure( + isinstance(server_public_key, bytes) + and len(server_public_key) == crypto_kx_PUBLIC_KEY_BYTES, + "Server public key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) + ensure( + isinstance(server_secret_key, bytes) + and len(server_secret_key) == crypto_kx_SECRET_KEY_BYTES, + "Server secret key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) + ensure( + isinstance(client_public_key, bytes) + and len(client_public_key) == crypto_kx_PUBLIC_KEY_BYTES, + "Client public key must be a {} bytes long bytes sequence".format( + crypto_kx_PUBLIC_KEY_BYTES + ), + raising=exc.TypeError, + ) rx_key = ffi.new("unsigned char[]", crypto_kx_SESSION_KEY_BYTES) tx_key = ffi.new("unsigned char[]", crypto_kx_SESSION_KEY_BYTES) - res = lib.crypto_kx_server_session_keys(rx_key, - tx_key, - server_public_key, - server_secret_key, - client_public_key) - ensure(res == 0, - "Server session key generation failed.", - raising=exc.CryptoError) - - return (ffi.buffer(rx_key, crypto_kx_SESSION_KEY_BYTES)[:], - ffi.buffer(tx_key, crypto_kx_SESSION_KEY_BYTES)[:]) + res = lib.crypto_kx_server_session_keys( + rx_key, tx_key, server_public_key, server_secret_key, client_public_key + ) + ensure( + res == 0, + "Server session key generation failed.", + raising=exc.CryptoError, + ) + + return ( + ffi.buffer(rx_key, crypto_kx_SESSION_KEY_BYTES)[:], + ffi.buffer(tx_key, crypto_kx_SESSION_KEY_BYTES)[:], + ) diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_pwhash.py python-nacl-1.5.0/src/nacl/bindings/crypto_pwhash.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_pwhash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_pwhash.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,21 +11,20 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import sys - -from six import integer_types +from typing import Tuple import nacl.exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -has_crypto_pwhash_scryptsalsa208sha256 = \ - bool(lib.PYNACL_HAS_CRYPTO_PWHASH_SCRYPTSALSA208SHA256) +has_crypto_pwhash_scryptsalsa208sha256 = bool( + lib.PYNACL_HAS_CRYPTO_PWHASH_SCRYPTSALSA208SHA256 +) -crypto_pwhash_scryptsalsa208sha256_STRPREFIX = b'' +crypto_pwhash_scryptsalsa208sha256_STRPREFIX = b"" crypto_pwhash_scryptsalsa208sha256_SALTBYTES = 0 crypto_pwhash_scryptsalsa208sha256_STRBYTES = 0 crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN = 0 @@ -42,164 +41,198 @@ crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = 0 if has_crypto_pwhash_scryptsalsa208sha256: - crypto_pwhash_scryptsalsa208sha256_STRPREFIX = \ - ffi.string(ffi.cast("char *", - lib.crypto_pwhash_scryptsalsa208sha256_strprefix() - ) - )[:] - crypto_pwhash_scryptsalsa208sha256_SALTBYTES = \ + crypto_pwhash_scryptsalsa208sha256_STRPREFIX = ffi.string( + ffi.cast("char *", lib.crypto_pwhash_scryptsalsa208sha256_strprefix()) + )[:] + crypto_pwhash_scryptsalsa208sha256_SALTBYTES = ( lib.crypto_pwhash_scryptsalsa208sha256_saltbytes() - crypto_pwhash_scryptsalsa208sha256_STRBYTES = \ + ) + crypto_pwhash_scryptsalsa208sha256_STRBYTES = ( lib.crypto_pwhash_scryptsalsa208sha256_strbytes() - crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN = \ + ) + crypto_pwhash_scryptsalsa208sha256_PASSWD_MIN = ( lib.crypto_pwhash_scryptsalsa208sha256_passwd_min() - crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX = \ + ) + crypto_pwhash_scryptsalsa208sha256_PASSWD_MAX = ( lib.crypto_pwhash_scryptsalsa208sha256_passwd_max() - crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = \ + ) + crypto_pwhash_scryptsalsa208sha256_BYTES_MIN = ( lib.crypto_pwhash_scryptsalsa208sha256_bytes_min() - crypto_pwhash_scryptsalsa208sha256_BYTES_MAX = \ + ) + crypto_pwhash_scryptsalsa208sha256_BYTES_MAX = ( lib.crypto_pwhash_scryptsalsa208sha256_bytes_max() - crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN = \ + ) + crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MIN = ( lib.crypto_pwhash_scryptsalsa208sha256_memlimit_min() - crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = \ + ) + crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_MAX = ( lib.crypto_pwhash_scryptsalsa208sha256_memlimit_max() - crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = \ + ) + crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN = ( lib.crypto_pwhash_scryptsalsa208sha256_opslimit_min() - crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX = \ + ) + crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX = ( lib.crypto_pwhash_scryptsalsa208sha256_opslimit_max() - crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = \ + ) + crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE = ( lib.crypto_pwhash_scryptsalsa208sha256_opslimit_interactive() - crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = \ + ) + crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE = ( lib.crypto_pwhash_scryptsalsa208sha256_memlimit_interactive() - crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = \ + ) + crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE = ( lib.crypto_pwhash_scryptsalsa208sha256_opslimit_sensitive() - crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = \ + ) + crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE = ( lib.crypto_pwhash_scryptsalsa208sha256_memlimit_sensitive() + ) -crypto_pwhash_ALG_ARGON2I13 = lib.crypto_pwhash_alg_argon2i13() -crypto_pwhash_ALG_ARGON2ID13 = lib.crypto_pwhash_alg_argon2id13() -crypto_pwhash_ALG_DEFAULT = lib.crypto_pwhash_alg_default() - -crypto_pwhash_SALTBYTES = lib.crypto_pwhash_saltbytes() -crypto_pwhash_STRBYTES = lib.crypto_pwhash_strbytes() - -crypto_pwhash_PASSWD_MIN = lib.crypto_pwhash_passwd_min() -crypto_pwhash_PASSWD_MAX = lib.crypto_pwhash_passwd_max() -crypto_pwhash_BYTES_MIN = lib.crypto_pwhash_bytes_min() -crypto_pwhash_BYTES_MAX = lib.crypto_pwhash_bytes_max() - -crypto_pwhash_argon2i_STRPREFIX = \ - ffi.string(ffi.cast("char *", - lib.crypto_pwhash_argon2i_strprefix() - ) - )[:] -crypto_pwhash_argon2i_MEMLIMIT_MIN = \ +crypto_pwhash_ALG_ARGON2I13: int = lib.crypto_pwhash_alg_argon2i13() +crypto_pwhash_ALG_ARGON2ID13: int = lib.crypto_pwhash_alg_argon2id13() +crypto_pwhash_ALG_DEFAULT: int = lib.crypto_pwhash_alg_default() + +crypto_pwhash_SALTBYTES: int = lib.crypto_pwhash_saltbytes() +crypto_pwhash_STRBYTES: int = lib.crypto_pwhash_strbytes() + +crypto_pwhash_PASSWD_MIN: int = lib.crypto_pwhash_passwd_min() +crypto_pwhash_PASSWD_MAX: int = lib.crypto_pwhash_passwd_max() +crypto_pwhash_BYTES_MIN: int = lib.crypto_pwhash_bytes_min() +crypto_pwhash_BYTES_MAX: int = lib.crypto_pwhash_bytes_max() + +crypto_pwhash_argon2i_STRPREFIX: bytes = ffi.string( + ffi.cast("char *", lib.crypto_pwhash_argon2i_strprefix()) +)[:] +crypto_pwhash_argon2i_MEMLIMIT_MIN: int = ( lib.crypto_pwhash_argon2i_memlimit_min() -crypto_pwhash_argon2i_MEMLIMIT_MAX = \ +) +crypto_pwhash_argon2i_MEMLIMIT_MAX: int = ( lib.crypto_pwhash_argon2i_memlimit_max() -crypto_pwhash_argon2i_OPSLIMIT_MIN = \ +) +crypto_pwhash_argon2i_OPSLIMIT_MIN: int = ( lib.crypto_pwhash_argon2i_opslimit_min() -crypto_pwhash_argon2i_OPSLIMIT_MAX = \ +) +crypto_pwhash_argon2i_OPSLIMIT_MAX: int = ( lib.crypto_pwhash_argon2i_opslimit_max() -crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE = \ +) +crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE: int = ( lib.crypto_pwhash_argon2i_opslimit_interactive() -crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE = \ +) +crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE: int = ( lib.crypto_pwhash_argon2i_memlimit_interactive() -crypto_pwhash_argon2i_OPSLIMIT_MODERATE = \ +) +crypto_pwhash_argon2i_OPSLIMIT_MODERATE: int = ( lib.crypto_pwhash_argon2i_opslimit_moderate() -crypto_pwhash_argon2i_MEMLIMIT_MODERATE = \ +) +crypto_pwhash_argon2i_MEMLIMIT_MODERATE: int = ( lib.crypto_pwhash_argon2i_memlimit_moderate() -crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE = \ +) +crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE: int = ( lib.crypto_pwhash_argon2i_opslimit_sensitive() -crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE = \ +) +crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE: int = ( lib.crypto_pwhash_argon2i_memlimit_sensitive() +) -crypto_pwhash_argon2id_STRPREFIX = \ - ffi.string(ffi.cast("char *", - lib.crypto_pwhash_argon2id_strprefix() - ) - )[:] -crypto_pwhash_argon2id_MEMLIMIT_MIN = \ +crypto_pwhash_argon2id_STRPREFIX: bytes = ffi.string( + ffi.cast("char *", lib.crypto_pwhash_argon2id_strprefix()) +)[:] +crypto_pwhash_argon2id_MEMLIMIT_MIN: int = ( lib.crypto_pwhash_argon2id_memlimit_min() -crypto_pwhash_argon2id_MEMLIMIT_MAX = \ +) +crypto_pwhash_argon2id_MEMLIMIT_MAX: int = ( lib.crypto_pwhash_argon2id_memlimit_max() -crypto_pwhash_argon2id_OPSLIMIT_MIN = \ +) +crypto_pwhash_argon2id_OPSLIMIT_MIN: int = ( lib.crypto_pwhash_argon2id_opslimit_min() -crypto_pwhash_argon2id_OPSLIMIT_MAX = \ +) +crypto_pwhash_argon2id_OPSLIMIT_MAX: int = ( lib.crypto_pwhash_argon2id_opslimit_max() -crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE = \ +) +crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE: int = ( lib.crypto_pwhash_argon2id_opslimit_interactive() -crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE = \ +) +crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE: int = ( lib.crypto_pwhash_argon2id_memlimit_interactive() -crypto_pwhash_argon2id_OPSLIMIT_MODERATE = \ +) +crypto_pwhash_argon2id_OPSLIMIT_MODERATE: int = ( lib.crypto_pwhash_argon2id_opslimit_moderate() -crypto_pwhash_argon2id_MEMLIMIT_MODERATE = \ +) +crypto_pwhash_argon2id_MEMLIMIT_MODERATE: int = ( lib.crypto_pwhash_argon2id_memlimit_moderate() -crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE = \ +) +crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE: int = ( lib.crypto_pwhash_argon2id_opslimit_sensitive() -crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE = \ +) +crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE: int = ( lib.crypto_pwhash_argon2id_memlimit_sensitive() +) -SCRYPT_OPSLIMIT_INTERACTIVE = \ +SCRYPT_OPSLIMIT_INTERACTIVE = ( crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE -SCRYPT_MEMLIMIT_INTERACTIVE = \ +) +SCRYPT_MEMLIMIT_INTERACTIVE = ( crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE -SCRYPT_OPSLIMIT_SENSITIVE = \ +) +SCRYPT_OPSLIMIT_SENSITIVE = ( crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE -SCRYPT_MEMLIMIT_SENSITIVE = \ +) +SCRYPT_MEMLIMIT_SENSITIVE = ( crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE -SCRYPT_SALTBYTES = \ - crypto_pwhash_scryptsalsa208sha256_SALTBYTES -SCRYPT_STRBYTES = \ - crypto_pwhash_scryptsalsa208sha256_STRBYTES +) +SCRYPT_SALTBYTES = crypto_pwhash_scryptsalsa208sha256_SALTBYTES +SCRYPT_STRBYTES = crypto_pwhash_scryptsalsa208sha256_STRBYTES -SCRYPT_PR_MAX = ((1 << 30) - 1) +SCRYPT_PR_MAX = (1 << 30) - 1 LOG2_UINT64_MAX = 63 UINT64_MAX = (1 << 64) - 1 SCRYPT_MAX_MEM = 32 * (1024 * 1024) -def _check_memory_occupation(n, r, p, maxmem=SCRYPT_MAX_MEM): - ensure(r != 0, 'Invalid block size', - raising=exc.ValueError) - - ensure(p != 0, 'Invalid parallelization factor', - raising=exc.ValueError) - - ensure((n & (n - 1)) == 0, 'Cost factor must be a power of 2', - raising=exc.ValueError) +def _check_memory_occupation( + n: int, r: int, p: int, maxmem: int = SCRYPT_MAX_MEM +) -> None: + ensure(r != 0, "Invalid block size", raising=exc.ValueError) + + ensure(p != 0, "Invalid parallelization factor", raising=exc.ValueError) + + ensure( + (n & (n - 1)) == 0, + "Cost factor must be a power of 2", + raising=exc.ValueError, + ) + + ensure(n > 1, "Cost factor must be at least 2", raising=exc.ValueError) + + ensure( + p <= SCRYPT_PR_MAX / r, + "p*r is greater than {}".format(SCRYPT_PR_MAX), + raising=exc.ValueError, + ) - ensure(n > 1, 'Cost factor must be at least 2', - raising=exc.ValueError) - - ensure(p <= SCRYPT_PR_MAX / r, - 'p*r is greater than {0}'.format(SCRYPT_PR_MAX), - raising=exc.ValueError) - - ensure(n < (1 << (16 * r)), - raising=exc.ValueError) + ensure(n < (1 << (16 * r)), raising=exc.ValueError) Blen = p * 128 * r i = UINT64_MAX / 128 - ensure(n + 2 <= i / r, - raising=exc.ValueError) + ensure(n + 2 <= i / r, raising=exc.ValueError) Vlen = 32 * r * (n + 2) * 4 - ensure(Blen <= UINT64_MAX - Vlen, - raising=exc.ValueError) + ensure(Blen <= UINT64_MAX - Vlen, raising=exc.ValueError) - ensure(Blen <= sys.maxsize - Vlen, - raising=exc.ValueError) + ensure(Blen <= sys.maxsize - Vlen, raising=exc.ValueError) - ensure(Blen + Vlen <= maxmem, - 'Memory limit would be exceeded with the choosen n, r, p', - raising=exc.ValueError) + ensure( + Blen + Vlen <= maxmem, + "Memory limit would be exceeded with the choosen n, r, p", + raising=exc.ValueError, + ) -def nacl_bindings_pick_scrypt_params(opslimit, memlimit): +def nacl_bindings_pick_scrypt_params( + opslimit: int, memlimit: int +) -> Tuple[int, int, int]: """Python implementation of libsodium's pickparams""" if opslimit < 32768: @@ -221,16 +254,23 @@ maxrp = (opslimit // 4) // (2 ** n_log2) - if maxrp > 0x3fffffff: # pragma: no cover - maxrp = 0x3fffffff + if maxrp > 0x3FFFFFFF: # pragma: no cover + maxrp = 0x3FFFFFFF p = maxrp // r return n_log2, r, p -def crypto_pwhash_scryptsalsa208sha256_ll(passwd, salt, n, r, p, dklen=64, - maxmem=SCRYPT_MAX_MEM): +def crypto_pwhash_scryptsalsa208sha256_ll( + passwd: bytes, + salt: bytes, + n: int, + r: int, + p: int, + dklen: int = 64, + maxmem: int = SCRYPT_MAX_MEM, +) -> bytes: """ Derive a cryptographic key using the ``passwd`` and ``salt`` given as input. @@ -252,40 +292,41 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_pwhash_scryptsalsa208sha256, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(n, integer_types), - raising=TypeError) - ensure(isinstance(r, integer_types), - raising=TypeError) - ensure(isinstance(p, integer_types), - raising=TypeError) - - ensure(isinstance(passwd, bytes), - raising=TypeError) - ensure(isinstance(salt, bytes), - raising=TypeError) + ensure( + has_crypto_pwhash_scryptsalsa208sha256, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure(isinstance(n, int), raising=TypeError) + ensure(isinstance(r, int), raising=TypeError) + ensure(isinstance(p, int), raising=TypeError) + + ensure(isinstance(passwd, bytes), raising=TypeError) + ensure(isinstance(salt, bytes), raising=TypeError) _check_memory_occupation(n, r, p, maxmem) buf = ffi.new("uint8_t[]", dklen) - ret = lib.crypto_pwhash_scryptsalsa208sha256_ll(passwd, len(passwd), - salt, len(salt), - n, r, p, - buf, dklen) - - ensure(ret == 0, 'Unexpected failure in key derivation', - raising=exc.RuntimeError) + ret = lib.crypto_pwhash_scryptsalsa208sha256_ll( + passwd, len(passwd), salt, len(salt), n, r, p, buf, dklen + ) + + ensure( + ret == 0, + "Unexpected failure in key derivation", + raising=exc.RuntimeError, + ) return ffi.buffer(ffi.cast("char *", buf), dklen)[:] def crypto_pwhash_scryptsalsa208sha256_str( - passwd, opslimit=SCRYPT_OPSLIMIT_INTERACTIVE, - memlimit=SCRYPT_MEMLIMIT_INTERACTIVE): + passwd: bytes, + opslimit: int = SCRYPT_OPSLIMIT_INTERACTIVE, + memlimit: int = SCRYPT_MEMLIMIT_INTERACTIVE, +) -> bytes: """ Derive a cryptographic key using the ``passwd`` and ``salt`` given as input, returning a string representation which includes @@ -304,24 +345,30 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_pwhash_scryptsalsa208sha256, - 'Not available in minimal build', - raising=exc.UnavailableError) + ensure( + has_crypto_pwhash_scryptsalsa208sha256, + "Not available in minimal build", + raising=exc.UnavailableError, + ) buf = ffi.new("char[]", SCRYPT_STRBYTES) - ret = lib.crypto_pwhash_scryptsalsa208sha256_str(buf, passwd, - len(passwd), - opslimit, - memlimit) - - ensure(ret == 0, 'Unexpected failure in password hashing', - raising=exc.RuntimeError) + ret = lib.crypto_pwhash_scryptsalsa208sha256_str( + buf, passwd, len(passwd), opslimit, memlimit + ) + + ensure( + ret == 0, + "Unexpected failure in password hashing", + raising=exc.RuntimeError, + ) return ffi.string(buf) -def crypto_pwhash_scryptsalsa208sha256_str_verify(passwd_hash, passwd): +def crypto_pwhash_scryptsalsa208sha256_str_verify( + passwd_hash: bytes, passwd: bytes +) -> bool: """ Verifies the ``passwd`` against the ``passwd_hash`` that was generated. Returns True or False depending on the success @@ -332,57 +379,91 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_pwhash_scryptsalsa208sha256, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(len(passwd_hash) == SCRYPT_STRBYTES - 1, 'Invalid password hash', - raising=exc.ValueError) - - ret = lib.crypto_pwhash_scryptsalsa208sha256_str_verify(passwd_hash, - passwd, - len(passwd)) - ensure(ret == 0, - "Wrong password", - raising=exc.InvalidkeyError) + ensure( + has_crypto_pwhash_scryptsalsa208sha256, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + len(passwd_hash) == SCRYPT_STRBYTES - 1, + "Invalid password hash", + raising=exc.ValueError, + ) + + ret = lib.crypto_pwhash_scryptsalsa208sha256_str_verify( + passwd_hash, passwd, len(passwd) + ) + ensure(ret == 0, "Wrong password", raising=exc.InvalidkeyError) # all went well, therefore: return True -def _check_argon2_limits_alg(opslimit, memlimit, alg): +def _check_argon2_limits_alg(opslimit: int, memlimit: int, alg: int) -> None: - if (alg == crypto_pwhash_ALG_ARGON2I13): + if alg == crypto_pwhash_ALG_ARGON2I13: if memlimit < crypto_pwhash_argon2i_MEMLIMIT_MIN: - raise exc.ValueError('memlimit must be at least {0} bytes'.format( - crypto_pwhash_argon2i_MEMLIMIT_MIN)) + raise exc.ValueError( + "memlimit must be at least {} bytes".format( + crypto_pwhash_argon2i_MEMLIMIT_MIN + ) + ) elif memlimit > crypto_pwhash_argon2i_MEMLIMIT_MAX: - raise exc.ValueError('memlimit must be at most {0} bytes'.format( - crypto_pwhash_argon2i_MEMLIMIT_MAX)) + raise exc.ValueError( + "memlimit must be at most {} bytes".format( + crypto_pwhash_argon2i_MEMLIMIT_MAX + ) + ) if opslimit < crypto_pwhash_argon2i_OPSLIMIT_MIN: - raise exc.ValueError('opslimit must be at least {0}'.format( - crypto_pwhash_argon2i_OPSLIMIT_MIN)) + raise exc.ValueError( + "opslimit must be at least {}".format( + crypto_pwhash_argon2i_OPSLIMIT_MIN + ) + ) elif opslimit > crypto_pwhash_argon2i_OPSLIMIT_MAX: - raise exc.ValueError('opslimit must be at most {0}'.format( - crypto_pwhash_argon2i_OPSLIMIT_MAX)) + raise exc.ValueError( + "opslimit must be at most {}".format( + crypto_pwhash_argon2i_OPSLIMIT_MAX + ) + ) - elif (alg == crypto_pwhash_ALG_ARGON2ID13): + elif alg == crypto_pwhash_ALG_ARGON2ID13: if memlimit < crypto_pwhash_argon2id_MEMLIMIT_MIN: - raise exc.ValueError('memlimit must be at least {0} bytes'.format( - crypto_pwhash_argon2id_MEMLIMIT_MIN)) + raise exc.ValueError( + "memlimit must be at least {} bytes".format( + crypto_pwhash_argon2id_MEMLIMIT_MIN + ) + ) elif memlimit > crypto_pwhash_argon2id_MEMLIMIT_MAX: - raise exc.ValueError('memlimit must be at most {0} bytes'.format( - crypto_pwhash_argon2id_MEMLIMIT_MAX)) + raise exc.ValueError( + "memlimit must be at most {} bytes".format( + crypto_pwhash_argon2id_MEMLIMIT_MAX + ) + ) if opslimit < crypto_pwhash_argon2id_OPSLIMIT_MIN: - raise exc.ValueError('opslimit must be at least {0}'.format( - crypto_pwhash_argon2id_OPSLIMIT_MIN)) + raise exc.ValueError( + "opslimit must be at least {}".format( + crypto_pwhash_argon2id_OPSLIMIT_MIN + ) + ) elif opslimit > crypto_pwhash_argon2id_OPSLIMIT_MAX: - raise exc.ValueError('opslimit must be at most {0}'.format( - crypto_pwhash_argon2id_OPSLIMIT_MAX)) + raise exc.ValueError( + "opslimit must be at most {}".format( + crypto_pwhash_argon2id_OPSLIMIT_MAX + ) + ) else: - raise exc.TypeError('Unsupported algorithm') + raise exc.TypeError("Unsupported algorithm") -def crypto_pwhash_alg(outlen, passwd, salt, opslimit, memlimit, alg): +def crypto_pwhash_alg( + outlen: int, + passwd: bytes, + salt: bytes, + opslimit: int, + memlimit: int, + alg: int, +) -> bytes: """ Derive a raw cryptographic key using the ``passwd`` and the ``salt`` given as input to the ``alg`` algorithm. @@ -391,6 +472,8 @@ :type outlen: int :param passwd: The input password :type passwd: bytes + :param salt: + :type salt: bytes :param opslimit: computational cost :type opslimit: int :param memlimit: memory cost @@ -400,48 +483,59 @@ :return: derived key :rtype: bytes """ - ensure(isinstance(outlen, integer_types), - raising=exc.TypeError) - ensure(isinstance(opslimit, integer_types), - raising=exc.TypeError) - ensure(isinstance(memlimit, integer_types), - raising=exc.TypeError) - ensure(isinstance(alg, integer_types), - raising=exc.TypeError) - ensure(isinstance(passwd, bytes), - raising=exc.TypeError) + ensure(isinstance(outlen, int), raising=exc.TypeError) + ensure(isinstance(opslimit, int), raising=exc.TypeError) + ensure(isinstance(memlimit, int), raising=exc.TypeError) + ensure(isinstance(alg, int), raising=exc.TypeError) + ensure(isinstance(passwd, bytes), raising=exc.TypeError) if len(salt) != crypto_pwhash_SALTBYTES: - raise exc.ValueError("salt must be exactly {0} bytes long".format( - crypto_pwhash_SALTBYTES)) + raise exc.ValueError( + "salt must be exactly {} bytes long".format( + crypto_pwhash_SALTBYTES + ) + ) if outlen < crypto_pwhash_BYTES_MIN: raise exc.ValueError( - 'derived key must be at least {0} bytes long'.format( - crypto_pwhash_BYTES_MIN)) + "derived key must be at least {} bytes long".format( + crypto_pwhash_BYTES_MIN + ) + ) elif outlen > crypto_pwhash_BYTES_MAX: raise exc.ValueError( - 'derived key must be at most {0} bytes long'.format( - crypto_pwhash_BYTES_MAX)) + "derived key must be at most {} bytes long".format( + crypto_pwhash_BYTES_MAX + ) + ) _check_argon2_limits_alg(opslimit, memlimit, alg) outbuf = ffi.new("unsigned char[]", outlen) - ret = lib.crypto_pwhash(outbuf, outlen, passwd, len(passwd), - salt, opslimit, memlimit, alg) - - ensure(ret == 0, 'Unexpected failure in key derivation', - raising=exc.RuntimeError) + ret = lib.crypto_pwhash( + outbuf, outlen, passwd, len(passwd), salt, opslimit, memlimit, alg + ) + + ensure( + ret == 0, + "Unexpected failure in key derivation", + raising=exc.RuntimeError, + ) return ffi.buffer(outbuf, outlen)[:] -def crypto_pwhash_str_alg(passwd, opslimit, memlimit, alg): +def crypto_pwhash_str_alg( + passwd: bytes, + opslimit: int, + memlimit: int, + alg: int, +) -> bytes: """ Derive a cryptographic key using the ``passwd`` given as input - and a random ``salt``, returning a string representation which + and a random salt, returning a string representation which includes the salt, the tuning parameters and the used algorithm. :param passwd: The input password @@ -455,27 +549,28 @@ :return: serialized derived key and parameters :rtype: bytes """ - ensure(isinstance(opslimit, integer_types), - raising=TypeError) - ensure(isinstance(memlimit, integer_types), - raising=TypeError) - ensure(isinstance(passwd, bytes), - raising=TypeError) + ensure(isinstance(opslimit, int), raising=TypeError) + ensure(isinstance(memlimit, int), raising=TypeError) + ensure(isinstance(passwd, bytes), raising=TypeError) _check_argon2_limits_alg(opslimit, memlimit, alg) outbuf = ffi.new("char[]", 128) - ret = lib.crypto_pwhash_str_alg(outbuf, passwd, len(passwd), - opslimit, memlimit, alg) - - ensure(ret == 0, 'Unexpected failure in key derivation', - raising=exc.RuntimeError) + ret = lib.crypto_pwhash_str_alg( + outbuf, passwd, len(passwd), opslimit, memlimit, alg + ) + + ensure( + ret == 0, + "Unexpected failure in key derivation", + raising=exc.RuntimeError, + ) return ffi.string(outbuf) -def crypto_pwhash_str_verify(passwd_hash, passwd): +def crypto_pwhash_str_verify(passwd_hash: bytes, passwd: bytes) -> bool: """ Verifies the ``passwd`` against a given password hash. @@ -487,19 +582,17 @@ :return: success :rtype: boolean """ - ensure(isinstance(passwd_hash, bytes), - raising=TypeError) - ensure(isinstance(passwd, bytes), - raising=TypeError) - ensure(len(passwd_hash) <= 127, - "Hash must be at most 127 bytes long", - raising=exc.ValueError) + ensure(isinstance(passwd_hash, bytes), raising=TypeError) + ensure(isinstance(passwd, bytes), raising=TypeError) + ensure( + len(passwd_hash) <= 127, + "Hash must be at most 127 bytes long", + raising=exc.ValueError, + ) ret = lib.crypto_pwhash_str_verify(passwd_hash, passwd, len(passwd)) - ensure(ret == 0, - "Wrong password", - raising=exc.InvalidkeyError) + ensure(ret == 0, "Wrong password", raising=exc.InvalidkeyError) # all went well, therefore: return True diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_scalarmult.py python-nacl-1.5.0/src/nacl/bindings/crypto_scalarmult.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_scalarmult.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_scalarmult.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,30 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -has_crypto_scalarmult_ed25519 = \ - bool(lib.PYNACL_HAS_CRYPTO_SCALARMULT_ED25519) +has_crypto_scalarmult_ed25519 = bool(lib.PYNACL_HAS_CRYPTO_SCALARMULT_ED25519) -crypto_scalarmult_BYTES = lib.crypto_scalarmult_bytes() -crypto_scalarmult_SCALARBYTES = lib.crypto_scalarmult_scalarbytes() +crypto_scalarmult_BYTES: int = lib.crypto_scalarmult_bytes() +crypto_scalarmult_SCALARBYTES: int = lib.crypto_scalarmult_scalarbytes() crypto_scalarmult_ed25519_BYTES = 0 crypto_scalarmult_ed25519_SCALARBYTES = 0 if has_crypto_scalarmult_ed25519: - crypto_scalarmult_ed25519_BYTES = \ - lib.crypto_scalarmult_ed25519_bytes() - crypto_scalarmult_ed25519_SCALARBYTES = \ + crypto_scalarmult_ed25519_BYTES = lib.crypto_scalarmult_ed25519_bytes() + crypto_scalarmult_ed25519_SCALARBYTES = ( lib.crypto_scalarmult_ed25519_scalarbytes() + ) -def crypto_scalarmult_base(n): +def crypto_scalarmult_base(n: bytes) -> bytes: """ Computes and returns the scalar product of a standard group element and an integer ``n``. @@ -46,14 +44,12 @@ q = ffi.new("unsigned char[]", crypto_scalarmult_BYTES) rc = lib.crypto_scalarmult_base(q, n) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:] -def crypto_scalarmult(n, p): +def crypto_scalarmult(n: bytes, p: bytes) -> bytes: """ Computes and returns the scalar product of the given group element and an integer ``n``. @@ -65,14 +61,12 @@ q = ffi.new("unsigned char[]", crypto_scalarmult_BYTES) rc = lib.crypto_scalarmult(q, n, p) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_SCALARBYTES)[:] -def crypto_scalarmult_ed25519_base(n): +def crypto_scalarmult_ed25519_base(n: bytes) -> bytes: """ Computes and returns the scalar product of a standard group element and an integer ``n`` on the edwards25519 curve. @@ -86,27 +80,30 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_scalarmult_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(n, bytes) and - len(n) == crypto_scalarmult_ed25519_SCALARBYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_scalarmult_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(n, bytes) + and len(n) == crypto_scalarmult_ed25519_SCALARBYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) q = ffi.new("unsigned char[]", crypto_scalarmult_ed25519_BYTES) rc = lib.crypto_scalarmult_ed25519_base(q, n) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_ed25519_BYTES)[:] -def crypto_scalarmult_ed25519_base_noclamp(n): +def crypto_scalarmult_ed25519_base_noclamp(n: bytes) -> bytes: """ Computes and returns the scalar product of a standard group element and an integer ``n`` on the edwards25519 curve. The integer ``n`` is not clamped. @@ -120,27 +117,30 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_scalarmult_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(n, bytes) and - len(n) == crypto_scalarmult_ed25519_SCALARBYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_SCALARBYTES'), - raising=exc.TypeError) + ensure( + has_crypto_scalarmult_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(n, bytes) + and len(n) == crypto_scalarmult_ed25519_SCALARBYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) q = ffi.new("unsigned char[]", crypto_scalarmult_ed25519_BYTES) rc = lib.crypto_scalarmult_ed25519_base_noclamp(q, n) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_ed25519_BYTES)[:] -def crypto_scalarmult_ed25519(n, p): +def crypto_scalarmult_ed25519(n: bytes, p: bytes) -> bytes: """ Computes and returns the scalar product of a *clamped* integer ``n`` and the given group element on the edwards25519 curve. @@ -160,33 +160,38 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_scalarmult_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(n, bytes) and - len(n) == crypto_scalarmult_ed25519_SCALARBYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_SCALARBYTES'), - raising=exc.TypeError) - - ensure(isinstance(p, bytes) and - len(p) == crypto_scalarmult_ed25519_BYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_BYTES'), - raising=exc.TypeError) + ensure( + has_crypto_scalarmult_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(n, bytes) + and len(n) == crypto_scalarmult_ed25519_SCALARBYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(p, bytes) and len(p) == crypto_scalarmult_ed25519_BYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_BYTES" + ), + raising=exc.TypeError, + ) q = ffi.new("unsigned char[]", crypto_scalarmult_ed25519_BYTES) rc = lib.crypto_scalarmult_ed25519(q, n, p) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_ed25519_BYTES)[:] -def crypto_scalarmult_ed25519_noclamp(n, p): +def crypto_scalarmult_ed25519_noclamp(n: bytes, p: bytes) -> bytes: """ Computes and returns the scalar product of an integer ``n`` and the given group element on the edwards25519 curve. The integer @@ -204,27 +209,32 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_scalarmult_ed25519, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(isinstance(n, bytes) and - len(n) == crypto_scalarmult_ed25519_SCALARBYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_SCALARBYTES'), - raising=exc.TypeError) - - ensure(isinstance(p, bytes) and - len(p) == crypto_scalarmult_ed25519_BYTES, - 'Input must be a {} long bytes sequence'.format( - 'crypto_scalarmult_ed25519_BYTES'), - raising=exc.TypeError) + ensure( + has_crypto_scalarmult_ed25519, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + isinstance(n, bytes) + and len(n) == crypto_scalarmult_ed25519_SCALARBYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_SCALARBYTES" + ), + raising=exc.TypeError, + ) + + ensure( + isinstance(p, bytes) and len(p) == crypto_scalarmult_ed25519_BYTES, + "Input must be a {} long bytes sequence".format( + "crypto_scalarmult_ed25519_BYTES" + ), + raising=exc.TypeError, + ) q = ffi.new("unsigned char[]", crypto_scalarmult_ed25519_BYTES) rc = lib.crypto_scalarmult_ed25519_noclamp(q, n, p) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(q, crypto_scalarmult_ed25519_BYTES)[:] diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_secretbox.py python-nacl-1.5.0/src/nacl/bindings/crypto_secretbox.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_secretbox.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_secretbox.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,22 +12,23 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -crypto_secretbox_KEYBYTES = lib.crypto_secretbox_keybytes() -crypto_secretbox_NONCEBYTES = lib.crypto_secretbox_noncebytes() -crypto_secretbox_ZEROBYTES = lib.crypto_secretbox_zerobytes() -crypto_secretbox_BOXZEROBYTES = lib.crypto_secretbox_boxzerobytes() -crypto_secretbox_MACBYTES = lib.crypto_secretbox_macbytes() -crypto_secretbox_MESSAGEBYTES_MAX = lib.crypto_secretbox_messagebytes_max() +crypto_secretbox_KEYBYTES: int = lib.crypto_secretbox_keybytes() +crypto_secretbox_NONCEBYTES: int = lib.crypto_secretbox_noncebytes() +crypto_secretbox_ZEROBYTES: int = lib.crypto_secretbox_zerobytes() +crypto_secretbox_BOXZEROBYTES: int = lib.crypto_secretbox_boxzerobytes() +crypto_secretbox_MACBYTES: int = lib.crypto_secretbox_macbytes() +crypto_secretbox_MESSAGEBYTES_MAX: int = ( + lib.crypto_secretbox_messagebytes_max() +) -def crypto_secretbox(message, nonce, key): +def crypto_secretbox(message: bytes, nonce: bytes, key: bytes) -> bytes: """ Encrypts and returns the message ``message`` with the secret ``key`` and the nonce ``nonce``. @@ -53,7 +54,9 @@ return ciphertext[crypto_secretbox_BOXZEROBYTES:] -def crypto_secretbox_open(ciphertext, nonce, key): +def crypto_secretbox_open( + ciphertext: bytes, nonce: bytes, key: bytes +) -> bytes: """ Decrypt and returns the encrypted message ``ciphertext`` with the secret ``key`` and the nonce ``nonce``. @@ -72,10 +75,12 @@ padded = b"\x00" * crypto_secretbox_BOXZEROBYTES + ciphertext plaintext = ffi.new("unsigned char[]", len(padded)) - res = lib.crypto_secretbox_open( - plaintext, padded, len(padded), nonce, key) - ensure(res == 0, "Decryption failed. Ciphertext failed verification", - raising=exc.CryptoError) + res = lib.crypto_secretbox_open(plaintext, padded, len(padded), nonce, key) + ensure( + res == 0, + "Decryption failed. Ciphertext failed verification", + raising=exc.CryptoError, + ) plaintext = ffi.buffer(plaintext, len(padded)) return plaintext[crypto_secretbox_ZEROBYTES:] diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_secretstream.py python-nacl-1.5.0/src/nacl/bindings/crypto_secretstream.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_secretstream.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_secretstream.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,37 +11,45 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import ByteString, Optional, Tuple, cast from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -crypto_secretstream_xchacha20poly1305_ABYTES = \ +crypto_secretstream_xchacha20poly1305_ABYTES: int = ( lib.crypto_secretstream_xchacha20poly1305_abytes() -crypto_secretstream_xchacha20poly1305_HEADERBYTES = \ +) +crypto_secretstream_xchacha20poly1305_HEADERBYTES: int = ( lib.crypto_secretstream_xchacha20poly1305_headerbytes() -crypto_secretstream_xchacha20poly1305_KEYBYTES = \ +) +crypto_secretstream_xchacha20poly1305_KEYBYTES: int = ( lib.crypto_secretstream_xchacha20poly1305_keybytes() -crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX = \ +) +crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX: int = ( lib.crypto_secretstream_xchacha20poly1305_messagebytes_max() -crypto_secretstream_xchacha20poly1305_STATEBYTES = \ +) +crypto_secretstream_xchacha20poly1305_STATEBYTES: int = ( lib.crypto_secretstream_xchacha20poly1305_statebytes() +) -crypto_secretstream_xchacha20poly1305_TAG_MESSAGE = \ +crypto_secretstream_xchacha20poly1305_TAG_MESSAGE: int = ( lib.crypto_secretstream_xchacha20poly1305_tag_message() -crypto_secretstream_xchacha20poly1305_TAG_PUSH = \ +) +crypto_secretstream_xchacha20poly1305_TAG_PUSH: int = ( lib.crypto_secretstream_xchacha20poly1305_tag_push() -crypto_secretstream_xchacha20poly1305_TAG_REKEY = \ +) +crypto_secretstream_xchacha20poly1305_TAG_REKEY: int = ( lib.crypto_secretstream_xchacha20poly1305_tag_rekey() -crypto_secretstream_xchacha20poly1305_TAG_FINAL = \ +) +crypto_secretstream_xchacha20poly1305_TAG_FINAL: int = ( lib.crypto_secretstream_xchacha20poly1305_tag_final() +) -def crypto_secretstream_xchacha20poly1305_keygen(): +def crypto_secretstream_xchacha20poly1305_keygen() -> bytes: """ Generate a key for use with :func:`.crypto_secretstream_xchacha20poly1305_init_push`. @@ -55,25 +63,28 @@ return ffi.buffer(keybuf)[:] -class crypto_secretstream_xchacha20poly1305_state(object): +class crypto_secretstream_xchacha20poly1305_state: """ An object wrapping the crypto_secretstream_xchacha20poly1305 state. """ - __slots__ = ['statebuf', 'rawbuf', 'tagbuf'] - def __init__(self): - """ Initialize a clean state object.""" - self.statebuf = ffi.new( + __slots__ = ["statebuf", "rawbuf", "tagbuf"] + + def __init__(self) -> None: + """Initialize a clean state object.""" + self.statebuf: ByteString = ffi.new( "unsigned char[]", crypto_secretstream_xchacha20poly1305_STATEBYTES, ) - self.rawbuf = None - self.tagbuf = None + self.rawbuf: Optional[ByteString] = None + self.tagbuf: Optional[ByteString] = None -def crypto_secretstream_xchacha20poly1305_init_push(state, key): +def crypto_secretstream_xchacha20poly1305_init_push( + state: crypto_secretstream_xchacha20poly1305_state, key: bytes +) -> bytes: """ Initialize a crypto_secretstream_xchacha20poly1305 encryption buffer. @@ -88,17 +99,17 @@ """ ensure( isinstance(state, crypto_secretstream_xchacha20poly1305_state), - 'State must be a crypto_secretstream_xchacha20poly1305_state object', + "State must be a crypto_secretstream_xchacha20poly1305_state object", raising=exc.TypeError, ) ensure( isinstance(key, bytes), - 'Key must be a bytes sequence', + "Key must be a bytes sequence", raising=exc.TypeError, ) ensure( len(key) == crypto_secretstream_xchacha20poly1305_KEYBYTES, - 'Invalid key length', + "Invalid key length", raising=exc.ValueError, ) @@ -108,18 +119,19 @@ ) rc = lib.crypto_secretstream_xchacha20poly1305_init_push( - state.statebuf, headerbuf, key) - ensure(rc == 0, 'Unexpected failure', raising=exc.RuntimeError) + state.statebuf, headerbuf, key + ) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) return ffi.buffer(headerbuf)[:] def crypto_secretstream_xchacha20poly1305_push( - state, - m, - ad=None, - tag=crypto_secretstream_xchacha20poly1305_TAG_MESSAGE, -): + state: crypto_secretstream_xchacha20poly1305_state, + m: bytes, + ad: Optional[bytes] = None, + tag: int = crypto_secretstream_xchacha20poly1305_TAG_MESSAGE, +) -> bytes: """ Add an encrypted message to the secret stream. @@ -141,24 +153,24 @@ """ ensure( isinstance(state, crypto_secretstream_xchacha20poly1305_state), - 'State must be a crypto_secretstream_xchacha20poly1305_state object', + "State must be a crypto_secretstream_xchacha20poly1305_state object", raising=exc.TypeError, ) - ensure(isinstance(m, bytes), 'Message is not bytes', raising=exc.TypeError) + ensure(isinstance(m, bytes), "Message is not bytes", raising=exc.TypeError) ensure( len(m) <= crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX, - 'Message is too long', + "Message is too long", raising=exc.ValueError, ) ensure( ad is None or isinstance(ad, bytes), - 'Additional data must be bytes or None', + "Additional data must be bytes or None", raising=exc.TypeError, ) clen = len(m) + crypto_secretstream_xchacha20poly1305_ABYTES if state.rawbuf is None or len(state.rawbuf) < clen: - state.rawbuf = ffi.new('unsigned char[]', clen) + state.rawbuf = ffi.new("unsigned char[]", clen) if ad is None: ad = ffi.NULL @@ -168,17 +180,24 @@ rc = lib.crypto_secretstream_xchacha20poly1305_push( state.statebuf, - state.rawbuf, ffi.NULL, - m, len(m), - ad, adlen, + state.rawbuf, + ffi.NULL, + m, + len(m), + ad, + adlen, tag, ) - ensure(rc == 0, 'Unexpected failure', raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) return ffi.buffer(state.rawbuf, clen)[:] -def crypto_secretstream_xchacha20poly1305_init_pull(state, header, key): +def crypto_secretstream_xchacha20poly1305_init_pull( + state: crypto_secretstream_xchacha20poly1305_state, + header: bytes, + key: bytes, +) -> None: """ Initialize a crypto_secretstream_xchacha20poly1305 decryption buffer. @@ -194,39 +213,44 @@ """ ensure( isinstance(state, crypto_secretstream_xchacha20poly1305_state), - 'State must be a crypto_secretstream_xchacha20poly1305_state object', + "State must be a crypto_secretstream_xchacha20poly1305_state object", raising=exc.TypeError, ) ensure( isinstance(header, bytes), - 'Header must be a bytes sequence', + "Header must be a bytes sequence", raising=exc.TypeError, ) ensure( len(header) == crypto_secretstream_xchacha20poly1305_HEADERBYTES, - 'Invalid header length', + "Invalid header length", raising=exc.ValueError, ) ensure( isinstance(key, bytes), - 'Key must be a bytes sequence', + "Key must be a bytes sequence", raising=exc.TypeError, ) ensure( len(key) == crypto_secretstream_xchacha20poly1305_KEYBYTES, - 'Invalid key length', + "Invalid key length", raising=exc.ValueError, ) if state.tagbuf is None: - state.tagbuf = ffi.new('unsigned char *') + state.tagbuf = ffi.new("unsigned char *") rc = lib.crypto_secretstream_xchacha20poly1305_init_pull( - state.statebuf, header, key) - ensure(rc == 0, 'Unexpected failure', raising=exc.RuntimeError) + state.statebuf, header, key + ) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) -def crypto_secretstream_xchacha20poly1305_pull(state, c, ad=None): +def crypto_secretstream_xchacha20poly1305_pull( + state: crypto_secretstream_xchacha20poly1305_state, + c: bytes, + ad: Optional[bytes] = None, +) -> Tuple[bytes, int]: """ Read a decrypted message from the secret stream. @@ -245,44 +269,45 @@ """ ensure( isinstance(state, crypto_secretstream_xchacha20poly1305_state), - 'State must be a crypto_secretstream_xchacha20poly1305_state object', + "State must be a crypto_secretstream_xchacha20poly1305_state object", raising=exc.TypeError, ) ensure( state.tagbuf is not None, ( - 'State must be initialized using ' - 'crypto_secretstream_xchacha20poly1305_init_pull' + "State must be initialized using " + "crypto_secretstream_xchacha20poly1305_init_pull" ), raising=exc.ValueError, ) ensure( isinstance(c, bytes), - 'Ciphertext is not bytes', + "Ciphertext is not bytes", raising=exc.TypeError, ) ensure( len(c) >= crypto_secretstream_xchacha20poly1305_ABYTES, - 'Ciphertext is too short', + "Ciphertext is too short", raising=exc.ValueError, ) ensure( - len(c) <= ( - crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX + - crypto_secretstream_xchacha20poly1305_ABYTES + len(c) + <= ( + crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX + + crypto_secretstream_xchacha20poly1305_ABYTES ), - 'Ciphertext is too long', + "Ciphertext is too long", raising=exc.ValueError, ) ensure( ad is None or isinstance(ad, bytes), - 'Additional data must be bytes or None', + "Additional data must be bytes or None", raising=exc.TypeError, ) mlen = len(c) - crypto_secretstream_xchacha20poly1305_ABYTES if state.rawbuf is None or len(state.rawbuf) < mlen: - state.rawbuf = ffi.new('unsigned char[]', mlen) + state.rawbuf = ffi.new("unsigned char[]", mlen) if ad is None: ad = ffi.NULL @@ -292,17 +317,26 @@ rc = lib.crypto_secretstream_xchacha20poly1305_pull( state.statebuf, - state.rawbuf, ffi.NULL, + state.rawbuf, + ffi.NULL, state.tagbuf, - c, len(c), - ad, adlen, + c, + len(c), + ad, + adlen, ) - ensure(rc == 0, 'Unexpected failure', raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected failure", raising=exc.RuntimeError) - return (ffi.buffer(state.rawbuf, mlen)[:], int(state.tagbuf[0])) + # Cast safety: we `ensure` above that `state.tagbuf is not None`. + return ( + ffi.buffer(state.rawbuf, mlen)[:], + int(cast(bytes, state.tagbuf)[0]), + ) -def crypto_secretstream_xchacha20poly1305_rekey(state): +def crypto_secretstream_xchacha20poly1305_rekey( + state: crypto_secretstream_xchacha20poly1305_state, +) -> None: """ Explicitly change the encryption key in the stream. @@ -317,7 +351,7 @@ """ ensure( isinstance(state, crypto_secretstream_xchacha20poly1305_state), - 'State must be a crypto_secretstream_xchacha20poly1305_state object', + "State must be a crypto_secretstream_xchacha20poly1305_state object", raising=exc.TypeError, ) lib.crypto_secretstream_xchacha20poly1305_rekey(state.statebuf) diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_shorthash.py python-nacl-1.5.0/src/nacl/bindings/crypto_shorthash.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_shorthash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_shorthash.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,18 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import nacl.exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -has_crypto_shorthash_siphashx24 = \ - bool(lib.PYNACL_HAS_CRYPTO_SHORTHASH_SIPHASHX24) +has_crypto_shorthash_siphashx24 = bool( + lib.PYNACL_HAS_CRYPTO_SHORTHASH_SIPHASHX24 +) -BYTES = lib.crypto_shorthash_siphash24_bytes() -KEYBYTES = lib.crypto_shorthash_siphash24_keybytes() +BYTES: int = lib.crypto_shorthash_siphash24_bytes() +KEYBYTES: int = lib.crypto_shorthash_siphash24_keybytes() XBYTES = 0 XKEYBYTES = 0 @@ -33,7 +33,7 @@ XKEYBYTES = lib.crypto_shorthash_siphashx24_keybytes() -def crypto_shorthash_siphash24(data, key): +def crypto_shorthash_siphash24(data: bytes, key: bytes) -> bytes: """Compute a fast, cryptographic quality, keyed hash of the input data :param data: @@ -44,7 +44,8 @@ """ if len(key) != KEYBYTES: raise exc.ValueError( - "Key length must be exactly {0} bytes".format(KEYBYTES)) + "Key length must be exactly {} bytes".format(KEYBYTES) + ) digest = ffi.new("unsigned char[]", BYTES) rc = lib.crypto_shorthash_siphash24(digest, data, len(data), key) @@ -52,7 +53,7 @@ return ffi.buffer(digest, BYTES)[:] -def crypto_shorthash_siphashx24(data, key): +def crypto_shorthash_siphashx24(data: bytes, key: bytes) -> bytes: """Compute a fast, cryptographic quality, keyed hash of the input data :param data: @@ -63,13 +64,16 @@ :raises nacl.exceptions.UnavailableError: If called when using a minimal build of libsodium. """ - ensure(has_crypto_shorthash_siphashx24, - 'Not available in minimal build', - raising=exc.UnavailableError) + ensure( + has_crypto_shorthash_siphashx24, + "Not available in minimal build", + raising=exc.UnavailableError, + ) if len(key) != XKEYBYTES: raise exc.ValueError( - "Key length must be exactly {0} bytes".format(XKEYBYTES)) + "Key length must be exactly {} bytes".format(XKEYBYTES) + ) digest = ffi.new("unsigned char[]", XBYTES) rc = lib.crypto_shorthash_siphashx24(digest, data, len(data), key) diff -Nru python-nacl-1.4.0/src/nacl/bindings/crypto_sign.py python-nacl-1.5.0/src/nacl/bindings/crypto_sign.py --- python-nacl-1.4.0/src/nacl/bindings/crypto_sign.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/crypto_sign.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,26 +11,25 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import Tuple from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -crypto_sign_BYTES = lib.crypto_sign_bytes() +crypto_sign_BYTES: int = lib.crypto_sign_bytes() # crypto_sign_SEEDBYTES = lib.crypto_sign_seedbytes() -crypto_sign_SEEDBYTES = lib.crypto_sign_secretkeybytes() // 2 -crypto_sign_PUBLICKEYBYTES = lib.crypto_sign_publickeybytes() -crypto_sign_SECRETKEYBYTES = lib.crypto_sign_secretkeybytes() +crypto_sign_SEEDBYTES: int = lib.crypto_sign_secretkeybytes() // 2 +crypto_sign_PUBLICKEYBYTES: int = lib.crypto_sign_publickeybytes() +crypto_sign_SECRETKEYBYTES: int = lib.crypto_sign_secretkeybytes() -crypto_sign_curve25519_BYTES = lib.crypto_box_secretkeybytes() +crypto_sign_curve25519_BYTES: int = lib.crypto_box_secretkeybytes() -crypto_sign_ed25519ph_STATEBYTES = lib.crypto_sign_ed25519ph_statebytes() +crypto_sign_ed25519ph_STATEBYTES: int = lib.crypto_sign_ed25519ph_statebytes() -def crypto_sign_keypair(): +def crypto_sign_keypair() -> Tuple[bytes, bytes]: """ Returns a randomly generated public key and secret key. @@ -40,9 +39,7 @@ sk = ffi.new("unsigned char[]", crypto_sign_SECRETKEYBYTES) rc = lib.crypto_sign_keypair(pk, sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ( ffi.buffer(pk, crypto_sign_PUBLICKEYBYTES)[:], @@ -50,7 +47,7 @@ ) -def crypto_sign_seed_keypair(seed): +def crypto_sign_seed_keypair(seed: bytes) -> Tuple[bytes, bytes]: """ Computes and returns the public key and secret key using the seed ``seed``. @@ -64,9 +61,7 @@ sk = ffi.new("unsigned char[]", crypto_sign_SECRETKEYBYTES) rc = lib.crypto_sign_seed_keypair(pk, sk, seed) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ( ffi.buffer(pk, crypto_sign_PUBLICKEYBYTES)[:], @@ -74,7 +69,7 @@ ) -def crypto_sign(message, sk): +def crypto_sign(message: bytes, sk: bytes) -> bytes: """ Signs the message ``message`` using the secret key ``sk`` and returns the signed message. @@ -87,14 +82,12 @@ signed_len = ffi.new("unsigned long long *") rc = lib.crypto_sign(signed, signed_len, message, len(message), sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(signed, signed_len[0])[:] -def crypto_sign_open(signed, pk): +def crypto_sign_open(signed: bytes, pk: bytes) -> bytes: """ Verifies the signature of the signed message ``signed`` using the public key ``pk`` and returns the unsigned message. @@ -106,14 +99,16 @@ message = ffi.new("unsigned char[]", len(signed)) message_len = ffi.new("unsigned long long *") - if lib.crypto_sign_open( - message, message_len, signed, len(signed), pk) != 0: + if ( + lib.crypto_sign_open(message, message_len, signed, len(signed), pk) + != 0 + ): raise exc.BadSignatureError("Signature was forged or corrupt") return ffi.buffer(message, message_len[0])[:] -def crypto_sign_ed25519_pk_to_curve25519(public_key_bytes): +def crypto_sign_ed25519_pk_to_curve25519(public_key_bytes: bytes) -> bytes: """ Converts a public Ed25519 key (encoded as bytes ``public_key_bytes``) to a public Curve25519 key as bytes. @@ -130,16 +125,15 @@ curve_public_key_len = crypto_sign_curve25519_BYTES curve_public_key = ffi.new("unsigned char[]", curve_public_key_len) - rc = lib.crypto_sign_ed25519_pk_to_curve25519(curve_public_key, - public_key_bytes) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + rc = lib.crypto_sign_ed25519_pk_to_curve25519( + curve_public_key, public_key_bytes + ) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(curve_public_key, curve_public_key_len)[:] -def crypto_sign_ed25519_sk_to_curve25519(secret_key_bytes): +def crypto_sign_ed25519_sk_to_curve25519(secret_key_bytes: bytes) -> bytes: """ Converts a secret Ed25519 key (encoded as bytes ``secret_key_bytes``) to a secret Curve25519 key as bytes. @@ -156,16 +150,15 @@ curve_secret_key_len = crypto_sign_curve25519_BYTES curve_secret_key = ffi.new("unsigned char[]", curve_secret_key_len) - rc = lib.crypto_sign_ed25519_sk_to_curve25519(curve_secret_key, - secret_key_bytes) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + rc = lib.crypto_sign_ed25519_sk_to_curve25519( + curve_secret_key, secret_key_bytes + ) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(curve_secret_key, curve_secret_key_len)[:] -def crypto_sign_ed25519_sk_to_pk(secret_key_bytes): +def crypto_sign_ed25519_sk_to_pk(secret_key_bytes: bytes) -> bytes: """ Extract the public Ed25519 key from a secret Ed25519 key (encoded as bytes ``secret_key_bytes``). @@ -182,7 +175,7 @@ return secret_key_bytes[crypto_sign_SEEDBYTES:] -def crypto_sign_ed25519_sk_to_seed(secret_key_bytes): +def crypto_sign_ed25519_sk_to_seed(secret_key_bytes: bytes) -> bytes: """ Extract the seed from a secret Ed25519 key (encoded as bytes ``secret_key_bytes``). @@ -199,24 +192,26 @@ return secret_key_bytes[:crypto_sign_SEEDBYTES] -class crypto_sign_ed25519ph_state(object): +class crypto_sign_ed25519ph_state: """ State object wrapping the sha-512 state used in ed25519ph computation """ - __slots__ = ['state'] - def __init__(self): - self.state = ffi.new('unsigned char[]', - crypto_sign_ed25519ph_STATEBYTES) + __slots__ = ["state"] + + def __init__(self) -> None: + self.state: bytes = ffi.new( + "unsigned char[]", crypto_sign_ed25519ph_STATEBYTES + ) rc = lib.crypto_sign_ed25519ph_init(self.state) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) -def crypto_sign_ed25519ph_update(edph, pmsg): +def crypto_sign_ed25519ph_update( + edph: crypto_sign_ed25519ph_state, pmsg: bytes +) -> None: """ Update the hash state wrapped in edph @@ -226,22 +221,23 @@ :type pmsg: bytes :rtype: None """ - ensure(isinstance(edph, crypto_sign_ed25519ph_state), - 'edph parameter must be a ed25519ph_state object', - raising=exc.TypeError) - ensure(isinstance(pmsg, bytes), - 'pmsg parameter must be a bytes object', - raising=exc.TypeError) - rc = lib.crypto_sign_ed25519ph_update(edph.state, - pmsg, - len(pmsg)) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + ensure( + isinstance(edph, crypto_sign_ed25519ph_state), + "edph parameter must be a ed25519ph_state object", + raising=exc.TypeError, + ) + ensure( + isinstance(pmsg, bytes), + "pmsg parameter must be a bytes object", + raising=exc.TypeError, + ) + rc = lib.crypto_sign_ed25519ph_update(edph.state, pmsg, len(pmsg)) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) -def crypto_sign_ed25519ph_final_create(edph, - sk): +def crypto_sign_ed25519ph_final_create( + edph: crypto_sign_ed25519ph_state, sk: bytes +) -> bytes: """ Create a signature for the data hashed in edph using the secret key sk @@ -254,31 +250,35 @@ :return: ed25519ph signature :rtype: bytes """ - ensure(isinstance(edph, crypto_sign_ed25519ph_state), - 'edph parameter must be a ed25519ph_state object', - raising=exc.TypeError) - ensure(isinstance(sk, bytes), - 'secret key parameter must be a bytes object', - raising=exc.TypeError) - ensure(len(sk) == crypto_sign_SECRETKEYBYTES, - ('secret key must be {0} ' - 'bytes long').format(crypto_sign_SECRETKEYBYTES), - raising=exc.TypeError) + ensure( + isinstance(edph, crypto_sign_ed25519ph_state), + "edph parameter must be a ed25519ph_state object", + raising=exc.TypeError, + ) + ensure( + isinstance(sk, bytes), + "secret key parameter must be a bytes object", + raising=exc.TypeError, + ) + ensure( + len(sk) == crypto_sign_SECRETKEYBYTES, + ("secret key must be {} bytes long").format( + crypto_sign_SECRETKEYBYTES + ), + raising=exc.TypeError, + ) signature = ffi.new("unsigned char[]", crypto_sign_BYTES) - rc = lib.crypto_sign_ed25519ph_final_create(edph.state, - signature, - ffi.NULL, - sk) - ensure(rc == 0, - 'Unexpected library error', - raising=exc.RuntimeError) + rc = lib.crypto_sign_ed25519ph_final_create( + edph.state, signature, ffi.NULL, sk + ) + ensure(rc == 0, "Unexpected library error", raising=exc.RuntimeError) return ffi.buffer(signature, crypto_sign_BYTES)[:] -def crypto_sign_ed25519ph_final_verify(edph, - signature, - pk): +def crypto_sign_ed25519ph_final_verify( + edph: crypto_sign_ed25519ph_state, signature: bytes, pk: bytes +) -> bool: """ Verify a prehashed signature using the public key pk @@ -293,26 +293,34 @@ :rtype: boolean :raises exc.BadSignatureError: if the signature is not valid """ - ensure(isinstance(edph, crypto_sign_ed25519ph_state), - 'edph parameter must be a ed25519ph_state object', - raising=exc.TypeError) - ensure(isinstance(signature, bytes), - 'signature parameter must be a bytes object', - raising=exc.TypeError) - ensure(len(signature) == crypto_sign_BYTES, - ('signature must be {0} ' - 'bytes long').format(crypto_sign_BYTES), - raising=exc.TypeError) - ensure(isinstance(pk, bytes), - 'public key parameter must be a bytes object', - raising=exc.TypeError) - ensure(len(pk) == crypto_sign_PUBLICKEYBYTES, - ('public key must be {0} ' - 'bytes long').format(crypto_sign_PUBLICKEYBYTES), - raising=exc.TypeError) - rc = lib.crypto_sign_ed25519ph_final_verify(edph.state, - signature, - pk) + ensure( + isinstance(edph, crypto_sign_ed25519ph_state), + "edph parameter must be a ed25519ph_state object", + raising=exc.TypeError, + ) + ensure( + isinstance(signature, bytes), + "signature parameter must be a bytes object", + raising=exc.TypeError, + ) + ensure( + len(signature) == crypto_sign_BYTES, + ("signature must be {} bytes long").format(crypto_sign_BYTES), + raising=exc.TypeError, + ) + ensure( + isinstance(pk, bytes), + "public key parameter must be a bytes object", + raising=exc.TypeError, + ) + ensure( + len(pk) == crypto_sign_PUBLICKEYBYTES, + ("public key must be {} bytes long").format( + crypto_sign_PUBLICKEYBYTES + ), + raising=exc.TypeError, + ) + rc = lib.crypto_sign_ed25519ph_final_verify(edph.state, signature, pk) if rc != 0: raise exc.BadSignatureError("Signature was forged or corrupt") diff -Nru python-nacl-1.4.0/src/nacl/bindings/__init__.py python-nacl-1.5.0/src/nacl/bindings/__init__.py --- python-nacl-1.4.0/src/nacl/bindings/__init__.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/__init__.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl.bindings.crypto_aead import ( crypto_aead_chacha20poly1305_ABYTES, @@ -38,37 +37,62 @@ crypto_aead_xchacha20poly1305_ietf_encrypt, ) from nacl.bindings.crypto_box import ( - crypto_box, crypto_box_BEFORENMBYTES, crypto_box_BOXZEROBYTES, - crypto_box_NONCEBYTES, crypto_box_PUBLICKEYBYTES, crypto_box_SEALBYTES, - crypto_box_SECRETKEYBYTES, crypto_box_SEEDBYTES, crypto_box_ZEROBYTES, - crypto_box_afternm, crypto_box_beforenm, crypto_box_keypair, - crypto_box_open, crypto_box_open_afternm, crypto_box_seal, - crypto_box_seal_open, crypto_box_seed_keypair, + crypto_box, + crypto_box_BEFORENMBYTES, + crypto_box_BOXZEROBYTES, + crypto_box_NONCEBYTES, + crypto_box_PUBLICKEYBYTES, + crypto_box_SEALBYTES, + crypto_box_SECRETKEYBYTES, + crypto_box_SEEDBYTES, + crypto_box_ZEROBYTES, + crypto_box_afternm, + crypto_box_beforenm, + crypto_box_keypair, + crypto_box_open, + crypto_box_open_afternm, + crypto_box_seal, + crypto_box_seal_open, + crypto_box_seed_keypair, ) from nacl.bindings.crypto_core import ( - crypto_core_ed25519_BYTES, crypto_core_ed25519_NONREDUCEDSCALARBYTES, - crypto_core_ed25519_SCALARBYTES, crypto_core_ed25519_add, - crypto_core_ed25519_is_valid_point, crypto_core_ed25519_scalar_add, - crypto_core_ed25519_scalar_complement, crypto_core_ed25519_scalar_invert, - crypto_core_ed25519_scalar_mul, crypto_core_ed25519_scalar_negate, - crypto_core_ed25519_scalar_reduce, crypto_core_ed25519_scalar_sub, - crypto_core_ed25519_sub, has_crypto_core_ed25519 + crypto_core_ed25519_BYTES, + crypto_core_ed25519_NONREDUCEDSCALARBYTES, + crypto_core_ed25519_SCALARBYTES, + crypto_core_ed25519_add, + crypto_core_ed25519_is_valid_point, + crypto_core_ed25519_scalar_add, + crypto_core_ed25519_scalar_complement, + crypto_core_ed25519_scalar_invert, + crypto_core_ed25519_scalar_mul, + crypto_core_ed25519_scalar_negate, + crypto_core_ed25519_scalar_reduce, + crypto_core_ed25519_scalar_sub, + crypto_core_ed25519_sub, + has_crypto_core_ed25519, ) from nacl.bindings.crypto_generichash import ( - crypto_generichash_BYTES, crypto_generichash_BYTES_MAX, - crypto_generichash_BYTES_MIN, crypto_generichash_KEYBYTES, - crypto_generichash_KEYBYTES_MAX, crypto_generichash_KEYBYTES_MIN, - crypto_generichash_PERSONALBYTES, crypto_generichash_SALTBYTES, + crypto_generichash_BYTES, + crypto_generichash_BYTES_MAX, + crypto_generichash_BYTES_MIN, + crypto_generichash_KEYBYTES, + crypto_generichash_KEYBYTES_MAX, + crypto_generichash_KEYBYTES_MIN, + crypto_generichash_PERSONALBYTES, + crypto_generichash_SALTBYTES, crypto_generichash_STATEBYTES, generichash_blake2b_final as crypto_generichash_blake2b_final, generichash_blake2b_init as crypto_generichash_blake2b_init, - generichash_blake2b_salt_personal as - crypto_generichash_blake2b_salt_personal, - generichash_blake2b_update as crypto_generichash_blake2b_update + generichash_blake2b_salt_personal as crypto_generichash_blake2b_salt_personal, + generichash_blake2b_update as crypto_generichash_blake2b_update, ) from nacl.bindings.crypto_hash import ( - crypto_hash, crypto_hash_BYTES, crypto_hash_sha256, - crypto_hash_sha256_BYTES, crypto_hash_sha512, crypto_hash_sha512_BYTES, + crypto_hash, + crypto_hash_BYTES, + crypto_hash_sha256, + crypto_hash_sha256_BYTES, + crypto_hash_sha512, + crypto_hash_sha512_BYTES, ) from nacl.bindings.crypto_kx import ( crypto_kx_PUBLIC_KEY_BYTES, @@ -137,17 +161,27 @@ nacl_bindings_pick_scrypt_params, ) from nacl.bindings.crypto_scalarmult import ( - crypto_scalarmult, crypto_scalarmult_BYTES, crypto_scalarmult_SCALARBYTES, - crypto_scalarmult_base, crypto_scalarmult_ed25519, - crypto_scalarmult_ed25519_BYTES, crypto_scalarmult_ed25519_SCALARBYTES, - crypto_scalarmult_ed25519_base, crypto_scalarmult_ed25519_base_noclamp, - crypto_scalarmult_ed25519_noclamp, has_crypto_scalarmult_ed25519 + crypto_scalarmult, + crypto_scalarmult_BYTES, + crypto_scalarmult_SCALARBYTES, + crypto_scalarmult_base, + crypto_scalarmult_ed25519, + crypto_scalarmult_ed25519_BYTES, + crypto_scalarmult_ed25519_SCALARBYTES, + crypto_scalarmult_ed25519_base, + crypto_scalarmult_ed25519_base_noclamp, + crypto_scalarmult_ed25519_noclamp, + has_crypto_scalarmult_ed25519, ) from nacl.bindings.crypto_secretbox import ( - crypto_secretbox, crypto_secretbox_BOXZEROBYTES, crypto_secretbox_KEYBYTES, - crypto_secretbox_MACBYTES, crypto_secretbox_MESSAGEBYTES_MAX, - crypto_secretbox_NONCEBYTES, crypto_secretbox_ZEROBYTES, - crypto_secretbox_open + crypto_secretbox, + crypto_secretbox_BOXZEROBYTES, + crypto_secretbox_KEYBYTES, + crypto_secretbox_MACBYTES, + crypto_secretbox_MESSAGEBYTES_MAX, + crypto_secretbox_NONCEBYTES, + crypto_secretbox_ZEROBYTES, + crypto_secretbox_open, ) from nacl.bindings.crypto_secretstream import ( crypto_secretstream_xchacha20poly1305_ABYTES, @@ -173,25 +207,38 @@ XKEYBYTES as crypto_shorthash_siphashx24_KEYBYTES, crypto_shorthash_siphash24, crypto_shorthash_siphashx24, - has_crypto_shorthash_siphashx24 + has_crypto_shorthash_siphashx24, ) from nacl.bindings.crypto_sign import ( - crypto_sign, crypto_sign_BYTES, crypto_sign_PUBLICKEYBYTES, - crypto_sign_SECRETKEYBYTES, crypto_sign_SEEDBYTES, - crypto_sign_ed25519_pk_to_curve25519, crypto_sign_ed25519_sk_to_curve25519, - crypto_sign_ed25519_sk_to_pk, crypto_sign_ed25519_sk_to_seed, - crypto_sign_ed25519ph_STATEBYTES, crypto_sign_ed25519ph_final_create, - crypto_sign_ed25519ph_final_verify, crypto_sign_ed25519ph_state, - crypto_sign_ed25519ph_update, crypto_sign_keypair, crypto_sign_open, + crypto_sign, + crypto_sign_BYTES, + crypto_sign_PUBLICKEYBYTES, + crypto_sign_SECRETKEYBYTES, + crypto_sign_SEEDBYTES, + crypto_sign_ed25519_pk_to_curve25519, + crypto_sign_ed25519_sk_to_curve25519, + crypto_sign_ed25519_sk_to_pk, + crypto_sign_ed25519_sk_to_seed, + crypto_sign_ed25519ph_STATEBYTES, + crypto_sign_ed25519ph_final_create, + crypto_sign_ed25519ph_final_verify, + crypto_sign_ed25519ph_state, + crypto_sign_ed25519ph_update, + crypto_sign_keypair, + crypto_sign_open, crypto_sign_seed_keypair, ) from nacl.bindings.randombytes import ( randombytes, - randombytes_buf_deterministic + randombytes_buf_deterministic, ) from nacl.bindings.sodium_core import sodium_init from nacl.bindings.utils import ( - sodium_add, sodium_increment, sodium_memcmp, sodium_pad, sodium_unpad, + sodium_add, + sodium_increment, + sodium_memcmp, + sodium_pad, + sodium_unpad, ) @@ -217,7 +264,6 @@ "crypto_aead_xchacha20poly1305_ietf_NSECBYTES", "crypto_aead_xchacha20poly1305_ietf_decrypt", "crypto_aead_xchacha20poly1305_ietf_encrypt", - "crypto_box_SECRETKEYBYTES", "crypto_box_PUBLICKEYBYTES", "crypto_box_SEEDBYTES", @@ -235,7 +281,6 @@ "crypto_box_seal", "crypto_box_seal_open", "crypto_box_seed_keypair", - "has_crypto_core_ed25519", "crypto_core_ed25519_BYTES", "crypto_core_ed25519_UNIFORMBYTES", @@ -252,14 +297,12 @@ "crypto_core_ed25519_scalar_sub", "crypto_core_ed25519_scalar_mul", "crypto_core_ed25519_scalar_reduce", - "crypto_hash_BYTES", "crypto_hash_sha256_BYTES", "crypto_hash_sha512_BYTES", "crypto_hash", "crypto_hash_sha256", "crypto_hash_sha512", - "crypto_generichash_BYTES", "crypto_generichash_BYTES_MIN", "crypto_generichash_BYTES_MAX", @@ -273,7 +316,6 @@ "crypto_generichash_blake2b_init", "crypto_generichash_blake2b_update", "crypto_generichash_blake2b_final", - "crypto_kx_keypair", "crypto_kx_seed_keypair", "crypto_kx_client_session_keys", @@ -282,7 +324,6 @@ "crypto_kx_SECRET_KEY_BYTES", "crypto_kx_SEED_BYTES", "crypto_kx_SESSION_KEY_BYTES", - "has_crypto_scalarmult_ed25519", "crypto_scalarmult_BYTES", "crypto_scalarmult_SCALARBYTES", @@ -294,7 +335,6 @@ "crypto_scalarmult_ed25519_base", "crypto_scalarmult_ed25519_noclamp", "crypto_scalarmult_ed25519_base_noclamp", - "crypto_secretbox_KEYBYTES", "crypto_secretbox_NONCEBYTES", "crypto_secretbox_ZEROBYTES", @@ -303,7 +343,6 @@ "crypto_secretbox_MESSAGEBYTES_MAX", "crypto_secretbox", "crypto_secretbox_open", - "crypto_secretstream_xchacha20poly1305_ABYTES", "crypto_secretstream_xchacha20poly1305_HEADERBYTES", "crypto_secretstream_xchacha20poly1305_KEYBYTES", @@ -319,7 +358,6 @@ "crypto_secretstream_xchacha20poly1305_push", "crypto_secretstream_xchacha20poly1305_rekey", "crypto_secretstream_xchacha20poly1305_state", - "has_crypto_shorthash_siphashx24", "crypto_shorthash_siphash24_BYTES", "crypto_shorthash_siphash24_KEYBYTES", @@ -327,7 +365,6 @@ "crypto_shorthash_siphashx24_BYTES", "crypto_shorthash_siphashx24_KEYBYTES", "crypto_shorthash_siphashx24", - "crypto_sign_BYTES", "crypto_sign_SEEDBYTES", "crypto_sign_PUBLICKEYBYTES", @@ -345,7 +382,6 @@ "crypto_sign_ed25519ph_final_verify", "crypto_sign_ed25519ph_state", "crypto_sign_ed25519ph_update", - "crypto_pwhash_ALG_ARGON2I13", "crypto_pwhash_ALG_ARGON2ID13", "crypto_pwhash_ALG_DEFAULT", @@ -355,7 +391,6 @@ "crypto_pwhash_PASSWD_MIN", "crypto_pwhash_SALTBYTES", "crypto_pwhash_STRBYTES", - "crypto_pwhash_alg", "crypto_pwhash_argon2i_MEMLIMIT_MIN", "crypto_pwhash_argon2i_MEMLIMIT_MAX", @@ -368,7 +403,6 @@ "crypto_pwhash_argon2i_OPSLIMIT_MODERATE", "crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE", "crypto_pwhash_argon2i_STRPREFIX", - "crypto_pwhash_argon2id_MEMLIMIT_MIN", "crypto_pwhash_argon2id_MEMLIMIT_MAX", "crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE", @@ -380,10 +414,8 @@ "crypto_pwhash_argon2id_OPSLIMIT_MODERATE", "crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE", "crypto_pwhash_argon2id_STRPREFIX", - "crypto_pwhash_str_alg", "crypto_pwhash_str_verify", - "has_crypto_pwhash_scryptsalsa208sha256", "crypto_pwhash_scryptsalsa208sha256_BYTES_MAX", "crypto_pwhash_scryptsalsa208sha256_BYTES_MIN", @@ -404,15 +436,11 @@ "crypto_pwhash_scryptsalsa208sha256_str", "crypto_pwhash_scryptsalsa208sha256_str_verify", "nacl_bindings_pick_scrypt_params", - "randombytes", "randombytes_buf_deterministic", - "sodium_init", - "sodium_add", "sodium_increment", - "sodium_memcmp", "sodium_pad", "sodium_unpad", diff -Nru python-nacl-1.4.0/src/nacl/bindings/randombytes.py python-nacl-1.5.0/src/nacl/bindings/randombytes.py --- python-nacl-1.4.0/src/nacl/bindings/randombytes.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/randombytes.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,15 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib -randombytes_SEEDBYTES = lib.randombytes_seedbytes() +randombytes_SEEDBYTES: int = lib.randombytes_seedbytes() -def randombytes(size): +def randombytes(size: int) -> bytes: """ Returns ``size`` number of random bytes from a cryptographically secure random source. @@ -33,7 +32,7 @@ return ffi.buffer(buf, size)[:] -def randombytes_buf_deterministic(size, seed): +def randombytes_buf_deterministic(size: int, seed: bytes) -> bytes: """ Returns ``size`` number of deterministically generated pseudorandom bytes from a seed @@ -43,8 +42,9 @@ :rtype: bytes """ if len(seed) != randombytes_SEEDBYTES: - raise exc.TypeError("Deterministic random bytes must be generated " - "from 32 bytes") + raise exc.TypeError( + "Deterministic random bytes must be generated from 32 bytes" + ) buf = ffi.new("unsigned char[]", size) lib.randombytes_buf_deterministic(buf, size, seed) diff -Nru python-nacl-1.4.0/src/nacl/bindings/sodium_core.py python-nacl-1.5.0/src/nacl/bindings/sodium_core.py --- python-nacl-1.4.0/src/nacl/bindings/sodium_core.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/sodium_core.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,20 +11,21 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from nacl import exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -def _sodium_init(): - ensure(lib.sodium_init() != -1, - "Could not initialize sodium", - raising=exc.RuntimeError) +def _sodium_init() -> None: + ensure( + lib.sodium_init() != -1, + "Could not initialize sodium", + raising=exc.RuntimeError, + ) -def sodium_init(): +def sodium_init() -> None: """ Initializes sodium, picking the best implementations available for this machine. diff -Nru python-nacl-1.4.0/src/nacl/bindings/utils.py python-nacl-1.5.0/src/nacl/bindings/utils.py --- python-nacl-1.4.0/src/nacl/bindings/utils.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/bindings/utils.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,23 +11,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function - -from six import integer_types import nacl.exceptions as exc from nacl._sodium import ffi, lib from nacl.exceptions import ensure -def sodium_memcmp(inp1, inp2): +def sodium_memcmp(inp1: bytes, inp2: bytes) -> bool: """ Compare contents of two memory regions in constant time """ - ensure(isinstance(inp1, bytes), - raising=exc.TypeError) - ensure(isinstance(inp2, bytes), - raising=exc.TypeError) + ensure(isinstance(inp1, bytes), raising=exc.TypeError) + ensure(isinstance(inp2, bytes), raising=exc.TypeError) ln = max(len(inp1), len(inp2)) @@ -43,7 +38,7 @@ return eqL and eqC -def sodium_pad(s, blocksize): +def sodium_pad(s: bytes, blocksize: int) -> bytes: """ Pad the input bytearray ``s`` to a multiple of ``blocksize`` using the ISO/IEC 7816-4 algorithm @@ -55,10 +50,8 @@ :return: padded string :rtype: bytes """ - ensure(isinstance(s, bytes), - raising=exc.TypeError) - ensure(isinstance(blocksize, integer_types), - raising=exc.TypeError) + ensure(isinstance(s, bytes), raising=exc.TypeError) + ensure(isinstance(blocksize, int), raising=exc.TypeError) if blocksize <= 0: raise exc.ValueError s_len = len(s) @@ -71,7 +64,7 @@ return ffi.buffer(buf, p_len[0])[:] -def sodium_unpad(s, blocksize): +def sodium_unpad(s: bytes, blocksize: int) -> bytes: """ Remove ISO/IEC 7816-4 padding from the input byte array ``s`` @@ -82,19 +75,17 @@ :return: unpadded string :rtype: bytes """ - ensure(isinstance(s, bytes), - raising=exc.TypeError) - ensure(isinstance(blocksize, integer_types), - raising=exc.TypeError) + ensure(isinstance(s, bytes), raising=exc.TypeError) + ensure(isinstance(blocksize, int), raising=exc.TypeError) s_len = len(s) u_len = ffi.new("size_t []", 1) rc = lib.sodium_unpad(u_len, s, s_len, blocksize) if rc != 0: raise exc.CryptoError("Unpadding failure") - return s[:u_len[0]] + return s[: u_len[0]] -def sodium_increment(inp): +def sodium_increment(inp: bytes) -> bytes: """ Increment the value of a byte-sequence interpreted as the little-endian representation of a unsigned big integer. @@ -107,8 +98,7 @@ :rtype: bytes """ - ensure(isinstance(inp, bytes), - raising=exc.TypeError) + ensure(isinstance(inp, bytes), raising=exc.TypeError) ln = len(inp) buf = ffi.new("unsigned char []", ln) @@ -120,7 +110,7 @@ return ffi.buffer(buf, ln)[:] -def sodium_add(a, b): +def sodium_add(a: bytes, b: bytes) -> bytes: """ Given a couple of *same-sized* byte sequences, interpreted as the little-endian representation of two unsigned integers, compute @@ -135,13 +125,10 @@ the integer value of ``(to_int(a) + to_int(b)) mod 2^(8*len(a))`` :rtype: bytes """ - ensure(isinstance(a, bytes), - raising=exc.TypeError) - ensure(isinstance(b, bytes), - raising=exc.TypeError) + ensure(isinstance(a, bytes), raising=exc.TypeError) + ensure(isinstance(b, bytes), raising=exc.TypeError) ln = len(a) - ensure(len(b) == ln, - raising=exc.TypeError) + ensure(len(b) == ln, raising=exc.TypeError) buf_a = ffi.new("unsigned char []", ln) buf_b = ffi.new("unsigned char []", ln) diff -Nru python-nacl-1.4.0/src/nacl/encoding.py python-nacl-1.5.0/src/nacl/encoding.py --- python-nacl-1.4.0/src/nacl/encoding.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/encoding.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,80 +11,95 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - import base64 import binascii +from abc import ABCMeta, abstractmethod +from typing import SupportsBytes, Type -class RawEncoder(object): +# TODO: when the minimum supported version of Python is 3.8, we can import +# Protocol from typing, and replace Encoder with a Protocol instead. +class _Encoder(metaclass=ABCMeta): + @staticmethod + @abstractmethod + def encode(data: bytes) -> bytes: + """Transform raw data to encoded data.""" @staticmethod - def encode(data): - return data + @abstractmethod + def decode(data: bytes) -> bytes: + """Transform encoded data back to raw data. + + Decoding after encoding should be a no-op, i.e. `decode(encode(x)) == x`. + """ + + +# Functions that use encoders are passed a subclass of _Encoder, not an instance +# (because the methods are all static). Let's gloss over that detail by defining +# an alias for Type[_Encoder]. +Encoder = Type[_Encoder] + +class RawEncoder(_Encoder): @staticmethod - def decode(data): + def encode(data: bytes) -> bytes: return data + @staticmethod + def decode(data: bytes) -> bytes: + return data -class HexEncoder(object): +class HexEncoder(_Encoder): @staticmethod - def encode(data): + def encode(data: bytes) -> bytes: return binascii.hexlify(data) @staticmethod - def decode(data): + def decode(data: bytes) -> bytes: return binascii.unhexlify(data) -class Base16Encoder(object): - +class Base16Encoder(_Encoder): @staticmethod - def encode(data): + def encode(data: bytes) -> bytes: return base64.b16encode(data) @staticmethod - def decode(data): + def decode(data: bytes) -> bytes: return base64.b16decode(data) -class Base32Encoder(object): - +class Base32Encoder(_Encoder): @staticmethod - def encode(data): + def encode(data: bytes) -> bytes: return base64.b32encode(data) @staticmethod - def decode(data): + def decode(data: bytes) -> bytes: return base64.b32decode(data) -class Base64Encoder(object): - +class Base64Encoder(_Encoder): @staticmethod - def encode(data): + def encode(data: bytes) -> bytes: return base64.b64encode(data) @staticmethod - def decode(data): + def decode(data: bytes) -> bytes: return base64.b64decode(data) -class URLSafeBase64Encoder(object): - +class URLSafeBase64Encoder(_Encoder): @staticmethod - def encode(data): + def encode(data: bytes) -> bytes: return base64.urlsafe_b64encode(data) @staticmethod - def decode(data): + def decode(data: bytes) -> bytes: return base64.urlsafe_b64decode(data) -class Encodable(object): - - def encode(self, encoder=RawEncoder): +class Encodable: + def encode(self: SupportsBytes, encoder: Encoder = RawEncoder) -> bytes: return encoder.encode(bytes(self)) diff -Nru python-nacl-1.4.0/src/nacl/exceptions.py python-nacl-1.5.0/src/nacl/exceptions.py --- python-nacl-1.4.0/src/nacl/exceptions.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/exceptions.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function + +# We create a clone of various builtin Exception types which additionally +# inherit from CryptoError. Below, we refer to the parent types via the +# `builtins` namespace, so mypy can distinguish between (e.g.) +# `nacl.exceptions.RuntimeError` and `builtins.RuntimeError`. +import builtins +from typing import Type class CryptoError(Exception): @@ -27,19 +33,19 @@ """ -class RuntimeError(RuntimeError, CryptoError): +class RuntimeError(builtins.RuntimeError, CryptoError): pass -class AssertionError(AssertionError, CryptoError): +class AssertionError(builtins.AssertionError, CryptoError): pass -class TypeError(TypeError, CryptoError): +class TypeError(builtins.TypeError, CryptoError): pass -class ValueError(ValueError, CryptoError): +class ValueError(builtins.ValueError, CryptoError): pass @@ -57,10 +63,11 @@ trying to call functions not available in a minimal build of libsodium. """ + pass -def ensure(cond, *args, **kwds): +def ensure(cond: bool, *args: object, **kwds: Type[Exception]) -> None: """ Return if a condition is true, otherwise raise a caller-configurable :py:class:`Exception` @@ -70,9 +77,9 @@ The only accepted named parameter is `raising` used to configure the exception to be raised if `cond` is not `True` """ - _CHK_UNEXP = 'check_condition() got an unexpected keyword argument {0}' + _CHK_UNEXP = "check_condition() got an unexpected keyword argument {0}" - raising = kwds.pop('raising', AssertionError) + raising = kwds.pop("raising", AssertionError) if kwds: raise TypeError(_CHK_UNEXP.format(repr(kwds.popitem()[0]))) diff -Nru python-nacl-1.4.0/src/nacl/hashlib.py python-nacl-1.5.0/src/nacl/hashlib.py --- python-nacl-1.4.0/src/nacl/hashlib.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/hashlib.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import binascii +from typing import NoReturn import nacl.bindings from nacl.utils import bytes_as_string @@ -35,17 +35,24 @@ _b2b_update = nacl.bindings.crypto_generichash_blake2b_update -class blake2b(object): +class blake2b: """ :py:mod:`hashlib` API compatible blake2b algorithm implementation """ + MAX_DIGEST_SIZE = BYTES MAX_KEY_SIZE = KEYBYTES_MAX PERSON_SIZE = PERSONALBYTES SALT_SIZE = SALTBYTES - def __init__(self, data=b'', digest_size=BYTES, key=b'', - salt=b'', person=b''): + def __init__( + self, + data: bytes = b"", + digest_size: int = BYTES, + key: bytes = b"", + salt: bytes = b"", + person: bytes = b"", + ): """ :py:class:`.blake2b` algorithm initializer @@ -67,52 +74,61 @@ :type person: bytes """ - self._state = _b2b_init(key=key, salt=salt, person=person, - digest_size=digest_size) + self._state = _b2b_init( + key=key, salt=salt, person=person, digest_size=digest_size + ) self._digest_size = digest_size if data: self.update(data) @property - def digest_size(self): + def digest_size(self) -> int: return self._digest_size @property - def block_size(self): + def block_size(self) -> int: return 128 @property - def name(self): - return 'blake2b' + def name(self) -> str: + return "blake2b" - def update(self, data): + def update(self, data: bytes) -> None: _b2b_update(self._state, data) - def digest(self): + def digest(self) -> bytes: _st = self._state.copy() return _b2b_final(_st) - def hexdigest(self): + def hexdigest(self) -> str: return bytes_as_string(binascii.hexlify(self.digest())) - def copy(self): + def copy(self) -> "blake2b": _cp = type(self)(digest_size=self.digest_size) _st = self._state.copy() _cp._state = _st return _cp - def __reduce__(self): + def __reduce__(self) -> NoReturn: """ Raise the same exception as hashlib's blake implementation on copy.copy() """ - raise TypeError("can't pickle {} objects".format( - self.__class__.__name__)) + raise TypeError( + "can't pickle {} objects".format(self.__class__.__name__) + ) -def scrypt(password, salt='', n=2**20, r=8, p=1, - maxmem=2**25, dklen=64): +def scrypt( + password: bytes, + salt: bytes = b"", + n: int = 2 ** 20, + r: int = 8, + p: int = 1, + maxmem: int = 2 ** 25, + dklen: int = 64, +) -> bytes: """ Derive a cryptographic key using the scrypt KDF. @@ -123,4 +139,5 @@ in cpython version 3.6 """ return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_ll( - password, salt, n, r, p, maxmem=maxmem, dklen=dklen) + password, salt, n, r, p, maxmem=maxmem, dklen=dklen + ) diff -Nru python-nacl-1.4.0/src/nacl/hash.py python-nacl-1.5.0/src/nacl/hash.py --- python-nacl-1.4.0/src/nacl/hash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/hash.py 2022-01-07 21:54:10.000000000 +0000 @@ -17,7 +17,6 @@ for their usage. """ -from __future__ import absolute_import, division, print_function import nacl.bindings import nacl.encoding @@ -60,7 +59,9 @@ _sip_hashx = nacl.bindings.crypto_shorthash_siphashx24 -def sha256(message, encoder=nacl.encoding.HexEncoder): +def sha256( + message: bytes, encoder: nacl.encoding.Encoder = nacl.encoding.HexEncoder +) -> bytes: """ Hashes ``message`` with SHA256. @@ -73,7 +74,9 @@ return encoder.encode(nacl.bindings.crypto_hash_sha256(message)) -def sha512(message, encoder=nacl.encoding.HexEncoder): +def sha512( + message: bytes, encoder: nacl.encoding.Encoder = nacl.encoding.HexEncoder +) -> bytes: """ Hashes ``message`` with SHA512. @@ -86,9 +89,14 @@ return encoder.encode(nacl.bindings.crypto_hash_sha512(message)) -def blake2b(data, digest_size=BLAKE2B_BYTES, key=b'', - salt=b'', person=b'', - encoder=nacl.encoding.HexEncoder): +def blake2b( + data: bytes, + digest_size: int = BLAKE2B_BYTES, + key: bytes = b"", + salt: bytes = b"", + person: bytes = b"", + encoder: nacl.encoding.Encoder = nacl.encoding.HexEncoder, +) -> bytes: """ Hashes ``data`` with blake2b. @@ -116,15 +124,20 @@ :rtype: bytes """ - digest = _b2b_hash(data, digest_size=digest_size, key=key, - salt=salt, person=person) + digest = _b2b_hash( + data, digest_size=digest_size, key=key, salt=salt, person=person + ) return encoder.encode(digest) generichash = blake2b -def siphash24(message, key=b'', encoder=nacl.encoding.HexEncoder): +def siphash24( + message: bytes, + key: bytes = b"", + encoder: nacl.encoding.Encoder = nacl.encoding.HexEncoder, +) -> bytes: """ Computes a keyed MAC of ``message`` using the short-input-optimized siphash-2-4 construction. @@ -144,7 +157,11 @@ shorthash = siphash24 -def siphashx24(message, key=b'', encoder=nacl.encoding.HexEncoder): +def siphashx24( + message: bytes, + key: bytes = b"", + encoder: nacl.encoding.Encoder = nacl.encoding.HexEncoder, +) -> bytes: """ Computes a keyed MAC of ``message`` using the 128 bit variant of the siphash-2-4 construction. diff -Nru python-nacl-1.4.0/src/nacl/__init__.py python-nacl-1.5.0/src/nacl/__init__.py --- python-nacl-1.4.0/src/nacl/__init__.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/__init__.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,22 +12,28 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function __all__ = [ - "__title__", "__summary__", "__uri__", "__version__", "__author__", - "__email__", "__license__", "__copyright__", + "__title__", + "__summary__", + "__uri__", + "__version__", + "__author__", + "__email__", + "__license__", + "__copyright__", ] __title__ = "PyNaCl" -__summary__ = ("Python binding to the Networking and Cryptography (NaCl) " - "library") +__summary__ = ( + "Python binding to the Networking and Cryptography (NaCl) library" +) __uri__ = "https://github.com/pyca/pynacl/" -__version__ = "1.4.0" +__version__ = "1.5.0" __author__ = "The PyNaCl developers" __email__ = "cryptography-dev@python.org" __license__ = "Apache License 2.0" -__copyright__ = "Copyright 2013-2018 {0}".format(__author__) +__copyright__ = "Copyright 2013-2018 {}".format(__author__) diff -Nru python-nacl-1.4.0/src/nacl/public.py python-nacl-1.5.0/src/nacl/public.py --- python-nacl-1.4.0/src/nacl/public.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/public.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,16 +11,16 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import ClassVar, Generic, Optional, Type, TypeVar import nacl.bindings from nacl import encoding from nacl import exceptions as exc +from nacl.encoding import Encoder from nacl.utils import EncryptedMessage, StringFixer, random -class PublicKey(encoding.Encodable, StringFixer, object): +class PublicKey(encoding.Encodable, StringFixer): """ The public key counterpart to an Curve25519 :class:`nacl.public.PrivateKey` for encrypting messages. @@ -31,36 +31,40 @@ :cvar SIZE: The size that the public key is required to be """ - SIZE = nacl.bindings.crypto_box_PUBLICKEYBYTES + SIZE: ClassVar[int] = nacl.bindings.crypto_box_PUBLICKEYBYTES - def __init__(self, public_key, encoder=encoding.RawEncoder): + def __init__( + self, + public_key: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ): self._public_key = encoder.decode(public_key) if not isinstance(self._public_key, bytes): raise exc.TypeError("PublicKey must be created from 32 bytes") if len(self._public_key) != self.SIZE: raise exc.ValueError( - "The public key must be exactly {0} bytes long".format( + "The public key must be exactly {} bytes long".format( self.SIZE ) ) - def __bytes__(self): + def __bytes__(self) -> bytes: return self._public_key - def __hash__(self): + def __hash__(self) -> int: return hash(bytes(self)) - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if not isinstance(other, self.__class__): return False return nacl.bindings.sodium_memcmp(bytes(self), bytes(other)) - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not (self == other) -class PrivateKey(encoding.Encodable, StringFixer, object): +class PrivateKey(encoding.Encodable, StringFixer): """ Private key for decrypting messages using the Curve25519 algorithm. @@ -77,18 +81,26 @@ private key is required to be """ - SIZE = nacl.bindings.crypto_box_SECRETKEYBYTES - SEED_SIZE = nacl.bindings.crypto_box_SEEDBYTES + SIZE: ClassVar[int] = nacl.bindings.crypto_box_SECRETKEYBYTES + SEED_SIZE: ClassVar[int] = nacl.bindings.crypto_box_SEEDBYTES - def __init__(self, private_key, encoder=encoding.RawEncoder): + def __init__( + self, + private_key: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ): # Decode the secret_key private_key = encoder.decode(private_key) # verify the given secret key type and size are correct - if not (isinstance(private_key, bytes) and - len(private_key) == self.SIZE): - raise exc.TypeError(("PrivateKey must be created from a {0} " - "bytes long raw secret key").format(self.SIZE) - ) + if not ( + isinstance(private_key, bytes) and len(private_key) == self.SIZE + ): + raise exc.TypeError( + ( + "PrivateKey must be created from a {} " + "bytes long raw secret key" + ).format(self.SIZE) + ) raw_public_key = nacl.bindings.crypto_scalarmult_base(private_key) @@ -96,7 +108,11 @@ self.public_key = PublicKey(raw_public_key) @classmethod - def from_seed(cls, seed, encoder=encoding.RawEncoder): + def from_seed( + cls, + seed: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> "PrivateKey": """ Generate a PrivateKey using a deterministic construction starting from a caller-provided seed @@ -116,30 +132,33 @@ seed = encoder.decode(seed) # Verify the given seed type and size are correct if not (isinstance(seed, bytes) and len(seed) == cls.SEED_SIZE): - raise exc.TypeError(("PrivateKey seed must be a {0} bytes long " - "binary sequence").format(cls.SEED_SIZE) - ) + raise exc.TypeError( + ( + "PrivateKey seed must be a {} bytes long " + "binary sequence" + ).format(cls.SEED_SIZE) + ) # generate a raw keypair from the given seed raw_pk, raw_sk = nacl.bindings.crypto_box_seed_keypair(seed) # construct a instance from the raw secret key return cls(raw_sk) - def __bytes__(self): + def __bytes__(self) -> bytes: return self._private_key - def __hash__(self): + def __hash__(self) -> int: return hash((type(self), bytes(self.public_key))) - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if not isinstance(other, self.__class__): return False return self.public_key == other.public_key - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not (self == other) @classmethod - def generate(cls): + def generate(cls) -> "PrivateKey": """ Generates a random :class:`~nacl.public.PrivateKey` object @@ -148,7 +167,10 @@ return cls(random(PrivateKey.SIZE), encoder=encoding.RawEncoder) -class Box(encoding.Encodable, StringFixer, object): +_Box = TypeVar("_Box", bound="Box") + + +class Box(encoding.Encodable, StringFixer): """ The Box class boxes and unboxes messages between a pair of keys @@ -168,35 +190,45 @@ :cvar NONCE_SIZE: The size that the nonce is required to be. """ - NONCE_SIZE = nacl.bindings.crypto_box_NONCEBYTES + NONCE_SIZE: ClassVar[int] = nacl.bindings.crypto_box_NONCEBYTES + _shared_key: bytes - def __init__(self, private_key, public_key): - if private_key and public_key: - if ((not isinstance(private_key, PrivateKey) or - not isinstance(public_key, PublicKey))): - raise exc.TypeError("Box must be created from " - "a PrivateKey and a PublicKey") - self._shared_key = nacl.bindings.crypto_box_beforenm( - public_key.encode(encoder=encoding.RawEncoder), - private_key.encode(encoder=encoding.RawEncoder), + def __init__(self, private_key: PrivateKey, public_key: PublicKey): + if not isinstance(private_key, PrivateKey) or not isinstance( + public_key, PublicKey + ): + raise exc.TypeError( + "Box must be created from a PrivateKey and a PublicKey" ) - else: - self._shared_key = None + self._shared_key = nacl.bindings.crypto_box_beforenm( + public_key.encode(encoder=encoding.RawEncoder), + private_key.encode(encoder=encoding.RawEncoder), + ) - def __bytes__(self): + def __bytes__(self) -> bytes: return self._shared_key @classmethod - def decode(cls, encoded, encoder=encoding.RawEncoder): + def decode( + cls: Type[_Box], encoded: bytes, encoder: Encoder = encoding.RawEncoder + ) -> _Box: + """ + Alternative constructor. Creates a Box from an existing Box's shared key. + """ # Create an empty box - box = cls(None, None) + box: _Box = cls.__new__(cls) # Assign our decoded value to the shared key of the box box._shared_key = encoder.decode(encoded) return box - def encrypt(self, plaintext, nonce=None, encoder=encoding.RawEncoder): + def encrypt( + self, + plaintext: bytes, + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> EncryptedMessage: """ Encrypts the plaintext message using the given `nonce` (or generates one randomly if omitted) and returns the ciphertext encoded with the @@ -215,8 +247,9 @@ nonce = random(self.NONCE_SIZE) if len(nonce) != self.NONCE_SIZE: - raise exc.ValueError("The nonce must be exactly %s bytes long" % - self.NONCE_SIZE) + raise exc.ValueError( + "The nonce must be exactly %s bytes long" % self.NONCE_SIZE + ) ciphertext = nacl.bindings.crypto_box_afternm( plaintext, @@ -233,7 +266,12 @@ encoder.encode(nonce + ciphertext), ) - def decrypt(self, ciphertext, nonce=None, encoder=encoding.RawEncoder): + def decrypt( + self, + ciphertext: bytes, + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: """ Decrypts the ciphertext using the `nonce` (explicitly, when passed as a parameter or implicitly, when omitted, as part of the ciphertext) and @@ -250,12 +288,13 @@ if nonce is None: # If we were given the nonce and ciphertext combined, split them. - nonce = ciphertext[:self.NONCE_SIZE] - ciphertext = ciphertext[self.NONCE_SIZE:] + nonce = ciphertext[: self.NONCE_SIZE] + ciphertext = ciphertext[self.NONCE_SIZE :] if len(nonce) != self.NONCE_SIZE: - raise exc.ValueError("The nonce must be exactly %s bytes long" % - self.NONCE_SIZE) + raise exc.ValueError( + "The nonce must be exactly %s bytes long" % self.NONCE_SIZE + ) plaintext = nacl.bindings.crypto_box_open_afternm( ciphertext, @@ -265,7 +304,7 @@ return plaintext - def shared_key(self): + def shared_key(self) -> bytes: """ Returns the Curve25519 shared secret, that can then be used as a key in other symmetric ciphers. @@ -280,7 +319,10 @@ return self._shared_key -class SealedBox(encoding.Encodable, StringFixer, object): +_Key = TypeVar("_Key", PublicKey, PrivateKey) + + +class SealedBox(Generic[_Key], encoding.Encodable, StringFixer): """ The SealedBox class boxes and unboxes messages addressed to a specified key-pair by using ephemeral sender's keypairs, @@ -291,33 +333,42 @@ the public part of the ephemeral key before the :class:`~nacl.public.Box` ciphertext. - :param public_key: :class:`~nacl.public.PublicKey` used to encrypt - messages and derive nonces - :param private_key: :class:`~nacl.public.PrivateKey` used to decrypt - messages + :param recipient_key: a :class:`~nacl.public.PublicKey` used to encrypt + messages and derive nonces, or a :class:`~nacl.public.PrivateKey` used + to decrypt messages. .. versionadded:: 1.2 """ - def __init__(self, recipient_key): + _public_key: bytes + _private_key: Optional[bytes] + def __init__(self, recipient_key: _Key): if isinstance(recipient_key, PublicKey): self._public_key = recipient_key.encode( - encoder=encoding.RawEncoder) + encoder=encoding.RawEncoder + ) self._private_key = None elif isinstance(recipient_key, PrivateKey): self._private_key = recipient_key.encode( - encoder=encoding.RawEncoder) + encoder=encoding.RawEncoder + ) self._public_key = recipient_key.public_key.encode( - encoder=encoding.RawEncoder) + encoder=encoding.RawEncoder + ) else: - raise exc.TypeError("SealedBox must be created from " - "a PublicKey or a PrivateKey") + raise exc.TypeError( + "SealedBox must be created from a PublicKey or a PrivateKey" + ) - def __bytes__(self): + def __bytes__(self) -> bytes: return self._public_key - def encrypt(self, plaintext, encoder=encoding.RawEncoder): + def encrypt( + self, + plaintext: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: """ Encrypts the plaintext message using a random-generated ephemeral keypair and returns a "composed ciphertext", containing both @@ -333,16 +384,17 @@ :return bytes: encoded ciphertext """ - ciphertext = nacl.bindings.crypto_box_seal( - plaintext, - self._public_key - ) + ciphertext = nacl.bindings.crypto_box_seal(plaintext, self._public_key) encoded_ciphertext = encoder.encode(ciphertext) return encoded_ciphertext - def decrypt(self, ciphertext, encoder=encoding.RawEncoder): + def decrypt( + self: "SealedBox[PrivateKey]", + ciphertext: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: """ Decrypts the ciphertext using the ephemeral public key enclosed in the ciphertext and the SealedBox private key, returning @@ -351,10 +403,17 @@ :param ciphertext: [:class:`bytes`] The encrypted message to decrypt :param encoder: The encoder used to decode the ciphertext. :return bytes: The original plaintext + :raises TypeError: if this SealedBox was created with a + :class:`~nacl.public.PublicKey` rather than a + :class:`~nacl.public.PrivateKey`. """ # Decode our ciphertext ciphertext = encoder.decode(ciphertext) + if self._private_key is None: + raise TypeError( + "SealedBoxes created with a public key cannot decrypt" + ) plaintext = nacl.bindings.crypto_box_seal_open( ciphertext, self._public_key, diff -Nru python-nacl-1.4.0/src/nacl/pwhash/argon2id.py python-nacl-1.5.0/src/nacl/pwhash/argon2id.py --- python-nacl-1.4.0/src/nacl/pwhash/argon2id.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/pwhash/argon2id.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -from __future__ import division import nacl.bindings import nacl.encoding @@ -39,25 +37,27 @@ OPSLIMIT_MIN = nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_MIN OPSLIMIT_MAX = nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_MAX -OPSLIMIT_INTERACTIVE = \ +OPSLIMIT_INTERACTIVE = ( nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_INTERACTIVE -MEMLIMIT_INTERACTIVE = \ +) +MEMLIMIT_INTERACTIVE = ( nacl.bindings.crypto_pwhash_argon2id_MEMLIMIT_INTERACTIVE -OPSLIMIT_SENSITIVE = \ - nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE -MEMLIMIT_SENSITIVE = \ - nacl.bindings.crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE - -OPSLIMIT_MODERATE = \ - nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_MODERATE -MEMLIMIT_MODERATE = \ - nacl.bindings.crypto_pwhash_argon2id_MEMLIMIT_MODERATE - - -def kdf(size, password, salt, - opslimit=OPSLIMIT_SENSITIVE, - memlimit=MEMLIMIT_SENSITIVE, - encoder=nacl.encoding.RawEncoder): +) +OPSLIMIT_SENSITIVE = nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_SENSITIVE +MEMLIMIT_SENSITIVE = nacl.bindings.crypto_pwhash_argon2id_MEMLIMIT_SENSITIVE + +OPSLIMIT_MODERATE = nacl.bindings.crypto_pwhash_argon2id_OPSLIMIT_MODERATE +MEMLIMIT_MODERATE = nacl.bindings.crypto_pwhash_argon2id_MEMLIMIT_MODERATE + + +def kdf( + size: int, + password: bytes, + salt: bytes, + opslimit: int = OPSLIMIT_SENSITIVE, + memlimit: int = MEMLIMIT_SENSITIVE, + encoder: nacl.encoding.Encoder = nacl.encoding.RawEncoder, +) -> bytes: """ Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the argon2i @@ -104,15 +104,17 @@ """ return encoder.encode( - nacl.bindings.crypto_pwhash_alg(size, password, salt, - opslimit, memlimit, - ALG) + nacl.bindings.crypto_pwhash_alg( + size, password, salt, opslimit, memlimit, ALG + ) ) -def str(password, - opslimit=OPSLIMIT_INTERACTIVE, - memlimit=MEMLIMIT_INTERACTIVE): +def str( + password: bytes, + opslimit: int = OPSLIMIT_INTERACTIVE, + memlimit: int = MEMLIMIT_INTERACTIVE, +) -> bytes: """ Hashes a password with a random salt, using the memory-hard argon2id construct and returning an ascii string that has all @@ -128,7 +130,6 @@ .. versionadded:: 1.2 """ - return nacl.bindings.crypto_pwhash_str_alg(password, - opslimit, - memlimit, - ALG) + return nacl.bindings.crypto_pwhash_str_alg( + password, opslimit, memlimit, ALG + ) diff -Nru python-nacl-1.4.0/src/nacl/pwhash/argon2i.py python-nacl-1.5.0/src/nacl/pwhash/argon2i.py --- python-nacl-1.4.0/src/nacl/pwhash/argon2i.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/pwhash/argon2i.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -from __future__ import division import nacl.bindings import nacl.encoding @@ -39,25 +37,23 @@ OPSLIMIT_MAX = nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_MAX OPSLIMIT_MIN = nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_MIN -OPSLIMIT_INTERACTIVE = \ - nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE -MEMLIMIT_INTERACTIVE = \ - nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE -OPSLIMIT_SENSITIVE = \ - nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE -MEMLIMIT_SENSITIVE = \ - nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE - -OPSLIMIT_MODERATE = \ - nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_MODERATE -MEMLIMIT_MODERATE = \ - nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_MODERATE - - -def kdf(size, password, salt, - opslimit=OPSLIMIT_SENSITIVE, - memlimit=MEMLIMIT_SENSITIVE, - encoder=nacl.encoding.RawEncoder): +OPSLIMIT_INTERACTIVE = nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_INTERACTIVE +MEMLIMIT_INTERACTIVE = nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_INTERACTIVE +OPSLIMIT_SENSITIVE = nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_SENSITIVE +MEMLIMIT_SENSITIVE = nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_SENSITIVE + +OPSLIMIT_MODERATE = nacl.bindings.crypto_pwhash_argon2i_OPSLIMIT_MODERATE +MEMLIMIT_MODERATE = nacl.bindings.crypto_pwhash_argon2i_MEMLIMIT_MODERATE + + +def kdf( + size: int, + password: bytes, + salt: bytes, + opslimit: int = OPSLIMIT_SENSITIVE, + memlimit: int = MEMLIMIT_SENSITIVE, + encoder: nacl.encoding.Encoder = nacl.encoding.RawEncoder, +) -> bytes: """ Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the argon2i @@ -104,15 +100,17 @@ """ return encoder.encode( - nacl.bindings.crypto_pwhash_alg(size, password, salt, - opslimit, memlimit, - ALG) + nacl.bindings.crypto_pwhash_alg( + size, password, salt, opslimit, memlimit, ALG + ) ) -def str(password, - opslimit=OPSLIMIT_INTERACTIVE, - memlimit=MEMLIMIT_INTERACTIVE): +def str( + password: bytes, + opslimit: int = OPSLIMIT_INTERACTIVE, + memlimit: int = MEMLIMIT_INTERACTIVE, +) -> bytes: """ Hashes a password with a random salt, using the memory-hard argon2i construct and returning an ascii string that has all @@ -129,7 +127,6 @@ .. versionadded:: 1.2 """ - return nacl.bindings.crypto_pwhash_str_alg(password, - opslimit, - memlimit, - ALG) + return nacl.bindings.crypto_pwhash_str_alg( + password, opslimit, memlimit, ALG + ) diff -Nru python-nacl-1.4.0/src/nacl/pwhash/_argon2.py python-nacl-1.5.0/src/nacl/pwhash/_argon2.py --- python-nacl-1.4.0/src/nacl/pwhash/_argon2.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/pwhash/_argon2.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -from __future__ import division import nacl.bindings @@ -34,7 +32,7 @@ ALG_ARGON2_DEFAULT = nacl.bindings.crypto_pwhash_ALG_DEFAULT -def verify(password_hash, password): +def verify(password_hash: bytes, password: bytes) -> bool: """ Takes a modular crypt encoded argon2i or argon2id stored password hash and checks if the user provided password will hash to the same string @@ -48,5 +46,4 @@ .. versionadded:: 1.2 """ - return nacl.bindings.crypto_pwhash_str_verify(password_hash, - password) + return nacl.bindings.crypto_pwhash_str_verify(password_hash, password) diff -Nru python-nacl-1.4.0/src/nacl/pwhash/__init__.py python-nacl-1.5.0/src/nacl/pwhash/__init__.py --- python-nacl-1.4.0/src/nacl/pwhash/__init__.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/pwhash/__init__.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import from nacl.exceptions import CryptPrefixError @@ -55,7 +54,7 @@ verify_scryptsalsa208sha256 = scrypt.verify -def verify(password_hash, password): +def verify(password_hash: bytes, password: bytes) -> bool: """ Takes a modular crypt encoded stored password hash derived using one of the algorithms supported by `libsodium` and checks if the user provided @@ -69,7 +68,8 @@ elif scrypt.AVAILABLE and password_hash.startswith(scrypt.STRPREFIX): return scrypt.verify(password_hash, password) else: - raise(CryptPrefixError("given password_hash is not " - "in a supported format" - ) - ) + raise ( + CryptPrefixError( + "given password_hash is not in a supported format" + ) + ) diff -Nru python-nacl-1.4.0/src/nacl/pwhash/scrypt.py python-nacl-1.5.0/src/nacl/pwhash/scrypt.py --- python-nacl-1.4.0/src/nacl/pwhash/scrypt.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/pwhash/scrypt.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import -from __future__ import division +from typing import cast import nacl.bindings import nacl.encoding @@ -40,23 +39,31 @@ OPSLIMIT_MIN = nacl.bindings.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MIN OPSLIMIT_MAX = nacl.bindings.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_MAX -OPSLIMIT_INTERACTIVE = \ +OPSLIMIT_INTERACTIVE = ( nacl.bindings.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_INTERACTIVE -MEMLIMIT_INTERACTIVE = \ +) +MEMLIMIT_INTERACTIVE = ( nacl.bindings.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_INTERACTIVE -OPSLIMIT_SENSITIVE = \ +) +OPSLIMIT_SENSITIVE = ( nacl.bindings.crypto_pwhash_scryptsalsa208sha256_OPSLIMIT_SENSITIVE -MEMLIMIT_SENSITIVE = \ +) +MEMLIMIT_SENSITIVE = ( nacl.bindings.crypto_pwhash_scryptsalsa208sha256_MEMLIMIT_SENSITIVE +) OPSLIMIT_MODERATE = 8 * OPSLIMIT_INTERACTIVE MEMLIMIT_MODERATE = 8 * MEMLIMIT_INTERACTIVE -def kdf(size, password, salt, - opslimit=OPSLIMIT_SENSITIVE, - memlimit=MEMLIMIT_SENSITIVE, - encoder=nacl.encoding.RawEncoder): +def kdf( + size: int, + password: bytes, + salt: bytes, + opslimit: int = OPSLIMIT_SENSITIVE, + memlimit: int = MEMLIMIT_SENSITIVE, + encoder: nacl.encoding.Encoder = nacl.encoding.RawEncoder, +) -> bytes: """ Derive a ``size`` bytes long key from a caller-supplied ``password`` and ``salt`` pair using the scryptsalsa208sha256 @@ -106,32 +113,45 @@ .. versionadded:: 1.2 """ - ensure(AVAILABLE, - 'Not available in minimal build', - raising=exc.UnavailableError) + ensure( + AVAILABLE, + "Not available in minimal build", + raising=exc.UnavailableError, + ) ensure( len(salt) == SALTBYTES, - "The salt must be exactly %s, not %s bytes long" % ( - SALTBYTES, - len(salt) - ), - raising=exc.ValueError + "The salt must be exactly %s, not %s bytes long" + % (SALTBYTES, len(salt)), + raising=exc.ValueError, ) - n_log2, r, p = nacl.bindings.nacl_bindings_pick_scrypt_params(opslimit, - memlimit) + n_log2, r, p = nacl.bindings.nacl_bindings_pick_scrypt_params( + opslimit, memlimit + ) maxmem = memlimit + (2 ** 16) return encoder.encode( nacl.bindings.crypto_pwhash_scryptsalsa208sha256_ll( - password, salt, 2 ** n_log2, r, p, maxmem=maxmem, dklen=size) + password, + salt, + # Cast safety: n_log2 is a positive integer, and so 2 ** n_log2 is also + # a positive integer. Mypy+typeshed can't deduce this, because there's no + # way to for them to know that n_log2: int is positive. + cast(int, 2 ** n_log2), + r, + p, + maxmem=maxmem, + dklen=size, + ) ) -def str(password, - opslimit=OPSLIMIT_INTERACTIVE, - memlimit=MEMLIMIT_INTERACTIVE): +def str( + password: bytes, + opslimit: int = OPSLIMIT_INTERACTIVE, + memlimit: int = MEMLIMIT_INTERACTIVE, +) -> bytes: """ Hashes a password with a random salt, using the memory-hard scryptsalsa208sha256 construct and returning an ascii string @@ -149,16 +169,18 @@ .. versionadded:: 1.2 """ - ensure(AVAILABLE, - 'Not available in minimal build', - raising=exc.UnavailableError) + ensure( + AVAILABLE, + "Not available in minimal build", + raising=exc.UnavailableError, + ) - return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_str(password, - opslimit, - memlimit) + return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_str( + password, opslimit, memlimit + ) -def verify(password_hash, password): +def verify(password_hash: bytes, password: bytes) -> bool: """ Takes the output of scryptsalsa208sha256 and compares it against a user provided password to see if they are the same @@ -171,14 +193,18 @@ .. versionadded:: 1.2 """ - ensure(AVAILABLE, - 'Not available in minimal build', - raising=exc.UnavailableError) - - ensure(len(password_hash) == PWHASH_SIZE, - "The password hash must be exactly %s bytes long" % - nacl.bindings.crypto_pwhash_scryptsalsa208sha256_STRBYTES, - raising=exc.ValueError) + ensure( + AVAILABLE, + "Not available in minimal build", + raising=exc.UnavailableError, + ) + + ensure( + len(password_hash) == PWHASH_SIZE, + "The password hash must be exactly %s bytes long" + % nacl.bindings.crypto_pwhash_scryptsalsa208sha256_STRBYTES, + raising=exc.ValueError, + ) return nacl.bindings.crypto_pwhash_scryptsalsa208sha256_str_verify( password_hash, password diff -Nru python-nacl-1.4.0/src/nacl/secret.py python-nacl-1.5.0/src/nacl/secret.py --- python-nacl-1.4.0/src/nacl/secret.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/secret.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import ClassVar, Optional import nacl.bindings from nacl import encoding @@ -20,7 +19,7 @@ from nacl.utils import EncryptedMessage, StringFixer, random -class SecretBox(encoding.Encodable, StringFixer, object): +class SecretBox(encoding.Encodable, StringFixer): """ The SecretBox class encrypts and decrypts messages using the given secret key. @@ -33,6 +32,12 @@ send are repudiable. For non-repudiable messages, sign them after encryption. + Encryption is done using `XSalsa20-Poly1305`_, and there are no practical + limits on the number or size of messages (up to 2⁶⁴ messages, each up to 2⁶⁴ + bytes). + + .. _XSalsa20-Poly1305: https://doc.libsodium.org/secret-key_cryptography/secretbox#algorithm-details + :param key: The secret key used to encrypt and decrypt messages :param encoder: The encoder class used to decode the given key @@ -44,28 +49,36 @@ pair. """ - KEY_SIZE = nacl.bindings.crypto_secretbox_KEYBYTES - NONCE_SIZE = nacl.bindings.crypto_secretbox_NONCEBYTES - MACBYTES = nacl.bindings.crypto_secretbox_MACBYTES - MESSAGEBYTES_MAX = nacl.bindings.crypto_secretbox_MESSAGEBYTES_MAX - - def __init__(self, key, encoder=encoding.RawEncoder): + KEY_SIZE: ClassVar[int] = nacl.bindings.crypto_secretbox_KEYBYTES + NONCE_SIZE: ClassVar[int] = nacl.bindings.crypto_secretbox_NONCEBYTES + MACBYTES: ClassVar[int] = nacl.bindings.crypto_secretbox_MACBYTES + MESSAGEBYTES_MAX: ClassVar[ + int + ] = nacl.bindings.crypto_secretbox_MESSAGEBYTES_MAX + + def __init__( + self, key: bytes, encoder: encoding.Encoder = encoding.RawEncoder + ): key = encoder.decode(key) if not isinstance(key, bytes): raise exc.TypeError("SecretBox must be created from 32 bytes") if len(key) != self.KEY_SIZE: raise exc.ValueError( - "The key must be exactly %s bytes long" % - self.KEY_SIZE, + "The key must be exactly %s bytes long" % self.KEY_SIZE, ) self._key = key - def __bytes__(self): + def __bytes__(self) -> bytes: return self._key - def encrypt(self, plaintext, nonce=None, encoder=encoding.RawEncoder): + def encrypt( + self, + plaintext: bytes, + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> EncryptedMessage: """ Encrypts the plaintext message using the given `nonce` (or generates one randomly if omitted) and returns the ciphertext encoded with the @@ -90,8 +103,160 @@ "The nonce must be exactly %s bytes long" % self.NONCE_SIZE, ) - ciphertext = nacl.bindings.crypto_secretbox(plaintext, - nonce, self._key) + ciphertext = nacl.bindings.crypto_secretbox( + plaintext, nonce, self._key + ) + + encoded_nonce = encoder.encode(nonce) + encoded_ciphertext = encoder.encode(ciphertext) + + return EncryptedMessage._from_parts( + encoded_nonce, + encoded_ciphertext, + encoder.encode(nonce + ciphertext), + ) + + def decrypt( + self, + ciphertext: bytes, + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: + """ + Decrypts the ciphertext using the `nonce` (explicitly, when passed as a + parameter or implicitly, when omitted, as part of the ciphertext) and + returns the plaintext message. + + :param ciphertext: [:class:`bytes`] The encrypted message to decrypt + :param nonce: [:class:`bytes`] The nonce used when encrypting the + ciphertext + :param encoder: The encoder used to decode the ciphertext. + :rtype: [:class:`bytes`] + """ + # Decode our ciphertext + ciphertext = encoder.decode(ciphertext) + + if nonce is None: + # If we were given the nonce and ciphertext combined, split them. + nonce = ciphertext[: self.NONCE_SIZE] + ciphertext = ciphertext[self.NONCE_SIZE :] + + if len(nonce) != self.NONCE_SIZE: + raise exc.ValueError( + "The nonce must be exactly %s bytes long" % self.NONCE_SIZE, + ) + + plaintext = nacl.bindings.crypto_secretbox_open( + ciphertext, nonce, self._key + ) + + return plaintext + + +class Aead(encoding.Encodable, StringFixer): + """ + The AEAD class encrypts and decrypts messages using the given secret key. + + Unlike :class:`~nacl.secret.SecretBox`, AEAD supports authenticating + non-confidential data received alongside the message, such as a length + or type tag. + + Like :class:`~nacl.secret.Secretbox`, this class provides authenticated + encryption. An inauthentic message will cause the decrypt function to raise + an exception. + + Likewise, the authenticator should not be mistaken for a (public-key) + signature: recipients (with the ability to decrypt messages) are capable of + creating arbitrary valid message; in particular, this means AEAD messages + are repudiable. For non-repudiable messages, sign them after encryption. + + The cryptosystem used is `XChacha20-Poly1305`_ as specified for + `standardization`_. There are `no practical limits`_ to how much can safely + be encrypted under a given key (up to 2⁶⁴ messages each containing up + to 2⁶⁴ bytes). + + .. _standardization: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-xchacha + .. _XChacha20-Poly1305: https://doc.libsodium.org/secret-key_cryptography/aead#xchacha-20-poly1305 + .. _no practical limits: https://doc.libsodium.org/secret-key_cryptography/aead#limitations + + :param key: The secret key used to encrypt and decrypt messages + :param encoder: The encoder class used to decode the given key + + :cvar KEY_SIZE: The size that the key is required to be. + :cvar NONCE_SIZE: The size that the nonce is required to be. + :cvar MACBYTES: The size of the authentication MAC tag in bytes. + :cvar MESSAGEBYTES_MAX: The maximum size of a message which can be + safely encrypted with a single key/nonce + pair. + """ + + KEY_SIZE = nacl.bindings.crypto_aead_xchacha20poly1305_ietf_KEYBYTES + NONCE_SIZE = nacl.bindings.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES + MACBYTES = nacl.bindings.crypto_aead_xchacha20poly1305_ietf_ABYTES + MESSAGEBYTES_MAX = ( + nacl.bindings.crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX + ) + + def __init__( + self, + key: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ): + key = encoder.decode(key) + if not isinstance(key, bytes): + raise exc.TypeError("AEAD must be created from 32 bytes") + + if len(key) != self.KEY_SIZE: + raise exc.ValueError( + "The key must be exactly %s bytes long" % self.KEY_SIZE, + ) + + self._key = key + + def __bytes__(self) -> bytes: + return self._key + + def encrypt( + self, + plaintext: bytes, + aad: bytes = b"", + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> EncryptedMessage: + """ + Encrypts the plaintext message using the given `nonce` (or generates + one randomly if omitted) and returns the ciphertext encoded with the + encoder. + + .. warning:: It is vitally important for :param nonce: to be unique. + By default, it is generated randomly; [:class:`Aead`] uses XChacha20 + for extended (192b) nonce size, so the risk of reusing random nonces + is negligible. It is *strongly recommended* to keep this behaviour, + as nonce reuse will compromise the privacy of encrypted messages. + Should implicit nonces be inadequate for your application, the + second best option is using split counters; e.g. if sending messages + encrypted under a shared key between 2 users, each user can use the + number of messages it sent so far, prefixed or suffixed with a 1bit + user id. Note that the counter must **never** be rolled back (due + to overflow, on-disk state being rolled back to an earlier backup, + ...) + + :param plaintext: [:class:`bytes`] The plaintext message to encrypt + :param nonce: [:class:`bytes`] The nonce to use in the encryption + :param encoder: The encoder to use to encode the ciphertext + :rtype: [:class:`nacl.utils.EncryptedMessage`] + """ + if nonce is None: + nonce = random(self.NONCE_SIZE) + + if len(nonce) != self.NONCE_SIZE: + raise exc.ValueError( + "The nonce must be exactly %s bytes long" % self.NONCE_SIZE, + ) + + ciphertext = nacl.bindings.crypto_aead_xchacha20poly1305_ietf_encrypt( + plaintext, aad, nonce, self._key + ) encoded_nonce = encoder.encode(nonce) encoded_ciphertext = encoder.encode(ciphertext) @@ -102,7 +267,13 @@ encoder.encode(nonce + ciphertext), ) - def decrypt(self, ciphertext, nonce=None, encoder=encoding.RawEncoder): + def decrypt( + self, + ciphertext: bytes, + aad: bytes = b"", + nonce: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: """ Decrypts the ciphertext using the `nonce` (explicitly, when passed as a parameter or implicitly, when omitted, as part of the ciphertext) and @@ -119,15 +290,16 @@ if nonce is None: # If we were given the nonce and ciphertext combined, split them. - nonce = ciphertext[:self.NONCE_SIZE] - ciphertext = ciphertext[self.NONCE_SIZE:] + nonce = ciphertext[: self.NONCE_SIZE] + ciphertext = ciphertext[self.NONCE_SIZE :] if len(nonce) != self.NONCE_SIZE: raise exc.ValueError( "The nonce must be exactly %s bytes long" % self.NONCE_SIZE, ) - plaintext = nacl.bindings.crypto_secretbox_open(ciphertext, - nonce, self._key) + plaintext = nacl.bindings.crypto_aead_xchacha20poly1305_ietf_decrypt( + ciphertext, aad, nonce, self._key + ) return plaintext diff -Nru python-nacl-1.4.0/src/nacl/signing.py python-nacl-1.5.0/src/nacl/signing.py --- python-nacl-1.4.0/src/nacl/signing.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/signing.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,14 +11,15 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function +from typing import Optional import nacl.bindings from nacl import encoding from nacl import exceptions as exc -from nacl.public import (PrivateKey as _Curve25519_PrivateKey, - PublicKey as _Curve25519_PublicKey) +from nacl.public import ( + PrivateKey as _Curve25519_PrivateKey, + PublicKey as _Curve25519_PublicKey, +) from nacl.utils import StringFixer, random @@ -28,29 +29,34 @@ :class:`SigningKey`. """ + _signature: bytes + _message: bytes + @classmethod - def _from_parts(cls, signature, message, combined): + def _from_parts( + cls, signature: bytes, message: bytes, combined: bytes + ) -> "SignedMessage": obj = cls(combined) obj._signature = signature obj._message = message return obj @property - def signature(self): + def signature(self) -> bytes: """ The signature contained within the :class:`SignedMessage`. """ return self._signature @property - def message(self): + def message(self) -> bytes: """ The message contained within the :class:`SignedMessage`. """ return self._message -class VerifyKey(encoding.Encodable, StringFixer, object): +class VerifyKey(encoding.Encodable, StringFixer): """ The public key counterpart to an Ed25519 SigningKey for producing digital signatures. @@ -59,7 +65,9 @@ :param encoder: A class that is able to decode the `key` """ - def __init__(self, key, encoder=encoding.RawEncoder): + def __init__( + self, key: bytes, encoder: encoding.Encoder = encoding.RawEncoder + ): # Decode the key key = encoder.decode(key) if not isinstance(key, bytes): @@ -67,27 +75,32 @@ if len(key) != nacl.bindings.crypto_sign_PUBLICKEYBYTES: raise exc.ValueError( - "The key must be exactly %s bytes long" % - nacl.bindings.crypto_sign_PUBLICKEYBYTES, + "The key must be exactly %s bytes long" + % nacl.bindings.crypto_sign_PUBLICKEYBYTES, ) self._key = key - def __bytes__(self): + def __bytes__(self) -> bytes: return self._key - def __hash__(self): + def __hash__(self) -> int: return hash(bytes(self)) - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if not isinstance(other, self.__class__): return False return nacl.bindings.sodium_memcmp(bytes(self), bytes(other)) - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not (self == other) - def verify(self, smessage, signature=None, encoder=encoding.RawEncoder): + def verify( + self, + smessage: bytes, + signature: Optional[bytes] = None, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> bytes: """ Verifies the signature of a signed message, returning the message if it has not been tampered with else raising @@ -102,8 +115,20 @@ :rtype: :class:`bytes` """ if signature is not None: - # If we were given the message and signature separately, combine - # them. + # If we were given the message and signature separately, validate + # signature size and combine them. + if not isinstance(signature, bytes): + raise exc.TypeError( + "Verification signature must be created from %d bytes" + % nacl.bindings.crypto_sign_BYTES, + ) + + if len(signature) != nacl.bindings.crypto_sign_BYTES: + raise exc.ValueError( + "The signature must be exactly %d bytes long" + % nacl.bindings.crypto_sign_BYTES, + ) + smessage = signature + encoder.decode(smessage) else: # Decode the signed message @@ -111,7 +136,7 @@ return nacl.bindings.crypto_sign_open(smessage, self._key) - def to_curve25519_public_key(self): + def to_curve25519_public_key(self) -> _Curve25519_PublicKey: """ Converts a :class:`~nacl.signing.VerifyKey` to a :class:`~nacl.public.PublicKey` @@ -122,7 +147,7 @@ return _Curve25519_PublicKey(raw_pk) -class SigningKey(encoding.Encodable, StringFixer, object): +class SigningKey(encoding.Encodable, StringFixer): """ Private key for producing digital signatures using the Ed25519 algorithm. @@ -141,18 +166,23 @@ (i.e. public) key that corresponds with this signing key. """ - def __init__(self, seed, encoder=encoding.RawEncoder): + def __init__( + self, + seed: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ): # Decode the seed seed = encoder.decode(seed) if not isinstance(seed, bytes): raise exc.TypeError( - "SigningKey must be created from a 32 byte seed") + "SigningKey must be created from a 32 byte seed" + ) # Verify that our seed is the proper size if len(seed) != nacl.bindings.crypto_sign_SEEDBYTES: raise exc.ValueError( - "The seed must be exactly %d bytes long" % - nacl.bindings.crypto_sign_SEEDBYTES + "The seed must be exactly %d bytes long" + % nacl.bindings.crypto_sign_SEEDBYTES ) public_key, secret_key = nacl.bindings.crypto_sign_seed_keypair(seed) @@ -161,22 +191,22 @@ self._signing_key = secret_key self.verify_key = VerifyKey(public_key) - def __bytes__(self): + def __bytes__(self) -> bytes: return self._seed - def __hash__(self): + def __hash__(self) -> int: return hash(bytes(self)) - def __eq__(self, other): + def __eq__(self, other: object) -> bool: if not isinstance(other, self.__class__): return False return nacl.bindings.sodium_memcmp(bytes(self), bytes(other)) - def __ne__(self, other): + def __ne__(self, other: object) -> bool: return not (self == other) @classmethod - def generate(cls): + def generate(cls) -> "SigningKey": """ Generates a random :class:`~nacl.signing.SigningKey` object. @@ -187,7 +217,11 @@ encoder=encoding.RawEncoder, ) - def sign(self, message, encoder=encoding.RawEncoder): + def sign( + self, + message: bytes, + encoder: encoding.Encoder = encoding.RawEncoder, + ) -> SignedMessage: """ Sign a message using this key. @@ -204,7 +238,7 @@ return SignedMessage._from_parts(signature, message, signed) - def to_curve25519_private_key(self): + def to_curve25519_private_key(self) -> _Curve25519_PrivateKey: """ Converts a :class:`~nacl.signing.SigningKey` to a :class:`~nacl.public.PrivateKey` diff -Nru python-nacl-1.4.0/src/nacl/utils.py python-nacl-1.5.0/src/nacl/utils.py --- python-nacl-1.4.0/src/nacl/utils.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/src/nacl/utils.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import os - -import six +from typing import SupportsBytes, Type, TypeVar import nacl.bindings from nacl import encoding +_EncryptedMessage = TypeVar("_EncryptedMessage", bound="EncryptedMessage") + class EncryptedMessage(bytes): """ @@ -28,49 +28,52 @@ :class:`SecretBox`. """ + _nonce: bytes + _ciphertext: bytes + @classmethod - def _from_parts(cls, nonce, ciphertext, combined): + def _from_parts( + cls: Type[_EncryptedMessage], + nonce: bytes, + ciphertext: bytes, + combined: bytes, + ) -> _EncryptedMessage: obj = cls(combined) obj._nonce = nonce obj._ciphertext = ciphertext return obj @property - def nonce(self): + def nonce(self) -> bytes: """ The nonce used during the encryption of the :class:`EncryptedMessage`. """ return self._nonce @property - def ciphertext(self): + def ciphertext(self) -> bytes: """ The ciphertext contained within the :class:`EncryptedMessage`. """ return self._ciphertext -class StringFixer(object): - - def __str__(self): - if six.PY3: - return str(self.__bytes__()) - else: - return self.__bytes__() +class StringFixer: + def __str__(self: SupportsBytes) -> str: + return str(self.__bytes__()) -def bytes_as_string(bytes_in): - if six.PY3: - return bytes_in.decode('ascii') - else: - return bytes_in +def bytes_as_string(bytes_in: bytes) -> str: + return bytes_in.decode("ascii") -def random(size=32): +def random(size: int = 32) -> bytes: return os.urandom(size) -def randombytes_deterministic(size, seed, encoder=encoding.RawEncoder): +def randombytes_deterministic( + size: int, seed: bytes, encoder: encoding.Encoder = encoding.RawEncoder +) -> bytes: """ Returns ``size`` number of deterministically generated pseudorandom bytes from a seed diff -Nru python-nacl-1.4.0/src/PyNaCl.egg-info/PKG-INFO python-nacl-1.5.0/src/PyNaCl.egg-info/PKG-INFO --- python-nacl-1.4.0/src/PyNaCl.egg-info/PKG-INFO 2020-05-25 19:39:18.000000000 +0000 +++ python-nacl-1.5.0/src/PyNaCl.egg-info/PKG-INFO 2022-01-07 21:55:15.000000000 +0000 @@ -1,219 +1,241 @@ Metadata-Version: 2.1 Name: PyNaCl -Version: 1.4.0 +Version: 1.5.0 Summary: Python binding to the Networking and Cryptography (NaCl) library Home-page: https://github.com/pyca/pynacl/ Author: The PyNaCl developers Author-email: cryptography-dev@python.org License: Apache License 2.0 -Description: =============================================== - PyNaCl: Python binding to the libsodium library - =============================================== - - .. image:: https://img.shields.io/pypi/v/pynacl.svg - :target: https://pypi.org/project/PyNaCl/ - :alt: Latest Version - - .. image:: https://travis-ci.org/pyca/pynacl.svg?branch=master - :target: https://travis-ci.org/pyca/pynacl - - .. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=master - :target: https://codecov.io/github/pyca/pynacl?branch=master - - .. image:: https://img.shields.io/pypi/pyversions/pynacl.svg - :target: https://pypi.org/project/PyNaCl/ - :alt: Compatible Python Versions - - PyNaCl is a Python binding to `libsodium`_, which is a fork of the - `Networking and Cryptography library`_. These libraries have a stated goal of - improving usability, security and speed. It supports Python 2.7 and 3.5+ as - well as PyPy 2.6+. - - .. _libsodium: https://github.com/jedisct1/libsodium - .. _Networking and Cryptography library: https://nacl.cr.yp.to/ - - Features - -------- - - * Digital signatures - * Secret-key encryption - * Public-key encryption - * Hashing and message authentication - * Password based key derivation and password hashing - - `Changelog`_ - ------------ - - .. _Changelog: https://pynacl.readthedocs.io/en/stable/changelog/ - - Installation - ============ - - Binary wheel install - -------------------- - - PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , - so all dependencies are included. Make sure you have an up-to-date pip - and run: - - .. code-block:: console - - $ pip install pynacl - - Linux source build - ------------------ - - PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled - with PyNaCl so to install you can run: - - .. code-block:: console - - $ pip install pynacl - - If you'd prefer to use the version of ``libsodium`` provided by your - distribution, you can disable the bundled copy during install by running: - - .. code-block:: console - - $ SODIUM_INSTALL=system pip install pynacl - - .. warning:: Usage of the legacy ``easy_install`` command provided by setuptools - is generally discouraged, and is completely unsupported in PyNaCl's case. - - .. _libsodium: https://github.com/jedisct1/libsodium - - .. [#many] `manylinux1 wheels `_ - are built on a baseline linux environment based on Centos 5.11 - and should work on most x86 and x86_64 glibc based linux environments. - - Changelog - ========= - - 1.4.0 (2020-05-25) - ------------------ - - * Update ``libsodium`` to 1.0.18. - * **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` - wheels. Continuing to produce them was a maintenance burden. - * Added support for Python 3.8, and removed support for Python 3.4. - * Add low level bindings for extracting the seed and the public key - from crypto_sign_ed25519 secret key - * Add low level bindings for deterministic random generation. - * Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) - * Fix checks on very slow builders (#481, #495) - * Add low-level bindings to ed25519 arithmetic functions - * Update low-level blake2b state implementation - * Fix wrong short-input behavior of SealedBox.decrypt() (#517) - * Raise CryptPrefixError exception instead of InvalidkeyError when trying - to check a password against a verifier stored in a unknown format (#519) - * Add support for minimal builds of libsodium. Trying to call functions - not available in a minimal build will raise an UnavailableError - exception. To compile a minimal build of the bundled libsodium, set - the SODIUM_INSTALL_MINIMAL environment variable to any non-empty - string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. - - 1.3.0 2018-09-26 - ---------------- - - * Added support for Python 3.7. - * Update ``libsodium`` to 1.0.16. - * Run and test all code examples in PyNaCl docs through sphinx's - doctest builder. - * Add low-level bindings for chacha20-poly1305 AEAD constructions. - * Add low-level bindings for the chacha20-poly1305 secretstream constructions. - * Add low-level bindings for ed25519ph pre-hashed signing construction. - * Add low-level bindings for constant-time increment and addition - on fixed-precision big integers represented as little-endian - byte sequences. - * Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. - * Add low-level bindings for libsodium's crypto_kx... key exchange - construction. - * Set hypothesis deadline to None in tests/test_pwhash.py to avoid - incorrect test failures on slower processor architectures. GitHub - issue #370 - - 1.2.1 - 2017-12-04 - ------------------ - - * Update hypothesis minimum allowed version. - * Infrastructure: add proper configuration for readthedocs builder - runtime environment. - - 1.2.0 - 2017-11-01 - ------------------ - - * Update ``libsodium`` to 1.0.15. - * Infrastructure: add jenkins support for automatic build of - ``manylinux1`` binary wheels - * Added support for ``SealedBox`` construction. - * Added support for ``argon2i`` and ``argon2id`` password hashing constructs - and restructured high-level password hashing implementation to expose - the same interface for all hashers. - * Added support for 128 bit ``siphashx24`` variant of ``siphash24``. - * Added support for ``from_seed`` APIs for X25519 keypair generation. - * Dropped support for Python 3.3. - - 1.1.2 - 2017-03-31 - ------------------ - - * reorder link time library search path when using bundled - libsodium - - 1.1.1 - 2017-03-15 - ------------------ - - * Fixed a circular import bug in ``nacl.utils``. - - 1.1.0 - 2017-03-14 - ------------------ - - * Dropped support for Python 2.6. - * Added ``shared_key()`` method on ``Box``. - * You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or - ``SecretBox`` and it will automatically generate a random nonce. - * Added support for ``siphash24``. - * Added support for ``blake2b``. - * Added support for ``scrypt``. - * Update ``libsodium`` to 1.0.11. - * Default to the bundled ``libsodium`` when compiling. - * All raised exceptions are defined mixing-in - ``nacl.exceptions.CryptoError`` - - 1.0.1 - 2016-01-24 - ------------------ - - * Fix an issue with absolute paths that prevented the creation of wheels. - - 1.0 - 2016-01-23 - ---------------- - - * PyNaCl has been ported to use the new APIs available in cffi 1.0+. - Due to this change we no longer support PyPy releases older than 2.6. - * Python 3.2 support has been dropped. - * Functions to convert between Ed25519 and Curve25519 keys have been added. - - 0.3.0 - 2015-03-04 - ------------------ - - * The low-level API (`nacl.c.*`) has been changed to match the - upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). - The order of arguments and return values has changed significantly. To - avoid silent failures, `nacl.c` has been removed, and replaced with - `nacl.bindings` (with the new argument ordering). If you have code which - calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review - the new docstrings and update your code/imports to match the new - conventions. - Platform: UNKNOWN Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Requires-Python: >=3.6 Provides-Extra: tests Provides-Extra: docs +License-File: LICENSE + +=============================================== +PyNaCl: Python binding to the libsodium library +=============================================== + +.. image:: https://img.shields.io/pypi/v/pynacl.svg + :target: https://pypi.org/project/PyNaCl/ + :alt: Latest Version + +.. image:: https://codecov.io/github/pyca/pynacl/coverage.svg?branch=main + :target: https://codecov.io/github/pyca/pynacl?branch=main + +.. image:: https://img.shields.io/pypi/pyversions/pynacl.svg + :target: https://pypi.org/project/PyNaCl/ + :alt: Compatible Python Versions + +PyNaCl is a Python binding to `libsodium`_, which is a fork of the +`Networking and Cryptography library`_. These libraries have a stated goal of +improving usability, security and speed. It supports Python 3.6+ as well as +PyPy 3. + +.. _libsodium: https://github.com/jedisct1/libsodium +.. _Networking and Cryptography library: https://nacl.cr.yp.to/ + +Features +-------- + +* Digital signatures +* Secret-key encryption +* Public-key encryption +* Hashing and message authentication +* Password based key derivation and password hashing + +`Changelog`_ +------------ + +.. _Changelog: https://pynacl.readthedocs.io/en/stable/changelog/ + +Installation +============ + +Binary wheel install +-------------------- + +PyNaCl ships as a binary wheel on macOS, Windows and Linux ``manylinux1`` [#many]_ , +so all dependencies are included. Make sure you have an up-to-date pip +and run: + +.. code-block:: console + + $ pip install pynacl + +Faster wheel build +------------------ + +You can define the environment variable ``LIBSODIUM_MAKE_ARGS`` to pass arguments to ``make`` +and enable `parallelization`_: + +.. code-block:: console + + $ LIBSODIUM_MAKE_ARGS=-j4 pip install pynacl + +Linux source build +------------------ + +PyNaCl relies on `libsodium`_, a portable C library. A copy is bundled +with PyNaCl so to install you can run: + +.. code-block:: console + + $ pip install pynacl + +If you'd prefer to use the version of ``libsodium`` provided by your +distribution, you can disable the bundled copy during install by running: + +.. code-block:: console + + $ SODIUM_INSTALL=system pip install pynacl + +.. warning:: Usage of the legacy ``easy_install`` command provided by setuptools + is generally discouraged, and is completely unsupported in PyNaCl's case. + +.. _parallelization: https://www.gnu.org/software/make/manual/html_node/Parallel.html + +.. _libsodium: https://github.com/jedisct1/libsodium + +.. [#many] `manylinux1 wheels `_ + are built on a baseline linux environment based on Centos 5.11 + and should work on most x86 and x86_64 glibc based linux environments. + +Changelog +========= + +1.5.0 (2022-01-07) +------------------ + +* **BACKWARDS INCOMPATIBLE:** Removed support for Python 2.7 and Python 3.5. +* **BACKWARDS INCOMPATIBLE:** We no longer distribute ``manylinux1`` + wheels. +* Added ``manylinux2014``, ``manylinux_2_24``, ``musllinux``, and macOS + ``universal2`` wheels (the latter supports macOS ``arm64``). +* Update ``libsodium`` to 1.0.18-stable (July 25, 2021 release). +* Add inline type hints. + +1.4.0 (2020-05-25) +------------------ + +* Update ``libsodium`` to 1.0.18. +* **BACKWARDS INCOMPATIBLE:** We no longer distribute 32-bit ``manylinux1`` + wheels. Continuing to produce them was a maintenance burden. +* Added support for Python 3.8, and removed support for Python 3.4. +* Add low level bindings for extracting the seed and the public key + from crypto_sign_ed25519 secret key +* Add low level bindings for deterministic random generation. +* Add ``wheel`` and ``setuptools`` setup_requirements in ``setup.py`` (#485) +* Fix checks on very slow builders (#481, #495) +* Add low-level bindings to ed25519 arithmetic functions +* Update low-level blake2b state implementation +* Fix wrong short-input behavior of SealedBox.decrypt() (#517) +* Raise CryptPrefixError exception instead of InvalidkeyError when trying + to check a password against a verifier stored in a unknown format (#519) +* Add support for minimal builds of libsodium. Trying to call functions + not available in a minimal build will raise an UnavailableError + exception. To compile a minimal build of the bundled libsodium, set + the SODIUM_INSTALL_MINIMAL environment variable to any non-empty + string (e.g. ``SODIUM_INSTALL_MINIMAL=1``) for setup. + +1.3.0 2018-09-26 +---------------- + +* Added support for Python 3.7. +* Update ``libsodium`` to 1.0.16. +* Run and test all code examples in PyNaCl docs through sphinx's + doctest builder. +* Add low-level bindings for chacha20-poly1305 AEAD constructions. +* Add low-level bindings for the chacha20-poly1305 secretstream constructions. +* Add low-level bindings for ed25519ph pre-hashed signing construction. +* Add low-level bindings for constant-time increment and addition + on fixed-precision big integers represented as little-endian + byte sequences. +* Add low-level bindings for the ISO/IEC 7816-4 compatible padding API. +* Add low-level bindings for libsodium's crypto_kx... key exchange + construction. +* Set hypothesis deadline to None in tests/test_pwhash.py to avoid + incorrect test failures on slower processor architectures. GitHub + issue #370 + +1.2.1 - 2017-12-04 +------------------ + +* Update hypothesis minimum allowed version. +* Infrastructure: add proper configuration for readthedocs builder + runtime environment. + +1.2.0 - 2017-11-01 +------------------ + +* Update ``libsodium`` to 1.0.15. +* Infrastructure: add jenkins support for automatic build of + ``manylinux1`` binary wheels +* Added support for ``SealedBox`` construction. +* Added support for ``argon2i`` and ``argon2id`` password hashing constructs + and restructured high-level password hashing implementation to expose + the same interface for all hashers. +* Added support for 128 bit ``siphashx24`` variant of ``siphash24``. +* Added support for ``from_seed`` APIs for X25519 keypair generation. +* Dropped support for Python 3.3. + +1.1.2 - 2017-03-31 +------------------ + +* reorder link time library search path when using bundled + libsodium + +1.1.1 - 2017-03-15 +------------------ + +* Fixed a circular import bug in ``nacl.utils``. + +1.1.0 - 2017-03-14 +------------------ + +* Dropped support for Python 2.6. +* Added ``shared_key()`` method on ``Box``. +* You can now pass ``None`` to ``nonce`` when encrypting with ``Box`` or + ``SecretBox`` and it will automatically generate a random nonce. +* Added support for ``siphash24``. +* Added support for ``blake2b``. +* Added support for ``scrypt``. +* Update ``libsodium`` to 1.0.11. +* Default to the bundled ``libsodium`` when compiling. +* All raised exceptions are defined mixing-in + ``nacl.exceptions.CryptoError`` + +1.0.1 - 2016-01-24 +------------------ + +* Fix an issue with absolute paths that prevented the creation of wheels. + +1.0 - 2016-01-23 +---------------- + +* PyNaCl has been ported to use the new APIs available in cffi 1.0+. + Due to this change we no longer support PyPy releases older than 2.6. +* Python 3.2 support has been dropped. +* Functions to convert between Ed25519 and Curve25519 keys have been added. + +0.3.0 - 2015-03-04 +------------------ + +* The low-level API (`nacl.c.*`) has been changed to match the + upstream NaCl C/C++ conventions (as well as those of other NaCl bindings). + The order of arguments and return values has changed significantly. To + avoid silent failures, `nacl.c` has been removed, and replaced with + `nacl.bindings` (with the new argument ordering). If you have code which + calls these functions (e.g. `nacl.c.crypto_box_keypair()`), you must review + the new docstrings and update your code/imports to match the new + conventions. + + diff -Nru python-nacl-1.4.0/src/PyNaCl.egg-info/requires.txt python-nacl-1.5.0/src/PyNaCl.egg-info/requires.txt --- python-nacl-1.4.0/src/PyNaCl.egg-info/requires.txt 2020-05-25 19:39:18.000000000 +0000 +++ python-nacl-1.5.0/src/PyNaCl.egg-info/requires.txt 2022-01-07 21:55:15.000000000 +0000 @@ -1,4 +1,3 @@ -six cffi>=1.4.1 [docs] diff -Nru python-nacl-1.4.0/src/PyNaCl.egg-info/SOURCES.txt python-nacl-1.5.0/src/PyNaCl.egg-info/SOURCES.txt --- python-nacl-1.4.0/src/PyNaCl.egg-info/SOURCES.txt 2020-05-25 19:39:19.000000000 +0000 +++ python-nacl-1.5.0/src/PyNaCl.egg-info/SOURCES.txt 2022-01-07 21:55:15.000000000 +0000 @@ -61,6 +61,7 @@ src/bindings/minimal/crypto_pwhash.h src/bindings/minimal/crypto_scalarmult.h src/bindings/minimal/crypto_shorthash.h +src/libsodium/.gitignore src/libsodium/AUTHORS src/libsodium/ChangeLog src/libsodium/LICENSE @@ -69,7 +70,9 @@ src/libsodium/README.markdown src/libsodium/THANKS src/libsodium/aclocal.m4 +src/libsodium/appveyor.yml src/libsodium/autogen.sh +src/libsodium/azure-pipelines.yml src/libsodium/build-aux src/libsodium/builds src/libsodium/compile @@ -79,17 +82,23 @@ src/libsodium/depcomp src/libsodium/dist-build src/libsodium/install-sh +src/libsodium/lgtm.yml src/libsodium/libsodium-uninstalled.pc.in src/libsodium/libsodium.pc.in src/libsodium/libsodium.sln src/libsodium/libsodium.vcxproj src/libsodium/libsodium.vcxproj.filters -src/libsodium/ltmain.sh +src/libsodium/logo.png src/libsodium/m4 src/libsodium/missing src/libsodium/msvc-scripts +src/libsodium/packaging +src/libsodium/regen-msvc src/libsodium/src src/libsodium/test +src/libsodium/.github/workflows/ci.yml +src/libsodium/.github/workflows/codeql-analysis.yml +src/libsodium/.github/workflows/dotnet-core.yml src/libsodium/build-aux/compile src/libsodium/build-aux/config.guess src/libsodium/build-aux/config.sub @@ -98,6 +107,7 @@ src/libsodium/build-aux/ltmain.sh src/libsodium/build-aux/missing src/libsodium/build-aux/test-driver +src/libsodium/builds/.gitignore src/libsodium/builds/Makefile.am src/libsodium/builds/Makefile.in src/libsodium/builds/msvc @@ -199,16 +209,22 @@ src/libsodium/dist-build/android-mips64.sh src/libsodium/dist-build/android-x86.sh src/libsodium/dist-build/android-x86_64.sh +src/libsodium/dist-build/apple-xcframework.sh +src/libsodium/dist-build/emscripten-symbols.def src/libsodium/dist-build/emscripten.sh +src/libsodium/dist-build/generate-emscripten-symbols.sh src/libsodium/dist-build/ios.sh src/libsodium/dist-build/msys2-win32.sh src/libsodium/dist-build/msys2-win64.sh +src/libsodium/dist-build/osx.sh src/libsodium/dist-build/wasm32-wasi.sh src/libsodium/dist-build/watchos.sh +src/libsodium/m4/ax_add_fortify_source.m4 src/libsodium/m4/ax_check_catchable_abrt.m4 src/libsodium/m4/ax_check_catchable_segv.m4 src/libsodium/m4/ax_check_compile_flag.m4 src/libsodium/m4/ax_check_define.m4 +src/libsodium/m4/ax_check_gnu_make.m4 src/libsodium/m4/ax_check_link_flag.m4 src/libsodium/m4/ax_pthread.m4 src/libsodium/m4/ax_tls.m4 @@ -224,6 +240,21 @@ src/libsodium/msvc-scripts/process.bat src/libsodium/msvc-scripts/rep.vbs src/libsodium/msvc-scripts/sodium.props +src/libsodium/packaging/dotnet-core +src/libsodium/packaging/nuget +src/libsodium/packaging/dotnet-core/libsodium.pkgproj +src/libsodium/packaging/dotnet-core/test.cs +src/libsodium/packaging/nuget/.gitignore +src/libsodium/packaging/nuget/package.bat +src/libsodium/packaging/nuget/package.config +src/libsodium/packaging/nuget/package.gsl +src/libsodium/regen-msvc/libsodium.vcxproj +src/libsodium/regen-msvc/libsodium.vcxproj.filters +src/libsodium/regen-msvc/libsodium.vcxproj.filters.tpl +src/libsodium/regen-msvc/libsodium.vcxproj.tpl +src/libsodium/regen-msvc/regen-msvc.py +src/libsodium/regen-msvc/tl_libsodium.vcxproj.filters.tpl +src/libsodium/regen-msvc/tl_libsodium.vcxproj.tpl src/libsodium/src/Makefile.am src/libsodium/src/Makefile.in src/libsodium/src/libsodium @@ -394,9 +425,6 @@ src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/fe_frombytes_sandy2x.c src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.S src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder.h -src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.S -src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base.h -src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_base_namespace.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/ladder_namespace.h src/libsodium/src/libsodium/crypto_scalarmult/curve25519/sandy2x/sandy2x.S src/libsodium/src/libsodium/crypto_scalarmult/ed25519/ref10 @@ -564,6 +592,7 @@ src/libsodium/src/libsodium/sodium/version.c src/libsodium/test/Makefile.am src/libsodium/test/Makefile.in +src/libsodium/test/constcheck.sh src/libsodium/test/default src/libsodium/test/quirks src/libsodium/test/default/Makefile.am @@ -637,9 +666,9 @@ src/libsodium/test/default/generichash3.exp src/libsodium/test/default/hash.c src/libsodium/test/default/hash.exp -src/libsodium/test/default/hash2.exp src/libsodium/test/default/hash3.c src/libsodium/test/default/hash3.exp +src/libsodium/test/default/index.html.tpl src/libsodium/test/default/kdf.c src/libsodium/test/default/kdf.exp src/libsodium/test/default/keygen.c @@ -734,6 +763,7 @@ src/nacl/hash.py src/nacl/hashlib.py src/nacl/public.py +src/nacl/py.typed src/nacl/secret.py src/nacl/signing.py src/nacl/utils.py @@ -758,6 +788,7 @@ src/nacl/pwhash/argon2i.py src/nacl/pwhash/argon2id.py src/nacl/pwhash/scrypt.py +tests/__init__.py tests/test_aead.py tests/test_bindings.py tests/test_box.py diff -Nru python-nacl-1.4.0/tests/test_aead.py python-nacl-1.5.0/tests/test_aead.py --- python-nacl-1.4.0/tests/test_aead.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_aead.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,52 +11,52 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - import binascii -import sys -from collections import namedtuple +from typing import Callable, Dict, List, NamedTuple, Optional from hypothesis import given, settings from hypothesis.strategies import binary, sampled_from import pytest -from utils import read_kv_test_vectors - import nacl.bindings as b import nacl.exceptions as exc +from .utils import read_kv_test_vectors + -def chacha20poly1305_agl_vectors(): +def chacha20poly1305_agl_vectors() -> List[Dict[str, bytes]]: # NIST vectors derived format DATA = "chacha20-poly1305-agl_ref.txt" - return read_kv_test_vectors(DATA, delimiter=b':', newrecord=b'AEAD') + return read_kv_test_vectors(DATA, delimiter=b":", newrecord=b"AEAD") -def chacha20poly1305_ietf_vectors(): +def chacha20poly1305_ietf_vectors() -> List[Dict[str, bytes]]: # NIST vectors derived format DATA = "chacha20-poly1305-ietf_ref.txt" - return read_kv_test_vectors(DATA, delimiter=b':', newrecord=b'AEAD') + return read_kv_test_vectors(DATA, delimiter=b":", newrecord=b"AEAD") -def xchacha20poly1305_ietf_vectors(): +def xchacha20poly1305_ietf_vectors() -> List[Dict[str, bytes]]: # NIST vectors derived format DATA = "xchacha20-poly1305-ietf_ref.txt" - return read_kv_test_vectors(DATA, delimiter=b':', newrecord=b'AEAD') + return read_kv_test_vectors(DATA, delimiter=b":", newrecord=b"AEAD") -Construction = namedtuple('Construction', 'encrypt, decrypt, NPUB, KEYBYTES') +class Construction(NamedTuple): + encrypt: Callable[[bytes, Optional[bytes], bytes, bytes], bytes] + decrypt: Callable[[bytes, Optional[bytes], bytes, bytes], bytes] + NPUB: int + KEYBYTES: int -def _getconstruction(construction): - if construction == b'chacha20-poly1305-old': +def _getconstruction(construction: bytes) -> Construction: + if construction == b"chacha20-poly1305-old": encrypt = b.crypto_aead_chacha20poly1305_encrypt decrypt = b.crypto_aead_chacha20poly1305_decrypt NPUB = b.crypto_aead_chacha20poly1305_NPUBBYTES KEYBYTES = b.crypto_aead_chacha20poly1305_KEYBYTES - elif construction == b'chacha20-poly1305': + elif construction == b"chacha20-poly1305": encrypt = b.crypto_aead_chacha20poly1305_ietf_encrypt decrypt = b.crypto_aead_chacha20poly1305_ietf_decrypt NPUB = b.crypto_aead_chacha20poly1305_ietf_NPUBBYTES @@ -70,42 +70,46 @@ return Construction(encrypt, decrypt, NPUB, KEYBYTES) -@pytest.mark.parametrize("kv", - chacha20poly1305_agl_vectors() + - chacha20poly1305_ietf_vectors() + - xchacha20poly1305_ietf_vectors() - ) -def test_chacha20poly1305_variants_kat(kv): - msg = binascii.unhexlify(kv['IN']) - ad = binascii.unhexlify(kv['AD']) - nonce = binascii.unhexlify(kv['NONCE']) - k = binascii.unhexlify(kv['KEY']) - c = _getconstruction(kv['AEAD']) - _tag = kv.get('TAG', b'') - exp = binascii.unhexlify(kv['CT']) + binascii.unhexlify(_tag) +@pytest.mark.parametrize( + "kv", + chacha20poly1305_agl_vectors() + + chacha20poly1305_ietf_vectors() + + xchacha20poly1305_ietf_vectors(), +) +def test_chacha20poly1305_variants_kat(kv: Dict[str, bytes]): + msg = binascii.unhexlify(kv["IN"]) + ad = binascii.unhexlify(kv["AD"]) + nonce = binascii.unhexlify(kv["NONCE"]) + k = binascii.unhexlify(kv["KEY"]) + c = _getconstruction(kv["AEAD"]) + _tag = kv.get("TAG", b"") + exp = binascii.unhexlify(kv["CT"]) + binascii.unhexlify(_tag) out = c.encrypt(msg, ad, nonce, k) - assert (out == exp) + assert out == exp -@given(sampled_from((b'chacha20-poly1305-old', - b'chacha20-poly1305', - b'xchacha20-poly1305' - )), - binary(min_size=0, max_size=100), - binary(min_size=0, max_size=50), - binary(min_size=b.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, - max_size=b.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES), - binary(min_size=b.crypto_aead_chacha20poly1305_KEYBYTES, - max_size=b.crypto_aead_chacha20poly1305_KEYBYTES)) +@given( + sampled_from( + (b"chacha20-poly1305-old", b"chacha20-poly1305", b"xchacha20-poly1305") + ), + binary(min_size=0, max_size=100), + binary(min_size=0, max_size=50), + binary( + min_size=b.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, + max_size=b.crypto_aead_xchacha20poly1305_ietf_NPUBBYTES, + ), + binary( + min_size=b.crypto_aead_chacha20poly1305_KEYBYTES, + max_size=b.crypto_aead_chacha20poly1305_KEYBYTES, + ), +) @settings(deadline=None, max_examples=20) -def test_chacha20poly1305_variants_roundtrip(construction, - message, - aad, - nonce, - key): +def test_chacha20poly1305_variants_roundtrip( + construction: bytes, message: bytes, aad: bytes, nonce: bytes, key: bytes +): c = _getconstruction(construction) - unonce = nonce[:c.NPUB] + unonce = nonce[: c.NPUB] ct = c.encrypt(message, aad, unonce, key) pt = c.decrypt(ct, aad, unonce, key) @@ -113,42 +117,43 @@ assert pt == message with pytest.raises(exc.CryptoError): ct1 = bytearray(ct) - ct1[0] = ct1[0] ^ 0xff + ct1[0] = ct1[0] ^ 0xFF c.decrypt(ct1, aad, unonce, key) -@pytest.mark.parametrize("construction", - [b'chacha20-poly1305-old', - b'chacha20-poly1305', - b'xchacha20-poly1305'] - ) -def test_chacha20poly1305_variants_wrong_params(construction): +@pytest.mark.parametrize( + "construction", + [b"chacha20-poly1305-old", b"chacha20-poly1305", b"xchacha20-poly1305"], +) +def test_chacha20poly1305_variants_wrong_params(construction: bytes): c = _getconstruction(construction) - nonce = b'\x00' * c.NPUB - key = b'\x00' * c.KEYBYTES + nonce = b"\x00" * c.NPUB + key = b"\x00" * c.KEYBYTES aad = None - c.encrypt(b'', aad, nonce, key) + c.encrypt(b"", aad, nonce, key) + # The first two checks call encrypt with a nonce/key that's too short. Otherwise, + # the types are fine. (TODO: Should this raise ValueError rather than TypeError? + # Doing so would be a breaking change.) with pytest.raises(exc.TypeError): - c.encrypt(b'', aad, nonce[:-1], key) + c.encrypt(b"", aad, nonce[:-1], key) with pytest.raises(exc.TypeError): - c.encrypt(b'', aad, nonce, key[:-1]) + c.encrypt(b"", aad, nonce, key[:-1]) + # Type safety: mypy spots these next two errors, but we want to check that they're + # spotted at runtime too. with pytest.raises(exc.TypeError): - c.encrypt(b'', aad, nonce.decode('utf-8'), key) + c.encrypt(b"", aad, nonce.decode("utf-8"), key) # type: ignore[arg-type] with pytest.raises(exc.TypeError): - c.encrypt(b'', aad, nonce, key.decode('utf-8')) + c.encrypt(b"", aad, nonce, key.decode("utf-8")) # type: ignore[arg-type] -@pytest.mark.skipif(sys.version_info < (3,), - reason="Python 2 doesn't distinguish str() from bytes()") -@pytest.mark.parametrize("construction", - [b'chacha20-poly1305-old', - b'chacha20-poly1305', - b'xchacha20-poly1305'] - ) -def test_chacha20poly1305_variants_str_msg(construction): +@pytest.mark.parametrize( + "construction", + [b"chacha20-poly1305-old", b"chacha20-poly1305", b"xchacha20-poly1305"], +) +def test_chacha20poly1305_variants_str_msg(construction: bytes): c = _getconstruction(construction) - nonce = b'\x00' * c.NPUB - key = b'\x00' * c.KEYBYTES + nonce = b"\x00" * c.NPUB + key = b"\x00" * c.KEYBYTES aad = None with pytest.raises(exc.TypeError): - c.encrypt('', aad, nonce, key) + c.encrypt("", aad, nonce, key) # type: ignore[arg-type] diff -Nru python-nacl-1.4.0/tests/test_bindings.py python-nacl-1.5.0/tests/test_bindings.py --- python-nacl-1.4.0/tests/test_bindings.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_bindings.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,25 +12,24 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import hashlib from binascii import hexlify, unhexlify +from typing import List, Tuple from hypothesis import given, settings from hypothesis.strategies import binary, integers import pytest -from test_signing import ed25519_known_answers - -from utils import flip_byte, read_crypto_test_vectors - from nacl import bindings as c from nacl.exceptions import BadSignatureError, CryptoError, UnavailableError +from .test_signing import ed25519_known_answers +from .utils import flip_byte, read_crypto_test_vectors -def tohex(b): + +def tohex(b: bytes) -> str: return hexlify(b).decode("ascii") @@ -38,10 +37,12 @@ msg = b"message" h1 = c.crypto_hash(msg) assert len(h1) == c.crypto_hash_BYTES - assert tohex(h1) == ("f8daf57a3347cc4d6b9d575b31fe6077" - "e2cb487f60a96233c08cb479dbf31538" - "cc915ec6d48bdbaa96ddc1a16db4f4f9" - "6f37276cfcb3510b8246241770d5952c") + assert tohex(h1) == ( + "f8daf57a3347cc4d6b9d575b31fe6077" + "e2cb487f60a96233c08cb479dbf31538" + "cc915ec6d48bdbaa96ddc1a16db4f4f9" + "6f37276cfcb3510b8246241770d5952c" + ) assert tohex(h1) == hashlib.sha512(msg).hexdigest() h2 = c.crypto_hash_sha512(msg) @@ -50,8 +51,9 @@ h3 = c.crypto_hash_sha256(msg) assert len(h3) == c.crypto_hash_sha256_BYTES - assert tohex(h3) == ("ab530a13e45914982b79f9b7e3fba994" - "cfd1f3fb22f71cea1afbf02b460c6d1d") + assert tohex(h3) == ( + "ab530a13e45914982b79f9b7e3fba994cfd1f3fb22f71cea1afbf02b460c6d1d" + ) assert tohex(h3) == hashlib.sha256(msg).hexdigest() @@ -82,7 +84,8 @@ c.crypto_secretbox_open(b"", b"", b"") with pytest.raises(ValueError): c.crypto_secretbox_open( - b"", b"", b"\x00" * c.crypto_secretbox_KEYBYTES) + b"", b"", b"\x00" * c.crypto_secretbox_KEYBYTES + ) def test_box(): @@ -111,27 +114,28 @@ assert m2 == message with pytest.raises(CryptoError): - c.crypto_box_open( - message + b"!", nonce, A_pubkey, A_secretkey) + c.crypto_box_open(message + b"!", nonce, A_pubkey, A_secretkey) def test_box_wrong_lengths(): A_pubkey, A_secretkey = c.crypto_box_keypair() with pytest.raises(ValueError): - c.crypto_box(b"abc", "\x00", A_pubkey, A_secretkey) + c.crypto_box(b"abc", b"\x00", A_pubkey, A_secretkey) with pytest.raises(ValueError): c.crypto_box( - b"abc", "\x00" * c.crypto_box_NONCEBYTES, b"", A_secretkey) + b"abc", b"\x00" * c.crypto_box_NONCEBYTES, b"", A_secretkey + ) with pytest.raises(ValueError): - c.crypto_box( - b"abc", "\x00" * c.crypto_box_NONCEBYTES, A_pubkey, b"") + c.crypto_box(b"abc", b"\x00" * c.crypto_box_NONCEBYTES, A_pubkey, b"") with pytest.raises(ValueError): c.crypto_box_open(b"", b"", b"", b"") with pytest.raises(ValueError): - c.crypto_box_open(b"", "\x00" * c.crypto_box_NONCEBYTES, b"", b"") + c.crypto_box_open(b"", b"\x00" * c.crypto_box_NONCEBYTES, b"", b"") with pytest.raises(ValueError): - c.crypto_box_open(b"", "\x00" * c.crypto_box_NONCEBYTES, A_pubkey, b"") + c.crypto_box_open( + b"", b"\x00" * c.crypto_box_NONCEBYTES, A_pubkey, b"" + ) with pytest.raises(ValueError): c.crypto_box_beforenm(b"", b"") @@ -172,7 +176,7 @@ c.crypto_sign_seed_keypair(b"") -def secret_scalar(): +def secret_scalar() -> Tuple[bytes, bytes]: pubkey, secretkey = c.crypto_box_keypair() assert len(secretkey) == c.crypto_box_SECRETKEYBYTES assert c.crypto_box_SECRETKEYBYTES == c.crypto_scalarmult_BYTES @@ -197,8 +201,9 @@ z = unhexlify(b"10" * 32) bz1 = c.crypto_scalarmult_base(z) - assert tohex(bz1) == ("781faab908430150daccdd6f9d6c5086" - "e34f73a93ebbaa271765e5036edfc519") + assert tohex(bz1) == ( + "781faab908430150daccdd6f9d6c5086e34f73a93ebbaa271765e5036edfc519" + ) bz2 = c.crypto_scalarmult(z, base) assert tohex(bz1) == tohex(bz2) @@ -207,8 +212,9 @@ """ Taken from test vectors in libsodium """ - keypair_seed = unhexlify(b"421151a459faeade3d247115f94aedae" - b"42318124095afabe4d1451a559faedee") + keypair_seed = unhexlify( + b"421151a459faeade3d247115f94aedae42318124095afabe4d1451a559faedee" + ) ed25519_pk, ed25519_sk = c.crypto_sign_seed_keypair(keypair_seed) assert c.crypto_sign_ed25519_sk_to_pk(ed25519_sk) == ed25519_pk @@ -228,19 +234,19 @@ curve25519_sk = c.crypto_sign_ed25519_sk_to_curve25519(ed25519_sk) - assert tohex(curve25519_pk) == ("f1814f0e8ff1043d8a44d25babff3ced" - "cae6c22c3edaa48f857ae70de2baae50") - assert tohex(curve25519_sk) == ("8052030376d47112be7f73ed7a019293" - "dd12ad910b654455798b4667d73de166") + assert tohex(curve25519_pk) == ( + "f1814f0e8ff1043d8a44d25babff3cedcae6c22c3edaa48f857ae70de2baae50" + ) + assert tohex(curve25519_sk) == ( + "8052030376d47112be7f73ed7a019293dd12ad910b654455798b4667d73de166" + ) def test_box_seal_empty(): A_pubkey, A_secretkey = c.crypto_box_keypair() empty = b"" msg = c.crypto_box_seal(empty, A_pubkey) - decoded = c.crypto_box_seal_open(msg, - A_pubkey, - A_secretkey) + decoded = c.crypto_box_seal_open(msg, A_pubkey, A_secretkey) assert decoded == empty @@ -251,9 +257,7 @@ amsg[-1] ^= 1 msg = bytes(amsg) with pytest.raises(CryptoError): - c.crypto_box_seal_open(msg, - A_pubkey, - A_secretkey) + c.crypto_box_seal_open(msg, A_pubkey, A_secretkey) def test_box_seal_wrong_lengths(): @@ -261,56 +265,47 @@ with pytest.raises(ValueError): c.crypto_box_seal(b"abc", A_pubkey[:-1]) with pytest.raises(ValueError): - c.crypto_box_seal_open(b"abc", - b"", - A_secretkey - ) - with pytest.raises(ValueError): - c.crypto_box_seal_open(b"abc", - A_pubkey, - A_secretkey[:-1] - ) + c.crypto_box_seal_open(b"abc", b"", A_secretkey) + with pytest.raises(ValueError): + c.crypto_box_seal_open(b"abc", A_pubkey, A_secretkey[:-1]) msg = c.crypto_box_seal(b"", A_pubkey) with pytest.raises(CryptoError): - c.crypto_box_seal_open(msg[:-1], - A_pubkey, - A_secretkey - ) + c.crypto_box_seal_open(msg[:-1], A_pubkey, A_secretkey) def test_box_seal_wrong_types(): A_pubkey, A_secretkey = c.crypto_box_keypair() + # type safety: mypy can spot these errors, but we want to spot them at runtime too. with pytest.raises(TypeError): - c.crypto_box_seal(b"abc", dict()) + c.crypto_box_seal(b"abc", dict()) # type: ignore[arg-type] with pytest.raises(TypeError): - c.crypto_box_seal_open( - b"abc", None, A_secretkey) + c.crypto_box_seal_open(b"abc", None, A_secretkey) # type: ignore[arg-type] with pytest.raises(TypeError): - c.crypto_box_seal_open( - b"abc", A_pubkey, None) + c.crypto_box_seal_open(b"abc", A_pubkey, None) # type: ignore[arg-type] with pytest.raises(TypeError): - c.crypto_box_seal_open( - None, A_pubkey, A_secretkey) + c.crypto_box_seal_open(None, A_pubkey, A_secretkey) # type: ignore[arg-type] -def _box_from_seed_vectors(): +def _box_from_seed_vectors() -> List[Tuple[bytes, bytes, bytes]]: # Fmt: || DATA = "box_from_seed.txt" - lines = read_crypto_test_vectors(DATA, maxels=2, delimiter=b'\t') - return [(x[0], # seed - x[1][:64], # derived public key - x[1][64:], # derived secret key - ) - for x in lines] + lines = read_crypto_test_vectors(DATA, maxels=2, delimiter=b"\t") + return [ + ( + x[0], # seed + x[1][:64], # derived public key + x[1][64:], # derived secret key + ) + for x in lines + ] @pytest.mark.parametrize( - ( - "seed", "public_key", "secret_key" - ), - _box_from_seed_vectors() + ("seed", "public_key", "secret_key"), _box_from_seed_vectors() ) -def test_box_seed_keypair_reference(seed, public_key, secret_key): +def test_box_seed_keypair_reference( + seed: bytes, public_key: bytes, secret_key: bytes +): seed = unhexlify(seed) pk, sk = c.crypto_box_seed_keypair(seed) assert pk == unhexlify(public_key) @@ -332,39 +327,33 @@ c.crypto_box_seed_keypair(seed) -@given(integers(min_value=-2, - max_value=0) - ) +@given(integers(min_value=-2, max_value=0)) def test_pad_wrong_blocksize(bl_sz): with pytest.raises(ValueError): - c.sodium_pad(b'x', bl_sz) + c.sodium_pad(b"x", bl_sz) def test_unpad_not_padded(): with pytest.raises(CryptoError): - c.sodium_unpad(b'x', 8) + c.sodium_unpad(b"x", 8) -@given(binary(min_size=0, - max_size=2049), - integers(min_value=16, - max_value=256) - ) +@given( + binary(min_size=0, max_size=2049), integers(min_value=16, max_value=256) +) @settings(max_examples=20) -def test_pad_sizes(msg, bl_sz): +def test_pad_sizes(msg: bytes, bl_sz: int): padded = c.sodium_pad(msg, bl_sz) assert len(padded) > len(msg) assert len(padded) >= bl_sz assert len(padded) % bl_sz == 0 -@given(binary(min_size=0, - max_size=2049), - integers(min_value=16, - max_value=256) - ) +@given( + binary(min_size=0, max_size=2049), integers(min_value=16, max_value=256) +) @settings(max_examples=20) -def test_pad_roundtrip(msg, bl_sz): +def test_pad_roundtrip(msg: bytes, bl_sz: int): padded = c.sodium_pad(msg, bl_sz) assert len(padded) > len(msg) assert len(padded) >= bl_sz @@ -375,10 +364,10 @@ def test_sodium_increment(): - maxint = 32 * b'\xff' - zero = 32 * b'\x00' - one = b'\x01' + 31 * b'\x00' - two = b'\x02' + 31 * b'\x00' + maxint = 32 * b"\xff" + zero = 32 * b"\x00" + one = b"\x01" + 31 * b"\x00" + two = b"\x02" + 31 * b"\x00" res = c.sodium_increment(maxint) assert res == zero @@ -391,13 +380,13 @@ def test_sodium_add(): - maxint = 32 * b'\xff' - zero = 32 * b'\x00' - one = b'\x01' + 31 * b'\x00' - short_one = b'\x01' + 15 * b'\x00' - two = b'\x02' + 31 * b'\x00' - three = b'\x03' + 31 * b'\x00' - four = b'\x04' + 31 * b'\x00' + maxint = 32 * b"\xff" + zero = 32 * b"\x00" + one = b"\x01" + 31 * b"\x00" + short_one = b"\x01" + 15 * b"\x00" + two = b"\x02" + 31 * b"\x00" + three = b"\x03" + 31 * b"\x00" + four = b"\x04" + 31 * b"\x00" res = c.sodium_add(one, two) assert res == three @@ -415,15 +404,19 @@ def test_sign_ed25519ph_rfc8032(): # sk, pk, msg, exp_sig # taken from RFC 8032 section 7.3. Test Vectors for Ed25519ph - sk = unhexlify(b'833fe62409237b9d62ec77587520911e' - b'9a759cec1d19755b7da901b96dca3d42') - pk = unhexlify(b'ec172b93ad5e563bf4932c70e1245034' - b'c35467ef2efd4d64ebf819683467e2bf') - msg = b'abc' - exp_sig = unhexlify(b'98a70222f0b8121aa9d30f813d683f80' - b'9e462b469c7ff87639499bb94e6dae41' - b'31f85042463c2a355a2003d062adf5aa' - b'a10b8c61e636062aaad11c2a26083406') + sk = unhexlify( + b"833fe62409237b9d62ec77587520911e9a759cec1d19755b7da901b96dca3d42" + ) + pk = unhexlify( + b"ec172b93ad5e563bf4932c70e1245034c35467ef2efd4d64ebf819683467e2bf" + ) + msg = b"abc" + exp_sig = unhexlify( + b"98a70222f0b8121aa9d30f813d683f80" + b"9e462b469c7ff87639499bb94e6dae41" + b"31f85042463c2a355a2003d062adf5aa" + b"a10b8c61e636062aaad11c2a26083406" + ) c_sk = sk + pk edph = c.crypto_sign_ed25519ph_state() @@ -449,15 +442,18 @@ msg = unhexlify(hmsg) - seed = unhexlify(b'421151a459faeade3d247115f94aedae' - b'42318124095afabe4d1451a559faedee') + seed = unhexlify( + b"421151a459faeade3d247115f94aedae42318124095afabe4d1451a559faedee" + ) pk, sk = c.crypto_sign_seed_keypair(seed) - exp_sig = unhexlify(b'10c5411e40bd10170fb890d4dfdb6d33' - b'8c8cb11d2764a216ee54df10977dcdef' - b'd8ff755b1eeb3f16fce80e40e7aafc99' - b'083dbff43d5031baf04157b48423960d') + exp_sig = unhexlify( + b"10c5411e40bd10170fb890d4dfdb6d33" + b"8c8cb11d2764a216ee54df10977dcdef" + b"d8ff755b1eeb3f16fce80e40e7aafc99" + b"083dbff43d5031baf04157b48423960d" + ) edph = c.crypto_sign_ed25519ph_state() c.crypto_sign_ed25519ph_update(edph, msg) @@ -466,9 +462,9 @@ assert sig == exp_sig edph_incr = c.crypto_sign_ed25519ph_state() - c.crypto_sign_ed25519ph_update(edph_incr, b'') - c.crypto_sign_ed25519ph_update(edph_incr, msg[0:len(msg) // 2]) - c.crypto_sign_ed25519ph_update(edph_incr, msg[len(msg) // 2:]) + c.crypto_sign_ed25519ph_update(edph_incr, b"") + c.crypto_sign_ed25519ph_update(edph_incr, msg[0 : len(msg) // 2]) + c.crypto_sign_ed25519ph_update(edph_incr, msg[len(msg) // 2 :]) assert c.crypto_sign_ed25519ph_final_verify(edph_incr, exp_sig, pk) is True @@ -483,20 +479,22 @@ c.crypto_sign_ed25519ph_final_verify(edph_wrng, exp_sig, pk) -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_is_valid_point(): """ Verify crypto_core_ed25519_is_valid_point correctly rejects the all-zeros "point" """ - zero = c.crypto_core_ed25519_BYTES * b'\x00' + zero = c.crypto_core_ed25519_BYTES * b"\x00" res = c.crypto_core_ed25519_is_valid_point(zero) assert res is False -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_add_and_sub(): # the public component of a ed25519 keypair # is a point on the ed25519 curve @@ -510,9 +508,10 @@ assert c.crypto_core_ed25519_sub(p3, p2) == p1 -@pytest.mark.skipif(not c.has_crypto_core_ed25519 or - not c.has_crypto_scalarmult_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519 or not c.has_crypto_scalarmult_ed25519, + reason="Requires full build of libsodium", +) def test_scalarmult_ed25519(): SCALARBYTES = c.crypto_scalarmult_ed25519_SCALARBYTES @@ -560,24 +559,54 @@ assert c.crypto_scalarmult_ed25519(MIN_P8, p) == _p8 -@pytest.mark.skipif(not c.has_crypto_scalarmult_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_scalarmult_ed25519, + reason="Requires full build of libsodium", +) def test_scalarmult_ed25519_base(): """ Verify scalarmult_ed25519_base is congruent to scalarmult_ed25519 on the ed25519 base point """ - BASEPOINT = bytes(bytearray([0x58, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66] - ) - ) + BASEPOINT = bytes( + bytearray( + [ + 0x58, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + ] + ) + ) sclr = c.randombytes(c.crypto_scalarmult_ed25519_SCALARBYTES) @@ -587,21 +616,51 @@ assert p2 == p -@pytest.mark.skipif(not c.has_crypto_scalarmult_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_scalarmult_ed25519, + reason="Requires full build of libsodium", +) def test_scalarmult_ed25519_noclamp(): # An arbitrary scalar which is known to differ once clamped - scalar = 32 * b'\x01' - BASEPOINT = bytes(bytearray([0x58, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66, - 0x66, 0x66, 0x66, 0x66] - ) - ) + scalar = 32 * b"\x01" + BASEPOINT = bytes( + bytearray( + [ + 0x58, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + 0x66, + ] + ) + ) p = c.crypto_scalarmult_ed25519_noclamp(scalar, BASEPOINT) pb = c.crypto_scalarmult_ed25519_base_noclamp(scalar) @@ -620,24 +679,53 @@ assert p1 == p2 -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_scalar_add_and_sub(): - zero = 32 * b'\x00' - one = b'\x01' + 31 * b'\x00' - two = b'\x02' + 31 * b'\x00' + zero = 32 * b"\x00" + one = b"\x01" + 31 * b"\x00" + two = b"\x02" + 31 * b"\x00" # the max integer over l, the order of the main subgroup # 2^252+27742317777372353535851937790883648493 - 1 - max = bytes(bytearray([0xec, 0xd3, 0xf5, 0x5c, - 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, - 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10] - ) - ) + max = bytes( + bytearray( + [ + 0xEC, + 0xD3, + 0xF5, + 0x5C, + 0x1A, + 0x63, + 0x12, + 0x58, + 0xD6, + 0x9C, + 0xF7, + 0xA2, + 0xDE, + 0xF9, + 0xDE, + 0x14, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x10, + ] + ) + ) p1 = c.crypto_core_ed25519_scalar_add(two, max) assert p1 == one @@ -649,11 +737,12 @@ assert p3 == max -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_scalar_mul(): - zero = 32 * b'\x00' - three = b'\x03' + 31 * b'\x00' + zero = 32 * b"\x00" + three = b"\x03" + 31 * b"\x00" # random scalar modulo l sclr = c.randombytes(c.crypto_core_ed25519_SCALARBYTES) @@ -666,11 +755,12 @@ assert p1 == p -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_scalar_invert_negate_complement(): - zero = 32 * b'\x00' - one = b'\x01' + 31 * b'\x00' + zero = 32 * b"\x00" + one = b"\x01" + 31 * b"\x00" # random scalar modulo l sclr = c.randombytes(c.crypto_core_ed25519_SCALARBYTES) @@ -686,40 +776,73 @@ assert c.crypto_core_ed25519_scalar_add(sclr, cp) == one -@pytest.mark.skipif(not c.has_crypto_core_ed25519, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not c.has_crypto_core_ed25519, reason="Requires full build of libsodium" +) def test_ed25519_scalar_reduce(): - zero = 32 * b'\x00' + zero = 32 * b"\x00" # 65536 times the order of the main subgroup (which is bigger # than 32 bytes), padded to 64 bytes # 2^252+27742317777372353535851937790883648493 - l65536 = bytes(2 * b'\x00') + \ - bytes(bytearray([0xed, 0xd3, 0xf5, 0x5c, - 0x1a, 0x63, 0x12, 0x58, - 0xd6, 0x9c, 0xf7, 0xa2, - 0xde, 0xf9, 0xde, 0x14, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x10] - ) - ) + bytes(30 * b'\x00') + l65536 = ( + bytes(2 * b"\x00") + + bytes( + bytearray( + [ + 0xED, + 0xD3, + 0xF5, + 0x5C, + 0x1A, + 0x63, + 0x12, + 0x58, + 0xD6, + 0x9C, + 0xF7, + 0xA2, + 0xDE, + 0xF9, + 0xDE, + 0x14, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x10, + ] + ) + ) + + bytes(30 * b"\x00") + ) # random scalar modulo l sclr = c.randombytes(c.crypto_core_ed25519_SCALARBYTES) p = c.crypto_core_ed25519_scalar_add(sclr, zero) # l65536 + p is bigger than 32 bytes - big = c.sodium_add(l65536, p + bytes(32 * b'\x00')) + big = c.sodium_add(l65536, p + bytes(32 * b"\x00")) r = c.crypto_core_ed25519_scalar_reduce(big) assert r == p -@pytest.mark.skipif(c.has_crypto_core_ed25519, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + c.has_crypto_core_ed25519, reason="Requires minimal build of libsodium" +) def test_ed25519_unavailable(): - zero = 32 * b'\x00' + zero = 32 * b"\x00" with pytest.raises(UnavailableError): c.crypto_core_ed25519_is_valid_point(zero) @@ -744,10 +867,12 @@ c.crypto_core_ed25519_scalar_reduce(zero) -@pytest.mark.skipif(c.has_crypto_scalarmult_ed25519, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + c.has_crypto_scalarmult_ed25519, + reason="Requires minimal build of libsodium", +) def test_scalarmult_ed25519_unavailable(): - zero = 32 * b'\x00' + zero = 32 * b"\x00" with pytest.raises(UnavailableError): c.crypto_scalarmult_ed25519_base(zero) diff -Nru python-nacl-1.4.0/tests/test_box.py python-nacl-1.5.0/tests/test_box.py --- python-nacl-1.4.0/tests/test_box.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_box.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,19 +12,18 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import binascii import pytest -from test_bindings import _box_from_seed_vectors - from nacl.encoding import HexEncoder from nacl.exceptions import CryptoError from nacl.public import Box, PrivateKey, PublicKey from nacl.utils import random +from .test_bindings import _box_from_seed_vectors +from .utils import check_type_error VECTORS = [ # privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext @@ -34,15 +33,19 @@ b"5dab087e624a8a4b79e17f8b83800ee66f3bb1292618b6fd1c2f8b27ff88e0eb", b"de9edb7d7b7dc1b4d35b61c2ece435373f8343c85b78674dadfc7e146f882b4f", b"69696ee955b62b73cd62bda875fc73d68219e0036b7a0b37", - (b"be075fc53c81f2d5cf141316ebeb0c7b5228c52a4c62cbd44b66849b64244ffce5e" - b"cbaaf33bd751a1ac728d45e6c61296cdc3c01233561f41db66cce314adb310e3be8" - b"250c46f06dceea3a7fa1348057e2f6556ad6b1318a024a838f21af1fde048977eb4" - b"8f59ffd4924ca1c60902e52f0a089bc76897040e082f937763848645e0705"), - (b"f3ffc7703f9400e52a7dfb4b3d3305d98e993b9f48681273c29650ba32fc76ce483" - b"32ea7164d96a4476fb8c531a1186ac0dfc17c98dce87b4da7f011ec48c97271d2c2" - b"0f9b928fe2270d6fb863d51738b48eeee314a7cc8ab932164548e526ae902243685" - b"17acfeabd6bb3732bc0e9da99832b61ca01b6de56244a9e88d5f9b37973f622a43d" - b"14a6599b1f654cb45a74e355a5"), + ( + b"be075fc53c81f2d5cf141316ebeb0c7b5228c52a4c62cbd44b66849b64244ffce5e" + b"cbaaf33bd751a1ac728d45e6c61296cdc3c01233561f41db66cce314adb310e3be8" + b"250c46f06dceea3a7fa1348057e2f6556ad6b1318a024a838f21af1fde048977eb4" + b"8f59ffd4924ca1c60902e52f0a089bc76897040e082f937763848645e0705" + ), + ( + b"f3ffc7703f9400e52a7dfb4b3d3305d98e993b9f48681273c29650ba32fc76ce483" + b"32ea7164d96a4476fb8c531a1186ac0dfc17c98dce87b4da7f011ec48c97271d2c2" + b"0f9b928fe2270d6fb863d51738b48eeee314a7cc8ab932164548e526ae902243685" + b"17acfeabd6bb3732bc0e9da99832b61ca01b6de56244a9e88d5f9b37973f622a43d" + b"14a6599b1f654cb45a74e355a5" + ), ), ] @@ -56,12 +59,11 @@ @pytest.mark.parametrize( - ( - "seed", "public_key", "secret_key" - ), - _box_from_seed_vectors() + ("seed", "public_key", "secret_key"), _box_from_seed_vectors() ) -def test_generate_private_key_from_seed(seed, public_key, secret_key): +def test_generate_private_key_from_seed( + seed: bytes, public_key: bytes, secret_key: bytes +): prvt = PrivateKey.from_seed(seed, encoder=HexEncoder) sk = binascii.unhexlify(secret_key) pk = binascii.unhexlify(public_key) @@ -110,17 +112,29 @@ @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_encryption( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubalice = PublicKey(pubalice, encoder=HexEncoder) - privbob = PrivateKey(privbob, encoder=HexEncoder) + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubalice_decoded = PublicKey(pubalice, encoder=HexEncoder) + privbob_decoded = PrivateKey(privbob, encoder=HexEncoder) - box = Box(privbob, pubalice) + box = Box(privbob_decoded, pubalice_decoded) encrypted = box.encrypt( binascii.unhexlify(plaintext), binascii.unhexlify(nonce), @@ -138,17 +152,29 @@ @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_decryption( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubbob = PublicKey(pubbob, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubbob_decoded = PublicKey(pubbob, encoder=HexEncoder) + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) - box = Box(privalice, pubbob) + box = Box(privalice_decoded, pubbob_decoded) nonce = binascii.unhexlify(nonce) decrypted = binascii.hexlify( @@ -160,17 +186,29 @@ @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_decryption_combined( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubbob = PublicKey(pubbob, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubbob_decoded = PublicKey(pubbob, encoder=HexEncoder) + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) - box = Box(privalice, pubbob) + box = Box(privalice_decoded, pubbob_decoded) combined = binascii.hexlify( binascii.unhexlify(nonce) + binascii.unhexlify(ciphertext), @@ -182,17 +220,29 @@ @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_optional_nonce( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubbob = PublicKey(pubbob, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubbob_decoded = PublicKey(pubbob, encoder=HexEncoder) + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) - box = Box(privalice, pubbob) + box = Box(privalice_decoded, pubbob_decoded) encrypted = box.encrypt(binascii.unhexlify(plaintext), encoder=HexEncoder) @@ -203,42 +253,68 @@ @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_encryption_generates_different_nonces( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubbob = PublicKey(pubbob, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) - - box = Box(privalice, pubbob) - - nonce_0 = box.encrypt(binascii.unhexlify(plaintext), - encoder=HexEncoder).nonce - - nonce_1 = box.encrypt(binascii.unhexlify(plaintext), - encoder=HexEncoder).nonce + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubbob_decoded = PublicKey(pubbob, encoder=HexEncoder) + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) + + box = Box(privalice_decoded, pubbob_decoded) + + nonce_0 = box.encrypt( + binascii.unhexlify(plaintext), encoder=HexEncoder + ).nonce + + nonce_1 = box.encrypt( + binascii.unhexlify(plaintext), encoder=HexEncoder + ).nonce assert nonce_0 != nonce_1 @pytest.mark.parametrize( ( - "privalice", "pubalice", "privbob", "pubbob", "nonce", "plaintext", + "privalice", + "pubalice", + "privbob", + "pubbob", + "nonce", + "plaintext", "ciphertext", ), VECTORS, ) def test_box_failed_decryption( - privalice, pubalice, privbob, pubbob, nonce, plaintext, ciphertext): - pubbob = PublicKey(pubbob, encoder=HexEncoder) - privbob = PrivateKey(privbob, encoder=HexEncoder) + privalice: bytes, + pubalice: bytes, + privbob: bytes, + pubbob: bytes, + nonce: bytes, + plaintext: bytes, + ciphertext: bytes, +): + pubbob_decoded = PublicKey(pubbob, encoder=HexEncoder) + privbob_decoded = PrivateKey(privbob, encoder=HexEncoder) # this cannot decrypt the ciphertext! the ciphertext must be decrypted by # (privalice, pubbob) or (privbob, pubalice) - box = Box(privbob, pubbob) + box = Box(privbob_decoded, pubbob_decoded) with pytest.raises(CryptoError): box.decrypt(ciphertext, binascii.unhexlify(nonce), encoder=HexEncoder) @@ -247,6 +323,7 @@ def test_box_wrong_length(): with pytest.raises(ValueError): PublicKey(b"") + # TODO: should the below raise a ValueError? with pytest.raises(TypeError): PrivateKey(b"") @@ -265,40 +342,58 @@ b.decrypt(b"", b"") -def check_type_error(expected, f, *args): - with pytest.raises(TypeError) as e: - f(*args) - assert expected in str(e.value) - - def test_wrong_types(): priv = PrivateKey.generate() - check_type_error(("PrivateKey must be created from a 32 bytes long " - "raw secret key"), - PrivateKey, 12) - check_type_error(("PrivateKey must be created from a 32 bytes long " - "raw secret key"), - PrivateKey, priv) - check_type_error(("PrivateKey must be created from a 32 bytes long " - "raw secret key"), - PrivateKey, priv.public_key) - - check_type_error("PublicKey must be created from 32 bytes", - PublicKey, 13) - check_type_error("PublicKey must be created from 32 bytes", - PublicKey, priv) - check_type_error("PublicKey must be created from 32 bytes", - PublicKey, priv.public_key) - - check_type_error("Box must be created from a PrivateKey and a PublicKey", - Box, priv, "not a public key") - check_type_error("Box must be created from a PrivateKey and a PublicKey", - Box, priv.encode(), priv.public_key.encode()) - check_type_error("Box must be created from a PrivateKey and a PublicKey", - Box, priv, priv.public_key.encode()) - check_type_error("Box must be created from a PrivateKey and a PublicKey", - Box, priv.encode(), priv.public_key) + check_type_error( + ("PrivateKey must be created from a 32 bytes long raw secret key"), + PrivateKey, + 12, + ) + check_type_error( + ("PrivateKey must be created from a 32 bytes long raw secret key"), + PrivateKey, + priv, + ) + check_type_error( + ("PrivateKey must be created from a 32 bytes long raw secret key"), + PrivateKey, + priv.public_key, + ) + + check_type_error("PublicKey must be created from 32 bytes", PublicKey, 13) + check_type_error( + "PublicKey must be created from 32 bytes", PublicKey, priv + ) + check_type_error( + "PublicKey must be created from 32 bytes", PublicKey, priv.public_key + ) + + check_type_error( + "Box must be created from a PrivateKey and a PublicKey", + Box, + priv, + "not a public key", + ) + check_type_error( + "Box must be created from a PrivateKey and a PublicKey", + Box, + priv.encode(), + priv.public_key.encode(), + ) + check_type_error( + "Box must be created from a PrivateKey and a PublicKey", + Box, + priv, + priv.public_key.encode(), + ) + check_type_error( + "Box must be created from a PrivateKey and a PublicKey", + Box, + priv.encode(), + priv.public_key, + ) - check_type_error("seed must be a 32 bytes long", - PrivateKey.from_seed, b"1") + check_type_error( + "seed must be a 32 bytes long", PrivateKey.from_seed, b"1" + ) diff -Nru python-nacl-1.4.0/tests/test_encoding.py python-nacl-1.5.0/tests/test_encoding.py --- python-nacl-1.4.0/tests/test_encoding.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_encoding.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import pytest @@ -27,43 +26,55 @@ # Encoder, Ciphertext ( nacl.encoding.RawEncoder, - (b"111111111111111111111111\xfcU\xe2\x9f\xe6E\x92\xd7\x0eFM=x\x83\x8fj" - b"} v\xd4\xf0\x1a1\xc0\x88Uk\x12\x02\x1cd\xfaOH\x13\xdc\x0e\x0e\xd7A" - b"\x07\x0b.\x9f\x01\xbf\xe4\xd0s\xf1P\xd3\x0e\xaa\x9d\xb3\xf7\\\x0f"), + ( + b"111111111111111111111111\xfcU\xe2\x9f\xe6E\x92\xd7\x0eFM=x\x83\x8fj" + b"} v\xd4\xf0\x1a1\xc0\x88Uk\x12\x02\x1cd\xfaOH\x13\xdc\x0e\x0e\xd7A" + b"\x07\x0b.\x9f\x01\xbf\xe4\xd0s\xf1P\xd3\x0e\xaa\x9d\xb3\xf7\\\x0f" + ), ), ( nacl.encoding.HexEncoder, - (b"313131313131313131313131313131313131313131313131fc55e29fe64592d70e4" - b"64d3d78838f6a7d2076d4f01a31c088556b12021c64fa4f4813dc0e0ed741070b2e" - b"9f01bfe4d073f150d30eaa9db3f75c0f"), + ( + b"313131313131313131313131313131313131313131313131fc55e29fe64592d70e4" + b"64d3d78838f6a7d2076d4f01a31c088556b12021c64fa4f4813dc0e0ed741070b2e" + b"9f01bfe4d073f150d30eaa9db3f75c0f" + ), ), ( nacl.encoding.Base16Encoder, - (b"313131313131313131313131313131313131313131313131FC55E29FE64592D70E4" - b"64D3D78838F6A7D2076D4F01A31C088556B12021C64FA4F4813DC0E0ED741070B2E" - b"9F01BFE4D073F150D30EAA9DB3F75C0F"), + ( + b"313131313131313131313131313131313131313131313131FC55E29FE64592D70E4" + b"64D3D78838F6A7D2076D4F01A31C088556B12021C64FA4F4813DC0E0ED741070B2E" + b"9F01BFE4D073F150D30EAA9DB3F75C0F" + ), ), ( nacl.encoding.Base32Encoder, - (b"GEYTCMJRGEYTCMJRGEYTCMJRGEYTCMJRGEYTCMP4KXRJ7ZSFSLLQ4RSNHV4IHD3KPUQ" - b"HNVHQDIY4BCCVNMJAEHDE7JHUQE64BYHNOQIHBMXJ6AN74TIHH4KQ2MHKVHNT65OA6" - b"==="), + ( + b"GEYTCMJRGEYTCMJRGEYTCMJRGEYTCMJRGEYTCMP4KXRJ7ZSFSLLQ4RSNHV4IHD3KPUQ" + b"HNVHQDIY4BCCVNMJAEHDE7JHUQE64BYHNOQIHBMXJ6AN74TIHH4KQ2MHKVHNT65OA6" + b"===" + ), ), ( nacl.encoding.Base64Encoder, - (b"MTExMTExMTExMTExMTExMTExMTExMTEx/FXin+ZFktcORk09eIOPan0gdtTwGjHAiFV" - b"rEgIcZPpPSBPcDg7XQQcLLp8Bv+TQc/FQ0w6qnbP3XA8="), + ( + b"MTExMTExMTExMTExMTExMTExMTExMTEx/FXin+ZFktcORk09eIOPan0gdtTwGjHAiFV" + b"rEgIcZPpPSBPcDg7XQQcLLp8Bv+TQc/FQ0w6qnbP3XA8=" + ), ), ( nacl.encoding.URLSafeBase64Encoder, - (b"MTExMTExMTExMTExMTExMTExMTExMTEx_FXin-ZFktcORk09eIOPan0gdtTwGjHAiFV" - b"rEgIcZPpPSBPcDg7XQQcLLp8Bv-TQc_FQ0w6qnbP3XA8="), + ( + b"MTExMTExMTExMTExMTExMTExMTExMTEx_FXin-ZFktcORk09eIOPan0gdtTwGjHAiFV" + b"rEgIcZPpPSBPcDg7XQQcLLp8Bv-TQc_FQ0w6qnbP3XA8=" + ), ), ] @pytest.mark.parametrize(("encoder", "ciphertext"), VECTORS) -def test_encoders(encoder, ciphertext): +def test_encoders(encoder: nacl.encoding.Encoder, ciphertext: bytes): box = nacl.secret.SecretBox(KEY) test_ciphertext = box.encrypt(TEXT, NONCE, encoder=encoder) diff -Nru python-nacl-1.4.0/tests/test_exc.py python-nacl-1.5.0/tests/test_exc.py --- python-nacl-1.4.0/tests/test_exc.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_exc.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import pytest @@ -23,21 +22,35 @@ pass +# Type safety: mypy can spot comparisons that will always evaluate to False, and the +# bad argument type. Suppress these: we want to test these are detected at runtime. + + def test_exceptions_ensure_with_true_condition(): - exc.ensure(1 == 1, 'one equals one') + exc.ensure(1 == 1, "one equals one") def test_exceptions_ensure_with_false_condition(): with pytest.raises(exc.AssertionError): - exc.ensure(1 == 0, 'one is not zero', - raising=exc.AssertionError) + exc.ensure( + 1 == 0, # type: ignore[comparison-overlap] + "one is not zero", + raising=exc.AssertionError, + ) def test_exceptions_ensure_with_unwanted_kwarg(): with pytest.raises(exc.TypeError): - exc.ensure(1 == 1, unexpected='unexpected') + exc.ensure( + 1 == 1, + unexpected="unexpected", # type: ignore[arg-type] + ) def test_exceptions_ensure_custom_exception(): with pytest.raises(CustomError): - exc.ensure(1 == 0, 'Raising a CustomError', raising=CustomError) + exc.ensure( + 1 == 0, # type: ignore[comparison-overlap] + "Raising a CustomError", + raising=CustomError, + ) diff -Nru python-nacl-1.4.0/tests/test_generichash.py python-nacl-1.5.0/tests/test_generichash.py --- python-nacl-1.4.0/tests/test_generichash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_generichash.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,93 +12,124 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function - import binascii import copy import json import os +from typing import AnyStr, Dict, List, Tuple, Union import pytest -from utils import read_crypto_test_vectors - import nacl.encoding import nacl.exceptions as exc import nacl.hash import nacl.hashlib +from .utils import read_crypto_test_vectors + + OVERLONG_PARAMS_VECTORS = [ - (b'key', 65 * b'\xaa', 16 * b'\xaa', 16 * b'\x55', 64, b'will raise'), - (b'salt', b'key', 17 * b'\xaa', 16 * b'\x55', 64, b'will raise'), - (b'personal', b'key', 16 * b'\xaa', 17 * b'\x55', 64, b'will raise'), - (b'digest_size', b'key', 16 * b'\xaa', 16 * b'\x55', 65, b'will raise'), + (b"key", 65 * b"\xaa", 16 * b"\xaa", 16 * b"\x55", 64, b"will raise"), + (b"salt", b"key", 17 * b"\xaa", 16 * b"\x55", 64, b"will raise"), + (b"personal", b"key", 16 * b"\xaa", 17 * b"\x55", 64, b"will raise"), + (b"digest_size", b"key", 16 * b"\xaa", 16 * b"\x55", 65, b"will raise"), ] -def generichash_vectors(): +def generichash_vectors() -> List[Tuple[bytes, bytes, bytes, bytes]]: # Format: DATA = "crypto-test-vectors-blake2-nosalt-nopersonalization.txt" - return read_crypto_test_vectors(DATA, delimiter=b'\t') + # Type safety: read_crypto_test_vectors returns an arbitrary length tuple, but we + # know this file's test entries contain exactly four fields. + return read_crypto_test_vectors(DATA, delimiter=b"\t") # type: ignore[return-value] -def blake2_salt_pers_vectors(): +def blake2_salt_pers_vectors() -> List[ + Tuple[bytes, bytes, bytes, bytes, bytes, bytes] +]: # Format: # DATA = "crypto-test-vectors-blake2-salt-personalization.txt" - return read_crypto_test_vectors(DATA, delimiter=b'\t') + # Type safety: read_crypto_test_vectors returns an arbitrary length tuple, but we + # know this file's test entries contain exactly six fields. + return read_crypto_test_vectors(DATA, delimiter=b"\t") # type: ignore[return-value] -def blake2_reference_vectors(): +def blake2_reference_vectors() -> List[Tuple[str, str, int, str]]: DATA = "blake2-kat.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) - jvectors = json.load(open(path)) - vectors = [(x["in"], x["key"], len(x["out"]) // 2, - x["out"]) - for x in jvectors if x["hash"] == "blake2b"] + jvectors: List[Dict[str, str]] = json.load(open(path)) + vectors = [ + (x["in"], x["key"], len(x["out"]) // 2, x["out"]) + for x in jvectors + if x["hash"] == "blake2b" + ] return vectors -@pytest.mark.parametrize(["message", "key", "outlen", "output"], - generichash_vectors()) -def test_generichash(message, key, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "outlen", "output"], generichash_vectors() +) +def test_generichash( + message: AnyStr, key: AnyStr, outlen: Union[AnyStr, int], output: AnyStr +): msg = binascii.unhexlify(message) - output = binascii.hexlify(binascii.unhexlify(output)) + output_bytes = binascii.hexlify(binascii.unhexlify(output)) k = binascii.unhexlify(key) - outlen = int(outlen) - out = nacl.hash.generichash(msg, digest_size=outlen, key=k) - assert (out == output) - - -@pytest.mark.parametrize(["message", "key", "salt", "person", "outlen", - "output"], - OVERLONG_PARAMS_VECTORS) -def test_overlong_blake2b_oneshot_params(message, key, salt, person, - outlen, output): + outlen_parsed = int(outlen) + out = nacl.hash.generichash(msg, digest_size=outlen_parsed, key=k) + assert out == output_bytes + + +@pytest.mark.parametrize( + ["message", "key", "salt", "person", "outlen", "output"], + OVERLONG_PARAMS_VECTORS, +) +def test_overlong_blake2b_oneshot_params( + message: bytes, + key: bytes, + salt: bytes, + person: bytes, + outlen: int, + output: bytes, +): with pytest.raises(exc.ValueError): - nacl.hash.blake2b(message, digest_size=outlen, key=key, - salt=salt, person=person) + nacl.hash.blake2b( + message, digest_size=outlen, key=key, salt=salt, person=person + ) -@pytest.mark.parametrize(["message", "key", "outlen", "output"], - blake2_reference_vectors()) -def test_generichash_blake2_ref(message, key, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "outlen", "output"], blake2_reference_vectors() +) +def test_generichash_blake2_ref( + message: str, key: str, outlen: int, output: str +): test_generichash(message, key, outlen, output) -@pytest.mark.parametrize(["message", "key", "salt", "person", "outlen", - "output"], - blake2_salt_pers_vectors()) -def test_hash_blake2b(message, key, salt, person, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "salt", "person", "outlen", "output"], + blake2_salt_pers_vectors(), +) +def test_hash_blake2b( + message: bytes, + key: bytes, + salt: bytes, + person: bytes, + outlen: bytes, + output: bytes, +): msg = binascii.unhexlify(message) output = binascii.hexlify(binascii.unhexlify(output)) k = binascii.unhexlify(key) slt = binascii.unhexlify(salt) pers = binascii.unhexlify(person) - outlen = int(outlen) - out = nacl.hash.blake2b(msg, digest_size=outlen, key=k, - salt=slt, person=pers) - assert (out == output) + outlen_parsed = int(outlen) + out = nacl.hash.blake2b( + msg, digest_size=outlen_parsed, key=k, salt=slt, person=pers + ) + assert out == output def test_expected_hashlib_level_pickle_and_copy_failures(): @@ -110,8 +141,11 @@ def test_expected_bindings_level_pickle_and_copy_failures(): - from nacl.bindings.crypto_generichash import (Blake2State, - crypto_generichash_BYTES) + from nacl.bindings.crypto_generichash import ( + Blake2State, + crypto_generichash_BYTES, + ) + st = Blake2State(crypto_generichash_BYTES) with pytest.raises(TypeError): copy.deepcopy(st) @@ -119,21 +153,27 @@ copy.copy(st) -@pytest.mark.parametrize(["message", "key", "outlen", "output"], - blake2_reference_vectors()) -def test_hashlib_blake2_ref_vectors(message, key, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "outlen", "output"], blake2_reference_vectors() +) +def test_hashlib_blake2_ref_vectors( + message: str, key: str, outlen: int, output: str +): msg = binascii.unhexlify(message) k = binascii.unhexlify(key) outlen = int(outlen) out = binascii.unhexlify(output) h = nacl.hashlib.blake2b(msg, digest_size=outlen, key=k) dgst = h.digest() - assert (out == dgst) + assert out == dgst -@pytest.mark.parametrize(["message", "key", "outlen", "output"], - blake2_reference_vectors()) -def test_hashlib_blake2_iuf_ref_vectors(message, key, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "outlen", "output"], blake2_reference_vectors() +) +def test_hashlib_blake2_iuf_ref_vectors( + message: str, key: str, outlen: int, output: str +): msg = binascii.unhexlify(message) k = binascii.unhexlify(key) outlen = int(outlen) @@ -144,13 +184,16 @@ h.update(bytes(msg[_pos:_end])) dgst = h.digest() hdgst = h.hexdigest() - assert (hdgst == output) - assert (out == dgst) + assert hdgst == output + assert out == dgst -@pytest.mark.parametrize(["message", "key", "outlen", "output"], - blake2_reference_vectors()) -def test_hashlib_blake2_iuf_cp_ref_vectors(message, key, outlen, output): +@pytest.mark.parametrize( + ["message", "key", "outlen", "output"], blake2_reference_vectors() +) +def test_hashlib_blake2_iuf_cp_ref_vectors( + message: str, key: str, outlen: int, output: str +): msg = binascii.unhexlify(message) msglen = len(msg) if msglen < 2: @@ -166,29 +209,37 @@ h2 = h.copy() dgst = h.digest() d2 = h2.digest() - assert (out == dgst) - assert (d2 != dgst) + assert out == dgst + assert d2 != dgst -@pytest.mark.parametrize(["message", "key", "salt", "person", "outlen", - "output"], - OVERLONG_PARAMS_VECTORS) -def test_overlong_blake2b_iuf_params(message, key, salt, person, - outlen, output): +@pytest.mark.parametrize( + ["message", "key", "salt", "person", "outlen", "output"], + OVERLONG_PARAMS_VECTORS, +) +def test_overlong_blake2b_iuf_params( + message: bytes, + key: bytes, + salt: bytes, + person: bytes, + outlen: int, + output: bytes, +): with pytest.raises(exc.ValueError): - nacl.hashlib.blake2b(message, digest_size=outlen, - key=key, salt=salt, person=person) + nacl.hashlib.blake2b( + message, digest_size=outlen, key=key, salt=salt, person=person + ) def test_blake2_descriptors_presence(): h = nacl.hashlib.blake2b() - assert h.name == 'blake2b' - h.block_size == 128 - h.digest_size == 32 # this is the default digest_size + assert h.name == "blake2b" + assert h.block_size == 128 + assert h.digest_size == 32 # this is the default digest_size def test_blake2_digest_size_descriptor_coherence(): h = nacl.hashlib.blake2b(digest_size=64) - assert h.name == 'blake2b' - h.block_size == 128 - h.digest_size == 64 + assert h.name == "blake2b" + assert h.block_size == 128 + assert h.digest_size == 64 diff -Nru python-nacl-1.4.0/tests/test_hashlib_scrypt.py python-nacl-1.5.0/tests/test_hashlib_scrypt.py --- python-nacl-1.4.0/tests/test_hashlib_scrypt.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_hashlib_scrypt.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from binascii import unhexlify @@ -54,47 +53,91 @@ # 37 30 40 49 e8 a9 52 fb cb f4 5c 6f a7 7a 41 a4 RFC_7914_VECTORS = [ - (b"", b"", 16, 1, 1, 64, ( - b"77 d6 57 62 38 65 7b 20 3b 19 ca 42 c1 8a 04 97" - b"f1 6b 48 44 e3 07 4a e8 df df fa 3f ed e2 14 42" - b"fc d0 06 9d ed 09 48 f8 32 6a 75 3a 0f c8 1f 17" - b"e8 d3 e0 fb 2e 0d 36 28 cf 35 e2 0c 38 d1 89 06") - ), - (b"password", b"NaCl", 1024, 8, 16, 64, ( - b"fd ba be 1c 9d 34 72 00 78 56 e7 19 0d 01 e9 fe" - b"7c 6a d7 cb c8 23 78 30 e7 73 76 63 4b 37 31 62" - b"2e af 30 d9 2e 22 a3 88 6f f1 09 27 9d 98 30 da" - b"c7 27 af b9 4a 83 ee 6d 83 60 cb df a2 cc 06 40") - ), - (b"pleaseletmein", b"SodiumChloride", 16384, 8, 1, 64, ( - b"70 23 bd cb 3a fd 73 48 46 1c 06 cd 81 fd 38 eb" - b"fd a8 fb ba 90 4f 8e 3e a9 b5 43 f6 54 5d a1 f2" - b"d5 43 29 55 61 3f 0f cf 62 d4 97 05 24 2a 9a f9" - b"e6 1e 85 dc 0d 65 1e 40 df cf 01 7b 45 57 58 87") - ), - (b"pleaseletmein", b"SodiumChloride", 1048576, 8, 1, 64, ( - b"21 01 cb 9b 6a 51 1a ae ad db be 09 cf 70 f8 81" - b"ec 56 8d 57 4a 2f fd 4d ab e5 ee 98 20 ad aa 47" - b"8e 56 fd 8f 4b a5 d0 9f fa 1c 6d 92 7c 40 f4 c3" - b"37 30 40 49 e8 a9 52 fb cb f4 5c 6f a7 7a 41 a4"), - ) + ( + b"", + b"", + 16, + 1, + 1, + 64, + ( + b"77 d6 57 62 38 65 7b 20 3b 19 ca 42 c1 8a 04 97" + b"f1 6b 48 44 e3 07 4a e8 df df fa 3f ed e2 14 42" + b"fc d0 06 9d ed 09 48 f8 32 6a 75 3a 0f c8 1f 17" + b"e8 d3 e0 fb 2e 0d 36 28 cf 35 e2 0c 38 d1 89 06" + ), + ), + ( + b"password", + b"NaCl", + 1024, + 8, + 16, + 64, + ( + b"fd ba be 1c 9d 34 72 00 78 56 e7 19 0d 01 e9 fe" + b"7c 6a d7 cb c8 23 78 30 e7 73 76 63 4b 37 31 62" + b"2e af 30 d9 2e 22 a3 88 6f f1 09 27 9d 98 30 da" + b"c7 27 af b9 4a 83 ee 6d 83 60 cb df a2 cc 06 40" + ), + ), + ( + b"pleaseletmein", + b"SodiumChloride", + 16384, + 8, + 1, + 64, + ( + b"70 23 bd cb 3a fd 73 48 46 1c 06 cd 81 fd 38 eb" + b"fd a8 fb ba 90 4f 8e 3e a9 b5 43 f6 54 5d a1 f2" + b"d5 43 29 55 61 3f 0f cf 62 d4 97 05 24 2a 9a f9" + b"e6 1e 85 dc 0d 65 1e 40 df cf 01 7b 45 57 58 87" + ), + ), + ( + b"pleaseletmein", + b"SodiumChloride", + 1048576, + 8, + 1, + 64, + ( + b"21 01 cb 9b 6a 51 1a ae ad db be 09 cf 70 f8 81" + b"ec 56 8d 57 4a 2f fd 4d ab e5 ee 98 20 ad aa 47" + b"8e 56 fd 8f 4b a5 d0 9f fa 1c 6d 92 7c 40 f4 c3" + b"37 30 40 49 e8 a9 52 fb cb f4 5c 6f a7 7a 41 a4" + ), + ), ] -@pytest.mark.skipif(not nacl.hashlib.SCRYPT_AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(('password', 'salt', 'n', 'r', 'p', - 'dklen', 'expected'), - RFC_7914_VECTORS) -def test_hashlib_scrypt_api(password, salt, n, r, p, dklen, expected): +@pytest.mark.skipif( + not nacl.hashlib.SCRYPT_AVAILABLE, + reason="Requires full build of libsodium", +) +@pytest.mark.parametrize( + ("password", "salt", "n", "r", "p", "dklen", "expected"), RFC_7914_VECTORS +) +def test_hashlib_scrypt_api( + password: bytes, + salt: bytes, + n: int, + r: int, + p: int, + dklen: int, + expected: bytes, +): _exp = unhexlify(expected.replace(b" ", b"")) - dgst = nacl.hashlib.scrypt(password, salt=salt, n=n, r=r, p=p, - dklen=dklen, maxmem=2 * (1024 ** 3)) + dgst = nacl.hashlib.scrypt( + password, salt=salt, n=n, r=r, p=p, dklen=dklen, maxmem=2 * (1024 ** 3) + ) assert _exp == dgst -@pytest.mark.skipif(nacl.hashlib.SCRYPT_AVAILABLE, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + nacl.hashlib.SCRYPT_AVAILABLE, reason="Requires minimal build of libsodium" +) def test_hashlib_scrypt_unavailable(): with pytest.raises(UnavailableError): nacl.hashlib.scrypt(b"") diff -Nru python-nacl-1.4.0/tests/test_hash.py python-nacl-1.5.0/tests/test_hash.py --- python-nacl-1.4.0/tests/test_hash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_hash.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,75 +11,96 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - import pytest import nacl.encoding import nacl.hash -@pytest.mark.parametrize(("inp", "expected"), [ - ( - b"The quick brown fox jumps over the lazy dog.", - b"ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c", - ), - ( - b"", - b"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - ) -]) -def test_sha256_hex(inp, expected): +@pytest.mark.parametrize( + ("inp", "expected"), + [ + ( + b"The quick brown fox jumps over the lazy dog.", + b"ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c", + ), + ( + b"", + b"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + ), + ], +) +def test_sha256_hex(inp: bytes, expected: bytes): assert nacl.hash.sha256(inp) == expected -@pytest.mark.parametrize(("inp", "expected"), [ - ( - b"The quick brown fox jumps over the lazy dog.", - (b"\xEFS\x7F%\xC8\x95\xBF\xA7\x82Re)\xA9\xB6=\x97\xAAc\x15d\xD5\xD7" - b"\x89\xC2\xB7eD\x8C\x865\xFBl"), - ), - ( - b"", - (b"\xe3\xb0\xc4B\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99o\xb9$'\xaeA\xe4d" - b"\x9b\x93L\xa4\x95\x99\x1bxR\xb8U"), - ) -]) -def test_sha256_binary(inp, expected): +@pytest.mark.parametrize( + ("inp", "expected"), + [ + ( + b"The quick brown fox jumps over the lazy dog.", + ( + b"\xEFS\x7F%\xC8\x95\xBF\xA7\x82Re)\xA9\xB6=\x97\xAAc\x15d\xD5\xD7" + b"\x89\xC2\xB7eD\x8C\x865\xFBl" + ), + ), + ( + b"", + ( + b"\xe3\xb0\xc4B\x98\xfc\x1c\x14\x9a\xfb\xf4\xc8\x99o\xb9$'\xaeA\xe4d" + b"\x9b\x93L\xa4\x95\x99\x1bxR\xb8U" + ), + ), + ], +) +def test_sha256_binary(inp: bytes, expected: bytes): assert nacl.hash.sha256(inp, encoder=nacl.encoding.RawEncoder) == expected -@pytest.mark.parametrize(("inp", "expected"), [ - ( - b"The quick brown fox jumps over the lazy dog.", - (b"91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c" - b"7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed"), - ), - ( - b"", - (b"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d" - b"0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"), - ) -]) -def test_sha512_hex(inp, expected): +@pytest.mark.parametrize( + ("inp", "expected"), + [ + ( + b"The quick brown fox jumps over the lazy dog.", + ( + b"91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c" + b"7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed" + ), + ), + ( + b"", + ( + b"cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d" + b"0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e" + ), + ), + ], +) +def test_sha512_hex(inp: bytes, expected: bytes): assert nacl.hash.sha512(inp) == expected -@pytest.mark.parametrize(("inp", "expected"), [ - ( - b"The quick brown fox jumps over the lazy dog.", - (b"\x91\xEA\x12E\xF2\rF\xAE\x9A\x03z\x98\x9FT\xF1\xF7\x90\xF0\xA4v\a" - b"\xEE\xB8\xA1M\x12\x89\f\xEAw\xA1\xBB\xC6\xC7\xED\x9C\xF2\x05\xE6{" - b"\x7F+\x8F\xD4\xC7\xDF\xD3\xA7\xA8a~E\xF3\xC4c\xD4\x81\xC7\xE5\x86" - b"\xC3\x9A\xC1\xED"), - ), - ( - b"", - (b"\xCF\x83\xE15~\xEF\xB8\xBD\xF1T(P\xD6m\x80\a\xD6 \xE4\x05\vW\x15" - b"\xDC\x83\xF4\xA9!\xD3l\xE9\xCEG\xD0\xD1<]\x85\xF2\xB0\xFF\x83\x18" - b"\xD2\x87~\xEC/c\xB91\xBDGAz\x81\xA582z\xF9'\xDA>"), - ) -]) -def test_sha512_binary(inp, expected): +@pytest.mark.parametrize( + ("inp", "expected"), + [ + ( + b"The quick brown fox jumps over the lazy dog.", + ( + b"\x91\xEA\x12E\xF2\rF\xAE\x9A\x03z\x98\x9FT\xF1\xF7\x90\xF0\xA4v\a" + b"\xEE\xB8\xA1M\x12\x89\f\xEAw\xA1\xBB\xC6\xC7\xED\x9C\xF2\x05\xE6{" + b"\x7F+\x8F\xD4\xC7\xDF\xD3\xA7\xA8a~E\xF3\xC4c\xD4\x81\xC7\xE5\x86" + b"\xC3\x9A\xC1\xED" + ), + ), + ( + b"", + ( + b"\xCF\x83\xE15~\xEF\xB8\xBD\xF1T(P\xD6m\x80\a\xD6 \xE4\x05\vW\x15" + b"\xDC\x83\xF4\xA9!\xD3l\xE9\xCEG\xD0\xD1<]\x85\xF2\xB0\xFF\x83\x18" + b"\xD2\x87~\xEC/c\xB91\xBDGAz\x81\xA582z\xF9'\xDA>" + ), + ), + ], +) +def test_sha512_binary(inp: bytes, expected: bytes): assert nacl.hash.sha512(inp, encoder=nacl.encoding.RawEncoder) == expected diff -Nru python-nacl-1.4.0/tests/test_kx.py python-nacl-1.5.0/tests/test_kx.py --- python-nacl-1.4.0/tests/test_kx.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_kx.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from hypothesis import HealthCheck, given, settings from hypothesis.strategies import binary @@ -30,13 +29,12 @@ assert secret_key != secret_key_2 -@given(binary(min_size=32, - max_size=32), - binary(min_size=32, - max_size=32), - ) +@given( + binary(min_size=32, max_size=32), + binary(min_size=32, max_size=32), +) @settings(max_examples=100) -def test_crypto_kx_seed_keypair(seed1, seed2): +def test_crypto_kx_seed_keypair(seed1: bytes, seed2: bytes): seeded = b.crypto_kx_seed_keypair(seed1) seeded_other = b.crypto_kx_seed_keypair(seed2) if seed1 != seed2: @@ -45,40 +43,39 @@ assert seeded == seeded_other -@given(binary(min_size=33, - max_size=128), - ) -@settings(max_examples=20, suppress_health_check=[ - HealthCheck.too_slow -]) -def test_crypto_kx_seed_keypair_seed_too_large(seed): +@given( + binary(min_size=33, max_size=128), +) +@settings(max_examples=20, suppress_health_check=[HealthCheck.too_slow]) +def test_crypto_kx_seed_keypair_seed_too_large(seed: bytes): with pytest.raises(exc.TypeError): b.crypto_kx_seed_keypair(seed) -@given(binary(min_size=0, - max_size=31), - ) +@given( + binary(min_size=0, max_size=31), +) @settings(max_examples=20) -def test_crypto_kx_seed_keypair_seed_too_small(seed): +def test_crypto_kx_seed_keypair_seed_too_small(seed: bytes): with pytest.raises(exc.TypeError): b.crypto_kx_seed_keypair(seed) -@given(binary(min_size=32, - max_size=32), - binary(min_size=32, - max_size=32), - ) +@given( + binary(min_size=32, max_size=32), + binary(min_size=32, max_size=32), +) @settings(max_examples=100) -def test_crypto_kx_session_keys(seed1, seed2): +def test_crypto_kx_session_keys(seed1: bytes, seed2: bytes): s_keys = b.crypto_kx_seed_keypair(seed1) c_keys = b.crypto_kx_seed_keypair(seed2) - server_rx_key, server_tx_key = \ - b.crypto_kx_server_session_keys(s_keys[0], s_keys[1], c_keys[0]) - client_rx_key, client_tx_key = \ - b.crypto_kx_client_session_keys(c_keys[0], c_keys[1], s_keys[0]) + server_rx_key, server_tx_key = b.crypto_kx_server_session_keys( + s_keys[0], s_keys[1], c_keys[0] + ) + client_rx_key, client_tx_key = b.crypto_kx_client_session_keys( + c_keys[0], c_keys[1], s_keys[0] + ) assert client_rx_key == server_tx_key assert server_rx_key == client_tx_key @@ -88,6 +85,7 @@ s_keys = b.crypto_kx_keypair() c_keys = b.crypto_kx_keypair() + # TODO: should invalid argument lengths (but correct types) raise ValueError? with pytest.raises(exc.TypeError): b.crypto_kx_server_session_keys(s_keys[0][:-1], s_keys[1], c_keys[0]) diff -Nru python-nacl-1.4.0/tests/test_public.py python-nacl-1.5.0/tests/test_public.py --- python-nacl-1.4.0/tests/test_public.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_public.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,17 +11,17 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - import binascii +from typing import Tuple, Union import pytest -from utils import assert_equal, assert_not_equal - from nacl.bindings import crypto_box_PUBLICKEYBYTES, crypto_box_SECRETKEYBYTES from nacl.public import Box, PrivateKey, PublicKey from nacl.utils import random +from .utils import assert_equal, assert_not_equal + class TestPublicKey: def test_equal_keys_have_equal_hashes(self): @@ -36,12 +36,15 @@ assert_equal(k1, k1) assert_equal(k1, k2) - @pytest.mark.parametrize('k2', [ - b"\x00" * crypto_box_PUBLICKEYBYTES, - PublicKey(b"\x01" * crypto_box_PUBLICKEYBYTES), - PublicKey(b"\x00" * (crypto_box_PUBLICKEYBYTES - 1) + b"\x01"), - ]) - def test_different_keys_are_not_equal(self, k2): + @pytest.mark.parametrize( + "k2", + [ + b"\x00" * crypto_box_PUBLICKEYBYTES, + PublicKey(b"\x01" * crypto_box_PUBLICKEYBYTES), + PublicKey(b"\x00" * (crypto_box_PUBLICKEYBYTES - 1) + b"\x01"), + ], + ) + def test_different_keys_are_not_equal(self, k2: Union[bytes, PublicKey]): k1 = PublicKey(b"\x00" * crypto_box_PUBLICKEYBYTES) assert_not_equal(k1, k2) @@ -59,7 +62,7 @@ assert_equal(k1, k1) assert_equal(k1, k2) - def _gen_equivalent_raw_keys_couple(self): + def _gen_equivalent_raw_keys_couple(self) -> Tuple[PrivateKey, PrivateKey]: rwk1 = bytearray(random(crypto_box_SECRETKEYBYTES)) rwk2 = bytearray(rwk1) # mask rwk1 bits @@ -88,12 +91,15 @@ sk = PrivateKey(random(crypto_box_SECRETKEYBYTES)) assert hash(sk) != hash(sk.public_key) - @pytest.mark.parametrize('k2', [ - b"\x00" * crypto_box_SECRETKEYBYTES, - PrivateKey(b"\x01" * crypto_box_SECRETKEYBYTES), - PrivateKey(b"\x00" * (crypto_box_SECRETKEYBYTES - 1) + b"\x01"), - ]) - def test_different_keys_are_not_equal(self, k2): + @pytest.mark.parametrize( + "k2", + [ + b"\x00" * crypto_box_SECRETKEYBYTES, + PrivateKey(b"\x01" * crypto_box_SECRETKEYBYTES), + PrivateKey(b"\x00" * (crypto_box_SECRETKEYBYTES - 1) + b"\x01"), + ], + ) + def test_different_keys_are_not_equal(self, k2: Union[bytes, PrivateKey]): k1 = PrivateKey(b"\x00" * crypto_box_SECRETKEYBYTES) assert_not_equal(k1, k2) @@ -117,14 +123,22 @@ key derivation pass on the raw shared Diffie-Hellman key, which is not exposed by itself, we just check the shared key for equality. """ - prv_A = (b'77076d0a7318a57d3c16c17251b26645' - b'df4c2f87ebc0992ab177fba51db92c2a') - pub_A = (b'8520f0098930a754748b7ddcb43ef75a' - b'0dbf3a0d26381af4eba4a98eaa9b4e6a') - prv_B = (b'5dab087e624a8a4b79e17f8b83800ee6' - b'6f3bb1292618b6fd1c2f8b27ff88e0eb') - pub_B = (b'de9edb7d7b7dc1b4d35b61c2ece43537' - b'3f8343c85b78674dadfc7e146f882b4f') + prv_A = ( + b"77076d0a7318a57d3c16c17251b26645" + b"df4c2f87ebc0992ab177fba51db92c2a" + ) + pub_A = ( + b"8520f0098930a754748b7ddcb43ef75a" + b"0dbf3a0d26381af4eba4a98eaa9b4e6a" + ) + prv_B = ( + b"5dab087e624a8a4b79e17f8b83800ee6" + b"6f3bb1292618b6fd1c2f8b27ff88e0eb" + ) + pub_B = ( + b"de9edb7d7b7dc1b4d35b61c2ece43537" + b"3f8343c85b78674dadfc7e146f882b4f" + ) alices = PrivateKey(binascii.unhexlify(prv_A)) bobs = PrivateKey(binascii.unhexlify(prv_B)) diff -Nru python-nacl-1.4.0/tests/test_pwhash.py python-nacl-1.5.0/tests/test_pwhash.py --- python-nacl-1.4.0/tests/test_pwhash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_pwhash.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,81 +11,99 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - import binascii import json import os import sys import unicodedata as ud +from typing import List, Tuple from hypothesis import given, settings from hypothesis.strategies import integers, text import pytest -from six import unichr - import nacl.bindings import nacl.encoding import nacl.exceptions as exc import nacl.pwhash -_all_unicode = u''.join(unichr(i) for i in range(sys.maxunicode)) -PASSWD_CHARS = u''.join(c for c in _all_unicode - if (ud.category(c).startswith('L') or - ud.category(c).startswith('N') or - ud.category(c) == 'Zs' - ) - ) +_all_unicode = "".join(chr(i) for i in range(sys.maxunicode)) +PASSWD_CHARS = "".join( + c + for c in _all_unicode + if ( + ud.category(c).startswith("L") + or ud.category(c).startswith("N") + or ud.category(c) == "Zs" + ) +) # Select Letters, number representations and spacing characters -def argon2i_modular_crypt_ref(): +def argon2i_modular_crypt_ref() -> List[Tuple[str, str]]: DATA = "modular_crypt_argon2i_hashes.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) jvectors = json.load(open(path)) - vectors = [(x["pwhash"], x["passwd"]) - for x in jvectors if x["mode"] == "crypt"] + vectors = [ + (x["pwhash"], x["passwd"]) for x in jvectors if x["mode"] == "crypt" + ] return vectors -def argon2i_raw_ref(): +def argon2i_raw_ref() -> List[Tuple[int, str, str, int, int, str]]: DATA = "raw_argon2i_hashes.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) jvectors = json.load(open(path)) - vectors = [(x["dgst_len"], x["passwd"], x["salt"], x["iters"], - x["maxmem"], x["pwhash"]) - for x in jvectors if x["mode"] == "raw"] + vectors = [ + ( + x["dgst_len"], + x["passwd"], + x["salt"], + x["iters"], + x["maxmem"], + x["pwhash"], + ) + for x in jvectors + if x["mode"] == "raw" + ] return vectors -def argon2id_modular_crypt_ref(): +def argon2id_modular_crypt_ref() -> List[Tuple[str, str]]: DATA = "modular_crypt_argon2id_hashes.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) jvectors = json.load(open(path)) - vectors = [(x["pwhash"], x["passwd"]) - for x in jvectors if (x["mode"] == "crypt" and - x["construct"] == "argon2id") - ] + vectors = [ + (x["pwhash"], x["passwd"]) + for x in jvectors + if (x["mode"] == "crypt" and x["construct"] == "argon2id") + ] return vectors -def argon2id_raw_ref(): +def argon2id_raw_ref() -> List[Tuple[int, str, str, int, int, str]]: DATA = "raw_argon2id_hashes.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) jvectors = json.load(open(path)) - vectors = [(x["dgst_len"], x["passwd"], x["salt"], x["iters"], - x["maxmem"], x["pwhash"]) - for x in jvectors if (x["mode"] == "raw" and - x["construct"] == "argon2id") - ] + vectors = [ + ( + x["dgst_len"], + x["passwd"], + x["salt"], + x["iters"], + x["maxmem"], + x["pwhash"], + ) + for x in jvectors + if (x["mode"] == "raw" and x["construct"] == "argon2id") + ] return vectors -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit", "expected"), [ @@ -95,62 +113,68 @@ b"ef537f25c895bfa782526529a9b63d97", 20000, (2 ** 20) * 100, - (b"\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98" - b"EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*") + ( + b"\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98" + b"EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*" + ), ), ], ) -def test_kdf_scryptsalsa208sha256(size, password, salt, - opslimit, memlimit, expected): - res = nacl.pwhash.kdf_scryptsalsa208sha256(size, password, salt, - opslimit, memlimit) +def test_kdf_scryptsalsa208sha256( + size: int, + password: bytes, + salt: bytes, + opslimit: int, + memlimit: int, + expected: bytes, +): + res = nacl.pwhash.kdf_scryptsalsa208sha256( + size, password, salt, opslimit, memlimit + ) assert res == expected -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scryptsalsa208sha256_random(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scryptsalsa208sha256_random(password: bytes): h1 = nacl.pwhash.scryptsalsa208sha256_str(password) h2 = nacl.pwhash.scryptsalsa208sha256_str(password) assert h1 != h2 -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scryptsalsa208sha256_verify(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scryptsalsa208sha256_verify(password: bytes): assert nacl.pwhash.verify_scryptsalsa208sha256( - nacl.pwhash.scryptsalsa208sha256_str(password), - password + nacl.pwhash.scryptsalsa208sha256_str(password), password ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scryptsalsa208sha256_verify_incorrect(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scryptsalsa208sha256_verify_incorrect(password: bytes): with pytest.raises(exc.InvalidkeyError): nacl.pwhash.verify_scryptsalsa208sha256( nacl.pwhash.scryptsalsa208sha256_str(password), - password.replace(b'dog', b'cat') + password.replace(b"dog", b"cat"), ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit"), [ @@ -159,36 +183,39 @@ b"The quick brown fox jumps over the lazy dog.", b"ef537f25c895bfa782526529a9", 20000, - (2 ** 20) * 100 + (2 ** 20) * 100, ), ], ) -def test_wrong_salt_length(size, password, salt, - opslimit, memlimit): +def test_wrong_salt_length( + size: int, password: bytes, salt: bytes, opslimit: int, memlimit: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.kdf_scryptsalsa208sha256(size, password, salt, - opslimit, memlimit) + nacl.pwhash.kdf_scryptsalsa208sha256( + size, password, salt, opslimit, memlimit + ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("passwd_hash", "password"), [ ( b"Too short (and wrong) hash", b"a password", - ), + ) ], ) -def test_wrong_hash_length(passwd_hash, password): +def test_wrong_hash_length(passwd_hash: bytes, password: bytes): with pytest.raises(exc.ValueError): - nacl.pwhash.verify_scryptsalsa208sha256(passwd_hash, - password) + nacl.pwhash.verify_scryptsalsa208sha256(passwd_hash, password) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit"), [ @@ -197,36 +224,39 @@ b"The quick brown fox jumps over the lazy dog.", b"ef537f25c895bfa782526529a9b6", 20000, - (2 ** 20) * 100 + (2 ** 20) * 100, ), ], ) -def test_kdf_wrong_salt_length(size, password, salt, - opslimit, memlimit): +def test_kdf_wrong_salt_length( + size: int, password: bytes, salt: bytes, opslimit: int, memlimit: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.kdf_scryptsalsa208sha256(size, password, salt, - opslimit, memlimit) + nacl.pwhash.kdf_scryptsalsa208sha256( + size, password, salt, opslimit, memlimit + ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("passwd_hash", "password"), [ ( b"Too short (and wrong) hash", b"another password", - ), + ) ], ) -def test_str_verify_wrong_hash_length(passwd_hash, password): +def test_str_verify_wrong_hash_length(passwd_hash: bytes, password: bytes): with pytest.raises(exc.ValueError): - nacl.pwhash.verify_scryptsalsa208sha256(passwd_hash, - password) + nacl.pwhash.verify_scryptsalsa208sha256(passwd_hash, password) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit", "expected"), [ @@ -236,62 +266,65 @@ b"ef537f25c895bfa782526529a9b63d97", 20000, (2 ** 20) * 100, - (b"\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98" - b"EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*") + ( + b"\x10e>\xc8A8\x11\xde\x07\xf1\x0f\x98" + b"EG\xe6}V]\xd4yN\xae\xd3P\x87yP\x1b\xc7+n*" + ), ), ], ) -def test_scrypt_kdf(size, password, salt, - opslimit, memlimit, expected): - res = nacl.pwhash.scrypt.kdf(size, password, salt, - opslimit, memlimit) +def test_scrypt_kdf( + size: int, + password: bytes, + salt: bytes, + opslimit: int, + memlimit: int, + expected: bytes, +): + res = nacl.pwhash.scrypt.kdf(size, password, salt, opslimit, memlimit) assert res == expected -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scrypt_random(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scrypt_random(password: bytes): h1 = nacl.pwhash.scrypt.str(password) h2 = nacl.pwhash.scrypt.str(password) assert h1 != h2 -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scrypt_verify(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scrypt_verify(password: bytes): assert nacl.pwhash.scrypt.verify( - nacl.pwhash.scrypt.str(password), - password + nacl.pwhash.scrypt.str(password), password ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("password", ), [ - ( - b"The quick brown fox jumps over the lazy dog.", - ), -]) -def test_scrypt_verify_incorrect(password): +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("password",), [(b"The quick brown fox jumps over the lazy dog.",)] +) +def test_scrypt_verify_incorrect(password: bytes): with pytest.raises(exc.InvalidkeyError): nacl.pwhash.scrypt.verify( - nacl.pwhash.scrypt.str(password), - password.replace(b'dog', b'cat') + nacl.pwhash.scrypt.str(password), password.replace(b"dog", b"cat") ) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit"), [ @@ -300,36 +333,37 @@ b"The quick brown fox jumps over the lazy dog.", b"ef537f25c895bfa782526529a9", 20000, - (2 ** 20) * 100 + (2 ** 20) * 100, ), ], ) -def test_wrong_scrypt_salt_length(size, password, salt, - opslimit, memlimit): +def test_wrong_scrypt_salt_length( + size: int, password: bytes, salt: bytes, opslimit: int, memlimit: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.scrypt.kdf(size, password, salt, - opslimit, memlimit) + nacl.pwhash.scrypt.kdf(size, password, salt, opslimit, memlimit) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("passwd_hash", "password"), [ ( b"Too short (and wrong) hash", b"a password", - ), + ) ], ) -def test_wrong_scrypt_hash_length(passwd_hash, password): +def test_wrong_scrypt_hash_length(passwd_hash: bytes, password: bytes): with pytest.raises(exc.ValueError): - nacl.pwhash.scrypt.verify(passwd_hash, - password) + nacl.pwhash.scrypt.verify(passwd_hash, password) -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("size", "password", "salt", "opslimit", "memlimit"), [ @@ -338,155 +372,125 @@ b"The quick brown fox jumps over the lazy dog.", b"ef537f25c895bfa782526529a9b6", 20000, - (2 ** 20) * 100 + (2 ** 20) * 100, ), ], ) -def test_scrypt_kdf_wrong_salt_length(size, password, salt, - opslimit, memlimit): +def test_scrypt_kdf_wrong_salt_length( + size: int, password: bytes, salt: bytes, opslimit: int, memlimit: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.scrypt.kdf(size, password, salt, - opslimit, memlimit) + nacl.pwhash.scrypt.kdf(size, password, salt, opslimit, memlimit) @pytest.mark.parametrize( ("opslimit", "memlimit", "n", "r", "p"), [ - ( - 32768, - 2 * (2 ** 20), - 10, - 8, - 1 - ), - ( - 32768, - 8 * (2 ** 10), - 3, - 8, - 128 - ), - ( - 65536, - (2 ** 20) * 2, - 11, - 8, - 1 - ), - ( - 262144, - (2 ** 20) * 2, - 11, - 8, - 4 - ), - ( - 2 * (2 ** 20), - 2 * (2 ** 20), - 11, - 8, - 32 - ), + (32768, 2 * (2 ** 20), 10, 8, 1), + (32768, 8 * (2 ** 10), 3, 8, 128), + (65536, (2 ** 20) * 2, 11, 8, 1), + (262144, (2 ** 20) * 2, 11, 8, 4), + (2 * (2 ** 20), 2 * (2 ** 20), 11, 8, 32), ], ) -def test_variable_limits(opslimit, memlimit, n, r, p): - rn, rr, rp = nacl.bindings.nacl_bindings_pick_scrypt_params(opslimit, - memlimit) +def test_variable_limits(opslimit: int, memlimit: int, n: int, r: int, p: int): + rn, rr, rp = nacl.bindings.nacl_bindings_pick_scrypt_params( + opslimit, memlimit + ) assert rn == n assert rr == r assert rp == p -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @pytest.mark.parametrize( ("passwd_hash", "password"), [ ( b"Too short (and wrong) hash", b"another password", - ), + ) ], ) -def test_scrypt_str_verify_wrong_hash_length(passwd_hash, password): +def test_scrypt_str_verify_wrong_hash_length( + passwd_hash: bytes, password: bytes +): with pytest.raises(exc.ValueError): - nacl.pwhash.scrypt.verify(passwd_hash, - password) + nacl.pwhash.scrypt.verify(passwd_hash, password) -@pytest.mark.parametrize(("password_hash", "password"), - argon2i_modular_crypt_ref() + - argon2id_modular_crypt_ref() - ) -def test_str_verify_argon2_ref(password_hash, password): - pw_hash = password_hash.encode('ascii') - pw = password.encode('ascii') +@pytest.mark.parametrize( + ("password_hash", "password"), + argon2i_modular_crypt_ref() + argon2id_modular_crypt_ref(), +) +def test_str_verify_argon2_ref(password_hash: str, password: str): + pw_hash = password_hash.encode("ascii") + pw = password.encode("ascii") res = nacl.pwhash.argon2id.verify(pw_hash, pw) assert res is True -@pytest.mark.parametrize(("password_hash", "password"), - argon2i_modular_crypt_ref() + - argon2id_modular_crypt_ref() - ) -def test_str_verify_argon2_ref_fail(password_hash, password): - pw_hash = password_hash.encode('ascii') - pw = ('a' + password).encode('ascii') +@pytest.mark.parametrize( + ("password_hash", "password"), + argon2i_modular_crypt_ref() + argon2id_modular_crypt_ref(), +) +def test_str_verify_argon2_ref_fail(password_hash: str, password: str): + pw_hash = password_hash.encode("ascii") + pw = ("a" + password).encode("ascii") with pytest.raises(exc.InvalidkeyError): nacl.pwhash.argon2id.verify(pw_hash, pw) -@given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), - integers(min_value=4, - max_value=6), - integers(min_value=1024 * 1024, - max_value=16 * 1024 * 1024) - ) +@given( + text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), + integers(min_value=4, max_value=6), + integers(min_value=1024 * 1024, max_value=16 * 1024 * 1024), +) @settings(deadline=None, max_examples=20) -def test_argon2i_str_and_verify(password, ops, mem): - _psw = password.encode('utf-8') +def test_argon2i_str_and_verify(password: str, ops: int, mem: int): + _psw = password.encode("utf-8") pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem) res = nacl.pwhash.argon2i.verify(pw_hash, _psw) assert res is True -@given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), - integers(min_value=1, - max_value=4), - integers(min_value=1024 * 1024, - max_value=16 * 1024 * 1024) - ) +@given( + text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), + integers(min_value=1, max_value=4), + integers(min_value=1024 * 1024, max_value=16 * 1024 * 1024), +) @settings(deadline=None, max_examples=20) -def test_argon2id_str_and_verify(password, ops, mem): - _psw = password.encode('utf-8') +def test_argon2id_str_and_verify(password: str, ops: int, mem: int): + _psw = password.encode("utf-8") pw_hash = nacl.pwhash.argon2id.str(_psw, opslimit=ops, memlimit=mem) res = nacl.pwhash.argon2id.verify(pw_hash, _psw) assert res is True -@given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), - integers(min_value=4, - max_value=6), - integers(min_value=1024 * 1024, - max_value=16 * 1024 * 1024) - ) +@given( + text(alphabet=PASSWD_CHARS, min_size=5, max_size=20), + integers(min_value=4, max_value=6), + integers(min_value=1024 * 1024, max_value=16 * 1024 * 1024), +) @settings(deadline=None, max_examples=20) -def test_argon2i_str_and_verify_fail(password, ops, mem): - _psw = password.encode('utf-8') +def test_argon2i_str_and_verify_fail(password: str, ops: int, mem: int): + _psw = password.encode("utf-8") pw_hash = nacl.pwhash.argon2i.str(_psw, opslimit=ops, memlimit=mem) with pytest.raises(exc.InvalidkeyError): - nacl.pwhash.argon2i.verify(pw_hash, b'A' + _psw) + nacl.pwhash.argon2i.verify(pw_hash, b"A" + _psw) @given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20)) @settings(deadline=None, max_examples=5) -def test_pwhash_str_and_verify(password): - _psw = password.encode('utf-8') +def test_pwhash_str_and_verify(password: str): + _psw = password.encode("utf-8") a2i_hash = nacl.pwhash.argon2i.str( _psw, opslimit=nacl.pwhash.argon2i.OPSLIMIT_INTERACTIVE, - memlimit=nacl.pwhash.argon2i.MEMLIMIT_INTERACTIVE + memlimit=nacl.pwhash.argon2i.MEMLIMIT_INTERACTIVE, ) a2i_res = nacl.pwhash.verify(a2i_hash, _psw) assert a2i_res is True @@ -494,59 +498,85 @@ a2id_hash = nacl.pwhash.argon2id.str( _psw, opslimit=nacl.pwhash.argon2id.OPSLIMIT_INTERACTIVE, - memlimit=nacl.pwhash.argon2id.MEMLIMIT_INTERACTIVE + memlimit=nacl.pwhash.argon2id.MEMLIMIT_INTERACTIVE, ) a2id_res = nacl.pwhash.verify(a2id_hash, _psw) assert a2id_res is True -@pytest.mark.skipif(not nacl.pwhash.scrypt.AVAILABLE, - reason="Requires full build of libsodium") +@pytest.mark.skipif( + not nacl.pwhash.scrypt.AVAILABLE, reason="Requires full build of libsodium" +) @given(text(alphabet=PASSWD_CHARS, min_size=5, max_size=20)) @settings(deadline=None, max_examples=5) -def test_pwhash_scrypt_str_and_verify(password): - _psw = password.encode('utf-8') +def test_pwhash_scrypt_str_and_verify(password: str): + _psw = password.encode("utf-8") scrypt_hash = nacl.pwhash.scrypt.str( _psw, opslimit=nacl.pwhash.scrypt.OPSLIMIT_INTERACTIVE, - memlimit=nacl.pwhash.scrypt.MEMLIMIT_INTERACTIVE + memlimit=nacl.pwhash.scrypt.MEMLIMIT_INTERACTIVE, ) scrypt_res = nacl.pwhash.verify(scrypt_hash, _psw) assert scrypt_res is True def test_invalid_modular_scrypt_prefix(): - psw = b'always invalid password' - invalid_modular_hash = b'$invalid_prefix$' + psw = b"always invalid password" + invalid_modular_hash = b"$invalid_prefix$" with pytest.raises(exc.InvalidkeyError): nacl.pwhash.verify(invalid_modular_hash, psw) def test_crypt_prefix_error(): - psw = b'always invalid password' - invalid_modular_hash = b'$invalid_prefix$' + psw = b"always invalid password" + invalid_modular_hash = b"$invalid_prefix$" with pytest.raises(exc.CryptPrefixError): nacl.pwhash.verify(invalid_modular_hash, psw) -@pytest.mark.parametrize(("dk_size", "password", "salt", - "iters", "mem_kb", "pwhash"), - argon2i_raw_ref()) -def test_argon2i_kdf(dk_size, password, salt, iters, mem_kb, pwhash): - dk = nacl.pwhash.argon2i.kdf(dk_size, password.encode('utf-8'), - salt.encode('utf-8'), iters, 1024 * mem_kb) +@pytest.mark.parametrize( + ("dk_size", "password", "salt", "iters", "mem_kb", "pwhash"), + argon2i_raw_ref(), +) +def test_argon2i_kdf( + dk_size: int, + password: str, + salt: str, + iters: int, + mem_kb: int, + pwhash: str, +): + dk = nacl.pwhash.argon2i.kdf( + dk_size, + password.encode("utf-8"), + salt.encode("utf-8"), + iters, + 1024 * mem_kb, + ) ref = binascii.unhexlify(pwhash) assert dk == ref -@pytest.mark.parametrize(("dk_size", "password", "salt", - "iters", "mem_kb", "pwhash"), - argon2id_raw_ref()) -def test_argon2_kdf_alg_argon2id(dk_size, password, salt, iters, mem_kb, - pwhash): - dk = nacl.pwhash.argon2id.kdf(dk_size, password.encode('utf-8'), - salt.encode('utf-8'), iters, 1024 * mem_kb) +@pytest.mark.parametrize( + ("dk_size", "password", "salt", "iters", "mem_kb", "pwhash"), + argon2id_raw_ref(), +) +def test_argon2_kdf_alg_argon2id( + dk_size: int, + password: str, + salt: str, + iters: int, + mem_kb: int, + pwhash: str, +): + dk = nacl.pwhash.argon2id.kdf( + dk_size, + password.encode("utf-8"), + salt.encode("utf-8"), + iters, + 1024 * mem_kb, + ) ref = binascii.unhexlify(pwhash) assert dk == ref @@ -569,40 +599,56 @@ @pytest.mark.parametrize( ("dk_size", "password", "salt", "iters", "mem_kb"), - raising_argon2_parameters + - [ + raising_argon2_parameters + + [ # too low iteration count: (20, "aPassword", 4 * "salt", 1, 256), - ] + ], ) -def test_argon2i_kdf_invalid_parms(dk_size, password, salt, iters, mem_kb): +def test_argon2i_kdf_invalid_parms( + dk_size: int, password: str, salt: str, iters: int, mem_kb: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.argon2i.kdf(dk_size, password.encode('utf-8'), - salt.encode('utf-8'), iters, 1024 * mem_kb) + nacl.pwhash.argon2i.kdf( + dk_size, + password.encode("utf-8"), + salt.encode("utf-8"), + iters, + 1024 * mem_kb, + ) @pytest.mark.parametrize( ("dk_size", "password", "salt", "iters", "mem_kb"), - raising_argon2_parameters + - [ + raising_argon2_parameters + + [ # too low iteration count: (20, "aPassword", 4 * "salt", 0, 256), - ] + ], ) -def test_argon2id_kdf_invalid_parms(dk_size, password, salt, iters, mem_kb): +def test_argon2id_kdf_invalid_parms( + dk_size: int, password: str, salt: str, iters: int, mem_kb: int +): with pytest.raises(exc.ValueError): - nacl.pwhash.argon2id.kdf(dk_size, password.encode('utf-8'), - salt.encode('utf-8'), iters, 1024 * mem_kb) + nacl.pwhash.argon2id.kdf( + dk_size, + password.encode("utf-8"), + salt.encode("utf-8"), + iters, + 1024 * mem_kb, + ) def test_check_limits_for_unknown_algorithm(): from nacl.bindings.crypto_pwhash import _check_argon2_limits_alg + with pytest.raises(exc.TypeError): _check_argon2_limits_alg(4, 1024, -1) -@pytest.mark.skipif(nacl.pwhash.scrypt.AVAILABLE, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + nacl.pwhash.scrypt.AVAILABLE, reason="Requires minimal build of libsodium" +) def test_scryptsalsa208sha256_unavailable(): empty = b"" @@ -614,8 +660,9 @@ nacl.pwhash.verify_scryptsalsa208sha256(empty, empty) -@pytest.mark.skipif(nacl.pwhash.scrypt.AVAILABLE, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + nacl.pwhash.scrypt.AVAILABLE, reason="Requires minimal build of libsodium" +) def test_scrypt_unavailable(): empty = b"" diff -Nru python-nacl-1.4.0/tests/test_sealed_box.py python-nacl-1.5.0/tests/test_sealed_box.py --- python-nacl-1.4.0/tests/test_sealed_box.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_sealed_box.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,36 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import binascii +from typing import List, Tuple import pytest -from utils import read_crypto_test_vectors - from nacl.encoding import HexEncoder from nacl.exceptions import CryptoError from nacl.public import PrivateKey, PublicKey, SealedBox +from .utils import check_type_error, read_crypto_test_vectors + -def sealbox_vectors(): +def sealbox_vectors() -> List[Tuple[bytes, bytes, bytes, bytes]]: # Fmt: : # <tab><cr_len>:<ciphertext>[<tab> ...] - def splitlen(x): - ln, dta = x.split(b':') + def splitlen(x: bytes) -> bytes: + ln, dta = x.split(b":") assert len(dta) == 2 * int(ln) return dta DATA = "sealed_box_ref.txt" - return [(x[0], - x[1], - splitlen(x[2]), - splitlen(x[3]) - ) - for x in read_crypto_test_vectors(DATA, - maxels=4, delimiter=b'\t')] + return [ + (x[0], x[1], splitlen(x[2]), splitlen(x[3])) + for x in read_crypto_test_vectors(DATA, maxels=4, delimiter=b"\t") + ] def test_generate_private_key(): @@ -62,16 +59,15 @@ @pytest.mark.parametrize( - ( - "privalice", "pubalice", "plaintext", "_encrypted" - ), - sealbox_vectors() + ("privalice", "pubalice", "plaintext", "_encrypted"), sealbox_vectors() ) -def test_sealed_box_encryption(privalice, pubalice, plaintext, _encrypted): - pubalice = PublicKey(pubalice, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) +def test_sealed_box_encryption( + privalice: bytes, pubalice: bytes, plaintext: bytes, _encrypted: bytes +): + pubalice_decoded = PublicKey(pubalice, encoder=HexEncoder) + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) - box = SealedBox(pubalice) + box = SealedBox(pubalice_decoded) encrypted = box.encrypt( binascii.unhexlify(plaintext), encoder=HexEncoder, @@ -80,7 +76,7 @@ assert encrypted != _encrypted # since SealedBox.encrypt uses an ephemeral sender's keypair - box2 = SealedBox(privalice) + box2 = SealedBox(privalice_decoded) decrypted = box2.decrypt( encrypted, encoder=HexEncoder, @@ -90,16 +86,14 @@ @pytest.mark.parametrize( - ( - "privalice", "pubalice", "plaintext", "encrypted" - ), - sealbox_vectors() + ("privalice", "_pubalice", "plaintext", "encrypted"), sealbox_vectors() ) -def test_sealed_box_decryption(privalice, pubalice, plaintext, encrypted): - pubalice = PublicKey(pubalice, encoder=HexEncoder) - privalice = PrivateKey(privalice, encoder=HexEncoder) +def test_sealed_box_decryption( + privalice: bytes, _pubalice: bytes, plaintext: bytes, encrypted: bytes +): + privalice_decoded = PrivateKey(privalice, encoder=HexEncoder) - box = SealedBox(privalice) + box = SealedBox(privalice_decoded) decrypted = box.decrypt( encrypted, encoder=HexEncoder, @@ -107,45 +101,44 @@ assert binascii.hexlify(decrypted) == plaintext -def check_type_error(expected, f, *args): - with pytest.raises(TypeError) as e: - f(*args) - assert expected in str(e.value) - - def test_wrong_types(): priv = PrivateKey.generate() - check_type_error(("SealedBox must be created from a PublicKey" - " or a PrivateKey"), - SealedBox, priv.encode()) - check_type_error(("SealedBox must be created from a PublicKey" - " or a PrivateKey"), - SealedBox, priv.public_key.encode()) + check_type_error( + ("SealedBox must be created from a PublicKey or a PrivateKey"), + SealedBox, + priv.encode(), + ) + check_type_error( + ("SealedBox must be created from a PublicKey or a PrivateKey"), + SealedBox, + priv.public_key.encode(), + ) with pytest.raises(TypeError): - SealedBox(priv, priv.public_key) + # Type safety: we want to check this error is detected at runtime. + SealedBox(priv, priv.public_key) # type: ignore[call-arg] @pytest.mark.parametrize( - ( - "_privalice", "pubalice", "_plaintext", "encrypted" - ), - sealbox_vectors() + ("_privalice", "pubalice", "_plaintext", "encrypted"), sealbox_vectors() ) -def test_sealed_box_public_key_cannot_decrypt(_privalice, pubalice, - _plaintext, encrypted): - pubalice = PublicKey(pubalice, encoder=HexEncoder) +def test_sealed_box_public_key_cannot_decrypt( + _privalice: bytes, pubalice: bytes, _plaintext: bytes, encrypted: bytes +): + pubalice_decoded = PublicKey(pubalice, encoder=HexEncoder) - box = SealedBox(pubalice) + box = SealedBox(pubalice_decoded) with pytest.raises(TypeError): - box.decrypt( + # Type safety: mypy spots that you can't decrypt with a public key, but we + # want to detect this at runtime too. + box.decrypt( # type: ignore[misc] encrypted, encoder=HexEncoder, ) def test_sealed_box_zero_length_plaintext(): - empty_plaintext = b'' + empty_plaintext = b"" k = PrivateKey.generate() enc_box = SealedBox(k.public_key) dec_box = SealedBox(k) @@ -157,7 +150,7 @@ def test_sealed_box_too_short_msg(): - empty_plaintext = b'' + empty_plaintext = b"" k = PrivateKey.generate() enc_box = SealedBox(k.public_key) dec_box = SealedBox(k) diff -Nru python-nacl-1.4.0/tests/test_secret.py python-nacl-1.5.0/tests/test_secret.py --- python-nacl-1.4.0/tests/test_secret.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_secret.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,17 +12,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import binascii +import re +from typing import Dict, Type, TypeVar -import pytest +from hypothesis import given, strategies as st -from utils import flip_byte +import pytest from nacl.encoding import HexEncoder from nacl.exceptions import CryptoError -from nacl.secret import SecretBox +from nacl.secret import Aead, SecretBox + +from .test_aead import xchacha20poly1305_ietf_vectors +from .utils import flip_byte VECTORS = [ @@ -30,36 +34,86 @@ ( b"1b27556473e985d462cd51197a9a46c76009549eac6474f206c4ee0844f68389", b"69696ee955b62b73cd62bda875fc73d68219e0036b7a0b37", - (b"be075fc53c81f2d5cf141316ebeb0c7b5228c52a4c62cbd44b66849b64244ffce5e" - b"cbaaf33bd751a1ac728d45e6c61296cdc3c01233561f41db66cce314adb310e3be8" - b"250c46f06dceea3a7fa1348057e2f6556ad6b1318a024a838f21af1fde048977eb4" - b"8f59ffd4924ca1c60902e52f0a089bc76897040e082f937763848645e0705"), - (b"f3ffc7703f9400e52a7dfb4b3d3305d98e993b9f48681273c29650ba32fc76ce483" - b"32ea7164d96a4476fb8c531a1186ac0dfc17c98dce87b4da7f011ec48c97271d2c2" - b"0f9b928fe2270d6fb863d51738b48eeee314a7cc8ab932164548e526ae902243685" - b"17acfeabd6bb3732bc0e9da99832b61ca01b6de56244a9e88d5f9b37973f622a43d" - b"14a6599b1f654cb45a74e355a5"), + ( + b"be075fc53c81f2d5cf141316ebeb0c7b5228c52a4c62cbd44b66849b64244ffce5e" + b"cbaaf33bd751a1ac728d45e6c61296cdc3c01233561f41db66cce314adb310e3be8" + b"250c46f06dceea3a7fa1348057e2f6556ad6b1318a024a838f21af1fde048977eb4" + b"8f59ffd4924ca1c60902e52f0a089bc76897040e082f937763848645e0705" + ), + ( + b"f3ffc7703f9400e52a7dfb4b3d3305d98e993b9f48681273c29650ba32fc76ce483" + b"32ea7164d96a4476fb8c531a1186ac0dfc17c98dce87b4da7f011ec48c97271d2c2" + b"0f9b928fe2270d6fb863d51738b48eeee314a7cc8ab932164548e526ae902243685" + b"17acfeabd6bb3732bc0e9da99832b61ca01b6de56244a9e88d5f9b37973f622a43d" + b"14a6599b1f654cb45a74e355a5" + ), ), ] +_BoxType = TypeVar("_BoxType", Aead, SecretBox) -def test_secret_box_creation(): - SecretBox( - b"ec2bee2d5be613ca82e377c96a0bf2220d823ce980cdff6279473edc52862798", - encoder=HexEncoder, +def hex_keys(m: Type[_BoxType]) -> st.SearchStrategy[bytes]: + return st.binary(min_size=m.KEY_SIZE, max_size=m.KEY_SIZE).map( + binascii.hexlify ) -def test_secret_box_bytes(): - s = SecretBox( - b"ec2bee2d5be613ca82e377c96a0bf2220d823ce980cdff6279473edc52862798", - encoder=HexEncoder, - ) - assert bytes(s) == s._key +def boxes(m: Type[_BoxType]) -> st.SearchStrategy[_BoxType]: + return st.binary(min_size=m.KEY_SIZE, max_size=m.KEY_SIZE).map(m) + + +@given(k=hex_keys(Aead)) +def test_aead_creation(k: bytes): + Aead(k, encoder=HexEncoder) + + +@given(k=hex_keys(Aead)) +def test_aead_bytes(k: bytes): + s = Aead(k, encoder=HexEncoder) + assert bytes(s) == s._key == binascii.unhexlify(k) + + +@given(box=boxes(Aead), plaintext=st.binary(), aad=st.binary()) +def test_aead_roundtrip(box: Aead, plaintext: bytes, aad: bytes): + assert plaintext == box.decrypt(box.encrypt(plaintext, aad), aad) + +@given(k=hex_keys(SecretBox)) +def test_secret_box_creation(k: bytes): + SecretBox(k, encoder=HexEncoder) -@pytest.mark.parametrize(("key", "nonce", "plaintext", "ciphertext"), VECTORS) -def test_secret_box_encryption(key, nonce, plaintext, ciphertext): + +@given(k=hex_keys(SecretBox)) +def test_secret_box_bytes(k: bytes): + s = SecretBox(k, encoder=HexEncoder) + assert bytes(s) == s._key == binascii.unhexlify(k) + + +AEAD_VECTORS = [ + {k: binascii.unhexlify(v) for (k, v) in d.items() if k != "AEAD"} + for d in xchacha20poly1305_ietf_vectors() +] + + +@pytest.mark.parametrize("kv", AEAD_VECTORS, ids=range(len(AEAD_VECTORS))) +def test_aead_vectors(kv: Dict[str, bytes]): + box = Aead(kv["KEY"]) + combined = kv["CT"] + kv["TAG"] + aad, nonce, plaintext = kv["AD"], kv["NONCE"], kv["IN"] + + assert box.encrypt(plaintext, aad, nonce) == nonce + combined + assert box.decrypt(combined, aad, nonce) == plaintext + assert box.decrypt(nonce + combined, aad) == plaintext + + +@pytest.mark.parametrize( + ("key", "nonce", "plaintext", "ciphertext"), + VECTORS, + ids=range(len(VECTORS)), +) +def test_secret_box_encryption( + key: bytes, nonce: bytes, plaintext: bytes, ciphertext: bytes +): box = SecretBox(key, encoder=HexEncoder) encrypted = box.encrypt( binascii.unhexlify(plaintext), @@ -76,8 +130,14 @@ assert encrypted.ciphertext == ciphertext -@pytest.mark.parametrize(("key", "nonce", "plaintext", "ciphertext"), VECTORS) -def test_secret_box_decryption(key, nonce, plaintext, ciphertext): +@pytest.mark.parametrize( + ("key", "nonce", "plaintext", "ciphertext"), + VECTORS, + ids=range(len(VECTORS)), +) +def test_secret_box_decryption( + key: bytes, nonce: bytes, plaintext: bytes, ciphertext: bytes +): box = SecretBox(key, encoder=HexEncoder) nonce = binascii.unhexlify(nonce) @@ -88,8 +148,14 @@ assert decrypted == plaintext -@pytest.mark.parametrize(("key", "nonce", "plaintext", "ciphertext"), VECTORS) -def test_secret_box_decryption_combined(key, nonce, plaintext, ciphertext): +@pytest.mark.parametrize( + ("key", "nonce", "plaintext", "ciphertext"), + VECTORS, + ids=range(len(VECTORS)), +) +def test_secret_box_decryption_combined( + key: bytes, nonce: bytes, plaintext: bytes, ciphertext: bytes +): box = SecretBox(key, encoder=HexEncoder) combined = binascii.hexlify( @@ -100,8 +166,14 @@ assert decrypted == plaintext -@pytest.mark.parametrize(("key", "nonce", "plaintext", "ciphertext"), VECTORS) -def test_secret_box_optional_nonce(key, nonce, plaintext, ciphertext): +@pytest.mark.parametrize( + ("key", "nonce", "plaintext", "ciphertext"), + VECTORS, + ids=range(len(VECTORS)), +) +def test_secret_box_optional_nonce( + key: bytes, nonce: bytes, plaintext: bytes, ciphertext: bytes +): box = SecretBox(key, encoder=HexEncoder) encrypted = box.encrypt(binascii.unhexlify(plaintext), encoder=HexEncoder) @@ -111,47 +183,110 @@ assert decrypted == plaintext -@pytest.mark.parametrize(("key", "nonce", "plaintext", "ciphertext"), VECTORS) +@pytest.mark.parametrize( + ("key", "nonce", "plaintext", "ciphertext"), + VECTORS, + ids=range(len(VECTORS)), +) def test_secret_box_encryption_generates_different_nonces( - key, nonce, plaintext, ciphertext): + key: bytes, nonce: bytes, plaintext: bytes, ciphertext: bytes +): box = SecretBox(key, encoder=HexEncoder) - nonce_0 = box.encrypt(binascii.unhexlify(plaintext), - encoder=HexEncoder).nonce - - nonce_1 = box.encrypt(binascii.unhexlify(plaintext), - encoder=HexEncoder).nonce + nonce_0 = box.encrypt( + binascii.unhexlify(plaintext), encoder=HexEncoder + ).nonce + + nonce_1 = box.encrypt( + binascii.unhexlify(plaintext), encoder=HexEncoder + ).nonce assert nonce_0 != nonce_1 -def test_secret_box_wrong_lengths(): - with pytest.raises(ValueError): - SecretBox(b"") - - box = SecretBox( - b"ec2bee2d5be613ca82e377c96a0bf2220d823ce980cdff6279473edc52862798", - encoder=HexEncoder, - ) - with pytest.raises(ValueError): - box.encrypt(b"", b"") - with pytest.raises(ValueError): - box.decrypt(b"", b"") +def wrong_length(length: int) -> st.SearchStrategy[bytes]: + return st.binary().filter(lambda s: len(s) != length) -def check_type_error(expected, f, *args): - with pytest.raises(TypeError) as e: - f(*args) - assert expected in str(e.value) - +@given(key=wrong_length(Aead.KEY_SIZE)) +def test_aead_wrong_key_length(key: bytes): + with pytest.raises( + ValueError, match=r"key must be exactly \d+ bytes long" + ): + Aead(key) + + +@given(box=boxes(Aead), nonce=wrong_length(Aead.NONCE_SIZE)) +def test_aead_wrong_nonce_length(box: Aead, nonce: bytes): + with pytest.raises( + ValueError, match=r"nonce must be exactly \d+ bytes long" + ): + box.encrypt(b"", aad=b"", nonce=nonce) + with pytest.raises( + ValueError, match=r"nonce must be exactly \d+ bytes long" + ): + box.decrypt(b"", aad=b"", nonce=nonce) + + +@given(key=wrong_length(SecretBox.KEY_SIZE)) +def test_secret_box_wrong_key_length(key: bytes): + with pytest.raises( + ValueError, match=r"key must be exactly \d+ bytes long" + ): + SecretBox(key) + + +@given(box=boxes(SecretBox), nonce=wrong_length(SecretBox.NONCE_SIZE)) +def test_secret_box_wrong_nonce_length(box: SecretBox, nonce: bytes): + with pytest.raises( + ValueError, match=r"nonce must be exactly \d+ bytes long" + ): + box.encrypt(b"", nonce) + with pytest.raises( + ValueError, match=r"nonce must be exactly \d+ bytes long" + ): + box.decrypt(b"", nonce) + + +@pytest.mark.parametrize("cls", (SecretBox, Aead)) +def test_wrong_types(cls: Type[_BoxType]): + expected = re.compile( + cls.__name__ + " must be created from 32 bytes", re.IGNORECASE + ) + # Type saftey: we're checking these type errors are detected at runtime. + with pytest.raises(TypeError, match=expected): + cls(12) # type: ignore[arg-type] -def test_wrong_types(): box = SecretBox(b"11" * 32, encoder=HexEncoder) + with pytest.raises(TypeError, match=expected): + cls(box) # type: ignore[arg-type] + - check_type_error("SecretBox must be created from 32 bytes", - SecretBox, 12) - check_type_error("SecretBox must be created from 32 bytes", - SecretBox, box) +def test_aead_bad_decryption(): + box = Aead(b"\x11" * Aead.KEY_SIZE) + aad = b"some data" + ciphertext = box.encrypt(b"hello") + + with pytest.raises(CryptoError): + # changes the nonce + box.decrypt(flip_byte(ciphertext, 0), aad) + with pytest.raises(CryptoError): + # changes ciphertext + box.decrypt(flip_byte(ciphertext, 24), aad) + with pytest.raises(CryptoError): + # changes MAC tag + box.decrypt(flip_byte(ciphertext, len(ciphertext) - 1), aad) + + with pytest.raises(CryptoError): + # completely changes ciphertext and tag + box.decrypt(ciphertext + b"\x00", aad) + with pytest.raises(CryptoError): + # completely changes everything + box.decrypt(b"\x00" + ciphertext, aad) + + with pytest.raises(CryptoError): + # changes the AAD + box.decrypt(ciphertext, flip_byte(aad, 0)) def test_secret_box_bad_decryption(): diff -Nru python-nacl-1.4.0/tests/test_secretstream.py python-nacl-1.5.0/tests/test_secretstream.py --- python-nacl-1.4.0/tests/test_secretstream.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_secretstream.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function - import binascii import json import os import random +from typing import ByteString, List, Optional, Tuple -import pytest +from _pytest._code import ExceptionInfo +from _pytest.monkeypatch import MonkeyPatch -import six +import pytest from nacl._sodium import ffi from nacl.bindings.crypto_secretstream import ( @@ -43,42 +43,45 @@ ) from nacl.utils import random as randombytes +Chunk = Tuple[int, Optional[bytes], bytes, bytes] -def read_secretstream_vectors(): + +def read_secretstream_vectors() -> List[Tuple[bytes, bytes, List[Chunk]]]: DATA = "secretstream-test-vectors.json" path = os.path.join(os.path.dirname(__file__), "data", DATA) - with open(path, 'r') as fp: + with open(path) as fp: jvectors = json.load(fp) unhex = binascii.unhexlify vectors = [ - [ - unhex(v['key']), - unhex(v['header']), + ( + unhex(v["key"]), + unhex(v["header"]), [ - [ - c['tag'], - unhex(c['ad']) if c['ad'] is not None else None, - unhex(c['message']), - unhex(c['ciphertext']), - ] - for c in v['chunks'] + ( + c["tag"], + unhex(c["ad"]) if c["ad"] is not None else None, + unhex(c["message"]), + unhex(c["ciphertext"]), + ) + for c in v["chunks"] ], - ] + ) for v in jvectors ] return vectors @pytest.mark.parametrize( - ('key', 'header', 'chunks'), + ("key", "header", "chunks"), read_secretstream_vectors(), ) -def test_vectors(key, header, chunks): +def test_vectors(key: bytes, header: bytes, chunks: List[Chunk]): state = crypto_secretstream_xchacha20poly1305_state() crypto_secretstream_xchacha20poly1305_init_pull(state, header, key) for tag, ad, message, ciphertext in chunks: m, t = crypto_secretstream_xchacha20poly1305_pull( - state, ciphertext, ad) + state, ciphertext, ad + ) assert m == message assert t == tag @@ -104,8 +107,9 @@ # push - assert len(state.statebuf) == \ - crypto_secretstream_xchacha20poly1305_STATEBYTES + assert ( + len(state.statebuf) == crypto_secretstream_xchacha20poly1305_STATEBYTES + ) header = crypto_secretstream_xchacha20poly1305_init_push(state, k) assert len(header) == crypto_secretstream_xchacha20poly1305_HEADERBYTES @@ -116,7 +120,8 @@ assert len(c2) == m2_len + crypto_secretstream_xchacha20poly1305_ABYTES c3 = crypto_secretstream_xchacha20poly1305_push( - state, m3, ad=ad, tag=crypto_secretstream_xchacha20poly1305_TAG_FINAL) + state, m3, ad=ad, tag=crypto_secretstream_xchacha20poly1305_TAG_FINAL + ) assert len(c3) == m3_len + crypto_secretstream_xchacha20poly1305_ABYTES # pull @@ -131,9 +136,14 @@ assert tag == crypto_secretstream_xchacha20poly1305_TAG_MESSAGE assert m2 == m2_ + # Mark this as taking a generic Exception, or else mypy will later complain + # that we can't write an ExceptionInfo[ValueError] value to an expression of type + # ExceptionInfo[RuntimeError]. + excinfo: ExceptionInfo[Exception] + with pytest.raises(RuntimeError) as excinfo: crypto_secretstream_xchacha20poly1305_pull(state, c3) - assert str(excinfo.value) == 'Unexpected failure' + assert str(excinfo.value) == "Unexpected failure" m3, tag = crypto_secretstream_xchacha20poly1305_pull(state, c3, ad) assert tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL assert m3 == m3_ @@ -142,36 +152,35 @@ with pytest.raises(RuntimeError) as excinfo: crypto_secretstream_xchacha20poly1305_pull(state, c3, ad) - assert str(excinfo.value) == 'Unexpected failure' + assert str(excinfo.value) == "Unexpected failure" # previous without a tag with pytest.raises(RuntimeError) as excinfo: crypto_secretstream_xchacha20poly1305_pull(state, c2, None) - assert str(excinfo.value) == 'Unexpected failure' + assert str(excinfo.value) == "Unexpected failure" # short ciphertext with pytest.raises(ValueError) as excinfo: c2len = random.randint( - 1, - crypto_secretstream_xchacha20poly1305_ABYTES - 1 + 1, crypto_secretstream_xchacha20poly1305_ABYTES - 1 ) crypto_secretstream_xchacha20poly1305_pull(state, c2[:c2len]) - assert str(excinfo.value) == 'Ciphertext is too short' + assert str(excinfo.value) == "Ciphertext is too short" with pytest.raises(ValueError) as excinfo: - crypto_secretstream_xchacha20poly1305_pull(state, b'') - assert str(excinfo.value) == 'Ciphertext is too short' + crypto_secretstream_xchacha20poly1305_pull(state, b"") + assert str(excinfo.value) == "Ciphertext is too short" # empty ciphertext with pytest.raises(ValueError) as excinfo: crypto_secretstream_xchacha20poly1305_pull( state, - c2[:crypto_secretstream_xchacha20poly1305_ABYTES - 1], + c2[: crypto_secretstream_xchacha20poly1305_ABYTES - 1], None, ) - assert str(excinfo.value) == 'Ciphertext is too short' + assert str(excinfo.value) == "Ciphertext is too short" # without explicit rekeying @@ -210,10 +219,11 @@ header = crypto_secretstream_xchacha20poly1305_init_push(state, k) - state_save = ffi.buffer(state.statebuf)[:] + state_save: ByteString = ffi.buffer(state.statebuf)[:] c1 = crypto_secretstream_xchacha20poly1305_push( - state, m1, tag=crypto_secretstream_xchacha20poly1305_TAG_REKEY) + state, m1, tag=crypto_secretstream_xchacha20poly1305_TAG_REKEY + ) c2 = crypto_secretstream_xchacha20poly1305_push(state, m2) @@ -231,7 +241,11 @@ # avoid using from_buffer until at least cffi >= 1.10 in setup.py # state = ffi.from_buffer(state_save) for i in range(crypto_secretstream_xchacha20poly1305_STATEBYTES): - state.statebuf[i] = six.indexbytes(state_save, i) + # Type safety: we can't write to a `ByteString` (≈ `Sequence[int]`). It's really + # a CFFI `cdata` object which owns an `unsigned char[]` (which we can write to). + # This is the only place we mutate `state_buf` in place across the project, + # and we don't expect end-users to do this. + state.statebuf[i] = state_save[i] # type: ignore[index] c1 = crypto_secretstream_xchacha20poly1305_push(state, m1) @@ -243,26 +257,28 @@ header = crypto_secretstream_xchacha20poly1305_init_push(state, k) c1 = crypto_secretstream_xchacha20poly1305_push( - state, m1, tag=crypto_secretstream_xchacha20poly1305_TAG_PUSH) + state, m1, tag=crypto_secretstream_xchacha20poly1305_TAG_PUSH + ) assert len(c1) == m1_len + crypto_secretstream_xchacha20poly1305_ABYTES # snip tests that require introspection into the state buffer # to test the nonce as we're using an opaque pointer -def test_max_message_size(monkeypatch): +def test_max_message_size(monkeypatch: MonkeyPatch): import nacl.bindings.crypto_secretstream as css + # we want to create an oversized message but don't want to blow out # memory so knock it down a bit for this test monkeypatch.setattr( css, - 'crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX', - 2**10 - 1, + "crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX", + 2 ** 10 - 1, ) - m = b'0' * (css.crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX + 1) + m = b"0" * (css.crypto_secretstream_xchacha20poly1305_MESSAGEBYTES_MAX + 1) k = crypto_secretstream_xchacha20poly1305_keygen() state = crypto_secretstream_xchacha20poly1305_state() crypto_secretstream_xchacha20poly1305_init_push(state, k) with pytest.raises(ValueError) as excinfo: crypto_secretstream_xchacha20poly1305_push(state, m, None, 0) - assert str(excinfo.value) == 'Message is too long' + assert str(excinfo.value) == "Message is too long" diff -Nru python-nacl-1.4.0/tests/test_shorthash.py python-nacl-1.5.0/tests/test_shorthash.py --- python-nacl-1.4.0/tests/test_shorthash.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_shorthash.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function from binascii import hexlify +from typing import List, Tuple import pytest @@ -85,7 +85,7 @@ b"\xe1\x91\x5f\x5c\xb1\xec\xa4\x6c", b"\xf3\x25\x96\x5c\xa1\x6d\x62\x9f", b"\x57\x5f\xf2\x8e\x60\x38\x1b\xe5", - b"\x72\x45\x06\xeb\x4c\x32\x8a\x95" + b"\x72\x45\x06\xeb\x4c\x32\x8a\x95", ] MESG = ( @@ -99,10 +99,7 @@ b"\x38\x39\x3a\x3b\x3c\x3d\x3e" ) -KEY = ( - b"\x00\x01\x02\x03\x04\x05\x06\x07" - b"\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" -) +KEY = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f" XHASHES = [ b"a3817f04ba25a8e66df67214c7550293", @@ -168,11 +165,11 @@ b"e3040c00eb28f15366ca73cbd872e740", b"7697009a6a831dfecca91c5993670f7a", b"5853542321f567a005d547a4f04759bd", - b"5150d1772f50834a503e069a973fbd7c" + b"5150d1772f50834a503e069a973fbd7c", ] -def sip24_vectors(): +def sip24_vectors() -> List[Tuple[bytes, bytes, bytes]]: """Generate test vectors using data from the reference implementation's test defined in https://github.com/veorq/SipHash/blob/master/main.c @@ -186,7 +183,7 @@ return vectors -def sipx24_vectors(): +def sipx24_vectors() -> List[Tuple[bytes, bytes, bytes]]: """Generate test vectors using data from libsodium's tests""" vectors = [] for i, expected in enumerate(XHASHES): @@ -195,52 +192,45 @@ return vectors -@pytest.mark.parametrize(("inp", "key", "expected"), - sip24_vectors() - ) -def test_siphash24(inp, key, expected): +@pytest.mark.parametrize(("inp", "key", "expected"), sip24_vectors()) +def test_siphash24(inp: bytes, key: bytes, expected: bytes): rs = siphash24(inp, key) assert rs == hexlify(expected) -@pytest.mark.skipif(not SIPHASHX_AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("inp", "key", "expected"), - sipx24_vectors() - ) -def test_siphashx24(inp, key, expected): +@pytest.mark.skipif( + not SIPHASHX_AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize(("inp", "key", "expected"), sipx24_vectors()) +def test_siphashx24(inp: bytes, key: bytes, expected: bytes): rs = siphashx24(inp, key) assert rs == expected -@pytest.mark.parametrize(("inp", "key", "expected"), [ - ( - b'\00', - b'\x00\x01\x02\x03\x04\x05\x06\x07', - b'' - ) -]) -def test_siphash24_shortened_key(inp, key, expected): +@pytest.mark.parametrize( + ("inp", "key", "expected"), + [(b"\00", b"\x00\x01\x02\x03\x04\x05\x06\x07", b"")], +) +def test_siphash24_shortened_key(inp: bytes, key: bytes, expected: bytes): with pytest.raises(ValueError): siphash24(inp, key) -@pytest.mark.skipif(not SIPHASHX_AVAILABLE, - reason="Requires full build of libsodium") -@pytest.mark.parametrize(("inp", "key", "expected"), [ - ( - b'\00', - b'\x00\x01\x02\x03\x04\x05\x06\x07', - b'' - ) -]) -def test_siphashx24_shortened_key(inp, key, expected): +@pytest.mark.skipif( + not SIPHASHX_AVAILABLE, reason="Requires full build of libsodium" +) +@pytest.mark.parametrize( + ("inp", "key", "expected"), + [(b"\00", b"\x00\x01\x02\x03\x04\x05\x06\x07", b"")], +) +def test_siphashx24_shortened_key(inp: bytes, key: bytes, expected: bytes): with pytest.raises(ValueError): siphashx24(inp, key) -@pytest.mark.skipif(SIPHASHX_AVAILABLE, - reason="Requires minimal build of libsodium") +@pytest.mark.skipif( + SIPHASHX_AVAILABLE, reason="Requires minimal build of libsodium" +) def test_siphashx24_unavailable(): with pytest.raises(UnavailableError): - siphashx24(b'', b'') + siphashx24(b"", b"") diff -Nru python-nacl-1.4.0/tests/test_signing.py python-nacl-1.5.0/tests/test_signing.py --- python-nacl-1.4.0/tests/test_signing.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_signing.py 2022-01-07 21:54:10.000000000 +0000 @@ -11,38 +11,44 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from __future__ import absolute_import, division, print_function - import binascii +from typing import List, Tuple, Union import pytest -from utils import assert_equal, assert_not_equal, read_crypto_test_vectors - from nacl.bindings import crypto_sign_PUBLICKEYBYTES, crypto_sign_SEEDBYTES from nacl.encoding import Base64Encoder, HexEncoder from nacl.exceptions import BadSignatureError from nacl.signing import SignedMessage, SigningKey, VerifyKey +from .utils import ( + assert_equal, + assert_not_equal, + check_type_error, + read_crypto_test_vectors, +) -def tohex(b): - return binascii.hexlify(b).decode('ascii') +def tohex(b: bytes) -> str: + return binascii.hexlify(b).decode("ascii") -def ed25519_known_answers(): + +def ed25519_known_answers() -> List[Tuple[bytes, bytes, bytes, bytes, bytes]]: # Known answers taken from: http://ed25519.cr.yp.to/python/sign.input # hex-encoded fields on each input line: sk||pk, pk, msg, signature||msg # known answer fields: sk, pk, msg, signature, signed DATA = "ed25519" - lines = read_crypto_test_vectors(DATA, delimiter=b':') - return [(x[0][:64], # secret key - x[1], # public key - x[2], # message - x[3][:128], # signature - x[3], # signed message - ) - for x in lines] + lines = read_crypto_test_vectors(DATA, delimiter=b":") + return [ + ( + x[0][:64], # secret key + x[1], # public key + x[2], # message + x[3][:128], # signature + x[3], # signed message + ) + for x in lines + ] class TestSigningKey: @@ -69,27 +75,37 @@ assert hash(k1) == hash(k2) assert id(k1) != id(k2) - @pytest.mark.parametrize('k2', [ - b"\x00" * crypto_sign_SEEDBYTES, - SigningKey(b"\x01" * crypto_sign_SEEDBYTES), - SigningKey(b"\x00" * (crypto_sign_SEEDBYTES - 1) + b"\x01"), - ]) - def test_different_keys_are_not_equal(self, k2): + @pytest.mark.parametrize( + "k2", + [ + b"\x00" * crypto_sign_SEEDBYTES, + SigningKey(b"\x01" * crypto_sign_SEEDBYTES), + SigningKey(b"\x00" * (crypto_sign_SEEDBYTES - 1) + b"\x01"), + ], + ) + def test_different_keys_are_not_equal(self, k2: Union[bytes, SigningKey]): k1 = SigningKey(b"\x00" * crypto_sign_SEEDBYTES) assert_not_equal(k1, k2) - @pytest.mark.parametrize("seed", [ - b"77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a", - ]) - def test_initialization_with_seed(self, seed): + @pytest.mark.parametrize( + "seed", + [b"77076d0a7318a57d3c16c17251b26645df4c2f87ebc0992ab177fba51db92c2a"], + ) + def test_initialization_with_seed(self, seed: bytes): SigningKey(seed, encoder=HexEncoder) @pytest.mark.parametrize( ("seed", "_public_key", "message", "signature", "expected"), - ed25519_known_answers() + ed25519_known_answers(), ) - def test_message_signing(self, seed, _public_key, - message, signature, expected): + def test_message_signing( + self, + seed: bytes, + _public_key: bytes, + message: bytes, + signature: bytes, + expected: bytes, + ): signing_key = SigningKey( seed, encoder=HexEncoder, @@ -125,33 +141,49 @@ assert hash(k1) == hash(k2) assert id(k1) != id(k2) - @pytest.mark.parametrize('k2', [ - b"\x00" * crypto_sign_PUBLICKEYBYTES, - VerifyKey(b"\x01" * crypto_sign_PUBLICKEYBYTES), - VerifyKey(b"\x00" * (crypto_sign_PUBLICKEYBYTES - 1) + b"\x01"), - ]) - def test_different_keys_are_not_equal(self, k2): + @pytest.mark.parametrize( + "k2", + [ + b"\x00" * crypto_sign_PUBLICKEYBYTES, + VerifyKey(b"\x01" * crypto_sign_PUBLICKEYBYTES), + VerifyKey(b"\x00" * (crypto_sign_PUBLICKEYBYTES - 1) + b"\x01"), + ], + ) + def test_different_keys_are_not_equal(self, k2: Union[bytes, VerifyKey]): k1 = VerifyKey(b"\x00" * crypto_sign_PUBLICKEYBYTES) assert_not_equal(k1, k2) @pytest.mark.parametrize( ("_seed", "public_key", "message", "signature", "signed"), - ed25519_known_answers() + ed25519_known_answers(), ) def test_valid_signed_message( - self, _seed, public_key, message, signature, signed): + self, + _seed: bytes, + public_key: bytes, + message: bytes, + signature: bytes, + signed: bytes, + ): key = VerifyKey( public_key, encoder=HexEncoder, ) - assert binascii.hexlify( - key.verify(signed, encoder=HexEncoder), - ) == message - assert binascii.hexlify( - key.verify(message, HexEncoder.decode(signature), - encoder=HexEncoder), - ) == message + assert ( + binascii.hexlify( + key.verify(signed, encoder=HexEncoder), + ) + == message + ) + assert ( + binascii.hexlify( + key.verify( + message, HexEncoder.decode(signature), encoder=HexEncoder + ), + ) + == message + ) def test_invalid_signed_message(self): skey = SigningKey.generate() @@ -168,6 +200,24 @@ forged = SignedMessage(signature + message) skey.verify_key.verify(forged) + def test_invalid_signature_length(self): + skey = SigningKey.generate() + message = b"hello" + signature = skey.sign(message).signature + + # Sanity checks + assert skey.verify_key.verify(message, signature) + assert skey.verify_key.verify(signature + message) + + with pytest.raises(ValueError): + skey.verify_key.verify(message, b"") + + with pytest.raises(ValueError): + skey.verify_key.verify(message, signature * 2) + + with pytest.raises(ValueError): + skey.verify_key.verify(signature + message, b"") + def test_base64_smessage_with_detached_sig_matches_with_attached_sig(self): sk = SigningKey.generate() vk = sk.verify_key @@ -179,8 +229,9 @@ sig = Base64Encoder.decode(b64sig) - assert vk.verify(msg, sig, encoder=Base64Encoder) == \ - vk.verify(smsg, encoder=Base64Encoder) + assert vk.verify(msg, sig, encoder=Base64Encoder) == vk.verify( + smsg, encoder=Base64Encoder + ) assert Base64Encoder.decode(msg) == b"Hello World in base64" @@ -195,46 +246,70 @@ sig = HexEncoder.decode(hexsig) - assert vk.verify(msg, sig, encoder=HexEncoder) == \ - vk.verify(smsg, encoder=HexEncoder) + assert vk.verify(msg, sig, encoder=HexEncoder) == vk.verify( + smsg, encoder=HexEncoder + ) assert HexEncoder.decode(msg) == b"Hello World in hex" def test_key_conversion(self): - keypair_seed = (b"421151a459faeade3d247115f94aedae" - b"42318124095afabe4d1451a559faedee") + keypair_seed = ( + b"421151a459faeade3d247115f94aedae" + b"42318124095afabe4d1451a559faedee" + ) signing_key = SigningKey(binascii.unhexlify(keypair_seed)) verify_key = signing_key.verify_key private_key = bytes(signing_key.to_curve25519_private_key()) public_key = bytes(verify_key.to_curve25519_public_key()) - assert tohex(private_key) == ("8052030376d47112be7f73ed7a019293" - "dd12ad910b654455798b4667d73de166") - - assert tohex(public_key) == ("f1814f0e8ff1043d8a44d25babff3ced" - "cae6c22c3edaa48f857ae70de2baae50") - + assert tohex(private_key) == ( + "8052030376d47112be7f73ed7a019293" + "dd12ad910b654455798b4667d73de166" + ) -def check_type_error(expected, f, *args): - with pytest.raises(TypeError) as e: - f(*args) - assert expected in str(e.value) + assert tohex(public_key) == ( + "f1814f0e8ff1043d8a44d25babff3ced" + "cae6c22c3edaa48f857ae70de2baae50" + ) def test_wrong_types(): sk = SigningKey.generate() - check_type_error("SigningKey must be created from a 32 byte seed", - SigningKey, 12) - check_type_error("SigningKey must be created from a 32 byte seed", - SigningKey, sk) - check_type_error("SigningKey must be created from a 32 byte seed", - SigningKey, sk.verify_key) - - check_type_error("VerifyKey must be created from 32 bytes", - VerifyKey, 13) - check_type_error("VerifyKey must be created from 32 bytes", - VerifyKey, sk) - check_type_error("VerifyKey must be created from 32 bytes", - VerifyKey, sk.verify_key) + check_type_error( + "SigningKey must be created from a 32 byte seed", SigningKey, 12 + ) + check_type_error( + "SigningKey must be created from a 32 byte seed", SigningKey, sk + ) + check_type_error( + "SigningKey must be created from a 32 byte seed", + SigningKey, + sk.verify_key, + ) + + check_type_error("VerifyKey must be created from 32 bytes", VerifyKey, 13) + check_type_error("VerifyKey must be created from 32 bytes", VerifyKey, sk) + check_type_error( + "VerifyKey must be created from 32 bytes", VerifyKey, sk.verify_key + ) + + def verify_detached_signature(x: bytes) -> None: + sk.verify_key.verify(b"", x) + + check_type_error( + "Verification signature must be created from 64 bytes", + verify_detached_signature, + 13, + ) + check_type_error( + "Verification signature must be created from 64 bytes", + verify_detached_signature, + sk, + ) + check_type_error( + "Verification signature must be created from 64 bytes", + verify_detached_signature, + sk.verify_key, + ) diff -Nru python-nacl-1.4.0/tests/test_utils.py python-nacl-1.5.0/tests/test_utils.py --- python-nacl-1.4.0/tests/test_utils.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/test_utils.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import pytest @@ -33,17 +32,23 @@ def test_deterministic_random_bytes(): - expected = b"0d8e6cc68715648926732e7ea73250cfaf2d58422083904c841a8ba" \ - b"33b986111f346ba50723a68ae283524a6bded09f83be6b80595856f" \ - b"72e25b86918e8b114bafb94bc8abedd73daab454576b7c5833eb0bf" \ - b"982a1bb4587a5c970ff0810ca3b791d7e12" - seed = b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d" \ - b"\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b" \ - b"\x1c\x1d\x1e\x1f" - assert nacl.utils.randombytes_deterministic( - 100, - seed, - encoder=nacl.utils.encoding.HexEncoder) == expected + expected = ( + b"0d8e6cc68715648926732e7ea73250cfaf2d58422083904c841a8ba" + b"33b986111f346ba50723a68ae283524a6bded09f83be6b80595856f" + b"72e25b86918e8b114bafb94bc8abedd73daab454576b7c5833eb0bf" + b"982a1bb4587a5c970ff0810ca3b791d7e12" + ) + seed = ( + b"\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0a\x0b\x0c\x0d" + b"\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b" + b"\x1c\x1d\x1e\x1f" + ) + assert ( + nacl.utils.randombytes_deterministic( + 100, seed, encoder=nacl.utils.encoding.HexEncoder + ) + == expected + ) def test_deterministic_random_bytes_invalid_seed_length(): diff -Nru python-nacl-1.4.0/tests/utils.py python-nacl-1.5.0/tests/utils.py --- python-nacl-1.4.0/tests/utils.py 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tests/utils.py 2022-01-07 21:54:10.000000000 +0000 @@ -12,31 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -from __future__ import absolute_import, division, print_function import os +from typing import Callable, Dict, List, Optional, Tuple -from six import byte2int, int2byte +import pytest -def assert_equal(x, y): +def assert_equal(x: object, y: object) -> None: assert x == y assert not (x != y) -def assert_not_equal(x, y): +def assert_not_equal(x: object, y: object) -> None: assert x != y assert not (x == y) -def read_crypto_test_vectors(fname, maxels=0, delimiter=None): +def read_crypto_test_vectors( + fname: str, maxels: int = 0, delimiter: Optional[bytes] = None +) -> List[Tuple[bytes, ...]]: assert delimiter is not None and isinstance(delimiter, bytes) vectors = [] path = os.path.join(os.path.dirname(__file__), "data", fname) with open(path, "rb") as fp: for line in fp: line = line.rstrip() - if line and line[0] != b'#'[0]: + if line and line[0] != b"#"[0]: splt = [x for x in line.split(delimiter)] if maxels: splt = splt[:maxels] @@ -44,27 +46,43 @@ return vectors -def read_kv_test_vectors(fname, delimiter=None, newrecord=None): +def read_kv_test_vectors( + fname: str, + delimiter: Optional[bytes] = None, + newrecord: Optional[bytes] = None, +) -> List[Dict[str, bytes]]: assert delimiter is not None and isinstance(delimiter, bytes) assert newrecord is not None and isinstance(newrecord, bytes) vectors = [] path = os.path.join(os.path.dirname(__file__), "data", fname) - vector = {} - with open(path, 'rb') as fp: + vector: Dict[str, bytes] = {} + with open(path, "rb") as fp: for line in fp: line = line.rstrip() - if line and line[0] != b'#'[0]: + if line and line[0] != b"#"[0]: [k, v] = line.split(delimiter, 1) k, v = k.strip(), v.strip() - if k == newrecord and k.decode('utf-8') in vector: + if k == newrecord and k.decode("utf-8") in vector: vectors.append(vector) vector = {} - vector[k.decode('utf-8')] = v + vector[k.decode("utf-8")] = v vectors.append(vector) return vectors -def flip_byte(original, byte_offset): - return (original[:byte_offset] + - int2byte(0x01 ^ byte2int(original[byte_offset:byte_offset + 1])) + - original[byte_offset + 1:]) +def flip_byte(original: bytes, byte_offset: int) -> bytes: + return ( + original[:byte_offset] + + bytes([0x01 ^ original[byte_offset]]) + + original[byte_offset + 1 :] + ) + + +# Type safety: it's fine to use `...` here, but mypy config doesn't like it because it's +# an explict `Any`. +def check_type_error( # type: ignore[misc] + expected: str, f: Callable[..., object], *args: object +) -> None: + with pytest.raises(TypeError) as e: + f(*args) + assert expected in str(e.value) diff -Nru python-nacl-1.4.0/tox.ini python-nacl-1.5.0/tox.ini --- python-nacl-1.4.0/tox.ini 2020-05-25 19:10:50.000000000 +0000 +++ python-nacl-1.5.0/tox.ini 2022-01-07 21:54:10.000000000 +0000 @@ -1,5 +1,5 @@ [tox] -envlist = py27,pypy,py35,py36,py37,py38,docs,meta +envlist = pypy,py36,py37,py38,py39,py310,docs,meta,mypy isolated_build = True [testenv] @@ -8,9 +8,9 @@ deps = coverage pretend -passenv = SODIUM_INSTALL SODIUM_INSTALL_MINIMAL PYNACL_SODIUM_STATIC LIB INCLUDE +passenv = SODIUM_INSTALL SODIUM_INSTALL_MINIMAL PYNACL_SODIUM_STATIC LIB INCLUDE LIBSODIUM_MAKE_ARGS commands = - coverage run --parallel-mode -m pytest --capture=no --strict + coverage run --parallel-mode -m pytest --capture=no --strict-markers {posargs} coverage combine coverage report -m @@ -26,16 +26,24 @@ doc8 README.rst docs/ --ignore-path docs/_build/ [testenv:meta] +basepython = python3 deps = + black flake8 flake8-import-order check-manifest commands = flake8 . + black --check . check-manifest . --ignore .travis.yml +[testenv:mypy] +deps = + mypy +commands = + mypy + [flake8] -ignore = W504 +ignore = E203,E501,W503,W504 select = E,W,F,I -exclude = .tox,*.egg application-import-names = nacl