From 524b2e9f8a35a73984cc96b5b8677bd2ea19ddca Mon Sep 17 00:00:00 2001 From: Kill Your TV Date: Wed, 29 Oct 2014 21:11:58 +0000 Subject: [PATCH] check for 64-bit compiler --- Makefile.linux | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile.linux b/Makefile.linux index 77bb2c60..e485b3e2 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -2,6 +2,9 @@ CC = g++ CFLAGS = -g -Wall CXXVER := $(shell ${CC} -dumpversion) +FGREP = fgrep +IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(FGREP) -c "64") + ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10 CFLAGS += -std=c++11 else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7 @@ -18,8 +21,11 @@ INCFLAGS = LDFLAGS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LIBS = + +ifeq ($(IS_64),1) #check if AES-NI is supported by CPU ifneq ($(shell grep -c aes /proc/cpuinfo),0) CPU_FLAGS = -maes -DAESNI endif +endif