<commit_before>#!/usr/bin/env ruby
require 'getoptlong'
require 'mkmf'

target="bdb2"

$distcleanfiles=["bdb_aux._c"]


def usage
  $stderr.puts "

Options:

 --va build an alternate output bdb2a, use this to avoid overwriting a
      previous bdb2 library, since R0.3 the interfaces are not
      compatible due to the addition of transaction parameters to many
      calls. Note the impact on indicating the include, below.
      If you have not used bdb2 before, you need not use this argument.

 -h,--help this

 --dbh {dir for db.h}
      If we cannot find the right db.h automatically, use this to
      indicate where to look. Do not use --with... because we need
      to find the file itself to extract all the DB defines.

"
end

opts = GetoptLong.new(
                      [ "--va", GetoptLong::NO_ARGUMENT],
                      [ "-h","--help",GetoptLong::NO_ARGUMENT],
                      [ "--dbh", GetoptLong::REQUIRED_ARGUMENT]
                      )
opts.each do |opt,arg|
  case opt
  when '--va'
    target="bdb2a"
  when '-h','--help'
    usage
    exit
  when '--dbh'
    $dbh_location=arg
  end
end

message "Target is #{target}\n"

if CONFIG['INSTALL'] =~ %r{./install-sh}
  CONFIG.delete("INSTALL")
end

mj,mi,rv=RUBY_VERSION.split('.').collect {|s| s.to_i}
ri=(((mj*1000)+mi)*1000)+rv
if ri < 1008004
  $stderr.puts("Version 1.8.4 minimum required")
  exit(3)
end

inc_dir,lib_dir = dir_config(target)

$stderr.puts("lib_dir=#{lib_dir} inc_dir=#{inc_dir}")


#case Config::CONFIG["arch"]
#when /solaris2/<commit_msg>make dbh find work a little better with --dbh arg<commit_after>#!/usr/bin/env ruby
require 'getoptlong'
require 'mkmf'

target="bdb2"

$distcleanfiles=["bdb_aux._c"]


def usage
  $stderr.puts "

Options:

 --va build an alternate output bdb2a, use this to avoid overwriting a
      previous bdb2 library, since R0.3 the interfaces are not
      compatible due to the addition of transaction parameters to many
      calls. Note the impact on indicating the include, below.
      If you have not used bdb2 before, you need not use this argument.

 -h,--help this

 --dbh {dir for db.h}
      If we cannot find the right db.h automatically, use this to
      indicate where to look. Do not use --with... because we need
      to find the file itself to extract all the DB defines.

"
end

opts = GetoptLong.new(
                      [ "--va", GetoptLong::NO_ARGUMENT],
                      [ "-h","--help",GetoptLong::NO_ARGUMENT],
                      [ "--dbh", GetoptLong::REQUIRED_ARGUMENT]
                      )
opts.each do |opt,arg|
  case opt
  when '--va'
    target="bdb2a"
  when '-h','--help'
    usage
    exit
  when '--dbh'
    $dbh_location=arg
  end
end

message "Target is #{target}\n"

if CONFIG['INSTALL'] =~ %r{./install-sh}
  CONFIG.delete("INSTALL")
end

mj,mi,rv=RUBY_VERSION.split('.').collect {|s| s.to_i}
ri=(((mj*1000)+mi)*1000)+rv
if ri < 1008004
  $stderr.puts("Version 1.8.4 minimum required")
  exit(3)
end

inc_dir,lib_dir = dir_config(target,$dbh_location)

$stderr.puts("lib_dir=#{lib_dir} inc_dir=#{inc_dir}")


#case Config::CONFIG["arch"]
#when /solaris2/
{'fraction_non_alphanumeric': 0.1316793893129771, 'fraction_numerical': 0.01717557251908397, 'mean_word_length': 2.7983091787439616, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6554585', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1065, 'n_words': 328}