зеркало из https://github.com/github/ruby.git
static-linked-ext: into libruby
* Makefile.in, common.mk (PROGRAM): no extension libraries. * common.mk (build-ext): pass macros for libruby.so. * ext/extmk.rb (command_output): link extension libraries and encoding libraries into libruby.so, not ruby executable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1a6b07d716
Коммит
0e60b2c6a3
|
@ -1,4 +1,11 @@
|
|||
Sat May 19 11:36:22 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sat May 19 11:37:18 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* Makefile.in, common.mk (PROGRAM): no extension libraries.
|
||||
|
||||
* common.mk (build-ext): pass macros for libruby.so.
|
||||
|
||||
* ext/extmk.rb (command_output): link extension libraries and encoding
|
||||
libraries into libruby.so, not ruby executable.
|
||||
|
||||
* ext/extmk.rb (command_output): fold long macro lines.
|
||||
|
||||
|
|
|
@ -181,7 +181,7 @@ miniruby$(EXEEXT):
|
|||
$(PROGRAM):
|
||||
@$(RM) $@
|
||||
$(ECHO) linking $@
|
||||
$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(ENCOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
|
||||
$(Q) $(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) $(EXTLIBS) $(OUTFLAG)$@
|
||||
$(Q) $(POSTLINK)
|
||||
|
||||
# We must `rm' the library each time this rule is invoked because "updating" a
|
||||
|
|
|
@ -32,6 +32,7 @@ ID_H_TARGET = -id.h-
|
|||
DMYEXT = dmyext.$(OBJEXT)
|
||||
NORMALMAINOBJ = main.$(OBJEXT)
|
||||
MAINOBJ = $(NORMALMAINOBJ)
|
||||
EXTOBJS =
|
||||
DLDOBJS = $(DMYEXT)
|
||||
MINIOBJS = $(ARCHMINIOBJS) dmyencoding.$(OBJEXT) dmyversion.$(OBJEXT) miniprelude.$(OBJEXT)
|
||||
ENC_MK = enc.mk
|
||||
|
@ -173,7 +174,7 @@ $(EXTS_MK): $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY)
|
|||
configure-ext: $(EXTS_MK)
|
||||
|
||||
build-ext: $(EXTS_MK)
|
||||
$(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC)
|
||||
$(Q)$(MAKE) -f $(EXTS_MK) $(MFLAGS) $(EXTSTATIC) LIBRUBY_EXTS=$(LIBRUBY_EXTS) ENCOBJS="$(ENCOBJS)"
|
||||
|
||||
$(MKMAIN_CMD): $(MKFILES) incs $(PREP) $(RBCONFIG) $(LIBRUBY)
|
||||
$(Q)$(MINIRUBY) $(srcdir)/ext/extmk.rb --make="$(MAKE)" --command-output=$@ $(EXTMK_ARGS)
|
||||
|
@ -206,7 +207,7 @@ Doxyfile: $(srcdir)/template/Doxyfile.tmpl $(PREP) $(srcdir)/tool/generic_erb.rb
|
|||
program: showflags $(PROGRAM)
|
||||
wprogram: showflags $(WPROGRAM)
|
||||
|
||||
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(ENCOBJS) $(SETUP) $(PREP)
|
||||
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(OBJS) $(EXTOBJS) $(SETUP) $(PREP)
|
||||
|
||||
$(LIBRUBY_A): $(OBJS) $(MAINOBJ) $(DMYEXT) $(ARCHFILE)
|
||||
|
||||
|
|
12
ext/extmk.rb
12
ext/extmk.rb
|
@ -654,16 +654,22 @@ if $configure_only and $command_output
|
|||
end
|
||||
mf.puts
|
||||
mf.puts "all: #{rubies.join(' ')}"
|
||||
mf.puts "static: ext/extinit.#{$OBJEXT} #{rubies.join(' ')}"
|
||||
mf.puts "static: #{rubies.join(' ')}"
|
||||
mf.puts "clean:\n\t-$(Q)$(RM) ext/extinit.#{$OBJEXT}"
|
||||
mf.puts "distclean:\n\t-$(Q)$(RM) ext/extinit.c"
|
||||
mf.puts
|
||||
mf.puts "#{rubies.join(' ')}: $(extensions:/.=/#{$force_static ? 'static' : 'all'})"
|
||||
rubies.each do |tgt|
|
||||
mf.print "#{tgt}:\n\t$(Q)$(MAKE) "
|
||||
mf.puts '$(MFLAGS) EXTOBJS="$(EXTOBJS)" EXTLIBS="$(EXTLIBS)" EXTLDFLAGS="$(EXTLDFLAGS)" $@'
|
||||
mf.print "$(MFLAGS) "
|
||||
if enable_config("shared", $enable_shared)
|
||||
mf.print %[DLDOBJS="$(EXTOBJS)" SOLIBS="$(ENCOBJS) $(EXTLIBS)" ]
|
||||
mf.print 'LIBRUBY_SO_UPDATE=$(LIBRUBY_EXTS) '
|
||||
else
|
||||
mf.print %[EXTOBJS="$(EXTOBJS)" EXTLIBS="$(EXTLIBS)" ]
|
||||
end
|
||||
mf.puts 'EXTLDFLAGS="$(EXTLDFLAGS)" $@'
|
||||
end
|
||||
mf.puts "ext/extinit.#{$OBJEXT}:\n\t$(Q)$(MAKE) $(MFLAGS) V=$(V) $@"
|
||||
mf.puts
|
||||
exec = config_string("exec") {|str| str + " "}
|
||||
targets.each do |tgt|
|
||||
|
|
Загрузка…
Ссылка в новой задаче