Compile sndio as static library

From: Fuzhou Chen <>
Date: Mon, 4 Dec 2023 03:21:40 +0800

I'm a game developer. I'm working on a project to compile the game engine I
use, (Haxe/Hashlink) in 100% static link for Linux. I noticed the engine
depends on openal-soft -> libsndio -> alsa-lib. I have successfully build
openal-soft and alsa-lib as static libraries, but seems libsndio Makefile
supports building only .so.

I'm not an audio expert, so I'm wondering whether there's any reason that
libsndio must be built as a shared library?

   === Describe the scenario of my ask ===

I want my game engine to be static linked is because I want to ensure
-static-libgcc and -static-libstdc++ option added to all dependencies, thus
my built binaries can be distributed to a Linux machine with older libgcc
and libstdc++ installed. My typical scenario is when my Github CI machine
is Ubuntu:latest while my code runs on Ubuntu Runtime.

Thus, there are two solutions: a) I make all my dependencies static. Then I
just need to add the two link options when building final Hashlink binary.
If this is not possible, then b) it's also OK that I add the options when
building libsndio.

I'm developing a private fix following b) for libsndio. I understand this
is not a common option that should be enabled by default. Thus, I would
like to ask for suggestions that which direction looks better.

Any suggestions are appreciated.

Received on Sun Dec 03 2023 - 20:21:40 CET

This archive was generated by hypermail 2.3.0 : Mon Dec 04 2023 - 01:30:02 CET