Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 679b5ddb0a
Fetching contributors…

Cannot retrieve contributors at this time

52 lines (41 sloc) 1.893 kB
import Options
from os import unlink, symlink, popen
from os.path import exists
from logging import fatal
srcdir = '.'
blddir = 'build'
VERSION = '0.0.1'
def set_options(opt):
opt.add_option('-D', '--debug', action='store_true', default=False, dest='debug')
def configure(conf):
conf.env['USE_DEBUG'] = Options.options.debug
if not conf.check(lib='ffi'):
if not conf.check(lib="ffi", libpath=['/usr/local/lib', '/opt/local/lib'], uselib_store="FFI"):
fatal("libffi not found.")
conf.env.append_value("CPPPATH_FFI", "/opt/local/include")
conf.env.append_value("LIB_FFI", "ffi")
conf.env.append_value("LIB_DL", "dl")
# the off_t size difference between the way node is compiled
# and this will cause the eio_req to be different and crash
# the node-ffi stuff
conf.env.append_value('CCFLAGS', '-D_LARGEFILE_SOURCE')
conf.env.append_value('CXXFLAGS', '-D_LARGEFILE_SOURCE')
conf.env.append_value('CCFLAGS', '-D_FILE_OFFSET_BITS=64')
conf.env.append_value('CXXFLAGS', '-D_FILE_OFFSET_BITS=64')
if conf.env['USE_DEBUG']:
conf.env.append_value('CCFLAGS', ['-DDEBUG', '-g', '-ggdb', '-O0', '-Wall'])
conf.env.append_value('CXXFLAGS', ['-DDEBUG', '-g', '-ggdb', '-O0', '-Wall'])
def build(bld):
obj = bld.new_task_gen('cxx', 'shlib', 'node_addon') = 'ffi_bindings'
obj.source = './src/ ./src/ ./src/ ./src/ ./src/'
obj.uselib = 'FFI DL'
def shutdown():
if Options.commands['clean']:
if exists('ffi_bindings.node'): unlink('ffi_bindings.node')
elif Options.commands['build']:
if exists('build/default/ffi_bindings.node') and not exists('ffi_bindings.node'):
symlink('build/default/ffi_bindings.node', 'ffi_bindings.node')
Jump to Line
Something went wrong with that request. Please try again.