1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
dnl
dnl More functions to query Erlang environment.
dnl
dnl ERLANG_CHECK_ERTS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Substitudes
dnl ERLANG_ERTS_DIR
dnl ERLANG_ERTS_VER
AC_DEFUN([ERLANG_CHECK_ERTS],
[
AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
AC_REQUIRE([AC_ERLANG_SUBST_ROOT_DIR])[]dnl
AC_CACHE_CHECK([for Erlang/OTP ERTS version],
[erlang_cv_erts_ver],
[
AC_LANG_PUSH(Erlang)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
file:write_file("conftest.out", erlang:system_info(version)),
halt(0)])],
[erlang_cv_erts_ver=`cat conftest.out`],
[if test ! -f conftest.out; then
AC_MSG_FAILURE([test Erlang program execution failed])
else
erlang_cv_erts_ver="not found"
fi])
AC_LANG_POP(Erlang)[]dnl
])
AC_CACHE_CHECK([for Erlang/OTP ERTS directory],
[erlang_cv_erts_dir],
[
erlang_cv_erts_dir="${ERLANG_ROOT_DIR}/erts-$erlang_cv_erts_ver"
if test ! -d "$erlang_cv_erts_dir"; then
erlang_cv_erts_dir="${ERLANG_ROOT_DIR}/usr"
fi
])
AC_SUBST([ERLANG_ERTS_DIR], [$erlang_cv_erts_dir])
AC_SUBST([ERLANG_ERTS_VER], [$erlang_cv_erts_ver])
AS_IF([test "$erlang_cv_erts_ver" = "not found"], [$2], [$1])
])
dnl ERLANG_CHECK_RELEASE()
dnl Substitudes
dnl ERLANG_RELEASE
AC_DEFUN([ERLANG_CHECK_RELEASE],
[
AC_REQUIRE([AC_ERLANG_PATH_ERLC])[]dnl
AC_REQUIRE([AC_ERLANG_PATH_ERL])[]dnl
AC_REQUIRE([AC_ERLANG_SUBST_ROOT_DIR])[]dnl
AC_CACHE_CHECK([for Erlang/OTP release],
[erlang_cv_release],
[
AC_LANG_PUSH(Erlang)[]dnl
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
file:write_file("conftest.out", erlang:system_info(otp_release)),
halt(0)])],
[erlang_cv_release=`cat conftest.out`],
[if test ! -f conftest.out; then
AC_MSG_FAILURE([test Erlang program execution failed])
else
erlang_cv_release="not found"
fi])
AC_LANG_POP(Erlang)[]dnl
])
AC_SUBST([ERLANG_RELEASE], [$erlang_cv_release])
])
|