I plan to share the source code of a larger software that depends on external libraries. The directory structure of the project is as follows

    ... my source code
    ... external source code

The external libraries only have few modifications and contain the original license headers. The external libraries have BSD, GPL, LGPL licenses.

The entire source code will be shared and additionally provided as pre-compiled binaries for download.


Can I put my code in src/ under a different license than the external packages in ext/? Specifically, I would like to restrict usage to research/academia and prohibit commercial use.

  • 3
    Well that depends how they're linked - you really haven't given us enough information to answer. And restricting use to academia makes it not free software or open source, which would make it incompatible with the GPL. Commented Nov 24, 2015 at 12:50
  • Thanks for your feedback. I have different options to link the libraries: static or dynamic linking. It sure will be open source, but I would only like to make it free for research purposes. Please, let me know if there is any other information you need. Commented Nov 24, 2015 at 19:03
  • 2
    Please check the Open Source and Free Software definitions - you cannot restrict to any kind of use at all. Commented Nov 25, 2015 at 0:09
  • It seems you are right and I had a misunderstanding of what the common meaning of "Open Source" is, even though the literal meaning suggests otherwise. What I really mean is rather something like "shared source" with the restriction to non-commercial use. The original question stands as it is. Commented Nov 25, 2015 at 4:47

1 Answer 1


It seems you are really asking: "Can I restrict users' rights to my larger work (such as commercial use) if it is dependent on BSD, GPL and LGPL open-source libraries?"

The answer is: if your work is dependent on at least one library under GPL, then I can already tell you that you can't because your larger work is a derivative of the GPL software and, as a derivative, it'll have to be licensed under a compatible license which means you can't restrict the freedom of use.

Please refer to the following answer for a great explanation of what a derivative is and why it doesn't matter whether you put your own source code in src/ or in ext/: When is my project a derivative work in an interpreted language?

However, if you can argue that your software isn't dependent on the GPL code and you don't distribute it along with your code, then you could create a custom license (open-source is clearly not suitable for your purpose), such as an EULA, for this purpose. This tool may help you get started: http://www.binpress.com/license/generator.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.