From e1ce77b1673db76fb46d87effa7b1a1dc083d9b7 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Mon, 4 Feb 2013 14:44:29 +0100 Subject: Initial AES-NI support --- configure.ac | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'configure.ac') 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 -- cgit v1.2.1