The doxygen documentation is by default created at the moment when doxygen is installed. The user has no possibility of switching this off when doxygen is installed. For packagers who want to put the documentation in a separate package, this is cumbersome since the generated documentation has to be removed or ignored. It would be better if this is really user-selectable. The current m4 macro does not support this. An alternative and more elaborate m4 macro can be found at http://autoconf-archive.cryp.to/ax_prog_doxygen.html
Macro from http://autoconf-archive.cryp.to/ax_prog_doxygen.html