It only depends on the standard library
It could also depend implicitly upon other things (think of resources like fonts, configuration files under /etc/
, header files under /usr/include/
, availability of /proc/
, of /sys/
, external programs run by system(3) or execvp(3), specific file systems or devices, particular ioctl
-s, available or required plugins, etc...)
These are kind of details which might make the porting difficult. For example look into nsswitch.conf(5).
The evil is in the details.
(in other words, without a lot more details, your question don't have much sense)
Linux is perceived as a free software ecosystem. The usual way of porting something is to recompile it on -or at least for- the target Linux distribution. When you do that several times (for different and many Linux distros), you'll understand what details are significant in your particular software (and distributions).
Most of the time, recompiling and porting a library on a different distribution is really easy. Sometimes, it might be hard.
For shared libraries, reading Program Library HowTo, C++ dlopen miniHowTo, elf(5), your ABI specification (see here for some incomplete list), Drepper's How To Write Shared Libraries could be useful.
My recommendation is to prepare binary packages for various common Linux distributions. For example, a .deb
for Debian & Ubuntu (some particular versions of them).
Of course a .deb
for Debian might not work on Ubuntu (sometimes it does).
Look also into things like autoconf (or cmake). You may want at least to have some externally provided #define
-d preprocessor strings (often passed by -D
to gcc
or g++
) which would vary from one distribution to the next (e.g. on some distributions, you print by popen
-ing lp
, on others, by popen
-ing lpr
, on others by interacting with some CUPS server etc...). Details matter.
My only interaction with the system is to open files
But even these vary a lot from one distribution to another one.
It is probable that you won't be able to provide a single -and the same one- lib*.a
for several distributions.
NB: you probably need to budget more work than what you believe.