diff options
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 |