Skip to content

Commit 86ccb76

Browse files
committed
- fixed build issue on Solaris (wrong compilation flags for multi-threading)
- fixed build issue on Linux redhat 3: python does not has tarfile module
1 parent bf95d0f commit 86ccb76

4 files changed

Lines changed: 48 additions & 35 deletions

File tree

SConstruct

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if platform == 'suncc':
134134
env.Tool( 'sunc++' )
135135
env.Tool( 'sunlink' )
136136
env.Tool( 'sunar' )
137-
env.Append( LIBS = ['pthreads'] )
137+
env.Append( CCFLAGS = ['-mt'] )
138138
elif platform == 'vacpp':
139139
env.Tool( 'default' )
140140
env.Tool( 'aixcc' )
@@ -198,14 +198,21 @@ env['JSONCPP_VERSION'] = JSONCPP_VERSION
198198
env['BUILD_DIR'] = env.Dir(build_dir)
199199
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
200200
env['DIST_DIR'] = DIST_DIR
201-
class SrcDistAdder:
202-
def __init__( self, env ):
203-
self.env = env
204-
def __call__( self, *args, **kw ):
205-
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
201+
if 'TarGz' in env['BUILDERS']:
202+
class SrcDistAdder:
203+
def __init__( self, env ):
204+
self.env = env
205+
def __call__( self, *args, **kw ):
206+
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
207+
env['SRCDIST_BUILDER'] = env.TarGz
208+
else: # If tarfile module is missing
209+
class SrcDistAdder:
210+
def __init__( self, env ):
211+
pass
212+
def __call__( self, *args, **kw ):
213+
pass
206214
env['SRCDIST_ADD'] = SrcDistAdder( env )
207215
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
208-
env['SRCDIST_BUILDER'] = env.TarGz
209216

210217
env_testing = env.Clone( )
211218
env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )

doc/sconscript

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ if 'doxygen' in env['TOOLS']:
3131
target = os.path.join( html_doc_path, 'index.html' ) )
3232
alias_doc_cmd = env.Alias('doc', doc_nodes )
3333
env.Alias('doc', env.Install( html_doc_path, '#README.txt' ) )
34-
targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % html_dir )
35-
zip_doc_cmd = env.TarGz( targz_path, [env.Dir(html_doc_path)],
36-
TARGZ_BASEDIR = env['ROOTBUILD_DIR'] )
37-
env.Depends( zip_doc_cmd, alias_doc_cmd )
38-
env.Alias( 'doc-dist', zip_doc_cmd )
34+
if 'TarGz' in env['BUILDERS']:
35+
targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % html_dir )
36+
zip_doc_cmd = env.TarGz( targz_path, [env.Dir(html_doc_path)],
37+
TARGZ_BASEDIR = env['ROOTBUILD_DIR'] )
38+
env.Depends( zip_doc_cmd, alias_doc_cmd )
39+
env.Alias( 'doc-dist', zip_doc_cmd )
3940
##
4041
## doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
4142
## SUBST_DICT = {

scons-tools/srcdist.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,13 @@ def generate(env):
167167
## scan_check = DoxySourceScanCheck,
168168
## )
169169

170-
srcdist_builder = targz.makeBuilder( srcDistEmitter )
170+
if targz.exists(env):
171+
srcdist_builder = targz.makeBuilder( srcDistEmitter )
171172

172-
env['BUILDERS']['SrcDist'] = srcdist_builder
173+
env['BUILDERS']['SrcDist'] = srcdist_builder
173174

174175
def exists(env):
175176
"""
176177
Make sure srcdist exists.
177178
"""
178-
return True
179+
return targz.exists(env)

scons-tools/targz.py

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,28 +51,32 @@ def visit(tar, dirname, names):
5151
tar.add(source_path, archive_name(source_path) ) # filename, arcname
5252
tar.close()
5353

54-
targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
54+
targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
5555

56-
def makeBuilder( emitter = None ):
57-
return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'),
58-
source_factory = SCons.Node.FS.Entry,
59-
source_scanner = SCons.Defaults.DirScanner,
60-
suffix = '$TARGZ_SUFFIX',
61-
multi = 1)
62-
TarGzBuilder = makeBuilder()
56+
def makeBuilder( emitter = None ):
57+
return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'),
58+
source_factory = SCons.Node.FS.Entry,
59+
source_scanner = SCons.Defaults.DirScanner,
60+
suffix = '$TARGZ_SUFFIX',
61+
multi = 1)
62+
TarGzBuilder = makeBuilder()
63+
64+
def generate(env):
65+
"""Add Builders and construction variables for zip to an Environment.
66+
The following environnement variables may be set:
67+
TARGZ_COMPRESSION_LEVEL: integer, [0-9]. 0: no compression, 9: best compression (same as gzip compression level).
68+
TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative
69+
to something other than top-dir).
70+
"""
71+
env['BUILDERS']['TarGz'] = TarGzBuilder
72+
env['TARGZ_COM'] = targzAction
73+
env['TARGZ_COMPRESSION_LEVEL'] = TARGZ_DEFAULT_COMPRESSION_LEVEL # range 0-9
74+
env['TARGZ_SUFFIX'] = '.tar.gz'
75+
env['TARGZ_BASEDIR'] = env.Dir('.') # Sources archive name are made relative to that directory.
76+
else:
77+
def generate(env):
78+
pass
6379

64-
def generate(env):
65-
"""Add Builders and construction variables for zip to an Environment.
66-
The following environnement variables may be set:
67-
TARGZ_COMPRESSION_LEVEL: integer, [0-9]. 0: no compression, 9: best compression (same as gzip compression level).
68-
TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative
69-
to something other than top-dir).
70-
"""
71-
env['BUILDERS']['TarGz'] = TarGzBuilder
72-
env['TARGZ_COM'] = targzAction
73-
env['TARGZ_COMPRESSION_LEVEL'] = TARGZ_DEFAULT_COMPRESSION_LEVEL # range 0-9
74-
env['TARGZ_SUFFIX'] = '.tar.gz'
75-
env['TARGZ_BASEDIR'] = env.Dir('.') # Sources archive name are made relative to that directory.
7680

7781
def exists(env):
7882
return internal_targz

0 commit comments

Comments
 (0)