diff options
author | Kun Zhang <zhangkun@google.com> | 2015-03-31 22:07:13 +0100 |
---|---|---|
committer | Kun Zhang <zhangkun@google.com> | 2015-03-31 15:46:40 -0700 |
commit | 36093ca45e544bb92ec67962130aaea31aa7c9d1 (patch) | |
tree | 4d052de7fb2782cc41ae7abfcb9c893cbcf5c5ba /protoc-artifacts/build-protoc.sh | |
parent | cd4e9e72fbcc7032b440df56a0352106d2c7d0b5 (diff) | |
download | protobuf-36093ca45e544bb92ec67962130aaea31aa7c9d1.tar.gz protobuf-36093ca45e544bb92ec67962130aaea31aa7c9d1.tar.bz2 protobuf-36093ca45e544bb92ec67962130aaea31aa7c9d1.zip |
Tweak flags to make statically-linked binary under Cygwin
Diffstat (limited to 'protoc-artifacts/build-protoc.sh')
-rwxr-xr-x | protoc-artifacts/build-protoc.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/protoc-artifacts/build-protoc.sh b/protoc-artifacts/build-protoc.sh index 137c5d63..8293311a 100755 --- a/protoc-artifacts/build-protoc.sh +++ b/protoc-artifacts/build-protoc.sh @@ -2,7 +2,18 @@ # Override the default value set in configure.ac that has '-g' which produces # huge binary. -export CXXFLAGS=-DNDEBUG +export CXXFLAGS="-DNDEBUG" + +# Statically link libgcc and libstdc++ +export LDFLAGS="-static-libgcc -static-libstdc++" + +# Under Cygwin we use MinGW GCC because the executable produced by Cygwin GCC +# depends on Cygwin DLL. +if [[ "$(uname)" == CYGWIN* ]]; then + export CC=i686-pc-mingw32-gcc + export CXX=i686-pc-mingw32-c++ + export CXXCPP=i686-pc-mingw32-cpp +fi cd $(dirname "$0")/.. && ./configure --disable-shared && make && cd src && (strip protoc || strip protoc.exe) |