aboutsummaryrefslogtreecommitdiffhomepage
path: root/protoc-artifacts/build-protoc.sh
diff options
context:
space:
mode:
Diffstat (limited to 'protoc-artifacts/build-protoc.sh')
-rwxr-xr-xprotoc-artifacts/build-protoc.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh
index 50c4b349..714b1bec 100755
--- a/protoc-artifacts/build-protoc.sh
+++ b/protoc-artifacts/build-protoc.sh
@@ -71,7 +71,13 @@ checkArch ()
fi
elif [[ "$OS" == osx ]]; then
format="$(file -b "$1" | grep -o "[^ ]*$")"
- assertEq $format "x86_64" $LINENO
+ if [[ "$ARCH" == x86_32 ]]; then
+ assertEq $format "i386" $LINENO
+ elif [[ "$ARCH" == x86_64 ]]; then
+ assertEq $format "x86_64" $LINENO
+ else
+ fail "Unsupported arch: $ARCH"
+ fi
else
fail "Unsupported system: $(uname)"
fi
@@ -120,6 +126,13 @@ elif [[ "$(uname)" == Linux* ]]; then
fi
elif [[ "$(uname)" == Darwin* ]]; then
assertEq "$OS" osx $LINENO
+ if [[ "$ARCH" == x86_64 ]]; then
+ CXXFLAGS="$CXXFLAGS -m64"
+ elif [[ "$ARCH" == x86_32 ]]; then
+ CXXFLAGS="$CXXFLAGS -m32"
+ else
+ fail "Unsupported arch: $ARCH"
+ fi
else
fail "Unsupported system: $(uname)"
fi