Licensing of source code that is meant to be used with incompatibly licensed library
<p>Suppose there exists a software library <em>libfoo</em> distributed under the terms of a hypothetical license we will here call The Foo License (TFL). The terms of TFL are identical to those of the <a href="https://opensource.org/licenses/BSD-3-Clause" rel="nofollow noreferrer">3-clause BSD license</a>, but with one extra condition tacked on:</p>
<ol start="4">
<li>No one by the name of Bob may use this software.</li>
</ol>
<p>Suppose now that I write a piece of software, let's call it <em>bar</em>, that uses libfoo. None of libfoo's code is copied into bar's source code, but when bar is compiled and linked, it also compiles pieces of libfoo and links these into the bar binary.</p>
<p>I am well aware that I cannot distribute the compiled bar binary under for example the <a href="https://www.gnu.org/licenses/gpl-3.0.en.html" rel="nofollow noreferrer">GPLv3</a>, because the 4th clause of TFL (which applies to the libfoo code present in the bar binary) is incompatible with the GPL. But: <strong>Can I distribute the <em>source code</em> for bar under the GPLv3?</strong></p>

<p>No, because <em><strong>both</strong></em> the binary and source code of your software would be covered under the same GPL v3 license, meaning distribution of either would be required to include an incompatible restriction (the No Bobs License terms) and thus not allowed under the GPL v3.</p>
<p>Note that there is a grey area in that if you are the sole copyright holder of the software you write, excluding the No Bobs License library, then you do not have to distribute under the same terms you require others to adhere to - so long as you can adhere to the No Bobs License yourself, you can distribute to another party under those terms but require that party to adhere to the GPL v3 when they distribute your code - which of course they cannot.  You are not beholden to the GPL v3 text because you did not distribute under it (same reason copyright holders can dual license) - but that has the outcome of effectively preventing distribution by third parties.</p>

licensing