From 65c051d3254f6a7318cbb1ffc319b6ad5eef2f8c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Nov 2009 14:29:56 -0800 Subject: Add rake-compiler support for cross compiles --- Rakefile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Rakefile') diff --git a/Rakefile b/Rakefile index 67534f2..79d95e9 100644 --- a/Rakefile +++ b/Rakefile @@ -143,3 +143,20 @@ task :raa_update do p res puts res.body end + +# optional rake-compiler support in case somebody needs to cross compile +begin + require 'rubygems' + 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" + end + Rake::ExtensionTask.new('unicorn_http', spec) +rescue LoadError +end -- cgit v1.2.3-24-ge0c7