Append cflags for undefined macro
MRuby::Toolchain.new(:gcc) do |conf, _params|
[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 -Wdeclaration-after-statement -Wwrite-strings)]
+ cc.flags = [ENV['CFLAGS'] || %w(-g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration -Wdeclaration-after-statement -Wwrite-strings -Wundef)]
cc.defines = %w(DISABLE_GEMS)
cc.option_include_path = '-I%s'
cc.option_define = '-D%s'
@@ -12,7 +12,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params|
[conf.cxx].each do |cxx|
cxx.command = ENV['CXX'] || 'g++'
- cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)]
+ cxx.flags = [ENV['CXXFLAGS'] || ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration -Wundef)]
cxx.defines = %w(DISABLE_GEMS)
cxx.option_include_path = '-I%s'
cxx.option_define = '-D%s'
