Is it possible to compile mpd statically?

Need help with MPD?
Post Reply
poldoxx
Posts: 1
Joined: March 2nd, 2019, 9:24 pm

Is it possible to compile mpd statically?

Post by poldoxx » March 2nd, 2019, 10:21 pm

I'd like to experiment with running a statically compiled version of mpd on a minimalist (and mostly read-only) raspberry pi 0. Has anyone successfully done this with the meson+ninja build system? Can you help a brother out with some high level steps I would have to follow? I have a working build based on the current stable branch from git.

max
Forum team
Posts: 876
Joined: January 15th, 2013, 3:43 pm

Re: Is it possible to compile mpd statically?

Post by max » March 5th, 2019, 9:16 am

Yes, it is possible. To do this, you must first compile all dependencies as static libraries, and then link MPD with linker flag "-static", e.g. by prepending it as LDFLAGS to the Meson command:

Code: Select all

LDFFLAGS=-static meson ....
None of this is MPD specific. This is true for all programs you wish to link statically.

Post Reply