Skip to content

Commit

Permalink
Enable CGO for OS X when building binary.
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfdecyf committed May 17, 2013
1 parent 2bc1e1d commit 1ae9537
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions script/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ cd "$( dirname "${BASH_SOURCE[0]}" )/.."
version=`grep 'const version = ' ./shadowsocks/util.go | sed -e 's/.*= //' | sed -e 's/"//g'`
echo "creating shadowsocks binary version $version"

export CGO_ENABLED=0

ROOT=`pwd`
bindir=$ROOT/bin
mkdir -p $bindir
Expand All @@ -16,6 +14,13 @@ build() {
local GOOS
local GOARCH

if [[ $1 == "darwin" ]]; then
# Enable CGO for OS X so change network location will not cause problem.
export CGO_ENABLED=1
else
export CGO_ENABLED=0
fi

prog=shadowsocks-$4
pushd cmd/$prog
name=$prog-$3-$version
Expand Down

0 comments on commit 1ae9537

Please sign in to comment.