Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 94ec7aa045
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 112 lines (88 sloc) 2.807 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
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_SUBST(ERL_OPTS)
AC_SUBST(ERLANG_XMERL_DIR)
AC_SUBST(SED)
AC_SUBST(ERL)
AC_SUBST(ERLC)
AC_SUBST(ERLDIR)
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])

AC_OUTPUT
Something went wrong with that request. Please try again.