Blog

thrift compiler のバイナリを static build したい

http://archive.apache.org/dist/thrift/ からダウンロードする。

https://stackoverflow.com/questions/20068947/how-to-static-link-linux-software-that-uses-configure

linux の場合

sudo yum install glibc-static -y
./configure --enable-static --without-ruby --without-nodejs --without-php --without-python --without-c_glib --without-go --without-nodejs --without-lua CFLAGS="-static"
make -j9 LDFLAGS="-all-static"

osx の場合

osx では static build ができないので諦める。

brew install bison
export PATH="/usr/local/opt/bison/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/bison/lib"
./configure --without-ruby --without-nodejs --without-php --without-python --without-c_glib --without-go --without-nodejs --without-lua
make -j 9