mkmf-lite 0.6.0 → 0.7.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e9c5878b974662c777fea5c8d6d31df14c3d098168a3cf393f8849cb0e9b4277
4
- data.tar.gz: 363a30d11f1c788cb8a234b221e8a937f2f2b47d0fb71fcfdfecab5e21a9847b
3
+ metadata.gz: 72c07ed9aa3d8aef12735ec24829df062a4e0461251cbc756f1b45e4e7db0c84
4
+ data.tar.gz: '04393aeb022d6686e32406dc15f0370ca128ca65508ef11d07c477c1049a3728'
5
5
  SHA512:
6
- metadata.gz: 96fc5d53b094dae8f3fbe95a0e946e51c304855ff5363961a9d7906b9724321b585f7d69bbce903f861673ced068547fc17bdcd3a56a5c921ef51784b3f6c1d3
7
- data.tar.gz: fd8e851d41e663ab6fe3419ca8892fae78be63d8260eca88a4856067ed8de17030adf42001c1a9bd0944ffa36186b33bec3e99d0a2d43b896a08cfbd40ac4f8a
6
+ metadata.gz: 69323d948af2a1c02bdb3b2189b083f66a19438c6ecfa142414b25f46465aa2c5e1860c3993d6dbac69eb337de939ef80defce1caa65267c25db6a9a5f1b9148
7
+ data.tar.gz: cd7610faf9fcc1638980e4938b87fa73a9beb6376e291c51ba4fdc79e616a01e4db2493211d55ccf07d1f58c94b077e15c573a403bc363f42c657b4005f347b9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.7.0 - 13-Sep-2024
2
+ * Append typical library switches to the compiler command. There was a private
3
+ method already in the code but I wasn't using it.
4
+ * Append DEFS if present in your RbConfig options. This was mainly to ensure
5
+ that FILE_OFFSET_BITS is passed, if present, but there could be other
6
+ macros in theory.
7
+
1
8
  ## 0.6.0 - 26-Sep-2023
2
9
  * Added the memoist gem and memoized the results of all public methods since
3
10
  the odds of them changing between calls is basically zero.
data/Rakefile CHANGED
@@ -26,4 +26,9 @@ RuboCop::RakeTask.new
26
26
  desc "Run the test suite"
27
27
  RSpec::Core::RakeTask.new(:spec)
28
28
 
29
+ # Clean up afterwards
30
+ Rake::Task[:spec].enhance do
31
+ Rake::Task[:clean].invoke
32
+ end
33
+
29
34
  task :default => :spec
data/lib/mkmf/lite.rb CHANGED
@@ -16,10 +16,14 @@ module Mkmf
16
16
  extend Memoist
17
17
 
18
18
  # The version of the mkmf-lite library
19
- MKMF_LITE_VERSION = '0.6.0'
19
+ MKMF_LITE_VERSION = '0.7.0'
20
20
 
21
21
  private
22
22
 
23
+ def cpp_defs
24
+ RbConfig::CONFIG['DEFS']
25
+ end
26
+
23
27
  # rubocop:disable Layout/LineLength
24
28
  def cpp_command
25
29
  command = RbConfig::CONFIG['CC'] || RbConfig::CONFIG['CPP'] || File.which('cc') || File.which('gcc') || File.which('cl')
@@ -44,11 +48,11 @@ module Mkmf
44
48
 
45
49
  memoize :cpp_out_file
46
50
 
47
- # TODO: We should adjust this based on OS. For now we're using
48
- # arguments I think you'll typically see set on Linux and BSD.
49
51
  def cpp_libraries
50
- if RbConfig::CONFIG['LIBS']
51
- RbConfig::CONFIG['LIBS'] + RbConfig::CONFIG['LIBRUBYARG']
52
+ return if File::ALT_SEPARATOR && RbConfig::CONFIG['CPP'] =~ /^cl/
53
+
54
+ if cpp_command =~ /clang/i
55
+ '-Lrt -Ldl -Lcrypt -Lm'
52
56
  else
53
57
  '-lrt -ldl -lcrypt -lm'
54
58
  end
@@ -205,7 +209,7 @@ module Mkmf
205
209
  Dir.chdir(Dir.tmpdir) do
206
210
  File.write(cpp_source_file, code)
207
211
 
208
- command = "#{cpp_command} "
212
+ command = "#{cpp_command} #{cpp_libraries} #{cpp_defs} "
209
213
  command += "#{cpp_out_file} "
210
214
  command += cpp_source_file
211
215
 
@@ -254,9 +258,9 @@ module Mkmf
254
258
  File.write(cpp_source_file, code)
255
259
 
256
260
  if command_options
257
- command = "#{cpp_command} #{command_options} "
261
+ command = "#{cpp_command} #{command_options} #{cpp_libraries} #{cpp_defs} "
258
262
  else
259
- command = "#{cpp_command} "
263
+ command = "#{cpp_command} #{cpp_libraries} #{cpp_defs} "
260
264
  end
261
265
 
262
266
  command += "#{cpp_out_file} "
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.6.0'
6
+ spec.version = '0.7.0'
7
7
  spec.author = 'Daniel J. Berger'
8
8
  spec.license = 'Apache-2.0'
9
9
  spec.email = 'djberg96@gmail.com'
@@ -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.6.0')
23
+ expect(described_class::MKMF_LITE_VERSION).to eq('0.7.0')
24
24
  expect(described_class::MKMF_LITE_VERSION).to be_frozen
25
25
  end
26
26
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mkmf-lite
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel J. Berger
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain:
11
11
  - |
@@ -35,7 +35,7 @@ cert_chain:
35
35
  ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
36
36
  WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
37
37
  -----END CERTIFICATE-----
38
- date: 2023-09-26 00:00:00.000000000 Z
38
+ date: 2024-09-14 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: ptools
@@ -160,7 +160,7 @@ metadata:
160
160
  source_code_uri: https://github.com/djberg96/mkmf-lite
161
161
  wiki_uri: https://github.com/djberg96/mkmf-lite/wiki
162
162
  rubygems_mfa_required: 'true'
163
- post_install_message:
163
+ post_install_message:
164
164
  rdoc_options: []
165
165
  require_paths:
166
166
  - lib
@@ -175,8 +175,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  - !ruby/object:Gem::Version
176
176
  version: '0'
177
177
  requirements: []
178
- rubygems_version: 3.3.26
179
- signing_key:
178
+ rubygems_version: 3.5.11
179
+ signing_key:
180
180
  specification_version: 4
181
181
  summary: A lighter version of mkmf designed for use as a library
182
182
  test_files:
metadata.gz.sig CHANGED
Binary file