summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-06 20:28:00 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-04-07 09:47:10 +0900
commitd7afaf21f2edfac8a606891868a3c4a7025267bd (patch)
tree4a71cd1906e50bda045f6747f854c37a5a29adfa /ext/extmk.rb
parent17ce0b9b846a065065008b5fb2e9f8ad13058fa1 (diff)
downloadruby-d7afaf21f2edfac8a606891868a3c4a7025267bd.tar.gz
Move the target directory of bundled gems like as rubygems
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 1da9e27045..a440af27fc 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -2,6 +2,9 @@
# -*- mode: ruby; coding: us-ascii -*-
# frozen_string_literal: false
+module Gem; end # only needs Gem::Platform
+require 'rubygems/platform'
+
# :stopdoc:
$extension = nil
$extstatic = nil
@@ -535,11 +538,12 @@ extend Module.new {
super(*args) do |conf|
conf.find do |s|
s.sub!(/^(TARGET_SO_DIR *= *)\$\(RUBYARCHDIR\)/) {
- "TARGET_GEM_DIR = $(extout)/gems/$(arch)/#{@gemname}\n"\
+ "TARGET_GEM_DIR = $(topdir)/.bundle/extensions/$(gem_platform)/$(ruby_version)/#{@gemname}\n"\
"#{$1}$(TARGET_GEM_DIR)$(target_prefix)"
}
end
conf.any? {|s| /^TARGET *= *\S/ =~ s} and conf << %{
+gem_platform = #{Gem::Platform.local}
# default target
all: