Subject: configure fails to detect C++ compiler on case-insensitive FS
From: "Daniel Macks" <[email-masked]>
To: [email-masked]
Date: Mon, 24 Aug 2015 06:12:32 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Building automake-1.15 on OS X 10.10 on a case-insensitive filesystem, during ./configure I see:

checking whether cc understands -c and -o together... yes
checking for aCC... no
checking for FCC... no
checking for KCC... KCC
checking whether the C++ compiler works... no
configure: WARNING: C++ compiler cannot create executables
configure: tests requiring the C++ compiler will be skipped

I don't have "KCC" and my C++ compiler (at "c++" or "g++") is fine. I do however have /usr/bin/kcc, which AC_PROG_CXX finds when it looks for "KCC" on my filesystem:

# The list of C++ compilers here has been copied, pasted and edited
# from 'lib/autoconf/c.m4:AC_PROG_CXX' in the Autoconf distribution.
# Keep it in sync, or better again, find out a way to avoid this code
# duplication.
_AM_COMPILER_CAN_FAIL([AC_PROG_CXX(dnl
  [aCC $am_CC FCC KCC $am_RCC xlC_r xlC c++ cxx cc++ gpp g++])],
  [CXX=false; _AM_SKIP_COMP_TESTS([C++])])

But my "kcc" is some completely unrelated kerberos tool, so when AC_PROG_CXX tests to see whether it behaves as a compiler, it fails because it isn't a compiler, and the autoconf tests don't get as far as my actual compiler in the list of possibilities. This is the same situation as the now-fixed automake bugs #11893 and #10766, where looking for "CC" was finding "cc" on case-insensitive filesystems, so presumably the same solution could work. That is, only look for "KCC" if it's a case-sensitive FS.

This code from which this block is documented to derive is:

[g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC]

in autoconf git, so an alternate solution is to re-sync with that (notably, "KCC" is well after "c++" and "g++").

dan

--
Daniel Macks
[email-masked]