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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
--- SConstruct
+++ SConstruct
@@ -26,7 +26,7 @@
if platform == 'linux-gcc':
CXX = 'g++' # not quite right, but env is not yet available.
import commands
- version = commands.getoutput('%s -dumpversion' %CXX)
+ version = 'FreeBSD'
platform = 'linux-gcc-%s' %version
print "Using platform '%s'" %platform
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '')
@@ -65,7 +65,7 @@
return vars
-env = Environment( ENV = make_environ_vars(),
+env = Environment( ENV = os.environ,
toolpath = ['scons-tools'],
tools=[] ) #, tools=['default'] )
@@ -121,6 +121,7 @@
env.Tool( 'default' )
env.Append( LIBS = ['pthread'], CCFLAGS = "-Wall" )
env['SHARED_LIB_ENABLED'] = True
+ env['CXX'] = os.environ['CXX']
else:
print "UNSUPPORTED PLATFORM."
env.Exit(1)
@@ -147,6 +148,11 @@
env['BUILD_DIR'] = env.Dir(build_dir)
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
env['DIST_DIR'] = DIST_DIR
+
+# Set SHLIBVERSION for env.InstallVersionedLib(). We use the version number
+# without the "-rcXX" part.
+env['SHLIBVERSION'] = JSONCPP_VERSION.partition('-')[0]
+
if 'TarGz' in env['BUILDERS']:
class SrcDistAdder:
def __init__( self, env ):
@@ -164,7 +170,7 @@
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
env_testing = env.Clone( )
-env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )
+env_testing.Append( LIBS = ['jsoncpp'] )
def buildJSONExample( env, target_sources, target_name ):
env = env.Clone()
@@ -187,14 +193,14 @@
env.AlwaysBuild( check_alias_target )
def buildLibrary( env, target_sources, target_name ):
- static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
+ static_lib = env.StaticLibrary( target=target_name,
source=target_sources )
global lib_dir
env.Install( lib_dir, static_lib )
if env['SHARED_LIB_ENABLED']:
- shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
+ shared_lib = env.SharedLibrary( target=target_name,
source=target_sources )
- env.Install( lib_dir, shared_lib )
+ env.InstallVersionedLib( lib_dir, shared_lib )
env['SRCDIST_ADD']( source=[target_sources] )
Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' )
|