forked from ignatz/boost_mongo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wscript
70 lines (57 loc) · 2.37 KB
/
wscript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/usr/bin/env python
# Copyright 2013, Sebastian Jeltsch ([email protected])
# Distributed under the terms of the LGPLv3 or newer.
import sys, os
APPNAME = 'boost-mongo'
VERSION = '1.0'
def options(opt):
opt.load('compiler_cxx')
opt.load('boost')
def configure(cfg):
cfg.load('compiler_cxx')
cfg.load('boost')
cfg.check_boost(lib='serialization thread system filesystem',
uselib_store='BOOST4MONGO')
cfg.check_cxx(lib='mongoclient')
cfg.check_cxx(lib='pthread')
# This non-standard installation behaviour is a HACK for some transitional
# time. Note that, if you want to install the package at the system level
# you can still explicitly specify the PREFIX var. For most unix style
# systems the prefix should be '/usr/local'.
cfg.env.PREFIX = cfg.env.PREFIX if os.getenv('PREFIX') else '.'
def build(bld):
bld(target = 'boost-mongo_inc',
export_includes = '.')
# use either system CXXFLAGS, LDFLAGS or fall back to defaults
cxxflags = bld.env['CXXFLAGS'] if bld.env['CXXFLAGS'] else [
'-O2', '-Wall', '-Wextra', '-pedantic',
'-Wno-long-long', '-Wno-variadic-macros']
ldflags = bld.env['LDFLAGS'] if bld.env['LDFLAGS'] else [ '-zdefs' ]
bld.shlib(
target = 'boost-mongo',
source = bld.path.ant_glob('libs/**/*.cpp'),
install_path = None,
use = [
'MONGOCLIENT',
'BOOST4MONGO',
'PTHREAD',
'boost-mongo_inc'
],
linkflags = ldflags + [
'-Wl,-soname,libboost-mongo.so.%s' % VERSION
],
cxxflags = cxxflags)
# build shlib conforming to ldconfig
bld.install_as('${PREFIX}/lib/libboost-mongo.so.' + VERSION,
'libboost-mongo.so')
bld.symlink_as('${PREFIX}/lib/libboost-mongo.so',
'libboost-mongo.so.%s' % VERSION)
# install headers
for header in bld.path.ant_glob('boost/archive/**/*.(hpp|ipp)'):
bld.install_as('${PREFIX}/include/%s' % header.path_from(bld.path), header)
def dist(dst):
dst.base_name = '%s_%s' % (APPNAME, VERSION)
dst.algo = 'tar.gz'
dst.excl = ' **/waf-1.* **/.waf-1.* **/waf3-1.* **/.waf3-1.* ' \
'**/*~ **/*.rej **/*.orig **/*.pyc **/*.pyo **/*.bak ' \
'**/*.swp **/.lock-w* **/.* **/build **/lib '