diff options
author | Basile Starynkevitch <basile@starynkevitch.net> | 2011-07-06 16:37:09 +0000 |
---|---|---|
committer | Basile Starynkevitch <bstarynk@gcc.gnu.org> | 2011-07-06 16:37:09 +0000 |
commit | bf5884559be4e9bfd8216516d540414dfede1d26 (patch) | |
tree | 38ed9939c26dba6d87fde9593de9440bc6b331cc /gcc/doc/plugins.texi | |
parent | c8ecdaba8771fa7acbff71d1a857dd5fee898601 (diff) | |
download | gcc-bf5884559be4e9bfd8216516d540414dfede1d26.tar.gz |
configure.ac (plugin-version.h): Generate GCCPLUGIN_VERSION_MAJOR...
2011-07-06 Basile Starynkevitch <basile@starynkevitch.net>
* configure.ac (plugin-version.h): Generate
GCCPLUGIN_VERSION_MAJOR, GCCPLUGIN_VERSION_MINOR,
GCCPLUGIN_VERSION_PATCHLEVEL, GCCPLUGIN_VERSION constant integer
macros.
* configure: Regenerate.
* doc/plugins.texi (Building GCC plugins): Mention
GCCPLUGIN_VERSION ... constant macros in plugin-version.h.
From-SVN: r175923
Diffstat (limited to 'gcc/doc/plugins.texi')
-rw-r--r-- | gcc/doc/plugins.texi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 2ab2b62021d..1ff14474ccc 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -417,6 +417,17 @@ invoking @command{gcc -print-file-name=plugin} (replace if needed Inside plugins, this @code{plugin} directory name can be queried by calling @code{default_plugin_dir_name ()}. +Plugins may know, when they are compiled, the GCC version for which +@file{plugin-version.h} is provided. The constant macros +@code{GCCPLUGIN_VERSION_MAJOR}, @code{GCCPLUGIN_VERSION_MINOR}, +@code{GCCPLUGIN_VERSION_PATCHLEVEL}, @code{GCCPLUGIN_VERSION} are +integer numbers, so a plugin could ensure it is built for GCC 4.7 with +@smallexample +#if GCCPLUGIN_VERSION != 4007 +#error this GCC plugin is for GCC 4.7 +#endif +@end smallexample + The following GNU Makefile excerpt shows how to build a simple plugin: @smallexample |