radar-mysql 2.8.2 → 2.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/extconf.rb +70 -0
- metadata +8 -8
data/extconf.rb
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
require 'mkmf'
|
2
|
+
|
3
|
+
if /mswin32/ =~ RUBY_PLATFORM
|
4
|
+
inc, lib = dir_config('mysql')
|
5
|
+
exit 1 unless have_library("libmysql")
|
6
|
+
elsif mc = with_config('mysql-config') then
|
7
|
+
mc = 'mysql_config' if mc == true
|
8
|
+
cflags = `#{mc} --cflags`.chomp
|
9
|
+
exit 1 if $? != 0
|
10
|
+
libs = `#{mc} --libs`.chomp
|
11
|
+
exit 1 if $? != 0
|
12
|
+
$CPPFLAGS += ' ' + cflags
|
13
|
+
$libs = libs + " " + $libs
|
14
|
+
else
|
15
|
+
inc, lib = dir_config('mysql', '/usr/local')
|
16
|
+
libs = ['m', 'z', 'socket', 'nsl', 'mygcc']
|
17
|
+
while not find_library('mysqlclient', 'mysql_query', lib, "#{lib}/mysql") do
|
18
|
+
exit 1 if libs.empty?
|
19
|
+
have_library(libs.shift)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
have_func('mysql_ssl_set')
|
24
|
+
have_func('rb_str_set_len')
|
25
|
+
|
26
|
+
if have_header('mysql.h') then
|
27
|
+
src = "#include <errmsg.h>\n#include <mysqld_error.h>\n"
|
28
|
+
elsif have_header('mysql/mysql.h') then
|
29
|
+
src = "#include <mysql/errmsg.h>\n#include <mysql/mysqld_error.h>\n"
|
30
|
+
else
|
31
|
+
exit 1
|
32
|
+
end
|
33
|
+
|
34
|
+
# make mysql constant
|
35
|
+
File.open("conftest.c", "w") do |f|
|
36
|
+
f.puts src
|
37
|
+
end
|
38
|
+
if defined? cpp_command then
|
39
|
+
cpp = Config.expand(cpp_command(''))
|
40
|
+
else
|
41
|
+
cpp = Config.expand sprintf(CPP, $CPPFLAGS, $CFLAGS, '')
|
42
|
+
end
|
43
|
+
if /mswin32/ =~ RUBY_PLATFORM && !/-E/.match(cpp)
|
44
|
+
cpp << " -E"
|
45
|
+
end
|
46
|
+
unless system "#{cpp} > confout" then
|
47
|
+
exit 1
|
48
|
+
end
|
49
|
+
File.unlink "conftest.c"
|
50
|
+
|
51
|
+
error_syms = []
|
52
|
+
IO.foreach('confout') do |l|
|
53
|
+
next unless l =~ /errmsg\.h|mysqld_error\.h/
|
54
|
+
fn = l.split(/\"/)[1]
|
55
|
+
IO.foreach(fn) do |m|
|
56
|
+
if m =~ /^#define\s+([CE]R_[0-9A-Z_]+)/ then
|
57
|
+
error_syms << $1
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
File.unlink 'confout'
|
62
|
+
error_syms.uniq!
|
63
|
+
|
64
|
+
File.open('error_const.h', 'w') do |f|
|
65
|
+
error_syms.each do |s|
|
66
|
+
f.puts " rb_define_mysql_const(#{s});"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
create_makefile("mysql")
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radar-mysql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.8.
|
4
|
+
version: 2.8.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Bigg
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-11 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -17,19 +17,19 @@ description: Ruby 1.9 compatible version of MySQL gem
|
|
17
17
|
email: radarlistener@gmail.com
|
18
18
|
executables: []
|
19
19
|
|
20
|
-
extensions:
|
21
|
-
|
20
|
+
extensions:
|
21
|
+
- extconf.rb
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README.html
|
24
24
|
files:
|
25
25
|
- README.html
|
26
|
-
has_rdoc:
|
26
|
+
has_rdoc: false
|
27
27
|
homepage: http://github.com/radar/mysql
|
28
28
|
post_install_message:
|
29
|
-
rdoc_options:
|
30
|
-
|
29
|
+
rdoc_options: []
|
30
|
+
|
31
31
|
require_paths:
|
32
|
-
-
|
32
|
+
- .
|
33
33
|
required_ruby_version: !ruby/object:Gem::Requirement
|
34
34
|
requirements:
|
35
35
|
- - ">="
|