From 48d489030a9896e7d2b52f754b86403145a79975 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 23 Jan 2017 04:22:23 +0000 Subject: [PATCH] configure-ext.mk.tmpl: embed macros * template/configure-ext.mk.tmpl: embed MINIRUBY and SCRIPT_ARGS to get rid of quoting problems of nmake. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- common.mk | 6 +++--- template/configure-ext.mk.tmpl | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/common.mk b/common.mk index 08bdd6bd32..0dfa2e4be9 100644 --- a/common.mk +++ b/common.mk @@ -211,8 +211,7 @@ exts: build-ext EXTS_MK = exts.mk $(EXTS_MK): ext/configure-ext.mk $(TIMESTAMPDIR)/.$(arch).time $(srcdir)/template/exts.mk.tmpl - $(MAKE) -f ext/configure-ext.mk V=$(V) MINIRUBY="$(MINIRUBY)" \ - EXTSTATIC=$(EXTSTATIC) \ + $(MAKE) -f ext/configure-ext.mk V=$(V) EXTSTATIC=$(EXTSTATIC) \ gnumake=$(gnumake) EXTLDFLAGS="$(EXTLDFLAGS)" srcdir="$(srcdir)" $(ECHO) generating makefile $@ $(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \ @@ -222,7 +221,8 @@ ext/configure-ext.mk: $(PREP) all-incs $(MKFILES) $(RBCONFIG) $(LIBRUBY) $(ECHO) generating makefiles $@ $(Q)$(MAKEDIRS) ext $(Q)$(MINIRUBY) $(srcdir)/tool/generic_erb.rb -o $@ -c \ - $(srcdir)/template/$(@F).tmpl --srcdir="$(srcdir)" + $(srcdir)/template/$(@F).tmpl --srcdir="$(srcdir)" \ + --miniruby="$(MINIRUBY)" --script-args='$(SCRIPT_ARGS)' configure-ext: $(EXTS_MK) diff --git a/template/configure-ext.mk.tmpl b/template/configure-ext.mk.tmpl index b8d4a67f7e..cf3f3b4e61 100644 --- a/template/configure-ext.mk.tmpl +++ b/template/configure-ext.mk.tmpl @@ -5,21 +5,25 @@ ECHO1 = $(V:1=@:) ECHO = $(ECHO1:0=@echo) <% -srcdir = miniruby = nil +srcdir = miniruby = script_args = nil opt = OptionParser.new do |o| o.on('--srcdir=SRCDIR') {|v| srcdir = v} o.on('--miniruby=MINIRUBY') {|v| miniruby = v} + o.on('--script-args=MINIRUBY') {|v| script_args = v} o.order!(ARGV) end srcdir ||= File.dirname(File.dirname(__FILE__)) exts = Dir.glob("#{srcdir}/ext/*/").map(&File.method(:basename)) %> +MINIRUBY = <%=miniruby%> +SCRIPT_ARGS = <%=script_args%> + all: % exts.each do |dir| all: ext/<%=dir%>/exts.mk ext/<%=dir%>/exts.mk: FORCE $(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make='$(MAKE)' --command-output=ext/<%=dir%>/exts.mk \ - --extension=<%=dir%> --extstatic $(EXTSTATIC) \ + $(SCRIPT_ARGS) --extension=<%=dir%> --extstatic $(EXTSTATIC) \ --gnumake=$(gnumake) --extflags="$(EXTLDFLAGS)" \ -- subconfigure % end