From fca5bb5ca8ce5e4b01d524cca7ae2455577ceda0 Mon Sep 17 00:00:00 2001 From: Diego Novillo Date: Thu, 18 Jun 2009 15:48:35 -0400 Subject: 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 --- gcc/doc/plugins.texi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'gcc/doc') 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 is not licensed under a GPL-compatible license +: 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 -- cgit v1.1