24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-09-27 14:30:55 +02:00

Add --enable-debug compile option

This commit is contained in:
Evgeniy Khramtsov 2013-05-02 18:15:03 +10:00
parent 5ec65571f8
commit 0eaab78f67
4 changed files with 62 additions and 36 deletions

View File

@ -1,22 +0,0 @@
%% Macros
{roster_gateway_workaround, @roster_gateway_workaround@}.
{flash_hack, @flash_hack@}.
{transient_supervisors, @transient_supervisors@}.
{full_xml, @full_xml@}.
{nif, @nif@}.
{db_type, @db_type@}.
%% Dependencies
{mysql, @mysql@}.
{pgsql, @pgsql@}.
{pam, @pam@}.
{zlib, @zlib@}.
{stun, @stun@}.
{riak, @riak@}.
{json, @json@}.
{iconv, @iconv@}.
%% Local Variables:
%% mode: erlang
%% End:
%% vim: set filetype=erlang tabstop=8:

20
configure vendored
View File

@ -561,6 +561,7 @@ ac_default_prefix=/
ac_subst_vars='LTLIBOBJS
LIBOBJS
INSTALLUSER
debug
iconv
json
riak
@ -644,6 +645,7 @@ enable_stun
enable_riak
enable_json
enable_iconv
enable_debug
enable_user
'
ac_precious_vars='build_alias
@ -1287,6 +1289,7 @@ Optional Features:
--enable-riak enable Riak support (default: no)
--enable-json enable JSON support for mod_bosh (default: no)
--enable-iconv enable iconv support (default: no)
--enable-debug enable debug information (default: yes)
--enable-user[[[=USER]]]
allow this system user to start ejabberd (default:
no)
@ -2613,7 +2616,20 @@ fi
ac_config_files="$ac_config_files Makefile config.rebar src/ejabberd.app.src rel/reltool.config"
# Check whether --enable-debug was given.
if test "${enable_debug+set}" = set; then :
enableval=$enable_debug; case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) as_fn_error $? "bad value ${enableval} for --enable-debug" "$LINENO" 5 ;;
esac
else
debug=true
fi
ac_config_files="$ac_config_files Makefile rebar.config.script src/ejabberd.app.src rel/reltool.config"
ENABLEUSER=""
@ -3339,7 +3355,7 @@ for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"config.rebar") CONFIG_FILES="$CONFIG_FILES config.rebar" ;;
"rebar.config.script") CONFIG_FILES="$CONFIG_FILES rebar.config.script" ;;
"src/ejabberd.app.src") CONFIG_FILES="$CONFIG_FILES src/ejabberd.app.src" ;;
"rel/reltool.config") CONFIG_FILES="$CONFIG_FILES rel/reltool.config" ;;

View File

@ -174,8 +174,17 @@ AC_ARG_ENABLE(iconv,
esac],[iconv=false])
AC_SUBST(iconv)
AC_ARG_ENABLE(debug,
[AC_HELP_STRING([--enable-debug], [enable debug information (default: yes)])],
[case "${enableval}" in
yes) debug=true ;;
no) debug=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
esac],[debug=true])
AC_SUBST(debug)
AC_CONFIG_FILES([Makefile
config.rebar
rebar.config.script
src/ejabberd.app.src
rel/reltool.config])

View File

@ -6,12 +6,25 @@
%%% @end
%%% Created : 1 May 2013 by Evgeniy Khramtsov <ekhramtsov@process-one.net>
%%%-------------------------------------------------------------------
Cfg = case file:consult("config.rebar") of
{ok, Terms} ->
Terms;
{error, _} ->
[]
end,
Cfg = [%% Macros
{roster_gateway_workaround, @roster_gateway_workaround@},
{flash_hack, @flash_hack@},
{transient_supervisors, @transient_supervisors@},
{full_xml, @full_xml@},
{nif, @nif@},
{db_type, @db_type@},
{debug, @debug@},
%% Dependencies
{mysql, @mysql@},
{pgsql, @pgsql@},
{pam, @pam@},
{zlib, @zlib@},
{stun, @stun@},
{riak, @riak@},
{json, @json@},
{iconv, @iconv@}],
Macros = lists:flatmap(
fun({roster_gateway_workaround, true}) ->
[{d, 'ROSTER_GATEWAY_WORKAROUND'}];
@ -28,13 +41,21 @@ Macros = lists:flatmap(
(_) ->
[]
end, Cfg),
Head = [{erl_opts, [debug_info,
{i, "include"},
{i, "deps/logger/include"},
{i, "deps/xml/include"}
| Macros]},
DebugInfo = case lists:keysearch(debug, 1, Cfg) of
{value, {debug, true}} ->
[debug_info];
_ ->
[]
end,
Head = [{erl_opts, [{i, "include"},
{i, filename:join(["deps", "logger", "include"])},
{i, filename:join(["deps", "xml", "include"])}]
++ Macros ++ DebugInfo},
{src_dirs, [asn1, src]},
{sub_dirs, ["rel"]}],
Deps = [{logger, ".*", {git, "git://github.com/processone/p1_logger"}},
{tls, ".*", {git, "git://github.com/processone/tls"}},
{stringprep, ".*", {git, "git://github.com/processone/stringprep"}},
@ -42,6 +63,7 @@ Deps = [{logger, ".*", {git, "git://github.com/processone/p1_logger"}},
{lhttpc, ".*", {git, "git://github.com/esl/lhttpc"}},
%%{xml, ".*", {git, "git://github.com/processone/xml"}},
{xmlrpc, ".*", {git, "git://github.com/etnt/xmlrpc"}}],
CfgDeps = lists:flatmap(
fun({mysql, true}) ->
[{mysql, ".*", {git, "git://github.com/processone/mysql"}}];
@ -62,6 +84,7 @@ CfgDeps = lists:flatmap(
(_) ->
[]
end, Cfg),
Head ++ [{deps, Deps ++ CfgDeps}].
%% Local Variables: