mysql2-replication 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/mysql2-replication/extconf.rb +62 -0
- data/ext/mysql2-replication/mysql2_replication.c +1427 -0
- data/lib/mysql2-replication/version.rb +1 -1
- data/mysql2-replication.gemspec +3 -1
- metadata +7 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e53fa99301ddf9de5e0152b67093098271e727d7dbf21f4228bb0f1d1857cc
|
4
|
+
data.tar.gz: 7345a93462c78c4d0fa7ff94f7c14e09005b4119366a58130855de1d3c94a7b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d3cac78675064583fc9f02a6f362a1dc5d5ed75bc7ae61873e734697f72f14ab5c5fe87335370dbb4be3231d604140b0a1e258bc615c730582c9db441ce2823
|
7
|
+
data.tar.gz: fb7bddd05753618b6fcef07c4e8ddea0ac611d9b94df1c80dd51671432799974b84667bb11d72475c405c73c80c56d90363a793fa5b036e29cb11dca3c83c1c8
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "mkmf"
|
4
|
+
|
5
|
+
require "pkg-config"
|
6
|
+
require "native-package-installer"
|
7
|
+
|
8
|
+
def gcc?
|
9
|
+
CONFIG["GCC"] == "yes"
|
10
|
+
end
|
11
|
+
|
12
|
+
def disable_optimization_build_flag(flags)
|
13
|
+
if gcc?
|
14
|
+
RbConfig.expand(flags.dup).gsub(/(^|\s)?-O\d(\s|$)?/, '\\1-O0\\2')
|
15
|
+
else
|
16
|
+
flags
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def enable_debug_build_flag(flags)
|
21
|
+
if gcc?
|
22
|
+
expanded_flags = RbConfig.expand(flags.dup)
|
23
|
+
debug_option_pattern = /(^|\s)-g(?:gdb)?\d?(\s|$)/
|
24
|
+
if debug_option_pattern =~ expanded_flags
|
25
|
+
expanded_flags.gsub(debug_option_pattern, '\\1-ggdb3\\2')
|
26
|
+
else
|
27
|
+
flags + " -ggdb3"
|
28
|
+
end
|
29
|
+
else
|
30
|
+
flags
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
checking_for(checking_message("--enable-debug-build option")) do
|
35
|
+
enable_debug_build = enable_config("debug-build", false)
|
36
|
+
if enable_debug_build
|
37
|
+
$CFLAGS = disable_optimization_build_flag($CFLAGS)
|
38
|
+
$CFLAGS = enable_debug_build_flag($CFLAGS)
|
39
|
+
|
40
|
+
$CXXFLAGS = disable_optimization_build_flag($CXXFLAGS)
|
41
|
+
$CXXFLAGS = enable_debug_build_flag($CXXFLAGS)
|
42
|
+
end
|
43
|
+
enable_debug_build
|
44
|
+
end
|
45
|
+
|
46
|
+
spec = Gem::Specification.find_by_name("mysql2")
|
47
|
+
source_dir = File.join(spec.full_gem_path, "ext", "mysql2")
|
48
|
+
$INCFLAGS += " -I#{source_dir}"
|
49
|
+
|
50
|
+
unless PKGConfig.have_package("libmariadb")
|
51
|
+
unless NativePackageInstaller.install(debian: "libmariadb-dev",
|
52
|
+
homebrew: "mariadb-connector-c",
|
53
|
+
msys2: "libmariadbclient",
|
54
|
+
redhat: "mariadb-connector-c-devel")
|
55
|
+
exit(false)
|
56
|
+
end
|
57
|
+
unless PKGConfig.have_package("libmariadb")
|
58
|
+
exit(false)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
create_makefile("mysql2_replication")
|