From 9ef265d9de2234c7964ef078c51bafc77193ac6e Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Sat, 8 Apr 2017 16:48:20 -0400 Subject: [PATCH] Don't add scrypt objects in twice. --- platform-independent/cli-c/build | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/platform-independent/cli-c/build b/platform-independent/cli-c/build index f2c7d869..0d6a00d3 100755 --- a/platform-independent/cli-c/build +++ b/platform-independent/cli-c/build @@ -214,18 +214,22 @@ depend() { } depend_scrypt() { if haslib sodium; then - CFLAGS+=" -DHAS_SODIUM=1" - LDFLAGS+=" -lsodium" + if [[ $CFLAGS != *HAS_SODIUM=1* ]]; then + CFLAGS+=" -DHAS_SODIUM=1" + LDFLAGS+=" -lsodium" + fi return fi depend scrypt - local objects=( - "lib/scrypt/src/libcperciva/"*/*.o - "lib/scrypt/src/lib/crypto/"*.o - ) - CFLAGS+=" -DHAS_CPERCIVA=1" - LDFLAGS+=" -Llib/scrypt/src ${objects[*]}" + if [[ $CFLAGS != *HAS_CPERCIVA=1* ]]; then + local objects=( + "lib/scrypt/src/libcperciva/"*/*.o + "lib/scrypt/src/lib/crypto/"*.o + ) + CFLAGS+=" -DHAS_CPERCIVA=1" + LDFLAGS+=" -Llib/scrypt/src ${objects[*]}" + fi }