forked from processone/tsung
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
138 lines (118 loc) · 4.04 KB
/
configure.in
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
132
133
134
135
136
137
138
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()
AC_MSG_CHECKING(for Erlang/OTP '-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
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(public_key),
case application:start(ssl) of
ok -> ok;
Err -> halt(1)
end,
halt(0)])],
[erlang_cv_ssl_runnable=yes
ERLANG_APPLICATIONS="kernel,stdlib,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: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 orelse is allowed in guards
AC_CACHE_CHECK([if orelse is allowed in guards],
[erlang_cv_orelse],
[erlang_cv_orelse=no
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([], [dnl
case 3 of
A when A > 3 orelse A < 2 -> ok;
_ -> bad
end,
halt(0)])],
[erlang_cv_orelse=yes],
[AC_MSG_RESULT(WARNING: orelse/andalso not allowed in guards: XPATH parsing will be disabled !!!)])
])
AC_SUBST(erlang_cv_orelse)
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 \
src/tsung_recorder/tsung_recorder.app.src \
src/tsung/tsung.app.src \
])
AC_OUTPUT