forked from processone/tsung
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
131 lines (112 loc) · 3.89 KB
/
configure.ac
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
dnl DNA define([AC_CACHE_LOAD], )dnl
AC_INIT([tsung], m4_normalize(m4_include([vsn.mk])),[[email protected]])
AC_PREREQ(2.59c)
AC_COPYRIGHT(Copyright (C) 2008 Nicolas Niclausse)
AC_CONFIG_SRCDIR(src/tsung/tsung.erl)
dnl AM_INIT_AUTOMAKE()
AC_CACHE_LOAD
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],[vsn.mk])
AC_SUBST([CONFIGURE_DEPENDENCIES],[vsn.mk])
AC_PATH_PROG(SED, sed)
AC_LANG(Erlang)
AC_ARG_WITH(erlang, [ --with-erlang=PREFIX path to erlc and erl ])
AC_ERLANG_PATH_ERLC(erlc, $with_erlang:$with_erlang/bin:$PATH)
AC_ERLANG_PATH_ERL(erl, $with_erlang:$with_erlang/bin:$PATH)
AC_PATH_PROG(DIALYZER,dialyzer, /usr/bin/dializer, $with_erlang:$with_erlang/bin:$PATH)
AC_PREFIX_PROGRAM(erl)
AC_ERLANG_SUBST_ROOT_DIR()
dnl check for xmerl include path
AC_ERLANG_CHECK_LIB(xmerl)
AC_ERLANG_CHECK_LIB(ssl)
AC_ERLANG_CHECK_LIB(crypto)
AC_ERLANG_CHECK_LIB(public_key)
dnl check if ssl is working
AC_CACHE_CHECK([if Erlang/OTP SSL application is running fine],
[erlang_cv_ssl_runnable],
[erlang_cv_ssl_runnable=no
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
case application:start(ssl) of
ok -> ok;
Err -> halt(1)
end,
halt(0)])],
[erlang_cv_ssl_runnable=yes
ERLANG_APPLICATIONS="kernel,stdlib,ssl"],
[
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
application:start(crypto),
application:start(asn1),
application:start(public_key),
case application:start(ssl) of
ok -> ok;
Err -> halt(1)
end,
halt(0)])],
[erlang_cv_ssl_runnable=yes
ERLANG_APPLICATIONS="kernel,stdlib,asn1,crypto,public_key,ssl"],
[ERLANG_APPLICATIONS="kernel,stdlib"
AC_MSG_RESULT(WARNING: ssl application is not working properly !!!)])
])
])
dnl check if crypto is working
AC_CACHE_CHECK([if Erlang/OTP crypto application is running fine],
[erlang_cv_crypto_runnable],
[erlang_cv_crypto_runnable=no
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
case application:start(crypto) of
ok ->
case catch crypto:hash(md5, "toto") of
<<247,29,190,82,98,138,63,131,167,122,180,148,129,117,37, 198>> -> ok;
_ ->
halt(1)
end;
Err ->
erlang:display([Err]),
halt(1)
end,
halt(0) ])],
[ erlang_cv_crypto_runnable=yes
ERLANG_APPLICATIONS="$ERLANG_APPLICATIONS,crypto" ],
[ AC_MSG_RESULT([WARNING: crypto application is not working properly !!!])]) ])
dnl check if new time API is available (R18 and up)
AC_CACHE_CHECK([new time API],
[erlang_cv_new_time_api],
[erlang_cv_new_time_api=no
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
R=case catch erlang:timestamp() of
{A,B,C} -> 0;
_ -> 1
end,
halt(R)])],
[erlang_cv_new_time_api=yes],
[AC_MSG_RESULT(WARNING: new time API not available. use old now() instead)])
])
AC_SUBST(erlang_cv_new_time_api)
AC_SUBST(ERL_OPTS)
AC_SUBST(ERLANG_APPLICATIONS)
AC_SUBST(DTD,[tsung-1.0.dtd])
AC_SUBST(TEMPLATES_SUBDIR,[tsung/templates])
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
AC_MSG_NOTICE(Storing library files in $EXPANDED_LIBDIR)
AS_AC_EXPAND(EXPANDED_SHAREDIR, "$datadir/tsung")
AC_MSG_NOTICE(Storing data files in $EXPANDED_SHAREDIR)
AC_CONFIG_FILES([\
Makefile \
tsung.spec \
tsung.sh \
tsung-recorder.sh \
examples/*.xml \
src/tsung_stats.pl \
src/tsung-plotter/tsplot.py \
src/log2tsung.pl \
src/tsung_controller/tsung_controller.app \
src/tsung_recorder/tsung_recorder.app \
src/tsung/tsung.app \
])
AC_OUTPUT