From c6699319417c244ad6dce99b608ddd4635f5bdbc Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 20 Jan 2013 13:24:31 +0000 Subject: [PATCH] vpath.rb: hack for msys make * tool/vpath.rb (VPath#def_options): hack for msys make, which converts a command line argument to non-msys command seems like a path list automagically. [Bug #7710] [ruby-core:51489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38886 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ common.mk | 2 +- ext/ripper/depend | 2 +- lib/mkmf.rb | 1 + tool/vpath.rb | 5 +++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47d87e5bb1..9ae42f3c64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Jan 20 22:24:28 2013 Nobuyoshi Nakada + + * tool/vpath.rb (VPath#def_options): hack for msys make, which + converts a command line argument to non-msys command seems like a + path list automagically. [Bug #7710] [ruby-core:51489] + Sat Jan 19 11:35:00 2013 Zachary Scott * struct.c (Struct.new): Document Struct.new with block diff --git a/common.mk b/common.mk index 3fc0d04563..1abef18031 100644 --- a/common.mk +++ b/common.mk @@ -575,7 +575,7 @@ PHONY: {$(srcdir)}.y.c: $(ECHO) generating $@ - $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=$(PATH_SEPARATOR) --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y + $(Q)$(BASERUBY) $(srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(SRC_FILE) > parse.tmp.y $(Q)$(YACC) -d $(YFLAGS) -o y.tab.c parse.tmp.y $(Q)$(RM) parse.tmp.y $(Q)sed -f $(srcdir)/tool/ytab.sed -e "/^#/s!parse\.tmp\.[iy]!parse.y!" -e "/^#/s!y\.tab\.c!$@!" y.tab.c > $@.new diff --git a/ext/ripper/depend b/ext/ripper/depend index 0beb489326..776977847d 100644 --- a/ext/ripper/depend +++ b/ext/ripper/depend @@ -25,7 +25,7 @@ static: check ripper.y: $(srcdir)/tools/preproc.rb $(top_srcdir)/parse.y $(ECHO) extracting $@ from $(top_srcdir)/parse.y - $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --vpath=$(VPATH) id.h $(top_srcdir)/parse.y > ripper.tmp.y + $(Q) $(RUBY) $(top_srcdir)/tool/id2token.rb --path-separator=.$(PATH_SEPARATOR)./ --vpath=$(VPATH) id.h $(top_srcdir)/parse.y > ripper.tmp.y $(Q) $(RUBY) $(srcdir)/tools/preproc.rb ripper.tmp.y --output=$@ $(Q) $(RM) ripper.tmp.y diff --git a/lib/mkmf.rb b/lib/mkmf.rb index 55e4b4a71c..e54f6113c5 100644 --- a/lib/mkmf.rb +++ b/lib/mkmf.rb @@ -1759,6 +1759,7 @@ srcdir = #{srcdir.gsub(/\$\((srcdir)\)|\$\{(srcdir)\}/) {mkintpath(CONFIG[$1||$2 topdir = #{mkintpath($extmk ? CONFIG["topdir"] : $topdir).unspace} hdrdir = #{mkintpath(CONFIG["hdrdir"]).unspace} arch_hdrdir = #{$arch_hdrdir.quote} +PATH_SEPARATOR = #{CONFIG['PATH_SEPARATOR']} VPATH = #{vpath.join(CONFIG['PATH_SEPARATOR'])} } if $extmk diff --git a/tool/vpath.rb b/tool/vpath.rb index 5aa2f9f3fe..cfa48313de 100644 --- a/tool/vpath.rb +++ b/tool/vpath.rb @@ -59,8 +59,9 @@ class VPath opt.on("-L", "--vpath=PATH LIST", "add directories to search path") {|dirs| @additional << [dirs] } - opt.on("--path-separator=SEP", /\A\W\z/, "separator for vpath") {|sep| - @separator = sep + opt.on("--path-separator=SEP", /\A(?:\W\z|\.(\W).+)/, "separator for vpath") {|sep, vsep| + # hack for msys make. + @separator = vsep || sep } end