GCC command line arguments for including aux libraries
 @param aux_libraries [Array<Pathname>] The external Arduino libraries required by this project
 @return [Array<String>] The GCC command-line flags necessary to include those libraries
327794
def include_args(aux_libraries)
      all_aux_include_dirs = arduino_library_src_dirs(aux_libraries)
      places = [ARDUINO_HEADER_DIR, UNITTEST_HEADER_DIR] + header_dirs + all_aux_include_dirs
      places.map { |d| "-I#{d}" }
    end
1083568
def libasan?(gcc_binary)
      unless @has_libasan_cache.key?(gcc_binary)
        file = Tempfile.new(["arduino_ci_libasan_check", ".cpp"])
        begin
          file.write "int main(){}"
          file.close
          @has_libasan_cache[gcc_binary] = run_gcc(gcc_binary, "-o", "/dev/null", "-fsanitize=address", file.path)
        ensure
          file.delete
        end
      end
      @has_libasan_cache[gcc_binary]
    end
1283533
def library_directories(self) -> typing.List[str]:
        
        def listify(value):
            return [value] if isinstance(value, str) else list(value)

        # If this is a project running remotely remove external library
        # folders as the remote shared libraries folder will contain all
        # of the necessary dependencies
        is_local_project = not self.is_remote_project
        folders = [
            f
            for f in listify(self.settings.fetch('library_folders', ['libs']))
            if is_local_project or not f.startswith('..')
        ]

        # Include the remote shared library folder as well
        folders.append('../__cauldron_shared_libs')

        # Include the project directory as well
        folders.append(self.source_directory)

        return [
            environ.paths.clean(os.path.join(self.source_directory, folder))
            for folder in folders
        ]
253856
def add_external_library(library):
    

    for command in ['build', 'build_ext', 'install']:
        add_command_option(command, str('use-system-' + library),
                           'Use the system {0} library'.format(library),
                           is_bool=True)
