FreeBSD/contrib/gcc/c-incpath.c
/* Exported function to handle include chain merging, duplicate
   removal, and registration with cpplib.  */
Exported function to handle include chain merging, duplicate
removal, and registration with cpplib.
Exported function to handle include chain merging duplicate removal and registration with cpplib .
void
register_include_chains (cpp_reader *pfile, const char *sysroot,
			 const char *iprefix, const char *imultilib,
			 int stdinc, int cxx_stdinc, int verbose)
{
  static const char *const lang_env_vars[] =
    { "C_INCLUDE_PATH", "CPLUS_INCLUDE_PATH",
      "OBJC_INCLUDE_PATH", "OBJCPLUS_INCLUDE_PATH" };
  cpp_options *cpp_opts = cpp_get_options (pfile);
  size_t idx = (cpp_opts->objc ? 2: 0);
  if (cpp_opts->cplusplus)
    idx++;
  else
    cxx_stdinc = false;
  add_env_var_paths ("CPATH", BRACKET);
  add_env_var_paths (lang_env_vars[idx], SYSTEM);
  target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc);
  if (stdinc)
    add_standard_paths (sysroot, iprefix, imultilib, cxx_stdinc);
  target_c_incpath.extra_includes (sysroot, iprefix, stdinc);
  merge_include_chains (pfile, verbose);
  cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET],
			  quote_ignores_source_dir);
}
void register_include_chains ( cpp_reader * pfile , const char * sysroot , const char * iprefix , const char * imultilib , int stdinc , int cxx_stdinc , int verbose ) { static const char * const lang_env_vars [ ] = { " " , " " , " " , " " } ; cpp_options * cpp_opts = cpp_get_options ( pfile ) ; size_t idx = ( cpp_opts -> objc ? 2 : 0 ) ; if ( cpp_opts -> cplusplus ) idx ++ ; else cxx_stdinc = false ; add_env_var_paths ( " " , BRACKET ) ; add_env_var_paths ( lang_env_vars [ idx ] , SYSTEM ) ; target_c_incpath . extra_pre_includes ( sysroot , iprefix , stdinc ) ; if ( stdinc ) add_standard_paths ( sysroot , iprefix , imultilib , cxx_stdinc ) ; target_c_incpath . extra_includes ( sysroot , iprefix , stdinc ) ; merge_include_chains ( pfile , verbose ) ; cpp_set_include_chains ( pfile , heads [ QUOTE ] , heads [ BRACKET ] , quote_ignores_source_dir ) ; }
Exported function to handle include chain merging, duplicate
removal, and registration with cpplib.
Exported function to handle include chain merging duplicate removal and registration with cpplib .
/* CPATH and language-dependent environment variables may add to the
     include chain.  */ /* Finally chain on the standard directories.  */