1 --- a/build/config/erlang.m4
2 +++ b/build/config/erlang.m4
4 AC_DEFUN([CHECK_ERLANG], [
6 -# Erlang checks for mod_erlang_event
11 @@ -19,22 +19,23 @@ then
12 if test ! -x "$with_erlang" ; then
13 AC_MSG_ERROR([Specified erlang does not exist or is not executable: $with_erlang])
15 - AC_MSG_RESULT([$with_erlang])
16 - AC_SUBST([ERLANG], ["$with_erlang"])
17 + AC_MSG_RESULT(["$with_erlang/bin/erl"])
18 + AC_SUBST([ERL],["$with_erlang/bin/erl"])
20 - AC_PATH_PROG([ERLANG], ["erl"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
21 + AC_ERLANG_NEED_ERL(["$with_erlang/bin"])
24 - if test "$ERLANG" != "no" ; then
25 + if test "$ERL" != "no" ; then
26 AC_MSG_CHECKING([erlang version])
27 - ERLANG_VER="`$ERLANG -version 2>&1 | cut -d' ' -f6`"
28 + ERLANG_VER="`$ERL -version 2>&1 | cut -d' ' -f6`"
30 if test -z "$ERLANG_VER" ; then
31 AC_MSG_ERROR([Unable to detect erlang version])
33 + AC_MSG_RESULT([$ERLANG_VER])
35 - AC_MSG_RESULT([$ERLANG_VER])
37 - ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
38 + ERLANG_LIBDIR=`$ERL -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
39 AC_MSG_CHECKING([erlang libdir])
40 if test -z "`echo $ERLANG_LIBDIR`" ; then
41 AC_MSG_ERROR([failed])
42 @@ -42,9 +43,16 @@ then
43 ERLANG_LDFLAGS="-L$ERLANG_LIBDIR $ERLANG_LDFLAGS"
44 LIBS="-L$ERLANG_LIBDIR $LIBS"
48 + # Don't use the above ERLANG_LDFLAGS
50 + ERLANG_LIBDIR="${STAGING_DIR}/usr/lib"
51 + ERLANG_LDFLAGS="-L$ERLANG_LIBDIR"
52 + LIBS="-L$ERLANG_LIBDIR $LIBS"
53 AC_MSG_RESULT([$ERLANG_LIBDIR])
55 - ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
56 + ERLANG_INCDIR=`$ERL -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
57 AC_MSG_CHECKING([erlang incdir])
58 if test -z "`echo $ERLANG_INCDIR`" ; then
59 AC_MSG_ERROR([failed])
60 @@ -58,10 +66,11 @@ then
66 AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"])
67 # maybe someday ei will actually expose this?
68 - AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
69 + # until then, we comment it out
70 + #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
72 if test "$has_libei" = "no" ; then
73 AS_IF([test "$with_erlang" = "try"],
74 @@ -75,7 +84,7 @@ then
77 ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei"
78 - AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
79 + AC_MSG_NOTICE([Your erlang seems OK. You can now use ErLang in your codes.])
80 AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS])
81 AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
83 @@ -85,12 +94,12 @@ then
86 AS_IF([test "$with_erlang" = "try"],
87 - [AC_MSG_WARN([Could not find erlang, mod_erlang_event will not build, use --with-erlang to specify the location])],
88 + [AC_MSG_WARN([Could not find erlang, codes depend on erlang will not build, use --with-erlang to specify the location])],
89 [AC_MSG_ERROR([Could not find erlang, use --with-erlang to specify the location])]
93 - AC_MSG_WARN([erlang support disabled, building mod_erlang_event will fail!])
94 + AC_MSG_WARN([erlang support disabled!])