liboqs/config/detect_host_and_cpu.m4
Nir Drucker d3ff24cd31 Add BIKE to master and some autotools/Makefiles changes (#333)
* Supporting BIKE KEM reference code

* Hiding print global symbol when VERBOSE!=2

* Supporting USE_OPENSSL + OPENSSL_DIR

* - The file config/.gitkeep is no longer needed its purpose was to allow git having an empty folder (config).
- Moved the file acinclude.m4 to the config directory (where all the *.m4 files are).
- Added .travis/defs.sh - this file holds common definitions used by travis scripts.
- Changed style-check to first check for clang-format only then handle modified files.
- Sodium support is no longer required.
- Breaked configure.ac into sub m4 files
- Sorted the flags list.
- Changed FrodoKEM to Frodo for consistency with SIKE and BIKE. Note that it is already under the KEM directory.
- Chaned USE_* protocl flags to ENABLE_* for consistency
- Adjaust most of the makefile to have a consistent compilation flags
- Added some more compilation warnings.

* Rename functions by using a legend instead of the FN() macro

* prettyprint

* 1) Some more Makefiles cleanup 2)Adding OQS_API defnition - hidding other symbols

* Reverting frodo renaming

* Reverting the checks order.

* Removing NEW_API.md

* pretty print

* 1)Disable bad warnings on gcc4.8/4.9 2) Disable all warnings on SIKE

* Disable the cast-align warning for now

* Documentation

* 1) Reenable BIKE error messages
2) Auto detection of AVX/AVX2/BMI features.

* Enable AVX features only on X86_64 Linux platforms

* Adding BIKE additional implementation for Linux(x86_64) and GCC

* Fixing configure.ac when OpenSSL is disabled

* Enabling BIKE's AVX512 implementation

* Wrap AVX512 code with ifdef

* Changes from code review

* Prettyprint

* Fix typo

* Rename symbol
2018-08-14 13:07:16 -04:00

73 lines
1.7 KiB
Plaintext

AC_DEFUN([DETECT_HOST_AND_CPU], [
AC_CANONICAL_HOST
# Check for which host we are on and setup a few things
# specifically based on the host
case $host_os in
darwin* )
darwin=true
;;
linux-android*)
AM_CFLAGS=${AM_CFLAGS}" -pie "
linux=true
;;
linux*)
linux=true
;;
*)
#Default Case
AC_MSG_ERROR([Your platform is not currently supported])
;;
esac
AM_CONDITIONAL([ON_DARWIN], [test "x$darwin" = xtrue])
AM_CONDITIONAL([ON_LINUX], [test "x$linux" = xtrue])
# Enable assembly optimizations here
# Appearenly asm optimizations do not work well with darwin
AM_COND_IF([ON_LINUX], [
case $host_cpu in
x86_64* )
AM_CPPFLAGS=${AM_CPPFLAGS}" -DSIDH_ASM -march=x86-64"
x86_64=true
;;
aarch64* )
AM_CPPFLAGS=${AM_CPPFLAGS}" -DSIDH_ASM -march=armv8-a+crc"
arm64=true
;;
arm* )
AM_CPPFLAGS=${AM_CPPFLAGS}" -DARM"
AM_CONDITIONAL([USE_AES_NI], [false])
arm=true
;;
*)
#Default Case
AC_MSG_ERROR([Your CPU is not currently supported])
;;
esac
])
AM_CONDITIONAL([X86_64], [test "x$x86_64" = xtrue])
AM_CONDITIONAL([ARM64], [test "x$arm64" = xtrue])
AM_CONDITIONAL([ARM], [test "x$arm" = xtrue])
AC_CACHE_CHECK([for GNUC compiler],
[gcc_cv_compiler],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM( [],
[ #if defined(__GNUC__) && !defined(__clang__)
return 0;
#else
return 1;
#endif
])],
[gcc_cv_compiler=true],
[gcc_cv_compiler=false]
)]
)
#Check if further x86 optimizations are available (e.g., avx/avx2/bmi).
AX_CHECK_X86_FEATURES
])