2014-12-11 08:46:28 +01:00
|
|
|
CXXFLAGS = -g -Wall -fPIC
|
2014-12-12 09:05:27 +01:00
|
|
|
INCFLAGS =
|
2014-09-23 03:44:09 +02:00
|
|
|
|
2014-12-12 09:05:27 +01:00
|
|
|
# detect proper flag for c++11 support by gcc
|
|
|
|
CXXVER := $(shell $(CXX) -dumpversion)
|
2014-09-24 01:56:29 +02:00
|
|
|
ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10
|
2014-12-12 09:10:33 +01:00
|
|
|
CXXFLAGS += -std=c++11
|
2014-09-24 01:56:29 +02:00
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
|
2014-12-12 09:10:33 +01:00
|
|
|
CXXFLAGS += -std=c++11
|
2014-09-24 01:56:29 +02:00
|
|
|
else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
|
2014-12-12 09:10:33 +01:00
|
|
|
CXXFLAGS += -std=c++0x
|
2014-10-30 02:42:55 +01:00
|
|
|
else ifeq ($(shell expr match $(CXX) 'clang'),5)
|
2014-12-12 09:10:33 +01:00
|
|
|
CXXFLAGS += -std=c++11
|
2014-09-24 01:56:29 +02:00
|
|
|
else # not supported
|
2014-12-12 09:10:33 +01:00
|
|
|
$(error Compiler too old)
|
2014-09-23 03:44:09 +02:00
|
|
|
endif
|
|
|
|
|
2014-12-12 09:05:27 +01:00
|
|
|
USE_AESNI := yes
|
2014-11-07 15:49:16 +01:00
|
|
|
ifeq ($(STATIC),yes)
|
2014-12-12 09:10:33 +01:00
|
|
|
LIBDIR := /usr/lib
|
|
|
|
LDLIBS = $(LIBDIR)/libcryptopp.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_system.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_date_time.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_filesystem.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_regex.a
|
|
|
|
LDLIBS += $(LIBDIR)/libboost_program_options.a
|
|
|
|
LDLIBS += -lpthread -static-libstdc++ -static-libgcc
|
|
|
|
USE_AESNI := no
|
2014-11-07 15:49:16 +01:00
|
|
|
else
|
2014-12-12 09:10:33 +01:00
|
|
|
LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
|
2014-11-07 15:49:16 +01:00
|
|
|
endif
|
2014-07-16 18:59:17 +02:00
|
|
|
|
2014-12-12 09:05:27 +01:00
|
|
|
FGREP = fgrep
|
|
|
|
IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(FGREP) -c "64")
|
2014-10-31 18:45:58 +01:00
|
|
|
ifeq ($(USE_AESNI),yes)
|
2014-10-29 22:11:58 +01:00
|
|
|
ifeq ($(IS_64),1)
|
2014-07-16 18:59:17 +02:00
|
|
|
#check if AES-NI is supported by CPU
|
2014-08-17 07:35:09 +02:00
|
|
|
ifneq ($(shell grep -c aes /proc/cpuinfo),0)
|
2014-12-12 08:48:13 +01:00
|
|
|
CXXFLAGS += -maes -DAESNI
|
2014-07-16 18:59:17 +02:00
|
|
|
endif
|
2014-10-29 22:11:58 +01:00
|
|
|
endif
|
2014-10-31 18:45:58 +01:00
|
|
|
endif
|
2014-07-16 18:59:17 +02:00
|
|
|
|