parameters: (fp, config, indent='', src_dir='')
docstring: Generates SCons dictionary items for a gyp configuration.
  
    This provides the main translation between the (lower-case) gyp settings
    keywords and the (upper-case) SCons construction variables.
docstring_summary: Generates SCons dictionary items for a gyp configuration.
docstring_tokens: Generates SCons dictionary items for a gyp configuration .
function: def GenerateConfig(fp, config, indent='', src_dir=''):
    """
    Generates SCons dictionary items for a gyp configuration.
  
    This provides the main translation between the (lower-case) gyp settings
    keywords and the (upper-case) SCons construction variables.
    """
    var_mapping = {
        'ASFLAGS' : 'asflags',
        'CCFLAGS' : 'cflags',
        'CFLAGS' : 'cflags_c',
        'CXXFLAGS' : 'cflags_cc',
        'CPPDEFINES' : 'defines',
        'CPPPATH' : 'include_dirs',
        # Add the ldflags value to $LINKFLAGS, but not $SHLINKFLAGS.
        # SCons defines $SHLINKFLAGS to incorporate $LINKFLAGS, so
        # listing both here would case 'ldflags' to get appended to
        # both, and then have it show up twice on the command line.
        'LINKFLAGS' : 'ldflags',
    }
    postamble='\n%s],\n' % indent
    for scons_var in sorted(var_mapping.keys()):
        gyp_var = var_mapping[scons_var]
        value = config.get(gyp_var)
        if value:
          if gyp_var in ('defines',):
            value = [EscapeCppDefine(v) for v in value]
          if gyp_var in ('include_dirs',):
            if src_dir and not src_dir.endswith('/'):
              src_dir += '/'
            result = []
            for v in value:
              v = FixPath(v, src_dir)
              # Force SCons to evaluate the CPPPATH directories at
              # SConscript-read time, so delayed evaluation of $SRC_DIR
              # doesn't point it to the --generator-output= directory.
              result.append('env.Dir(%r)' % v)
            value = result
          else:
            value = map(repr, value)
          WriteList(fp,
                    value,
                    prefix=indent,
                    preamble='%s%s = [\n    ' % (indent, scons_var),
                    postamble=postamble)
function_tokens: def GenerateConfig ( fp , config , indent = '' , src_dir = '' ) : var_mapping = { 'ASFLAGS' : 'asflags' , 'CCFLAGS' : 'cflags' , 'CFLAGS' : 'cflags_c' , 'CXXFLAGS' : 'cflags_cc' , 'CPPDEFINES' : 'defines' , 'CPPPATH' : 'include_dirs' , # Add the ldflags value to $LINKFLAGS, but not $SHLINKFLAGS. # SCons defines $SHLINKFLAGS to incorporate $LINKFLAGS, so # listing both here would case 'ldflags' to get appended to # both, and then have it show up twice on the command line. 'LINKFLAGS' : 'ldflags' , } postamble = '\n%s],\n' % indent for scons_var in sorted ( var_mapping . keys ( ) ) : gyp_var = var_mapping [ scons_var ] value = config . get ( gyp_var ) if value : if gyp_var in ( 'defines' , ) : value = [ EscapeCppDefine ( v ) for v in value ] if gyp_var in ( 'include_dirs' , ) : if src_dir and not src_dir . endswith ( '/' ) : src_dir += '/' result = [ ] for v in value : v = FixPath ( v , src_dir ) # Force SCons to evaluate the CPPPATH directories at # SConscript-read time, so delayed evaluation of $SRC_DIR # doesn't point it to the --generator-output= directory. result . append ( 'env.Dir(%r)' % v ) value = result else : value = map ( repr , value ) WriteList ( fp , value , prefix = indent , preamble = '%s%s = [\n    ' % ( indent , scons_var ) , postamble = postamble )