For When You Can't Have The Real Thing
[ start | index | login ]
start > Linux > Building Static Programs

Building Static Programs

Created by dave. Last edited by dave, 12 years and 314 days ago. Viewed 1,913 times. #1
[edit] [rdf]
labels
attachments
Sometimes you don't have access to the fancy dynamically-loaded libraries in your runtime environment that your build environment has. In the extreme, you might have no dynamic libraries.

To build your program so that it is a staticly-linked binary, you might try:

export CFLAGS='-static'
...before your ./configure and make commands.

This doesn't work in nearly all circumstances, but in some simple cases it might.

This worked for me when building a rsync for my webhost environment which lacked certain libraries (specifically, a magic version of libc).

no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt