#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
Post a Comment
This site's webmaster failed misserably in upgrading the underlaying web framework.
The comment system is entirely broken right now. Sorry!
It's a little surprising that the GNU folks didn't think to put compatible licence checks into ld. :)
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.
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.
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.
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".
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.