Skip to content

Commit

Permalink
Merge pull request samba-team#16 from freenas/freenas/master-samba-aesni
Browse files Browse the repository at this point in the history
accellerated AES for samba thanks to timur
  • Loading branch information
Kris Moore committed Oct 24, 2017
2 parents 76fbf2c + 92709e0 commit 634f9e2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions third_party/aesni-intel/wscript
Expand Up @@ -4,20 +4,26 @@ import Utils

def configure(conf):
if Options.options.accel_aes.lower() == "intelaesni":
if conf.CHECK_CFLAGS('-Wp,-E,-lang-asm', ''):
if conf.env['SYSTEM_UNAME_MACHINE'] == 'x86_64':
asm_flags = ('-Wp,-E,-lang-asm', '-xassembler-with-cpp')
for f in asm_flags:
if conf.CHECK_CFLAGS(f, ''):
conf.DEFINE('AESNI_INTEL_CFLAGS', f)
break

if conf.CONFIG_SET('AESNI_INTEL_CFLAGS'):
if conf.env['SYSTEM_UNAME_MACHINE'] in ('x86_64', 'amd64'):
print("Compiling with Intel AES instructions")
conf.DEFINE('HAVE_AESNI_INTEL', 1)
else:
raise Utils.WafError('--aes-accel=intelaesni selected and non x86_64 CPU')
else:
raise Utils.WafError('--aes-accel=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
raise Utils.WafError('--aes-accel=intelaesni selected and compiler rejects ' + str(asm_flags))

def build(bld):
if not bld.CONFIG_SET('HAVE_AESNI_INTEL'):
return

bld.SAMBA_LIBRARY('aesni-intel',
source='aesni-intel_asm.c',
cflags='-Wp,-E,-lang-asm',
cflags=bld.CONFIG_GET('AESNI_INTEL_CFLAGS'),
private_library=True)

0 comments on commit 634f9e2

Please sign in to comment.