hw/sd/pl181: Replace fprintf(stderr, "*\n") with error_report()
[qemu/ar7.git] / crypto / meson.build
blob18da7c8541d58afe95f9d3456d9d25f692346552
1 crypto_ss = ss.source_set()
2 crypto_ss.add(genh)
3 crypto_ss.add(files(
4   'afsplit.c',
5   'block-luks.c',
6   'block-qcow.c',
7   'block.c',
8   'cipher.c',
9   'desrfb.c',
10   'hash.c',
11   'hmac.c',
12   'ivgen-essiv.c',
13   'ivgen-plain.c',
14   'ivgen-plain64.c',
15   'ivgen.c',
16   'pbkdf.c',
17   'secret_common.c',
18   'secret.c',
19   'tlscreds.c',
20   'tlscredsanon.c',
21   'tlscredspsk.c',
22   'tlscredsx509.c',
23   'tlssession.c',
26 if 'CONFIG_GCRYPT' in config_host
27   wo_nettle = files('hash-gcrypt.c', 'pbkdf-gcrypt.c')
28 else
29   wo_nettle = files('hash-glib.c', 'pbkdf-stub.c')
30 endif
31 if 'CONFIG_GCRYPT_HMAC' not in config_host
32   wo_nettle += files('hmac-glib.c')
33 endif
34 crypto_ss.add(when: [nettle, 'CONFIG_NETTLE'],
35              if_true: files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'),
36              if_false: wo_nettle)
38 crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
39 crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.c'))
40 crypto_ss.add(when: 'CONFIG_GCRYPT_HMAC', if_true: files('hmac-gcrypt.c'))
41 crypto_ss.add(when: 'CONFIG_AF_ALG', if_true: files('afalg.c', 'cipher-afalg.c', 'hash-afalg.c'))
42 crypto_ss.add(when: 'CONFIG_GNUTLS', if_true: files('tls-cipher-suites.c'))
44 crypto_ss = crypto_ss.apply(config_host, strict: false)
45 libcrypto = static_library('crypto', crypto_ss.sources() + genh,
46                            dependencies: [crypto_ss.dependencies()],
47                            name_suffix: 'fa',
48                            build_by_default: false)
50 crypto = declare_dependency(link_whole: libcrypto,
51                             dependencies: [authz, qom])
53 util_ss.add(files('aes.c'))
54 util_ss.add(files('init.c'))
55 if 'CONFIG_GCRYPT' in config_host
56   util_ss.add(files('random-gcrypt.c'))
57 elif 'CONFIG_GNUTLS' in config_host
58   util_ss.add(files('random-gnutls.c'), gnutls)
59 elif 'CONFIG_RNG_NONE' in config_host
60   util_ss.add(files('random-none.c'))
61 else
62   util_ss.add(files('random-platform.c'))
63 endif