ext/nmatrix_atlas/extconf.rb in nmatrix-atlas-0.2.0 vs ext/nmatrix_atlas/extconf.rb in nmatrix-atlas-0.2.1

- old
+ new

@@ -105,13 +105,10 @@ # Why not just autogenerate this list from all .c/.cpp files in directory? basenames = %w{nmatrix_atlas math_atlas} $objs = basenames.map { |b| "#{b}.o" } $srcs = basenames.map { |b| "#{b}.cpp" } -#CONFIG['CXX'] = 'clang++' -CONFIG['CXX'] = 'g++' - def find_newer_gplusplus #:nodoc: print "checking for apparent GNU g++ binary with C++0x/C++11 support... " [9,8,7,6,5,4,3].each do |minor| ver = "4.#{minor}" gpp = "g++-#{ver}" @@ -135,11 +132,11 @@ "#{major}.#{minor}.#{patch}" end if CONFIG['CXX'] == 'clang++' - $CPP_STANDARD = 'c++11' + $CXX_STANDARD = 'c++11' else version = gplusplus_version if version < '4.3.0' && CONFIG['CXX'] == 'g++' # see if we can find a newer G++, unless it's been overridden by user if !find_newer_gplusplus @@ -147,15 +144,15 @@ end version = gplusplus_version end if version < '4.7.0' - $CPP_STANDARD = 'c++0x' + $CXX_STANDARD = 'c++0x' else - $CPP_STANDARD = 'c++11' + $CXX_STANDARD = 'c++11' end - puts "using C++ standard... #{$CPP_STANDARD}" + puts "using C++ standard... #{$CXX_STANDARD}" puts "g++ reports version... " + `#{CONFIG['CXX']} --version|head -n 1|cut -f 3 -d " "` end # add smmp in to get generic transp; remove smmp2 to eliminate funcptr transp @@ -231,15 +228,20 @@ # For release, these next two should both be changed to -O3. $CFLAGS += " -O3" #" -O0 -g " #$CFLAGS += " -static -O0 -g " -$CPPFLAGS += " -O3 -std=#{$CPP_STANDARD}" #" -O0 -g -std=#{$CPP_STANDARD} " #-fmax-errors=10 -save-temps -#$CPPFLAGS += " -static -O0 -g -std=#{$CPP_STANDARD} " +$CXXFLAGS += " -O3 -std=#{$CXX_STANDARD}" #" -O0 -g -std=#{$CXX_STANDARD} " #-fmax-errors=10 -save-temps +#$CPPFLAGS += " -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', '') + +have_func("rb_array_const_ptr", "ruby.h") +have_macro("FIX_CONST_VALUE_PTR", "ruby.h") +have_macro("RARRAY_CONST_PTR", "ruby.h") +have_macro("RARRAY_AREF", "ruby.h") create_conf_h("nmatrix_atlas_config.h") create_makefile("nmatrix_atlas") # to clean up object files in subdirectories: