<commit_before>require 'mkmf'

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

if ARGV.member?('--help') || ARGV.member?('-?')
  puts "ruby extconf.rb:"
  puts "Options for the Ruby bindings to Chipmunk: "
#  puts "--disable-vendor    Disables vendoring Chipmunk."
#  puts "--enable-vendor     Enables vendoring Chipmunk."
  puts "--enable-macosx     Enables compiling for OS-X."
  puts "--enable-64         Enables compiling to 64 bits targets."
  puts
  exit
end

p "pwd", Dir.pwd

dir_config('chipmunk')

# VENDORED_CHIPMUNK     = 'chipmunk-5.3.4'
# VENDORED_SRC_DIR      =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'src')
# VENDORED_SRC_DIR2     =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'src',
#                                   'constraints')
# VENDORED_INCLUDE_DIR  =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'include'
#                                'chipmunk')

MINGW = '/usr/i586-mingw32msvc'
CHIPMUNK_HEADER   = 'chipmunk.h'
CHIPMUNK_NAME     = 'chipmunk'
CHIPMUNK_FUNCTION = 'cpMomentForPoly'
CHIPMUNK_INCLUDE  = [ '/usr/include',
                      File.join(MINGW, 'include'),
                      File.join(MINGW, 'include', 'chipmunk'),
                     '/usr/local/include',
                     '/usr/include/chipmunk',
                     '/usr/local/include/chipmunk'
                    ]
CHIPMUNK_LIBDIR   = ['/usr/lib', File.join(MINGW, 'lib'), '/usr/local/lib']

# This is a bit of a trick to cleanly vendor the chipmunk C library.
# sources           = Dir.glob(File.join($srcdir, 'rb_*.c')).to_a
# normally, we need the rb_xxx files...

have_header('chipmunk.h')

if enable_config("macosx", false)
    $CFLAGS += ' -arch ppc -arch i386 -arch x86_64'
    $LDFLAGS += ' -arch x86_64 -arch i386 -arch ppc'
end

if enable_config("64", false)
  $CFLAGS += ' -m64'
end

$CFLAGS += ' -std=gnu99 -ffast-math -DNDEBUG '
create_makefile('chipmunk')
<commit_msg>dropped ppc arch flag<commit_after>require 'mkmf'

RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']

if ARGV.member?('--help') || ARGV.member?('-?')
  puts "ruby extconf.rb:"
  puts "Options for the Ruby bindings to Chipmunk: "
#  puts "--disable-vendor    Disables vendoring Chipmunk."
#  puts "--enable-vendor     Enables vendoring Chipmunk."
  puts "--enable-macosx     Enables compiling for OS-X."
  puts "--enable-64         Enables compiling to 64 bits targets."
  puts
  exit
end

p "pwd", Dir.pwd

dir_config('chipmunk')

# VENDORED_CHIPMUNK     = 'chipmunk-5.3.4'
# VENDORED_SRC_DIR      =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'src')
# VENDORED_SRC_DIR2     =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'src',
#                                   'constraints')
# VENDORED_INCLUDE_DIR  =  File.join($srcdir, 'vendor', VENDORED_CHIPMUNK, 'include'
#                                'chipmunk')

MINGW = '/usr/i586-mingw32msvc'
CHIPMUNK_HEADER   = 'chipmunk.h'
CHIPMUNK_NAME     = 'chipmunk'
CHIPMUNK_FUNCTION = 'cpMomentForPoly'
CHIPMUNK_INCLUDE  = [ '/usr/include',
                      File.join(MINGW, 'include'),
                      File.join(MINGW, 'include', 'chipmunk'),
                     '/usr/local/include',
                     '/usr/include/chipmunk',
                     '/usr/local/include/chipmunk'
                    ]
CHIPMUNK_LIBDIR   = ['/usr/lib', File.join(MINGW, 'lib'), '/usr/local/lib']

# This is a bit of a trick to cleanly vendor the chipmunk C library.
# sources           = Dir.glob(File.join($srcdir, 'rb_*.c')).to_a
# normally, we need the rb_xxx files...

have_header('chipmunk.h')

if enable_config("macosx", false)
    # $CFLAGS += ' -arch ppc -arch i386 -arch x86_64'
    # $LDFLAGS += ' -arch x86_64 -arch i386 -arch ppc'
    $CFLAGS += ' -arch i386 -arch x86_64'
    $LDFLAGS += ' -arch x86_64 -arch i386'
end

if enable_config("64", false)
  $CFLAGS += ' -m64'
end

$CFLAGS += ' -std=gnu99 -ffast-math -DNDEBUG '
create_makefile('chipmunk')

{'fraction_non_alphanumeric': 0.14869322506977925, 'fraction_numerical': 0.020299416391778735, 'mean_word_length': 2.5577617328519855, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2063273', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1479, 'n_words': 305}