summaryrefslogtreecommitdiff
path: root/gcc/config/darwin-c.c
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-16 06:49:59 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-09-16 06:49:59 +0000
commit2288041ea79a1adf1cbb2e44e9b04fc4a70173bd (patch)
treeeea8e6b301cfcc78ad08dad2ffb1c0dc3348acdd /gcc/config/darwin-c.c
parent921d9bf36ddd5d4ac808fea780faee0cf3141a54 (diff)
downloadgcc-2288041ea79a1adf1cbb2e44e9b04fc4a70173bd.tar.gz
2004-09-15 Andrew Pinski <pinskia@physics.uc.edu>
PR target/11572 * c-incpath.h (target_c_incpath_s): Add extra_pre_includes. Add two parameters to extra_includes. (C_INCPATH_INIT): Remove. * c-incpath.c (register_include_chains): Call extra_pre_includes before adding the standard include directory. Update call to extra_includes. (!defined TARGET_EXTRA_INCLUDES): Update hook_void_charptr_charptr_int and add !define TARGET_EXTRA_PRE_INCLUDES. (!define TARGET_EXTRA_INCLUDES): Define as hook_void_charptr_charptr_int. (!define TARGET_EXTRA_PRE_INCLUDES): Likewise. (target_c_incpath): Always declare. * fixinclude.c (defined TARGET_EXTRA_INCLUDES): Declare a empty function. (define TARGET_EXTRA_PRE_INCLUDES): Likewise. * config/darwin.h: (darwin_register_frameworks): Update for the two new parameters. (darwin_register_objc_includes): Add prototype. (TARGET_EXTRA_PRE_INCLUDES): Define. * config/darwin-c.c (darwin_register_objc_includes): New function. (darwin_register_frameworks): Update for the two new parameters. (target_c_incpath): Remove. * config/t-darwin (darwin-c.o): Add $(PREPROCESSOR_DEFINES) to the compile line. * doc/tm.texi (TARGET_EXTRA_INCLUDES): Document the two new parameters. (TARGET_EXTRA_PRE_INCLUDES): Document. * gcc.c (spec_function): Add replace-outfile. (replace_outfile_spec_function): New function. * config/darwin.h (LINK_SPEC): Add replace -lobjc with -lobjc-gnu if -fgnu-runtime is supplied. * invoke.texi (replace-outfile): Document. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87588 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/darwin-c.c')
-rw-r--r--gcc/config/darwin-c.c48
1 files changed, 45 insertions, 3 deletions
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index 9adf2498bcc..d7f3e01016f 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA. */
#include "c-incpath.h"
#include "toplev.h"
#include "tm_p.h"
+#include "cppdefault.h"
+#include "prefix.h"
/* Pragmas. */
@@ -419,13 +421,55 @@ static const char *framework_defaults [] =
"/Library/Frameworks",
};
+/* Register the GNU objective-C runtime include path if STDINC. */
+
+void
+darwin_register_objc_includes (const char *sysroot, const char *iprefix,
+ int stdinc)
+{
+ const char *fname;
+ size_t len;
+ /* We do not do anything if we do not want the standard includes. */
+ if (!stdinc)
+ return;
+
+ fname = GCC_INCLUDE_DIR "-gnu-runtime";
+
+ /* Register the GNU OBJC runtime include path if we are compiling OBJC
+ with GNU-runtime. */
+
+ if (c_dialect_objc () && !flag_next_runtime)
+ {
+ char *str;
+ /* See if our directory starts with the standard prefix.
+ "Translate" them, ie. replace /usr/local/lib/gcc... with
+ IPREFIX and search them first. */
+ if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot
+ && !strncmp (fname, cpp_GCC_INCLUDE_DIR, len))
+ {
+ str = concat (iprefix, fname + len, NULL);
+ /* FIXME: wrap the headers for C++awareness. */
+ add_path (str, SYSTEM, /*c++aware=*/false, false);
+ }
+
+ /* Should this directory start with the sysroot? */
+ if (sysroot)
+ str = concat (sysroot, fname, NULL);
+ else
+ str = update_path (fname, "");
+
+ add_path (str, SYSTEM, /*c++aware=*/false, false);
+ }
+}
+
/* Register all the system framework paths if STDINC is true and setup
the missing_header callback for subframework searching if any
frameworks had been registered. */
void
-darwin_register_frameworks (int stdinc)
+darwin_register_frameworks (const char *sysroot ATTRIBUTE_UNUSED,
+ const char *iprefix ATTRIBUTE_UNUSED, int stdinc)
{
if (stdinc)
{
@@ -476,5 +520,3 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp)
return 0;
}
-
-struct target_c_incpath_s target_c_incpath = C_INCPATH_INIT;