parameters: ()
return_statement: return { 'ARFLAGS.target': arflags_target,
             'ARFLAGS.host': arflags_host,
             'LINK_flags': link_flags }
docstring: Run tests against the system to compute default settings for commands.
  
    Returns:
      dictionary of settings matching the block of command-lines used in
      SHARED_HEADER.  E.g. the dictionary will contain a ARFLAGS.target
      key for the default ARFLAGS for the target ar command.
docstring_summary: Run tests against the system to compute default settings for commands.
docstring_tokens: Run tests against the system to compute default settings for commands .
function: def RunSystemTests():
    """Run tests against the system to compute default settings for commands.
  
    Returns:
      dictionary of settings matching the block of command-lines used in
      SHARED_HEADER.  E.g. the dictionary will contain a ARFLAGS.target
      key for the default ARFLAGS for the target ar command.
    """
    # Compute flags used for building static archives.
    # N.B.: this fallback logic should match the logic in SHARED_HEADER.
    # See comment there for more details.
    ar_target = os.environ.get('AR.target', os.environ.get('AR', 'ar'))
    cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc'))
    arflags_target = 'crs'
    if gyp.system_test.TestArSupportsT(ar_command=ar_target,
                                       cc_command=cc_target):
      arflags_target = 'crsT'
  
    ar_host = os.environ.get('AR.host', 'ar')
    cc_host = os.environ.get('CC.host', 'gcc')
    arflags_host = 'crs'
    # It feels redundant to compute this again given that most builds aren't
    # cross-compiles, but due to quirks of history CC.host defaults to 'gcc'
    # while CC.target defaults to 'cc', so the commands really are different
    # even though they're nearly guaranteed to run the same code underneath.
    if gyp.system_test.TestArSupportsT(ar_command=ar_host, cc_command=cc_host):
      arflags_host = 'crsT'
  
    link_flags = ''
    if gyp.system_test.TestLinkerSupportsThreads(cc_command=cc_target):
      # N.B. we don't test for cross-compilation; as currently written, we
      # don't even use flock when linking in the cross-compile setup!
      # TODO(evan): refactor cross-compilation such that this code can
      # be reused.
      link_flags = '-Wl,--threads --Wl,--thread-count=4'
  
    # TODO(evan): cache this output.  (But then we'll need to add extra
    # flags to gyp to flush the cache, yuk!  It's fast enough for now to
    # just run it every time.)
  
    return { 'ARFLAGS.target': arflags_target,
             'ARFLAGS.host': arflags_host,
             'LINK_flags': link_flags }
function_tokens: def RunSystemTests ( ) : # Compute flags used for building static archives. # N.B.: this fallback logic should match the logic in SHARED_HEADER. # See comment there for more details. ar_target = os . environ . get ( 'AR.target' , os . environ . get ( 'AR' , 'ar' ) ) cc_target = os . environ . get ( 'CC.target' , os . environ . get ( 'CC' , 'cc' ) ) arflags_target = 'crs' if gyp . system_test . TestArSupportsT ( ar_command = ar_target , cc_command = cc_target ) : arflags_target = 'crsT' ar_host = os . environ . get ( 'AR.host' , 'ar' ) cc_host = os . environ . get ( 'CC.host' , 'gcc' ) arflags_host = 'crs' # It feels redundant to compute this again given that most builds aren't # cross-compiles, but due to quirks of history CC.host defaults to 'gcc' # while CC.target defaults to 'cc', so the commands really are different # even though they're nearly guaranteed to run the same code underneath. if gyp . system_test . TestArSupportsT ( ar_command = ar_host , cc_command = cc_host ) : arflags_host = 'crsT' link_flags = '' if gyp . system_test . TestLinkerSupportsThreads ( cc_command = cc_target ) : # N.B. we don't test for cross-compilation; as currently written, we # don't even use flock when linking in the cross-compile setup! # TODO(evan): refactor cross-compilation such that this code can # be reused. link_flags = '-Wl,--threads --Wl,--thread-count=4' # TODO(evan): cache this output.  (But then we'll need to add extra # flags to gyp to flush the cache, yuk!  It's fast enough for now to # just run it every time.) return { 'ARFLAGS.target' : arflags_target , 'ARFLAGS.host' : arflags_host , 'LINK_flags' : link_flags }