Licensing software that uses GPL code with licenses other than GPL

Let's say I write some code, which we'll call X. It uses some GPL code, let's call it library Y. Clearly I would have to release X with a GPL license. That's fine. My question is, can I additionally release X under a license such as MIT, so that if someone only wants X but not Y they don't need to use it with the GPL?


YES, you can release your source code under any license you wish. You have that right under US copyright law.

However, if you incorporate any GPL source code within your source code (or distribute with any GPL code), you must use the GPL license for the entire work. That's because you have to agree to their license to use their code.

BTW. I'm not an attorney.


MIT license is also GPL-compatible, meaning that the GPL permits combination and redistribution with software that uses the MIT License. This link should provide you with a comprehensive analysis. There are lots of ifs and buts and definitions around libraries vs plugins vs modules etc that you should familiarize with.


The key question here is: can your software X be distributed if you license X only under the MIT license (or some other rather relaxed Open Source license)?

The answer to that question is:

  • no if the dependency of X on the GPL-licensed library Y is mandatory and cannot be avoided to build/use X.
  • yes if the dependency of X on the GPL-licensed library is optional Y, and if it is disabled by default.
  • If the dependency on Y cannot be avoided, then releasing X under MIT would essentially prevent anybody (eg Linux distributions, or commercial vendors, or web-sites providing pre-built software) from distributing your software with the GPL-licensed library enabled in the build.

    So while you can decide to license your own software under the MIT license, by releasing it under this license you would create headaches for all your users.

    And my guess it that it is not what you are looking for.

    My recommendation is that you make up your mind and decide between either:

  • Release X under the GPL if this GPL-licenced library Y is essential to your software. (the simplest, do-the-right-thing option)
  • Release X under dual GPL/MIT license if the GPL-licensed library Y is optional, and if you really need to have a version of software available under an MIT license, but want to allow distribution (by you or others) of X with Y support enabled. (only if it is really required)
  • Release X under MIT if the GPL-licensed library Y is optional, but be aware that nobody will be able to distribute your software in any way with the Y support enabled. (creates potential headaches for users, for a really unclear benefit)
  • I hope this helps.

    链接地址: http://www.djcxy.com/p/79512.html

    上一篇: 帮助我选择正确的开源许可证

    下一篇: 使用非GPL许可证的GPL代码的许可软件