From 05a62af99b5112e3adf98931ca7d49f3350af509 Mon Sep 17 00:00:00 2001 From: hagen Date: Fri, 12 Dec 2014 08:22:03 +0000 Subject: [PATCH] * move USE_* to main Makefile --- Makefile | 3 +++ Makefile.linux | 12 ++++++------ Makefile.osx | 4 +++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 2296867a..7cfdd921 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ I2PD := i2p include filelist.mk +USE_AESNI := yes +USE_STATIC := no + ifeq ($(UNAME),Darwin) DAEMON_SRC += DaemonLinux.cpp include Makefile.osx diff --git a/Makefile.linux b/Makefile.linux index 621fa8af..ffb89ee0 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -15,8 +15,7 @@ else # not supported $(error Compiler too old) endif -USE_AESNI := yes -ifeq ($(STATIC),yes) +ifeq ($(USE_STATIC),yes) LIBDIR := /usr/lib LDLIBS = $(LIBDIR)/libcryptopp.a LDLIBS += $(LIBDIR)/libboost_system.a @@ -30,14 +29,15 @@ else LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread endif -FGREP = fgrep -IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(FGREP) -c "64") +GREP = fgrep +IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(GREP) -c "64") ifeq ($(USE_AESNI),yes) ifeq ($(IS_64),1) #check if AES-NI is supported by CPU -ifneq ($(shell grep -c aes /proc/cpuinfo),0) +ifneq ($(shell $(GREP) -c aes /proc/cpuinfo),1) CXXFLAGS += -maes -DAESNI +else + $(warning "AESNI support enabled requested but not supported by this CPU") endif endif endif - diff --git a/Makefile.osx b/Makefile.osx index 331119a9..ca5fabaf 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -8,7 +8,9 @@ LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_ # http://www.hutsby.net/2011/08/macs-with-aes-ni.html # Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2 # Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic -CXXFLAGS += -maes -DAESNI +ifeq ($(USE_AESNI),yes) + CXXFLAGS += -maes -DAESNI +endif install: all mkdir -p ${PREFIX}/