summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/deps/mruby-file-stat/mrbgem.rake
blob: ff7d076b8bc7bb391d59a6bc47a780d418928892 (plain)
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
MRuby::Gem::Specification.new('mruby-file-stat') do |spec|
  spec.license = 'MIT'
  spec.author  = 'ksss <co000ri@gmail.com>'
  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
        system env, "#{dir}/configure"
      end
    end
  end
  file "#{dir}/src/file-stat.c" => config
  task :clean do
    FileUtils.rm_f config, :verbose => true
  end

  cc.include_paths << build_dir
end