Skip to content
Permalink
Browse files
Merge pull request #4 from geomacy/code-grant-update
Only disable CGO_ENABLED when about to cross-compile.
  • Loading branch information
ahgittin committed Mar 7, 2016
2 parents 3b89cf2 + 767ac8f commit 0142a31adb49eb373e1659a5a52ee16ea96a6fa6
Showing 1 changed file with 5 additions and 6 deletions.
@@ -30,12 +30,7 @@ CLI_PACKAGE="${PROJECT}/${BRNAME}"
GOBIN=go
GODEP=godep

#
# Compile options
#

# Disable use of C code modules (causes problems with cross-compiling)
export CGO_ENABLED=0

#
# Globals
@@ -155,7 +150,7 @@ PATH=${GOPATH}/bin:${PATH}

command -v $GODEP >/dev/null 2>&1 || {
echo installing $GODEP
go get github.com/tools/godep || { echo failed installing dodep ; exit 1; }
go get github.com/tools/godep || { echo failed installing $GODEP ; exit 1; }
}

command -v $GODEP >/dev/null 2>&1 || {
@@ -185,6 +180,10 @@ fi

mkdir -p ${GOPATH}/bin

# Disable use of C code modules (causes problems with cross-compiling)
export CGO_ENABLED=0

# Build as instructed
if [ -z "$os" -a -z "$all" ]; then
echo "Building $BRNAME for native OS/ARCH"
$GODEP $GOBIN build -ldflags "-s" -o "${GOPATH}/bin/${BRNAME}${label}${timestamp}" $CLI_PACKAGE || exit $?

0 comments on commit 0142a31

Please sign in to comment.