From 476c759f5e2ea3949cf3aaf4e60ccc7e0439ee73 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Tue, 18 Sep 2018 13:07:38 +0800 Subject: bin: allow non-root homebrew install to work (#113) In order for non-root homebrew install to work, we need to setup some custom CFLAGS and LDFLAGS variables, we also need to patch the mcl library so we are able to build. A PR is sent to the mcl upstream, the local patch will be removed once the upstream PR is merged. --- bin/env.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bin/env.sh (limited to 'bin/env.sh') diff --git a/bin/env.sh b/bin/env.sh new file mode 100644 index 0000000..ca884b4 --- /dev/null +++ b/bin/env.sh @@ -0,0 +1,11 @@ +# Environment variables for the project. + +# Setup custom build flags for non-root homebrew installation. +if [ "$(uname -o)" = "Darwin" ] && [ "$(brew --prefix)" != "/usr/local" ]; then + export BLS256_SLIB_LDFLAGS="-L$(brew --prefix gmp)/lib" + export BLS384_SLIB_LDFLAGS="-L$(brew --prefix gmp)/lib" + + export CFLAGS="-I$(brew --prefix gmp)/include -I$(brew --prefix openssl)/include $CFLAGS" + export LDFLAGS="-L$(brew --prefix gmp)/lib $LDFLAGS -L$(brew --prefix openssl)/lib $LDFLAGS" + export CGO_LDFLAGS=$LDFLAGS +fi -- cgit