Skip to content

Commit

Permalink
Fix ARCH_FLAG when cross-compiling on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Dec 15, 2023
1 parent 1e5c402 commit 2c2c6bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -461,7 +461,7 @@ AC_SUBST(CC_VERSION_MESSAGE, $cc_version_message)
: ${DLDFLAGS="$LDFLAGS"}

RUBY_UNIVERSAL_ARCH
AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "$cross_compiling" = no -a "${universal_binary:-no}" = no], [
AS_IF([test "$target_cpu" != "$host_cpu" -a "$GCC" = yes -a "${universal_binary:-no}" = no], [
RUBY_DEFAULT_ARCH("$target_cpu")
])
host_os=$target_os
Expand Down
4 changes: 4 additions & 0 deletions tool/m4/ruby_default_arch.m4
Expand Up @@ -9,6 +9,10 @@ AS_CASE([$1:"$host_cpu"],
[[i[3-6]86]:x86_64], [ARCH_FLAG=-m32],
[ppc64:ppc*], [ARCH_FLAG=-m64],
[ppc*:ppc64], [ARCH_FLAG=-m32],
AS_CASE([$build_os],
[darwin*], [ARCH_FLAG="-arch "$1],
[ARCH_FLAG=-march=$1]
)
)
AC_MSG_RESULT([$ARCH_FLAG])
])dnl

0 comments on commit 2c2c6bc

Please sign in to comment.