From caf4d6322925d4b0aa2ad4810df812603cec508b Mon Sep 17 00:00:00 2001 From: crimsonwoods Date: Sat, 23 Nov 2013 19:30:52 -0800 Subject: Modify build script for gcc. Newly added compile option '-std=gnu99' is not necessary for C++. And 'g++' should be used to compile for C++ source codes, I think. --- tasks/toolchains/gcc.rake | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tasks/toolchains') diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake index 9b0b39d5c..27917d1c5 100644 --- a/tasks/toolchains/gcc.rake +++ b/tasks/toolchains/gcc.rake @@ -1,5 +1,5 @@ MRuby::Toolchain.new(:gcc) do |conf| - [conf.cc, conf.cxx, conf.objc, conf.asm].each do |cc| + [conf.cc, conf.objc, conf.asm].each do |cc| cc.command = ENV['CC'] || 'gcc' cc.flags = [ENV['CFLAGS'] || %w(-g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration)] cc.include_paths = ["#{MRUBY_ROOT}/include"] @@ -9,6 +9,16 @@ MRuby::Toolchain.new(:gcc) do |conf| cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' end + [conf.cxx].each do |cxx| + cxx.command = ENV['CC'] || 'g++' + cxx.flags = [ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)] + cxx.include_paths = ["#{MRUBY_ROOT}/include"] + cxx.defines = %w(DISABLE_GEMS) + cxx.option_include_path = '-I%s' + cxx.option_define = '-D%s' + cxx.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' + end + conf.linker do |linker| linker.command = ENV['LD'] || 'gcc' linker.flags = [ENV['LDFLAGS'] || %w()] -- cgit v1.2.3 From 92916bb4a6fb0065c1dc54b52b8ce51a1ac3eb17 Mon Sep 17 00:00:00 2001 From: crimsonwoods Date: Sat, 23 Nov 2013 21:47:47 -0800 Subject: Modify referenced environment variables. 'CXX' is used instead of 'CC'. 'CXXFLAGS' is used instead of 'CFLAGS'. --- tasks/toolchains/gcc.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tasks/toolchains') diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake index 27917d1c5..cacce1e84 100644 --- a/tasks/toolchains/gcc.rake +++ b/tasks/toolchains/gcc.rake @@ -10,8 +10,8 @@ MRuby::Toolchain.new(:gcc) do |conf| end [conf.cxx].each do |cxx| - cxx.command = ENV['CC'] || 'g++' - cxx.flags = [ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)] + cxx.command = ENV['CXX'] || 'g++' + cxx.flags = [ENV['CXXFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)] cxx.include_paths = ["#{MRUBY_ROOT}/include"] cxx.defines = %w(DISABLE_GEMS) cxx.option_include_path = '-I%s' -- cgit v1.2.3