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,14 @@ 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_LDFLAGS="-L${STAGING_DIR}/usr/lib"
51 AC_MSG_RESULT([$ERLANG_LIBDIR])
53 - ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
54 + ERLANG_INCDIR=`$ERL -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
55 AC_MSG_CHECKING([erlang incdir])
56 if test -z "`echo $ERLANG_INCDIR`" ; then
57 AC_MSG_ERROR([failed])
58 @@ -58,10 +64,11 @@ then
64 AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"])
65 # maybe someday ei will actually expose this?
66 - AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
67 + # until then, we comment it out
68 + #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
70 if test "$has_libei" = "no" ; then
71 AS_IF([test "$with_erlang" = "try"],
72 @@ -75,7 +82,7 @@ then
75 ERLANG_LDFLAGS="$ERLANG_LDFLAGS -lei"
76 - AC_MSG_NOTICE([Your erlang seems OK, do not forget to enable mod_erlang_event in modules.conf])
77 + AC_MSG_NOTICE([Your erlang seems OK. You can now use ErLang in your codes.])
78 AC_SUBST([ERLANG_CFLAGS], [$ERLANG_CFLAGS])
79 AC_SUBST([ERLANG_LDFLAGS], [$ERLANG_LDFLAGS])
81 @@ -85,12 +92,12 @@ then
84 AS_IF([test "$with_erlang" = "try"],
85 - [AC_MSG_WARN([Could not find erlang, mod_erlang_event will not build, use --with-erlang to specify the location])],
86 + [AC_MSG_WARN([Could not find erlang, codes depend on erlang will not build, use --with-erlang to specify the location])],
87 [AC_MSG_ERROR([Could not find erlang, use --with-erlang to specify the location])]
91 - AC_MSG_WARN([erlang support disabled, building mod_erlang_event will fail!])
92 + AC_MSG_WARN([erlang support disabled!])