extconf detect properly mingw.

This commit is contained in:
Luis Lavena 2010-08-11 22:45:52 +08:00 committed by Brian Lopez
parent 254f42f502
commit 4c27a1e4fc

View File

@ -10,7 +10,7 @@ have_func('rb_thread_blocking_region')
# borrowed from mysqlplus # borrowed from mysqlplus
# http://github.com/oldmoe/mysqlplus/blob/master/ext/extconf.rb # http://github.com/oldmoe/mysqlplus/blob/master/ext/extconf.rb
dirs = ENV['PATH'].split(':') + %w[ dirs = ENV['PATH'].split(File::PATH_SEPARATOR) + %w[
/opt /opt
/opt/local /opt/local
/opt/local/mysql /opt/local/mysql
@ -24,7 +24,7 @@ dirs = ENV['PATH'].split(':') + %w[
GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}" GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}"
if /mswin32/ =~ RUBY_PLATFORM if RUBY_PLATFORM =~ /mswin|mingw/
inc, lib = dir_config('mysql') inc, lib = dir_config('mysql')
exit 1 unless have_library("libmysql") exit 1 unless have_library("libmysql")
elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then
@ -57,7 +57,9 @@ end
asplode h unless have_header h asplode h unless have_header h
end end
$CFLAGS << ' -Wall -funroll-loops' unless RUBY_PLATFORM =~ /mswin/
$CFLAGS << ' -Wall -funroll-loops'
end
# $CFLAGS << ' -O0 -ggdb3 -Wextra' # $CFLAGS << ' -O0 -ggdb3 -Wextra'
create_makefile('mysql2/mysql2') create_makefile('mysql2/mysql2')