summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-01 05:24:19 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-09-01 05:24:19 +0000
commit68d5d0f372221e4772507842e0ec8fabef9d0d98 (patch)
tree52d5e600c561f33e2071ae72e333825855d0df4e /ext/extmk.rb
parentd8f4c6a5ffc30a256db8c9da798bc4b0e30038df (diff)
extmk.rb: hacks for bundled gems
* ext/extmk.rb (gems): move dirty hacks for bundled gems from mkmf.rb. * lib/mkmf.rb (create_makefile): yield all configuration strings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/extmk.rb')
-rwxr-xr-xext/extmk.rb22
1 files changed, 16 insertions, 6 deletions
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 848516d..0a7c589 100755
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -569,10 +569,22 @@ FileUtils::makedirs('gems')
Dir.chdir('gems')
extout = $extout
unless gems.empty?
+ def self.timestamp_file(name, target_prefix = nil)
+ name = @sodir if name == '$(TARGET_SO_DIR)'
+ super
+ end
+
def self.create_makefile(*args, &block)
- if super(*args, &block)
- open("Makefile", "a") do |mf|
- mf << %{
+ super(*args) do |conf|
+ conf.find do |s|
+ s.sub!(/^(TARGET_SO_DIR *= *)\$\(RUBYARCHDIR\)/) {
+ $1 + @sodir
+ }
+ end
+ conf << %{
+
+# default target
+all:
build_complete = $(TARGET_SO_DIR)gem.build_complete
install-so: build_complete
@@ -581,14 +593,12 @@ $(build_complete): $(TARGET_SO)
$(Q) $(TOUCH) $@
}
- end
- true
end
end
end
gems.each do |d|
$extout = extout.dup
- $sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}"
+ @sodir = "$(extout)/gems/$(arch)/#{d[%r{\A[^/]+}]}"
extmake(d, 'gems')
end
$extout = extout