summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-16 05:39:06 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-16 05:39:06 +0000
commit3fa3f9abb9a187a12089c2c5a650a62dbd82a3dd (patch)
tree5a7f6c9f348469863b60010b02375c06b6704951 /lib/mkmf.rb
parent0923ae5ed1711d699ef2923c2223163646634a66 (diff)
Supports static linking of extensions and encodings again.
Fixes --with-static-linked-ext. Patch by Google Inc. [ruby-core:45073]. * Makefile.in (ENCOBJS, EXTOBJS): New variables to specify static linked libraries. Also reintroduces extinit.o, introduces encinit.o introduces encinit.o * common.mk: Builds static libraries rather than shared objects if specified. * configure.in (LD): new substitution. Avoids PIE if s * enc/depend: Supports static linked libraries (libencs, libenc, libtrans): New target. * enc/encinit.c.erb: new template to generate the initialization of statically linked encodings. * enc/make_encmake.rb (--module): new flag to specify whether static or dynamic. * transcode_data.h (TRANS_INIT): New macro to get rid of the name collision of encoding initializers and transcoder initializers. * ext/extmk.rb: Fixes the behavior on $extstatic is true. * lib/mkmf.rb (clean-static): new target to clean up static linked libraries. * ruby.c (process_options): New initializes statically linked encodings here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/mkmf.rb')
-rw-r--r--lib/mkmf.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 78841e2bf3..05c3bd8972 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1835,7 +1835,7 @@ DISTCLEANFILES = #{$distcleanfiles.join(' ')}
all install static install-so install-rb: Makefile
.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
+.PHONY: clean clean-so clean-static clean-rb
RULES
end
@@ -2064,7 +2064,7 @@ CLEANOBJS = *.#{$OBJEXT} #{config_string('cleanobjs') {|t| t.gsub(/\$\*/, "$
all: #{$extout ? "install" : target ? "$(DLLIB)" : "Makefile"}
static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
.PHONY: all install static install-so install-rb
-.PHONY: clean clean-so clean-rb
+.PHONY: clean clean-so clean-static clean-rb
"
mfile.print CLEANINGS
fsep = config_string('BUILD_FILE_SEPARATOR') {|s| s unless s == "/"}
@@ -2100,6 +2100,8 @@ static: $(STATIC_LIB)#{$extout ? " install-rb" : ""}
mfile.print "\t@echo #{dir}/#{File.basename(f)}>>$(INSTALLED_LIST)\n"
end
end
+ mfile.print "clean-static::\n"
+ mfile.print "\t-$(Q)$(RM) $(STATIC_LIB)\n"
else
mfile.puts "Makefile"
end
@@ -2372,13 +2374,14 @@ MESSAGE
clean-rb-default::
clean-rb::
clean-so::
-clean: clean-so clean-rb-default clean-rb
+clean: clean-so clean-static clean-rb-default clean-rb
\t\t-$(Q)$(RM) $(CLEANLIBS#{sep}) $(CLEANOBJS#{sep}) $(CLEANFILES#{sep})
distclean-rb-default::
distclean-rb::
distclean-so::
-distclean: clean distclean-so distclean-rb-default distclean-rb
+distclean-static::
+distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
\t\t-$(Q)$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
\t\t-$(Q)$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES#{sep})
\t\t-$(Q)$(RMDIRS) $(DISTCLEANDIRS#{sep})#{$ignore_error}