From 0b429ad26907f62fb86aaea6ca699e7161f839ce Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 22 Apr 2018 00:02:56 +0000 Subject: [PATCH] Makefile.in: MJIT_ARCHFLAG * Makefile.in (mjit_config.h): separate MJIT_ARCHFLAG for each architecture on universal binary. cannot use precompiled-header with multiple -arch options. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- Makefile.in | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 62fea44052..4dc0178e12 100644 --- a/Makefile.in +++ b/Makefile.in @@ -46,6 +46,7 @@ sitedir = @sitedir@ archlibdir = @archlibdir@ ruby_version = @ruby_version@ RUBY_VERSION_NAME = @RUBY_VERSION_NAME@ +UNIVERSAL_ARCHNAMES = @UNIVERSAL_ARCHNAMES@ TESTUI = console TESTS = @@ -555,6 +556,7 @@ mjit_config.h: $${1+printf} $${1+' "%s"'$$sep} $${1+"$$@"}; \ echo; \ }; \ + archs="$(UNIVERSAL_ARCHNAMES)"; \ test "$(Q)" = @ || set -x; \ echo '#ifndef RUBY_MJIT_CONFIG_H'; \ echo '#define RUBY_MJIT_CONFIG_H 1'; \ @@ -563,12 +565,18 @@ mjit_config.h: quote MJIT_HEADER_INSTALL_DIR "$(MJIT_HEADER_INSTALL_DIR)"; \ sep=,; \ quote "MJIT_CC_COMMON " $(MJIT_CC); \ - quote "MJIT_CFLAGS " -w $(ARCH_FLAG); \ + quote "MJIT_CFLAGS $${archs:+ MJIT_ARCHFLAG}" -w; \ quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \ quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \ quote "MJIT_LDSHARED " $(MJIT_LDSHARED); \ quote "MJIT_DLDFLAGS " @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:+'#endif'}; \ echo; \ echo '#endif /* RUBY_MJIT_CONFIG_H */'; \ } > $@