summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--configure.in22
2 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 8d605f8077..8e7f9c563c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jul 24 00:42:00 2011 Kenta Murata <mrkn@mrkn.jp>
+
+ * configure.in: change the default compiler to gcc-4.2 if target os
+ is OS X 10.7 (Lion).
+
Sun Jul 24 00:19:13 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* configure.in: changed default optflags to -O0 if the compiler is
diff --git a/configure.in b/configure.in
index b90f689e8b..ecb3a36ca2 100644
--- a/configure.in
+++ b/configure.in
@@ -86,6 +86,11 @@ AC_SUBST(RUBY_RELEASE_DATE)
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_ARG_WITH(gcc,
AS_HELP_STRING([--without-gcc], [never use gcc]),
@@ -93,7 +98,18 @@ AC_ARG_WITH(gcc,
AS_CASE([$withval],
[no], [: ${CC=cc}],
[yes], [: ${CC=gcc}],
- [CC=$withval])])
+ [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])
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
@@ -110,10 +126,6 @@ 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-} "],