Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6c54808ce8
Fetching contributors…

Cannot retrieve contributors at this time

177 lines (147 sloc) 4.673 kb
DNA define([AC_CACHE_LOAD], )dnl
dnl define([AC_CACHE_SAVE], )dnl
AC_INIT([tsung], m4_normalize(m4_include([vsn.mk])),[tsung-users@process-one.net])
AC_CONFIG_SRCDIR(src/tsung/tsung.erl)
dnl AM_INIT_AUTOMAKE()
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],[vsn.mk])
AC_SUBST([CONFIGURE_DEPENDENCIES],[vsn.mk])
dnl work out who the cpu, vendor and OS are
dnl AC_CANONICAL_SYSTEM
dnl AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target")
AC_PATH_PROG(SED, sed)
AC_ARG_WITH(erlang, [ --with-erlang=PREFIX path to erlc and erl ])
AC_PATH_TOOL(ERLC, erlc, , $with_erlang:$with_erlang/bin:$PATH)
AC_PATH_TOOL(ERL, erl, , $with_erlang:$with_erlang/bin:$PATH)
if test "z$ERLC" == "z" || test "z$ERL" == "z"; then
AC_MSG_ERROR([erlang not found])
fi
ERLDIR=`echo "${ERL}" | sed 's/\/bin\/*erl.*//'`
AC_PREFIX_PROGRAM(erl)
dnl check for xmerl include path
AC_MSG_CHECKING(xmerl.hrl)
cat >>conftest.erl <<_EOF
-module(conftest).
-author('nicolas@niclux.org').
-export([[start/0]]).
start() ->
case code:lib_dir("xmerl") of
{error,bad_name} ->
file:write_file("conftest.out", "notfound\n");
XMerlDirS ->
file:write_file("conftest.out", XMerlDirS)
end,
halt().
_EOF
if ! $ERLC conftest.erl; then
AC_MSG_ERROR([could not compile sample program])
fi
if ! $ERL -s conftest -noshell ; then
AC_MSG_ERROR([could not run sample program])
fi
if ! test -f conftest.out; then
AC_MSG_ERROR([erlang program was not properly executed, (conftest.out was
not produced)])
fi
ERLANG_XMERL_DIR=`head -1 < conftest.out`
if test -f "$ERLANG_XMERL_DIR/inc/xmerl.hrl"; then
ERLANG_XMERL_DIR="$ERLANG_XMERL_DIR/inc/"
AC_MSG_RESULT($ERLANG_XMERL_DIR)
elif test -f "$ERLANG_XMERL_DIR/include/xmerl.hrl"; then
ERLANG_XMERL_DIR="$ERLANG_XMERL_DIR/include/"
AC_MSG_RESULT($ERLANG_XMERL_DIR)
else
AC_MSG_ERROR([xmerl not found])
fi
AC_MSG_CHECKING(for '+Mea r10b' option)
if ! $ERL -noshell +Mea r10b -s init stop 2> /dev/null; then
AC_MSG_RESULT(no)
ERL_OPTS=""
else
AC_MSG_RESULT(yes)
ERL_OPTS="+Mea r10b"
fi
AC_MSG_CHECKING(for '-hybrid' option)
if ! $ERL -noshell -hybrid -smp 2 -s init stop 2> /dev/null; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
ERL_OPTS="-hybrid $ERL_OPTS"
fi
AC_MSG_CHECKING(for '-shared' option)
if ! $ERL -noshell -shared -smp 2 -s init stop 2> /dev/null; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
ERL_OPTS="-shared $ERL_OPTS"
fi
AC_MSG_CHECKING(ssl application)
cat >confapp.erl <<_EOF
-module(confapp).
-author('nicolas@niclux.org').
-export([[start/1]]).
start([[Args]]) ->
case application:start(Args) of
ok ->
case Args of
crypto ->
case catch crypto:md5("toto") of
<<247,29,190,82,98,138,63,131,167,122,180,148,129,117,37, 198>> -> ok;
_ ->
file:write_file("confapp.out", "error\n"),
halt()
end;
_ -> ok
end,
file:write_file("confapp.out", "ok\n");
Err ->
erlang:display([Err]),
file:write_file("confapp.out", "error\n")
end,
halt().
_EOF
if ! $ERLC confapp.erl; then
AC_MSG_ERROR([could not compile sample program])
fi
if ! $ERL -s confapp start ssl -noshell >/dev/null 2>&1 ; then
AC_MSG_ERROR([could not run sample program])
fi
if ! test -f confapp.out; then
AC_MSG_ERROR([erlang program was not properly executed, (confapp.out was
not produced)])
fi
ERLANG_SSL=`head -1 < confapp.out`
if test "$ERLANG_SSL" == "error" ; then
AC_MSG_RESULT(no)
ERLANG_APPLICATIONS="kernel,stdlib"
else
AC_MSG_RESULT(yes)
ERLANG_APPLICATIONS="kernel,stdlib,ssl"
fi
AC_MSG_CHECKING(crypto application )
if ! $ERL -s confapp start crypto -noshell >/dev/null 2>&1 ; then
AC_MSG_ERROR([could not run sample program])
fi
if ! test -f confapp.out; then
AC_MSG_ERROR([erlang program was not properly executed, (confapp.out was
not produced)])
fi
ERLANG_SSL=`head -1 < confapp.out`
if test "$ERLANG_SSL" == "error" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
ERLANG_APPLICATIONS="$ERLANG_APPLICATIONS,crypto"
fi
AC_SUBST(ERL_OPTS)
AC_SUBST(ERLANG_XMERL_DIR)
AC_SUBST(SED)
AC_SUBST(ERL)
AC_SUBST(ERLC)
AC_SUBST(ERLDIR)
AC_SUBST(ERLANG_APPLICATIONS)
AC_SUBST(DTD,[tsung-1.0.dtd])
AC_SUBST(TEMPLATES_SUBDIR,[tsung/templates])
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_CONFIG_FILES([Makefile tsung.spec tsung.sh examples/*.xml src/tsung_stats.pl src/log2tsung.pl src/tsung_controller/tsung_controller.app.src src/tsung_recorder/tsung_recorder.app.src src/tsung/tsung.app.src])
AC_OUTPUT
Jump to Line
Something went wrong with that request. Please try again.