3a748b34abcd4c75b51a9eed64c7094c2df5ae70
[feed/telephony.git] / net / freeswitch / patches / 0000002-build-config-erlang_m4.patch
1 --- a/build/config/erlang.m4
2 +++ b/build/config/erlang.m4
3 @@ -16,25 +16,26 @@ then
4
5 if test "$with_erlang" != "yes" -a "$with_erlang" != "try" ; then
6 AC_MSG_CHECKING([for erlang])
7 - if test ! -x "$with_erlang" ; then
8 + if test ! -x "$with_erlang/../../host/lib/erlang/bin" ; then
9 AC_MSG_ERROR([Specified erlang does not exist or is not executable: $with_erlang])
10 fi
11 - AC_MSG_RESULT([$with_erlang])
12 - AC_SUBST([ERLANG], ["$with_erlang"])
13 + AC_MSG_RESULT(["$with_erlang/../../host/lib/erlang/bin/erl"])
14 + AC_SUBST([ERL],["$with_erlang/../../host/lib/erlang/bin/erl"])
15 else
16 - AC_PATH_PROG([ERLANG], ["erl"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
17 + AC_ERLANG_NEED_ERL(["$with_erlang/../../host/lib/erlang/bin"])
18 fi
19
20 - if test "$ERLANG" != "no" ; then
21 + if test "$ERL" != "no" ; then
22 AC_MSG_CHECKING([erlang version])
23 - ERLANG_VER="`$ERLANG -version 2>&1 | cut -d' ' -f6`"
24 + ERLANG_VER="`$ERL -version 2>&1 | cut -d' ' -f6`"
25
26 if test -z "$ERLANG_VER" ; then
27 AC_MSG_ERROR([Unable to detect erlang version])
28 + else
29 + AC_MSG_RESULT([$ERLANG_VER])
30 fi
31 - AC_MSG_RESULT([$ERLANG_VER])
32
33 - ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
34 + ERLANG_LIBDIR="$with_erlang/lib"
35 AC_MSG_CHECKING([erlang libdir])
36 if test -z "`echo $ERLANG_LIBDIR`" ; then
37 AC_MSG_ERROR([failed])
38 @@ -44,7 +45,7 @@ then
39 fi
40 AC_MSG_RESULT([$ERLANG_LIBDIR])
41
42 - ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
43 + ERLANG_INCDIR="$with_erlang/include"
44 AC_MSG_CHECKING([erlang incdir])
45 if test -z "`echo $ERLANG_INCDIR`" ; then
46 AC_MSG_ERROR([failed])
47 @@ -61,7 +62,8 @@ then
48 # check liei
49 AC_CHECK_LIB([$ERLANG_LIB], [ei_encode_version], [has_libei="yes"], [has_libei="no"])
50 # maybe someday ei will actually expose this?
51 - AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
52 + # until then, we comment it out
53 + #AC_CHECK_LIB([$ERLANG_LIB], [ei_link_unlink], [ERLANG_CFLAGS="$ERLANG_CFLAGS -DEI_LINK_UNLINK"])
54
55 if test "$has_libei" = "no" ; then
56 AS_IF([test "$with_erlang" = "try"],