I want to create a dynamically loadable module (.dll or .so) for a closed source program, but I would like to make the source code of this module available, and I'd like it to be (A)GPL licensed, so others could use my module, but I also want to make sure their code would also be open sourced. My questions are:Since the whole project would be one executable at the end would the closed source program count as derivative work, thereby it would need to be GPL as well?If yes, can I add some kind of additional permission to the GPL licence of my code to explicitly allow this linkage to occur, so it could actually be distributed with the app?If yes, where and how should I put these additional permissions in the licence file?Would this modified licence still be GPL (compatible)? What kind of open source code could I use within my module?If the resulting licence would not be GPL compatible are there any other licences that are better sutied for this situation, but are still similar in essence to GPL (e.g. reusing the code is only possible in case it's source is also released)?
GPL licenced code for a module of a closed source program
licensing;gpl
Since the whole project would be one executable at the end would the closed source program count as derivative work, thereby it would need to be GPL as well?The basic understanding of the GPL and it's intention saying: yes, the program must be GPL too, as through the linking you create a derivative work. That is the position of the FSF. But it is not shared by everyone. Some interpretations say, only static linking make it a derived work, not dynamic linking (which it would be, you saying it is a DLL). There are even angles, that differ even more. Lawrence Rosen (from the OSI) says:The primary indication of whether a new program is a derivative work  is whether the source code of the original program was used [in a  copy-paste sense], modified, translated or otherwise changed in any  way to create the new program. If not, then I would argue that it is  not a derivative workSo, there are different interpretations. As far as I know this dispute wasn't put to test in the courts yet. The GPL was enforced multiple times in courts, but as far as I know it was always about violations in using the GPL-program, not because of linking.If yes, can I add some kind of additional permission to the GPL licence of my code to explicitly allow this linkage to occur, so it could actually be distributed with the app?Yes. Many projects use a linking exception to the GPL.If yes, where and how should I put these additional permissions in the licence file?I found no clear guidance of this, but in my understanding it must be clear that an exception is applied and which part is the original GPL. So I would have the copyright statement saying it is GPL with your exception and put both in the license file, but with clear distinction (new header or so).Would this modified licence still be GPL (compatible)? What kind of open source code could I use within my module?As far as I understand, the code of your module can be used in other GPL-projects, but different GPL-code cannot be used in your module without the author consenting to your exception. Other than that, more permissive licenses still should work, as long as they are conforming with the terms of the GPL and your exception.If the resulting licence would not be GPL compatible are there any other licences that are better sutied for this situation, but are still similar in essence to GPL (e.g. reusing the code is only possible in case it's source is also released)?The LGPL doesn't count linking as creating a derived work, but still applies copyleft to the code of your module. That would imply your module can be linked to different programs without making them Open Source, but modifying your module still demands making that changes LGPL.