glib-genmarshal/glib-mkenums: Add comment clarifying licensing

Clarify the licensing of the code generated by the two scripts in a
comment in the header of each generated file. The intention is that the
license of GLib does *not* apply to the generated files; but that they
are subject to the linking restrictions of the LGPL, since they link to
GLib and GLib is licensed under the LGPL. The generated files themselves
are under the license of whatever project they’re generated for.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=788990
This commit is contained in:
Philip Withnall 2017-10-19 10:16:51 +01:00
parent b829b762fd
commit 9a319a126e
2 changed files with 17 additions and 2 deletions

View File

@ -162,9 +162,17 @@ def print_info(msg):
print_color(msg, color=Color.GREEN, prefix='INFO')
def generate_licensing_comment(outfile):
outfile.write('/* This file is generated by glib-genmarshal, do not '
'modify it. This code is licensed under the same license as '
'the containing project. Note that it links to GLib, so '
'must comply with the LGPL linking clauses. */\n')
def generate_header_preamble(outfile, prefix='', std_includes=True, use_pragma=False):
'''Generate the preamble for the marshallers header file'''
outfile.write('/* This file is generated, all changes will be lost */\n')
generate_licensing_comment(outfile)
if use_pragma:
outfile.write('#pragma once\n')
outfile.write('\n')
@ -193,6 +201,8 @@ def generate_header_postamble(outfile, prefix='', use_pragma=False):
def generate_body_preamble(outfile, std_includes=True, include_headers=None, cpp_defines=None, cpp_undefines=None):
'''Generate the preamble for the marshallers source file'''
generate_licensing_comment(outfile)
for header in (include_headers or []):
outfile.write('#include "{}"\n'.format(header))
if include_headers:

View File

@ -381,7 +381,12 @@ else:
tmpfile = None
# put auto-generation comment
comment = comment_tmpl.replace('\u0040comment\u0040', 'Generated data (by glib-mkenums)')
comment = comment_tmpl.replace('\u0040comment\u0040',
'This file is generated by glib-mkenums, do '
'not modify it. This code is licensed under '
'the same license as the containing project. '
'Note that it links to GLib, so must comply '
'with the LGPL linking clauses.')
write_output("\n" + comment + '\n')
def replace_specials(prod):