parameters: (self, ldflag, gyp_to_build_path)
return_statement: return ldflag
docstring: Checks if ldflag contains a filename and if so remaps it from
      gyp-directory-relative to build-directory-relative.
docstring_summary: Checks if ldflag contains a filename and if so remaps it from
      gyp-directory-relative to build-directory-relative.
docstring_tokens: Checks if ldflag contains a filename and if so remaps it from gyp - directory - relative to build - directory - relative .
function: def _MapLinkerFlagFilename(self, ldflag, gyp_to_build_path):
          """Checks if ldflag contains a filename and if so remaps it from
      gyp-directory-relative to build-directory-relative."""
          # This list is expanded on demand.
          # They get matched as:
          #   -exported_symbols_list file
          #   -Wl,exported_symbols_list file
          #   -Wl,exported_symbols_list,file
          LINKER_FILE = r"(\S+)"
          WORD = r"\S+"
          linker_flags = [
              ["-exported_symbols_list", LINKER_FILE],  # Needed for NaCl.
              ["-unexported_symbols_list", LINKER_FILE],
              ["-reexported_symbols_list", LINKER_FILE],
              ["-sectcreate", WORD, WORD, LINKER_FILE],  # Needed for remoting.
          ]
          for flag_pattern in linker_flags:
              regex = re.compile("(?:-Wl,)?" + "[ ,]".join(flag_pattern))
              m = regex.match(ldflag)
              if m:
                  ldflag = (
                      ldflag[: m.start(1)]
                      + gyp_to_build_path(m.group(1))
                      + ldflag[m.end(1) :]
                  )
          # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS,
          # TODO(thakis): Update ffmpeg.gyp):
          if ldflag.startswith("-L"):
              ldflag = "-L" + gyp_to_build_path(ldflag[len("-L") :])
          return ldflag
function_tokens: def _MapLinkerFlagFilename ( self , ldflag , gyp_to_build_path ) : # This list is expanded on demand. # They get matched as: #   -exported_symbols_list file #   -Wl,exported_symbols_list file #   -Wl,exported_symbols_list,file LINKER_FILE = r"(\S+)" WORD = r"\S+" linker_flags = [ [ "-exported_symbols_list" , LINKER_FILE ] , # Needed for NaCl. [ "-unexported_symbols_list" , LINKER_FILE ] , [ "-reexported_symbols_list" , LINKER_FILE ] , [ "-sectcreate" , WORD , WORD , LINKER_FILE ] , # Needed for remoting. ] for flag_pattern in linker_flags : regex = re . compile ( "(?:-Wl,)?" + "[ ,]" . join ( flag_pattern ) ) m = regex . match ( ldflag ) if m : ldflag = ( ldflag [ : m . start ( 1 ) ] + gyp_to_build_path ( m . group ( 1 ) ) + ldflag [ m . end ( 1 ) : ] ) # Required for ffmpeg (no idea why they don't use LIBRARY_SEARCH_PATHS, # TODO(thakis): Update ffmpeg.gyp): if ldflag . startswith ( "-L" ) : ldflag = "-L" + gyp_to_build_path ( ldflag [ len ( "-L" ) : ] ) return ldflag