aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorMatthias Klose <doko@gcc.gnu.org>2010-04-12 23:58:18 +0000
committerMatthias Klose <doko@gcc.gnu.org>2010-04-12 23:58:18 +0000
commit4adbd5dd3cf5801e622fcfff3149a27940d34089 (patch)
tree03b93cac03234238b2a22c3947bc8bcd44f3d7fb /gcc/doc
parente0db9cc648242cbbea38cc3c559663acb501aee8 (diff)
downloadgcc-4adbd5dd3cf5801e622fcfff3149a27940d34089.zip
gcc-4adbd5dd3cf5801e622fcfff3149a27940d34089.tar.gz
gcc-4adbd5dd3cf5801e622fcfff3149a27940d34089.tar.bz2
gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec.
gcc/ 2010-04-13 Matthias Klose <doko@ubuntu.com> * gcc.c (cc1_options): Handle -iplugindir before processing the cc1 spec. Only add -iplugindir once. (cpp_unique_options): Add -iplugindir option if -fplugin* options found. * common.opt (iplugindir): Remove `Separate' property, initialize. * plugin.c (default_plugin_dir_name): Error with missing -iplugindir option. * Makefile.in (check-%, check-parallel-%): Create plugin dir. (distclean): Remove plugin dir. 2010-04-13 Basile Starynkevitch <basile@starynkevitch.net> * doc/plugins.texi (Loading Plugins): Document short -fplugin=foo option. (Plugin API): Mention default_plugin_dir_name function. * gcc.c (find_file_spec_function): Add new declaration. (static_spec_func): Use it for "find-file". (find_file_spec_function): Add new function. (cc1_options): Add -iplugindir option if -fplugin* options found. * gcc-plugin.h (default_plugin_dir_name): Added new declaration. * plugin.c (add_new_plugin): Updated comment, and handle short plugin name. (default_plugin_dir_name): Added new function. * common.opt (iplugindir): New option to set the plugin directory. gcc/testsuite/ 2010-04-13 Matthias Klose <doko@ubuntu.com> * gcc.dg/plugindir1.c: New testcase. * gcc.dg/plugindir2.c: New testcase. * gcc.dg/plugindir3.c: New testcase. * gcc.dg/plugindir4.c: New testcase. From-SVN: r158247
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/invoke.texi11
-rw-r--r--gcc/doc/plugins.texi8
2 files changed, 17 insertions, 2 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ad7d097..1c52a3a 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -425,8 +425,9 @@ Objective-C and Objective-C++ Dialects}.
@item Directory Options
@xref{Directory Options,,Options for Directory Search}.
-@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir}
--specs=@var{file} -I- --sysroot=@var{dir}}
+@gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir}}
+-iquote@var{dir} -L@var{dir} -specs=@var{file} -I-
+--sysroot=@var{dir}
@item Machine Dependent Options
@xref{Submodel Options,,Hardware Models and Configurations}.
@@ -8892,6 +8893,12 @@ the ordering for the include_next directive are not inadvertently changed.
If you really need to change the search order for system directories,
use the @option{-nostdinc} and/or @option{-isystem} options.
+@item -iplugindir=@var{dir}
+Set the directory to search for plugins which are passed
+by @option{-fplugin=@var{name}} instead of
+@option{-fplugin=@var{path}/@var{name}.so}. This option is not meant
+to be used by the user, but only passed by the driver.
+
@item -iquote@var{dir}
@opindex iquote
Add the directory @var{dir} to the head of the list of directories to
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi
index a938e02..77000fe 100644
--- a/gcc/doc/plugins.texi
+++ b/gcc/doc/plugins.texi
@@ -22,6 +22,11 @@ The plugin arguments are parsed by GCC and passed to respective
plugins as key-value pairs. Multiple plugins can be invoked by
specifying multiple @option{-fplugin} arguments.
+A plugin can be simply given by its short name (no dots or
+slashes). When simply passing @option{-fplugin=NAME}, the plugin is
+loaded from the @file{plugin} directory, so @option{-fplugin=NAME} is
+the same as @option{-fplugin=`gcc -print-file-name=plugin`/NAME.so},
+using backquote shell syntax to query the @file{plugin} directory.
@section Plugin API
@@ -407,6 +412,9 @@ On most systems, you can query this @code{plugin} directory by
invoking @command{gcc -print-file-name=plugin} (replace if needed
@command{gcc} with the appropriate program path).
+Inside plugins, this @code{plugin} directory name can be queried by
+calling @code{default_plugin_dir_name ()}.
+
The following GNU Makefile excerpt shows how to build a simple plugin:
@smallexample