summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSebastian Ramacher <sebastian@ramacher.at>2013-02-04 14:44:29 +0100
committerDwayne Litzenberger <dlitz@dlitz.net>2013-04-21 20:41:18 -0700
commite1ce77b1673db76fb46d87effa7b1a1dc083d9b7 (patch)
tree3c999461384918aa9b1c2f10813db7211e2534b1 /configure.ac
parent1dd8353cc490f954677285415ec01e253f84b93d (diff)
downloadpycrypto-e1ce77b1673db76fb46d87effa7b1a1dc083d9b7.tar.gz
Initial AES-NI support
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 19 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5541361..16078ac 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,6 +49,18 @@ AX_CHECK_COMPILE_FLAG([-Wextra], [AX_APPEND_FLAG([-Wextra])])
AX_CHECK_COMPILE_FLAG([-Wno-missing-field-initializers], [AX_APPEND_FLAG([-Wno-missing-field-initializers])])
AX_CHECK_COMPILE_FLAG([-Wno-unused-parameter], [AX_APPEND_FLAG([-Wno-unused-parameter])])
+# Checks for compiler flags.
+old_CFLAGS="$CFLAGS"
+CFLAGS=-maes
+AC_MSG_CHECKING([whether CC supports -maes])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [
+ AC_MSG_RESULT([yes])
+ AC_DEFINE(HAVE_MAES, [1], [Define if CC supports -maes])
+ have_maes=yes
+ ], [AC_MSG_RESULT([no])]
+)
+CFLAGS="$old_cflags"
+
# Checks for libraries.
AC_ARG_WITH([gmp], AS_HELP_STRING([--without-gmp], [Build without gmp library (default: test)]))
AS_IF([test "x$with_gmp" != "xno"], [
@@ -76,7 +88,13 @@ AC_CHECK_DECLS([mpz_powm_sec], [], [], [
]])
# Checks for header files.
-AC_CHECK_HEADERS([inttypes.h sys/inttypes.h limits.h stddef.h stdint.h stdlib.h string.h wchar.h])
+AC_CHECK_HEADERS([inttypes.h sys/inttypes.h cpuid.h limits.h stddef.h stdint.h stdlib.h string.h wchar.h])
+old_CPPFLAGS="$CPPFLAGS"
+AS_IF([test "x$have_maes" = "xyes"], [
+ CPPFLAGS="$CPPFLAGS -maes"
+])
+AC_CHECK_HEADERS([wmmintrin.h])
+CPPFLAGS="$old_CPPFLAGS"
# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE