The core protocol of WoopChain
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
woop/scripts/setup_bls_build_flags.sh

34 lines
1.1 KiB

# no shebang; to be sourced from other scripts
unset -v progdir
case "${0}" in
*/*) progdir="${0%/*}";;
*) progdir=.;;
esac
unset -v gopath
gopath=$(go env GOPATH)
# HMY_PATH is the common root directory of all harmony repos
HMY_PATH="${gopath%%:*}/src/github.com/harmony-one"
if [ ! -d $HMY_PATH ]; then
# "env pwd" uses external pwd(1) implementation and not the Bash built-in,
# which does not fully dereference symlinks.
HMY_PATH=$(cd $progdir/../.. && env pwd)
fi
: ${OPENSSL_DIR="/usr/local/opt/openssl"}
: ${MCL_DIR="${HMY_PATH}/mcl"}
: ${BLS_DIR="${HMY_PATH}/bls"}
export CGO_CFLAGS="-I${BLS_DIR}/include -I${MCL_DIR}/include"
export CGO_LDFLAGS="-L${BLS_DIR}/lib"
export LD_LIBRARY_PATH=${BLS_DIR}/lib:${MCL_DIR}/lib
OS=$(uname -s)
case $OS in
Darwin)
export CGO_CFLAGS="-I${BLS_DIR}/include -I${MCL_DIR}/include -I${OPENSSL_DIR}/include"
export CGO_LDFLAGS="-L${BLS_DIR}/lib -L${OPENSSL_DIR}/lib"
export LD_LIBRARY_PATH=${BLS_DIR}/lib:${MCL_DIR}/lib:${OPENSSL_DIR}/lib
export DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH
;;
esac