Imported File#ftype spec from rubyspecs.
[rbx.git] / rakelib / extensions.rake
blobe0ccff14153a3d1b5bac382107be66ebca11557e
1 require 'lib/ffi/generator_task'
3 desc "Build extensions from lib/ext"
4 task :extensions => %w[
5   build:system
7   extension:digest_rmd160
8   extension:digest_md5
9   extension:digest_sha1
10   extension:digest_sha2
12   extension:readline
14   lib/etc.rb
15   lib/fcntl.rb
16   lib/openssl/digest.rb
17   lib/syslog.rb
18   lib/zlib.rb
21 namespace :extension do
22   FFI::Generator::Task.new %w[
23     lib/etc.rb
24     lib/fcntl.rb
25     lib/openssl/digest.rb
26     lib/syslog.rb
27     lib/zlib.rb
28   ]
30   task :digest_md5 => "lib/ext/digest/md5/md5.#{$dlext}"
32   file "lib/ext/digest/md5/md5.#{$dlext}" => FileList[
33     'shotgun/lib/subtend/*',
34     'lib/ext/digest/md5/build.rb',
35     'lib/ext/digest/md5/*.c',
36     'lib/ext/digest/md5/*.h',
37     'lib/ext/digest/defs.h',
38   ] do
39     compile 'lib/ext/digest/md5'
40   end
42   task :digest_rmd160 => "lib/ext/digest/rmd160/rmd160.#{$dlext}"
44   file "lib/ext/digest/rmd160/rmd160.#{$dlext}" => FileList[
45     'shotgun/lib/subtend/*',
46     'lib/ext/digest/rmd160/build.rb',
47     'lib/ext/digest/rmd160/*.c',
48     'lib/ext/digest/rmd160/*.h',
49     'lib/ext/digest/defs.h',
50   ] do
51     compile 'lib/ext/digest/rmd160'
52   end
54   task :digest_sha1 => "lib/ext/digest/sha1/sha1.#{$dlext}"
56   file "lib/ext/digest/sha1/sha1.#{$dlext}" => FileList[
57     'shotgun/lib/subtend/*',
58     'lib/ext/digest/sha1/build.rb',
59     'lib/ext/digest/sha1/*.c',
60     'lib/ext/digest/sha1/*.h',
61     'lib/ext/digest/defs.h',
62   ] do
63     compile 'lib/ext/digest/sha1'
64   end
66   task :digest_sha2 => "lib/ext/digest/sha2/sha2.#{$dlext}"
68   file "lib/ext/digest/sha2/sha2.#{$dlext}" => FileList[
69     'shotgun/lib/subtend/*',
70     'lib/ext/digest/sha2/build.rb',
71     'lib/ext/digest/sha2/*.c',
72     'lib/ext/digest/sha2/*.h',
73     'lib/ext/digest/defs.h',
74   ] do
75     compile 'lib/ext/digest/sha2'
76   end
78   task :mongrel => "lib/ext/mongrel/http11.#{$dlext}"
80   file "lib/ext/mongrel/http11.#{$dlext}" => FileList[
81     'shotgun/lib/subtend/*',
82     'lib/ext/mongrel/build.rb',
83     'lib/ext/mongrel/*.c',
84     'lib/ext/mongrel/*.h',
85   ] do
86     compile "lib/ext/mongrel"
87   end
89   task :readline => %W[lib/ext/readline/readline.#{$dlext} lib/readline.rb]
91   file "lib/ext/readline/readline.#{$dlext}" => FileList[
92     'shotgun/lib/subtend/*',
93     'lib/ext/readline/build.rb',
94     'lib/ext/readline/*.c'
95   ] do
96     compile "lib/ext/readline"
97   end
98 end