Your best option is to use the GNU AGPL or GPL and sell a different license to companies who find those unacceptable. Be prepared to go to court in order to uphold the GNU licenses, companies will violate them a lot. Also be prepared to have companies reimplement your library from scratch in order to avoid the GNU licenses.