Lines 1-67
Link Here
|
1 |
--- SConstruct.orig 2016-05-09 23:15:49 UTC |
|
|
2 |
+++ SConstruct |
3 |
@@ -26,7 +26,7 @@ try: |
4 |
if platform == 'linux-gcc': |
5 |
CXX = 'g++' # not quite right, but env is not yet available. |
6 |
import commands |
7 |
- version = commands.getoutput('%s -dumpversion' %CXX) |
8 |
+ version = 'FreeBSD' |
9 |
platform = 'linux-gcc-%s' %version |
10 |
print "Using platform '%s'" %platform |
11 |
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') |
12 |
@@ -65,7 +65,7 @@ def make_environ_vars(): |
13 |
return vars |
14 |
|
15 |
|
16 |
-env = Environment( ENV = make_environ_vars(), |
17 |
+env = Environment( ENV = os.environ, |
18 |
toolpath = ['scons-tools'], |
19 |
tools=[] ) #, tools=['default'] ) |
20 |
|
21 |
@@ -121,6 +121,7 @@ elif platform.startswith('linux-gcc'): |
22 |
env.Tool( 'default' ) |
23 |
env.Append( LIBS = ['pthread'], CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") ) |
24 |
env['SHARED_LIB_ENABLED'] = True |
25 |
+ env['CXX'] = os.environ['CXX'] |
26 |
else: |
27 |
print "UNSUPPORTED PLATFORM." |
28 |
env.Exit(1) |
29 |
@@ -147,6 +148,11 @@ env['JSONCPP_VERSION'] = JSONCPP_VERSION |
30 |
env['BUILD_DIR'] = env.Dir(build_dir) |
31 |
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir) |
32 |
env['DIST_DIR'] = DIST_DIR |
33 |
+ |
34 |
+# Set SHLIBVERSION for env.InstallVersionedLib(). We use the version number |
35 |
+# without the "-rcXX" part. |
36 |
+env['SHLIBVERSION'] = JSONCPP_VERSION.partition('-')[0] |
37 |
+ |
38 |
if 'TarGz' in env['BUILDERS']: |
39 |
class SrcDistAdder: |
40 |
def __init__( self, env ): |
41 |
@@ -164,7 +170,7 @@ env['SRCDIST_ADD'] = SrcDistAdder( env ) |
42 |
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] ) |
43 |
|
44 |
env_testing = env.Clone( ) |
45 |
-env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] ) |
46 |
+env_testing.Append( LIBS = ['jsoncpp'] ) |
47 |
|
48 |
def buildJSONExample( env, target_sources, target_name ): |
49 |
env = env.Clone() |
50 |
@@ -187,14 +193,14 @@ def buildUnitTests( env, target_sources, |
51 |
env.AlwaysBuild( check_alias_target ) |
52 |
|
53 |
def buildLibrary( env, target_sources, target_name ): |
54 |
- static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', |
55 |
+ static_lib = env.StaticLibrary( target=target_name, |
56 |
source=target_sources ) |
57 |
global lib_dir |
58 |
env.Install( lib_dir, static_lib ) |
59 |
if env['SHARED_LIB_ENABLED']: |
60 |
- shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', |
61 |
+ shared_lib = env.SharedLibrary( target=target_name, |
62 |
source=target_sources ) |
63 |
- env.Install( lib_dir, shared_lib ) |
64 |
+ env.InstallVersionedLib( lib_dir, shared_lib ) |
65 |
env['SRCDIST_ADD']( source=[target_sources] ) |
66 |
|
67 |
Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' ) |