зеркало из https://github.com/github/ruby.git
* Makefile.in: static link libraries to LIBRUBY_SO with static linked
ext. [ruby-dev:21157] * ext/extmk.rb (extmake): sort extension library initialization order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4372 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
8eb6b7328e
Коммит
fd36ed94f3
|
@ -1,3 +1,10 @@
|
||||||
|
Tue Aug 12 11:12:42 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* Makefile.in: static link libraries to LIBRUBY_SO with static linked
|
||||||
|
ext. [ruby-dev:21157]
|
||||||
|
|
||||||
|
* ext/extmk.rb (extmake): sort extension library initialization order.
|
||||||
|
|
||||||
Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
|
* eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
|
||||||
|
|
19
Makefile.in
19
Makefile.in
|
@ -30,7 +30,7 @@ EXTLIBS =
|
||||||
LIBS = @LIBS@ $(EXTLIBS)
|
LIBS = @LIBS@ $(EXTLIBS)
|
||||||
MISSING = @LIBOBJS@ @ALLOCA@
|
MISSING = @LIBOBJS@ @ALLOCA@
|
||||||
LDSHARED = @LIBRUBY_LDSHARED@
|
LDSHARED = @LIBRUBY_LDSHARED@
|
||||||
DLDFLAGS = @LIBRUBY_DLDFLAGS@
|
DLDFLAGS = @LIBRUBY_DLDFLAGS@ $(EXTLDFLAGS)
|
||||||
SOLIBS = @SOLIBS@
|
SOLIBS = @SOLIBS@
|
||||||
MAINLIBS = @MAINLIBS@
|
MAINLIBS = @MAINLIBS@
|
||||||
|
|
||||||
|
@ -57,8 +57,11 @@ LIBRUBYARG_SHARED = @LIBRUBYARG_SHARED@
|
||||||
|
|
||||||
PREP = @PREP@ @ARCHFILE@
|
PREP = @PREP@ @ARCHFILE@
|
||||||
SETUP =
|
SETUP =
|
||||||
|
EXTSTATIC = @EXTSTATIC@
|
||||||
|
|
||||||
EXTOBJS =
|
EXTOBJS =
|
||||||
|
DLDOBJS = $(DMYEXT)
|
||||||
|
DMYEXT = dmyext.@OBJEXT@
|
||||||
|
|
||||||
MAINOBJ = main.@OBJEXT@
|
MAINOBJ = main.@OBJEXT@
|
||||||
|
|
||||||
|
@ -108,22 +111,22 @@ SCRIPT_ARGS = --dest-dir="$(DESTDIR)" \
|
||||||
--make-flags="$(MAKEFLAGS)"
|
--make-flags="$(MAKEFLAGS)"
|
||||||
|
|
||||||
all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
|
all: @MAKEFILES@ miniruby$(EXEEXT) rbconfig.rb $(LIBRUBY)
|
||||||
@$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="@EXTSTATIC@" $(SCRIPT_ARGS)
|
@$(MINIRUBY) $(srcdir)/ext/extmk.rb --extstatic="$(EXTSTATIC)" $(SCRIPT_ARGS)
|
||||||
|
|
||||||
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) dmyext.@OBJEXT@
|
miniruby$(EXEEXT): config.status $(LIBRUBY_A) $(MAINOBJ) $(DMYEXT)
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) dmyext.@OBJEXT@ $(LIBRUBY_A) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(MAINOBJ) $(DMYEXT) $(LIBRUBY_A) $(LIBS) -o $@
|
||||||
|
|
||||||
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT)
|
$(PROGRAM): $(LIBRUBY) $(MAINOBJ) $(EXTOBJS) $(SETUP) miniruby$(EXEEXT)
|
||||||
@rm -f $@
|
@rm -f $@
|
||||||
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
$(PURIFY) $(CC) $(LDFLAGS) $(XLDFLAGS) $(MAINLIBS) $(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
|
||||||
|
|
||||||
$(LIBRUBY_A): $(OBJS) dmyext.@OBJEXT@
|
$(LIBRUBY_A): $(OBJS) $(DMYEXT)
|
||||||
@AR@ rcu $@ $(OBJS) dmyext.@OBJEXT@
|
@AR@ rcu $@ $(OBJS) $(DMYEXT)
|
||||||
@-@RANLIB@ $@ 2> /dev/null || true
|
@-@RANLIB@ $@ 2> /dev/null || true
|
||||||
|
|
||||||
$(LIBRUBY_SO): $(OBJS) dmyext.@OBJEXT@ miniruby$(EXEEXT) $(PREP)
|
$(LIBRUBY_SO): $(OBJS) $(DLDOBJS) miniruby$(EXEEXT) $(PREP)
|
||||||
$(LDSHARED) $(DLDFLAGS) $(OBJS) dmyext.@OBJEXT@ $(SOLIBS) -o $@
|
$(LDSHARED) $(DLDFLAGS) $(OBJS) $(DLDOBJS) $(SOLIBS) -o $@
|
||||||
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
|
@-$(MINIRUBY) -e 'ARGV.each{|link| File.delete link if File.exist? link; \
|
||||||
File.symlink "$(LIBRUBY_SO)", link}' \
|
File.symlink "$(LIBRUBY_SO)", link}' \
|
||||||
$(LIBRUBY_ALIASES) || true
|
$(LIBRUBY_ALIASES) || true
|
||||||
|
|
13
ext/extmk.rb
13
ext/extmk.rb
|
@ -60,6 +60,7 @@ def extmake(target)
|
||||||
$target = target
|
$target = target
|
||||||
$mdir = target
|
$mdir = target
|
||||||
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
$srcdir = File.join($top_srcdir, "ext", $mdir)
|
||||||
|
$preload = nil
|
||||||
unless $ignore
|
unless $ignore
|
||||||
if $static ||
|
if $static ||
|
||||||
!(t = modified?("./Makefile", MTIMES)) ||
|
!(t = modified?("./Makefile", MTIMES)) ||
|
||||||
|
@ -88,7 +89,7 @@ def extmake(target)
|
||||||
end
|
end
|
||||||
if File.exist?("./Makefile")
|
if File.exist?("./Makefile")
|
||||||
if $static
|
if $static
|
||||||
$extlist.push [$static, $target, File.basename($target)]
|
$extlist.push [$static, $target, File.basename($target), $preload]
|
||||||
end
|
end
|
||||||
unless system($make, *sysquote($mflags))
|
unless system($make, *sysquote($mflags))
|
||||||
$ignore or $continue or return false
|
$ignore or $continue or return false
|
||||||
|
@ -228,7 +229,13 @@ end
|
||||||
if $extlist.size > 0
|
if $extlist.size > 0
|
||||||
$extinit ||= ""
|
$extinit ||= ""
|
||||||
$extobjs ||= ""
|
$extobjs ||= ""
|
||||||
for s,t,i in $extlist
|
list = $extlist.dup
|
||||||
|
until list.empty?
|
||||||
|
s,t,i,r = list.shift
|
||||||
|
if r and list.any? {|l| r.include?(l[1])}
|
||||||
|
list << [s,t,i]
|
||||||
|
next
|
||||||
|
end
|
||||||
f = format("%s/%s.%s", s, i, $LIBEXT)
|
f = format("%s/%s.%s", s, i, $LIBEXT)
|
||||||
if File.exist?(f)
|
if File.exist?(f)
|
||||||
$extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n"
|
$extinit += "\tinit(Init_#{i}, \"#{t}.so\");\n"
|
||||||
|
@ -252,7 +259,7 @@ SRC
|
||||||
$extpath.delete("$(topdir)")
|
$extpath.delete("$(topdir)")
|
||||||
$extflags = libpathflag($extpath) << " " << $extflags.strip
|
$extflags = libpathflag($extpath) << " " << $extflags.strip
|
||||||
conf = [
|
conf = [
|
||||||
['SETUP', $setup], ['EXTOBJS', $extobjs],
|
['SETUP', $setup], [$enable_shared ? 'DLDOBJS' : 'EXTOBJS', $extobjs],
|
||||||
['EXTLIBS', $extlibs], ['EXTLDFLAGS', $extflags]
|
['EXTLIBS', $extlibs], ['EXTLDFLAGS', $extflags]
|
||||||
].map {|n, v|
|
].map {|n, v|
|
||||||
"#{n}=#{v}" if v and !(v = v.strip).empty?
|
"#{n}=#{v}" if v and !(v = v.strip).empty?
|
||||||
|
|
Загрузка…
Ссылка в новой задаче