2003-10-17 21:15:38 +02:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
|
|
|
AC_PREREQ(2.53)
|
2010-06-12 13:53:59 +02:00
|
|
|
AC_INIT(ejabberd, m4_esyscmd([grep -o -E "\{vsn,.\".*\"\}" ejabberd.app | cut -d \" -f 2 | tr -d '\n']), [ejabberd@process-one.net], [ejabberd])
|
2003-10-17 21:15:38 +02:00
|
|
|
|
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
2007-11-29 17:59:35 +01:00
|
|
|
if test "x$GCC" = "xyes"; then
|
|
|
|
CFLAGS="$CFLAGS -Wall"
|
|
|
|
fi
|
|
|
|
|
2003-10-17 21:15:38 +02:00
|
|
|
#locating erlang
|
|
|
|
AM_WITH_ERLANG
|
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
AC_C_CONST
|
|
|
|
|
2008-07-11 14:48:27 +02:00
|
|
|
# Check Erlang headers are installed
|
|
|
|
#AC_CHECK_HEADER(erl_driver.h,,[AC_MSG_ERROR([cannot find Erlang header files])])
|
|
|
|
|
2006-02-02 17:59:38 +01:00
|
|
|
# Change default prefix
|
2007-03-10 17:27:17 +01:00
|
|
|
AC_PREFIX_DEFAULT(/)
|
2006-02-02 17:59:38 +01:00
|
|
|
|
2003-10-17 21:15:38 +02:00
|
|
|
# Checks for library functions.
|
|
|
|
AC_FUNC_MALLOC
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
AC_MOD_ENABLE(mod_muc, yes)
|
2006-10-28 04:04:55 +02:00
|
|
|
AC_MOD_ENABLE(mod_proxy65, yes)
|
2009-01-19 12:16:44 +01:00
|
|
|
AC_MOD_ENABLE(mod_pubsub, yes)
|
2003-11-23 21:11:21 +01:00
|
|
|
AC_MOD_ENABLE(eldap, yes)
|
2005-05-23 22:27:17 +02:00
|
|
|
AC_MOD_ENABLE(odbc, no)
|
2009-01-19 12:16:44 +01:00
|
|
|
AC_MOD_ENABLE(tls, yes)
|
|
|
|
AC_MOD_ENABLE(web, yes)
|
|
|
|
|
2006-01-19 03:17:31 +01:00
|
|
|
AC_MOD_ENABLE(ejabberd_zlib, yes)
|
2009-01-19 12:16:44 +01:00
|
|
|
#locating zlib
|
|
|
|
AM_WITH_ZLIB
|
|
|
|
|
|
|
|
AC_MOD_ENABLE(pam, no)
|
|
|
|
#locating PAM
|
|
|
|
AM_WITH_PAM
|
2003-10-17 21:15:38 +02:00
|
|
|
|
2007-12-06 18:09:35 +01:00
|
|
|
AC_ARG_ENABLE(hipe,
|
2008-07-15 10:45:05 +02:00
|
|
|
[AC_HELP_STRING([--enable-hipe], [compile natively with HiPE, not recommended (default: no)])],
|
2007-12-06 18:09:35 +01:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) hipe=true ;;
|
|
|
|
no) hipe=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-hipe) ;;
|
|
|
|
esac],[hipe=false])
|
|
|
|
AC_SUBST(hipe)
|
|
|
|
|
2005-12-11 20:48:31 +01:00
|
|
|
AC_ARG_ENABLE(roster_gateway_workaround,
|
2008-07-15 10:45:05 +02:00
|
|
|
[AC_HELP_STRING([--enable-roster-gateway-workaround], [turn on workaround for processing gateway subscriptions (default: no)])],
|
2005-12-11 20:48:31 +01:00
|
|
|
[case "${enableval}" in
|
|
|
|
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])
|
|
|
|
AC_SUBST(roster_gateway_workaround)
|
|
|
|
|
2011-07-08 17:17:05 +02:00
|
|
|
AC_ARG_ENABLE(flash_hack,
|
|
|
|
[AC_HELP_STRING([--enable-flash-hack], [support Adobe Flash client XML (default: no)])],
|
|
|
|
[case "${enableval}" in
|
|
|
|
yes) flash_hack=true ;;
|
|
|
|
no) flash_hack=false ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-flash-hack) ;;
|
|
|
|
esac],[flash_hack=false])
|
|
|
|
AC_SUBST(flash_hack)
|
|
|
|
|
2006-09-03 17:15:46 +02:00
|
|
|
AC_ARG_ENABLE(mssql,
|
2008-07-15 10:45:05 +02:00
|
|
|
[AC_HELP_STRING([--enable-mssql], [use Microsoft SQL Server database (default: no, requires --enable-odbc)])],
|
2006-09-03 17:15:46 +02:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) db_type=mssql ;;
|
|
|
|
no) db_type=generic ;;
|
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-mssql) ;;
|
|
|
|
esac],[db_type=generic])
|
|
|
|
AC_SUBST(db_type)
|
|
|
|
|
2007-09-14 16:16:36 +02:00
|
|
|
AC_ARG_ENABLE(transient_supervisors,
|
2008-07-15 10:45:05 +02:00
|
|
|
[AC_HELP_STRING([--enable-transient_supervisors], [use Erlang supervision for transient process (default: yes)])],
|
2007-09-14 16:16:36 +02:00
|
|
|
[case "${enableval}" in
|
|
|
|
yes) transient_supervisors=true ;;
|
|
|
|
no) transient_supervisors=false ;;
|
2010-07-01 16:59:26 +02:00
|
|
|
*) AC_MSG_ERROR(bad value ${enableval} for --enable-transient_supervisors) ;;
|
2007-09-14 16:16:36 +02:00
|
|
|
esac],[transient_supervisors=true])
|
|
|
|
AC_SUBST(transient_supervisors)
|
|
|
|
|
2007-07-31 14:05:00 +02:00
|
|
|
AC_ARG_ENABLE(full_xml,
|
2008-07-15 10:45:05 +02:00
|
|
|
[AC_HELP_STRING([--enable-full-xml], [use XML features in XMPP stream (ex: CDATA) (default: no, requires XML compliant clients)])],
|
2007-07-31 14:05:00 +02:00
|
|
|
[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])
|
|
|
|
AC_SUBST(full_xml)
|
|
|
|
|
2003-10-17 21:15:38 +02:00
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
$make_mod_muc
|
|
|
|
$make_mod_pubsub
|
2006-10-28 04:04:55 +02:00
|
|
|
$make_mod_proxy65
|
2003-11-23 21:11:21 +01:00
|
|
|
$make_eldap
|
2007-10-01 12:33:03 +02:00
|
|
|
$make_pam
|
2004-03-12 14:36:27 +01:00
|
|
|
$make_web
|
2009-08-11 20:23:54 +02:00
|
|
|
stun/Makefile
|
2005-05-23 22:27:17 +02:00
|
|
|
$make_tls
|
2006-01-19 03:17:31 +01:00
|
|
|
$make_odbc
|
|
|
|
$make_ejabberd_zlib])
|
2004-08-05 22:46:24 +02:00
|
|
|
#openssl
|
|
|
|
AM_WITH_OPENSSL
|
2006-05-27 10:46:27 +02:00
|
|
|
# If ssl is kerberized it need krb5.h
|
|
|
|
# On RedHat and OpenBSD, krb5.h is in an unsual place:
|
|
|
|
KRB5_INCLUDE="`krb5-config --cflags 2>/dev/null`"
|
|
|
|
if test -n "$KRB5_INCLUDE" ; then
|
|
|
|
CPPFLAGS="$CPPFLAGS $KRB5_INCLUDE"
|
|
|
|
else
|
|
|
|
# For RedHat For BSD
|
|
|
|
for D in /usr/kerberos/include /usr/include/kerberos /usr/include/kerberosV
|
|
|
|
do
|
|
|
|
if test -d $D ; then
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$D"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
AC_CHECK_HEADER(krb5.h,,)
|
|
|
|
|
2008-07-15 10:45:05 +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
|
|
|
|
|
2010-08-07 14:28:48 +02:00
|
|
|
AC_CHECK_HEADER(openssl/md2.h, md2=true, md2=false)
|
|
|
|
AC_SUBST(md2)
|
|
|
|
|
2009-10-12 14:59:07 +02:00
|
|
|
AC_CANONICAL_SYSTEM
|
|
|
|
#AC_DEFINE_UNQUOTED(CPU_VENDOR_OS, "$target")
|
|
|
|
#AC_SUBST(target_os)
|
|
|
|
|
|
|
|
|
|
|
|
case "$target_os" in
|
|
|
|
*darwin10*)
|
|
|
|
echo "Target OS is 'Darwin10'"
|
|
|
|
AC_LANG(Erlang)
|
|
|
|
AC_RUN_IFELSE(
|
|
|
|
[AC_LANG_PROGRAM([],[dnl
|
|
|
|
halt(case erlang:system_info(wordsize) of
|
|
|
|
8 -> 0; 4 -> 1 end)])],
|
|
|
|
[AC_MSG_NOTICE(found 64-bit Erlang)
|
|
|
|
CBIT=-m64],
|
|
|
|
[AC_MSG_NOTICE(found 32-bit Erlang)
|
|
|
|
CBIT=-m32])
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Target OS is '$target_os'"
|
|
|
|
CBIT=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
CFLAGS="$CFLAGS $CBIT"
|
|
|
|
LD_SHARED="$LD_SHARED $CBIT"
|
|
|
|
echo "CBIT is set to '$CBIT'"
|
|
|
|
|
2003-10-17 21:15:38 +02:00
|
|
|
AC_OUTPUT
|
2010-01-22 12:27:32 +01:00
|
|
|
|
|
|
|
echo
|
|
|
|
echo "********************** WARNING ! ************************"
|
2010-02-16 12:00:05 +01:00
|
|
|
echo "* ejabberd master is NOT ready for real usage yet, *"
|
2010-01-22 12:27:32 +01:00
|
|
|
echo "* because it is still in heavy development. *"
|
2010-07-22 18:54:36 +02:00
|
|
|
echo "* Don't use ejabberd master, it is still alpha code! *"
|
2010-02-16 12:00:05 +01:00
|
|
|
echo "* Please use ejabberd 2.1.x branch instead. *"
|
2010-01-22 12:27:32 +01:00
|
|
|
echo "*********************************************************"
|
|
|
|
echo
|