OSDN Git Service

2010-06-05 Matthias Klose <doko@ubuntu.com>
authordoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 5 Jun 2010 15:07:32 +0000 (15:07 +0000)
committerdoko <doko@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 5 Jun 2010 15:07:32 +0000 (15:07 +0000)
        * gcc.c (cc1_options, cpp_unique_options): Use find-plugindir spec
        function to add the -iplugindir option.
        (find_plugindir_spec_function): Add new declaration and function.
        (static_spec_func): Use it for "find-plugindir".

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160319 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/gcc.c

index 6164ce7..1f1c24a 100644 (file)
@@ -1,3 +1,10 @@
+2010-06-05  Matthias Klose  <doko@ubuntu.com>
+
+       * gcc.c (cc1_options, cpp_unique_options): Use find-plugindir spec
+       function to add the -iplugindir option.
+       (find_plugindir_spec_function): Add new declaration and function.
+       (static_spec_func): Use it for "find-plugindir".
+
 2010-06-05  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/44361
index 75409af..03cfedc 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -399,6 +399,7 @@ 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 *find_file_spec_function (int, const char **);
+static const char *find_plugindir_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 **);
@@ -862,7 +863,7 @@ static const char *cpp_unique_options =
  %{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
  %{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
  %{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
- %{!iplugindir*:%{fplugin*:-iplugindir=%:find-file(plugin)}}\
+ %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
  %{H} %C %{D*&U*&A*} %{i*} %Z %i\
  %{fmudflap:-D_MUDFLAP -include mf-runtime.h}\
  %{fmudflapth:-D_MUDFLAP -D_MUDFLAPTH -include mf-runtime.h}\
@@ -885,7 +886,7 @@ static const char *cpp_debug_options = "%{d*}";
 /* NB: This is shared amongst all front-ends, except for Ada.  */
 static const char *cc1_options =
 "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %{!iplugindir*:%{fplugin*:-iplugindir=%:find-file(plugin)}}\
+ %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\
  %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\
  %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \
  %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \
@@ -1719,6 +1720,7 @@ static const struct spec_function static_spec_functions[] =
   { "version-compare",         version_compare_spec_function },
   { "include",                 include_spec_function },
   { "find-file",               find_file_spec_function },
+  { "find-plugindir",          find_plugindir_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 },
@@ -8657,11 +8659,11 @@ include_spec_function (int argc, const char **argv)
   return NULL;
 }
 
-/* %:find-file spec function.  This function replace its argument by
+/* %:find-file spec function.  This function replaces its argument by
     the file found thru find_file, that is the -print-file-name gcc
     program option. */
 static const char *
-find_file_spec_function (int argc, const char**argv)
+find_file_spec_function (int argc, const char **argv)
 {
   const char *file;
 
@@ -8673,6 +8675,22 @@ find_file_spec_function (int argc, const char**argv)
 }
 
 
+/* %:find-plugindir spec function.  This function replaces its argument
+    by the -iplugindir=<dir> option.  `dir' is found thru find_file, that
+    is the -print-file-name gcc program option. */
+static const char *
+find_plugindir_spec_function (int argc, const char **argv ATTRIBUTE_UNUSED)
+{
+  const char *option;
+
+  if (argc != 0)
+    abort ();
+
+  option = concat ("-iplugindir=", find_file ("plugin"), NULL);
+  return option;
+}
+
+
 /* %:print-asm-header spec function.  Print a banner to say that the
    following output is from the assembler.  */