actsasflinn-ruby-tokyotyrant 0.1.1 → 0.1.2
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/ext/extconf.rb +39 -0
- metadata +3 -3
data/ext/extconf.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# ENV["RC_ARCHS"] = `uname -m`.chomp if `uname -sr` =~ /^Darwin/
|
2
|
+
#
|
3
|
+
# require 'mkmf'
|
4
|
+
#
|
5
|
+
|
6
|
+
if RUBY_PLATFORM =~ /darwin/
|
7
|
+
ENV["RC_ARCHS"] = `uname -m`.chomp if `uname -sr` =~ /^Darwin/
|
8
|
+
|
9
|
+
# On PowerPC the defaults are fine
|
10
|
+
ENV["RC_ARCHS"] = '' if `uname -m` =~ /^Power Macintosh/
|
11
|
+
end
|
12
|
+
|
13
|
+
# Loads mkmf which is used to make makefiles for Ruby extensions
|
14
|
+
require 'mkmf'
|
15
|
+
|
16
|
+
# Give it a name
|
17
|
+
extension_name = 'tokyo_tyrant'
|
18
|
+
|
19
|
+
dir_config("tokyo_tyrant")
|
20
|
+
|
21
|
+
# NOTE: use GCC flags unless Visual C compiler is used
|
22
|
+
$CFLAGS << ' -Wall ' unless RUBY_PLATFORM =~ /mswin/
|
23
|
+
|
24
|
+
if RUBY_VERSION < '1.8.6'
|
25
|
+
$CFLAGS << ' -DRUBY_LESS_THAN_186'
|
26
|
+
end
|
27
|
+
|
28
|
+
# Do the work
|
29
|
+
|
30
|
+
find_library(*['tokyotyrant', "tcrdbnew", dir_config('libtokyotyrant').last].compact) or
|
31
|
+
raise "shared library 'libtokyotyrant' not found"
|
32
|
+
|
33
|
+
['tctdb.h',
|
34
|
+
'tcrdb.h'].each do |header|
|
35
|
+
find_header(*[header, dir_config('libtokyotyrant').first].compact) or
|
36
|
+
raise "header file '#{header}' not found"
|
37
|
+
end
|
38
|
+
|
39
|
+
create_makefile 'tokyo_tyrant'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actsasflinn-ruby-tokyotyrant
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Flinn
|
@@ -17,8 +17,8 @@ description:
|
|
17
17
|
email: flinn@actsasflinn.com
|
18
18
|
executables: []
|
19
19
|
|
20
|
-
extensions:
|
21
|
-
|
20
|
+
extensions:
|
21
|
+
- ext/extconf.rb
|
22
22
|
extra_rdoc_files:
|
23
23
|
- README.rdoc
|
24
24
|
files:
|