summaryrefslogtreecommitdiffstats
path: root/wscript
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-16 17:37:24 +0000
committerDavid Robillard <d@drobilla.net>2014-12-16 17:37:24 +0000
commitfdf4f00e83fd3843a3fae406c24102ee667c274f (patch)
treea262b307892478f0d1f87d941d43bac69057019d /wscript
parent0e7023d64190f563208de8bb11c6c582ce2eef3c (diff)
downloadsord-fdf4f00e83fd3843a3fae406c24102ee667c274f.tar.gz
sord-fdf4f00e83fd3843a3fae406c24102ee667c274f.tar.bz2
sord-fdf4f00e83fd3843a3fae406c24102ee667c274f.zip
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
Diffstat (limited to 'wscript')
-rw-r--r--wscript14
1 files changed, 13 insertions, 1 deletions
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)