David Svoboda <[EMAIL PROTECTED]> writes: > In the lines 57-77 the choice of compiler, the user wants to use, is done. > When the ./configure (generated from this file) is executed without any > parameters, "config.log" is full of errors about corrent compiler setting. > When these lines (57-77) are deleted, everythig is OK. Why? What happens > with the compiler setting, when using AC_PROG_CXX, AC_PROG_CC macros in > different places of the "configure.in" file?
You cannot have several calls to AC_PROG_CC under different conditionals in your configure.in. The interface to your configure is also not really in the autoconf-style. Instead of --enable-kai-compiler et al, the autoconf way of doing it would be to run: env CXX=KCC configure env CXX=xcxx configure and so on to specify what comiler is to be used. So I would do something similar to this: AC_PROG_CXX(KCC cxx g++ c++) case "$CXX" in KCC) CC="$CXX --c" CXXFLAGS="$CXXFLAGS --one_instantiation_per_object --restrict --thread_safe" ;; cxx) CPPFLAGS="$CPPFLAGS __USE_STD_IOSTREAM" ... ;; esac Or if you prefer, you should be able to set a list of all the compilers to test for in a shell variable and then call AC_PROG_CXX. cxx_compilers="g++ c++" if ... cxx_compilers="KCC $cxx_compilers" ... fi AC_PROG_CXX($cxx_compilers) Hope this helps.
