i2pd/Makefile.linux

44 lines
1.3 KiB
Makefile
Raw Normal View History

CXXFLAGS = -g -Wall -fPIC
2014-12-12 11:05:27 +03:00
INCFLAGS =
2014-09-23 05:44:09 +04:00
2014-12-12 11:05:27 +03:00
# detect proper flag for c++11 support by gcc
CXXVER := $(shell $(CXX) -dumpversion)
ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10
CXXFLAGS += -std=c++11
else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
CXXFLAGS += -std=c++11
else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
CXXFLAGS += -std=c++0x
2014-10-30 04:42:55 +03:00
else ifeq ($(shell expr match $(CXX) 'clang'),5)
CXXFLAGS += -std=c++11
else # not supported
$(error Compiler too old)
2014-09-23 05:44:09 +04:00
endif
2014-12-12 11:22:03 +03:00
ifeq ($(USE_STATIC),yes)
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
else
LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
endif
2014-12-12 11:22:03 +03:00
GREP = fgrep
IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(GREP) -c "64")
2014-10-31 20:45:58 +03:00
ifeq ($(USE_AESNI),yes)
2014-10-30 00:11:58 +03:00
ifeq ($(IS_64),1)
#check if AES-NI is supported by CPU
2014-12-12 11:22:03 +03:00
ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),1)
CXXFLAGS += -maes -DAESNI
2014-12-12 11:22:03 +03:00
else
$(warning "AESNI support enabled requested but not supported by this CPU")
endif
2014-10-30 00:11:58 +03:00
endif
2014-10-31 20:45:58 +03:00
endif