aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcc.c
diff options
context:
space:
mode:
authorAndrew Pinski <pinskia@physics.uc.edu>2004-09-16 06:49:59 +0000
committerAndrew Pinski <pinskia@gcc.gnu.org>2004-09-15 23:49:59 -0700
commit3dd53121bd70fdcc8eb33cb4639eb9272c2b930f (patch)
treeeea8e6b301cfcc78ad08dad2ffb1c0dc3348acdd /gcc/gcc.c
parent511bbc8f91882da77dfb2026bbed3ee94df4f731 (diff)
downloadgcc-3dd53121bd70fdcc8eb33cb4639eb9272c2b930f.zip
gcc-3dd53121bd70fdcc8eb33cb4639eb9272c2b930f.tar.gz
gcc-3dd53121bd70fdcc8eb33cb4639eb9272c2b930f.tar.bz2
re PR libobjc/11572 (GNU libobjc no longer compiled on Darwin)
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. From-SVN: r87588
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 45a9ab4..6e7dec9 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -361,6 +361,7 @@ static const char *convert_filename (const char *, int, int);
static const char *if_exists_spec_function (int, const char **);
static const char *if_exists_else_spec_function (int, const char **);
+static const char *replace_outfile_spec_function (int, const char **);
/* The Specs Language
@@ -1572,6 +1573,7 @@ static const struct spec_function static_spec_functions[] =
{
{ "if-exists", if_exists_spec_function },
{ "if-exists-else", if_exists_else_spec_function },
+ { "replace-outfile", replace_outfile_spec_function },
{ 0, 0 }
};
@@ -7582,3 +7584,24 @@ if_exists_else_spec_function (int argc, const char **argv)
return argv[1];
}
+
+/* replace-outfile built-in spec function.
+ This looks for the first argument in the outfiles array's name and replaces it
+ with the second argument. */
+
+static const char *
+replace_outfile_spec_function (int argc, const char **argv)
+{
+ int i;
+ /* Must have exactly two arguments. */
+ if (argc != 2)
+ abort ();
+
+ for (i = 0; i < n_infiles; i++)
+ {
+ if (outfiles[i] && !strcmp (outfiles[i], argv[0]))
+ outfiles[i] = xstrdup (argv[1]);
+ }
+ return NULL;
+}
+