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
99
100
101
102
103
104
105
|
# File 'lib/ffi-inliner/inliner.rb', line 99
def cmd
if Config::CONFIG['target_os'] =~ /mswin|mingw/
"sh -c ' #{ldshared} -o \"#{@fm.so_fn}\" \"#{@fm.c_fn}\" #{libs}' 2>\"#{@fm.log_fn}\""
else
"#{ldshared} #{libs} -o \"#{@fm.so_fn}\" \"#{@fm.c_fn}\" #{after_libs} 2>\"#{@fm.log_fn}\""
end
end
|
#exists? ⇒ Boolean
87
88
89
|
# File 'lib/ffi-inliner/inliner.rb', line 87
def exists?
IO.popen("#{@progname} 2>&1") { |f| f.gets } ? true : false
end
|
#ldshared ⇒ Object
91
92
93
94
95
96
97
|
# File 'lib/ffi-inliner/inliner.rb', line 91
def ldshared
if Config::CONFIG['target_os'] =~ /darwin/
'gcc -dynamic -bundle -fPIC'
else
'gcc -shared -fPIC'
end
end
|