From cae6fb76301e8a7efd3031c18e42e78c43cc273f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karl=20Lind=C3=A9n?= Date: Fri, 3 Apr 2015 13:51:36 +0200 Subject: [PATCH] Add a --no-samplerate build option to not build against libsamplerate even if available and use pkg-config to find libsamplerate. --- common/wscript | 5 ----- wscript | 9 ++++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/common/wscript b/common/wscript index 4302b1e2..bca070a5 100644 --- a/common/wscript +++ b/common/wscript @@ -6,11 +6,6 @@ import re import os def configure(conf): - conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE") - - if conf.is_defined('HAVE_SAMPLERATE'): - conf.env['LIB_SAMPLERATE'] = ['samplerate'] - conf.env['BUILD_NETLIB'] = conf.is_defined('HAVE_SAMPLERATE') conf.env['BUILD_ADAPTER'] = conf.is_defined('HAVE_SAMPLERATE') diff --git a/wscript b/wscript index 9d3d6c89..abca0578 100644 --- a/wscript +++ b/wscript @@ -80,6 +80,7 @@ def options(opt): opt.add_option('--clients', default=64, type="int", dest="clients", help='Maximum number of JACK clients') opt.add_option('--ports-per-application', default=768, type="int", dest="application_ports", help='Maximum number of ports per application') opt.add_option('--debug', action='store_true', default=False, dest='debug', help='Build debuggable binaries') + opt.add_option('--no-samplerate', action='store_true', default=False, dest='no_samplerate', help='Do not build against libsamplerate if available') opt.add_option('--firewire', action='store_true', default=False, help='Enable FireWire driver (FFADO)') opt.add_option('--freebob', action='store_true', default=False, help='Enable FreeBob driver') opt.add_option('--alsa', action='store_true', default=False, help='Enable ALSA driver') @@ -141,7 +142,6 @@ def configure(conf): conf.env.append_unique('CXXFLAGS', '-Wall') conf.env.append_unique('CFLAGS', '-Wall') - conf.sub_config('common') if conf.env['IS_LINUX']: conf.sub_config('linux') if Options.options.alsa and not conf.env['BUILD_DRIVER_ALSA']: @@ -166,11 +166,10 @@ def configure(conf): if conf.env['BUILD_JACKDBUS'] != True: conf.fatal('jackdbus was explicitly requested but cannot be built') - conf.check_cc(header_name='samplerate.h', define_name="HAVE_SAMPLERATE") - - if conf.is_defined('HAVE_SAMPLERATE'): - conf.env['LIB_SAMPLERATE'] = ['samplerate'] + if not Options.options.no_samplerate and conf.check_cfg(package='samplerate', args='--cflags --libs', mandatory=False): + conf.define('HAVE_SAMPLERATE', 1) + conf.sub_config('common') conf.sub_config('example-clients') if conf.check_cfg(package='celt', atleast_version='0.11.0', args='--cflags --libs', mandatory=False):