Skip to content
Browse files

check for ssl and crypto app at compile time (TSUN-63)

SVN Revision: 829
  • Loading branch information...
1 parent cd0de81 commit 6c54808ce8641c7a52a210c9d5b33873406d1ed5 @nniclausse nniclausse committed
View
8 Makefile.in
@@ -114,8 +114,11 @@ TEST_TARGET = $(addsuffix .beam, $(basename \
DEBIAN = debian/changelog debian/control debian/compat debian/copyright debian/docs debian/tsung.dirs debian/rules
SRC_APPFILES = $(ESRC)/$(APPLICATION)/$(APPLICATION).app.src $(ESRC)/$(APPLICATION)/$(APPLICATION).rel.src
+SRC_APPFILES_IN = $(ESRC)/$(APPLICATION)/$(APPLICATION).app.src.in $(ESRC)/$(APPLICATION)/$(APPLICATION).rel.src
CONTROLLER_SRC_APPFILES = $(ESRC)/$(CONTROLLER_APPLICATION)/$(CONTROLLER_APPLICATION).app.src $(ESRC)/$(CONTROLLER_APPLICATION)/$(CONTROLLER_APPLICATION).rel.src
+CONTROLLER_SRC_APPFILES_IN = $(ESRC)/$(CONTROLLER_APPLICATION)/$(CONTROLLER_APPLICATION).app.src.in $(ESRC)/$(CONTROLLER_APPLICATION)/$(CONTROLLER_APPLICATION).rel.src
RECORDER_SRC_APPFILES = $(ESRC)/$(RECORDER_APPLICATION)/$(RECORDER_APPLICATION).app.src $(ESRC)/$(RECORDER_APPLICATION)/$(RECORDER_APPLICATION).rel.src
+RECORDER_SRC_APPFILES_IN = $(ESRC)/$(RECORDER_APPLICATION)/$(RECORDER_APPLICATION).app.src.in $(ESRC)/$(RECORDER_APPLICATION)/$(RECORDER_APPLICATION).rel.src
TGT_APPFILES_E = $(EBIN)/$(APPLICATION).app
CONTROLLER_TGT_APPFILES_E = $(EBIN)/$(CONTROLLER_APPLICATION).app
RECORDER_TGT_APPFILES_E = $(EBIN)/$(RECORDER_APPLICATION).app
@@ -332,8 +335,9 @@ doc:
release: Makefile tsung.spec doc
rm -fr $(distdir)
mkdir -p $(distdir)
- tar zcf tmp.tgz $(SRC) $(SRC_APPFILES) $(INC_FILES) $(LIBSRC) \
- $(CONTROLLER_SRC) $(CONTROLLER_SRC_APPFILES) $(TESTSRC) \
+ tar zcf tmp.tgz $(SRC) $(SRC_APPFILES_IN) $(INC_FILES) $(LIBSRC) \
+ $(CONTROLLER_SRC) $(CONTROLLER_SRC_APPFILES_IN) $(TESTSRC) \
+ $(RECORDER_SRC_APPFILES_IN) \
$(RECORDER_SRC) $(RECORDER_SRC_APPFILES) $(TEMPLATES) \
doc/*.erl doc/*.txt doc/*.fig doc/*.png doc/Makefile doc/*.sgml doc/*.1 \
$(USERMANUAL) $(USERMANUAL_SRC) $(USERMANUAL_IMG) $(DTD) \
View
118 configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for tsung 1.2.2.
+# Generated by GNU Autoconf 2.61 for tsung 1.2.3.
#
# Report bugs to <tsung-users@process-one.net>.
#
@@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='tsung'
PACKAGE_TARNAME='tsung'
-PACKAGE_VERSION='1.2.2'
-PACKAGE_STRING='tsung 1.2.2'
+PACKAGE_VERSION='1.2.3'
+PACKAGE_STRING='tsung 1.2.3'
PACKAGE_BUGREPORT='tsung-users@process-one.net'
ac_unique_file="src/tsung/tsung.erl"
@@ -625,6 +625,7 @@ ac_prefix_program
ERL_OPTS
ERLANG_XMERL_DIR
ERLDIR
+ERLANG_APPLICATIONS
DTD
TEMPLATES_SUBDIR
SET_MAKE
@@ -1139,7 +1140,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures tsung 1.2.2 to adapt to many kinds of systems.
+\`configure' configures tsung 1.2.3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1200,7 +1201,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of tsung 1.2.2:";;
+ short | recursive ) echo "Configuration of tsung 1.2.3:";;
esac
cat <<\_ACEOF
@@ -1270,7 +1271,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-tsung configure 1.2.2
+tsung configure 1.2.3
generated by GNU Autoconf 2.61
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1284,7 +1285,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by tsung $as_me 1.2.2, which was
+It was created by tsung $as_me 1.2.3, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
@@ -1989,12 +1990,9 @@ fi
echo $ECHO_N "checking xmerl.hrl... $ECHO_C" >&6; }
cat >>conftest.erl <<_EOF
-
-module(conftest).
-author('nicolas@niclux.org').
-
-export([start/0]).
-
start() ->
case code:lib_dir("xmerl") of
{error,bad_name} ->
@@ -2003,7 +2001,6 @@ start() ->
file:write_file("conftest.out", XMerlDirS)
end,
halt().
-
_EOF
if ! $ERLC conftest.erl; then
@@ -2074,6 +2071,93 @@ echo "${ECHO_T}yes" >&6; }
ERL_OPTS="-shared $ERL_OPTS"
fi
+{ echo "$as_me:$LINENO: checking ssl application" >&5
+echo $ECHO_N "checking ssl application... $ECHO_C" >&6; }
+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
+ { { echo "$as_me:$LINENO: error: could not compile sample program" >&5
+echo "$as_me: error: could not compile sample program" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+if ! $ERL -s confapp start ssl -noshell >/dev/null 2>&1 ; then
+ { { echo "$as_me:$LINENO: error: could not run sample program" >&5
+echo "$as_me: error: could not run sample program" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+if ! test -f confapp.out; then
+ { { echo "$as_me:$LINENO: error: erlang program was not properly executed, (confapp.out was
+ not produced)" >&5
+echo "$as_me: error: erlang program was not properly executed, (confapp.out was
+ not produced)" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ERLANG_SSL=`head -1 < confapp.out`
+if test "$ERLANG_SSL" == "error" ; then
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ ERLANG_APPLICATIONS="kernel,stdlib"
+else
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ ERLANG_APPLICATIONS="kernel,stdlib,ssl"
+fi
+
+{ echo "$as_me:$LINENO: checking crypto application " >&5
+echo $ECHO_N "checking crypto application ... $ECHO_C" >&6; }
+if ! $ERL -s confapp start crypto -noshell >/dev/null 2>&1 ; then
+ { { echo "$as_me:$LINENO: error: could not run sample program" >&5
+echo "$as_me: error: could not run sample program" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+if ! test -f confapp.out; then
+ { { echo "$as_me:$LINENO: error: erlang program was not properly executed, (confapp.out was
+ not produced)" >&5
+echo "$as_me: error: erlang program was not properly executed, (confapp.out was
+ not produced)" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ERLANG_SSL=`head -1 < confapp.out`
+if test "$ERLANG_SSL" == "error" ; then
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+else
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ ERLANG_APPLICATIONS="$ERLANG_APPLICATIONS,crypto"
+fi
+
+
@@ -2227,7 +2311,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-ac_config_files="$ac_config_files Makefile tsung.spec tsung.sh examples/*.xml src/tsung_stats.pl src/log2tsung.pl"
+ac_config_files="$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"
cat >confcache <<\_ACEOF
@@ -2656,7 +2740,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by tsung $as_me 1.2.2, which was
+This file was extended by tsung $as_me 1.2.3, which was
generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -2699,7 +2783,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
-tsung config.status 1.2.2
+tsung config.status 1.2.3
configured by $0, generated by GNU Autoconf 2.61,
with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
@@ -2804,6 +2888,9 @@ do
"examples/*.xml") CONFIG_FILES="$CONFIG_FILES examples/*.xml" ;;
"src/tsung_stats.pl") CONFIG_FILES="$CONFIG_FILES src/tsung_stats.pl" ;;
"src/log2tsung.pl") CONFIG_FILES="$CONFIG_FILES src/log2tsung.pl" ;;
+ "src/tsung_controller/tsung_controller.app.src") CONFIG_FILES="$CONFIG_FILES src/tsung_controller/tsung_controller.app.src" ;;
+ "src/tsung_recorder/tsung_recorder.app.src") CONFIG_FILES="$CONFIG_FILES src/tsung_recorder/tsung_recorder.app.src" ;;
+ "src/tsung/tsung.app.src") CONFIG_FILES="$CONFIG_FILES src/tsung/tsung.app.src" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
@@ -2910,6 +2997,7 @@ ac_prefix_program!$ac_prefix_program$ac_delim
ERL_OPTS!$ERL_OPTS$ac_delim
ERLANG_XMERL_DIR!$ERLANG_XMERL_DIR$ac_delim
ERLDIR!$ERLDIR$ac_delim
+ERLANG_APPLICATIONS!$ERLANG_APPLICATIONS$ac_delim
DTD!$DTD$ac_delim
TEMPLATES_SUBDIR!$TEMPLATES_SUBDIR$ac_delim
SET_MAKE!$SET_MAKE$ac_delim
@@ -2920,7 +3008,7 @@ LIBOBJS!$LIBOBJS$ac_delim
LTLIBOBJS!$LTLIBOBJS$ac_delim
_ACEOF
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 54; then
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 55; then
break
elif $ac_last_try; then
{ { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
View
87 configure.in
@@ -17,7 +17,7 @@ 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
@@ -29,12 +29,9 @@ 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} ->
@@ -43,17 +40,16 @@ start() ->
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)])
@@ -73,7 +69,7 @@ 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
+else
AC_MSG_RESULT(yes)
ERL_OPTS="+Mea r10b"
fi
@@ -89,23 +85,92 @@ 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
+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])
+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
View
2 src/tsung/tsung.app.src → src/tsung/tsung.app.src.in
@@ -69,6 +69,6 @@
{jabber_domain, "mydomain.com"}
]},
- {applications, [kernel, stdlib, ssl]},
+ {applications, [ @ERLANG_APPLICATIONS@]},
{mod, {tsung, []}}
]}.
View
2 ...tsung_controller/tsung_controller.app.src → ...ng_controller/tsung_controller.app.src.in
@@ -44,7 +44,7 @@
{config_file, "./tsung.xml"},
{log_file, "./tsung.log"}
]},
- {applications, [kernel, stdlib, ssl]},
+ {applications, [ @ERLANG_APPLICATIONS@ ]},
{start_phases, [{load_config, []},{start_os_monitoring,[{timeout,30000}]},
{start_clients,[]}]},
{mod, {tsung_controller, []}}
View
2 src/tsung_recorder/tsung_recorder.app.src → src/tsung_recorder/tsung_recorder.app.src.in
@@ -23,6 +23,6 @@
{proxy_log_file, "./tsung_recorder"},
{proxy_listen_port, 8090}
]},
- {applications, [kernel, stdlib, ssl]},
+ {applications, [@ERLANG_APPLICATIONS@]},
{mod, {tsung_recorder, []}}
]}.

0 comments on commit 6c54808

Please sign in to comment.
Something went wrong with that request. Please try again.