Skip to content

Commit

Permalink
Fix building with LLVM disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
dbussink committed Apr 5, 2011
1 parent 5bbf3ed commit e81ba74
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rakelib/blueprint.rb
Expand Up @@ -5,6 +5,7 @@
gcc.cflags << "-pipe -Wall -fno-omit-frame-pointer"
gcc.cflags << "-ggdb3 -Werror"
gcc.cflags << "-DRBX_PROFILER"
gcc.cflags << "-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS"

if ENV['DEV']
gcc.cflags << "-O0"
Expand Down Expand Up @@ -34,15 +35,15 @@
end
end

gcc.ldflags << "-lstdc++"
gcc.ldflags << "-lstdc++" << "-lm"
gcc.ldflags << "-L/usr/local/lib -L/opt/local/lib"

make = "make"

# TODO: Fix with Platform object
case RUBY_PLATFORM
when /linux/i
gcc.ldflags << '-Wl,--export-dynamic' << "-lrt" << "-lcrypt"
gcc.ldflags << '-Wl,--export-dynamic' << "-lrt" << "-lcrypt" << "-ldl" << "-lpthread"
when /openbsd/i
gcc.ldflags << '-lcrypto' << '-pthread' << '-lssl' << "-rdynamic" << "-Wl,--export-dynamic"
make = "gmake"
Expand All @@ -54,7 +55,7 @@
when /mingw|win32/i
gcc.ldflags << "-lws2_32"
else
gcc.ldflags << "-ldl"
gcc.ldflags << "-ldl" << "-lpthread"
end

if RUBY_PLATFORM =~ /bsd/ and
Expand All @@ -78,6 +79,7 @@
conf = "vm/external_libs/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"
l.cflags = flags

Expand All @@ -103,6 +105,7 @@
conf = Rubinius::BUILD_CONFIG[:llvm_configure]
flags = `#{perl} #{conf} --cflags`.strip.split(/\s+/)
flags.delete_if { |x| x.index("-O") == 0 }
flags.delete_if { |x| x =~ /-D__STDC/ }
flags << "-DENABLE_LLVM"
gcc.cflags.concat flags
gcc.ldflags.concat `#{perl} #{conf} --ldflags --libfiles`.strip.split(/\s+/)
Expand Down

0 comments on commit e81ba74

Please sign in to comment.