Skip to content

Commit

Permalink
Changed references from vm/external_libs to vendor.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Ford committed Jul 2, 2011
1 parent 6fad047 commit eff4aa4
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 58 deletions.
19 changes: 0 additions & 19 deletions .gitignore
Expand Up @@ -84,25 +84,6 @@ tmtags
/lib/syslog.rb
/lib/readline.rb

# LLVM and its Makefiles
vm/external_libs/llvm/Makefile
vm/external_libs/llvm/Makefile.common
vm/external_libs/llvm/bindings/Makefile
vm/external_libs/llvm/bindings/ocaml/Makefile.ocaml
vm/external_libs/llvm/examples/Makefile
vm/external_libs/llvm/lib/Makefile
vm/external_libs/llvm/projects/Makefile
vm/external_libs/llvm/projects/sample/Makefile
vm/external_libs/llvm/projects/sample/lib/Makefile
vm/external_libs/llvm/projects/sample/lib/sample/Makefile
vm/external_libs/llvm/projects/sample/tools/Makefile
vm/external_libs/llvm/projects/sample/tools/sample/Makefile
vm/external_libs/llvm/runtime/Makefile
vm/external_libs/llvm/test/Makefile
vm/external_libs/llvm/test/Makefile.tests
vm/external_libs/llvm/tools/Makefile
vm/external_libs/llvm/utils/Makefile

