Sha256: 5e3fcf17561d337ae43149740ad8fb50fffac29c2e736030abe90ef12f45de89

Contents?: true

Size: 1.93 KB

Versions: 33

Compression:

Stored size: 1.93 KB

Contents

ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/

require 'mkmf'

# :stopdoc:

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



ldflags = cppflags = nil
if RbConfig::CONFIG["host_os"] =~ /darwin/
  begin
    brew_prefix = `brew --prefix sqlite3`.chomp
    ldflags   = "#{brew_prefix}/lib"
    cppflags  = "#{brew_prefix}/include"
    pkg_conf  = "#{brew_prefix}/lib/pkgconfig"

    # pkg_config should be less error prone than parsing compiler
    # commandline options, but we need to set default ldflags and cpp flags
    # in case the user doesn't have pkg-config installed
    ENV['PKG_CONFIG_PATH'] ||= pkg_conf
  rescue
  end
end

pkg_config("sqlite3")

# --with-sqlite3-{dir,include,lib}
dir_config("sqlite3", cppflags, ldflags)

if RbConfig::CONFIG["host_os"] =~ /mswin/
  $CFLAGS << ' -W3'
end

def asplode missing
  if RUBY_PLATFORM =~ /mingw|mswin/
    abort "#{missing} is missing. Install SQLite3 from " +
          "http://www.sqlite.org/ first."
  else
    abort <<-error
#{missing} is missing. Try 'brew install sqlite3',
'yum install sqlite-devel' or 'apt-get install libsqlite3-dev'
and check your shared library search path (the
location where your sqlite3 shared library is located).
    error
  end
end

asplode('sqlite3.h')  unless find_header  'sqlite3.h'
find_library 'pthread', 'pthread_create' # 1.8 support. *shrug*
asplode('sqlite3') unless find_library 'sqlite3', 'sqlite3_libversion_number'

# Functions defined in 1.9 but not 1.8
have_func('rb_proc_arity')

# Functions defined in 2.1 but not 2.0
have_func('rb_integer_pack')

# These functions may not be defined
have_func('sqlite3_initialize')
have_func('sqlite3_backup_init')
have_func('sqlite3_column_database_name')
have_func('sqlite3_enable_load_extension')
have_func('sqlite3_load_extension')
have_func('sqlite3_open_v2')
have_func('sqlite3_prepare_v2')
have_type('sqlite3_int64', 'sqlite3.h')
have_type('sqlite3_uint64', 'sqlite3.h')

create_makefile('sqlite3/sqlite3_native')

Version data entries

33 entries across 30 versions & 7 rubygems

Version Path
tdiary-5.0.11 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
nullifyable-0.1.0 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.9 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.8 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.7 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.6 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.5 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.4 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.3 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.2 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
mockley_crew-1.1.1 vendor/gems/sqlite3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.9 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.8 vendor/bundle/gems/tdiary-5.0.7/vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.8 vendor/bundle/ruby/2.5.0/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.8 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.7 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.6 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.5 vendor/bundle/gems/tdiary-5.0.4/vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
tdiary-5.0.5 vendor/bundle/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/sqlite3-1.3.13/ext/sqlite3/extconf.rb