2018-01-15 17:08:24 +00:00
AC_PREREQ(2.60a)
2006-04-24 17:11:45 +00:00
2010-06-04 01:20:17 +00:00
AC_INIT([asterisk], [trunk], [https://issues.asterisk.org])
2006-04-24 17:11:45 +00:00
# cross-compile macros
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# check existence of the package
2006-08-21 02:11:39 +00:00
AC_CONFIG_SRCDIR([main/asterisk.c])
2006-04-24 17:11:45 +00:00
AC_COPYRIGHT("Asterisk")
2009-08-28 20:01:21 +00:00
# preserve any CFLAGS or LDFLAGS that may be set
2009-09-08 16:37:28 +00:00
# NOTE: This must be done before calling any macros that end up
# calling AC_PROG_CC or the like, since they will set a default
# set of CFLAGS ("-g -O2") if the user did not supply any, and
# we don't want those default flags to be carried over into the
# rest of the build system since we have other means of controlling
# debugging symbol generation and optimization.
2009-08-28 20:01:21 +00:00
CONFIG_CFLAGS="${CFLAGS}"
CONFIG_LDFLAGS="${LDFLAGS}"
AC_SUBST(CONFIG_CFLAGS)
AC_SUBST(CONFIG_LDFLAGS)
2009-09-08 16:37:28 +00:00
# specify output header file
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
2011-01-21 09:09:54 +00:00
# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
# other macro that uses the C compiler, or the default order will be used.
2011-01-22 04:13:15 +00:00
AC_PROG_CC([gcc cc])
2011-01-21 09:09:54 +00:00
2010-09-28 18:20:20 +00:00
AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD
# System default paths
AC_SUBST([astsbindir], ['${sbindir}'])dnl
AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl
AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl
2012-01-30 21:21:16 +00:00
AC_SUBST([astlibdir], ['${libdir}'])dnl
AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl
2010-09-28 18:20:20 +00:00
AC_SUBST([astmandir], ['${mandir}'])dnl
AC_SUBST([astvarlibdir], ['${localstatedir}/lib/asterisk'])dnl
AC_SUBST([astdatadir], ['${astvarlibdir}'])dnl
AC_SUBST([astdbdir], ['${astvarlibdir}'])dnl
AC_SUBST([astkeydir], ['${astvarlibdir}'])dnl
AC_SUBST([astspooldir], ['${localstatedir}/spool/asterisk'])dnl
AC_SUBST([astlogdir], ['${localstatedir}/log/asterisk'])dnl
AC_SUBST([astvarrundir], ['${localstatedir}/run/asterisk'])dnl
case "${host_os}" in
*bsd*)
2018-02-16 13:52:36 +00:00
if test ${prefix} != 'NONE'; then
2010-09-28 18:20:20 +00:00
astvarlibdir='${prefix}/share/asterisk'
astdbdir='${localstatedir}/db/asterisk'
fi
;;
darwin*)
if test ${prefix} = 'NONE'; then
astvarrundir='/Library/Application Support/Asterisk/Run'
fi
;;
esac
2009-09-08 16:37:28 +00:00
2006-08-21 02:11:39 +00:00
case "${host_os}" in
2018-03-08 15:14:11 +00:00
netbsd*)
ac_default_prefix=/usr/pkg
CPPFLAGS=-I/usr/pkg/include
LDFLAGS=-L/usr/pkg/lib
;;
2018-04-20 10:50:03 +00:00
dragonfly*|freebsd*)
2011-01-27 17:03:44 +00:00
ac_default_prefix=/usr/local
2006-10-04 22:59:02 +00:00
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
2006-05-19 18:54:21 +00:00
;;
2008-10-07 18:53:34 +00:00
openbsd*)
2011-01-27 17:03:44 +00:00
ac_default_prefix=/usr/local
2008-10-07 18:53:34 +00:00
if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
2010-09-28 18:20:20 +00:00
astetcdir=/etc/asterisk
2008-10-07 18:53:34 +00:00
fi
if test ${mandir} = '${prefix}/man'; then
2010-09-28 18:20:20 +00:00
astmandir=/usr/share/man
2008-10-07 18:53:34 +00:00
fi
fi
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
;;
Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines
Fix cases where the internal poll() was not being used when it needed to be.
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
darwin*)
2011-01-27 17:03:44 +00:00
ac_default_prefix=/usr/local
2010-10-05 14:17:37 +00:00
if test ${prefix} = 'NONE'; then
2012-01-30 21:21:16 +00:00
astmoddir='/Library/Application Support/Asterisk/Modules'
2010-12-26 21:17:02 +00:00
astvarlibdir='/Library/Application Support/Asterisk'
2010-10-05 14:17:37 +00:00
astlogdir=/Library/Logs/Asterisk
2010-12-26 21:17:02 +00:00
astvarrundir='/Library/Application Support/Asterisk/Run'
2010-10-05 14:17:37 +00:00
fi
Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines
Fix cases where the internal poll() was not being used when it needed to be.
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
2010-09-02 05:02:54 +00:00
AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.])
Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines
Fix cases where the internal poll() was not being used when it needed to be.
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
;;
2010-09-28 18:20:20 +00:00
solaris*)
if test ${prefix} = 'NONE'; then
astetcdir=/var/etc/asterisk
astsbindir=/opt/asterisk/sbin
astlibdir=/opt/asterisk/lib
2012-01-30 21:21:16 +00:00
astmoddir=/opt/asterisk/lib/modules
2010-09-28 18:20:20 +00:00
astheaderdir=/opt/asterisk/include
astmandir=/opt/asterisk/man
astvarlibdir=/var/opt/asterisk
astspooldir=/var/spool/asterisk
astlogdir=/var/log/asterisk
astvarrundir=/var/run/asterisk
fi
;;
2006-05-19 18:54:21 +00:00
*)
2011-01-27 17:03:44 +00:00
ac_default_prefix=/usr
2008-07-30 21:40:08 +00:00
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
2008-07-30 19:48:37 +00:00
if test ${sysconfdir} = '${prefix}/etc'; then
sysconfdir=/etc
fi
if test ${mandir} = '${prefix}/man'; then
mandir=/usr/share/man
fi
2006-05-25 22:05:12 +00:00
fi
2006-05-19 18:54:21 +00:00
;;
esac
2009-03-11 22:20:13 +00:00
if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
if test ${localstatedir} = '${prefix}/var'; then
localstatedir=/var
fi
2006-05-19 18:54:21 +00:00
fi
2006-04-24 17:11:45 +00:00
2006-08-21 02:11:39 +00:00
BUILD_PLATFORM=${build}
BUILD_CPU=${build_cpu}
BUILD_VENDOR=${build_vendor}
BUILD_OS=${build_os}
AC_SUBST(BUILD_PLATFORM)
AC_SUBST(BUILD_CPU)
AC_SUBST(BUILD_VENDOR)
AC_SUBST(BUILD_OS)
HOST_PLATFORM=${host}
HOST_CPU=${host_cpu}
HOST_VENDOR=${host_vendor}
HOST_OS=${host_os}
AC_SUBST(HOST_PLATFORM)
AC_SUBST(HOST_CPU)
AC_SUBST(HOST_VENDOR)
AC_SUBST(HOST_OS)
2006-04-24 17:11:45 +00:00
2008-11-04 15:07:54 +00:00
PBX_WINARCH=0
2007-12-17 17:11:06 +00:00
2006-09-19 14:04:15 +00:00
case "${host_os}" in
2018-04-20 10:50:03 +00:00
dragonfly*|freebsd*)
2006-09-19 14:04:15 +00:00
OSARCH=FreeBSD
;;
2006-09-19 14:19:54 +00:00
netbsd*)
OSARCH=NetBSD
;;
2006-09-19 14:24:14 +00:00
openbsd*)
OSARCH=OpenBSD
;;
2006-09-19 14:19:54 +00:00
solaris*)
OSARCH=SunOS
;;
2007-12-17 17:11:06 +00:00
mingw32)
OSARCH=mingw32
2008-11-04 15:07:54 +00:00
PBX_WINARCH=1
2007-12-17 17:11:06 +00:00
;;
cygwin)
OSARCH=cygwin
2008-11-04 15:07:54 +00:00
PBX_WINARCH=1
2007-12-17 17:11:06 +00:00
;;
2016-11-02 10:05:18 +00:00
linux-gnu*)
2009-10-26 22:46:09 +00:00
OSARCH=linux-gnu
;;
2016-06-03 05:59:30 +00:00
linux-musl*)
OSARCH=linux-musl
;;
2010-08-15 13:08:45 +00:00
kfreebsd*-gnu)
OSARCH=kfreebsd-gnu
;;
2006-09-19 14:04:15 +00:00
*)
2007-11-17 00:31:32 +00:00
OSARCH=${host_os}
2006-09-19 14:04:15 +00:00
;;
esac
AC_SUBST(OSARCH)
2008-11-04 15:07:54 +00:00
AC_SUBST(PBX_WINARCH)
2006-09-19 14:04:15 +00:00
2014-10-19 17:09:38 +00:00
AC_MSG_CHECKING(whether char is unsigned)
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
#include <limits.h>
#if CHAR_MIN == 0
#error
#endif
)
],[
AC_MSG_RESULT(no)
CONFIG_SIGNED_CHAR=""
],[
AC_MSG_RESULT(yes)
CONFIG_SIGNED_CHAR="-fsigned-char"
]
)
AC_SUBST(CONFIG_SIGNED_CHAR)
2006-04-24 17:11:45 +00:00
# check for uname
AC_PATH_TOOL([UNAME], [uname], No)
if test ! x"${UNAME}" = xNo; then
PBX_OSREV=$(${UNAME} -r)
fi
AC_SUBST(PBX_OSREV)
2015-11-25 16:42:31 +00:00
AH_TOP([#ifndef ASTERISK_AUTOCONFIG_H
2006-06-07 18:54:56 +00:00
#define ASTERISK_AUTOCONFIG_H
2015-11-25 16:42:31 +00:00
/* IWYU pragma: private, include "asterisk.h" */
2006-06-07 18:54:56 +00:00
2015-11-25 16:42:31 +00:00
#include "asterisk/buildopts.h" /* IWYU pragma: export */])
2006-05-11 09:50:41 +00:00
2015-11-25 16:42:31 +00:00
AH_BOTTOM([#endif /* ASTERISK_AUTOCONFIG_H */])
2006-06-07 18:54:56 +00:00
2006-04-24 17:11:45 +00:00
# cross-compile checks
2012-01-30 21:21:16 +00:00
if test "${cross_compiling}" = "yes";
2006-04-24 17:11:45 +00:00
then
AC_CHECK_TOOL(CC, gcc, :)
AC_CHECK_TOOL(CXX, g++, :)
2006-08-21 02:11:39 +00:00
AC_CHECK_TOOL(LD, ld, :)
2006-04-24 17:11:45 +00:00
AC_CHECK_TOOL(RANLIB, ranlib, :)
2020-01-12 11:37:46 +00:00
CROSS_COMPILING=1
AC_SUBST(CROSS_COMPILING)
2006-04-24 17:11:45 +00:00
fi
# Checks for programs.
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
2006-11-08 16:36:45 +00:00
# This macro is just copied into our local acinclude.m4 from libtool.m4 so that
# the developers regenerating the configure script don't have to install libtool.
2007-01-19 09:44:55 +00:00
AST_PROG_LD # note, does not work on FreeBSD
2006-04-24 17:11:45 +00:00
AC_PROG_AWK
AC_PROG_INSTALL
2011-08-25 15:30:46 +00:00
AC_PROG_LN_S
2006-04-24 17:11:45 +00:00
AC_PROG_RANLIB
AST_CHECK_GNU_MAKE
2010-10-03 21:09:52 +00:00
AC_PROG_EGREP
2006-04-24 17:11:45 +00:00
2010-04-27 19:31:55 +00:00
AC_CHECK_TOOLS([STRIP], [strip gstrip], :)
AC_CHECK_TOOLS([AR], [ar gar], :)
2007-05-24 20:44:46 +00:00
2006-11-01 22:35:52 +00:00
GNU_LD=0
if test "x$with_gnu_ld" = "xyes" ; then
GNU_LD=1
fi
AC_SUBST(GNU_LD)
2010-01-24 06:40:31 +00:00
AC_PATH_PROG([BISON], [bison], :)
2010-10-03 21:09:52 +00:00
AC_PATH_PROG([CMP], [cmp], :)
2016-11-16 18:05:43 +00:00
AC_PATH_PROG([CAT], [cat], :)
2017-11-19 15:57:28 +00:00
AC_PATH_PROG([CUT], [cut], :)
2010-01-24 06:40:31 +00:00
AC_PATH_PROG([FLEX], [flex], :)
2006-04-24 17:11:45 +00:00
AC_PATH_PROG([GREP], [grep], :)
2018-03-22 00:25:58 +00:00
AC_PATH_PROG([PYTHON], [python], :)
2006-04-24 17:11:45 +00:00
AC_PATH_PROG([FIND], [find], :)
AC_PATH_PROG([COMPRESS], [compress], :)
AC_PATH_PROG([BASENAME], [basename], :)
AC_PATH_PROG([DIRNAME], [dirname], :)
AC_PATH_PROG([SHELL], [sh], :)
AC_PATH_PROG([LN], [ln], :)
2012-10-13 15:06:39 +00:00
AC_PATH_PROG([DOXYGEN], [doxygen], :)
2006-04-24 17:11:45 +00:00
AC_PATH_PROG([DOT], [dot], :)
2006-12-01 23:20:17 +00:00
AC_PATH_PROG([WGET], [wget], :)
2009-02-03 00:29:49 +00:00
AC_PATH_PROG([CURL], [curl], :)
2007-03-15 22:29:45 +00:00
AC_PATH_PROG([RUBBER], [rubber], :)
2010-04-21 19:18:35 +00:00
AC_PATH_PROG([CATDVI], [catdvi], :)
2008-01-11 23:57:01 +00:00
AC_PATH_PROG([KPATHSEA], [kpsewhich], :)
2010-07-17 13:10:47 +00:00
AC_PATH_PROG([XMLLINT], [xmllint], :)
2018-01-17 12:47:45 +00:00
AC_PATH_PROGS([XMLSTARLET], [xmlstarlet xml], :)
build: Add download capability for external packages
The DPMA and g729a, silk, siren7 and siren14 codecs hosted at
http://downloads.digium.com/pub/telephony/ are now listed in the
"External" sections of the "Resource Modules" and "Codec Translators"
pages in menuselect. Any that are selected will automatically be
downloaded and installed when "make install" is run. Their LICENSE and
README (if avaialble) files will be installed to
ASTVARLIBDIR/documentation/thirdparty/<product_name>.
Example use with codecs:
The codecs/codecs.xml file is a menuselect style xml file that lists
the codecs to be included. Their support levels are 'external', which
triggers the download and install, and defaultenabled is no. Also
because codec_g729a is actually in a directory named codec_g729 on the
download server, the newly added 'member_data' element is used to
override the default of the directory name being the package name. You
can use the 'directory_name' attribute to keep default base URL
(http://downloads.digium.com/pub/telephony/) but use the new directory,
or you use the 'remote_url' attribute to specify a full URL to the
download directory. In this case, you must still follow the same
subdirectory naming conventions as that used for the packages located
at 'http://downloads.digium.com/pub/telephony'.
A new configure option '--with-externals-cache' was added and like
'--with-sounds-cache' it allows the installer to cache tarballs so
they're not downloaded every time.
To assist with the download and install process, each external package
now has a manifest.xml file that, among other things, contains a package
version and checksums for each file in the tarball. The manifest is
saved to both the cache directory and ASTMODDIR and together with the
manifest.xml on the downloads site, tells the install scripts whether
a download and/or update is needed.
bash and xmlstarlet are required for downloader operation. If they're
not installed, the external items in menuselect will be unavailable.
Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
2016-08-02 01:55:33 +00:00
AC_PATH_PROG([BASH], [bash], :)
2012-10-18 20:13:17 +00:00
AC_PATH_PROG([GIT], [git], :)
2016-01-21 22:40:47 +00:00
AC_PATH_PROG([ALEMBIC], [alembic], :)
2016-10-03 16:30:43 +00:00
AC_PATH_PROG([BZIP2], [bzip2], :)
AC_PATH_PROG([TAR], [tar], :)
AC_PATH_PROG([PATCH], [patch], :)
AC_PATH_PROG([SED], [sed], :)
AC_PATH_PROG([NM], [nm], :)
2018-03-09 12:26:40 +00:00
DOWNLOAD=":"
DOWNLOAD_TO_STDOUT=
DOWNLOAD_TIMEOUT=
2006-12-01 23:20:17 +00:00
if test "${WGET}" != ":" ; then
DOWNLOAD=${WGET}
2017-04-04 21:20:22 +00:00
DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
2016-11-16 18:05:43 +00:00
DOWNLOAD_TIMEOUT='--timeout=$1'
2018-04-03 19:39:39 +00:00
elif test "${CURL}" != ":" ; then
2009-02-03 00:29:49 +00:00
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
2017-03-14 20:12:28 +00:00
DOWNLOAD_TO_STDOUT="${CURL} -Ls"
2016-11-16 18:05:43 +00:00
DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
2006-12-01 23:20:17 +00:00
else
2018-03-09 12:26:40 +00:00
AC_PATH_PROG([FETCH], [fetch], :)
if test "${FETCH}" != ":" ; then
DOWNLOAD=${FETCH}
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
fi
2006-12-01 23:20:17 +00:00
fi
AC_SUBST(DOWNLOAD)
2016-10-03 16:30:43 +00:00
AC_SUBST(DOWNLOAD_TO_STDOUT)
2016-11-16 18:05:43 +00:00
AC_SUBST(DOWNLOAD_TIMEOUT)
2012-01-30 21:21:16 +00:00
AC_PATH_PROG([LDCONFIG], [ldconfig], :)
AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
AC_PATH_PROG([OPENSSL], [openssl], :)
2006-04-24 17:11:45 +00:00
2010-01-25 20:18:15 +00:00
AC_CACHE_CHECK([for bison that supports parse-param], [ac_cv_path_BISON2], [
if test "x$BISON" != "x:" ; then
# Create a temporary directory $tmp in $TMPDIR (default /tmp).
# Use mktemp if possible; otherwise fall back on mkdir,
# with $RANDOM to make collisions less likely.
: ${TMPDIR=/tmp}
{
tmp=`
(umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
` &&
test -n "$tmp" && test -d "$tmp"
} || {
tmp=$TMPDIR/foo$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || exit $?
cat >$tmp/test.y <<__EOL__
%parse-param {struct parse_io *parseio}
%%
file : { \$\$ = parseio->pval = 1; }
;
%%
__EOL__
${BISON} -o ${tmp}/test.tab.c ${tmp}/test.y >/dev/null 2>&1
if test -e "${tmp}/test.tab.c"; then
ac_cv_path_BISON2=${BISON}
fi
rm -rf ${tmp}
fi
])
if test "x${ac_cv_path_BISON2}" = "x" ; then
BISON=:
2010-01-25 21:38:33 +00:00
PBX_BISON=0
else
PBX_BISON=1
fi
AC_SUBST(PBX_BISON)
if test "x${FLEX}" = "x:" ; then
PBX_FLEX=0
else
PBX_FLEX=1
2010-01-25 20:18:15 +00:00
fi
2010-01-25 21:38:33 +00:00
AC_SUBST(PBX_FLEX)
2010-01-25 20:18:15 +00:00
build: Add download capability for external packages
The DPMA and g729a, silk, siren7 and siren14 codecs hosted at
http://downloads.digium.com/pub/telephony/ are now listed in the
"External" sections of the "Resource Modules" and "Codec Translators"
pages in menuselect. Any that are selected will automatically be
downloaded and installed when "make install" is run. Their LICENSE and
README (if avaialble) files will be installed to
ASTVARLIBDIR/documentation/thirdparty/<product_name>.
Example use with codecs:
The codecs/codecs.xml file is a menuselect style xml file that lists
the codecs to be included. Their support levels are 'external', which
triggers the download and install, and defaultenabled is no. Also
because codec_g729a is actually in a directory named codec_g729 on the
download server, the newly added 'member_data' element is used to
override the default of the directory name being the package name. You
can use the 'directory_name' attribute to keep default base URL
(http://downloads.digium.com/pub/telephony/) but use the new directory,
or you use the 'remote_url' attribute to specify a full URL to the
download directory. In this case, you must still follow the same
subdirectory naming conventions as that used for the packages located
at 'http://downloads.digium.com/pub/telephony'.
A new configure option '--with-externals-cache' was added and like
'--with-sounds-cache' it allows the installer to cache tarballs so
they're not downloaded every time.
To assist with the download and install process, each external package
now has a manifest.xml file that, among other things, contains a package
version and checksums for each file in the tarball. The manifest is
saved to both the cache directory and ASTMODDIR and together with the
manifest.xml on the downloads site, tells the install scripts whether
a download and/or update is needed.
bash and xmlstarlet are required for downloader operation. If they're
not installed, the external items in menuselect will be unavailable.
Change-Id: Id3dcf1289ffd3cb0bbd7dfab3cafbb87be60323a
2016-08-02 01:55:33 +00:00
if test "x${XMLSTARLET}" = "x:" ; then
PBX_XMLSTARLET=0
else
PBX_XMLSTARLET=1
fi
AC_SUBST(PBX_XMLSTARLET)
if test "x${BASH}" = "x:" ; then
PBX_BASH=0
else
PBX_BASH=1
fi
AC_SUBST(PBX_BASH)
2007-12-19 22:51:03 +00:00
AC_CHECK_TOOL([SOXMIX], [soxmix], [:])
if test "${SOXMIX}" != ":" ; then
AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
fi
2008-11-19 00:27:45 +00:00
AC_CHECK_PROGS([MD5], [md5 md5sum gmd5sum digest])
if test "${MD5}" = "digest" ; then
2012-01-30 21:21:16 +00:00
MD5="${MD5} -a md5"
2008-11-19 00:27:45 +00:00
fi
2016-07-13 13:57:08 +00:00
AX_PTHREAD
2007-01-15 15:08:45 +00:00
2006-04-24 17:11:45 +00:00
AC_LANG(C)
2018-08-26 18:18:42 +00:00
PBX_NO_BINARY_MODULES=0
AC_ARG_ENABLE([binary-modules],
[AS_HELP_STRING([--disable-binary-modules],
[Block installation of binary modules.])],
[case "${enableval}" in
y|ye|yes) PBX_NO_BINARY_MODULES=0 ;;
n|no) PBX_NO_BINARY_MODULES=1 ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-binary-modules) ;;
esac])
AC_SUBST(PBX_NO_BINARY_MODULES)
2008-10-06 17:32:02 +00:00
AC_ARG_ENABLE([dev-mode],
[AS_HELP_STRING([--enable-dev-mode],
[Turn on developer mode])],
2006-04-24 17:11:45 +00:00
[case "${enableval}" in
y|ye|yes) AST_DEVMODE=yes ;;
n|no) AST_DEVMODE=no ;;
2009-07-30 23:37:31 +00:00
noisy)
AST_DEVMODE=yes
NOISY_BUILD=yes
;;
2012-03-08 16:21:49 +00:00
strict)
AST_DEVMODE=yes
AST_DEVMODE_STRICT=yes
;;
2006-04-24 17:11:45 +00:00
*) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
esac])
2009-07-30 23:37:31 +00:00
AC_SUBST(NOISY_BUILD)
2006-04-24 17:11:45 +00:00
AC_SUBST(AST_DEVMODE)
2012-03-08 16:21:49 +00:00
AC_SUBST(AST_DEVMODE_STRICT)
2006-04-24 17:11:45 +00:00
2017-08-08 18:33:50 +00:00
AST_OPTION_ONLY([download-cache], [AST_DOWNLOAD_CACHE], [cached sound AND external module tarfiles], [])
2016-10-14 05:18:50 +00:00
AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
2010-07-27 21:16:39 +00:00
AST_CODE_COVERAGE=no
AC_ARG_ENABLE([coverage],
[AS_HELP_STRING([--enable-coverage],
[Turn on code coverage tracking (for gcov)])],
[case "${enableval}" in
y|ye|yes) AST_CODE_COVERAGE=yes ;;
n|no) AST_CODE_COVERAGE=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-coverage) ;;
esac])
AC_SUBST(AST_CODE_COVERAGE)
Update configure.ac/Makefile for clang
Created autoconf/ast_check_raii.m4: contains AST_CHECK_RAII which
checks compiler requirements for RAII:
gcc: -fnested-functions support
clang: -fblocks (and if required -lBlocksRuntime)
The original check was implemented in configure.ac and now has it's
own file. This function also sets C_COMPILER_FAMILY to either gcc or
clang for use by makefile
Created autoconf/ast_check_strsep_array_bounds.m4 (contains
AST_CHECK_STRSEP_ARRAY_BOUNDS):
which checks if clang is able to handle the optimized strsep & strcmp
functions (linux). If not, the standard libc implementation should be
used instead. Clang + the optimized macro's work with:
strsep(char *, char []), but not with strsepo(char *, char *).
Instead of replacing all the occurences throughout the source code,
not using the optimized macro version seemed easier
See 'define __strcmp_gc(s1, s2, l2) in bits/string2.h':
llvm-comment: Normally, this array-bounds warning are suppressed for
macros, so that unused paths like the one that accesses __s1[3] are
not warned about. But if you preprocess manually, and feed the
result to another instance of clang, it will warn about all the
possible forks of this particular if statement. Instead of switching
of this optimization, another solution would be to run the preproces-
sing step with -frewrite-includes, which should preserve enough
information so that clang should still be able to suppress the diag-
nostic at the compile step later on.
See also "https://llvm.org/bugs/show_bug.cgi?id=20144"
See also "https://llvm.org/bugs/show_bug.cgi?id=11536"
Makefile.rules: If C_COMPILER_FAMILY=clang then add two warning
suppressions:
-Wno-unused-value
-Wno-parentheses-equality
In an earlier review (reviewboard: 4550 and 4554), they were deemed a
nuisace and less than benefitial.
configure.ac:
Added AST_CHECK_RAII() see earlier
Added AST_CHECK_STRSEP_ARRAY_BOUNDS() see earlier
Removed moved content
ASTERISK-24917
Change-Id: I12ea29d3bda2254ad3908e279b7effbbac6a97cb
2015-04-20 18:03:56 +00:00
AST_CHECK_RAII()
AST_CHECK_STRSEP_ARRAY_BOUNDS()
2018-07-16 20:08:20 +00:00
JANSSON_BUNDLED=no
AC_ARG_WITH([jansson-bundled],
[AS_HELP_STRING([--with-jansson-bundled],
[Use bundled jansson library])],
[case "${withval}" in
y|yes) JANSSON_BUNDLED=yes ;;
*) JANSSON_BUNDLED=no ;;
esac])
2017-08-08 18:33:50 +00:00
PJPROJECT_BUNDLED=yes
2016-10-03 16:30:43 +00:00
AH_TEMPLATE(m4_bpatsubst([[HAVE_PJPROJECT_BUNDLED]], [(.*)]), [Define to 1 when using the bundled pjproject.])
AC_ARG_WITH([pjproject-bundled],
[AS_HELP_STRING([--with-pjproject-bundled],
2017-08-08 18:33:50 +00:00
[Use bundled pjproject libraries (default)])],
2016-12-16 07:32:57 +00:00
[case "${withval}" in
2016-10-03 16:30:43 +00:00
n|no) PJPROJECT_BUNDLED=no ;;
*) PJPROJECT_BUNDLED=yes ;;
esac])
THIRD_PARTY_CONFIGURE()
2007-12-19 08:57:45 +00:00
# AST_EXT_LIB_SETUP is used to tell configure to handle variables for
# various packages.
# $1 is the prefix for the variables in makeopts and autoconfig.h
# $2 is the short comment, $4 is the long comment
# $3 is the name used in --with- or --without- flags for configure.
#
# Package option names should be in alphabetical order
2007-11-21 00:22:41 +00:00
# by the --with option name (the third field),
# to make things easier for the users.
2006-06-24 19:43:31 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
2010-12-18 00:08:13 +00:00
AST_EXT_LIB_SETUP([BFD], [Debug symbol decoding], [bfd])
# BKTR is used for backtrace support on platforms that do not
# have it natively.
AST_EXT_LIB_SETUP([BKTR], [Stack Backtrace], [execinfo])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth])
2006-09-27 21:48:01 +00:00
AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
2016-07-19 18:14:21 +00:00
AST_EXT_LIB_SETUP([CODEC2], [Codec 2 Audio Decoder/Encoder], [codec2])
2012-02-05 10:58:37 +00:00
AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
2012-04-28 01:20:57 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
2013-07-03 16:32:00 +00:00
AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
2012-09-20 18:27:28 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_SRTP], [OpenSSL SRTP Extension Support], [CRYPTO], [crypto])
2019-06-11 12:26:42 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_BIO_METHOD], [OpenSSL BIO Method Support], [CRYPTO], [crypto])
2008-06-12 17:27:55 +00:00
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
2010-12-18 00:08:13 +00:00
AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise])
2012-07-23 21:27:56 +00:00
AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2])
AST_EXT_LIB_SETUP([GMIME], [GMime], [gmime])
2008-08-03 16:14:14 +00:00
AST_EXT_LIB_SETUP([HOARD], [Hoard Memory Allocator], [hoard])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([ICAL], [iCal], [ical])
AST_EXT_LIB_SETUP([ICONV], [Iconv], [iconv])
AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber], [iksemel])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
2009-02-25 19:24:44 +00:00
AST_EXT_LIB_SETUP([INOTIFY], [inotify support], [inotify])
2008-10-06 23:14:33 +00:00
AST_EXT_LIB_SETUP([IODBC], [iODBC], [iodbc])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([ISDNNET], [ISDN4Linux], [isdnnet])
2008-01-13 18:08:50 +00:00
AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack])
2013-01-11 22:31:42 +00:00
AST_EXT_LIB_SETUP([JANSSON], [Jansson JSON library], [jansson])
2013-08-23 21:49:47 +00:00
AST_EXT_LIB_SETUP([URIPARSER], [uriparser library], [uriparser])
2010-05-13 05:37:31 +00:00
AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue])
2008-01-22 22:33:20 +00:00
AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap])
2010-06-04 01:20:17 +00:00
AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
2018-02-12 07:26:56 +00:00
AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit])
2016-11-14 18:16:03 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit])
2008-11-01 21:10:07 +00:00
AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
2013-08-01 17:07:52 +00:00
AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
2013-10-03 18:00:15 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
2007-11-02 15:36:34 +00:00
AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([MISDN], [mISDN user], [misdn])
AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([NBS], [Network Broadcast Sound], [nbs])
2009-05-28 19:57:18 +00:00
AST_EXT_LIB_SETUP([NEON], [neon], [neon])
2010-05-26 05:33:11 +00:00
AST_EXT_LIB_SETUP([NEON29], [neon29], [neon29])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
2010-06-04 01:20:17 +00:00
AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
2014-10-27 17:55:43 +00:00
AST_EXT_LIB_SETUP([OPUS], [Opus], [opus])
2017-11-06 09:21:12 +00:00
AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
AST_EXT_LIB_SETUP([OSS], [Open Sound System], [oss])
AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
2017-10-16 21:46:02 +00:00
AST_EXT_LIB_SETUP([BEANSTALK], [Beanstalk Job Queue], [beanstalk])
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
2016-10-03 16:30:43 +00:00
if test "x${PBX_PJPROJECT}" != "x1" ; then
2013-03-12 19:08:59 +00:00
AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
2016-02-10 22:16:46 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [PJSIP Dialog Create UAS with Incremented Lock], [PJPROJECT], [pjsip])
2013-11-26 22:34:08 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [PJPROJECT], [pjsip])
2013-12-03 18:01:36 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_REPLACE_MEDIA_STREAM], [PJSIP Media Stream Replacement Support], [PJPROJECT], [pjsip])
2015-01-13 12:09:45 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_GET_DEST_INFO], [pjsip_get_dest_info support], [PJPROJECT], [pjsip])
2015-01-16 21:46:09 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj_ssl_cert_load_from_files2 support], [PJPROJECT], [pjsip])
2015-04-13 13:47:01 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EXTERNAL_RESOLVER], [PJSIP External Resolver Support], [PJPROJECT], [pjsip])
2016-03-14 13:59:10 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_PROTO], [PJSIP TLS Transport proto field support], [PJPROJECT], [pjsip])
2016-06-12 16:19:27 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EVSUB_GRP_LOCK], [PJSIP EVSUB Group Lock support], [PJPROJECT], [pjsip])
2016-08-18 19:45:59 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_SESSION_REF], [PJSIP INVITE Session Reference Count support], [PJPROJECT], [pjsip])
2016-11-14 20:36:52 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_AUTH_CLT_DEINIT], [pjsip_auth_clt_deinit support], [PJPROJECT], [pjsip])
2017-04-04 21:20:22 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip_tsx_layer_find_tsx2 support], [PJPROJECT], [pjsip])
2018-06-19 02:22:17 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [PJSIP INVITE Accept Multiple SDP Answers], [PJPROJECT], [pjsip])
2018-09-17 16:38:19 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_ENDPOINT_COMPACT_FORM], [PJSIP Compact Form Support on Endpoint], [PJPROJECT], [pjsip])
2018-07-18 12:45:26 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [PJSIP Transport Connection Reuse Disabling], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_OAUTH_AUTHENTICATION], [PJSIP OAuth Authentication Support], [PJPROJECT], [pjsip])
2016-10-03 16:30:43 +00:00
fi
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
AST_EXT_LIB_SETUP([POPT], [popt], [popt])
2007-12-31 15:20:30 +00:00
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
2014-05-13 00:35:31 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_ACK_INBAND], [ISDN PRI progress inband ie in SETUP ACK], [PRI], [pri])
2011-10-06 23:06:43 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([PRI_L2_PERSISTENCE], [ISDN Layer 2 persistence option], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_DATETIME_SEND], [ISDN PRI Date/time ie send policy], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI_V2], [ISDN PRI Message Waiting Indication (Fixed)], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_DISPLAY_TEXT], [ISDN PRI user display text IE contents during call], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_MWI], [ISDN PRI Message Waiting Indication], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_MCID], [ISDN PRI Malicious Call ID], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_WAITING], [ISDN PRI call waiting supplementary service], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_AOC_EVENTS], [ISDN PRI advice of charge supplementary service events], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_TRANSFER], [ISDN PRI call transfer supplementary service], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CCSS], [ISDN PRI call completion supplementary service], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_HANGUP_FIX], [ISDN PRI hangup fix], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SUBADDR], [ISDN PRI subaddressing], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_HOLD], [ISDN PRI call hold], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_CALL_REROUTING], [ISDN PRI call rerouting and call deflection], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_KEYPAD], [ISDN PRI keypad facility in SETUP], [PRI], [pri])
# ------------------------------------v
# TODO: The code can be changed to always include these features now.
# These features will always be present if pri_connected_line_update is available.
AST_EXT_LIB_SETUP_OPTIONAL([PRI_INBANDDISCONNECT], [ISDN PRI set_inbanddisconnect], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_PROG_W_CAUSE], [ISDN progress with cause], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SERVICE_MESSAGES], [ISDN service messages], [PRI], [pri])
AST_EXT_LIB_SETUP_OPTIONAL([PRI_REVERSE_CHARGE], [ISDN reverse charge], [PRI], [pri])
# ------------------------------------^
2008-03-18 00:28:39 +00:00
AST_EXT_LIB_SETUP([RADIUS], [Radius Client], [radius])
2016-08-12 16:22:40 +00:00
AST_EXT_LIB_SETUP([FFTW3], [LIBFFTW3], [fftw3])
2010-06-04 01:20:17 +00:00
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
2016-12-22 15:42:46 +00:00
AST_EXT_LIB_SETUP([SNDFILE], [libsndfile], [sndfile])
2008-03-17 17:31:46 +00:00
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
2010-06-04 01:20:17 +00:00
AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
2008-12-01 21:23:37 +00:00
AST_EXT_LIB_SETUP([SPEEX_PREPROCESS], [Speex preprocess routines], [speex])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([SPEEXDSP], [SpeexDSP], [speexdsp])
2009-08-27 17:28:01 +00:00
AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([SQLITE], [SQLite], [sqlite])
2007-03-13 21:22:33 +00:00
AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
2010-06-08 05:29:08 +00:00
AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp])
2016-07-13 10:24:46 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_256], [SRTP Library AES-256 (ICM)], [SRTP], [srtp])
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_192], [SRTP Library AES-192 (ICM)], [SRTP], [srtp])
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GCM], [SRTP Library AES-128 (GCM) and AES-256 (GCM)], [SRTP], [srtp])
2013-05-15 12:42:04 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])
2018-09-17 15:38:28 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GET_VERSION], [SRTP Library Version Function], [SRTP], [srtp])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])
2015-07-24 22:04:35 +00:00
AST_EXT_LIB_SETUP_OPTIONAL([RT], [Realtime functions], [rt])
2010-06-04 01:20:17 +00:00
AST_EXT_LIB_SETUP([SUPPSERV], [mISDN Supplemental Services], [suppserv])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
2010-06-04 01:20:17 +00:00
AST_EXT_LIB_SETUP([TIMERFD], [timerfd], [timerfd])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
2015-03-25 12:32:26 +00:00
AST_EXT_LIB_SETUP([UNBOUND], [unbound], [unbound])
2008-10-06 23:14:33 +00:00
AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [unixodbc])
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
2008-01-28 21:07:18 +00:00
AST_EXT_LIB_SETUP([VPB], [Voicetronix API], [vpb])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_SETUP([X11], [X11], [x11])
AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z])
2007-11-17 01:49:26 +00:00
2006-07-05 19:59:34 +00:00
# check for basic system features and functionality before
# checking for package libraries
2006-06-24 08:45:49 +00:00
2006-07-05 19:59:34 +00:00
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
2017-03-31 17:09:38 +00:00
if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then
AC_MSG_ERROR([*** Could not find dirent header that defines 'DIR'.])
fi
2006-07-05 19:59:34 +00:00
AC_HEADER_STDC
2017-03-31 17:09:38 +00:00
if test "$ac_cv_header_stdc" != "yes"; then
AC_MSG_ERROR([*** ANSI C header files not found.])
fi
2006-07-05 19:59:34 +00:00
AC_HEADER_SYS_WAIT
2017-03-31 17:09:38 +00:00
if test "$ac_cv_header_sys_wait_h" != "yes"; then
AC_MSG_ERROR([*** POSIX.1 compatible sys/wait.h is required.])
fi
2018-01-15 16:57:11 +00:00
AC_HEADER_RESOLV
if test "$ac_cv_header_resolv_h" != "yes"; then
AC_MSG_ERROR([*** resolv.h is required.])
fi
2017-03-31 17:09:38 +00:00
# Check for headers that are unconditionally required on all platforms. Do not use
# this to check for headers that are only needed by modules.
AC_CHECK_HEADERS([ \
arpa/nameser.h assert.h ctype.h dlfcn.h errno.h fcntl.h float.h grp.h \
2018-01-15 16:57:11 +00:00
inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \
2017-03-31 17:09:38 +00:00
sched.h stdarg.h stdint.h stdio.h stdlib.h string.h syslog.h \
sys/file.h sys/ioctl.h sys/param.h sys/resource.h sys/socket.h sys/stat.h \
sys/time.h sys/types.h sys/un.h \
termios.h time.h unistd.h \
], [], [
AC_MSG_ERROR([*** A required header was not found.])
])
AC_CHECK_HEADERS([arpa/inet.h libintl.h malloc.h netdb.h stddef.h strings.h sys/event.h utime.h])
2006-07-05 19:59:34 +00:00
2018-07-28 12:39:40 +00:00
PKG_PROG_PKG_CONFIG()
2018-03-22 10:43:18 +00:00
# Find required NetBSD Editline library (libedit).
AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)
# some platforms do not list libedit via pkg-config, for example OpenBSD 6.2
AST_EXT_LIB_CHECK([LIBEDIT], [edit], [history_init], [histedit.h], [-ltermcap])
if test "${PBX_LIBEDIT}" != 1; then
AC_MSG_ERROR(*** Please install the 'libedit' development package.)
exit 1
2011-09-13 18:56:45 +00:00
fi
2018-03-22 10:43:18 +00:00
AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])
2011-09-13 18:56:45 +00:00
2013-06-03 15:57:42 +00:00
# Find required UUID support.
# * -luuid on Linux
# * -le2fs-uuid on OpenBSD
# * in libsystem on OS X
BuildSystem: For consistency, avoid extra libs to be empty.
AST_EXT_LIB_CHECK has several optional parameters. When an optional parameter
is left empty, [] is used to indicate this. However, this is done in the script
./configure only then, when a further parameter is not empty. For example, when
no extra libraries are needed to test the checked library, parameter 5 is not
mentioned. Except parameter 6 and higher are used, then parameter 5 must be
empty.
However, this general rule was broken
* four times for parameter 5 (extra libs) and
* three times for parameter 4 (header)
as found via the Regular Expression \[\]\). In case of parameter 5, all cases
were changed, because that happened for no reason. In case of parameter 4, an
[] improves readability actually. Therefore for parameter 4, the only case which
did not do it was changed. All this aims to create more consistency: Only do
something different if there is a reason to do so.
Change-Id: I037ef170cf1ad94497151a9ea5071a31c656cafe
2018-03-20 16:53:19 +00:00
AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h])
2013-06-03 15:57:42 +00:00
if test "x$LIBUUID_LIB" != "x" ; then
UUID_INCLUDE="$LIBUUID_INCLUDE"
UUID_LIB="$LIBUUID_LIB"
else
BuildSystem: For consistency, avoid extra libs to be empty.
AST_EXT_LIB_CHECK has several optional parameters. When an optional parameter
is left empty, [] is used to indicate this. However, this is done in the script
./configure only then, when a further parameter is not empty. For example, when
no extra libraries are needed to test the checked library, parameter 5 is not
mentioned. Except parameter 6 and higher are used, then parameter 5 must be
empty.
However, this general rule was broken
* four times for parameter 5 (extra libs) and
* three times for parameter 4 (header)
as found via the Regular Expression \[\]\). In case of parameter 5, all cases
were changed, because that happened for no reason. In case of parameter 4, an
[] improves readability actually. Therefore for parameter 4, the only case which
did not do it was changed. All this aims to create more consistency: Only do
something different if there is a reason to do so.
Change-Id: I037ef170cf1ad94497151a9ea5071a31c656cafe
2018-03-20 16:53:19 +00:00
AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h])
2018-03-08 15:04:29 +00:00
if test "x$E2FSUUID_LIB" != "x" ; then
UUID_INCLUDE="$E2FSUUID_INCLUDE"
UUID_LIB="$E2FSUUID_LIB"
else
AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
if test "x$SYSUUID" != "x" ; then
UUID_INCLUDE=""
UUID_LIB=""
else
AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
fi
fi
2012-12-13 16:43:40 +00:00
fi
2013-06-03 15:57:42 +00:00
AC_SUBST(UUID_INCLUDE)
AC_SUBST(UUID_LIB)
2018-07-16 20:08:20 +00:00
# Find required JSON support if bundled is not enabled.
if test "$JANSSON_BUNDLED" = "no" ; then
2018-07-28 12:39:40 +00:00
AST_PKG_CONFIG_CHECK([JANSSON], [jansson >= 2.11])
2018-07-16 20:08:20 +00:00
# json_sprintf is available in 2.11+
AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_sprintf], [jansson.h])
2012-12-13 16:43:40 +00:00
2018-07-16 20:08:20 +00:00
if test "${PBX_JANSSON}" != 1; then
AC_MSG_NOTICE(*** Asterisk requires libjansson >= 2.11 and no system copy was found.)
AC_MSG_NOTICE(*** Please install the 'libjansson' development package or)
AC_MSG_NOTICE(*** use './configure --with-jansson-bundled')
exit 1
fi
2018-09-17 20:35:05 +00:00
JANSSON_DEFINE_JSON_INT()
2018-07-16 20:08:20 +00:00
else
PBX_JANSSON=1
2013-03-22 14:06:46 +00:00
fi
2015-07-24 22:04:35 +00:00
# See if clock_gettime is in librt
BuildSystem: For consistency, avoid extra libs to be empty.
AST_EXT_LIB_CHECK has several optional parameters. When an optional parameter
is left empty, [] is used to indicate this. However, this is done in the script
./configure only then, when a further parameter is not empty. For example, when
no extra libraries are needed to test the checked library, parameter 5 is not
mentioned. Except parameter 6 and higher are used, then parameter 5 must be
empty.
However, this general rule was broken
* four times for parameter 5 (extra libs) and
* three times for parameter 4 (header)
as found via the Regular Expression \[\]\). In case of parameter 5, all cases
were changed, because that happened for no reason. In case of parameter 4, an
[] improves readability actually. Therefore for parameter 4, the only case which
did not do it was changed. All this aims to create more consistency: Only do
something different if there is a reason to do so.
Change-Id: I037ef170cf1ad94497151a9ea5071a31c656cafe
2018-03-20 16:53:19 +00:00
AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], [])
2015-07-24 22:04:35 +00:00
2014-07-17 19:31:05 +00:00
AST_EXT_TOOL_CHECK([LIBXML2], [xml2-config], , ,
[#include <libxml/tree.h>
#include <libxml/parser.h>],
[LIBXML_TEST_VERSION])
if test "${PBX_LIBXML2}" != 1; then
AC_MSG_NOTICE(*** The Asterisk menuselect tool requires the 'libxml2' development package.)
AC_MSG_NOTICE(*** Please install the 'libxml2' development package.)
2014-07-17 19:02:22 +00:00
exit 1
fi
2013-08-23 21:49:47 +00:00
AST_EXT_LIB_CHECK([URIPARSER], [uriparser], [uriParseUriA], [uriparser/Uri.h])
2011-09-13 18:56:45 +00:00
# Another mandatory item (unless it's explicitly disabled)
AC_ARG_ENABLE([xmldoc],
[AS_HELP_STRING([--disable-xmldoc],
2012-01-30 21:21:16 +00:00
[Explicitly disable XML documentation])],
2011-09-13 18:56:45 +00:00
[case "${enableval}" in
2017-03-30 14:51:14 +00:00
y|ye|yes) DISABLE_XMLDOC=no ;;
n|no) DISABLE_XMLDOC=yes ;;
2011-09-13 18:56:45 +00:00
*) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc) ;;
2017-03-30 14:51:14 +00:00
esac], [DISABLE_XMLDOC=no])
2011-09-13 18:56:45 +00:00
2017-03-30 14:51:14 +00:00
AC_SUBST([DISABLE_XMLDOC])
if test "${DISABLE_XMLDOC}" != "yes"; then
AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.])
2013-08-01 17:07:52 +00:00
AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
2013-10-03 18:00:15 +00:00
AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
2013-08-01 17:07:52 +00:00
2011-09-13 18:56:45 +00:00
fi
2019-04-02 20:49:52 +00:00
AC_ARG_ENABLE([permanent-dlopen],
[AS_HELP_STRING([--enable-permanent-dlopen],
[Enable when your libc has a permanent dlopen like musl])],
[case "${enableval}" in
y|ye|yes) PERMANENT_DLOPEN=yes ;;
n|no) PERMANENT_DLOPEN=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-permanent-dlopen) ;;
esac], [PERMANENT_DLOPEN=no])
AC_SUBST([PERMANENT_DLOPEN])
if test "${PERMANENT_DLOPEN}" == "yes"; then
AC_DEFINE([HAVE_PERMANENT_DLOPEN], 1, [Define to support libc with permanent dlopen.])
fi
2010-07-26 16:44:25 +00:00
# some embedded systems omit internationalization (locale) support
AC_CHECK_HEADERS([xlocale.h])
2007-11-17 04:17:53 +00:00
AC_CHECK_HEADERS([winsock.h winsock2.h])
Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines
Fix cases where the internal poll() was not being used when it needed to be.
We have seen a number of problems caused by poll() not working properly on
Mac OSX. If you search around, you'll find a number of references to using
select() instead of poll() to work around these issues. In Asterisk, we've
had poll.c which implements poll() using select() internally. However, we
were still getting reports of problems.
vadim investigated a bit and realized that at least on his system, even
though we were compiling in poll.o, the system poll() was still being used.
So, the primary purpose of this patch is to ensure that we're using the
internal poll() when we want it to be used.
The changes are:
1) Remove logic for when internal poll should be used from the Makefile.
Instead, put it in the configure script. The logic in the configure
script is the same as it was in the Makefile. Ideally, we would have
a functionality test for the problem, but that's not actually possible,
since we would have to be able to run an application on the _target_
system to test poll() behavior.
2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
is not defined.
3) Change uses of poll() throughout the source tree to ast_poll(). I feel
that it is good practice to give the API call a new name when we are
changing its behavior and not using the system version directly in all cases.
So, normally, ast_poll() is just redefined to poll(). On systems where
AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().
4) Change poll() in main/poll.c to be ast_internal_poll().
It's worth noting that any code that still uses poll() directly will work fine
(if they worked fine before). So, for example, out of tree modules that are
using poll() will not stop working or anything. However, for modules to work
properly on Mac OSX, ast_poll() needs to be used.
(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim
http://reviewboard.digium.com/r/198/
........
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
AC_CHECK_HEADER([sys/poll.h],
[],
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
2006-07-05 19:59:34 +00:00
AC_SYS_LARGEFILE
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
2009-09-16 23:15:43 +00:00
AC_TYPE_LONG_DOUBLE_WIDER
2006-07-05 19:59:34 +00:00
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
2012-01-13 21:42:12 +00:00
AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
#include <sys/socket.h> ])
2010-12-10 16:28:14 +00:00
AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
2006-07-05 19:59:34 +00:00
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
2014-03-05 16:58:21 +00:00
stat_nsec_found=no
AC_CHECK_MEMBERS([struct stat.st_mtim, struct stat.st_mtimensec, struct stat.st_mtimespec], [stat_nsec_found=yes], [], [[#include <sys/stat.h>]])
if test "${stat_nsec_found}" != yes; then
AC_MSG_WARN(Cannot determine nanosecond field of struct stat)
fi
2006-07-05 19:59:34 +00:00
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
2006-08-21 20:12:18 +00:00
AST_FUNC_FORK
2006-07-05 19:59:34 +00:00
AC_FUNC_FSEEKO
AC_PROG_GCC_TRADITIONAL
2006-08-21 02:11:39 +00:00
# XXX: these are commented out until we determine whether it matters if our malloc()
# acts exactly like glibc's or not
# AC_FUNC_MALLOC
# AC_FUNC_REALLOC
2006-07-05 19:59:34 +00:00
AC_FUNC_MEMCMP
AC_FUNC_MMAP
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_STAT
AC_FUNC_STRCOLL
AC_FUNC_STRFTIME
AC_FUNC_STRNLEN
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
2018-12-07 12:57:48 +00:00
AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale pipe2 ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl malloc_trim])
2015-01-26 14:50:40 +00:00
AC_MSG_CHECKING(for htonll)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <arpa/inet.h>],
[return htonll(0);])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HTONLL, 1, [Define to 1 if arpa/inet.h includes a htonll definition.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for ntohll)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <arpa/inet.h>],
[return ntohll(0);])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_NTOHLL, 1, [Define to 1 if arpa/inet.h includes a ntohll definition.]),
AC_MSG_RESULT(no)
)
2006-07-05 19:59:34 +00:00
2009-09-16 23:15:43 +00:00
# NOTE: we use AC_CHECK_LIB to get -lm into the arguments for later checks,
# so that AC_CHECK_FUNCS can detect functions in that library.
2009-08-27 17:28:01 +00:00
AC_CHECK_LIB([m], [sqrt])
2009-09-16 23:15:43 +00:00
# BSD might not have exp2, and/or log2
2013-01-19 20:54:07 +00:00
AC_CHECK_FUNCS([exp2 log2 exp10 log10 sin cos tan asin acos atan atan2 pow rint exp log remainder fmod round roundf trunc floor ceil])
2009-09-16 23:15:43 +00:00
# Certain architectures don't really have long double, even though
# AC_CHECK_FUNCS would otherwise find the following functions.
if test "x${ac_cv_type_long_double_wider}" = "xyes" ; then
AC_CHECK_FUNCS([exp2l log2l exp10l log10l sinl cosl tanl asinl acosl atanl atan2l powl sqrtl rintl expl logl remainderl fmodl roundl truncl floorl ceill])
fi
2007-11-18 16:43:08 +00:00
2010-07-15 19:46:57 +00:00
AC_MSG_CHECKING(for LLONG_MAX in limits.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <limits.h>],
[long long foo = LLONG_MAX])],
2010-07-15 19:46:57 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_LLONG_MAX], 1, [Define to 1 if limits.h includes a LLONG_MAX definition.]),
AC_MSG_RESULT(no)
)
2007-11-18 16:43:08 +00:00
AC_MSG_CHECKING(for timersub in time.h)
2007-11-17 09:30:22 +00:00
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <sys/time.h>],
[struct timeval *a; timersub(a, a, a);])],
2007-11-17 09:30:22 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]),
AC_MSG_RESULT(no)
)
2010-07-16 04:45:33 +00:00
AC_MSG_CHECKING(for a version of GNU ld that supports the --dynamic-list flag)
old_LDFLAGS=${LDFLAGS}
2010-07-16 05:38:06 +00:00
cat >conftest.dynamics <<_ACEOF
{
*ast_*;
};
_ACEOF
LDFLAGS="${LDFLAGS} -Wl,--dynamic-list,conftest.dynamics"
2010-07-16 04:45:33 +00:00
PBX_DYNAMIC_LIST=0
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([], [])],
2010-07-16 04:45:33 +00:00
PBX_DYNAMIC_LIST=1
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
AC_SUBST(PBX_DYNAMIC_LIST)
LDFLAGS=${old_LDFLAGS}
2010-07-16 05:38:06 +00:00
rm -f conftest.dynamics
2010-07-16 04:45:33 +00:00
2012-01-30 21:21:16 +00:00
AC_CHECK_HEADER([sys/poll.h],
2007-11-17 06:33:07 +00:00
[HAS_POLL=1]
AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
)
2008-07-28 19:53:56 +00:00
2008-10-06 17:32:02 +00:00
AC_ARG_ENABLE([internal-poll],
[AS_HELP_STRING([--enable-internal-poll],
[Use Asterisk's poll implementation])],
2008-07-28 19:53:56 +00:00
[case "${enableval}" in
y|ye|yes) HAS_POLL="";;
n|no) HAS_POLL="${HAS_POLL}" ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-internal-poll) ;;
esac])
2007-11-17 02:57:40 +00:00
AC_SUBST(HAS_POLL)
2007-11-17 00:31:32 +00:00
2012-01-30 21:21:16 +00:00
AC_ARG_ENABLE([asteriskssl],
[AS_HELP_STRING([--disable-asteriskssl],
[Disable Asterisk's SSL wrapper library])],
[case "${enableval}" in
y|ye|yes) AST_ASTERISKSSL=yes ;;
n|no) AST_ASTERISKSSL=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-asteriskssl) ;;
esac], [AST_ASTERISKSSL=yes])
AC_SUBST(AST_ASTERISKSSL)
2008-07-28 19:53:56 +00:00
2007-11-17 14:11:53 +00:00
AC_CHECK_FUNCS([inet_aton])
2007-11-06 15:01:56 +00:00
# check if we have IP_PKTINFO constant defined
2007-11-18 16:43:08 +00:00
AC_MSG_CHECKING(for IP_PKTINFO)
2007-11-06 15:01:56 +00:00
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <netinet/in.h>],
[int pi = IP_PKTINFO;])],
2007-11-06 15:01:56 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PKTINFO], 1, [Define to 1 if your system defines IP_PKTINFO.]),
AC_MSG_RESULT(no)
)
2006-10-22 19:09:25 +00:00
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
2007-08-01 17:47:05 +00:00
AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
2007-08-01 17:27:09 +00:00
AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <stdlib.h>
2007-08-06 14:20:04 +00:00
#include <netdb.h>],
2012-01-14 16:43:12 +00:00
[struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
2007-08-01 17:27:09 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GETHOSTBYNAME_R_6], 1, [Define to 1 if your system has gethostbyname_r with 6 arguments.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for gethostbyname_r with 5 arguments)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <stdlib.h>
2007-08-06 14:20:04 +00:00
#include <netdb.h>],
2012-01-14 16:43:12 +00:00
[struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
2007-08-01 17:27:09 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_GETHOSTBYNAME_R_5], 1, [Define to 1 if your system has gethostbyname_r with 5 arguments.]),
AC_MSG_RESULT(no)
)
2006-10-22 19:09:25 +00:00
2007-07-23 13:46:57 +00:00
AC_CHECK_HEADER([byteswap.h], [AC_DEFINE_UNQUOTED([HAVE_BYTESWAP_H], 1, [Define to 1 if byteswap.h macros are available.])])
AC_MSG_CHECKING(for __swap16 variant of <sys/endian.h> byteswapping macros)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);])],
2007-07-23 13:46:57 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SYS_ENDIAN_SWAP16], 1, [Define to 1 if your sys/endian.h header file provides the __swap16 macro.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for bswap16 variant of <sys/endian.h> byteswapping macros)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);])],
2007-07-23 13:46:57 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SYS_ENDIAN_BSWAP16], 1, [Define to 1 if your sys/endian.h header file provides the bswap16 macro.]),
AC_MSG_RESULT(no)
)
2010-06-08 22:45:16 +00:00
AC_MSG_CHECKING(for locale_t in locale.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <locale.h>], [locale_t lt = NULL])],
2010-06-08 22:45:16 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_LOCALE_T_IN_LOCALE_H], 1, [Define to 1 if your system defines the locale_t type in locale.h]),
AC_MSG_RESULT(no)
AC_MSG_CHECKING(for locale_t in xlocale.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <xlocale.h>], [locale_t lt = NULL])],
2010-06-08 22:45:16 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_LOCALE_T_IN_XLOCALE_H], 1, [Define to 1 if your system defines the locale_t type in xlocale.h]),
AC_MSG_RESULT(no)
)
)
2010-05-13 05:37:31 +00:00
AC_MSG_CHECKING(for O_EVTONLY in fcntl.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_EVTONLY;])],
2010-05-13 05:37:31 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_O_EVTONLY], 1, [Define to 1 if your system defines the file flag O_EVTONLY in fcntl.h]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for O_SYMLINK in fcntl.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <fcntl.h>], [int a = O_SYMLINK;])],
2010-05-13 05:37:31 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_O_SYMLINK], 1, [Define to 1 if your system defines the file flag O_SYMLINK in fcntl.h]),
AC_MSG_RESULT(no)
)
2006-11-02 16:28:13 +00:00
AST_C_DEFINE_CHECK([PTHREAD_RWLOCK_INITIALIZER], [PTHREAD_RWLOCK_INITIALIZER], [pthread.h])
2008-01-02 22:40:55 +00:00
AC_MSG_CHECKING(for PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_RWLOCK_PREFER_WRITER_NP;])],
2008-01-02 22:40:55 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP], 1, [Define to 1 if your system defines PTHREAD_RWLOCK_PREFER_WRITER_NP in pthread.h]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for PTHREAD_MUTEX_RECURSIVE_NP in pthread.h)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_RECURSIVE_NP;])],
2008-01-02 22:40:55 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_RECURSIVE_NP in pthread.h]),
AC_MSG_RESULT(no)
)
2014-04-23 20:13:30 +00:00
AC_MSG_CHECKING(for PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <pthread.h>], [int a = PTHREAD_MUTEX_ADAPTIVE_NP;])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_MUTEX_ADAPTIVE_NP], 1, [Define to 1 if your system defines PTHREAD_MUTEX_ADAPTIVE_NP in pthread.h]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for pthread_spinlock_t in pthread.h)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <pthread.h>], [pthread_spinlock_t spin;])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PTHREAD_SPINLOCK], 1, [Define to 1 if your system has pthread_spinlock_t in pthread.h]),
AC_MSG_RESULT(no)
)
2010-05-07 20:35:17 +00:00
save_LIBS="$LIBS"
save_CFLAGS="$CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
Multiple revisions 399887,400138,400178,400180-400181
........
r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
Minor performance bump by not allocate manager variable struct if we don't need it
........
r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
Stasis performance improvements
This patch addresses several performance problems that were found in
the initial performance testing of Asterisk 12.
The Stasis dispatch object was allocated as an AO2 object, even though
it has a very confined lifecycle. This was replaced with a straight
ast_malloc().
The Stasis message router was spending an inordinate amount of time
searching hash tables. In this case, most of our routers had 6 or
fewer routes in them to begin with. This was replaced with an array
that's searched linearly for the route.
We more heavily rely on AO2 objects in Asterisk 12, and the memset()
in ao2_ref() actually became noticeable on the profile. This was
#ifdef'ed to only run when AO2_DEBUG was enabled.
After being misled by an erroneous comment in taskprocessor.c during
profiling, the wrong comment was removed.
Review: https://reviewboard.asterisk.org/r/2873/
........
r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
Taskprocessor optimization; switch Stasis to use taskprocessors
This patch optimizes taskprocessor to use a semaphore for signaling,
which the OS can do a better job at managing contention and waiting
that we can with a mutex and condition.
The taskprocessor execution was also slightly optimized to reduce the
number of locks taken.
The only observable difference in the taskprocessor implementation is
that when the final reference to the taskprocessor goes away, it will
execute all tasks to completion instead of discarding the unexecuted
tasks.
For systems where unnamed semaphores are not supported, a really
simple semaphore implementation is provided. (Which gives identical
performance as the original taskprocessor implementation).
The way we ended up implementing Stasis caused the threadpool to be a
burden instead of a boost to performance. This was switched to just
use taskprocessors directly for subscriptions.
Review: https://reviewboard.asterisk.org/r/2881/
........
r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
Optimize how Stasis forwards are dispatched
This patch optimizes how forwards are dispatched in Stasis.
Originally, forwards were dispatched as subscriptions that are invoked
on the publishing thread. This did not account for the vast number of
forwards we would end up having in the system, and the amount of work it
would take to walk though the forward subscriptions.
This patch modifies Stasis so that rather than walking the tree of
forwards on every dispatch, when forwards and subscriptions are changed,
the subscriber list for every topic in the tree is changed.
This has a couple of benefits. First, this reduces the workload of
dispatching messages. It also reduces contention when dispatching to
different topics that happen to forward to the same aggregation topic
(as happens with all of the channel, bridge and endpoint topics).
Since forwards are no longer subscriptions, the bulk of this patch is
simply changing stasis_subscription objects to stasis_forward objects
(which, admittedly, I should have done in the first place.)
Since this required me to yet again put in a growing array, I finally
abstracted that out into a set of ast_vector macros in
asterisk/vector.h.
Review: https://reviewboard.asterisk.org/r/2883/
........
r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
Remove dispatch object allocation from Stasis publishing
While looking for areas for performance improvement, I realized that an
unused feature in Stasis was negatively impacting performance.
When a message is sent to a subscriber, a dispatch object is allocated
for the dispatch, containing the topic the message was published to, the
subscriber the message is being sent to, and the message itself.
The topic is actually unused by any subscriber in Asterisk today. And
the subscriber is associated with the taskprocessor the message is being
dispatched to.
First, this patch removes the unused topic parameter from Stasis
subscription callbacks.
Second, this patch introduces the concept of taskprocessor local data,
data that may be set on a taskprocessor and provided along with the data
pointer when a task is pushed using the ast_taskprocessor_push_local()
call. This allows the task to have both data specific to that
taskprocessor, in addition to data specific to that invocation.
With those two changes, the dispatch object can be removed completely,
and the message is simply refcounted and sent directly to the
taskprocessor.
Review: https://reviewboard.asterisk.org/r/2884/
........
Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
AC_MSG_CHECKING(for pthread_rwlock_timedwrlock() in pthread.h)
2009-04-22 21:38:15 +00:00
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pthread.h>
#include <time.h>],
[pthread_rwlock_t foo; struct timespec bar; pthread_rwlock_timedwrlock(&foo, &bar)])
],[
AC_MSG_RESULT(yes)
ac_cv_pthread_rwlock_timedwrlock="yes"
],[
AC_MSG_RESULT(no)
ac_cv_pthread_rwlock_timedwrlock="no"
]
)
Multiple revisions 399887,400138,400178,400180-400181
........
r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
Minor performance bump by not allocate manager variable struct if we don't need it
........
r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
Stasis performance improvements
This patch addresses several performance problems that were found in
the initial performance testing of Asterisk 12.
The Stasis dispatch object was allocated as an AO2 object, even though
it has a very confined lifecycle. This was replaced with a straight
ast_malloc().
The Stasis message router was spending an inordinate amount of time
searching hash tables. In this case, most of our routers had 6 or
fewer routes in them to begin with. This was replaced with an array
that's searched linearly for the route.
We more heavily rely on AO2 objects in Asterisk 12, and the memset()
in ao2_ref() actually became noticeable on the profile. This was
#ifdef'ed to only run when AO2_DEBUG was enabled.
After being misled by an erroneous comment in taskprocessor.c during
profiling, the wrong comment was removed.
Review: https://reviewboard.asterisk.org/r/2873/
........
r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
Taskprocessor optimization; switch Stasis to use taskprocessors
This patch optimizes taskprocessor to use a semaphore for signaling,
which the OS can do a better job at managing contention and waiting
that we can with a mutex and condition.
The taskprocessor execution was also slightly optimized to reduce the
number of locks taken.
The only observable difference in the taskprocessor implementation is
that when the final reference to the taskprocessor goes away, it will
execute all tasks to completion instead of discarding the unexecuted
tasks.
For systems where unnamed semaphores are not supported, a really
simple semaphore implementation is provided. (Which gives identical
performance as the original taskprocessor implementation).
The way we ended up implementing Stasis caused the threadpool to be a
burden instead of a boost to performance. This was switched to just
use taskprocessors directly for subscriptions.
Review: https://reviewboard.asterisk.org/r/2881/
........
r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
Optimize how Stasis forwards are dispatched
This patch optimizes how forwards are dispatched in Stasis.
Originally, forwards were dispatched as subscriptions that are invoked
on the publishing thread. This did not account for the vast number of
forwards we would end up having in the system, and the amount of work it
would take to walk though the forward subscriptions.
This patch modifies Stasis so that rather than walking the tree of
forwards on every dispatch, when forwards and subscriptions are changed,
the subscriber list for every topic in the tree is changed.
This has a couple of benefits. First, this reduces the workload of
dispatching messages. It also reduces contention when dispatching to
different topics that happen to forward to the same aggregation topic
(as happens with all of the channel, bridge and endpoint topics).
Since forwards are no longer subscriptions, the bulk of this patch is
simply changing stasis_subscription objects to stasis_forward objects
(which, admittedly, I should have done in the first place.)
Since this required me to yet again put in a growing array, I finally
abstracted that out into a set of ast_vector macros in
asterisk/vector.h.
Review: https://reviewboard.asterisk.org/r/2883/
........
r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
Remove dispatch object allocation from Stasis publishing
While looking for areas for performance improvement, I realized that an
unused feature in Stasis was negatively impacting performance.
When a message is sent to a subscriber, a dispatch object is allocated
for the dispatch, containing the topic the message was published to, the
subscriber the message is being sent to, and the message itself.
The topic is actually unused by any subscriber in Asterisk today. And
the subscriber is associated with the taskprocessor the message is being
dispatched to.
First, this patch removes the unused topic parameter from Stasis
subscription callbacks.
Second, this patch introduces the concept of taskprocessor local data,
data that may be set on a taskprocessor and provided along with the data
pointer when a task is pushed using the ast_taskprocessor_push_local()
call. This allows the task to have both data specific to that
taskprocessor, in addition to data specific to that invocation.
With those two changes, the dispatch object can be removed completely,
and the message is simply refcounted and sent directly to the
taskprocessor.
Review: https://reviewboard.asterisk.org/r/2884/
........
Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
# Some platforms define sem_init(), but only support sem_open(). joyous.
AC_MSG_CHECKING(for working unnamed semaphores)
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <semaphore.h>],
[sem_t sem; return sem_init(&sem, 0, 0);])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.]),
2015-01-15 02:19:49 +00:00
AC_MSG_RESULT(no),
AC_MSG_RESULT(cross-compile)
AC_MSG_NOTICE([WARNING: result yes guessed because of cross compilation])
AC_DEFINE([HAS_WORKING_SEMAPHORE], 1, [Define to 1 if anonymous semaphores work.])
Multiple revisions 399887,400138,400178,400180-400181
........
r399887 | dlee | 2013-09-26 10:41:47 -0500 (Thu, 26 Sep 2013) | 1 line
Minor performance bump by not allocate manager variable struct if we don't need it
........
r400138 | dlee | 2013-09-30 10:24:00 -0500 (Mon, 30 Sep 2013) | 23 lines
Stasis performance improvements
This patch addresses several performance problems that were found in
the initial performance testing of Asterisk 12.
The Stasis dispatch object was allocated as an AO2 object, even though
it has a very confined lifecycle. This was replaced with a straight
ast_malloc().
The Stasis message router was spending an inordinate amount of time
searching hash tables. In this case, most of our routers had 6 or
fewer routes in them to begin with. This was replaced with an array
that's searched linearly for the route.
We more heavily rely on AO2 objects in Asterisk 12, and the memset()
in ao2_ref() actually became noticeable on the profile. This was
#ifdef'ed to only run when AO2_DEBUG was enabled.
After being misled by an erroneous comment in taskprocessor.c during
profiling, the wrong comment was removed.
Review: https://reviewboard.asterisk.org/r/2873/
........
r400178 | dlee | 2013-09-30 13:26:27 -0500 (Mon, 30 Sep 2013) | 24 lines
Taskprocessor optimization; switch Stasis to use taskprocessors
This patch optimizes taskprocessor to use a semaphore for signaling,
which the OS can do a better job at managing contention and waiting
that we can with a mutex and condition.
The taskprocessor execution was also slightly optimized to reduce the
number of locks taken.
The only observable difference in the taskprocessor implementation is
that when the final reference to the taskprocessor goes away, it will
execute all tasks to completion instead of discarding the unexecuted
tasks.
For systems where unnamed semaphores are not supported, a really
simple semaphore implementation is provided. (Which gives identical
performance as the original taskprocessor implementation).
The way we ended up implementing Stasis caused the threadpool to be a
burden instead of a boost to performance. This was switched to just
use taskprocessors directly for subscriptions.
Review: https://reviewboard.asterisk.org/r/2881/
........
r400180 | dlee | 2013-09-30 13:39:34 -0500 (Mon, 30 Sep 2013) | 28 lines
Optimize how Stasis forwards are dispatched
This patch optimizes how forwards are dispatched in Stasis.
Originally, forwards were dispatched as subscriptions that are invoked
on the publishing thread. This did not account for the vast number of
forwards we would end up having in the system, and the amount of work it
would take to walk though the forward subscriptions.
This patch modifies Stasis so that rather than walking the tree of
forwards on every dispatch, when forwards and subscriptions are changed,
the subscriber list for every topic in the tree is changed.
This has a couple of benefits. First, this reduces the workload of
dispatching messages. It also reduces contention when dispatching to
different topics that happen to forward to the same aggregation topic
(as happens with all of the channel, bridge and endpoint topics).
Since forwards are no longer subscriptions, the bulk of this patch is
simply changing stasis_subscription objects to stasis_forward objects
(which, admittedly, I should have done in the first place.)
Since this required me to yet again put in a growing array, I finally
abstracted that out into a set of ast_vector macros in
asterisk/vector.h.
Review: https://reviewboard.asterisk.org/r/2883/
........
r400181 | dlee | 2013-09-30 13:48:57 -0500 (Mon, 30 Sep 2013) | 28 lines
Remove dispatch object allocation from Stasis publishing
While looking for areas for performance improvement, I realized that an
unused feature in Stasis was negatively impacting performance.
When a message is sent to a subscriber, a dispatch object is allocated
for the dispatch, containing the topic the message was published to, the
subscriber the message is being sent to, and the message itself.
The topic is actually unused by any subscriber in Asterisk today. And
the subscriber is associated with the taskprocessor the message is being
dispatched to.
First, this patch removes the unused topic parameter from Stasis
subscription callbacks.
Second, this patch introduces the concept of taskprocessor local data,
data that may be set on a taskprocessor and provided along with the data
pointer when a task is pushed using the ast_taskprocessor_push_local()
call. This allows the task to have both data specific to that
taskprocessor, in addition to data specific to that invocation.
With those two changes, the dispatch object can be removed completely,
and the message is simply refcounted and sent directly to the
taskprocessor.
Review: https://reviewboard.asterisk.org/r/2884/
........
Merged revisions 399887,400138,400178,400180-400181 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-09-30 18:55:27 +00:00
)
2010-05-07 20:35:17 +00:00
LIBS="$save_LIBS"
CFLAGS="$save_CFLAGS"
2009-04-22 21:38:15 +00:00
if test "${ac_cv_pthread_rwlock_timedwrlock}" = "yes"; then
AC_DEFINE([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK], 1, [Define if your system has pthread_rwlock_timedwrlock()])
fi
2009-12-28 15:22:54 +00:00
AC_MSG_CHECKING(if PTHREAD_ONCE_INIT needs braces)
saved_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror -Wmissing-braces"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
2010-01-21 15:27:42 +00:00
[#include <pthread.h>
void empty(){}],
[pthread_once_t once = PTHREAD_ONCE_INIT; pthread_once(&once, empty);])
2009-12-28 15:22:54 +00:00
],[
AC_MSG_RESULT(no)
ac_cv_pthread_once_needsbraces="no"
],[
AC_MSG_RESULT(yes)
ac_cv_pthread_once_needsbraces="yes"
]
)
CFLAGS="${saved_CFLAGS}"
if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then
AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
fi
2007-11-17 23:03:16 +00:00
AST_C_DEFINE_CHECK([PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP], [pthread.h])
2006-11-02 16:28:13 +00:00
2010-04-06 19:28:42 +00:00
# Can we compare a mutex to its initial value?
# Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
2010-04-06 19:28:42 +00:00
if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
return 0;
}
2012-01-14 16:43:12 +00:00
return 0])],
2010-04-06 19:28:42 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if your system's implementation of mutexes supports comparison of a mutex to its initializer.]),
AC_MSG_RESULT(no)
)
2008-02-21 16:44:57 +00:00
#if test "${cross_compiling}" = "no";
#then
#AC_MSG_CHECKING(for working epoll support)
#AC_LINK_IFELSE(
#AC_LANG_PROGRAM([#include <sys/epoll.h>], [int res = epoll_create(10);
# if (res < 0)
# return 1;
# close (res);
# return 0;]),
#AC_MSG_RESULT(yes)
#AC_DEFINE([HAVE_EPOLL], 1, [Define to 1 if your system has working epoll support.]),
#AC_MSG_RESULT(no)
#)
#fi
2007-08-08 21:44:58 +00:00
2010-12-12 03:58:33 +00:00
# for FreeBSD thr_self
AC_CHECK_HEADERS([sys/thr.h])
2018-01-25 00:49:02 +00:00
AC_MSG_CHECKING(for compiler sync operations)
2006-07-05 19:59:34 +00:00
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([], [int foo1; int foo2 = __sync_fetch_and_add(&foo1, 1);])],
2006-07-05 19:59:34 +00:00
AC_MSG_RESULT(yes)
2018-01-25 07:37:32 +00:00
ax_cv_have_gcc_atomics=1
2018-01-25 00:49:02 +00:00
AC_DEFINE([HAVE_GCC_ATOMICS], 1, [Define to 1 if your GCC C compiler provides __sync atomic operations.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for compiler atomic operations)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([], [int foo1; int foo2 = __atomic_fetch_add(&foo1, 1, __ATOMIC_RELAXED);])],
AC_MSG_RESULT(yes)
2018-01-25 07:37:32 +00:00
ax_cv_have_c_atomics=1
2018-01-25 00:49:02 +00:00
AC_DEFINE([HAVE_C_ATOMICS], 1, [Define to 1 if your C compiler provides __atomic operations.]),
2006-07-05 19:59:34 +00:00
AC_MSG_RESULT(no)
)
2018-01-25 07:37:32 +00:00
if test -z $ax_cv_have_c_atomics$ax_cv_have_gcc_atomics; then
AC_MSG_ERROR([*** Atomic operations are not supported by your compiler.])
fi
2010-02-10 16:01:28 +00:00
# glibc, AFAIK, is the only C library that makes printing a NULL to a string safe.
AC_MSG_CHECKING([if your system printf is NULL-safe.])
AC_RUN_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <stdio.h>],
[printf("%s", NULL)])],
2010-02-10 16:01:28 +00:00
AC_DEFINE([HAVE_NULLSAFE_PRINTF], 1, [Define to 1 if your C library can safely print NULL to string formats.])
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no),
# It's unlikely an embedded system will have this.
AC_MSG_RESULT(unknown)
)
2018-12-07 12:57:48 +00:00
AC_MSG_CHECKING([if socket() accepts SOCK_NONBLOCK])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif
], [
if (socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, 0) < 0) {
return 1;
}
return 0;
])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SOCK_NONBLOCK], 1, [Define to 1 if your socket() implementation can accept SOCK_NONBLOCK.]),
AC_MSG_RESULT(no),
AC_MSG_RESULT(cross-compile)
)
2010-09-02 05:02:54 +00:00
AC_MSG_CHECKING(if we can increase the maximum select-able file descriptor)
AC_RUN_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([
2010-09-02 05:02:54 +00:00
#include <stdio.h>
#include <sys/select.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
], [[
struct rlimit rlim = { FD_SETSIZE * 2, FD_SETSIZE * 2 };
int fd0, fd1;
struct timeval tv = { 0, };
struct ast_fdset { long fds_bits[[1024]]; } fds = { { 0, } };
if (setrlimit(RLIMIT_NOFILE, &rlim)) { exit(1); }
if ((fd0 = open("/dev/null", O_RDONLY)) < 0) { exit(1); }
if (dup2(fd0, (fd1 = FD_SETSIZE + 1)) < 0) { exit(1); }
FD_SET(fd0, (fd_set *) &fds);
FD_SET(fd1, (fd_set *) &fds);
if (select(FD_SETSIZE + 2, (fd_set *) &fds, NULL, NULL, &tv) < 0) { exit(1); }
2012-01-14 16:43:12 +00:00
exit(0)]])],
2010-09-02 05:02:54 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_VARIABLE_FDSET], 1, [Define to 1 if your system can support larger than default select bitmasks.]),
AC_MSG_RESULT(no),
AC_MSG_RESULT(cross-compile)
)
if test "${ac_cv_have_variable_fdset}x" = "0x"; then
AC_RUN_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([
2010-09-02 05:02:54 +00:00
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
2012-01-14 16:43:12 +00:00
], [if (getuid() != 0) { exit(1); }])],
2010-09-02 05:02:54 +00:00
AC_DEFINE([CONFIGURE_RAN_AS_ROOT], 1, [Some configure tests will unexpectedly fail if configure is run by a non-root user. These may be able to be tested at runtime.]))
fi
2017-04-18 00:06:10 +00:00
AC_MSG_CHECKING([if we have usable eventfd support])
AC_RUN_IFELSE(
[AC_LANG_PROGRAM([#include <sys/eventfd.h>],
[return eventfd(0, EFD_NONBLOCK | EFD_SEMAPHORE) == -1;])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_EVENTFD], 1, [Define to 1 if your system supports eventfd and the EFD_NONBLOCK and EFD_SEMAPHORE flags.]),
2017-06-07 19:32:57 +00:00
AC_MSG_RESULT(no),
AC_MSG_RESULT(cross-compile)
2017-04-18 00:06:10 +00:00
)
2006-08-26 16:45:35 +00:00
AST_GCC_ATTRIBUTE(pure)
AST_GCC_ATTRIBUTE(malloc)
AST_GCC_ATTRIBUTE(const)
AST_GCC_ATTRIBUTE(unused)
AST_GCC_ATTRIBUTE(always_inline)
2007-07-16 18:36:02 +00:00
AST_GCC_ATTRIBUTE(deprecated)
2008-05-02 02:56:39 +00:00
AST_GCC_ATTRIBUTE(sentinel)
2008-06-19 17:55:34 +00:00
AST_GCC_ATTRIBUTE(warn_unused_result)
optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].
This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.
For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.
Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)
The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.
Other changes made as a part of this patch:
* The stubs for http_websocket that wrap system calls set errno to
ENOSYS.
* res_http_websocket now properly increments module use count.
* In loader.c, the while() wrappers around dlclose() were removed. The
while(!dlclose()) is actually an anti-pattern, which can lead to
infinite loops if the module you're attempting to unload exports a
symbol that was directly linked to.
* The special handling of nonoptreq on systems without weak symbol
support was removed, since we no longer rely on weak symbols for
optional_api.
[1]: https://wiki.asterisk.org/wiki/x/wACUAQ
(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........
Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:40:27 +00:00
AST_GCC_ATTRIBUTE(may_alias)
AST_GCC_ATTRIBUTE(constructor)
2017-10-31 03:09:17 +00:00
if test "$ax_cv_have_func_attribute_constructor" != "1"; then
AC_MSG_ERROR([*** Function constructor attribute is not supported by your compiler.])
fi
optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].
This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.
For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.
Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)
The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.
Other changes made as a part of this patch:
* The stubs for http_websocket that wrap system calls set errno to
ENOSYS.
* res_http_websocket now properly increments module use count.
* In loader.c, the while() wrappers around dlclose() were removed. The
while(!dlclose()) is actually an anti-pattern, which can lead to
infinite loops if the module you're attempting to unload exports a
symbol that was directly linked to.
* The special handling of nonoptreq on systems without weak symbol
support was removed, since we no longer rely on weak symbols for
optional_api.
[1]: https://wiki.asterisk.org/wiki/x/wACUAQ
(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........
Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:40:27 +00:00
AST_GCC_ATTRIBUTE(destructor)
2017-10-31 03:09:17 +00:00
if test "$ax_cv_have_func_attribute_destructor" != "1"; then
AC_MSG_ERROR([*** Function destructor attribute is not supported by your compiler.])
fi
2016-07-19 03:46:19 +00:00
AST_GCC_ATTRIBUTE(noreturn,noreturn)
2006-08-26 16:45:35 +00:00
2016-02-10 05:40:32 +00:00
AC_MSG_CHECKING(for -fsanitize=address support)
saved_sanitize_CFLAGS="${CFLAGS}"
saved_sanitize_LDFLAGS="${LDFLAGS}"
CFLAGS="-fsanitize=address -fno-omit-frame-pointer"
LDFLAGS="-fsanitize=address"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[AST_ADDRESS_SANITIZER=1],
2016-11-10 00:18:00 +00:00
[AST_ADDRESS_SANITIZER=0]
2016-02-10 05:40:32 +00:00
AC_MSG_RESULT(no)
)
CFLAGS="${saved_sanitize_CFLAGS}"
LDFLAGS="${saved_sanitize_LDFLAGS}"
AC_SUBST(AST_ADDRESS_SANITIZER)
AC_MSG_CHECKING(for -fsanitize=thread support)
saved_sanitize_CFLAGS="${CFLAGS}"
saved_sanitize_LDFLAGS="${LDFLAGS}"
CFLAGS="-fno-omit-frame-pointer -pie -fPIE -fsanitize=thread"
LDFLAGS="-fsanitize=thread -pie -fPIE"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[AST_THREAD_SANITIZER=1],
2016-11-10 00:18:00 +00:00
[AST_THREAD_SANITIZER=0]
2016-02-10 05:40:32 +00:00
AC_MSG_RESULT(no)
)
CFLAGS="${saved_sanitize_CFLAGS}"
LDFLAGS="${saved_sanitize_LDFLAGS}"
AC_SUBST(AST_THREAD_SANITIZER)
AC_MSG_CHECKING(for -fsanitize=leak support)
saved_sanitize_CFLAGS="${CFLAGS}"
saved_sanitize_LDFLAGS="${LDFLAGS}"
CFLAGS="-fno-omit-frame-pointer -fsanitize=leak"
LDFLAGS="-fsanitize=leak"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[AST_LEAK_SANITIZER=1],
2016-05-11 19:07:17 +00:00
[AST_LEAK_SANITIZER=0]
2016-02-10 05:40:32 +00:00
AC_MSG_RESULT(no)
)
CFLAGS="${saved_sanitize_CFLAGS}"
LDFLAGS="${saved_sanitize_LDFLAGS}"
AC_SUBST(AST_LEAK_SANITIZER)
AC_MSG_CHECKING(for -fsanitize=undefined support)
saved_sanitize_CFLAGS="${CFLAGS}"
saved_sanitize_LDFLAGS="${LDFLAGS}"
CFLAGS="-fno-omit-frame-pointer -fsanitize=undefined"
LDFLAGS="-fsanitize=undefined"
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[AST_UNDEFINED_SANITIZER=1],
2016-05-11 19:07:17 +00:00
[AST_UNDEFINED_SANITIZER=0]
2016-02-10 05:40:32 +00:00
AC_MSG_RESULT(no)
)
CFLAGS="${saved_sanitize_CFLAGS}"
LDFLAGS="${saved_sanitize_LDFLAGS}"
AC_SUBST(AST_UNDEFINED_SANITIZER)
2007-06-28 21:31:00 +00:00
AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
2018-01-06 21:40:46 +00:00
if $(${CC} -Wdeclaration-after-statement -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2007-06-28 21:31:00 +00:00
AC_MSG_RESULT(yes)
AST_DECLARATION_AFTER_STATEMENT=-Wdeclaration-after-statement
else
AC_MSG_RESULT(no)
AST_DECLARATION_AFTER_STATEMENT=
fi
AC_SUBST(AST_DECLARATION_AFTER_STATEMENT)
2012-06-01 16:33:25 +00:00
AC_MSG_CHECKING(for -Wtrampolines support)
2015-03-12 12:40:23 +00:00
if $(${CC} -Wtrampolines -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2012-06-01 16:33:25 +00:00
AC_MSG_RESULT(yes)
AST_TRAMPOLINES=-Wtrampolines
else
AC_MSG_RESULT(no)
AST_TRAMPOLINES=
fi
AC_SUBST(AST_TRAMPOLINES)
2008-11-29 17:57:39 +00:00
AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
2014-08-17 22:35:27 +00:00
if $(${CC} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2008-11-29 17:57:39 +00:00
AC_MSG_RESULT(yes)
2014-08-17 22:35:27 +00:00
AST_FORTIFY_SOURCE="-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2"
2008-11-29 17:57:39 +00:00
else
AC_MSG_RESULT(no)
AST_FORTIFY_SOURCE=
fi
AC_SUBST(AST_FORTIFY_SOURCE)
2008-03-11 14:09:49 +00:00
AC_MSG_CHECKING(for -fno-strict-overflow)
if $(${CC} -O2 -fno-strict-overflow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2008-08-08 18:19:33 +00:00
AC_MSG_RESULT(yes)
AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
2008-03-11 14:09:49 +00:00
else
AC_MSG_RESULT(no)
AST_NO_STRICT_OVERFLOW=
fi
AC_SUBST(AST_NO_STRICT_OVERFLOW)
2007-06-28 21:31:00 +00:00
2017-08-02 19:16:43 +00:00
AC_MSG_CHECKING(for -Wno-format-truncation)
2018-01-06 21:40:46 +00:00
if $(${CC} -Wno-format-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2017-08-02 19:16:43 +00:00
AC_MSG_RESULT(yes)
AST_NO_FORMAT_TRUNCATION=-Wno-format-truncation
else
AC_MSG_RESULT(no)
AST_NO_FORMAT_TRUNCATION=
fi
AC_SUBST(AST_NO_FORMAT_TRUNCATION)
2018-05-07 02:17:34 +00:00
AC_MSG_CHECKING(for -Wno-stringop-truncation)
if $(${CC} -Wno-stringop-truncation -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
AC_MSG_RESULT(yes)
AST_NO_STRINGOP_TRUNCATION=-Wno-stringop-truncation
else
AC_MSG_RESULT(no)
AST_NO_STRINGOP_TRUNCATION=
fi
AC_SUBST(AST_NO_STRINGOP_TRUNCATION)
2008-08-08 18:19:33 +00:00
AC_MSG_CHECKING(for -Wshadow)
2018-01-06 21:40:46 +00:00
if $(${CC} -Wshadow -Werror -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2008-08-08 18:19:33 +00:00
AC_MSG_RESULT(yes)
AST_SHADOW_WARNINGS=-Wshadow
else
AC_MSG_RESULT(no)
AST_SHADOW_WARNINGS=
fi
AC_SUBST(AST_SHADOW_WARNINGS)
2012-04-12 15:25:47 +00:00
AC_MSG_CHECKING(for -march=native support)
2011-03-11 15:09:23 +00:00
if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
2016-07-12 08:50:22 +00:00
AC_MSG_RESULT(yes)
AST_NATIVE_ARCH=1
2011-03-11 15:09:23 +00:00
else
AC_MSG_RESULT(no)
2016-07-12 08:50:22 +00:00
AST_NATIVE_ARCH=0
2011-03-11 15:09:23 +00:00
fi
2012-04-12 15:25:47 +00:00
AC_SUBST(AST_NATIVE_ARCH)
2011-03-11 15:09:23 +00:00
2012-09-18 15:50:35 +00:00
2013-01-18 21:35:09 +00:00
dnl Check to see if rpath should be set in LDFLAGS
AC_ARG_ENABLE(rpath,
2016-06-21 13:01:40 +00:00
[AS_HELP_STRING([--disable-rpath],
2013-01-18 21:35:09 +00:00
[Disables rpath linker option checking])],
[case "${enableval}" in
y|ye|yes) check_rpath=yes ;;
n|no) check_rpath=no ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-rpath) ;;
esac], [check_rpath=yes])
AC_MSG_CHECKING(whether to use rpath)
AST_RPATH=
2018-03-08 15:14:11 +00:00
if test "${OSARCH}" = "NetBSD"; then
AST_RPATH="-Wl,-rpath,/usr/pkg/lib"
fi
2013-01-18 21:35:09 +00:00
if test "${check_rpath}" != yes; then
AC_MSG_RESULT(skipped)
elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
AC_MSG_RESULT(not needed)
else
2013-01-18 22:42:38 +00:00
AST_RPATH="-Wl,-rpath,${libdir}"
2013-01-18 21:35:09 +00:00
fi
AC_SUBST(AST_RPATH)
2007-04-11 20:21:18 +00:00
AC_MSG_CHECKING(for sysinfo)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
[struct sysinfo sys_info; int uptime = sys_info.uptime])],
2007-04-11 20:21:18 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]),
AC_MSG_RESULT(no)
)
2008-05-09 16:36:58 +00:00
AC_SEARCH_LIBS(res_9_ninit, resolv)
2006-08-31 01:48:04 +00:00
AC_MSG_CHECKING(for res_ninit)
2006-08-21 02:11:39 +00:00
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([
2008-05-09 16:36:58 +00:00
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
#include <resolv.h>],
2012-01-14 16:43:12 +00:00
[int foo = res_ninit(NULL);])],
2006-08-21 02:11:39 +00:00
AC_MSG_RESULT(yes)
2007-07-10 18:41:03 +00:00
AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
2008-05-09 16:36:58 +00:00
AC_SEARCH_LIBS(res_9_ndestroy, resolv)
2007-07-10 18:41:03 +00:00
AC_MSG_CHECKING(for res_ndestroy)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([
2008-05-09 16:36:58 +00:00
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
#include <resolv.h>],
2012-01-14 16:43:12 +00:00
[res_ndestroy(NULL);])],
2007-07-10 18:41:03 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_RES_NDESTROY], 1, [Define to 1 if your system has the ndestroy resolver function.]),
AC_MSG_RESULT(no)
2009-07-08 16:43:12 +00:00
)
AC_SEARCH_LIBS(res_9_close, resolv)
AC_MSG_CHECKING(for res_close)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([
2009-07-08 16:43:12 +00:00
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
#include <arpa/nameser.h>
#endif
#include <resolv.h>],
2012-01-14 16:43:12 +00:00
[res_close();])],
2009-07-08 16:43:12 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_RES_CLOSE], 1, [Define to 1 if your system has the close resolver function.]),
AC_MSG_RESULT(no)
2007-07-10 18:41:03 +00:00
),
2006-08-21 02:11:39 +00:00
AC_MSG_RESULT(no)
)
2017-06-06 19:54:43 +00:00
AC_MSG_CHECKING(for BIND_8_COMPAT required)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[
#undef BIND_8_COMPAT
#include <arpa/nameser.h>
]],
[[int x = NXDOMAIN]])],
AC_MSG_RESULT(no),
AC_MSG_RESULT(yes)
[BIND8_CFLAGS=-DBIND_8_COMPAT])
AC_SUBST(BIND8_CFLAGS)
2009-04-21 14:28:04 +00:00
AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h])
AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h])
optional_api: Fix linking problems between modules that export global symbols
With the new work in Asterisk 12, there are some uses of the
optional_api that are prone to failure. The details are rather involved,
and captured on [the wiki][1].
This patch addresses the issue by removing almost all of the magic from
the optional API implementation. Instead of relying on weak symbol
resolution, a new optional_api.c module was added to Asterisk core.
For modules providing an optional API, the pointer to the implementation
function is registered with the core. For modules that use an optional
API, a pointer to a stub function, along with a optional_ref function
pointer are registered with the core. The optional_ref function pointers
is set to the implementation function when it's provided, or the stub
function when it's now.
Since the implementation no longer relies on magic, it is now supported
on all platforms. In the spirit of choice, an OPTIONAL_API flag was
added, so we can disable the optional_api if needed (maybe it's buggy on
some bizarre platform I haven't tested on)
The AST_OPTIONAL_API*() macros themselves remained unchanged, so
existing code could remain unchanged. But to help with debugging the
optional_api, the patch limits the #include of optional API's to just
the modules using the API. This also reduces resource waste maintaining
optional_ref pointers that aren't used.
Other changes made as a part of this patch:
* The stubs for http_websocket that wrap system calls set errno to
ENOSYS.
* res_http_websocket now properly increments module use count.
* In loader.c, the while() wrappers around dlclose() were removed. The
while(!dlclose()) is actually an anti-pattern, which can lead to
infinite loops if the module you're attempting to unload exports a
symbol that was directly linked to.
* The special handling of nonoptreq on systems without weak symbol
support was removed, since we no longer rely on weak symbols for
optional_api.
[1]: https://wiki.asterisk.org/wiki/x/wACUAQ
(closes issue ASTERISK-22296)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/2797/
........
Merged revisions 397989 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-30 13:40:27 +00:00
AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
2006-10-13 15:47:42 +00:00
AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
2010-03-17 00:14:29 +00:00
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([char *])
2010-09-10 01:27:44 +00:00
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_COMPUTE_INT([ac_cv_sizeof_fd_set_fds_bits], [sizeof(foo.fds_bits[[0]])], [$ac_includes_default
fd_set foo;])
# This doesn't actually work; what it does is to use the variable set in the
# previous test as a cached value to set the right output variables.
AC_CHECK_SIZEOF(fd_set.fds_bits)
# Set a type compatible with the previous. We cannot just use a generic type
# for these bits, because on big-endian systems, the bits won't match up
# correctly if the size is wrong.
if test $ac_cv_sizeof_int = $ac_cv_sizeof_fd_set_fds_bits; then
AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [int], [Define to a type of the same size as fd_set.fds_bits[[0]]])
2018-04-03 19:39:39 +00:00
elif test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then
2010-09-10 01:27:44 +00:00
AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
2018-04-03 19:39:39 +00:00
elif test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then
2010-09-10 01:27:44 +00:00
AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
2018-04-03 19:39:39 +00:00
fi
2010-09-10 01:27:44 +00:00
2010-12-18 00:08:13 +00:00
AC_MSG_CHECKING(for dladdr in dlfcn.h)
PBX_DLADDR=0
old_LIBS=${LIBS}
LIBS="${LIBS} -ldl"
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM([#define _GNU_SOURCE 1
2010-12-18 00:08:13 +00:00
#include <dlfcn.h>],
[dladdr((void *)0, (void *)0)]
2012-01-14 16:43:12 +00:00
)],
2010-12-18 00:08:13 +00:00
AC_MSG_RESULT(yes)
PBX_DLADDR=1
AC_SUBST([PBX_DLADDR])
AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
AC_MSG_RESULT(no)
)
LIBS=${old_LIBS}
2018-03-09 08:44:23 +00:00
# re-check without -ldl
# Non-Linux platforms like FreeBSD and NetBSD do not need a library libdl.so.
if test "${PBX_DLADDR}" = "0"; then
AC_MSG_CHECKING(for dladdr in dlfcn.h without -ldl)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#define _GNU_SOURCE 1
#include <dlfcn.h>],
[dladdr((void *)0, (void *)0)]
)],
AC_MSG_RESULT(yes)
PBX_DLADDR=1
AC_SUBST([PBX_DLADDR])
AC_DEFINE([HAVE_DLADDR], 1, [Define to 1 if your system has the dladdr() GNU extension]),
AC_MSG_RESULT(no)
)
fi
2006-04-24 17:11:45 +00:00
2006-07-05 19:59:34 +00:00
# do the package library checks now
2006-04-24 17:11:45 +00:00
BuildSystem: Enable Advanced Linux Sound Architecture (ALSA) in NetBSD.
In the script ./configure, AST_EXT_LIB_CHECK checks for external libraries. Some
libraries do not specify all their dependencies and require additional shared
libraries. In AST_EXT_LIB_CHECK, this is the fifth parameter. However, if a
library is specified there, it must exist on the platform, because ./configure
tries to compile/link/execute a small app using those statements. For example,
the library libdl.so is Linux specific and does not exist on BSD-like platforms.
Furthermore, no supported platform/version was found, which still (ever?)
requires those additional libraries. Therefore, they were simply removed.
Finally, this change adds the error code ESTRPIPE to the channel driver
chan_alsa for those platforms which lack it, again for example NetBSD.
ASTERISK-27720
Change-Id: I3b21f2135f6cbfac7590ccdc2df753257f426e0b
2018-03-05 16:10:45 +00:00
AST_EXT_LIB_CHECK([ALSA], [asound], [snd_pcm_open], [alsa/asoundlib.h])
2006-07-05 19:59:34 +00:00
2010-12-18 00:08:13 +00:00
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])
2018-03-09 09:13:20 +00:00
# Fedora/RedHat/CentOS require extra libraries
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty])
# openSUSE requires -lz
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h], [-ldl -liberty -lz])
2013-09-28 22:13:57 +00:00
2016-06-03 05:59:30 +00:00
case "${OSARCH}" in
linux*)
2006-09-27 21:48:01 +00:00
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
2016-06-03 05:59:30 +00:00
;;
esac
2006-09-27 21:48:01 +00:00
2010-05-19 17:48:31 +00:00
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_RESET_COUNTERS], [dahdi/user.h], [230])
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_DEFAULT_MTU_MRU], [dahdi/user.h], [220])
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h], [200])
2008-06-12 17:27:55 +00:00
2008-12-19 21:44:18 +00:00
AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h])
2009-01-22 15:49:24 +00:00
AST_C_COMPILE_CHECK([DAHDI_LINEREVERSE_VMWI], [struct dahdi_vmwi_info booger], [dahdi/user.h], , [enhanced dahdi vmwi support])
2009-04-30 21:42:35 +00:00
AST_C_COMPILE_CHECK([DAHDI_ECHOCANCEL_FAX_MODE], [int foo = DAHDI_ECHOCANCEL_FAX_MODE], [dahdi/user.h])
2008-07-22 20:54:07 +00:00
AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
2008-11-19 19:37:32 +00:00
AST_C_COMPILE_CHECK([TIMERFD], [timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);], [sys/timerfd.h], , [timerfd support])
2008-02-01 16:01:22 +00:00
2006-07-05 19:59:34 +00:00
GSM_INTERNAL="yes"
2006-08-21 02:11:39 +00:00
AC_SUBST(GSM_INTERNAL)
2006-07-05 19:59:34 +00:00
GSM_SYSTEM="yes"
2006-04-24 17:11:45 +00:00
if test "${USE_GSM}" != "no"; then
2006-07-05 21:28:30 +00:00
if test "${GSM_DIR}" = "internal"; then
GSM_SYSTEM="no"
elif test "${GSM_DIR}" != ""; then
GSM_INTERNAL="no"
fi
2006-04-24 17:11:45 +00:00
if test "${GSM_SYSTEM}" = "yes"; then
2006-05-19 18:54:21 +00:00
gsmlibdir=""
2006-05-01 10:34:20 +00:00
if test "x${GSM_DIR}" != "x"; then
2007-01-30 23:27:16 +00:00
if test -d ${GSM_DIR}/lib; then
gsmlibdir="-L${GSM_DIR}/lib"
else
gsmlibdir="-L${GSM_DIR}"
fi
2006-05-01 10:34:20 +00:00
fi
2006-04-24 17:11:45 +00:00
AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
2006-05-19 18:54:21 +00:00
[Define to indicate the GSM library]), [], ${gsmlibdir})
2006-04-24 17:11:45 +00:00
if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
2007-01-30 23:27:16 +00:00
if test "x${GSM_DIR}" != "x" ; then
AC_CHECK_HEADER([${GSM_DIR}/include/gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
AC_CHECK_HEADER([${GSM_DIR}/include/gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
else
AC_CHECK_HEADER([gsm.h], [GSM_HEADER_FOUND=1], [GSM_HEADER_FOUND=0])
AC_CHECK_HEADER([gsm/gsm.h], [GSM_GSM_HEADER_FOUND=1], [GSM_GSM_HEADER_FOUND=0])
fi
if test "${GSM_HEADER_FOUND}" = "0" ; then
if test "{GSM_GSM_HEADER_FOUND}" = "0" ; then
if test "x${GSM_MANDATORY}" = "xyes" ; then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** It appears that you do not have the gsm development package installed.])
AC_MSG_NOTICE([*** Please install it to include ${GSM_DESCRIP} support, or re-run configure])
AC_MSG_NOTICE([*** without explicitly specifying --with-${GSM_OPTION}])
exit 1
fi
fi
fi
GSM_OK=0
if test "${GSM_HEADER_FOUND}" = "1" ; then
AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
GSM_OK=1
2018-04-03 19:39:39 +00:00
elif test "${GSM_GSM_HEADER_FOUND}" = "1" ; then
AC_DEFINE_UNQUOTED([HAVE_GSM_GSM_HEADER], 1, [Define to indicate that gsm.h is in gsm/gsm.h])
GSM_OK=1
2007-01-30 23:27:16 +00:00
fi
if test "${GSM_OK}" = "1" ; then
GSM_LIB="-lgsm"
if test "x${GSM_DIR}" != "x"; then
GSM_LIB="${gsmlibdir} ${GSM_LIB}"
GSM_INCLUDE="-I${GSM_DIR}/include"
fi
PBX_GSM=1
GSM_INTERNAL="no"
fi
2006-04-24 17:11:45 +00:00
fi
fi
if test "${GSM_INTERNAL}" = "yes"; then
2006-07-05 19:59:34 +00:00
PBX_GSM=1
2007-01-30 23:27:16 +00:00
AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
2006-04-24 17:11:45 +00:00
fi
fi
2012-07-23 21:27:56 +00:00
ILBC_INTERNAL="yes"
AC_SUBST(ILBC_INTERNAL)
ILBC_SYSTEM="yes"
if test "${USE_ILBC}" != "no"; then
if test "${ILBC_DIR}" = "internal"; then
ILBC_SYSTEM="no"
elif test "${ILBC_DIR}" != ""; then
ILBC_INTERNAL="no"
fi
if test "${ILBC_SYSTEM}" = "yes"; then
AST_PKG_CONFIG_CHECK(ILBC, libilbc)
2012-07-25 12:21:54 +00:00
if test "$PBX_ILBC" = "1"; then
ILBC_INTERNAL="no"
2012-07-23 21:27:56 +00:00
fi
fi
if test "${ILBC_INTERNAL}" = "yes"; then
PBX_ILBC=1
fi
fi
2009-08-25 22:39:51 +00:00
AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])
2011-05-23 16:20:59 +00:00
# GNU libiconv #define's iconv_open to libiconv_open, so we need to search for that symbol
AST_EXT_LIB_CHECK([ICONV], [iconv], [libiconv_open], [iconv.h])
2009-08-25 22:39:51 +00:00
# Some versions of Linux package iconv in glibc
AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h])
2008-01-01 22:08:32 +00:00
2010-06-29 22:40:00 +00:00
# If ical.h is NOT in the libical directory, then it is of a version insufficient for us.
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
2010-05-26 00:29:40 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
2006-04-24 17:11:45 +00:00
2006-07-05 19:59:34 +00:00
if test "${USE_IMAP_TK}" != "no"; then
2008-02-15 15:11:23 +00:00
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
2008-02-15 00:59:21 +00:00
switch_to_system_on_failure="no"
2008-02-14 23:39:47 +00:00
if test "${IMAP_TK_DIR}" = ""; then
IMAP_TK_DIR=`pwd`"/../imap-2004g"
2008-02-15 00:59:21 +00:00
switch_to_system_on_failure="yes"
2008-02-14 23:39:47 +00:00
fi
if test "${IMAP_TK_DIR}" != "system"; then
AC_MSG_CHECKING(for UW IMAP Toolkit c-client library)
if test -f "${IMAP_TK_DIR}/c-client/LDFLAGS"; then
imap_ldflags=`cat ${IMAP_TK_DIR}/c-client/LDFLAGS`
fi
imap_libs="${IMAP_TK_DIR}/c-client/c-client.a"
imap_include="-I${IMAP_TK_DIR}/c-client"
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include "c-client.h"
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
MAILSTREAM *foo = mail_open(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include "c-client.h"
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
long check = mail_expunge_full(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
2008-02-15 00:59:21 +00:00
if test "${ac_cv_imap_tk}" = "no"; then
2008-02-14 23:39:47 +00:00
AC_MSG_RESULT(no)
2008-02-15 00:59:21 +00:00
if test "${switch_to_system_on_failure}" = "yes"; then
IMAP_TK_DIR="system"
2008-02-15 17:32:43 +00:00
else #This means they specified a directory. Search for a package installation there too
AC_MSG_CHECKING([for system c-client library...])
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
imap_include="-I${IMAP_TK_DIR}/include"
2008-03-11 13:58:37 +00:00
imap_ldflags="-L${IMAP_TK_DIR}/lib"
2008-02-15 17:32:43 +00:00
imap_libs="-lc-client"
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-15 17:32:43 +00:00
[#include "c-client.h"
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
MAILSTREAM *foo = mail_open(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-15 17:32:43 +00:00
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-15 17:32:43 +00:00
[#include "c-client.h"
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
long check = mail_expunge_full(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-15 17:32:43 +00:00
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
2008-02-15 00:59:21 +00:00
fi
2008-02-14 23:39:47 +00:00
fi
2012-01-30 21:21:16 +00:00
fi
2008-02-14 23:39:47 +00:00
if test "${IMAP_TK_DIR}" = "system"; then
#We will enter here if user specified "system" or if any of above checks failed
AC_MSG_CHECKING([for system c-client library...])
2008-02-15 17:32:43 +00:00
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
2008-02-14 23:39:47 +00:00
imap_ldflags=""
2018-03-12 10:19:41 +00:00
imap_libs="-lcrypto -lssl -lc-client"
2008-02-14 23:39:47 +00:00
imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include <stdio.h>
#include <imap/c-client.h>
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
MAILSTREAM *foo = mail_open(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include <stdio.h>
#include <imap/c-client.h>
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
long check = mail_expunge_full(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
else #looking in imap directory didn't work, try c-client
imap_ldflags=""
2018-02-16 12:41:35 +00:00
imap_libs="-lcrypto -lssl -lc-client"
2008-02-14 23:39:47 +00:00
imap_include="-DUSE_SYSTEM_CCLIENT"
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include <stdio.h>
#include <c-client/c-client.h>
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
MAILSTREAM *foo = mail_open(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
2018-04-20 12:13:12 +00:00
if test "${ac_cv_imap_tk}" = "no"; then
imap_libs="-lcrypto -lssl -lc-client4"
LIBS="${saved_libs} ${imap_libs} "`echo ${imap_ldflags}`
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <stdio.h>
#include <c-client/c-client.h>
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
MAILSTREAM *foo = mail_open(NULL, "", 0);
]
)],
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
fi
2008-02-14 23:39:47 +00:00
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2008-02-14 23:39:47 +00:00
[#include <stdio.h>
#include <c-client/c-client.h>
void mm_searched (MAILSTREAM *stream,unsigned long number)
{
}
void mm_exists (MAILSTREAM *stream,unsigned long number)
{
}
void mm_expunged (MAILSTREAM *stream,unsigned long number)
{
}
void mm_flags (MAILSTREAM *stream,unsigned long number)
{
}
void mm_notify (MAILSTREAM *stream,char *string,long errflg)
{
}
void mm_list (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_lsub (MAILSTREAM *stream,int delimiter,char *mailbox,long attributes)
{
}
void mm_status (MAILSTREAM *stream,char *mailbox,MAILSTATUS *status)
{
}
void mm_log (char *string,long errflg)
{
}
void mm_dlog (char *string)
{
}
void mm_login (NETMBX *mb,char *user,char *pwd,long trial)
{
}
void mm_critical (MAILSTREAM *stream)
{
}
void mm_nocritical (MAILSTREAM *stream)
{
}
long mm_diskerror (MAILSTREAM *stream,long errcode,long serious)
{
}
void mm_fatal (char *string)
{
}],
[
long check = mail_expunge_full(NULL, "", 0);
]
2012-01-14 16:43:12 +00:00
)],
2008-02-14 23:39:47 +00:00
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
fi
2008-02-15 00:59:21 +00:00
fi
if test "${ac_cv_imap_tk}" = "yes"; then
AC_MSG_RESULT(yes)
IMAP_TK_LIB="${imap_libs} "`echo ${imap_ldflags}`
IMAP_TK_INCLUDE="${imap_include}"
PBX_IMAP_TK=1
AC_DEFINE([HAVE_IMAP_TK], 1, [Define if your system has the UW IMAP Toolkit c-client library.])
if test "${ac_cv_imap_tk2006}" = "yes"; then
AC_DEFINE([HAVE_IMAP_TK2006], 1, [Define if your system has the UW IMAP Toolkit c-client library version 2006 or greater.])
2008-02-14 23:39:47 +00:00
fi
2008-02-15 00:59:21 +00:00
else
2012-01-30 21:21:16 +00:00
AC_MSG_RESULT(no)
2008-02-14 23:39:47 +00:00
fi
2008-02-15 15:11:23 +00:00
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
2006-07-05 19:59:34 +00:00
fi
2006-06-24 19:43:31 +00:00
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_CHECK([IODBC], [iodbc], [SQLConnect], [sql.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
2008-10-06 23:14:33 +00:00
2009-02-25 19:24:44 +00:00
AST_EXT_LIB_CHECK([INOTIFY], [c], [inotify_init], [sys/inotify.h])
2008-01-13 18:08:50 +00:00
AST_EXT_LIB_CHECK([JACK], [jack], [jack_activate], [jack/jack.h])
2010-05-13 05:37:31 +00:00
# BSD (and OS X) equivalent of inotify
AST_EXT_LIB_CHECK([KQUEUE], [c], [kqueue], [sys/event.h])
# 64-bit version of kevent (from kqueue) on OS X
AC_CHECK_FUNCS([kevent64])
2008-02-14 21:21:53 +00:00
AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h])
2008-01-22 22:33:20 +00:00
2006-08-21 02:11:39 +00:00
AST_EXT_LIB_CHECK([MISDN], [mISDN], [mISDN_open], [mISDNuser/mISDNlib.h])
if test "${PBX_MISDN}" = 1; then
AST_EXT_LIB_CHECK([ISDNNET], [isdnnet], [init_manager], [mISDNuser/isdn_net.h], [-lmISDN -lpthread])
AST_EXT_LIB_CHECK([SUPPSERV], [suppserv], [encodeFac], [mISDNuser/suppserv.h])
2007-10-29 16:34:45 +00:00
AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
AST_C_DEFINE_CHECK([MISDN_FAC_ERROR], [Fac_ERROR], [mISDNuser/suppserv.h])
2007-03-26 15:59:56 +00:00
AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
2009-11-04 13:57:09 +00:00
AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
2006-08-21 02:11:39 +00:00
fi
2019-12-16 12:35:31 +00:00
2009-06-30 16:40:38 +00:00
AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])
2019-12-16 12:35:31 +00:00
if test "${PBX_MYSQLCLIENT}" = 1; then
AC_MSG_CHECKING(for MySQL client bool support)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <mysql/mysql.h>],
[bool test = 1;])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MYSQLCLIENT_BOOL, 1, [Define to 1 if mysql/mysql.h has bool defined.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for MySQL client my_bool support)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <mysql/mysql.h>],
[my_bool test = 1;])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_MYSQLCLIENT_MY_BOOL, 1, [Define to 1 if mysql/mysql.h has my_bool defined.]),
AC_MSG_RESULT(no)
)
fi
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
2006-06-24 19:43:31 +00:00
2009-06-30 16:40:38 +00:00
AST_EXT_TOOL_CHECK([NEON], [neon-config])
2009-05-28 19:57:18 +00:00
2010-05-26 05:33:11 +00:00
AST_EXT_TOOL_CHECK([NEON29], [neon-config], , [--libs],
[#include <ne_auth.h>],
[#ifndef NE_AUTH_NTLM
#error Need libneon >= 0.29.0
#endif])
2009-06-30 16:40:38 +00:00
AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs],
2008-01-16 23:08:11 +00:00
[#include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <net-snmp/agent/net-snmp-agent-includes.h>],
[int callback = snmp_register_callback(0, 0, NULL, NULL)])
2006-06-24 19:43:31 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
2018-09-24 22:56:07 +00:00
# Check that unbound is installed and the version code fragment compiles
AST_EXT_LIB_EXTRA_CHECK([UNBOUND], [unbound], [ub_ctx_delete], [unbound.h],
[], [], [
AC_LANG_PROGRAM( [#include <unbound.h>],
[
#if (UNBOUND_VERSION_MAJOR < 1 || (UNBOUND_VERSION_MAJOR == 1 && UNBOUND_VERSION_MINOR < 5 ))
#error "Unbound version must be >= 1.5"
#endif
]
)
], [unbound version >= 1.5])
2015-03-25 12:32:26 +00:00
BuildSystem: For consistency, avoid extra libs to be empty.
AST_EXT_LIB_CHECK has several optional parameters. When an optional parameter
is left empty, [] is used to indicate this. However, this is done in the script
./configure only then, when a further parameter is not empty. For example, when
no extra libraries are needed to test the checked library, parameter 5 is not
mentioned. Except parameter 6 and higher are used, then parameter 5 must be
empty.
However, this general rule was broken
* four times for parameter 5 (extra libs) and
* three times for parameter 4 (header)
as found via the Regular Expression \[\]\). In case of parameter 5, all cases
were changed, because that happened for no reason. In case of parameter 4, an
[] improves readability actually. Therefore for parameter 4, the only case which
did not do it was changed. All this aims to create more consistency: Only do
something different if there is a reason to do so.
Change-Id: I037ef170cf1ad94497151a9ea5071a31c656cafe
2018-03-20 16:53:19 +00:00
AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h])
2006-07-05 19:59:34 +00:00
2018-03-17 15:49:11 +00:00
AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_stream_init], [ogg/ogg.h])
2006-07-05 19:59:34 +00:00
2008-01-28 18:27:29 +00:00
# Non-glibc platforms require libexecinfo for backtrace support
2007-11-21 21:30:24 +00:00
AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
2008-01-28 18:27:29 +00:00
# Linux, however, has backtrace directly in glibc
AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h])
2007-01-19 09:39:02 +00:00
2009-06-30 16:40:38 +00:00
AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
2017-10-16 21:46:02 +00:00
AST_EXT_LIB_CHECK([BEANSTALK], [beanstalk], [bs_version], [beanstalk.h])
2006-10-04 23:52:23 +00:00
# possible places for oss definitions
AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [linux/soundcard.h])
AST_EXT_LIB_CHECK([OSS], [ossaudio], [], [sys/soundcard.h])
AST_EXT_LIB_CHECK([OSS], [ossaudio], [oss_ioctl_mixer], [soundcard.h])
2006-06-24 19:43:31 +00:00
2006-04-24 17:11:45 +00:00
PG_CONFIG=No
2012-01-30 21:21:16 +00:00
if test "${USE_PGSQL}" != "no"; then
2006-07-05 19:59:34 +00:00
if test "x${PGSQL_DIR}" != "x"; then
AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
2006-04-24 17:11:45 +00:00
if test x"${PG_CONFIG}" = xNo; then
2006-12-16 21:38:10 +00:00
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** pg_config was not found in the path you specified:])
AC_MSG_NOTICE([*** ${PGSQL_DIR}/bin])
AC_MSG_NOTICE([*** Either correct the installation, or run configure])
AC_MSG_NOTICE([*** including --without-postgres])
2006-04-24 17:11:45 +00:00
exit 1
fi
else
AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
fi
fi
2006-07-05 19:59:34 +00:00
if test "${PG_CONFIG}" != No; then
2007-01-08 03:56:06 +00:00
PGSQL_libdir=`${PG_CONFIG} --libdir`
PGSQL_includedir=`${PG_CONFIG} --includedir`
2007-02-17 01:11:32 +00:00
if test "x$?" != "x0" ; then
if test -n "${PGSQL_MANDATORY}" ; then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
AC_MSG_NOTICE([*** Either correct the installation, or run configure])
AC_MSG_NOTICE([*** including --without-postgres])
exit 1
fi
2012-01-30 21:21:16 +00:00
else
2007-12-12 16:56:12 +00:00
AC_CHECK_LIB([pq], [PQescapeStringConn], AC_DEFINE_UNQUOTED([HAVE_PGSQL], 1,
2007-02-17 01:11:32 +00:00
[Define to indicate the PostgreSQL library]), [], -L${PGSQL_libdir} -lz)
2010-09-24 03:41:02 +00:00
AC_MSG_CHECKING(for pg_encoding_to_char within Postgres headers)
old_CFLAGS=${CFLAGS}
CFLAGS="${CFLAGS} -I${PGSQL_includedir} -Werror"
old_LDFLAGS=${LDFLAGS}
LDFLAGS="${LDFLAGS} -L${PGSQL_libdir} -lpq -lz"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <libpq-fe.h>],
[const char *foo = pg_encoding_to_char(1)])],
[AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED([HAVE_PGSQL_pg_encoding_to_char], 1, [Define to indicate presence of the pg_encoding_to_char API.])],
[AC_MSG_RESULT(no)])
CFLAGS=${old_CFLAGS}
LDFLAGS=${old_LDFLAGS}
2007-12-12 16:56:12 +00:00
if test "${ac_cv_lib_pq_PQescapeStringConn}" = "yes"; then
2007-02-17 01:11:32 +00:00
PGSQL_LIB="-L${PGSQL_libdir} -lpq -lz"
PGSQL_INCLUDE="-I${PGSQL_includedir}"
PBX_PGSQL=1
elif test -n "${PGSQL_MANDATORY}";
then
AC_MSG_NOTICE([***])
AC_MSG_NOTICE([*** The PostgreSQL installation on this system appears to be broken.])
AC_MSG_NOTICE([*** Either correct the installation, or run configure])
AC_MSG_NOTICE([*** including --without-postgres])
exit 1
fi
2006-04-24 17:11:45 +00:00
fi
2006-10-04 23:52:23 +00:00
fi
2006-04-24 17:11:45 +00:00
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
if test "$USE_PJPROJECT" != "no" ; then
2016-10-03 16:30:43 +00:00
if test "$PJPROJECT_BUNDLED" = "no" ; then
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
AST_PKG_CONFIG_CHECK([PJPROJECT], [libpjproject])
2018-03-08 11:28:37 +00:00
AST_EXT_LIB_CHECK([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [pjsip], [pjsip_dlg_create_uas_and_inc_lock], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
AST_EXT_LIB_CHECK([PJ_TRANSACTION_GRP_LOCK], [pjsip], [pjsip_tsx_create_uac2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
LIBS="${LIBS} ${PJPROJECT_LIB}"
AST_C_COMPILE_CHECK([PJSIP_REPLACE_MEDIA_STREAM], [pjmedia_mod_offer_flag flag = PJMEDIA_SDP_NEG_ALLOW_MEDIA_CHANGE], [pjmedia.h])
LIBS="${saved_libs}"
CPPFLAGS="${saved_cppflags}"
AST_EXT_LIB_CHECK([PJSIP_GET_DEST_INFO], [pjsip], [pjsip_get_dest_info], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2016-08-17 11:12:19 +00:00
AST_EXT_LIB_CHECK([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj], [pj_ssl_cert_load_from_files2], [pjlib.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2018-03-08 11:28:37 +00:00
AST_EXT_LIB_CHECK([PJSIP_EXTERNAL_RESOLVER], [pjsip], [pjsip_endpt_set_ext_resolver], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2016-03-14 13:59:10 +00:00
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
CPPFLAGS="${CPPFLAGS} ${PJPROJECT_CFLAGS}"
LIBS="${LIBS} ${PJPROJECT_LIB}"
AST_C_COMPILE_CHECK([PJSIP_TLS_TRANSPORT_PROTO], [struct pjsip_tls_setting setting; int proto; proto = setting.proto;], [pjsip.h])
2018-06-19 02:22:17 +00:00
AST_C_COMPILE_CHECK([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [pjsip_cfg()->endpt.accept_multiple_sdp_answers = 0;], [pjsip.h])
2018-09-17 16:38:19 +00:00
AST_C_COMPILE_CHECK([PJSIP_ENDPOINT_COMPACT_FORM], [pjsip_cfg()->endpt.use_compact_form = PJ_TRUE;], [pjsip.h])
2018-07-18 12:45:26 +00:00
AST_C_COMPILE_CHECK([PJSIP_TRANSPORT_DISABLE_CONNECTION_REUSE], [struct pjsip_tpselector sel; sel.disable_connection_reuse = PJ_TRUE;], [pjsip.h])
AST_C_COMPILE_CHECK([PJSIP_OAUTH_AUTHENTICATION], [struct pjsip_oauth_credential credential;], [pjsip.h])
2020-01-23 19:17:06 +00:00
AC_MSG_CHECKING(for pjproject on_valid_pair callback)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[#include <pjsip.h>
#include <pjsip_ua.h>
#include <pjnath.h>
void on_valid_pair(pj_ice_sess *ice) {}
void on_ice_complete(pj_ice_sess *ice, pj_status_t status) {}
void on_rx_data(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, void *pkt, pj_size_t size, const pj_sockaddr_t *src_addr, unsigned src_addr_len) {}
pj_status_t on_tx_pkt(pj_ice_sess *ice, unsigned comp_id, unsigned transport_id, const void *pkt, pj_size_t size, const pj_sockaddr_t *dst_addr, unsigned dst_addr_len) {}],
[pj_ice_sess_cb ice_sess_cb = {
.on_valid_pair = on_valid_pair,
.on_ice_complete = on_ice_complete,
.on_rx_data = on_rx_data,
.on_tx_pkt = on_tx_pkt,
};])],
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PJPROJECT_ON_VALID_ICE_PAIR_CALLBACK, 1, [Define to 1 if on_valid_pair callback is present.]),
AC_MSG_RESULT(no)
)
2016-03-14 13:59:10 +00:00
LIBS="${saved_libs}"
CPPFLAGS="${saved_cppflags}"
2016-06-12 16:19:27 +00:00
2016-06-30 13:25:09 +00:00
AST_EXT_LIB_CHECK([PJSIP_EVSUB_GRP_LOCK], [pjsip], [pjsip_evsub_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2016-08-18 19:45:59 +00:00
AST_EXT_LIB_CHECK([PJSIP_INV_SESSION_REF], [pjsip], [pjsip_inv_add_ref], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2016-11-14 20:36:52 +00:00
AST_EXT_LIB_CHECK([PJSIP_AUTH_CLT_DEINIT], [pjsip], [pjsip_auth_clt_deinit], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
2017-04-04 21:20:22 +00:00
AST_EXT_LIB_CHECK([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip], [pjsip_tsx_layer_find_tsx2], [pjsip.h], [$PJPROJECT_LIB], [$PJPROJECT_CFLAGS])
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
fi
fi
2015-01-13 12:09:45 +00:00
2016-05-09 01:19:50 +00:00
AC_SUBST([PYTHONDEV_LIB])
AC_SUBST([PYTHONDEV_INCLUDE])
2018-03-22 00:25:58 +00:00
AST_PKG_CONFIG_CHECK([PYTHONDEV], [python])
2016-05-09 01:19:50 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([POPT], [popt], [poptStrerror], [popt.h])
2006-04-24 17:11:45 +00:00
2018-03-06 12:28:15 +00:00
AST_PKG_CONFIG_CHECK([PORTAUDIO], [portaudio-2.0])
2007-12-31 15:20:30 +00:00
AST_EXT_LIB_CHECK([PORTAUDIO], [portaudio], [Pa_GetDeviceCount], [portaudio.h])
2009-08-21 23:18:16 +00:00
AST_EXT_LIB_CHECK([PRI], [pri], [pri_connected_line_update], [libpri.h])
2014-05-13 00:35:31 +00:00
AST_EXT_LIB_CHECK([PRI_SETUP_ACK_INBAND], [pri], [pri_setup_ack], [libpri.h])
2011-08-17 16:18:27 +00:00
AST_EXT_LIB_CHECK([PRI_L2_PERSISTENCE], [pri], [pri_persistent_layer2_option], [libpri.h])
2011-05-17 20:13:27 +00:00
AST_EXT_LIB_CHECK([PRI_DATETIME_SEND], [pri], [pri_date_time_send_option], [libpri.h])
2011-04-18 19:48:00 +00:00
AST_EXT_LIB_CHECK([PRI_MWI_V2], [pri], [pri_mwi_indicate_v2], [libpri.h])
2011-02-04 20:30:48 +00:00
AST_EXT_LIB_CHECK([PRI_DISPLAY_TEXT], [pri], [pri_display_text], [libpri.h])
2010-06-03 00:02:14 +00:00
AST_EXT_LIB_CHECK([PRI_MWI], [pri], [pri_mwi_indicate], [libpri.h])
2010-06-02 22:28:58 +00:00
AST_EXT_LIB_CHECK([PRI_MCID], [pri], [pri_mcid_enable], [libpri.h])
2010-06-02 21:05:32 +00:00
AST_EXT_LIB_CHECK([PRI_CALL_WAITING], [pri], [pri_connect_ack_enable], [libpri.h])
2010-06-02 17:13:53 +00:00
AST_EXT_LIB_CHECK([PRI_AOC_EVENTS], [pri], [pri_aoc_events_enable], [libpri.h])
2010-10-26 16:01:08 +00:00
AST_EXT_LIB_CHECK([PRI_TRANSFER], [pri], [pri_transfer_enable], [libpri.h])
Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:
1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
multiple calls to the same device. This proved to not be such a good idea
when implementing protocol-specific monitors, and so we ended up using one
monitor per-device per-call.
3. There are some configuration options which were conceived after the document
was written. These are documented in the ccss.conf.sample that is on this
review request.
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.
This implements CCBS and CCNR in several flavors.
First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.
Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:
* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
what is defined in the referenced draft.
* Implementation of the draft required support for SIP PUBLISH. I attempted to write
this in a generic-enough fashion such that if someone were to want to write PUBLISH
support for other event packages, such as dialog-state or presence, most of the effort
would be in writing callbacks specific to the event package.
* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
parser. The PIDF support added is a bit minimal. I first wrote a validation
routine to ensure that the PIDF document is formatted properly. The rest of the
PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
code. In other words, while there is PIDF support here, it is not in any state
where it could easily be applied to other event packages as is.
Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.
Review: https://reviewboard.asterisk.org/r/523
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256528 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-09 15:31:32 +00:00
AST_EXT_LIB_CHECK([PRI_CCSS], [pri], [pri_cc_enable], [libpri.h])
2010-05-11 23:18:53 +00:00
AST_EXT_LIB_CHECK([PRI_HANGUP_FIX], [pri], [pri_hangup_fix_enable], [libpri.h])
2009-10-22 16:33:22 +00:00
AST_EXT_LIB_CHECK([PRI_SUBADDR], [pri], [pri_sr_set_called_subaddress], [libpri.h])
2009-10-23 16:57:33 +00:00
AST_EXT_LIB_CHECK([PRI_CALL_HOLD], [pri], [pri_hold_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_CALL_REROUTING], [pri], [pri_reroute_enable], [libpri.h])
AST_EXT_LIB_CHECK([PRI_SETUP_KEYPAD], [pri], [pri_sr_set_keypad_digits], [libpri.h])
2008-11-05 20:45:03 +00:00
2009-08-21 23:18:16 +00:00
# ------------------------------------v
# TODO: The code can be changed to always include these features now.
# These features will always be present if pri_connected_line_update is available.
2008-11-05 20:45:03 +00:00
AST_EXT_LIB_CHECK([PRI_PROG_W_CAUSE], [pri], [pri_progress_with_cause], [libpri.h])
2008-07-22 19:59:10 +00:00
AST_EXT_LIB_CHECK([PRI_INBANDDISCONNECT], [pri], [pri_set_inbanddisconnect], [libpri.h])
Add service maintenance message support
This is the companion commit to libpri r732. Service messages are now supported
for switch types 4ess/5ess. A new option service_message_support has been added
to chan_dahdi.conf and is noted in the sample config file. The service message
support is turned off by default. The current implementation relies on AstDB
to keep track of channel state, which allows the statuses to be preserved
across Asterisk restarts. Below is a description of the storage format.
The state and reason for the service state are in the form <state>:<reason>,
where:
<state> ::= { 'O' } // 'O' – Out Of Service
<reason> ::= { '0' | '1' | '2' | '3' }, where:
'0' – No reason (backwards compatibility)
'1' – NEAR END
'2' – FAR END
'3' – both NEAR and FAR END
The new CLI commands to handle channel service state are:
pri service disable channel <chan>
pri service enable channel <chan>
Many people contributed to the development of this functionality. Because I
entered at the very end I do not know the exact history. Special thanks to
all who moved the bug forward one way or another:
cmaj, PCadach, markster, mattf, drmac, MikeJ, serge-v, murf, kanelbullar, Seb7,
tilghman, lmadsen, and especially dhubbard (he answered lots of my questions
and did a large portion of the work)
(closes issue #3450)
Reported by: cmaj
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 15:54:16 +00:00
AST_EXT_LIB_CHECK([PRI_SERVICE_MESSAGES], [pri], [pri_maintenance_service], [libpri.h])
2009-07-03 15:44:01 +00:00
AST_EXT_LIB_CHECK([PRI_REVERSE_CHARGE], [pri], [pri_sr_set_reversecharge], [libpri.h])
2009-08-21 23:18:16 +00:00
# ------------------------------------^
2009-07-03 15:44:01 +00:00
2008-07-21 14:47:41 +00:00
AST_EXT_LIB_CHECK([RESAMPLE], [resample], [resample_open], [libresample.h], [-lm])
2018-06-23 09:50:00 +00:00
AST_EXT_LIB_CHECK([FFTW3], [fftw3], [fftw_malloc], [fftw3.h])
2016-08-12 16:23:18 +00:00
AST_EXT_LIB_CHECK([SNDFILE], [sndfile], [sf_open], [sndfile.h])
2008-07-21 14:47:41 +00:00
2008-06-02 15:43:40 +00:00
AST_C_COMPILE_CHECK([SPANDSP], [
#if SPANDSP_RELEASE_DATE < 20080516
#error "spandsp 0.0.5 or greater is required"
#endif
2008-10-15 10:16:29 +00:00
], [spandsp/version.h], , [minimum version of SpanDSP])
2008-06-02 15:43:40 +00:00
2008-06-02 15:57:43 +00:00
if test "x${PBX_SPANDSP}" = "x1" ; then
# We found the correct version in the header, now let's make sure it links
# properly, and that libtiff is available
PBX_SPANDSP=0
AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [span_set_message_handler], [spandsp.h], [-ltiff])
fi
2008-11-19 18:28:14 +00:00
if test "x${PBX_SPANDSP}" = "x1" ; then
# We also need t38_terminal_init()
PBX_SPANDSP=0
AST_EXT_LIB_CHECK([SPANDSP], [spandsp], [t38_terminal_init], [spandsp.h], [-ltiff])
fi
2014-06-16 18:27:51 +00:00
# Check for libss7 v2.0 branch compatible version.
AST_EXT_LIB_CHECK([SS7], [ss7], [ss7_set_isup_timer], [libss7.h])
2006-09-21 18:41:33 +00:00
Add MFC/R2 support for chan_dahdi.
This commit introduces official support for R2 signaling in chan_dahdi. The
modifications to chan_dahdi, and the supporting library, LibOpenR2, were both
written by Moises Silva.
Many users are using this code, or a variant of it, in Asterisk 1.2, 1.4 and 1.6
in Brazil, México and Argentina. An unknown number of users (but at least 1)
are using it in each of the following countries: Colombia, Nepal, Thailand,
Venezuela, Perú, and probably others.
To use this code, LibOpenR2 must be installed from http://www.libopenr2.org/.
Information about configuration can be found in configs/chan_dahdi.conf.sample.
The code committed is the most up to date version, which was being maintained
in svn/asterisk/team/moy/mfcr2/.
I would also like to include a Thank You to the many others that tested this
code beyond those listed in this commit message. These are the names that I
could find in the mantis issue.
(closes issue #12509)
Reported by: moy
Patches:
chan_zap-mfr2.patch uploaded by moy (license 222)
Tested by: moy, korihor, viniciusfontes, Skarmeth, loloski, asbestoshead, titogarrido, heliocoelhojr, konsultex, ncorrare, ecarruda, rtorresduque, PTorres, ychen
Review: http://reviewboard.digium.com/r/40/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-16 20:35:58 +00:00
AST_EXT_LIB_CHECK([OPENR2], [openr2], [openr2_chan_new], [openr2.h])
2014-10-27 17:55:43 +00:00
AST_EXT_LIB_CHECK([OPUS], [opus], [opus_encoder_create], [opus/opus.h])
2017-11-06 09:21:12 +00:00
# opusfile.h includes <opus_multistream.h> so we need to make sure that
# either $OPUS_INCLUDE or /usr/include/opus is added to the search path.
__opus_include=${OPUS_INCLUDE}
if test -z "$__opus_include" -o x"$__opus_include" = x" " ; then
__opus_include=-I/usr/include/opus
fi
AST_EXT_LIB_CHECK([OPUSFILE], [opusfile], [op_open_callbacks], [opus/opusfile.h], [], [$__opus_include])
2014-10-27 17:55:43 +00:00
2018-04-03 19:39:39 +00:00
for ver in 5.3 5.2 5.1; do
AST_EXT_LIB_CHECK([LUA], lua${ver}, [luaL_newstate], lua${ver}/lua.h, [-lm])
if test "x${PBX_LUA}" = "x1" ; then
if test x"${LUA_DIR}" = x; then
LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua${ver}"
else
LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua${ver}"
fi
break;
2010-05-26 00:29:40 +00:00
fi
2018-04-03 19:39:39 +00:00
done
2012-01-30 21:21:16 +00:00
2018-03-05 14:01:06 +00:00
# Some distributions (like openSUSE and NetBSD) remove the 5.x suffix.
AST_EXT_LIB_CHECK([LUA], [lua], [luaL_newstate], [lua.h], [-lm])
2007-11-02 15:36:34 +00:00
2014-01-28 23:23:15 +00:00
# Accept either RADIUS client library, their APIs are fully compatible,
# just different header filenames and different SONAMEs
AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
if test "x${PBX_RADIUS}" = "x1"; then
2016-11-12 18:15:12 +00:00
AC_DEFINE(RADIUS_HEADER_STR, [<freeradius-client.h>], [Name of RADIUS library include header])
2014-01-28 23:23:15 +00:00
else
AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
2016-11-12 18:15:12 +00:00
if test "x${PBX_RADIUS}" = "x1"; then
AC_DEFINE(RADIUS_HEADER_STR, [<radiusclient-ng.h>], [Name of RADIUS library include header])
else
AST_EXT_LIB_CHECK([RADIUS], [radcli], [rc_read_config], [radcli/radcli.h])
if test "x${PBX_RADIUS}" = "x1"; then
AC_DEFINE(RADIUS_HEADER_STR, [<radcli/radcli.h>], [Name of RADIUS library include header])
fi
fi
2014-01-28 23:23:15 +00:00
fi
2006-07-05 19:59:34 +00:00
2016-07-19 18:14:21 +00:00
AST_EXT_LIB_CHECK([CODEC2], [codec2], [codec2_create], [codec2/codec2.h])
2017-10-06 15:51:17 +00:00
AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcpg -lcfg])
2012-04-28 01:20:57 +00:00
AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])
2008-06-10 00:43:06 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([SPEEX], [speex], [speex_encode], [speex/speex.h], [-lm])
2008-05-05 22:13:57 +00:00
# See if the main speex library contains the preprocess functions
2008-05-06 13:55:44 +00:00
AST_EXT_LIB_CHECK([SPEEX_PREPROCESS], [speex], [speex_preprocess_ctl], [speex/speex.h], [-lm])
2008-05-05 22:13:57 +00:00
if test "${PBX_SPEEX_PREPROCESS}" = 1; then
PBX_SPEEX_PREPROCESS=1
fi
2008-01-16 01:17:25 +00:00
AST_EXT_LIB_CHECK([SPEEXDSP], [speexdsp], [speex_preprocess_ctl], [speex/speex.h], [-lm])
2008-05-05 22:13:57 +00:00
if test "${PBX_SPEEXDSP}" = 1; then
PBX_SPEEX_PREPROCESS=1
fi
AC_SUBST(PBX_SPEEX_PREPROCESS)
2008-01-16 01:17:25 +00:00
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([SQLITE], [sqlite], [sqlite_exec], [sqlite.h])
2010-12-17 21:06:13 +00:00
AST_EXT_LIB_CHECK([SQLITE3], [sqlite3], [sqlite3_open], [sqlite3.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
2007-03-13 21:22:33 +00:00
2011-07-06 20:58:12 +00:00
if test "${PBX_SQLITE3}" != 1; then
2015-02-25 23:09:51 +00:00
AC_MSG_ERROR(*** Asterisk now uses SQLite3 for the internal Asterisk database.)
AC_MSG_ERROR(*** Please install the SQLite3 development package.)
2011-07-06 20:58:12 +00:00
exit 1
fi
2013-07-03 16:32:00 +00:00
# Find crypt support
# * -lcrypt on *NIX
# * in libsystem on OS X
AST_EXT_LIB_CHECK([LIBCRYPT], [crypt], [crypt], [crypt.h])
AC_CHECK_FUNC([crypt], [SYSCRYPT=true], [SYSCRYPT=""])
if test "x$LIBCRYPT_LIB" != "x" ; then
CRYPT_LIB="$LIBCRYPT_LIB"
CRYPT_INCLUDE="$LIBCRYPT_INCLUDE"
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.])
2013-07-03 16:32:00 +00:00
elif test "x$SYSCRYPT" != "x" ; then
CRYPT_LIB=""
CRYPT_INCLUDE=""
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
AC_DEFINE([HAVE_CRYPT], [1], [Define to 1 if you have the 'crypt' function.])
2013-07-03 16:32:00 +00:00
fi
AC_SUBST(CRYPT_LIB)
AC_SUBST(CRYPT_INCLUDE)
# Find crypt_r support
AC_CHECK_LIB([crypt], [crypt_r],
build-system: Allow building with static pjproject
Background here:
http://lists.digium.com/pipermail/asterisk-dev/2016-January/075266.html
From CHANGES:
* To help insure that Asterisk is compiled and run with the same known
version of pjproject, a new option (--with-pjproject-bundled) has been
added to ./configure. When specified, the version of pjproject specified
in third-party/versions.mak will be downloaded and configured. When you
make Asterisk, the build process will also automatically build pjproject
and Asterisk will be statically linked to it. Once a particular version
of pjproject is configured and built, it won't be configured or built
again unless you run a 'make distclean'.
To facilitate testing, when 'make install' is run, the pjsua and pjsystest
utilities and the pjproject python bindings will be installed in
ASTDATADIR/third-party/pjproject.
The default behavior remains building with the shared pjproject
installation, if any.
Building:
All you have to do is include the --with-pjproject-bundled option on
the ./configure command line (and remove any existing --with-pjproject
option if specified). Everything else is automatic.
Behind the scenes:
The top-level Makefile was modified to include 'third-party' in the
list of MOD_SUBDIRS.
The third-party directory was created to contain any third party
packages that may be needed in the future. Its Makefile automatically
iterates over any subdirectories passing on targets.
The third-party/pjproject directory was created to house the pjproject
source distribution. Its Makefile contains targets to download, patch
configure, generate dependencies, compile libs, apps and python bindings,
sanitized build.mak and generate a symbols list.
When bootstrap.sh is run, it automatically includes the configure.m4
file in third-party/pjproject. This file has a macro to download and
conifgure pjproject and get and set PJPROJECT_INCLUDE, PJPROJECT_DIR
and PJPROJECT_BUNDLED. It also tests for the capabilities like
PJ_TRANSACTION_GRP_LOCK by parsing preprocessor output as opposed to
trying to compile. Of course, bootstrap.sh is only run once and the
configure file is incldued in the patch.
When configure is run with the new options, the macro in configure.m4
triggers the download, patch, conifgure and tests. No compilation is
performed at this time. The downloaded tarball is cached in /tmp so
it doesn't get downloaded again on a distclean.
When make is run in the top-level Asterisk source directory, it will
automatically descend all the subdirectories in third_party just as it
does for addons, apps, etc. The top-level Makefile makes sure that
the 'third-party' is built before 'main' so that dependencies from the
other directories are built first.
When main does build, a new shared library (libasteriskpj) is created that
links statically to the pjproject .a files and exports all their symbols.
The asterisk binary links to that, just as it does with libasteriskssl.
When Asterisk is installed, the pjsua and pjsystest apps, and the pjproject
python bindings are installed in ASTDATADIR/third-party/pjproject. This
will facilitate testing, including running the testsuite which will be
updated to check that directory for the pjsua module ahead of the system
python library.
Modules should continue to depend on pjproject if they use pjproject APIs
directly. They should not care about the implementation. No changes to any
res_pjsip modules were made.
Change-Id: Ia7a60c28c2e9ba9537c5570f933c1ebcb20a3103
2016-01-19 03:54:28 +00:00
[AC_DEFINE([HAVE_CRYPT_R], [1], [Define to 1 if you have the 'crypt_r' function.])])
2013-07-03 16:32:00 +00:00
2007-05-24 22:07:50 +00:00
AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
2007-05-25 15:07:26 +00:00
if test "$PBX_CRYPTO" = "1";
2007-05-24 22:07:50 +00:00
then
2011-04-11 19:39:26 +00:00
AST_EXT_LIB_CHECK([OPENSSL], [ssl], [SSL_connect], [openssl/ssl.h], [-lcrypto])
2019-06-11 12:26:42 +00:00
AST_EXT_LIB_CHECK([OPENSSL_BIO_METHOD], [ssl], [BIO_meth_new], [openssl/ssl.h], [-lcrypto])
2007-05-24 22:07:50 +00:00
fi
2006-06-29 07:50:01 +00:00
2007-05-25 15:07:26 +00:00
if test "$PBX_OPENSSL" = "1";
then
2012-09-20 18:27:28 +00:00
AST_CHECK_OSPTK([4], [0], [0])
2007-05-25 15:07:26 +00:00
fi
2017-05-26 16:15:42 +00:00
AST_EXT_LIB_CHECK([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [2])
AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp2], [srtp_init], [srtp2/srtp.h], [], [], [], [
AC_MSG_WARN([***])
AC_MSG_WARN([*** libsrtp2 could not be linked as a shared object.])
AC_MSG_WARN([*** Try compiling libsrtp2 manually. Configure libsrtp2])
AC_MSG_WARN([*** with ./configure --prefix=/usr replacing /usr with])
AC_MSG_WARN([*** the prefix of your choice, and then make with])
AC_MSG_WARN([*** 'make libsrtp2.so'])
AC_MSG_WARN([***])
AC_MSG_WARN([*** After re-installing libsrtp2, re-run the Asterisk])
AC_MSG_WARN([*** configure script.])
AC_MSG_WARN([***])
AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
AC_MSG_WARN([*** with the --without-srtp option.])
exit 1
])
2010-06-08 05:29:08 +00:00
2017-05-26 16:15:42 +00:00
if test "x$PBX_SRTP" = x1;
2010-08-13 16:08:05 +00:00
then
2017-05-26 16:15:42 +00:00
AST_EXT_LIB_CHECK([SRTP_256], [srtp2], [srtp_crypto_policy_set_aes_cm_256_hmac_sha1_80])
2017-10-18 08:30:25 +00:00
AST_EXT_LIB_CHECK([SRTP_192], [srtp2], [srtp_crypto_policy_set_aes_cm_192_hmac_sha1_80])
2017-05-26 16:15:42 +00:00
AST_EXT_LIB_CHECK([SRTP_GCM], [srtp2], [srtp_crypto_policy_set_aes_gcm_128_8_auth])
AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp2], [srtp_shutdown], [srtp2/srtp.h])
2018-09-17 15:38:28 +00:00
AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp2], [srtp_get_version_string], [srtp2/srtp.h])
2017-05-26 16:15:42 +00:00
# libsrtp2 removed support for PRNG, so we require OpenSSL
if test "x$PBX_OPENSSL" != x1;
then
AC_MSG_WARN([***])
AC_MSG_WARN([*** OpenSSL required when using libsrtp2, checking for libsrtp instead.])
AC_MSG_WARN([***])
PBX_SRTP=0
fi
2010-08-13 16:08:05 +00:00
fi
2017-05-26 16:15:42 +00:00
if test "x$PBX_SRTP" != x1;
2016-07-13 10:24:46 +00:00
then
2017-05-26 16:15:42 +00:00
AST_EXT_LIB_CHECK([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [1])
AST_EXT_LIB_CHECK_SHARED([SRTP], [srtp], [srtp_init], [srtp/srtp.h], [], [], [], [
AC_MSG_WARN([***])
AC_MSG_WARN([*** libsrtp could not be linked as a shared object.])
AC_MSG_WARN([*** Try compiling libsrtp manually. Configure libsrtp])
AC_MSG_WARN([*** with ./configure CFLAGS=-fPIC --prefix=/usr])
AC_MSG_WARN([*** replacing /usr with the prefix of your choice.])
AC_MSG_WARN([*** After re-installing libsrtp, re-run the Asterisk])
AC_MSG_WARN([*** configure script.])
AC_MSG_WARN([***])
AC_MSG_WARN([*** If you do not need SRTP support re-run configure])
AC_MSG_WARN([*** with the --without-srtp option.])
exit 1
])
if test "x$PBX_SRTP" = x1;
then
AST_EXT_LIB_CHECK([SRTP_256], [srtp], [crypto_policy_set_aes_cm_256_hmac_sha1_80])
AST_EXT_LIB_CHECK([SRTP_192], [srtp], [crypto_policy_set_aes_cm_192_hmac_sha1_80])
AST_EXT_LIB_CHECK([SRTP_GCM], [srtp], [crypto_policy_set_aes_gcm_128_8_auth])
AST_EXT_LIB_CHECK([SRTP_SHUTDOWN], [srtp], [srtp_shutdown], [srtp/srtp.h])
2018-09-17 15:38:28 +00:00
AST_EXT_LIB_CHECK([SRTP_GET_VERSION], [srtp], [srtp_get_version_string], [srtp/srtp.h])
2017-05-26 16:15:42 +00:00
fi
2016-07-13 10:24:46 +00:00
fi
2017-08-03 18:13:01 +00:00
for ver in 2.0 2.2 2.4 2.6 3.0; do
2012-05-14 13:42:49 +00:00
AST_PKG_CONFIG_CHECK([GMIME], gmime-$ver)
if test "$PBX_GMIME" = 1; then
2011-05-16 14:38:16 +00:00
break;
2012-05-14 13:42:49 +00:00
fi
done
2008-10-01 23:48:16 +00:00
2008-08-03 16:14:14 +00:00
AST_EXT_LIB_CHECK([HOARD], [hoard], [malloc], [])
2008-06-28 21:28:16 +00:00
AST_EXT_LIB_CHECK([FREETDS], [sybdb], [dbinit], [sybdb.h])
2006-06-29 07:50:01 +00:00
2008-12-11 20:02:35 +00:00
AC_CHECK_LIB([tonezone], [tone_zone_find_by_num], tonezone_does_not_need_lm=yes, tonezone_does_not_need_lm=no)
if test "${tonezone_does_not_need_lm}" = "no" ; then
2006-07-05 19:59:34 +00:00
tonezone_extra="-lm"
2006-06-24 19:43:31 +00:00
fi
2008-07-03 16:22:02 +00:00
AST_EXT_LIB_CHECK([TONEZONE], [tonezone], [tone_zone_find], [dahdi/tonezone.h], [${tonezone_extra} ${DAHDI_INCLUDE}])
2006-07-05 19:59:34 +00:00
2018-03-16 14:53:22 +00:00
AST_EXT_LIB_CHECK([VORBIS], [vorbis], [vorbis_info_init], [vorbis/codec.h], [-lm -lvorbisenc -lvorbisfile])
2012-02-16 19:51:15 +00:00
AST_C_DECLARE_CHECK([VORBIS_OPEN_CALLBACKS], [OV_CALLBACKS_NOCLOSE], [vorbis/vorbisfile.h])
2006-06-24 19:43:31 +00:00
2008-01-28 21:07:18 +00:00
AC_LANG_PUSH(C++)
if test "${USE_VPB}" != "no"; then
AC_MSG_CHECKING(for vpb_open in -lvpb)
saved_libs="${LIBS}"
saved_cppflags="${CPPFLAGS}"
if test "x${VPB_DIR}" != "x"; then
if test -d ${VPB_DIR}/lib; then
vpblibdir=${VPB_DIR}/lib
else
vpblibdir=${VPB_DIR}
fi
LIBS="${LIBS} -L${vpblibdir}"
CPPFLAGS="${CPPFLAGS} -I${VPB_DIR}/include"
fi
2010-05-07 20:35:17 +00:00
LIBS="${PTHREAD_LIBS} ${LIBS} -lvpb"
2010-05-08 02:40:01 +00:00
CPPFLAGS="${CPPFLAGS} ${PTHREAD_CFLAGS}"
2008-01-28 21:07:18 +00:00
AC_LINK_IFELSE(
[
AC_LANG_PROGRAM(
[#include <vpbapi.h>],
[int q = vpb_open(0,0);])
],
2012-01-30 21:21:16 +00:00
[ AC_MSG_RESULT(yes)
ac_cv_lib_vpb_vpb_open="yes"
2008-01-28 21:07:18 +00:00
],
2012-01-30 21:21:16 +00:00
[ AC_MSG_RESULT(no)
ac_cv_lib_vpb_vpb_open="no"
2008-01-28 21:07:18 +00:00
]
)
LIBS="${saved_libs}"
CPPFLAGS="${saved_cppflags}"
if test "${ac_cv_lib_vpb_vpb_open}" = "yes"; then
VPB_LIB="-lvpb"
if test "${VPB_DIR}" != ""; then
VPB_LIB="-L${vpblibdir} ${VPB_LIB}"
VPB_INCLUDE="-I${VPB_DIR}/include"
fi
PBX_VPB=1
AC_DEFINE([HAVE_VPB], 1, [Define if your system has the VoiceTronix API libraries.])
fi
fi
AC_LANG_POP
2006-07-05 19:59:34 +00:00
AST_EXT_LIB_CHECK([ZLIB], [z], [compress], [zlib.h])
2006-06-24 19:43:31 +00:00
2009-09-10 18:17:14 +00:00
if test "x${PBX_UNIXODBC}" = "x1" -o "x${PBX_IODBC}" = "x1"; then
# Does ODBC support wide characters?
AC_MSG_CHECKING(whether ODBC has support for Unicode types)
AC_LINK_IFELSE(
2012-01-14 16:43:12 +00:00
[AC_LANG_PROGRAM(
2009-09-10 18:17:14 +00:00
[#include <sql.h>
#include <sqlext.h>],
2012-01-14 16:43:12 +00:00
[int foo = SQL_WCHAR])],
2009-09-10 18:17:14 +00:00
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_ODBC_WCHAR], [1], [Define to 1 if your ODBC library has wide (Unicode) types.]),
AC_MSG_RESULT(no)
)
fi
2007-07-11 17:06:54 +00:00
AC_CHECK_HEADER([linux/compiler.h],
[AC_DEFINE_UNQUOTED([HAVE_LINUX_COMPILER_H], 1, [Define to 1 if your system has linux/compiler.h.])])
2006-06-24 19:43:31 +00:00
AC_CHECK_HEADER([linux/ixjuser.h], [PBX_IXJUSER=1], [PBX_IXJUSER=0], [
#include <linux/version.h>
2007-07-11 17:06:54 +00:00
#ifdef HAVE_LINUX_COMPILER_H
2006-06-24 19:43:31 +00:00
#include <linux/compiler.h>
#endif
])
AC_SUBST(PBX_IXJUSER)
2009-12-04 04:52:24 +00:00
# Used in res/res_pktccops
AST_C_DEFINE_CHECK([MSG_NOSIGNAL], [MSG_NOSIGNAL], [sys/socket.h])
AST_C_DEFINE_CHECK([SO_NOSIGPIPE], [SO_NOSIGPIPE], [sys/socket.h])
2009-06-30 16:40:38 +00:00
AST_EXT_TOOL_CHECK([SDL], [sdl-config])
2007-11-20 15:39:00 +00:00
AST_EXT_LIB_CHECK([SDL_IMAGE], [SDL_image], [IMG_Load], [SDL_image.h], [${SDL_LIB}], [${SDL_INCLUDE}])
2010-05-07 20:35:17 +00:00
AST_EXT_LIB_CHECK([FFMPEG], [avcodec], [sws_getContext], [ffmpeg/avcodec.h], [${PTHREAD_LIBS} -lz -lm], [${PTHREAD_CFLAGS}])
2007-11-17 01:49:26 +00:00
2007-11-21 01:29:45 +00:00
# possible places for video4linux version 1
AC_CHECK_HEADER([linux/videodev.h],
[AC_DEFINE_UNQUOTED([HAVE_VIDEODEV_H], 1, [Define to 1 if your system has linux/videodev.h.])])
2007-11-21 00:22:41 +00:00
# possible places for X11
AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],,, [standard_path])
AST_EXT_LIB_CHECK([X11], [X11], [XOpenDisplay], [X11/Xlib.h],, [-I/usr/X11R6/include], [X11R6])
2010-06-21 22:41:00 +00:00
PBX_LAUNCHD=0
2008-02-19 17:33:55 +00:00
if test "${cross_compiling}" = "no";
then
2015-01-26 14:50:40 +00:00
AC_CHECK_FILE(/sbin/launchd,
[PBX_LAUNCHD=1]
AC_DEFINE([HAVE_SBIN_LAUNCHD], 1, [Define to 1 if your system has /sbin/launchd.]))
2008-02-19 17:33:55 +00:00
fi
2010-06-21 22:41:00 +00:00
AC_SUBST(PBX_LAUNCHD)
2008-02-04 21:15:18 +00:00
2012-05-14 13:42:49 +00:00
AST_PKG_CONFIG_CHECK([GTK2], [gtk+-2.0])
2007-03-15 23:56:10 +00:00
2009-01-15 20:18:53 +00:00
# build a GENERIC_ODBC result based on the presence of either UnixODBC (preferred)
# or iODBC
PBX_GENERIC_ODBC=0
if test "${PBX_UNIXODBC}" = 1; then
PBX_GENERIC_ODBC=1
GENERIC_ODBC_LIB="${UNIXODBC_LIB}"
GENERIC_ODBC_INCLUDE="${UNIXODBC_INCLUDE}"
elif test "${PBX_IODBC}" = 1; then
PBX_GENERIC_ODBC=1
GENERIC_ODBC_LIB="${IODBC_LIB}"
GENERIC_ODBC_INCLUDE="${IODBC_INCLUDE}"
fi
AC_SUBST([GENERIC_ODBC_LIB])
AC_SUBST([GENERIC_ODBC_INCLUDE])
AC_SUBST([PBX_GENERIC_ODBC])
2016-06-27 19:26:54 +00:00
AC_SUBST([PBX_SYSTEMD])
AC_SUBST([SYSTEMD_LIB])
AC_SUBST([SYSTEMD_INCLUDE])
AST_PKG_CONFIG_CHECK([SYSTEMD], [libsystemd])
2009-06-26 22:08:05 +00:00
PBX_SYSLOG=0
2009-06-26 03:06:06 +00:00
if test "${ac_cv_header_syslog_h}" = "yes"; then
# syslog facilities
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTH], [LOG_AUTH], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_AUTHPRIV], [LOG_AUTHPRIV], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_CRON], [LOG_CRON], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_DAEMON], [LOG_DAEMON], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_FTP], [LOG_FTP], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_KERN], [LOG_KERN], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_LPR], [LOG_LPR], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_MAIL], [LOG_MAIL], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_NEWS], [LOG_NEWS], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_SYSLOG], [LOG_SYSLOG], [syslog.h])
AST_C_DEFINE_CHECK([SYSLOG_FACILITY_LOG_UUCP], [LOG_UUCP], [syslog.h])
2009-06-26 22:08:05 +00:00
PBX_SYSLOG=1
2009-06-26 03:06:06 +00:00
fi
2009-06-26 22:08:05 +00:00
AC_SUBST([PBX_SYSLOG])
2010-10-03 21:09:52 +00:00
if test -f makeopts; then
2010-10-04 20:24:41 +00:00
${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak
2010-10-03 21:09:52 +00:00
else
2010-10-04 20:24:41 +00:00
touch makeopts.acbak
2010-10-03 21:09:52 +00:00
fi
2016-08-12 16:23:18 +00:00
# conf_bridge (binaural rendering): check if HRIRs are available
2019-01-23 13:59:00 +00:00
# this check does not work when cross-compiling
if test "${cross_compiling}" = "no"; then
AC_CHECK_FILES([bridges/bridge_softmix/include/hrirs.h])
fi
2016-08-12 16:23:18 +00:00
2014-07-04 15:11:51 +00:00
AC_CONFIG_FILES([build_tools/menuselect-deps makeopts])
2006-10-05 15:42:14 +00:00
AST_CHECK_MANDATORY
2008-11-04 15:07:54 +00:00
if test -f build_tools/menuselect-deps; then
# extract old values of all PBX_ variables from menuselect-deps
# and preserve them so that menuselect can determine whether
# any previously-met dependencies are no longer met and warn
# the user appropriately
while IFS="=:" read var val old_val; do
eval "PBX_${var}=\${PBX_${var}}:${val}"
done < build_tools/menuselect-deps
fi
2006-04-24 17:11:45 +00:00
AC_OUTPUT
2010-10-04 20:24:41 +00:00
${ac_cv_path_EGREP} 'CURSES|GTK2|OSARCH|NEWT' makeopts > makeopts.acbak2
2010-10-03 21:09:52 +00:00
if test "x${ac_cv_path_CMP}" = "x:"; then
2010-10-04 20:24:41 +00:00
( cd `pwd`/menuselect && ./configure )
2018-04-03 19:39:39 +00:00
elif ${ac_cv_path_CMP} -s makeopts.acbak makeopts.acbak2; then : ; else
2010-10-04 20:24:41 +00:00
( cd `pwd`/menuselect && ./configure )
2018-04-03 19:39:39 +00:00
fi
2010-10-03 21:09:52 +00:00
2010-10-04 20:24:41 +00:00
rm makeopts.acbak makeopts.acbak2
2010-10-03 21:09:52 +00:00
2006-08-14 00:08:35 +00:00
if test "x${silent}" != "xyes" ; then
2006-04-24 17:11:45 +00:00
echo
echo " .\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$=.. "
echo " .\$7\$7.. .7\$\$7:. "
echo " .\$\$:. ,\$7.7 "
echo " .\$7. 7\$\$\$\$ .\$\$77 "
echo " ..\$\$. \$\$\$\$\$ .\$\$\$7 "
echo " ..7\$ .?. \$\$\$\$\$ .?. 7\$\$\$."
echo " \$.\$. .\$\$\$7. \$\$\$\$7 .7\$\$\$. .\$\$\$."
echo " .777. .\$\$\$\$\$\$77\$\$\$77\$\$\$\$\$7. \$\$\$,"
echo " \$\$\$~ .7\$\$\$\$\$\$\$\$\$\$\$\$\$7. .\$\$\$."
echo ".\$\$7 .7\$\$\$\$\$\$\$7: ?\$\$\$."
echo "\$\$\$ ?7\$\$\$\$\$\$\$\$\$\$I .\$\$\$7 "
echo "\$\$\$ .7\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$ :\$\$\$. "
echo "\$\$\$ \$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$\$\$\$ .\$\$\$. "
echo "\$\$\$ \$\$\$ 7\$\$\$7 .\$\$\$ .\$\$\$. "
echo "\$\$\$\$ \$\$\$\$7 .\$\$\$. "
echo "7\$\$\$7 7\$\$\$\$ 7\$\$\$ "
echo " \$\$\$\$\$ \$\$\$ "
echo " \$\$\$\$7. \$\$ (TM) "
echo " \$\$\$\$\$\$\$. .7\$\$\$\$\$\$ \$\$ "
echo " \$\$\$\$\$\$\$\$\$\$\$\$7\$\$\$\$\$\$\$\$\$.\$\$\$\$\$\$ "
echo " \$\$\$\$\$\$\$\$\$\$\$\$\$\$\$\$. "
echo
2006-08-14 00:08:35 +00:00
fi
2006-04-24 17:11:45 +00:00
2013-10-08 22:33:31 +00:00
if test "x${AST_IODBC_FOUND}" = "xyes"; then
echo "WARNING: iodbc libs/headers found!"
echo
echo " If you plan to use ODBC functionality, you should consider"
echo " switching to unixodbc instead."
echo " See: https://issues.asterisk.org/jira/browse/ASTERISK-22459"
echo
fi
2006-08-14 00:08:35 +00:00
AC_MSG_NOTICE(Package configured for: )
2006-08-21 02:11:39 +00:00
AC_MSG_NOTICE( OS type : $host_os)
2006-08-14 00:08:35 +00:00
AC_MSG_NOTICE( Host CPU : $host_cpu)
2012-01-30 21:21:16 +00:00
AC_MSG_NOTICE( build-cpu:vendor:os: $build_cpu : $build_vendor : $build_os :)
AC_MSG_NOTICE( host-cpu:vendor:os: $host_cpu : $host_vendor : $host_os :)
2006-08-21 02:11:39 +00:00
if test "${cross_compiling}" = "yes"; then
2006-08-14 00:08:35 +00:00
AC_MSG_NOTICE( Cross Compilation = YES)
2006-04-24 17:11:45 +00:00
fi