mkmf-lite 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +3 -0
- data/README +1 -1
- data/lib/mkmf/lite.rb +21 -6
- data/mkmf-lite.gemspec +2 -2
- data/test/test_mkmf_lite.rb +4 -4
- metadata +60 -70
data/CHANGES
CHANGED
data/README
CHANGED
data/lib/mkmf/lite.rb
CHANGED
@@ -12,7 +12,7 @@ end
|
|
12
12
|
module Mkmf
|
13
13
|
module Lite
|
14
14
|
# The version of the mkmf-lite library
|
15
|
-
MKMF_LITE_VERSION = '0.2.
|
15
|
+
MKMF_LITE_VERSION = '0.2.4'
|
16
16
|
|
17
17
|
@@cpp_command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP']
|
18
18
|
@@cpp_srcfile = 'conftest.c'
|
@@ -43,14 +43,24 @@ module Mkmf
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
# Check for the presence of the given +header+ file.
|
46
|
+
# Check for the presence of the given +header+ file. You may optionally
|
47
|
+
# provide a list of directories to search.
|
47
48
|
#
|
48
49
|
# Returns true if found, or false if not found.
|
49
50
|
#
|
50
|
-
def have_header(header)
|
51
|
+
def have_header(header, *directories)
|
51
52
|
erb = ERB.new(read_template('have_header.erb'))
|
52
53
|
code = erb.result(binding)
|
53
|
-
|
54
|
+
|
55
|
+
if directories.empty?
|
56
|
+
options = nil
|
57
|
+
else
|
58
|
+
options = ""
|
59
|
+
directories.each{ |dir| options += "-I#{dir} " }
|
60
|
+
options.rstrip!
|
61
|
+
end
|
62
|
+
|
63
|
+
try_to_compile(code, options)
|
54
64
|
end
|
55
65
|
|
56
66
|
# Check for the presence of the given +function+ in the common header
|
@@ -197,7 +207,7 @@ module Mkmf
|
|
197
207
|
# Note that $stderr is temporarily redirected to the null device because
|
198
208
|
# we don't actually care about the reason for failure.
|
199
209
|
#
|
200
|
-
def try_to_compile(code)
|
210
|
+
def try_to_compile(code, command_options=nil)
|
201
211
|
begin
|
202
212
|
boolean = false
|
203
213
|
stderr_orig = $stderr.dup
|
@@ -206,7 +216,12 @@ module Mkmf
|
|
206
216
|
Dir.chdir(Dir.tmpdir){
|
207
217
|
File.open(@@cpp_srcfile, 'w'){ |fh| fh.write(code) }
|
208
218
|
|
209
|
-
|
219
|
+
if command_options
|
220
|
+
command = @@cpp_command + ' ' + command_options + ' '
|
221
|
+
else
|
222
|
+
command = @@cpp_command + ' '
|
223
|
+
end
|
224
|
+
|
210
225
|
command += @@cpp_outfile + ' '
|
211
226
|
command += @@cpp_srcfile
|
212
227
|
|
data/mkmf-lite.gemspec
CHANGED
@@ -3,11 +3,11 @@ require 'rubygems'
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'mkmf-lite'
|
5
5
|
spec.summary = 'A lighter version of mkmf designed for use as a library'
|
6
|
-
spec.version = '0.2.
|
6
|
+
spec.version = '0.2.4'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.license = 'Artistic 2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
10
|
-
spec.homepage = 'http://
|
10
|
+
spec.homepage = 'http://github.com/djberg96/mkmf-lite'
|
11
11
|
spec.test_file = 'test/test_mkmf_lite.rb'
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
|
data/test/test_mkmf_lite.rb
CHANGED
@@ -21,7 +21,7 @@ class TC_Mkmf_Lite < Test::Unit::TestCase
|
|
21
21
|
end
|
22
22
|
|
23
23
|
test "version information" do
|
24
|
-
assert_equal('0.2.
|
24
|
+
assert_equal('0.2.4', MKMF_LITE_VERSION)
|
25
25
|
end
|
26
26
|
|
27
27
|
test "have_header basic functionality" do
|
@@ -33,9 +33,9 @@ class TC_Mkmf_Lite < Test::Unit::TestCase
|
|
33
33
|
assert_false(have_header('foobar.h'))
|
34
34
|
end
|
35
35
|
|
36
|
-
test "have_header
|
37
|
-
|
38
|
-
|
36
|
+
test "have_header accepts an array of directories as a second argument" do
|
37
|
+
assert_nothing_raised{ have_header('stdio.h', '/usr/local/include') }
|
38
|
+
assert_nothing_raised{ have_header('stdio.h', '/usr/local/include', '/usr/include') }
|
39
39
|
end
|
40
40
|
|
41
41
|
test "have_func basic functionality" do
|
metadata
CHANGED
@@ -1,107 +1,97 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkmf-lite
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.4
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 3
|
10
|
-
version: 0.2.3
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Daniel J. Berger
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-03-07 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: ptools
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
version: "0"
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
32
22
|
type: :runtime
|
33
|
-
version_requirements: *id001
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: test-unit
|
36
23
|
prerelease: false
|
37
|
-
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: test-unit
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
38
33
|
none: false
|
39
|
-
requirements:
|
40
|
-
- -
|
41
|
-
- !ruby/object:Gem::Version
|
42
|
-
hash: 31
|
43
|
-
segments:
|
44
|
-
- 2
|
45
|
-
- 4
|
46
|
-
- 0
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
47
37
|
version: 2.4.0
|
48
38
|
type: :development
|
49
|
-
|
50
|
-
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 2.4.0
|
46
|
+
description: ! " The mkmf-lite library is a light version of the the mkmf library\n
|
47
|
+
\ designed for use as a library. It does not create packages, builds,\n or
|
48
|
+
log files of any kind. Instead, it provides mixin methods that you\n can use
|
49
|
+
in FFI or tests to check for the presence of header files,\n constants, and so
|
50
|
+
on.\n"
|
51
51
|
email: djberg96@gmail.com
|
52
52
|
executables: []
|
53
|
-
|
54
53
|
extensions: []
|
55
|
-
|
56
|
-
extra_rdoc_files:
|
54
|
+
extra_rdoc_files:
|
57
55
|
- CHANGES
|
58
56
|
- README
|
59
57
|
- MANIFEST
|
60
|
-
files:
|
61
|
-
- test/test_mkmf_lite.rb
|
62
|
-
- Rakefile
|
63
|
-
- MANIFEST
|
58
|
+
files:
|
64
59
|
- CHANGES
|
65
|
-
- lib/mkmf/
|
60
|
+
- lib/mkmf/lite.rb
|
66
61
|
- lib/mkmf/templates/check_sizeof.erb
|
67
|
-
- lib/mkmf/templates/
|
62
|
+
- lib/mkmf/templates/have_func.erb
|
68
63
|
- lib/mkmf/templates/have_func_pointer.erb
|
64
|
+
- lib/mkmf/templates/have_header.erb
|
69
65
|
- lib/mkmf/templates/have_struct_member.erb
|
70
|
-
-
|
71
|
-
- README
|
66
|
+
- MANIFEST
|
72
67
|
- mkmf-lite.gemspec
|
73
|
-
|
74
|
-
|
68
|
+
- Rakefile
|
69
|
+
- README
|
70
|
+
- test/test_mkmf_lite.rb
|
71
|
+
homepage: http://github.com/djberg96/mkmf-lite
|
72
|
+
licenses:
|
75
73
|
- Artistic 2.0
|
76
74
|
post_install_message:
|
77
75
|
rdoc_options: []
|
78
|
-
|
79
|
-
require_paths:
|
76
|
+
require_paths:
|
80
77
|
- lib
|
81
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
78
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
79
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
|
87
|
-
|
88
|
-
- 0
|
89
|
-
version: "0"
|
90
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
85
|
none: false
|
92
|
-
requirements:
|
93
|
-
- -
|
94
|
-
- !ruby/object:Gem::Version
|
95
|
-
|
96
|
-
segments:
|
97
|
-
- 0
|
98
|
-
version: "0"
|
86
|
+
requirements:
|
87
|
+
- - ! '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
99
90
|
requirements: []
|
100
|
-
|
101
91
|
rubyforge_project: shards
|
102
|
-
rubygems_version: 1.8.
|
92
|
+
rubygems_version: 1.8.23
|
103
93
|
signing_key:
|
104
94
|
specification_version: 3
|
105
95
|
summary: A lighter version of mkmf designed for use as a library
|
106
|
-
test_files:
|
96
|
+
test_files:
|
107
97
|
- test/test_mkmf_lite.rb
|