summaryrefslogtreecommitdiff
path: root/lib/mkmf.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 /lib/mkmf.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 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 8c795b0ae6..4e69f765fb 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2260,11 +2260,8 @@ RULES
dllib = target ? "$(TARGET).#{CONFIG['DLEXT']}" : ""
staticlib = target ? "$(TARGET).#$LIBEXT" : ""
- mfile = open("Makefile", "wb")
conf = configuration(srcprefix)
- conf = yield(conf) if block_given?
- mfile.puts(conf)
- mfile.print "
+ conf << "\
libpath = #{($DEFLIBPATH|$LIBPATH).join(" ")}
LIBPATH = #{libpath}
DEFFILE = #{deffile}
@@ -2293,17 +2290,20 @@ STATIC_LIB = #{staticlib unless $static.nil?}
TIMESTAMP_DIR = #{$extout ? '$(extout)/.timestamp' : '.'}
" #"
# TODO: fixme
- install_dirs.each {|d| mfile.print("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
- sodir = !$extout ? '' :
- $sodir ? $sodir+target_prefix :
- '$(RUBYARCHDIR)'
+ install_dirs.each {|d| conf << ("%-14s= %s\n" % d) if /^[[:upper:]]/ =~ d[0]}
+ sodir = $extout ? '$(TARGET_SO_DIR)' : '$(RUBYARCHDIR)'
n = '$(TARGET_SO_DIR)$(TARGET)'
- mfile.print "
-TARGET_SO_DIR =#{(sodir && !sodir.empty? ? " #{sodir}/" : '')}
+ conf << "\
+TARGET_SO_DIR =#{$extout ? " $(RUBYARCHDIR)/" : ''}
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
+" #"
+ conf = yield(conf) if block_given?
+ mfile = open("Makefile", "wb")
+ mfile.puts(conf)
+ mfile.print "
all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{!$extmk ? " install-rb" : ""}"}
.PHONY: all install static install-so install-rb
@@ -2339,7 +2339,7 @@ static: #{$extmk && !$static ? "all" : "$(STATIC_LIB)#{!$extmk ? " install-rb" :
mfile.print "\t-$(Q)$(RMDIRS) #{fseprepl[dir]}#{$ignore_error}\n"
else
mfile.print "#{f} #{stamp}\n"
- mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} $(RUBYARCHDIR)\n"
+ mfile.print "\t$(INSTALL_PROG) #{fseprepl[f]} #{dir}\n"
if defined?($installed_list)
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
end