-
Notifications
You must be signed in to change notification settings - Fork 10
/
mrbgem.rake
39 lines (34 loc) · 1.07 KB
/
mrbgem.rake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
MRuby::Gem::Specification.new('mruby-file-stat') do |spec|
spec.license = 'MIT'
spec.author = 'ksss <[email protected]>'
spec.add_dependency('mruby-time')
env = {
'CC' => "#{build.cc.command} #{build.cc.flags.join(' ')}",
'CXX' => "#{build.cxx.command} #{build.cxx.flags.join(' ')}",
'LD' => "#{build.linker.command} #{build.linker.flags.join(' ')}",
'AR' => build.archiver.command
}
config = "#{build_dir}/config.h"
file config do
FileUtils.mkdir_p build_dir, :verbose => true
Dir.chdir build_dir do
if ENV['OS'] == 'Windows_NT'
_pp 'on Windows', dir
FileUtils.touch "#{build_dir}/config.h", :verbose => true
else
_pp './configure', dir
host = ''
if build.kind_of?(MRuby::CrossBuild) && build.host_target
host = "--host #{build.host_target}"
end
system env, "#{dir}/configure #{host}"
end
end
end
# build hook
file "#{dir}/src/file-stat.c" => config
task :clean do
FileUtils.rm_f config, :verbose => true
end
cc.include_paths << build_dir
end