From 3d6b48f77c7219eb6431f5cb77f6c5ea29a28ba1 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Fran=C3=A7ois=20Beausoleil?= Date: Wed, 2 Apr 2008 16:04:59 -0400 Subject: [PATCH] New build:checkdeps task to tell the developer which dependencies are missing before attempting build or installation. This returns a message like the following when a missing dependency is found: $ rake install (in /home/francois/src/rubinius) Checking build dependencies... bison --version >/dev/null git --version >/dev/null ruby --version >/dev/null gem --version >/dev/null pkg-config --version >/dev/null make --version >/dev/null libtool --version >/dev/null sh: libtool: not found You are missing one or more required dependencies (which might have dependencies of their own): * libtool This is very useful for new developers, as missing dependencies can be immediately corrected, instead of having cryptic error messages later in the build process. --- Rakefile | 20 +++++++++++++++++++- 1 files changed, 19 insertions(+), 1 deletions(-) diff --git a/Rakefile b/Rakefile index bdf4b4b..085d724 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 libtool).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 one or more 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] @@ -167,7 +185,7 @@ end # INSTALL TASKS desc "Install rubinius as rbx" -task :install => :config_env do +task :install => %w[build:checkdeps config_env] do sh "cd shotgun; #{make "install"}" mkdir_p RBAPATH, :verbose => true -- 1.5.3.6