summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2014-12-27 10:59:19 +0000
committerCarlos Martín Nieto <[email protected]>2014-12-27 10:59:19 +0000
commit8f6e13bd08d2f37027d34c0f379a79a6c5263e8a (patch)
tree0e16bdf81b0540c47e0575ad8e6ffcd8481c3577 /script
parent74957c2ae6dc852a50de54fc788f207d8f385d67 (diff)
Make the cgo tool do more linking work
The cgo directives let us do a lot more than I previously thought, so we can use this to make the building process of git2go go through the go tool directly rather than via the script. libgit2 still needs to be built manually, so we do still require make, but only for building libgit2. Once that's built, any modifications to git2go's own code can be built with go build
Diffstat (limited to 'script')
-rwxr-xr-xscript/build-libgit2-static.sh4
-rwxr-xr-xscript/with-static.sh12
2 files changed, 2 insertions, 14 deletions
diff --git a/script/build-libgit2-static.sh b/script/build-libgit2-static.sh
index 5723721..0a6c39f 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=../install \
+ -DCMAKE_INSTALL_PREFIX=. \
.. &&
cmake --build .
diff --git a/script/with-static.sh b/script/with-static.sh
deleted file mode 100755
index 3f60e31..0000000
--- a/script/with-static.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/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"
-
-$@