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 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