13
0

wscript: detect if qm-dsp is self-contained or need linking with kiss

When building with --use-external-libs on Fedora, Ardour would fail at
runtime with messages like:
  symbol lookup error: .../vamp/libardourvampplugins.so: undefined symbol: kiss_fftr_alloc
Try to automate handling of this error situation.

Fedora packaging worked around it with a custom patch that we rather
would avoid:
https://src.fedoraproject.org/rpms/ardour6/blob/rawhide/f/ardour6-missing-kissfft.patch .
This commit is contained in:
Mads Kiilerich 2022-01-27 17:25:35 +01:00 committed by Robin Gareus
parent 9b89dd7967
commit 6f04dfc774
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -27,6 +27,29 @@ def configure(conf):
conf.check_cxx(header_name="base/Pitch.h", mandatory=True, msg="Checking for qm-dsp headers") conf.check_cxx(header_name="base/Pitch.h", mandatory=True, msg="Checking for qm-dsp headers")
conf.check_cxx(lib="qm-dsp", uselib_store="QMDSP", mandatory=True) conf.check_cxx(lib="qm-dsp", uselib_store="QMDSP", mandatory=True)
# Verify that qm-dsp is self-contained and that FFT transforms actually works
if not conf.check_cxx(msg = 'Checking qm-dsp without explicit kiss linking',
features = 'cxx cxxprogram',
fragment = """#include "dsp/transforms/FFT.h"\nint main(void) {\nFFT(4).process(false, nullptr, 0, nullptr, nullptr);\nFFTReal(4).forward(nullptr, nullptr, nullptr);\nreturn 0;\n}""",
uselib = 'QMDSP',
okmsg = 'ok',
errmsg = "-lqm-dsp by itself failed",
mandatory = False,
):
# The external qm-dsp might be built without embedded kiss - try to link with it explicitly and check again
conf.check_cxx(lib="kiss_fft_double", uselib_store="KISSFFT", mandatory=True)
conf.check_cxx(lib="kiss_fftr_double", uselib_store="KISSFFTR", mandatory=True)
conf.env.append_value('LIB_QMDSP', conf.env['LIB_KISSFFT'] + conf.env['LIB_KISSFFTR'])
conf.check_cxx(msg = 'Checking qm-dsp with explicit kiss linking',
features = 'cxx cxxprogram',
fragment = """#include "dsp/transforms/FFT.h"\nint main(void) {\nFFT(4).process(false, nullptr, 0, nullptr, nullptr);\nFFTReal(4).forward(nullptr, nullptr, nullptr);\nreturn 0;\n}""",
uselib = 'QMDSP',
okmsg = '-lqm-dsp needs explicit kiss linking',
errmsg = "qm-dsp doesn't work, even with kiss libraries",
mandatory = True,
)
def build(bld): def build(bld):
if bld.is_defined('USE_EXTERNAL_LIBS'): if bld.is_defined('USE_EXTERNAL_LIBS'):
return return