ruby-changes:50490
From: nobu <ko1@a...>
Date: Fri, 2 Mar 2018 07:49:32 +0900 (JST)
Subject: [ruby-changes:50490] nobu:r62623 (trunk): MJIT specific flags
nobu 2018-03-02 07:49:26 +0900 (Fri, 02 Mar 2018) New Revision: 62623 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62623 Log: MJIT specific flags Passing options to configure like as `configure MJIT_OPTFLAGS=-O MJIT_DEBUGFLAGS=-g` overrides options to be used to compile JIT code, separately from the default options to be used for ruby itself. Modified files: trunk/Makefile.in trunk/configure.ac trunk/win32/Makefile.sub Index: configure.ac =================================================================== --- configure.ac (revision 62622) +++ configure.ac (revision 62623) @@ -2459,6 +2459,9 @@ AC_SUBST(DLDFLAGS)dnl https://github.com/ruby/ruby/blob/trunk/configure.ac#L2459 AC_SUBST(ARCH_FLAG)dnl AC_SUBST(MJIT_HEADER_FLAGS)dnl AC_SUBST(MJIT_HEADER_INSTALL_DIR)dnl +AC_SUBST(MJIT_CC, [${MJIT_CC-'$(CC)'}])dnl +AC_SUBST(MJIT_OPTFLAGS, [${MJIT_OPTFLAGS-'$(optflags)'}])dnl +AC_SUBST(MJIT_DEBUGFLAGS, [${MJIT_DEBUGFLAGS-'$(debugflags)'}])dnl AC_SUBST(STATIC)dnl AC_SUBST(CCDLFLAGS)dnl Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 62622) +++ win32/Makefile.sub (revision 62623) @@ -301,6 +301,15 @@ MJIT_HEADER_FLAGS = -P https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L301 MJIT_HEADER_SUFFIX = MJIT_HEADER_ARCH = MJIT_HEADER_INSTALL_DIR = include/$(RUBY_VERSION_NAME)/$(arch) +!ifndef MJIT_CC +MJIT_CC = $(CC) +!endif +!ifndef MJIT_OPTFLAGS +MJIT_OPTFLAGS = $(OPTFLAGS) +!endif +!ifndef MJIT_DEBUGFLAGS +MJIT_DEBUGFLAGS = $(DEBUGFLAGS) +!endif DLDFLAGS = $(LDFLAGS) -dll SOLIBS = @@ -1262,7 +1271,7 @@ mjit_config.h: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1271 <<KEEP @ @(set sep=#define MJIT_CC_COMMON ) & \ - for %I in ($(CC)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ + for %I in ($(MJIT_CC)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_CC_COMMON */>> $@ @ @(set sep=#define MJIT_CFLAGS ) & \ @@ -1270,11 +1279,11 @@ mjit_config.h: https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1279 @echo /* MJIT_CFLAGS */>> $@ @ @(set sep=#define MJIT_OPTFLAGS ) & \ - for %I in ($(OPTFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ + for %I in ($(MJIT_OPTFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_OPTFLAGS */>> $@ @ @(set sep=#define MJIT_DEBUGFLAGS ) & \ - for %I in ($(DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ + for %I in ($(MJIT_DEBUGFLAGS)) do @(call echo.%%sep%%"%%~I", \& set sep= ) >> $@ @echo /* MJIT_DEBUGFLAGS */>> $@ @ @(set sep=#define MJIT_LDSHARED ) & \ Index: Makefile.in =================================================================== --- Makefile.in (revision 62622) +++ Makefile.in (revision 62623) @@ -75,6 +75,9 @@ MJIT_HEADER_FLAGS = @MJIT_HEADER_FLAGS@ https://github.com/ruby/ruby/blob/trunk/Makefile.in#L75 MJIT_HEADER_SUFFIX = MJIT_HEADER_ARCH = MJIT_HEADER_INSTALL_DIR = @MJIT_HEADER_INSTALL_DIR@ +MJIT_CC = @MJIT_CC@ +MJIT_OPTFLAGS = @MJIT_OPTFLAGS@ +MJIT_DEBUGFLAGS = @MJIT_DEBUGFLAGS@ LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@ EXTLDFLAGS = @EXTLDFLAGS@ XLDFLAGS = @XLDFLAGS@ $(EXTLDFLAGS) @@ -556,10 +559,10 @@ mjit_config.h: https://github.com/ruby/ruby/blob/trunk/Makefile.in#L559 sep=; \ quote MJIT_HEADER_INSTALL_DIR "$(MJIT_HEADER_INSTALL_DIR)"; \ sep=,; \ - quote "MJIT_CC_COMMON " $(CC); \ + quote "MJIT_CC_COMMON " $(MJIT_CC); \ quote "MJIT_CFLAGS " -w $(ARCH_FLAG); \ - quote "MJIT_OPTFLAGS " $(optflags); \ - quote "MJIT_DEBUGFLAGS " $(debugflags); \ + quote "MJIT_OPTFLAGS " $(MJIT_OPTFLAGS); \ + quote "MJIT_DEBUGFLAGS " $(MJIT_DEBUGFLAGS); \ quote "MJIT_LDSHARED " @LDSHARED@; \ quote "MJIT_DLDFLAGS " @DLDFLAGS@; \ quote "MJIT_LIBS " $(LIBRUBYARG_SHARED); \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/