From d3247c3eeec50083acb266e7277e06a8ebf6f2c7 Mon Sep 17 00:00:00 2001
From: Andrew Thompson <andrew@hijacked.us>
Date: Tue, 12 May 2009 20:00:49 +0000
Subject: [PATCH] Fix erlang autoconf macro to deal with crazy things being in
 ~/.erlang (MODEVENT-45)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13288 d0543943-73ff-0310-b7d9-9358b9ac24b2
---
 build/config/erlang.m4 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/build/config/erlang.m4 b/build/config/erlang.m4
index 6fc8378006..32969e15b5 100644
--- a/build/config/erlang.m4
+++ b/build/config/erlang.m4
@@ -34,7 +34,7 @@ then
 		fi
 		AC_MSG_RESULT([$ERLANG_VER])
 
-		ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt`
+		ERLANG_LIBDIR=`$ERLANG -noshell -eval 'io:format("~n~s/lib~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
 		AC_MSG_CHECKING([erlang libdir])
 		if test -z "`echo $ERLANG_LIBDIR`" ; then
 			AC_MSG_ERROR([failed])
@@ -44,7 +44,7 @@ then
 		fi
 		AC_MSG_RESULT([$ERLANG_LIBDIR])
 
-		ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt`
+		ERLANG_INCDIR=`$ERLANG -noshell -eval 'io:format("~n~s/include~n", [[code:lib_dir("erl_interface")]]).' -s erlang halt | tail -n 1`
 		AC_MSG_CHECKING([erlang incdir])
 		if test -z "`echo $ERLANG_INCDIR`" ; then
 			AC_MSG_ERROR([failed])