Davi de Castro Reis wrote:
Hi guys,
Does someone know how can I create static binaries using autotools? I have a program that uses several dynamic libraries and I want to distribute it as a single static binary. Everytime I want to distribute it, I do a make (the Makefile is generated from configure), then I delete the binary, and do the last linking step myself, using the static flag. This is quite boring. Does someone know a way to create a 'make static'?
Are you looking for the following? ./configure --enable-shared=yes --enable-shared=no These options are standard if your project is built with libtool support. And it is very hard to build shared libraries without libtool support. If you are frequently rebuilding, you can put AC_DISABLE_SHARED before AC_PROG_LIBTOOL in your configure.ac or configure.in file. I suspect that's what you want. I use the opposite: I try to force shared object builds as the default because C++ doesn't work so well with static libraries. -- JDL