VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-09 17:11:04 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2016-10-17 18:40:31 +0200
commit0f7ef7dcd74ac3b6b37da6351044cba79d649ed6 (patch)
tree74a0f9aad9d975424a711b7af1fe96efec6671bd /src
parentf96eb0c5ecd97731785fd48d92cee91c50148382 (diff)
downloadVeraCrypt-0f7ef7dcd74ac3b6b37da6351044cba79d649ed6.tar.gz
VeraCrypt-0f7ef7dcd74ac3b6b37da6351044cba79d649ed6.zip
Linux/MacOSX: cleaner support for SSE compiler switches
Diffstat (limited to 'src')
-rw-r--r--src/Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/Makefile b/src/Makefile
index 0477d5a1..7bfc5ad5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -129,6 +129,7 @@ export PLATFORM_ARCH := "Unknown"
export PLATFORM_UNSUPPORTED := 0
export CPU_ARCH ?= unknown
+export SIMD_SUPPORTED := 0
ARCH = $(shell uname -p)
ifeq "$(ARCH)" "unknown"
@@ -149,9 +150,11 @@ endif
ifeq "$(CPU_ARCH)" "x86"
PLATFORM_ARCH := i386
+ SIMD_SUPPORTED := 1
C_CXX_FLAGS += -D TC_ARCH_X86
else ifeq "$(CPU_ARCH)" "x64"
PLATFORM_ARCH := amd64
+ SIMD_SUPPORTED := 1
C_CXX_FLAGS += -D TC_ARCH_X64
endif
@@ -163,7 +166,7 @@ ifeq "$(shell uname -s)" "Linux"
PLATFORM := Linux
C_CXX_FLAGS += -DTC_UNIX -DTC_LINUX
- ifneq "$(CPU_ARCH)" "unknown"
+ ifeq "$(SIMD_SUPPORTED)" "1"
CFLAGS += -msse2
CXXFLAGS += -msse2
@@ -176,10 +179,12 @@ ifeq "$(shell uname -s)" "Linux"
ifeq "$(GCC_GTEQ_430)" "1"
ifeq "$(origin SSSE3)" "command line"
- CFLAGS += -mssse3 -msse4.1
+ CFLAGS += -mssse3
+ CXXFLAGS += -mssse3
endif
ifeq "$(origin SSE41)" "command line"
+ CFLAGS += -mssse3 -msse4.1
CXXFLAGS += -mssse3 -msse4.1
endif
endif
@@ -235,6 +240,19 @@ ifeq "$(shell uname -s)" "Darwin"
CPU_ARCH = x86
endif
+ CFLAGS += -msse2
+ CXXFLAGS += -msse2
+
+ ifeq "$(origin SSSE3)" "command line"
+ CFLAGS += -mssse3
+ CXXFLAGS += -mssse3
+ endif
+
+ ifeq "$(origin SSE41)" "command line"
+ CFLAGS += -mssse3 -msse4.1
+ CXXFLAGS += -mssse3 -msse4.1
+ endif
+
AS := $(BASE_DIR)/Build/Tools/MacOSX/nasm
ASFLAGS += --prefix _