aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWei-Ning Huang <w@dexon.org>2019-04-11 17:28:51 +0800
committerWei-Ning Huang <w@dexon.org>2019-04-11 19:34:45 +0800
commiteffb2b076a3af184e18df827bd2854bd7e419a10 (patch)
tree97094fc5fc0de27c9f29049536d924ffdd3d7371
parentb0a83abe7389df7f4c45adc3b52d957f3996322d (diff)
downloaddexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar.gz
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar.bz2
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar.lz
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar.xz
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.tar.zst
dexon-bls-effb2b076a3af184e18df827bd2854bd7e419a10.zip
ffi/go: remove libcrypto dependency and build static on linux by default
libbls384.a must be built with MCL_USE_OPENSSL=0
-rw-r--r--.travis.yml8
-rw-r--r--ffi/go/bls/bls.go2
-rw-r--r--images/bls-go-alpine/Dockerfile2
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 <bls/bls.h>
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/