diff options
author | Determinant <[email protected]> | 2019-12-06 10:12:06 -0500 |
---|---|---|
committer | Determinant <[email protected]> | 2019-12-06 10:12:06 -0500 |
commit | 5266d3a41ceb38108cedeed646902f3252cb4f53 (patch) | |
tree | a45273a29aea118d0b63e374a2b3229444e97cda /scripts | |
parent | b6d1796be78b1156d835f8a81efbf8cc24750520 (diff) |
add setup.sh
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.sh | 9 | ||||
-rw-r--r-- | scripts/env.sh | 3 |
2 files changed, 6 insertions, 6 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index 1cf1488..2443a76 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,23 +1,22 @@ #!/bin/bash -e -prefix="$(pwd)/build" +prefix="${1:-$(pwd)}/build" SRC_DIR="$(dirname "${BASH_SOURCE[0]}")" source "${SRC_DIR}/env.sh" if [[ "$OSTYPE" == "linux-gnu" ]]; then - go get -d "github.com/$SALTICIDAE_ORG/salticidae-go" + go get -u -d "github.com/$SALTICIDAE_ORG/salticidae-go" cd "$SALTICIDAE_PATH" cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$SALTICIDAE_PATH/build" . make -j4 make install cd - + rm -f "$prefix/libsalticidae.a" + ln -sv "$GOPATH/src/github.com/$SALTICIDAE_ORG/salticidae-go/salticidae/libsalticidae.a" "$prefix/libsalticidae.a" elif [[ "$OSTYPE" == "darwin"* ]]; then brew install Determinant/salticidae/salticidae else echo "Your system is not supported yet." exit 1 fi - -rm -f "$prefix/libsalticidae.a" -ln -sv "$GOPATH/src/github.com/$SALTICIDAE_ORG/salticidae-go/salticidae/libsalticidae.a" "$prefix/libsalticidae.a" diff --git a/scripts/env.sh b/scripts/env.sh index 318c483..2e32fd5 100644 --- a/scripts/env.sh +++ b/scripts/env.sh @@ -1,8 +1,9 @@ export GOPATH="$(go env GOPATH)" export SALTICIDAE_ORG="Determinant" +export SALTICIDAE_GO_PATH="$GOPATH/src/github.com/$SALTICIDAE_ORG/salticidae-go" if [[ "$OSTYPE" == "linux-gnu" ]]; then - export SALTICIDAE_PATH="$GOPATH/src/github.com/$SALTICIDAE_ORG/salticidae-go/salticidae" + export SALTICIDAE_PATH="$SALTICIDAE_GO_PATH/salticidae" export CGO_CFLAGS="-I$SALTICIDAE_PATH/build/include/" export CGO_LDFLAGS="-L$SALTICIDAE_PATH/build/lib/ -lsalticidae -luv -lssl -lcrypto -lstdc++" elif [[ "$OSTYPE" == "darwin"* ]]; then |