summaryrefslogtreecommitdiff
path: root/script/with-static.sh
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-31 19:46:38 +0000
committerCarlos Martín Nieto <[email protected]>2014-12-31 19:46:38 +0000
commitdae3004ca339f568db8991cf4d93d0ad6fbaffd1 (patch)
tree5dbc19b7a1d5d6faa8fecf4c8b6b2c4559084d4e /script/with-static.sh
parentdb3754ce8db412a7fd82cca2d0f91ddbcf90b475 (diff)
parentef839080596bd9fbead5db1e91f698bebfd4024a (diff)
Merge pull request #162 from libgit2/revert-159-cgo-directives
Revert "Make the cgo tool do more linking work"
Diffstat (limited to 'script/with-static.sh')
-rwxr-xr-xscript/with-static.sh12
1 files changed, 12 insertions, 0 deletions
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"
+
+$@