注册 登录  
 加关注
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

勇敢的劳尤条

 
 
 

日志

 
 

在基于GPL发布的软件中,可以调用闭源库吗(使用GPL开源库,如何闭源?)  

2014-01-20 11:53:47|  分类: 开源的困惑与诱惑 |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |

问题来源于:使用GPL开源库,如何闭源?

下面是具体描述。

基于GPL的开源库做了软件,想做C/S通信系统,想保护通信协议,所以不能完全开源。所以问题:
我的项目中,用到了开源库ABCD等,以及自己的协议库 M ,基本架构如下
-------------------------------               
               app
-------------------------------
 A |  B  |  C  |  D |    M
---  ----   ----   ---   -------

如果A的开源许可证是GPLB的许可证是LGPLC的是类BSDD是某闭源库,购买而来的,而M是自己的协议库。
为了让app工作,必须同时有这些库的支持,我的app都只跟下层的库进行通信交互,而库与库之间是完全独立的,没有任何交互,请问这样的软件能发布吗?ABCDM这些库能协同工作吗?还是怎么样?

本人也看过查找过不少关于开源许可证方面的资料,但是对于这里还有一丝困惑?
因为我的app才是依赖A,所以app必须遵循GPL开源我能理解,那么DM呢,他们是被  ”遵循GPL的软件“  调用,是被依赖方,所以主要困境在这里。

 

简单的说:在基于GPL发布的软件中,可以调用闭源库吗?


