Also build a shared library

This commit is contained in:
Nils O. Selåsdal
2014-09-20 21:47:29 +02:00
parent 959d525938
commit 6247bcbdfd
3 changed files with 12 additions and 3 deletions
+4
View File
@@ -9,6 +9,9 @@ version_info = {
'version_minor': 0 ,
'version_patch': 0 ,
'version_revision': revision,
#version_abi is the abi version of the shared library. Only bump it when
#backwards compatibility breaks. Strive to not break the ABI.
'version_abi': '1.0.0'
}
version_info['version_str'] = "%d.%d.%d.%s" % (
version_info['version_major'],
@@ -99,6 +102,7 @@ env.Append(CFLAGS = ['-Wno-unused-parameter', '-Werror=implicit-function-declara
env.Append(LINKFLAGS = ['-O2', '-pthread'])
env.Append(CPPDEFINES = ['_FILE_OFFSET_BITS=64'])
env.Append(CPPPATH = ['#include'])
env.Append(SHLIBVERSION = version_info['version_abi'])
if GetOption('force32bit'):
env.Append(CFLAGS = ['-m32'])
+5 -3
View File
@@ -13,9 +13,11 @@ sources = ucore_env.Glob('*.c')
#print 'sources:', sources[len(sources)-2]
#Build library
ucore_lib = ucore_env.StaticLibrary(target='ucore' + lib_suffix , source=sources)
ucore_staticlib = ucore_env.StaticLibrary(target='ucore' + lib_suffix , source=sources)
ucore_sharedlib = ucore_env.SharedLibrary(target='ucore' + lib_suffix , source=sources)
#install targets
ucore_env.Alias('install',
ucore_env.Install(os.path.join(prefix, 'lib'), ucore_lib))
ucore_env.Install(os.path.join(prefix, 'lib'), [ucore_staticlib]))
ucore_env.Alias('install',
ucore_env.InstallVersionedLib(os.path.join(prefix, 'lib'), [ucore_sharedlib]))
+3
View File
@@ -23,6 +23,9 @@ test_executable = 'test_runner'
if test_xml:
test_executable += ' -x'
#rpath to shared lib, so test_runner can actually be executed
test_env.Append(LINKFLAGS = ['-Wl,-rpath,\\$$ORIGIN/../src'])
prog = test_env.Program('test_runner', tests)
cmd = test_env.Command(target='test_phony' ,
source = None,