- fixed build issue on Solaris (wrong compilation flags for multi-threading)

- fixed build issue on Linux redhat 3: python does not has tarfile module
This commit is contained in:
Baptiste Lepilleur 2009-11-19 13:05:54 +00:00
parent bf95d0f619
commit 86ccb76138
4 changed files with 48 additions and 35 deletions

View File

@ -134,7 +134,7 @@ if platform == 'suncc':
env.Tool( 'sunc++' )
env.Tool( 'sunlink' )
env.Tool( 'sunar' )
env.Append( LIBS = ['pthreads'] )
env.Append( CCFLAGS = ['-mt'] )
elif platform == 'vacpp':
env.Tool( 'default' )
env.Tool( 'aixcc' )
@ -198,14 +198,21 @@ env['JSONCPP_VERSION'] = JSONCPP_VERSION
env['BUILD_DIR'] = env.Dir(build_dir)
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
env['DIST_DIR'] = DIST_DIR
class SrcDistAdder:
if 'TarGz' in env['BUILDERS']:
class SrcDistAdder:
def __init__( self, env ):
self.env = env
def __call__( self, *args, **kw ):
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
env['SRCDIST_BUILDER'] = env.TarGz
else: # If tarfile module is missing
class SrcDistAdder:
def __init__( self, env ):
pass
def __call__( self, *args, **kw ):
pass
env['SRCDIST_ADD'] = SrcDistAdder( env )
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
env['SRCDIST_BUILDER'] = env.TarGz
env_testing = env.Clone( )
env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] )

View File

@ -31,6 +31,7 @@ if 'doxygen' in env['TOOLS']:
target = os.path.join( html_doc_path, 'index.html' ) )
alias_doc_cmd = env.Alias('doc', doc_nodes )
env.Alias('doc', env.Install( html_doc_path, '#README.txt' ) )
if 'TarGz' in env['BUILDERS']:
targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % html_dir )
zip_doc_cmd = env.TarGz( targz_path, [env.Dir(html_doc_path)],
TARGZ_BASEDIR = env['ROOTBUILD_DIR'] )

View File

@ -167,6 +167,7 @@ def generate(env):
## scan_check = DoxySourceScanCheck,
## )
if targz.exists(env):
srcdist_builder = targz.makeBuilder( srcDistEmitter )
env['BUILDERS']['SrcDist'] = srcdist_builder
@ -175,4 +176,4 @@ def exists(env):
"""
Make sure srcdist exists.
"""
return True
return targz.exists(env)

View File

@ -51,17 +51,17 @@ if internal_targz:
tar.add(source_path, archive_name(source_path) ) # filename, arcname
tar.close()
targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
targzAction = SCons.Action.Action(targz, varlist=['TARGZ_COMPRESSION_LEVEL','TARGZ_BASEDIR'])
def makeBuilder( emitter = None ):
def makeBuilder( emitter = None ):
return SCons.Builder.Builder(action = SCons.Action.Action('$TARGZ_COM', '$TARGZ_COMSTR'),
source_factory = SCons.Node.FS.Entry,
source_scanner = SCons.Defaults.DirScanner,
suffix = '$TARGZ_SUFFIX',
multi = 1)
TarGzBuilder = makeBuilder()
TarGzBuilder = makeBuilder()
def generate(env):
def generate(env):
"""Add Builders and construction variables for zip to an Environment.
The following environnement variables may be set:
TARGZ_COMPRESSION_LEVEL: integer, [0-9]. 0: no compression, 9: best compression (same as gzip compression level).
@ -73,6 +73,10 @@ def generate(env):
env['TARGZ_COMPRESSION_LEVEL'] = TARGZ_DEFAULT_COMPRESSION_LEVEL # range 0-9
env['TARGZ_SUFFIX'] = '.tar.gz'
env['TARGZ_BASEDIR'] = env.Dir('.') # Sources archive name are made relative to that directory.
else:
def generate(env):
pass
def exists(env):
return internal_targz