Generate scons substitute info in top file

This commit is contained in:
Nils O. Selåsdal
2013-10-28 19:02:47 +01:00
parent a5c984e00b
commit 678378c2f4
2 changed files with 10 additions and 7 deletions
+8 -1
View File
@@ -1,4 +1,5 @@
import os
import platform
#version info of the library, we use 5 chars from the git hash
revision = os.popen('git describe --abbrev=5 --dirty --always').read()[:-1]
@@ -78,7 +79,6 @@ if os.environ.has_key('CC'):
env['CC'] = os.environ['CC']
env.AddMethod(InstallPerm)
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml')
env.Append(CFLAGS = ['-std=gnu99','-Wall', '-Wextra', '-Wundef', '-Wcast-qual','-Wshadow' ,'-Wcast-align','-pipe', '-ggdb', '-pthread'])
env.Append(LINKFLAGS = ['-O2', '-pthread'])
@@ -103,6 +103,13 @@ if GetOption('coverage'):
env.Append(CFLAGS = ['--coverage'])
env.Append(LINKFLAGS = ['--coverage'])
# Generate substitute dictionary
subst_info = dict(('@' + key + '@', version_info[key]) for key in version_info)
subst_info['@prefix'] = prefix
subst_info['@build_host@'] = platform.node()
Export('env', 'build_type', 'prefix', 'version_info', 'test_xml', 'subst_info')
#put all .sconsign files in one place
env.SConsignFile()