From: Vsevolod Stakhov Date: Thu, 15 Oct 2015 12:14:49 +0000 (+0100) Subject: 128 bit integers are not very portable. X-Git-Tag: 1.0.6~24 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=afc42e7f860aa0552560acec89cf4f57ea84f8a7;p=rspamd.git 128 bit integers are not very portable. --- diff --git a/src/libcryptobox/CMakeLists.txt b/src/libcryptobox/CMakeLists.txt index ccdfba279..3579ebc1a 100644 --- a/src/libcryptobox/CMakeLists.txt +++ b/src/libcryptobox/CMakeLists.txt @@ -13,7 +13,7 @@ SET(CURVESRC ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/ref.c ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519.c) # For now we support only x86_64 architecture with optimizations -IF(${ARCH} STREQUAL "x86_64") +IF("${ARCH}" STREQUAL "x86_64") SET(ASM_CODE "vpaddq %ymm0, %ymm0, %ymm0") ASM_OP(HAVE_AVX2 "avx2") SET(ASM_CODE "vpaddq %xmm0, %xmm0, %xmm0") @@ -43,9 +43,15 @@ IF(${ARCH} STREQUAL "x86_64") ") ASM_OP(HAVE_DOLLARMACRO "dollar macro convention") - SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-64.c) - SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna-c64.c) -ELSEIF(${ARCH} STREQUAL "i386") + if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-64.c) + SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna-c64.c) + else() + SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-32.c) + SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna.c) + endif() + +ELSEIF("${ARCH}" STREQUAL "i386") SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-32.c) SET(CURVESRC ${CURVESRC} ${CMAKE_CURRENT_SOURCE_DIR}/curve25519/curve25519-donna.c) ELSE()