mirror of
https://github.com/radareorg/sdb.git
synced 2026-11-09 17:48:43 -10:00
44 lines
1.2 KiB
Python
44 lines
1.2 KiB
Python
arch="i386"
|
|
arch="x86_64"
|
|
|
|
import Options
|
|
from os import unlink, symlink, popen
|
|
from os.path import exists
|
|
|
|
srcdir = "."
|
|
blddir = "build"
|
|
VERSION = "0.0.1"
|
|
|
|
def set_options(opt):
|
|
opt.tool_options("compiler_cxx")
|
|
|
|
def configure(conf):
|
|
conf.check_tool("compiler_cxx")
|
|
conf.check_tool("node_addon")
|
|
|
|
# sdb pkgconfig here
|
|
# conf.env.append_value("LIB_XML2", "xml2")
|
|
# xml2_config = conf.find_program('xml2-config', var='XML2_CONFIG', mandatory=True)
|
|
# xml2_includedir = popen("%s --cflags" % xml2_config).readline().strip()
|
|
# conf.env.append_value("CPPPATH_XML2", [i.strip() for i in xml2_includedir.split('-I') if len(i) > 0])
|
|
|
|
|
|
def build(bld):
|
|
obj = bld.new_task_gen("cxx", "shlib", "node_addon")
|
|
obj.target = "sdb"
|
|
obj.source = "sdb.cc"
|
|
#obj.source = "a.cc"
|
|
obj.cxxflags = ["-D_FILE_OFFSET_BITS=64",
|
|
"-D_LARGEFILE_SOURCE",
|
|
"-I/usr/include/sdb"]
|
|
#, "-arch", arch ]
|
|
obj.ldflags = ["-lsdb"]
|
|
obj.ldflags = ["/usr/lib/libsdb.a"] #, "-arch", arch]
|
|
|
|
def shutdown():
|
|
if Options.commands['clean']:
|
|
if exists('sdb.node'): unlink('sdb.node')
|
|
else:
|
|
if exists('build/default/sdb.node') and not exists('sdb.node'):
|
|
symlink('build/default/sdb.node', 'sdb.node')
|