chuyeow-memcached 0.17.4 → 0.17.7

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ v0.17.7. Disable dependency tracking.
3
+
4
+ v0.17.6. Again.
5
+
6
+ v0.17.5. Fuss with archflags.
7
+
2
8
  v0.17.4. Don't segfault on invalid keys in get_multi.
3
9
 
4
10
  v0.17.3. Compile with -Os. Retry once on Memcached::ClientError.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.17.4
1
+ 0.17.7
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chuyeow-memcached}
8
- s.version = "0.17.4"
8
+ s.version = "0.17.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Cheah Chu Yeow"]
@@ -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
- DARWIN = `uname -sp` == "Darwin i386\n"
8
-
9
- # Is there a better way to do this?
10
- archflags = if ENV['ARCHFLAGS']
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='#{cxxflags}' || true 2>&1")
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")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chuyeow-memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.4
4
+ version: 0.17.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cheah Chu Yeow