<s> """<STR_LIT>""" <EOL> import SCons . Action <EOL> import SCons . Util <EOL> import gnulink <EOL> def shlib_generator ( target , source , env , for_signature ) : <EOL> cmd = SCons . Util . CLVar ( [ '<STR_LIT>' ] ) <EOL> dll = env . FindIxes ( target , '<STR_LIT>' , '<STR_LIT>' ) <EOL> if dll : cmd . extend ( [ '<STR_LIT>' , dll ] ) <EOL> cmd . extend ( [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> implib = env . FindIxes ( target , '<STR_LIT>' , '<STR_LIT>' ) <EOL> if implib : <EOL> cmd . extend ( [ <EOL> '<STR_LIT>' + implib . get_string ( for_signature ) , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ] ) <EOL> else : <EOL> cmd . extend ( [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> return [ cmd ] <EOL> def shlib_emitter ( target , source , env ) : <EOL> dll = env . FindIxes ( target , '<STR_LIT>' , '<STR_LIT>' ) <EOL> no_import_lib = env . get ( '<STR_LIT>' , <NUM_LIT:0> ) <EOL> if not dll or len ( target ) > <NUM_LIT:1> : <EOL> raise SCons . Errors . UserError ( "<STR_LIT>" % env . subst ( "<STR_LIT>" ) ) <EOL> pre = env . subst ( '<STR_LIT>' ) <EOL> if dll . name [ len ( pre ) : len ( pre ) + <NUM_LIT:3> ] == '<STR_LIT>' : <EOL> dll . name = pre + dll . name [ len ( pre ) + <NUM_LIT:3> : ] <EOL> orig_target = target <EOL> target = [ env . fs . File ( dll ) ] <EOL> target [ <NUM_LIT:0> ] . attributes . shared = <NUM_LIT:1> <EOL> if not no_import_lib : <EOL> target_strings = env . ReplaceIxes ( orig_target [ <NUM_LIT:0> ] , <EOL> '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ) <EOL> implib_target = env . fs . File ( target_strings ) <EOL> implib_target . attributes . shared = <NUM_LIT:1> <EOL> target . append ( implib_target ) <EOL> return ( target , source ) <EOL> shlib_action = SCons . Action . Action ( shlib_generator , generator = <NUM_LIT:1> ) <EOL> def generate ( env ) : <EOL> """<STR_LIT>""" <EOL> gnulink . generate ( env ) <EOL> env [ '<STR_LIT>' ] = SCons . Util . CLVar ( '<STR_LIT>' ) <EOL> env [ '<STR_LIT>' ] = shlib_action <EOL> env [ '<STR_LIT>' ] = shlib_action <EOL> env . Append ( SHLIBEMITTER = [ shlib_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> def exists ( env ) : <EOL> return gnulink . exists ( env ) </s>
