2005-11-12 16:27:19 -05:00
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
2007-08-19 01:01:08 -04:00
# Must change all of the below together
# For a release, set revision for that tagged release as well and uncomment
2013-08-28 12:40:06 -04:00
AC_INIT([freeswitch], [1.5.6b], bugs@freeswitch.org)
2007-08-19 01:01:08 -04:00
AC_SUBST(SWITCH_VERSION_MAJOR, [1])
2013-03-29 23:42:51 -04:00
AC_SUBST(SWITCH_VERSION_MINOR, [5])
2013-08-28 12:40:06 -04:00
AC_SUBST(SWITCH_VERSION_MICRO, [6b])
2012-08-18 11:20:42 -04:00
AC_SUBST(SWITCH_VERSION_REVISION, [])
AC_SUBST(SWITCH_VERSION_REVISION_HUMAN, [])
2007-08-19 01:01:08 -04:00
AC_CONFIG_FILES([src/include/switch_version.h.in:src/include/switch_version.h.template])
2006-07-21 21:02:36 -04:00
2006-03-30 09:43:39 -05:00
AC_CONFIG_AUX_DIR(build/config)
2005-11-12 16:27:19 -05:00
AM_INIT_AUTOMAKE(libfreeswitch,0.1)
AC_CONFIG_SRCDIR([src/switch.c])
2007-03-09 15:44:13 -05:00
AC_CONFIG_HEADER([src/include/switch_private.h])
2008-05-23 23:35:44 -04:00
AC_CONFIG_HEADER([libs/xmlrpc-c/xmlrpc_amconfig.h])
2007-03-09 15:44:13 -05:00
2006-01-02 13:31:50 -05:00
AC_PREFIX_DEFAULT(/usr/local/freeswitch)
2007-03-11 00:15:34 -05:00
# AC_PREFIX_DEFAULT does not get expanded until too late so we need to do this to use prefix in this script
if test "x$prefix" = "xNONE" ; then
prefix='/usr/local/freeswitch'
fi
2007-03-10 23:02:10 -05:00
2007-03-20 16:44:09 -04:00
AC_CANONICAL_HOST
2007-03-10 23:02:10 -05:00
# Absolute source/build directory
switch_srcdir=`(cd $srcdir && pwd)`
switch_builddir=`pwd`
AC_SUBST(switch_srcdir)
AC_SUBST(switch_builddir)
2008-02-18 09:58:41 -05:00
# Where to install the modules
2008-05-12 15:12:37 -04:00
AC_ARG_WITH([modinstdir],
2010-01-11 09:36:29 -05:00
[AS_HELP_STRING([--with-modinstdir=DIR], [Install modules into this location (default: $prefix/mod)])], [modulesdir="$withval"], [modulesdir="${prefix}/mod"])
AC_SUBST(modulesdir)
AC_DEFINE_UNQUOTED([SWITCH_MOD_DIR],"${modulesdir}",[where to install the modules to])
2007-03-12 22:26:00 -04:00
2010-08-05 19:21:52 -04:00
if test "$localstatedir" = "\${prefix}/var" ; then
rundir="$prefix/run"
2011-12-15 22:54:19 -05:00
logdir="${prefix}/log"
2010-08-05 19:21:52 -04:00
else
rundir="$localstatedir/run/freeswitch"
2011-12-15 22:54:19 -05:00
logdir="$localstatedir/log/freeswitch"
2010-08-05 19:21:52 -04:00
fi
2009-09-04 14:26:15 -04:00
# Where to put pidfile
AC_ARG_WITH([rundir],
2010-08-05 19:21:52 -04:00
[AS_HELP_STRING([--with-rundir=DIR], [Put pidfile into this location (default: $prefix/run)])], [runtimedir="$withval"], [runtimedir="$rundir"])
2010-01-11 09:36:29 -05:00
AC_SUBST(runtimedir)
AC_DEFINE_UNQUOTED([SWITCH_RUN_DIR],"${runtimedir}",[where to put pidfile to])
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([logfiledir],
[AS_HELP_STRING([--with-logfiledir=DIR], [Put logfiles into this location (default: $localstatedir/log)])], [logfiledir="$withval"], [logfiledir="$logdir"])
2010-01-11 09:36:29 -05:00
AC_SUBST(logfiledir)
AC_DEFINE_UNQUOTED([SWITCH_LOG_DIR],"${logfiledir}",[where to put log files])
2009-09-04 14:26:15 -04:00
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([dbdir],
[AS_HELP_STRING([--with-dbdir=DIR], [Put database files into this location (default: $prefix/db)])], [dbdir="$withval"], [dbdir="$prefix/db"])
2010-01-11 09:36:29 -05:00
AC_SUBST(dbdir)
AC_DEFINE_UNQUOTED([SWITCH_DB_DIR],"${dbdir}",[where to put db files])
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([htdocsdir],
[AS_HELP_STRING([--with-htdocsdir=DIR], [Put html files into this location (default: $prefix/htdocs)])], [htdocsdir="$withval"], [htdocsdir="$prefix/htdocs"])
2010-01-11 10:47:36 -05:00
AC_SUBST(htdocsdir)
AC_DEFINE_UNQUOTED([SWITCH_HTDOCS_DIR],"${htdocsdir}",[where to put htdocs files])
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([soundsdir],
[AS_HELP_STRING([--with-soundsdir=DIR], [Put sound files into this location (default: $prefix/sounds)])], [soundsdir="$withval"], [soundsdir="$prefix/sounds"])
2010-01-11 11:32:35 -05:00
AC_SUBST(soundsdir)
AC_DEFINE_UNQUOTED([SWITCH_SOUNDS_DIR],"${soundsdir}",[where to put sounds files])
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([grammardir],
[AS_HELP_STRING([--with-grammardir=DIR], [Put grammar files into this location (default: $prefix/grammar)])], [grammardir="$withval"], [grammardir="$prefix/grammar"])
2010-01-11 10:47:36 -05:00
AC_SUBST(grammardir)
AC_DEFINE_UNQUOTED([SWITCH_GRAMMAR_DIR],"${grammardir}",[where to put grammar files])
2013-02-01 15:29:40 -05:00
AC_ARG_WITH([certsdir],
[AS_HELP_STRING([--with-certsdir=DIR], [Put certs files into this location (default: $prefix/certs)])], [certsdir="$withval"], [certsdir="$prefix/certs"])
AC_SUBST(certsdir)
AC_DEFINE_UNQUOTED([SWITCH_CERTS_DIR],"${certsdir}",[where to put certs files])
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([scriptdir],
2011-12-17 01:37:19 -05:00
[AS_HELP_STRING([--with-scriptdir=DIR], [Put script files into this location (default: $prefix/scripts)])], [scriptdir="$withval"], [scriptdir="$prefix/scripts"])
2010-01-11 09:36:29 -05:00
AC_SUBST(scriptdir)
AC_DEFINE_UNQUOTED([SWITCH_SCRIPT_DIR],"${scriptdir}",[where to put script files])
2009-09-04 14:26:15 -04:00
2011-12-15 22:54:19 -05:00
AC_ARG_WITH([recordingsdir],
[AS_HELP_STRING([--with-recordingsdir=DIR], [Put recordings files into this location (default: $prefix/recordings)])], [recordingsdir="$withval"], [recordingsdir="$prefix/recordings"])
2010-01-10 22:20:42 -05:00
AC_SUBST(recordingsdir)
AC_DEFINE_UNQUOTED([SWITCH_RECORDINGS_DIR],"${recordingsdir}",[where to put recording files])
2013-05-08 13:30:02 -04:00
AC_ARG_WITH([storagedir],
[AS_HELP_STRING([--with-storagedir=DIR], [Put storage files into this location (default: $prefix/storage)])], [storagedir="$withval"], [storagedir="$prefix/storage"])
AC_SUBST(storagedir)
AC_DEFINE_UNQUOTED([SWITCH_STORAGE_DIR],"${storagedir}",[where to put storage files])
2008-12-08 19:50:32 -05:00
if test "$sysconfdir" = "\${prefix}/etc" ; then
confdir="$prefix/conf"
else
confdir="$sysconfdir"
fi
2010-01-11 09:36:29 -05:00
sysconfdir="$confdir"
2008-12-08 19:50:32 -05:00
AC_SUBST(confdir)
2008-12-09 04:41:37 -05:00
AC_DEFINE_UNQUOTED([SWITCH_CONF_DIR],"${confdir}",[directory for configuration files])
2008-12-08 19:50:32 -05:00
2010-01-11 15:26:14 -05:00
AC_SUBST(libdir)
AC_SUBST(bindir)
AC_SUBST(includedir)
2011-02-19 17:07:22 -05:00
AC_ARG_WITH([pkgconfigdir],
2011-02-19 17:38:04 -05:00
[AS_HELP_STRING([--with-pkgconfigdir=DIR], [Installation directory for pkgconfig file (default: ${libdir}/pkgconfig)])],
2011-02-19 17:07:22 -05:00
[case "${withval}" in
yes|no) AC_MSG_ERROR([Invalid value ${withval} for option --with-pkgconfigdir]) ;;
*) pkgconfigdir="${withval}" ;;
esac
],
[pkgconfigdir="${libdir}/pkgconfig"]
)
AC_SUBST([pkgconfigdir])
2006-12-16 18:22:45 -05:00
#Set default language
AC_LANG_C
2005-11-12 16:27:19 -05:00
# Checks for programs.
AC_PROG_CC
2008-09-12 11:31:29 -04:00
AC_PROG_CXX
2009-02-02 18:04:08 -05:00
#check if the g++ compiler works
AC_CACHE_CHECK([whether the C++ compiler works], [ac_cv_sys_cxx_works], [
AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE([int main() { }], [ac_cv_sys_cxx_works=yes],
[ac_cv_sys_cxx_works=no])
AC_LANG_POP([C++])
])
[ if [ "x$ac_cv_sys_cxx_works" = "xno" ]; then ]
AC_MSG_FAILURE([The C++ compiler does not work. Please (re)install the C++ compiler])
[ fi ]
2006-03-29 21:12:50 -05:00
AC_PROG_AWK
2005-11-12 16:27:19 -05:00
AC_PROG_MAKE_SET
AC_PROG_INSTALL
2007-04-01 16:52:29 -04:00
#override some default libtool behavior and invoke AC_PROG_LIBTOOL (see http://lists.gnu.org/archive/html/libtool/2007-03/msg00000.html)
m4_defun([_LT_AC_LANG_F77_CONFIG], [:])
m4_defun([_LT_AC_LANG_GCJ_CONFIG], [:])
m4_defun([_LT_AC_LANG_RC_CONFIG], [:])
2007-10-24 11:11:46 -04:00
AM_PROG_CC_C_O
2006-03-29 21:12:50 -05:00
AC_PROG_LIBTOOL
2005-11-12 16:27:19 -05:00
2006-12-16 18:22:45 -05:00
#Check for compiler vendor
AX_COMPILER_VENDOR
# Optimize
AC_ARG_ENABLE(optimization,
[AC_HELP_STRING([--enable-optimization],[Set if you want us to add max optimising compiler flags])],[enable_optimizer="$enableval"],[enable_optimizer="no"])
if test "${enable_optimizer}" = "yes" ; then
AC_DEFINE([OPTIMZER],[],[Enable Optimization.])
AX_CC_MAXOPT
fi
2011-03-25 13:17:13 -04:00
AX_PATH_LIBGNUTLS()
2007-03-10 23:02:10 -05:00
# set defaults for use on all platforms
2013-01-14 09:34:07 -05:00
SWITCH_AM_CFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
SWITCH_AM_CXXFLAGS="-I${switch_srcdir}/src/include -I${switch_builddir}/src/include -I${switch_srcdir}/libs/libteletone/src -I${switch_srcdir}/libs/stfu"
2009-02-06 13:23:14 -05:00
SWITCH_AM_LDFLAGS="-lm"
2007-03-10 23:02:10 -05:00
#set SOLINK variable based on compiler and host
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
SOLINK="-Bdynamic -dy -G"
2013-10-15 12:16:36 -04:00
elif test "x${ax_cv_c_compiler_vendor}" = "xclang" ; then
2007-03-10 23:02:10 -05:00
case "$host" in
2013-10-15 12:16:36 -04:00
*darwin*)
2009-12-09 16:35:01 -05:00
SOLINK="-dynamic -force-flat-namespace"
;;
2013-10-15 12:16:36 -04:00
*)
AC_ERROR([Please update configure.in with SOLINK values for your compiler])
;;
esac
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
case "$host" in
# older Xcode test for darwin, Xcode 4/5 use clang above
2007-03-12 13:46:24 -04:00
*darwin*)
2007-03-10 23:02:10 -05:00
SOLINK="-dynamic -bundle -force-flat-namespace"
;;
2008-06-25 22:27:32 -04:00
*-solaris2*)
SOLINK="-shared -Xlinker"
;;
2007-03-10 23:02:10 -05:00
*)
SOLINK="-shared -Xlinker -x"
;;
esac
else
AC_ERROR([Please update configure.in with SOLINK values for your compiler])
fi
# set DYNAMIC_LIB_EXTEN
# we should really be using libtool so we don't need to do this
2006-12-16 18:22:45 -05:00
case "$host" in
2007-03-10 23:02:10 -05:00
*cygwin* | *mingw*)
DYNAMIC_LIB_EXTEN="dll"
;;
*)
DYNAMIC_LIB_EXTEN="so"
;;
2006-12-16 18:22:45 -05:00
esac
2007-03-10 23:02:10 -05:00
2009-04-06 17:59:48 -04:00
##
# detect libtool major version,
# set libtool library extension based on this
# to work around some brokeness when using 'la' with libtool-1.5
#
AC_MSG_CHECKING([libtool major version])
libtool="${switch_builddir}/libtool"
2009-06-23 18:32:06 -04:00
LIBTOOL_MAJOR_VERSION="`$libtool --version 2>/dev/null| sed -e 's/([[^)]]*)//g;s/^[[^0-9]]*//;s/[[- ]].*//g;q'| awk 'BEGIN { FS = "." } { print $1 }' `"
2009-04-06 19:29:41 -04:00
if test -z "$LIBTOOL_MAJOR_VERSION" ; then
2009-08-10 16:57:40 -04:00
LIBTOOL_MAJOR_VERSION="`sed -n -e '/^VERSION/{s/^.*=\"\{0,1\}\([[0-9]]\{1,\}\)\..*/\1/;p;}' ${switch_srcdir}/build/config/ltmain.sh`"
2009-04-06 19:29:41 -04:00
fi
if test -z "$LIBTOOL_MAJOR_VERSION" ; then
AC_MSG_ERROR([Failed to detect your libtool version, please open a bug report on http://jira.freeswitch.org/])
fi
2009-04-06 17:59:48 -04:00
AC_MSG_RESULT([${LIBTOOL_MAJOR_VERSION}])
2009-04-06 15:54:30 -04:00
LIBTOOL_LIB_EXTEN="$DYNAMIC_LIB_EXTEN"
2009-04-06 17:59:48 -04:00
if test "${LIBTOOL_MAJOR_VERSION}" = "2" ; then
2009-04-06 15:54:30 -04:00
LIBTOOL_LIB_EXTEN="la"
fi
2009-04-06 17:59:48 -04:00
AC_MSG_RESULT([using libtool library extension... ${LIBTOOL_LIB_EXTEN}])
2009-04-06 15:54:30 -04:00
2007-11-13 15:03:56 -05:00
# Enable 64 bit build
2007-07-16 11:08:38 -04:00
AC_ARG_ENABLE(64,
2007-11-13 15:03:56 -05:00
[AC_HELP_STRING([--enable-64],[build with 64 bit support])],[enable_64="$enable_64"],[enable_64="no"])
2007-07-16 11:08:38 -04:00
2007-03-10 23:02:10 -05:00
# tweak compiler specific flags
if test "x${ax_cv_c_compiler_vendor}" = "xsun" ; then
APR_ADDTO(SWITCH_AM_CFLAGS, -KPIC)
APR_ADDTO(SWITCH_AM_CFLAGS, -DPIC)
2009-03-05 11:14:35 -05:00
APR_ADDTO(SWITCH_AM_CFLAGS, -erroff=E_END_OF_LOOP_CODE_NOT_REACHED)
APR_ADDTO(SWITCH_AM_CFLAGS, -errtags=yes)
2010-12-17 19:15:55 -05:00
APR_ADDTO(SWITCH_AM_CFLAGS, -D__FUNCTION__=__func__ )
APR_ADDTO(SWITCH_AM_CFLAGS, -mt)
2009-03-05 11:14:35 -05:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, -errtags=yes)
2007-03-12 00:21:54 -04:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, -KPIC)
APR_ADDTO(SWITCH_AM_CXXFLAGS, -DPIC)
2007-06-08 10:52:50 -04:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, "-features=extensions")
2010-12-17 19:15:55 -05:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, -D__FUNCTION__=__func__)
APR_ADDTO(SWITCH_AM_CXXFLAGS, -mt)
2007-06-08 10:52:50 -04:00
2007-03-10 23:02:10 -05:00
APR_ADDTO(SWITCH_AM_LDFLAGS, -R${prefix}/lib)
2007-07-16 11:08:38 -04:00
if test "${enable_64}" = "yes"; then
APR_ADDTO(SWITCH_AM_CFLAGS, -m64)
2007-11-15 16:28:26 -05:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, -m64)
APR_ADDTO(SWITCH_AM_LDFLAGS, -m64)
2009-02-06 13:23:14 -05:00
LIBS="$LIBS -m64"
2007-07-16 11:08:38 -04:00
fi
2007-03-10 23:02:10 -05:00
elif test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
2007-03-12 00:21:54 -04:00
APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
2007-03-18 13:38:48 -04:00
APR_ADDTO(SWITCH_AM_CFLAGS, -Werror)
2009-02-06 13:23:14 -05:00
if test "${enable_64}" = "yes"; then
2009-12-09 16:35:01 -05:00
case "$host" in
2012-11-05 13:53:59 -05:00
*darwin12.*|*darwin11.*|*darwin10.*|*darwin9.*|*darwin8.*)
2009-12-09 16:35:01 -05:00
APR_ADDTO(CFLAGS, -arch x86_64)
APR_ADDTO(LDFLAGS, -arch x86_64)
APR_ADDTO(CXXFLAGS, -arch x86_64)
;;
2009-12-10 14:58:16 -05:00
*)
LIBS="$LIBS -m64"
;;
2009-12-09 16:35:01 -05:00
esac
2009-02-06 13:23:14 -05:00
fi
2007-03-10 23:02:10 -05:00
fi
2009-02-16 13:17:01 -05:00
#
# gcc visibility cflag checks
#
AC_ARG_ENABLE([visibility],
[AS_HELP_STRING([--disable-visibility], [Disable or enable API visibility support (default: use if available)])],
[enable_visibility="${enableval}"],
[enable_visibility="detect"]
)
HAVE_VISIBILITY="no"
if test "x${enable_visibility}" != "xno" ; then
case "${ax_cv_c_compiler_vendor}" in
gnu)
save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -fvisibility=hidden"
AC_MSG_CHECKING([whether the compiler supports -fvisibility=hidden])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
[int foo __attribute__ ((visibility("default")));],
[;]
)],
[AC_MSG_RESULT([yes])
APR_ADDTO([SWITCH_AM_CFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
APR_ADDTO([SWITCH_AM_CXXFLAGS], [-fvisibility=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
HAVE_VISIBILITY="yes"],
[AC_MSG_RESULT([no])]
)
CFLAGS="${save_CFLAGS}"
;;
2009-02-17 14:25:42 -05:00
sun)
2009-04-25 14:10:27 -04:00
# save_CFLAGS="${CFLAGS}"
# CFLAGS="${CFLAGS} -xldscope=hidden"
# AC_MSG_CHECKING([whether the compiler supports -xldscope=hidden])
# AC_COMPILE_IFELSE(
# [AC_LANG_PROGRAM(
# [int foo __attribute__ ((visibility("default")));],
# [;]
# )],
#
# [AC_MSG_RESULT([yes])
# APR_ADDTO([SWITCH_AM_CFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
# APR_ADDTO([SWITCH_AM_CXXFLAGS], [-xldscope=hidden -DSWITCH_API_VISIBILITY=1 -DHAVE_VISIBILITY=1])
# HAVE_VISIBILITY="yes"],
#
# [AC_MSG_RESULT([no])]
# )
# CFLAGS="${save_CFLAGS}"
2009-02-17 14:25:42 -05:00
;;
2009-02-16 13:17:01 -05:00
*)
if test "x${enable_visibility}" = "xyes" ; then
2009-02-17 14:25:42 -05:00
AC_MSG_ERROR([Non-GNU / SUN compilers are currently unsupported])
2009-02-16 13:17:01 -05:00
else
2009-02-17 14:25:42 -05:00
AC_MSG_WARN([Non-GNU / SUN compilers are currently unsupported])
2009-02-16 13:17:01 -05:00
fi
;;
esac
#
# visibility explicitly requested but not supported by this compiler => error
#
if test "x${enable_visibility}" = "xyes" -a "x${HAVE_VISIBILITY}" = "xno" ; then
AC_MSG_ERROR([API visibility not supported by this compiler])
fi
fi
2008-05-09 20:39:12 -04:00
# Enable debugging (default: on)
# (rename option if the default is changed)
2007-12-19 16:13:09 -05:00
AC_ARG_ENABLE(debug,
2008-05-09 20:39:12 -04:00
[AC_HELP_STRING([--disable-debug],[build without debug information])],[enable_debug="$enableval"],[enable_debug="yes"])
2007-12-19 16:13:09 -05:00
if test "${enable_debug}" = "yes"; then
AC_DEFINE([DEBUG],[],[Enable extra debugging.])
2009-12-02 15:28:49 -05:00
saved_CFLAGS="$CFLAGS"
2009-12-01 15:15:55 -05:00
CFLAGS=
2007-12-19 16:13:09 -05:00
AX_CFLAGS_WARN_ALL_ANSI
2009-12-01 17:19:07 -05:00
SWITCH_ANSI_CFLAGS=$CFLAGS
2009-12-02 15:28:49 -05:00
CFLAGS="$saved_CFLAGS"
2007-12-19 16:13:09 -05:00
if test "x${ax_cv_c_compiler_vendor}" = "xgnu" ; then
APR_ADDTO(SWITCH_AM_CFLAGS, -g -ggdb)
2008-01-12 17:17:41 -05:00
export DEBUG_CFLAGS="-g -ggdb"
2007-12-19 16:13:09 -05:00
fi
fi
2009-11-30 07:31:24 -05:00
AC_ARG_ENABLE(cpp,
[AC_HELP_STRING([--disable-cpp],[build without cpp code])],[enable_cpp="$enableval"],[enable_cpp="yes"])
AM_CONDITIONAL([ENABLE_CPP],[test "${enable_cpp}" = "yes"])
2011-05-02 12:34:13 -04:00
AC_ARG_ENABLE(srtp,
[AC_HELP_STRING([--disable-srtp],[build without srtp support])],[enable_srtp="$enableval"],[enable_srtp="yes"])
AM_CONDITIONAL([ENABLE_SRTP],[test "${enable_srtp}" = "yes"])
2009-05-20 19:04:05 -04:00
AC_ARG_ENABLE(zrtp,
[AS_HELP_STRING([--enable-zrtp], [Compile with zrtp Support])],,[enable_zrtp="no"])
if test "x$enable_zrtp" = "xyes" ; then
2012-04-05 00:10:55 -04:00
LIBS="-lpthread $LIBS"
2009-05-20 19:04:05 -04:00
APR_ADDTO(SWITCH_AM_CFLAGS, -DENABLE_ZRTP)
fi
2009-12-10 22:20:06 -05:00
2009-12-11 13:12:55 -05:00
PA_LIBS=
PKG_CHECK_MODULES(JACK, jack, have_jack=yes, have_jack=no)
if test "x$have_jack" = "xyes" ; then
PA_LIBS+=$JACK_LIBS
fi
2009-12-10 22:20:06 -05:00
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
2009-12-10 23:05:27 -05:00
if test "x$have_alsa" = "xyes" ; then
2009-12-11 13:12:55 -05:00
PA_LIBS+=-lasound
2009-12-10 22:20:06 -05:00
fi
2009-12-11 13:12:55 -05:00
AC_SUBST(PA_LIBS)
2009-12-10 22:20:06 -05:00
2009-05-20 19:04:05 -04:00
AM_CONDITIONAL([ENABLE_ZRTP],[test "x$enable_zrtp" != "xno"])
2008-05-09 20:35:34 -04:00
AM_CONDITIONAL([WANT_DEBUG],[test "${enable_debug}" = "yes"])
2009-02-03 21:03:26 -05:00
AC_ARG_ENABLE(core-odbc-support,
[AS_HELP_STRING([--enable-core-odbc-support], [Compile with ODBC Support])],,[enable_core_odbc_support="no"])
AX_LIB_ODBC
if test "$ac_cv_found_odbc" = "yes" ; then
enable_core_odbc_support="yes"
fi
2012-04-23 13:00:30 -04:00
if test "x$enable_core_odbc_support" != "xno"; then
AC_CHECK_LIB([odbc], [SQLDisconnect],, AC_MSG_ERROR([no usable libodbc; please install unixodbc devel package or equivalent]))
fi
2013-07-04 23:02:47 -04:00
CHECK_LIBUUID
SWITCH_AM_LDFLAGS="$LIBUUID_LIBS $SWITCH_AM_LDFLAGS"
SWITCH_AM_CFLAGS="$LIBUUID_CFLAGS $SWITCH_AM_CFLAGS"
2012-09-29 21:48:48 -04:00
AC_ARG_ENABLE(core-pgsql-support,
[AS_HELP_STRING([--enable-core-pgsql-support], [Compile with PGSQL Support])],,[enable_core_pgsql_support="no"])
if test x"$enable_core_pgsql_support" = x"yes" ; then
AC_PATH_PROG([PG_CONFIG], [pg_config], [no])
if test "$PG_CONFIG" != "no"; then
AC_MSG_CHECKING([for PostgreSQL libraries])
POSTGRESQL_CXXFLAGS="`$PG_CONFIG --cppflags` -I`$PG_CONFIG --includedir`"
2013-07-04 23:02:47 -04:00
POSTGRESQL_LDFLAGS="`$PG_CONFIG --ldflags|sed 's/ -Wl,--as-needed//g'` -L`$PG_CONFIG --libdir` -lpq"
2012-09-29 21:48:48 -04:00
POSTGRESQL_VERSION=`$PG_CONFIG --version | sed -e 's#PostgreSQL ##'`
2013-09-27 15:09:58 -04:00
POSTGRESQL_MAJOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL ([0-9]+).[0-9]+.?[0-9]+?#\1#'`
2013-09-27 15:32:40 -04:00
POSTGRESQL_MINOR_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.([0-9]+).?[0-9]+?#\1#'`
2013-09-27 15:09:58 -04:00
POSTGRESQL_PATCH_VERSION=`$PG_CONFIG --version | sed -e 's/devel//' | sed -re 's#PostgreSQL [0-9]+.[0-9]+.?([0-9]+)?#\1#'`
2012-09-29 21:48:48 -04:00
AC_DEFINE([SWITCH_HAVE_PGSQL], [1], [Define to 1 if PostgreSQL libraries are available])
2012-10-09 14:42:23 -04:00
AC_DEFINE_UNQUOTED([POSTGRESQL_VERSION], "${POSTGRESQL_VERSION}", [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MAJOR_VERSION], ${POSTGRESQL_MAJOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_MINOR_VERSION], ${POSTGRESQL_MINOR_VERSION}, [Specifies the version of PostgreSQL we are linking against])
AC_DEFINE_UNQUOTED([POSTGRESQL_PATCH_VERSION], ${POSTGRESQL_PATCH_VERSION}, [Specifies the version of PostgreSQL we are linking against])
2012-09-29 21:48:48 -04:00
AC_CHECK_LIB([pq], [PQgetvalue],, AC_MSG_ERROR([no usable libpq; please install PostgreSQL devel package or equivalent]))
AC_MSG_RESULT([yes])
SWITCH_AM_CXXFLAGS="$POSTGRESQL_CXXFLAGS $SWITCH_AM_CXXFLAGS"
SWITCH_AM_LDFLAGS="$POSTGRESQL_LDFLAGS $SWITCH_AM_LDFLAGS"
else
AC_MSG_RESULT([no])
AC_MSG_FAILURE([Unabled to find pg_config in PATH. Is PostgreSQL installed?])
fi
2009-02-03 21:03:26 -05:00
2012-09-29 21:48:48 -04:00
fi
2011-06-30 19:30:24 -04:00
2012-10-31 11:22:01 -04:00
AC_ARG_ENABLE(deprecated-core-db-events,
[AS_HELP_STRING([--enable-deprecated-core-db-events], [Keep deprecated core db events])],,[enable_deprecated_core_db_events="no"])
if test x"$enable_deprecated_core_db_events" = x"yes" ; then
AC_DEFINE([SWITCH_DEPRECATED_CORE_DB], [1], [Define to 1 to enable deprecated core db events])
fi
2011-06-30 19:30:24 -04:00
AC_ARG_ENABLE(timerfd-wrapper,
[AC_HELP_STRING([--enable-timerfd-wrapper],[timerfd is in the kernel but not in your libc])],[enable_timer_fd_wrapper="$enableval"],[enable_timer_fd_wrapper="no"])
2011-06-30 17:24:30 -04:00
AM_CONDITIONAL([ENABLE_TIMERFD_WRAPPER],[test "x$enable_timer_fd_wrapper" != "xno"])
2012-04-09 22:41:19 -04:00
AC_CHECK_LIB(z, inflateReset, have_libz=yes, AC_MSG_ERROR([no usable zlib; please install zlib devel package or equivalent]))
2010-04-26 03:21:41 -04:00
if test "x$have_libz" = "xyes" ; then
APR_ADDTO(SWITCH_AM_LDFLAGS, -lz)
fi
2012-04-09 22:41:19 -04:00
AC_CHECK_LIB(jpeg, jpeg_std_error,, AC_MSG_ERROR([no usable libjpeg; please install libjpeg devel package or equivalent]))
2013-05-06 19:23:54 -04:00
AC_CHECK_LIB(jbig, jbg_enc_out, have_libjbig=yes, have_libjbig=no)
if test "x$have_libjbig" = "xyes" ; then
SPANDSP_LA_JBIG="-ljbig"
AC_SUBST(SPANDSP_LA_JBIG)
fi
2013-09-07 15:21:33 -04:00
AC_CHECK_LIB(lzma, lzma_code, have_liblzma=yes, have_liblzma=no)
if test "x$have_liblzma" = "xyes" ; then
SPANDSP_LA_LZMA="-llzma"
AC_SUBST(SPANDSP_LA_LZMA)
fi
2010-11-24 17:22:16 -05:00
AC_CHECK_LIB(resolv, res_init, have_libresolv=yes, have_libresolv=no)
if test "x$have_libresolv" = "xyes" ; then
APR_ADDTO(SWITCH_AM_LDFLAGS, -lresolv)
fi
2009-01-20 11:29:32 -05:00
ESL_LDFLAGS=
2011-11-04 16:04:29 -04:00
PLATFORM_CORE_LDFLAGS=
PLATFORM_CORE_LIBS=
2007-03-10 23:02:10 -05:00
# tweak platform specific flags
case "$host" in
2012-11-05 13:53:59 -05:00
*darwin12.*|*darwin11.*)
2012-10-29 13:20:10 -04:00
APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp -Wno-deprecated-declarations)
APR_ADDTO(LDFLAGS, -pipe -bind_at_load)
APR_ADDTO(CXXFLAGS, -pipe)
APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
if test "x$enable_core_odbc_support" != "xno"; then
APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
fi
APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
;;
2009-12-09 16:35:01 -05:00
*darwin10.*)
APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
APR_ADDTO(CFLAGS, -pipe -no-cpp-precomp)
APR_ADDTO(LDFLAGS, -pipe -bind_at_load)
APR_ADDTO(CXXFLAGS, -pipe)
APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
if test "x$enable_core_odbc_support" != "xno"; then
2011-11-04 16:04:29 -04:00
APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
2009-12-09 16:35:01 -05:00
fi
2011-11-17 02:23:21 -05:00
APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
2009-12-09 16:35:01 -05:00
;;
2007-03-12 13:46:24 -04:00
*darwin*)
2007-03-10 23:02:10 -05:00
APR_ADDTO(SWITCH_AM_CFLAGS, -DMACOSX)
APR_REMOVEFROM(SWITCH_AM_CFLAGS, -fPIC)
2009-01-20 16:55:27 -05:00
if test "x$enable_core_odbc_support" != "xno"; then
2011-11-04 16:04:29 -04:00
APR_ADDTO([PLATFORM_CORE_LDFLAGS], [--framework CoreFoundation])
2009-01-20 16:55:27 -05:00
fi
2011-11-17 02:23:21 -05:00
APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl])
2007-03-10 23:02:10 -05:00
;;
*-solaris2*)
2011-09-14 08:59:02 -04:00
APR_ADDTO(SWITCH_AM_CFLAGS, -DPATH_MAX=2048 -D__EXTENSIONS__)
2010-01-30 18:27:40 -05:00
APR_ADDTO(SWITCH_AM_LDFLAGS, -lsendfile -lresolv -lsocket -lnsl -luuid)
2009-02-19 00:32:49 -05:00
APR_ADDTO(ESL_LDFLAGS, -lnsl -lsocket)
2011-11-04 16:04:29 -04:00
APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt -lsendfile -lresolv -lsocket -lnsl -luuid])
2007-03-10 23:02:10 -05:00
;;
2007-05-28 13:20:57 -04:00
*bsd*)
APR_ADDTO(SWITCH_AM_CFLAGS, -I/usr/local/include)
2011-11-07 12:26:05 -05:00
APR_ADDTO([PLATFORM_CORE_LIBS], [-lcrypt -lrt])
2011-11-04 16:04:29 -04:00
;;
*linux*)
APR_ADDTO([PLATFORM_CORE_LIBS], [-ldl -lcrypt -lrt])
2007-05-28 13:20:57 -04:00
;;
2007-03-10 23:02:10 -05:00
esac
2007-03-12 00:21:54 -04:00
APR_REMOVEFROM(SWITCH_AM_CXXFLAGS, -std=c99)
2007-03-10 23:02:10 -05:00
AC_SUBST(SWITCH_AM_CFLAGS)
2009-12-01 17:19:07 -05:00
AC_SUBST(SWITCH_ANSI_CFLAGS)
2007-03-12 00:21:54 -04:00
AC_SUBST(SWITCH_AM_CXXFLAGS)
2007-03-10 23:02:10 -05:00
AC_SUBST(SWITCH_AM_LDFLAGS)
2009-01-20 11:29:32 -05:00
AC_SUBST(ESL_LDFLAGS)
2011-11-04 16:04:29 -04:00
AC_SUBST(PLATFORM_CORE_LDFLAGS)
AC_SUBST(PLATFORM_CORE_LIBS)
2006-12-16 18:22:45 -05:00
AC_SUBST(SOLINK)
AC_SUBST(DYNAMIC_LIB_EXTEN)
2009-04-06 15:54:30 -04:00
AC_SUBST(LIBTOOL_LIB_EXTEN)
2006-12-16 18:22:45 -05:00
2005-11-12 16:27:19 -05:00
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
2012-10-13 12:37:25 -04:00
AC_CHECK_HEADERS([sys/types.h sys/resource.h sched.h wchar.h sys/filio.h sys/ioctl.h sys/select.h netdb.h execinfo.h])
2008-05-23 22:15:05 -04:00
if test x"$ac_cv_header_wchar_h" = xyes; then
HAVE_WCHAR_H_DEFINE=1
else
HAVE_WCHAR_H_DEFINE=0
fi
AC_SUBST(HAVE_WCHAR_H_DEFINE)
2005-11-12 16:27:19 -05:00
2012-10-13 12:37:25 -04:00
# Needed by Abyss on Solaris:
if test x"$ac_cv_header_sys_filio_h" = xyes; then
HAVE_SYS_FILIO_H_DEFINE=1
else
HAVE_SYS_FILIO_H_DEFINE=0
fi
AC_SUBST(HAVE_SYS_FILIO_H_DEFINE)
# Needed by Abyss on Solaris:
if test x"$ac_cv_header_sys_ioctl_h" = xyes; then
HAVE_SYS_IOCTL_H_DEFINE=1
else
HAVE_SYS_IOCTL_H_DEFINE=0
fi
AC_SUBST(HAVE_SYS_IOCTL_H_DEFINE)
if test x"$ac_cv_header_sys_select_h" = xyes; then
HAVE_SYS_SELECT_H_DEFINE=1
else
HAVE_SYS_SELECT_H_DEFINE=0
fi
AC_SUBST(HAVE_SYS_SELECT_H_DEFINE)
2005-11-12 16:27:19 -05:00
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
AC_STRUCT_TM
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_TYPE_SIGNAL
AC_FUNC_STRFTIME
2011-12-06 18:51:27 -05:00
AC_CHECK_FUNCS([gethostname vasprintf mmap mlock mlockall usleep getifaddrs timerfd_create getdtablesize posix_openpt])
2010-01-12 13:31:13 -05:00
AC_CHECK_FUNCS([sched_setscheduler setpriority setrlimit setgroups initgroups])
2008-05-23 23:35:44 -04:00
AC_CHECK_FUNCS([wcsncmp setgroups asprintf setenv pselect gettimeofday localtime_r gmtime_r strcasecmp stricmp _stricmp])
2007-10-23 11:56:23 -04:00
2012-08-14 08:11:44 -04:00
# Check availability and return type of strerror_r
# (NOTE: apr-1-config sets -D_GNU_SOURCE at build-time, need to run the check with it too)
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_FUNC_STRERROR_R
CPPFLAGS="$save_CPPFLAGS"
2010-01-12 13:31:13 -05:00
AX_HAVE_CPU_SET
2007-11-13 13:47:08 -05:00
AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
2010-01-13 16:07:39 -05:00
AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
2007-11-13 13:47:08 -05:00
AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
2012-11-07 15:53:10 -05:00
AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
2012-10-23 13:14:51 -04:00
2008-05-23 23:35:44 -04:00
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
2007-11-13 13:47:08 -05:00
2011-12-06 18:51:27 -05:00
AC_CHECK_FILE(/dev/ptmx, [AC_DEFINE(HAVE_DEV_PTMX, 1, [Define if you have /dev/ptmx])])
AC_CHECK_LIB(util, openpty, [AC_DEFINE(HAVE_OPENPTY, 1, [Define if you have openpty()])])
2009-05-20 10:21:54 -04:00
AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[
2009-05-15 14:19:30 -04:00
#include <sys/types.h>
#include <time.h>])
2009-05-20 10:21:54 -04:00
AC_CHECK_MEMBERS([struct tm.tm_zone],,,[
2009-05-15 14:19:30 -04:00
#include <sys/types.h>
#include <time.h>])
2007-10-23 11:56:23 -04:00
AC_CHECK_DECL([RLIMIT_MEMLOCK],
[AC_DEFINE([HAVE_RLIMIT_MEMLOCK],[1],[RLIMIT_MEMLOCK constant for setrlimit])],,
[#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif])
AC_CHECK_DECL([SCHED_RR],
[AC_DEFINE([HAVE_SCHED_RR],[1],[SCHED_RR constant for sched_setscheduler])],,
[#ifdef HAVE_SCHED_H
#include <sched.h>
#endif])
2012-09-25 17:12:51 -04:00
AC_CHECK_DECL([SCHED_FIFO],
[AC_DEFINE([HAVE_SCHED_FIFO],[1],[SCHED_FIFO constant for sched_setscheduler])],,
[#ifdef HAVE_SCHED_H
#include <sched.h>
#endif])
2007-10-23 11:56:23 -04:00
#
# use mlockall only on linux (for now; if available)
#
if test "x${ac_cv_func_mlockall}" = "xyes"; then
AC_MSG_CHECKING([whether to use mlockall])
case "$host" in
*-linux-*)
AC_DEFINE([USE_MLOCKALL],[1],[Enable mlockall support])
AC_MSG_RESULT([yes])
USE_MLOCKALL=yes
;;
*-freebsd*)
2011-12-21 20:43:01 -05:00
APR_ADDTO(SWITCH_AM_CFLAGS, -fPIC)
APR_ADDTO(SWITCH_AM_CXXFLAGS, -fPIC)
2007-10-23 11:56:23 -04:00
AC_MSG_RESULT([no, broken for non-root users])
;;
*)
AC_MSG_RESULT([no])
;;
esac
#
# setrlimit prerequisites
#
if test "x${USE_MLOCKALL}" = "xyes" -a \
"x${ac_cv_func_setrlimit}" = "xyes" -a \
"x${ac_cv_have_decl_RLIMIT_MEMLOCK}" = "xyes"
then
AC_DEFINE([USE_SETRLIMIT],[1],[Use setrlimit to disable mlock limit for non-root users])
fi
fi
#
# sched_setcheduler + round-robin scheduler prerequisites
#
if test "x${ac_cv_func_sched_setscheduler}" = "xyes" -a \
"x${ac_cv_have_decl_SCHED_RR}" = "xyes"
then
AC_DEFINE([USE_SCHED_SETSCHEDULER],[1],[Enable round-robin scheduler using sched_setscheduler])
fi
2008-05-23 23:35:44 -04:00
#
# xmlrpc-c checks
#
2012-10-13 12:37:25 -04:00
AC_CHECK_FUNCS(setenv strtoll strtoull strtoq strtouq __strtoll __strtoull)
2008-05-23 23:35:44 -04:00
HAVE_LIBWWW_SSL_DEFINE=0
AC_SUBST(HAVE_LIBWWW_SSL_DEFINE)
DIRECTORY_SEPARATOR="/"
AC_SUBST(DIRECTORY_SEPARATOR)
va_list_is_array=no
AC_MSG_CHECKING(whether va_list is an array)
AC_TRY_COMPILE([
#include <stdarg.h>
], [va_list list1, list2; list1 = list2;], ,
va_list_is_array=yes)
AC_MSG_RESULT($va_list_is_array)
if test x"$va_list_is_array" = xyes; then
VA_LIST_IS_ARRAY_DEFINE=1
else
VA_LIST_IS_ARRAY_DEFINE=0
fi
AC_SUBST(VA_LIST_IS_ARRAY_DEFINE)
2009-12-02 15:28:49 -05:00
2008-05-23 23:35:44 -04:00
AC_MSG_CHECKING(whether compiler has __attribute__)
AC_TRY_COMPILE(, [int x __attribute__((__unused__));],
compiler_has_attribute=yes,
compiler_has_attribute=no)
AC_MSG_RESULT($compiler_has_attribute)
if test x"$compiler_has_attribute" = xyes; then
ATTR_UNUSED="__attribute__((__unused__))"
else
ATTR_UNUSED=
fi
AC_SUBST(ATTR_UNUSED)
2009-12-02 15:28:49 -05:00
saved_CFLAGS="$CFLAGS"
AC_CACHE_CHECK([whether compiler supports -Wdeclaration-after-statement], [ac_cv_gcc_declaration_after_statement], [
CFLAGS="$CFLAGS -Wdeclaration-after-statement"
AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_declaration_after_statement=yes],[ac_cv_gcc_declaration_after_statement=no])
])
AC_MSG_RESULT($ac_cv_gcc_declaration_after_statement)
if test x"$ac_cv_gcc_declaration_after_statement" = xyes; then
APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wdeclaration-after-statement)
fi
CFLAGS="$saved_CFLAGS"
2005-11-12 16:27:19 -05:00
2013-10-15 12:16:36 -04:00
# Next check added for Xcode 5 and systems with clang 5 llvm 3.3 or above, extended offset must be off
AC_CACHE_CHECK([whether compiler supports -Wextended-offsetof], [ac_cv_clang_extended_offsetof], [
AC_TRY_COMPILE([],[return 0;],[ac_cv_clang_extended_offsetof=yes],[ac_cv_clang_extended_offsetof=no])
])
AC_MSG_RESULT($ac_cv_clang_extended_offsetof)
if test x"$ac_cv_clang_extended_offsetof" = xyes; then
APR_ADDTO(CFLAGS, -Wno-extended-offsetof)
fi
2011-04-22 23:09:40 -04:00
# Tested and fixed lot of modules, but some are untested. Will be added back when the core team decide it ready
# Untested modules : mod_osp mod_soundtouch mod_sangoma_codec mod_dingaling mod_opal mod_skypopen mod_h323 mod_khomp
# mod_unimrcp mod_cepstral mod_erlang_event mod_snmp mod_perl mod_java mod_managed
#
#saved_CFLAGS="$CFLAGS"
#AC_CACHE_CHECK([whether compiler supports -Wunused-but-set-variable], [ac_cv_gcc_unused_but_set_variable], [
#CFLAGS="$CFLAGS -Wunused-but-set-variable"
#AC_TRY_COMPILE([],[return 0;],[ac_cv_gcc_unused_but_set_variable=yes],[ac_cv_gcc_unused_but_set_variable=no])
#])
#AC_MSG_RESULT($ac_cv_gcc_unused_but_set_variable)
#if test x"$ac_cv_gcc_unused_but_set_variable" = xyes; then
# APR_ADDTO(SWITCH_ANSI_CFLAGS, -Wunused-but-set-variable)
#fi
#CFLAGS="$saved_CFLAGS"
2011-04-22 21:45:42 -04:00
2006-12-16 20:01:09 -05:00
AC_C_BIGENDIAN(AC_DEFINE([SWITCH_BYTE_ORDER],__BIG_ENDIAN,[Big Endian]),AC_DEFINE([SWITCH_BYTE_ORDER],__LITTLE_ENDIAN,[Little Endian]))
2006-01-05 18:13:00 -05:00
2007-03-09 15:44:13 -05:00
# Checks for integer size
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(long long, 8)
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
# Checks for pointer size
AC_CHECK_SIZEOF(void*, 4)
if test "x$ac_cv_sizeof_voidp" != "x"; then
voidp_size=$ac_cv_sizeof_voidp
else
AC_ERROR([Cannot determine size of void*])
fi
if test "$ac_cv_sizeof_short" = "2"; then
short_value=short
fi
if test "$ac_cv_sizeof_int" = "4"; then
int_value=int
fi
if test "$ac_cv_sizeof_int" = "8"; then
int64_t_fmt='#define SWITCH_INT64_T_FMT "d"'
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "u"'
int64_value="int"
long_value=int
elif test "$ac_cv_sizeof_long" = "8"; then
int64_t_fmt='#define SWITCH_INT64_T_FMT "ld"'
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "lu"'
int64_value="long"
long_value=long
2009-06-30 17:54:56 -04:00
case "$host" in
2010-03-22 19:05:20 -04:00
*-solaris2*|*apple-darwin*|*-openbsd*)
2009-06-30 17:54:56 -04:00
if test "$ac_cv_sizeof_long_long" = "8"; then
int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
int64_value="long long"
long_value="long long"
fi
;;
esac
2007-03-09 15:44:13 -05:00
elif test "$ac_cv_sizeof_long_long" = "8"; then
int64_t_fmt='#define SWITCH_INT64_T_FMT "lld"'
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "llu"'
int64_value="long long"
long_value="long long"
elif test "$ac_cv_sizeof_longlong" = "8"; then
int64_t_fmt='#define SWITCH_INT64_T_FMT "qd"'
uint64_t_fmt='#define SWITCH_UINT64_T_FMT "qu"'
int64_value="__int64"
long_value="__int64"
else
AC_ERROR([could not detect a 64-bit integer type])
fi
if test "$ac_cv_type_size_t" = "yes"; then
size_t_value="size_t"
else
size_t_value="switch_int32_t"
fi
if test "$ac_cv_type_ssize_t" = "yes"; then
ssize_t_value="ssize_t"
else
ssize_t_value="switch_int32_t"
fi
APR_CHECK_SIZEOF_EXTENDED([#include <sys/types.h>], ssize_t, 8)
if test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_int"; then
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
elif test "$ac_cv_sizeof_ssize_t" = "$ac_cv_sizeof_long"; then
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
else
ssize_t_fmt='#error Can not determine the proper size for ssize_t'
fi
APR_CHECK_SIZEOF_EXTENDED([#include <stddef.h>], size_t, 8)
if test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_int"; then
size_t_fmt='#define SWITCH_SIZE_T_FMT "d"'
elif test "$ac_cv_sizeof_size_t" = "$ac_cv_sizeof_long"; then
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
else
2011-07-15 11:42:48 -04:00
size_t_fmt='#define SWITCH_SIZE_T_FMT "zu"'
2007-03-09 15:44:13 -05:00
fi
# Basically, we have tried to figure out the correct format strings
# for SWITCH types which vary between platforms, but we don't always get
# it right. If you find that we don't get it right for your platform,
# you can override our decision below.
# NOTE: borrowed much of this logic from apr.
case $host in
s390*linux*)
# uniquely, the 31-bit Linux/s390 uses "unsigned long int"
# for size_t rather than "unsigned int":
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
;;
*-os2*)
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
;;
2008-02-22 18:11:08 -05:00
*-openbsd*)
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
;;
2007-03-09 15:44:13 -05:00
*aix4*|*aix5*)
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
;;
*beos*)
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
size_t_fmt='#define SWITCH_SIZE_T_FMT "ld"'
;;
*apple-darwin*)
osver=`uname -r`
case $osver in
[0-7].*)
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "d"'
;;
*)
ssize_t_fmt='#define SWITCH_SSIZE_T_FMT "ld"'
;;
esac
size_t_fmt='#define SWITCH_SIZE_T_FMT "lu"'
;;
esac
AC_SUBST(voidp_size)
AC_SUBST(short_value)
AC_SUBST(int_value)
AC_SUBST(long_value)
AC_SUBST(int64_value)
AC_SUBST(size_t_value)
AC_SUBST(ssize_t_value)
AC_SUBST(int64_t_fmt)
AC_SUBST(uint64_t_fmt)
AC_SUBST(ssize_t_fmt)
AC_SUBST(size_t_fmt)
2010-03-22 19:05:20 -04:00
case $host in
*-openbsd*)
# OpenBSD's gunzip and friends don't like -d because its redundant, only gzip does
AC_PATH_PROGS(ZCAT, gzip)
;;
*)
AC_PATH_PROGS(ZCAT, gunzip gzcat gzip zcat)
;;
esac
2011-10-27 16:03:28 -04:00
AC_PATH_PROGS(BZIP, bzip2)
AC_PATH_PROGS(XZ, xz)
2007-03-13 23:02:46 -04:00
AC_PATH_PROGS(TAR, gtar tar)
AC_PATH_PROGS(WGET, wget)
AC_PATH_PROGS(CURL, curl)
2009-12-11 16:20:02 -05:00
GETLIB="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getlib.sh"
2007-03-14 10:35:11 -04:00
AC_SUBST(GETLIB)
2011-02-14 14:52:35 -05:00
GETG729="cd $switch_srcdir/libs && ${SHELL} $switch_builddir/build/getg729.sh"
AC_SUBST(GETG729)
2009-12-11 16:20:02 -05:00
GETSOUNDS="${SHELL} $switch_builddir/build/getsounds.sh"
2007-12-10 18:38:42 -05:00
AC_SUBST(GETSOUNDS)
2007-03-14 10:35:11 -04:00
2007-03-13 23:02:46 -04:00
2010-06-08 15:17:46 -04:00
LIBCURL_DEPS=
AC_ARG_WITH(libcurl,
AC_HELP_STRING([--with-libcurl=DIR],[look for the curl library in DIR]),
[_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
2010-07-25 04:10:06 -04:00
AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_use_system_curl], [
LIBCURL_CHECK_CONFIG([yes], [7.13.0], [ac_cv_use_system_curl='yes'], [ac_cv_use_system_curl='no'])
])
2010-06-08 15:17:46 -04:00
if test "$_libcurl_with" = "no" ; then
ac_cv_use_system_curl=no;
fi
if test "$_libcurl_with" = "yes" ; then
ac_cv_use_system_curl=yes;
fi
2011-11-30 12:03:53 -05:00
if test "$ac_cv_use_system_curl" = "yes" ; then
AC_CACHE_CHECK([whether to use system libcurl library], [ac_cv_curl_usable], [
AC_CHECK_LIB(curl, Curl_setopt, [ac_cv_curl_usable="yes"], [ac_cv_curl_usable="no"])
])
fi
if test "$ac_cv_curl_usable" != "yes" ; then
ac_cv_use_system_curl=no;
fi
2010-06-08 15:17:46 -04:00
if test "$ac_cv_use_system_curl" != "yes" ; then
LIBCURL_DEPS='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL='${switch_builddir}/libs/curl/lib/libcurl.la'
LIBCURL_CPPFLAGS='-I${switch_srcdir}/libs/curl/include'
2011-11-29 16:38:52 -05:00
else
SWITCH_AM_LDFLAGS="$LIBCURL $SWITCH_AM_LDFLAGS"
2010-06-08 15:17:46 -04:00
fi
2011-11-29 16:38:52 -05:00
SWITCH_AM_CFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CFLAGS"
SWITCH_AM_CXXFLAGS="$LIBCURL_CPPFLAGS $SWITCH_AM_CXXFLAGS"
2011-11-29 14:35:16 -05:00
AM_CONDITIONAL([CURL_BUILTIN],[test "${ac_cv_use_system_curl}" != "yes"])
2007-03-14 14:59:25 -04:00
AC_SUBST(LIBCURL_DEPS)
2007-04-03 23:08:17 -04:00
2007-04-30 16:37:41 -04:00
AC_ARG_ENABLE(core-libedit-support,
2008-05-12 15:12:37 -04:00
[AS_HELP_STRING([--disable-core-libedit-support], [Compile without libedit Support])], [enable_core_libedit_support="$enableval"], [enable_core_libedit_support="yes"])
2007-04-30 16:37:41 -04:00
2007-11-22 01:24:24 -05:00
if test "$enable_core_libedit_support" = "yes" ; then
2013-09-07 15:21:33 -04:00
AC_CHECK_LIB(tinfo, tgetent, [have_libtinfo="yes"], [have_libtinfo="no"])
if test "$have_libtinfo" == "yes" ; then
TINFO_LIBS="-ltinfo"
else
TINFO_LIBS=""
AC_CHECK_LIB(ncurses, tgetent,,
[AC_CHECK_LIB(curses, tgetent,,
[AC_MSG_ERROR([libtermcap, libcurses or libncurses are required!])] )] )
fi
AC_SUBST(TINFO_LIBS)
2007-11-22 01:24:24 -05:00
fi
2009-06-17 12:11:53 -04:00
SAC_OPENSSL
2009-06-23 17:23:44 -04:00
if test x$HAVE_OPENSSL = x1; then
openssl_CFLAGS="$openssl_CFLAGS -DHAVE_OPENSSL";
2011-05-13 19:25:52 -04:00
APR_ADDTO(SWITCH_AM_CFLAGS, -DHAVE_OPENSSL)
2013-01-31 16:43:27 -05:00
AC_CHECK_LIB(ssl, SSL_CTX_set_tlsext_use_srtp, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS_SRTP, 1, HAVE_OPENSSL_DTLS_SRTP))
2013-05-10 17:01:40 -04:00
AC_CHECK_LIB(ssl, DTLSv1_method, AC_DEFINE_UNQUOTED(HAVE_OPENSSL_DTLS, 1, HAVE_OPENSSL_DTLS), AC_MSG_WARN([OpenSSL version < 1.0.1e you might want to upgrade]))
else
AC_MSG_ERROR([OpenSSL and associaed developement headers required])
2009-06-23 17:23:44 -04:00
fi
2007-09-25 09:21:17 -04:00
AX_CHECK_JAVA
2007-03-23 02:08:17 -04:00
2009-02-03 15:31:24 -05:00
2010-01-16 22:11:56 -05:00
AM_CONDITIONAL([HAVE_ODBC],[test "x$enable_core_odbc_support" != "xno"])
AM_CONDITIONAL([HAVE_LIBEDIT],[test "x$enable_core_libedit_support" != "xno"])
2007-04-06 05:38:11 -04:00
AM_CONDITIONAL([HAVE_MYSQL],[test "$found_mysql" = "yes"])
2006-01-05 18:13:00 -05:00
2008-05-02 19:40:37 -04:00
#
# Python checks for mod_python
#
AC_ARG_WITH(
[python],
[AS_HELP_STRING([--with-python], [Use system provided version of python (default: try)])],
[with_python="$withval"],
[with_python="try"]
)
if test "$with_python" != "no"
then
2008-05-16 14:49:52 -04:00
save_CFLAGS="$CFLAGS"
save_LIBS="$LIBS"
2008-05-02 19:40:37 -04:00
if test "$with_python" != "yes" -a "$with_python" != "try" ; then
AC_MSG_CHECKING([for python])
if test ! -x "$with_python" ; then
AC_MSG_ERROR([Specified python does not exist or is not executable: $with_python])
fi
AC_MSG_RESULT([$with_python])
AC_SUBST([PYTHON], ["$with_python"])
else
AC_PATH_PROG([PYTHON], ["python"], ["no"], ["$PATH:/usr/bin:/usr/local/bin"])
fi
if test "$PYTHON" != "no" ; then
AC_MSG_CHECKING([python version])
PYTHON_VER="`$PYTHON -V 2>&1 | cut -d' ' -f2`"
if test -z "$PYTHON_VER" ; then
AC_MSG_ERROR([Unable to detect python version])
fi
AC_MSG_RESULT([$PYTHON_VER])
2008-05-16 14:49:52 -04:00
AC_MSG_CHECKING([for python distutils])
2008-05-16 15:58:16 -04:00
python_result="`$PYTHON -c 'import distutils;' 2>&1`"
if test -z "$python_result" ; then
2008-05-16 14:49:52 -04:00
python_has_distutils="yes"
2008-05-16 15:58:16 -04:00
else
python_has_distutils="no"
2008-05-16 14:49:52 -04:00
fi
AC_MSG_RESULT([$python_has_distutils])
2008-05-16 15:58:16 -04:00
if test "$python_has_distutils" != "no" ; then
2008-05-16 15:29:26 -04:00
AC_MSG_CHECKING([location of site-packages])
2011-09-19 09:47:06 -04:00
PYTHON_SITE_DIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_python_lib(0));'`"
2008-05-16 15:29:26 -04:00
if test -z "$PYTHON_SITE_DIR" ; then
AC_MSG_ERROR([Unable to detect python site-packages path])
elif test ! -d "$PYTHON_SITE_DIR" ; then
AC_MSG_ERROR([Path $PYTHON_SITE_DIR returned by python does not exist!])
fi
AC_MSG_RESULT([$PYTHON_SITE_DIR])
AC_SUBST([PYTHON_SITE_DIR], [$PYTHON_SITE_DIR])
2008-05-16 14:49:52 -04:00
#
# python distutils found, get settings from python directly
#
2012-06-01 18:12:34 -04:00
PYTHON_CFLAGS="`$PYTHON -c 'from distutils import sysconfig; flags = [[\"-I\" + sysconfig.get_python_inc(0), \"-I\" + sysconfig.get_python_inc(1), \" \".join(sysconfig.get_config_var(\"CFLAGS\").split())]]; print(\" \".join(flags));' | sed -e 's/-arch i386//g;s/-arch x86_64//g'`"
2011-09-19 09:47:06 -04:00
PYTHON_LDFLAGS="`$PYTHON -c 'from distutils import sysconfig; libs = sysconfig.get_config_var(\"LIBS\").split() + sysconfig.get_config_var(\"SYSLIBS\").split(); libs.append(\"-lpython\"+sysconfig.get_config_var(\"VERSION\")); print(\" \".join(libs));'`"
PYTHON_LIB="`$PYTHON -c 'from distutils import sysconfig; print(\"python\" + sysconfig.get_config_var(\"VERSION\"));'`"
PYTHON_LIBDIR="`$PYTHON -c 'from distutils import sysconfig; print(sysconfig.get_config_var(\"LIBDIR\"));'`"
2008-05-24 20:52:37 -04:00
# handle python being installed into /usr/local
AC_MSG_CHECKING([python libdir])
if test -z "`echo $PYTHON_LIBDIR | grep "/usr/lib"`" ; then
PYTHON_LDFLAGS="-L$PYTHON_LIBDIR $PYTHON_LDFLAGS"
LIBS="-L$PYTHON_LIBDIR $LIBS"
fi
AC_MSG_RESULT([$PYTHON_LIBDIR])
2008-05-02 19:40:37 -04:00
2008-05-16 14:49:52 -04:00
# check libpython
AC_CHECK_LIB([$PYTHON_LIB], [main], [has_libpython="yes"], [has_libpython="no"])
if test "$has_libpython" = "no" ; then
AS_IF([test "$with_python" = "try"],
[AC_MSG_WARN([$PYTHON_LIB is unusable])],
[AC_MSG_ERROR([$PYTHON_LIB is unusable])]
)
fi
2008-05-02 19:40:37 -04:00
# check whether system libpython is usable and has threads support
2008-05-16 14:49:52 -04:00
CFLAGS="$PYTHON_CFLAGS"
2008-05-02 19:40:37 -04:00
LIBS="$PYTHON_LDFLAGS"
AC_CHECK_FUNC([PyThread_init_thread], [python_has_threads="yes"], [python_has_threads="no"])
2008-05-16 14:49:52 -04:00
if test "$python_has_threads" = "no"; then
AS_IF([test "$with_python" = "try"],
[AC_MSG_WARN([Your python lacks threads support, can not build mod_python])],
[AC_MSG_ERROR([Your python lacks threads support, can not build mod_python])]
)
2008-05-02 19:40:37 -04:00
else
AC_MSG_NOTICE([Your python seems OK, do not forget to enable mod_python in modules.conf])
2008-05-16 14:49:52 -04:00
AC_SUBST([PYTHON_CFLAGS], [$PYTHON_CFLAGS])
2008-05-02 19:40:37 -04:00
AC_SUBST([PYTHON_LDFLAGS], [$PYTHON_LDFLAGS])
fi
else
2008-05-16 14:49:52 -04:00
AS_IF([test "$with_python" = "try"],
2008-05-16 15:58:16 -04:00
[AC_MSG_WARN([Could not find or use python distutils module: $python_result])],
[AC_MSG_ERROR([Could not find or use python distutils module: $python_result])]
2008-05-16 14:49:52 -04:00
)
2008-05-02 19:40:37 -04:00
fi
2008-05-16 14:49:52 -04:00
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
unset python_has_threads
unset python_has_distutils
2008-05-16 15:58:16 -04:00
unset python_result
2008-05-16 14:49:52 -04:00
else
AS_IF([test "$with_python" = "try"],
[AC_MSG_WARN([Could not find python, mod_python will not build, use --with-python to specify the location])],
[AC_MSG_ERROR([Could not find python, use --with-python to specify the location])]
)
2008-05-02 19:40:37 -04:00
fi
else
AC_MSG_WARN([python support disabled, building mod_python will fail!])
fi
2009-03-12 15:54:20 -04:00
CHECK_ERLANG
2007-03-09 15:44:13 -05:00
AC_CONFIG_FILES([Makefile
2010-05-12 22:25:54 -04:00
build/Makefile
src/Makefile
src/mod/Makefile
2009-12-07 02:14:34 -05:00
src/mod/applications/mod_expr/Makefile
2010-05-24 05:24:38 -04:00
src/mod/applications/mod_spandsp/Makefile
2010-09-27 03:39:38 -04:00
src/mod/applications/mod_osp/Makefile
2009-12-07 02:45:28 -05:00
src/mod/applications/mod_stress/Makefile
2010-07-19 16:10:10 -04:00
src/mod/applications/mod_hash/Makefile
2011-02-14 14:52:35 -05:00
src/mod/codecs/mod_com_g729/Makefile
2009-12-07 04:00:05 -05:00
src/mod/endpoints/mod_portaudio/Makefile
2010-03-02 12:16:52 -05:00
src/mod/endpoints/mod_skinny/Makefile
2010-03-14 17:57:23 -04:00
src/mod/endpoints/mod_skypopen/Makefile
2010-05-12 22:25:54 -04:00
src/mod/endpoints/mod_sofia/Makefile
2009-12-07 04:00:05 -05:00
src/mod/formats/mod_portaudio_stream/Makefile
2010-05-12 22:25:54 -04:00
src/mod/asr_tts/mod_unimrcp/Makefile
src/mod/languages/mod_java/Makefile
2010-01-17 01:57:35 -05:00
src/mod/languages/mod_lua/Makefile
2010-05-12 22:25:54 -04:00
src/mod/languages/mod_python/Makefile
2010-01-17 00:48:36 -05:00
src/mod/languages/mod_spidermonkey/Makefile
2010-05-12 22:25:54 -04:00
src/mod/event_handlers/mod_erlang_event/Makefile
src/include/switch_am_config.h
build/getsounds.sh
build/getlib.sh
2011-02-14 14:52:35 -05:00
build/getg729.sh
2010-01-11 23:43:39 -05:00
build/freeswitch.pc
2010-05-12 22:25:54 -04:00
build/modmake.rules
2013-09-07 15:21:33 -04:00
libs/esl/eslmake.rules
2010-05-12 22:25:54 -04:00
libs/xmlrpc-c/xmlrpc_config.h
2012-10-13 12:37:25 -04:00
libs/xmlrpc-c/config.mk
libs/xmlrpc-c/srcdir.mk
libs/xmlrpc-c/stamp-h
2010-05-12 22:25:54 -04:00
scripts/gentls_cert])
2005-11-12 16:27:19 -05:00
2005-11-18 19:10:16 -05:00
AM_CONDITIONAL(ISLINUX, [test `uname -s` = Linux])
2005-12-13 16:26:03 -05:00
AM_CONDITIONAL(ISMAC, [test `uname -s` = Darwin])
2006-01-25 18:59:02 -05:00
AM_CONDITIONAL(IS64BITLINUX, [test `uname -m` = x86_64])
2005-11-18 19:10:16 -05:00
2007-03-30 16:22:38 -04:00
#some vars to sub into the Makefile.am's
#LIBS+=> core.log || error="yes";if test -n "$(VERBOSE)" -o "$$error" = "yes";then cat core.log;fi;if test "$$error" = "yes";then exit 1;fi
LIBTOOL='`if test -z "$(VERBOSE)" ; then echo $(SHELL) $(switch_builddir)/quiet_libtool ;else echo $(switch_builddir)/libtool; fi;`'
TOUCH_TARGET='if test -f "$@";then touch "$@";fi;'
2009-06-30 17:01:16 -04:00
CONF_MODULES='$$(grep -v "\#" $(switch_builddir)/modules.conf | sed -e "s|^.*/||" | sort | uniq )'
2009-07-01 16:27:00 -04:00
CONF_DISABLED_MODULES='$$(grep "\#" $(switch_builddir)/modules.conf | grep -v "\#\#" | sed -e "s|^.*/||" | sort | uniq )'
2009-06-30 17:01:16 -04:00
OUR_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
OUR_CLEAN_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
OUR_INSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
OUR_UNINSTALL_MODS='$$(if test -z "$(MODULES)" ; then tmp_mods="$(CONF_MODULES)"; else tmp_mods="$(MODULES)" ; fi ; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
OUR_DISABLED_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-all ; done )"; echo $$mods )'
OUR_DISABLED_CLEAN_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-clean ; done )"; echo $$mods )'
OUR_DISABLED_INSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-install ; done)"; echo $$mods )'
OUR_DISABLED_UNINSTALL_MODS='$$(tmp_mods="$(CONF_DISABLED_MODULES)"; mods="$$(for i in $$tmp_mods ; do echo $$i-uninstall ; done)"; echo $$mods )'
2008-05-02 14:36:01 -04:00
AM_MAKEFLAGS='"OUR_MODULES=$(OUR_MODS)" "OUR_CLEAN_MODULES=$(OUR_CLEAN_MODS)" "OUR_INSTALL_MODULES=$(OUR_INSTALL_MODS)" "OUR_UNINSTALL_MODULES=$(OUR_UNINSTALL_MODS)" "OUR_DISABLED_MODULES=$(OUR_DISABLED_MODS)" "OUR_DISABLED_CLEAN_MODULES=$(OUR_DISABLED_CLEAN_MODS)" "OUR_DISABLED_INSTALL_MODULES=$(OUR_DISABLED_INSTALL_MODS)" "OUR_DISABLED_UNINSTALL_MODULES=$(OUR_DISABLED_UNINSTALL_MODS)" `test -n "$(VERBOSE)" || echo -s`'
2007-04-09 10:40:03 -04:00
#AM_MAKEFLAGS='`test -n "$(VERBOSE)" || echo -s`'
2007-03-30 16:22:38 -04:00
AC_SUBST(LIBTOOL)
AC_SUBST(TOUCH_TARGET)
2008-05-02 14:36:01 -04:00
AC_SUBST(CONF_DISABLED_MODULES)
2007-04-09 10:40:03 -04:00
AC_SUBST(CONF_MODULES)
2008-05-02 14:36:01 -04:00
2007-04-09 10:40:03 -04:00
AC_SUBST(OUR_MODS)
AC_SUBST(OUR_CLEAN_MODS)
AC_SUBST(OUR_INSTALL_MODS)
AC_SUBST(OUR_UNINSTALL_MODS)
2008-05-02 14:36:01 -04:00
AC_SUBST(OUR_DISABLED_MODS)
AC_SUBST(OUR_DISABLED_CLEAN_MODS)
AC_SUBST(OUR_DISABLED_INSTALL_MODS)
AC_SUBST(OUR_DISABLED_UNINSTALL_MODS)
2007-03-30 16:22:38 -04:00
AC_SUBST(AM_MAKEFLAGS)
2010-01-13 17:26:00 -05:00
ac_configure_args="$ac_configure_args CONFIGURE_CFLAGS='$CFLAGS' CONFIGURE_CXXFLAGS='$CXXFLAGS' CONFIGURE_LDFLAGS='$LDFLAGS' "
2010-01-13 16:16:36 -05:00
2010-01-11 13:53:05 -05:00
# --prefix='$prefix' --exec_prefix='$exec_prefix' --libdir='$libdir' --libexecdir='$libexecdir' --bindir='$bindir' --sbindir='$sbindir' \
# --localstatedir='$localstatedir' --datadir='$datadir'"
2009-12-09 19:32:02 -05:00
2007-03-11 03:36:49 -04:00
# Run configure in all the subdirs
2012-09-24 15:39:52 -04:00
AC_CONFIG_SUBDIRS([libs/srtp])
AC_CONFIG_SUBDIRS([libs/sqlite])
if test "$enable_core_libedit_support" = "yes" ; then
AC_CONFIG_SUBDIRS([libs/libedit])
fi
AC_CONFIG_SUBDIRS([libs/pcre])
AC_CONFIG_SUBDIRS([libs/apr])
AC_CONFIG_SUBDIRS([libs/apr-util])
AC_CONFIG_SUBDIRS([libs/ilbc])
AC_CONFIG_SUBDIRS([libs/curl])
AC_CONFIG_SUBDIRS([libs/iksemel])
AC_CONFIG_SUBDIRS([libs/js/nsprpub])
AC_CONFIG_SUBDIRS([libs/js])
AC_CONFIG_SUBDIRS([libs/libdingaling])
AC_CONFIG_SUBDIRS([libs/libsndfile])
AC_CONFIG_SUBDIRS([libs/sofia-sip])
AC_CONFIG_SUBDIRS([libs/speex])
AC_CONFIG_SUBDIRS([libs/portaudio])
AC_CONFIG_SUBDIRS([libs/openzap])
AC_CONFIG_SUBDIRS([libs/freetdm])
AC_CONFIG_SUBDIRS([libs/unimrcp])
AC_CONFIG_SUBDIRS([libs/tiff-4.0.2])
AC_CONFIG_SUBDIRS([libs/spandsp])
AC_CONFIG_SUBDIRS([libs/broadvoice])
AC_CONFIG_SUBDIRS([libs/libg722_1])
AC_CONFIG_SUBDIRS([libs/silk])
AC_CONFIG_SUBDIRS([libs/libcodec2])
if test "x${enable_zrtp}" = "xyes"; then
2013-02-10 18:47:38 -05:00
AC_CONFIG_SUBDIRS([libs/libzrtp])
2012-04-05 00:10:55 -04:00
fi
2012-09-24 15:39:52 -04:00
AC_CONFIG_SUBDIRS([libs/libwebsockets])
2007-03-11 10:03:58 -04:00
2010-03-22 19:05:20 -04:00
case $host in
*-openbsd*)
# libtool won't link static libs against shared ones on OpenBSD unless we tell it not to be stupid
AC_CONFIG_COMMANDS([hacklibtool], [cp libtool libtool.orig && sed -e "s/deplibs_check_method=.*/deplibs_check_method=pass_all/g" libtool.orig > libtool])
;;
esac
2007-03-13 02:17:58 -04:00
AC_OUTPUT
2010-01-11 09:36:29 -05:00
2010-07-01 19:15:51 -04:00
##
## Registering for ClueCon
##
2012-09-24 15:38:06 -04:00
if ! test -f noreg ; then
2010-07-01 19:15:51 -04:00
echo ""
echo ""
echo $ECHO_N "Registering you for ClueCon http://www.cluecon.com $ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-01 19:15:51 -04:00
echo $ECHO_N ".$ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-01 19:15:51 -04:00
echo $ECHO_N ".$ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-01 19:15:51 -04:00
echo $ECHO_N ".$ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-01 19:15:51 -04:00
echo $ECHO_N ".$ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-02 00:15:37 -04:00
echo $ECHO_N ".$ECHO_C" 1>&6
2011-09-23 12:54:41 -04:00
sleep 1
2010-07-01 19:15:51 -04:00
AC_MSG_RESULT([ See you in August. ;-)])
2011-09-23 12:54:41 -04:00
sleep 2
2010-07-01 19:15:51 -04:00
echo ""
2011-02-14 14:52:35 -05:00
fi
2010-07-01 19:15:51 -04:00
2010-01-11 09:36:29 -05:00
##
## Configuration summary
##
echo
2010-01-13 12:01:36 -05:00
echo "-------------------------- FreeSWITCH configuration --------------------------"
2010-01-11 09:36:29 -05:00
echo ""
echo " Locations:"
echo " Selected layout: ${layout_name}"
echo ""
echo " prefix: ${prefix}"
echo " exec_prefix: ${exec_prefix}"
echo " bindir: ${bindir}"
echo " libdir: ${libdir}"
echo " modulesdir: ${modulesdir}"
echo " sysconfdir: ${sysconfdir}"
echo " runtimedir: ${runtimedir}"
echo " logfiledir: ${logfiledir}"
echo ""
2010-01-13 12:01:36 -05:00
echo "------------------------------------------------------------------------------"