diff options
Diffstat (limited to 'comm/third_party/botan/botan.mozbuild')
-rw-r--r-- | comm/third_party/botan/botan.mozbuild | 238 |
1 files changed, 238 insertions, 0 deletions
diff --git a/comm/third_party/botan/botan.mozbuild b/comm/third_party/botan/botan.mozbuild new file mode 100644 index 0000000000..50ca96d6f7 --- /dev/null +++ b/comm/third_party/botan/botan.mozbuild @@ -0,0 +1,238 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +include('../rnpdefs.mozbuild') + +DEFINES['BOTAN_IS_BEING_BUILT'] = 1 +DEFINES['_REENTRANT'] = 1 + +if CONFIG['CC_TYPE'] == 'clang-cl': + DEFINES['_ENABLE_EXTENDED_ALIGNED_STORAGE'] = 1 + + CXXFLAGS += [ + '-bigobj', + '-clang:-fno-force-enable-int128', + '/EHs', + ] +else: + CXXFLAGS += [ + '-fexceptions', + '-fstack-protector' + ] + +if CONFIG['OS_ARCH'] == 'WINNT': + botan_os = 'windows' +elif CONFIG['OS_ARCH'] == 'Linux': + botan_os = 'linux' + CXXFLAGS += ['-pthread'] +else: + botan_os = CONFIG['OS_ARCH'].lower() + +# Run Botan's configure.py to generate build.h. Use --with-cmake to avoid +# writing a Makefile that would overwrite our own. +botan_generated = [ + 'build/build.h', + 'build/build_config.json', + 'CMakeLists.txt', + ] + +if CONFIG['COMPILE_ENVIRONMENT']: + GENERATED_FILES += botan_generated + botan_build = GENERATED_FILES['build/build.h'] + botan_build.script = 'botan_configure.py' + botan_build.flags = [ + '--cc-bin={}'.format(CONFIG['CXX']), + '--cpu={}'.format(CONFIG['target_cpu']), + '--os={}'.format(botan_os), + '--with-build-dir={}'.format(OBJDIR), + '--minimized-build', + '--disable-shared-library', + '--link-method=copy', + '--without-documentation', + '--distribution-info={}'.format(rnp_dist_info), + '--with-cmake', + ] + + +LOCAL_INCLUDES = ['!build/include'] + +# This list was obtained by running Botan's configure script in CMake mode +# with the desired options and extracting the information from CMakeLists.txt. +SOURCES += [ + 'src/lib/asn1/alg_id.cpp', + 'src/lib/asn1/asn1_obj.cpp', + 'src/lib/asn1/asn1_oid.cpp', + 'src/lib/asn1/asn1_print.cpp', + 'src/lib/asn1/asn1_str.cpp', + 'src/lib/asn1/asn1_time.cpp', + 'src/lib/asn1/ber_dec.cpp', + 'src/lib/asn1/der_enc.cpp', + 'src/lib/asn1/oid_maps.cpp', + 'src/lib/asn1/oids.cpp', + 'src/lib/base/buf_comp.cpp', + 'src/lib/base/scan_name.cpp', + 'src/lib/base/sym_algo.cpp', + 'src/lib/base/symkey.cpp', + 'src/lib/block/aes/aes.cpp', + 'src/lib/block/block_cipher.cpp', + 'src/lib/block/blowfish/blowfish.cpp', + 'src/lib/block/camellia/camellia.cpp', + 'src/lib/block/cast128/cast128.cpp', + 'src/lib/block/des/des.cpp', + 'src/lib/block/des/des_tab.cpp', + 'src/lib/block/des/desx.cpp', + 'src/lib/block/idea/idea.cpp', + 'src/lib/block/sm4/sm4.cpp', + 'src/lib/block/twofish/twofish.cpp', + 'src/lib/block/twofish/twofish_tab.cpp', + 'src/lib/codec/base64/base64.cpp', + 'src/lib/codec/hex/hex.cpp', + 'src/lib/entropy/entropy_srcs.cpp', + 'src/lib/ffi/ffi.cpp', + 'src/lib/ffi/ffi_block.cpp', + 'src/lib/ffi/ffi_cert.cpp', + 'src/lib/ffi/ffi_cipher.cpp', + 'src/lib/ffi/ffi_fpe.cpp', + 'src/lib/ffi/ffi_hash.cpp', + 'src/lib/ffi/ffi_hotp.cpp', + 'src/lib/ffi/ffi_kdf.cpp', + 'src/lib/ffi/ffi_keywrap.cpp', + 'src/lib/ffi/ffi_mac.cpp', + 'src/lib/ffi/ffi_mp.cpp', + 'src/lib/ffi/ffi_pk_op.cpp', + 'src/lib/ffi/ffi_pkey.cpp', + 'src/lib/ffi/ffi_pkey_algs.cpp', + 'src/lib/ffi/ffi_rng.cpp', + 'src/lib/ffi/ffi_totp.cpp', + 'src/lib/hash/checksum/crc24/crc24.cpp', + 'src/lib/hash/hash.cpp', + 'src/lib/hash/md5/md5.cpp', + 'src/lib/hash/mdx_hash/mdx_hash.cpp', + 'src/lib/hash/rmd160/rmd160.cpp', + 'src/lib/hash/sha1/sha160.cpp', + 'src/lib/hash/sha2_32/sha2_32.cpp', + 'src/lib/hash/sha2_64/sha2_64.cpp', + 'src/lib/hash/sha3/sha3.cpp', + 'src/lib/hash/sm3/sm3.cpp', + 'src/lib/kdf/kdf.cpp', + 'src/lib/kdf/kdf2/kdf2.cpp', + 'src/lib/kdf/sp800_56a/sp800_56a.cpp', + 'src/lib/mac/cmac/cmac.cpp', + 'src/lib/mac/hmac/hmac.cpp', + 'src/lib/mac/mac.cpp', + 'src/lib/math/bigint/big_code.cpp', + 'src/lib/math/bigint/big_io.cpp', + 'src/lib/math/bigint/big_ops2.cpp', + 'src/lib/math/bigint/big_ops3.cpp', + 'src/lib/math/bigint/big_rand.cpp', + 'src/lib/math/bigint/bigint.cpp', + 'src/lib/math/bigint/divide.cpp', + 'src/lib/math/mp/mp_comba.cpp', + 'src/lib/math/mp/mp_karat.cpp', + 'src/lib/math/mp/mp_monty.cpp', + 'src/lib/math/mp/mp_monty_n.cpp', + 'src/lib/math/numbertheory/dsa_gen.cpp', + 'src/lib/math/numbertheory/jacobi.cpp', + 'src/lib/math/numbertheory/make_prm.cpp', + 'src/lib/math/numbertheory/mod_inv.cpp', + 'src/lib/math/numbertheory/monty.cpp', + 'src/lib/math/numbertheory/monty_exp.cpp', + 'src/lib/math/numbertheory/mp_numth.cpp', + 'src/lib/math/numbertheory/nistp_redc.cpp', + 'src/lib/math/numbertheory/numthry.cpp', + 'src/lib/math/numbertheory/pow_mod.cpp', + 'src/lib/math/numbertheory/primality.cpp', + 'src/lib/math/numbertheory/primes.cpp', + 'src/lib/math/numbertheory/reducer.cpp', + 'src/lib/math/numbertheory/ressol.cpp', + 'src/lib/misc/nist_keywrap/nist_keywrap.cpp', + 'src/lib/misc/rfc3394/rfc3394.cpp', + 'src/lib/modes/aead/aead.cpp', + 'src/lib/modes/aead/eax/eax.cpp', + 'src/lib/modes/aead/ocb/ocb.cpp', + 'src/lib/modes/cbc/cbc.cpp', + 'src/lib/modes/cfb/cfb.cpp', + 'src/lib/modes/cipher_mode.cpp', + 'src/lib/modes/mode_pad/mode_pad.cpp', + 'src/lib/pbkdf/pbkdf.cpp', + 'src/lib/pbkdf/pgp_s2k/pgp_s2k.cpp', + 'src/lib/pbkdf/pwdhash.cpp', + 'src/lib/pk_pad/eme.cpp', + 'src/lib/pk_pad/eme_pkcs1/eme_pkcs.cpp', + 'src/lib/pk_pad/emsa.cpp', + 'src/lib/pk_pad/emsa1/emsa1.cpp', + 'src/lib/pk_pad/emsa_pkcs1/emsa_pkcs1.cpp', + 'src/lib/pk_pad/emsa_pssr/pssr.cpp', + 'src/lib/pk_pad/emsa_raw/emsa_raw.cpp', + 'src/lib/pk_pad/hash_id/hash_id.cpp', + 'src/lib/pk_pad/mgf1/mgf1.cpp', + 'src/lib/pk_pad/padding.cpp', + 'src/lib/pubkey/blinding.cpp', + 'src/lib/pubkey/curve25519/curve25519.cpp', + 'src/lib/pubkey/curve25519/donna.cpp', + 'src/lib/pubkey/dl_algo/dl_algo.cpp', + 'src/lib/pubkey/dl_group/dl_group.cpp', + 'src/lib/pubkey/dl_group/dl_named.cpp', + 'src/lib/pubkey/dsa/dsa.cpp', + 'src/lib/pubkey/ec_group/curve_gfp.cpp', + 'src/lib/pubkey/ec_group/ec_group.cpp', + 'src/lib/pubkey/ec_group/ec_named.cpp', + 'src/lib/pubkey/ec_group/point_gfp.cpp', + 'src/lib/pubkey/ec_group/point_mul.cpp', + 'src/lib/pubkey/ecc_key/ecc_key.cpp', + 'src/lib/pubkey/ecdh/ecdh.cpp', + 'src/lib/pubkey/ecdsa/ecdsa.cpp', + 'src/lib/pubkey/ed25519/ed25519.cpp', + 'src/lib/pubkey/ed25519/ed25519_fe.cpp', + 'src/lib/pubkey/ed25519/ed25519_key.cpp', + 'src/lib/pubkey/ed25519/ge.cpp', + 'src/lib/pubkey/ed25519/sc_muladd.cpp', + 'src/lib/pubkey/ed25519/sc_reduce.cpp', + 'src/lib/pubkey/elgamal/elgamal.cpp', + 'src/lib/pubkey/keypair/keypair.cpp', + 'src/lib/pubkey/pem/pem.cpp', + 'src/lib/pubkey/pk_algs.cpp', + 'src/lib/pubkey/pk_keys.cpp', + 'src/lib/pubkey/pk_ops.cpp', + 'src/lib/pubkey/pkcs8.cpp', + 'src/lib/pubkey/pubkey.cpp', + 'src/lib/pubkey/rsa/rsa.cpp', + 'src/lib/pubkey/sm2/sm2.cpp', + 'src/lib/pubkey/sm2/sm2_enc.cpp', + 'src/lib/pubkey/workfactor.cpp', + 'src/lib/pubkey/x509_key.cpp', + 'src/lib/rng/auto_rng/auto_rng.cpp', + 'src/lib/rng/hmac_drbg/hmac_drbg.cpp', + 'src/lib/rng/rng.cpp', + 'src/lib/rng/stateful_rng/stateful_rng.cpp', + 'src/lib/rng/system_rng/system_rng.cpp', + 'src/lib/stream/ctr/ctr.cpp', + 'src/lib/stream/stream_cipher.cpp', + 'src/lib/utils/assert.cpp', + 'src/lib/utils/calendar.cpp', + 'src/lib/utils/charset.cpp', + 'src/lib/utils/cpuid/cpuid.cpp', + 'src/lib/utils/cpuid/cpuid_arm.cpp', + 'src/lib/utils/cpuid/cpuid_ppc.cpp', + 'src/lib/utils/cpuid/cpuid_x86.cpp', + 'src/lib/utils/ct_utils.cpp', + 'src/lib/utils/data_src.cpp', + 'src/lib/utils/exceptn.cpp', + 'src/lib/utils/filesystem.cpp', + 'src/lib/utils/mem_ops.cpp', + 'src/lib/utils/os_utils.cpp', + 'src/lib/utils/parsing.cpp', + 'src/lib/utils/poly_dbl/poly_dbl.cpp', + 'src/lib/utils/read_cfg.cpp', + 'src/lib/utils/read_kv.cpp', + 'src/lib/utils/timer.cpp', + 'src/lib/utils/version.cpp', +] + +if CONFIG['CC_TYPE'] == 'clang-cl': + SOURCES += [ + 'src/lib/utils/dyn_load/dyn_load.cpp', + ] |