enable cross-compilation

This commit is contained in:
Brian Lopez 2010-09-09 07:35:31 -07:00
parent 64be4019ad
commit b1b66cc389
3 changed files with 14 additions and 4 deletions

View File

@ -95,7 +95,7 @@ static VALUE rb_mysql_result_fetch_row(VALUE self, ID db_timezone, ID app_timezo
mysql2_result_wrapper * wrapper;
MYSQL_ROW row;
MYSQL_FIELD * fields = NULL;
unsigned int i = 0;
long i = 0;
unsigned long * fieldLengths;
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) {
mysql2_result_wrapper * wrapper;
unsigned int i = 0;
long i = 0;
short int symbolizeKeys = 0;
VALUE defaults;

View File

@ -8,7 +8,7 @@ typedef struct {
VALUE fields;
VALUE rows;
VALUE encoding;
unsigned int numberOfFields;
long numberOfFields;
unsigned long numberOfRows;
unsigned long lastRowProcessed;
short int resultFreed;

View File

@ -4,7 +4,12 @@ require "rake/extensiontask"
MYSQL_VERSION = "5.1.50"
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
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
ext.config_options << "--with-mysql-include=#{mysql_lib}/include"
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
ext.lib_dir = File.join 'lib', 'mysql2'