mirror of
https://github.com/rubyjs/libv8
synced 2023-03-27 23:21:48 -04:00
Check that (2.4 >= Python < 3.x)
This commit is contained in:
parent
5a25359904
commit
7bdedfb124
2 changed files with 30 additions and 0 deletions
15
Rakefile
15
Rakefile
|
@ -52,6 +52,21 @@ end
|
|||
desc "Compile the V8 JavaScript engine"
|
||||
task :compile, [:version] do |t, options|
|
||||
options.with_defaults(:version => latest_v8)
|
||||
|
||||
begin
|
||||
def crash(str)
|
||||
printf("Unable to build libv8: %s\n", str)
|
||||
exit 1
|
||||
end
|
||||
|
||||
print "Checking for Python..."
|
||||
version = `python --version 2>&1`
|
||||
crash "Python not found!" if version.split.first != "Python"
|
||||
crash "Python 3.x is unsupported by V8!" if Gem::Version.new(version.split.last) >= Gem::Version.new(3)
|
||||
crash "Python 2.4+ is required by V8!" if Gem::Version.new(version.split.last) < Gem::Version.new("2.4")
|
||||
puts version.split.last
|
||||
end
|
||||
|
||||
puts "Compiling V8 (#{options.version})..."
|
||||
Rake::Task[:checkout].invoke(options.version)
|
||||
Dir.chdir(File.join('lib', 'libv8')) do
|
||||
|
|
|
@ -1,6 +1,21 @@
|
|||
require 'mkmf'
|
||||
require 'pathname'
|
||||
|
||||
begin
|
||||
def crash(str)
|
||||
printf("Unable to build libv8: %s\n", str)
|
||||
exit 1
|
||||
end
|
||||
|
||||
print "Checking for Python..."
|
||||
version = `python --version 2>&1`
|
||||
crash "Python not found!" if version.split.first != "Python"
|
||||
crash "Python 3.x is unsupported by V8!" if Gem::Version.new(version.split.last) >= Gem::Version.new(3)
|
||||
crash "Python 2.4+ is required by V8!" if Gem::Version.new(version.split.last) < Gem::Version.new("2.4")
|
||||
puts version.split.last
|
||||
end
|
||||
|
||||
|
||||
Dir.chdir(Pathname(__FILE__).dirname.join('..', '..', 'lib', 'libv8')) do
|
||||
puts "Compiling V8..."
|
||||
`make`
|
||||
|
|
Loading…
Reference in a new issue