From ac2d2d8b2745fb54b5ebff833bad9fcb90f798ec Mon Sep 17 00:00:00 2001 From: dwing Date: Thu, 10 Jan 2019 13:26:37 +0800 Subject: [PATCH] fix building scripts --- make_linux.sh | 5 ++++- make_linux_jemalloc.sh | 5 ++++- make_mac.sh | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) mode change 100644 => 100755 make_mac.sh diff --git a/make_linux.sh b/make_linux.sh index 9ea87e7e17..0eba00e1c5 100755 --- a/make_linux.sh +++ b/make_linux.sh @@ -5,7 +5,10 @@ cd `dirname $0` # note: # 1. if gcc supports c++11 (4.8+), remove "-Dconstexpr= -Doverride=" -if [ "$JAVA_HOME" = "" ]; then JAVA_HOME=/usr/java/default; fi +if [ -z $JAVA_HOME ]; then JAVA_HOME=/usr/java/default; fi + +JAVA_VER=`$JAVA_HOME/bin/java -version 2>&1 | awk -F "[ \"]" '/version/{print $4}'` +if [[ $JAVA_VER < 1.8 ]]; then echo 'ERROR: JDK 1.8 or later is required!'; exit 1; fi CORE_FILES="\ db/builder.cc \ diff --git a/make_linux_jemalloc.sh b/make_linux_jemalloc.sh index 07c8de3f6a..effde1f5d0 100755 --- a/make_linux_jemalloc.sh +++ b/make_linux_jemalloc.sh @@ -6,7 +6,10 @@ cd `dirname $0` # 1. if gcc supports c++11 (4.8+), remove "-Dconstexpr= -Doverride=" # 2. configure and make jemalloc, then put the result "lib/libjemalloc.a" and "lib/libjemalloc_pic.a" in this path -if [ "$JAVA_HOME" = "" ]; then JAVA_HOME=/usr/java/default; fi +if [ -z $JAVA_HOME ]; then JAVA_HOME=/usr/java/default; fi + +JAVA_VER=`$JAVA_HOME/bin/java -version 2>&1 | awk -F "[ \"]" '/version/{print $4}'` +if [[ $JAVA_VER < 1.8 ]]; then echo 'ERROR: JDK 1.8 or later is required!'; exit 1; fi CORE_FILES="\ db/builder.cc \ diff --git a/make_mac.sh b/make_mac.sh old mode 100644 new mode 100755 index ae091861b4..aee0cb72a4 --- a/make_mac.sh +++ b/make_mac.sh @@ -2,6 +2,9 @@ cd `dirname $0` +# note: +# 1. install JDK 8 or later and set $JAVA_INCLUDE if JDK is not in default path + if [ "$JAVA_INCLUDE" = "" ]; then JAVA_INCLUDE=/System/Library/Frameworks/JavaVM.framework/Versions/A/Headers; fi CORE_FILES="\