diff options
Diffstat (limited to 'extra/makerake.rb')
-rw-r--r-- | extra/makerake.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/extra/makerake.rb b/extra/makerake.rb new file mode 100644 index 0000000..5d24faa --- /dev/null +++ b/extra/makerake.rb @@ -0,0 +1,40 @@ +#!/usr/bin/ruby -w +# See the LICENSE file for copyright and distribution information + +require "rubygems" +require "mkrf" +require 'optparse' + +options = {} + +def crash( ) + print <<EOL +need libivy (see http://www.tls.cena.fr/products/ivy/index.html) + + Install the library or try one of the following options to makerake.rb: + + -L /path/to/libivy/lib + -H /path/to/libivy/include +EOL + exit 1 +end + +OptionParser.new do |opts| + opts.banner = "Usage: makerake.rb [options]" + + opts.on("-L", "--libraries [PATH]", String, "Path to the libivy") do |v| + options[:libivy] = v + end + + opts.on("-H", "--headers [PATH]", String, "Path to the Ivy headers") do |v| + options[:headerivy] = v + end +end.parse! + +Mkrf::Generator.new('ivy', '*.c') do |g| + g.include_library('ivy','IvySendMsg', [options[:libivy]]) or crash + + ["ivyloop.h", "ivysocket.h", "ivychannel.h", "ivybind.h", "ivy.h", "timer.h"].each do |header_file| + g.include_header( header_file, [options[:headerivy]] ) or crash + end +end
\ No newline at end of file |