diff options
author | David Robillard <d@drobilla.net> | 2018-05-27 15:48:25 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-12-20 10:26:55 -0500 |
commit | 58a874fa1ba233c62272eb2f370a9f3c64b56c1a (patch) | |
tree | d284ac6be22aa7f6894352098dd3d5c0367ada65 /wscript | |
parent | dd364625e2dda4691cec852a8f4fa3c40ac7e189 (diff) | |
download | serd-58a874fa1ba233c62272eb2f370a9f3c64b56c1a.tar.gz serd-58a874fa1ba233c62272eb2f370a9f3c64b56c1a.tar.bz2 serd-58a874fa1ba233c62272eb2f370a9f3c64b56c1a.zip |
Add model validation
Diffstat (limited to 'wscript')
-rw-r--r-- | wscript | 28 |
1 files changed, 26 insertions, 2 deletions
@@ -37,6 +37,7 @@ def options(ctx): 'no-shared': 'do not build shared library', 'static-progs': 'build programs as static binaries', 'largefile': 'build with large file support on 32-bit systems', + 'no-pcre': 'do not use PCRE, even if present', 'no-posix': 'do not use POSIX functions, even if present'}) def configure(conf): @@ -69,6 +70,21 @@ def configure(conf): defines = ['_POSIX_C_SOURCE=200809L'], mandatory = False) + if not Options.options.no_pcre: + autowaf.check_pkg(conf, 'libpcre', uselib_store='PCRE', mandatory=False) + + if conf.env.HAVE_PCRE: + if conf.check(cflags=['-pthread'], mandatory=False): + conf.env.PTHREAD_CFLAGS = ['-pthread'] + if conf.env.CC_NAME != 'clang': + 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 = [] + autowaf.set_lib_env(conf, 'serd', SERD_VERSION) conf.write_config_header('serd_config.h', remove=False) @@ -100,6 +116,7 @@ lib_source = ['src/base64.c', 'src/syntax.c', 'src/system.c', 'src/uri.c', + 'src/validate.c', 'src/world.c', 'src/writer.c', 'src/zix/btree.c', @@ -120,6 +137,7 @@ def build(bld): 'includes': ['.', './src'], 'cflags': ['-fvisibility=hidden'], 'lib': ['m'], + 'use': ['PCRE'], 'vnum': SERD_VERSION, 'install_path': '${LIBDIR}'} if bld.env.MSVC_COMPILER: @@ -133,6 +151,7 @@ def build(bld): source = lib_source, name = 'libserd', target = 'serd-%s' % SERD_MAJOR_VERSION, + uselib = 'PCRE', defines = defines + ['SERD_SHARED', 'SERD_INTERNAL'], **lib_args) @@ -142,6 +161,7 @@ def build(bld): source = lib_source, name = 'libserd_static', target = 'serd-%s' % SERD_MAJOR_VERSION, + uselib = 'PCRE', defines = defines + ['SERD_INTERNAL'], **lib_args) @@ -157,6 +177,7 @@ def build(bld): source = lib_source, name = 'libserd_profiled', target = 'serd_profiled', + uselib = 'PCRE', defines = defines + ['SERD_INTERNAL'], **test_args) @@ -185,13 +206,16 @@ def build(bld): target = 'serdi', includes = ['.', './src'], use = 'libserd', + uselib = 'PCRE', lib = lib_args['lib'], + cflags = bld.env.PTHREAD_CFLAGS, + linkflags = bld.env.PTHREAD_LINKFLAGS, install_path = '${BINDIR}') if not bld.env.BUILD_SHARED or bld.env.STATIC_PROGS: obj.use = 'libserd_static' if bld.env.STATIC_PROGS: - obj.env.SHLIB_MARKER = obj.env.STLIB_MARKER - obj.linkflags = ['-static'] + obj.env.SHLIB_MARKER = obj.env.STLIB_MARKER + obj.linkflags += ['-static'] # Documentation if bld.env.DOCS: |