-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathextconf.rb
69 lines (61 loc) · 2.1 KB
/
extconf.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/ruby
# Ruby bindings for the Clutter 'interactive canvas' library.
# Copyright (C) 2007 Neil Roberts
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301 USA
require 'pathname'
def show_fail
print("*** Configuration failed due to a missing requirement\n")
exit(1)
end
SUBDIRS = %w{ clutter clutter-cairo clutter-gtk clutter-gst }
cwd = Pathname.getwd
successful_dirs = []
failed_dirs = []
# Run extconf.rb in each of the subdirectories
SUBDIRS.each do |dir|
STDERR.print("Entering directory #{dir}\n")
Dir.chdir(cwd.join(dir).to_s) do
begin
pid = Process.fork do
load(cwd.join(dir, "extconf.rb").to_s, true)
end
Process.wait(pid)
if $?.exitstatus == 0
successful_dirs << dir
else
failed_dirs << dir
end
end
end
STDERR.print("Leaving directory #{dir}\n")
end
STDERR.print("\n" \
"Succeeded: #{successful_dirs.size == 0 ? "none" : successful_dirs.join(' ')}\n" \
"Failed: #{failed_dirs.size == 0 ? "none" : failed_dirs.join(' ')}\n")
# Generate a parent makefile that forwards all of the rules to the
# makefiles in the subdirectories
RULES = %w{ all clean distclean install site-install }
File.open("Makefile", "w") do |mf|
RULES.each do |rule|
mf.print("#{rule}:\n")
successful_dirs.each do |subdir|
mf.print("\t$(MAKE) -C #{subdir} #{rule}\n")
end
mf.print("\n")
end
mf.print(".PHONY : #{RULES.join(" ")}\n")
end