296195
def lines(arch)
      lines        = Lines.new
      current_line = nil

      stdin, stdout, stderr = Open3.popen3('dwarfdump', '--debug-line', "--arch=#{arch}", @dsym)
      stdout.each_line do |line|
        if current_line
          if line =~ /^include_directories\[\s+(\d+)\] = '(.+)'$/
            current_line[:include_directories][$1] = $2
          elsif line =~ /^file_names\[\s*(\d+)\]\s+(\d+)\s+0x[0-9a-f]+\s+0x[0-9a-f]+\s+(.+)$/
            current_line[:file_names][$1] = current_line[:include_directories][$2] + '/' + $3
          elsif line =~ /^            (0x[0-9a-f]+)\s+(\d+)\s+(\d+)\s+(\d+)\s+/
            path          = current_line[:file_names][$2]
            line          = $3.to_i
            col           = $4.to_i
            start_address = $1.hex
            path.sub!(/^#{Regexp.escape @project_dir}\//, '') if @project_dir
            lines.add start_address, path, line, col
          end
        else
          if line =~ /^debug_line\[0x[0-9a-f]+\]$/
            current_line = {
                :include_directories => {},
                :file_names          => {}
            }
          end
        end
      end

      return lines
    end
146443
def argnames(self):
        
        # pylint: disable=no-member; github.com/pycqa/astroid/issues/291
        # args is in fact redefined later on by postinit. Can't be changed
        # to None due to a strong interaction between Lambda and FunctionDef.

        if self.args.args:  # maybe None with builtin functions
            names = _rec_get_names(self.args.args)
        else:
            names = []
        if self.args.vararg:
            names.append(self.args.vararg)
        if self.args.kwarg:
            names.append(self.args.kwarg)
        return names
531803
def getThirdPartyLibLinkerFlags(self, libs):
		
		fmt = PrintingFormat.singleLine()
		if libs[0] == '--multiline':
			fmt = PrintingFormat.multiLine()
			libs = libs[1:]
		
		includeLibs = True
		if (libs[0] == '--flagsonly'):
			includeLibs = False
			libs = libs[1:]
		
		platformDefaults = True
		if libs[0] == '--nodefaults':
			platformDefaults = False
			libs = libs[1:]
		
		details = self.getThirdpartyLibs(libs, includePlatformDefaults=platformDefaults)
		return details.getLinkerFlags(self.getEngineRoot(), fmt, includeLibs)
901787
def _add_path_traversal_strings(self, lib):
        '''
        
        '''
        entries = [
            (('/etc/passwd', 'absolute - /etc/passwd')),
            (('./../../../../../../../../../../../../../../etc/passwd', 'relative - /etc/passwd')),
            (('../../../../../../../../../../../../../../etc/passwd', 'relative - /etc/passwd')),
            (('/proc/cpuinfo', 'absolute path - /proc/cpuinfo')),
            (('./../../../../../../../../../../../../../../proc/cpuinfo', 'relative - /proc/cpuinfo')),
            (('../../../../../../../../../../../../../../proc/cpuinfo', 'relative - /proc/cpuinfo')),
            (('~/.profile', 'absolute - home')),
            (('$HOME/.profile', 'environment - home')),
            (('/../../../../../../../../../../../../boot.ini', 'relative - boot.ini')),
        ]
        for (s, desc) in entries:
            lib.append((s, 'path traversal - %s' % desc))
741178
def get_arguments(self, **include):
        
        d = dict(self._kwargs)

        for k in include:
            if not include[k] and k in d:
                d.pop(k)
        return d
114987
def getIncludeAndRuntime():
    
    include_dirs, library_dirs = [], []

    py_include = distutils.sysconfig.get_python_inc()
    plat_py_include = distutils.sysconfig.get_python_inc(plat_specific=1)

    include_dirs.append(py_include)
    if plat_py_include != py_include:
        include_dirs.append(plat_py_include)

    if os.name == 'nt':
        library_dirs.append(os.path.join(sys.exec_prefix, 'libs'))
        include_dirs.append(os.path.join(sys.exec_prefix, 'PC'))

        MSVC_VERSION = int(distutils.msvccompiler.get_build_version())
        if MSVC_VERSION == 14:
            library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VS14',
                                             'win32release'))
        elif MSVC_VERSION == 9:
            suffix = '' if PLATFORM == 'win32' else PLATFORM[4:]
            new_lib = os.path.join(sys.exec_prefix, 'PCbuild')
            if suffix:
                new_lib = os.path.join(new_lib, suffix)
            library_dirs.append(new_lib)
        elif MSVC_VERSION == 8:
            library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VS8.0',
                                             'win32release'))
        elif MSVC_VERSION == 7:
            library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VS7.1'))
        else:
            library_dirs.append(os.path.join(sys.exec_prefix, 'PC', 'VC6'))

    if os.name == 'os2':
        library_dirs.append(os.path.join(sys.exec_prefix, 'Config'))

    is_cygwin = sys.platform[:6] == 'cygwin'
    is_atheos = sys.platform[:6] == 'atheos'
    is_shared = distutils.sysconfig.get_config_var('Py_ENABLE_SHARED')
    is_linux = sys.platform.startswith('linux')
    is_gnu = sys.platform.startswith('gnu')
    is_sunos = sys.platform.startswith('sunos')

    if is_cygwin or is_atheos:
        if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
            library_dirs.append(os.path.join(sys.prefix, "lib", BASENAME,
                                             "config"))
        else:
            library_dirs.append(os.getcwd())

    if (is_linux or is_gnu or is_sunos) and is_shared:
        if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")):
            library_dirs.append(distutils.sysconfig.get_config_var('LIBDIR'))
        else:
            library_dirs.append(os.getcwd())

    user_include = os.path.join(site.USER_BASE, "include")
    user_lib = os.path.join(site.USER_BASE, "lib")
    if os.path.isdir(user_include):
        include_dirs.append(user_include)
    if os.path.isdir(user_lib):
        library_dirs.append(user_lib)

    ret_object = (include_dirs, library_dirs)
    _filter_non_existing_dirs(ret_object)

    return ret_object
1221804
def getThirdPartyLibCmakeFlags(self, libs):
		
		fmt = PrintingFormat.singleLine()
		if libs[0] == '--multiline':
			fmt = PrintingFormat.multiLine()
			libs = libs[1:]
		
		platformDefaults = True
		if libs[0] == '--nodefaults':
			platformDefaults = False
			libs = libs[1:]
		
		details = self.getThirdpartyLibs(libs, includePlatformDefaults=platformDefaults)
		CMakeCustomFlags.processLibraryDetails(details)
		return details.getCMakeFlags(self.getEngineRoot(), fmt)
