From b6c89a84152dc6accca9c8943be13c4997f36516 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fran=C3=A7ois=20Beausoleil?= Date: Wed, 2 Apr 2008 13:54:02 -0400 Subject: [PATCH] New build:checkdeps task to tell the developer which dependencies are missing before attempting build. --- Rakefile | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/Rakefile b/Rakefile index bdf4b4b..7288b2b 100644 --- a/Rakefile +++ b/Rakefile @@ -82,6 +82,7 @@ AllPreCompiled << "runtime/loader.rbc" namespace :build do task :all => %w[ + build:checkdeps build:shotgun build:platform build:rbc @@ -125,6 +126,23 @@ namespace :build do sh make('vm') end + desc "Checks that you have all required dependencies" + task :checkdeps do + puts "Checking build dependencies..." + missing_dependencies = [] + %w(bison git ruby gem pkg-config make).each do |dependency| + sh dependency + " --version >/dev/null" rescue nil + missing_dependencies << dependency if $?.exitstatus == 127 + end + + unless missing_dependencies.empty? then + puts "\nYou are missing these required dependencies (which might have dependencies of their own):" + puts missing_dependencies.map {|dep| " * #{dep}"}.join("\n") + puts + exit 1 + end + end + desc "Compiles shotgun (the C-code VM)" task :shotgun => %w[configure shotgun/rubinius.bin shotgun/rubinius.local.bin] -- 1.5.3.6