# Generated documentation
doc/generated/vm
web/doc/*/*.bak
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Expand Up @@ -33,7 +33,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG

unless BUILD_CONFIG[:config_version] == 135
unless BUILD_CONFIG[:config_version] == 136
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
Expand Down
4 changes: 2 additions & 2 deletions configure
Expand Up @@ -79,7 +79,7 @@ class Configure
@llvm_generic_prebuilt = "llvm-#{@llvm_version}-#{@host}.tar.bz2"
end

@llvm_parent_path = File.join(root, "vm", "external_libs")
@llvm_parent_path = File.join(root, "vendor")
@llvm_default = File.join(@llvm_parent_path, "llvm")
@llvm_prebuilt_path = File.join(@llvm_parent_path, "prebuilt")
@llvm_include_path = File.join(@llvm_default, "include")
Expand Down Expand Up @@ -111,7 +111,7 @@ class Configure
@libversion = "2.0"
@version = "#{@libversion}.0dev"
@release_date = "yyyy-mm-dd"
@config_version = 135
@config_version = 136

# TODO: add conditionals for platforms
if RbConfig::CONFIG["build_os"] =~ /darwin/
Expand Down
34 changes: 17 additions & 17 deletions rakelib/blueprint.rb
Expand Up @@ -83,12 +83,12 @@
# Libraries
case Rubinius::BUILD_CONFIG[:llvm]
when :prebuilt, :svn
llvm = i.external_lib "vm/external_libs/llvm" do |l|
conf = "vm/external_libs/llvm/Release/bin/llvm-config"
llvm = i.external_lib "vendor/llvm" do |l|
conf = "vendor/llvm/Release/bin/llvm-config"
flags = `#{perl} #{conf} --cflags`.strip.split(/\s+/)
flags.delete_if { |x| x.index("-O") == 0 || x.index("-I") == 0 }
flags.delete_if { |x| x =~ /-D__STDC/ }
flags << "-Ivm/external_libs/llvm/include" << "-DENABLE_LLVM"
flags << "-Ivendor/llvm/include" << "-DENABLE_LLVM"
l.cflags = flags

ldflags = `#{perl} #{conf} --ldflags`.strip
Expand Down Expand Up @@ -124,42 +124,42 @@
raise "get out"
end

ltm = i.external_lib "vm/external_libs/libtommath" do |l|
l.cflags = ["-Ivm/external_libs/libtommath"]
ltm = i.external_lib "vendor/libtommath" do |l|
l.cflags = ["-Ivendor/libtommath"]
l.objects = [l.file("libtommath.a")]
l.to_build do |x|
x.command make
end
end

onig = i.external_lib "vm/external_libs/onig" do |l|
l.cflags = ["-Ivm/external_libs/onig"]
onig = i.external_lib "vendor/onig" do |l|
l.cflags = ["-Ivendor/onig"]
l.objects = [l.file(".libs/libonig.a")]
l.to_build do |x|
x.command "sh -c ./configure" unless File.exists?("Makefile")
x.command make
end
end

gdtoa = i.external_lib "vm/external_libs/libgdtoa" do |l|
l.cflags = ["-Ivm/external_libs/libgdtoa"]
gdtoa = i.external_lib "vendor/libgdtoa" do |l|
l.cflags = ["-Ivendor/libgdtoa"]
l.objects = [l.file("libgdtoa.a")]
l.to_build do |x|
x.command make
end
end

ffi = i.external_lib "vm/external_libs/libffi" do |l|
l.cflags = ["-Ivm/external_libs/libffi/include"]
ffi = i.external_lib "vendor/libffi" do |l|
l.cflags = ["-Ivendor/libffi/include"]
l.objects = [l.file(".libs/libffi.a")]
l.to_build do |x|
x.command "sh -c ./configure" unless File.exists?("Makefile")
x.command make
end
end

udis = i.external_lib "vm/external_libs/udis86" do |l|
l.cflags = ["-Ivm/external_libs/udis86"]
udis = i.external_lib "vendor/udis86" do |l|
l.cflags = ["-Ivendor/udis86"]
l.objects = [l.file("libudis86/.libs/libudis86.a")]
l.to_build do |x|
unless File.exists?("Makefile") and File.exists?("libudis86/Makefile")
Expand All @@ -170,8 +170,8 @@
end

if Rubinius::BUILD_CONFIG[:vendor_zlib]
zlib = i.external_lib "vm/external_libs/zlib" do |l|
l.cflags = ["-Ivm/external_libs/zlib"]
zlib = i.external_lib "vendor/zlib" do |l|
l.cflags = ["-Ivendor/zlib"]
l.objects = []
l.to_build do |x|
unless File.exists?("Makefile") and File.exists?("zconf.h")
Expand Down Expand Up @@ -199,8 +199,8 @@
end

if Rubinius::BUILD_CONFIG[:windows]
winp = i.external_lib "vm/external_libs/winpthreads" do |l|
l.cflags = ["-Ivm/external_libs/winpthreads/include"]
winp = i.external_lib "vendor/winpthreads" do |l|
l.cflags = ["-Ivendor/winpthreads/include"]
l.objects = [l.file("libpthread.a")]
l.to_build do |x|
x.command "sh -c ./configure" unless File.exists?("Makefile")
Expand Down
4 changes: 2 additions & 2 deletions rakelib/build.rb
@@ -1,7 +1,7 @@
def llvm_configure
case Rubinius::BUILD_CONFIG[:llvm]
when :svn, :prebuilt
"vm/external_libs/llvm/Release/bin/llvm-config"
"vendor/llvm/Release/bin/llvm-config"
when :config
Rubinius::BUILD_CONFIG[:llvm_configure]
else
Expand All @@ -20,7 +20,7 @@ def llvm_flags

case Rubinius::BUILD_CONFIG[:llvm]
when :svn, :prebuilt
@llvm_flags = ["-Ivm/external_libs/llvm/include"]
@llvm_flags = ["-Ivendor/llvm/include"]
else
@llvm_flags = []
end
Expand Down
2 changes: 1 addition & 1 deletion rakelib/ext_helper.rb
Expand Up @@ -26,7 +26,7 @@ def env(name, default = "")

$DEBUGFLAGS = "-O0" if ENV["DEV"]

$ELIBSDIR = env "ELIBSDIR", File.expand_path("../../vm/external_libs", __FILE__)
$ELIBSDIR = env "ELIBSDIR", File.expand_path("../../vendor", __FILE__)
$LIBS = env "LIBS"
$LDDIRS = env "LDDIRS"
$LDFLAGS = env "LDFLAGS", Rubinius::BUILD_CONFIG[:user_ldflags]
Expand Down
10 changes: 5 additions & 5 deletions rakelib/jit.rake
Expand Up @@ -57,7 +57,7 @@ namespace :jit do
end
end

str = `llvm-g++ -I. -Ivm -Ivm/external_libs/libtommath -emit-llvm -S -o - "#{path}"`
str = `llvm-g++ -I. -Ivm -Ivendor/libtommath -emit-llvm -S -o - "#{path}"`

return unless $?.exitstatus == 0

Expand All @@ -83,14 +83,14 @@ namespace :jit do
f.puts(*types)
end

`vm/external_libs/llvm/Release/bin/llvm-as < vm/gen/types.ll > vm/gen/types.bc`
`vm/external_libs/llvm/Release/bin/llc -march=cpp -cppgen=contents -o vm/llvm/types.cpp.gen vm/gen/types.bc`
`vendor/llvm/Release/bin/llvm-as < vm/gen/types.ll > vm/gen/types.bc`
`vendor/llvm/Release/bin/llc -march=cpp -cppgen=contents -o vm/llvm/types.cpp.gen vm/gen/types.bc`
end

task :generate_header do
puts "GEN vm/llvm/types.cpp.gen"
`vm/external_libs/llvm/Release/bin/llvm-as < vm/llvm/types.ll > vm/gen/types.bc`
`vm/external_libs/llvm/Release/bin/llc -march=cpp -cppgen=contents -o vm/llvm/types.cpp.gen vm/gen/types.bc`
`vendor/llvm/Release/bin/llvm-as < vm/llvm/types.ll > vm/gen/types.bc`
`vendor/llvm/Release/bin/llc -march=cpp -cppgen=contents -o vm/llvm/types.cpp.gen vm/gen/types.bc`
end

task :generate_offsets do
Expand Down
2 changes: 1 addition & 1 deletion rakelib/package.rake
Expand Up @@ -7,7 +7,7 @@ namespace :package do
prebuilt_archive = "llvm-#{llvm_version}-#{host_triple}.tar.bz2"
end

sh "tar -c -C vm/external_libs/llvm --exclude .svn --exclude \"*.dylib\" --exclude \"*.so\" -f - Release/lib Release/bin/llvm-config include | bzip2 -9 > #{prebuilt_archive}"
sh "tar -c -C vendor/llvm --exclude .svn --exclude \"*.dylib\" --exclude \"*.so\" -f - Release/lib Release/bin/llvm-config include | bzip2 -9 > #{prebuilt_archive}"

require 'digest/md5'
md5 = Digest::MD5.new
Expand Down
2 changes: 1 addition & 1 deletion rakelib/platform.rake
Expand Up @@ -559,7 +559,7 @@ file 'runtime/platform.conf' => deps do |task|
end.write_constants(f)

FFI::Generators::Constants.new 'rbx.platform.zlib' do |cg|
cg.include_dir 'vm/external_libs/zlib'
cg.include_dir 'vendor/zlib'
cg.include 'zlib.h'

zlib_constants = %w[ZLIB_VERSION]
Expand Down
8 changes: 4 additions & 4 deletions rakelib/vm.rake
Expand Up @@ -111,9 +111,9 @@ namespace :build do
desc "Build LLVM"
task :llvm do
if Rubinius::BUILD_CONFIG[:llvm] == :svn
unless File.file?("vm/external_libs/llvm/Release/bin/llvm-config")
unless File.file?("vendor/llvm/Release/bin/llvm-config")
ENV["REQUIRES_RTTI"] = "1"
Dir.chdir "vm/external_libs/llvm" do
Dir.chdir "vendor/llvm" do
sh %[sh -c "#{expand("./configure")} #{llvm_config_flags}"]
sh make
end
Expand Down Expand Up @@ -154,7 +154,7 @@ namespace :build do
directory 'lib/zlib'

task :zlib => ['lib/zlib', VM_EXE] do
FileList["vm/external_libs/zlib/libz.*"].each do |lib|
FileList["vendor/zlib/libz.*"].each do |lib|
cp lib, 'lib/zlib/'
end
end
Expand Down Expand Up @@ -187,7 +187,7 @@ files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] + [:run_
end

file encoding_database => 'vm/codegen/encoding_extract.rb' do |t|
dir = File.expand_path "../vm/external_libs/onig"
dir = File.expand_path "../vendor/onig"
ruby 'vm/codegen/encoding_extract.rb', dir, t.name
end

Expand Down
4 changes: 2 additions & 2 deletions rakelib/winpthreads.rake
Expand Up @@ -3,12 +3,12 @@
require 'rakelib/git'

namespace :winpthreads do
desc "Synchronize vm/external_libs/winpthreads with current clone"
desc "Synchronize vendor/winpthreads with current clone"
task :sync do
unless src_dir = ENV['DIR']
raise "Use DIR= to specify a clone of winpthreads"
end
dest_dir = "vm/external_libs/winpthreads"
dest_dir = "vendor/winpthreads"

unless is_git_project src_dir, "winpthreads.git"
raise "#{src_dir} is not a winpthreads clone. Clone from 'git://github.com/brixen/winpthreads.git'"
Expand Down
2 changes: 1 addition & 1 deletion tools/llvm_type_extract.rb
Expand Up @@ -11,7 +11,7 @@
f.puts "void blah(#{klass}* thing) { useme(thing); }"
end

str = `llvm-g++ -I. -I.. -Iexternal_libs/libtommath -emit-llvm -S -o - "#{path}"`
str = `llvm-g++ -I. -I.. -Ivendor/libtommath -emit-llvm -S -o - "#{path}"`

str.split("\n").each do |line|
if /%"?struct.#{klass}"? = type/.match(line)
Expand Down
70 changes: 70 additions & 0 deletions vendor/.gitignore
@@ -0,0 +1,70 @@
# General ignores
.deps
*.data
prebuilt/*

# LLVM and its Makefiles
llvm
llvm/Makefile
llvm/Makefile.common
llvm/bindings/Makefile
llvm/bindings/ocaml/Makefile.ocaml
llvm/examples/Makefile
llvm/lib/Makefile
llvm/projects/Makefile
llvm/projects/sample/Makefile
llvm/projects/sample/lib/Makefile
llvm/projects/sample/lib/sample/Makefile
llvm/projects/sample/tools/Makefile
llvm/projects/sample/tools/sample/Makefile
llvm/runtime/Makefile
llvm/test/Makefile
llvm/test/Makefile.tests
llvm/tools/Makefile
llvm/utils/Makefile

# libffi
libffi/Makefile
libffi/config.log
libffi/config.status
libffi/fficonfig.h
libffi/include/Makefile
libffi/include/ffi.h
libffi/include/ffitarget.h
libffi/libffi.pc
libffi/libtool
libffi/man/Makefile
libffi/src/.dirstamp
libffi/src/x86/.dirstamp
libffi/testsuite/Makefile

# oniguruma
onig/Makefile
onig/config.h
onig/config.log
onig/config.status
onig/libtool
onig/onig-config
onig/sample/Makefile

# libudis
udis86/Makefile
udis86/config.h
udis86/config.log
udis86/config.status
udis86/docs/Makefile
udis86/libtool
udis86/libudis86/Makefile
udis86/tests/Makefile
udis86/udcli/Makefile
udis86/udcli/udcli

# zlib
zlib/Makefile
zlib/example
zlib/examplesh
zlib/minigzip
zlib/minigzipsh
zlib/zconf.h
zlib/zlib.pc

1 change: 0 additions & 1 deletion vm/.gitignore
@@ -1,7 +1,6 @@
vm
.depends.mf
gen/*
external_libs
test/test_instructions.hpp

capi/18/include/config.h
Expand Down
2 changes: 1 addition & 1 deletion vm/test/one.sh
Expand Up @@ -10,4 +10,4 @@ fi

vm/test/cxxtest/cxxtestgen.pl --error-printer --have-eh --abort-on-fail --include=string.h -o vm/test/one.cpp "$*"

g++ $FLAGS -ggdb3 -g -Wall -Werror -Ivm/external_libs/libtommath -Ivm/test/cxxtest -I. -Ivm -o vm/test/one vm/test/one.cpp && ./vm/test/one
g++ $FLAGS -ggdb3 -g -Wall -Werror -Ivendor/libtommath -Ivm/test/cxxtest -I. -Ivm -o vm/test/one vm/test/one.cpp && ./vm/test/one

0 comments on commit eff4aa4

Please sign in to comment.