summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-12 07:01:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-09-12 07:01:59 +0000
commitf677ba887158758c48b4f8e1df092c6aacfe6621 (patch)
tree4f7a8f405f865581afb946952e809cd09e9263cc /configure.ac
parentca47fb329a1d48af3e1009620bdb18e931c9f188 (diff)
deduce versioned tools from CC
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64694 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac14
1 files changed, 11 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index b88649e..f401fd5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -193,6 +193,14 @@ AS_IF([test x"${build}" != x"${host}"], [
])
AC_PROG_CC
+AS_CASE([$CC],
+[gcc-*], [
+ gcc_prefix=gcc- gcc_suffix=`echo "$CC" | sed 's/^gcc//'`
+ AC_PROG_CXX(g++${gcc_suffix})],
+[clang-*], [
+ gcc_prefix=clang- gcc_suffix=`echo "$CC" | sed 's/^gcc//'`
+ AC_PROG_CXX(clang++${gcc_suffix})],
+[gcc_prefix= gcc_suffix=])
dnl Select the appropriate C++ compiler in OS X
AS_CASE(["$build_os"],
@@ -266,8 +274,8 @@ if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then
rb_cv_arflags='-no_warning_for_no_symbols -o'
fi
])
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(AR, ar)
+AC_CHECK_TOOLS(RANLIB, [${gcc_prefix}ranlib${gcc_suffix} ranlib], :)
+AC_CHECK_TOOLS(AR, [${gcc_prefix}ar${gcc_suffix} ar])
AS_IF([test -z "$AR"], [
AC_CHECK_PROGS(AR, aal, ar)
])
@@ -316,7 +324,7 @@ AS_CASE(["$target_os"],
],
[aix*], [AC_CHECK_TOOL(NM, nm, /usr/ccs/bin/nm, /usr/ccs/bin:$PATH)],
[hiuxmpp*], [AC_DEFINE(__HIUX_MPP__)]) # by TOYODA Eizi <toyoda@npd.kishou.go.jp>
-AC_CHECK_TOOL(NM, nm)
+AC_CHECK_TOOLS(NM, [${gcc_prefix}nm${gcc_suffix} nm])
AC_PROG_LN_S
AC_PROG_MAKE_SET