diff --git a/ext/extmk.rb b/ext/extmk.rb index 939eb73565..73ee71fd37 100755 --- a/ext/extmk.rb +++ b/ext/extmk.rb @@ -536,9 +536,14 @@ extend Module.new { def timestamp_file(name, target_prefix = nil) if @gemname and name == '$(TARGET_SO_DIR)' - name = "$(arch)/gems/#{@gemname}#{target_prefix}" + gem = true + name = "$(gem_platform)/$(ruby_version)/gems/#{@gemname}#{target_prefix}" end - super.sub(%r[/\.extout\.(?:-\.)?], '/.') + path = super.sub(%r[/\.extout\.(?:-\.)?], '/.') + if gem + nil while path.sub!(%r[/\.(gem_platform|ruby_version)\.-(?=\.)], '/$(\1)/') + end + path end def configuration(srcdir)