From 8430d0d123f96dd7c1a4204306aa93e301f939d3 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Tue, 7 Aug 2018 15:14:48 +0000 Subject: 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 --- win32/Makefile.sub | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'win32/Makefile.sub') diff --git a/win32/Makefile.sub b/win32/Makefile.sub index a2e3e2f0ff..c9d9384e2c 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -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)" <> $@ @ @(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 ) & \ -- cgit v1.2.3