ruby-changes:43974
From: nobu <ko1@a...>
Date: Wed, 31 Aug 2016 15:36:18 +0900 (JST)
Subject: [ruby-changes:43974] nobu:r56047 (trunk): mkmf.rb: TARGET_SO_DIR
nobu 2016-08-31 15:36:12 +0900 (Wed, 31 Aug 2016) New Revision: 56047 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=56047 Log: mkmf.rb: TARGET_SO_DIR * ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb. * lib/mkmf.rb (create_makefile): create target shared object files under $(TARGET_SO_DIR) which is $sodir if it is defined with $extout. [ruby-core:77058] [Bug #12681] Modified files: trunk/ChangeLog trunk/ext/extmk.rb trunk/lib/mkmf.rb Index: ext/extmk.rb =================================================================== --- ext/extmk.rb (revision 56046) +++ ext/extmk.rb (revision 56047) @@ -131,7 +131,7 @@ def extract_makefile(makefile, keep = tr https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L131 true end -def extmake(target, basedir = (maybestatic = 'ext'), &block) +def extmake(target, basedir = (maybestatic = 'ext')) unless $configure_only || verbose? print "#{$message} #{target}\n" $stdout.flush @@ -225,7 +225,7 @@ def extmake(target, basedir = (maybestat https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L225 load $0 = conf end else - create_makefile(target, &block) + create_makefile(target) end $defs << "-DRUBY_EXPORT" if $static ok = File.exist?(makefile) @@ -243,7 +243,6 @@ def extmake(target, basedir = (maybestat https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L243 ok &&= File.open(makefile){|f| s = f.gets and !s[DUMMY_SIGNATURE]} unless ok mf = ["# #{DUMMY_SIGNATURE}\n", *dummy_makefile(CONFIG["srcdir"])].join("") - mf = yield mf if block atomic_write_open(makefile) do |f| f.print(mf) end @@ -571,15 +570,8 @@ Dir.chdir('gems') https://github.com/ruby/ruby/blob/trunk/ext/extmk.rb#L570 extout = $extout gems.each do |d| $extout = extout.dup - extmake(d, 'gems') do |mf| - mf.sub!(/^RUBYARCHDIR *= *(\$\(extout\))\/(\$\(arch\))(.*)/) { - "TARGET_SO_DIR = #$1/gems/#$2/#{d[%r{\A[^/]+}]}#$3\n" \ - "TARGET_SO_TIME = .gems.-.arch.-.#{d[/\A[^\/]+/]}.time" - } - mf.gsub!(/\bRUBYARCHDIR\b/, 'TARGET_SO_DIR') - mf.gsub!(/\.TARGET_SO_DIR\.time/, '$(TARGET_SO_TIME)') - mf - end + $sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}" + extmake(d, 'gems') end $extout = extout Dir.chdir('../ext') Index: lib/mkmf.rb =================================================================== --- lib/mkmf.rb (revision 56046) +++ lib/mkmf.rb (revision 56047) @@ -2303,9 +2303,13 @@ TIMESTAMP_DIR = #{$extout ? '$(extout)/. https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2303 " #" # TODO: fixme install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]} - n = ($extout ? '$(RUBYARCHDIR)/' : '') + '$(TARGET)' + sodir = !$extout ? '' : + $sodir ? $sodir+target_prefix : + '$(RUBYARCHDIR)' + n = '$(TARGET_SO_DIR)$(TARGET)' mfile.print " -TARGET_SO = #{($extout ? '$(RUBYARCHDIR)/' : '')}$(DLLIB) +TARGET_SO_DIR =#{(sodir ? " #{sodir}/" : '')} +TARGET_SO = $(TARGET_SO_DIR)$(DLLIB) CLEANLIBS = $(TARGET_SO) #{config_string('cleanlibs') {|t| t.gsub(/\$\*/) {n}}} CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$(TARGET)#{deffile ? '-$(arch)': ''}")} if target} *.bak @@ -2331,7 +2335,7 @@ static: #{$extmk && !$static ? "all" : " https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2335 end dirs = [] mfile.print "install: install-so install-rb\n\n" - sodir = (dir = "$(RUBYARCHDIR)").dup + dir = sodir.dup mfile.print("install-so: ") if target f = "$(DLLIB)" @@ -2450,7 +2454,7 @@ site-install-rb: install-rb https://github.com/ruby/ruby/blob/trunk/lib/mkmf.rb#L2454 mfile.print "$(TARGET_SO): " mfile.print "$(DEFFILE) " if makedef mfile.print "$(OBJS) Makefile" - mfile.print " #{timestamp_file('$(RUBYARCHDIR)', target_prefix)}" if $extout + mfile.print " #{timestamp_file(sodir, target_prefix)}" if $extout mfile.print "\n" mfile.print "\t$(ECHO) linking shared-object #{target_prefix.sub(/\A\/(.*)/, '\1/')}$(DLLIB)\n" mfile.print "\t-$(Q)$(RM) $(@#{sep})\n" Index: ChangeLog =================================================================== --- ChangeLog (revision 56046) +++ ChangeLog (revision 56047) @@ -1,3 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Aug 31 15:36:10 2016 Nobuyoshi Nakada <nobu@r...> + + * ext/extmk.rb: move TARGET_SO_DIR stuffs to mkmf.rb. + + * lib/mkmf.rb (create_makefile): create target shared object files + under $(TARGET_SO_DIR) which is $sodir if it is defined with + $extout. [ruby-core:77058] [Bug #12681] + Wed Aug 31 01:56:55 2016 Yuichiro Kaneko <yui-knk@r...> * doc/extension.ja.rdoc: [DOC] Fix a typo. [ci skip] -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/