summaryrefslogtreecommitdiffstats
path: root/third_party/aesni-intel/wscript
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 17:47:29 +0000
commit4f5791ebd03eaec1c7da0865a383175b05102712 (patch)
tree8ce7b00f7a76baa386372422adebbe64510812d4 /third_party/aesni-intel/wscript
parentInitial commit. (diff)
downloadsamba-upstream.tar.xz
samba-upstream.zip
Adding upstream version 2:4.17.12+dfsg.upstream/2%4.17.12+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/aesni-intel/wscript')
-rw-r--r--third_party/aesni-intel/wscript32
1 files changed, 32 insertions, 0 deletions
diff --git a/third_party/aesni-intel/wscript b/third_party/aesni-intel/wscript
new file mode 100644
index 0000000..382b3c6
--- /dev/null
+++ b/third_party/aesni-intel/wscript
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+from waflib import Options
+from waflib import Errors
+
+def configure(conf):
+ if Options.options.accel_aes.lower() == "intelaesni":
+ 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 Errors.WafError('--accel-aes=intelaesni selected and non x86_64 CPU')
+ else:
+ raise Errors.WafError('--aes-accel=intelaesni selected and compiler rejects ' + str(asm_flags))
+ if not conf.CHECK_LDFLAGS('-Wl,-z,noexecstack'):
+ raise Errors.WafError('--accel-aes=intelaesni selected and linker rejects -z noexecstack')
+
+def build(bld):
+ if (not bld.CONFIG_SET('HAVE_AESNI_INTEL') or
+ bld.CONFIG_SET('HAVE_GNUTLS_AES_CMAC')):
+ return
+
+ bld.SAMBA_LIBRARY('aesni-intel',
+ source='aesni-intel_asm.c',
+ cflags=bld.CONFIG_GET('AESNI_INTEL_CFLAGS'),
+ ldflags='-Wl,-z,noexecstack',
+ private_library=True)