|
3 | 3 |
|
4 | 4 | def asplode lib
|
5 | 5 | if RUBY_PLATFORM =~ /mingw|mswin/
|
6 |
| - abort "-----\n#{lib} is missing. please check your installation of mysql and try again.\n-----" |
| 6 | + abort "-----\n#{lib} is missing. Check your installation of MySQL or Connector/C, and try again.\n-----" |
7 | 7 | elsif RUBY_PLATFORM =~ /darwin/
|
8 |
| - abort "-----\n#{lib} is missing. Try 'brew install mysql', check your installation of mysql and try again.\n-----" |
| 8 | + abort "-----\n#{lib} is missing. You may need to 'brew install mysql' or 'port install mysql', and try again.\n-----" |
9 | 9 | else
|
10 |
| - abort "-----\n#{lib} is missing. Try 'apt-get install libmysqlclient-dev' or |
11 |
| -'yum install mysql-devel', check your installation of mysql and try again.\n-----" |
| 10 | + abort "-----\n#{lib} is missing. You may need to 'apt-get install libmysqlclient-dev' or 'yum install mysql-devel', and try again.\n-----" |
12 | 11 | end
|
13 | 12 | end
|
14 | 13 |
|
@@ -73,15 +72,22 @@ def asplode lib
|
73 | 72 | rpath_dir = libs
|
74 | 73 | else
|
75 | 74 | inc, lib = dir_config('mysql', '/usr/local')
|
76 |
| - libs = ['m', 'z', 'socket', 'nsl', 'mygcc'] |
77 |
| - found = false |
78 |
| - while not find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") do |
79 |
| - exit 1 if libs.empty? |
80 |
| - found ||= have_library(libs.shift) |
| 75 | + unless find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") |
| 76 | + found = false |
| 77 | + # For some systems and some versions of libmysqlclient, there were extra |
| 78 | + # libraries needed to link. Try each typical extra library, add it to the |
| 79 | + # global compile flags, and see if that allows us to link libmysqlclient. |
| 80 | + warn "-----\nlibmysqlclient is missing. Trying again with extra runtime libraries...\n-----" |
| 81 | + |
| 82 | + %w{ m z socket nsl mygcc }.each do |extra_lib| |
| 83 | + if have_library(extra_lib) && find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") |
| 84 | + found = true |
| 85 | + break |
| 86 | + end |
| 87 | + end |
| 88 | + asplode('libmysqlclient') unless found |
81 | 89 | end
|
82 | 90 |
|
83 |
| - asplode("mysql client") unless found |
84 |
| - |
85 | 91 | rpath_dir = lib
|
86 | 92 | end
|
87 | 93 |
|
|
0 commit comments