863918
def _render_jar_tool_args(self, options):
    
    args = []

    with temporary_dir() as manifest_stage_dir:
      # relativize urls in canonical classpath, this needs to be stable too therefore
      # do not follow the symlinks because symlinks may vary from platform to platform.
      classpath = relativize_classpath(self.classpath,
                                       os.path.dirname(self._path),
                                       followlinks=False)

      def as_cli_entry(entry):
        src = entry.materialize(manifest_stage_dir)
        return '{}={}'.format(src, entry.dest) if entry.dest else src
      files = [as_cli_entry(entry) for entry in self._entries] if self._entries else []

      jars = self._jars or []

      with safe_args(classpath, options, delimiter=',') as classpath_args:
        with safe_args(files, options, delimiter=',') as files_args:
          with safe_args(jars, options, delimiter=',') as jars_args:

            # If you specify --manifest to jar-tool you cannot specify --main.
            if self._manifest_entry:
              manifest_file = self._manifest_entry.materialize(manifest_stage_dir)
            else:
              manifest_file = None

            if self._main and manifest_file:
              main_arg = None
              with open(manifest_file, 'a') as f:
                f.write("Main-Class: {}\n".format(self._main))
            else:
              main_arg = self._main

            if main_arg:
              args.append('-main={}'.format(self._main))

            if classpath_args:
              args.append('-classpath={}'.format(','.join(classpath_args)))

            if manifest_file:
              args.append('-manifest={}'.format(manifest_file))

            if files_args:
              args.append('-files={}'.format(','.join(files_args)))

            if jars_args:
              args.append('-jars={}'.format(','.join(jars_args)))

            yield args
532352
def _GetRunFlowFlags(args=None):
    """"""
    # There's one rare situation where gsutil will not have argparse
    # available, but doesn't need anything depending on argparse anyway,
    # since they're bringing their own credentials. So we just allow this
    # to fail with an ImportError in those cases.
    #
    # TODO(craigcitro): Move this import back to the top when we drop
    # python 2.6 support (eg when gsutil does).
    import argparse

    parser = argparse.ArgumentParser(parents=[tools.argparser])
    # Get command line argparse flags.
    flags, _ = parser.parse_known_args(args=args)

    # Allow `gflags` and `argparse` to be used side-by-side.
    if hasattr(FLAGS, 'auth_host_name'):
        flags.auth_host_name = FLAGS.auth_host_name
    if hasattr(FLAGS, 'auth_host_port'):
        flags.auth_host_port = FLAGS.auth_host_port
    if hasattr(FLAGS, 'auth_local_webserver'):
        flags.noauth_local_webserver = (not FLAGS.auth_local_webserver)
    return flags
1276611
def add_signaling_arguments(parser):
    
    parser.add_argument('--signaling', '-s', choices=[
        'copy-and-paste', 'tcp-socket', 'unix-socket'])
    parser.add_argument('--signaling-host', default='127.0.0.1',
                        help='Signaling host (tcp-socket only)')
    parser.add_argument('--signaling-port', default=1234,
                        help='Signaling port (tcp-socket only)')
    parser.add_argument('--signaling-path', default='aiortc.socket',
                        help='Signaling socket path (unix-socket only)')
170406
def args(lib=library)
      @args = !@args.nil? ? @args : begin
        if lib
          file_string, meth = file_string_and_method_for_args(lib)
          (file_string && meth && (@file_parsed_args = true) &&
            MethodInspector.scrape_arguments(file_string, meth))
        end || false
      end
    end
694885
def cmd(self):
        
        cmd = (
            [self.compiler_binary] +
            self.flags +
            ['-U'+x for x in self.undef] +
            ['-D'+x for x in self.define] +
            ['-I'+x for x in self.include_dirs] +
            self.sources
        )
        if self.run_linker:
            cmd += (['-L'+x for x in self.library_dirs] +
                    [(x if os.path.exists(x) else '-l'+x) for x in self.libraries] +
                    self.linkline)
        counted = []
        for envvar in re.findall('\$\{(\w+)\}', ' '.join(cmd)):
            if os.getenv(envvar) is None:
                if envvar not in counted:
                    counted.append(envvar)
                    msg = "Environment variable '{}' undefined.".format(
                        envvar)
                    self.logger.error(msg)
                    raise CompilationError(msg)
        return cmd
565862
def has_void_args(argv):
    
    n_args = len(argv)
    return n_args == 1 or n_args == 2 and argv[1].startswith('--conf=') or n_args == 3 and argv[1] == '--conf'