1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-03-15 15:20:08 +00:00
parent b12d7f17d6
commit ec45161c51

View file

@ -258,29 +258,6 @@ AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" =
RUBY_DEFAULT_ARCH("$target_cpu") 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*], [ AS_CASE(["$target_os"], [darwin*], [
if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then if libtool 2>&1 | grep no_warning_for_no_symbols > /dev/null; then
ac_cv_prog_ac_ct_RANLIB=: ac_cv_prog_ac_ct_RANLIB=:
@ -664,6 +641,23 @@ AS_IF([test "$GCC" = yes], [
done 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, AC_ARG_WITH(opt-dir,
AS_HELP_STRING([--with-opt-dir=DIR-LIST], AS_HELP_STRING([--with-opt-dir=DIR-LIST],
[add optional headers and libraries directories separated by $PATH_SEPARATOR]), [add optional headers and libraries directories separated by $PATH_SEPARATOR]),