chuyeow-memcached 0.17.4 → 0.17.7
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/CHANGELOG +6 -0
- data/VERSION +1 -1
- data/chuyeow-memcached.gemspec +1 -1
- data/ext/extconf.rb +14 -53
- metadata +1 -1
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.17.
|
1
|
+
0.17.7
|
data/chuyeow-memcached.gemspec
CHANGED
data/ext/extconf.rb
CHANGED
@@ -1,28 +1,26 @@
|
|
1
1
|
require 'mkmf'
|
2
|
+
require 'rbconfig'
|
2
3
|
|
3
4
|
HERE = File.expand_path(File.dirname(__FILE__))
|
4
5
|
BUNDLE = Dir.glob("libmemcached-*.tar.gz").first
|
5
6
|
BUNDLE_PATH = BUNDLE.sub(".tar.gz", "")
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
ENV['ARCHFLAGS']
|
12
|
-
elsif Config::CONFIG['host_os'][0,8] == "darwin10"
|
13
|
-
"-arch i386 -arch x86_64"
|
14
|
-
elsif Config::CONFIG['host_os'][0,6] == "darwin"
|
15
|
-
"-arch i386 -arch ppc"
|
8
|
+
if ENV['DEBUG']
|
9
|
+
puts "Setting debug flags."
|
10
|
+
$CFLAGS << " -O0 -ggdb -DHAVE_DEBUG"
|
11
|
+
$EXTRA_CONF = " --enable-debug"
|
16
12
|
end
|
17
13
|
|
14
|
+
$CFLAGS = "#{RbConfig::CONFIG['CFLAGS']} #{$CFLAGS}".gsub("$(cflags)", "")
|
15
|
+
$LDFLAGS = "#{RbConfig::CONFIG['LDFLAGS']} #{$LDFLAGS}".gsub("$(ldflags)", "")
|
16
|
+
$CXXFLAGS = " -std=gnu++98"
|
17
|
+
$CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
|
18
|
+
|
18
19
|
if !ENV["EXTERNAL_LIB"]
|
19
20
|
$includes = " -I#{HERE}/include"
|
20
21
|
$libraries = " -L#{HERE}/lib"
|
21
|
-
|
22
22
|
$CFLAGS = "#{$includes} #{$libraries} #{$CFLAGS}"
|
23
23
|
$LDFLAGS = "#{$libraries} #{$LDFLAGS}"
|
24
|
-
$CPPFLAGS = $ARCH_FLAG = $DLDFLAGS = ""
|
25
|
-
|
26
24
|
$LIBPATH = ["#{HERE}/lib"]
|
27
25
|
$DEFLIBPATH = []
|
28
26
|
|
@@ -38,38 +36,17 @@ if !ENV["EXTERNAL_LIB"]
|
|
38
36
|
puts(cmd = "patch -p1 < libmemcached.patch")
|
39
37
|
raise "'#{cmd}' failed" unless system(cmd)
|
40
38
|
|
41
|
-
Dir.chdir(BUNDLE_PATH) do
|
42
|
-
|
43
|
-
cxxflags = cflags = ldflags = "-fPIC"
|
44
|
-
extraconf = ''
|
45
|
-
|
46
|
-
# again... is there a better way to do this?
|
47
|
-
if DARWIN
|
48
|
-
cflags = "#{cflags} #{archflags}"
|
49
|
-
cxxflags = "-std=gnu++98 #{cflags}"
|
50
|
-
ldflags = "#{ldflags} #{archflags}"
|
51
|
-
extraconf = '--enable-dtrace --disable-dependency-tracking'
|
52
|
-
end
|
53
|
-
|
54
|
-
if ENV['DEBUG']
|
55
|
-
puts "Setting debug flags for libmemcached."
|
56
|
-
cflags << " -O0 -ggdb -DHAVE_DEBUG"
|
57
|
-
extraconf << " --enable-debug"
|
58
|
-
else
|
59
|
-
cflags << " -Os"
|
60
|
-
end
|
39
|
+
Dir.chdir(BUNDLE_PATH) do
|
40
|
+
puts(cmd = "env CFLAGS='-fPIC #{$CFLAGS}' LDFLAGS='-fPIC #{$LDFLAGS}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils --disable-dependency-tracking #{$EXTRA_CONF} 2>&1")
|
61
41
|
|
62
|
-
puts(cmd = "env CFLAGS='#{cflags}' LDFLAGS='#{ldflags}' ./configure --prefix=#{HERE} --without-memcached --disable-shared --disable-utils #{extraconf} 2>&1")
|
63
42
|
raise "'#{cmd}' failed" unless system(cmd)
|
64
|
-
puts(cmd = "make CXXFLAGS='#{
|
43
|
+
puts(cmd = "make CXXFLAGS='#{$CXXFLAGS}' || true 2>&1")
|
65
44
|
raise "'#{cmd}' failed" unless system(cmd)
|
66
45
|
puts(cmd = "make install || true 2>&1")
|
67
46
|
raise "'#{cmd}' failed" unless system(cmd)
|
68
47
|
end
|
69
48
|
|
70
|
-
unless ENV['DEBUG'] or ENV['DEV']
|
71
|
-
system("rm -rf #{BUNDLE_PATH}")
|
72
|
-
end
|
49
|
+
system("rm -rf #{BUNDLE_PATH}") unless ENV['DEBUG'] or ENV['DEV']
|
73
50
|
end
|
74
51
|
end
|
75
52
|
|
@@ -81,22 +58,6 @@ if !ENV["EXTERNAL_LIB"]
|
|
81
58
|
$LIBS << " -lmemcached_gem"
|
82
59
|
end
|
83
60
|
|
84
|
-
$CFLAGS.gsub! /-O\d/, ''
|
85
|
-
|
86
|
-
if ENV['DEBUG']
|
87
|
-
puts "Setting debug flags for gem."
|
88
|
-
$CFLAGS << " -O0 -ggdb -DHAVE_DEBUG"
|
89
|
-
else
|
90
|
-
$CFLAGS << " -Os"
|
91
|
-
end
|
92
|
-
|
93
|
-
if DARWIN
|
94
|
-
$CFLAGS.gsub! /-arch \S+/, ''
|
95
|
-
$CFLAGS << " #{archflags}"
|
96
|
-
$LDFLAGS.gsub! /-arch \S+/, ''
|
97
|
-
$LDFLAGS << " #{archflags}"
|
98
|
-
end
|
99
|
-
|
100
61
|
if ENV['SWIG']
|
101
62
|
puts "Running SWIG."
|
102
63
|
puts(cmd = "swig #{$includes} -ruby -autorename rlibmemcached.i")
|