2 from waflib
import Options
3 from waflib
import Errors
6 if Options
.options
.accel_aes
.lower() == "intelaesni":
7 asm_flags
= ('-Wp,-E,-lang-asm', '-xassembler-with-cpp')
9 if conf
.CHECK_CFLAGS(f
, ''):
10 conf
.DEFINE('AESNI_INTEL_CFLAGS', f
)
12 if conf
.CONFIG_SET('AESNI_INTEL_CFLAGS'):
13 if conf
.env
['SYSTEM_UNAME_MACHINE'] in ('x86_64', 'amd64'):
14 print("Compiling with Intel AES instructions")
15 conf
.DEFINE('HAVE_AESNI_INTEL', 1)
17 raise Errors
.WafError('--accel-aes=intelaesni selected and non x86_64 CPU')
19 raise Errors
.WafError('--aes-accel=intelaesni selected and compiler rejects ' + str(asm_flags
))
20 if not conf
.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
21 raise Errors
.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')
24 if (not bld
.CONFIG_SET('HAVE_AESNI_INTEL') or
25 bld
.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
28 bld
.SAMBA_LIBRARY('aesni-intel',
29 source
='aesni-intel_asm.c',
30 cflags
=bld
.CONFIG_GET('AESNI_INTEL_CFLAGS'),
31 ldflags
='-Wl,-z,noexecstack',