Commit 181a007a authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Fix mruby build

Copy build_config.rb to build directory because now
build_config.rb.lock is created along side it.

Define toolchain depending on CC environment variable.
parent 7df73a5d
......@@ -54,7 +54,10 @@ EXTRA_DIST += build_config.rb mruby/*
.PHONY: all-local clean mruby
mruby:
MRUBY_CONFIG="${srcdir}/build_config.rb" \
mkdir -p "${abs_builddir}/mruby/build"
diff "${srcdir}/build_config.rb" "${abs_builddir}/mruby/build/build_config.rb" >& /dev/null || \
cp "${srcdir}/build_config.rb" "${abs_builddir}/mruby/build"
MRUBY_CONFIG="${abs_builddir}/mruby/build/build_config.rb" \
BUILD_DIR="${abs_builddir}/mruby/build" \
INSTALL_DIR="${abs_builddir}/mruby/build/install/bin" \
CC="${CC}" CXX="$(firstword $(CXX))" LD="${LD}" \
......@@ -66,7 +69,7 @@ mruby:
all-local: mruby
clean-local:
MRUBY_CONFIG="${srcdir}/build_config.rb" \
MRUBY_CONFIG="${abs_builddir}/mruby/build/build_config.rb" \
BUILD_DIR="${abs_builddir}/mruby/build" \
"${srcdir}/mruby/minirake" -f "${srcdir}/mruby/Rakefile" clean
......
MRuby::Build.new do |conf|
# TODO use same compilers configured in configure script
toolchain :clang
toolchain :clang if ENV['CC'].include? "clang"
toolchain :gcc if ENV['CC'].include? "gcc"
# C++ project needs this. Without this, mruby exception does not
# properly destory C++ object allocated on stack.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment