I'm creating a standard library for a programming language, and I'd like to license each and every single class or function in there under the MIT license, so they're completely FOSS.

All of the files reside in a single directory. Would it be enough to put a LICENSE.txt file in the same directory, containing the MIT license? Do I need to say that the following license applies to all features of the library, or is the library itself considered to be a program?


The general practice is to place the license text in a clearly identifiable location, like you suggest, and to include comments near the top of each source file that tell the reader to look there. And don't forget to make the license obvious to someone who doesn't download the source code, just a binary.

As to what comprises a "program", you get to ignore that. In a binary distribution, there's no question - you download one .dll/.so/whatever file and a license file. In a source distribution, the license or a reference to it is present in every file.

  • "...you get to ignore that." - you mean define that, right? – jcora Dec 21 '12 at 12:19
  • Nope, I meant "ignore". You've got two distribution possibilities: the library binary or its source. As I said, either way they get the license file, and in source form they get told to look at it. So who cares what a "program" is then? – Ross Patterson Dec 21 '12 at 16:44

Well, at one level the answer depends on the law of the legal jurisdiction you release your software in. So you might want to check that.

But more generally, adding a full copy of the text of the licence in the root directory of your distribution and then placing a one line comment in each source file is likely to convey your intentions very clearly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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