Newer
Older
AC_PREREQ(2.60a)
Kevin P. Fleming
committed
AC_INIT([asterisk], [trunk], [https://issues.asterisk.org])
Kevin P. Fleming
committed
# cross-compile macros
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# check existence of the package
AC_CONFIG_SRCDIR([main/asterisk.c])
Kevin P. Fleming
committed
AC_COPYRIGHT("Asterisk")
Kevin P. Fleming
committed
# preserve any CFLAGS or LDFLAGS that may be set
# 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.
Kevin P. Fleming
committed
CONFIG_CFLAGS="${CFLAGS}"
CONFIG_LDFLAGS="${LDFLAGS}"
AC_SUBST(CONFIG_CFLAGS)
AC_SUBST(CONFIG_LDFLAGS)
# specify output header file
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
# 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.
AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD
# System default paths
AC_SUBST([astsbindir], ['${sbindir}'])dnl
AC_SUBST([astcachedir], ['${localstatedir}/cache/asterisk'])dnl
AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl
AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl
AC_SUBST([astlibdir], ['${libdir}'])dnl
AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl
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*)
Alexander Traud
committed
if test ${prefix} != 'NONE'; then
astvarlibdir='${prefix}/share/asterisk'
astdbdir='${localstatedir}/db/asterisk'
fi
;;
darwin*)
if test ${prefix} = 'NONE'; then
astvarrundir='/Library/Application Support/Asterisk/Run'
fi
;;
esac
case "${host_os}" in
netbsd*)
ac_default_prefix=/usr/pkg
CPPFLAGS=-I/usr/pkg/include
LDFLAGS=-L/usr/pkg/lib
;;
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
Russell Bryant
committed
;;
openbsd*)
if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
fi
if test ${mandir} = '${prefix}/man'; then
fi
fi
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
;;
if test ${prefix} = 'NONE'; then
astmoddir='/Library/Application Support/Asterisk/Modules'
astvarlibdir='/Library/Application Support/Asterisk'
astlogdir=/Library/Logs/Asterisk
astvarrundir='/Library/Application Support/Asterisk/Run'
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.])
solaris*)
if test ${prefix} = 'NONE'; then
astcachedir=/var/cache/asterisk
astetcdir=/var/etc/asterisk
astsbindir=/opt/asterisk/sbin
astlibdir=/opt/asterisk/lib
astmoddir=/opt/asterisk/lib/modules
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
;;
Russell Bryant
committed
*)
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
sysconfdir=/etc
fi
if test ${mandir} = '${prefix}/man'; then
mandir=/usr/share/man
fi
fi
Russell Bryant
committed
;;
esac
if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
if test ${localstatedir} = '${prefix}/var'; then
localstatedir=/var
fi
Russell Bryant
committed
fi
Kevin P. Fleming
committed
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)
Kevin P. Fleming
committed
Kevin P. Fleming
committed
PBX_WINARCH=0
Kevin P. Fleming
committed
Kevin P. Fleming
committed
case "${host_os}" in
Kevin P. Fleming
committed
OSARCH=FreeBSD
;;
Kevin P. Fleming
committed
mingw32)
OSARCH=mingw32
Kevin P. Fleming
committed
PBX_WINARCH=1
Kevin P. Fleming
committed
;;
cygwin)
OSARCH=cygwin
Kevin P. Fleming
committed
PBX_WINARCH=1
Kevin P. Fleming
committed
;;
OSARCH=linux-gnu
;;
linux-musl*)
OSARCH=linux-musl
;;
Kevin P. Fleming
committed
*)
Kevin P. Fleming
committed
;;
esac
AC_SUBST(OSARCH)
Kevin P. Fleming
committed
AC_SUBST(PBX_WINARCH)
Kevin P. Fleming
committed
George Joseph
committed
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)
Kevin P. Fleming
committed
# check for uname
AC_PATH_TOOL([UNAME], [uname], :)
if test "x${UNAME}" != "x:"; then
Kevin P. Fleming
committed
PBX_OSREV=$(${UNAME} -r)
fi
AC_SUBST(PBX_OSREV)
AH_TOP([#ifndef ASTERISK_AUTOCONFIG_H
Kevin P. Fleming
committed
#define ASTERISK_AUTOCONFIG_H
/* IWYU pragma: private, include "asterisk.h" */
Kevin P. Fleming
committed
#include "asterisk/buildopts.h" /* IWYU pragma: export */])
AH_BOTTOM([#endif /* ASTERISK_AUTOCONFIG_H */])
Kevin P. Fleming
committed
Kevin P. Fleming
committed
# cross-compile checks
if test "${cross_compiling}" = "yes";
Kevin P. Fleming
committed
then
AC_CHECK_TOOL(CC, gcc, :)
AC_CHECK_TOOL(CXX, g++, :)
AC_CHECK_TOOL(LD, ld, :)
Kevin P. Fleming
committed
AC_CHECK_TOOL(RANLIB, ranlib, :)
CROSS_COMPILING=1
AC_SUBST(CROSS_COMPILING)
Kevin P. Fleming
committed
fi
# Checks for programs.
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CXXCPP
# 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.
AST_PROG_LD # note, does not work on FreeBSD
Kevin P. Fleming
committed
AC_PROG_AWK
AC_PROG_INSTALL
Kevin P. Fleming
committed
AC_PROG_RANLIB
AST_CHECK_GNU_MAKE
Kevin P. Fleming
committed
AC_CHECK_TOOLS([STRIP], [strip gstrip], :)
AC_CHECK_TOOLS([AR], [ar gar], :)
GNU_LD=0
if test "x$with_gnu_ld" = "xyes" ; then
GNU_LD=1
fi
AC_SUBST(GNU_LD)
AC_PATH_PROG([BISON], [bison], :)
AC_PATH_PROG([CMP], [cmp], :)
AC_PATH_PROG([CAT], [cat], :)
AC_PATH_PROG([FLEX], [flex], :)
Kevin P. Fleming
committed
AC_PATH_PROG([GREP], [grep], :)
AC_PATH_PROGS([PYTHON], [python2.7 python2 python python3], :)
Kevin P. Fleming
committed
AC_PATH_PROG([FIND], [find], :)
AC_PATH_PROG([BASENAME], [basename], :)
AC_PATH_PROG([DIRNAME], [dirname], :)
AC_PATH_PROG([SHELL], [sh], :)
AC_PATH_PROG([LN], [ln], :)
Kevin P. Fleming
committed
AC_PATH_PROG([DOT], [dot], :)
AC_PATH_PROG([WGET], [wget], :)
AC_PATH_PROG([CURL], [curl], :)
AC_PATH_PROG([XMLLINT], [xmllint], :)
AC_PATH_PROGS([XMLSTARLET], [xmlstarlet xml], :)
AC_PATH_PROG([BASH], [bash], :)
AC_PATH_PROG([GIT], [git], :)
AC_PATH_PROG([ALEMBIC], [alembic], :)
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], :)
AC_PATH_PROG([REALPATH], [realpath], :)
Alexander Traud
committed
DOWNLOAD=":"
DOWNLOAD_TO_STDOUT=
DOWNLOAD_TIMEOUT=
if test "x${WGET}" != "x:"; then
DOWNLOAD_TO_STDOUT="${WGET} -q -O-"
DOWNLOAD_TIMEOUT='--timeout=$1'
elif test "x${CURL}" != "x:"; then
DOWNLOAD="${CURL} -O --progress-bar -w \"%{url_effective}\n\""
DOWNLOAD_TO_STDOUT="${CURL} -Ls"
DOWNLOAD_TIMEOUT='--max-time $(or $2,$1)'
Alexander Traud
committed
AC_PATH_PROG([FETCH], [fetch], :)
if test "x${FETCH}" != "x:"; then
Alexander Traud
committed
DOWNLOAD=${FETCH}
DOWNLOAD_TO_STDOUT="${FETCH} -o-"
DOWNLOAD_TIMEOUT='--timeout=$(or $2,$1)'
fi
AC_SUBST(DOWNLOAD_TO_STDOUT)
AC_SUBST(DOWNLOAD_TIMEOUT)
AC_PATH_PROG([LDCONFIG], [ldconfig], :)
AC_PATH_PROG([SHA1SUM], [sha1sum], $ac_aux_dir/build_tools/sha1sum-sh)
AC_PATH_PROG([OPENSSL], [openssl], :)
Kevin P. Fleming
committed
PKG_PROG_PKG_CONFIG()
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
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=:
PBX_BISON=0
else
PBX_BISON=1
fi
AC_SUBST(PBX_BISON)
if test "${FLEX}" = ":"; then
PBX_FLEX=0
else
PBX_FLEX=1
if test "${XMLSTARLET}" = ":"; then
PBX_XMLSTARLET=0
else
PBX_XMLSTARLET=1
fi
AC_SUBST(PBX_XMLSTARLET)
if test "${BASH}" = ":"; then
PBX_BASH=0
else
PBX_BASH=1
fi
AC_SUBST(PBX_BASH)
AC_CHECK_TOOL([SOXMIX], [soxmix], :)
if test "x${SOXMIX}" != "x:"; then
AC_DEFINE([HAVE_SOXMIX], 1, [Define to 1 if your system has soxmix application.])
fi
AC_CHECK_PROGS([MD5], [md5 md5sum gmd5sum digest])
if test "${MD5}" = "digest" ; then
MD5="${MD5} -a md5"
fi
AX_PTHREAD
Kevin P. Fleming
committed
AC_LANG(C)
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)
AC_ARG_ENABLE([dev-mode],
[AS_HELP_STRING([--enable-dev-mode],
[Turn on developer mode])],
Kevin P. Fleming
committed
[case "${enableval}" in
y|ye|yes) AST_DEVMODE=yes ;;
n|no) AST_DEVMODE=no ;;
Sean Bright
committed
noisy)
AST_DEVMODE=yes
NOISY_BUILD=yes
;;
strict)
AST_DEVMODE=yes
AST_DEVMODE_STRICT=yes
;;
Kevin P. Fleming
committed
*) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
esac])
Sean Bright
committed
AC_SUBST(NOISY_BUILD)
Kevin P. Fleming
committed
AC_SUBST(AST_DEVMODE)
Kevin P. Fleming
committed
AST_OPTION_ONLY([download-cache], [AST_DOWNLOAD_CACHE], [cached sound AND external module tarfiles], [])
AST_OPTION_ONLY([sounds-cache], [SOUNDS_CACHE_DIR], [cached sound tarfiles], [])
AST_OPTION_ONLY([externals-cache], [EXTERNALS_CACHE_DIR], [cached external module tarfiles], [])
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)
AST_CHECK_RAII()
AST_CHECK_STRSEP_ARRAY_BOUNDS()
JANSSON_BUNDLED=no
AC_ARG_WITH([jansson-bundled],
[AS_HELP_STRING([--with-jansson-bundled],
[Use bundled jansson library])],
[case "${withval}" in
y|ye|yes) JANSSON_BUNDLED=yes ;;
*) JANSSON_BUNDLED=no ;;
esac])
PJPROJECT_BUNDLED=yes
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],
[Use bundled pjproject libraries (default)])],
n|no) PJPROJECT_BUNDLED=no ;;
*) PJPROJECT_BUNDLED=yes ;;
esac])
if test "${with_pjproject}" = "no" || test "${with_pjproject}" = "n" ; then
PJPROJECT_BUNDLED=no
fi
#
# OpenSSL stuff has to be done here because we want to pass
# any resulting CFLAGS and LDFLAGS to the bundled pjproject
# configure done in THIRD_PARTY_CONFIGURE()
#
AST_EXT_LIB_SETUP([CRYPTO], [OpenSSL Cryptography], [crypto])
AST_EXT_LIB_SETUP([OPENSSL], [OpenSSL Secure Sockets Layer], [ssl])
AST_EXT_LIB_SETUP_OPTIONAL([OPENSSL_BIO_METHOD], [OpenSSL BIO Method Support], [CRYPTO], [crypto])
# If neither --without-ssl (PBX_OPENSSL=-1) nor --without-crypto (PBX_CRYPTO=-1)
# and there were no directories atdded to --with-ssl and --with-crypto, and
# pkg-config is installed (which is should be by install_prereq).
if test "x$PKG_CONFIG" != "x" -a $PBX_OPENSSL -ge 0 -a $PBX_CRYPTO -ge 0 -a "x$OPENSSL_DIR" = "x" ; then
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
AC_MSG_NOTICE(checking OPENSSL with pkg-config)
AC_MSG_NOTICE(checking whether system openssl > 1.1.0)
AST_PKG_CONFIG_CHECK([OPENSSL], [openssl >= 1.1.0])
if test $PBX_OPENSSL -eq 0 ; then
AC_MSG_NOTICE(checking whether alternate openssl11 is installed)
AST_PKG_CONFIG_CHECK([OPENSSL], [openssl11])
fi
if test $PBX_OPENSSL -eq 1 ; then
AC_DEFINE([HAVE_OPENSSL_BIO_METHOD], 1)
PBX_OPENSSL_BIO_METHOD=1
else
AC_MSG_NOTICE(checking fallback system openssl)
AST_PKG_CONFIG_CHECK([OPENSSL], [openssl])
fi
if test $PBX_OPENSSL -eq 1; then
AC_DEFINE([HAVE_CRYPTO], 1)
PBX_CRYPTO=1
fi
else
AC_MSG_NOTICE(Checking OPENSSL without pkg-config)
AST_EXT_LIB_CHECK([CRYPTO], [crypto], [AES_encrypt], [openssl/aes.h])
if test "$PBX_CRYPTO" = "1";
then
AST_EXT_LIB_CHECK([OPENSSL], [ssl], [SSL_connect], [openssl/ssl.h], [-lcrypto])
AST_EXT_LIB_CHECK([OPENSSL_BIO_METHOD], [ssl], [BIO_meth_new], [openssl/ssl.h], [-lcrypto])
fi
fi
if test $PBX_OPENSSL -eq 0 ; then
AC_MSG_WARN(OpenSSL does not seem to be installed)
fi
THIRD_PARTY_CONFIGURE()
# 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
# by the --with option name (the third field),
# to make things easier for the users.
Kevin P. Fleming
committed
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([ALSA], [Advanced Linux Sound Architecture], [asound])
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])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([BLUETOOTH], [Bluetooth], [bluetooth])
AST_EXT_LIB_SETUP([CAP], [POSIX 1.e capabilities], [cap])
AST_EXT_LIB_SETUP([CODEC2], [Codec 2 Audio Decoder/Encoder], [codec2])
AST_EXT_LIB_SETUP([COROSYNC], [Corosync], [cpg])
AST_EXT_LIB_SETUP_OPTIONAL([COROSYNC_CFG_STATE_TRACK], [A callback only in corosync 1.x], [COROSYNC], [cfg])
AST_EXT_LIB_SETUP([CRYPT], [password and data encryption], [crypt])
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
AST_EXT_LIB_SETUP([FFMPEG], [Ffmpeg and avcodec], [avcodec])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([GSM], [External GSM], [gsm], [, use 'internal' GSM otherwise])
AST_EXT_LIB_SETUP([ILBC], [System iLBC], [ilbc], [, use 'internal' iLBC otherwise])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([GTK2], [gtk2], [gtk2])
AST_EXT_LIB_SETUP([GMIME], [GMime], [gmime])
AST_EXT_LIB_SETUP([HOARD], [Hoard Memory Allocator], [hoard])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([ICAL], [iCal], [ical])
AST_EXT_LIB_SETUP([ICONV], [Iconv], [iconv])
AST_EXT_LIB_SETUP([IKSEMEL], [Iksemel Jabber], [iksemel])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([IMAP_TK], [UW IMAP Toolkit], [imap])
AST_EXT_LIB_SETUP([INOTIFY], [inotify support], [inotify])
AST_EXT_LIB_SETUP([IODBC], [iODBC], [iodbc])
AST_EXT_LIB_SETUP([JACK], [Jack Audio Connection Kit], [jack])
AST_EXT_LIB_SETUP([JANSSON], [Jansson JSON library], [jansson])
AST_EXT_LIB_SETUP([URIPARSER], [uriparser library], [uriparser])
AST_EXT_LIB_SETUP([KQUEUE], [kqueue support], [kqueue])
AST_EXT_LIB_SETUP([LDAP], [OpenLDAP], [ldap])
AST_LIBCURL_CHECK_CONFIG([], [7.10.1])
AST_EXT_LIB_SETUP([LIBEDIT], [NetBSD Editline library], [libedit])
AST_EXT_LIB_SETUP_OPTIONAL([LIBEDIT_IS_UNICODE], [Libedit compiled for unicode], [LIBEDIT], [libedit])
AST_EXT_LIB_SETUP([LIBXML2], [LibXML2], [libxml2])
AST_EXT_LIB_SETUP([LIBXSLT], [LibXSLT], [libxslt])
AST_EXT_LIB_SETUP_OPTIONAL([LIBXSLT_CLEANUP], [LibXSLT Library Cleanup Function], [LIBXSLT], [libxslt])
AST_EXT_LIB_SETUP([LUA], [Lua], [lua])
AC_ARG_VAR([LUA_VERSIONS],[A space separated list of target lua versions to test.])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([MYSQLCLIENT], [MySQL client], [mysqlclient])
AST_EXT_LIB_SETUP([NEON], [neon], [neon])
AST_EXT_LIB_SETUP([NEON29], [neon29], [neon29])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([NETSNMP], [Net-SNMP], [netsnmp])
AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
AST_EXT_LIB_SETUP([OGG], [OGG], [ogg])
AST_EXT_LIB_SETUP([OPENR2], [MFR2], [openr2])
AST_EXT_LIB_SETUP([OPUS], [Opus], [opus])
AST_EXT_LIB_SETUP([OPUSFILE], [Opusfile], [opusfile])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([OSPTK], [OSP Toolkit], [osptk])
AST_EXT_LIB_SETUP([PGSQL], [PostgreSQL], [postgres])
AST_EXT_LIB_SETUP([BEANSTALK], [Beanstalk Job Queue], [beanstalk])
if test "x${PBX_PJPROJECT}" != "x1" ; then
AST_EXT_LIB_SETUP([PJPROJECT], [PJPROJECT], [pjproject])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_DLG_CREATE_UAS_AND_INC_LOCK], [PJSIP Dialog Create UAS with Incremented Lock], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJ_TRANSACTION_GRP_LOCK], [PJSIP Transaction Group Lock Support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_REPLACE_MEDIA_STREAM], [PJSIP Media Stream Replacement Support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_GET_DEST_INFO], [pjsip_get_dest_info support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJ_SSL_CERT_LOAD_FROM_FILES2], [pj_ssl_cert_load_from_files2 support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EXTERNAL_RESOLVER], [PJSIP External Resolver Support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_PROTO], [PJSIP TLS Transport proto field support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_EVSUB_GRP_LOCK], [PJSIP EVSUB Group Lock support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_SESSION_REF], [PJSIP INVITE Session Reference Count support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_AUTH_CLT_DEINIT], [pjsip_auth_clt_deinit support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TSX_LAYER_FIND_TSX2], [pjsip_tsx_layer_find_tsx2 support], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_INV_ACCEPT_MULTIPLE_SDP_ANSWERS], [PJSIP INVITE Accept Multiple SDP Answers], [PJPROJECT], [pjsip])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_ENDPOINT_COMPACT_FORM], [PJSIP Compact Form Support on Endpoint], [PJPROJECT], [pjsip])
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])
AST_EXT_LIB_SETUP_OPTIONAL([PJSIP_TLS_TRANSPORT_RESTART], [PJSIP TLS Transport Restart Support], [PJPROJECT], [pjsip])
fi
AST_EXT_LIB_SETUP([POPT], [popt], [popt])
AST_EXT_LIB_SETUP([PORTAUDIO], [PortAudio], [portaudio])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([PRI], [ISDN PRI], [pri])
Richard Mudgett
committed
AST_EXT_LIB_SETUP_OPTIONAL([PRI_SETUP_ACK_INBAND], [ISDN PRI progress inband ie in SETUP ACK], [PRI], [pri])
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])
# ------------------------------------^
AST_EXT_LIB_SETUP([FFTW3], [LIBFFTW3], [fftw3])
AST_EXT_LIB_SETUP([RESAMPLE], [LIBRESAMPLE], [resample])
Dennis Guse
committed
AST_EXT_LIB_SETUP([SNDFILE], [libsndfile], [sndfile])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([SDL], [Sdl], [sdl])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([SDL_IMAGE], [Sdl Image], [SDL_image])
AST_EXT_LIB_SETUP([SPANDSP], [SPANDSP], [spandsp])
AST_EXT_LIB_SETUP([SS7], [ISDN SS7], [ss7])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([SPEEX], [Speex], [speex])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([SPEEX_PREPROCESS], [Speex preprocess routines], [speex])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([SPEEXDSP], [SpeexDSP], [speexdsp])
AST_EXT_LIB_SETUP_DEPENDENT([SPEEX_PREPROCESS], [speex_preprocess_ctl], [], [speex])
AST_EXT_LIB_SETUP([SQLITE3], [SQLite], [sqlite3])
AST_EXT_LIB_SETUP([SRTP], [Secure RTP], [srtp])
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])
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_SHUTDOWN], [SRTP Library Shutdown Function], [SRTP], [srtp])
AST_EXT_LIB_SETUP_OPTIONAL([SRTP_GET_VERSION], [SRTP Library Version Function], [SRTP], [srtp])
AST_EXT_LIB_SETUP_OPTIONAL([RT], [Realtime functions], [rt])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([FREETDS], [FreeTDS], [tds])
AST_EXT_LIB_SETUP([TIMERFD], [timerfd], [timerfd])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([TONEZONE], [tonezone], [tonezone])
Joshua Colp
committed
AST_EXT_LIB_SETUP([UNBOUND], [unbound], [unbound])
AST_EXT_LIB_SETUP([UNIXODBC], [unixODBC], [unixodbc])
Kevin P. Fleming
committed
AST_EXT_LIB_SETUP([VORBIS], [Vorbis], [vorbis])
Tilghman Lesher
committed
AST_EXT_LIB_SETUP([X11], [X11], [x11])
AST_EXT_LIB_SETUP([ZLIB], [zlib compression], [z])
Kevin P. Fleming
committed
# check for basic system features and functionality before
# checking for package libraries
Kevin P. Fleming
committed
AC_FUNC_ALLOCA
AC_HEADER_DIRENT
if test -z $ac_header_dirent -o "$ac_header_dirent" = "no"; then
AC_MSG_ERROR([*** Could not find dirent header that defines 'DIR'.])
fi
Kevin P. Fleming
committed
AC_HEADER_SYS_WAIT
if test "$ac_cv_header_sys_wait_h" != "yes"; then
AC_MSG_ERROR([*** POSIX.1 compatible sys/wait.h is required.])
fi
Alexander Traud
committed
AC_HEADER_RESOLV
if test "$ac_cv_header_resolv_h" != "yes"; then
AC_MSG_ERROR([*** resolv.h is required.])
fi
# 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 \
Alexander Traud
committed
inttypes.h limits.h locale.h math.h pwd.h netinet/in.h regex.h \
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])
Kevin P. Fleming
committed
Alexander Traud
committed
# 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
Alexander Traud
committed
AST_C_COMPILE_CHECK([LIBEDIT_IS_UNICODE], [el_rfunc_t *callback;], [histedit.h], [], [Testing for libedit unicode support])
# Find required UUID support.
# * -luuid on Linux
# * -le2fs-uuid on OpenBSD
# * in libsystem on OS X
AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h])
if test "x$LIBUUID_LIB" != "x" ; then
UUID_INCLUDE="$LIBUUID_INCLUDE"
UUID_LIB="$LIBUUID_LIB"
else
AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h])
Alexander Traud
committed
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
AC_SUBST(UUID_INCLUDE)
AC_SUBST(UUID_LIB)
# Find required JSON support if bundled is not enabled.
if test "$JANSSON_BUNDLED" = "no" ; then
AST_PKG_CONFIG_CHECK([JANSSON], [jansson >= 2.11])
# json_sprintf is available in 2.11+
AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_sprintf], [jansson.h])
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
JANSSON_DEFINE_JSON_INT()
fi
# See if clock_gettime is in librt
AST_EXT_LIB_CHECK([RT], [rt], [clock_gettime], [])
AST_PKG_CONFIG_CHECK([LIBXML2], [libxml-2.0])
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.)
AST_EXT_LIB_CHECK([URIPARSER], [uriparser], [uriParseUriA], [uriparser/Uri.h])
# Another mandatory item (unless it's explicitly disabled)
AC_ARG_ENABLE([xmldoc],
[AS_HELP_STRING([--disable-xmldoc],
[Explicitly disable XML documentation])],
y|ye|yes) DISABLE_XMLDOC=no ;;
n|no) DISABLE_XMLDOC=yes ;;
*) AC_MSG_ERROR(bad value ${enableval} for --disable-xmldoc) ;;
AC_SUBST([DISABLE_XMLDOC])
if test "${DISABLE_XMLDOC}" != "yes"; then
AC_DEFINE([AST_XML_DOCS], 1, [Define to enable XML documentation.])
AST_EXT_LIB_CHECK([LIBXSLT], [xslt], [xsltLoadStylesheetPI], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
AST_EXT_LIB_CHECK([LIBXSLT_CLEANUP], [xslt], [xsltCleanupGlobals], [libxslt/xsltInternals.h], [${LIBXML2_LIB}], [${LIBXML2_INCLUDE}])
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
# some embedded systems omit internationalization (locale) support
AC_CHECK_HEADERS([xlocale.h])
AC_CHECK_HEADERS([winsock.h winsock2.h])
AC_CHECK_HEADER([sys/poll.h],
[],
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.]))
Kevin P. Fleming
committed
AC_SYS_LARGEFILE
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
Tilghman Lesher
committed
AC_TYPE_LONG_DOUBLE_WIDER
Kevin P. Fleming
committed
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_CHECK_MEMBERS([struct stat.st_blksize])
AC_CHECK_MEMBERS([struct ucred.uid, struct ucred.cr_uid, struct sockpeercred.uid], [], [], [#include <sys/types.h>
#include <sys/socket.h> ])
AC_CHECK_MEMBERS([struct ifreq.ifr_ifru.ifru_hwaddr], [], [], [#include <net/if.h>])
Kevin P. Fleming
committed
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_CHECK_TYPES([ptrdiff_t])
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
Kevin P. Fleming
committed
# Checks for library functions.
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
Kevin P. Fleming
committed
AST_FUNC_FORK
Kevin P. Fleming
committed
AC_FUNC_FSEEKO
AC_PROG_GCC_TRADITIONAL
# 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
Kevin P. Fleming
committed
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
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])
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)
)
Kevin P. Fleming
committed
Tilghman Lesher
committed
# 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.
Tilghman Lesher
committed
# BSD might not have exp2, and/or log2
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])
Tilghman Lesher
committed
# 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
Joshua Colp
committed
AC_MSG_CHECKING(for LLONG_MAX in limits.h)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <limits.h>],
[long long foo = LLONG_MAX])],
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)
)
Joshua Colp
committed
AC_MSG_CHECKING(for timersub in time.h)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <sys/time.h>],
[struct timeval *a; timersub(a, a, a);])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_TIMERSUB], 1, [Define to 1 if your system defines timersub.]),
AC_MSG_RESULT(no)
)
AC_MSG_CHECKING(for a version of GNU ld that supports the --dynamic-list flag)
old_LDFLAGS=${LDFLAGS}
cat >conftest.dynamics <<_ACEOF
{
*ast_*;
};
_ACEOF
LDFLAGS="${LDFLAGS} -Wl,--dynamic-list,conftest.dynamics"
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([], [])],
PBX_DYNAMIC_LIST=1
AC_MSG_RESULT(yes),
AC_MSG_RESULT(no)
)
AC_SUBST(PBX_DYNAMIC_LIST)
LDFLAGS=${old_LDFLAGS}
AC_CHECK_HEADER([sys/poll.h],
Russell Bryant
committed
[HAS_POLL=1]
AC_DEFINE([HAVE_SYS_POLL_H], 1, [Define to 1 if your system has working sys/poll.h]),
)
AC_ARG_ENABLE([internal-poll],
[AS_HELP_STRING([--enable-internal-poll],
[Use Asterisk's poll implementation])],
[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])
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)
AC_CHECK_FUNCS([inet_aton])
# check if we have IP_PKTINFO constant defined
Joshua Colp
committed
AC_MSG_CHECKING(for IP_PKTINFO)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <netinet/in.h>],
[int pi = IP_PKTINFO;])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_PKTINFO], 1, [Define to 1 if your system defines IP_PKTINFO.]),
AC_MSG_RESULT(no)
)
# NetBSD libc ships with an internal-only incompatible symbol gethostbyname_r
AC_CHECK_DECLS([gethostbyname_r],
[have_gethostbyname_r_public_declaration=yes],
[have_gethostbyname_r_public_declaration=no],
[#include <stdlib.h>
#include <netdb.h>]
if test "x$have_gethostbyname_r_public_declaration" = "xyes"; then
# some systems already have gethostbyname_r so we don't need to build ours in main/utils.c
AC_SEARCH_LIBS(gethostbyname_r, [socket nsl])
AC_MSG_CHECKING(for gethostbyname_r with 6 arguments)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([#include <stdlib.h>
#include <netdb.h>],
[struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (struct hostent **)NULL, (int *)NULL);])],
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(
[AC_LANG_PROGRAM([#include <stdlib.h>
#include <netdb.h>],
[struct hostent *he = gethostbyname_r((const char *)NULL, (struct hostent *)NULL, (char *)NULL, (int)0, (int *)NULL);])],
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)
)
fi
Joshua Colp
committed
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(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = __swap16(a);])],
Joshua Colp
committed
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(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <sys/endian.h>], [int a = 1; int b = bswap16(a);])],
Joshua Colp
committed
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)
)