I'm confused by this. If it "does not contain code from any GPL-covered software", then surely you can release it under any license you feel like, whether it can run stand-alone or not. If I
A program can be free of code from a GPL-covered program, but it links with a library licensed under the GPL, then it has to be under the GPL as well. It is this catch, if you will, that led to the LGPL.
This could only be true if you ship the binary with it linked.
For example, I hereby put the following code in to the public domain:
**** program PetersProgram;
uses MD5;
begin end. ****
The program contains no GPL-covered code, but is not standalone, and currently MD5 is GPLed, but there is no way for the GPL to apply to this code because I have not had to agree to the GPL to write this code.
If I wanted to compile and ship this binary, then in order to have permission for this, I would need permission to use the MD5 library, and to get that permission I would have to agree to the GPL license and then I would have to make my code GPLed. But even then I could still take the code I'd written and make it available in any other licensed form, including a commercial license.
This is even explicitly covered in the GPL, section 5, "You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. ..." - as long as you do not modify or distribute the GPL code, nothing stops you distributing code in any format you like, and this is true for any code you write, regardless of any perceived ability to stand alone.
Also, if you read section 2 carefully, section b does not apply unless you distribute or publish the derivative work. Therefore, it would be possible to sell the above code under a commercial license, and legitimate for anyone purchasing that code to compile an application that they could use, but they would not be able to distribute or publish the result because they would not have the appropriate permission to comply with section 2b - which they would have to do since they would be bound by the GPL.
So to be clear, there is nothing in the GPL to forbid this:
Download GPL code A.
Write your own code B that does not actually use any of code A but does link with it.
Assume the code A & code B remain in entirely different files.
Comply with section 2a and 2c regarding notices in the derived work and combine A & B and compile them together. Make changes to A as required. No requirement under the GPL requires you to distribute this derived work.
Remove files B. You now have a derived work A-prime under the GPL, even if such work does not even compile. In fact if it cannot compile, it cannot normally read commands interactively and so 2c would not apply.
Distribute A-prime under the GPL.
Sell files B under your own commercial license.
And since mere aggregation of A & B does not bring B under the scope of the license, you could ship a CD to your customers containing A-prime and B, which you could sell as you pleased (you still have to fully comply with the GPL for A-prime and include full source, but then that's really required anyway).
You could not ship a binary or A&B since that would be a distribution of the derivative work A&B and would bring section 2b in to play.
write code that does not contain code from any GPL-covered software, how then could the GPL be required of my code even if it is not standalone?
If it is not standalone, and it links with one or more libraries under the GPL, then your code falls under the situation I described above. It would then have to be released under the GPL, as per its conditions.
That is only true if I linked the code, and distribute/publish the derived work.
I can't see how that could be otherwise...?
I hope my reply helps you understand the hairy situation.
Not really. I never said anything about shipping a binary or linking with anything. I'm talking about pure code, and regardless of whether the GPL says the moon is made of green cheese, there is no way for it to force a license on to code without an agreement to that license, and that agreement is not needed to write code that does not contain code from GPL-covered software whether it will compile standalone or not.
The FSF might like it to be different, but that does not make it so. I can think of no legal way that any license could require the B files described above to be released under GPL unless the GPL required that all modifications and all derivative works ever created, regardless of whether they were distributed or not must be distributed under the GPL (that is, every single time you save a file, you would have to distribute it under the GPL), which is not practical and not what the GPL says.
Enjoy, Peter.