Mailinglist Archive: opensuse-programming (42 mails)

< Previous Next >
Re: [suse-programming-e] Creating static binaries with autotools
  • From: Davi de Castro Reis <davicastro@xxxxxxxxxxxx>
  • Date: Mon, 03 May 2004 09:55:21 -0300
  • Message-id: <40964139.8040909@xxxxxxxxxxxx>
William A. Mahaffey III wrote:
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'?

Thanks in advance,
Davi de Castro Reis

You should be able to put an entry in your Makefile to do whatever you do to manually make the static binary. Static versions of all the dynamic libraries must exist, of course.

Yes I can do, but it is not simple command line and it depends on a lot of user-specified variables (LDFLAGS, CXXFLAGS, CPPFLAGS, CC), and I do it with several different packages. What I want to know if there is some way that I can tell autoconf or automake to generate this entry in the Makefile for me. Something like a STATIC_PROGRAMS = xxxx or AC_CONFIG_STATIC().

Davi de Castro Reis

< Previous Next >
List Navigation