-
Notifications
You must be signed in to change notification settings - Fork 8
/
SConstruct
35 lines (25 loc) · 882 Bytes
/
SConstruct
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
import os
common_libs = Split('event')
lib_src = Split("""
evws.c
utils.c""")
lib_target = 'libs/evws'
env = Environment(ENV = os.environ, LIBPATH = './libs/')
if ARGUMENTS.get('debug', 0):
env.Append(CCFLAGS=['-g'])
# configuring
conf = Configure(env)
for lib in common_libs:
if not conf.CheckLib(lib):
print "You need library " + lib + " to compile"
Exit(1)
for incl in ['sys/queue.h', 'event2/event.h', 'event2/listener.h', 'event2/buffer.h', 'event2/bufferevent.h', 'string.h', 'stdlib.h']:
if not conf.CheckHeader(incl):
print "You need header " + incl + " to compile"
Exit(1)
env = conf.Finish()
lib = env.StaticLibrary(target = lib_target, source = lib_src, LIBS = common_libs)
env.Install('/usr/local/lib', lib)
env.Install('/usr/local/include', 'evws.h')
env.Alias('library', [lib_src])
env.Alias('install', ['/usr/local/lib', '/usr/local/include'])