I'm writing a library and a tool on top of it, and I would like to release both under MPL-2. However, the library has an optional dependency, another library which is released under GPL (not LGPL).I understand that the result of this combination will be under GPL, but I want to allow using my library and tool under conditions of MPL-2 if GPL-ed dependency is disabled.What license should I apply to my source code and what headers should I add to my files?Is it enough to release library and tool only under MPL-2?Or should I additionally release under GPL every file?Or should I additionally release under GPL only files that call functions from GPL-ed dependency?Or should I additionally release under GPL my tool?I would prefer single license (MPL-2) for all code, to keep things simple.I've found this: Combining MPL-Licensed files with an (L)GPL-Licensed Project, and this:You have a GPL'ed program that I'd like to link with my code to build a proprietary program. Does the fact that I link with your program mean I have to GPL my program? (#LinkingWithGPL)Not exactly. It means you must release your program under a license compatible with the GPL (more precisely, compatible with one or more GPL versions accepted by all the rest of the code in the combination that you link). The combination itself is then available under those GPL versions.I don't understand when the result of combination appears and when to apply GPL to MPL-ed work:when I distribute source code that may use GPL-ed dependency?when I distribute binaries with enabled GPL-ed dependency?when someone builds my library and tool with GPL-ed dependency enabled?when someone uses my library and tool with GPL-ed dependency enabled?
Using GPL-ed library from code with more permissive license (MPL-2)
gpl;license compatibility;derivative works;multi licensing;mpl