From fdf4f00e83fd3843a3fae406c24102ee667c274f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 16 Dec 2014 17:37:24 +0000 Subject: Fix compilation on compilers that do not support -pthread flag (#987). git-svn-id: http://svn.drobilla.net/sord/trunk@318 3d64ff67-21c5-427c-a301-fe4f08042e5a --- NEWS | 5 +++-- wscript | 14 +++++++++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index d32ff9e..95c6098 100644 --- a/NEWS +++ b/NEWS @@ -3,10 +3,11 @@ sord (0.13.0) unstable; * Reduce memory usage and increase performance with a better data structure * Add sord_erase() for erasing statements via an iterator * Fix bugs with stores that contain both graphs and default graph statements + * Fix compilation on compilers that do not support -pthread flag * This release does not break the ABI, but the semantics of iterators has - changed: any modification to a model invalidates iterators on that model. + changed: any modification to a model invalidates iterators on that model - -- David Robillard Mon, 03 Nov 2014 11:43:54 -0500 + -- David Robillard Tue, 16 Dec 2014 12:35:54 -0500 sord (0.12.2) stable; diff --git a/wscript b/wscript index 790656d..3c9e0aa 100644 --- a/wscript +++ b/wscript @@ -65,6 +65,17 @@ def configure(conf): atleast_version='0.18.0', mandatory=True) autowaf.check_pkg(conf, 'libpcre', uselib_store='PCRE', mandatory=False) + if conf.is_defined('HAVE_PCRE'): + if conf.check(cflags=['-pthread'], mandatory=False): + conf.env.PTHREAD_CFLAGS = ['-pthread'] + conf.env.PTHREAD_LINKFLAGS = ['-pthread'] + elif conf.check(linkflags=['-lpthread'], mandatory=False): + conf.env.PTHREAD_CFLAGS = [] + conf.env.PTHREAD_LINKFLAGS = ['-lpthread'] + else: + conf.env.PTHREAD_CFLAGS = [] + conf.env.PTHREAD_LINKFLAGS = [] + # Parse dump options and define things accordingly dump = Options.options.dump.split(',') all = 'all' in dump @@ -210,7 +221,8 @@ def build(bld): autowaf.use_lib(bld, obj, 'SERD') if i == 'sord_validate': autowaf.use_lib(bld, obj, 'PCRE') - obj.cflags = '-pthread' + obj.cflags = bld.env.PTHREAD_CFLAGS + obj.linkflags = bld.env.PTHREAD_LINKFLAGS # Documentation autowaf.build_dox(bld, 'SORD', SORD_VERSION, top, out) -- cgit v1.2.1