summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/digest/md5/extconf.rb2
-rw-r--r--ext/digest/rmd160/extconf.rb2
-rw-r--r--ext/digest/sha1/extconf.rb2
-rw-r--r--ext/digest/sha2/extconf.rb2
-rw-r--r--ext/extmk.rb22
5 files changed, 23 insertions, 7 deletions
diff --git a/ext/digest/md5/extconf.rb b/ext/digest/md5/extconf.rb
index 0db0404dbeb..4ab7b401c6b 100644
--- a/ext/digest/md5/extconf.rb
+++ b/ext/digest/md5/extconf.rb
@@ -24,4 +24,6 @@ have_header("inttypes.h")
have_header("unistd.h")
+$preload = %w[digest]
+
create_makefile("digest/md5")
diff --git a/ext/digest/rmd160/extconf.rb b/ext/digest/rmd160/extconf.rb
index 3f6a88e7567..e6edf5ac64f 100644
--- a/ext/digest/rmd160/extconf.rb
+++ b/ext/digest/rmd160/extconf.rb
@@ -23,4 +23,6 @@ have_header("inttypes.h")
have_header("unistd.h")
+$preload = %w[digest]
+
create_makefile("digest/rmd160")
diff --git a/ext/digest/sha1/extconf.rb b/ext/digest/sha1/extconf.rb
index c249a415ed5..4d8ba64c394 100644
--- a/ext/digest/sha1/extconf.rb
+++ b/ext/digest/sha1/extconf.rb
@@ -22,4 +22,6 @@ have_header("inttypes.h")
have_header("unistd.h")
+$preload = %w[digest]
+
create_makefile("digest/sha1")
diff --git a/ext/digest/sha2/extconf.rb b/ext/digest/sha2/extconf.rb
index c982aa64de2..53698a7bcb8 100644
--- a/ext/digest/sha2/extconf.rb
+++ b/ext/digest/sha2/extconf.rb
@@ -17,6 +17,8 @@ have_header("inttypes.h")
have_header("unistd.h")
+$preload = %w[digest]
+
if try_cpp(<<SRC, $defs.join(' '))
#include "defs.h"
#ifdef NO_UINT64_T
diff --git a/ext/extmk.rb b/ext/extmk.rb
index 4f2ab88ec5e..21d82ff32b1 100644
--- a/ext/extmk.rb
+++ b/ext/extmk.rb
@@ -205,7 +205,7 @@ for dir in ["ext", File::join($top_srcdir, "ext")]
next
end
target = target.downcase if /mswin32|bccwin32/ =~ RUBY_PLATFORM
- $static_ext[target] = true
+ $static_ext[target] = $static_ext.size
end
MTIMES << f.mtime
$setup = setup
@@ -218,10 +218,15 @@ FileUtils::makedirs('ext')
Dir::chdir('ext')
ext_prefix = "#{$top_srcdir}/ext"
+$static_ext.sort_by {|t, i| i}.each do |t, i|
+ next unless File.exist?("#{ext_prefix}/#{t}/MANIFEST")
+ extmake(t) or abort
+end
Dir.glob("#{ext_prefix}/*/**/MANIFEST") do |d|
d = File.dirname(d)
d.slice!(0, ext_prefix.length + 1)
- extmake(d) or exit(1)
+ next if $static_ext[d]
+ extmake(d) or abort
end
if $ignore
@@ -233,11 +238,14 @@ if $extlist.size > 0
$extinit ||= ""
$extobjs ||= ""
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
+ while e = list.shift
+ s,t,i,r = e
+ if r
+ l = list.size
+ if (while l > 0; break true if r.include?(list[l-=1][1]) end)
+ list.insert(l + 1, e)
+ next
+ end
end
f = format("%s/%s.%s", s, i, $LIBEXT)
if File.exist?(f)