Question

I'm wondering which Linux distribution would be best (i.e. introduces the least dependencies) when linking a binary that should work on as many distributions as possible against shared libraries.

I've done it on Ubuntu, but the list of dependencies is horrible. SDL introduces PulseAudio and whatnot. My next guess would be to use Debian lenny - what's the best distribution for that in your opinion?

Was it helpful?

Solution

If you look at QT documentation, http://doc.trolltech.com/4.6/deployment-x11.html section "Creating the Application Package" they suggest to create a package like a Mac bundle, with a shell script to start it.

You can do the same thing; you will have to create the libraries you need and include them in your package which will make it bigger unfortunately. At least this should encourage you to only link to the libs you need :)

OTHER TIPS

If you do not want to release your source and compile it on the target systems using an installation script, then provide everything statically linked or ship your own so files and use LD_LIBRARY_PATH and LD_PRELOAD environment variables in the script used to start your executable. (An example on how it is done can be seen in the mozilla firefox packaging)

Also legal issues apply: NEVER use GPL code. And do never link statically against LGPL code (among other issues).

Any other solution leaves too much room for good or bad luck and will generate nothing but frustration.

If I recall correctly, linking against SDL on one distro that has pulseaudio as an SDL dependency does not mean your program must always be linked against pulseaudio on every distro. You don't actually have to put an -lpulseaudio on your compile line, do you? sdl-config --libs on my Ubuntu box doesn't list it.

The correct way to produce software for Linux is to put one tarball of source code per release in a stable location on your website, and let the distributions deal with everything else. Don't try to produce binaries yourself. You will save yourself from an unending supply of grief.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top