From: MASM fan Date: Tue, 17 Mar 2015 19:34:46 +0000 (-0700) Subject: Fix some configuration issues. X-Git-Tag: nvc-v0.5.3~65 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=f54abc022ebe79879fccb088fd22696be4bc65de Fix some configuration issues. Modify guilding conditions to prevent unexpected results in case if USE_ASM and USE_SSE2 are both enabled. USE_SSE2 has a sense only for generic module. --- diff --git a/novacoin-qt.pro b/novacoin-qt.pro index 79905ba..585782d 100644 --- a/novacoin-qt.pro +++ b/novacoin-qt.pro @@ -135,21 +135,24 @@ contains(USE_LEVELDB, 1) { # use: qmake "USE_ASM=1" contains(USE_ASM, 1) { - message(Using optimized scrypt core implementation) + message(Using assembler scrypt core implementation) SOURCES += src/scrypt-arm.S src/scrypt-x86.S src/scrypt-x86_64.S } else { - message(Using generic scrypt core implementation) + # use: qmake "USE_SSE2=1" + contains(USE_SSE2, 1) { + message(Using SSE2 intrinsic scrypt implementation) + SOURCES += src/scrypt-sse2.cpp + DEFINES += USE_SSE2 + QMAKE_CXXFLAGS += -msse2 + QMAKE_CFLAGS += -msse2 + } else { + message(Using generic scrypt core implementation) + } + + # For now, generic module is required in both cases SOURCES += src/scrypt-generic.c } -# use: qmake "USE_SSE2=1" -contains(USE_SSE2, 1) { - message(Using SSE2 scrypt core implementation) - SOURCES += src/scrypt-sse2.cpp - DEFINES += USE_SSE2 - QMAKE_CXXFLAGS += -msse2 - QMAKE_CFLAGS += -msse2 -} # regenerate src/build.h !windows|contains(USE_BUILD_INFO, 1) { genbuild.depends = FORCE diff --git a/src/makefile.bsd b/src/makefile.bsd index 8589d15..27f8187 100644 --- a/src/makefile.bsd +++ b/src/makefile.bsd @@ -166,14 +166,15 @@ OBJS += obj/scrypt-generic.o obj/scrypt-generic.o: scrypt-generic.c $(CC) -c $(xCXXFLAGS) -MMD -o $@ $< -endif ifeq (${USE_SSE2}, 1) - DEFS += -DUSE_SSE2 - OBJS += obj/scrypt-sse2.o +DEFS += -DUSE_SSE2 +OBJS += obj/scrypt-sse2.o obj/scrypt-sse2.o: scrypt-sse2.cpp $(CXX) -c $(CFLAGS) -MMD -o $@ $< endif +endif + # auto-generated dependencies: -include obj/*.P diff --git a/src/makefile.linux-mingw b/src/makefile.linux-mingw index 580f92e..26a8eb8 100644 --- a/src/makefile.linux-mingw +++ b/src/makefile.linux-mingw @@ -133,19 +133,22 @@ obj/scrypt-x86.o: scrypt-x86.S obj/scrypt-x86_64.o: scrypt-x86_64.S $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $< endif + ifneq (${USE_ASM}, 1) OBJS += obj/scrypt-generic.o obj/scrypt-generic.o: scrypt-generic.c $(CC) -c $(xCXXFLAGS) -MMD -o $@ $< -endif ifeq (${USE_SSE2}, 1) - DEFS += -DUSE_SSE2 - OBJS += obj/scrypt-sse2.o +DEFS += -DUSE_SSE2 +OBJS += obj/scrypt-sse2.o + obj/scrypt-sse2.o: scrypt-sse2.cpp $(HEADERS) $(CCX) -c $(CFLAGS) -MMD -o $@ $< endif +endif + obj/build.h: FORCE /bin/sh ../share/genbuild.sh obj/build.h diff --git a/src/makefile.mingw b/src/makefile.mingw index cd2919c..1d36b42 100644 --- a/src/makefile.mingw +++ b/src/makefile.mingw @@ -107,7 +107,7 @@ DEFS += $(addprefix -I,$(CURDIR)/leveldb/include) -DUSE_LEVELDB DEFS += $(addprefix -I,$(CURDIR)/leveldb/helpers) OBJS += obj/txdb-leveldb.o leveldb/libleveldb.a: - cd leveldb;TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a;; cd .. + cd leveldb;TARGET_OS=NATIVE_WINDOWS make libleveldb.a libmemenv.a;; cd .. obj/txdb-leveldb.o: leveldb/libleveldb.a else OBJS += obj/txdb-bdb.o @@ -126,14 +126,17 @@ OBJS += obj/scrypt-generic.o obj/scrypt-generic.o: scrypt-generic.c $(CC) -c $(xCXXFLAGS) -MMD -o $@ $< -endif -ifeq (${USE_SSE2}, 1) - DEFS += -DUSE_SSE2 - OBJS += obj/scrypt-sse2.o +ifdef USE_SSE2 +DEFS += -DUSE_SSE2 +OBJS += obj/scrypt-sse2.o + obj/scrypt-sse2.o: scrypt-sse2.cpp $(HEADERS) g++ -c $(CFLAGS) -MMD -o $@ $< endif +endif + + obj/%.o: %.cpp $(HEADERS) g++ -c $(CFLAGS) -o $@ $< diff --git a/src/makefile.osx b/src/makefile.osx index f24eb52..3a4a80c 100644 --- a/src/makefile.osx +++ b/src/makefile.osx @@ -144,14 +144,16 @@ OBJS += obj/scrypt-generic.o obj/scrypt-generic.o: scrypt-generic.c $(CC) -c $(xCXXFLAGS) -MMD -o $@ $< -endif -ifeq (${USE_SSE2}, 1) - DEFS += -DUSE_SSE2 - OBJS += obj/scrypt-sse2.o +ifneq (${USE_SSE2}, 1) and eq (${USE_ASM}, 1) +DEFS += -DUSE_SSE2 +OBJS += obj/scrypt-sse2.o + obj/scrypt-sse2.o: scrypt-sse2.cpp $(CXX) -c $(CFLAGS) -MMD -o $@ $< endif +endif + # auto-generated dependencies: -include obj/*.P diff --git a/src/makefile.unix b/src/makefile.unix index f6eab90..4ef89d5 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -173,14 +173,16 @@ OBJS += obj/scrypt-generic.o obj/scrypt-generic.o: scrypt-generic.c $(CC) -c $(xCXXFLAGS) -MMD -o $@ $< -endif ifeq (${USE_SSE2}, 1) - DEFS += -DUSE_SSE2 - OBJS += obj/scrypt-sse2.o +DEFS += -DUSE_SSE2 +OBJS += obj/scrypt-sse2.o + obj/scrypt-sse2.o: scrypt-sse2.cpp $(CXX) -c $(xCXXFLAGS) -MMD -o $@ $< endif +endif + # auto-generated dependencies: -include obj/*.P