2013-04-08 11:12:54 +02:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.53)
|
2014-10-01 17:39:26 +02:00
|
|
|
AC_INIT(ejabberd, m4_esyscmd([echo `git describe --tags 2>/dev/null || echo 0.0` | sed 's/-g.*//;s/-/./' | tr -d '\012']), [ejabberd@process-one.net], [ejabberd])
|
2019-10-25 10:44:04 +02:00
|
|
|
REQUIRE_ERLANG_MIN="8.3 (Erlang/OTP 19.3)"
|
2017-07-27 15:31:38 +02:00
|
|
|
REQUIRE_ERLANG_MAX="100.0.0 (No Max)"
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2015-06-30 10:53:45 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_SED
|
|
|
|
|
|
|
|
if test "x$GCC" = "xyes"; then
|
|
|
|
CFLAGS="$CFLAGS -Wall"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Checks Erlang runtime and compiler
|
|
|
|
AC_ARG_WITH(erlang,
|
|
|
|
AC_HELP_STRING([--with-erlang=dir],
|
|
|
|
[search for erlang in dir]),
|
|
|
|
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_erlang" = "X"; then
|
|
|
|
extra_erl_path=""
|
|
|
|
else
|
|
|
|
extra_erl_path="$with_erlang:$with_erlang/bin:"
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
2020-09-21 16:14:12 +02:00
|
|
|
AC_ARG_WITH(rebar,
|
|
|
|
AC_HELP_STRING([--with-rebar=bin],
|
2021-07-15 21:31:31 +02:00
|
|
|
[use the rebar/rebar3/mix binary specified]),
|
2020-09-21 16:14:12 +02:00
|
|
|
[if test "$withval" = "yes" -o "$withval" = "no" -o "X$with_rebar" = "X"; then
|
|
|
|
rebar="rebar"
|
|
|
|
else
|
|
|
|
rebar="$with_rebar"
|
|
|
|
fi
|
|
|
|
], [rebar="rebar"])
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_PATH_TOOL(ERL, erl, , [${extra_erl_path}$PATH])
|
|
|
|
AC_PATH_TOOL(ERLC, erlc, , [${extra_erl_path}$PATH])
|
2016-05-01 21:29:59 +02:00
|
|
|
AC_PATH_TOOL(EPMD, epmd, , [${extra_erl_path}$PATH])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
AC_ERLANG_NEED_ERL
|
|
|
|
AC_ERLANG_NEED_ERLC
|
|
|
|
|
|
|
|
# Checks and sets ERLANG_ROOT_DIR and ERLANG_LIB_DIR variable
|
|
|
|
AC_ERLANG_SUBST_ROOT_DIR
|
|
|
|
# AC_ERLANG_SUBST_LIB_DIR
|
|
|
|
|
|
|
|
#locating escript
|
|
|
|
AC_PATH_PROG([ESCRIPT], [escript], [], [$ERLANG_ROOT_DIR/bin])
|
|
|
|
|
|
|
|
#locating make
|
|
|
|
AC_CHECK_PROG([MAKE], [make], [make], [])
|
|
|
|
|
|
|
|
if test "x$ESCRIPT" = "x"; then
|
|
|
|
AC_MSG_ERROR(['escript' was not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test "x$MAKE" = "x"; then
|
|
|
|
AC_MSG_ERROR(['make' was not found])
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Change default prefix
|
2017-04-06 15:35:02 +02:00
|
|
|
AC_PREFIX_DEFAULT(/usr/local)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2021-02-16 18:28:30 +01:00
|
|
|
vars.config])
|
2020-05-19 13:14:10 +02:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(all,
|
2021-03-08 13:53:37 +01:00
|
|
|
[AC_HELP_STRING([--enable-all], [same as --enable-odbc --enable-mysql --enable-pgsql --enable-sqlite --enable-pam --enable-zlib --enable-redis --enable-elixir --enable-stun --enable-sip --enable-debug --enable-lua --enable-tools (useful for Dialyzer checks, default: no)])],
|
2013-04-08 11:12:54 +02:00
|
|
|
[case "${enableval}" in
|
2021-03-08 13:53:37 +01:00
|
|
|
yes) odbc=true mysql=true pgsql=true sqlite=true pam=true zlib=true redis=true elixir=true stun=true sip=true debug=true lua=true tools=true ;;
|
|
|
|
no) odbc=false mysql=false pgsql=false sqlite=false pam=false zlib=false redis=false elixir=false stun=false sip=false debug=false lua=false tools=false ;;
|
2020-05-19 13:14:10 +02:00
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-all) ;;
|
|
|
|
esac],[])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
[AC_HELP_STRING([--enable-debug], [enable debug information (default: yes)])],
|
2013-04-08 11:12:54 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) debug=true ;;
|
|
|
|
no) debug=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
|
|
|
|
esac],[if test "x$debug" = "x"; then debug=true; fi])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(elixir,
|
|
|
|
[AC_HELP_STRING([--enable-elixir], [enable Elixir support (default: no)])],
|
2017-11-02 15:03:30 +01:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) elixir=true ;;
|
|
|
|
no) elixir=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-elixir) ;;
|
|
|
|
esac],[if test "x$elixir" = "x"; then elixir=false; fi])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(erlang-version-check,
|
|
|
|
[AC_HELP_STRING([--enable-erlang-version-check],
|
|
|
|
[Check Erlang/OTP version (default: yes)])])
|
|
|
|
case "$enable_erlang_version_check" in
|
|
|
|
yes|'')
|
|
|
|
ERLANG_VERSION_CHECK([$REQUIRE_ERLANG_MIN],[$REQUIRE_ERLANG_MAX])
|
|
|
|
;;
|
|
|
|
no)
|
|
|
|
ERLANG_VERSION_CHECK([$REQUIRE_ERLANG_MIN],[$REQUIRE_ERLANG_MAX],[warn])
|
|
|
|
;;
|
|
|
|
esac
|
2017-11-02 15:03:30 +01:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_ARG_ENABLE(full_xml,
|
|
|
|
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) full_xml=true ;;
|
|
|
|
no) full_xml=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-full-xml) ;;
|
|
|
|
esac],[full_xml=false])
|
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
ENABLEGROUP=""
|
|
|
|
AC_ARG_ENABLE(group,
|
|
|
|
[AS_HELP_STRING([--enable-group[[[[=GROUP]]]]], [allow this system group to start ejabberd (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) ENABLEGROUP=`groups |head -n 1` ;;
|
|
|
|
no) ENABLEGROUP="" ;;
|
|
|
|
*) ENABLEGROUP=$enableval
|
|
|
|
esac],
|
|
|
|
[])
|
|
|
|
if test "$ENABLEGROUP" != ""; then
|
|
|
|
echo "allow this system group to start ejabberd: $ENABLEGROUP"
|
|
|
|
AC_SUBST([INSTALLGROUP], [$ENABLEGROUP])
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(latest_deps,
|
|
|
|
[AC_HELP_STRING([--enable-latest-deps], [makes rebar use latest commits for dependencies instead of tagged versions (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) latest_deps=true ;;
|
|
|
|
no) latest_deps=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-latest-deps) ;;
|
|
|
|
esac],[if test "x$latest_deps" = "x"; then latest_deps=false; fi])
|
|
|
|
|
2021-03-08 13:53:37 +01:00
|
|
|
AC_ARG_ENABLE(lua,
|
|
|
|
[AC_HELP_STRING([--enable-lua], [enable Lua support, to import from Prosody (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) lua=true ;;
|
|
|
|
no) lua=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-lua) ;;
|
|
|
|
esac],[if test "x$lua" = "x"; then lua=false; fi])
|
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_ARG_ENABLE(mssql,
|
|
|
|
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
|
|
|
|
[case "${enableval}" in
|
2020-04-28 16:52:08 +02:00
|
|
|
yes) db_type=mssql; mssql=true ;;
|
|
|
|
no) db_type=generic; mssql=false ;;
|
2013-04-08 11:12:54 +02:00
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mssql) ;;
|
|
|
|
esac],[db_type=generic])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(mysql,
|
|
|
|
[AC_HELP_STRING([--enable-mysql], [enable MySQL support (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) mysql=true ;;
|
|
|
|
no) mysql=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mysql) ;;
|
|
|
|
esac],[if test "x$mysql" = "x"; then mysql=false; fi])
|
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(new_sql_schema,
|
|
|
|
[AC_HELP_STRING([--enable-new-sql-schema], [use new SQL schema (default: no)])],
|
2013-04-08 11:12:54 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) new_sql_schema=true ;;
|
|
|
|
no) new_sql_schema=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-new-sql-schema) ;;
|
|
|
|
esac],[new_sql_schema=false])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(odbc,
|
|
|
|
[AC_HELP_STRING([--enable-odbc], [enable pure ODBC support (default: no)])],
|
2015-03-16 19:53:19 +01:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) odbc=true ;;
|
|
|
|
no) odbc=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-odbc) ;;
|
|
|
|
esac],[if test "x$odbc" = "x"; then odbc=false; fi])
|
2015-03-16 19:53:19 +01:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_ARG_ENABLE(pam,
|
|
|
|
[AC_HELP_STRING([--enable-pam], [enable PAM support (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) pam=true ;;
|
|
|
|
no) pam=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pam) ;;
|
|
|
|
esac],[if test "x$pam" = "x"; then pam=false; fi])
|
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(pgsql,
|
|
|
|
[AC_HELP_STRING([--enable-pgsql], [enable PostgreSQL support (default: no)])],
|
2013-04-08 11:12:54 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) pgsql=true ;;
|
|
|
|
no) pgsql=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pgsql) ;;
|
|
|
|
esac],[if test "x$pgsql" = "x"; then pgsql=false; fi])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2015-03-11 12:46:57 +01:00
|
|
|
AC_ARG_ENABLE(redis,
|
|
|
|
[AC_HELP_STRING([--enable-redis], [enable Redis support (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) redis=true ;;
|
|
|
|
no) redis=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-redis) ;;
|
|
|
|
esac],[if test "x$redis" = "x"; then redis=false; fi])
|
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(roster_gateway_workaround,
|
|
|
|
[AC_HELP_STRING([--enable-roster-gateway-workaround], [turn on workaround for processing gateway subscriptions (default: no)])],
|
2013-04-08 11:12:54 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) roster_gateway_workaround=true ;;
|
|
|
|
no) roster_gateway_workaround=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-roster-gateway-workaround) ;;
|
|
|
|
esac],[roster_gateway_workaround=false])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(sip,
|
|
|
|
[AC_HELP_STRING([--enable-sip], [enable SIP support (default: no)])],
|
2015-12-18 17:20:18 +01:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) sip=true ;;
|
|
|
|
no) sip=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-sip) ;;
|
|
|
|
esac],[if test "x$sip" = "x"; then sip=false; fi])
|
2015-12-18 17:20:18 +01:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(sqlite,
|
|
|
|
[AC_HELP_STRING([--enable-sqlite], [enable SQLite support (default: no)])],
|
2017-05-31 11:30:34 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) sqlite=true ;;
|
|
|
|
no) sqlite=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-sqlite) ;;
|
|
|
|
esac],[if test "x$sqlite" = "x"; then sqlite=false; fi])
|
2017-05-31 11:30:34 +02:00
|
|
|
|
2017-05-23 12:12:48 +02:00
|
|
|
AC_ARG_ENABLE(stun,
|
2020-04-20 00:37:41 +02:00
|
|
|
[AC_HELP_STRING([--enable-stun], [enable STUN/TURN support (default: yes)])],
|
2017-05-23 12:12:48 +02:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) stun=true ;;
|
|
|
|
no) stun=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-stun) ;;
|
2020-04-20 00:37:41 +02:00
|
|
|
esac],[if test "x$stun" = "x"; then stun=true; fi])
|
2017-05-23 12:12:48 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(system_deps,
|
|
|
|
[AC_HELP_STRING([--enable-system-deps], [makes rebar use locally installed dependencies instead of downloading them (default: no)])],
|
2017-05-23 12:12:48 +02:00
|
|
|
[case "${enableval}" in
|
2020-05-19 13:14:10 +02:00
|
|
|
yes) system_deps=true ;;
|
|
|
|
no) system_deps=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-system-deps) ;;
|
|
|
|
esac],[if test "x$system_deps" = "x"; then system_deps=false; fi])
|
2017-05-23 12:12:48 +02:00
|
|
|
|
2020-05-19 13:14:10 +02:00
|
|
|
AC_ARG_ENABLE(tools,
|
|
|
|
[AC_HELP_STRING([--enable-tools], [build development tools (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) tools=true ;;
|
|
|
|
no) tools=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-tools) ;;
|
|
|
|
esac],[if test "x$tools" = "x"; then tools=false; fi])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
ENABLEUSER=""
|
|
|
|
AC_ARG_ENABLE(user,
|
|
|
|
[AS_HELP_STRING([--enable-user[[[[=USER]]]]], [allow this system user to start ejabberd (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) ENABLEUSER=`whoami` ;;
|
|
|
|
no) ENABLEUSER="" ;;
|
|
|
|
*) ENABLEUSER=$enableval
|
|
|
|
esac],
|
|
|
|
[])
|
|
|
|
if test "$ENABLEUSER" != ""; then
|
|
|
|
echo "allow this system user to start ejabberd: $ENABLEUSER"
|
|
|
|
AC_SUBST([INSTALLUSER], [$ENABLEUSER])
|
|
|
|
fi
|
2020-05-19 13:14:10 +02:00
|
|
|
|
|
|
|
AC_ARG_ENABLE(zlib,
|
|
|
|
[AC_HELP_STRING([--enable-zlib], [enable Stream Compression (XEP-0138) using zlib (default: yes)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) zlib=true ;;
|
|
|
|
no) zlib=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-zlib) ;;
|
|
|
|
esac],[if test "x$zlib" = "x"; then zlib=true; fi])
|
2013-04-08 11:12:54 +02:00
|
|
|
|
2020-12-23 13:41:13 +01:00
|
|
|
case "`uname`" in
|
|
|
|
"Darwin")
|
|
|
|
# Darwin (macos) erlang-sqlite is built using amalgamated lib, so no external dependency
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
if test "$sqlite" = "true"; then
|
|
|
|
AX_LIB_SQLITE3([3.6.19])
|
|
|
|
if test "x$SQLITE3_VERSION" = "x"; then
|
|
|
|
AC_MSG_ERROR(SQLite3 library >= 3.6.19 was not found)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2015-04-08 13:49:14 +02:00
|
|
|
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_SUBST(roster_gateway_workaround)
|
2017-11-02 15:03:30 +01:00
|
|
|
AC_SUBST(new_sql_schema)
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_SUBST(full_xml)
|
|
|
|
AC_SUBST(db_type)
|
|
|
|
AC_SUBST(odbc)
|
|
|
|
AC_SUBST(mysql)
|
|
|
|
AC_SUBST(pgsql)
|
2015-03-16 19:53:19 +01:00
|
|
|
AC_SUBST(sqlite)
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_SUBST(pam)
|
|
|
|
AC_SUBST(zlib)
|
2020-09-21 16:14:12 +02:00
|
|
|
AC_SUBST(rebar)
|
2015-03-11 12:46:57 +01:00
|
|
|
AC_SUBST(redis)
|
2015-01-29 18:43:47 +01:00
|
|
|
AC_SUBST(elixir)
|
2017-05-23 12:12:48 +02:00
|
|
|
AC_SUBST(stun)
|
|
|
|
AC_SUBST(sip)
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_SUBST(debug)
|
2021-03-08 13:53:37 +01:00
|
|
|
AC_SUBST(lua)
|
2013-04-08 11:12:54 +02:00
|
|
|
AC_SUBST(tools)
|
2015-12-18 17:20:18 +01:00
|
|
|
AC_SUBST(latest_deps)
|
2017-05-31 11:30:34 +02:00
|
|
|
AC_SUBST(system_deps)
|
2015-10-20 15:22:39 +02:00
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
AC_SUBST(CPPFLAGS)
|
|
|
|
AC_SUBST(LDFLAGS)
|
2013-04-08 11:12:54 +02:00
|
|
|
|
|
|
|
AC_OUTPUT
|