diff options
author | Diego Novillo <dnovillo@google.com> | 2009-06-18 15:48:35 -0400 |
---|---|---|
committer | Diego Novillo <dnovillo@gcc.gnu.org> | 2009-06-18 15:48:35 -0400 |
commit | fca5bb5ca8ce5e4b01d524cca7ae2455577ceda0 (patch) | |
tree | 79b33d246f25f2bed1420ec88101b2b444ad38fd /gcc/doc/plugins.texi | |
parent | 3600f67820b56b1083b1b5719e2be55b5bc8b775 (diff) | |
download | gcc-fca5bb5ca8ce5e4b01d524cca7ae2455577ceda0.zip gcc-fca5bb5ca8ce5e4b01d524cca7ae2455577ceda0.tar.gz gcc-fca5bb5ca8ce5e4b01d524cca7ae2455577ceda0.tar.bz2 |
plugins.texi: Document plugin_is_GPL_compatible.
* doc/plugins.texi: Document plugin_is_GPL_compatible.
* plugin.c (str_license): Declare.
(try_init_one_plugin): Assert that the symbol
'plugin_is_GPL_compatible' exists.
testsuite/ChangeLog
* gcc.dg/plugin/selfassign.c: Declare plugin_is_GPL_compatible.
* gcc.dg/plugin/ggcplug.c: Likewise.
* gcc.dg/plugin/one_time_plugin.c: Likewise.
* g++.dg/plugin/selfassign.c: Likewise.
* g++.dg/plugin/attribute_plugin.c: Likewise.
* g++.dg/plugin/dumb_plugin.c: Likewise.
From-SVN: r148667
Diffstat (limited to 'gcc/doc/plugins.texi')
-rw-r--r-- | gcc/doc/plugins.texi | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/doc/plugins.texi b/gcc/doc/plugins.texi index 9ae0a18..791e04b 100644 --- a/gcc/doc/plugins.texi +++ b/gcc/doc/plugins.texi @@ -32,6 +32,26 @@ address of the callback function that will handle that event. The header @file{gcc-plugin.h} must be the first gcc header to be included. +@subsection Plugin license check + +Every plugin should define the global symbol @code{plugin_is_GPL_compatible} +to assert that it has been licensed under a GPL-compatible license. +If this symbol does not exist, the compiler will emit a fatal error +and exit with the error message: + +@smallexample +fatal error: plugin <name> is not licensed under a GPL-compatible license +<name>: undefined symbol: plugin_is_GPL_compatible +compilation terminated +@end smallexample + +The type of the symbol is irrelevant. The compiler merely asserts that +it exists in the global scope. Something like this is enough: + +@smallexample +int plugin_is_GPL_compatible; +@end smallexample + @subsection Plugin initialization Every plugin should export a function called @code{plugin_init} that |