From 4c27a1e4fcd8be4a11f5ba2bee416e0968bca182 Mon Sep 17 00:00:00 2001 From: Luis Lavena Date: Wed, 11 Aug 2010 22:45:52 +0800 Subject: [PATCH] extconf detect properly mingw. --- ext/mysql2/extconf.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ext/mysql2/extconf.rb b/ext/mysql2/extconf.rb index bc48e6b..c8806d0 100644 --- a/ext/mysql2/extconf.rb +++ b/ext/mysql2/extconf.rb @@ -10,7 +10,7 @@ have_func('rb_thread_blocking_region') # borrowed from mysqlplus # 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/local /opt/local/mysql @@ -24,7 +24,7 @@ dirs = ENV['PATH'].split(':') + %w[ GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}" -if /mswin32/ =~ RUBY_PLATFORM +if RUBY_PLATFORM =~ /mswin|mingw/ inc, lib = dir_config('mysql') exit 1 unless have_library("libmysql") elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then @@ -57,7 +57,9 @@ end asplode h unless have_header h end -$CFLAGS << ' -Wall -funroll-loops' +unless RUBY_PLATFORM =~ /mswin/ + $CFLAGS << ' -Wall -funroll-loops' +end # $CFLAGS << ' -O0 -ggdb3 -Wextra' create_makefile('mysql2/mysql2')