<s> """<STR_LIT>""" <EOL> __revision__ = "<STR_LIT>" <EOL> import os . path <EOL> import SCons . Action <EOL> import SCons . Defaults <EOL> import SCons . Errors <EOL> import SCons . Platform . win32 <EOL> import SCons . Tool <EOL> import SCons . Tool . msvc <EOL> import SCons . Tool . msvs <EOL> import SCons . Util <EOL> def pdbGenerator ( env , target , source , for_signature ) : <EOL> try : <EOL> return [ '<STR_LIT>' % target [ <NUM_LIT:0> ] . attributes . pdb , '<STR_LIT>' ] <EOL> except ( AttributeError , IndexError ) : <EOL> return None <EOL> def _dllTargets ( target , source , env , for_signature , paramtp ) : <EOL> listCmd = [ ] <EOL> dll = env . FindIxes ( target , '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp ) <EOL> if dll : listCmd . append ( "<STR_LIT>" % dll . get_string ( for_signature ) ) <EOL> implib = env . FindIxes ( target , '<STR_LIT>' , '<STR_LIT>' ) <EOL> if implib : listCmd . append ( "<STR_LIT>" % implib . get_string ( for_signature ) ) <EOL> return listCmd <EOL> def _dllSources ( target , source , env , for_signature , paramtp ) : <EOL> listCmd = [ ] <EOL> deffile = env . FindIxes ( source , "<STR_LIT>" , "<STR_LIT>" ) <EOL> for src in source : <EOL> if deffile and src == deffile : <EOL> listCmd . append ( "<STR_LIT>" % src . get_string ( for_signature ) ) <EOL> else : <EOL> listCmd . append ( src ) <EOL> return listCmd <EOL> def windowsShlinkTargets ( target , source , env , for_signature ) : <EOL> return _dllTargets ( target , source , env , for_signature , '<STR_LIT>' ) <EOL> def windowsShlinkSources ( target , source , env , for_signature ) : <EOL> return _dllSources ( target , source , env , for_signature , '<STR_LIT>' ) <EOL> def _windowsLdmodTargets ( target , source , env , for_signature ) : <EOL> """<STR_LIT>""" <EOL> return _dllTargets ( target , source , env , for_signature , '<STR_LIT>' ) <EOL> def _windowsLdmodSources ( target , source , env , for_signature ) : <EOL> """<STR_LIT>""" <EOL> return _dllSources ( target , source , env , for_signature , '<STR_LIT>' ) <EOL> def _dllEmitter ( target , source , env , paramtp ) : <EOL> """<STR_LIT>""" <EOL> SCons . Tool . msvc . validate_vars ( env ) <EOL> extratargets = [ ] <EOL> extrasources = [ ] <EOL> dll = env . FindIxes ( target , '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp ) <EOL> no_import_lib = env . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> if not dll : <EOL> raise SCons . Errors . UserError , '<STR_LIT>' % env . subst ( '<STR_LIT>' % paramtp ) <EOL> insert_def = env . subst ( "<STR_LIT>" ) <EOL> if not insert_def in [ '<STR_LIT>' , '<STR_LIT:0>' , <NUM_LIT:0> ] and not env . FindIxes ( source , "<STR_LIT>" , "<STR_LIT>" ) : <EOL> extrasources . append ( <EOL> env . ReplaceIxes ( dll , <EOL> '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> version_num , suite = SCons . Tool . msvs . msvs_parse_version ( env . get ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> if version_num >= <NUM_LIT> and env . get ( '<STR_LIT>' , <NUM_LIT:0> ) : <EOL> extratargets . append ( <EOL> env . ReplaceIxes ( dll , <EOL> '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> if env . has_key ( '<STR_LIT>' ) and env [ '<STR_LIT>' ] : <EOL> pdb = env . arg2nodes ( '<STR_LIT>' , target = target , source = source ) [ <NUM_LIT:0> ] <EOL> extratargets . append ( pdb ) <EOL> target [ <NUM_LIT:0> ] . attributes . pdb = pdb <EOL> if not no_import_lib and not env . FindIxes ( target , "<STR_LIT>" , "<STR_LIT>" ) : <EOL> extratargets . append ( <EOL> env . ReplaceIxes ( dll , <EOL> '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> extratargets . append ( <EOL> env . ReplaceIxes ( dll , <EOL> '<STR_LIT>' % paramtp , '<STR_LIT>' % paramtp , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> return ( target + extratargets , source + extrasources ) <EOL> def windowsLibEmitter ( target , source , env ) : <EOL> return _dllEmitter ( target , source , env , '<STR_LIT>' ) <EOL> def ldmodEmitter ( target , source , env ) : <EOL> """<STR_LIT>""" <EOL> return _dllEmitter ( target , source , env , '<STR_LIT>' ) <EOL> def prog_emitter ( target , source , env ) : <EOL> SCons . Tool . msvc . validate_vars ( env ) <EOL> extratargets = [ ] <EOL> exe = env . FindIxes ( target , "<STR_LIT>" , "<STR_LIT>" ) <EOL> if not exe : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % env . subst ( "<STR_LIT>" ) <EOL> version_num , suite = SCons . Tool . msvs . msvs_parse_version ( env . get ( '<STR_LIT>' , '<STR_LIT>' ) ) <EOL> if version_num >= <NUM_LIT> and env . get ( '<STR_LIT>' , <NUM_LIT:0> ) : <EOL> extratargets . append ( <EOL> env . ReplaceIxes ( exe , <EOL> "<STR_LIT>" , "<STR_LIT>" , <EOL> "<STR_LIT>" , "<STR_LIT>" ) ) <EOL> if env . has_key ( '<STR_LIT>' ) and env [ '<STR_LIT>' ] : <EOL> pdb = env . arg2nodes ( '<STR_LIT>' , target = target , source = source ) [ <NUM_LIT:0> ] <EOL> extratargets . append ( pdb ) <EOL> target [ <NUM_LIT:0> ] . attributes . pdb = pdb <EOL> return ( target + extratargets , source ) <EOL> def RegServerFunc ( target , source , env ) : <EOL> if env . has_key ( '<STR_LIT>' ) and env [ '<STR_LIT>' ] : <EOL> ret = regServerAction ( [ target [ <NUM_LIT:0> ] ] , [ source [ <NUM_LIT:0> ] ] , env ) <EOL> if ret : <EOL> raise SCons . Errors . UserError , "<STR_LIT>" % target [ <NUM_LIT:0> ] <EOL> else : <EOL> print "<STR_LIT>" % target [ <NUM_LIT:0> ] <EOL> return ret <EOL> return <NUM_LIT:0> <EOL> regServerAction = SCons . Action . Action ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> regServerCheck = SCons . Action . Action ( RegServerFunc , None ) <EOL> shlibLinkAction = SCons . Action . Action ( '<STR_LIT>' ) <EOL> compositeShLinkAction = shlibLinkAction + regServerCheck <EOL> ldmodLinkAction = SCons . Action . Action ( '<STR_LIT>' ) <EOL> compositeLdmodAction = ldmodLinkAction + regServerCheck <EOL> def generate ( env ) : <EOL> """<STR_LIT>""" <EOL> SCons . Tool . createSharedLibBuilder ( env ) <EOL> SCons . Tool . createProgBuilder ( env ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = SCons . Util . CLVar ( '<STR_LIT>' ) <EOL> env [ '<STR_LIT>' ] = windowsShlinkTargets <EOL> env [ '<STR_LIT>' ] = windowsShlinkSources <EOL> env [ '<STR_LIT>' ] = compositeShLinkAction <EOL> env . Append ( SHLIBEMITTER = [ windowsLibEmitter ] ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = SCons . Util . CLVar ( '<STR_LIT>' ) <EOL> env [ '<STR_LIT>' ] = pdbGenerator <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env . Append ( PROGEMITTER = [ prog_emitter ] ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = <NUM_LIT:0> <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = regServerCheck <EOL> env [ '<STR_LIT>' ] = os . path . join ( SCons . Platform . win32 . get_system_root ( ) , '<STR_LIT>' , '<STR_LIT>' ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> try : <EOL> version = SCons . Tool . msvs . get_default_visualstudio_version ( env ) <EOL> if env . has_key ( '<STR_LIT>' ) and env [ '<STR_LIT>' ] : <EOL> include_path , lib_path , exe_path = SCons . Tool . msvc . get_msvc_default_paths ( env , version ) <EOL> else : <EOL> include_path , lib_path , exe_path = SCons . Tool . msvc . get_msvc_paths ( env , version ) <EOL> env . PrependENVPath ( '<STR_LIT>' , include_path ) <EOL> env . PrependENVPath ( '<STR_LIT>' , lib_path ) <EOL> env . PrependENVPath ( '<STR_LIT>' , exe_path ) <EOL> except ( SCons . Util . RegError , SCons . Errors . InternalError ) : <EOL> pass <EOL> SCons . Tool . createLoadableModuleBuilder ( env ) <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> env [ '<STR_LIT>' ] = _windowsLdmodTargets <EOL> env [ '<STR_LIT>' ] = _windowsLdmodSources <EOL> env [ '<STR_LIT>' ] = [ ldmodEmitter ] <EOL> env [ '<STR_LIT>' ] = compositeLdmodAction <EOL> def exists ( env ) : <EOL> platform = env . get ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> if SCons . Tool . msvs . is_msvs_installed ( ) : <EOL> return <NUM_LIT:1> <EOL> elif platform in ( '<STR_LIT:win32>' , '<STR_LIT>' ) : <EOL> return env . Detect ( '<STR_LIT>' ) <EOL> return None </s>
