forked from tblobaum/node-ssh
/
wscript
38 lines (30 loc) · 1.02 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
import Options
import os, re
from os.path import exists
srcdir = '.'
blddir = 'build'
def set_options(opt):
opt.tool_options('compiler_cxx')
def configure(conf):
conf.check_tool('compiler_cxx')
conf.check_tool('node_addon')
libs = re.split(r'\s+', os.popen(
'pkg-config --libs libssh'
).readline().strip())
conf.env.append_value('LINKFLAGS', libs)
if not conf.find_program('pkg-config') :
conf.fatal('pkg-config not found')
if os.system('pkg-config --exists libssh') != 0 :
conf.fatal('libssh pkg-config package (libssh.pc) not found')
def build(bld):
sshd = bld.new_task_gen('cxx', 'shlib', 'node_addon')
sshd.target = 'sshd'
sshd.source = [
'src/init.cc', 'src/sshd.cc', 'src/client.cc',
'src/msg.cc', 'src/chan.cc', 'src/constants.cc'
]
sshd.cxxflags = [ '-D_FILE_OFFSET_BITS=64', '-D_LARGEFILE_SOURCE' ]
sshd.cxxflags.append(
os.popen('pkg-config --cflags libssh').readline().strip()
)
sshd.uselib = 'SSH'