From e63cd52413524e7ab0f9c095c6d8fd0b0278f13f Mon Sep 17 00:00:00 2001 From: John Woods Date: Thu, 14 Dec 2017 13:18:37 -0600 Subject: [PATCH] Hopefully, fix to #591. --- lib/nmatrix/mkmf.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/nmatrix/mkmf.rb b/lib/nmatrix/mkmf.rb index 2e2d0cd4..8c5d0526 100644 --- a/lib/nmatrix/mkmf.rb +++ b/lib/nmatrix/mkmf.rb @@ -91,8 +91,10 @@ def gplusplus_version $CXXFLAGS += " -O3 -std=#{$CXX_STANDARD} " #-fmax-errors=10 -save-temps #$CXXFLAGS += " -static -O0 -g -std=#{$CXX_STANDARD} " -CONFIG['warnflags'].gsub!('-Wshorten-64-to-32', '') # doesn't work except in Mac-patched gcc (4.2) -CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '') -CONFIG['warnflags'].gsub!('-Wimplicit-function-declaration', '') - +if CONFIG.has_key?('warnflags') + CONFIG['warnflags'].gsub!('-Wshorten-64-to-32', '') # doesn't work except in Mac-patched gcc (4.2) + CONFIG['warnflags'].gsub!('-Wdeclaration-after-statement', '') + CONFIG['warnflags'].gsub!('-Wimplicit-function-declaration', '') +end + have_func("rb_array_const_ptr", "ruby.h")