Class: Inliner::Compilers::GCC
Instance Attribute Summary
Attributes inherited from Compiler
#progname
Instance Method Summary
collapse
Methods inherited from Compiler
check_and_create, #compile, #initialize
Instance Method Details
#cmd ⇒ Object
95
96
97
|
# File 'lib/ffi-inliner/inliner.rb', line 95
def cmd
"#{ldshared} #{libs} -o \"#{@fm.so_fn}\" \"#{@fm.c_fn}\" 2>\"#{@fm.log_fn}\""
end
|
#exists? ⇒ Boolean
85
86
87
|
# File 'lib/ffi-inliner/inliner.rb', line 85
def exists?
IO.popen("#{@progname} 2>&1") { |f| f.gets } ? true : false
end
|
#ldshared ⇒ Object
88
89
90
91
92
93
94
|
# File 'lib/ffi-inliner/inliner.rb', line 88
def ldshared
if Config::CONFIG['target_os'] =~ /darwin/
'gcc -dynamic -bundle -fPIC'
else
'gcc -shared -fPIC'
end
end
|