Reputation: 1130
I'm working on an audio library that's targeting both Windows and Linux. For the Windows backends I support DirectSound, WASAPI and ASIO, and for Linux it's ALSA, JACK and PulseAudio. Recently the topic of static vs. shared/dynamic linking of the c/c++ runtime (msvcrt/libc/libgcc/libstdc++) and additional dependencies came up, in light of being self-contained and library-version-independent. I decided to settle on static linking everything (DirectSound, WASAPI, ASIO and msvcrt) for Windows, because DirectSound and WASAPI are built-in, and I compile ASIO from source. But for Linux things seem a bit more complicated. This here: https://insanecoding.blogspot.com/2012/07/creating-portable-linux-binaries.html suggests I'm reasonably safe by static linking libgcc and libstdc++, but not libc itself (correct me if I'm wrong). But i have absolutely no clue about what to do with libasound, libpulse, and libjack-jackd2. APT packages even seem to provide only .so's, not .a's.
So my question basically boils down to this: how do I produce a shared library (.so) on linux, using all of libc, libgcc, libstdc++, libasound, libjack, and libpulse, while being as much self-contained as possible, require end-users to install as little as possible, and run on a as wide variety of linux distros as possible (not interested in other *NIXes).
If it makes any difference, the main goal (for now) is to publish wrapper libraries around this native binary both for .NET on nuget.org and Java on Maven central. I just want a consumer of the package to be able to say "packagereference include=audiolib" and be done with it, then be able to run on a wide range of platforms.
Really appreciate if someone from the ALSA/Pulse/JACK team can shed some light on this as there's at least some material out there on static linking GCC's runtimes, but next to nothing on the specific audio libs.
Upvotes: 3
Views: 1134
Reputation: 11
I did a quick google search and here's what I gathered:
Upvotes: 1