diff --git a/.gitignore b/.gitignore index 94e6fe6d..24664d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ build_dynamic/ autom4te.cache/ .openssl_build_done .openssl_configure_done +.mruby_version .vagrant/ diff --git a/Makefile.in b/Makefile.in index 2d782413..29dd8360 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,16 +61,27 @@ clean: -rm -rf mrbgems_config mrbgems_config_dynamic clobber: clean_mruby clean - -rm -rf tmp autom4te.cache config config.status config.log $(BUILD_DIR) .openssl_build_done .openssl_configure_done + -rm -rf tmp autom4te.cache config config.status config.log $(BUILD_DIR) .openssl_build_done .openssl_configure_done .mruby_version # # mruby # build_mruby: $(MRUBY_BUILD_DEPEND_TARGETS) + @if [ -f .mruby_version ]; then \ + built_version=`cat .mruby_version`; \ + current_version=`git log -1 --format="%H" mruby`; \ + if [ $$built_version != $$current_version ]; then \ + echo $$current_version > .mruby_version; \ + cd $(MRUBY_ROOT) && rm -rf build; \ + fi; \ + else \ + git log -1 --format="%H" mruby > .mruby_version; \ + fi cd $(MRUBY_ROOT) && $(RAKE) MRUBY_CONFIG=$(NGX_MRUBY_ROOT)/build_config.rb NGX_MRUBY_CFLAGS="$(NGX_MRUBY_CFLAGS)" clean_mruby: - cd $(MRUBY_ROOT) && $(RAKE) deep_clean && rm -rf build + rm -f .mruby_version + cd $(MRUBY_ROOT) && $(RAKE) MRUBY_CONFIG=$(NGX_MRUBY_ROOT)/build_config.rb deep_clean && rm -rf build $(MRUBY_MAK_FILE): build_mruby diff --git a/build.sh b/build.sh index 9c6daccd..eb2eabc1 100755 --- a/build.sh +++ b/build.sh @@ -87,13 +87,6 @@ else OPENSSL_BUILD_OPT='' fi -# FIXME: not sure if we really need this. even if we do, it should be moved to mruby/Rakefile -if [ -d "./mruby/${BUILD_DIR}" ]; then - echo "mruby Cleaning ..." - (cd mruby && rake clean MRUBY_CONFIG=../build_config.rb) - echo "mruby Cleaning ... Done" -fi - echo "ngx_mruby configure ..." ./configure ${CONFIG_OPT} --with-ngx-src-root=${NGINX_SRC} --with-ngx-config-opt="${NGINX_CONFIG_OPT}" ${OPENSSL_BUILD_OPT} $@ echo "ngx_mruby configure ... Done"