enable cross-compilation
This commit is contained in:
parent
64be4019ad
commit
b1b66cc389
@ -95,7 +95,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
|
|||||||
mysql2_result_wrapper * wrapper;
|
mysql2_result_wrapper * wrapper;
|
||||||
MYSQL_ROW row;
|
MYSQL_ROW row;
|
||||||
MYSQL_FIELD * fields = NULL;
|
MYSQL_FIELD * fields = NULL;
|
||||||
unsigned int i = 0;
|
long i = 0;
|
||||||
unsigned long * fieldLengths;
|
unsigned long * fieldLengths;
|
||||||
void * ptr;
|
void * ptr;
|
||||||
|
|
||||||
@ -286,7 +286,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
|
|||||||
|
|
||||||
static VALUE rb_mysql_result_fetch_fields(VALUE self) {
|
static VALUE rb_mysql_result_fetch_fields(VALUE self) {
|
||||||
mysql2_result_wrapper * wrapper;
|
mysql2_result_wrapper * wrapper;
|
||||||
unsigned int i = 0;
|
long i = 0;
|
||||||
short int symbolizeKeys = 0;
|
short int symbolizeKeys = 0;
|
||||||
VALUE defaults;
|
VALUE defaults;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ typedef struct {
|
|||||||
VALUE fields;
|
VALUE fields;
|
||||||
VALUE rows;
|
VALUE rows;
|
||||||
VALUE encoding;
|
VALUE encoding;
|
||||||
unsigned int numberOfFields;
|
long numberOfFields;
|
||||||
unsigned long numberOfRows;
|
unsigned long numberOfRows;
|
||||||
unsigned long lastRowProcessed;
|
unsigned long lastRowProcessed;
|
||||||
short int resultFreed;
|
short int resultFreed;
|
||||||
|
@ -4,7 +4,12 @@ require "rake/extensiontask"
|
|||||||
MYSQL_VERSION = "5.1.50"
|
MYSQL_VERSION = "5.1.50"
|
||||||
MYSQL_MIRROR = ENV['MYSQL_MIRROR'] || "http://mysql.mirrors.pair.com"
|
MYSQL_MIRROR = ENV['MYSQL_MIRROR'] || "http://mysql.mirrors.pair.com"
|
||||||
|
|
||||||
Rake::ExtensionTask.new("mysql2", JEWELER.gemspec) do |ext|
|
|
||||||
|
def gemspec
|
||||||
|
@clean_gemspec ||= eval(File.read(File.expand_path('../../mysql2.gemspec', __FILE__)))
|
||||||
|
end
|
||||||
|
|
||||||
|
Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
|
||||||
# reference where the vendored MySQL got extracted
|
# reference where the vendored MySQL got extracted
|
||||||
mysql_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', "mysql-#{MYSQL_VERSION}-win32"))
|
mysql_lib = File.expand_path(File.join(File.dirname(__FILE__), '..', 'vendor', "mysql-#{MYSQL_VERSION}-win32"))
|
||||||
|
|
||||||
@ -12,6 +17,11 @@ Rake::ExtensionTask.new("mysql2", JEWELER.gemspec) do |ext|
|
|||||||
if RUBY_PLATFORM =~ /mswin|mingw/ then
|
if RUBY_PLATFORM =~ /mswin|mingw/ then
|
||||||
ext.config_options << "--with-mysql-include=#{mysql_lib}/include"
|
ext.config_options << "--with-mysql-include=#{mysql_lib}/include"
|
||||||
ext.config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"
|
ext.config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"
|
||||||
|
else
|
||||||
|
ext.cross_compile = true
|
||||||
|
ext.cross_platform = ['x86-mingw32', 'x86-mswin32-60']
|
||||||
|
ext.cross_config_options << "--with-mysql-include=#{mysql_lib}/include"
|
||||||
|
ext.cross_config_options << "--with-mysql-lib=#{mysql_lib}/lib/opt"
|
||||||
end
|
end
|
||||||
|
|
||||||
ext.lib_dir = File.join 'lib', 'mysql2'
|
ext.lib_dir = File.join 'lib', 'mysql2'
|
||||||
|
Loading…
Reference in New Issue
Block a user