Distro-independent binaries

I want to distribute this project I'm working on, but since I can't get my head around the GNU build system (checking for available libraries, specifically), I'd prefer distributing compiled binaries.

Has anyone had luck at this? In case it helps, the project uses a few shared libraries.

On a related subject, what books/sources did you learn the GNU build system from?
A few points:
1. If you distribute your own binaries, then you'll be confined to one platform.
2. Not all Linux systems use the same method of distribution. Debian uses apt, RedHat uses RPM ...
3. This is a few years old now, but most GNU projects seem to use autoconf/libtool. http://sources.redhat.com/autobook/
Since the project only compiles in a couple of OSs anyway, this is not a problem for me.

I would only distribute the binary file on its own, maybe with an installation script.
Last edited on
There are two schools of though on Unix installs. I hope I don't start a flame war here, it can be a very emotive issue.

1. The first integrates with the rest of the system. Dependent libraries are installed if necessary with versioned file names (like libMyLib.so.1.0.0). These tend to go in /usr/local/ ...

2. The second is to install all your dependecies yourself, so you have a self contained installation directory, with possible duplicate copies of libraries across the system. These tend to go in /opt/. A sample installation might look like:
/opt/MyCoolProj/bin/myserver1
/opt/MyCoolProj/bin/myserver2
/opt/MyCoolProj/etc/coolproj.conf
/opt/MyCoolProj/bin/libmylib.so
/opt/MyCoolProj/lib/libvorbis.so.0.3.0
/opt/MyCoolProj/lib/libvcard.so.0.0.0
I was actually looking for some way to statically link. I think that would be ideal, in this case.
I'm not sure what you're asking. If you want the syntax for creating a static lib and using it:
1
2
3
4
5
6
g++ -c util1.cpp
g++ -c util2.cpp
ar rcs libmyutils.a util1.o util2.o

g++ -c main.cpp
g++ main.o libmyutils.a -o myapp
No, no.

I'm using some dynamic libraries. I would like to find a way to link them statically.
Last edited on
You need to link against a statically built libary (.a), not one built for dynamic linking. So it comes down to how the library your linking against is built.
Topic archived. No new replies allowed.