mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-05-20 12:05:31 +02:00
- 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:
parent
bf95d0f619
commit
86ccb76138
21
SConstruct
21
SConstruct
@ -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:
|
||||
def __init__( self, env ):
|
||||
self.env = env
|
||||
def __call__( self, *args, **kw ):
|
||||
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
|
||||
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}'] )
|
||||
|
@ -31,11 +31,12 @@ 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' ) )
|
||||
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'] )
|
||||
env.Depends( zip_doc_cmd, alias_doc_cmd )
|
||||
env.Alias( 'doc-dist', zip_doc_cmd )
|
||||
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'] )
|
||||
env.Depends( zip_doc_cmd, alias_doc_cmd )
|
||||
env.Alias( 'doc-dist', zip_doc_cmd )
|
||||
##
|
||||
## doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
|
||||
## SUBST_DICT = {
|
||||
|
@ -167,12 +167,13 @@ def generate(env):
|
||||
## scan_check = DoxySourceScanCheck,
|
||||
## )
|
||||
|
||||
srcdist_builder = targz.makeBuilder( srcDistEmitter )
|
||||
if targz.exists(env):
|
||||
srcdist_builder = targz.makeBuilder( srcDistEmitter )
|
||||
|
||||
env['BUILDERS']['SrcDist'] = srcdist_builder
|
||||
env['BUILDERS']['SrcDist'] = srcdist_builder
|
||||
|
||||
def exists(env):
|
||||
"""
|
||||
Make sure srcdist exists.
|
||||
"""
|
||||
return True
|
||||
return targz.exists(env)
|
||||
|
@ -51,28 +51,32 @@ 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 ):
|
||||
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()
|
||||
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()
|
||||
|
||||
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).
|
||||
TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative
|
||||
to something other than top-dir).
|
||||
"""
|
||||
env['BUILDERS']['TarGz'] = TarGzBuilder
|
||||
env['TARGZ_COM'] = targzAction
|
||||
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 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).
|
||||
TARGZ_BASEDIR: base-directory used to determine archive name (this allow archive name to be relative
|
||||
to something other than top-dir).
|
||||
"""
|
||||
env['BUILDERS']['TarGz'] = TarGzBuilder
|
||||
env['TARGZ_COM'] = targzAction
|
||||
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.
|
||||
|
||||
def exists(env):
|
||||
return internal_targz
|
||||
|
Loading…
x
Reference in New Issue
Block a user