且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我可以在我的闭源应用程序中动态调用 LGPL/GPL 软件吗?

更新时间:2023-10-28 07:53:52

Linking 有一个特定的计算机编程中的意思.您根本没有链接 GPL 或 LGPL 的代码,您只是生成 GPL 或 LGPL 的二进制文件,并且 GPL 和 LGPL 允许这样做.您的用户可以根据作者的预期目的自行使用该二进制文件,并且可以自行下载和编译源代码,因此他们的所有***都将得到保留,并且您不会违反 GPL 或 LGPL.(这就是communicat[ing] 保持距离.")这甚至没有违反 LGPL 和 GPL 的精神;他们容忍专有软件的存在,并假设在某个时候专有程序会产生免费程序,反之亦然.(否则,我们无法在 Windows 下运行任何 GPL 软件.)

Linking has a specific meaning in computer programming. You're not linking GPL'ed or LGPL'ed code at all, you're only spawning a GPL'ed or LGPL'ed binary, and the GPL and LGPL permit this. Your users are free to use that binary themselves for its authors' intended purposes and are free to download and compile the source themselves, so all of their freedoms are preserved, and you're not in violation of the GPL or LGPL. (This is what the GPL FAQ is talking about by "communicat[ing] at arms length.") This doesn't even violate the spirit of the LGPL and GPL; they tolerate the existence of proprietary software and assume that at some point proprietary programs will spawn free programs and vice versa. (Otherwise, we couldn't run any GPL'ed software under Windows.)

GPL 确实要求专有程序和 GPL 程序不能以一种可以使它们有效地成为单个程序的方式组合在一起".如果您的程序完全依赖于 GPL 的可执行文件,即使它是一个独立的二进制文件,没有它们也无法使用,那么这可能会让您陷入困境.(而且可能是时候咨询您的律师以确认了.)

The GPL does require that proprietary and GPL'ed programs "are not combined in a way that would make them effectively a single program." If your program is completely dependent upon GPL'ed executables, such that it wouldn't be usable without them even though it is a standalone binary, then that might place you on shakier ground. (And it's probably time to consult your lawyer to find out for sure.)

此外,尽管您没有特别询问这一点,但请记住,将 GPL 或 LGPL 的软件与您的软件一起分发意味着您需要在安装程序中包含一份许可证副本,并且还需要分发源代码.例如,如果您在安装程序中打包应用程序并在安装程序中包含 GPL 或 LGPL 可执行文件的副本,那么您正在分发 LGPL 或 GPL 代码,并且必须提供源代码的副本(在线、邮寄或 CD,具体取决于您分发应用程序的方式).包含上游项目的链接是不够的(至少对于 GPL 的第 2 版).阅读 GPL 和 LGPL 以了解详细信息.

Also, although you didn't specifically ask about this, keep in mind that distributing GPL'ed or LGPL'ed software with your software means that you're required to include a copy of the license with your installer and to also distribute the source code. For example, if you package up your application in an installer and include copies of GPL'ed or LGPL'ed executables in the installer, then you're distributing LGPL'ed or GPL'ed code and must make copies of the source code available (either online, by mail-in offer, or by CD, depending on how you distribute your app). Including a link to the upstream project is not sufficient (at least for version 2 of the GPL). Read the GPL and LGPL for exact details.