summaryrefslogtreecommitdiff
path: root/third_party/aesni-intel/wscript
blob: f0723a525011079132f0f716cd9fcbfd49f93c49 (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
#!/usr/bin/env python
import Options
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':
                print("Compiling with Intel AES instructions")
                conf.DEFINE('HAVE_AESNI_INTEL', 1)
            else:
                raise Utils.WafError('--accel-aes=intelaesni selected and non x86_64 CPU')
        else:
            raise Utils.WafError('--accel-aes=intelaesni selected and compiler rejects -Wp,-E,-lang-asm')
        if not conf.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
            raise Utils.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')

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',
        ldflags='-Wl,-z,noexecstack',
        private_library=True)