From 6996cdd8d7d36b72d4c1ee30a11969d164ed85e2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 26 Apr 2010 15:49:01 -0700 Subject: Rakefile: hopefully fix optional rake-compiler support --- Rakefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index f2ab994..598852e 100644 --- a/Rakefile +++ b/Rakefile @@ -175,16 +175,17 @@ end # optional rake-compiler support in case somebody needs to cross compile begin - spec = Gem::Specification.load('unicorn.gemspec') - require 'rake/extensiontask' - unless test ?r, "ext/unicorn_http/unicorn_http.c" - abort "run 'gmake ragel' or 'make ragel' to generate the Ragel source" - end mk = "ext/unicorn_http/Makefile" if test ?r, mk - abort "run 'gmake -C ext/unicorn_http clean' and " \ - "remove #{mk} before using rake-compiler" + warn "run 'gmake -C ext/unicorn_http clean' and\n" \ + "remove #{mk} before using rake-compiler" + else + unless test ?r, "ext/unicorn_http/unicorn_http.c" + abort "run 'gmake ragel' or 'make ragel' to generate the Ragel source" + end + spec = Gem::Specification.load('unicorn.gemspec') + require 'rake/extensiontask' + Rake::ExtensionTask.new('unicorn_http', spec) end - Rake::ExtensionTask.new('unicorn_http', spec) rescue LoadError end -- cgit v1.2.3-24-ge0c7