t/lib.perl: fix Perl integration tests w/o installation
[unicorn.git] / Rakefile
blobfe1588bee7e53b1bdbfe8cf3644023117894fdd3
1 # frozen_string_literal: false
2 # optional rake-compiler support in case somebody needs to cross compile
3 begin
4   mk = "ext/unicorn_http/Makefile"
5   if File.readable?(mk)
6     warn "run 'gmake -C ext/unicorn_http clean' and\n" \
7          "remove #{mk} before using rake-compiler"
8   elsif ENV['VERSION']
9     unless File.readable?("ext/unicorn_http/unicorn_http.c")
10       abort "run 'gmake ragel' or 'make ragel' to generate the Ragel source"
11     end
12     spec = Gem::Specification.load('unicorn.gemspec')
13     require 'rake/extensiontask'
14     Rake::ExtensionTask.new('unicorn_http', spec)
15   end
16 rescue LoadError
17 end