From: Stepan Kasal Date: Fri, 25 Feb 2005 08:52:48 +0000 (+0000) Subject: improve AC_PROG_CC and AC_PROG_CXX X-Git-Tag: AUTOCONF-2.59c~431 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cb653bd0dc116bd53c989a75b5639607b6ef2ad;p=thirdparty%2Fautoconf.git improve AC_PROG_CC and AC_PROG_CXX --- diff --git a/ChangeLog b/ChangeLog index d2f3c8d7a..81309c976 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-02-24 Stepan Kasal + + * lib/autoconf/c.m4 (AC_PROG_CC): Be more careful to skip + `/usr/ucb/cc'; use `cl.exe' to distinguish the MS compiler + from a Common Lisp's `cl'. + (AC_PROG_CXX): Behave according to the documentation: don't + search for $ac_tool_prefix$CCC and $CCC, just set CXX=$CCC; + make the variable CCC precious; use `cl.exe', not `cl'. + 2005-02-23 Paul Eggert Alexandre Duret-Lutz diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4 index 52f31c36a..b72710fe9 100644 --- a/lib/autoconf/c.m4 +++ b/lib/autoconf/c.m4 @@ -460,13 +460,19 @@ m4_ifval([$1], [AC_CHECK_TOOLS(CC, [$1])], [AC_CHECK_TOOL(CC, gcc) if test -z "$CC"; then - AC_CHECK_TOOL(CC, cc) + dnl Here we want: + dnl AC_CHECK_TOOL(CC, cc) + dnl but without the check for a tool without the prefix. + dnl Until the check is removed from there, copy the code: + if test -n "$ac_tool_prefix"; then + AC_CHECK_PROG(CC, [${ac_tool_prefix}cc], [${ac_tool_prefix}cc]) + fi fi if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi if test -z "$CC"; then - AC_CHECK_TOOLS(CC, cl) + AC_CHECK_TOOLS(CC, cl.exe) fi ]) @@ -696,11 +702,17 @@ AC_ARG_VAR([CXX], [C++ compiler command])dnl AC_ARG_VAR([CXXFLAGS], [C++ compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl _AC_ARG_VAR_CPPFLAGS()dnl -AC_CHECK_TOOLS(CXX, - [$CCC m4_default([$1], - [g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC])], - g++) - +_AC_ARG_VAR_PRECIOUS([CCC])dnl +if test -z "$CXX"; then + if test -n "$CCC"; then + CXX=$CCC + else + AC_CHECK_TOOLS(CXX, + [m4_default([$1], + [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC])], + g++) + fi +fi # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD