mcbuild 0.0.12 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mcbuild.rb +21 -4
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ea4f037ff215ebdc917095027295ba8645fa663
4
- data.tar.gz: 365c341ebb2cb8e3ec15de40df0153357045ef5a
3
+ metadata.gz: fa4238aad7a2ccce113c01d0db5c8ed549d1d238
4
+ data.tar.gz: 662179cca09098b76e173f4a1005145905c6bed5
5
5
  SHA512:
6
- metadata.gz: c7c3c6fd1cd9c50dd488571260af948e506d0da9039f42b749f3baa9fa15ac0be5ead7baa6b85248d360a088270881f7e82a022e515e1f12001c7c5e281e40a9
7
- data.tar.gz: 7de5707dd0149b7f81b93118974447c0a6fc6223a839d5f32a09e7231f395b5b217dbe08eaa49b579b2b70fcf30189b0f684e2a2911cd7973c00ba31cfc5b6db
6
+ metadata.gz: 0c51e4932903443c7bb7a5d70344b3ccb7838f013b1aa99ad03d915e33effc6742b8b9918914af84d30c431697d065f417993e5aadd3bd3012e795165bde1b21
7
+ data.tar.gz: c8fbb6efaf9079ba2250b86bcda48082400bdee0c8d34864d159012bf9656101918874986960000aad51003c92656a0b42ccf8b47c150879d6b3335c2fc83267
data/lib/mcbuild.rb CHANGED
@@ -3,6 +3,10 @@ require 'find'
3
3
  require 'fileutils'
4
4
 
5
5
  class MCConfig
6
+ def self.support_machines
7
+ ['x86_64', 'armv6', 'armv7', 'armv7s', 'arm64']
8
+ end
9
+
6
10
  def self.x86_64
7
11
  'x86_64'
8
12
  end
@@ -33,6 +37,17 @@ class MCConfig
33
37
  end
34
38
 
35
39
  class MCBuild
40
+ def self.detect_machine
41
+ ret = MCConfig.x86_64
42
+ mach = %x[uname -m].strip
43
+ MCConfig.support_machines.each { |supportm|
44
+ if mach.include? supportm
45
+ ret = supportm
46
+ end
47
+ }
48
+ ret
49
+ end
50
+
36
51
  def self.noArgs(valid_args)
37
52
  ARGV.each { |arg|
38
53
  valid_args.each { |va|
@@ -88,21 +103,23 @@ class MCBuild
88
103
  end
89
104
 
90
105
  def initialize(dir)
106
+ @mach = MCBuild.detect_machine
91
107
  @d = remove_slash(dir)
92
- @headers = []
108
+
93
109
  @name = "mcdefault"
94
110
  @fext = ".c"
95
111
  @oext = ".o"
96
112
  @aext = ".a"
97
- @mach = "x86_64"
98
113
  @std = "c99"
99
114
  @flags = ""
100
115
  @outpath = "_build"
116
+
117
+ @headers = []
101
118
  @excludes = []
102
119
  @dependency = []
103
120
 
104
- @compile_arg = " -I#{@d}/#{@outpath}/archive"
105
- @link_arg = " -L#{@d}/#{@outpath}/archive"
121
+ @compile_arg = " -I#{self.export_path}"
122
+ @link_arg = " -L#{self.export_path}"
106
123
  end
107
124
 
108
125
  def export_path
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mcbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sun Yuli
@@ -17,9 +17,9 @@ extensions: []
17
17
  extra_rdoc_files: []
18
18
  files:
19
19
  - lib/mcbuild.rb
20
- homepage: https://github.com/sunpaq
20
+ homepage: https://github.com/sunpaq/mcbuild
21
21
  licenses:
22
- - BSD
22
+ - BSD-3-Clause
23
23
  metadata: {}
24
24
  post_install_message:
25
25
  rdoc_options: []