diff options
-rwxr-xr-x | examples/test.sh | 2 | ||||
-rw-r--r-- | makerake.rb | 37 |
2 files changed, 38 insertions, 1 deletions
diff --git a/examples/test.sh b/examples/test.sh index 1dc1cf4..57da1a2 100755 --- a/examples/test.sh +++ b/examples/test.sh @@ -1,3 +1,3 @@ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/opt/rosx/lib -ruby 001-Bind.rb +ruby $1 diff --git a/makerake.rb b/makerake.rb new file mode 100644 index 0000000..92f79bb --- /dev/null +++ b/makerake.rb @@ -0,0 +1,37 @@ +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 |