为解决此问题,看了开源软件以及许可证的区别等,在前面的几篇博客里面。但是还是没能彻底搞懂,现在到了GNU的FAQ这里,下面的英文皆来自FAQ原文。
【重点】(1)(2)(3)(4)(5)(11)(12)(13)
(1)两个许可证相互兼容,到底是什么意思呢?两个程序都要有合并许可,要满足两种许可证。
What does it mean to say that two licenses are “compatible”? (#WhatIsCompatible)

In order to combine two programs (or substantial parts of them) into a larger work, you need to have permission to use both programs in this way. If the two programs' licenses permit this, they are compatible. If there is no way to satisfy both licenses at once, they are incompatible.

For some licenses, the way in which the combination is made may affect whether they are compatible—for instance, they may allow linking two modules together, but not allow merging their code into one module.

If you just want to install two separate programs in the same system, it is not necessary that their licenses be compatible, because this does not combine them into a larger work.


(2)跟GPL兼容是什么意思呢?(你可以将不同许可证的两份代码合并成一个更大的程序)
What does it mean to say a license is “compatible with the GPL?” (#WhatDoesCompatMean)

It means that the other license and the GNU GPL are compatible; you can combine code released under the other license with code released under the GNU GPL in one larger program.

All GNU GPL versions permit such combinations privately; they also permit distribution of such combinations provided the combination is released under the same GNU GPL version. The other license is compatible with the GPL if it permits this too.

GPLv3 is compatible with more licenses than GPLv2: it allows you to make combinations with code that has specific kinds of additional requirements that are not in GPLv3 itself. Section 7 has more information about this, including the list of additional requirements that are permitted.


(3)自由软件可以使用非自由的库吗?是可以的,但是在自由的环境中,你的程序将不能充分利用起来。而且,这完全在自由世界的界限之外。
Can I write free software that uses non-free libraries? (#FSWithNFLibs)

If you do this, your program won't be fully usable in a free environment. If your program depends on a non-free library to do a certain job, it cannot do that job in the Free World. If it depends on a non-free library to run at all, it cannot be part of a free operating system such as GNU; it is entirely off limits to the Free World.

So please consider: can you find a way to get the job done without using this library? Can you write a free replacement for that library?

If the program is already written using the non-free library, perhaps it is too late to change the decision. You may as well release the program as it stands, rather than not release it. But please mention in the README that the need for the non-free library is a drawback, and suggest the task of changing the program so that it does the same job without the non-free library. Please suggest that anyone who thinks of doing substantial further work on the program first free it from dependence on the non-free library.

Note that there may also be legal issues with combining certain non-free libraries with GPL-covered free software. Please see the question on GPL software with GPL-incompatible libraries for more information.


(4)我可以把GPL程序链接到一个专有的系统库吗?如果与GPL不兼容的库,满足系统库的标准,那么比不需要做任何其他的事。要求是:发布整个程序源码的时候,不要包括这些库。
Can I link a GPL program with a proprietary system library? (#SystemLibraryException)

Both versions of the GPL have an exception to their copyleft, commonly called the system library exception. If the GPL-incompatible libraries you want to use meet the criteria for a system library, then you don't have to do anything special to use them; the requirement to distribute source code for the whole program does not include those libraries, even if you distribute a linked executable containing them.

The criteria for what counts as a "system library" vary between different versions of the GPL. GPLv3 explicitly defines "System Libraries" in section 1, to exclude it from the definition of "Corresponding Source." GPLv2 deals with this issue slightly differently, near the end of section 3.


(5)如果我在GPL软件中使用了GPL不兼容的库,那么会有什么法律问题呢?
What legal issues come up if I use GPL-incompatible libraries with GPL software? (#GPLIncompatibleLibs)

If you want your program to link against a library not covered by the system library exception, you need to provide permission to do that. Below are two example license notices that you can use to do that; one for GPLv3, and the other for GPLv2. In either case, you should put this text in each file to which you are granting this permission.

Only the copyright holders for the program can legally release their software under these terms. If you wrote the whole program yourself, then assuming your employer or school does not claim the copyright, you are the copyright holder—so you can authorize the exception. But if you want to use parts of other GPL-covered programs by other authors in your code, you cannot authorize the exception for them. You have to get the approval of the copyright holders of those programs.

When other people modify the program, they do not have to make the same exception for their code—it is their choice whether to do so.

If the libraries you intend to link with are non-free, please also see the section on writing Free Software which uses non-free libraries.

If you're using GPLv3, you can accomplish this goal by granting an additional permission under section 7. The following license notice will do that. You must replace all the text in brackets with text that is appropriate for your program. If not everybody can distribute source for the libraries you intend to link with, you should remove the text in braces; otherwise, just remove the braces themselves.

Copyright (C) [years] [name of copyright holder]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses>.

Additional permission under GNU GPL version 3 section 7

If you modify this Program, or any covered work, by linking or combining it with [name of library] (or a modified version of that library), containing parts covered by the terms of [name of library's license], the licensors of this Program grant you additional permission to convey the resulting work. {Corresponding Source for a non-source form of such a combination shall include the source code for the parts of [name of library] used as well as that of the covered work.}

If you're using GPLv2, you can provide your own exception to the license's terms. The following license notice will do that. Again, you must replace all the text in brackets with text that is appropriate for your program. If not everybody can distribute source for the libraries you intend to link with, you should remove the text in braces; otherwise, just remove the braces themselves.

Copyright (C) [years] [name of copyright holder]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses>.

Linking [name of your program] statically or dynamically with other modules is making a combined work based on [name of your program]. Thus, the terms and conditions of the GNU General Public License cover the whole combination.

In addition, as a special exception, the copyright holders of [name of your program] give you permission to combine [name of your program] with free software programs or libraries that are released under the GNU LGPL and with code included in the standard release of [name of library] under the [name of library's license] (or modified versions of such code, with unchanged license). You may copy and distribute such a system following the terms of the GNU GPL for [name of your program] and the licenses of the other code concerned{, provided that you include the source code of that other code when and as the GNU GPL requires distribution of source code}.

Note that people who make modified versions of [name of your program] are not obligated to grant this special exception for their modified versions; it is their choice whether to do so. The GNU General Public License gives permission to release a modified version without this exception; this exception also makes it possible to release a modified version which carries forward this exception.


(6)版权所有者,可以平行地在多 许可证下发布自己的程序。
常见的做法是双许可证,一个GPL许可证进行公开并保护,另一个作为商业许可证。
I heard that someone got a copy of a GPL'ed program under another license. Is this possible? (#HeardOtherLicense)

The GNU GPL does not give users permission to attach other licenses to the program. But the copyright holder for a program can release it under several different licenses in parallel. One of them may be the GNU GPL.

The license that comes in your copy, assuming it was put in by the copyright holder and that you got the copy legitimately, is the license that applies to your copy.


(7)我想将我的程序发布为GPL许可,但是,同时我想在非自由软件中使用这些代码。如果你是版权所有者,你可以在不同的时间,以不同的许可证进行发布。(发布非自由软件不道德?)
I would like to release a program I wrote under the GNU GPL, but I would like to use the same code in non-free programs. (#ReleaseUnderGPLAndNF)

To release a non-free program is always ethically tainted, but legally there is no obstacle to your doing this. If you are the copyright holder for the code, you can release it under various different non-exclusive licenses at various times.


(8)将程序以GPL发布的开发者,以后可以许可另一方”独家使用“吗?不行,因为公众在GPL下已经有使用程序的权利了,而这个权利无法撤回。
Can the developer of a program who distributed it under the GPL later license it to another party for exclusive use? (#CanDeveloperThirdParty)

No, because the public already has the right to use the program under the GPL, and this right cannot be withdrawn.


(9)我可以使用基于GPL发布的编辑器和编译器等工具吗?答案当然是可以的。因为工具编辑器的版权不会覆盖你写的代码,简单的说,自己写的程序,与GPL工具是完全隔离的。
有些程序会复制代码的一部分到输出,比如Bison,拷贝一个标准解析程序到它的输出文件。这些输出的代码要遵循源程序代码的许可证,也就是输出的代码,继承了输入的许可证状态。
Bison也可以用于开发非自由程序。这是因为我们决定,允许在Bison输出文件中,没有限制显式地使用Bison标准解析程序。我们做这个决定,是因为其他和Bison可比的工具,已经允许在非自由程序中使用了。
Can I use GPL-covered editors such as GNU Emacs to develop non-free programs? Can I use GPL-covered tools such as GCC to compile them? (#CanIUseGPLToolsForNF)

Yes, because the copyright on the editors and tools does not cover the code you write. Using them does not place any restrictions, legally, on the license you use for your code.

Some programs copy parts of themselves into the output for technical reasons—for example, Bison copies a standard parser program into its output file. In such cases, the copied text in the output is covered by the same license that covers it in the source code. Meanwhile, the part of the output which is derived from the program's input inherits the copyright status of the input.

As it happens, Bison can also be used to develop non-free programs. This is because we decided to explicitly permit the use of the Bison standard parser program in Bison output files without restriction. We made the decision because there were other tools comparable to Bison which already permitted use for non-free programs.


(10)GPL对静态和动态链接模块,有不同要求吗?没有!静态或者动态链接GPL模块,都成为基于GPL的联合作品。GPL的条款都会加到整个联合作品上面。
Does the GPL have different requirements for statically vs dynamically linked modules with a covered work? (#GPLStaticVsDynamic)

No. Linking a GPL covered work statically or dynamically with other modules is making a combined work based on the GPL covered work. Thus, the terms and conditions of the GNU General Public License cover the whole combination. See also What legal issues come up if I use GPL-incompatible libraries with GPL software?


(11)LGPL对静态和动态链接模块,有不同要求吗?
Does the LGPL have different requirements for statically vs dynamically linked modules with a covered work? (#LGPLStaticVsDynamic)

For the purpose of complying with the LGPL (any extant version: v2, v2.1 or v3):

(1) If you statically link against an LGPL'd library, you must also provide your application in an object (not necessarily source) format, so that a user has the opportunity to modify the library and relink the application.

(2) If you dynamically link against an LGPL'd library already present on the user's computer, you need not convey the library's source. On the other hand, if you yourself convey the executable LGPL'd library along with your application, whether linked with statically or dynamically, you must also convey the library's sources, in one of the ways for which the LGPL provides.


(12)如果我增加一个模块到GPL程序中,我一定要将GPL作为我的模块的许可证吗?我的模块,必须在GPL下可用。可以使用一个更加宽松的许可证,跟GPL兼容。
If I add a module to a GPL-covered program, do I have to use the GPL as the license for my module? (#GPLModuleLicense)

The GPL says that the whole combined program has to be released under the GPL. So your module has to be available for use under the GPL.

But you can give additional permission for the use of your code. You can, if you wish, release your program under a license which is more lax than the GPL but compatible with the GPL. The license list page gives a partial list of GPL-compatible licenses. 


(13)如果一个库是基于GPL发布的,那么是不是任何使用到该库的软件,都必须是GPL许可的,或者GPL兼容的许可证?答案是肯定的。
If a library is released under the GPL (not the LGPL), does that mean that any software which uses it has to be under the GPL or a GPL-compatible license? (#IfLibraryIsGPL)

Yes, because the software as it is actually run includes the library.


(14)如果一个程序语言的解释器是基于GPL的,那么用这种语言写的程序也要基于GPL兼容的许可吗?   如果解释器只是解释程序,那么答案是不用。因为对于解释器来说,程序只是数据。这与用gcc编译程序的道理是一样的。解释器不能限制我们用什么数据。
If a programming language interpreter is released under the GPL, does that mean programs written to be interpreted by it must be under GPL-compatible licenses? (#IfInterpreterIsGPL)

When the interpreter just interprets a language, the answer is no. The interpreted program, to the interpreter, is just data; a free software license like the GPL, based on copyright law, cannot limit what data you use the interpreter on. You can run it on any data (interpreted program), any way you like, and there are no requirements about licensing that data to anyone.

However, when the interpreter is extended to provide “bindings” to other facilities (often, but not necessarily, libraries), the interpreted program is effectively linked to the facilities it uses through these bindings. So if these facilities are released under the GPL, the interpreted program that uses them must be released in a GPL-compatible way. The JNI or Java Native Interface is an example of such a binding mechanism; libraries that are accessed in this way are linked dynamically with the Java programs that call them. These libraries are also linked with the interpreter. If the interpreter is linked statically with these libraries, or if it is designed to link dynamically with these specific libraries, then it too needs to be released in a GPL-compatible way.

Another similar and very common case is to provide libraries with the interpreter which are themselves interpreted. For instance, Perl comes with many Perl modules, and a Java implementation comes with many Java classes. These libraries and the programs that call them are always dynamically linked together.

A consequence is that if you choose to use GPL'd Perl modules or Java classes in your program, you must release the program in a GPL-compatible way, regardless of the license used in the Perl or Java interpreter that the combined Perl or Java program will run on. 


(15)我用VC或者VB编写程序,我要以GPL发布程序。如果我的程序  动态链接VC或者VB的运行时库,那我还能以GPL发布吗?运行时库是系统库,所以不用担心相关代码。    你不能发布dll格式的库,为了防止不法经销商将”系统库异常“作为一个漏洞,GPL说,库有资格成为系统库,只要他们不是随着程序本身一起发布。
I'm writing a Windows application with Microsoft Visual C++ (or Visual Basic) and I will be releasing it under the GPL. Is dynamically linking my program with the Visual C++ (or Visual Basic) runtime library permitted under the GPL? (#WindowsRuntimeAndGPL)

You may link your program to these libraries, and distribute the compiled program to others. When you do this, the runtime libraries are “System Libraries” as GPLv3 defines them. That means that you don't need to worry about including their source code with the program's Corresponding Source. GPLv2 provides a similar exception in section 3.

You may not distribute these libraries in compiled DLL form with the program. To prevent unscrupulous distributors from trying to use the System Library exception as a loophole, the GPL says that libraries can only qualify as System Libraries as long as they're not distributed with the program itself. If you distribute the DLLs with the program, they won't be eligible for this exception anymore; then the only way to comply with the GPL would be to provide their source code, which you are unable to do.

It is possible to write free programs that only run on Windows, but it is not a good idea. These programs would be “trapped” by Windows, and therefore contribute zero to the Free World.


(16)如果一个程序以GPL插件形式发布,那么插件需要什么许可证?
如果程序是以fork然后exev的形式使用插件,那么是以新建进程的形式使用,则不会感染GPL。
如果程序动态链接插件,那么就会感染GPL。
If a program released under the GPL uses plug-ins, what are the requirements for the licenses of a plug-in? (#GPLAndPlugins)

It depends on how the program invokes its plug-ins. If the program uses fork and exec to invoke plug-ins, then the plug-ins are separate programs, so the license for the main program makes no requirements for them.

If the program dynamically links plug-ins, and they make function calls to each other and share data structures, we believe they form a single program, which must be treated as an extension of both the main program and the plug-ins. This means the plug-ins must be released under the GPL or a GPL-compatible free software license, and that the terms of the GPL must be followed when those plug-ins are distributed.

If the program dynamically links plug-ins, but the communication between them is limited to invoking the ‘main’ function of the plug-in with some options and waiting for it to return, that is a borderline case.


参考资料:
http://www.gnu.org/licenses/license-list.html (GNU许可证兼容性列表)
  评论这张
 
阅读(1050)| 评论(0)
推荐 转载

历史上的今天

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2017