|
|
@@ -44,8 +44,8 @@ export ERTS_DIR="$ROOTDIR/erts-$ERTS_VSN"
|
|
|
export BINDIR="$ERTS_DIR/bin"
|
|
|
export EMU="beam"
|
|
|
export PROGNAME="erl"
|
|
|
-export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
|
|
|
export ERTS_LIB_DIR="$ERTS_DIR/../lib"
|
|
|
+DYNLIBS_DIR="$RUNNER_ROOT_DIR/dynlibs"
|
|
|
|
|
|
# Echo to stderr on errors
|
|
|
echoerr() { echo "ERROR: $*" 1>&2; }
|
|
|
@@ -62,6 +62,33 @@ assert_node_alive() {
|
|
|
fi
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+# Echo to stderr on errors
|
|
|
+echoerr() { echo "$*" 1>&2; }
|
|
|
+
|
|
|
+check_eralng_start() {
|
|
|
+ "$BINDIR/$PROGNAME" -noshell -boot "$REL_DIR/start_clean" -s crypto start -s init stop
|
|
|
+}
|
|
|
+
|
|
|
+if ! check_eralng_start >/dev/null 2>&1; then
|
|
|
+ BUILT_ON="$(head -1 "${REL_DIR}/BUILT_ON")"
|
|
|
+ ## failed to start, might be due to missing libs, try to be portable
|
|
|
+ export LD_LIBRARY_PATH="$DYNLIBS_DIR:$LD_LIBRARY_PATH"
|
|
|
+ if ! check_eralng_start; then
|
|
|
+ ## it's hopeless
|
|
|
+ echoerr "FATAL: Unable to start Erlang (with libcrypto)."
|
|
|
+ echoerr "Please make sure it's running on the correct platform with all required dependencies."
|
|
|
+ echoerr "This EMQ X release is built for $BUILT_ON"
|
|
|
+ exit 1
|
|
|
+ fi
|
|
|
+ echoerr "WARNING: There seem to be missing dynamic libs from the OS. Using libs from ${DYNLIBS_DIR}"
|
|
|
+fi
|
|
|
+
|
|
|
+## backward compatible
|
|
|
+if [ -d "$ERTS_DIR/lib" ]; then
|
|
|
+ export LD_LIBRARY_PATH="$ERTS_DIR/lib:$LD_LIBRARY_PATH"
|
|
|
+fi
|
|
|
+
|
|
|
relx_usage() {
|
|
|
command="$1"
|
|
|
|