2015-03-25 23:07:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2015-04-01 01:26:28 +00:00
|
|
|
cd $(dirname "$0")
|
|
|
|
WORKING_DIR=$(pwd)
|
|
|
|
|
2015-03-25 23:07:50 +00:00
|
|
|
# Override the default value set in configure.ac that has '-g' which produces
|
|
|
|
# huge binary.
|
2015-03-31 21:07:13 +00:00
|
|
|
export CXXFLAGS="-DNDEBUG"
|
|
|
|
|
2015-03-31 23:28:57 +00:00
|
|
|
# Statically link libgcc and libstdc++.
|
|
|
|
# -s to produce stripped binary
|
|
|
|
export LDFLAGS="-static-libgcc -static-libstdc++ -s"
|
2015-03-31 21:07:13 +00:00
|
|
|
|
|
|
|
# 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
|
2015-03-25 23:07:50 +00:00
|
|
|
|
2015-04-01 01:26:28 +00:00
|
|
|
cd "$WORKING_DIR"/.. && ./configure --disable-shared && make clean && make &&
|
|
|
|
cd "$WORKING_DIR" && mkdir -p target &&
|
|
|
|
(cp ../src/protoc target/protoc.exe || cp ../src/protoc.exe target/protoc.exe)
|