Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 72 lines (60 sloc) 2.313 kb
9fcd743 wave.to first commit
waveto authored
1 import Options
c6f9096 Woody Anderson updated infate(encoding) issue. updated filetest to use fs (not posix), ...
authored
2 import platform
9fcd743 wave.to first commit
waveto authored
3 from os import unlink, symlink, popen
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
4 from os.path import lexists, exists
9fcd743 wave.to first commit
waveto authored
5
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
6 srcdir = '.'
7 blddir = 'build'
90de190 Woody Anderson rework memory management to protect the reallocd buffers in empty buffer...
authored
8 VERSION = '0.1.4'
c6f9096 Woody Anderson updated infate(encoding) issue. updated filetest to use fs (not posix), ...
authored
9 OSTYPE = platform.system()
9fcd743 wave.to first commit
waveto authored
10
11 def set_options(opt):
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
12 opt.tool_options('compiler_cxx')
13 opt.tool_options('compiler_cc')
14 opt.add_option('--debug', dest='debug', action='store_true', default=False)
15 opt.add_option('--no-bzip', dest='nobzip', action='store_true', default=False)
16 opt.add_option('--no-gzip', dest='nogzip', action='store_true', default=False)
9fcd743 wave.to first commit
waveto authored
17
18 def configure(conf):
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
19 conf.check_tool('compiler_cxx')
20 conf.check_tool('compiler_cc')
21 conf.check_tool('node_addon')
9fcd743 wave.to first commit
waveto authored
22
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
23 conf.env.cxxflags = ['-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE', '-Wall']
24 conf.env.includes = ['/usr/include', '/usr/local/include']
25 conf.env.defines = []
26 conf.env.uselibs = []
27 conf.env.libpath = ['/usr/lib', '/usr/local/lib']
28
29 if OSTYPE == 'Darwin':
30 conf.env.libpath.insert(0, '/opt/local/lib')
31 conf.env.includes.insert(0, '/opt/local/include')
32 conf.env.cxxflags.append('-mmacosx-version-min=10.4')
33 # add any other os special cases here
34
35 if Options.options.debug:
36 conf.env.defines += ['DEBUG']
37 conf.env.cxxflags += ['-O0', '-g3']
38 else:
39 conf.env.cxxflags += ['-O2']
40
41 if Options.options.nobzip != True:
42 conf.check(lib='z', libpath=conf.env.libpath, uselib_store='ZLIB')
43 conf.env.defines += ['WITH_GZIP']
44 conf.env.uselibs += ['ZLIB']
45 if Options.options.nobzip != True:
46 conf.check(lib='bz2', libpath=conf.env.libpath, uselib_store='BZLIB')
47 conf.env.defines += ['WITH_BZIP']
48 conf.env.uselibs += ['BZLIB']
9fcd743 wave.to first commit
waveto authored
49
50 def build(bld):
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
51 obj = bld.new_task_gen('cxx', 'shlib', 'node_addon')
52 obj.cxxflags = bld.env.cxxflags
c6f9096 Woody Anderson updated infate(encoding) issue. updated filetest to use fs (not posix), ...
authored
53 obj.ldflags = []
54
55 if OSTYPE == 'Darwin':
56 obj.ldflags.append('-mmacosx-version-min=10.4')
2f29204 Woody Anderson bzip2 support, inputstream sub mods
authored
57 # finalize any other os special cases here
58
59 obj.target = 'gzbz2'
60 obj.source = 'compress.cc'
61 obj.defines = bld.env.defines
62 obj.uselib = bld.env.uselibs
63 obj.libpath = bld.env.libpath
64
65 def shutdown(bld):
66 if Options.commands['clean'] and not Options.commands['build']:
67 if lexists('gzbz2.node'):
68 unlink('gzbz2.node')
69 elif Options.commands['build']:
70 if exists('build/default/gzbz2.node') and not lexists('gzbz2.node'):
71 symlink('build/default/gzbz2.node', 'gzbz2.node')
Something went wrong with that request. Please try again.