Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I am currently adding some functionality to a popular open source project. It written in C and in Every file GPL license text is embedded. The functionality I am adding is not supported by the project. So you can say its some sort of extending.

My code gets compiled when the main project is compiled. My code is inside the main project and its integrated heavily.

Let me explain more thoroughly. Basically I know of two types of linking.

  1. My program uses mysql c api. so I link my c code with libmysqlclient. Here I am using libmysqlclient

  2. My code adds hash-table functionality on libmysqlclient so user can access fields by column name.

My project is of second type. Should it be GPL? What about the first scenario (I am curious)?

share|improve this question
    
My understanding is that the type of linking matters. Are you statically or dynamically linking to the GPL'd project? –  Thomas Owens Jul 19 '12 at 16:54
    
For case 1, its dynamic linking for sure. And for my project (case 2) I dont know. I compile the main project and my source gets compiled. May be its static linking. –  Shiplu Jul 19 '12 at 16:57
    
@ThomasOwens: For LGPL, yes; the rules on dynamic linking are more relaxed. For GPL, no; linking is linking. –  Mason Wheeler Jul 19 '12 at 17:02
    
@MasonWheeler Debatable, according to Wikipedia. I tried to parse some of the references, but I'm no where near familiar enough with the nuances of the law to do so. Although I would suspect someone who is more familiar with GNU and using the GLP would be. –  Thomas Owens Jul 19 '12 at 17:49
    
The GPL only applies of you re-distribute it. If it is for personal use then no problems. –  Loki Astari Jul 19 '12 at 18:46
show 1 more comment

2 Answers

In case (2), where you have actually added code to an existing GPL'ed project, the GPL is very clear that you are creating a derived work, which is subject to the GPL.

In the case of (1), there is some disagreement about whether or not linking to a GPL library obligates you to license your product under the GPL. Personally, I am of the mind that you can do whatever you want by linking to a GPL library. It seems to me that in this case, you are simply making use of the library, not creating a derived work.

However, it is also good to know that there is another license called the "LGPL" which specifically states that you are not obligated to license a product under the GPL as a result of linking to an LGLP library.

share|improve this answer
    
I also think case 1 is just using the library. It should not be GPL. The main project is 100% GPL. So I can not think about LGPL. –  Shiplu Jul 19 '12 at 17:00
    
You're going to have to read the license yourself and use your best judgement in case 1. In case 2 though, I think it's very clear that you are creating a derived work. –  Rice Flour Cookies Jul 19 '12 at 17:39
add comment

Yes. The GPL is a viral license; anything you extend the project with, or even link to it with shared libraries, must either be GPL or a compatible license, which includes many but not all other open-source licenses.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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