As I’ve haven’t found a proper way to link program (writteln in c++) statically if I’m going to use plug-ins in it (linker warns that dlopen require glibc shared libraries at runtime). Also I’m not able not build dynamically-linked binaries for most of linux distibutions currently, so I could either distribute source only or try to distribute binaries along with shared libraries found in my system by ldd, for example:
libc.so.6
libdl.so.2
libgcc_s.so.1
libm.so.6
libstdc++.so.6
since I suppose that it is more easy for user to be asked to add to .bash_profile
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path to program directory>
than to compile program and plugins from scratch.
So, first of all, am I right that I could re-distribute those libraries freely because they are licensed under GNU LGPL?
And does it makes any sense to do it, will the program run in most linux distributions and its versions correctly?
The best way to distribute binaries is to publish your program in source form with a free license (like GPL); then distribution makers (and contributors) will eventually package your program for their distribution (and you don’t have to bother with that).
Otherwise, you could distribute binary packages for some few major Linux distributions (eg
.debfor Debian or Ubuntu with.rpmfor Redhat or Centos or Mandriva).Some non-free software (like AMD/ATI Catalyst fglrx for driving ATI graphics card) are distributed in a form which generates appropriate binary packages (on the end-user machine).
All the libraries you mention are available in every standard not too old Linux distribution. You don’t need to distribute them, just mention that you need them (and give a precise list of them, with their version number).
I would really avoid [re-] distributing the system libraries like
libc.so.6orlibstdc++.so.6; the main reason to avoid distributing them is that your user (installing your copies on his system) will very probably make a big mess on his own system (and that could break other existing programs, which will make your user pissed off). Of course, if you choose (wrongly in my opinion) to distribute them, you have to comply with their license. But your users already have them, and by re-distributing them you increase the probability of a big mess. So just give the binary executable of your program (suitably packaged), without the system libraries that it requires.All package managers (and package formats) deal with dependencies (on other packages), so will install e.g.
libstdc++.so.6in the rare cases when the user’s system don’t have it already.