Why don you use GNU autoconfig / automake / autoblurdybloop?
Autoconfig et al are not available on all the platforms where the IMAP toolkit is supported; and do not work correctly on some of the platforms where they do exist. Furthermore, these programs add another layer of complexity to an already complex process. Coaxing software that uses autoconfig to build properly on platforms which were not specifically considered by that software wastes an inordinate amount of time. When (not if) autoconfig fails to do the right thing, the result is an inpenetrable morass to untangle in order to find the problem and fix it. The concept behind autoconfig is good, but the execution is flawed. It rarely does the right thing on a platform that wasn’t specifically considered. Human life is too short to debug autoconfig problems, especially since the current mechanism is so much easier.