hw/dma: Add SiFive platform DMA controller emulation
[qemu/ar7.git] / crypto / meson.build
blobf6f5ce1ecd06e1f5039f5df07fa3c239ed4ef890
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_NETTLE' in config_host
27   crypto_ss.add(files('hash-nettle.c', 'hmac-nettle.c', 'pbkdf-nettle.c'))
28 elif 'CONFIG_GCRYPT' in config_host
29   crypto_ss.add(files('hash-gcrypt.c', 'pbkdf-gcrypt.c'))
30   if 'CONFIG_GCRYPT_HMAC' in config_host
31     crypto_ss.add(files('hmac-gcrypt.c'))
32   else
33     crypto_ss.add(files('hmac-glib.c'))
34   endif
35 else
36   crypto_ss.add(files('hash-glib.c', 'hmac-glib.c', 'pbkdf-stub.c'))
37 endif
39 crypto_ss.add(when: 'CONFIG_SECRET_KEYRING', if_true: files('secret_keyring.c'))
40 crypto_ss.add(when: 'CONFIG_QEMU_PRIVATE_XTS', if_true: files('xts.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 if 'CONFIG_NETTLE' in config_host
45   crypto_ss.add(nettle)
46 elif 'CONFIG_GCRYPT' in config_host
47   crypto_ss.add(gcrypt)
48 endif
50 if 'CONFIG_GNUTLS' in config_host
51   crypto_ss.add(gnutls)
52 endif
55 crypto_ss = crypto_ss.apply(config_host, strict: false)
56 libcrypto = static_library('crypto', crypto_ss.sources() + genh,
57                            dependencies: [crypto_ss.dependencies()],
58                            name_suffix: 'fa',
59                            build_by_default: false)
61 crypto = declare_dependency(link_whole: libcrypto,
62                             dependencies: [authz, qom])
64 util_ss.add(files('aes.c'))
65 util_ss.add(files('init.c'))
67 if 'CONFIG_GCRYPT' in config_host
68   util_ss.add(files('random-gcrypt.c'))
69 elif 'CONFIG_GNUTLS' in config_host
70   util_ss.add(files('random-gnutls.c'))
71 elif 'CONFIG_RNG_NONE' in config_host
72   util_ss.add(files('random-none.c'))
73 else
74   util_ss.add(files('random-platform.c'))
75 endif
77 if 'CONFIG_GCRYPT' in config_host
78   util_ss.add(gcrypt)
79 endif
81 if 'CONFIG_GNUTLS' in config_host
82   util_ss.add(gnutls)
83 endif