summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Terceiro <terceiro@softwarelivre.org>2011-12-25 21:51:18 -0200
committerAntonio Terceiro <terceiro@softwarelivre.org>2012-02-06 21:00:22 -0200
commit70ca2f4fdd328275375838b488dbe354173ce2f3 (patch)
tree518d2071d0bec3e05cc14f2ea079b83effad3bf3
parentdd3da66f3de01e668877c181c019d1199f7d8afb (diff)
downloadffi-70ca2f4fdd328275375838b488dbe354173ce2f3.tar.gz
Add :remote option to FFI:TypesGenerator#generate
This is useful for porting to other architecture for which you don't have ruby installed.
-rw-r--r--lib/ffi/tools/types_generator.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/ffi/tools/types_generator.rb b/lib/ffi/tools/types_generator.rb
index 28f19f4..c1afc12 100644
--- a/lib/ffi/tools/types_generator.rb
+++ b/lib/ffi/tools/types_generator.rb
@@ -51,7 +51,12 @@ module FFI
C
io.close
- typedefs = `gcc -E -x c #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c #{io.path}`
+ cmd = "gcc -E -x c #{options[:cppflags]} -D_DARWIN_USE_64_BIT_INODE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -c"
+ if options[:remote]
+ typedefs = `ssh #{options[:remote]} #{cmd} - < #{io.path}`
+ else
+ typedefs = `#{cmd} #{io.path}`
+ end
end
code = ""