summaryrefslogtreecommitdiffstats
path: root/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 02:57:58 +0000
commitbe1c7e50e1e8809ea56f2c9d472eccd8ffd73a97 (patch)
tree9754ff1ca740f6346cf8483ec915d4054bc5da2d /web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake
parentInitial commit. (diff)
downloadnetdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.tar.xz
netdata-be1c7e50e1e8809ea56f2c9d472eccd8ffd73a97.zip
Adding upstream version 1.44.3.upstream/1.44.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake40
1 files changed, 40 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake
new file mode 100644
index 00000000..3bf6d6ae
--- /dev/null
+++ b/web/server/h2o/libh2o/deps/mruby/mrbgems/mruby-compiler/mrbgem.rake
@@ -0,0 +1,40 @@
+MRuby::Gem::Specification.new 'mruby-compiler' do |spec|
+ spec.license = 'MIT'
+ spec.author = 'mruby developers'
+ spec.summary = 'mruby compiler library'
+
+ current_dir = spec.dir
+ current_build_dir = spec.build_dir
+
+ lex_def = "#{current_dir}/core/lex.def"
+ core_objs = Dir.glob("#{current_dir}/core/*.c").map { |f|
+ next nil if build.cxx_exception_enabled? and f =~ /(codegen).c$/
+ objfile(f.pathmap("#{current_build_dir}/core/%n"))
+ }.compact
+
+ if build.cxx_exception_enabled?
+ core_objs <<
+ build.compile_as_cxx("#{current_build_dir}/core/y.tab.c", "#{current_build_dir}/core/y.tab.cxx",
+ objfile("#{current_build_dir}/y.tab"), ["#{current_dir}/core"]) <<
+ build.compile_as_cxx("#{current_dir}/core/codegen.c", "#{current_build_dir}/core/codegen.cxx")
+ else
+ core_objs << objfile("#{current_build_dir}/core/y.tab")
+ file objfile("#{current_build_dir}/core/y.tab") => "#{current_build_dir}/core/y.tab.c" do |t|
+ cc.run t.name, t.prerequisites.first, [], ["#{current_dir}/core"]
+ end
+ end
+ file objfile("#{current_build_dir}/core/y.tab") => lex_def
+
+ # Parser
+ file "#{current_build_dir}/core/y.tab.c" => ["#{current_dir}/core/parse.y"] do |t|
+ yacc.run t.name, t.prerequisites.first
+ end
+
+ # Lexical analyzer
+ file lex_def => "#{current_dir}/core/keywords" do |t|
+ gperf.run t.name, t.prerequisites.first
+ end
+
+ file libfile("#{build.build_dir}/lib/libmruby_core") => core_objs
+ build.libmruby << core_objs
+end