|
|
|
|
@@ -1,147 +0,0 @@
|
|
|
|
|
From 8d8dbc4fad71bb683a81036a7fc323ac45e2da76 Mon Sep 17 00:00:00 2001
|
|
|
|
|
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
|
|
|
|
|
Date: Sun, 2 Sep 2018 22:03:29 +0200
|
|
|
|
|
Subject: [PATCH] Align compile to our needs
|
|
|
|
|
MIME-Version: 1.0
|
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
|
|
Upstream-Status: Inappropriate [configuration]
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
|
|
|
|
|
---
|
|
|
|
|
Rakefile | 10 ++++------
|
|
|
|
|
build_config.rb | 37 +++++++++++++++++++++++++------------
|
|
|
|
|
lib/mruby/build/command.rb | 2 +-
|
|
|
|
|
tasks/toolchains/gcc.rake | 2 +-
|
|
|
|
|
4 files changed, 31 insertions(+), 20 deletions(-)
|
|
|
|
|
|
|
|
|
|
diff --git a/Rakefile b/Rakefile
|
|
|
|
|
index 2f6fa056..74aa5e8f 100644
|
|
|
|
|
--- a/Rakefile
|
|
|
|
|
+++ b/Rakefile
|
|
|
|
|
@@ -83,15 +83,13 @@ MRuby.each_target do |target|
|
|
|
|
|
end
|
|
|
|
|
depfiles += [ install_path ]
|
|
|
|
|
elsif target == MRuby.targets['host-debug']
|
|
|
|
|
- unless MRuby.targets['host'].gems.map {|g| g.bins}.include?([bin])
|
|
|
|
|
- install_path = MRuby.targets['host-debug'].exefile("#{bin_path}/#{bin}")
|
|
|
|
|
+ install_path = MRuby.targets['host-debug'].exefile("#{bin_path}/#{bin}")
|
|
|
|
|
|
|
|
|
|
- file install_path => exec do |t|
|
|
|
|
|
- FileUtils.rm_f t.name, { :verbose => $verbose }
|
|
|
|
|
- FileUtils.cp t.prerequisites.first, t.name, { :verbose => $verbose }
|
|
|
|
|
+ file install_path => exec do |t|
|
|
|
|
|
+ FileUtils.rm_f t.name, { :verbose => $verbose }
|
|
|
|
|
+ FileUtils.cp t.prerequisites.first, t.name, { :verbose => $verbose }
|
|
|
|
|
end
|
|
|
|
|
depfiles += [ install_path ]
|
|
|
|
|
- end
|
|
|
|
|
else
|
|
|
|
|
depfiles += [ exec ]
|
|
|
|
|
end
|
|
|
|
|
diff --git a/build_config.rb b/build_config.rb
|
|
|
|
|
index 1429837b..98d0a40d 100644
|
|
|
|
|
--- a/build_config.rb
|
|
|
|
|
+++ b/build_config.rb
|
|
|
|
|
@@ -24,15 +24,15 @@ MRuby::Build.new do |conf|
|
|
|
|
|
# include the default GEMs
|
|
|
|
|
conf.gembox 'default'
|
|
|
|
|
# C compiler settings
|
|
|
|
|
- # conf.cc do |cc|
|
|
|
|
|
- # cc.command = ENV['CC'] || 'gcc'
|
|
|
|
|
- # cc.flags = [ENV['CFLAGS'] || %w()]
|
|
|
|
|
+ conf.cc do |cc|
|
|
|
|
|
+ cc.command = ENV['CC']
|
|
|
|
|
+ cc.flags = [ENV['CFLAGS']]
|
|
|
|
|
# cc.include_paths = ["#{root}/include"]
|
|
|
|
|
# cc.defines = %w(DISABLE_GEMS)
|
|
|
|
|
# cc.option_include_path = '-I%s'
|
|
|
|
|
# cc.option_define = '-D%s'
|
|
|
|
|
# cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
|
|
|
|
|
- # end
|
|
|
|
|
+ end
|
|
|
|
|
|
|
|
|
|
# mrbc settings
|
|
|
|
|
# conf.mrbc do |mrbc|
|
|
|
|
|
@@ -40,9 +40,9 @@ MRuby::Build.new do |conf|
|
|
|
|
|
# end
|
|
|
|
|
|
|
|
|
|
# Linker settings
|
|
|
|
|
- # conf.linker do |linker|
|
|
|
|
|
- # linker.command = ENV['LD'] || 'gcc'
|
|
|
|
|
- # linker.flags = [ENV['LDFLAGS'] || []]
|
|
|
|
|
+ conf.linker do |linker|
|
|
|
|
|
+ linker.command = ENV['CC']
|
|
|
|
|
+ linker.flags = [ENV['LDFLAGS']]
|
|
|
|
|
# linker.flags_before_libraries = []
|
|
|
|
|
# linker.libraries = %w()
|
|
|
|
|
# linker.flags_after_libraries = []
|
|
|
|
|
@@ -50,13 +50,12 @@ MRuby::Build.new do |conf|
|
|
|
|
|
# linker.option_library = '-l%s'
|
|
|
|
|
# linker.option_library_path = '-L%s'
|
|
|
|
|
# linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
|
|
|
|
|
- # end
|
|
|
|
|
+ end
|
|
|
|
|
|
|
|
|
|
# Archiver settings
|
|
|
|
|
- # conf.archiver do |archiver|
|
|
|
|
|
- # archiver.command = ENV['AR'] || 'ar'
|
|
|
|
|
- # archiver.archive_options = 'rs %{outfile} %{objs}'
|
|
|
|
|
- # end
|
|
|
|
|
+ conf.archiver do |archiver|
|
|
|
|
|
+ archiver.command = ENV['AR']
|
|
|
|
|
+ end
|
|
|
|
|
|
|
|
|
|
# Parser generator settings
|
|
|
|
|
# conf.yacc do |yacc|
|
|
|
|
|
@@ -101,6 +100,20 @@ MRuby::Build.new('host-debug') do |conf|
|
|
|
|
|
|
|
|
|
|
# C compiler settings
|
|
|
|
|
conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
|
|
|
|
|
+ conf.cc do |cc|
|
|
|
|
|
+ cc.command = ENV['CC']
|
|
|
|
|
+ cc.flags = [ENV['CFLAGS']]
|
|
|
|
|
+ end
|
|
|
|
|
+ # Linker settings
|
|
|
|
|
+ conf.linker do |linker|
|
|
|
|
|
+ linker.command = ENV['CC']
|
|
|
|
|
+ linker.flags = [ENV['LDFLAGS']]
|
|
|
|
|
+ end
|
|
|
|
|
+
|
|
|
|
|
+ # Archiver settings
|
|
|
|
|
+ conf.archiver do |archiver|
|
|
|
|
|
+ archiver.command = ENV['AR']
|
|
|
|
|
+ end
|
|
|
|
|
|
|
|
|
|
# Generate mruby debugger command (require mruby-eval)
|
|
|
|
|
conf.gem :core => "mruby-bin-debugger"
|
|
|
|
|
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb
|
|
|
|
|
index 694b4a24..5744556c 100644
|
|
|
|
|
--- a/lib/mruby/build/command.rb
|
|
|
|
|
+++ b/lib/mruby/build/command.rb
|
|
|
|
|
@@ -143,7 +143,7 @@ module MRuby
|
|
|
|
|
|
|
|
|
|
def initialize(build)
|
|
|
|
|
super
|
|
|
|
|
- @command = ENV['LD'] || 'ld'
|
|
|
|
|
+ @command = ENV['CC'] || 'ld'
|
|
|
|
|
@flags = (ENV['LDFLAGS'] || [])
|
|
|
|
|
@flags_before_libraries, @flags_after_libraries = [], []
|
|
|
|
|
@libraries = []
|
|
|
|
|
diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake
|
|
|
|
|
index fc2e0bff..5d9f96fc 100644
|
|
|
|
|
--- a/tasks/toolchains/gcc.rake
|
|
|
|
|
+++ b/tasks/toolchains/gcc.rake
|
|
|
|
|
@@ -22,7 +22,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
conf.linker do |linker|
|
|
|
|
|
- linker.command = ENV['LD'] || 'gcc'
|
|
|
|
|
+ linker.command = ENV['CC']
|
|
|
|
|
linker.flags = [ENV['LDFLAGS'] || %w()]
|
|
|
|
|
linker.libraries = %w(m)
|
|
|
|
|
linker.library_paths = []
|
|
|
|
|
--
|
|
|
|
|
2.14.4
|
|
|
|
|
|