lib: crypto: Add the ability to select Intel AESNI instruction set at configure time.
[Samba.git] / third_party / aesni-intel / wscript
blobeb92d6626fe1c52b5975ccc8ffc8dc278653f46a
1 #!/usr/bin/env python
2 import Options
3 import Utils
5 def configure(conf):
6 if Options.options.accel_aes.lower() == "intelaesni":
7 if conf.CHECK_CFLAGS('-Wp,-E,-lang-asm', ''):
8 if conf.env['SYSTEM_UNAME_MACHINE'] == 'x86_64':
9 print("Compiling with Intel AES instructions")
10 conf.DEFINE('HAVE_AESNI_INTEL', 1)
11 else:
12 raise Utils.WafError('--aes-accel=intelaesni selected and non x86_64 CPU')
13 else:
14 raise Utils.WafError('--aes-accel=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
16 def build(bld):
17 if not bld.CONFIG_SET('HAVE_AESNI_INTEL'):
18 return
20 bld.SAMBA_LIBRARY('aesni-intel',
21 source='aesni-intel_asm.c',
22 cflags='-Wp,-E,-lang-asm',
23 private_library=True)