Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 62 lines (46 sloc) 2.137 kb
1390e5f @luislavena Cleanup extension building process and dependencies.
luislavena authored
1 # use rake-compiler for building the extension
2 require 'rake/extensiontask'
3
bbc0fff @luislavena Added post install message for Windows binaries.
luislavena authored
4 # NOTE: version used by cross compilation of Windows native extension
5 # It do not affect compilation under other operating systems
6 # The version indicated is the minimum DLL suggested for correct functionality
7 BINARY_VERSION = '3.6.23.1'
8 URL_VERSION = BINARY_VERSION.gsub('.', '_')
9
f8dd52d @luislavena Updated extension tasks to match newer structure.
luislavena authored
10 # build sqlite3_native C extension
11 Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
12 # where to locate the extension
13 ext.ext_dir = 'ext/sqlite3'
14
bd2d259 @luislavena Updated dependency on rake-compiler to 0.7.0
luislavena authored
15 # where native extension will be copied (matches makefile)
16 ext.lib_dir = "lib/sqlite3"
17
f344924 @luislavena Build sqlite3_api C extension for cross compilation.
luislavena authored
18 # reference to the sqlite3 library
19 sqlite3_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', 'sqlite3'))
20
ca10111 @luislavena Always clean after you.
luislavena authored
21 # clean binary folders always
22 CLEAN.include("#{ext.lib_dir}/?.?")
23
f344924 @luislavena Build sqlite3_api C extension for cross compilation.
luislavena authored
24 # automatically add build options to avoid need of manual input
25 if RUBY_PLATFORM =~ /mswin|mingw/ then
f8dd52d @luislavena Updated extension tasks to match newer structure.
luislavena authored
26 # define target for extension (supporting fat binaries)
27 RUBY_VERSION =~ /(\d+\.\d+)/
28 ext.lib_dir = "lib/sqlite3/#{$1}"
f344924 @luislavena Build sqlite3_api C extension for cross compilation.
luislavena authored
29 ext.config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
17608ff @luislavena Trigger cross-compilation anything except Windows.
luislavena authored
30 else
31 ext.cross_compile = true
35da3e5 @luislavena Strict versioning for mswin32 binary gems.
luislavena authored
32 ext.cross_platform = ['i386-mswin32-60', 'i386-mingw32']
17608ff @luislavena Trigger cross-compilation anything except Windows.
luislavena authored
33 ext.cross_config_options << "--with-sqlite3-dir=#{sqlite3_lib}"
bbc0fff @luislavena Added post install message for Windows binaries.
luislavena authored
34 ext.cross_compiling do |gemspec|
35 gemspec.post_install_message = <<-POST_INSTALL_MESSAGE
36
37 =============================================================================
38
39 You've installed the binary version of #{gemspec.name}.
40 It was built using SQLite3 version #{BINARY_VERSION}.
41 It's recommended to use the exact same version to avoid potential issues.
42
43 At the time of building this gem, the necessary DLL files where available
44 in the following download:
45
46 http://www.sqlite.org/sqlitedll-#{URL_VERSION}.zip
47
48 You can put the sqlite3.dll available in this package in your Ruby bin
49 directory, for example C:\\Ruby\\bin
50
51 =============================================================================
52
53 POST_INSTALL_MESSAGE
54 end
f344924 @luislavena Build sqlite3_api C extension for cross compilation.
luislavena authored
55 end
56 end
1390e5f @luislavena Cleanup extension building process and dependencies.
luislavena authored
57
e7c3813 @luislavena Adapt Rakefiles to Hoe.
luislavena authored
58 # ensure things are compiled prior testing
59 task :test => [:compile]
f8dd52d @luislavena Updated extension tasks to match newer structure.
luislavena authored
60
61 # vim: syntax=ruby
Something went wrong with that request. Please try again.