summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-03 17:39:55 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-03 17:39:55 +0000
commitddcb133aa22bf0be31baeea0787369671c689b74 (patch)
tree7f87613b054b4026403b7943dbc3def5d3441ee1 /configure.in
parent36be8938f4f4f1deec2ef25a84c5fbb4e21fc190 (diff)
* configure.in: use build_os variable for checking C and C++ compilers
matching. * configure.in: use clang++ if clang is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@32835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in45
1 files changed, 27 insertions, 18 deletions
diff --git a/configure.in b/configure.in
index ec51a9b4c0..9b800bd602 100644
--- a/configure.in
+++ b/configure.in
@@ -87,35 +87,40 @@ if test "$MAJOR" = "1"; then
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
fi
-AC_CANONICAL_TARGET
-target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
-ac_install_sh='' # unusable for extension libraries.
-
dnl checks for alternative programs
+AC_CANONICAL_BUILD
+AS_CASE(["$build_os"],
+ [darwin11.*], [
+ default_cc=cc-4.2
+ default_gcc=gcc-4.2
+ ], [
+ default_cc=cc
+ default_gcc=gcc
+ ])
+
AC_ARG_WITH(gcc,
AS_HELP_STRING([--without-gcc], [never use gcc]),
[
AS_CASE([$withval],
- [no], [: ${CC=cc}],
- [yes], [: ${CC=gcc}],
- [CC=$withval])
- AS_CASE([$withval], [no|yes],
- [with_gcc_specified=no],
- [with_gcc_specified=yes])])
-AS_CASE(["$target_os"], [darwin11.*],
- [if test -z "$CC"; then
- CC=gcc-4.2
- else
- if test "x$with_gcc_specified" = "xno" && $CC -v 2>&1 | grep -i LLVM > /dev/null; then
- CC=gcc-4.2
- fi
- fi])
+ [no], [: ${CC=$default_cc}],
+ [yes], [: ${CC=$default_gcc}],
+ [CC=$withval])])
dnl If the user switches compilers, we can't believe the cache
if test ! -z "$ac_cv_prog_CC" -a ! -z "$CC" -a "$CC" != "$ac_cv_prog_CC"
then
AC_MSG_ERROR(cached CC is different -- throw away $cache_file
(it is also a good idea to do 'make clean' before compiling))
fi
+AS_CASE(["$build_os"],
+ [darwin11.*], [
+ test -z "$withval" && : ${CC=gcc-4.2}
+ AS_CASE(["x$CC"],
+ [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
+ [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
+ [xcc-4.2|x/usr/bin/cc-4.2], [: ${CXX=c++-4.2}],
+ [xcc|x/usr/bin/cc], [: ${CXX=c++}],
+ [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
+ ])
test -z "$CC" || ac_cv_prog_CC="$CC"
if test "$program_prefix" = NONE; then
@@ -126,6 +131,10 @@ RUBYW_BASE_NAME=`echo rubyw | sed "$program_transform_name"`
AC_SUBST(RUBY_BASE_NAME)
AC_SUBST(RUBYW_BASE_NAME)
+AC_CANONICAL_TARGET
+target_os=`echo $target_os | sed 's/linux-gnu$/linux/;s/linux-gnu/linux-/'`
+ac_install_sh='' # unusable for extension libraries.
+
AC_DEFUN([RUBY_APPEND_OPTION],
[# RUBY_APPEND_OPTION($1, $2)
AS_CASE([" [$]{$1-} "],