From effb2b076a3af184e18df827bd2854bd7e419a10 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Thu, 11 Apr 2019 17:28:51 +0800 Subject: ffi/go: remove libcrypto dependency and build static on linux by default libbls384.a must be built with MCL_USE_OPENSSL=0 --- .travis.yml | 8 +++----- ffi/go/bls/bls.go | 2 +- images/bls-go-alpine/Dockerfile | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71a667a..d877e21 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,13 +18,11 @@ addons: install: - git clone --depth 1 https://github.com/dexon-foundation/mcl.git $TRAVIS_BUILD_DIR/../mcl script: -- make -j3 -- make test_ci DISABLE_THREAD_TEST=1 -- make test_go -- env LD_LIBRARY_PATH=../mcl/lib bin/bls_c384_test.exe -- make clean && make -C ../mcl clean - make -j3 MCL_USE_OPENSSL=0 - make test_ci DISABLE_THREAD_TEST=1 MCL_USE_OPENSSL=0 +- make test_go MCL_USE_OPENSSL=0 +- env LD_LIBRARY_PATH=../mcl/lib bin/bls_c384_test.exe +- make clean && make -C ../mcl clean - docker build --tag "$IMAGE_TAG" . -f images/bls-go-alpine/Dockerfile --no-cache before_deploy: - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin diff --git a/ffi/go/bls/bls.go b/ffi/go/bls/bls.go index e9a6be3..c83a4e6 100644 --- a/ffi/go/bls/bls.go +++ b/ffi/go/bls/bls.go @@ -11,7 +11,7 @@ package bls #cgo !bn256,!bn384,!bn384_256 LDFLAGS:${SRCDIR}/../../../lib/libbls384.a #cgo CFLAGS:-I${SRCDIR}/../../../include -I${SRCDIR}/../../../../mcl/include #cgo LDFLAGS:${SRCDIR}/../../../../mcl/lib/libmcl.a -lgmpxx -lgmp -#cgo pkg-config: libcrypto +#cgo linux LDFLAGS:-static typedef unsigned int (*ReadRandFunc)(void *, void *, unsigned int); int wrapReadRandCgo(void *self, void *buf, unsigned int n); #include diff --git a/images/bls-go-alpine/Dockerfile b/images/bls-go-alpine/Dockerfile index edd49eb..9419a32 100644 --- a/images/bls-go-alpine/Dockerfile +++ b/images/bls-go-alpine/Dockerfile @@ -9,4 +9,4 @@ RUN mkdir work ; cd work RUN git clone --depth 1 git://github.com/dexon-foundation/mcl.git RUN mkdir bls COPY . bls/ -RUN cd bls ; make clean && make test_go DOCKER=alpine -j && cp lib/* /usr/lib/ +RUN cd bls ; make clean && make test_go MCL_USE_OPENSSL=0 DOCKER=alpine -j && cp lib/* /usr/lib/ -- cgit v1.2.3