From a077d7671f03f6cb3c940212bbaa28a79500d210 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 19 Feb 2018 10:15:03 -0500 Subject: [PATCH 1/4] define cpu_* if not set --- libi2pd/CPU.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libi2pd/CPU.cpp b/libi2pd/CPU.cpp index 96beaf78..d2868a20 100644 --- a/libi2pd/CPU.cpp +++ b/libi2pd/CPU.cpp @@ -3,6 +3,15 @@ #include #endif #include "Log.h" + +#ifndef bit_AES +#define bit_AES (1 << 25) +#endif +#ifndef bit_AVX +#define bit_AVX (1 << 28) +#endif + + namespace i2p { namespace cpu From 9c93d6f93180ec0ed9be5fd0b4ea59817c01ed02 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 19 Feb 2018 10:15:26 -0500 Subject: [PATCH 2/4] Revert "define cpu_* if not set" This reverts commit a077d7671f03f6cb3c940212bbaa28a79500d210. --- libi2pd/CPU.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/libi2pd/CPU.cpp b/libi2pd/CPU.cpp index d2868a20..96beaf78 100644 --- a/libi2pd/CPU.cpp +++ b/libi2pd/CPU.cpp @@ -3,15 +3,6 @@ #include #endif #include "Log.h" - -#ifndef bit_AES -#define bit_AES (1 << 25) -#endif -#ifndef bit_AVX -#define bit_AVX (1 << 28) -#endif - - namespace i2p { namespace cpu From a5cc2f3b5d57b18b41cc931de5584e2a38a0bc75 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 19 Feb 2018 10:15:39 -0500 Subject: [PATCH 3/4] define bit_* if not already defined --- libi2pd/CPU.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libi2pd/CPU.cpp b/libi2pd/CPU.cpp index 96beaf78..d2868a20 100644 --- a/libi2pd/CPU.cpp +++ b/libi2pd/CPU.cpp @@ -3,6 +3,15 @@ #include #endif #include "Log.h" + +#ifndef bit_AES +#define bit_AES (1 << 25) +#endif +#ifndef bit_AVX +#define bit_AVX (1 << 28) +#endif + + namespace i2p { namespace cpu From f876cc90796de2cb1559944e63d99669da39a199 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 19 Feb 2018 10:16:48 -0500 Subject: [PATCH 4/4] update makefile --- Makefile.homebrew | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile.homebrew b/Makefile.homebrew index b3105c56..a6e645ee 100644 --- a/Makefile.homebrew +++ b/Makefile.homebrew @@ -33,10 +33,13 @@ endif # 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 -# note from psi: 2009 macbook does not have aesni -#ifeq ($(USE_AESNI),yes) -# CXXFLAGS += -maes -DAESNI -#endif +ifeq ($(USE_AESNI),yes) + CXXFLAGS += -maes -DAESNI +endif +ifeq ($(USE_AVX),1) + CXXFLAGS += -mavx +endif + # Disabled, since it will be the default make rule. I think its better # to define the default rule in Makefile and not Makefile. - torkel