Ugandan President Yoweri Museveni has signed into law a bill enacting extremely harsh criminal penalties for homosexuals and their supporters.