Re: re: lebsack account request
| From: | Luke Kenneth Casson Leighton | Date: | Fri, 04 Feb 2005 21:59:57 +0000 |
| Subject: | Re: re: lebsack account request | ||
| References: | 1 2 3 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-1894@lists.php.net to get a copy of this message | ||
On Thu, Feb 03, 2005 at 11:47:36PM -0700, adam@ruffdogs.com wrote:
> Quoting Wez Furlong <kingwez@gmail.com>:
>
> >GPL will infect the code you write and thus make it GPL too.
> >Normally we say "no" to this kind of thing, but then we have this:
> >http://viewcvs.php.net/viewcvs.cgi/pecl/smbc/, which is the
> >"same" as
> >your effort.
>
> OK, so by "infecting", do you mean the use of libsmbclient symbol names in
> my
> smbclient.c file? Does that make this a derivative work and not
> something that
> merely uses the functionality of the GPL'd work?
okay.
if you are linking with an smb library and that library is GPL,
your entire project MUST be made GPL.
to get round this, what you can do is "dlopen" the library from your
OWN program.
you must write "wrapper" functions around all of the functions
in the library that you intend to use, and these functions
you must add to the library.
they can of course have the same arguments - you must just _not_ call
the GPL code directly.
you must then release the header file containing your "wrapper"
function under TWO - not one - TWO licenses.
1) your license
2) the GPL license.
you then "dlopen" the library, and as long as you only call _your_
functions, you're okay.
it would be _better_ if you did this:
/* a table with functions you intend to use. the definition of this
table (its header file) is dual-licensed GPL and your license
*/
struct vtable
{
int (*hello_world)(int fred);
int (*goodbye_world)(int joe);
};
/* add this function to the GPL'd library */
struct vtable * get_vtable();
inside the library:
int your_wrapper_to_gpld_version_of_hello_world(int fred)
{
return call_gpl_hello_world_function(fred);
}
int your_wrapper_to_gpld_version_of_goodbye_world(int joe)
{
return call_gpl_goodbye_world_function(joe);
}
static struct vtable tb =
{
your_wrapper_to_gpld_version_of_hello_world,
your_wrapper_to_gpld_version_of_goodbye_world
};
struct vtable * get_vtable()
{
return tb;
}
to use it you must do:
hnd = dlopen("thegpllibrary.so");
function_table = dlsym(hnd, "get_vtable") ();
i know this looks painful but it means that there can be no complaints.
you are _not_ linking with GPL'd code.
you are DYNAMICALLY LOADING it.
if you were not the person who wrote the dynamic loading code, such
that you cannot dual-license the loading code, you CAN NOT get away
with this trick.
l.