#!/bin/sh

set -ex

export BUILD="$PWD/vendor/libgit2/build"
export PCFILE="$BUILD/libgit2.pc"

export CGO_LDFLAGS="$BUILD/libgit2.a -L$BUILD $(pkg-config --static --libs $PCFILE)"
export CGO_CFLAGS="-I$PWD/vendor/libgit2/include"

$@

#!/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"

$@

Exit when pkg-config isn't found
Exit when pkg-config isn't found

We run pkg-config in a subshell, so our 'set -e' does not take effect
there. Explicitly error out if there was an error running pkg-config.
