autorake 2.1.1 → 2.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 +8 -8
- data/lib/autorake.rb +2 -2
- data/lib/autorake/compile.rb +31 -19
- data/lib/autorake/definition.rb +6 -6
- data/lib/autorake/version.rb +1 -1
- data/samples/plainc/Rakefile +1 -1
- data/samples/plainc/hello.c +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZGVkY2MwNDQwNWY2YzYwMmE3OGI2MTc4ZGQwNWVlZTNlODhiNzk4Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
Zjg4NWFjZmU0ODExMDU2NWE1MTNhZWMxZGZlMmUyOGYwYzAzM2EyZg==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGIwMDJlZmM5YzUyOTk1OTk3ZTAwOWEyZmYxZmU2YmVmYzk0ZDFiMTNjNTdk
|
10
|
+
Mzg2OTQxOTM2NTdjMGZiMzY1MTJjNzViZWE4NTg3MWQ1YzcwNTg1NTJlNWI3
|
11
|
+
M2ZlOTQwOTFlZmYyYTZkOTAwNTM1MmYwOWQ2MWQyNjU1NDVjMzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MTFkYWQ1ZDQ0Mzg5ZTFkOWRiMWEzZWI5Y2MzMTI3ZDlkMWUwZDA0M2E2MzE0
|
14
|
+
MjAzZjdlYWQ0ZTEyNjhkN2RjOTJkNTVjMDg5Njg5YTI3NzVhYTlkNTcwYTc4
|
15
|
+
NzNjOTA3NTg0NWQ2Y2Y2ZDQ5YzMxZTQyMTdhOTI0NTU1ZWExYjA=
|
data/lib/autorake.rb
CHANGED
@@ -12,7 +12,7 @@ module Autorake
|
|
12
12
|
class <<self
|
13
13
|
def extended obj
|
14
14
|
obj.load_autorake ENV[ "AUTORAKE_CONFIGURE"]
|
15
|
-
|
15
|
+
Builder.verbose = true
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -25,7 +25,7 @@ module Autorake
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def compiler *args
|
28
|
-
|
28
|
+
Compiler.new @autorake.incdirs, @autorake.macros, *args
|
29
29
|
end
|
30
30
|
|
31
31
|
def linker *args
|
data/lib/autorake/compile.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
module Autorake
|
6
6
|
|
7
|
-
class
|
7
|
+
class Builder
|
8
8
|
|
9
9
|
class Error < StandardError ; end
|
10
10
|
|
@@ -13,30 +13,42 @@ module Autorake
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def cc *a
|
16
|
-
a
|
17
|
-
a.compact!
|
18
|
-
a.unshift ENV[ "CC"] || "cc"
|
19
|
-
message a
|
20
|
-
f = fork do
|
21
|
-
$stderr.reopen "/dev/null" if Compiler.quiet
|
22
|
-
exec *a
|
23
|
-
end
|
24
|
-
Process.waitpid f
|
25
|
-
$?.success? or raise Error, "#{self.class} failed."
|
16
|
+
command "CC", "cc" do build *a end
|
26
17
|
end
|
27
18
|
|
19
|
+
def cxx *a
|
20
|
+
command "CXX", "c++" do build *a end
|
21
|
+
end
|
22
|
+
alias cpp cxx
|
23
|
+
|
28
24
|
private
|
29
25
|
|
30
|
-
def
|
31
|
-
|
26
|
+
def command env, default
|
27
|
+
@cmd = ENV[ env] || default
|
28
|
+
yield
|
29
|
+
ensure
|
30
|
+
@cmd = nil
|
31
|
+
end
|
32
|
+
|
33
|
+
def build *a
|
34
|
+
a.flatten!
|
35
|
+
a.compact!
|
36
|
+
a.unshift @cmd
|
37
|
+
if Builder.verbose then
|
32
38
|
m = a.join " "
|
33
39
|
puts m
|
34
40
|
end
|
41
|
+
f = fork do
|
42
|
+
$stderr.reopen "/dev/null" if Builder.quiet
|
43
|
+
exec *a
|
44
|
+
end
|
45
|
+
Process.waitpid f
|
46
|
+
$?.success? or raise Error, "#{self.class} failed."
|
35
47
|
end
|
36
48
|
|
37
49
|
end
|
38
50
|
|
39
|
-
class
|
51
|
+
class Preprocessor < Builder
|
40
52
|
|
41
53
|
def initialize incdirs, macros, *args
|
42
54
|
@incdirs = incdirs.map { |d| "-I#{d}" }
|
@@ -51,7 +63,7 @@ module Autorake
|
|
51
63
|
@cflags = e.split if e
|
52
64
|
end
|
53
65
|
|
54
|
-
def
|
66
|
+
def build obj, src
|
55
67
|
io = [ "-o", obj.to_s, "-c", src.to_s]
|
56
68
|
super @cflags, @macros, @incdirs, @args, opt_E, io
|
57
69
|
end
|
@@ -64,7 +76,7 @@ module Autorake
|
|
64
76
|
|
65
77
|
end
|
66
78
|
|
67
|
-
class
|
79
|
+
class Compiler < Preprocessor
|
68
80
|
|
69
81
|
private
|
70
82
|
|
@@ -72,17 +84,17 @@ module Autorake
|
|
72
84
|
|
73
85
|
end
|
74
86
|
|
75
|
-
class Linker <
|
87
|
+
class Linker < Builder
|
76
88
|
|
77
89
|
def initialize libdirs, libs, *args
|
78
90
|
@libdirs = libdirs.map { |d| "-Wl,-L#{d}" }
|
79
91
|
@libs = libs.map { |d| "-Wl,-l#{d}" }
|
80
|
-
|
92
|
+
@args = args
|
81
93
|
e = ENV[ "LDFLAGS"]
|
82
94
|
@ldflags = e.split if e
|
83
95
|
end
|
84
96
|
|
85
|
-
def
|
97
|
+
def build bin, *objs
|
86
98
|
io = [ "-o", bin.to_s, objs]
|
87
99
|
super @ldflags, @libdirs, @libs, @args, io
|
88
100
|
end
|
data/lib/autorake/definition.rb
CHANGED
@@ -28,7 +28,7 @@ module Autorake
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def perform
|
31
|
-
|
31
|
+
Builder.quiet = true
|
32
32
|
c = Configuration.new @environment, @directories
|
33
33
|
c.do_env
|
34
34
|
c.features.update @features
|
@@ -197,7 +197,7 @@ module Autorake
|
|
197
197
|
end
|
198
198
|
print "yes"
|
199
199
|
true
|
200
|
-
rescue
|
200
|
+
rescue Builder::Error
|
201
201
|
print "no"
|
202
202
|
false
|
203
203
|
ensure
|
@@ -214,7 +214,7 @@ module Autorake
|
|
214
214
|
SRC
|
215
215
|
end
|
216
216
|
def compile t
|
217
|
-
c =
|
217
|
+
c = Preprocessor.new @config.incdirs, @config.macros, "-w"
|
218
218
|
c.cc t.cpp, t.src
|
219
219
|
end
|
220
220
|
def set!
|
@@ -247,7 +247,7 @@ module Autorake
|
|
247
247
|
SRC
|
248
248
|
end
|
249
249
|
def compile t
|
250
|
-
c =
|
250
|
+
c = Preprocessor.new @config.incdirs, @config.macros, "-w"
|
251
251
|
c.cc t.cpp, t.src
|
252
252
|
end
|
253
253
|
def check!
|
@@ -267,7 +267,7 @@ void dummy( void)
|
|
267
267
|
SRC
|
268
268
|
end
|
269
269
|
def compile t
|
270
|
-
c =
|
270
|
+
c = Compiler.new @config.incdirs, @config.macros, "-w"
|
271
271
|
c.cc t.obj, t.src
|
272
272
|
end
|
273
273
|
def set!
|
@@ -283,7 +283,7 @@ int main( int argc, char *argv[]) { return 0; }
|
|
283
283
|
SRC
|
284
284
|
end
|
285
285
|
def compile t
|
286
|
-
c =
|
286
|
+
c = Compiler.new @config.incdirs, @config.macros, "-w"
|
287
287
|
c.cc t.obj, t.src
|
288
288
|
l = Linker.new @config.libdirs, [ @name], "-w"
|
289
289
|
l.cc t.bin, t.obj
|
data/lib/autorake/version.rb
CHANGED
data/samples/plainc/Rakefile
CHANGED
data/samples/plainc/hello.c
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: autorake
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bertram Scharpf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|