2 from waflib
import Options
3 from waflib
import Utils
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 Utils
.WafError('--accel-aes=intelaesni selected and non x86_64 CPU')
19 raise Utils
.WafError('--aes-accel=intelaesni selected and compiler rejects ' + str(asm_flags
))
20 if not conf
.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
21 raise Utils
.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')
24 if not bld
.CONFIG_SET('HAVE_AESNI_INTEL'):
27 bld
.SAMBA_LIBRARY('aesni-intel',
28 source
='aesni-intel_asm.c',
29 cflags
=bld
.CONFIG_GET('AESNI_INTEL_CFLAGS'),
30 ldflags
='-Wl,-z,noexecstack',