diff options
author | Mike Stump <mrs@apple.com> | 2004-03-04 00:18:54 +0000 |
---|---|---|
committer | Mike Stump <mrs@gcc.gnu.org> | 2004-03-04 00:18:54 +0000 |
commit | 94d1613b239ef411e8fd6e6e647d920149d1d272 (patch) | |
tree | 52808307852a6d2e40b91f9dd8a1f85f701d9c10 /gcc/c-incpath.c | |
parent | c158d74ab414718dba2a566728c4b58ed6f781f7 (diff) | |
download | gcc-94d1613b239ef411e8fd6e6e647d920149d1d272.tar.gz |
Add framework support for darwin.
* c-incpath.c: Include target.h and machmode.h.
(add_path): Use a consistent style for cpp_dir. Initialize
p->construct to 0.
(add_cpp_dir_path): New.
(register_include_chains): Add use of extra_includes callback.
(hook_void_int): Add.
(target_c_incpath): Add.
* c-incpath.h (add_cpp_dir_path): New.
(target_c_incpath_s): Add.
(target_c_incpath): Add.
(C_INCPATH_INIT): Add.
* c-opts.c (c_common_missing_argument,
c_common_handle_option): Add -F argument processing.
* c.opt: Add -F argument processing.
* gcc.c (trad_capable_cpp): Add -F argument processing.
* cppfiles.c (find_file_in_dir): Update to use construct
callback.
(search_path_exhausted, cpp_get_path, cpp_get_buffer,
cpp_get_prev): New.
(_cpp_find_file): Use search_path_exhausted.
(make_cpp_dir): Initialize construct to 0.
* cpplib.h (missing_header_cb
cpp_get_path, cpp_get_buffer, cpp_get_file, cpp_get_prev): New.
(cpp_callbacks): Add missing_header
(cpp_dir): Add construct.
* target-def.h: (TARGET_OPTF): New.
* hooks.c (hook_void_int, hook_void_charptr): Add.
* hooks.h (hook_void_int, hook_void_charptr): Add.
* Makefile.in (c-incpath.o) : Add $(TARGET_H) and
$(MACHMODE_H) dependencies.
* doc/invoke.texi (Darwin Options): Document -F.
* doc/tm.texi (TARGET_EXTRA_INCLUDES): Add.
(TARGET_OPTF): Add.
* fix-header.c (target_c_incpath): Add.
* config/darwin-c.c: Add c-incpath.h include.
(using_frameworks, find_subframework_file,
find_subframework_header, add_system_framework_path,
frameworks_in_use, num_frameworks, max_frameworks,
add_framework, find_framework, struct framework_header,
framework_header_dirs, framework_construct_pathname,
find_subframework_file, add_system_framework_path,
add_framework_path, framework_defaults,
darwin_register_frameworks, find_subframework_header): Add.
* config/darwin.h (TARGET_EXTRA_INCLUDES, TARGET_OPTF): New.
(TARGET_OPTION_TRANSLATE_TABLE): Add -framework support.
(CPP_SPEC): Add __APPLE_CC__ support.
* t-darwin (darwin-c.o): Add c-incpath.h dependency.
From-SVN: r78875
Diffstat (limited to 'gcc/c-incpath.c')
-rw-r--r-- | gcc/c-incpath.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c index 7b08c1a12a3..7f6cbdf63f0 100644 --- a/gcc/c-incpath.c +++ b/gcc/c-incpath.c @@ -21,6 +21,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "system.h" #include "coretypes.h" +#include "machmode.h" +#include "target.h" #include "tm.h" #include "cpplib.h" #include "prefix.h" @@ -298,20 +300,33 @@ split_quote_chain (void) quote_ignores_source_dir = true; } +/* Add P to the chain specified by CHAIN. */ + +void +add_cpp_dir_path (cpp_dir *p, int chain) +{ + if (tails[chain]) + tails[chain]->next = p; + else + heads[chain] = p; + tails[chain] = p; +} + /* Add PATH to the include chain CHAIN. PATH must be malloc-ed and NUL-terminated. */ void add_path (char *path, int chain, int cxx_aware) { - struct cpp_dir *p; + cpp_dir *p; - p = xmalloc (sizeof (struct cpp_dir)); + p = xmalloc (sizeof (cpp_dir)); p->next = NULL; p->name = path; if (chain == SYSTEM || chain == AFTER) p->sysp = 1 + !cxx_aware; else p->sysp = 0; + p->construct = 0; if (tails[chain]) tails[chain]->next = p; @@ -347,8 +362,16 @@ register_include_chains (cpp_reader *pfile, const char *sysroot, if (stdinc) add_standard_paths (sysroot, iprefix, cxx_stdinc); + target_c_incpath.extra_includes (stdinc); + merge_include_chains (pfile, verbose); cpp_set_include_chains (pfile, heads[QUOTE], heads[BRACKET], quote_ignores_source_dir); } + +#ifndef TARGET_EXTRA_INCLUDES +static void hook_void_int(int u ATTRIBUTE_UNUSED) { } + +struct target_c_incpath_s target_c_incpath = { hook_void_int }; +#endif |