diff options
| author | Carlos Martín Nieto <[email protected]> | 2014-12-31 19:46:38 +0000 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2014-12-31 19:46:38 +0000 |
| commit | dae3004ca339f568db8991cf4d93d0ad6fbaffd1 (patch) | |
| tree | 5dbc19b7a1d5d6faa8fecf4c8b6b2c4559084d4e /script | |
| parent | db3754ce8db412a7fd82cca2d0f91ddbcf90b475 (diff) | |
| parent | ef839080596bd9fbead5db1e91f698bebfd4024a (diff) | |
Merge pull request #162 from libgit2/revert-159-cgo-directives
Revert "Make the cgo tool do more linking work"
Diffstat (limited to 'script')
| -rwxr-xr-x | script/build-libgit2-static.sh | 4 | ||||
| -rwxr-xr-x | script/with-static.sh | 12 |
2 files changed, 14 insertions, 2 deletions
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh index 0a6c39f..5723721 100755 --- a/script/build-libgit2-static.sh +++ b/script/build-libgit2-static.sh @@ -4,7 +4,7 @@ set -ex VENDORED_PATH=vendor/libgit2 -cd "$VENDORED_PATH" && +cd $VENDORED_PATH && mkdir -p install/lib && mkdir -p build && cd build && @@ -13,7 +13,7 @@ cmake -DTHREADSAFE=ON \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_C_FLAGS=-fPIC \ -DCMAKE_BUILD_TYPE="RelWithDebInfo" \ - -DCMAKE_INSTALL_PREFIX=. \ + -DCMAKE_INSTALL_PREFIX=../install \ .. && cmake --build . diff --git a/script/with-static.sh b/script/with-static.sh new file mode 100755 index 0000000..3f60e31 --- /dev/null +++ b/script/with-static.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -ex + +export BUILD="$PWD/vendor/libgit2/build" +export PCFILE="$BUILD/libgit2.pc" + +FLAGS=$(pkg-config --static --libs $PCFILE) || exit 1 +export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD ${FLAGS}" +export CGO_CFLAGS="-I$PWD/vendor/libgit2/include" + +$@ |
