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?
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.
My understanding, despite not being a lawyer, is that you can license your code under any set of licenses you want, as long as you also license it to be compatible with components that you use.
If your code does not depend on the GPL code, you don't need to license under GPL as long as you're not distributing it with GPL code. IPython, for instance, was using readline initially but they removed that from the explicit/required dependencies and only use it if it's present so that they could comply with the GPL but license their software under whatever license they chose. (Sorry, I can't find a reference.)
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 (e.g. 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.
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.
Yes, you can use a GPL library; and not use the GPL license as long as you "dynamically link" to it. otherwise the Linux kernel wouldn't have very many drivers if any.
This means you have to have a separate executable (and/or documentation on the fact you used the software); that loads at run-time instead of compile time. This also means that you are one step closer to Dependency HELL!!!
There are several realms of Dependency HELL, here they are in no particular order:
- DLL Hell
- DSO Hell
- Jar Hell
- RPM Hell
- Extension Conflicts
- #define 1 0
each of which having multiple forms, culminating into the worst form:
Multiple Long Chains of Multiple Circular AND Conflicting Dependencies that writhe into your brain suck out your very soul!!!