summaryrefslogtreecommitdiff
path: root/lib/crypto/wscript_configure
blob: 9fdaf9f3d14dfec8138f3458361fc9e38d3af6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env python
import Options
import Utils

if not conf.CHECK_FUNCS_IN('MD5Init', 'bsd', headers='bsd/md5.h',
    checklibc=True):
    conf.CHECK_FUNCS_IN('MD5Init', 'md5', headers='sys/md5.h',
                        checklibc=True)
    conf.CHECK_FUNCS_IN('MD5Init', 'md', headers='sys/md5.h',
                        checklibc=True)
conf.CHECK_FUNCS_IN('CC_MD5_Init', '', headers='CommonCrypto/CommonDigest.h',
    checklibc=True)

if conf.CHECK_FUNCS('SHA1_Update'):
	conf.DEFINE('SHA1_RENAME_NEEDED', 1)
if conf.CHECK_FUNCS('SHA256_Update'):
	conf.DEFINE('SHA256_RENAME_NEEDED', 1)
if conf.CHECK_FUNCS('SHA512_Update'):
	conf.DEFINE('SHA512_RENAME_NEEDED', 1)

#
# --aes-accel=XXX selects accelerated AES crypto library to use, if any.
# Default is none.
#
if Options.options.accel_aes.lower() == "intelaesni":
        print("Attempting to compile with runtime-switchable x86_64 Intel AES instructions. WARNING - this is temporary.")
elif Options.options.accel_aes.lower() != "none":
        raise Utils.WafError('--aes-accel=%s is not a valid option. Valid options are [none|intelaesni]' % Options.options.accel_aes)