meson: accept either shared or static libraries if --disable-static
commitd7dedf428fefccc662f367745c21c0041f30a1d6
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 26 Jan 2021 10:15:33 +0000 (26 11:15 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 8 Feb 2021 13:43:54 +0000 (8 14:43 +0100)
treeec72d9011ce0d778385add0f2464926a3b5b6e1c
parent8db0b20415c129cf5e577a593a4a0372d90b7cc9
meson: accept either shared or static libraries if --disable-static

Meson's "static" argument to cc.find_library is a tri-state.  By default
Meson *prefers* a shared library, which basically means using -l to
look for it; instead, "static: false" *requires* a shared library.  Of
course, "static: true" requires a static library, which is all good
for --enable-static builds.

For --disable-static, "static: false" is rarely desirable; it does not
match what the configure script used to do and the test is more complex
(and harder to debug if it fails, which was reported by Peter Lieven
for librbd).

Reported-by: Peter Lieven <pl@kamp.de>
Tested-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
docs/devel/build-system.rst
meson.build