My son also had this problem before and I keep giving prune juice (Del Monte) just dilute it half in water. Also his poo poo only came in every 3 days before and hard and big, that's why he cried heavily when making it.
Then my doc give me a bottle of " Danilax Mixture 250ml. we give him 2 times per day for 2.5 ml each time and then his poo poo has been regular to once a day, it's baby metamucil. So you may ask your baby's doc if he needs this one too.