<commit_before>Daedalus.blueprint do |i|
  gcc = i.gcc!

  gcc.cflags << "-Ivm -Ivm/test/cxxtest -I. -I/usr/local/include -I/opt/local/include "
  gcc.cflags << "-pipe -Wall -fno-omit-frame-pointer"
  gcc.cflags << "-ggdb3 -Werror"
  gcc.cflags << "-DRBX_PROFILER"

  if ENV['DEV']
    gcc.cflags << "-O0"
  else
    gcc.cflags << "-O2"
  end

  # This is necessary for the gcc sync prims to fully work
  if Rubinius::BUILD_CONFIG[:x86_32]
    gcc.cflags << "-march=i686"
  end

  Rubinius::BUILD_CONFIG[:defines].each do |flag|
    gcc.cflags << "-D#{flag}"
  end

  if RUBY_PLATFORM =~ /darwin/i
    if `sw_vers` =~ /10\.4/
      gcc.cflags << "-DHAVE_STRLCAT -DHAVE_STRLCPY"
    end

    # This flag makes the executable non-relocatable (and
    # slightly faster), but 4.3 does not support it.
    # TODO: Look for workarounds.
    unless `gcc -v 2>&1` =~ /gcc version 4\.3/i
      gcc.cflags << "-mdynamic-no-pic"
    end
  end

  gcc.ldflags << "-lstdc++"
  gcc.ldflags << "-L/usr/local/lib -L/opt/local/lib"

  make = "make"

  # TODO: Fix with Platform object
  case RUBY_PLATFORM
  when /linux/i
    gcc.ldflags << '-Wl,--export-dynamic' << "-lrt" << "-lcrypt"
  when /openbsd/i
    gcc.ldflags << '-lcrypto' << '-pthread' << '-lssl' << "-ldl" << "-rdynamic"
  when /haiku/i
    gcc.ldflags << "-ldl" << "-lnetwork"
  when /bsd/i
    gcc.ldflags << "-ldl" << "-lcrypt" << "-rdynamic"
    make = "gmake"
  when /mingw|win32/i
    gcc.ldflags << "-lws2_32"
  else
    gcc.ldflags << "-ldl"
  end

  if RUBY_PLATFORM =~ /bsd/ and
      Rubinius::BUILD_CONFIG[:defines].include?('HAS_EXECINFO')
    gcc.ldflags << "-lexecinfo"
  end

  # Files
  subdirs = %w[ builtin capi util instruments gc llvm missing ].map do |x|
    "vm/#{x}/*.{cpp,c}"
  end

  files = i.source_files "vm/*.{cpp,c}", *subdirs

  perl = Rubinius::BUILD_CONFIG[:build_perl] || "perl"

  # Libraries
  case Rubinius::BUILD_CONFIG[:llvm]
  when :prebuilt, :svn
    llvm = i.external_lib "vm/external_libs/llvm" do |l|
      conf = "vm/external_libs/llvm/Release/bin/llvm-config"
      flags = `#{perl} #{conf} --cflags`.strip.split(/\s+/)
      flags.delete_if { |x| x.index("-O") == 0 || x.index("-I") == 0 }
      flags << "-Ivm/external_libs/llvm/include" << "-DENABLE_LLVM"
      l.cflags = flags
<commit_msg>FreeBSD doesn't need -ldl and OpenBSD already explicitly has it<commit_after>Daedalus.blueprint do |i|
  gcc = i.gcc!

  gcc.cflags << "-Ivm -Ivm/test/cxxtest -I. -I/usr/local/include -I/opt/local/include "
  gcc.cflags << "-pipe -Wall -fno-omit-frame-pointer"
  gcc.cflags << "-ggdb3 -Werror"
  gcc.cflags << "-DRBX_PROFILER"

  if ENV['DEV']
    gcc.cflags << "-O0"
  else
    gcc.cflags << "-O2"
  end

  # This is necessary for the gcc sync prims to fully work
  if Rubinius::BUILD_CONFIG[:x86_32]
    gcc.cflags << "-march=i686"
  end

  Rubinius::BUILD_CONFIG[:defines].each do |flag|
    gcc.cflags << "-D#{flag}"
  end

  if RUBY_PLATFORM =~ /darwin/i
    if `sw_vers` =~ /10\.4/
      gcc.cflags << "-DHAVE_STRLCAT -DHAVE_STRLCPY"
    end

    # This flag makes the executable non-relocatable (and
    # slightly faster), but 4.3 does not support it.
    # TODO: Look for workarounds.
    unless `gcc -v 2>&1` =~ /gcc version 4\.3/i
      gcc.cflags << "-mdynamic-no-pic"
    end
  end

  gcc.ldflags << "-lstdc++"
  gcc.ldflags << "-L/usr/local/lib -L/opt/local/lib"

  make = "make"

  # TODO: Fix with Platform object
  case RUBY_PLATFORM
  when /linux/i
    gcc.ldflags << '-Wl,--export-dynamic' << "-lrt" << "-lcrypt"
  when /openbsd/i
    gcc.ldflags << '-lcrypto' << '-pthread' << '-lssl' << "-ldl" << "-rdynamic"
  when /haiku/i
    gcc.ldflags << "-ldl" << "-lnetwork"
  when /bsd/i
    gcc.ldflags << "-lcrypt" << "-rdynamic"
    make = "gmake"
  when /mingw|win32/i
    gcc.ldflags << "-lws2_32"
  else
    gcc.ldflags << "-ldl"
  end

  if RUBY_PLATFORM =~ /bsd/ and
      Rubinius::BUILD_CONFIG[:defines].include?('HAS_EXECINFO')
    gcc.ldflags << "-lexecinfo"
  end

  # Files
  subdirs = %w[ builtin capi util instruments gc llvm missing ].map do |x|
    "vm/#{x}/*.{cpp,c}"
  end

  files = i.source_files "vm/*.{cpp,c}", *subdirs

  perl = Rubinius::BUILD_CONFIG[:build_perl] || "perl"

  # Libraries
  case Rubinius::BUILD_CONFIG[:llvm]
  when :prebuilt, :svn
    llvm = i.external_lib "vm/external_libs/llvm" do |l|
      conf = "vm/external_libs/llvm/Release/bin/llvm-config"
      flags = `#{perl} #{conf} --cflags`.strip.split(/\s+/)
      flags.delete_if { |x| x.index("-O") == 0 || x.index("-I") == 0 }
      flags << "-Ivm/external_libs/llvm/include" << "-DENABLE_LLVM"
      l.cflags = flags

{'fraction_non_alphanumeric': 0.18045927209705373, 'fraction_numerical': 0.011265164644714038, 'mean_word_length': 2.70545746388443, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 5, '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': '73697', 'n_tokens_mistral': 1967, 'n_tokens_neox': 1835, 'n_words': 402}