From 0a8fc937ca838ad63511eddff6893b047e40d14a Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 11 Feb 2013 02:06:47 +0000 Subject: [PATCH] * configure.in: move the test for -march=i486 just after RUBY_UNIVERSAL_ARCH/RUBY_DEFAULT_ARCH. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ configure.in | 46 +++++++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e035f7d02..4b35d93d51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 11 11:04:29 2013 Tanaka Akira + + * configure.in: move the test for -march=i486 just after + RUBY_UNIVERSAL_ARCH/RUBY_DEFAULT_ARCH. + Sun Feb 10 23:42:26 2013 Tanaka Akira * ext/socket/extconf.rb: test structure members just after types test. diff --git a/configure.in b/configure.in index 2b71c85c51..2bd85788ef 100644 --- a/configure.in +++ b/configure.in @@ -406,6 +406,29 @@ if test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no RUBY_DEFAULT_ARCH("$target_cpu") fi +AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [ + AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [ + AC_TRY_LINK([unsigned long atomic_var;], + [ + __sync_val_compare_and_swap(&atomic_var, 0, 1); + ], + [rb_cv_gcc_compiler_cas=yes], + [rb_cv_gcc_compiler_cas=no])]) + if test "$rb_cv_gcc_compiler_cas" = no; then + unset rb_cv_gcc_compiler_cas + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -march=i486" + AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [ + AC_TRY_LINK([unsigned long atomic_var;], + [ + __sync_val_compare_and_swap(&atomic_var, 0, 1); + ], + [rb_cv_gcc_compiler_cas=yes + ARCH_FLAG="-march=i486"], + [rb_cv_gcc_compiler_cas=no])]) + CFLAGS="$save_CFLAGS" + fi]) + AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar) if test -z "$AR"; then @@ -1553,29 +1576,6 @@ AS_CASE(["$target_os"], []) -AS_CASE(["$target_cpu-$target_os"], [[i[3-6]86*]], [ - AC_CACHE_CHECK([for __sync_val_compare_and_swap], [rb_cv_gcc_compiler_cas], [ - AC_TRY_LINK([unsigned long atomic_var;], - [ - __sync_val_compare_and_swap(&atomic_var, 0, 1); - ], - [rb_cv_gcc_compiler_cas=yes], - [rb_cv_gcc_compiler_cas=no])]) - if test "$rb_cv_gcc_compiler_cas" = no; then - unset rb_cv_gcc_compiler_cas - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -march=i486" - AC_CACHE_CHECK([for __sync_val_compare_and_swap with -march=i486], [rb_cv_gcc_compiler_cas], [ - AC_TRY_LINK([unsigned long atomic_var;], - [ - __sync_val_compare_and_swap(&atomic_var, 0, 1); - ], - [rb_cv_gcc_compiler_cas=yes - ARCH_FLAG="-march=i486"], - [rb_cv_gcc_compiler_cas=no])]) - CFLAGS="$save_CFLAGS" - fi]) - AC_CACHE_CHECK(for signbit, rb_cv_have_signbit, [AC_TRY_LINK([ #include