extmk.rb: always dynamic non-install extensions
* ext/extmk.rb (extmake): extensions not to be installed should not make static libraries, but make dynamic libraries always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40537 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
84c8319c8d
commit
262669e6c6
@ -1,3 +1,8 @@
|
|||||||
|
Wed May 1 16:17:46 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/extmk.rb (extmake): extensions not to be installed should not
|
||||||
|
make static libraries, but make dynamic libraries always.
|
||||||
|
|
||||||
Wed May 1 12:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
Wed May 1 12:20:00 2013 Zachary Scott <zachary@zacharyscott.net>
|
||||||
|
|
||||||
* lib/rake/version.rb: Fix RDoc warning with :include: [Bug #8347]
|
* lib/rake/version.rb: Fix RDoc warning with :include: [Bug #8347]
|
||||||
|
14
ext/extmk.rb
14
ext/extmk.rb
@ -144,6 +144,8 @@ def extmake(target)
|
|||||||
$srcs = []
|
$srcs = []
|
||||||
$compiled[target] = false
|
$compiled[target] = false
|
||||||
makefile = "./Makefile"
|
makefile = "./Makefile"
|
||||||
|
static = $static
|
||||||
|
$static = nil if noinstall = File.fnmatch?("-*", target)
|
||||||
ok = File.exist?(makefile)
|
ok = File.exist?(makefile)
|
||||||
unless $ignore
|
unless $ignore
|
||||||
rbconfig0 = RbConfig::CONFIG
|
rbconfig0 = RbConfig::CONFIG
|
||||||
@ -216,7 +218,14 @@ def extmake(target)
|
|||||||
end
|
end
|
||||||
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
|
ok &&= File.open(makefile){|f| !f.gets[DUMMY_SIGNATURE]}
|
||||||
ok = yield(ok) if block_given?
|
ok = yield(ok) if block_given?
|
||||||
unless ok
|
if ok
|
||||||
|
open(makefile, "r+") do |f|
|
||||||
|
s = f.read.sub!(/^(static:)\s.*/, '\1 all')
|
||||||
|
f.rewind
|
||||||
|
f.print(s)
|
||||||
|
f.truncate(f.pos)
|
||||||
|
end
|
||||||
|
else
|
||||||
open(makefile, "w") do |f|
|
open(makefile, "w") do |f|
|
||||||
f.puts "# " + DUMMY_SIGNATURE
|
f.puts "# " + DUMMY_SIGNATURE
|
||||||
f.print(*dummy_makefile(CONFIG["srcdir"]))
|
f.print(*dummy_makefile(CONFIG["srcdir"]))
|
||||||
@ -236,7 +245,7 @@ def extmake(target)
|
|||||||
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
|
unless $destdir.to_s.empty? or $mflags.defined?("DESTDIR")
|
||||||
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
|
args += [sysquote("DESTDIR=" + relative_from($destdir, "../"+prefix))]
|
||||||
end
|
end
|
||||||
if $static and ok and !$objs.empty? and !File.fnmatch?("-*", target)
|
if $static and ok and !$objs.empty? and !noinstall
|
||||||
args += ["static"] unless $clean
|
args += ["static"] unless $clean
|
||||||
$extlist.push [$static, target, $target, $preload]
|
$extlist.push [$static, target, $target, $preload]
|
||||||
end
|
end
|
||||||
@ -279,6 +288,7 @@ def extmake(target)
|
|||||||
$top_srcdir = top_srcdir
|
$top_srcdir = top_srcdir
|
||||||
$topdir = topdir
|
$topdir = topdir
|
||||||
$hdrdir = hdrdir
|
$hdrdir = hdrdir
|
||||||
|
$static = static
|
||||||
Dir.chdir dir
|
Dir.chdir dir
|
||||||
end
|
end
|
||||||
begin
|
begin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user