<commit_before>require 'mkmf'

filegdb_path = File.expand_path("#{File.dirname(__FILE__)}/filegdb")

dir_config '', File.join(filegdb_path, 'include'), File.join(filegdb_path, 'lib')

have_library 'FileGDBAPI' or raise 'libFileGDBAPI not found'

$libs = append_library $libs, 'FileGDBAPI'

$LDFLAGS << " -Wl,-rpath,#{File.join(filegdb_path, 'lib')}"

create_makefile 'filegdb/filegdb'
<commit_msg>Force compilation with GCC on OSX Mavericks<commit_after>require 'mkmf'

filegdb_path = File.expand_path("#{File.dirname(__FILE__)}/filegdb")

dir_config '', File.join(filegdb_path, 'include'), File.join(filegdb_path, 'lib')

have_library 'FileGDBAPI' or raise 'libFileGDBAPI not found'

$libs = append_library $libs, 'FileGDBAPI'

$LDFLAGS << " -Wl,-rpath,#{File.join(filegdb_path, 'lib')}"

if RUBY_PLATFORM =~ /darwin12/
  # libFileGDBAPI requires GCC compilation because it's C++ symbols are incompatible with LLVM 5.0
  #
  # To install GCC on OSX:
  #
  #   $ brew tap homebrew/versions
  #   $ brew install --enable-cxx gcc49
  #

  msg = <<-GCC


\e[31m
===========================================================================================================================
===========================================================================================================================

The filegdb gem requires GCC on OSX Mavericks because the C++ symbols in libFileGDBAPI.dylib are incompatible with LLVM 5.0

To install GCC on OSX:

   $ brew tap homebrew/versions
   $ brew install --enable-cxx gcc49

Note: Installing GCC through homebrew is safe and will not interfere with your Xcode installation.

===========================================================================================================================
===========================================================================================================================
\e[0m

GCC

  if `which gcc-4.00000`.strip.length == 0
    puts msg
    exit
  end

  require 'rbconfig'
  RbConfig::MAKEFILE_CONFIG['CC']  = 'gcc-4.9'
  RbConfig::MAKEFILE_CONFIG['CXX'] = 'gcc-4.9'

  # remove -Wshorten-64-to-32 since it's incompatible with GCC
  $warnflags = $warnflags.gsub(/-Wshorten-64-to-32/, '')
end

create_makefile 'filegdb/filegdb'

{'fraction_non_alphanumeric': 0.3213965980304387, 'fraction_numerical': 0.01432408236347359, 'mean_word_length': 5.962616822429907, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3269558', 'n_tokens_mistral': 736, 'n_tokens_neox': 662, 'n_words': 159}