Skip to content

Commit

Permalink
Fixed building C exts that use extconf.rb.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ford committed Sep 1, 2010
1 parent 7d66440 commit f5a5246
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion lib/ext/dl/extconf.h

This file was deleted.

21 changes: 11 additions & 10 deletions rakelib/extensions.rake
Expand Up @@ -25,14 +25,14 @@ def rbx_build
rbx = File.expand_path "../bin/rbx-build", File.dirname(__FILE__) rbx = File.expand_path "../bin/rbx-build", File.dirname(__FILE__)
end end


def build_extconf(name, ignore_fail) def build_extconf(name, opts)
if ignore_fail if opts[:ignore_fail]
fail_block = lambda { |ok, status| } fail_block = lambda { |ok, status| }
else else
fail_block = nil fail_block = nil
end end


redirect = $verbose || !ignore_fail ? "" : "> /dev/null 2>&1" redirect = $verbose || !opts[:ignore_fail] ? "" : "> /dev/null 2>&1"


puts "Building #{name}" puts "Building #{name}"


Expand All @@ -42,7 +42,8 @@ def build_extconf(name, ignore_fail)
ENV["CFLAGS"] = "-Ivm/capi/include" ENV["CFLAGS"] = "-Ivm/capi/include"
end end


unless File.exists?("Makefile") and File.exists?("extconf.h") unless opts[:deps] and opts[:deps].all? { |n| File.exists? n }
# unless File.exists?("Makefile") and File.exists?("extconf.h")
sh("#{rbx_build} extconf.rb #{redirect}", &fail_block) sh("#{rbx_build} extconf.rb #{redirect}", &fail_block)
end end


Expand Down Expand Up @@ -72,7 +73,7 @@ def compile_ext(name, opts={})
if File.exists? "Rakefile" if File.exists? "Rakefile"
sh "#{BUILD_CONFIG[:build_ruby]} -S rake #{'-t' if $verbose} -r #{ext_helper} -r #{dep_grapher} #{ext_task_name}" sh "#{BUILD_CONFIG[:build_ruby]} -S rake #{'-t' if $verbose} -r #{ext_helper} -r #{dep_grapher} #{ext_task_name}"
else else
build_extconf name, opts[:ignore_fail] build_extconf name, opts
end end
end end
end end
Expand All @@ -98,8 +99,8 @@ compile_ext "nkf"


# rbx must be able to run to build these because they use # rbx must be able to run to build these because they use
# extconf.rb, so they must be after melbourne for Rubinius. # extconf.rb, so they must be after melbourne for Rubinius.
compile_ext "openssl" compile_ext "openssl", :deps => ["Makefile", "extconf.h"]
compile_ext "dl" compile_ext "dl", :deps => ["Makefile", "dlconfig.h"]
compile_ext "dbm", :ignore_fail => true compile_ext "dbm", :ignore_fail => true, :deps => ["Makefile"]
compile_ext "gdbm", :ignore_fail => true compile_ext "gdbm", :ignore_fail => true, :deps => ["Makefile"]
compile_ext "sdbm" compile_ext "sdbm", :deps => ["Makefile"]

0 comments on commit f5a5246

Please sign in to comment.