I agree with changing jobs.
At a certain point, you have to realize that you are in a no win situation and move on. The only way to affect change in your current organization is to leave. If enough people follow your lead, senior management will realize that your manager is a problem and deal with them. That will be too little, too late in your specific case, but the company will be better in the long run.
If you really are a good programmer, you can go to work anywhere. There is a serious shortage of good programmers in the world. By good programmers I mean people who inherently get programming. I do not mean people who happen to be able to develop apps in a single language.
Once you get burnt out with programming, aspire to be the manager or executive that you always wished that you could work for. Cultivate an environment in which other programmers can thrive and succeed. Find a company that needs good programmers and reap the rewards of being the person, or the team leader who builds the product that generates the revenue.