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.

If I were to write say, an embeded linux video server, how much of the code do I have to offer to someone who requests the source? Do I have to offer the code that directly links against the GPL covered code or do I have to offer all code? For instance, if I use gstreamer, or any other LGPL code, on a linux platform in my program, does all of my code become under GPL simply because somewhere in the chain, the LGPL program had to link agaist GPL code?

I guess this is an extension of the question. Can you write a C library that compiles in linux that does not become subject to GPL?

share|improve this question
    
Code that directly links against the GPL covered code or all code That sentence makes absolutely no sense to me. –  Yannis Rizos Nov 16 '11 at 19:02
1  
@Yannis, me neither, let me fix it. –  Jonathan Henson Nov 16 '11 at 19:03
    
So are you asking whether Linux makes all code running on it GPL by virtue of being GPL'd itself? –  delnan Nov 16 '11 at 19:08
1  
That's pretty easy to answer through logic: If that was the case, there'd be no non-GPL software on linux. There clearly is, there's even entirely proprietary software. –  delnan Nov 16 '11 at 19:23
4  
The entire purpose of the LGPL existing (as opposed to the GPL) is to allow being called as a library without requiring that the caller is GPL or LGPL. However, LGPL can't call GPL'ed things (because the GPL would then require it to be GPL, not LGPL). –  Zach Nov 17 '11 at 2:52
show 4 more comments

4 Answers

up vote 3 down vote accepted

Ob: IANAL, and for legal advice you should go find one.

That said: to answer the question from the title "Is a program linked against an LGPL library in linux still under GPL?" The answer is no, because it never was.

Merely running a program on Linux does not make it subject to GPL. There are all sorts of closed-source programs that run on Linux.

Similarly linking to an LGPL library does not make you subject to GPL, but generally only to LGPL.

So for your case, if you are only using LGPL code, and furthermore linking dynamically as per LGPL section four removes your obligation to supply source code for the library itself.

The summary from the FSF about why you should not in their opinion use the LGPL for a new work is

The GNU Project has two principal licenses to use for libraries. One is the GNU Lesser GPL; the other is the ordinary GNU GPL. The choice of license makes a big difference: using the Lesser GPL permits use of the library in proprietary programs; using the ordinary GPL for a library makes it available only for free programs.

Which attempts to make it clear, that LGPL libraries are not infectious like the GPL itself.

If therefore on the other hand, you are linking to full GPL libraries from your own code, then the situation is quite different, and yes you are obligated to open your program, as you should have been supplying (or offering to supply) the code all along.

share|improve this answer
    
A "good lawyer"? Perhaps you meant a competent one? –  James Anderson Nov 17 '11 at 4:56
add comment

You really should just read the LGPL, sections 4, 5 and 6. No attempt to simplify those words will preserve their meaning. You will also find that there are multiple positions on some of these questions and the only way to get an authoritative answer you can legally rely on is to get your own written opinion from a lawyer.

share|improve this answer
    
I don't know that "legally rely on" is the right wording. After all, a lawyers opinion is still an opinion - the courts aren't required to act according to that opinion. –  Steve314 Nov 17 '11 at 10:32
1  
It's the right wording in many jurisdictions. The lawyer may be wrong, yes, but it won't be negligence on your side if you do rely on his faulty advice. However, if you rely on a faulty internet posting, you are far more likely to be considered negligent. –  MSalters Nov 17 '11 at 15:31
    
So it's a formal legal meaning behind "legally rely on" - a jargon meaning which is related to but different to the English language meaning, so that the term will naturally mislead non-lawyers. And the trouble with stating that as a criticism of lawyers is that all professionals do the same thing including programmers. Hmmm... –  Steve314 Nov 19 '11 at 1:34
    
It's jargon, but it's not exactly legal jargon. The same jargon is used in many professions that deal with liability. For example, pilots understand that if a qualified mechanic tells them that some work was done, there are specific rules that decide whether they may "rely on" the mechanic's statement or whether they are expected to check it themselves. (Whether or not they can rely on it has nothing to do with whether it's true or not. It has to do with whether the statement provides them a defense if it turns out to be false.) –  David Schwartz Nov 19 '11 at 3:44
add comment

The fundamental gist of LGPL is that its code can be linked against any license software without affecting its license, as long as it's done in such a way that the LGPL'd code can be tinkered with, modified, and the code linked against will be possible to get to work with the modified version. The license of the program using LGPL'd pieces can be arbitrary and doesn't change, but the way it is written or distributed must enable replacing the LGPL'd part. And you must provide all the code necessary for the replacement: the code of the LGPL'd part and anything necessary to integrate it in your program.

That means:

  • if you use dynamic linking, provide just the LGPL code, allowing easy replacement of the Free .so/.dll
  • if you use static linking, you must provide object files that can be linked with the library to provide a working executable.
  • if it integrates deeply, compilation units (object files) containing both your and the library code, you must provide your code, at least as much as necessary to compile the ready program after modifying contents of the library.
  • if you modified the library itself to suit your needs - even if the changes are extensive and far beyond scope of the original library - you must provide sources to the new, modified library as LGPL. If you want to keep the changes proprietary, they must land elsewhere outside the library, either as a wrapper/abstraction layer, or as a separate library.
share|improve this answer
add comment

The LGPL exists specifically to allow you to use GPLed source code, without the more restrictive terms of the full GPL.

This is usually applied to Macros,scripts libraries, and complex header files where without including the source in your code the rest of the GPLed library would be unusable.

share|improve this answer
    
Hmm... LGPLd code is not under the GPL, and does not allow you to use code under the GPL without following its requirements. –  Sean McMillan Nov 17 '11 at 13:56
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.