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

win32/Makefile.sub: escape = in MJIT cflags

Since `=` is considered as delimiter in `()` of `for`, having
`-DRUBY_DEVEL=1` in CPPFLAGS had resulted in:

 #define MJIT_OPTFLAGS "-DMJIT_HEADER", \
   "-DRUBY_DEVEL", \
   "1", \

Even escaped `for %I in (... -DRUBY_DEVEL^=1)` does not yield an
expected result. This commit is a workaround for this issue.

After this commit, mjit_config.h will have:

 #define MJIT_OPTFLAGS "-DMJIT_HEADER", \
   "-DRUBY_DEVEL" MJIT_CONFIG_ESCAPED_EQ "1", \

And C macro resolves MJIT_CONFIG_ESCAPED_EQ to "=".

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-08-07 15:14:48 +00:00
parent dfd6787f46
commit 8430d0d123

View file

@ -316,10 +316,9 @@ MJIT_PRECOMPILED_HEADER = $(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_N
MJIT_CC = $(CC)
!endif
!ifndef MJIT_OPTFLAGS
# Short-term TODO: Include `$(XCFLAGS) $(CPPFLAGS)` to suppress warning. Currently adding them breakes JIT.
# Long-term TODO: Use only $(OPTFLAGS) for performance. It requires to modify flags for precompiled header too.
# Using flags used for building precompiled header to make JIT succeed.
MJIT_OPTFLAGS = -DMJIT_HEADER $(CFLAGS)
# TODO: Use only $(OPTFLAGS) for performance. It requires to modify flags for precompiled header too.
# For now, using flags used for building precompiled header to make JIT succeed.
MJIT_OPTFLAGS = -DMJIT_HEADER $(CFLAGS) $(XCFLAGS) $(CPPFLAGS)
!endif
!ifndef MJIT_DEBUGFLAGS
# TODO: Make this work... Another header for debug build needs to be installed first.
@ -1332,6 +1331,7 @@ mjit_config.h:
#ifndef RUBY_MJIT_CONFIG_H
#define RUBY_MJIT_CONFIG_H 1
#define MJIT_CONFIG_ESCAPED_EQ "="
#define MJIT_BUILD_DIR "$(MAKEDIR)"
#define MJIT_PRECOMPILED_HEADER_NAME "/$(MJIT_HEADER_INSTALL_DIR)/$(MJIT_PRECOMPILED_HEADER_NAME)"
<<KEEP
@ -1345,11 +1345,11 @@ mjit_config.h:
@echo /* MJIT_CFLAGS */>> $@
@
@(set sep=#define MJIT_OPTFLAGS ) & \
for %I in ($(MJIT_OPTFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
for %I in ($(MJIT_OPTFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_OPTFLAGS */>> $@
@
@(set sep=#define MJIT_DEBUGFLAGS ) & \
for %I in ($(MJIT_DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
for %I in ($(MJIT_DEBUGFLAGS:^==" MJIT_CONFIG_ESCAPED_EQ ")) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@
@echo /* MJIT_DEBUGFLAGS */>> $@
@
@(set sep=#define MJIT_LDSHARED ) & \