Take him to the vet. Most likely he'll get an enema. Then buy him a water fountain (he'll drink more water) and feed him a good quality canned food--grain free or as close to grain free as you can. The ones you find in the grocery store usually have sugar in them, which isn't good for constipated cats. Wellness, Merrick, Natural Balance, Timberwolf Organics are a few good ones.
Tink, who is siamese (the breed is prone to constipation) was chronically constipated--painful cramps, 3 emergency trips to the vet, and at the last, he was having only one good day or so a week. I bought a water fountain and switched him to Wellness about 6 months ago and he hasn't had a problem since.
I hope he feels better soon!