Hi Betty: I really need more information about your walls irregularity to address possible solutions. Does the wall lean into or out of the room? Does it pitch back to the left or right as you face it, or is it a washboard effect....common on some turn of the century homes finished by discount plasterers.
Most cabinets are built with the cabinet back dadoed into its sides, which will give you usually 1 to 3" of just the plywood (or particle board) side touching the wall. For a cabinets exposed (visible after installation) side, I hold it in place against the wall, using a cabinet jack and/or combinations of clamps. Once plumb, I use a compass, set its width to the widest gap the cabinet has with the wall, and scribe a line down that side of the cabinet, following the contour of the wall. I cut this line using a saber saw with a new fine tooth blade to minimize splintering.
In your case, this will have to involve taking down the cabinet(s) to do this.
A quicker but less asthetically pleasing method is to use thin flat stock of the same material the cabinets are made, slide it along the side of the cabinet until it hits the wall and plumb it vertically, then do as described above, then finish this piece to match the cabinets and attach it to the cabinet side using small (1") brads.