analysisBy Richard Dowden
Uganda's war over homosexuality threatens to spread to other African countries and has further damaged the increasingly strained relationship between Africa and Western donors. For the donors it is a matter of human rights for minorities - a corner stone of democracy.
For Africa it is part of the push back against the Western donors and the assertion of an African agenda. In Africa's very religious - Christian or Muslim - societies, it is a matter of morality. At best it is a battle between Western human rights and African morality but both suspect the other - quite rightly - of more cynical agendas.
How did we get here? In the mid 1980s when Aids became front page news it was at first an American story from San Francisco dubbed "The Gay Plague".
Then there were the reports from Southern Uganda - the area I had lived in more than a decade earlier. A particular hard-nosed news editor asked me: "So are they all bumming each other in Africa?" My reply was that in all the time I had been working in Africa I had never come across homosexuality. That was true. Nobody talked about it.
In the United States Aids had begun to spread through the gay community while in Africa it was spread through heterosexual relationships, but my assertion that there was no gay sex in Africa was absurd. In fact teaching in a Catholic school in Buganda it was staring me in the face.
The Uganda Martyrs, 22 young men executed by the Kabaka, the Baganda king, Mutesa II in 1886 and canonised by Pope Paul VI in 1964, were burned to death because they refused to have sex with him. But in the school, this was played down. We taught that they were executed because they converted to Christianity. Homosexuality was not talked about in Africa.
If it came up in conversation Ugandans and many other Africans would tell you that homosexuality is not African. They say it was introduced to Africa by the Arabs or the Europeans who forced Africans to do it - all part of the imperial takeover of Africa.
It is true that African cultures tend to be very patriarchal and often macho. Part of that culture is the refusal to accept that some people, male and female, are gay and that they are just made that way.
Of course the mainstream religions (Christianity and Islam) which have traditionally denounced homosexuality were mostly introduced to Africa by Europeans and Arabs.
Their new well-funded fundamentalist counterparts - Wahabi Islam from Saudi Arabia and born again Christianity funded by theologically primitive churches in America - are killing off Africa's traditional tolerance of otherness. There is much evidence that historically many African societies tolerated homosexuality and found ways of accommodating gay people.
If anything it was the Christian churches and Islamic preachers who suppressed it. Many years after I left Uganda I heard that the head boy of the school I taught in had committed suicide.
He was a very sensible, mild mannered boy who worked hard and never did anything wrong. The girls loved him because he handsome and never hit on them - or hit them - as other boys did.
I learned that he had become a well-respected priest but one day he had gone to the forest and hanged himself. I am now sure he was gay and had become a priest in the belief that God would give him the strength to resist these heinous feelings.
There was the bizarre case in 1997 of the first president of Zimbabwe, the Reverend Canaan Sodindo Banana. His male bodyguard accused him of forcing him to have sex.
At first his denials were believed but the case came to court and other victims came forward as witnesses. Banana was convicted and served a prison sentence. When he died in 2003 he was not given a state funeral but Robert Mugabe called him "a rare gift to the nation."
Since then there have been other reports of gay groups throughout Africa including at senior levels of the Nigerian army but until recently not many Africans have admitted they are gay. It can be a death sentence in some societies.
I fear for Binyavanga Wainaina, the gay Kenyan writer who movingly came out in public earlier this year. Since the new law in Uganda bans the promotion of gay literature, presumably his books are banned there now.
But wait a moment. There is another side to this apparently simple story of backward primitive Africa confronting progressive Western morality.
I grew up in a world which was very similar to where Uganda is at the moment. In the Catholic boarding school I went to homosexuality was the worst crime in the book and boys were beaten for it. It was not just a matter of school discipline. We were told we would definitely go to hell for it too.
And that was pretty much the view of society too. Homosexuality was illegal and gay people discriminated against in the UK until a series of laws began to be passed in 1967. Even then it was tolerated as long as it didn't "frighten the horses" - cause a public problem.
So people like Oscar Wilde were destroyed by those laws and, in my lifetime, Alun Turing, the man who broke the German enigma code in World II, committed suicide after being convicted of homosexual acts. He was also forced to have chemical hormone treatment to "cure" him. Until recently a prominent psychiatrist I know believed it was a "disorder".
The fact is that in Britain it has only been 30 years since being gay has been OK thanks to a concentrated campaign to change the public attitude.
Africa may not have been exposed to that debate and even then we must not assume its people will simply follow what Western governments tell them to do. Why should we expect African countries to automatically follow suit and change their minds and their laws, just because we tell them to? That does sound like neo-imperialism to me.
With China and other countries now engaged in Africa, African people and their rulers are becoming more self-confident and are able to push back against the western agenda - including western liberal values.
It is tragic that this new self-confidence and ability to assert African values has started with the issue of gay rights but we should be neither surprised, nor smug about it.
Richard Dowden is Director of the Royal African Society and author of Africa; altered states, ordinary miracles. Follow Richard on twitter @DowdenAfrica