mkmf-lite 0.7.0 → 0.7.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGES.md +6 -0
- data/README.md +2 -2
- data/lib/mkmf/lite.rb +35 -7
- data/mkmf-lite.gemspec +4 -2
- data/spec/mkmf_lite_spec.rb +5 -5
- data.tar.gz.sig +0 -0
- metadata +5 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e85aa72d40bbefbc3868cfce08cdadcd27f2715f96aead7b7055808ea724f5f
|
4
|
+
data.tar.gz: 415625060ad8e4d9d6998f581af4eeb0adb5c69f0a012a827956cfc19f173ff7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af36e6b2ffc4d90cb1faf28ebe141547b2459819f95caf6b5dded3e51dce35667eb8ea9b0bf81443146495f42c341f56f81d27d3b7b3a7862e9c2a492b4c848d
|
7
|
+
data.tar.gz: f78fc8d5f051406690b1d7b1b362868be38fd25a45ad140cec40bc9aaf58d0ebdf2a2b53b5c0ca4660954266938be91405660bee3fe85ad0f3a340002d92e25b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
## 0.7.2 - 13-Mar-2025
|
2
|
+
* Allow option of adding directories to check_sizeof and check_valueof methods.
|
3
|
+
|
4
|
+
## 0.7.1 - 29-Sep-2024
|
5
|
+
* Skip adding compiler switches for JRuby, which chokes on them for some reason.
|
6
|
+
|
1
7
|
## 0.7.0 - 13-Sep-2024
|
2
8
|
* Append typical library switches to the compiler command. There was a private
|
3
9
|
method already in the code but I wasn't using it.
|
data/README.md
CHANGED
@@ -48,13 +48,13 @@ since they wouldn't ever change without requiring a reboot/restart of your
|
|
48
48
|
server, container, etc, anyway.
|
49
49
|
|
50
50
|
## Known Issues
|
51
|
-
|
51
|
+
JRuby may emit warnings on some platforms.
|
52
52
|
|
53
53
|
## License
|
54
54
|
Apache-2.0
|
55
55
|
|
56
56
|
## Copyright
|
57
|
-
(C) 2010-
|
57
|
+
(C) 2010-2024 Daniel J. Berger
|
58
58
|
All Rights Reserved
|
59
59
|
|
60
60
|
## Warranty
|
data/lib/mkmf/lite.rb
CHANGED
@@ -16,7 +16,7 @@ module Mkmf
|
|
16
16
|
extend Memoist
|
17
17
|
|
18
18
|
# The version of the mkmf-lite library
|
19
|
-
MKMF_LITE_VERSION = '0.7.
|
19
|
+
MKMF_LITE_VERSION = '0.7.2'
|
20
20
|
|
21
21
|
private
|
22
22
|
|
@@ -24,6 +24,12 @@ module Mkmf
|
|
24
24
|
RbConfig::CONFIG['DEFS']
|
25
25
|
end
|
26
26
|
|
27
|
+
def jruby?
|
28
|
+
defined?(JRUBY_VERSION) ? true : false
|
29
|
+
end
|
30
|
+
|
31
|
+
memoize :jruby?
|
32
|
+
|
27
33
|
# rubocop:disable Layout/LineLength
|
28
34
|
def cpp_command
|
29
35
|
command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP'] || File.which('cc') || File.which('gcc') || File.which('cl')
|
@@ -50,6 +56,7 @@ module Mkmf
|
|
50
56
|
|
51
57
|
def cpp_libraries
|
52
58
|
return if File::ALT_SEPARATOR && RbConfig::CONFIG['CPP'] =~ /^cl/
|
59
|
+
return if jruby?
|
53
60
|
|
54
61
|
if cpp_command =~ /clang/i
|
55
62
|
'-Lrt -Ldl -Lcrypt -Lm'
|
@@ -128,12 +135,20 @@ module Mkmf
|
|
128
135
|
# If this method fails an error is raised. This could happen if the constant
|
129
136
|
# can't be found and/or the header files do not include the indicated constant.
|
130
137
|
#
|
131
|
-
def check_valueof(constant, headers = [])
|
138
|
+
def check_valueof(constant, headers = [], *directories)
|
132
139
|
headers = get_header_string(headers)
|
133
140
|
erb = ERB.new(read_template('check_valueof.erb'))
|
134
141
|
code = erb.result(binding)
|
135
142
|
|
136
|
-
|
143
|
+
if directories.empty?
|
144
|
+
options = nil
|
145
|
+
else
|
146
|
+
options = ''
|
147
|
+
directories.each{ |dir| options += "-I#{dir} " }
|
148
|
+
options.rstrip!
|
149
|
+
end
|
150
|
+
|
151
|
+
try_to_execute(code, options)
|
137
152
|
end
|
138
153
|
|
139
154
|
memoize :check_valueof
|
@@ -151,12 +166,20 @@ module Mkmf
|
|
151
166
|
# utsname = check_sizeof('struct utsname', 'sys/utsname.h')
|
152
167
|
# end
|
153
168
|
#
|
154
|
-
def check_sizeof(type, headers = [])
|
169
|
+
def check_sizeof(type, headers = [], *directories)
|
155
170
|
headers = get_header_string(headers)
|
156
171
|
erb = ERB.new(read_template('check_sizeof.erb'))
|
157
172
|
code = erb.result(binding)
|
158
173
|
|
159
|
-
|
174
|
+
if directories.empty?
|
175
|
+
options = nil
|
176
|
+
else
|
177
|
+
options = ''
|
178
|
+
directories.each{ |dir| options += "-I#{dir} " }
|
179
|
+
options.rstrip!
|
180
|
+
end
|
181
|
+
|
182
|
+
try_to_execute(code, options)
|
160
183
|
end
|
161
184
|
|
162
185
|
memoize :check_sizeof
|
@@ -199,7 +222,7 @@ module Mkmf
|
|
199
222
|
# we don't actually care about the reason for failure, though a Ruby
|
200
223
|
# error is raised if the compilation step fails.
|
201
224
|
#
|
202
|
-
def try_to_execute(code)
|
225
|
+
def try_to_execute(code, command_options = nil)
|
203
226
|
begin
|
204
227
|
result = 0
|
205
228
|
|
@@ -209,7 +232,12 @@ module Mkmf
|
|
209
232
|
Dir.chdir(Dir.tmpdir) do
|
210
233
|
File.write(cpp_source_file, code)
|
211
234
|
|
212
|
-
|
235
|
+
if command_options
|
236
|
+
command = "#{cpp_command} #{command_options} #{cpp_libraries} #{cpp_defs} "
|
237
|
+
else
|
238
|
+
command = "#{cpp_command} #{cpp_libraries} #{cpp_defs} "
|
239
|
+
end
|
240
|
+
|
213
241
|
command += "#{cpp_out_file} "
|
214
242
|
command += cpp_source_file
|
215
243
|
|
data/mkmf-lite.gemspec
CHANGED
@@ -3,7 +3,7 @@ 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.7.
|
6
|
+
spec.version = '0.7.2'
|
7
7
|
spec.author = 'Daniel J. Berger'
|
8
8
|
spec.license = 'Apache-2.0'
|
9
9
|
spec.email = 'djberg96@gmail.com'
|
@@ -27,7 +27,9 @@ Gem::Specification.new do |spec|
|
|
27
27
|
'documentation_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
28
28
|
'source_code_uri' => 'https://github.com/djberg96/mkmf-lite',
|
29
29
|
'wiki_uri' => 'https://github.com/djberg96/mkmf-lite/wiki',
|
30
|
-
'rubygems_mfa_required' => 'true'
|
30
|
+
'rubygems_mfa_required' => 'true',
|
31
|
+
'github_repo' => 'https://github.com/djberg96/mkmf-lite',
|
32
|
+
'funding_uri' => 'https://github.com/sponsors/djberg96'
|
31
33
|
}
|
32
34
|
|
33
35
|
spec.description = <<-EOF
|
data/spec/mkmf_lite_spec.rb
CHANGED
@@ -20,7 +20,7 @@ RSpec.describe Mkmf::Lite do
|
|
20
20
|
|
21
21
|
describe 'constants' do
|
22
22
|
example 'version information' do
|
23
|
-
expect(described_class::MKMF_LITE_VERSION).to eq('0.7.
|
23
|
+
expect(described_class::MKMF_LITE_VERSION).to eq('0.7.2')
|
24
24
|
expect(described_class::MKMF_LITE_VERSION).to be_frozen
|
25
25
|
end
|
26
26
|
end
|
@@ -96,8 +96,8 @@ RSpec.describe Mkmf::Lite do
|
|
96
96
|
expect{ subject.check_valueof }.to raise_error(ArgumentError)
|
97
97
|
end
|
98
98
|
|
99
|
-
example 'check_valueof accepts
|
100
|
-
expect{ subject.check_valueof(constant, 'stdio.h',
|
99
|
+
example 'check_valueof accepts directory arguments' do
|
100
|
+
expect{ subject.check_valueof(constant, 'stdio.h', ['/usr/include']) }.not_to raise_error
|
101
101
|
end
|
102
102
|
|
103
103
|
example 'check_valueof works with one or two arguments' do
|
@@ -122,8 +122,8 @@ RSpec.describe Mkmf::Lite do
|
|
122
122
|
expect{ subject.check_sizeof }.to raise_error(ArgumentError)
|
123
123
|
end
|
124
124
|
|
125
|
-
example 'check_sizeof accepts
|
126
|
-
expect{ subject.check_sizeof('div_t', 'stdlib.h',
|
125
|
+
example 'check_sizeof accepts directory arguments' do
|
126
|
+
expect{ subject.check_sizeof('div_t', 'stdlib.h', ['/usr/include']) }.not_to raise_error
|
127
127
|
end
|
128
128
|
|
129
129
|
example 'check_sizeof works with one or two arguments' do
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mkmf-lite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain:
|
11
10
|
- |
|
@@ -35,7 +34,7 @@ cert_chain:
|
|
35
34
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
35
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
36
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
37
|
+
date: 2025-03-13 00:00:00.000000000 Z
|
39
38
|
dependencies:
|
40
39
|
- !ruby/object:Gem::Dependency
|
41
40
|
name: ptools
|
@@ -160,7 +159,8 @@ metadata:
|
|
160
159
|
source_code_uri: https://github.com/djberg96/mkmf-lite
|
161
160
|
wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
|
162
161
|
rubygems_mfa_required: 'true'
|
163
|
-
|
162
|
+
github_repo: https://github.com/djberg96/mkmf-lite
|
163
|
+
funding_uri: https://github.com/sponsors/djberg96
|
164
164
|
rdoc_options: []
|
165
165
|
require_paths:
|
166
166
|
- lib
|
@@ -175,8 +175,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
175
|
- !ruby/object:Gem::Version
|
176
176
|
version: '0'
|
177
177
|
requirements: []
|
178
|
-
rubygems_version: 3.5
|
179
|
-
signing_key:
|
178
|
+
rubygems_version: 3.6.5
|
180
179
|
specification_version: 4
|
181
180
|
summary: A lighter version of mkmf designed for use as a library
|
182
181
|
test_files:
|
metadata.gz.sig
CHANGED
Binary file
|