Attempt to enable static linking for Windows

This commit is contained in:
Luis Lavena 2010-09-26 17:26:05 -03:00
parent 685538ce52
commit 7787f25f3f
2 changed files with 4 additions and 2 deletions

View File

@ -26,7 +26,8 @@ GLOB = "{#{dirs.join(',')}}/{mysql_config,mysql_config5}"
if RUBY_PLATFORM =~ /mswin|mingw/ if RUBY_PLATFORM =~ /mswin|mingw/
inc, lib = dir_config('mysql') inc, lib = dir_config('mysql')
exit 1 unless have_library("libmysql") library = enable_config('static') ? 'mysqlclient' : 'libmysql'
exit 1 unless have_library(library)
elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then elsif mc = (with_config('mysql-config') || Dir[GLOB].first) then
mc = Dir[GLOB].first if mc == true mc = Dir[GLOB].first if mc == true
cflags = `#{mc} --cflags`.chomp cflags = `#{mc} --cflags`.chomp

View File

@ -15,7 +15,8 @@ Rake::ExtensionTask.new("mysql2", gemspec) do |ext|
# DRY options feed into compile or cross-compile process # DRY options feed into compile or cross-compile process
windows_options = [ windows_options = [
"--with-mysql-include=#{mysql_lib}/include", "--with-mysql-include=#{mysql_lib}/include",
"--with-mysql-lib=#{mysql_lib}/lib/opt" "--with-mysql-lib=#{mysql_lib}/lib/opt",
'--enable-static'
] ]
# automatically add build options to avoid need of manual input # automatically add build options to avoid need of manual input