File: extconf.rb

package info (click to toggle)
ruby-concurrent 1.3.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,136 kB
  • sloc: ruby: 30,875; java: 6,128; ansic: 265; makefile: 26; sh: 19
file content (27 lines) | stat: -rw-r--r-- 614 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require 'fileutils'
require 'mkmf'

unless RUBY_ENGINE == "ruby"
  File.write("Makefile", dummy_makefile($srcdir).join(""))
  exit
end

extension_name = 'concurrent_ruby_ext'

dir_config(extension_name)
have_header "libkern/OSAtomic.h"

compiler_is_gcc = (CONFIG["GCC"] && !CONFIG["GCC"].empty?) ||
    # This could stand to be more generic...  but I am afraid.
    CONFIG["CC"] =~ /\bgcc\b/

if compiler_is_gcc
  case CONFIG["arch"]
  when /mswin32|mingw|solaris/
    $CFLAGS += " -march=native"
  when 'i686-linux'
    $CFLAGS += " -march=i686"
  end
end

create_makefile File.join('concurrent', extension_name)