diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 75622e50..63f705ea 100644 --- a/configure.ac +++ b/configure.ac @@ -1364,6 +1364,21 @@ CFLAGS="$CFLAGS -Werror" # +# Check whether compiler supports 'optimize' function attribute +# +AC_CACHE_CHECK([whether compiler supports 'optimize' function attribute], + [gcry_cv_gcc_attribute_optimize], + [gcry_cv_gcc_attribute_optimize=no + AC_COMPILE_IFELSE([AC_LANG_SOURCE( + [[int __attribute__ ((optimize("-O2"))) fn(int i){return i;}]])], + [gcry_cv_gcc_attribute_optimize=yes])]) +if test "$gcry_cv_gcc_attribute_optimize" = "yes" ; then + AC_DEFINE(HAVE_GCC_ATTRIBUTE_OPTIMIZE,1, + [Defined if compiler supports "__attribute__ ((optimize))" function attribute]) +fi + + +# # Check whether compiler supports 'ms_abi' function attribute. # AC_CACHE_CHECK([whether compiler supports 'ms_abi' function attribute], @@ -2255,6 +2270,28 @@ fi # +# Check whether compiler supports GCC PowerPC target attributes +# +AC_CACHE_CHECK([whether compiler supports GCC PowerPC target attributes], + [gcry_cv_gcc_attribute_ppc_target], + [if test "$mpi_cpu_arch" != "ppc" ; then + gcry_cv_gcc_attribute_ppc_target="n/a" + else + gcry_cv_gcc_attribute_ppc_target=no + AC_LINK_IFELSE([AC_LANG_PROGRAM( + [[void __attribute__((target("cpu=power8"))) testfn8(void) {} + void __attribute__((target("cpu=power9"))) testfn9(void) + { testfn8(); } + ]], [ testfn9(); ])], + [gcry_cv_gcc_attribute_ppc_target=yes]) + fi]) +if test "$gcry_cv_gcc_attribute_ppc_target" = "yes" ; then + AC_DEFINE(HAVE_GCC_ATTRIBUTE_PPC_TARGET,1, + [Defined if compiler supports GCC PowerPC target attributes]) +fi + + +# # Check whether GCC inline assembler supports zSeries instructions # AC_CACHE_CHECK([whether GCC inline assembler supports zSeries instructions], |