diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2009-12-12 21:31:27 +0100 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2009-12-12 21:31:27 +0100 |
commit | 03d8ee4b0e08c2209518e296de7f9a49183a4a47 (patch) | |
tree | 59f1b180df722e53b1f0bcda7c7822d8f8d63dd5 /SConstruct | |
parent | 95f4c7cb4a9f0a30ab9d78852725a45688a97512 (diff) |
Replaced Makefile with SConstruct.
ircstats now builds by running scons instead of make.
Build with DEBUG set to compile with -g.
Also added scons-related stuff to .gitignore.
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct new file mode 100644 index 0000000..2de6c3c --- /dev/null +++ b/SConstruct @@ -0,0 +1,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 |