ruby-changes:50612
From: nobu <ko1@a...>
Date: Fri, 16 Mar 2018 00:20:13 +0900 (JST)
Subject: [ruby-changes:50612] nobu:r62765 (trunk): configure.ac: fix rb_cv_gcc_compiler_cas
nobu 2018-03-16 00:20:08 +0900 (Fri, 16 Mar 2018) New Revision: 62765 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62765 Log: configure.ac: fix rb_cv_gcc_compiler_cas * configure.ac (rb_cv_gcc_compiler_cas): do not use one variable for multiple AC_CACHE_CHECK. in one check, select by different values. Modified files: trunk/configure.ac Index: configure.ac =================================================================== --- configure.ac (revision 62764) +++ configure.ac (revision 62765) @@ -258,29 +258,6 @@ AS_IF([test "$target_cpu" != "$host_cpu" https://github.com/ruby/ruby/blob/trunk/configure.ac#L258 RUBY_DEFAULT_ARCH("$target_cpu") ]) -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])]) - AS_IF([test "$rb_cv_gcc_compiler_cas" = no], [ - 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" - ])]) - AS_CASE(["$target_os"], [darwin*], [ if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then ac_cv_prog_ac_ct_RANLIB=: @@ -664,6 +641,23 @@ AS_IF([test "$GCC" = yes], [ https://github.com/ruby/ruby/blob/trunk/configure.ac#L641 done ]) +AS_CASE(["$target_cpu"], [[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], + [ + save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -march=i486" + AC_TRY_LINK([unsigned long atomic_var;], + [__sync_val_compare_and_swap(&atomic_var, 0, 1);], + [rb_cv_gcc_compiler_cas=i486], + [rb_cv_gcc_compiler_cas=no]) + CFLAGS="$save_CFLAGS" + ]) + ]) + AS_IF([test "$rb_cv_gcc_compiler_cas" = i486], [ARCH_FLAG="-march=i486"]) +]) + AC_ARG_WITH(opt-dir, AS_HELP_STRING([--with-opt-dir=DIR-LIST], [add optional headers and libraries directories separated by $PATH_SEPARATOR]), -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/