This repository has been archived by the owner on Feb 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSConstruct
33 lines (24 loc) · 1.8 KB
/
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
import platform
optimize = '-O3'
envmurmur = Environment(CPPPATH = ['deps/murmurhash/'], CPPFLAGS="-fno-exceptions " + optimize)
murmur = envmurmur.Library('murmur', Glob("deps/murmurhash/*.cpp"))
envinih = Environment(CPATH = ['deps/inih/'], CFLAGS=optimize)
inih = envinih.Library('inih', Glob("deps/inih/*.c"))
envketama = Environment(CPATH = ['deps/libketama/'], CFLAGS=optimize)
ketama = envketama.Library('ketama', Glob("deps/libketama/md5.c") + Glob("deps/libketama/ketama.c"))
env_statsite_with_err = Environment(CCFLAGS = '-std=c99 -D_GNU_SOURCE -Wall -Werror ' + optimize + ' -pthread -Ideps/inih/ -Ideps/libev/ -Ideps/libketama/ -Isrc/')
env_statsite_without_err = Environment(CCFLAGS = '-std=c99 -D_GNU_SOURCE ' + optimize + ' -pthread -Ideps/inih/ -Ideps/libev/ -Ideps/libketama/ -Isrc/')
objs = env_statsite_with_err.Object('src/proxy', 'src/proxy.c') + \
env_statsite_with_err.Object('src/hashring', 'src/hashring.c') + \
env_statsite_with_err.Object('src/hashmap', 'src/hashmap.c') + \
env_statsite_with_err.Object('src/heap', 'src/heap.c') + \
env_statsite_with_err.Object('src/config', 'src/config.c') + \
env_statsite_without_err.Object('src/networking', 'src/networking.c') + \
env_statsite_without_err.Object('src/conn_handler', 'src/conn_handler.c')
statsite_proxy_libs = ["m", "pthread", murmur, inih, ketama]
if platform.system() == 'Linux':
statsite_proxy_libs.append("rt")
statsite_proxy = env_statsite_with_err.Program('statsite_proxy', objs + ["src/statsite_proxy.c"], LIBS=statsite_proxy_libs)
statsite_proxy_test = env_statsite_without_err.Program('test_runner', objs + Glob("tests/runner.c"), LIBS=statsite_proxy_libs + ["check"])
# By default, only compile statsite_proxy
Default(statsite_proxy)