Mathias Hasselmann

#ifndef LIBRARY_IS_GPL

There are libraries, which are licensed under GPL, instead of LGPL. This puts people under the risk of accidentely violating the copyright of that library, by using the GPL library from some LGPL library for instance. Well, also could be that doing that changes the license of your LGPL library to GPL or whatever. Don't really want to think about the horrible implications of accidently using a GPL library from some LGPL library.

Half jokingly (I assume) Matthew suggested a solution for that problem:

#ifndef LIBRARY_IS_GPL
#error "Library is released under the terms of the GNU General Public License. Define LIBRARY_IS_GPL to acknowledge this license."
#endif

I really like this idea.

Comments

Thomas Thurman commented on March 27, 2008 at 5:06 p.m.

It's a little surprising that the GNU folks didn't think to put compatible licence checks into ld. :)

Anonymous commented on March 27, 2008 at 11:27 p.m.

No thank you. For all of those people who *want* their software GPLed, this just represents an annoying hurdle to jump when using the library.

Jan Schmidt commented on March 28, 2008 at 3:51 a.m.

I feel compelled to point out that there is no problem with using a GPL'd library from an LGPL'd one. As always, the problems only arise when you go to distribute them together. As such, a compile time check is an irritation that isn't quite encompassing the actual problem.

Mathias Hasselmann commented on March 28, 2008 at 10:16 a.m.

Jan, are you really sure, that using a GPL library from LGPL code doesn't turn your LGPL code into GPL code? I think you are fundamentally wrong in your opinion. Let me point you that the FSF's license FAQ (http://www.fsf.org/licensing/licenses...

"If a library is released under the GPL (not the LGPL), does that mean that any program which uses it has to be under the GPL?

Yes, because the program as it is actually run includes the library."

My reading of this words is, that you cannot use GPL libraries from LGPL libraries. Well, unless you accept that your LGPL library effectively got relicensed to the GPL.

anon commented on March 28, 2008 at 2:24 p.m.

While potentially helpful, it's not good enough, there may be libraries licensed "GPLvN-only" or "GPLv{N or M}-only" or "GPLvN or later".

Thomas Thurman commented on March 28, 2008 at 6:21 p.m.

I believe Jan's interpretation is correct, but I'm not a lawyer and we should ask the FSF. I'm sure they'd be happy to tell us and note this in the FAQ.

Note that you can cover both cases by simply turning #error into #warning.

Post a Comment

This site's webmaster failed misserably in upgrading the underlaying web framework.
The comment system is entirely broken right now. Sorry!