views:

81

answers:

1

I'm rewriting a small MIT-licensed program in C, and I intend to copy a segment from it (though not verbatim) that prints usage information and such things. The programs are going to behave, for the most part, the same, but the implementations are going to be much different.

What is the best way to incorporate this code into my program, whether it's licensed under Apache 2, GPLv2/3, or under the MIT license?

My guess is that for the first two listed I'd just add the original authors name to the NOTICE file along with relevant information and paste the license header as a comment above the derived code, and for the latter I'd just add the original author's copyright statement above my own.

A: 

If you are re-using MIT-licensed code, one easy thing you can do is to separate all your re-used code into its own module/library. The module can keep the existing MIT license, and your main source (whatever its license may be) can simply link against the MIT module since the MIT license allows linking without any "viral" licensing requirements.

If you are using either the MIT or Apache 2.0 license for you program, then you should also be able to place your re-used code in its own file (instead of building it as a separate library). You would then include that code's original license statement at the top of that file, and with your own license (whether included in your source files or in a separate file) you would include a note that says something like "This project includes code released under the MIT license, Copyright OriginalAuthor 2003". This practice was actually a requirement of the old version of the BSD license, but it was removed because it got unwieldy if you had a project that used a large number of individual projects with that license. If you are only basing your code on a few (or one) other projects, then this is not unreasonable and is an easy way to acknowledge clearly that some of your code is licensed differently.

bta