diff --git a/.gitattributes b/.gitattributes index d9785fad00..6ca2f89462 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ *.gemspec diff=ruby *.rb diff=ruby +bin svn-properties=svn:ignore=ruby bin/* diff=ruby tool/update-deps diff=ruby tool/make-snapshot diff=ruby diff --git a/.gitignore b/.gitignore index bc83b6a1e5..ad98717668 100644 --- a/.gitignore +++ b/.gitignore @@ -130,6 +130,8 @@ lcov*.info /benchmark/fasta.output.* /benchmark/wc.input +/bin/ruby + /enc/*.def /enc/*.exp /enc/*.lib diff --git a/Makefile.in b/Makefile.in index 870fcdea31..2ee5c23736 100644 --- a/Makefile.in +++ b/Makefile.in @@ -265,7 +265,7 @@ $(ruby_pc): ruby-runner.h: template/ruby-runner.h.in @./config.status --file=$@:$(srcdir)/template/$(@F).in -ruby-runner$(EXEEXT): ruby-runner.c ruby-runner.h +bin/$(PROGRAM): ruby-runner.c ruby-runner.h $(Q) $(PURIFY) $(CC) $(CFLAGS) $(CPPFLAGS) -DRUBY_INSTALL_NAME=$(RUBY_INSTALL_NAME) $(LDFLAGS) $(LIBS) $(OUTFLAG)$@ $< $(RBCONFIG): $(PREP) @@ -417,7 +417,7 @@ clean-local:: $(Q)$(RM) ext/extinit.c ext/extinit.$(OBJEXT) ext/ripper/y.output \ enc/encinit.c enc/encinit.$(OBJEXT) -$(Q)$(RM) $(pkgconfig_DATA) - -$(Q)$(RMALL) ruby-runner$(EXEEXT) ruby-runner.h *.dSYM + -$(Q)$(RMALL) bin/$(PROGRAM) ruby-runner.h *.dSYM distclean-local:: $(Q)$(RM) ext/config.cache $(RBCONFIG) Doxyfile diff --git a/configure.in b/configure.in index 69a2a05859..ad94b75e5f 100644 --- a/configure.in +++ b/configure.in @@ -4028,7 +4028,7 @@ AS_CASE("$cross_compiling:${LIBPATHENV}", [yes:* | no:], [], [ AC_MSG_CHECKING(whether wrapper for $LIBPATHENV is needed) AS_IF([env ${LIBPATHENV}=/lib /bin/sh -c ': ${'${LIBPATHENV}'?}' 2>/dev/null], [AC_MSG_RESULT(no)], - [PREP="$PREP"' ruby-runner$(EXEEXT)' + [PREP="$PREP"' bin/$(PROGRAM)' AC_MSG_RESULT(yes)] ) ]) diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb index 539cce9d6f..5828bcd5ba 100644 --- a/test/dtrace/helper.rb +++ b/test/dtrace/helper.rb @@ -46,8 +46,8 @@ module DTrace IO.popen(cmd, err: [:child, :out], &:readlines) end - exeext = Regexp.quote(RbConfig::CONFIG["EXEEXT"]) - RUBYBIN = EnvUtil.rubybin.sub(/\/ruby-runner(?=#{exeext}\z)/, '/miniruby') + miniruby = "#{RbConfig::TOPDIR}/miniruby#{RbConfig::CONFIG["EXEEXT"]}" + RUBYBIN = File.exist?(miniruby) ? miniruby : EnvUtil.rubybin def trap_probe d_program, ruby_program d = Tempfile.new(%w'probe .d') diff --git a/tool/mkrunnable.rb b/tool/mkrunnable.rb index fbfc76047a..e43c4329e7 100755 --- a/tool/mkrunnable.rb +++ b/tool/mkrunnable.rb @@ -115,8 +115,8 @@ rubyw_install_name = config["rubyw_install_name"] goruby_install_name = "go" + ruby_install_name [ruby_install_name, rubyw_install_name, goruby_install_name].map do |ruby| ruby += exeext - if ruby and !ruby.empty? - ln_relative(ruby, "#{bindir}/#{ruby}") + if ruby and !ruby.empty? and !File.file?(target = "#{bindir}/#{ruby}") + ln_relative(ruby, target) end end so = config["LIBRUBY_SO"] diff --git a/tool/runruby.rb b/tool/runruby.rb index be1be6a68b..23d835536e 100755 --- a/tool/runruby.rb +++ b/tool/runruby.rb @@ -74,14 +74,14 @@ env = { 'RUBY_FIBER_MACHINE_STACK_SIZE' => '1', } -runner = File.join(abs_archdir, "ruby-runner#{config['EXEEXT']}") +runner = File.join(abs_archdir, "bin/ruby#{config['EXEEXT']}") runner = nil unless File.exist?(runner) abs_ruby = runner || File.expand_path(ruby) env["RUBY"] = abs_ruby env["GEM_PATH"] = env["GEM_HOME"] = File.expand_path("spec/rspec", srcdir) env["BUNDLE_RUBY"] = abs_ruby env["BUNDLE_GEM"] = "#{abs_ruby} -rrubygems #{srcdir}/bin/gem --backtrace" -env["PATH"] = [abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR) +env["PATH"] = [File.dirname(abs_ruby), abs_archdir, ENV["PATH"]].compact.join(File::PATH_SEPARATOR) if e = ENV["RUBYLIB"] libs |= e.split(File::PATH_SEPARATOR)