<commit_before>module HomebrewEnvExtension
  # -w: keep signal to noise high
  SAFE_CFLAGS_FLAGS = "-w -pipe"

  def setup_build_environment
    # Clear CDPATH to avoid make issues that depend on changing directories
    delete('CDPATH')
    delete('CPPFLAGS')
    delete('LDFLAGS')

    self['MAKEFLAGS']="-j#{Hardware.processor_count}"

    unless HOMEBREW_PREFIX.to_s == '/usr/local'
      # /usr/local is already an -isystem and -L directory so we skip it
      self['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include"
      self['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
      # CMake ignores the variables above
      self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
    end

    if MACOS_VERSION >= 10.6 and self.use_clang?
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++"
      cflags = ['-O3'] # -O4 makes the linker fail on some formulae
    elsif MACOS_VERSION >= 10.6 and self.use_llvm?
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++"
      cflags = ['-O4'] # link time optimisation baby!
    elsif MACOS_VERSION >= 10.6 and self.use_gcc?
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++"
      cflags = ['-O3']
    else
      # If these aren't set, many formulae fail to build
      self['CC'] = '/usr/bin/cc'
      self['CXX'] = '/usr/bin/c++'
      cflags = ['-O3']
    end

    # In rare cases this may break your builds, as the tool for some reason wants
    # to use a specific linker. However doing this in general causes formula to
    # build more successfully because we are changing CC and many build systems
    # don't react properly to that.
    self['LD'] = self['CC']

    # Optimise all the way to eleven, references:
    # http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel<commit_msg>Fix Xcode 4 compiler paths for --use-gcc<commit_after>module HomebrewEnvExtension
  # -w: keep signal to noise high
  SAFE_CFLAGS_FLAGS = "-w -pipe"

  def setup_build_environment
    # Clear CDPATH to avoid make issues that depend on changing directories
    delete('CDPATH')
    delete('CPPFLAGS')
    delete('LDFLAGS')

    self['MAKEFLAGS']="-j#{Hardware.processor_count}"

    unless HOMEBREW_PREFIX.to_s == '/usr/local'
      # /usr/local is already an -isystem and -L directory so we skip it
      self['CPPFLAGS'] = "-isystem #{HOMEBREW_PREFIX}/include"
      self['LDFLAGS'] = "-L#{HOMEBREW_PREFIX}/lib"
      # CMake ignores the variables above
      self['CMAKE_PREFIX_PATH'] = "#{HOMEBREW_PREFIX}"
    end

    if MACOS_VERSION >= 10.6 and self.use_clang?
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/clang"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/clang++"
      cflags = ['-O3'] # -O4 makes the linker fail on some formulae
    elsif MACOS_VERSION >= 10.6 and self.use_llvm?
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-gcc"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/llvm-g++"
      cflags = ['-O4'] # link time optimisation baby!
    elsif MACOS_VERSION >= 10.6 and self.use_gcc?
      # Xcode 4 makes gcc and g++ #{MacOS.xcode_prefix}/usr/bin/ links to llvm versions
      # so we need to use gcc-4.2 and g++-4.2 for real non-llvm compilers
      self['CC'] = "#{MacOS.xcode_prefix}/usr/bin/gcc-4.2"
      self['CXX'] = "#{MacOS.xcode_prefix}/usr/bin/g++-4.2"
      cflags = ['-O3']
    else
      # If these aren't set, many formulae fail to build
      self['CC'] = '/usr/bin/cc'
      self['CXX'] = '/usr/bin/c++'
      cflags = ['-O3']
    end

    # In rare cases this may break your builds, as the tool for some reason wants
    # to use a specific linker. However doing this in general causes formula to
    # build more successfully because we are changing CC and many build systems
    # don't react properly to that.
    self['LD'] = self['CC']

    # Optimise all the way to eleven, references:
    # http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel
{'fraction_non_alphanumeric': 0.14193388018891376, 'fraction_numerical': 0.009445687298036291, 'mean_word_length': 3.0159680638722555, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5083627', 'n_tokens_mistral': 1405, 'n_tokens_neox': 1336, 'n_words': 374}