File gcc-add-defaultsspec.diff of Package gcc45

Index: gcc/gcc.c
===================================================================
--- gcc/gcc.c.orig	2009-11-04 21:01:19.000000000 +0100
+++ gcc/gcc.c	2009-11-18 14:58:23.000000000 +0100
@@ -402,6 +402,7 @@ static const char *if_exists_else_spec_f
 static const char *replace_outfile_spec_function (int, const char **);
 static const char *version_compare_spec_function (int, const char **);
 static const char *include_spec_function (int, const char **);
+static const char *include_noerr_spec_function (int, const char **);
 static const char *print_asm_header_spec_function (int, const char **);
 static const char *compare_debug_dump_opt_spec_function (int, const char **);
 static const char *compare_debug_self_opt_spec_function (int, const char **);
@@ -1722,6 +1723,7 @@ static const struct spec_function static
   { "replace-outfile",		replace_outfile_spec_function },
   { "version-compare",		version_compare_spec_function },
   { "include",			include_spec_function },
+  { "include_noerr",            include_noerr_spec_function },
   { "print-asm-header",		print_asm_header_spec_function },
   { "compare-debug-dump-opt",	compare_debug_dump_opt_spec_function },
   { "compare-debug-self-opt",	compare_debug_self_opt_spec_function },
@@ -6919,6 +6921,8 @@ main (int argc, char **argv)
   if (access (specs_file, R_OK) == 0)
     read_specs (specs_file, TRUE);
 
+  do_self_spec ("%:include_noerr(defaults.spec)%(default_spec)");
+
   /* Process any configure-time defaults specified for the command line
      options, via OPTION_DEFAULT_SPECS.  */
   for (i = 0; i < ARRAY_SIZE (option_default_specs); i++)
@@ -8763,6 +8767,21 @@ include_spec_function (int argc, const c
 
   return NULL;
 }
+
+static const char *
+include_noerr_spec_function (int argc, const char **argv)
+{
+  char *file;
+
+  if (argc != 1)
+    abort ();
+
+  file = find_a_file (&startfile_prefixes, argv[0], R_OK, 0);
+  if (file)
+    read_specs (file, FALSE);
+
+  return NULL;
+}
 
 /* %:print-asm-header spec function.  Print a banner to say that the
    following output is from the assembler.  */
openSUSE Build Service is sponsored by