From 240fdaa384fb247b2e352fb211916a51b24fead9 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 03:11:54 +0100 Subject: [PATCH 1/6] add cclib to makefile --- zcutil/build.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zcutil/build.sh b/zcutil/build.sh index 08517475c..68239e16e 100755 --- a/zcutil/build.sh +++ b/zcutil/build.sh @@ -101,6 +101,21 @@ eval "$MAKE" --version as --version ld -v +#BUILD CCLIB + +WD=$PWD +cd src/cc +echo $PWD + +if make "$@"; then + echo CCLIB BUILD SUCCESSFUL +else + echo CCLIB BUILD FAILED + exit 1 +fi + +cd $WD + HOST="$HOST" BUILD="$BUILD" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1 ./autogen.sh From 5fe3792aef1b662640e37d5c076e7793b3ac5445 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 03:13:21 +0100 Subject: [PATCH 2/6] create cclib Makefile --- src/cc/Makefile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/cc/Makefile diff --git a/src/cc/Makefile b/src/cc/Makefile new file mode 100644 index 000000000..5848d46dd --- /dev/null +++ b/src/cc/Makefile @@ -0,0 +1,19 @@ +SHELL = /bin/sh +CC = gcc +#CXXFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +DEBUGFLAGS = -O0 -D _DEBUG +RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program + +TARGET = ../cclib.so +SOURCES = cclib.cpp +#HEADERS = $(shell echo ../cryptoconditions/include/*.h) +all: $(TARGET) + +$(TARGET): $(SOURCES) + $(info Building cclib.so to src/) + $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) + +clean: + rm -rf $(TARGET) + From 4357791ede3f46e63fab14dfd3b12a321ebff2c9 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 05:04:14 +0100 Subject: [PATCH 3/6] [update] cclib multiOS Makefile --- src/cc/Makefile | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/src/cc/Makefile b/src/cc/Makefile index 5848d46dd..24d13690c 100644 --- a/src/cc/Makefile +++ b/src/cc/Makefile @@ -1,19 +1,32 @@ -SHELL = /bin/sh -CC = gcc -#CXXFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -CFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c -DEBUGFLAGS = -O0 -D _DEBUG -RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program - +SHELL = /bin/sh +CC = gcc +CC_WIN = x86_64-w64-mingw32-gcc-posix +CFLAGS_DARWIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CFLAGS_WIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +DEBUGFLAGS = -O0 -D _DEBUG +RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program +$(info $(OS)) +OS := $(shell uname -s) +$(info $(OS)) TARGET = ../cclib.so +TARGET_WIN = ../cclib.dll SOURCES = cclib.cpp #HEADERS = $(shell echo ../cryptoconditions/include/*.h) + all: $(TARGET) $(TARGET): $(SOURCES) $(info Building cclib.so to src/) +ifeq ($(OS),Darwin) + $(CC) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) +else ifeq ($(OS),Linux) $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) +#else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host +else + $(info else) + #$(CC)_WIN $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) +endif clean: rm -rf $(TARGET) - From 1dbed5f02024e62783f3b8cf74652a0e9179fc45 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 05:06:51 +0100 Subject: [PATCH 4/6] [update] cclib multiOS Makefile --- src/cc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/Makefile b/src/cc/Makefile index 24d13690c..3522a0c08 100644 --- a/src/cc/Makefile +++ b/src/cc/Makefile @@ -17,7 +17,7 @@ SOURCES = cclib.cpp all: $(TARGET) $(TARGET): $(SOURCES) - $(info Building cclib.so to src/) + $(info Building cclib to src/) ifeq ($(OS),Darwin) $(CC) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) else ifeq ($(OS),Linux) @@ -25,7 +25,7 @@ else ifeq ($(OS),Linux) #else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host else $(info else) - #$(CC)_WIN $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) + #$(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) endif clean: From 12ebbabfd6b21b77400bddd933cb9f5b04db4481 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 05:11:14 +0100 Subject: [PATCH 5/6] [update] OSX Makefile --- zcutil/build-mac.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/zcutil/build-mac.sh b/zcutil/build-mac.sh index 138508cb5..a3619111f 100755 --- a/zcutil/build-mac.sh +++ b/zcutil/build-mac.sh @@ -42,6 +42,21 @@ PREFIX="$(pwd)/depends/$TRIPLET" make "$@" -C ./depends/ V=1 NO_QT=1 NO_PROTON=1 +#BUILD CCLIB + +WD=$PWD +cd src/cc +echo $PWD + +if make "$@"; then + echo CCLIB BUILD SUCCESSFUL +else + echo CCLIB BUILD FAILED + exit 1 +fi + +cd $WD + ./autogen.sh CPPFLAGS="-I$PREFIX/include -arch x86_64" LDFLAGS="-L$PREFIX/lib -arch x86_64 -Wl,-no_pie" \ CXXFLAGS='-arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I$PREFIX/include -fwrapv -fno-strict-aliasing -Werror -g -Wl,-undefined -Wl,dynamic_lookup' \ From 9307591c1435a0881e74a9f25073b3ff39f87cd7 Mon Sep 17 00:00:00 2001 From: ca333 Date: Sun, 20 Jan 2019 06:45:59 +0100 Subject: [PATCH 6/6] [update] OSX cclib Makefile --- src/cc/Makefile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cc/Makefile b/src/cc/Makefile index 3522a0c08..a3c54d81d 100644 --- a/src/cc/Makefile +++ b/src/cc/Makefile @@ -1,7 +1,8 @@ SHELL = /bin/sh CC = gcc +CC_DARWIN = g++-6 CC_WIN = x86_64-w64-mingw32-gcc-posix -CFLAGS_DARWIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c +CFLAGS_DARWIN = -std=c++11 -arch x86_64 -I/usr/local/Cellar/gcc\@6/6.4.0_2/include/c++/6.4.0/ -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -c -Wl,-undefined -Wl,dynamic_lookup CFLAGS = -std=c++11 -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c CFLAGS_WIN = -std=c++11 -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../cryptoconditions/include -I../cryptoconditions/src -I../cryptoconditions/src/asn -I.. -I. -fPIC -shared -c DEBUGFLAGS = -O0 -D _DEBUG @@ -19,13 +20,13 @@ all: $(TARGET) $(TARGET): $(SOURCES) $(info Building cclib to src/) ifeq ($(OS),Darwin) - $(CC) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) + $(CC_DARWIN) $(CFLAGS_DARWIN) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) else ifeq ($(OS),Linux) $(CC) $(CFLAGS) $(DEBUGFLAGS) -o $(TARGET) $(SOURCES) #else ifeq ($(WIN_HOST),True) - todo: pass ENV var from build.sh if WIN host else - $(info else) - #$(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) + $(info WINDOWS) + $(CC_WIN) $(CFLAGS_WIN) $(DEBUGFLAGS) -o $(TARGET_WIN) $(SOURCES) endif clean: