+2013-05-14 Paul Smith <psmith@gnu.org>
+
+ * doc/make.texi (Loaded Object API): Document the requirement for
+ the plugin_is_GPL_compatible symbol.
+ * load.c (load_object): Check for plugin_is_GPL_compatible symbol.
+
2013-05-13 Paul Smith <psmith@gnu.org>
* filedef.h (struct file): Add a builtin flag.
routines to perform their tasks, then optionally return a string as
the result of the function expansion.
+@subsubheading Loaded Object Licensing
+@cindex loaded object licensing
+@cindex plugin_is_GPL_compatible
+
+Every dynamic extension 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,
+@code{make} emits a fatal error and exits when it tries to load your
+extension.
+
+The declared type of the symbol should be @code{int}. It does not need
+to be in any allocated section, though. The code merely asserts that
+the symbol exists in the global scope. Something like this is enough:
+
+@example
+int plugin_is_GPL_compatible;
+@end example
+
@subsubheading Data Structures
@table @code
#include <gnumake.h>
+int plugin_is_GPL_compatible;
+
char *
gen_tmpfile(const char *nm, int argc, char **argv)
@{
return NULL;
}
+ /* Assert that the GPL license symbol is defined. */
+ symp = dlsym (*dlp, "plugin_is_GPL_compatible");
+ if (! symp)
+ fatal (flocp, _("Loaded object %s is not declared to be GPL compatible"),
+ ldname);
+
symp = dlsym (*dlp, symname);
if (! symp)
fatal (flocp, _("Failed to load symbol %s from %s: %s"),
+2013-05-14 Paul Smith <psmith@gnu.org>
+
+ * scripts/features/loadapi: Add plugin_is_GPL_compatible symbol.
+ * scripts/features/load: Ditto.
+
2013-05-13 Paul Smith <psmith@gnu.org>
* scripts/features/output-sync (output_sync_set): Update for new
#include "gnumake.h"
+int plugin_is_GPL_compatible;
+
int
testload_gmk_setup (gmk_floc *pos)
{
#include "gnumake.h"
+int plugin_is_GPL_compatible;
+
static char *
test_eval (const char *buf)
{