Removed need for gcc as a dependency for debian packages.

This commit is contained in:
Patrick J Cherry
2012-01-24 15:59:30 +00:00
parent f0775b2a9e
commit 888f9f5156
5 changed files with 47 additions and 7 deletions

View File

@@ -7,6 +7,28 @@ Rake::TestTask.new do |t|
t.test_files = FileList["test/**/t_*.rb"]
end
task :gem do
desc "Create the size_t size macro for c_struct"
file 'lib/linux/c_struct_sizeof_size_t.rb' do |t|
begin
sz = Integer(`echo __SIZEOF_SIZE_T__ | /usr/bin/gcc -E -P -`)
File.open(t.name, 'w+') do |fh|
fh.puts "module Linux ; class CStruct ; SIZEOF_SIZE_T = #{sz} ; end ; end"
end
rescue
rm_f t.name
end
end
desc "Package a gem"
task :gem do
#
# FIXME. If using a gem, fall back on GCC to determine sizeof size_t.
#
rm_f "lib/linux/c_struct_sizeof_size_t.rb"
sh "gem build netlinkrb.gemspec"
end
desc "clean up"
task :clean do
rm_f "lib/linux/c_struct_sizeof_size_t.rb"
end