summaryrefslogtreecommitdiff
path: root/SConstruct
blob: 2de6c3ce2eb842ed54f7eb73bbe8e0b4557502b1 (plain)
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
import os

env = Environment()

conf = Configure(env)
for lib in ('config', 'pcre', 'xml2', 'pthread'):
	if not conf.CheckLib(lib):
		print 'Could not find %s' % lib
		Exit(1)
env = conf.Finish()

env.Append(CCFLAGS = ['-std=c99', '-D_GNU_SOURCE', '-pthread'])

if 'DEBUG' in os.environ:
	print 'Debug build'
	env.Append(CCFLAGS = ['-g'])
else:
	print 'Release build'
	env.Append(CCFLAGS = ['-O2'])

env.Append(LINKFLAGS = ['-pthread'])
env.ParseConfig('pkg-config --cflags --libs libconfig')
env.ParseConfig('pcre-config --cflags --libs')
env.ParseConfig('xml2-config --cflags --libs')

env.Program('ircstats', Glob('*.c'))

# vim: syn=python