Lines 26-32
try:
Link Here
|
26 |
if platform == 'linux-gcc': |
26 |
if platform == 'linux-gcc': |
27 |
CXX = 'g++' # not quite right, but env is not yet available. |
27 |
CXX = 'g++' # not quite right, but env is not yet available. |
28 |
import commands |
28 |
import commands |
29 |
version = commands.getoutput('%s -dumpversion' %CXX) |
29 |
version = 'FreeBSD' |
30 |
platform = 'linux-gcc-%s' %version |
30 |
platform = 'linux-gcc-%s' %version |
31 |
print "Using platform '%s'" %platform |
31 |
print "Using platform '%s'" %platform |
32 |
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') |
32 |
LD_LIBRARY_PATH = os.environ.get('LD_LIBRARY_PATH', '') |
Lines 65-71
def make_environ_vars():
Link Here
|
65 |
return vars |
65 |
return vars |
66 |
|
66 |
|
67 |
|
67 |
|
68 |
env = Environment( ENV = make_environ_vars(), |
68 |
env = Environment( ENV = os.environ, |
69 |
toolpath = ['scons-tools'], |
69 |
toolpath = ['scons-tools'], |
70 |
tools=[] ) #, tools=['default'] ) |
70 |
tools=[] ) #, tools=['default'] ) |
71 |
|
71 |
|
Lines 121-126
elif platform.startswith('linux-gcc'):
Link Here
|
121 |
env.Tool( 'default' ) |
121 |
env.Tool( 'default' ) |
122 |
env.Append( LIBS = ['pthread'], CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") ) |
122 |
env.Append( LIBS = ['pthread'], CCFLAGS = os.environ.get("CXXFLAGS", "-Wall"), LINKFLAGS=os.environ.get("LDFLAGS", "") ) |
123 |
env['SHARED_LIB_ENABLED'] = True |
123 |
env['SHARED_LIB_ENABLED'] = True |
|
|
124 |
env['CXX'] = os.environ['CXX'] |
124 |
else: |
125 |
else: |
125 |
print "UNSUPPORTED PLATFORM." |
126 |
print "UNSUPPORTED PLATFORM." |
126 |
env.Exit(1) |
127 |
env.Exit(1) |
Lines 147-152
env['JSONCPP_VERSION'] = JSONCPP_VERSION
Link Here
|
147 |
env['BUILD_DIR'] = env.Dir(build_dir) |
148 |
env['BUILD_DIR'] = env.Dir(build_dir) |
148 |
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir) |
149 |
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir) |
149 |
env['DIST_DIR'] = DIST_DIR |
150 |
env['DIST_DIR'] = DIST_DIR |
|
|
151 |
|
152 |
# Set SHLIBVERSION for env.InstallVersionedLib(). We use the version number |
153 |
# without the "-rcXX" part. |
154 |
env['SHLIBVERSION'] = JSONCPP_VERSION.partition('-')[0] |
155 |
|
150 |
if 'TarGz' in env['BUILDERS']: |
156 |
if 'TarGz' in env['BUILDERS']: |
151 |
class SrcDistAdder: |
157 |
class SrcDistAdder: |
152 |
def __init__( self, env ): |
158 |
def __init__( self, env ): |
Lines 164-170
env['SRCDIST_ADD'] = SrcDistAdder( env )
Link Here
|
164 |
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] ) |
170 |
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] ) |
165 |
|
171 |
|
166 |
env_testing = env.Clone( ) |
172 |
env_testing = env.Clone( ) |
167 |
env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] ) |
173 |
env_testing.Append( LIBS = ['jsoncpp'] ) |
168 |
|
174 |
|
169 |
def buildJSONExample( env, target_sources, target_name ): |
175 |
def buildJSONExample( env, target_sources, target_name ): |
170 |
env = env.Clone() |
176 |
env = env.Clone() |
Lines 187-200
def buildUnitTests( env, target_sources,
Link Here
|
187 |
env.AlwaysBuild( check_alias_target ) |
193 |
env.AlwaysBuild( check_alias_target ) |
188 |
|
194 |
|
189 |
def buildLibrary( env, target_sources, target_name ): |
195 |
def buildLibrary( env, target_sources, target_name ): |
190 |
static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', |
196 |
static_lib = env.StaticLibrary( target=target_name, |
191 |
source=target_sources ) |
197 |
source=target_sources ) |
192 |
global lib_dir |
198 |
global lib_dir |
193 |
env.Install( lib_dir, static_lib ) |
199 |
env.Install( lib_dir, static_lib ) |
194 |
if env['SHARED_LIB_ENABLED']: |
200 |
if env['SHARED_LIB_ENABLED']: |
195 |
shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', |
201 |
shared_lib = env.SharedLibrary( target=target_name, |
196 |
source=target_sources ) |
202 |
source=target_sources ) |
197 |
env.Install( lib_dir, shared_lib ) |
203 |
env.InstallVersionedLib( lib_dir, shared_lib ) |
198 |
env['SRCDIST_ADD']( source=[target_sources] ) |
204 |
env['SRCDIST_ADD']( source=[target_sources] ) |
199 |
|
205 |
|
200 |
Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' ) |
206 |
Export( 'env env_testing buildJSONExample buildLibrary buildJSONTests buildUnitTests' ) |