4

I'm writing a program that uses OpenAL. When I link against it (I'm using CMake), it also links against libpulse - PulseAudio. This results in the binary not working on other systems. Can I somehow not link against PulseAudio and still use OpenAL on Ubuntu?

Edit: I just figured something out: It's not OpenAL that's dragging PulseAudio in, it's SDL. Is there anything I can do about that?

htorque
  • 64,798

2 Answers2

2

Build the binary separately on each platform you want to supply binary packages for and make sure you distribute the source code so that people on other platforms can build it for themselves.

Note that Linux focuses on source compatibility rather than binary compatibility. Most distributions are not binary compatible with each other (not even Ubuntu and Debian are completely compatible*).

This is a somewhat related question: Technically speaking, what is different about Ubuntu compared to other Linux distributions?

dv3500ea
  • 37,204
  • Source distribution is not really an option. How do the makers of Skype etc. do it? –  Aug 23 '10 at 20:30
  • 1
    Why exactly is source distribution not an option? Be careful and make sure that all libraries you are linking to allow distribution without the source code. You should be OK if they are all licensed under the LGPL but if any are licensed under the GPL, you MUST make the source code available.

    The only way to ensure it works is to build them on each platform you want to support. (To do this you could use something like virtualbox and install Debian, Fedora, OpenSUSE, Windows etc. and build the binary package on them).

    – dv3500ea Aug 23 '10 at 20:44
  • The application is not open source, so I'll have to go for binary distribution. –  Aug 23 '10 at 20:45
  • If it's your program, you could always make it open source :).

    It's completely your choice though, and if you want to only release binary packages it will just mean more work to support different platforms.

    – dv3500ea Aug 23 '10 at 20:50
1

About the SDL pulseaudio you can simply install libsdl1.2debian-alsa, it will remove the pa-sdl version and link against ALSA libs. Still you are likely to get other binary/library related compatibilities like dv3500ea mentioned. A common approach to avoid system related dependency issues is by using static linking. This will make the binaries much larger because they include the required code from the libraries.

For more information on static linking check: http://wiki.linuxquestions.org/wiki/Static_linking

João Pinto
  • 17,159
  • CMake seems to support static linking only reluctantly, and I believe that there are some libraries I can legally not link static, but I'll look into it. The libsdl debian package is a good idea, I'll use that :) –  Aug 24 '10 at 04:42