Makefile.in: ARCH_FLAG may contain "-m64" etc.

* Makefile.in (mjit_config.h): ARCH_FLAG may contain "-m64", "-m32",
  "-march=i486" and so on, but the change made with r63232 only
  supports "-arch AAA -arch BBB" mainly used on Mac OS X.
  To solve the issue, ARCH_FLAG is parsed and the architectures
  specified in "-arch XXX" are added to $archs and the rest is
  stored to $arch_flag. The $arch_flag is defined as MJIT_ARCHFLAG
  if $archs is empty or the target architecture is not listed in $arch.
  Fix build failure on Solaris 10 with ./configure CFLAGS="-m64".
  [Bug #14876] [ruby-dev:50583]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ngoto 2018-07-02 13:50:53 +00:00
Родитель ad0169421f
Коммит 2c68033a6d
1 изменённых файлов: 25 добавлений и 4 удалений

Просмотреть файл

@ -560,9 +560,26 @@ mjit_config.h:
$${1+printf} $${1+' "%s"'$$sep} $${1+"$$@"}; \
echo; \
}; \
archs="$(UNIVERSAL_ARCHNAMES)"; \
archs="$${archs:-$(ARCH_FLAG:-arch=)}"; \
parse_arch_flag() { \
while [ "$$#" -gt 0 ]; do \
case "$$1" in \
-arch) \
shift; \
archs="$${archs:+$$archs }$$1"; \
shift; \
;; \
*) \
arch_flag="$${arch_flag:+$${arch_flag} }$$1"; \
shift; \
;; \
esac; \
done; \
}; \
test "$(Q)" = @ || set -x; \
archs="$(UNIVERSAL_ARCHNAMES)"; \
arch_flag=""; \
parse_arch_flag $(ARCH_FLAG); \
need_mjit_archflag="$${archs}$${arch_flag}"; \
echo '#ifndef RUBY_MJIT_CONFIG_H'; \
echo '#define RUBY_MJIT_CONFIG_H 1'; \
echo; \
@ -570,17 +587,21 @@ mjit_config.h:
quote MJIT_MIN_HEADER_NAME "/$(MJIT_HEADER_INSTALL_DIR)/$(MJIT_MIN_HEADER_NAME)"; \
sep=,; \
quote "MJIT_CC_COMMON " $(MJIT_CC); \
quote "MJIT_CFLAGS $${archs:+ MJIT_ARCHFLAG}" -w; \
quote "MJIT_CFLAGS $${need_mjit_archflag:+ MJIT_ARCHFLAG}" -w; \
quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \
quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \
quote "MJIT_LDSHARED " $(MJIT_LDSHARED); \
quote "MJIT_DLDFLAGS $${archs:+ MJIT_ARCHFLAG}" $(MJIT_DLDFLAGS); \
quote "MJIT_DLDFLAGS $${need_mjit_archflag:+ MJIT_ARCHFLAG}" $(MJIT_DLDFLAGS); \
quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \
$${archs:+echo} $${archs:+'#if 0'}; \
for arch in $$archs; do \
echo "#elif defined __$${arch%=*}__"; \
quote " MJIT_ARCHFLAG " -arch $${arch%=*}; \
done; \
$${archs:+echo} $${archs:+'#else'}; \
if [ "$${arch_flag}" != "" ]; then \
quote " MJIT_ARCHFLAG " $${arch_flag}; \
fi; \
$${archs:+echo} $${archs:+'#endif'}; \
echo; \
echo '#endif /* RUBY_MJIT_CONFIG_H */'; \