From 354502d59da41d2aaeb301a66570fe3a625f3d7c Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Tue, 14 Mar 2017 18:38:37 -0400 Subject: [PATCH] Change HAS_NASM to USE_NASM. The makefile does not etect it automatically --- GNUmakefile | 6 +++--- rdrand.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 55045543..ff2393bc 100755 --- a/GNUmakefile +++ b/GNUmakefile @@ -55,7 +55,7 @@ HAS_SOLIB_VERSION := $(IS_LINUX) IS_X32 ?= 0 # Set to 1 if you used NASM to build rdrand-{x86|x32|x64} -HAS_NASM ?= 0 +USE_NASM ?= 0 # Fixup for X32 ifeq ($(IS_X32),1) @@ -470,7 +470,7 @@ endif # List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems. OBJS := $(SRCS:.cpp=.o) -ifeq ($(HAS_NASM),1) +ifeq ($(USE_NASM),1) ifeq ($(IS_X64),1) OBJS += rdrand-x64.o else ifeq ($(IS_X32),1) @@ -766,7 +766,7 @@ endif endif # Run rdrand-nasm.sh to create the object files -ifeq ($(HAS_NASM),1) +ifeq ($(USE_NASM),1) rdrand.o: rdrand.h rdrand.cpp rdrand.S $(CXX) $(strip $(CXXFLAGS)) -DNASM_RDRAND_ASM_AVAILABLE=1 -DNASM_RDSEED_ASM_AVAILABLE=1 -c rdrand.cpp rdrand-x86.o: ; diff --git a/rdrand.cpp b/rdrand.cpp index 31ef84d0..26be8c43 100644 --- a/rdrand.cpp +++ b/rdrand.cpp @@ -25,10 +25,10 @@ ///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// -// For Linux, install NASM, run rdrand-nasm.asm, add the apppropriate -// object file to the Makefile's LIBOBJS (rdrand-x{86|32|64}.o). After -// that, define these. They are not enabled by default because they -// are not easy to cut-in in the Makefile. +// For Linux, NASM is optional. Run rdrand-nasm.sh, and then make +// with "USE_NASM" like so: USE_NASM=1 make -j 4. The makefile +// will add the appropriate defines when building rdrand.cpp, +// and add the appropriate object file during link. #if 0 #define NASM_RDRAND_ASM_AVAILABLE 1