ax_cxx_gcc_abi_demangle.m4 fails to detect AX_CXX_GCC_ABI_DEMANGLE feature on FreeBSD when using GCC 4.6 or later. The test code uses free(3) which is declared in stdlib.h. In the described environment the function is _not_ indirectly visible via other headers used. So compilation of the test code always fails.
Adding an cstdlib header include resolves the issue. Thank you. -- Andriy Gapon