Sha256: e2ec46df71d164bb8d8a33751a600c66bdaeb205b7b5750ce6b4a76d68822fa9

Contents?: true

Size: 1.28 KB

Versions: 71

Compression:

Stored size: 1.28 KB

Contents

require 'mkmf'

if with_config('static-libstdc++')
  $LDFLAGS << ' ' << `#{CONFIG['CC']} -print-file-name=libstdc++.a`.chomp
else
  have_library('stdc++')

  case RbConfig::CONFIG['host_os']
  when /solaris(!?2.11)/
    # Do a little trickery here to enable C++ standard on Solaris 11 if found.
    # This also forces 64bit compilation mode.
    $CXX = CONFIG['CXX']
    $CXX << ' ' << '-m64'
    $CFLAGS = CONFIG['CFLAGS'].gsub(/-std=c99/, '')
    $CFLAGS << ' ' << '-m64 -std=c++11'
    $CPPFLAGS = CONFIG['CFLAGS'].gsub(/-std=c99/, '')
    $CPPFLAGS << ' ' << '-m64 -std=c++11'
    $CXXFLAGS = CONFIG['CFLAGS'].gsub(/-std=c99/, '')
    $CXXFLAGS << ' ' << '-m64 -std=c++11'
  when /aix/
    # Compiler flags necessary on AIX.
    # rubocop:disable Style/GlobalVars
    $CFLAGS << ' ' << '-D_ALL_SOURCE=1'
    $CPPFLAGS << ' ' << '-D_ALL_SOURCE=1'
    $CXXFLAGS << ' ' << '-D_ALL_SOURCE=1'
  end
end

create_makefile 'unf_ext'

unless CONFIG['CXX']
  case CONFIG['CC']
  when %r{((?:.*[-/])?)gcc([-0-9.]*)$}
    cxx = $1 + 'g++' + $2
  when %r{((?:.*[-/])?)clang([-0-9.]*)$}
    cxx = $1 + 'clang++' + $2
  else
    cxx = CONFIG['CC']
  end

  warn "CXX is automatically set to #{cxx}"

  new_mf = <<-EOF << File.read('Makefile')
CXX=#{cxx}
  EOF

  File.open('Makefile', 'w') { |mf|
    mf.print new_mf
  }
end

Version data entries

71 entries across 52 versions & 7 rubygems

Version Path
direct7-0.0.18 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
direct7-0.0.17 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
direct7-0.0.16 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/unf_ext-0.0.8.2/ext/unf_ext/extconf.rb
unf_ext-0.0.8.2-x86-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.2-x64-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.2-x64-mingw-ucrt ext/unf_ext/extconf.rb
unf_ext-0.0.8.2 ext/unf_ext/extconf.rb
unf_ext-0.0.8.2.beta-x86-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.2.beta-x64-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.2.beta-x64-mingw-ucrt ext/unf_ext/extconf.rb
unf_ext-0.0.8.2.beta ext/unf_ext/extconf.rb
unf_ext-0.0.8.1-x86-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.1-x64-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8.1 ext/unf_ext/extconf.rb
unf_ext-0.0.8-x86-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8-x64-mingw32 ext/unf_ext/extconf.rb
unf_ext-0.0.8 ext/unf_ext/extconf.rb