[ Cc:ing bug-autoconf; this is http://thread.gmane.org/gmane.comp.gnu.libtool.bugs/6337 ]
Hello Andreas, * Andreas Schwab wrote on Tue, May 13, 2008 at 04:54:58PM CEST: > The following configure.ac input creates a circular dependency error: > > $ cat configure.ac > AC_INIT > AC_PROG_LIBTOOL > AC_LANG_CPLUSPLUS > AC_PROG_CC > AC_HEADER_STDC > AC_OUTPUT > $ autoreconf -fi > configure.ac:5: error: m4_require: circular dependency of > AC_LANG_COMPILER(C++) > ../../lib/autoconf/lang.m4:271: AC_LANG_COMPILER_REQUIRE is expanded from... > ../../lib/autoconf/general.m4:2517: AC_LINK_IFELSE is expanded from... > /usr/share/aclocal/libtool.m4:1018: _LT_SYS_MODULE_PATH_AIX is expanded > from... > /usr/share/aclocal/libtool.m4:5305: _LT_LANG_CXX_CONFIG is expanded from... > /usr/share/aclocal/libtool.m4:785: _LT_LANG is expanded from... > /usr/share/aclocal/libtool.m4:768: LT_LANG is expanded from... > ../../lib/autoconf/c.m4:769: AC_LANG_COMPILER(C++) is expanded from... > ../../lib/autoconf/lang.m4:271: AC_LANG_COMPILER_REQUIRE is expanded from... > ../../lib/autoconf/general.m4:2461: AC_COMPILE_IFELSE is expanded from... > ../../lib/m4sugar/m4sh.m4:508: AS_IF is expanded from... > ../../lib/autoconf/general.m4:1973: AC_CACHE_VAL is expanded from... > ../../lib/autoconf/general.m4:1993: AC_CACHE_CHECK is expanded from... > ../../lib/autoconf/headers.m4:622: AC_HEADER_STDC is expanded from... > configure.ac:5: the top level > autom4te: /usr/bin/m4 failed with exit status: 1 > aclocal: autom4te failed with exit status: 1 > autoreconf: aclocal failed with exit status: 1 > > When AC_PROG_LIBTOOL is commented out no error occurs and the generated > configure script works as expected. Workaround is to explicitly add the > missing AC_PROG_CXX. Thanks for the report. I think this is an Autoconf bug: AC_LANG_CPLUSPLUS should ideally require AC_PROG_CXX. However, since the former is just AC_LANG([C++]), for which it is a bit difficult to use AC_REQUIRE, I think we should adjust our documentation to state that the user needs to call AC_PROG_CXX before using AC_LANG([C++]). Actually, the Autoconf manual has several examples that do not follow this convention (for different languages). FWIW, if AC_PROG_LIBTOOL is commented out, there is no autoconf failure, but the configure script doesn't work as expected: namely, AC_LANG_CPLUSPLUS switches to the C++ language but no C++ compiler has been configured. Cheers, Ralf
