Error message: "AMDEP" was never defined

autoconf, automake

Solution

Apparently you cannot embed `AM_PROG_CC`, `AM_PROG_CPP` or `AM_PROG_CXX` in an `if` block (for whatever reason). Solution was to set a variable in the `if` block and pass it to AM_PROG_*.

Problem

I have a `configure.ac` in which I enable different compilers by different configure options. The `configure` script is generated successfully but at the end (call to `AC_OUTPUT`) I get an error message: ``` configure: error: conditional "AMDEP" was never defined. Usually this means the macro was only invoked conditionally. ``` Sadly looking into `config.log` does not help and I have no idea what causes this error or where to start searching.

Original source