Newer
Older
David M. Lee
committed
AST_GCC_ATTRIBUTE(constructor)
AST_GCC_ATTRIBUTE(destructor)
Joshua Colp
committed
AC_MSG_CHECKING(for -ffunction-sections support)
saved_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -ffunction-sections"
AC_COMPILE_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[saved_LDFLAGS="${LDFLAGS}"]
[LDFLAGS="${LDFLAGS} -Wl,--gc-sections"]
Joshua Colp
committed
AC_MSG_CHECKING(for --gc-sections support)
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([], [int x = 1;])],
AC_MSG_RESULT(yes)
[GC_CFLAGS="-ffunction-sections"]
[[GC_LDFLAGS="-Wl,--gc-sections"]],
AC_MSG_RESULT(no)
)
[LDFLAGS="${saved_LDFLAGS}"],
AC_MSG_RESULT(no)
)
CFLAGS="${saved_CFLAGS}"
AC_SUBST(GC_CFLAGS)
AC_SUBST(GC_LDFLAGS)
AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
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)
AC_MSG_CHECKING(for -Wtrampolines support)
if $(${CC} -Wtrampolines -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
AC_MSG_RESULT(yes)
AST_TRAMPOLINES=-Wtrampolines
else
AC_MSG_RESULT(no)
AST_TRAMPOLINES=
fi
AC_SUBST(AST_TRAMPOLINES)
AC_MSG_CHECKING(for _FORTIFY_SOURCE support)
if $(${CC} -D_FORTIFY_SOURCE=2 -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
AC_MSG_RESULT(yes)
AST_FORTIFY_SOURCE=-D_FORTIFY_SOURCE=2
else
AC_MSG_RESULT(no)
AST_FORTIFY_SOURCE=
fi
AC_SUBST(AST_FORTIFY_SOURCE)
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
Sean Bright
committed
AC_MSG_RESULT(yes)
AST_NO_STRICT_OVERFLOW=-fno-strict-overflow
else
AC_MSG_RESULT(no)
AST_NO_STRICT_OVERFLOW=
fi
AC_SUBST(AST_NO_STRICT_OVERFLOW)
Sean Bright
committed
AC_MSG_CHECKING(for -Wshadow)
if $(${CC} -Wshadow -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
AC_MSG_RESULT(yes)
AST_SHADOW_WARNINGS=-Wshadow
else
AC_MSG_RESULT(no)
AST_SHADOW_WARNINGS=
fi
AC_SUBST(AST_SHADOW_WARNINGS)
AC_MSG_CHECKING(for -march=native support)
if $(${CC} -march=native -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
if test "${CONFIG_CFLAGS}" = ""; then
AC_MSG_RESULT(yes)
AST_NATIVE_ARCH=1
else
AC_MSG_RESULT(user CFLAGS present)
AST_NATIVE_ARCH=
fi
AC_SUBST(AST_NATIVE_ARCH)
dnl Nested functions required for RAII implementation
AC_MSG_CHECKING(for -fnested-functions)
AC_COMPILE_IFELSE(
dnl Prototype needed due to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36774
[AC_LANG_PROGRAM([], [auto void foo(void); void foo(void) {}])],
AC_MSG_RESULT(no)
[AST_NESTED_FUNCTIONS=],
AC_MSG_RESULT(required)
[AST_NESTED_FUNCTIONS=-fnested-functions]
)
AC_SUBST(AST_NESTED_FUNCTIONS)
dnl Check to see if rpath should be set in LDFLAGS
AC_ARG_ENABLE(rpath,
[AC_HELP_STRING([--disable-rpath],
[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=
if test "${check_rpath}" != yes; then
AC_MSG_RESULT(skipped)
elif test "${prefix}" = /usr || test "${prefix}" = NONE; then
AC_MSG_RESULT(not needed)
else
fi
AC_SUBST(AST_RPATH)
AC_MSG_CHECKING(for sysinfo)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#include <sys/sysinfo.h>],
[struct sysinfo sys_info; int uptime = sys_info.uptime])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_SYSINFO], 1, [Define to 1 if your system has sysinfo support]),
AC_MSG_RESULT(no)
)
AC_SEARCH_LIBS(res_9_ninit, resolv)
Joshua Colp
committed
AC_MSG_CHECKING(for res_ninit)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([
#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>],
Kevin P. Fleming
committed
[int foo = res_ninit(NULL);])],
AC_MSG_RESULT(yes)
AC_DEFINE([HAVE_RES_NINIT], 1, [Define to 1 if your system has the re-entrant resolver functions.])
AC_SEARCH_LIBS(res_9_ndestroy, resolv)
AC_MSG_CHECKING(for res_ndestroy)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([
#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>],
Kevin P. Fleming
committed
[res_ndestroy(NULL);])],
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)
)
AC_SEARCH_LIBS(res_9_close, resolv)
AC_MSG_CHECKING(for res_close)
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([
#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>],
Kevin P. Fleming
committed
[res_close();])],
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)
AC_MSG_RESULT(no)
)
AST_C_DEFINE_CHECK([GLOB_NOMAGIC], [GLOB_NOMAGIC], [glob.h])
AST_C_DEFINE_CHECK([GLOB_BRACE], [GLOB_BRACE], [glob.h])
David M. Lee
committed
AST_C_DEFINE_CHECK([RTLD_NOLOAD], [RTLD_NOLOAD], [dlfcn.h])
AST_C_DEFINE_CHECK([IP_MTU_DISCOVER], [IP_MTU_DISCOVER], [netinet/in.h])
Kevin P. Fleming
committed
AC_CHECK_HEADER([libkern/OSAtomic.h],
[AC_DEFINE_UNQUOTED([HAVE_OSX_ATOMICS], 1, [Define to 1 if OSX atomic operations are supported.])])
Tilghman Lesher
committed
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_CHECK_SIZEOF([long long])
AC_CHECK_SIZEOF([char *])
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]]])
else if test $ac_cv_sizeof_long = $ac_cv_sizeof_fd_set_fds_bits; then
AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
else if test $ac_cv_sizeof_long_long = $ac_cv_sizeof_fd_set_fds_bits; then
AC_DEFINE([TYPEOF_FD_SET_FDS_BITS], [long long], [Define to a type of the same size as fd_set.fds_bits[[0]]])
fi ; fi ; fi
AC_MSG_CHECKING(for dladdr in dlfcn.h)
PBX_DLADDR=0
old_LIBS=${LIBS}
LIBS="${LIBS} -ldl"
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM([#define _GNU_SOURCE 1
#include <dlfcn.h>],
[dladdr((void *)0, (void *)0)]
Kevin P. Fleming
committed
)],
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}
# PKGCONFIG is used in later tests
Kevin P. Fleming
committed
Kevin P. Fleming
committed
# do the package library checks now
Kevin P. Fleming
committed
Kevin P. Fleming
committed
AST_EXT_LIB_CHECK([ALSA], [asound], [snd_spcm_init], [alsa/asoundlib.h], [-lm -ldl])
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_openr], [bfd.h])
if test "${PBX_BFD}" = "0"; then
# Fedora/RedHat/CentOS require extra libraries
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty])
fi
if test "${PBX_BFD}" = "0"; then
# openSUSE requires -lz
AST_EXT_LIB_CHECK([BFD], [bfd], [bfd_check_format], [bfd.h], [-ldl -liberty -lz])
fi
if test "x${OSARCH}" = "xlinux-gnu" ; then
AST_EXT_LIB_CHECK([CAP], [cap], [cap_from_text], [sys/capability.h])
fi
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])
AST_C_DEFINE_CHECK([DAHDI_HALF_FULL], [DAHDI_POLICY_HALF_FULL], [dahdi/user.h])
AST_C_COMPILE_CHECK([DAHDI_LINEREVERSE_VMWI], [struct dahdi_vmwi_info booger], [dahdi/user.h], , [enhanced dahdi vmwi support])
Kevin P. Fleming
committed
AST_C_COMPILE_CHECK([DAHDI_ECHOCANCEL_FAX_MODE], [int foo = DAHDI_ECHOCANCEL_FAX_MODE], [dahdi/user.h])
AST_C_COMPILE_CHECK([GETIFADDRS], [struct ifaddrs *p; getifaddrs(&p)], [ifaddrs.h], , [getifaddrs() support])
AST_C_COMPILE_CHECK([TIMERFD], [timerfd_create(0,0); timerfd_settime(0,0,NULL,NULL);], [sys/timerfd.h], , [timerfd support])
Kevin P. Fleming
committed
GSM_INTERNAL="yes"
AC_SUBST(GSM_INTERNAL)
Kevin P. Fleming
committed
GSM_SYSTEM="yes"
Kevin P. Fleming
committed
if test "${USE_GSM}" != "no"; then
if test "${GSM_DIR}" = "internal"; then
GSM_SYSTEM="no"
elif test "${GSM_DIR}" != ""; then
GSM_INTERNAL="no"
fi
Kevin P. Fleming
committed
if test "${GSM_SYSTEM}" = "yes"; then
Russell Bryant
committed
gsmlibdir=""
if test "x${GSM_DIR}" != "x"; then
if test -d ${GSM_DIR}/lib; then
gsmlibdir="-L${GSM_DIR}/lib"
else
gsmlibdir="-L${GSM_DIR}"
fi
Kevin P. Fleming
committed
AC_CHECK_LIB([gsm], [gsm_create], AC_DEFINE_UNQUOTED([HAVE_GSM], 1,
Russell Bryant
committed
[Define to indicate the GSM library]), [], ${gsmlibdir})
Kevin P. Fleming
committed
if test "${ac_cv_lib_gsm_gsm_create}" = "yes"; then
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
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
else
if 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
fi
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
Kevin P. Fleming
committed
fi
fi
if test "${GSM_INTERNAL}" = "yes"; then
Kevin P. Fleming
committed
PBX_GSM=1
AC_DEFINE_UNQUOTED([HAVE_GSM_HEADER], 1, [Define to indicate that gsm.h has no prefix for its location])
Kevin P. Fleming
committed
fi
fi
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)
if test "$PBX_ILBC" = "1"; then
ILBC_INTERNAL="no"
fi
fi
if test "${ILBC_INTERNAL}" = "yes"; then
PBX_ILBC=1
fi
fi
LIBEDIT_INTERNAL="yes"
AC_SUBST(LIBEDIT_INTERNAL)
LIBEDIT_SYSTEM="yes"
if test "${USE_LIBEDIT}" != "no"; then
if test "${LIBEDIT_DIR}" = "internal"; then
LIBEDIT_SYSTEM="no"
elif test "${LIBEDIT_DIR}" != ""; then
LIBEDIT_INTERNAL="no"
fi
if test "${LIBEDIT_SYSTEM}" = "yes"; then
AST_PKG_CONFIG_CHECK(LIBEDIT, libedit)
if test "$PBX_LIBEDIT" = "1"; then
LIBEDIT_INTERNAL="no"
fi
fi
if test "${LIBEDIT_INTERNAL}" = "yes"; then
PBX_LIBEDIT=1
fi
fi
AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])
# 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])
# Some versions of Linux package iconv in glibc
AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h])
# If ical.h is NOT in the libical directory, then it is of a version insufficient for us.
Tilghman Lesher
committed
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
Kevin P. Fleming
committed
AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
Kevin P. Fleming
committed
Kevin P. Fleming
committed
if test "${USE_IMAP_TK}" != "no"; then
saved_cppflags="${CPPFLAGS}"
saved_libs="${LIBS}"
switch_to_system_on_failure="no"
Mark Michelson
committed
if test "${IMAP_TK_DIR}" = ""; then
IMAP_TK_DIR=`pwd`"/../imap-2004g"
switch_to_system_on_failure="yes"
Mark Michelson
committed
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(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
if test "${ac_cv_imap_tk}" = "no"; then
Mark Michelson
committed
AC_MSG_RESULT(no)
if test "${switch_to_system_on_failure}" = "yes"; then
IMAP_TK_DIR="system"
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"
imap_ldflags="-L${IMAP_TK_DIR}/lib"
imap_libs="-lc-client"
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} ${imap_ldflags}"
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
[#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);
]
Kevin P. Fleming
committed
)],
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
[#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);
]
Kevin P. Fleming
committed
)],
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
Mark Michelson
committed
fi
fi
Mark Michelson
committed
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...])
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
Mark Michelson
committed
imap_ldflags=""
imap_libs="-lc-client"
imap_include="-DUSE_SYSTEM_IMAP" #Try the imap directory first
CPPFLAGS="${CPPFLAGS} ${imap_include}"
LIBS="${LIBS} ${imap_libs} "`echo ${imap_ldflags}`
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
else #looking in imap directory didn't work, try c-client
imap_ldflags=""
imap_libs="-lc-client"
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(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk="yes"],
[ac_cv_imap_tk="no"]
)
if test "${ac_cv_imap_tk}" = "yes"; then
AC_LINK_IFELSE(
Kevin P. Fleming
committed
[AC_LANG_PROGRAM(
Mark Michelson
committed
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
[#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);
]
Kevin P. Fleming
committed
)],
Mark Michelson
committed
[ac_cv_imap_tk2006="yes"],
[ac_cv_imap_tk2006="no"]
)
fi
fi
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.])
Mark Michelson
committed
fi
AC_MSG_RESULT(no)
Mark Michelson
committed
fi
CPPFLAGS="${saved_cppflags}"
LIBS="${saved_libs}"
Kevin P. Fleming
committed
fi
Kevin P. Fleming
committed
Tilghman Lesher
committed
AST_EXT_LIB_CHECK([IODBC], [iodbc], [SQLConnect], [sql.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
AST_EXT_LIB_CHECK([INOTIFY], [c], [inotify_init], [sys/inotify.h])
AST_EXT_LIB_CHECK([JACK], [jack], [jack_activate], [jack/jack.h])
# 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])
# Needed by unixodbc
AST_EXT_LIB_CHECK([LTDL], [ltdl], [lt_dlinit], [ltdl.h], [])
Jason Parker
committed
AST_EXT_LIB_CHECK([LDAP], [ldap], [ldap_initialize], [ldap.h])
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])
AST_C_DEFINE_CHECK([MISDN_FAC_RESULT], [Fac_RESULT], [mISDNuser/suppserv.h])
AST_C_DEFINE_CHECK([MISDN_FAC_ERROR], [Fac_ERROR], [mISDNuser/suppserv.h])
AC_CHECK_HEADER([linux/mISDNdsp.h], [AC_DEFINE_UNQUOTED([MISDN_1_2], 1, [Build chan_misdn for mISDN 1.2 or later.])])
AC_CHECK_MEMBER([Q931_info_t.redirect_dn], [], [PBX_MISDN=0], [#include <mISDNuser/mISDNlib.h>])
AST_EXT_TOOL_CHECK([MYSQLCLIENT], [mysql_config])
Kevin P. Fleming
committed
AST_EXT_LIB_CHECK([NBS], [nbs], [nbs_connect], [nbs.h])
Kevin P. Fleming
committed
AST_EXT_TOOL_CHECK([NEON], [neon-config])
AST_EXT_TOOL_CHECK([NEON29], [neon-config], , [--libs],
[#include <ne_auth.h>],
[#ifndef NE_AUTH_NTLM
#error Need libneon >= 0.29.0
#endif])
AST_EXT_TOOL_CHECK([NETSNMP], [net-snmp-config], , [--agent-libs],
[#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)])
Kevin P. Fleming
committed
Kevin P. Fleming
committed
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
AST_EXT_LIB_CHECK([UNIXODBC], [odbc], [SQLConnect], [sql.h], [])
Kevin P. Fleming
committed
AST_EXT_LIB_CHECK([OGG], [ogg], [ogg_sync_init], [])
Tilghman Lesher
committed
# Non-glibc platforms require libexecinfo for backtrace support
AST_EXT_LIB_CHECK([BKTR], [execinfo], [backtrace], [execinfo.h])
Tilghman Lesher
committed
# Linux, however, has backtrace directly in glibc
AST_EXT_LIB_CHECK([BKTR], [c], [backtrace], [execinfo.h])
AST_EXT_LIB_CHECK([BLUETOOTH], [bluetooth], [ba2str], [bluetooth/bluetooth.h])
# 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])
Kevin P. Fleming
committed
Kevin P. Fleming
committed
PG_CONFIG=No
if test "${USE_PGSQL}" != "no"; then
Kevin P. Fleming
committed
if test "x${PGSQL_DIR}" != "x"; then
AC_PATH_TOOL([PG_CONFIG], [pg_config], No, [${PGSQL_DIR}/bin])
Kevin P. Fleming
committed
if test x"${PG_CONFIG}" = xNo; then
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])
Kevin P. Fleming
committed
exit 1
fi
else
AC_PATH_TOOL([PG_CONFIG], [pg_config], No)
fi
fi
Kevin P. Fleming
committed
if test "${PG_CONFIG}" != No; then
PGSQL_libdir=`${PG_CONFIG} --libdir`